@tanagram/lore 0.1.157 → 0.1.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -5
- package/package.json +4 -4
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 VYe=Object.create;var lM=Object.defineProperty;var YYe=Object.getOwnPropertyDescriptor;var KYe=Object.getOwnPropertyNames;var JYe=Object.getPrototypeOf,ZYe=Object.prototype.hasOwnProperty;var Fe=(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,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var F=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},$s=(e,t)=>{for(var n in t)lM(e,n,{get:t[n],enumerable:!0})},ide=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of KYe(t))!ZYe.call(e,o)&&o!==n&&lM(e,o,{get:()=>t[o],enumerable:!(r=YYe(t,o))||r.enumerable});return e};var se=(e,t,n)=>(n=e!=null?VYe(JYe(e)):{},ide(t||!e||!e.__esModule?lM(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>ide(lM({},"__esModule",{value:!0}),e);var A=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.157"}}catch{}})()});var lg,z$=O(()=>{A();lg="1.9.1"});function WYe(e){let t=new Set([e]),n=new Set,r=e.match(ude);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(l){return l===e};function i(c){return n.add(c),!1}function s(c){return t.add(c),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(ude);if(!f)return i(l);let h={major:+f[1],minor:+f[2],patch:+f[3],prerelease:f[4]};return h.prerelease!=null||o.major!==h.major?i(l):o.major===0?o.minor===h.minor&&o.patch<=h.patch?s(l):i(l):o.minor<=h.minor?s(l):i(l)}}var ude,cde,lde=O(()=>{A();z$();ude=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;cde=WYe(lg)});function mm(e,t,n,r=!1){var o;let i=sB[iB]=(o=sB[iB])!==null&&o!==void 0?o:{version:lg};if(!r&&i[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(i.version!==lg){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${lg}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${lg}.`),!0}function xl(e){var t,n;let r=(t=sB[iB])===null||t===void 0?void 0:t.version;if(!(!r||!cde(r)))return(n=sB[iB])===null||n===void 0?void 0:n[e]}function Am(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${lg}.`);let n=sB[iB];n&&delete n[e]}var XYe,iB,sB,By=O(()=>{A();z$();lde();XYe=lg.split(".")[0],iB=Symbol.for(`opentelemetry.js.api.${XYe}`),sB=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function aB(e,t,n){let r=xl("diag");if(r)return r[e](t,...n)}var dM,dde=O(()=>{A();By();dM=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return aB("debug",this._namespace,t)}error(...t){return aB("error",this._namespace,t)}info(...t){return aB("info",this._namespace,t)}warn(...t){return aB("warn",this._namespace,t)}verbose(...t){return aB("verbose",this._namespace,t)}}});var ys,pM=O(()=>{A();(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"})(ys||(ys={}))});function pde(e,t){e<ys.NONE?e=ys.NONE:e>ys.ALL&&(e=ys.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",ys.ERROR),warn:n("warn",ys.WARN),info:n("info",ys.INFO),debug:n("debug",ys.DEBUG),verbose:n("verbose",ys.VERBOSE)}}var fde=O(()=>{A();pM()});var eKe,qs,Ny=O(()=>{A();dde();fde();pM();By();eKe="diag",qs=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=xl("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:ys.INFO})=>{var s,c,l;if(o===n){let y=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=y.stack)!==null&&s!==void 0?s:y.message),!1}typeof i=="number"&&(i={logLevel:i});let f=xl("diag"),h=pde((c=i.logLevel)!==null&&c!==void 0?c:ys.INFO,o);if(f&&!i.suppressOverrideMessage){let y=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${y}`),h.warn(`Current logger will overwrite one already registered from ${y}`)}return mm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Am(eKe,n)},n.createComponentLogger=o=>new dM(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var fM,mde=O(()=>{A();fM=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 Ade,gde=O(()=>{A();Ade=Symbol("BaggageEntryMetadata")});function hde(e={}){return new fM(new Map(Object.entries(e)))}function _de(e){return typeof e!="string"&&(tKe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Ade,toString(){return e}}}var tKe,j$=O(()=>{A();Ny();mde();gde();tKe=qs.instance()});function Dl(e){return Symbol.for(e)}var H$,Wb,uB=O(()=>{A();H$=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}}},Wb=new H$});var $$,q$,mM,Ede=O(()=>{A();$$=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],q$={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(q$[t]=console[t])}mM=class{constructor(){function t(n){return function(...r){let o=q$[n];if(typeof o!="function"&&(o=q$.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<$$.length;n++)this[$$[n].n]=t($$[n].c)}}});function yde(){return t9}var V$,Xb,Y$,K$,J$,Z$,cB,W$,X$,e9,t9,nKe,rKe,oKe,iKe,sKe,aKe,uKe,n9=O(()=>{A();V$=class{constructor(){}createGauge(t,n){return rKe}createHistogram(t,n){return oKe}createCounter(t,n){return nKe}createUpDownCounter(t,n){return iKe}createObservableGauge(t,n){return aKe}createObservableCounter(t,n){return sKe}createObservableUpDownCounter(t,n){return uKe}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},Xb=class{},Y$=class extends Xb{add(t,n){}},K$=class extends Xb{add(t,n){}},J$=class extends Xb{record(t,n){}},Z$=class extends Xb{record(t,n){}},cB=class{addCallback(t){}removeCallback(t){}},W$=class extends cB{},X$=class extends cB{},e9=class extends cB{},t9=new V$,nKe=new Y$,rKe=new J$,oKe=new Z$,iKe=new K$,sKe=new W$,aKe=new X$,uKe=new e9});var AM,Sde=O(()=>{A();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(AM||(AM={}))});var gM,hM,r9=O(()=>{A();gM={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},hM={set(e,t,n){e!=null&&(e[t]=n)}}});var _M,Tde=O(()=>{A();uB();_M=class{active(){return Wb}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var o9,cKe,gm,lB=O(()=>{A();Tde();By();Ny();o9="context",cKe=new _M,gm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return mm(o9,t,qs.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 xl(o9)||cKe}disable(){this._getContextManager().disable(),Am(o9,qs.instance())}}});var Ja,i9=O(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Ja||(Ja={}))});var dB,Oy,EM,yM=O(()=>{A();i9();dB="0000000000000000",Oy="00000000000000000000000000000000",EM={traceId:Oy,spanId:dB,traceFlags:Ja.NONE}});var hm,SM=O(()=>{A();yM();hm=class{constructor(t=EM){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 TM(e){return e.getValue(s9)||void 0}function Ide(){return TM(gm.getInstance().active())}function pB(e,t){return e.setValue(s9,t)}function bde(e){return e.deleteValue(s9)}function Cde(e,t){return pB(e,new hm(t))}function IM(e){var t;return(t=TM(e))===null||t===void 0?void 0:t.spanContext()}var s9,a9=O(()=>{A();uB();SM();lB();s9=Dl("OpenTelemetry Context Key SPAN")});function vde(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(bM[e.charCodeAt(r)]|0)+(bM[e.charCodeAt(r+1)]|0)+(bM[e.charCodeAt(r+2)]|0)+(bM[e.charCodeAt(r+3)]|0);return n===t}function u9(e){return vde(e,32)&&e!==Oy}function c9(e){return vde(e,16)&&e!==dB}function dg(e){return u9(e.traceId)&&c9(e.spanId)}function Rde(e){return new hm(e)}var bM,CM=O(()=>{A();yM();SM();bM=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 lKe(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 l9,eC,d9=O(()=>{A();lB();a9();SM();CM();l9=gm.getInstance(),eC=class{startSpan(t,n,r=l9.active()){if(!!n?.root)return new hm;let i=r&&IM(r);return lKe(i)&&dg(i)?new hm(i):new hm}startActiveSpan(t,n,r,o){let i,s,c;if(arguments.length<2)return;arguments.length===2?c=n:arguments.length===3?(i=n,c=r):(i=n,s=r,c=o);let l=s??l9.active(),f=this.startSpan(t,i,l),h=pB(l,f);return l9.with(h,c,void 0,f)}}});var dKe,tC,p9=O(()=>{A();d9();dKe=new eC,tC=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):dKe}}});var vM,xde=O(()=>{A();d9();vM=class{getTracer(t,n,r){return new eC}}});var pKe,wy,f9=O(()=>{A();p9();xde();pKe=new vM,wy=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new tC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:pKe}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 RM,Dde=O(()=>{A();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(RM||(RM={}))});var co,Bde=O(()=>{A();(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"})(co||(co={}))});var di,Nde=O(()=>{A();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(di||(di={}))});function Ode(e){return AKe.test(e)}function wde(e){return gKe.test(e)&&!hKe.test(e)}var m9,fKe,mKe,AKe,gKe,hKe,kde=O(()=>{A();m9="[_0-9a-z-*/]",fKe=`[a-z]${m9}{0,255}`,mKe=`[a-z0-9]${m9}{0,240}@[a-z]${m9}{0,13}`,AKe=new RegExp(`^(?:${fKe}|${mKe})$`),gKe=/^[ -~]{0,255}[!-~]$/,hKe=/,|=/});var Pde,_Ke,Mde,Lde,xM,Ude=O(()=>{A();kde();Pde=32,_Ke=512,Mde=",",Lde="=",xM=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+Lde+this.get(n)),t),[]).join(Mde)}_parse(t){t.length>_Ke||(this._internalState=t.split(Mde).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(Lde);if(i!==-1){let s=o.slice(0,i),c=o.slice(i+1,r.length);Ode(s)&&wde(c)&&n.set(s,c)}return n},new Map),this._internalState.size>Pde&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Pde))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function Qde(e){return new xM(e)}var Fde=O(()=>{A();Ude()});var Ke,Gde=O(()=>{A();lB();Ke=gm.getInstance()});var Bl,zde=O(()=>{A();Ny();Bl=qs.instance()});var A9,jde,Hde=O(()=>{A();n9();A9=class{getMeter(t,n,r){return t9}},jde=new A9});var g9,DM,$de=O(()=>{A();Hde();By();Ny();g9="metrics",DM=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return mm(g9,t,qs.instance())}getMeterProvider(){return xl(g9)||jde}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Am(g9,qs.instance())}}});var h9,qde=O(()=>{A();$de();h9=DM.getInstance()});var BM,Vde=O(()=>{A();BM=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function E9(e){return e.getValue(_9)||void 0}function Yde(){return E9(gm.getInstance().active())}function Kde(e,t){return e.setValue(_9,t)}function Jde(e){return e.deleteValue(_9)}var _9,Zde=O(()=>{A();lB();uB();_9=Dl("OpenTelemetry Baggage Key")});var y9,EKe,NM,Wde=O(()=>{A();By();Vde();r9();Zde();j$();Ny();y9="propagation",EKe=new BM,NM=class e{constructor(){this.createBaggage=hde,this.getBaggage=E9,this.getActiveBaggage=Yde,this.setBaggage=Kde,this.deleteBaggage=Jde}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return mm(y9,t,qs.instance())}inject(t,n,r=hM){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=gM){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Am(y9,qs.instance())}_getGlobalPropagator(){return xl(y9)||EKe}}});var ef,Xde=O(()=>{A();Wde();ef=NM.getInstance()});var S9,OM,epe=O(()=>{A();By();f9();CM();a9();Ny();S9="trace",OM=class e{constructor(){this._proxyTracerProvider=new wy,this.wrapSpanContext=Rde,this.isSpanContextValid=dg,this.deleteSpan=bde,this.getSpan=TM,this.getActiveSpan=Ide,this.getSpanContext=IM,this.setSpan=pB,this.setSpanContext=Cde}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=mm(S9,this._proxyTracerProvider,qs.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return xl(S9)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Am(S9,qs.instance()),this._proxyTracerProvider=new wy}}});var $t,tpe=O(()=>{A();epe();$t=OM.getInstance()});var We={};$s(We,{DiagConsoleLogger:()=>mM,DiagLogLevel:()=>ys,INVALID_SPANID:()=>dB,INVALID_SPAN_CONTEXT:()=>EM,INVALID_TRACEID:()=>Oy,ProxyTracer:()=>tC,ProxyTracerProvider:()=>wy,ROOT_CONTEXT:()=>Wb,SamplingDecision:()=>RM,SpanKind:()=>co,SpanStatusCode:()=>di,TraceFlags:()=>Ja,ValueType:()=>AM,baggageEntryMetadataFromString:()=>_de,context:()=>Ke,createContextKey:()=>Dl,createNoopMeter:()=>yde,createTraceState:()=>Qde,default:()=>yKe,defaultTextMapGetter:()=>gM,defaultTextMapSetter:()=>hM,diag:()=>Bl,isSpanContextValid:()=>dg,isValidSpanId:()=>c9,isValidTraceId:()=>u9,metrics:()=>h9,propagation:()=>ef,trace:()=>$t});var yKe,ze=O(()=>{A();j$();uB();Ede();pM();n9();Sde();r9();p9();f9();Dde();Bde();Nde();i9();Fde();CM();yM();Gde();zde();qde();Xde();tpe();yKe={context:Ke,diag:Bl,metrics:h9,propagation:ef,trace:$t}});var fB=F(u_=>{"use strict";A();Object.defineProperty(u_,"__esModule",{value:!0});u_.isTracingSuppressed=u_.unsuppressTracing=u_.suppressTracing=void 0;var SKe=(ze(),Me(We)),T9=(0,SKe.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function TKe(e){return e.setValue(T9,!0)}u_.suppressTracing=TKe;function IKe(e){return e.deleteValue(T9)}u_.unsuppressTracing=IKe;function bKe(e){return e.getValue(T9)===!0}u_.isTracingSuppressed=bKe});var I9=F(Za=>{"use strict";A();Object.defineProperty(Za,"__esModule",{value:!0});Za.BAGGAGE_MAX_TOTAL_LENGTH=Za.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Za.BAGGAGE_MAX_NAME_VALUE_PAIRS=Za.BAGGAGE_HEADER=Za.BAGGAGE_ITEMS_SEPARATOR=Za.BAGGAGE_PROPERTIES_SEPARATOR=Za.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Za.BAGGAGE_KEY_PAIR_SEPARATOR="=";Za.BAGGAGE_PROPERTIES_SEPARATOR=";";Za.BAGGAGE_ITEMS_SEPARATOR=",";Za.BAGGAGE_HEADER="baggage";Za.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Za.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Za.BAGGAGE_MAX_TOTAL_LENGTH=8192});var C9=F(kd=>{"use strict";A();Object.defineProperty(kd,"__esModule",{value:!0});kd.parseKeyPairsIntoRecord=kd.parseBaggageHeaderString=kd.parsePairKeyValue=kd.getKeyPairs=kd.serializeKeyPairs=void 0;var CKe=(ze(),Me(We)),_m=I9();function vKe(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?_m.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>_m.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}kd.serializeKeyPairs=vKe;function RKe(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=_m.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}kd.getKeyPairs=RKe;function b9(e){if(!e)return;let t=e.indexOf(_m.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(_m.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 s,c;try{s=decodeURIComponent(o),c=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,CKe.baggageEntryMetadataFromString)(f)}return{key:s,value:c,metadata:l}}kd.parsePairKeyValue=b9;function xKe(e,t,n,r){let o=0;for(;o<e.length&&n<_m.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(_m.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,c=s-o;if(c<=_m.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=b9(e.substring(o,s));if(l){let f=(n===0?0:1)+c;if(r+f>_m.BAGGAGE_MAX_TOTAL_LENGTH)break;t[l.key]=l.metadata?{value:l.value,metadata:l.metadata}:{value:l.value},n++,r+=f}}if(i===-1)break;o=i+1}return[n,r]}kd.parseBaggageHeaderString=xKe;function DKe(e){let t={};return typeof e=="string"&&e.length>0&&e.split(_m.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=b9(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}kd.parseKeyPairsIntoRecord=DKe});var npe=F(kM=>{"use strict";A();Object.defineProperty(kM,"__esModule",{value:!0});kM.W3CBaggagePropagator=void 0;var v9=(ze(),Me(We)),BKe=fB(),mB=I9(),wM=C9(),R9=class{inject(t,n,r){let o=v9.propagation.getBaggage(t);if(!o||(0,BKe.isTracingSuppressed)(t))return;let i=(0,wM.getKeyPairs)(o).filter(c=>c.length<=mB.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,mB.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,wM.serializeKeyPairs)(i);s.length>0&&r.set(n,mB.BAGGAGE_HEADER,s)}extract(t,n,r){let o=r.get(n,mB.BAGGAGE_HEADER);if(!o)return t;let i={},s=0,c=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,c]=(0,wM.parseBaggageHeaderString)(o[l],i,s,c);else[s]=(0,wM.parseBaggageHeaderString)(o,i,s,c);return s===0?t:v9.propagation.setBaggage(t,v9.propagation.createBaggage(i))}fields(){return[mB.BAGGAGE_HEADER]}};kM.W3CBaggagePropagator=R9});var rpe=F(PM=>{"use strict";A();Object.defineProperty(PM,"__esModule",{value:!0});PM.AnchoredClock=void 0;var x9=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}};PM.AnchoredClock=x9});var upe=F(c_=>{"use strict";A();Object.defineProperty(c_,"__esModule",{value:!0});c_.isAttributeValue=c_.isAttributeKey=c_.sanitizeAttributes=void 0;var ope=(ze(),Me(We));function NKe(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(!ipe(n)){ope.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!spe(r)){ope.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}c_.sanitizeAttributes=NKe;function ipe(e){return typeof e=="string"&&e!==""}c_.isAttributeKey=ipe;function spe(e){return e==null?!0:Array.isArray(e)?OKe(e):ape(typeof e)}c_.isAttributeValue=spe;function OKe(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(ape(r)){t=r;continue}return!1}return!1}}return!0}function ape(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var D9=F(MM=>{"use strict";A();Object.defineProperty(MM,"__esModule",{value:!0});MM.loggingErrorHandler=void 0;var wKe=(ze(),Me(We));function kKe(){return e=>{wKe.diag.error(PKe(e))}}MM.loggingErrorHandler=kKe;function PKe(e){return typeof e=="string"?e:JSON.stringify(MKe(e))}function MKe(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 lpe=F(nC=>{"use strict";A();Object.defineProperty(nC,"__esModule",{value:!0});nC.globalErrorHandler=nC.setGlobalErrorHandler=void 0;var LKe=D9(),cpe=(0,LKe.loggingErrorHandler)();function UKe(e){cpe=e}nC.setGlobalErrorHandler=UKe;function QKe(e){try{cpe(e)}catch{}}nC.globalErrorHandler=QKe});var mpe=F(Em=>{"use strict";A();Object.defineProperty(Em,"__esModule",{value:!0});Em.getStringListFromEnv=Em.getBooleanFromEnv=Em.getStringFromEnv=Em.getNumberFromEnv=void 0;var dpe=(ze(),Me(We)),ppe=Fe("util");function FKe(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){dpe.diag.warn(`Unknown value ${(0,ppe.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}Em.getNumberFromEnv=FKe;function fpe(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}Em.getStringFromEnv=fpe;function GKe(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||dpe.diag.warn(`Unknown value ${(0,ppe.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Em.getBooleanFromEnv=GKe;function zKe(e){return fpe(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}Em.getStringListFromEnv=zKe});var Ape=F(LM=>{"use strict";A();Object.defineProperty(LM,"__esModule",{value:!0});LM._globalThis=void 0;LM._globalThis=globalThis});var gpe=F(UM=>{"use strict";A();Object.defineProperty(UM,"__esModule",{value:!0});UM.VERSION=void 0;UM.VERSION="2.8.0"});function Ni(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 B9=O(()=>{A()});var hpe,_pe,Epe,ype,Spe,Tpe,Ipe,bpe,Cpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Ppe,Mpe,Lpe,Upe,Qpe,Fpe,Gpe,zpe,jpe,Hpe,$pe,qpe,Vpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,sfe,afe,ufe,cfe,lfe,dfe,pfe,ffe,mfe,Afe,gfe,hfe,_fe,Efe,yfe,Sfe,Tfe,Ife,bfe,Cfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Pfe,Mfe,Lfe,Ufe,Qfe,Ffe,Gfe,zfe,jfe,Hfe,$fe,qfe,Vfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eme,tme,nme,rme,ome,ime,sme,ame,ume,cme,lme,dme,pme,fme,mme,Ame,gme,hme,_me,Eme,yme,Sme,Tme,Ime,bme,Cme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Pme,Mme,jKe,N9,HKe,$Ke,qKe,VKe,O9,YKe,KKe,JKe,ZKe,WKe,XKe,eJe,tJe,nJe,rJe,oJe,iJe,sJe,aJe,uJe,cJe,lJe,dJe,w9,pJe,fJe,mJe,AJe,gJe,hJe,_Je,EJe,yJe,SJe,TJe,IJe,k9,bJe,CJe,P9,M9,vJe,RJe,xJe,DJe,BJe,NJe,OJe,wJe,kJe,PJe,MJe,LJe,UJe,QJe,FJe,GJe,zJe,AB,rC,L9,jJe,HJe,ky,$Je,qJe,VJe,YJe,U9,Q9,KJe,F9,JJe,ZJe,WJe,XJe,eZe,tZe,nZe,rZe,oZe,iZe,sZe,aZe,uZe,cZe,lZe,dZe,pZe,fZe,mZe,AZe,gZe,hZe,_Ze,G9,EZe,yZe,SZe,TZe,IZe,bZe,CZe,vZe,RZe,xZe,DZe,BZe,NZe,OZe,wZe,kZe,PZe,MZe,LZe,z9,UZe,j9,QZe,FZe,GZe,zZe,jZe,HZe,$Ze,qZe,VZe,Lme,Ume,Qme,Fme,Gme,zme,jme,Hme,$me,qme,Vme,Yme,Kme,Jme,Zme,Wme,Xme,eAe,tAe,nAe,rAe,oAe,iAe,sAe,aAe,uAe,cAe,lAe,dAe,pAe,fAe,mAe,AAe,gAe,hAe,_Ae,EAe,yAe,SAe,TAe,IAe,bAe,CAe,vAe,RAe,xAe,DAe,YZe,KZe,JZe,ZZe,WZe,XZe,eWe,tWe,nWe,rWe,oWe,iWe,sWe,aWe,uWe,cWe,lWe,dWe,pWe,fWe,mWe,AWe,gWe,hWe,_We,EWe,yWe,SWe,TWe,IWe,bWe,CWe,vWe,RWe,xWe,DWe,BWe,NWe,OWe,wWe,kWe,PWe,MWe,LWe,UWe,QWe,FWe,GWe,BAe,NAe,OAe,wAe,kAe,PAe,MAe,LAe,UAe,QAe,FAe,zWe,jWe,HWe,$We,qWe,VWe,YWe,KWe,JWe,ZWe,WWe,XWe,GAe,zAe,jAe,HAe,$Ae,eXe,tXe,nXe,rXe,oXe,iXe,qAe,VAe,YAe,sXe,aXe,uXe,cXe,KAe,JAe,ZAe,WAe,lXe,dXe,pXe,fXe,mXe,XAe,ege,tge,nge,rge,oge,ige,AXe,gXe,hXe,_Xe,EXe,yXe,SXe,TXe,sge,age,uge,cge,lge,IXe,bXe,CXe,vXe,RXe,xXe,dge,pge,fge,mge,Age,gge,hge,_ge,Ege,yge,Sge,Tge,Ige,bge,Cge,vge,Rge,xge,Dge,Bge,Nge,DXe,BXe,NXe,OXe,wXe,kXe,PXe,MXe,LXe,UXe,QXe,FXe,GXe,zXe,jXe,HXe,$Xe,qXe,VXe,YXe,KXe,JXe,Oge,wge,kge,Pge,Mge,ZXe,WXe,XXe,eet,tet,net,Lge,Uge,ret,oet,iet,Qge,Fge,set,aet,uet,Gge,zge,jge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,cet,det,pet,fet,met,Aet,get,het,_et,Eet,yet,Tet,Iet,bet,Cet,vet,Ret,xet,ohe,ihe,Det,Bet,Net,she=O(()=>{A();B9();hpe="aws.lambda.invoked_arn",_pe="db.system",Epe="db.connection_string",ype="db.user",Spe="db.jdbc.driver_classname",Tpe="db.name",Ipe="db.statement",bpe="db.operation",Cpe="db.mssql.instance_name",vpe="db.cassandra.keyspace",Rpe="db.cassandra.page_size",xpe="db.cassandra.consistency_level",Dpe="db.cassandra.table",Bpe="db.cassandra.idempotence",Npe="db.cassandra.speculative_execution_count",Ope="db.cassandra.coordinator.id",wpe="db.cassandra.coordinator.dc",kpe="db.hbase.namespace",Ppe="db.redis.database_index",Mpe="db.mongodb.collection",Lpe="db.sql.table",Upe="exception.type",Qpe="exception.message",Fpe="exception.stacktrace",Gpe="exception.escaped",zpe="faas.trigger",jpe="faas.execution",Hpe="faas.document.collection",$pe="faas.document.operation",qpe="faas.document.time",Vpe="faas.document.name",Ype="faas.time",Kpe="faas.cron",Jpe="faas.coldstart",Zpe="faas.invoked_name",Wpe="faas.invoked_provider",Xpe="faas.invoked_region",efe="net.transport",tfe="net.peer.ip",nfe="net.peer.port",rfe="net.peer.name",ofe="net.host.ip",ife="net.host.port",sfe="net.host.name",afe="net.host.connection.type",ufe="net.host.connection.subtype",cfe="net.host.carrier.name",lfe="net.host.carrier.mcc",dfe="net.host.carrier.mnc",pfe="net.host.carrier.icc",ffe="peer.service",mfe="enduser.id",Afe="enduser.role",gfe="enduser.scope",hfe="thread.id",_fe="thread.name",Efe="code.function",yfe="code.namespace",Sfe="code.filepath",Tfe="code.lineno",Ife="http.method",bfe="http.url",Cfe="http.target",vfe="http.host",Rfe="http.scheme",xfe="http.status_code",Dfe="http.flavor",Bfe="http.user_agent",Nfe="http.request_content_length",Ofe="http.request_content_length_uncompressed",wfe="http.response_content_length",kfe="http.response_content_length_uncompressed",Pfe="http.server_name",Mfe="http.route",Lfe="http.client_ip",Ufe="aws.dynamodb.table_names",Qfe="aws.dynamodb.consumed_capacity",Ffe="aws.dynamodb.item_collection_metrics",Gfe="aws.dynamodb.provisioned_read_capacity",zfe="aws.dynamodb.provisioned_write_capacity",jfe="aws.dynamodb.consistent_read",Hfe="aws.dynamodb.projection",$fe="aws.dynamodb.limit",qfe="aws.dynamodb.attributes_to_get",Vfe="aws.dynamodb.index_name",Yfe="aws.dynamodb.select",Kfe="aws.dynamodb.global_secondary_indexes",Jfe="aws.dynamodb.local_secondary_indexes",Zfe="aws.dynamodb.exclusive_start_table",Wfe="aws.dynamodb.table_count",Xfe="aws.dynamodb.scan_forward",eme="aws.dynamodb.segment",tme="aws.dynamodb.total_segments",nme="aws.dynamodb.count",rme="aws.dynamodb.scanned_count",ome="aws.dynamodb.attribute_definitions",ime="aws.dynamodb.global_secondary_index_updates",sme="messaging.system",ame="messaging.destination",ume="messaging.destination_kind",cme="messaging.temp_destination",lme="messaging.protocol",dme="messaging.protocol_version",pme="messaging.url",fme="messaging.message_id",mme="messaging.conversation_id",Ame="messaging.message_payload_size_bytes",gme="messaging.message_payload_compressed_size_bytes",hme="messaging.operation",_me="messaging.consumer_id",Eme="messaging.rabbitmq.routing_key",yme="messaging.kafka.message_key",Sme="messaging.kafka.consumer_group",Tme="messaging.kafka.client_id",Ime="messaging.kafka.partition",bme="messaging.kafka.tombstone",Cme="rpc.system",vme="rpc.service",Rme="rpc.method",xme="rpc.grpc.status_code",Dme="rpc.jsonrpc.version",Bme="rpc.jsonrpc.request_id",Nme="rpc.jsonrpc.error_code",Ome="rpc.jsonrpc.error_message",wme="message.type",kme="message.id",Pme="message.compressed_size",Mme="message.uncompressed_size",jKe=hpe,N9=_pe,HKe=Epe,$Ke=ype,qKe=Spe,VKe=Tpe,O9=Ipe,YKe=bpe,KKe=Cpe,JKe=vpe,ZKe=Rpe,WKe=xpe,XKe=Dpe,eJe=Bpe,tJe=Npe,nJe=Ope,rJe=wpe,oJe=kpe,iJe=Ppe,sJe=Mpe,aJe=Lpe,uJe=Upe,cJe=Qpe,lJe=Fpe,dJe=Gpe,w9=zpe,pJe=jpe,fJe=Hpe,mJe=$pe,AJe=qpe,gJe=Vpe,hJe=Ype,_Je=Kpe,EJe=Jpe,yJe=Zpe,SJe=Wpe,TJe=Xpe,IJe=efe,k9=tfe,bJe=nfe,CJe=rfe,P9=ofe,M9=ife,vJe=sfe,RJe=afe,xJe=ufe,DJe=cfe,BJe=lfe,NJe=dfe,OJe=pfe,wJe=ffe,kJe=mfe,PJe=Afe,MJe=gfe,LJe=hfe,UJe=_fe,QJe=Efe,FJe=yfe,GJe=Sfe,zJe=Tfe,AB=Ife,rC=bfe,L9=Cfe,jJe=vfe,HJe=Rfe,ky=xfe,$Je=Dfe,qJe=Bfe,VJe=Nfe,YJe=Ofe,U9=wfe,Q9=kfe,KJe=Pfe,F9=Mfe,JJe=Lfe,ZJe=Ufe,WJe=Qfe,XJe=Ffe,eZe=Gfe,tZe=zfe,nZe=jfe,rZe=Hfe,oZe=$fe,iZe=qfe,sZe=Vfe,aZe=Yfe,uZe=Kfe,cZe=Jfe,lZe=Zfe,dZe=Wfe,pZe=Xfe,fZe=eme,mZe=tme,AZe=nme,gZe=rme,hZe=ome,_Ze=ime,G9=sme,EZe=ame,yZe=ume,SZe=cme,TZe=lme,IZe=dme,bZe=pme,CZe=fme,vZe=mme,RZe=Ame,xZe=gme,DZe=hme,BZe=_me,NZe=Eme,OZe=yme,wZe=Sme,kZe=Tme,PZe=Ime,MZe=bme,LZe=Cme,z9=vme,UZe=Rme,j9=xme,QZe=Dme,FZe=Bme,GZe=Nme,zZe=Ome,jZe=wme,HZe=kme,$Ze=Pme,qZe=Mme,VZe=Ni([hpe,_pe,Epe,ype,Spe,Tpe,Ipe,bpe,Cpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Ppe,Mpe,Lpe,Upe,Qpe,Fpe,Gpe,zpe,jpe,Hpe,$pe,qpe,Vpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,sfe,afe,ufe,cfe,lfe,dfe,pfe,ffe,mfe,Afe,gfe,hfe,_fe,Efe,yfe,Sfe,Tfe,Ife,bfe,Cfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Pfe,Mfe,Lfe,Ufe,Qfe,Ffe,Gfe,zfe,jfe,Hfe,$fe,qfe,Vfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eme,tme,nme,rme,ome,ime,sme,ame,ume,cme,lme,dme,pme,fme,mme,Ame,gme,hme,_me,Eme,yme,Sme,Tme,Ime,bme,Cme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Pme,Mme]),Lme="other_sql",Ume="mssql",Qme="mysql",Fme="oracle",Gme="db2",zme="postgresql",jme="redshift",Hme="hive",$me="cloudscape",qme="hsqldb",Vme="progress",Yme="maxdb",Kme="hanadb",Jme="ingres",Zme="firstsql",Wme="edb",Xme="cache",eAe="adabas",tAe="firebird",nAe="derby",rAe="filemaker",oAe="informix",iAe="instantdb",sAe="interbase",aAe="mariadb",uAe="netezza",cAe="pervasive",lAe="pointbase",dAe="sqlite",pAe="sybase",fAe="teradata",mAe="vertica",AAe="h2",gAe="coldfusion",hAe="cassandra",_Ae="hbase",EAe="mongodb",yAe="redis",SAe="couchbase",TAe="couchdb",IAe="cosmosdb",bAe="dynamodb",CAe="neo4j",vAe="geode",RAe="elasticsearch",xAe="memcached",DAe="cockroachdb",YZe=Lme,KZe=Ume,JZe=Qme,ZZe=Fme,WZe=Gme,XZe=zme,eWe=jme,tWe=Hme,nWe=$me,rWe=qme,oWe=Vme,iWe=Yme,sWe=Kme,aWe=Jme,uWe=Zme,cWe=Wme,lWe=Xme,dWe=eAe,pWe=tAe,fWe=nAe,mWe=rAe,AWe=oAe,gWe=iAe,hWe=sAe,_We=aAe,EWe=uAe,yWe=cAe,SWe=lAe,TWe=dAe,IWe=pAe,bWe=fAe,CWe=mAe,vWe=AAe,RWe=gAe,xWe=hAe,DWe=_Ae,BWe=EAe,NWe=yAe,OWe=SAe,wWe=TAe,kWe=IAe,PWe=bAe,MWe=CAe,LWe=vAe,UWe=RAe,QWe=xAe,FWe=DAe,GWe=Ni([Lme,Ume,Qme,Fme,Gme,zme,jme,Hme,$me,qme,Vme,Yme,Kme,Jme,Zme,Wme,Xme,eAe,tAe,nAe,rAe,oAe,iAe,sAe,aAe,uAe,cAe,lAe,dAe,pAe,fAe,mAe,AAe,gAe,hAe,_Ae,EAe,yAe,SAe,TAe,IAe,bAe,CAe,vAe,RAe,xAe,DAe]),BAe="all",NAe="each_quorum",OAe="quorum",wAe="local_quorum",kAe="one",PAe="two",MAe="three",LAe="local_one",UAe="any",QAe="serial",FAe="local_serial",zWe=BAe,jWe=NAe,HWe=OAe,$We=wAe,qWe=kAe,VWe=PAe,YWe=MAe,KWe=LAe,JWe=UAe,ZWe=QAe,WWe=FAe,XWe=Ni([BAe,NAe,OAe,wAe,kAe,PAe,MAe,LAe,UAe,QAe,FAe]),GAe="datasource",zAe="http",jAe="pubsub",HAe="timer",$Ae="other",eXe=GAe,tXe=zAe,nXe=jAe,rXe=HAe,oXe=$Ae,iXe=Ni([GAe,zAe,jAe,HAe,$Ae]),qAe="insert",VAe="edit",YAe="delete",sXe=qAe,aXe=VAe,uXe=YAe,cXe=Ni([qAe,VAe,YAe]),KAe="alibaba_cloud",JAe="aws",ZAe="azure",WAe="gcp",lXe=KAe,dXe=JAe,pXe=ZAe,fXe=WAe,mXe=Ni([KAe,JAe,ZAe,WAe]),XAe="ip_tcp",ege="ip_udp",tge="ip",nge="unix",rge="pipe",oge="inproc",ige="other",AXe=XAe,gXe=ege,hXe=tge,_Xe=nge,EXe=rge,yXe=oge,SXe=ige,TXe=Ni([XAe,ege,tge,nge,rge,oge,ige]),sge="wifi",age="wired",uge="cell",cge="unavailable",lge="unknown",IXe=sge,bXe=age,CXe=uge,vXe=cge,RXe=lge,xXe=Ni([sge,age,uge,cge,lge]),dge="gprs",pge="edge",fge="umts",mge="cdma",Age="evdo_0",gge="evdo_a",hge="cdma2000_1xrtt",_ge="hsdpa",Ege="hsupa",yge="hspa",Sge="iden",Tge="evdo_b",Ige="lte",bge="ehrpd",Cge="hspap",vge="gsm",Rge="td_scdma",xge="iwlan",Dge="nr",Bge="nrnsa",Nge="lte_ca",DXe=dge,BXe=pge,NXe=fge,OXe=mge,wXe=Age,kXe=gge,PXe=hge,MXe=_ge,LXe=Ege,UXe=yge,QXe=Sge,FXe=Tge,GXe=Ige,zXe=bge,jXe=Cge,HXe=vge,$Xe=Rge,qXe=xge,VXe=Dge,YXe=Bge,KXe=Nge,JXe=Ni([dge,pge,fge,mge,Age,gge,hge,_ge,Ege,yge,Sge,Tge,Ige,bge,Cge,vge,Rge,xge,Dge,Bge,Nge]),Oge="1.0",wge="1.1",kge="2.0",Pge="SPDY",Mge="QUIC",ZXe=Oge,WXe=wge,XXe=kge,eet=Pge,tet=Mge,net={HTTP_1_0:Oge,HTTP_1_1:wge,HTTP_2_0:kge,SPDY:Pge,QUIC:Mge},Lge="queue",Uge="topic",ret=Lge,oet=Uge,iet=Ni([Lge,Uge]),Qge="receive",Fge="process",set=Qge,aet=Fge,uet=Ni([Qge,Fge]),Gge=0,zge=1,jge=2,Hge=3,$ge=4,qge=5,Vge=6,Yge=7,Kge=8,Jge=9,Zge=10,Wge=11,Xge=12,ehe=13,the=14,nhe=15,rhe=16,cet=Gge,det=zge,pet=jge,fet=Hge,met=$ge,Aet=qge,get=Vge,het=Yge,_et=Kge,Eet=Jge,yet=Zge,Tet=Wge,Iet=Xge,bet=ehe,Cet=the,vet=nhe,Ret=rhe,xet={OK:Gge,CANCELLED:zge,UNKNOWN:jge,INVALID_ARGUMENT:Hge,DEADLINE_EXCEEDED:$ge,NOT_FOUND:qge,ALREADY_EXISTS:Vge,PERMISSION_DENIED:Yge,RESOURCE_EXHAUSTED:Kge,FAILED_PRECONDITION:Jge,ABORTED:Zge,OUT_OF_RANGE:Wge,UNIMPLEMENTED:Xge,INTERNAL:ehe,UNAVAILABLE:the,DATA_LOSS:nhe,UNAUTHENTICATED:rhe},ohe="SENT",ihe="RECEIVED",Det=ohe,Bet=ihe,Net=Ni([ohe,ihe])});var ahe=O(()=>{A();she()});var uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,Ihe,bhe,Che,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,zhe,jhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,I_e,b_e,C_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e,Oet,wet,ket,Pet,Met,Let,Uet,Qet,Fet,Get,zet,jet,Het,$et,qet,Vet,Yet,Ket,Jet,Zet,Wet,Xet,ett,ttt,ntt,rtt,ott,itt,stt,att,utt,ctt,ltt,dtt,ptt,ftt,mtt,Att,gtt,htt,_tt,Ett,ytt,Stt,Ttt,Itt,btt,Ctt,vtt,Rtt,xtt,Dtt,Btt,Ntt,Ott,wtt,ktt,Ptt,Mtt,Ltt,Utt,Qtt,Ftt,Gtt,ztt,jtt,Htt,$tt,qtt,Vtt,Ytt,H9,Ktt,Jtt,Ztt,Wtt,Xtt,ent,tnt,nnt,rnt,ont,P_e,M_e,L_e,U_e,int,snt,ant,unt,cnt,Q_e,F_e,G_e,z_e,j_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,lnt,dnt,pnt,fnt,mnt,Ant,gnt,hnt,_nt,Ent,ynt,Snt,Tnt,Int,bnt,Cnt,vnt,Rnt,nEe,rEe,xnt,Dnt,Bnt,oEe,iEe,sEe,aEe,uEe,cEe,lEe,Nnt,Ont,wnt,knt,Pnt,Mnt,Lnt,Unt,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,Qnt,Fnt,Gnt,znt,jnt,Hnt,$nt,qnt,Vnt,Ynt,Knt,Jnt,TEe,IEe,bEe,CEe,vEe,REe,xEe,DEe,BEe,NEe,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,srt,art,OEe=O(()=>{A();B9();uhe="cloud.provider",che="cloud.account.id",lhe="cloud.region",dhe="cloud.availability_zone",phe="cloud.platform",fhe="aws.ecs.container.arn",mhe="aws.ecs.cluster.arn",Ahe="aws.ecs.launchtype",ghe="aws.ecs.task.arn",hhe="aws.ecs.task.family",_he="aws.ecs.task.revision",Ehe="aws.eks.cluster.arn",yhe="aws.log.group.names",She="aws.log.group.arns",The="aws.log.stream.names",Ihe="aws.log.stream.arns",bhe="container.name",Che="container.id",vhe="container.runtime",Rhe="container.image.name",xhe="container.image.tag",Dhe="deployment.environment",Bhe="device.id",Nhe="device.model.identifier",Ohe="device.model.name",whe="faas.name",khe="faas.id",Phe="faas.version",Mhe="faas.instance",Lhe="faas.max_memory",Uhe="host.id",Qhe="host.name",Fhe="host.type",Ghe="host.arch",zhe="host.image.name",jhe="host.image.id",Hhe="host.image.version",$he="k8s.cluster.name",qhe="k8s.node.name",Vhe="k8s.node.uid",Yhe="k8s.namespace.name",Khe="k8s.pod.uid",Jhe="k8s.pod.name",Zhe="k8s.container.name",Whe="k8s.replicaset.uid",Xhe="k8s.replicaset.name",e_e="k8s.deployment.uid",t_e="k8s.deployment.name",n_e="k8s.statefulset.uid",r_e="k8s.statefulset.name",o_e="k8s.daemonset.uid",i_e="k8s.daemonset.name",s_e="k8s.job.uid",a_e="k8s.job.name",u_e="k8s.cronjob.uid",c_e="k8s.cronjob.name",l_e="os.type",d_e="os.description",p_e="os.name",f_e="os.version",m_e="process.pid",A_e="process.executable.name",g_e="process.executable.path",h_e="process.command",__e="process.command_line",E_e="process.command_args",y_e="process.owner",S_e="process.runtime.name",T_e="process.runtime.version",I_e="process.runtime.description",b_e="service.name",C_e="service.namespace",v_e="service.instance.id",R_e="service.version",x_e="telemetry.sdk.name",D_e="telemetry.sdk.language",B_e="telemetry.sdk.version",N_e="telemetry.auto.version",O_e="webengine.name",w_e="webengine.version",k_e="webengine.description",Oet=uhe,wet=che,ket=lhe,Pet=dhe,Met=phe,Let=fhe,Uet=mhe,Qet=Ahe,Fet=ghe,Get=hhe,zet=_he,jet=Ehe,Het=yhe,$et=She,qet=The,Vet=Ihe,Yet=bhe,Ket=Che,Jet=vhe,Zet=Rhe,Wet=xhe,Xet=Dhe,ett=Bhe,ttt=Nhe,ntt=Ohe,rtt=whe,ott=khe,itt=Phe,stt=Mhe,att=Lhe,utt=Uhe,ctt=Qhe,ltt=Fhe,dtt=Ghe,ptt=zhe,ftt=jhe,mtt=Hhe,Att=$he,gtt=qhe,htt=Vhe,_tt=Yhe,Ett=Khe,ytt=Jhe,Stt=Zhe,Ttt=Whe,Itt=Xhe,btt=e_e,Ctt=t_e,vtt=n_e,Rtt=r_e,xtt=o_e,Dtt=i_e,Btt=s_e,Ntt=a_e,Ott=u_e,wtt=c_e,ktt=l_e,Ptt=d_e,Mtt=p_e,Ltt=f_e,Utt=m_e,Qtt=A_e,Ftt=g_e,Gtt=h_e,ztt=__e,jtt=E_e,Htt=y_e,$tt=S_e,qtt=T_e,Vtt=I_e,Ytt=b_e,H9=C_e,Ktt=v_e,Jtt=R_e,Ztt=x_e,Wtt=D_e,Xtt=B_e,ent=N_e,tnt=O_e,nnt=w_e,rnt=k_e,ont=Ni([uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,Ihe,bhe,Che,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,zhe,jhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,I_e,b_e,C_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e]),P_e="alibaba_cloud",M_e="aws",L_e="azure",U_e="gcp",int=P_e,snt=M_e,ant=L_e,unt=U_e,cnt=Ni([P_e,M_e,L_e,U_e]),Q_e="alibaba_cloud_ecs",F_e="alibaba_cloud_fc",G_e="aws_ec2",z_e="aws_ecs",j_e="aws_eks",H_e="aws_lambda",$_e="aws_elastic_beanstalk",q_e="azure_vm",V_e="azure_container_instances",Y_e="azure_aks",K_e="azure_functions",J_e="azure_app_service",Z_e="gcp_compute_engine",W_e="gcp_cloud_run",X_e="gcp_kubernetes_engine",eEe="gcp_cloud_functions",tEe="gcp_app_engine",lnt=Q_e,dnt=F_e,pnt=G_e,fnt=z_e,mnt=j_e,Ant=H_e,gnt=$_e,hnt=q_e,_nt=V_e,Ent=Y_e,ynt=K_e,Snt=J_e,Tnt=Z_e,Int=W_e,bnt=X_e,Cnt=eEe,vnt=tEe,Rnt=Ni([Q_e,F_e,G_e,z_e,j_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe]),nEe="ec2",rEe="fargate",xnt=nEe,Dnt=rEe,Bnt=Ni([nEe,rEe]),oEe="amd64",iEe="arm32",sEe="arm64",aEe="ia64",uEe="ppc32",cEe="ppc64",lEe="x86",Nnt=oEe,Ont=iEe,wnt=sEe,knt=aEe,Pnt=uEe,Mnt=cEe,Lnt=lEe,Unt=Ni([oEe,iEe,sEe,aEe,uEe,cEe,lEe]),dEe="windows",pEe="linux",fEe="darwin",mEe="freebsd",AEe="netbsd",gEe="openbsd",hEe="dragonflybsd",_Ee="hpux",EEe="aix",yEe="solaris",SEe="z_os",Qnt=dEe,Fnt=pEe,Gnt=fEe,znt=mEe,jnt=AEe,Hnt=gEe,$nt=hEe,qnt=_Ee,Vnt=EEe,Ynt=yEe,Knt=SEe,Jnt=Ni([dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe]),TEe="cpp",IEe="dotnet",bEe="erlang",CEe="go",vEe="java",REe="nodejs",xEe="php",DEe="python",BEe="ruby",NEe="webjs",Znt=TEe,Wnt=IEe,Xnt=bEe,ert=CEe,trt=vEe,nrt=REe,rrt=xEe,ort=DEe,irt=BEe,srt=NEe,art=Ni([TEe,IEe,bEe,CEe,vEe,REe,xEe,DEe,BEe,NEe])});var wEe=O(()=>{A();OEe()});var urt,crt,lrt,drt,prt,frt,mrt,Art,grt,hrt,_rt,Ert,yrt,Srt,Trt,Irt,brt,Crt,vrt,Rrt,xrt,Drt,Brt,Nrt,Ort,$9,q9,wrt,oC,krt,V9,Y9,Prt,Py,Mrt,Lrt,Urt,Qrt,Frt,Grt,zrt,jrt,lYt,dYt,K9,Hrt,$rt,qrt,Vrt,Yrt,Krt,My,Jrt,Zrt,Wrt,pYt,Xrt,eot,tot,not,fYt,rot,oot,iot,sot,pg,fg,aot,uot,cot,lot,dot,pot,fot,mot,Aot,mYt,got,hot,_ot,Eot,yot,Sot,J9,Z9,Tot,W9,X9,Iot,bot,AYt,gYt,Cot,vot,Rot,xot,Dot,Bot,Not,Oot,hYt,wot,e5,t5,kot,n5,Pot,r5,Mot,Lot,Uot,Qot,Fot,Got,zot,jot,Hot,_Yt,$ot,qot,EYt,Vot,Yot,yYt,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,l_,rit,oit,iit,o5,kEe=O(()=>{A();urt="aspnetcore.diagnostics.exception.result",crt="aborted",lrt="handled",drt="skipped",prt="unhandled",frt="aspnetcore.diagnostics.handler.type",mrt="aspnetcore.rate_limiting.policy",Art="aspnetcore.rate_limiting.result",grt="acquired",hrt="endpoint_limiter",_rt="global_limiter",Ert="request_canceled",yrt="aspnetcore.request.is_unhandled",Srt="aspnetcore.routing.is_fallback",Trt="aspnetcore.routing.match_status",Irt="failure",brt="success",Crt="aspnetcore.user.is_authenticated",vrt="client.address",Rrt="client.port",xrt="code.column.number",Drt="code.file.path",Brt="code.function.name",Nrt="code.line.number",Ort="code.stacktrace",$9="db.collection.name",q9="db.namespace",wrt="db.operation.batch.size",oC="db.operation.name",krt="db.query.summary",V9="db.query.text",Y9="db.response.status_code",Prt="db.stored_procedure.name",Py="db.system.name",Mrt="mariadb",Lrt="microsoft.sql_server",Urt="mysql",Qrt="postgresql",Frt="dotnet.gc.heap.generation",Grt="gen0",zrt="gen1",jrt="gen2",lYt="loh",dYt="poh",K9="error.type",Hrt="_OTHER",$rt="exception.escaped",qrt="exception.message",Vrt="exception.stacktrace",Yrt="exception.type",Krt=e=>`http.request.header.${e}`,My="http.request.method",Jrt="_OTHER",Zrt="CONNECT",Wrt="DELETE",pYt="GET",Xrt="HEAD",eot="OPTIONS",tot="PATCH",not="POST",fYt="PUT",rot="TRACE",oot="http.request.method_original",iot="http.request.resend_count",sot=e=>`http.response.header.${e}`,pg="http.response.status_code",fg="http.route",aot="jvm.gc.action",uot="jvm.gc.name",cot="jvm.memory.pool.name",lot="jvm.memory.type",dot="heap",pot="non_heap",fot="jvm.thread.daemon",mot="jvm.thread.state",Aot="blocked",mYt="new",got="runnable",hot="terminated",_ot="timed_waiting",Eot="waiting",yot="network.local.address",Sot="network.local.port",J9="network.peer.address",Z9="network.peer.port",Tot="network.protocol.name",W9="network.protocol.version",X9="network.transport",Iot="pipe",bot="quic",AYt="tcp",gYt="udp",Cot="unix",vot="network.type",Rot="ipv4",xot="ipv6",Dot="otel.scope.name",Bot="otel.scope.version",Not="otel.status_code",Oot="ERROR",hYt="OK",wot="otel.status_description",e5="server.address",t5="server.port",kot="service.instance.id",n5="service.name",Pot="service.namespace",r5="service.version",Mot="signalr.connection.status",Lot="app_shutdown",Uot="normal_closure",Qot="timeout",Fot="signalr.transport",Got="long_polling",zot="server_sent_events",jot="web_sockets",Hot="telemetry.sdk.language",_Yt="cpp",$ot="dotnet",qot="erlang",EYt="go",Vot="java",Yot="nodejs",yYt="php",Kot="python",Jot="ruby",Zot="rust",Wot="swift",Xot="webjs",eit="telemetry.sdk.name",tit="telemetry.sdk.version",nit="url.fragment",l_="url.full",rit="url.path",oit="url.query",iit="url.scheme",o5="user_agent.original"});var sit,ait,uit,cit,lit,dit,pit,fit,mit,Ait,git,hit,_it,Eit,yit,Sit,Tit,Iit,bit,Cit,vit,Rit,xit,Dit,Bit,Nit,Oit,wit,kit,Pit,Mit,Lit,Uit,Qit,Fit,Git,zit,jit,Hit,$it,qit,Vit,Yit,Kit,Jit,Zit,Wit,Xit,est,tst,nst,PEe=O(()=>{A();sit="aspnetcore.diagnostics.exceptions",ait="aspnetcore.rate_limiting.active_request_leases",uit="aspnetcore.rate_limiting.queued_requests",cit="aspnetcore.rate_limiting.request.time_in_queue",lit="aspnetcore.rate_limiting.request_lease.duration",dit="aspnetcore.rate_limiting.requests",pit="aspnetcore.routing.match_attempts",fit="db.client.operation.duration",mit="dotnet.assembly.count",Ait="dotnet.exceptions",git="dotnet.gc.collections",hit="dotnet.gc.heap.total_allocated",_it="dotnet.gc.last_collection.heap.fragmentation.size",Eit="dotnet.gc.last_collection.heap.size",yit="dotnet.gc.last_collection.memory.committed_size",Sit="dotnet.gc.pause.time",Tit="dotnet.jit.compilation.time",Iit="dotnet.jit.compiled_il.size",bit="dotnet.jit.compiled_methods",Cit="dotnet.monitor.lock_contentions",vit="dotnet.process.cpu.count",Rit="dotnet.process.cpu.time",xit="dotnet.process.memory.working_set",Dit="dotnet.thread_pool.queue.length",Bit="dotnet.thread_pool.thread.count",Nit="dotnet.thread_pool.work_item.count",Oit="dotnet.timer.count",wit="http.client.request.duration",kit="http.server.request.duration",Pit="jvm.class.count",Mit="jvm.class.loaded",Lit="jvm.class.unloaded",Uit="jvm.cpu.count",Qit="jvm.cpu.recent_utilization",Fit="jvm.cpu.time",Git="jvm.gc.duration",zit="jvm.memory.committed",jit="jvm.memory.limit",Hit="jvm.memory.used",$it="jvm.memory.used_after_last_gc",qit="jvm.thread.count",Vit="kestrel.active_connections",Yit="kestrel.active_tls_handshakes",Kit="kestrel.connection.duration",Jit="kestrel.queued_connections",Zit="kestrel.queued_requests",Wit="kestrel.rejected_connections",Xit="kestrel.tls_handshake.duration",est="kestrel.upgraded_connections",tst="signalr.server.active_connections",nst="signalr.server.connection.duration"});var rst,MEe=O(()=>{A();rst="exception"});var Fr={};$s(Fr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>crt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>lrt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>drt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>prt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>grt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>hrt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>_rt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Ert,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Irt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>brt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>urt,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>frt,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>mrt,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Art,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>yrt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Srt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Trt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Crt,ATTR_CLIENT_ADDRESS:()=>vrt,ATTR_CLIENT_PORT:()=>Rrt,ATTR_CODE_COLUMN_NUMBER:()=>xrt,ATTR_CODE_FILE_PATH:()=>Drt,ATTR_CODE_FUNCTION_NAME:()=>Brt,ATTR_CODE_LINE_NUMBER:()=>Nrt,ATTR_CODE_STACKTRACE:()=>Ort,ATTR_DB_COLLECTION_NAME:()=>$9,ATTR_DB_NAMESPACE:()=>q9,ATTR_DB_OPERATION_BATCH_SIZE:()=>wrt,ATTR_DB_OPERATION_NAME:()=>oC,ATTR_DB_QUERY_SUMMARY:()=>krt,ATTR_DB_QUERY_TEXT:()=>V9,ATTR_DB_RESPONSE_STATUS_CODE:()=>Y9,ATTR_DB_STORED_PROCEDURE_NAME:()=>Prt,ATTR_DB_SYSTEM_NAME:()=>Py,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Frt,ATTR_ERROR_TYPE:()=>K9,ATTR_EXCEPTION_ESCAPED:()=>$rt,ATTR_EXCEPTION_MESSAGE:()=>qrt,ATTR_EXCEPTION_STACKTRACE:()=>Vrt,ATTR_EXCEPTION_TYPE:()=>Yrt,ATTR_HTTP_REQUEST_HEADER:()=>Krt,ATTR_HTTP_REQUEST_METHOD:()=>My,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>oot,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>iot,ATTR_HTTP_RESPONSE_HEADER:()=>sot,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>pg,ATTR_HTTP_ROUTE:()=>fg,ATTR_JVM_GC_ACTION:()=>aot,ATTR_JVM_GC_NAME:()=>uot,ATTR_JVM_MEMORY_POOL_NAME:()=>cot,ATTR_JVM_MEMORY_TYPE:()=>lot,ATTR_JVM_THREAD_DAEMON:()=>fot,ATTR_JVM_THREAD_STATE:()=>mot,ATTR_NETWORK_LOCAL_ADDRESS:()=>yot,ATTR_NETWORK_LOCAL_PORT:()=>Sot,ATTR_NETWORK_PEER_ADDRESS:()=>J9,ATTR_NETWORK_PEER_PORT:()=>Z9,ATTR_NETWORK_PROTOCOL_NAME:()=>Tot,ATTR_NETWORK_PROTOCOL_VERSION:()=>W9,ATTR_NETWORK_TRANSPORT:()=>X9,ATTR_NETWORK_TYPE:()=>vot,ATTR_OTEL_SCOPE_NAME:()=>Dot,ATTR_OTEL_SCOPE_VERSION:()=>Bot,ATTR_OTEL_STATUS_CODE:()=>Not,ATTR_OTEL_STATUS_DESCRIPTION:()=>wot,ATTR_SERVER_ADDRESS:()=>e5,ATTR_SERVER_PORT:()=>t5,ATTR_SERVICE_INSTANCE_ID:()=>kot,ATTR_SERVICE_NAME:()=>n5,ATTR_SERVICE_NAMESPACE:()=>Pot,ATTR_SERVICE_VERSION:()=>r5,ATTR_SIGNALR_CONNECTION_STATUS:()=>Mot,ATTR_SIGNALR_TRANSPORT:()=>Fot,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Hot,ATTR_TELEMETRY_SDK_NAME:()=>eit,ATTR_TELEMETRY_SDK_VERSION:()=>tit,ATTR_URL_FRAGMENT:()=>nit,ATTR_URL_FULL:()=>l_,ATTR_URL_PATH:()=>rit,ATTR_URL_QUERY:()=>oit,ATTR_URL_SCHEME:()=>iit,ATTR_USER_AGENT_ORIGINAL:()=>o5,AWSECSLAUNCHTYPEVALUES_EC2:()=>xnt,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Dnt,AwsEcsLaunchtypeValues:()=>Bnt,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>lnt,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>dnt,CLOUDPLATFORMVALUES_AWS_EC2:()=>pnt,CLOUDPLATFORMVALUES_AWS_ECS:()=>fnt,CLOUDPLATFORMVALUES_AWS_EKS:()=>mnt,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>gnt,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Ant,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Ent,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Snt,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>_nt,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>ynt,CLOUDPLATFORMVALUES_AZURE_VM:()=>hnt,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>vnt,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Cnt,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Int,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Tnt,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>bnt,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>int,CLOUDPROVIDERVALUES_AWS:()=>snt,CLOUDPROVIDERVALUES_AZURE:()=>ant,CLOUDPROVIDERVALUES_GCP:()=>unt,CloudPlatformValues:()=>Rnt,CloudProviderValues:()=>cnt,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>zWe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>JWe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>jWe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>KWe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>$We,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>WWe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>qWe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>HWe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>ZWe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>YWe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>VWe,DBSYSTEMVALUES_ADABAS:()=>dWe,DBSYSTEMVALUES_CACHE:()=>lWe,DBSYSTEMVALUES_CASSANDRA:()=>xWe,DBSYSTEMVALUES_CLOUDSCAPE:()=>nWe,DBSYSTEMVALUES_COCKROACHDB:()=>FWe,DBSYSTEMVALUES_COLDFUSION:()=>RWe,DBSYSTEMVALUES_COSMOSDB:()=>kWe,DBSYSTEMVALUES_COUCHBASE:()=>OWe,DBSYSTEMVALUES_COUCHDB:()=>wWe,DBSYSTEMVALUES_DB2:()=>WZe,DBSYSTEMVALUES_DERBY:()=>fWe,DBSYSTEMVALUES_DYNAMODB:()=>PWe,DBSYSTEMVALUES_EDB:()=>cWe,DBSYSTEMVALUES_ELASTICSEARCH:()=>UWe,DBSYSTEMVALUES_FILEMAKER:()=>mWe,DBSYSTEMVALUES_FIREBIRD:()=>pWe,DBSYSTEMVALUES_FIRSTSQL:()=>uWe,DBSYSTEMVALUES_GEODE:()=>LWe,DBSYSTEMVALUES_H2:()=>vWe,DBSYSTEMVALUES_HANADB:()=>sWe,DBSYSTEMVALUES_HBASE:()=>DWe,DBSYSTEMVALUES_HIVE:()=>tWe,DBSYSTEMVALUES_HSQLDB:()=>rWe,DBSYSTEMVALUES_INFORMIX:()=>AWe,DBSYSTEMVALUES_INGRES:()=>aWe,DBSYSTEMVALUES_INSTANTDB:()=>gWe,DBSYSTEMVALUES_INTERBASE:()=>hWe,DBSYSTEMVALUES_MARIADB:()=>_We,DBSYSTEMVALUES_MAXDB:()=>iWe,DBSYSTEMVALUES_MEMCACHED:()=>QWe,DBSYSTEMVALUES_MONGODB:()=>BWe,DBSYSTEMVALUES_MSSQL:()=>KZe,DBSYSTEMVALUES_MYSQL:()=>JZe,DBSYSTEMVALUES_NEO4J:()=>MWe,DBSYSTEMVALUES_NETEZZA:()=>EWe,DBSYSTEMVALUES_ORACLE:()=>ZZe,DBSYSTEMVALUES_OTHER_SQL:()=>YZe,DBSYSTEMVALUES_PERVASIVE:()=>yWe,DBSYSTEMVALUES_POINTBASE:()=>SWe,DBSYSTEMVALUES_POSTGRESQL:()=>XZe,DBSYSTEMVALUES_PROGRESS:()=>oWe,DBSYSTEMVALUES_REDIS:()=>NWe,DBSYSTEMVALUES_REDSHIFT:()=>eWe,DBSYSTEMVALUES_SQLITE:()=>TWe,DBSYSTEMVALUES_SYBASE:()=>IWe,DBSYSTEMVALUES_TERADATA:()=>bWe,DBSYSTEMVALUES_VERTICA:()=>CWe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Mrt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Lrt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Urt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Qrt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Grt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>zrt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>jrt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>lYt,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>dYt,DbCassandraConsistencyLevelValues:()=>XWe,DbSystemValues:()=>GWe,ERROR_TYPE_VALUE_OTHER:()=>Hrt,EVENT_EXCEPTION:()=>rst,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>uXe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>aXe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>sXe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>lXe,FAASINVOKEDPROVIDERVALUES_AWS:()=>dXe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>pXe,FAASINVOKEDPROVIDERVALUES_GCP:()=>fXe,FAASTRIGGERVALUES_DATASOURCE:()=>eXe,FAASTRIGGERVALUES_HTTP:()=>tXe,FAASTRIGGERVALUES_OTHER:()=>oXe,FAASTRIGGERVALUES_PUBSUB:()=>nXe,FAASTRIGGERVALUES_TIMER:()=>rXe,FaasDocumentOperationValues:()=>cXe,FaasInvokedProviderValues:()=>mXe,FaasTriggerValues:()=>iXe,HOSTARCHVALUES_AMD64:()=>Nnt,HOSTARCHVALUES_ARM32:()=>Ont,HOSTARCHVALUES_ARM64:()=>wnt,HOSTARCHVALUES_IA64:()=>knt,HOSTARCHVALUES_PPC32:()=>Pnt,HOSTARCHVALUES_PPC64:()=>Mnt,HOSTARCHVALUES_X86:()=>Lnt,HTTPFLAVORVALUES_HTTP_1_0:()=>ZXe,HTTPFLAVORVALUES_HTTP_1_1:()=>WXe,HTTPFLAVORVALUES_HTTP_2_0:()=>XXe,HTTPFLAVORVALUES_QUIC:()=>tet,HTTPFLAVORVALUES_SPDY:()=>eet,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Zrt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Wrt,HTTP_REQUEST_METHOD_VALUE_GET:()=>pYt,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Xrt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>eot,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Jrt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>tot,HTTP_REQUEST_METHOD_VALUE_POST:()=>not,HTTP_REQUEST_METHOD_VALUE_PUT:()=>fYt,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>rot,HostArchValues:()=>Unt,HttpFlavorValues:()=>net,JVM_MEMORY_TYPE_VALUE_HEAP:()=>dot,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>pot,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Aot,JVM_THREAD_STATE_VALUE_NEW:()=>mYt,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>got,JVM_THREAD_STATE_VALUE_TERMINATED:()=>hot,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>_ot,JVM_THREAD_STATE_VALUE_WAITING:()=>Eot,MESSAGETYPEVALUES_RECEIVED:()=>Bet,MESSAGETYPEVALUES_SENT:()=>Det,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>ret,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>oet,MESSAGINGOPERATIONVALUES_PROCESS:()=>aet,MESSAGINGOPERATIONVALUES_RECEIVE:()=>set,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>sit,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>ait,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>uit,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>dit,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>lit,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>cit,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>pit,METRIC_DB_CLIENT_OPERATION_DURATION:()=>fit,METRIC_DOTNET_ASSEMBLY_COUNT:()=>mit,METRIC_DOTNET_EXCEPTIONS:()=>Ait,METRIC_DOTNET_GC_COLLECTIONS:()=>git,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>hit,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>_it,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Eit,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>yit,METRIC_DOTNET_GC_PAUSE_TIME:()=>Sit,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Tit,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Iit,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>bit,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Cit,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>vit,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Rit,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>xit,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>Dit,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Bit,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>Nit,METRIC_DOTNET_TIMER_COUNT:()=>Oit,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>wit,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>kit,METRIC_JVM_CLASS_COUNT:()=>Pit,METRIC_JVM_CLASS_LOADED:()=>Mit,METRIC_JVM_CLASS_UNLOADED:()=>Lit,METRIC_JVM_CPU_COUNT:()=>Uit,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Qit,METRIC_JVM_CPU_TIME:()=>Fit,METRIC_JVM_GC_DURATION:()=>Git,METRIC_JVM_MEMORY_COMMITTED:()=>zit,METRIC_JVM_MEMORY_LIMIT:()=>jit,METRIC_JVM_MEMORY_USED:()=>Hit,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>$it,METRIC_JVM_THREAD_COUNT:()=>qit,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Vit,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Yit,METRIC_KESTREL_CONNECTION_DURATION:()=>Kit,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Jit,METRIC_KESTREL_QUEUED_REQUESTS:()=>Zit,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Wit,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Xit,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>est,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>tst,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>nst,MessageTypeValues:()=>Net,MessagingDestinationKindValues:()=>iet,MessagingOperationValues:()=>uet,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>OXe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>PXe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>BXe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>zXe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>wXe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>kXe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>FXe,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>DXe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>HXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>MXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>UXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>jXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>LXe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>QXe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>qXe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>GXe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>KXe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>VXe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>YXe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>$Xe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>NXe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>CXe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>vXe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>RXe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>IXe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>bXe,NETTRANSPORTVALUES_INPROC:()=>yXe,NETTRANSPORTVALUES_IP:()=>hXe,NETTRANSPORTVALUES_IP_TCP:()=>AXe,NETTRANSPORTVALUES_IP_UDP:()=>gXe,NETTRANSPORTVALUES_OTHER:()=>SXe,NETTRANSPORTVALUES_PIPE:()=>EXe,NETTRANSPORTVALUES_UNIX:()=>_Xe,NETWORK_TRANSPORT_VALUE_PIPE:()=>Iot,NETWORK_TRANSPORT_VALUE_QUIC:()=>bot,NETWORK_TRANSPORT_VALUE_TCP:()=>AYt,NETWORK_TRANSPORT_VALUE_UDP:()=>gYt,NETWORK_TRANSPORT_VALUE_UNIX:()=>Cot,NETWORK_TYPE_VALUE_IPV4:()=>Rot,NETWORK_TYPE_VALUE_IPV6:()=>xot,NetHostConnectionSubtypeValues:()=>JXe,NetHostConnectionTypeValues:()=>xXe,NetTransportValues:()=>TXe,OSTYPEVALUES_AIX:()=>Vnt,OSTYPEVALUES_DARWIN:()=>Gnt,OSTYPEVALUES_DRAGONFLYBSD:()=>$nt,OSTYPEVALUES_FREEBSD:()=>znt,OSTYPEVALUES_HPUX:()=>qnt,OSTYPEVALUES_LINUX:()=>Fnt,OSTYPEVALUES_NETBSD:()=>jnt,OSTYPEVALUES_OPENBSD:()=>Hnt,OSTYPEVALUES_SOLARIS:()=>Ynt,OSTYPEVALUES_WINDOWS:()=>Qnt,OSTYPEVALUES_Z_OS:()=>Knt,OTEL_STATUS_CODE_VALUE_ERROR:()=>Oot,OTEL_STATUS_CODE_VALUE_OK:()=>hYt,OsTypeValues:()=>Jnt,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>yet,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>get,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>det,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>vet,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>met,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Eet,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>bet,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>fet,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Aet,RPCGRPCSTATUSCODEVALUES_OK:()=>cet,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Tet,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>het,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>_et,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Ret,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Cet,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Iet,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>pet,RpcGrpcStatusCodeValues:()=>xet,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>iZe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>hZe,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>nZe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>WJe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>AZe,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>lZe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>uZe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>_Ze,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>sZe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>XJe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>oZe,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>cZe,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>rZe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>eZe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>tZe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>gZe,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>pZe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>fZe,SEMATTRS_AWS_DYNAMODB_SELECT:()=>aZe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>dZe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>ZJe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>mZe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>jKe,SEMATTRS_CODE_FILEPATH:()=>GJe,SEMATTRS_CODE_FUNCTION:()=>QJe,SEMATTRS_CODE_LINENO:()=>zJe,SEMATTRS_CODE_NAMESPACE:()=>FJe,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>WKe,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>rJe,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>nJe,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>eJe,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>JKe,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>ZKe,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>tJe,SEMATTRS_DB_CASSANDRA_TABLE:()=>XKe,SEMATTRS_DB_CONNECTION_STRING:()=>HKe,SEMATTRS_DB_HBASE_NAMESPACE:()=>oJe,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>qKe,SEMATTRS_DB_MONGODB_COLLECTION:()=>sJe,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>KKe,SEMATTRS_DB_NAME:()=>VKe,SEMATTRS_DB_OPERATION:()=>YKe,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>iJe,SEMATTRS_DB_SQL_TABLE:()=>aJe,SEMATTRS_DB_STATEMENT:()=>O9,SEMATTRS_DB_SYSTEM:()=>N9,SEMATTRS_DB_USER:()=>$Ke,SEMATTRS_ENDUSER_ID:()=>kJe,SEMATTRS_ENDUSER_ROLE:()=>PJe,SEMATTRS_ENDUSER_SCOPE:()=>MJe,SEMATTRS_EXCEPTION_ESCAPED:()=>dJe,SEMATTRS_EXCEPTION_MESSAGE:()=>cJe,SEMATTRS_EXCEPTION_STACKTRACE:()=>lJe,SEMATTRS_EXCEPTION_TYPE:()=>uJe,SEMATTRS_FAAS_COLDSTART:()=>EJe,SEMATTRS_FAAS_CRON:()=>_Je,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>fJe,SEMATTRS_FAAS_DOCUMENT_NAME:()=>gJe,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>mJe,SEMATTRS_FAAS_DOCUMENT_TIME:()=>AJe,SEMATTRS_FAAS_EXECUTION:()=>pJe,SEMATTRS_FAAS_INVOKED_NAME:()=>yJe,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>SJe,SEMATTRS_FAAS_INVOKED_REGION:()=>TJe,SEMATTRS_FAAS_TIME:()=>hJe,SEMATTRS_FAAS_TRIGGER:()=>w9,SEMATTRS_HTTP_CLIENT_IP:()=>JJe,SEMATTRS_HTTP_FLAVOR:()=>$Je,SEMATTRS_HTTP_HOST:()=>jJe,SEMATTRS_HTTP_METHOD:()=>AB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>VJe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>YJe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>U9,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Q9,SEMATTRS_HTTP_ROUTE:()=>F9,SEMATTRS_HTTP_SCHEME:()=>HJe,SEMATTRS_HTTP_SERVER_NAME:()=>KJe,SEMATTRS_HTTP_STATUS_CODE:()=>ky,SEMATTRS_HTTP_TARGET:()=>L9,SEMATTRS_HTTP_URL:()=>rC,SEMATTRS_HTTP_USER_AGENT:()=>qJe,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>$Ze,SEMATTRS_MESSAGE_ID:()=>HZe,SEMATTRS_MESSAGE_TYPE:()=>jZe,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>qZe,SEMATTRS_MESSAGING_CONSUMER_ID:()=>BZe,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>vZe,SEMATTRS_MESSAGING_DESTINATION:()=>EZe,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>yZe,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>kZe,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>wZe,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>OZe,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>PZe,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>MZe,SEMATTRS_MESSAGING_MESSAGE_ID:()=>CZe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>xZe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>RZe,SEMATTRS_MESSAGING_OPERATION:()=>DZe,SEMATTRS_MESSAGING_PROTOCOL:()=>TZe,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>IZe,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>NZe,SEMATTRS_MESSAGING_SYSTEM:()=>G9,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>SZe,SEMATTRS_MESSAGING_URL:()=>bZe,SEMATTRS_NET_HOST_CARRIER_ICC:()=>OJe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>BJe,SEMATTRS_NET_HOST_CARRIER_MNC:()=>NJe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>DJe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>xJe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>RJe,SEMATTRS_NET_HOST_IP:()=>P9,SEMATTRS_NET_HOST_NAME:()=>vJe,SEMATTRS_NET_HOST_PORT:()=>M9,SEMATTRS_NET_PEER_IP:()=>k9,SEMATTRS_NET_PEER_NAME:()=>CJe,SEMATTRS_NET_PEER_PORT:()=>bJe,SEMATTRS_NET_TRANSPORT:()=>IJe,SEMATTRS_PEER_SERVICE:()=>wJe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>j9,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>GZe,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>zZe,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>FZe,SEMATTRS_RPC_JSONRPC_VERSION:()=>QZe,SEMATTRS_RPC_METHOD:()=>UZe,SEMATTRS_RPC_SERVICE:()=>z9,SEMATTRS_RPC_SYSTEM:()=>LZe,SEMATTRS_THREAD_ID:()=>LJe,SEMATTRS_THREAD_NAME:()=>UJe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Uet,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Let,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Qet,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Fet,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Get,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>zet,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>jet,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>$et,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Het,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Vet,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>qet,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>wet,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Pet,SEMRESATTRS_CLOUD_PLATFORM:()=>Met,SEMRESATTRS_CLOUD_PROVIDER:()=>Oet,SEMRESATTRS_CLOUD_REGION:()=>ket,SEMRESATTRS_CONTAINER_ID:()=>Ket,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Zet,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Wet,SEMRESATTRS_CONTAINER_NAME:()=>Yet,SEMRESATTRS_CONTAINER_RUNTIME:()=>Jet,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Xet,SEMRESATTRS_DEVICE_ID:()=>ett,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>ttt,SEMRESATTRS_DEVICE_MODEL_NAME:()=>ntt,SEMRESATTRS_FAAS_ID:()=>ott,SEMRESATTRS_FAAS_INSTANCE:()=>stt,SEMRESATTRS_FAAS_MAX_MEMORY:()=>att,SEMRESATTRS_FAAS_NAME:()=>rtt,SEMRESATTRS_FAAS_VERSION:()=>itt,SEMRESATTRS_HOST_ARCH:()=>dtt,SEMRESATTRS_HOST_ID:()=>utt,SEMRESATTRS_HOST_IMAGE_ID:()=>ftt,SEMRESATTRS_HOST_IMAGE_NAME:()=>ptt,SEMRESATTRS_HOST_IMAGE_VERSION:()=>mtt,SEMRESATTRS_HOST_NAME:()=>ctt,SEMRESATTRS_HOST_TYPE:()=>ltt,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Att,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Stt,SEMRESATTRS_K8S_CRONJOB_NAME:()=>wtt,SEMRESATTRS_K8S_CRONJOB_UID:()=>Ott,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Dtt,SEMRESATTRS_K8S_DAEMONSET_UID:()=>xtt,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Ctt,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>btt,SEMRESATTRS_K8S_JOB_NAME:()=>Ntt,SEMRESATTRS_K8S_JOB_UID:()=>Btt,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>_tt,SEMRESATTRS_K8S_NODE_NAME:()=>gtt,SEMRESATTRS_K8S_NODE_UID:()=>htt,SEMRESATTRS_K8S_POD_NAME:()=>ytt,SEMRESATTRS_K8S_POD_UID:()=>Ett,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Itt,SEMRESATTRS_K8S_REPLICASET_UID:()=>Ttt,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Rtt,SEMRESATTRS_K8S_STATEFULSET_UID:()=>vtt,SEMRESATTRS_OS_DESCRIPTION:()=>Ptt,SEMRESATTRS_OS_NAME:()=>Mtt,SEMRESATTRS_OS_TYPE:()=>ktt,SEMRESATTRS_OS_VERSION:()=>Ltt,SEMRESATTRS_PROCESS_COMMAND:()=>Gtt,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>jtt,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>ztt,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Qtt,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Ftt,SEMRESATTRS_PROCESS_OWNER:()=>Htt,SEMRESATTRS_PROCESS_PID:()=>Utt,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Vtt,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>$tt,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>qtt,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Ktt,SEMRESATTRS_SERVICE_NAME:()=>Ytt,SEMRESATTRS_SERVICE_NAMESPACE:()=>H9,SEMRESATTRS_SERVICE_VERSION:()=>Jtt,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>ent,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Wtt,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Ztt,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Xtt,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>rnt,SEMRESATTRS_WEBENGINE_NAME:()=>tnt,SEMRESATTRS_WEBENGINE_VERSION:()=>nnt,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Lot,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Uot,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Qot,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Got,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>zot,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>jot,SemanticAttributes:()=>VZe,SemanticResourceAttributes:()=>ont,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Znt,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Wnt,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Xnt,TELEMETRYSDKLANGUAGEVALUES_GO:()=>ert,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>trt,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>nrt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>rrt,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>ort,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>irt,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>srt,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>_Yt,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>$ot,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>qot,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>EYt,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Vot,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Yot,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>yYt,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Kot,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Jot,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Zot,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Wot,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Xot,TelemetrySdkLanguageValues:()=>art});var Zn=O(()=>{A();ahe();wEe();kEe();PEe();MEe()});var LEe=F(QM=>{"use strict";A();Object.defineProperty(QM,"__esModule",{value:!0});QM.ATTR_PROCESS_RUNTIME_NAME=void 0;QM.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var UEe=F(GM=>{"use strict";A();Object.defineProperty(GM,"__esModule",{value:!0});GM.SDK_INFO=void 0;var ost=gpe(),FM=(Zn(),Me(Fr)),ist=LEe();GM.SDK_INFO={[FM.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[ist.ATTR_PROCESS_RUNTIME_NAME]:"node",[FM.ATTR_TELEMETRY_SDK_LANGUAGE]:FM.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[FM.ATTR_TELEMETRY_SDK_VERSION]:ost.VERSION}});var QEe=F(Wa=>{"use strict";A();Object.defineProperty(Wa,"__esModule",{value:!0});Wa.otperformance=Wa.SDK_INFO=Wa._globalThis=Wa.getStringListFromEnv=Wa.getNumberFromEnv=Wa.getBooleanFromEnv=Wa.getStringFromEnv=void 0;var zM=mpe();Object.defineProperty(Wa,"getStringFromEnv",{enumerable:!0,get:function(){return zM.getStringFromEnv}});Object.defineProperty(Wa,"getBooleanFromEnv",{enumerable:!0,get:function(){return zM.getBooleanFromEnv}});Object.defineProperty(Wa,"getNumberFromEnv",{enumerable:!0,get:function(){return zM.getNumberFromEnv}});Object.defineProperty(Wa,"getStringListFromEnv",{enumerable:!0,get:function(){return zM.getStringListFromEnv}});var sst=Ape();Object.defineProperty(Wa,"_globalThis",{enumerable:!0,get:function(){return sst._globalThis}});var ast=UEe();Object.defineProperty(Wa,"SDK_INFO",{enumerable:!0,get:function(){return ast.SDK_INFO}});Wa.otperformance=performance});var i5=F(Xa=>{"use strict";A();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.getStringListFromEnv=Xa.getNumberFromEnv=Xa.getStringFromEnv=Xa.getBooleanFromEnv=Xa.otperformance=Xa._globalThis=Xa.SDK_INFO=void 0;var Ly=QEe();Object.defineProperty(Xa,"SDK_INFO",{enumerable:!0,get:function(){return Ly.SDK_INFO}});Object.defineProperty(Xa,"_globalThis",{enumerable:!0,get:function(){return Ly._globalThis}});Object.defineProperty(Xa,"otperformance",{enumerable:!0,get:function(){return Ly.otperformance}});Object.defineProperty(Xa,"getBooleanFromEnv",{enumerable:!0,get:function(){return Ly.getBooleanFromEnv}});Object.defineProperty(Xa,"getStringFromEnv",{enumerable:!0,get:function(){return Ly.getStringFromEnv}});Object.defineProperty(Xa,"getNumberFromEnv",{enumerable:!0,get:function(){return Ly.getNumberFromEnv}});Object.defineProperty(Xa,"getStringListFromEnv",{enumerable:!0,get:function(){return Ly.getStringListFromEnv}})});var jEe=F(Gr=>{"use strict";A();Object.defineProperty(Gr,"__esModule",{value:!0});Gr.addHrTimes=Gr.isTimeInput=Gr.isTimeInputHrTime=Gr.hrTimeToSeconds=Gr.hrTimeToMilliseconds=Gr.hrTimeToMicroseconds=Gr.hrTimeToNanoseconds=Gr.hrTimeToTimeStamp=Gr.hrTimeDuration=Gr.timeInputToHrTime=Gr.hrTime=Gr.getTimeOrigin=Gr.millisToHrTime=void 0;var jM=i5(),FEe=9,ust=6,cst=Math.pow(10,ust),gB=Math.pow(10,FEe);function hB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*cst);return[n,r]}Gr.millisToHrTime=hB;function lst(){return jM.otperformance.timeOrigin}Gr.getTimeOrigin=lst;function GEe(e){let t=hB(jM.otperformance.timeOrigin),n=hB(typeof e=="number"?e:jM.otperformance.now());return zEe(t,n)}Gr.hrTime=GEe;function dst(e){if(s5(e))return e;if(typeof e=="number")return e<jM.otperformance.timeOrigin?GEe(e):hB(e);if(e instanceof Date)return hB(e.getTime());throw TypeError("Invalid input type")}Gr.timeInputToHrTime=dst;function pst(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=gB),[n,r]}Gr.hrTimeDuration=pst;function fst(e){let t=FEe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}Gr.hrTimeToTimeStamp=fst;function mst(e){return e[0]*gB+e[1]}Gr.hrTimeToNanoseconds=mst;function Ast(e){return e[0]*1e6+e[1]/1e3}Gr.hrTimeToMicroseconds=Ast;function gst(e){return e[0]*1e3+e[1]/1e6}Gr.hrTimeToMilliseconds=gst;function hst(e){return e[0]+e[1]/gB}Gr.hrTimeToSeconds=hst;function s5(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}Gr.isTimeInputHrTime=s5;function _st(e){return s5(e)||typeof e=="number"||e instanceof Date}Gr.isTimeInput=_st;function zEe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=gB&&(n[1]-=gB,n[0]+=1),n}Gr.addHrTimes=zEe});var HEe=F(HM=>{"use strict";A();Object.defineProperty(HM,"__esModule",{value:!0});HM.unrefTimer=void 0;function Est(e){typeof e!="number"&&e.unref()}HM.unrefTimer=Est});var $Ee=F(_B=>{"use strict";A();Object.defineProperty(_B,"__esModule",{value:!0});_B.ExportResultCode=void 0;var yst;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(yst=_B.ExportResultCode||(_B.ExportResultCode={}))});var VEe=F($M=>{"use strict";A();Object.defineProperty($M,"__esModule",{value:!0});$M.CompositePropagator=void 0;var qEe=(ze(),Me(We)),a5=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let n=new Set;for(let r of this._propagators){let o=typeof r.fields=="function"?r.fields():[];for(let i of o)n.add(i)}this._fields=Array.from(n)}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){qEe.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(s){qEe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};$M.CompositePropagator=a5});var YEe=F(iC=>{"use strict";A();Object.defineProperty(iC,"__esModule",{value:!0});iC.validateValue=iC.validateKey=void 0;var u5="[_0-9a-z-*/]",Sst=`[a-z]${u5}{0,255}`,Tst=`[a-z0-9]${u5}{0,240}@[a-z]${u5}{0,13}`,Ist=new RegExp(`^(?:${Sst}|${Tst})$`),bst=/^[ -~]{0,255}[!-~]$/,Cst=/,|=/;function vst(e){return Ist.test(e)}iC.validateKey=vst;function Rst(e){return bst.test(e)&&!Cst.test(e)}iC.validateValue=Rst});var l5=F(VM=>{"use strict";A();Object.defineProperty(VM,"__esModule",{value:!0});VM.TraceState=void 0;var qM=YEe(),xst=32,KEe=512,JEe=",",ZEe="=",c5=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,qM.validateKey)(t)||!(0,qM.validateValue)(n))return this;let r=this._getState(),o=r.get(t),i=this._length;if(typeof o=="string"?i+=n.length-o.length:i+=t.length+n.length+(r.size>0?2:1),i>KEe)return this;let s=new Map(r);return s.delete(t),s.set(t,n),this._fromState(s,i)}unset(t){let n=this._getState(),r=n.get(t);if(typeof r!="string")return this;let o=this._length-(t.length+r.length+1);n.size>1&&(o=o-1);let i=new Map(n);return i.delete(t),this._fromState(i,o)}get(t){return this._getState().get(t)}serialize(){let t="",n=0;for(let r of this._getState())n>0&&(t=JEe+t),t=`${r[0]}${ZEe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(JEe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(ZEe);if(s===-1)continue;let c=i.slice(0,s),l=i.slice(s+1);if(!(0,qM.validateKey)(c)||!(0,qM.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>KEe)&&(n.set(c,l),r=f,n.size>=xst))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};VM.TraceState=c5});var XEe=F(eu=>{"use strict";A();Object.defineProperty(eu,"__esModule",{value:!0});eu.W3CTraceContextPropagator=eu.parseTraceParent=eu.TRACE_STATE_HEADER=eu.TRACE_PARENT_HEADER=void 0;var YM=(ze(),Me(We)),Dst=fB(),Bst=l5();eu.TRACE_PARENT_HEADER="traceparent";eu.TRACE_STATE_HEADER="tracestate";var Nst="00",Ost="(?!ff)[\\da-f]{2}",wst="(?![0]{32})[\\da-f]{32}",kst="(?![0]{16})[\\da-f]{16}",Pst="[\\da-f]{2}",Mst=new RegExp(`^\\s?(${Ost})-(${wst})-(${kst})-(${Pst})(-.*)?\\s?$`);function WEe(e){let t=Mst.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}eu.parseTraceParent=WEe;var d5=class{inject(t,n,r){let o=YM.trace.getSpanContext(t);if(!o||(0,Dst.isTracingSuppressed)(t)||!(0,YM.isSpanContextValid)(o))return;let i=`${Nst}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||YM.TraceFlags.NONE).toString(16)}`;r.set(n,eu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,eu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,eu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=WEe(i);if(!s)return t;s.isRemote=!0;let c=r.get(n,eu.TRACE_STATE_HEADER);if(c){let l=Array.isArray(c)?c.join(","):c;s.traceState=new Bst.TraceState(typeof l=="string"?l:void 0)}return YM.trace.setSpanContext(t,s)}fields(){return[eu.TRACE_PARENT_HEADER,eu.TRACE_STATE_HEADER]}};eu.W3CTraceContextPropagator=d5});var e0e=F(tf=>{"use strict";A();Object.defineProperty(tf,"__esModule",{value:!0});tf.getRPCMetadata=tf.deleteRPCMetadata=tf.setRPCMetadata=tf.RPCType=void 0;var Lst=(ze(),Me(We)),p5=(0,Lst.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Ust;(function(e){e.HTTP="http"})(Ust=tf.RPCType||(tf.RPCType={}));function Qst(e,t){return e.setValue(p5,t)}tf.setRPCMetadata=Qst;function Fst(e){return e.deleteValue(p5)}tf.deleteRPCMetadata=Fst;function Gst(e){return e.getValue(p5)}tf.getRPCMetadata=Gst});var i0e=F(KM=>{"use strict";A();Object.defineProperty(KM,"__esModule",{value:!0});KM.isPlainObject=void 0;var zst="[object Object]",jst="[object Null]",Hst="[object Undefined]",$st=Function.prototype,t0e=$st.toString,qst=t0e.call(Object),Vst=Object.getPrototypeOf,n0e=Object.prototype,r0e=n0e.hasOwnProperty,Uy=Symbol?Symbol.toStringTag:void 0,o0e=n0e.toString;function Yst(e){if(!Kst(e)||Jst(e)!==zst)return!1;let t=Vst(e);if(t===null)return!0;let n=r0e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&t0e.call(n)===qst}KM.isPlainObject=Yst;function Kst(e){return e!=null&&typeof e=="object"}function Jst(e){return e==null?e===void 0?Hst:jst:Uy&&Uy in Object(e)?Zst(e):Wst(e)}function Zst(e){let t=r0e.call(e,Uy),n=e[Uy],r=!1;try{e[Uy]=void 0,r=!0}catch{}let o=o0e.call(e);return r&&(t?e[Uy]=n:delete e[Uy]),o}function Wst(e){return o0e.call(e)}});var l0e=F(WM=>{"use strict";A();Object.defineProperty(WM,"__esModule",{value:!0});WM.merge=void 0;var s0e=i0e(),Xst=20;function eat(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=u0e(t,e.shift(),0,n);return t}WM.merge=eat;function f5(e){return ZM(e)?e.slice():e}function u0e(e,t,n=0,r){let o;if(!(n>Xst)){if(n++,JM(e)||JM(t)||c0e(t))o=f5(t);else if(ZM(e)){if(o=e.slice(),ZM(t))for(let i=0,s=t.length;i<s;i++)o.push(f5(t[i]));else if(EB(t)){let i=Object.keys(t);for(let s=0,c=i.length;s<c;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=f5(t[l]))}}}else if(EB(e))if(EB(t)){if(!tat(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,c=i.length;s<c;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(JM(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],y=f;if(a0e(e,l,r)||a0e(t,l,r))delete o[l];else{if(EB(h)&&EB(y)){let S=r.get(h)||[],b=r.get(y)||[];S.push({obj:e,key:l}),b.push({obj:t,key:l}),r.set(h,S),r.set(y,b)}o[l]=u0e(o[l],f,n,r)}}}}else o=t;return o}}function a0e(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let s=r[o];if(s.key===t&&s.obj===e)return!0}return!1}function ZM(e){return Array.isArray(e)}function c0e(e){return typeof e=="function"}function EB(e){return!JM(e)&&!ZM(e)&&!c0e(e)&&typeof e=="object"}function JM(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function tat(e,t){return!(!(0,s0e.isPlainObject)(e)||!(0,s0e.isPlainObject)(t))}});var d0e=F(sC=>{"use strict";A();Object.defineProperty(sC,"__esModule",{value:!0});sC.callWithTimeout=sC.TimeoutError=void 0;var XM=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};sC.TimeoutError=XM;function nat(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new XM("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}sC.callWithTimeout=nat});var f0e=F(aC=>{"use strict";A();Object.defineProperty(aC,"__esModule",{value:!0});aC.isUrlIgnored=aC.urlMatches=void 0;function p0e(e,t){return typeof t=="string"?e===t:!!e.match(t)}aC.urlMatches=p0e;function rat(e,t){if(!t)return!1;for(let n of t)if(p0e(e,n))return!0;return!1}aC.isUrlIgnored=rat});var m0e=F(eL=>{"use strict";A();Object.defineProperty(eL,"__esModule",{value:!0});eL.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)}};eL.Deferred=m5});var A0e=F(tL=>{"use strict";A();Object.defineProperty(tL,"__esModule",{value:!0});tL.BindOnceFuture=void 0;var oat=m0e(),A5=class{_isCalled=!1;_deferred=new oat.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}};tL.BindOnceFuture=A5});var h0e=F(nL=>{"use strict";A();Object.defineProperty(nL,"__esModule",{value:!0});nL.diagLogLevelFromString=void 0;var mg=(ze(),Me(We)),g0e={ALL:mg.DiagLogLevel.ALL,VERBOSE:mg.DiagLogLevel.VERBOSE,DEBUG:mg.DiagLogLevel.DEBUG,INFO:mg.DiagLogLevel.INFO,WARN:mg.DiagLogLevel.WARN,ERROR:mg.DiagLogLevel.ERROR,NONE:mg.DiagLogLevel.NONE};function iat(e){if(e==null)return;let t=g0e[e.toUpperCase()];return t??(mg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(g0e)}, using default`),mg.DiagLogLevel.INFO)}nL.diagLogLevelFromString=iat});var E0e=F(rL=>{"use strict";A();Object.defineProperty(rL,"__esModule",{value:!0});rL._export=void 0;var _0e=(ze(),Me(We)),sat=fB();function aat(e,t){return new Promise(n=>{_0e.context.with((0,sat.suppressTracing)(_0e.context.active()),()=>{e.export(t,n)})})}rL._export=aat});var br=F(Ne=>{"use strict";A();Object.defineProperty(Ne,"__esModule",{value:!0});Ne.diagLogLevelFromString=Ne.BindOnceFuture=Ne.urlMatches=Ne.isUrlIgnored=Ne.callWithTimeout=Ne.TimeoutError=Ne.merge=Ne.TraceState=Ne.unsuppressTracing=Ne.suppressTracing=Ne.isTracingSuppressed=Ne.setRPCMetadata=Ne.getRPCMetadata=Ne.deleteRPCMetadata=Ne.RPCType=Ne.parseTraceParent=Ne.W3CTraceContextPropagator=Ne.TRACE_STATE_HEADER=Ne.TRACE_PARENT_HEADER=Ne.CompositePropagator=Ne.otperformance=Ne.getStringListFromEnv=Ne.getNumberFromEnv=Ne.getBooleanFromEnv=Ne.getStringFromEnv=Ne._globalThis=Ne.SDK_INFO=Ne.parseKeyPairsIntoRecord=Ne.ExportResultCode=Ne.unrefTimer=Ne.timeInputToHrTime=Ne.millisToHrTime=Ne.isTimeInputHrTime=Ne.isTimeInput=Ne.hrTimeToTimeStamp=Ne.hrTimeToSeconds=Ne.hrTimeToNanoseconds=Ne.hrTimeToMilliseconds=Ne.hrTimeToMicroseconds=Ne.hrTimeDuration=Ne.hrTime=Ne.getTimeOrigin=Ne.addHrTimes=Ne.loggingErrorHandler=Ne.setGlobalErrorHandler=Ne.globalErrorHandler=Ne.sanitizeAttributes=Ne.isAttributeValue=Ne.AnchoredClock=Ne.W3CBaggagePropagator=void 0;Ne.internal=void 0;var uat=npe();Object.defineProperty(Ne,"W3CBaggagePropagator",{enumerable:!0,get:function(){return uat.W3CBaggagePropagator}});var cat=rpe();Object.defineProperty(Ne,"AnchoredClock",{enumerable:!0,get:function(){return cat.AnchoredClock}});var y0e=upe();Object.defineProperty(Ne,"isAttributeValue",{enumerable:!0,get:function(){return y0e.isAttributeValue}});Object.defineProperty(Ne,"sanitizeAttributes",{enumerable:!0,get:function(){return y0e.sanitizeAttributes}});var S0e=lpe();Object.defineProperty(Ne,"globalErrorHandler",{enumerable:!0,get:function(){return S0e.globalErrorHandler}});Object.defineProperty(Ne,"setGlobalErrorHandler",{enumerable:!0,get:function(){return S0e.setGlobalErrorHandler}});var lat=D9();Object.defineProperty(Ne,"loggingErrorHandler",{enumerable:!0,get:function(){return lat.loggingErrorHandler}});var Nl=jEe();Object.defineProperty(Ne,"addHrTimes",{enumerable:!0,get:function(){return Nl.addHrTimes}});Object.defineProperty(Ne,"getTimeOrigin",{enumerable:!0,get:function(){return Nl.getTimeOrigin}});Object.defineProperty(Ne,"hrTime",{enumerable:!0,get:function(){return Nl.hrTime}});Object.defineProperty(Ne,"hrTimeDuration",{enumerable:!0,get:function(){return Nl.hrTimeDuration}});Object.defineProperty(Ne,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Nl.hrTimeToMicroseconds}});Object.defineProperty(Ne,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Nl.hrTimeToMilliseconds}});Object.defineProperty(Ne,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Nl.hrTimeToNanoseconds}});Object.defineProperty(Ne,"hrTimeToSeconds",{enumerable:!0,get:function(){return Nl.hrTimeToSeconds}});Object.defineProperty(Ne,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Nl.hrTimeToTimeStamp}});Object.defineProperty(Ne,"isTimeInput",{enumerable:!0,get:function(){return Nl.isTimeInput}});Object.defineProperty(Ne,"isTimeInputHrTime",{enumerable:!0,get:function(){return Nl.isTimeInputHrTime}});Object.defineProperty(Ne,"millisToHrTime",{enumerable:!0,get:function(){return Nl.millisToHrTime}});Object.defineProperty(Ne,"timeInputToHrTime",{enumerable:!0,get:function(){return Nl.timeInputToHrTime}});var dat=HEe();Object.defineProperty(Ne,"unrefTimer",{enumerable:!0,get:function(){return dat.unrefTimer}});var pat=$Ee();Object.defineProperty(Ne,"ExportResultCode",{enumerable:!0,get:function(){return pat.ExportResultCode}});var fat=C9();Object.defineProperty(Ne,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return fat.parseKeyPairsIntoRecord}});var Qy=i5();Object.defineProperty(Ne,"SDK_INFO",{enumerable:!0,get:function(){return Qy.SDK_INFO}});Object.defineProperty(Ne,"_globalThis",{enumerable:!0,get:function(){return Qy._globalThis}});Object.defineProperty(Ne,"getStringFromEnv",{enumerable:!0,get:function(){return Qy.getStringFromEnv}});Object.defineProperty(Ne,"getBooleanFromEnv",{enumerable:!0,get:function(){return Qy.getBooleanFromEnv}});Object.defineProperty(Ne,"getNumberFromEnv",{enumerable:!0,get:function(){return Qy.getNumberFromEnv}});Object.defineProperty(Ne,"getStringListFromEnv",{enumerable:!0,get:function(){return Qy.getStringListFromEnv}});Object.defineProperty(Ne,"otperformance",{enumerable:!0,get:function(){return Qy.otperformance}});var mat=VEe();Object.defineProperty(Ne,"CompositePropagator",{enumerable:!0,get:function(){return mat.CompositePropagator}});var oL=XEe();Object.defineProperty(Ne,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return oL.TRACE_PARENT_HEADER}});Object.defineProperty(Ne,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return oL.TRACE_STATE_HEADER}});Object.defineProperty(Ne,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return oL.W3CTraceContextPropagator}});Object.defineProperty(Ne,"parseTraceParent",{enumerable:!0,get:function(){return oL.parseTraceParent}});var iL=e0e();Object.defineProperty(Ne,"RPCType",{enumerable:!0,get:function(){return iL.RPCType}});Object.defineProperty(Ne,"deleteRPCMetadata",{enumerable:!0,get:function(){return iL.deleteRPCMetadata}});Object.defineProperty(Ne,"getRPCMetadata",{enumerable:!0,get:function(){return iL.getRPCMetadata}});Object.defineProperty(Ne,"setRPCMetadata",{enumerable:!0,get:function(){return iL.setRPCMetadata}});var g5=fB();Object.defineProperty(Ne,"isTracingSuppressed",{enumerable:!0,get:function(){return g5.isTracingSuppressed}});Object.defineProperty(Ne,"suppressTracing",{enumerable:!0,get:function(){return g5.suppressTracing}});Object.defineProperty(Ne,"unsuppressTracing",{enumerable:!0,get:function(){return g5.unsuppressTracing}});var Aat=l5();Object.defineProperty(Ne,"TraceState",{enumerable:!0,get:function(){return Aat.TraceState}});var gat=l0e();Object.defineProperty(Ne,"merge",{enumerable:!0,get:function(){return gat.merge}});var T0e=d0e();Object.defineProperty(Ne,"TimeoutError",{enumerable:!0,get:function(){return T0e.TimeoutError}});Object.defineProperty(Ne,"callWithTimeout",{enumerable:!0,get:function(){return T0e.callWithTimeout}});var I0e=f0e();Object.defineProperty(Ne,"isUrlIgnored",{enumerable:!0,get:function(){return I0e.isUrlIgnored}});Object.defineProperty(Ne,"urlMatches",{enumerable:!0,get:function(){return I0e.urlMatches}});var hat=A0e();Object.defineProperty(Ne,"BindOnceFuture",{enumerable:!0,get:function(){return hat.BindOnceFuture}});var _at=h0e();Object.defineProperty(Ne,"diagLogLevelFromString",{enumerable:!0,get:function(){return _at.diagLogLevelFromString}});var Eat=E0e();Ne.internal={_export:Eat._export}});var b0e=F(sL=>{"use strict";A();Object.defineProperty(sL,"__esModule",{value:!0});sL.VERSION=void 0;sL.VERSION="0.214.0"});var C0e=F(yB=>{"use strict";A();Object.defineProperty(yB,"__esModule",{value:!0});yB.SeverityNumber=void 0;var yat;(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"})(yat=yB.SeverityNumber||(yB.SeverityNumber={}))});var uL=F(uC=>{"use strict";A();Object.defineProperty(uC,"__esModule",{value:!0});uC.NOOP_LOGGER=uC.NoopLogger=void 0;var aL=class{emit(t){}};uC.NoopLogger=aL;uC.NOOP_LOGGER=new aL});var v0e=F(ym=>{"use strict";A();Object.defineProperty(ym,"__esModule",{value:!0});ym.API_BACKWARDS_COMPATIBILITY_VERSION=ym.makeGetter=ym._global=ym.GLOBAL_LOGS_API_KEY=void 0;ym.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");ym._global=globalThis;function Sat(e,t,n){return r=>r===e?t:n}ym.makeGetter=Sat;ym.API_BACKWARDS_COMPATIBILITY_VERSION=1});var h5=F(cC=>{"use strict";A();Object.defineProperty(cC,"__esModule",{value:!0});cC.NOOP_LOGGER_PROVIDER=cC.NoopLoggerProvider=void 0;var Tat=uL(),cL=class{getLogger(t,n,r){return new Tat.NoopLogger}};cC.NoopLoggerProvider=cL;cC.NOOP_LOGGER_PROVIDER=new cL});var R0e=F(lL=>{"use strict";A();Object.defineProperty(lL,"__esModule",{value:!0});lL.ProxyLogger=void 0;var Iat=uL(),_5=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):Iat.NOOP_LOGGER}};lL.ProxyLogger=_5});var x0e=F(dL=>{"use strict";A();Object.defineProperty(dL,"__esModule",{value:!0});dL.ProxyLoggerProvider=void 0;var bat=h5(),Cat=R0e(),E5=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Cat.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:bat.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)}};dL.ProxyLoggerProvider=E5});var B0e=F(pL=>{"use strict";A();Object.defineProperty(pL,"__esModule",{value:!0});pL.LogsAPI=void 0;var Pd=v0e(),vat=h5(),D0e=x0e(),y5=class e{constructor(){this._proxyLoggerProvider=new D0e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Pd._global[Pd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Pd._global[Pd.GLOBAL_LOGS_API_KEY]=(0,Pd.makeGetter)(Pd.API_BACKWARDS_COMPATIBILITY_VERSION,t,vat.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Pd._global[Pd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Pd._global,Pd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Pd._global[Pd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new D0e.ProxyLoggerProvider}};pL.LogsAPI=y5});var S5=F(Sm=>{"use strict";A();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.logs=Sm.NoopLogger=Sm.NOOP_LOGGER=Sm.SeverityNumber=void 0;var Rat=C0e();Object.defineProperty(Sm,"SeverityNumber",{enumerable:!0,get:function(){return Rat.SeverityNumber}});var N0e=uL();Object.defineProperty(Sm,"NOOP_LOGGER",{enumerable:!0,get:function(){return N0e.NOOP_LOGGER}});Object.defineProperty(Sm,"NoopLogger",{enumerable:!0,get:function(){return N0e.NoopLogger}});var xat=B0e();Sm.logs=xat.LogsAPI.getInstance()});var O0e=F(lC=>{"use strict";A();Object.defineProperty(lC,"__esModule",{value:!0});lC.disableInstrumentations=lC.enableInstrumentations=void 0;function Dat(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}lC.enableInstrumentations=Dat;function Bat(e){e.forEach(t=>t.disable())}lC.disableInstrumentations=Bat});var P0e=F(fL=>{"use strict";A();Object.defineProperty(fL,"__esModule",{value:!0});fL.registerInstrumentations=void 0;var w0e=(ze(),Me(We)),Nat=S5(),k0e=O0e();function Oat(e){let t=e.tracerProvider||w0e.trace.getTracerProvider(),n=e.meterProvider||w0e.metrics.getMeterProvider(),r=e.loggerProvider||Nat.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,k0e.enableInstrumentations)(o,t,n,r),()=>{(0,k0e.disableInstrumentations)(o)}}fL.registerInstrumentations=Oat});var H0e=F(mL=>{"use strict";A();Object.defineProperty(mL,"__esModule",{value:!0});mL.satisfies=void 0;var C5=(ze(),Me(We)),F0e=/^(?: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-]+)*))?$/,wat=/^(?<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-]+)*))?$/,kat={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Pat(e,t,n){if(!Mat(e))return C5.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Fat(e);if(!r)return!1;let o=[],i=G0e(r,t,o,n);return i&&!n?.includePrerelease?Uat(r,o):i}mL.satisfies=Pat;function Mat(e){return typeof e=="string"&&F0e.test(e)}function G0e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(T5(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=aut(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!T5(e,i,n,r))return!1;return!0}return T5(e,t,n,r)}function T5(e,t,n,r){if(t=Qat(t,r),t.includes(" "))return G0e(e,t,n,r);{let o=Gat(t);return n.push(o),Lat(e,o)}}function Lat(e,t){if(t.invalid)return!1;if(!t.version||b5(t.version))return!0;let n=L0e(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=L0e(r,o)}return kat[t.op]?.includes(n)}function Uat(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Qat(e,t){return e=e.trim(),e=iut(e,t),e=out(e),e=sut(e,t),e=e.trim(),e}function Mu(e){return!e||e.toLowerCase()==="x"||e==="*"}function Fat(e){let t=e.match(F0e);if(!t){C5.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function Gat(e){if(!e)return{};let t=e.match(wat);if(!t)return C5.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function b5(e){return e==="*"||e==="x"||e==="X"}function M0e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function zat(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 jat(e,t){if(b5(e)||b5(t))return 0;let[n,r]=zat(M0e(e),M0e(t));return n>r?1:n<r?-1:0}function L0e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=jat(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var z0e="[a-zA-Z0-9-]",j0e="0|[1-9]\\d*",Hat=`\\d*[a-zA-Z-]${z0e}*`,$at="((?:<|>)?=?)",U0e=`(?:${j0e}|${Hat})`,qat=`(?:-(${U0e}(?:\\.${U0e})*))`,Q0e=`${z0e}+`,Vat=`(?:\\+(${Q0e}(?:\\.${Q0e})*))`,I5=`${j0e}|x|X|\\*`,SB=`[v=\\s]*(${I5})(?:\\.(${I5})(?:\\.(${I5})(?:${qat})?${Vat}?)?)?`,Yat=`^${$at}\\s*${SB}$`,Kat=new RegExp(Yat),Jat=`^\\s*(${SB})\\s+-\\s+(${SB})\\s*$`,Zat=new RegExp(Jat),Wat="(?:~>?)",Xat=`^${Wat}${SB}$`,eut=new RegExp(Xat),tut="(?:\\^)",nut=`^${tut}${SB}$`,rut=new RegExp(nut);function out(e){let t=eut;return e.replace(t,(n,r,o,i,s)=>{let c;return Mu(r)?c="":Mu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Mu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?c=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function iut(e,t){let n=rut,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,c,l)=>{let f;return Mu(i)?f="":Mu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Mu(c)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${c}-${l} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${c}${r} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c} <${+i+1}.0.0-0`,f})}function sut(e,t){let n=Kat;return e.replace(n,(r,o,i,s,c,l)=>{let f=Mu(i),h=f||Mu(s),y=h||Mu(c),S=y;return o==="="&&S&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&S?(h&&(s=0),c=0,o===">"?(o=">=",h?(i=+i+1,s=0,c=0):(s=+s+1,c=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${c}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:y&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function aut(e,t){let n=Zat;return e.replace(n,(r,o,i,s,c,l,f,h,y,S,b,v)=>(Mu(i)?o="":Mu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Mu(c)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Mu(y)?h="":Mu(S)?h=`<${+y+1}.0.0-0`:Mu(b)?h=`<${y}.${+S+1}.0-0`:v?h=`<=${y}.${S}.${b}-${v}`:t?.includePrerelease?h=`<${y}.${S}.${+b+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var v5=F(Ia=>{"use strict";A();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.massUnwrap=Ia.unwrap=Ia.massWrap=Ia.wrap=void 0;var Lu=console.error.bind(console);function TB(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 uut=(e,t,n)=>{if(!e||!e[t]){Lu("no original function "+String(t)+" to wrap");return}if(!n){Lu("no wrapper function"),Lu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){Lu("original object and wrapper must be functions");return}let o=n(r,t);return TB(o,"__original",r),TB(o,"__unwrap",()=>{e[t]===o&&TB(e,t,r)}),TB(o,"__wrapped",!0),TB(e,t,o),o};Ia.wrap=uut;var cut=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Lu("must provide one or more modules to patch"),Lu(new Error().stack);return}if(!(t&&Array.isArray(t))){Lu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ia.wrap)(r,o,n)})})};Ia.massWrap=cut;var lut=(e,t)=>{if(!e||!e[t]){Lu("no function to unwrap."),Lu(new Error().stack);return}let n=e[t];if(!n.__unwrap)Lu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ia.unwrap=lut;var dut=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Lu("must provide one or more modules to patch"),Lu(new Error().stack);return}if(!(t&&Array.isArray(t))){Lu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ia.unwrap)(n,r)})})};Ia.massUnwrap=dut;function IB(e){e&&e.logger&&(typeof e.logger!="function"?Lu("new logger isn't a function, not replacing"):Lu=e.logger)}Ia.default=IB;IB.wrap=Ia.wrap;IB.massWrap=Ia.massWrap;IB.unwrap=Ia.unwrap;IB.massUnwrap=Ia.massUnwrap});var $0e=F(gL=>{"use strict";A();Object.defineProperty(gL,"__esModule",{value:!0});gL.InstrumentationAbstract=void 0;var R5=(ze(),Me(We)),put=S5(),AL=v5(),x5=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=R5.diag.createComponentLogger({namespace:t}),this._tracer=R5.trace.getTracer(t,n),this._meter=R5.metrics.getMeter(t,n),this._logger=put.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=AL.wrap;_unwrap=AL.unwrap;_massWrap=AL.massWrap;_massUnwrap=AL.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)}}};gL.InstrumentationAbstract=x5});var V0e=F((KKt,q0e)=>{A();var dC=1e3,pC=dC*60,fC=pC*60,Fy=fC*24,fut=Fy*7,mut=Fy*365.25;q0e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Aut(e);if(n==="number"&&isFinite(e))return t.long?hut(e):gut(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Aut(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*mut;case"weeks":case"week":case"w":return n*fut;case"days":case"day":case"d":return n*Fy;case"hours":case"hour":case"hrs":case"hr":case"h":return n*fC;case"minutes":case"minute":case"mins":case"min":case"m":return n*pC;case"seconds":case"second":case"secs":case"sec":case"s":return n*dC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function gut(e){var t=Math.abs(e);return t>=Fy?Math.round(e/Fy)+"d":t>=fC?Math.round(e/fC)+"h":t>=pC?Math.round(e/pC)+"m":t>=dC?Math.round(e/dC)+"s":e+"ms"}function hut(e){var t=Math.abs(e);return t>=Fy?hL(e,t,Fy,"day"):t>=fC?hL(e,t,fC,"hour"):t>=pC?hL(e,t,pC,"minute"):t>=dC?hL(e,t,dC,"second"):e+" ms"}function hL(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var D5=F((ZKt,Y0e)=>{A();function _ut(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=c,n.humanize=V0e(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let y=0;for(let S=0;S<h.length;S++)y=(y<<5)-y+h.charCodeAt(S),y|=0;return n.colors[Math.abs(y)%n.colors.length]}n.selectColor=t;function n(h){let y,S=null,b,v;function x(...D){if(!x.enabled)return;let k=x,Q=Number(new Date),z=Q-(y||Q);k.diff=z,k.prev=y,k.curr=Q,y=Q,D[0]=n.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let G=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(ie,ge)=>{if(ie==="%%")return"%";G++;let Ce=n.formatters[ge];if(typeof Ce=="function"){let ve=D[G];ie=Ce.call(k,ve),D.splice(G,1),G--}return ie}),n.formatArgs.call(k,D),(k.log||n.log).apply(k,D)}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:()=>S!==null?S:(b!==n.namespaces&&(b=n.namespaces,v=n.enabled(h)),v),set:D=>{S=D}}),typeof n.init=="function"&&n.init(x),x}function r(h,y){let S=n(this.namespace+(typeof y>"u"?":":y)+h);return S.log=this.log,S}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let y=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let S of y)S[0]==="-"?n.skips.push(S.slice(1)):n.names.push(S)}function i(h,y){let S=0,b=0,v=-1,x=0;for(;S<h.length;)if(b<y.length&&(y[b]===h[S]||y[b]==="*"))y[b]==="*"?(v=b,x=S,b++):(S++,b++);else if(v!==-1)b=v+1,x++,S=x;else return!1;for(;b<y.length&&y[b]==="*";)b++;return b===y.length}function s(){let h=[...n.names,...n.skips.map(y=>"-"+y)].join(",");return n.enable(""),h}function c(h){for(let y of n.skips)if(i(h,y))return!1;for(let y of n.names)if(i(h,y))return!0;return!1}function l(h){return h instanceof Error?h.stack||h.message:h}function f(){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}Y0e.exports=_ut});var K0e=F((Oc,_L)=>{A();Oc.formatArgs=yut;Oc.save=Sut;Oc.load=Tut;Oc.useColors=Eut;Oc.storage=Iut();Oc.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`."))}})();Oc.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 Eut(){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 yut(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+_L.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)}Oc.log=console.debug||console.log||(()=>{});function Sut(e){try{e?Oc.storage.setItem("debug",e):Oc.storage.removeItem("debug")}catch{}}function Tut(){let e;try{e=Oc.storage.getItem("debug")||Oc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Iut(){try{return localStorage}catch{}}_L.exports=D5()(Oc);var{formatters:but}=_L.exports;but.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Z0e=F((eJt,J0e)=>{"use strict";A();J0e.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 eye=F((nJt,X0e)=>{"use strict";A();var Cut=Fe("os"),W0e=Fe("tty"),Md=Z0e(),{env:Vs}=process,d_;Md("no-color")||Md("no-colors")||Md("color=false")||Md("color=never")?d_=0:(Md("color")||Md("colors")||Md("color=true")||Md("color=always"))&&(d_=1);"FORCE_COLOR"in Vs&&(Vs.FORCE_COLOR==="true"?d_=1:Vs.FORCE_COLOR==="false"?d_=0:d_=Vs.FORCE_COLOR.length===0?1:Math.min(parseInt(Vs.FORCE_COLOR,10),3));function B5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function N5(e,t){if(d_===0)return 0;if(Md("color=16m")||Md("color=full")||Md("color=truecolor"))return 3;if(Md("color=256"))return 2;if(e&&!t&&d_===void 0)return 0;let n=d_||0;if(Vs.TERM==="dumb")return n;if(process.platform==="win32"){let r=Cut.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Vs)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Vs)||Vs.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Vs)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Vs.TEAMCITY_VERSION)?1:0;if(Vs.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Vs){let r=parseInt((Vs.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Vs.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Vs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Vs.TERM)||"COLORTERM"in Vs?1:n}function vut(e){let t=N5(e,e&&e.isTTY);return B5(t)}X0e.exports={supportsColor:vut,stdout:B5(N5(!0,W0e.isatty(1))),stderr:B5(N5(!0,W0e.isatty(2)))}});var nye=F((Ys,yL)=>{A();var Rut=Fe("tty"),EL=Fe("util");Ys.init=kut;Ys.log=Nut;Ys.formatArgs=Dut;Ys.save=Out;Ys.load=wut;Ys.useColors=xut;Ys.destroy=EL.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ys.colors=[6,2,3,4,5,1];try{let e=eye();e&&(e.stderr||e).level>=2&&(Ys.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{}Ys.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 xut(){return"colors"in Ys.inspectOpts?!!Ys.inspectOpts.colors:Rut.isatty(process.stderr.fd)}function Dut(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 VYe=Object.create;var lM=Object.defineProperty;var YYe=Object.getOwnPropertyDescriptor;var KYe=Object.getOwnPropertyNames;var JYe=Object.getPrototypeOf,ZYe=Object.prototype.hasOwnProperty;var Fe=(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,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var F=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},$s=(e,t)=>{for(var n in t)lM(e,n,{get:t[n],enumerable:!0})},ide=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of KYe(t))!ZYe.call(e,o)&&o!==n&&lM(e,o,{get:()=>t[o],enumerable:!(r=YYe(t,o))||r.enumerable});return e};var se=(e,t,n)=>(n=e!=null?VYe(JYe(e)):{},ide(t||!e||!e.__esModule?lM(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>ide(lM({},"__esModule",{value:!0}),e);var A=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.159"}}catch{}})()});var lg,z$=O(()=>{A();lg="1.9.1"});function WYe(e){let t=new Set([e]),n=new Set,r=e.match(ude);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(l){return l===e};function i(c){return n.add(c),!1}function s(c){return t.add(c),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(ude);if(!f)return i(l);let h={major:+f[1],minor:+f[2],patch:+f[3],prerelease:f[4]};return h.prerelease!=null||o.major!==h.major?i(l):o.major===0?o.minor===h.minor&&o.patch<=h.patch?s(l):i(l):o.minor<=h.minor?s(l):i(l)}}var ude,cde,lde=O(()=>{A();z$();ude=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;cde=WYe(lg)});function mm(e,t,n,r=!1){var o;let i=sB[iB]=(o=sB[iB])!==null&&o!==void 0?o:{version:lg};if(!r&&i[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(i.version!==lg){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${lg}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${lg}.`),!0}function xl(e){var t,n;let r=(t=sB[iB])===null||t===void 0?void 0:t.version;if(!(!r||!cde(r)))return(n=sB[iB])===null||n===void 0?void 0:n[e]}function Am(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${lg}.`);let n=sB[iB];n&&delete n[e]}var XYe,iB,sB,By=O(()=>{A();z$();lde();XYe=lg.split(".")[0],iB=Symbol.for(`opentelemetry.js.api.${XYe}`),sB=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function aB(e,t,n){let r=xl("diag");if(r)return r[e](t,...n)}var dM,dde=O(()=>{A();By();dM=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return aB("debug",this._namespace,t)}error(...t){return aB("error",this._namespace,t)}info(...t){return aB("info",this._namespace,t)}warn(...t){return aB("warn",this._namespace,t)}verbose(...t){return aB("verbose",this._namespace,t)}}});var ys,pM=O(()=>{A();(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"})(ys||(ys={}))});function pde(e,t){e<ys.NONE?e=ys.NONE:e>ys.ALL&&(e=ys.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",ys.ERROR),warn:n("warn",ys.WARN),info:n("info",ys.INFO),debug:n("debug",ys.DEBUG),verbose:n("verbose",ys.VERBOSE)}}var fde=O(()=>{A();pM()});var eKe,qs,Ny=O(()=>{A();dde();fde();pM();By();eKe="diag",qs=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=xl("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:ys.INFO})=>{var s,c,l;if(o===n){let y=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=y.stack)!==null&&s!==void 0?s:y.message),!1}typeof i=="number"&&(i={logLevel:i});let f=xl("diag"),h=pde((c=i.logLevel)!==null&&c!==void 0?c:ys.INFO,o);if(f&&!i.suppressOverrideMessage){let y=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${y}`),h.warn(`Current logger will overwrite one already registered from ${y}`)}return mm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Am(eKe,n)},n.createComponentLogger=o=>new dM(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var fM,mde=O(()=>{A();fM=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 Ade,gde=O(()=>{A();Ade=Symbol("BaggageEntryMetadata")});function hde(e={}){return new fM(new Map(Object.entries(e)))}function _de(e){return typeof e!="string"&&(tKe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Ade,toString(){return e}}}var tKe,j$=O(()=>{A();Ny();mde();gde();tKe=qs.instance()});function Dl(e){return Symbol.for(e)}var H$,Wb,uB=O(()=>{A();H$=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}}},Wb=new H$});var $$,q$,mM,Ede=O(()=>{A();$$=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],q$={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(q$[t]=console[t])}mM=class{constructor(){function t(n){return function(...r){let o=q$[n];if(typeof o!="function"&&(o=q$.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<$$.length;n++)this[$$[n].n]=t($$[n].c)}}});function yde(){return t9}var V$,Xb,Y$,K$,J$,Z$,cB,W$,X$,e9,t9,nKe,rKe,oKe,iKe,sKe,aKe,uKe,n9=O(()=>{A();V$=class{constructor(){}createGauge(t,n){return rKe}createHistogram(t,n){return oKe}createCounter(t,n){return nKe}createUpDownCounter(t,n){return iKe}createObservableGauge(t,n){return aKe}createObservableCounter(t,n){return sKe}createObservableUpDownCounter(t,n){return uKe}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},Xb=class{},Y$=class extends Xb{add(t,n){}},K$=class extends Xb{add(t,n){}},J$=class extends Xb{record(t,n){}},Z$=class extends Xb{record(t,n){}},cB=class{addCallback(t){}removeCallback(t){}},W$=class extends cB{},X$=class extends cB{},e9=class extends cB{},t9=new V$,nKe=new Y$,rKe=new J$,oKe=new Z$,iKe=new K$,sKe=new W$,aKe=new X$,uKe=new e9});var AM,Sde=O(()=>{A();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(AM||(AM={}))});var gM,hM,r9=O(()=>{A();gM={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},hM={set(e,t,n){e!=null&&(e[t]=n)}}});var _M,Tde=O(()=>{A();uB();_M=class{active(){return Wb}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var o9,cKe,gm,lB=O(()=>{A();Tde();By();Ny();o9="context",cKe=new _M,gm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return mm(o9,t,qs.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 xl(o9)||cKe}disable(){this._getContextManager().disable(),Am(o9,qs.instance())}}});var Ja,i9=O(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Ja||(Ja={}))});var dB,Oy,EM,yM=O(()=>{A();i9();dB="0000000000000000",Oy="00000000000000000000000000000000",EM={traceId:Oy,spanId:dB,traceFlags:Ja.NONE}});var hm,SM=O(()=>{A();yM();hm=class{constructor(t=EM){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 TM(e){return e.getValue(s9)||void 0}function Ide(){return TM(gm.getInstance().active())}function pB(e,t){return e.setValue(s9,t)}function bde(e){return e.deleteValue(s9)}function Cde(e,t){return pB(e,new hm(t))}function IM(e){var t;return(t=TM(e))===null||t===void 0?void 0:t.spanContext()}var s9,a9=O(()=>{A();uB();SM();lB();s9=Dl("OpenTelemetry Context Key SPAN")});function vde(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(bM[e.charCodeAt(r)]|0)+(bM[e.charCodeAt(r+1)]|0)+(bM[e.charCodeAt(r+2)]|0)+(bM[e.charCodeAt(r+3)]|0);return n===t}function u9(e){return vde(e,32)&&e!==Oy}function c9(e){return vde(e,16)&&e!==dB}function dg(e){return u9(e.traceId)&&c9(e.spanId)}function Rde(e){return new hm(e)}var bM,CM=O(()=>{A();yM();SM();bM=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 lKe(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 l9,eC,d9=O(()=>{A();lB();a9();SM();CM();l9=gm.getInstance(),eC=class{startSpan(t,n,r=l9.active()){if(!!n?.root)return new hm;let i=r&&IM(r);return lKe(i)&&dg(i)?new hm(i):new hm}startActiveSpan(t,n,r,o){let i,s,c;if(arguments.length<2)return;arguments.length===2?c=n:arguments.length===3?(i=n,c=r):(i=n,s=r,c=o);let l=s??l9.active(),f=this.startSpan(t,i,l),h=pB(l,f);return l9.with(h,c,void 0,f)}}});var dKe,tC,p9=O(()=>{A();d9();dKe=new eC,tC=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):dKe}}});var vM,xde=O(()=>{A();d9();vM=class{getTracer(t,n,r){return new eC}}});var pKe,wy,f9=O(()=>{A();p9();xde();pKe=new vM,wy=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new tC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:pKe}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 RM,Dde=O(()=>{A();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(RM||(RM={}))});var co,Bde=O(()=>{A();(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"})(co||(co={}))});var di,Nde=O(()=>{A();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(di||(di={}))});function Ode(e){return AKe.test(e)}function wde(e){return gKe.test(e)&&!hKe.test(e)}var m9,fKe,mKe,AKe,gKe,hKe,kde=O(()=>{A();m9="[_0-9a-z-*/]",fKe=`[a-z]${m9}{0,255}`,mKe=`[a-z0-9]${m9}{0,240}@[a-z]${m9}{0,13}`,AKe=new RegExp(`^(?:${fKe}|${mKe})$`),gKe=/^[ -~]{0,255}[!-~]$/,hKe=/,|=/});var Pde,_Ke,Mde,Lde,xM,Ude=O(()=>{A();kde();Pde=32,_Ke=512,Mde=",",Lde="=",xM=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+Lde+this.get(n)),t),[]).join(Mde)}_parse(t){t.length>_Ke||(this._internalState=t.split(Mde).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(Lde);if(i!==-1){let s=o.slice(0,i),c=o.slice(i+1,r.length);Ode(s)&&wde(c)&&n.set(s,c)}return n},new Map),this._internalState.size>Pde&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Pde))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function Qde(e){return new xM(e)}var Fde=O(()=>{A();Ude()});var Ke,Gde=O(()=>{A();lB();Ke=gm.getInstance()});var Bl,zde=O(()=>{A();Ny();Bl=qs.instance()});var A9,jde,Hde=O(()=>{A();n9();A9=class{getMeter(t,n,r){return t9}},jde=new A9});var g9,DM,$de=O(()=>{A();Hde();By();Ny();g9="metrics",DM=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return mm(g9,t,qs.instance())}getMeterProvider(){return xl(g9)||jde}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Am(g9,qs.instance())}}});var h9,qde=O(()=>{A();$de();h9=DM.getInstance()});var BM,Vde=O(()=>{A();BM=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function E9(e){return e.getValue(_9)||void 0}function Yde(){return E9(gm.getInstance().active())}function Kde(e,t){return e.setValue(_9,t)}function Jde(e){return e.deleteValue(_9)}var _9,Zde=O(()=>{A();lB();uB();_9=Dl("OpenTelemetry Baggage Key")});var y9,EKe,NM,Wde=O(()=>{A();By();Vde();r9();Zde();j$();Ny();y9="propagation",EKe=new BM,NM=class e{constructor(){this.createBaggage=hde,this.getBaggage=E9,this.getActiveBaggage=Yde,this.setBaggage=Kde,this.deleteBaggage=Jde}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return mm(y9,t,qs.instance())}inject(t,n,r=hM){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=gM){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Am(y9,qs.instance())}_getGlobalPropagator(){return xl(y9)||EKe}}});var ef,Xde=O(()=>{A();Wde();ef=NM.getInstance()});var S9,OM,epe=O(()=>{A();By();f9();CM();a9();Ny();S9="trace",OM=class e{constructor(){this._proxyTracerProvider=new wy,this.wrapSpanContext=Rde,this.isSpanContextValid=dg,this.deleteSpan=bde,this.getSpan=TM,this.getActiveSpan=Ide,this.getSpanContext=IM,this.setSpan=pB,this.setSpanContext=Cde}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=mm(S9,this._proxyTracerProvider,qs.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return xl(S9)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Am(S9,qs.instance()),this._proxyTracerProvider=new wy}}});var $t,tpe=O(()=>{A();epe();$t=OM.getInstance()});var We={};$s(We,{DiagConsoleLogger:()=>mM,DiagLogLevel:()=>ys,INVALID_SPANID:()=>dB,INVALID_SPAN_CONTEXT:()=>EM,INVALID_TRACEID:()=>Oy,ProxyTracer:()=>tC,ProxyTracerProvider:()=>wy,ROOT_CONTEXT:()=>Wb,SamplingDecision:()=>RM,SpanKind:()=>co,SpanStatusCode:()=>di,TraceFlags:()=>Ja,ValueType:()=>AM,baggageEntryMetadataFromString:()=>_de,context:()=>Ke,createContextKey:()=>Dl,createNoopMeter:()=>yde,createTraceState:()=>Qde,default:()=>yKe,defaultTextMapGetter:()=>gM,defaultTextMapSetter:()=>hM,diag:()=>Bl,isSpanContextValid:()=>dg,isValidSpanId:()=>c9,isValidTraceId:()=>u9,metrics:()=>h9,propagation:()=>ef,trace:()=>$t});var yKe,ze=O(()=>{A();j$();uB();Ede();pM();n9();Sde();r9();p9();f9();Dde();Bde();Nde();i9();Fde();CM();yM();Gde();zde();qde();Xde();tpe();yKe={context:Ke,diag:Bl,metrics:h9,propagation:ef,trace:$t}});var fB=F(u_=>{"use strict";A();Object.defineProperty(u_,"__esModule",{value:!0});u_.isTracingSuppressed=u_.unsuppressTracing=u_.suppressTracing=void 0;var SKe=(ze(),Me(We)),T9=(0,SKe.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function TKe(e){return e.setValue(T9,!0)}u_.suppressTracing=TKe;function IKe(e){return e.deleteValue(T9)}u_.unsuppressTracing=IKe;function bKe(e){return e.getValue(T9)===!0}u_.isTracingSuppressed=bKe});var I9=F(Za=>{"use strict";A();Object.defineProperty(Za,"__esModule",{value:!0});Za.BAGGAGE_MAX_TOTAL_LENGTH=Za.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Za.BAGGAGE_MAX_NAME_VALUE_PAIRS=Za.BAGGAGE_HEADER=Za.BAGGAGE_ITEMS_SEPARATOR=Za.BAGGAGE_PROPERTIES_SEPARATOR=Za.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Za.BAGGAGE_KEY_PAIR_SEPARATOR="=";Za.BAGGAGE_PROPERTIES_SEPARATOR=";";Za.BAGGAGE_ITEMS_SEPARATOR=",";Za.BAGGAGE_HEADER="baggage";Za.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Za.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Za.BAGGAGE_MAX_TOTAL_LENGTH=8192});var C9=F(kd=>{"use strict";A();Object.defineProperty(kd,"__esModule",{value:!0});kd.parseKeyPairsIntoRecord=kd.parseBaggageHeaderString=kd.parsePairKeyValue=kd.getKeyPairs=kd.serializeKeyPairs=void 0;var CKe=(ze(),Me(We)),_m=I9();function vKe(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?_m.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>_m.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}kd.serializeKeyPairs=vKe;function RKe(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=_m.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}kd.getKeyPairs=RKe;function b9(e){if(!e)return;let t=e.indexOf(_m.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(_m.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 s,c;try{s=decodeURIComponent(o),c=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,CKe.baggageEntryMetadataFromString)(f)}return{key:s,value:c,metadata:l}}kd.parsePairKeyValue=b9;function xKe(e,t,n,r){let o=0;for(;o<e.length&&n<_m.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(_m.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,c=s-o;if(c<=_m.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=b9(e.substring(o,s));if(l){let f=(n===0?0:1)+c;if(r+f>_m.BAGGAGE_MAX_TOTAL_LENGTH)break;t[l.key]=l.metadata?{value:l.value,metadata:l.metadata}:{value:l.value},n++,r+=f}}if(i===-1)break;o=i+1}return[n,r]}kd.parseBaggageHeaderString=xKe;function DKe(e){let t={};return typeof e=="string"&&e.length>0&&e.split(_m.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=b9(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}kd.parseKeyPairsIntoRecord=DKe});var npe=F(kM=>{"use strict";A();Object.defineProperty(kM,"__esModule",{value:!0});kM.W3CBaggagePropagator=void 0;var v9=(ze(),Me(We)),BKe=fB(),mB=I9(),wM=C9(),R9=class{inject(t,n,r){let o=v9.propagation.getBaggage(t);if(!o||(0,BKe.isTracingSuppressed)(t))return;let i=(0,wM.getKeyPairs)(o).filter(c=>c.length<=mB.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,mB.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,wM.serializeKeyPairs)(i);s.length>0&&r.set(n,mB.BAGGAGE_HEADER,s)}extract(t,n,r){let o=r.get(n,mB.BAGGAGE_HEADER);if(!o)return t;let i={},s=0,c=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,c]=(0,wM.parseBaggageHeaderString)(o[l],i,s,c);else[s]=(0,wM.parseBaggageHeaderString)(o,i,s,c);return s===0?t:v9.propagation.setBaggage(t,v9.propagation.createBaggage(i))}fields(){return[mB.BAGGAGE_HEADER]}};kM.W3CBaggagePropagator=R9});var rpe=F(PM=>{"use strict";A();Object.defineProperty(PM,"__esModule",{value:!0});PM.AnchoredClock=void 0;var x9=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}};PM.AnchoredClock=x9});var upe=F(c_=>{"use strict";A();Object.defineProperty(c_,"__esModule",{value:!0});c_.isAttributeValue=c_.isAttributeKey=c_.sanitizeAttributes=void 0;var ope=(ze(),Me(We));function NKe(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(!ipe(n)){ope.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!spe(r)){ope.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}c_.sanitizeAttributes=NKe;function ipe(e){return typeof e=="string"&&e!==""}c_.isAttributeKey=ipe;function spe(e){return e==null?!0:Array.isArray(e)?OKe(e):ape(typeof e)}c_.isAttributeValue=spe;function OKe(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(ape(r)){t=r;continue}return!1}return!1}}return!0}function ape(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var D9=F(MM=>{"use strict";A();Object.defineProperty(MM,"__esModule",{value:!0});MM.loggingErrorHandler=void 0;var wKe=(ze(),Me(We));function kKe(){return e=>{wKe.diag.error(PKe(e))}}MM.loggingErrorHandler=kKe;function PKe(e){return typeof e=="string"?e:JSON.stringify(MKe(e))}function MKe(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 lpe=F(nC=>{"use strict";A();Object.defineProperty(nC,"__esModule",{value:!0});nC.globalErrorHandler=nC.setGlobalErrorHandler=void 0;var LKe=D9(),cpe=(0,LKe.loggingErrorHandler)();function UKe(e){cpe=e}nC.setGlobalErrorHandler=UKe;function QKe(e){try{cpe(e)}catch{}}nC.globalErrorHandler=QKe});var mpe=F(Em=>{"use strict";A();Object.defineProperty(Em,"__esModule",{value:!0});Em.getStringListFromEnv=Em.getBooleanFromEnv=Em.getStringFromEnv=Em.getNumberFromEnv=void 0;var dpe=(ze(),Me(We)),ppe=Fe("util");function FKe(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){dpe.diag.warn(`Unknown value ${(0,ppe.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}Em.getNumberFromEnv=FKe;function fpe(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}Em.getStringFromEnv=fpe;function GKe(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||dpe.diag.warn(`Unknown value ${(0,ppe.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Em.getBooleanFromEnv=GKe;function zKe(e){return fpe(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}Em.getStringListFromEnv=zKe});var Ape=F(LM=>{"use strict";A();Object.defineProperty(LM,"__esModule",{value:!0});LM._globalThis=void 0;LM._globalThis=globalThis});var gpe=F(UM=>{"use strict";A();Object.defineProperty(UM,"__esModule",{value:!0});UM.VERSION=void 0;UM.VERSION="2.8.0"});function Ni(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 B9=O(()=>{A()});var hpe,_pe,Epe,ype,Spe,Tpe,Ipe,bpe,Cpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Ppe,Mpe,Lpe,Upe,Qpe,Fpe,Gpe,zpe,jpe,Hpe,$pe,qpe,Vpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,sfe,afe,ufe,cfe,lfe,dfe,pfe,ffe,mfe,Afe,gfe,hfe,_fe,Efe,yfe,Sfe,Tfe,Ife,bfe,Cfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Pfe,Mfe,Lfe,Ufe,Qfe,Ffe,Gfe,zfe,jfe,Hfe,$fe,qfe,Vfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eme,tme,nme,rme,ome,ime,sme,ame,ume,cme,lme,dme,pme,fme,mme,Ame,gme,hme,_me,Eme,yme,Sme,Tme,Ime,bme,Cme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Pme,Mme,jKe,N9,HKe,$Ke,qKe,VKe,O9,YKe,KKe,JKe,ZKe,WKe,XKe,eJe,tJe,nJe,rJe,oJe,iJe,sJe,aJe,uJe,cJe,lJe,dJe,w9,pJe,fJe,mJe,AJe,gJe,hJe,_Je,EJe,yJe,SJe,TJe,IJe,k9,bJe,CJe,P9,M9,vJe,RJe,xJe,DJe,BJe,NJe,OJe,wJe,kJe,PJe,MJe,LJe,UJe,QJe,FJe,GJe,zJe,AB,rC,L9,jJe,HJe,ky,$Je,qJe,VJe,YJe,U9,Q9,KJe,F9,JJe,ZJe,WJe,XJe,eZe,tZe,nZe,rZe,oZe,iZe,sZe,aZe,uZe,cZe,lZe,dZe,pZe,fZe,mZe,AZe,gZe,hZe,_Ze,G9,EZe,yZe,SZe,TZe,IZe,bZe,CZe,vZe,RZe,xZe,DZe,BZe,NZe,OZe,wZe,kZe,PZe,MZe,LZe,z9,UZe,j9,QZe,FZe,GZe,zZe,jZe,HZe,$Ze,qZe,VZe,Lme,Ume,Qme,Fme,Gme,zme,jme,Hme,$me,qme,Vme,Yme,Kme,Jme,Zme,Wme,Xme,eAe,tAe,nAe,rAe,oAe,iAe,sAe,aAe,uAe,cAe,lAe,dAe,pAe,fAe,mAe,AAe,gAe,hAe,_Ae,EAe,yAe,SAe,TAe,IAe,bAe,CAe,vAe,RAe,xAe,DAe,YZe,KZe,JZe,ZZe,WZe,XZe,eWe,tWe,nWe,rWe,oWe,iWe,sWe,aWe,uWe,cWe,lWe,dWe,pWe,fWe,mWe,AWe,gWe,hWe,_We,EWe,yWe,SWe,TWe,IWe,bWe,CWe,vWe,RWe,xWe,DWe,BWe,NWe,OWe,wWe,kWe,PWe,MWe,LWe,UWe,QWe,FWe,GWe,BAe,NAe,OAe,wAe,kAe,PAe,MAe,LAe,UAe,QAe,FAe,zWe,jWe,HWe,$We,qWe,VWe,YWe,KWe,JWe,ZWe,WWe,XWe,GAe,zAe,jAe,HAe,$Ae,eXe,tXe,nXe,rXe,oXe,iXe,qAe,VAe,YAe,sXe,aXe,uXe,cXe,KAe,JAe,ZAe,WAe,lXe,dXe,pXe,fXe,mXe,XAe,ege,tge,nge,rge,oge,ige,AXe,gXe,hXe,_Xe,EXe,yXe,SXe,TXe,sge,age,uge,cge,lge,IXe,bXe,CXe,vXe,RXe,xXe,dge,pge,fge,mge,Age,gge,hge,_ge,Ege,yge,Sge,Tge,Ige,bge,Cge,vge,Rge,xge,Dge,Bge,Nge,DXe,BXe,NXe,OXe,wXe,kXe,PXe,MXe,LXe,UXe,QXe,FXe,GXe,zXe,jXe,HXe,$Xe,qXe,VXe,YXe,KXe,JXe,Oge,wge,kge,Pge,Mge,ZXe,WXe,XXe,eet,tet,net,Lge,Uge,ret,oet,iet,Qge,Fge,set,aet,uet,Gge,zge,jge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,cet,det,pet,fet,met,Aet,get,het,_et,Eet,yet,Tet,Iet,bet,Cet,vet,Ret,xet,ohe,ihe,Det,Bet,Net,she=O(()=>{A();B9();hpe="aws.lambda.invoked_arn",_pe="db.system",Epe="db.connection_string",ype="db.user",Spe="db.jdbc.driver_classname",Tpe="db.name",Ipe="db.statement",bpe="db.operation",Cpe="db.mssql.instance_name",vpe="db.cassandra.keyspace",Rpe="db.cassandra.page_size",xpe="db.cassandra.consistency_level",Dpe="db.cassandra.table",Bpe="db.cassandra.idempotence",Npe="db.cassandra.speculative_execution_count",Ope="db.cassandra.coordinator.id",wpe="db.cassandra.coordinator.dc",kpe="db.hbase.namespace",Ppe="db.redis.database_index",Mpe="db.mongodb.collection",Lpe="db.sql.table",Upe="exception.type",Qpe="exception.message",Fpe="exception.stacktrace",Gpe="exception.escaped",zpe="faas.trigger",jpe="faas.execution",Hpe="faas.document.collection",$pe="faas.document.operation",qpe="faas.document.time",Vpe="faas.document.name",Ype="faas.time",Kpe="faas.cron",Jpe="faas.coldstart",Zpe="faas.invoked_name",Wpe="faas.invoked_provider",Xpe="faas.invoked_region",efe="net.transport",tfe="net.peer.ip",nfe="net.peer.port",rfe="net.peer.name",ofe="net.host.ip",ife="net.host.port",sfe="net.host.name",afe="net.host.connection.type",ufe="net.host.connection.subtype",cfe="net.host.carrier.name",lfe="net.host.carrier.mcc",dfe="net.host.carrier.mnc",pfe="net.host.carrier.icc",ffe="peer.service",mfe="enduser.id",Afe="enduser.role",gfe="enduser.scope",hfe="thread.id",_fe="thread.name",Efe="code.function",yfe="code.namespace",Sfe="code.filepath",Tfe="code.lineno",Ife="http.method",bfe="http.url",Cfe="http.target",vfe="http.host",Rfe="http.scheme",xfe="http.status_code",Dfe="http.flavor",Bfe="http.user_agent",Nfe="http.request_content_length",Ofe="http.request_content_length_uncompressed",wfe="http.response_content_length",kfe="http.response_content_length_uncompressed",Pfe="http.server_name",Mfe="http.route",Lfe="http.client_ip",Ufe="aws.dynamodb.table_names",Qfe="aws.dynamodb.consumed_capacity",Ffe="aws.dynamodb.item_collection_metrics",Gfe="aws.dynamodb.provisioned_read_capacity",zfe="aws.dynamodb.provisioned_write_capacity",jfe="aws.dynamodb.consistent_read",Hfe="aws.dynamodb.projection",$fe="aws.dynamodb.limit",qfe="aws.dynamodb.attributes_to_get",Vfe="aws.dynamodb.index_name",Yfe="aws.dynamodb.select",Kfe="aws.dynamodb.global_secondary_indexes",Jfe="aws.dynamodb.local_secondary_indexes",Zfe="aws.dynamodb.exclusive_start_table",Wfe="aws.dynamodb.table_count",Xfe="aws.dynamodb.scan_forward",eme="aws.dynamodb.segment",tme="aws.dynamodb.total_segments",nme="aws.dynamodb.count",rme="aws.dynamodb.scanned_count",ome="aws.dynamodb.attribute_definitions",ime="aws.dynamodb.global_secondary_index_updates",sme="messaging.system",ame="messaging.destination",ume="messaging.destination_kind",cme="messaging.temp_destination",lme="messaging.protocol",dme="messaging.protocol_version",pme="messaging.url",fme="messaging.message_id",mme="messaging.conversation_id",Ame="messaging.message_payload_size_bytes",gme="messaging.message_payload_compressed_size_bytes",hme="messaging.operation",_me="messaging.consumer_id",Eme="messaging.rabbitmq.routing_key",yme="messaging.kafka.message_key",Sme="messaging.kafka.consumer_group",Tme="messaging.kafka.client_id",Ime="messaging.kafka.partition",bme="messaging.kafka.tombstone",Cme="rpc.system",vme="rpc.service",Rme="rpc.method",xme="rpc.grpc.status_code",Dme="rpc.jsonrpc.version",Bme="rpc.jsonrpc.request_id",Nme="rpc.jsonrpc.error_code",Ome="rpc.jsonrpc.error_message",wme="message.type",kme="message.id",Pme="message.compressed_size",Mme="message.uncompressed_size",jKe=hpe,N9=_pe,HKe=Epe,$Ke=ype,qKe=Spe,VKe=Tpe,O9=Ipe,YKe=bpe,KKe=Cpe,JKe=vpe,ZKe=Rpe,WKe=xpe,XKe=Dpe,eJe=Bpe,tJe=Npe,nJe=Ope,rJe=wpe,oJe=kpe,iJe=Ppe,sJe=Mpe,aJe=Lpe,uJe=Upe,cJe=Qpe,lJe=Fpe,dJe=Gpe,w9=zpe,pJe=jpe,fJe=Hpe,mJe=$pe,AJe=qpe,gJe=Vpe,hJe=Ype,_Je=Kpe,EJe=Jpe,yJe=Zpe,SJe=Wpe,TJe=Xpe,IJe=efe,k9=tfe,bJe=nfe,CJe=rfe,P9=ofe,M9=ife,vJe=sfe,RJe=afe,xJe=ufe,DJe=cfe,BJe=lfe,NJe=dfe,OJe=pfe,wJe=ffe,kJe=mfe,PJe=Afe,MJe=gfe,LJe=hfe,UJe=_fe,QJe=Efe,FJe=yfe,GJe=Sfe,zJe=Tfe,AB=Ife,rC=bfe,L9=Cfe,jJe=vfe,HJe=Rfe,ky=xfe,$Je=Dfe,qJe=Bfe,VJe=Nfe,YJe=Ofe,U9=wfe,Q9=kfe,KJe=Pfe,F9=Mfe,JJe=Lfe,ZJe=Ufe,WJe=Qfe,XJe=Ffe,eZe=Gfe,tZe=zfe,nZe=jfe,rZe=Hfe,oZe=$fe,iZe=qfe,sZe=Vfe,aZe=Yfe,uZe=Kfe,cZe=Jfe,lZe=Zfe,dZe=Wfe,pZe=Xfe,fZe=eme,mZe=tme,AZe=nme,gZe=rme,hZe=ome,_Ze=ime,G9=sme,EZe=ame,yZe=ume,SZe=cme,TZe=lme,IZe=dme,bZe=pme,CZe=fme,vZe=mme,RZe=Ame,xZe=gme,DZe=hme,BZe=_me,NZe=Eme,OZe=yme,wZe=Sme,kZe=Tme,PZe=Ime,MZe=bme,LZe=Cme,z9=vme,UZe=Rme,j9=xme,QZe=Dme,FZe=Bme,GZe=Nme,zZe=Ome,jZe=wme,HZe=kme,$Ze=Pme,qZe=Mme,VZe=Ni([hpe,_pe,Epe,ype,Spe,Tpe,Ipe,bpe,Cpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Ppe,Mpe,Lpe,Upe,Qpe,Fpe,Gpe,zpe,jpe,Hpe,$pe,qpe,Vpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,sfe,afe,ufe,cfe,lfe,dfe,pfe,ffe,mfe,Afe,gfe,hfe,_fe,Efe,yfe,Sfe,Tfe,Ife,bfe,Cfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Pfe,Mfe,Lfe,Ufe,Qfe,Ffe,Gfe,zfe,jfe,Hfe,$fe,qfe,Vfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eme,tme,nme,rme,ome,ime,sme,ame,ume,cme,lme,dme,pme,fme,mme,Ame,gme,hme,_me,Eme,yme,Sme,Tme,Ime,bme,Cme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Pme,Mme]),Lme="other_sql",Ume="mssql",Qme="mysql",Fme="oracle",Gme="db2",zme="postgresql",jme="redshift",Hme="hive",$me="cloudscape",qme="hsqldb",Vme="progress",Yme="maxdb",Kme="hanadb",Jme="ingres",Zme="firstsql",Wme="edb",Xme="cache",eAe="adabas",tAe="firebird",nAe="derby",rAe="filemaker",oAe="informix",iAe="instantdb",sAe="interbase",aAe="mariadb",uAe="netezza",cAe="pervasive",lAe="pointbase",dAe="sqlite",pAe="sybase",fAe="teradata",mAe="vertica",AAe="h2",gAe="coldfusion",hAe="cassandra",_Ae="hbase",EAe="mongodb",yAe="redis",SAe="couchbase",TAe="couchdb",IAe="cosmosdb",bAe="dynamodb",CAe="neo4j",vAe="geode",RAe="elasticsearch",xAe="memcached",DAe="cockroachdb",YZe=Lme,KZe=Ume,JZe=Qme,ZZe=Fme,WZe=Gme,XZe=zme,eWe=jme,tWe=Hme,nWe=$me,rWe=qme,oWe=Vme,iWe=Yme,sWe=Kme,aWe=Jme,uWe=Zme,cWe=Wme,lWe=Xme,dWe=eAe,pWe=tAe,fWe=nAe,mWe=rAe,AWe=oAe,gWe=iAe,hWe=sAe,_We=aAe,EWe=uAe,yWe=cAe,SWe=lAe,TWe=dAe,IWe=pAe,bWe=fAe,CWe=mAe,vWe=AAe,RWe=gAe,xWe=hAe,DWe=_Ae,BWe=EAe,NWe=yAe,OWe=SAe,wWe=TAe,kWe=IAe,PWe=bAe,MWe=CAe,LWe=vAe,UWe=RAe,QWe=xAe,FWe=DAe,GWe=Ni([Lme,Ume,Qme,Fme,Gme,zme,jme,Hme,$me,qme,Vme,Yme,Kme,Jme,Zme,Wme,Xme,eAe,tAe,nAe,rAe,oAe,iAe,sAe,aAe,uAe,cAe,lAe,dAe,pAe,fAe,mAe,AAe,gAe,hAe,_Ae,EAe,yAe,SAe,TAe,IAe,bAe,CAe,vAe,RAe,xAe,DAe]),BAe="all",NAe="each_quorum",OAe="quorum",wAe="local_quorum",kAe="one",PAe="two",MAe="three",LAe="local_one",UAe="any",QAe="serial",FAe="local_serial",zWe=BAe,jWe=NAe,HWe=OAe,$We=wAe,qWe=kAe,VWe=PAe,YWe=MAe,KWe=LAe,JWe=UAe,ZWe=QAe,WWe=FAe,XWe=Ni([BAe,NAe,OAe,wAe,kAe,PAe,MAe,LAe,UAe,QAe,FAe]),GAe="datasource",zAe="http",jAe="pubsub",HAe="timer",$Ae="other",eXe=GAe,tXe=zAe,nXe=jAe,rXe=HAe,oXe=$Ae,iXe=Ni([GAe,zAe,jAe,HAe,$Ae]),qAe="insert",VAe="edit",YAe="delete",sXe=qAe,aXe=VAe,uXe=YAe,cXe=Ni([qAe,VAe,YAe]),KAe="alibaba_cloud",JAe="aws",ZAe="azure",WAe="gcp",lXe=KAe,dXe=JAe,pXe=ZAe,fXe=WAe,mXe=Ni([KAe,JAe,ZAe,WAe]),XAe="ip_tcp",ege="ip_udp",tge="ip",nge="unix",rge="pipe",oge="inproc",ige="other",AXe=XAe,gXe=ege,hXe=tge,_Xe=nge,EXe=rge,yXe=oge,SXe=ige,TXe=Ni([XAe,ege,tge,nge,rge,oge,ige]),sge="wifi",age="wired",uge="cell",cge="unavailable",lge="unknown",IXe=sge,bXe=age,CXe=uge,vXe=cge,RXe=lge,xXe=Ni([sge,age,uge,cge,lge]),dge="gprs",pge="edge",fge="umts",mge="cdma",Age="evdo_0",gge="evdo_a",hge="cdma2000_1xrtt",_ge="hsdpa",Ege="hsupa",yge="hspa",Sge="iden",Tge="evdo_b",Ige="lte",bge="ehrpd",Cge="hspap",vge="gsm",Rge="td_scdma",xge="iwlan",Dge="nr",Bge="nrnsa",Nge="lte_ca",DXe=dge,BXe=pge,NXe=fge,OXe=mge,wXe=Age,kXe=gge,PXe=hge,MXe=_ge,LXe=Ege,UXe=yge,QXe=Sge,FXe=Tge,GXe=Ige,zXe=bge,jXe=Cge,HXe=vge,$Xe=Rge,qXe=xge,VXe=Dge,YXe=Bge,KXe=Nge,JXe=Ni([dge,pge,fge,mge,Age,gge,hge,_ge,Ege,yge,Sge,Tge,Ige,bge,Cge,vge,Rge,xge,Dge,Bge,Nge]),Oge="1.0",wge="1.1",kge="2.0",Pge="SPDY",Mge="QUIC",ZXe=Oge,WXe=wge,XXe=kge,eet=Pge,tet=Mge,net={HTTP_1_0:Oge,HTTP_1_1:wge,HTTP_2_0:kge,SPDY:Pge,QUIC:Mge},Lge="queue",Uge="topic",ret=Lge,oet=Uge,iet=Ni([Lge,Uge]),Qge="receive",Fge="process",set=Qge,aet=Fge,uet=Ni([Qge,Fge]),Gge=0,zge=1,jge=2,Hge=3,$ge=4,qge=5,Vge=6,Yge=7,Kge=8,Jge=9,Zge=10,Wge=11,Xge=12,ehe=13,the=14,nhe=15,rhe=16,cet=Gge,det=zge,pet=jge,fet=Hge,met=$ge,Aet=qge,get=Vge,het=Yge,_et=Kge,Eet=Jge,yet=Zge,Tet=Wge,Iet=Xge,bet=ehe,Cet=the,vet=nhe,Ret=rhe,xet={OK:Gge,CANCELLED:zge,UNKNOWN:jge,INVALID_ARGUMENT:Hge,DEADLINE_EXCEEDED:$ge,NOT_FOUND:qge,ALREADY_EXISTS:Vge,PERMISSION_DENIED:Yge,RESOURCE_EXHAUSTED:Kge,FAILED_PRECONDITION:Jge,ABORTED:Zge,OUT_OF_RANGE:Wge,UNIMPLEMENTED:Xge,INTERNAL:ehe,UNAVAILABLE:the,DATA_LOSS:nhe,UNAUTHENTICATED:rhe},ohe="SENT",ihe="RECEIVED",Det=ohe,Bet=ihe,Net=Ni([ohe,ihe])});var ahe=O(()=>{A();she()});var uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,Ihe,bhe,Che,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,zhe,jhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,I_e,b_e,C_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e,Oet,wet,ket,Pet,Met,Let,Uet,Qet,Fet,Get,zet,jet,Het,$et,qet,Vet,Yet,Ket,Jet,Zet,Wet,Xet,ett,ttt,ntt,rtt,ott,itt,stt,att,utt,ctt,ltt,dtt,ptt,ftt,mtt,Att,gtt,htt,_tt,Ett,ytt,Stt,Ttt,Itt,btt,Ctt,vtt,Rtt,xtt,Dtt,Btt,Ntt,Ott,wtt,ktt,Ptt,Mtt,Ltt,Utt,Qtt,Ftt,Gtt,ztt,jtt,Htt,$tt,qtt,Vtt,Ytt,H9,Ktt,Jtt,Ztt,Wtt,Xtt,ent,tnt,nnt,rnt,ont,P_e,M_e,L_e,U_e,int,snt,ant,unt,cnt,Q_e,F_e,G_e,z_e,j_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,lnt,dnt,pnt,fnt,mnt,Ant,gnt,hnt,_nt,Ent,ynt,Snt,Tnt,Int,bnt,Cnt,vnt,Rnt,nEe,rEe,xnt,Dnt,Bnt,oEe,iEe,sEe,aEe,uEe,cEe,lEe,Nnt,Ont,wnt,knt,Pnt,Mnt,Lnt,Unt,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,Qnt,Fnt,Gnt,znt,jnt,Hnt,$nt,qnt,Vnt,Ynt,Knt,Jnt,TEe,IEe,bEe,CEe,vEe,REe,xEe,DEe,BEe,NEe,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,srt,art,OEe=O(()=>{A();B9();uhe="cloud.provider",che="cloud.account.id",lhe="cloud.region",dhe="cloud.availability_zone",phe="cloud.platform",fhe="aws.ecs.container.arn",mhe="aws.ecs.cluster.arn",Ahe="aws.ecs.launchtype",ghe="aws.ecs.task.arn",hhe="aws.ecs.task.family",_he="aws.ecs.task.revision",Ehe="aws.eks.cluster.arn",yhe="aws.log.group.names",She="aws.log.group.arns",The="aws.log.stream.names",Ihe="aws.log.stream.arns",bhe="container.name",Che="container.id",vhe="container.runtime",Rhe="container.image.name",xhe="container.image.tag",Dhe="deployment.environment",Bhe="device.id",Nhe="device.model.identifier",Ohe="device.model.name",whe="faas.name",khe="faas.id",Phe="faas.version",Mhe="faas.instance",Lhe="faas.max_memory",Uhe="host.id",Qhe="host.name",Fhe="host.type",Ghe="host.arch",zhe="host.image.name",jhe="host.image.id",Hhe="host.image.version",$he="k8s.cluster.name",qhe="k8s.node.name",Vhe="k8s.node.uid",Yhe="k8s.namespace.name",Khe="k8s.pod.uid",Jhe="k8s.pod.name",Zhe="k8s.container.name",Whe="k8s.replicaset.uid",Xhe="k8s.replicaset.name",e_e="k8s.deployment.uid",t_e="k8s.deployment.name",n_e="k8s.statefulset.uid",r_e="k8s.statefulset.name",o_e="k8s.daemonset.uid",i_e="k8s.daemonset.name",s_e="k8s.job.uid",a_e="k8s.job.name",u_e="k8s.cronjob.uid",c_e="k8s.cronjob.name",l_e="os.type",d_e="os.description",p_e="os.name",f_e="os.version",m_e="process.pid",A_e="process.executable.name",g_e="process.executable.path",h_e="process.command",__e="process.command_line",E_e="process.command_args",y_e="process.owner",S_e="process.runtime.name",T_e="process.runtime.version",I_e="process.runtime.description",b_e="service.name",C_e="service.namespace",v_e="service.instance.id",R_e="service.version",x_e="telemetry.sdk.name",D_e="telemetry.sdk.language",B_e="telemetry.sdk.version",N_e="telemetry.auto.version",O_e="webengine.name",w_e="webengine.version",k_e="webengine.description",Oet=uhe,wet=che,ket=lhe,Pet=dhe,Met=phe,Let=fhe,Uet=mhe,Qet=Ahe,Fet=ghe,Get=hhe,zet=_he,jet=Ehe,Het=yhe,$et=She,qet=The,Vet=Ihe,Yet=bhe,Ket=Che,Jet=vhe,Zet=Rhe,Wet=xhe,Xet=Dhe,ett=Bhe,ttt=Nhe,ntt=Ohe,rtt=whe,ott=khe,itt=Phe,stt=Mhe,att=Lhe,utt=Uhe,ctt=Qhe,ltt=Fhe,dtt=Ghe,ptt=zhe,ftt=jhe,mtt=Hhe,Att=$he,gtt=qhe,htt=Vhe,_tt=Yhe,Ett=Khe,ytt=Jhe,Stt=Zhe,Ttt=Whe,Itt=Xhe,btt=e_e,Ctt=t_e,vtt=n_e,Rtt=r_e,xtt=o_e,Dtt=i_e,Btt=s_e,Ntt=a_e,Ott=u_e,wtt=c_e,ktt=l_e,Ptt=d_e,Mtt=p_e,Ltt=f_e,Utt=m_e,Qtt=A_e,Ftt=g_e,Gtt=h_e,ztt=__e,jtt=E_e,Htt=y_e,$tt=S_e,qtt=T_e,Vtt=I_e,Ytt=b_e,H9=C_e,Ktt=v_e,Jtt=R_e,Ztt=x_e,Wtt=D_e,Xtt=B_e,ent=N_e,tnt=O_e,nnt=w_e,rnt=k_e,ont=Ni([uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,Ihe,bhe,Che,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,zhe,jhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,I_e,b_e,C_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e]),P_e="alibaba_cloud",M_e="aws",L_e="azure",U_e="gcp",int=P_e,snt=M_e,ant=L_e,unt=U_e,cnt=Ni([P_e,M_e,L_e,U_e]),Q_e="alibaba_cloud_ecs",F_e="alibaba_cloud_fc",G_e="aws_ec2",z_e="aws_ecs",j_e="aws_eks",H_e="aws_lambda",$_e="aws_elastic_beanstalk",q_e="azure_vm",V_e="azure_container_instances",Y_e="azure_aks",K_e="azure_functions",J_e="azure_app_service",Z_e="gcp_compute_engine",W_e="gcp_cloud_run",X_e="gcp_kubernetes_engine",eEe="gcp_cloud_functions",tEe="gcp_app_engine",lnt=Q_e,dnt=F_e,pnt=G_e,fnt=z_e,mnt=j_e,Ant=H_e,gnt=$_e,hnt=q_e,_nt=V_e,Ent=Y_e,ynt=K_e,Snt=J_e,Tnt=Z_e,Int=W_e,bnt=X_e,Cnt=eEe,vnt=tEe,Rnt=Ni([Q_e,F_e,G_e,z_e,j_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe]),nEe="ec2",rEe="fargate",xnt=nEe,Dnt=rEe,Bnt=Ni([nEe,rEe]),oEe="amd64",iEe="arm32",sEe="arm64",aEe="ia64",uEe="ppc32",cEe="ppc64",lEe="x86",Nnt=oEe,Ont=iEe,wnt=sEe,knt=aEe,Pnt=uEe,Mnt=cEe,Lnt=lEe,Unt=Ni([oEe,iEe,sEe,aEe,uEe,cEe,lEe]),dEe="windows",pEe="linux",fEe="darwin",mEe="freebsd",AEe="netbsd",gEe="openbsd",hEe="dragonflybsd",_Ee="hpux",EEe="aix",yEe="solaris",SEe="z_os",Qnt=dEe,Fnt=pEe,Gnt=fEe,znt=mEe,jnt=AEe,Hnt=gEe,$nt=hEe,qnt=_Ee,Vnt=EEe,Ynt=yEe,Knt=SEe,Jnt=Ni([dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe]),TEe="cpp",IEe="dotnet",bEe="erlang",CEe="go",vEe="java",REe="nodejs",xEe="php",DEe="python",BEe="ruby",NEe="webjs",Znt=TEe,Wnt=IEe,Xnt=bEe,ert=CEe,trt=vEe,nrt=REe,rrt=xEe,ort=DEe,irt=BEe,srt=NEe,art=Ni([TEe,IEe,bEe,CEe,vEe,REe,xEe,DEe,BEe,NEe])});var wEe=O(()=>{A();OEe()});var urt,crt,lrt,drt,prt,frt,mrt,Art,grt,hrt,_rt,Ert,yrt,Srt,Trt,Irt,brt,Crt,vrt,Rrt,xrt,Drt,Brt,Nrt,Ort,$9,q9,wrt,oC,krt,V9,Y9,Prt,Py,Mrt,Lrt,Urt,Qrt,Frt,Grt,zrt,jrt,lYt,dYt,K9,Hrt,$rt,qrt,Vrt,Yrt,Krt,My,Jrt,Zrt,Wrt,pYt,Xrt,eot,tot,not,fYt,rot,oot,iot,sot,pg,fg,aot,uot,cot,lot,dot,pot,fot,mot,Aot,mYt,got,hot,_ot,Eot,yot,Sot,J9,Z9,Tot,W9,X9,Iot,bot,AYt,gYt,Cot,vot,Rot,xot,Dot,Bot,Not,Oot,hYt,wot,e5,t5,kot,n5,Pot,r5,Mot,Lot,Uot,Qot,Fot,Got,zot,jot,Hot,_Yt,$ot,qot,EYt,Vot,Yot,yYt,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,l_,rit,oit,iit,o5,kEe=O(()=>{A();urt="aspnetcore.diagnostics.exception.result",crt="aborted",lrt="handled",drt="skipped",prt="unhandled",frt="aspnetcore.diagnostics.handler.type",mrt="aspnetcore.rate_limiting.policy",Art="aspnetcore.rate_limiting.result",grt="acquired",hrt="endpoint_limiter",_rt="global_limiter",Ert="request_canceled",yrt="aspnetcore.request.is_unhandled",Srt="aspnetcore.routing.is_fallback",Trt="aspnetcore.routing.match_status",Irt="failure",brt="success",Crt="aspnetcore.user.is_authenticated",vrt="client.address",Rrt="client.port",xrt="code.column.number",Drt="code.file.path",Brt="code.function.name",Nrt="code.line.number",Ort="code.stacktrace",$9="db.collection.name",q9="db.namespace",wrt="db.operation.batch.size",oC="db.operation.name",krt="db.query.summary",V9="db.query.text",Y9="db.response.status_code",Prt="db.stored_procedure.name",Py="db.system.name",Mrt="mariadb",Lrt="microsoft.sql_server",Urt="mysql",Qrt="postgresql",Frt="dotnet.gc.heap.generation",Grt="gen0",zrt="gen1",jrt="gen2",lYt="loh",dYt="poh",K9="error.type",Hrt="_OTHER",$rt="exception.escaped",qrt="exception.message",Vrt="exception.stacktrace",Yrt="exception.type",Krt=e=>`http.request.header.${e}`,My="http.request.method",Jrt="_OTHER",Zrt="CONNECT",Wrt="DELETE",pYt="GET",Xrt="HEAD",eot="OPTIONS",tot="PATCH",not="POST",fYt="PUT",rot="TRACE",oot="http.request.method_original",iot="http.request.resend_count",sot=e=>`http.response.header.${e}`,pg="http.response.status_code",fg="http.route",aot="jvm.gc.action",uot="jvm.gc.name",cot="jvm.memory.pool.name",lot="jvm.memory.type",dot="heap",pot="non_heap",fot="jvm.thread.daemon",mot="jvm.thread.state",Aot="blocked",mYt="new",got="runnable",hot="terminated",_ot="timed_waiting",Eot="waiting",yot="network.local.address",Sot="network.local.port",J9="network.peer.address",Z9="network.peer.port",Tot="network.protocol.name",W9="network.protocol.version",X9="network.transport",Iot="pipe",bot="quic",AYt="tcp",gYt="udp",Cot="unix",vot="network.type",Rot="ipv4",xot="ipv6",Dot="otel.scope.name",Bot="otel.scope.version",Not="otel.status_code",Oot="ERROR",hYt="OK",wot="otel.status_description",e5="server.address",t5="server.port",kot="service.instance.id",n5="service.name",Pot="service.namespace",r5="service.version",Mot="signalr.connection.status",Lot="app_shutdown",Uot="normal_closure",Qot="timeout",Fot="signalr.transport",Got="long_polling",zot="server_sent_events",jot="web_sockets",Hot="telemetry.sdk.language",_Yt="cpp",$ot="dotnet",qot="erlang",EYt="go",Vot="java",Yot="nodejs",yYt="php",Kot="python",Jot="ruby",Zot="rust",Wot="swift",Xot="webjs",eit="telemetry.sdk.name",tit="telemetry.sdk.version",nit="url.fragment",l_="url.full",rit="url.path",oit="url.query",iit="url.scheme",o5="user_agent.original"});var sit,ait,uit,cit,lit,dit,pit,fit,mit,Ait,git,hit,_it,Eit,yit,Sit,Tit,Iit,bit,Cit,vit,Rit,xit,Dit,Bit,Nit,Oit,wit,kit,Pit,Mit,Lit,Uit,Qit,Fit,Git,zit,jit,Hit,$it,qit,Vit,Yit,Kit,Jit,Zit,Wit,Xit,est,tst,nst,PEe=O(()=>{A();sit="aspnetcore.diagnostics.exceptions",ait="aspnetcore.rate_limiting.active_request_leases",uit="aspnetcore.rate_limiting.queued_requests",cit="aspnetcore.rate_limiting.request.time_in_queue",lit="aspnetcore.rate_limiting.request_lease.duration",dit="aspnetcore.rate_limiting.requests",pit="aspnetcore.routing.match_attempts",fit="db.client.operation.duration",mit="dotnet.assembly.count",Ait="dotnet.exceptions",git="dotnet.gc.collections",hit="dotnet.gc.heap.total_allocated",_it="dotnet.gc.last_collection.heap.fragmentation.size",Eit="dotnet.gc.last_collection.heap.size",yit="dotnet.gc.last_collection.memory.committed_size",Sit="dotnet.gc.pause.time",Tit="dotnet.jit.compilation.time",Iit="dotnet.jit.compiled_il.size",bit="dotnet.jit.compiled_methods",Cit="dotnet.monitor.lock_contentions",vit="dotnet.process.cpu.count",Rit="dotnet.process.cpu.time",xit="dotnet.process.memory.working_set",Dit="dotnet.thread_pool.queue.length",Bit="dotnet.thread_pool.thread.count",Nit="dotnet.thread_pool.work_item.count",Oit="dotnet.timer.count",wit="http.client.request.duration",kit="http.server.request.duration",Pit="jvm.class.count",Mit="jvm.class.loaded",Lit="jvm.class.unloaded",Uit="jvm.cpu.count",Qit="jvm.cpu.recent_utilization",Fit="jvm.cpu.time",Git="jvm.gc.duration",zit="jvm.memory.committed",jit="jvm.memory.limit",Hit="jvm.memory.used",$it="jvm.memory.used_after_last_gc",qit="jvm.thread.count",Vit="kestrel.active_connections",Yit="kestrel.active_tls_handshakes",Kit="kestrel.connection.duration",Jit="kestrel.queued_connections",Zit="kestrel.queued_requests",Wit="kestrel.rejected_connections",Xit="kestrel.tls_handshake.duration",est="kestrel.upgraded_connections",tst="signalr.server.active_connections",nst="signalr.server.connection.duration"});var rst,MEe=O(()=>{A();rst="exception"});var Fr={};$s(Fr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>crt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>lrt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>drt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>prt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>grt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>hrt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>_rt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Ert,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Irt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>brt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>urt,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>frt,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>mrt,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Art,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>yrt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Srt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Trt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Crt,ATTR_CLIENT_ADDRESS:()=>vrt,ATTR_CLIENT_PORT:()=>Rrt,ATTR_CODE_COLUMN_NUMBER:()=>xrt,ATTR_CODE_FILE_PATH:()=>Drt,ATTR_CODE_FUNCTION_NAME:()=>Brt,ATTR_CODE_LINE_NUMBER:()=>Nrt,ATTR_CODE_STACKTRACE:()=>Ort,ATTR_DB_COLLECTION_NAME:()=>$9,ATTR_DB_NAMESPACE:()=>q9,ATTR_DB_OPERATION_BATCH_SIZE:()=>wrt,ATTR_DB_OPERATION_NAME:()=>oC,ATTR_DB_QUERY_SUMMARY:()=>krt,ATTR_DB_QUERY_TEXT:()=>V9,ATTR_DB_RESPONSE_STATUS_CODE:()=>Y9,ATTR_DB_STORED_PROCEDURE_NAME:()=>Prt,ATTR_DB_SYSTEM_NAME:()=>Py,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Frt,ATTR_ERROR_TYPE:()=>K9,ATTR_EXCEPTION_ESCAPED:()=>$rt,ATTR_EXCEPTION_MESSAGE:()=>qrt,ATTR_EXCEPTION_STACKTRACE:()=>Vrt,ATTR_EXCEPTION_TYPE:()=>Yrt,ATTR_HTTP_REQUEST_HEADER:()=>Krt,ATTR_HTTP_REQUEST_METHOD:()=>My,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>oot,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>iot,ATTR_HTTP_RESPONSE_HEADER:()=>sot,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>pg,ATTR_HTTP_ROUTE:()=>fg,ATTR_JVM_GC_ACTION:()=>aot,ATTR_JVM_GC_NAME:()=>uot,ATTR_JVM_MEMORY_POOL_NAME:()=>cot,ATTR_JVM_MEMORY_TYPE:()=>lot,ATTR_JVM_THREAD_DAEMON:()=>fot,ATTR_JVM_THREAD_STATE:()=>mot,ATTR_NETWORK_LOCAL_ADDRESS:()=>yot,ATTR_NETWORK_LOCAL_PORT:()=>Sot,ATTR_NETWORK_PEER_ADDRESS:()=>J9,ATTR_NETWORK_PEER_PORT:()=>Z9,ATTR_NETWORK_PROTOCOL_NAME:()=>Tot,ATTR_NETWORK_PROTOCOL_VERSION:()=>W9,ATTR_NETWORK_TRANSPORT:()=>X9,ATTR_NETWORK_TYPE:()=>vot,ATTR_OTEL_SCOPE_NAME:()=>Dot,ATTR_OTEL_SCOPE_VERSION:()=>Bot,ATTR_OTEL_STATUS_CODE:()=>Not,ATTR_OTEL_STATUS_DESCRIPTION:()=>wot,ATTR_SERVER_ADDRESS:()=>e5,ATTR_SERVER_PORT:()=>t5,ATTR_SERVICE_INSTANCE_ID:()=>kot,ATTR_SERVICE_NAME:()=>n5,ATTR_SERVICE_NAMESPACE:()=>Pot,ATTR_SERVICE_VERSION:()=>r5,ATTR_SIGNALR_CONNECTION_STATUS:()=>Mot,ATTR_SIGNALR_TRANSPORT:()=>Fot,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Hot,ATTR_TELEMETRY_SDK_NAME:()=>eit,ATTR_TELEMETRY_SDK_VERSION:()=>tit,ATTR_URL_FRAGMENT:()=>nit,ATTR_URL_FULL:()=>l_,ATTR_URL_PATH:()=>rit,ATTR_URL_QUERY:()=>oit,ATTR_URL_SCHEME:()=>iit,ATTR_USER_AGENT_ORIGINAL:()=>o5,AWSECSLAUNCHTYPEVALUES_EC2:()=>xnt,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Dnt,AwsEcsLaunchtypeValues:()=>Bnt,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>lnt,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>dnt,CLOUDPLATFORMVALUES_AWS_EC2:()=>pnt,CLOUDPLATFORMVALUES_AWS_ECS:()=>fnt,CLOUDPLATFORMVALUES_AWS_EKS:()=>mnt,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>gnt,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Ant,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Ent,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Snt,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>_nt,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>ynt,CLOUDPLATFORMVALUES_AZURE_VM:()=>hnt,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>vnt,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Cnt,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Int,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Tnt,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>bnt,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>int,CLOUDPROVIDERVALUES_AWS:()=>snt,CLOUDPROVIDERVALUES_AZURE:()=>ant,CLOUDPROVIDERVALUES_GCP:()=>unt,CloudPlatformValues:()=>Rnt,CloudProviderValues:()=>cnt,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>zWe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>JWe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>jWe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>KWe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>$We,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>WWe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>qWe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>HWe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>ZWe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>YWe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>VWe,DBSYSTEMVALUES_ADABAS:()=>dWe,DBSYSTEMVALUES_CACHE:()=>lWe,DBSYSTEMVALUES_CASSANDRA:()=>xWe,DBSYSTEMVALUES_CLOUDSCAPE:()=>nWe,DBSYSTEMVALUES_COCKROACHDB:()=>FWe,DBSYSTEMVALUES_COLDFUSION:()=>RWe,DBSYSTEMVALUES_COSMOSDB:()=>kWe,DBSYSTEMVALUES_COUCHBASE:()=>OWe,DBSYSTEMVALUES_COUCHDB:()=>wWe,DBSYSTEMVALUES_DB2:()=>WZe,DBSYSTEMVALUES_DERBY:()=>fWe,DBSYSTEMVALUES_DYNAMODB:()=>PWe,DBSYSTEMVALUES_EDB:()=>cWe,DBSYSTEMVALUES_ELASTICSEARCH:()=>UWe,DBSYSTEMVALUES_FILEMAKER:()=>mWe,DBSYSTEMVALUES_FIREBIRD:()=>pWe,DBSYSTEMVALUES_FIRSTSQL:()=>uWe,DBSYSTEMVALUES_GEODE:()=>LWe,DBSYSTEMVALUES_H2:()=>vWe,DBSYSTEMVALUES_HANADB:()=>sWe,DBSYSTEMVALUES_HBASE:()=>DWe,DBSYSTEMVALUES_HIVE:()=>tWe,DBSYSTEMVALUES_HSQLDB:()=>rWe,DBSYSTEMVALUES_INFORMIX:()=>AWe,DBSYSTEMVALUES_INGRES:()=>aWe,DBSYSTEMVALUES_INSTANTDB:()=>gWe,DBSYSTEMVALUES_INTERBASE:()=>hWe,DBSYSTEMVALUES_MARIADB:()=>_We,DBSYSTEMVALUES_MAXDB:()=>iWe,DBSYSTEMVALUES_MEMCACHED:()=>QWe,DBSYSTEMVALUES_MONGODB:()=>BWe,DBSYSTEMVALUES_MSSQL:()=>KZe,DBSYSTEMVALUES_MYSQL:()=>JZe,DBSYSTEMVALUES_NEO4J:()=>MWe,DBSYSTEMVALUES_NETEZZA:()=>EWe,DBSYSTEMVALUES_ORACLE:()=>ZZe,DBSYSTEMVALUES_OTHER_SQL:()=>YZe,DBSYSTEMVALUES_PERVASIVE:()=>yWe,DBSYSTEMVALUES_POINTBASE:()=>SWe,DBSYSTEMVALUES_POSTGRESQL:()=>XZe,DBSYSTEMVALUES_PROGRESS:()=>oWe,DBSYSTEMVALUES_REDIS:()=>NWe,DBSYSTEMVALUES_REDSHIFT:()=>eWe,DBSYSTEMVALUES_SQLITE:()=>TWe,DBSYSTEMVALUES_SYBASE:()=>IWe,DBSYSTEMVALUES_TERADATA:()=>bWe,DBSYSTEMVALUES_VERTICA:()=>CWe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Mrt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Lrt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Urt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Qrt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Grt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>zrt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>jrt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>lYt,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>dYt,DbCassandraConsistencyLevelValues:()=>XWe,DbSystemValues:()=>GWe,ERROR_TYPE_VALUE_OTHER:()=>Hrt,EVENT_EXCEPTION:()=>rst,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>uXe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>aXe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>sXe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>lXe,FAASINVOKEDPROVIDERVALUES_AWS:()=>dXe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>pXe,FAASINVOKEDPROVIDERVALUES_GCP:()=>fXe,FAASTRIGGERVALUES_DATASOURCE:()=>eXe,FAASTRIGGERVALUES_HTTP:()=>tXe,FAASTRIGGERVALUES_OTHER:()=>oXe,FAASTRIGGERVALUES_PUBSUB:()=>nXe,FAASTRIGGERVALUES_TIMER:()=>rXe,FaasDocumentOperationValues:()=>cXe,FaasInvokedProviderValues:()=>mXe,FaasTriggerValues:()=>iXe,HOSTARCHVALUES_AMD64:()=>Nnt,HOSTARCHVALUES_ARM32:()=>Ont,HOSTARCHVALUES_ARM64:()=>wnt,HOSTARCHVALUES_IA64:()=>knt,HOSTARCHVALUES_PPC32:()=>Pnt,HOSTARCHVALUES_PPC64:()=>Mnt,HOSTARCHVALUES_X86:()=>Lnt,HTTPFLAVORVALUES_HTTP_1_0:()=>ZXe,HTTPFLAVORVALUES_HTTP_1_1:()=>WXe,HTTPFLAVORVALUES_HTTP_2_0:()=>XXe,HTTPFLAVORVALUES_QUIC:()=>tet,HTTPFLAVORVALUES_SPDY:()=>eet,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Zrt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Wrt,HTTP_REQUEST_METHOD_VALUE_GET:()=>pYt,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Xrt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>eot,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Jrt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>tot,HTTP_REQUEST_METHOD_VALUE_POST:()=>not,HTTP_REQUEST_METHOD_VALUE_PUT:()=>fYt,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>rot,HostArchValues:()=>Unt,HttpFlavorValues:()=>net,JVM_MEMORY_TYPE_VALUE_HEAP:()=>dot,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>pot,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Aot,JVM_THREAD_STATE_VALUE_NEW:()=>mYt,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>got,JVM_THREAD_STATE_VALUE_TERMINATED:()=>hot,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>_ot,JVM_THREAD_STATE_VALUE_WAITING:()=>Eot,MESSAGETYPEVALUES_RECEIVED:()=>Bet,MESSAGETYPEVALUES_SENT:()=>Det,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>ret,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>oet,MESSAGINGOPERATIONVALUES_PROCESS:()=>aet,MESSAGINGOPERATIONVALUES_RECEIVE:()=>set,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>sit,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>ait,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>uit,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>dit,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>lit,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>cit,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>pit,METRIC_DB_CLIENT_OPERATION_DURATION:()=>fit,METRIC_DOTNET_ASSEMBLY_COUNT:()=>mit,METRIC_DOTNET_EXCEPTIONS:()=>Ait,METRIC_DOTNET_GC_COLLECTIONS:()=>git,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>hit,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>_it,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Eit,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>yit,METRIC_DOTNET_GC_PAUSE_TIME:()=>Sit,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Tit,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Iit,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>bit,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Cit,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>vit,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Rit,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>xit,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>Dit,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Bit,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>Nit,METRIC_DOTNET_TIMER_COUNT:()=>Oit,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>wit,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>kit,METRIC_JVM_CLASS_COUNT:()=>Pit,METRIC_JVM_CLASS_LOADED:()=>Mit,METRIC_JVM_CLASS_UNLOADED:()=>Lit,METRIC_JVM_CPU_COUNT:()=>Uit,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Qit,METRIC_JVM_CPU_TIME:()=>Fit,METRIC_JVM_GC_DURATION:()=>Git,METRIC_JVM_MEMORY_COMMITTED:()=>zit,METRIC_JVM_MEMORY_LIMIT:()=>jit,METRIC_JVM_MEMORY_USED:()=>Hit,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>$it,METRIC_JVM_THREAD_COUNT:()=>qit,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Vit,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Yit,METRIC_KESTREL_CONNECTION_DURATION:()=>Kit,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Jit,METRIC_KESTREL_QUEUED_REQUESTS:()=>Zit,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Wit,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Xit,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>est,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>tst,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>nst,MessageTypeValues:()=>Net,MessagingDestinationKindValues:()=>iet,MessagingOperationValues:()=>uet,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>OXe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>PXe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>BXe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>zXe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>wXe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>kXe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>FXe,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>DXe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>HXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>MXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>UXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>jXe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>LXe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>QXe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>qXe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>GXe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>KXe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>VXe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>YXe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>$Xe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>NXe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>CXe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>vXe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>RXe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>IXe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>bXe,NETTRANSPORTVALUES_INPROC:()=>yXe,NETTRANSPORTVALUES_IP:()=>hXe,NETTRANSPORTVALUES_IP_TCP:()=>AXe,NETTRANSPORTVALUES_IP_UDP:()=>gXe,NETTRANSPORTVALUES_OTHER:()=>SXe,NETTRANSPORTVALUES_PIPE:()=>EXe,NETTRANSPORTVALUES_UNIX:()=>_Xe,NETWORK_TRANSPORT_VALUE_PIPE:()=>Iot,NETWORK_TRANSPORT_VALUE_QUIC:()=>bot,NETWORK_TRANSPORT_VALUE_TCP:()=>AYt,NETWORK_TRANSPORT_VALUE_UDP:()=>gYt,NETWORK_TRANSPORT_VALUE_UNIX:()=>Cot,NETWORK_TYPE_VALUE_IPV4:()=>Rot,NETWORK_TYPE_VALUE_IPV6:()=>xot,NetHostConnectionSubtypeValues:()=>JXe,NetHostConnectionTypeValues:()=>xXe,NetTransportValues:()=>TXe,OSTYPEVALUES_AIX:()=>Vnt,OSTYPEVALUES_DARWIN:()=>Gnt,OSTYPEVALUES_DRAGONFLYBSD:()=>$nt,OSTYPEVALUES_FREEBSD:()=>znt,OSTYPEVALUES_HPUX:()=>qnt,OSTYPEVALUES_LINUX:()=>Fnt,OSTYPEVALUES_NETBSD:()=>jnt,OSTYPEVALUES_OPENBSD:()=>Hnt,OSTYPEVALUES_SOLARIS:()=>Ynt,OSTYPEVALUES_WINDOWS:()=>Qnt,OSTYPEVALUES_Z_OS:()=>Knt,OTEL_STATUS_CODE_VALUE_ERROR:()=>Oot,OTEL_STATUS_CODE_VALUE_OK:()=>hYt,OsTypeValues:()=>Jnt,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>yet,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>get,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>det,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>vet,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>met,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Eet,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>bet,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>fet,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Aet,RPCGRPCSTATUSCODEVALUES_OK:()=>cet,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Tet,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>het,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>_et,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Ret,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Cet,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Iet,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>pet,RpcGrpcStatusCodeValues:()=>xet,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>iZe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>hZe,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>nZe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>WJe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>AZe,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>lZe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>uZe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>_Ze,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>sZe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>XJe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>oZe,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>cZe,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>rZe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>eZe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>tZe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>gZe,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>pZe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>fZe,SEMATTRS_AWS_DYNAMODB_SELECT:()=>aZe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>dZe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>ZJe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>mZe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>jKe,SEMATTRS_CODE_FILEPATH:()=>GJe,SEMATTRS_CODE_FUNCTION:()=>QJe,SEMATTRS_CODE_LINENO:()=>zJe,SEMATTRS_CODE_NAMESPACE:()=>FJe,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>WKe,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>rJe,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>nJe,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>eJe,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>JKe,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>ZKe,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>tJe,SEMATTRS_DB_CASSANDRA_TABLE:()=>XKe,SEMATTRS_DB_CONNECTION_STRING:()=>HKe,SEMATTRS_DB_HBASE_NAMESPACE:()=>oJe,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>qKe,SEMATTRS_DB_MONGODB_COLLECTION:()=>sJe,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>KKe,SEMATTRS_DB_NAME:()=>VKe,SEMATTRS_DB_OPERATION:()=>YKe,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>iJe,SEMATTRS_DB_SQL_TABLE:()=>aJe,SEMATTRS_DB_STATEMENT:()=>O9,SEMATTRS_DB_SYSTEM:()=>N9,SEMATTRS_DB_USER:()=>$Ke,SEMATTRS_ENDUSER_ID:()=>kJe,SEMATTRS_ENDUSER_ROLE:()=>PJe,SEMATTRS_ENDUSER_SCOPE:()=>MJe,SEMATTRS_EXCEPTION_ESCAPED:()=>dJe,SEMATTRS_EXCEPTION_MESSAGE:()=>cJe,SEMATTRS_EXCEPTION_STACKTRACE:()=>lJe,SEMATTRS_EXCEPTION_TYPE:()=>uJe,SEMATTRS_FAAS_COLDSTART:()=>EJe,SEMATTRS_FAAS_CRON:()=>_Je,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>fJe,SEMATTRS_FAAS_DOCUMENT_NAME:()=>gJe,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>mJe,SEMATTRS_FAAS_DOCUMENT_TIME:()=>AJe,SEMATTRS_FAAS_EXECUTION:()=>pJe,SEMATTRS_FAAS_INVOKED_NAME:()=>yJe,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>SJe,SEMATTRS_FAAS_INVOKED_REGION:()=>TJe,SEMATTRS_FAAS_TIME:()=>hJe,SEMATTRS_FAAS_TRIGGER:()=>w9,SEMATTRS_HTTP_CLIENT_IP:()=>JJe,SEMATTRS_HTTP_FLAVOR:()=>$Je,SEMATTRS_HTTP_HOST:()=>jJe,SEMATTRS_HTTP_METHOD:()=>AB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>VJe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>YJe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>U9,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Q9,SEMATTRS_HTTP_ROUTE:()=>F9,SEMATTRS_HTTP_SCHEME:()=>HJe,SEMATTRS_HTTP_SERVER_NAME:()=>KJe,SEMATTRS_HTTP_STATUS_CODE:()=>ky,SEMATTRS_HTTP_TARGET:()=>L9,SEMATTRS_HTTP_URL:()=>rC,SEMATTRS_HTTP_USER_AGENT:()=>qJe,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>$Ze,SEMATTRS_MESSAGE_ID:()=>HZe,SEMATTRS_MESSAGE_TYPE:()=>jZe,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>qZe,SEMATTRS_MESSAGING_CONSUMER_ID:()=>BZe,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>vZe,SEMATTRS_MESSAGING_DESTINATION:()=>EZe,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>yZe,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>kZe,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>wZe,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>OZe,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>PZe,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>MZe,SEMATTRS_MESSAGING_MESSAGE_ID:()=>CZe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>xZe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>RZe,SEMATTRS_MESSAGING_OPERATION:()=>DZe,SEMATTRS_MESSAGING_PROTOCOL:()=>TZe,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>IZe,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>NZe,SEMATTRS_MESSAGING_SYSTEM:()=>G9,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>SZe,SEMATTRS_MESSAGING_URL:()=>bZe,SEMATTRS_NET_HOST_CARRIER_ICC:()=>OJe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>BJe,SEMATTRS_NET_HOST_CARRIER_MNC:()=>NJe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>DJe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>xJe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>RJe,SEMATTRS_NET_HOST_IP:()=>P9,SEMATTRS_NET_HOST_NAME:()=>vJe,SEMATTRS_NET_HOST_PORT:()=>M9,SEMATTRS_NET_PEER_IP:()=>k9,SEMATTRS_NET_PEER_NAME:()=>CJe,SEMATTRS_NET_PEER_PORT:()=>bJe,SEMATTRS_NET_TRANSPORT:()=>IJe,SEMATTRS_PEER_SERVICE:()=>wJe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>j9,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>GZe,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>zZe,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>FZe,SEMATTRS_RPC_JSONRPC_VERSION:()=>QZe,SEMATTRS_RPC_METHOD:()=>UZe,SEMATTRS_RPC_SERVICE:()=>z9,SEMATTRS_RPC_SYSTEM:()=>LZe,SEMATTRS_THREAD_ID:()=>LJe,SEMATTRS_THREAD_NAME:()=>UJe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Uet,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Let,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Qet,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Fet,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Get,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>zet,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>jet,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>$et,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Het,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Vet,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>qet,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>wet,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Pet,SEMRESATTRS_CLOUD_PLATFORM:()=>Met,SEMRESATTRS_CLOUD_PROVIDER:()=>Oet,SEMRESATTRS_CLOUD_REGION:()=>ket,SEMRESATTRS_CONTAINER_ID:()=>Ket,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Zet,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Wet,SEMRESATTRS_CONTAINER_NAME:()=>Yet,SEMRESATTRS_CONTAINER_RUNTIME:()=>Jet,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Xet,SEMRESATTRS_DEVICE_ID:()=>ett,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>ttt,SEMRESATTRS_DEVICE_MODEL_NAME:()=>ntt,SEMRESATTRS_FAAS_ID:()=>ott,SEMRESATTRS_FAAS_INSTANCE:()=>stt,SEMRESATTRS_FAAS_MAX_MEMORY:()=>att,SEMRESATTRS_FAAS_NAME:()=>rtt,SEMRESATTRS_FAAS_VERSION:()=>itt,SEMRESATTRS_HOST_ARCH:()=>dtt,SEMRESATTRS_HOST_ID:()=>utt,SEMRESATTRS_HOST_IMAGE_ID:()=>ftt,SEMRESATTRS_HOST_IMAGE_NAME:()=>ptt,SEMRESATTRS_HOST_IMAGE_VERSION:()=>mtt,SEMRESATTRS_HOST_NAME:()=>ctt,SEMRESATTRS_HOST_TYPE:()=>ltt,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Att,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Stt,SEMRESATTRS_K8S_CRONJOB_NAME:()=>wtt,SEMRESATTRS_K8S_CRONJOB_UID:()=>Ott,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Dtt,SEMRESATTRS_K8S_DAEMONSET_UID:()=>xtt,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Ctt,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>btt,SEMRESATTRS_K8S_JOB_NAME:()=>Ntt,SEMRESATTRS_K8S_JOB_UID:()=>Btt,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>_tt,SEMRESATTRS_K8S_NODE_NAME:()=>gtt,SEMRESATTRS_K8S_NODE_UID:()=>htt,SEMRESATTRS_K8S_POD_NAME:()=>ytt,SEMRESATTRS_K8S_POD_UID:()=>Ett,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Itt,SEMRESATTRS_K8S_REPLICASET_UID:()=>Ttt,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Rtt,SEMRESATTRS_K8S_STATEFULSET_UID:()=>vtt,SEMRESATTRS_OS_DESCRIPTION:()=>Ptt,SEMRESATTRS_OS_NAME:()=>Mtt,SEMRESATTRS_OS_TYPE:()=>ktt,SEMRESATTRS_OS_VERSION:()=>Ltt,SEMRESATTRS_PROCESS_COMMAND:()=>Gtt,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>jtt,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>ztt,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Qtt,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Ftt,SEMRESATTRS_PROCESS_OWNER:()=>Htt,SEMRESATTRS_PROCESS_PID:()=>Utt,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Vtt,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>$tt,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>qtt,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Ktt,SEMRESATTRS_SERVICE_NAME:()=>Ytt,SEMRESATTRS_SERVICE_NAMESPACE:()=>H9,SEMRESATTRS_SERVICE_VERSION:()=>Jtt,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>ent,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Wtt,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Ztt,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Xtt,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>rnt,SEMRESATTRS_WEBENGINE_NAME:()=>tnt,SEMRESATTRS_WEBENGINE_VERSION:()=>nnt,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Lot,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Uot,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Qot,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Got,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>zot,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>jot,SemanticAttributes:()=>VZe,SemanticResourceAttributes:()=>ont,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Znt,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Wnt,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Xnt,TELEMETRYSDKLANGUAGEVALUES_GO:()=>ert,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>trt,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>nrt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>rrt,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>ort,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>irt,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>srt,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>_Yt,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>$ot,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>qot,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>EYt,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Vot,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Yot,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>yYt,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Kot,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Jot,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Zot,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Wot,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Xot,TelemetrySdkLanguageValues:()=>art});var Zn=O(()=>{A();ahe();wEe();kEe();PEe();MEe()});var LEe=F(QM=>{"use strict";A();Object.defineProperty(QM,"__esModule",{value:!0});QM.ATTR_PROCESS_RUNTIME_NAME=void 0;QM.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var UEe=F(GM=>{"use strict";A();Object.defineProperty(GM,"__esModule",{value:!0});GM.SDK_INFO=void 0;var ost=gpe(),FM=(Zn(),Me(Fr)),ist=LEe();GM.SDK_INFO={[FM.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[ist.ATTR_PROCESS_RUNTIME_NAME]:"node",[FM.ATTR_TELEMETRY_SDK_LANGUAGE]:FM.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[FM.ATTR_TELEMETRY_SDK_VERSION]:ost.VERSION}});var QEe=F(Wa=>{"use strict";A();Object.defineProperty(Wa,"__esModule",{value:!0});Wa.otperformance=Wa.SDK_INFO=Wa._globalThis=Wa.getStringListFromEnv=Wa.getNumberFromEnv=Wa.getBooleanFromEnv=Wa.getStringFromEnv=void 0;var zM=mpe();Object.defineProperty(Wa,"getStringFromEnv",{enumerable:!0,get:function(){return zM.getStringFromEnv}});Object.defineProperty(Wa,"getBooleanFromEnv",{enumerable:!0,get:function(){return zM.getBooleanFromEnv}});Object.defineProperty(Wa,"getNumberFromEnv",{enumerable:!0,get:function(){return zM.getNumberFromEnv}});Object.defineProperty(Wa,"getStringListFromEnv",{enumerable:!0,get:function(){return zM.getStringListFromEnv}});var sst=Ape();Object.defineProperty(Wa,"_globalThis",{enumerable:!0,get:function(){return sst._globalThis}});var ast=UEe();Object.defineProperty(Wa,"SDK_INFO",{enumerable:!0,get:function(){return ast.SDK_INFO}});Wa.otperformance=performance});var i5=F(Xa=>{"use strict";A();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.getStringListFromEnv=Xa.getNumberFromEnv=Xa.getStringFromEnv=Xa.getBooleanFromEnv=Xa.otperformance=Xa._globalThis=Xa.SDK_INFO=void 0;var Ly=QEe();Object.defineProperty(Xa,"SDK_INFO",{enumerable:!0,get:function(){return Ly.SDK_INFO}});Object.defineProperty(Xa,"_globalThis",{enumerable:!0,get:function(){return Ly._globalThis}});Object.defineProperty(Xa,"otperformance",{enumerable:!0,get:function(){return Ly.otperformance}});Object.defineProperty(Xa,"getBooleanFromEnv",{enumerable:!0,get:function(){return Ly.getBooleanFromEnv}});Object.defineProperty(Xa,"getStringFromEnv",{enumerable:!0,get:function(){return Ly.getStringFromEnv}});Object.defineProperty(Xa,"getNumberFromEnv",{enumerable:!0,get:function(){return Ly.getNumberFromEnv}});Object.defineProperty(Xa,"getStringListFromEnv",{enumerable:!0,get:function(){return Ly.getStringListFromEnv}})});var jEe=F(Gr=>{"use strict";A();Object.defineProperty(Gr,"__esModule",{value:!0});Gr.addHrTimes=Gr.isTimeInput=Gr.isTimeInputHrTime=Gr.hrTimeToSeconds=Gr.hrTimeToMilliseconds=Gr.hrTimeToMicroseconds=Gr.hrTimeToNanoseconds=Gr.hrTimeToTimeStamp=Gr.hrTimeDuration=Gr.timeInputToHrTime=Gr.hrTime=Gr.getTimeOrigin=Gr.millisToHrTime=void 0;var jM=i5(),FEe=9,ust=6,cst=Math.pow(10,ust),gB=Math.pow(10,FEe);function hB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*cst);return[n,r]}Gr.millisToHrTime=hB;function lst(){return jM.otperformance.timeOrigin}Gr.getTimeOrigin=lst;function GEe(e){let t=hB(jM.otperformance.timeOrigin),n=hB(typeof e=="number"?e:jM.otperformance.now());return zEe(t,n)}Gr.hrTime=GEe;function dst(e){if(s5(e))return e;if(typeof e=="number")return e<jM.otperformance.timeOrigin?GEe(e):hB(e);if(e instanceof Date)return hB(e.getTime());throw TypeError("Invalid input type")}Gr.timeInputToHrTime=dst;function pst(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=gB),[n,r]}Gr.hrTimeDuration=pst;function fst(e){let t=FEe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}Gr.hrTimeToTimeStamp=fst;function mst(e){return e[0]*gB+e[1]}Gr.hrTimeToNanoseconds=mst;function Ast(e){return e[0]*1e6+e[1]/1e3}Gr.hrTimeToMicroseconds=Ast;function gst(e){return e[0]*1e3+e[1]/1e6}Gr.hrTimeToMilliseconds=gst;function hst(e){return e[0]+e[1]/gB}Gr.hrTimeToSeconds=hst;function s5(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}Gr.isTimeInputHrTime=s5;function _st(e){return s5(e)||typeof e=="number"||e instanceof Date}Gr.isTimeInput=_st;function zEe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=gB&&(n[1]-=gB,n[0]+=1),n}Gr.addHrTimes=zEe});var HEe=F(HM=>{"use strict";A();Object.defineProperty(HM,"__esModule",{value:!0});HM.unrefTimer=void 0;function Est(e){typeof e!="number"&&e.unref()}HM.unrefTimer=Est});var $Ee=F(_B=>{"use strict";A();Object.defineProperty(_B,"__esModule",{value:!0});_B.ExportResultCode=void 0;var yst;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(yst=_B.ExportResultCode||(_B.ExportResultCode={}))});var VEe=F($M=>{"use strict";A();Object.defineProperty($M,"__esModule",{value:!0});$M.CompositePropagator=void 0;var qEe=(ze(),Me(We)),a5=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let n=new Set;for(let r of this._propagators){let o=typeof r.fields=="function"?r.fields():[];for(let i of o)n.add(i)}this._fields=Array.from(n)}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){qEe.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(s){qEe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};$M.CompositePropagator=a5});var YEe=F(iC=>{"use strict";A();Object.defineProperty(iC,"__esModule",{value:!0});iC.validateValue=iC.validateKey=void 0;var u5="[_0-9a-z-*/]",Sst=`[a-z]${u5}{0,255}`,Tst=`[a-z0-9]${u5}{0,240}@[a-z]${u5}{0,13}`,Ist=new RegExp(`^(?:${Sst}|${Tst})$`),bst=/^[ -~]{0,255}[!-~]$/,Cst=/,|=/;function vst(e){return Ist.test(e)}iC.validateKey=vst;function Rst(e){return bst.test(e)&&!Cst.test(e)}iC.validateValue=Rst});var l5=F(VM=>{"use strict";A();Object.defineProperty(VM,"__esModule",{value:!0});VM.TraceState=void 0;var qM=YEe(),xst=32,KEe=512,JEe=",",ZEe="=",c5=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,qM.validateKey)(t)||!(0,qM.validateValue)(n))return this;let r=this._getState(),o=r.get(t),i=this._length;if(typeof o=="string"?i+=n.length-o.length:i+=t.length+n.length+(r.size>0?2:1),i>KEe)return this;let s=new Map(r);return s.delete(t),s.set(t,n),this._fromState(s,i)}unset(t){let n=this._getState(),r=n.get(t);if(typeof r!="string")return this;let o=this._length-(t.length+r.length+1);n.size>1&&(o=o-1);let i=new Map(n);return i.delete(t),this._fromState(i,o)}get(t){return this._getState().get(t)}serialize(){let t="",n=0;for(let r of this._getState())n>0&&(t=JEe+t),t=`${r[0]}${ZEe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(JEe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(ZEe);if(s===-1)continue;let c=i.slice(0,s),l=i.slice(s+1);if(!(0,qM.validateKey)(c)||!(0,qM.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>KEe)&&(n.set(c,l),r=f,n.size>=xst))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};VM.TraceState=c5});var XEe=F(eu=>{"use strict";A();Object.defineProperty(eu,"__esModule",{value:!0});eu.W3CTraceContextPropagator=eu.parseTraceParent=eu.TRACE_STATE_HEADER=eu.TRACE_PARENT_HEADER=void 0;var YM=(ze(),Me(We)),Dst=fB(),Bst=l5();eu.TRACE_PARENT_HEADER="traceparent";eu.TRACE_STATE_HEADER="tracestate";var Nst="00",Ost="(?!ff)[\\da-f]{2}",wst="(?![0]{32})[\\da-f]{32}",kst="(?![0]{16})[\\da-f]{16}",Pst="[\\da-f]{2}",Mst=new RegExp(`^\\s?(${Ost})-(${wst})-(${kst})-(${Pst})(-.*)?\\s?$`);function WEe(e){let t=Mst.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}eu.parseTraceParent=WEe;var d5=class{inject(t,n,r){let o=YM.trace.getSpanContext(t);if(!o||(0,Dst.isTracingSuppressed)(t)||!(0,YM.isSpanContextValid)(o))return;let i=`${Nst}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||YM.TraceFlags.NONE).toString(16)}`;r.set(n,eu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,eu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,eu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=WEe(i);if(!s)return t;s.isRemote=!0;let c=r.get(n,eu.TRACE_STATE_HEADER);if(c){let l=Array.isArray(c)?c.join(","):c;s.traceState=new Bst.TraceState(typeof l=="string"?l:void 0)}return YM.trace.setSpanContext(t,s)}fields(){return[eu.TRACE_PARENT_HEADER,eu.TRACE_STATE_HEADER]}};eu.W3CTraceContextPropagator=d5});var e0e=F(tf=>{"use strict";A();Object.defineProperty(tf,"__esModule",{value:!0});tf.getRPCMetadata=tf.deleteRPCMetadata=tf.setRPCMetadata=tf.RPCType=void 0;var Lst=(ze(),Me(We)),p5=(0,Lst.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Ust;(function(e){e.HTTP="http"})(Ust=tf.RPCType||(tf.RPCType={}));function Qst(e,t){return e.setValue(p5,t)}tf.setRPCMetadata=Qst;function Fst(e){return e.deleteValue(p5)}tf.deleteRPCMetadata=Fst;function Gst(e){return e.getValue(p5)}tf.getRPCMetadata=Gst});var i0e=F(KM=>{"use strict";A();Object.defineProperty(KM,"__esModule",{value:!0});KM.isPlainObject=void 0;var zst="[object Object]",jst="[object Null]",Hst="[object Undefined]",$st=Function.prototype,t0e=$st.toString,qst=t0e.call(Object),Vst=Object.getPrototypeOf,n0e=Object.prototype,r0e=n0e.hasOwnProperty,Uy=Symbol?Symbol.toStringTag:void 0,o0e=n0e.toString;function Yst(e){if(!Kst(e)||Jst(e)!==zst)return!1;let t=Vst(e);if(t===null)return!0;let n=r0e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&t0e.call(n)===qst}KM.isPlainObject=Yst;function Kst(e){return e!=null&&typeof e=="object"}function Jst(e){return e==null?e===void 0?Hst:jst:Uy&&Uy in Object(e)?Zst(e):Wst(e)}function Zst(e){let t=r0e.call(e,Uy),n=e[Uy],r=!1;try{e[Uy]=void 0,r=!0}catch{}let o=o0e.call(e);return r&&(t?e[Uy]=n:delete e[Uy]),o}function Wst(e){return o0e.call(e)}});var l0e=F(WM=>{"use strict";A();Object.defineProperty(WM,"__esModule",{value:!0});WM.merge=void 0;var s0e=i0e(),Xst=20;function eat(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=u0e(t,e.shift(),0,n);return t}WM.merge=eat;function f5(e){return ZM(e)?e.slice():e}function u0e(e,t,n=0,r){let o;if(!(n>Xst)){if(n++,JM(e)||JM(t)||c0e(t))o=f5(t);else if(ZM(e)){if(o=e.slice(),ZM(t))for(let i=0,s=t.length;i<s;i++)o.push(f5(t[i]));else if(EB(t)){let i=Object.keys(t);for(let s=0,c=i.length;s<c;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=f5(t[l]))}}}else if(EB(e))if(EB(t)){if(!tat(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,c=i.length;s<c;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(JM(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],y=f;if(a0e(e,l,r)||a0e(t,l,r))delete o[l];else{if(EB(h)&&EB(y)){let S=r.get(h)||[],b=r.get(y)||[];S.push({obj:e,key:l}),b.push({obj:t,key:l}),r.set(h,S),r.set(y,b)}o[l]=u0e(o[l],f,n,r)}}}}else o=t;return o}}function a0e(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let s=r[o];if(s.key===t&&s.obj===e)return!0}return!1}function ZM(e){return Array.isArray(e)}function c0e(e){return typeof e=="function"}function EB(e){return!JM(e)&&!ZM(e)&&!c0e(e)&&typeof e=="object"}function JM(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function tat(e,t){return!(!(0,s0e.isPlainObject)(e)||!(0,s0e.isPlainObject)(t))}});var d0e=F(sC=>{"use strict";A();Object.defineProperty(sC,"__esModule",{value:!0});sC.callWithTimeout=sC.TimeoutError=void 0;var XM=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};sC.TimeoutError=XM;function nat(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new XM("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}sC.callWithTimeout=nat});var f0e=F(aC=>{"use strict";A();Object.defineProperty(aC,"__esModule",{value:!0});aC.isUrlIgnored=aC.urlMatches=void 0;function p0e(e,t){return typeof t=="string"?e===t:!!e.match(t)}aC.urlMatches=p0e;function rat(e,t){if(!t)return!1;for(let n of t)if(p0e(e,n))return!0;return!1}aC.isUrlIgnored=rat});var m0e=F(eL=>{"use strict";A();Object.defineProperty(eL,"__esModule",{value:!0});eL.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)}};eL.Deferred=m5});var A0e=F(tL=>{"use strict";A();Object.defineProperty(tL,"__esModule",{value:!0});tL.BindOnceFuture=void 0;var oat=m0e(),A5=class{_isCalled=!1;_deferred=new oat.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}};tL.BindOnceFuture=A5});var h0e=F(nL=>{"use strict";A();Object.defineProperty(nL,"__esModule",{value:!0});nL.diagLogLevelFromString=void 0;var mg=(ze(),Me(We)),g0e={ALL:mg.DiagLogLevel.ALL,VERBOSE:mg.DiagLogLevel.VERBOSE,DEBUG:mg.DiagLogLevel.DEBUG,INFO:mg.DiagLogLevel.INFO,WARN:mg.DiagLogLevel.WARN,ERROR:mg.DiagLogLevel.ERROR,NONE:mg.DiagLogLevel.NONE};function iat(e){if(e==null)return;let t=g0e[e.toUpperCase()];return t??(mg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(g0e)}, using default`),mg.DiagLogLevel.INFO)}nL.diagLogLevelFromString=iat});var E0e=F(rL=>{"use strict";A();Object.defineProperty(rL,"__esModule",{value:!0});rL._export=void 0;var _0e=(ze(),Me(We)),sat=fB();function aat(e,t){return new Promise(n=>{_0e.context.with((0,sat.suppressTracing)(_0e.context.active()),()=>{e.export(t,n)})})}rL._export=aat});var br=F(Ne=>{"use strict";A();Object.defineProperty(Ne,"__esModule",{value:!0});Ne.diagLogLevelFromString=Ne.BindOnceFuture=Ne.urlMatches=Ne.isUrlIgnored=Ne.callWithTimeout=Ne.TimeoutError=Ne.merge=Ne.TraceState=Ne.unsuppressTracing=Ne.suppressTracing=Ne.isTracingSuppressed=Ne.setRPCMetadata=Ne.getRPCMetadata=Ne.deleteRPCMetadata=Ne.RPCType=Ne.parseTraceParent=Ne.W3CTraceContextPropagator=Ne.TRACE_STATE_HEADER=Ne.TRACE_PARENT_HEADER=Ne.CompositePropagator=Ne.otperformance=Ne.getStringListFromEnv=Ne.getNumberFromEnv=Ne.getBooleanFromEnv=Ne.getStringFromEnv=Ne._globalThis=Ne.SDK_INFO=Ne.parseKeyPairsIntoRecord=Ne.ExportResultCode=Ne.unrefTimer=Ne.timeInputToHrTime=Ne.millisToHrTime=Ne.isTimeInputHrTime=Ne.isTimeInput=Ne.hrTimeToTimeStamp=Ne.hrTimeToSeconds=Ne.hrTimeToNanoseconds=Ne.hrTimeToMilliseconds=Ne.hrTimeToMicroseconds=Ne.hrTimeDuration=Ne.hrTime=Ne.getTimeOrigin=Ne.addHrTimes=Ne.loggingErrorHandler=Ne.setGlobalErrorHandler=Ne.globalErrorHandler=Ne.sanitizeAttributes=Ne.isAttributeValue=Ne.AnchoredClock=Ne.W3CBaggagePropagator=void 0;Ne.internal=void 0;var uat=npe();Object.defineProperty(Ne,"W3CBaggagePropagator",{enumerable:!0,get:function(){return uat.W3CBaggagePropagator}});var cat=rpe();Object.defineProperty(Ne,"AnchoredClock",{enumerable:!0,get:function(){return cat.AnchoredClock}});var y0e=upe();Object.defineProperty(Ne,"isAttributeValue",{enumerable:!0,get:function(){return y0e.isAttributeValue}});Object.defineProperty(Ne,"sanitizeAttributes",{enumerable:!0,get:function(){return y0e.sanitizeAttributes}});var S0e=lpe();Object.defineProperty(Ne,"globalErrorHandler",{enumerable:!0,get:function(){return S0e.globalErrorHandler}});Object.defineProperty(Ne,"setGlobalErrorHandler",{enumerable:!0,get:function(){return S0e.setGlobalErrorHandler}});var lat=D9();Object.defineProperty(Ne,"loggingErrorHandler",{enumerable:!0,get:function(){return lat.loggingErrorHandler}});var Nl=jEe();Object.defineProperty(Ne,"addHrTimes",{enumerable:!0,get:function(){return Nl.addHrTimes}});Object.defineProperty(Ne,"getTimeOrigin",{enumerable:!0,get:function(){return Nl.getTimeOrigin}});Object.defineProperty(Ne,"hrTime",{enumerable:!0,get:function(){return Nl.hrTime}});Object.defineProperty(Ne,"hrTimeDuration",{enumerable:!0,get:function(){return Nl.hrTimeDuration}});Object.defineProperty(Ne,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Nl.hrTimeToMicroseconds}});Object.defineProperty(Ne,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Nl.hrTimeToMilliseconds}});Object.defineProperty(Ne,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Nl.hrTimeToNanoseconds}});Object.defineProperty(Ne,"hrTimeToSeconds",{enumerable:!0,get:function(){return Nl.hrTimeToSeconds}});Object.defineProperty(Ne,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Nl.hrTimeToTimeStamp}});Object.defineProperty(Ne,"isTimeInput",{enumerable:!0,get:function(){return Nl.isTimeInput}});Object.defineProperty(Ne,"isTimeInputHrTime",{enumerable:!0,get:function(){return Nl.isTimeInputHrTime}});Object.defineProperty(Ne,"millisToHrTime",{enumerable:!0,get:function(){return Nl.millisToHrTime}});Object.defineProperty(Ne,"timeInputToHrTime",{enumerable:!0,get:function(){return Nl.timeInputToHrTime}});var dat=HEe();Object.defineProperty(Ne,"unrefTimer",{enumerable:!0,get:function(){return dat.unrefTimer}});var pat=$Ee();Object.defineProperty(Ne,"ExportResultCode",{enumerable:!0,get:function(){return pat.ExportResultCode}});var fat=C9();Object.defineProperty(Ne,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return fat.parseKeyPairsIntoRecord}});var Qy=i5();Object.defineProperty(Ne,"SDK_INFO",{enumerable:!0,get:function(){return Qy.SDK_INFO}});Object.defineProperty(Ne,"_globalThis",{enumerable:!0,get:function(){return Qy._globalThis}});Object.defineProperty(Ne,"getStringFromEnv",{enumerable:!0,get:function(){return Qy.getStringFromEnv}});Object.defineProperty(Ne,"getBooleanFromEnv",{enumerable:!0,get:function(){return Qy.getBooleanFromEnv}});Object.defineProperty(Ne,"getNumberFromEnv",{enumerable:!0,get:function(){return Qy.getNumberFromEnv}});Object.defineProperty(Ne,"getStringListFromEnv",{enumerable:!0,get:function(){return Qy.getStringListFromEnv}});Object.defineProperty(Ne,"otperformance",{enumerable:!0,get:function(){return Qy.otperformance}});var mat=VEe();Object.defineProperty(Ne,"CompositePropagator",{enumerable:!0,get:function(){return mat.CompositePropagator}});var oL=XEe();Object.defineProperty(Ne,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return oL.TRACE_PARENT_HEADER}});Object.defineProperty(Ne,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return oL.TRACE_STATE_HEADER}});Object.defineProperty(Ne,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return oL.W3CTraceContextPropagator}});Object.defineProperty(Ne,"parseTraceParent",{enumerable:!0,get:function(){return oL.parseTraceParent}});var iL=e0e();Object.defineProperty(Ne,"RPCType",{enumerable:!0,get:function(){return iL.RPCType}});Object.defineProperty(Ne,"deleteRPCMetadata",{enumerable:!0,get:function(){return iL.deleteRPCMetadata}});Object.defineProperty(Ne,"getRPCMetadata",{enumerable:!0,get:function(){return iL.getRPCMetadata}});Object.defineProperty(Ne,"setRPCMetadata",{enumerable:!0,get:function(){return iL.setRPCMetadata}});var g5=fB();Object.defineProperty(Ne,"isTracingSuppressed",{enumerable:!0,get:function(){return g5.isTracingSuppressed}});Object.defineProperty(Ne,"suppressTracing",{enumerable:!0,get:function(){return g5.suppressTracing}});Object.defineProperty(Ne,"unsuppressTracing",{enumerable:!0,get:function(){return g5.unsuppressTracing}});var Aat=l5();Object.defineProperty(Ne,"TraceState",{enumerable:!0,get:function(){return Aat.TraceState}});var gat=l0e();Object.defineProperty(Ne,"merge",{enumerable:!0,get:function(){return gat.merge}});var T0e=d0e();Object.defineProperty(Ne,"TimeoutError",{enumerable:!0,get:function(){return T0e.TimeoutError}});Object.defineProperty(Ne,"callWithTimeout",{enumerable:!0,get:function(){return T0e.callWithTimeout}});var I0e=f0e();Object.defineProperty(Ne,"isUrlIgnored",{enumerable:!0,get:function(){return I0e.isUrlIgnored}});Object.defineProperty(Ne,"urlMatches",{enumerable:!0,get:function(){return I0e.urlMatches}});var hat=A0e();Object.defineProperty(Ne,"BindOnceFuture",{enumerable:!0,get:function(){return hat.BindOnceFuture}});var _at=h0e();Object.defineProperty(Ne,"diagLogLevelFromString",{enumerable:!0,get:function(){return _at.diagLogLevelFromString}});var Eat=E0e();Ne.internal={_export:Eat._export}});var b0e=F(sL=>{"use strict";A();Object.defineProperty(sL,"__esModule",{value:!0});sL.VERSION=void 0;sL.VERSION="0.214.0"});var C0e=F(yB=>{"use strict";A();Object.defineProperty(yB,"__esModule",{value:!0});yB.SeverityNumber=void 0;var yat;(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"})(yat=yB.SeverityNumber||(yB.SeverityNumber={}))});var uL=F(uC=>{"use strict";A();Object.defineProperty(uC,"__esModule",{value:!0});uC.NOOP_LOGGER=uC.NoopLogger=void 0;var aL=class{emit(t){}};uC.NoopLogger=aL;uC.NOOP_LOGGER=new aL});var v0e=F(ym=>{"use strict";A();Object.defineProperty(ym,"__esModule",{value:!0});ym.API_BACKWARDS_COMPATIBILITY_VERSION=ym.makeGetter=ym._global=ym.GLOBAL_LOGS_API_KEY=void 0;ym.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");ym._global=globalThis;function Sat(e,t,n){return r=>r===e?t:n}ym.makeGetter=Sat;ym.API_BACKWARDS_COMPATIBILITY_VERSION=1});var h5=F(cC=>{"use strict";A();Object.defineProperty(cC,"__esModule",{value:!0});cC.NOOP_LOGGER_PROVIDER=cC.NoopLoggerProvider=void 0;var Tat=uL(),cL=class{getLogger(t,n,r){return new Tat.NoopLogger}};cC.NoopLoggerProvider=cL;cC.NOOP_LOGGER_PROVIDER=new cL});var R0e=F(lL=>{"use strict";A();Object.defineProperty(lL,"__esModule",{value:!0});lL.ProxyLogger=void 0;var Iat=uL(),_5=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):Iat.NOOP_LOGGER}};lL.ProxyLogger=_5});var x0e=F(dL=>{"use strict";A();Object.defineProperty(dL,"__esModule",{value:!0});dL.ProxyLoggerProvider=void 0;var bat=h5(),Cat=R0e(),E5=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Cat.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:bat.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)}};dL.ProxyLoggerProvider=E5});var B0e=F(pL=>{"use strict";A();Object.defineProperty(pL,"__esModule",{value:!0});pL.LogsAPI=void 0;var Pd=v0e(),vat=h5(),D0e=x0e(),y5=class e{constructor(){this._proxyLoggerProvider=new D0e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Pd._global[Pd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Pd._global[Pd.GLOBAL_LOGS_API_KEY]=(0,Pd.makeGetter)(Pd.API_BACKWARDS_COMPATIBILITY_VERSION,t,vat.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Pd._global[Pd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Pd._global,Pd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Pd._global[Pd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new D0e.ProxyLoggerProvider}};pL.LogsAPI=y5});var S5=F(Sm=>{"use strict";A();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.logs=Sm.NoopLogger=Sm.NOOP_LOGGER=Sm.SeverityNumber=void 0;var Rat=C0e();Object.defineProperty(Sm,"SeverityNumber",{enumerable:!0,get:function(){return Rat.SeverityNumber}});var N0e=uL();Object.defineProperty(Sm,"NOOP_LOGGER",{enumerable:!0,get:function(){return N0e.NOOP_LOGGER}});Object.defineProperty(Sm,"NoopLogger",{enumerable:!0,get:function(){return N0e.NoopLogger}});var xat=B0e();Sm.logs=xat.LogsAPI.getInstance()});var O0e=F(lC=>{"use strict";A();Object.defineProperty(lC,"__esModule",{value:!0});lC.disableInstrumentations=lC.enableInstrumentations=void 0;function Dat(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}lC.enableInstrumentations=Dat;function Bat(e){e.forEach(t=>t.disable())}lC.disableInstrumentations=Bat});var P0e=F(fL=>{"use strict";A();Object.defineProperty(fL,"__esModule",{value:!0});fL.registerInstrumentations=void 0;var w0e=(ze(),Me(We)),Nat=S5(),k0e=O0e();function Oat(e){let t=e.tracerProvider||w0e.trace.getTracerProvider(),n=e.meterProvider||w0e.metrics.getMeterProvider(),r=e.loggerProvider||Nat.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,k0e.enableInstrumentations)(o,t,n,r),()=>{(0,k0e.disableInstrumentations)(o)}}fL.registerInstrumentations=Oat});var H0e=F(mL=>{"use strict";A();Object.defineProperty(mL,"__esModule",{value:!0});mL.satisfies=void 0;var C5=(ze(),Me(We)),F0e=/^(?: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-]+)*))?$/,wat=/^(?<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-]+)*))?$/,kat={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Pat(e,t,n){if(!Mat(e))return C5.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Fat(e);if(!r)return!1;let o=[],i=G0e(r,t,o,n);return i&&!n?.includePrerelease?Uat(r,o):i}mL.satisfies=Pat;function Mat(e){return typeof e=="string"&&F0e.test(e)}function G0e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(T5(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=aut(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!T5(e,i,n,r))return!1;return!0}return T5(e,t,n,r)}function T5(e,t,n,r){if(t=Qat(t,r),t.includes(" "))return G0e(e,t,n,r);{let o=Gat(t);return n.push(o),Lat(e,o)}}function Lat(e,t){if(t.invalid)return!1;if(!t.version||b5(t.version))return!0;let n=L0e(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=L0e(r,o)}return kat[t.op]?.includes(n)}function Uat(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Qat(e,t){return e=e.trim(),e=iut(e,t),e=out(e),e=sut(e,t),e=e.trim(),e}function Mu(e){return!e||e.toLowerCase()==="x"||e==="*"}function Fat(e){let t=e.match(F0e);if(!t){C5.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function Gat(e){if(!e)return{};let t=e.match(wat);if(!t)return C5.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function b5(e){return e==="*"||e==="x"||e==="X"}function M0e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function zat(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 jat(e,t){if(b5(e)||b5(t))return 0;let[n,r]=zat(M0e(e),M0e(t));return n>r?1:n<r?-1:0}function L0e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=jat(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var z0e="[a-zA-Z0-9-]",j0e="0|[1-9]\\d*",Hat=`\\d*[a-zA-Z-]${z0e}*`,$at="((?:<|>)?=?)",U0e=`(?:${j0e}|${Hat})`,qat=`(?:-(${U0e}(?:\\.${U0e})*))`,Q0e=`${z0e}+`,Vat=`(?:\\+(${Q0e}(?:\\.${Q0e})*))`,I5=`${j0e}|x|X|\\*`,SB=`[v=\\s]*(${I5})(?:\\.(${I5})(?:\\.(${I5})(?:${qat})?${Vat}?)?)?`,Yat=`^${$at}\\s*${SB}$`,Kat=new RegExp(Yat),Jat=`^\\s*(${SB})\\s+-\\s+(${SB})\\s*$`,Zat=new RegExp(Jat),Wat="(?:~>?)",Xat=`^${Wat}${SB}$`,eut=new RegExp(Xat),tut="(?:\\^)",nut=`^${tut}${SB}$`,rut=new RegExp(nut);function out(e){let t=eut;return e.replace(t,(n,r,o,i,s)=>{let c;return Mu(r)?c="":Mu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Mu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?c=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function iut(e,t){let n=rut,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,c,l)=>{let f;return Mu(i)?f="":Mu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Mu(c)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${c}-${l} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${c}${r} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c} <${+i+1}.0.0-0`,f})}function sut(e,t){let n=Kat;return e.replace(n,(r,o,i,s,c,l)=>{let f=Mu(i),h=f||Mu(s),y=h||Mu(c),S=y;return o==="="&&S&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&S?(h&&(s=0),c=0,o===">"?(o=">=",h?(i=+i+1,s=0,c=0):(s=+s+1,c=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${c}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:y&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function aut(e,t){let n=Zat;return e.replace(n,(r,o,i,s,c,l,f,h,y,S,b,v)=>(Mu(i)?o="":Mu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Mu(c)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Mu(y)?h="":Mu(S)?h=`<${+y+1}.0.0-0`:Mu(b)?h=`<${y}.${+S+1}.0-0`:v?h=`<=${y}.${S}.${b}-${v}`:t?.includePrerelease?h=`<${y}.${S}.${+b+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var v5=F(Ia=>{"use strict";A();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.massUnwrap=Ia.unwrap=Ia.massWrap=Ia.wrap=void 0;var Lu=console.error.bind(console);function TB(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 uut=(e,t,n)=>{if(!e||!e[t]){Lu("no original function "+String(t)+" to wrap");return}if(!n){Lu("no wrapper function"),Lu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){Lu("original object and wrapper must be functions");return}let o=n(r,t);return TB(o,"__original",r),TB(o,"__unwrap",()=>{e[t]===o&&TB(e,t,r)}),TB(o,"__wrapped",!0),TB(e,t,o),o};Ia.wrap=uut;var cut=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Lu("must provide one or more modules to patch"),Lu(new Error().stack);return}if(!(t&&Array.isArray(t))){Lu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ia.wrap)(r,o,n)})})};Ia.massWrap=cut;var lut=(e,t)=>{if(!e||!e[t]){Lu("no function to unwrap."),Lu(new Error().stack);return}let n=e[t];if(!n.__unwrap)Lu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ia.unwrap=lut;var dut=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Lu("must provide one or more modules to patch"),Lu(new Error().stack);return}if(!(t&&Array.isArray(t))){Lu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ia.unwrap)(n,r)})})};Ia.massUnwrap=dut;function IB(e){e&&e.logger&&(typeof e.logger!="function"?Lu("new logger isn't a function, not replacing"):Lu=e.logger)}Ia.default=IB;IB.wrap=Ia.wrap;IB.massWrap=Ia.massWrap;IB.unwrap=Ia.unwrap;IB.massUnwrap=Ia.massUnwrap});var $0e=F(gL=>{"use strict";A();Object.defineProperty(gL,"__esModule",{value:!0});gL.InstrumentationAbstract=void 0;var R5=(ze(),Me(We)),put=S5(),AL=v5(),x5=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=R5.diag.createComponentLogger({namespace:t}),this._tracer=R5.trace.getTracer(t,n),this._meter=R5.metrics.getMeter(t,n),this._logger=put.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=AL.wrap;_unwrap=AL.unwrap;_massWrap=AL.massWrap;_massUnwrap=AL.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)}}};gL.InstrumentationAbstract=x5});var V0e=F((KKt,q0e)=>{A();var dC=1e3,pC=dC*60,fC=pC*60,Fy=fC*24,fut=Fy*7,mut=Fy*365.25;q0e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Aut(e);if(n==="number"&&isFinite(e))return t.long?hut(e):gut(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Aut(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*mut;case"weeks":case"week":case"w":return n*fut;case"days":case"day":case"d":return n*Fy;case"hours":case"hour":case"hrs":case"hr":case"h":return n*fC;case"minutes":case"minute":case"mins":case"min":case"m":return n*pC;case"seconds":case"second":case"secs":case"sec":case"s":return n*dC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function gut(e){var t=Math.abs(e);return t>=Fy?Math.round(e/Fy)+"d":t>=fC?Math.round(e/fC)+"h":t>=pC?Math.round(e/pC)+"m":t>=dC?Math.round(e/dC)+"s":e+"ms"}function hut(e){var t=Math.abs(e);return t>=Fy?hL(e,t,Fy,"day"):t>=fC?hL(e,t,fC,"hour"):t>=pC?hL(e,t,pC,"minute"):t>=dC?hL(e,t,dC,"second"):e+" ms"}function hL(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var D5=F((ZKt,Y0e)=>{A();function _ut(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=c,n.humanize=V0e(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let y=0;for(let S=0;S<h.length;S++)y=(y<<5)-y+h.charCodeAt(S),y|=0;return n.colors[Math.abs(y)%n.colors.length]}n.selectColor=t;function n(h){let y,S=null,b,v;function x(...D){if(!x.enabled)return;let k=x,Q=Number(new Date),z=Q-(y||Q);k.diff=z,k.prev=y,k.curr=Q,y=Q,D[0]=n.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let G=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(ie,ge)=>{if(ie==="%%")return"%";G++;let Ce=n.formatters[ge];if(typeof Ce=="function"){let ve=D[G];ie=Ce.call(k,ve),D.splice(G,1),G--}return ie}),n.formatArgs.call(k,D),(k.log||n.log).apply(k,D)}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:()=>S!==null?S:(b!==n.namespaces&&(b=n.namespaces,v=n.enabled(h)),v),set:D=>{S=D}}),typeof n.init=="function"&&n.init(x),x}function r(h,y){let S=n(this.namespace+(typeof y>"u"?":":y)+h);return S.log=this.log,S}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let y=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let S of y)S[0]==="-"?n.skips.push(S.slice(1)):n.names.push(S)}function i(h,y){let S=0,b=0,v=-1,x=0;for(;S<h.length;)if(b<y.length&&(y[b]===h[S]||y[b]==="*"))y[b]==="*"?(v=b,x=S,b++):(S++,b++);else if(v!==-1)b=v+1,x++,S=x;else return!1;for(;b<y.length&&y[b]==="*";)b++;return b===y.length}function s(){let h=[...n.names,...n.skips.map(y=>"-"+y)].join(",");return n.enable(""),h}function c(h){for(let y of n.skips)if(i(h,y))return!1;for(let y of n.names)if(i(h,y))return!0;return!1}function l(h){return h instanceof Error?h.stack||h.message:h}function f(){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}Y0e.exports=_ut});var K0e=F((Oc,_L)=>{A();Oc.formatArgs=yut;Oc.save=Sut;Oc.load=Tut;Oc.useColors=Eut;Oc.storage=Iut();Oc.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`."))}})();Oc.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 Eut(){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 yut(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+_L.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)}Oc.log=console.debug||console.log||(()=>{});function Sut(e){try{e?Oc.storage.setItem("debug",e):Oc.storage.removeItem("debug")}catch{}}function Tut(){let e;try{e=Oc.storage.getItem("debug")||Oc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Iut(){try{return localStorage}catch{}}_L.exports=D5()(Oc);var{formatters:but}=_L.exports;but.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Z0e=F((eJt,J0e)=>{"use strict";A();J0e.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 eye=F((nJt,X0e)=>{"use strict";A();var Cut=Fe("os"),W0e=Fe("tty"),Md=Z0e(),{env:Vs}=process,d_;Md("no-color")||Md("no-colors")||Md("color=false")||Md("color=never")?d_=0:(Md("color")||Md("colors")||Md("color=true")||Md("color=always"))&&(d_=1);"FORCE_COLOR"in Vs&&(Vs.FORCE_COLOR==="true"?d_=1:Vs.FORCE_COLOR==="false"?d_=0:d_=Vs.FORCE_COLOR.length===0?1:Math.min(parseInt(Vs.FORCE_COLOR,10),3));function B5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function N5(e,t){if(d_===0)return 0;if(Md("color=16m")||Md("color=full")||Md("color=truecolor"))return 3;if(Md("color=256"))return 2;if(e&&!t&&d_===void 0)return 0;let n=d_||0;if(Vs.TERM==="dumb")return n;if(process.platform==="win32"){let r=Cut.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Vs)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Vs)||Vs.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Vs)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Vs.TEAMCITY_VERSION)?1:0;if(Vs.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Vs){let r=parseInt((Vs.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Vs.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Vs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Vs.TERM)||"COLORTERM"in Vs?1:n}function vut(e){let t=N5(e,e&&e.isTTY);return B5(t)}X0e.exports={supportsColor:vut,stdout:B5(N5(!0,W0e.isatty(1))),stderr:B5(N5(!0,W0e.isatty(2)))}});var nye=F((Ys,yL)=>{A();var Rut=Fe("tty"),EL=Fe("util");Ys.init=kut;Ys.log=Nut;Ys.formatArgs=Dut;Ys.save=Out;Ys.load=wut;Ys.useColors=xut;Ys.destroy=EL.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ys.colors=[6,2,3,4,5,1];try{let e=eye();e&&(e.stderr||e).level>=2&&(Ys.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{}Ys.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 xut(){return"colors"in Ys.inspectOpts?!!Ys.inspectOpts.colors:Rut.isatty(process.stderr.fd)}function Dut(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+"+yL.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=But()+t+" "+e[0]}function But(){return Ys.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Nut(...e){return process.stderr.write(EL.formatWithOptions(Ys.inspectOpts,...e)+`
|
|
6
6
|
`)}function Out(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function wut(){return process.env.DEBUG}function kut(e){e.inspectOpts={};let t=Object.keys(Ys.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=Ys.inspectOpts[t[n]]}yL.exports=D5()(Ys);var{formatters:tye}=yL.exports;tye.o=function(e){return this.inspectOpts.colors=this.useColors,EL.inspect(e,this.inspectOpts).split(`
|
|
@@ -35,7 +35,7 @@ Url: ${BU(e)}`),!0}return!1}function Jdt(e,t){return t?.length?CU(e).some(n=>S_(
|
|
|
35
35
|
`);for(let o of r){if(!o)continue;let i=o.indexOf(":");if(i===-1)continue;let s=o.substring(0,i).toLowerCase(),c=o.substring(i+1).trim(),l=n.get(s);l&&Array.isArray(l)?l.push(c):l?n.set(s,[l,c]):n.set(s,c)}}return n}onRequestCreated({request:t}){let n=this.getConfig(),r=n.enabled!==!1;if((0,QN.safeExecuteInTheMiddle)(()=>!r||t.method==="CONNECT"||n.ignoreRequestHook?.(t),ie=>ie&&this._diag.error("caught ignoreRequestHook error: ",ie),!0))return;let i=(0,EF.hrTime)(),s;try{s=new eEt.URL(t.path,t.origin)}catch(ie){this._diag.warn("could not determine url.full:",ie);return}let c=s.protocol.replace(":",""),l=this.getRequestMethod(t.method),f={[ts.ATTR_HTTP_REQUEST_METHOD]:l,[ts.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:t.method,[ts.ATTR_URL_FULL]:s.toString(),[ts.ATTR_URL_PATH]:s.pathname,[ts.ATTR_URL_QUERY]:s.search,[ts.ATTR_URL_SCHEME]:c},h={https:"443",http:"80"},y=s.hostname,S=s.port||h[c];f[ts.ATTR_SERVER_ADDRESS]=y,S&&!isNaN(Number(S))&&(f[ts.ATTR_SERVER_PORT]=Number(S));let v=this.parseRequestHeaders(t).get("user-agent");if(v){let ie=Array.isArray(v)?v[v.length-1]:v;f[ts.ATTR_USER_AGENT_ORIGINAL]=ie}let x=(0,QN.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(t),ie=>ie&&this._diag.error("caught startSpanHook error: ",ie),!0);x&&Object.entries(x).forEach(([ie,ge])=>{f[ie]=ge});let D=Gl.context.active(),k=Gl.trace.getSpan(D),Q;n.requireParentforSpans&&(!k||!Gl.trace.isSpanContextValid(k.spanContext()))?Q=Gl.trace.wrapSpanContext(Gl.INVALID_SPAN_CONTEXT):Q=this.tracer.startSpan(l==="_OTHER"?"HTTP":l,{kind:Gl.SpanKind.CLIENT,attributes:f},D),(0,QN.safeExecuteInTheMiddle)(()=>n.requestHook?.(Q,t),ie=>ie&&this._diag.error("caught requestHook error: ",ie),!0);let z=Gl.trace.setSpan(Gl.context.active(),Q),G={};Gl.propagation.inject(z,G);let $=Object.entries(G);for(let ie=0;ie<$.length;ie++){let[ge,Ce]=$[ie];typeof t.addHeader=="function"?t.addHeader(ge,Ce):typeof t.headers=="string"?t.headers+=`${ge}: ${Ce}\r
|
|
36
36
|
`:Array.isArray(t.headers)&&t.headers.push(ge,Ce)}this._recordFromReq.set(t,{span:Q,attributes:f,startTime:i})}onRequestHeaders({request:t,socket:n}){let r=this._recordFromReq.get(t);if(!r)return;let o=this.getConfig(),{span:i}=r,{remoteAddress:s,remotePort:c}=n,l={[ts.ATTR_NETWORK_PEER_ADDRESS]:s,[ts.ATTR_NETWORK_PEER_PORT]:c};if(o.headersToSpanAttributes?.requestHeaders){let f=new Set(o.headersToSpanAttributes.requestHeaders.map(y=>y.toLowerCase())),h=this.parseRequestHeaders(t);for(let[y,S]of h.entries())if(f.has(y)){let b=Array.isArray(S)?S:[S];l[`http.request.header.${y}`]=b}}i.setAttributes(l)}onResponseHeaders({request:t,response:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i}=r,s={[ts.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},c=this.getConfig();if((0,QN.safeExecuteInTheMiddle)(()=>c.responseHook?.(o,{request:t,response:n}),l=>l&&this._diag.error("caught responseHook error: ",l),!0),c.headersToSpanAttributes?.responseHeaders){let l=new Set;c.headersToSpanAttributes?.responseHeaders.forEach(f=>l.add(f.toLowerCase()));for(let f=0;f<n.headers.length;f=f+2){let h=n.headers[f].toString().toLowerCase(),y=n.headers[f+1];if(l.has(h)){let S=`http.response.header.${h}`;Object.hasOwn(s,S)?s[S].push(y.toString()):s[S]=[y.toString()]}}}o.setAttributes(s),o.setStatus({code:n.statusCode>=400?Gl.SpanStatusCode.ERROR:Gl.SpanStatusCode.UNSET}),r.attributes=Object.assign(i,s)}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:s}=r;o.recordException(n),o.setStatus({code:Gl.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(t),i[ts.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(i,s)}recordRequestDuration(t,n){let r={};[ts.ATTR_HTTP_RESPONSE_STATUS_CODE,ts.ATTR_HTTP_REQUEST_METHOD,ts.ATTR_SERVER_ADDRESS,ts.ATTR_SERVER_PORT,ts.ATTR_URL_SCHEME,ts.ATTR_ERROR_TYPE].forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,EF.hrTimeToMilliseconds)((0,EF.hrTimeDuration)(n,(0,EF.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"}};yF.UndiciInstrumentation=dK});var iDe=F(SF=>{"use strict";A();Object.defineProperty(SF,"__esModule",{value:!0});SF.UndiciInstrumentation=void 0;var tEt=oDe();Object.defineProperty(SF,"UndiciInstrumentation",{enumerable:!0,get:function(){return tEt.UndiciInstrumentation}})});function sDe(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}function iEt(e,t={}){return typeof e.spans=="boolean"?e.spans:!t.skipOpenTelemetrySetup&&ki(t)}function sEt(e={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=sDe(n.origin,n.path),o=e.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=sDe(n.origin,n.path);if(r.startsWith("data:")){let o=$C(r);return{[kt]:"auto.http.otel.node_fetch","http.url":o,[v_]:o,[Fd]:`${n.method||"GET"} ${o}`}}return{[kt]:"auto.http.otel.node_fetch"}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}var aDe,uDe,nEt,rEt,oEt,cDe,lDe=O(()=>{A();aDe=se(iDe(),1);dt();gr();uDe="NodeFetch",nEt=at(uDe,aDe.UndiciInstrumentation,e=>sEt(e)),rEt=at(`${uDe}.sentry`,cS,e=>e),oEt=((e={})=>({name:"NodeFetch",setupOnce(){iEt(e,gt()?.getOptions())&&nEt(e),rEt(e)}})),cDe=oEt});var TF=F(FN=>{"use strict";A();Object.defineProperty(FN,"__esModule",{value:!0});FN.ExpressLayerType=void 0;var aEt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(aEt=FN.ExpressLayerType||(FN.ExpressLayerType={}))});var IF=F(GN=>{"use strict";A();Object.defineProperty(GN,"__esModule",{value:!0});GN.AttributeNames=void 0;var uEt;(function(e){e.EXPRESS_TYPE="express.type",e.EXPRESS_NAME="express.name"})(uEt=GN.AttributeNames||(GN.AttributeNames={}))});var pK=F(Tv=>{"use strict";A();Object.defineProperty(Tv,"__esModule",{value:!0});Tv._LAYERS_STORE_PROPERTY=Tv.kLayerPatched=void 0;Tv.kLayerPatched=Symbol("express-layer-patched");Tv._LAYERS_STORE_PROPERTY="__ot_middlewares"});var fDe=F(ns=>{"use strict";A();Object.defineProperty(ns,"__esModule",{value:!0});ns.getActualMatchedRoute=ns.getConstructedRoute=ns.getLayerPath=ns.asErrorAndMessage=ns.isLayerIgnored=ns.getLayerMetadata=ns.getRouterPath=ns.storeLayerPath=void 0;var fK=TF(),Iv=IF(),AS=pK(),cEt=(e,t)=>(Array.isArray(e[AS._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,AS._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t===void 0?{isLayerPathStored:!1}:(e[AS._LAYERS_STORE_PROPERTY].push(t),{isLayerPathStored:!0}));ns.storeLayerPath=cEt;var lEt=(e,t)=>{let n=t.handle?.stack?.[0];return n?.route?.path?`${e}${n.route.path}`:n?.handle?.stack?(0,ns.getRouterPath)(e,n):e};ns.getRouterPath=lEt;var dEt=(e,t,n)=>{if(t.name==="router"){let r=(0,ns.getRouterPath)("",t),o=r||n||e||"/";return{attributes:{[Iv.AttributeNames.EXPRESS_NAME]:o,[Iv.AttributeNames.EXPRESS_TYPE]:fK.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[Iv.AttributeNames.EXPRESS_NAME]:(e||n)??"request handler",[Iv.AttributeNames.EXPRESS_TYPE]:fK.ExpressLayerType.REQUEST_HANDLER},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[Iv.AttributeNames.EXPRESS_NAME]:t.name,[Iv.AttributeNames.EXPRESS_TYPE]:fK.ExpressLayerType.MIDDLEWARE},name:`middleware - ${t.name}`}};ns.getLayerMetadata=dEt;var pEt=(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")},fEt=(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(pEt(e,r))return!0}catch{}return!1};ns.isLayerIgnored=fEt;var mEt=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];ns.asErrorAndMessage=mEt;var AEt=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>dDe(n)||"").join(","):dDe(t)};ns.getLayerPath=AEt;var dDe=e=>{if(typeof e=="string")return e;if(e instanceof RegExp||typeof e=="number")return e.toString()};function pDe(e){let n=(Array.isArray(e[AS._LAYERS_STORE_PROPERTY])?e[AS._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}ns.getConstructedRoute=pDe;function gEt(e){let t=Array.isArray(e[AS._LAYERS_STORE_PROPERTY])?e[AS._LAYERS_STORE_PROPERTY]:[];if(t.length===0)return;if(t.every(i=>i==="/"))return e.originalUrl==="/"?"/":void 0;let n=pDe(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)||hEt(r))?r:void 0}ns.getActualMatchedRoute=gEt;function hEt(e){return e.includes(":")||e.includes("*")}});var mDe=F(bv=>{"use strict";A();Object.defineProperty(bv,"__esModule",{value:!0});bv.PACKAGE_NAME=bv.PACKAGE_VERSION=void 0;bv.PACKAGE_VERSION="0.62.0";bv.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var EDe=F(CF=>{"use strict";A();Object.defineProperty(CF,"__esModule",{value:!0});CF.ExpressInstrumentation=void 0;var ADe=br(),Qc=(ze(),Me(We)),gDe=TF(),hDe=IF(),Gm=fDe(),_De=mDe(),Cv=on(),_Et=(Zn(),Me(Fr)),bF=pK(),mK=class extends Cv.InstrumentationBase{constructor(t={}){super(_De.PACKAGE_NAME,_De.PACKAGE_VERSION,t)}init(){return[new Cv.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],t=>{let n=typeof t?.Router?.prototype?.route=="function",r=n?t.Router.prototype:t.Router;return(0,Cv.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,Cv.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,Cv.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),s=this.stack[this.stack.length-1];return t._applyPatch(s,(0,Gm.getLayerPath)(o)),i}}}_getRouterUsePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),s=this.stack[this.stack.length-1];return t._applyPatch(s,(0,Gm.getLayerPath)(o)),i}}}_getAppUsePatch(t){let n=this;return function(r){return function(...i){let s=t?this.router:this._router,c=r.apply(this,i);if(s){let l=s.stack[s.stack.length-1];n._applyPatch(l,(0,Gm.getLayerPath)(i))}return c}}}_applyPatch(t,n){let r=this;t[bF.kLayerPatched]!==!0&&(t[bF.kLayerPatched]=!0,this._wrap(t,"handle",o=>{if(o.length===4)return o;let i=function(s,c){let{isLayerPathStored:l}=(0,Gm.storeLayerPath)(s,n),f=(0,Gm.getConstructedRoute)(s),h=(0,Gm.getActualMatchedRoute)(s),y={[_Et.ATTR_HTTP_ROUTE]:h},S=(0,Gm.getLayerMetadata)(f,t,n),b=S.attributes[hDe.AttributeNames.EXPRESS_TYPE],v=(0,ADe.getRPCMetadata)(Qc.context.active());if(v?.type===ADe.RPCType.HTTP&&(v.route=h),(0,Gm.isLayerIgnored)(S.name,b,r.getConfig()))return b===gDe.ExpressLayerType.MIDDLEWARE&&s[bF._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Qc.trace.getSpan(Qc.context.active())===void 0)return o.apply(this,arguments);let x=r._getSpanName({request:s,layerType:b,route:f},S.name),D=r.tracer.startSpan(x,{attributes:Object.assign(y,S.attributes)}),k=Qc.context.active(),Q=Qc.trace.setSpan(k,D),{requestHook:z}=r.getConfig();z&&(0,Cv.safeExecuteInTheMiddle)(()=>z(D,{request:s,layerType:b,route:f}),Ce=>{Ce&&Qc.diag.error("express instrumentation: request hook failed",Ce)},!0);let G=!1;S.attributes[hDe.AttributeNames.EXPRESS_TYPE]===gDe.ExpressLayerType.ROUTER&&(D.end(),G=!0,Q=k);let $=()=>{G===!1&&(G=!0,D.end())},ie=Array.from(arguments),ge=ie.findIndex(Ce=>typeof Ce=="function");ge>=0&&(arguments[ge]=function(){let Ce=arguments[0],ve=![void 0,null,"route","router"].includes(Ce);if(!G&&ve){let[fn,De]=(0,Gm.asErrorAndMessage)(Ce);D.recordException(fn),D.setStatus({code:Qc.SpanStatusCode.ERROR,message:De})}G===!1&&(G=!0,s.res?.removeListener("finish",$),D.end()),!(s.route&&ve)&&l&&s[bF._LAYERS_STORE_PROPERTY].pop();let Xe=ie[ge],wt=Qc.context.active(),nt=Qc.trace.getSpan(k),Vt=nt?Qc.trace.setSpan(wt,nt):wt;return Qc.context.bind(Vt,Xe).apply(this,arguments)});try{return Qc.context.bind(Q,o).apply(this,arguments)}catch(Ce){let[ve,Xe]=(0,Gm.asErrorAndMessage)(Ce);throw D.recordException(ve),D.setStatus({code:Qc.SpanStatusCode.ERROR,message:Xe}),Ce}finally{G||c.once("finish",$)}};for(let s in o)Object.defineProperty(i,s,{get(){return o[s]},set(c){o[s]=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 Qc.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};CF.ExpressInstrumentation=mK});var yDe=F(Y_=>{"use strict";A();Object.defineProperty(Y_,"__esModule",{value:!0});Y_.AttributeNames=Y_.ExpressLayerType=Y_.ExpressInstrumentation=void 0;var EEt=EDe();Object.defineProperty(Y_,"ExpressInstrumentation",{enumerable:!0,get:function(){return EEt.ExpressInstrumentation}});var yEt=TF();Object.defineProperty(Y_,"ExpressLayerType",{enumerable:!0,get:function(){return yEt.ExpressLayerType}});var SEt=IF();Object.defineProperty(Y_,"AttributeNames",{enumerable:!0,get:function(){return SEt.AttributeNames}})});var bs,gS=O(()=>{A();bs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__});function TEt(e){zr(e,"auto.http.otel.express");let t=Ot(e).data,n=t["express.type"];n&&e.setAttribute(Xt,`${n}.express`);let r=t["express.name"];typeof r=="string"&&e.updateName(r)}function IEt(e,t){if(vn()===Qd())return bs&&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";vn().setTransactionName(`${r} ${e.route}`)}return t}var SDe,TDe,IDe,bEt,bDe,CDe=O(()=>{A();SDe=se(yDe(),1);dt();gr();gS();TDe="Express";IDe=at(TDe,()=>new SDe.ExpressInstrumentation({requestHook:e=>TEt(e),spanNameHook:(e,t)=>IEt(e,t)})),bEt=(()=>({name:TDe,setupOnce(){IDe()}})),bDe=bEt});var vDe=F(zN=>{"use strict";A();Object.defineProperty(zN,"__esModule",{value:!0});zN.SeverityNumber=void 0;var CEt;(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"})(CEt=zN.SeverityNumber||(zN.SeverityNumber={}))});var xF=F(vv=>{"use strict";A();Object.defineProperty(vv,"__esModule",{value:!0});vv.NOOP_LOGGER=vv.NoopLogger=void 0;var RF=class{emit(t){}};vv.NoopLogger=RF;vv.NOOP_LOGGER=new RF});var RDe=F(zm=>{"use strict";A();Object.defineProperty(zm,"__esModule",{value:!0});zm.API_BACKWARDS_COMPATIBILITY_VERSION=zm.makeGetter=zm._global=zm.GLOBAL_LOGS_API_KEY=void 0;zm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");zm._global=globalThis;function vEt(e,t,n){return r=>r===e?t:n}zm.makeGetter=vEt;zm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var AK=F(Rv=>{"use strict";A();Object.defineProperty(Rv,"__esModule",{value:!0});Rv.NOOP_LOGGER_PROVIDER=Rv.NoopLoggerProvider=void 0;var REt=xF(),DF=class{getLogger(t,n,r){return new REt.NoopLogger}};Rv.NoopLoggerProvider=DF;Rv.NOOP_LOGGER_PROVIDER=new DF});var xDe=F(BF=>{"use strict";A();Object.defineProperty(BF,"__esModule",{value:!0});BF.ProxyLogger=void 0;var xEt=xF(),gK=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):xEt.NOOP_LOGGER}};BF.ProxyLogger=gK});var DDe=F(NF=>{"use strict";A();Object.defineProperty(NF,"__esModule",{value:!0});NF.ProxyLoggerProvider=void 0;var DEt=AK(),BEt=xDe(),hK=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new BEt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:DEt.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)}};NF.ProxyLoggerProvider=hK});var NDe=F(OF=>{"use strict";A();Object.defineProperty(OF,"__esModule",{value:!0});OF.LogsAPI=void 0;var qd=RDe(),NEt=AK(),BDe=DDe(),_K=class e{constructor(){this._proxyLoggerProvider=new BDe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return qd._global[qd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(qd._global[qd.GLOBAL_LOGS_API_KEY]=(0,qd.makeGetter)(qd.API_BACKWARDS_COMPATIBILITY_VERSION,t,NEt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=qd._global[qd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(qd._global,qd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete qd._global[qd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new BDe.ProxyLoggerProvider}};OF.LogsAPI=_K});var EK=F(jm=>{"use strict";A();Object.defineProperty(jm,"__esModule",{value:!0});jm.logs=jm.NoopLogger=jm.NOOP_LOGGER=jm.SeverityNumber=void 0;var OEt=vDe();Object.defineProperty(jm,"SeverityNumber",{enumerable:!0,get:function(){return OEt.SeverityNumber}});var ODe=xF();Object.defineProperty(jm,"NOOP_LOGGER",{enumerable:!0,get:function(){return ODe.NOOP_LOGGER}});Object.defineProperty(jm,"NoopLogger",{enumerable:!0,get:function(){return ODe.NoopLogger}});var wEt=NDe();jm.logs=wEt.LogsAPI.getInstance()});var wDe=F(xv=>{"use strict";A();Object.defineProperty(xv,"__esModule",{value:!0});xv.disableInstrumentations=xv.enableInstrumentations=void 0;function kEt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}xv.enableInstrumentations=kEt;function PEt(e){e.forEach(t=>t.disable())}xv.disableInstrumentations=PEt});var MDe=F(wF=>{"use strict";A();Object.defineProperty(wF,"__esModule",{value:!0});wF.registerInstrumentations=void 0;var kDe=(ze(),Me(We)),MEt=EK(),PDe=wDe();function LEt(e){let t=e.tracerProvider||kDe.trace.getTracerProvider(),n=e.meterProvider||kDe.metrics.getMeterProvider(),r=e.loggerProvider||MEt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,PDe.enableInstrumentations)(o,t,n,r),()=>{(0,PDe.disableInstrumentations)(o)}}wF.registerInstrumentations=LEt});var $De=F(kF=>{"use strict";A();Object.defineProperty(kF,"__esModule",{value:!0});kF.satisfies=void 0;var IK=(ze(),Me(We)),GDe=/^(?: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-]+)*))?$/,UEt=/^(?<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-]+)*))?$/,QEt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function FEt(e,t,n){if(!GEt(e))return IK.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=$Et(e);if(!r)return!1;let o=[],i=zDe(r,t,o,n);return i&&!n?.includePrerelease?jEt(r,o):i}kF.satisfies=FEt;function GEt(e){return typeof e=="string"&&GDe.test(e)}function zDe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(yK(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=p0t(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!yK(e,i,n,r))return!1;return!0}return yK(e,t,n,r)}function yK(e,t,n,r){if(t=HEt(t,r),t.includes(" "))return zDe(e,t,n,r);{let o=qEt(t);return n.push(o),zEt(e,o)}}function zEt(e,t){if(t.invalid)return!1;if(!t.version||TK(t.version))return!0;let n=UDe(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=UDe(r,o)}return QEt[t.op]?.includes(n)}function jEt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function HEt(e,t){return e=e.trim(),e=l0t(e,t),e=c0t(e),e=d0t(e,t),e=e.trim(),e}function Hu(e){return!e||e.toLowerCase()==="x"||e==="*"}function $Et(e){let t=e.match(GDe);if(!t){IK.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function qEt(e){if(!e)return{};let t=e.match(UEt);if(!t)return IK.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function TK(e){return e==="*"||e==="x"||e==="X"}function LDe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function VEt(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 YEt(e,t){if(TK(e)||TK(t))return 0;let[n,r]=VEt(LDe(e),LDe(t));return n>r?1:n<r?-1:0}function UDe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=YEt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var jDe="[a-zA-Z0-9-]",HDe="0|[1-9]\\d*",KEt=`\\d*[a-zA-Z-]${jDe}*`,JEt="((?:<|>)?=?)",QDe=`(?:${HDe}|${KEt})`,ZEt=`(?:-(${QDe}(?:\\.${QDe})*))`,FDe=`${jDe}+`,WEt=`(?:\\+(${FDe}(?:\\.${FDe})*))`,SK=`${HDe}|x|X|\\*`,jN=`[v=\\s]*(${SK})(?:\\.(${SK})(?:\\.(${SK})(?:${ZEt})?${WEt}?)?)?`,XEt=`^${JEt}\\s*${jN}$`,e0t=new RegExp(XEt),t0t=`^\\s*(${jN})\\s+-\\s+(${jN})\\s*$`,n0t=new RegExp(t0t),r0t="(?:~>?)",o0t=`^${r0t}${jN}$`,i0t=new RegExp(o0t),s0t="(?:\\^)",a0t=`^${s0t}${jN}$`,u0t=new RegExp(a0t);function c0t(e){let t=i0t;return e.replace(t,(n,r,o,i,s)=>{let c;return Hu(r)?c="":Hu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Hu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?c=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function l0t(e,t){let n=u0t,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,c,l)=>{let f;return Hu(i)?f="":Hu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Hu(c)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${c}-${l} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${c}${r} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c} <${+i+1}.0.0-0`,f})}function d0t(e,t){let n=e0t;return e.replace(n,(r,o,i,s,c,l)=>{let f=Hu(i),h=f||Hu(s),y=h||Hu(c),S=y;return o==="="&&S&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&S?(h&&(s=0),c=0,o===">"?(o=">=",h?(i=+i+1,s=0,c=0):(s=+s+1,c=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${c}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:y&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function p0t(e,t){let n=n0t;return e.replace(n,(r,o,i,s,c,l,f,h,y,S,b,v)=>(Hu(i)?o="":Hu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Hu(c)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Hu(y)?h="":Hu(S)?h=`<${+y+1}.0.0-0`:Hu(b)?h=`<${y}.${+S+1}.0-0`:v?h=`<=${y}.${S}.${b}-${v}`:t?.includePrerelease?h=`<${y}.${S}.${+b+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var bK=F(Na=>{"use strict";A();Object.defineProperty(Na,"__esModule",{value:!0});Na.massUnwrap=Na.unwrap=Na.massWrap=Na.wrap=void 0;var $u=console.error.bind(console);function HN(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 f0t=(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 HN(o,"__original",r),HN(o,"__unwrap",()=>{e[t]===o&&HN(e,t,r)}),HN(o,"__wrapped",!0),HN(e,t,o),o};Na.wrap=f0t;var m0t=(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,Na.wrap)(r,o,n)})})};Na.massWrap=m0t;var A0t=(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}};Na.unwrap=A0t;var g0t=(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,Na.unwrap)(n,r)})})};Na.massUnwrap=g0t;function $N(e){e&&e.logger&&(typeof e.logger!="function"?$u("new logger isn't a function, not replacing"):$u=e.logger)}Na.default=$N;$N.wrap=Na.wrap;$N.massWrap=Na.massWrap;$N.unwrap=Na.unwrap;$N.massUnwrap=Na.massUnwrap});var qDe=F(MF=>{"use strict";A();Object.defineProperty(MF,"__esModule",{value:!0});MF.InstrumentationAbstract=void 0;var CK=(ze(),Me(We)),h0t=EK(),PF=bK(),vK=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=CK.diag.createComponentLogger({namespace:t}),this._tracer=CK.trace.getTracer(t,n),this._meter=CK.metrics.getMeter(t,n),this._logger=h0t.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=PF.wrap;_unwrap=PF.unwrap;_massWrap=PF.massWrap;_massUnwrap=PF.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)}}};MF.InstrumentationAbstract=vK});var VDe=F(K_=>{"use strict";A();Object.defineProperty(K_,"__esModule",{value:!0});K_.ModuleNameTrie=K_.ModuleNameSeparator=void 0;K_.ModuleNameSeparator="/";var LF=class{hooks=[];children=new Map},RK=class{_trie=new LF;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(K_.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new LF,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=[],s=!0;for(let c of t.split(K_.ModuleNameSeparator)){let l=o.children.get(c);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,l)=>c.insertedId-l.insertedId),i.map(({hook:c})=>c))}};K_.ModuleNameTrie=RK});var KDe=F(UF=>{"use strict";A();Object.defineProperty(UF,"__esModule",{value:!0});UF.RequireInTheMiddleSingleton=void 0;var _0t=Gy(),YDe=Fe("path"),xK=VDe(),E0t=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),DK=class e{_moduleNameTrie=new xK.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new _0t.Hook(null,{internals:!0},(t,n,r)=>{let o=y0t(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return E0t?new e:this._instance=this._instance??new e}};UF.RequireInTheMiddleSingleton=DK;function y0t(e){return YDe.sep!==xK.ModuleNameSeparator?e.split(YDe.sep).join(xK.ModuleNameSeparator):e}});var e1e=F(qN=>{A();var JDe=[],BK=new WeakMap,ZDe=new WeakMap,WDe=new Map,XDe=[],S0t={set(e,t,n){let r=BK.get(e),o=r&&r[t];return typeof o=="function"?o(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=ZDe.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=BK.get(e),o=r&&r[t];return typeof o=="function"?o(n.value):!0}};function T0t(e,t,n,r,o){WDe.set(e,o),BK.set(t,n),ZDe.set(t,r);let i=new Proxy(t,S0t);JDe.forEach(s=>s(e,i,o)),XDe.push([e,i,o])}qN.register=T0t;qN.importHooks=JDe;qN.specifiers=WDe;qN.toHook=XDe});var kK=F((p_n,Bv)=>{A();var t1e=Fe("path"),I0t=SL(),{fileURLToPath:b0t}=Fe("url"),{MessageChannel:C0t}=Fe("worker_threads"),{isBuiltin:NK}=Fe("module");NK||(NK=()=>!0);var{importHooks:OK,specifiers:v0t,toHook:R0t}=e1e();function n1e(e){OK.push(e),R0t.forEach(([t,n,r])=>e(t,n,r))}function r1e(e){let t=OK.indexOf(e);t>-1&&OK.splice(t,1)}function Dv(e,t,n,r){let o=e(t,n,r);o&&o!==t&&"default"in t&&(t.default=o)}var wK;function x0t(){let{port1:e,port2:t}=new C0t,n=0,r;wK=c=>{n++,e.postMessage(c)},e.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let c=setInterval(()=>{},1e3),l=new Promise(f=>{r=f}).then(()=>{clearInterval(c)});return n===0&&r(),l}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:o}}function VN(e,t,n){if(!(this instanceof VN))return new VN(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;wK&&Array.isArray(e)&&wK(e),this._iitmHook=(o,i,s)=>{let c=o,l=c.startsWith("node:"),f,h;if(l){let y=o.slice(5);NK(y)&&(o=y)}else if(c.startsWith("file://")){let y=Error.stackTraceLimit;Error.stackTraceLimit=0;try{f=b0t(o),o=f}catch{}if(Error.stackTraceLimit=y,f){let S=I0t(f);S&&(o=S.name,h=S.basedir)}}if(e)for(let y of e)if(f&&y===f)Dv(n,i,f,void 0);else if(y===o){if(!h)Dv(n,i,o,h);else if(h.endsWith(v0t.get(c)))Dv(n,i,o,h);else if(r){let S=o+t1e.sep+t1e.relative(h,f);Dv(n,i,S,h)}}else y===s&&Dv(n,i,s,h);else Dv(n,i,o,h)},n1e(this._iitmHook)}VN.prototype.unhook=function(){r1e(this._iitmHook)};Bv.exports=VN;Bv.exports.Hook=VN;Bv.exports.addHook=n1e;Bv.exports.removeHook=r1e;Bv.exports.createAddHookMessageChannel=x0t});var PK=F(J_=>{"use strict";A();Object.defineProperty(J_,"__esModule",{value:!0});J_.isWrapped=J_.safeExecuteInTheMiddleAsync=J_.safeExecuteInTheMiddle=void 0;function D0t(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}J_.safeExecuteInTheMiddle=D0t;async function B0t(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}}J_.safeExecuteInTheMiddleAsync=B0t;function N0t(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}J_.isWrapped=N0t});var s1e=F(QF=>{"use strict";A();Object.defineProperty(QF,"__esModule",{value:!0});QF.InstrumentationBase=void 0;var YN=Fe("path"),o1e=Fe("util"),O0t=$De(),MK=bK(),w0t=qDe(),k0t=KDe(),P0t=kK(),KN=(ze(),Me(We)),M0t=Gy(),L0t=Fe("fs"),U0t=PK(),LK=class extends w0t.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=k0t.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,U0t.isWrapped)(t[n])&&this._unwrap(t,n),o1e.types.isProxy(t)){let o=(0,MK.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,MK.wrap)(t,n,r)};_unwrap=(t,n)=>o1e.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,MK.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{KN.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){KN.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{KN.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){KN.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=Fe.resolve(n);Fe.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,L0t.readFileSync)(YN.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{KN.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 i1e(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 s=t.files??[],c=YN.normalize(r);return s.filter(f=>f.name===c&&i1e(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,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(f,t.moduleVersion)):f),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,c,l)=>{if(!l&&YN.isAbsolute(c)){let f=YN.parse(c);c=f.name,l=f.dir}return this._onRequire(t,s,c,l)},r=(s,c,l)=>this._onRequire(t,s,c,l),o=YN.isAbsolute(t.name)?new M0t.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new P0t.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}};QF.InstrumentationBase=LK;function i1e(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,O0t.satisfies)(t,r,{includePrerelease:n}))}});var a1e=F(FF=>{"use strict";A();Object.defineProperty(FF,"__esModule",{value:!0});FF.normalize=void 0;var Q0t=Fe("path");Object.defineProperty(FF,"normalize",{enumerable:!0,get:function(){return Q0t.normalize}})});var u1e=F(Nv=>{"use strict";A();Object.defineProperty(Nv,"__esModule",{value:!0});Nv.normalize=Nv.InstrumentationBase=void 0;var F0t=s1e();Object.defineProperty(Nv,"InstrumentationBase",{enumerable:!0,get:function(){return F0t.InstrumentationBase}});var G0t=a1e();Object.defineProperty(Nv,"normalize",{enumerable:!0,get:function(){return G0t.normalize}})});var UK=F(Ov=>{"use strict";A();Object.defineProperty(Ov,"__esModule",{value:!0});Ov.normalize=Ov.InstrumentationBase=void 0;var c1e=u1e();Object.defineProperty(Ov,"InstrumentationBase",{enumerable:!0,get:function(){return c1e.InstrumentationBase}});Object.defineProperty(Ov,"normalize",{enumerable:!0,get:function(){return c1e.normalize}})});var l1e=F(GF=>{"use strict";A();Object.defineProperty(GF,"__esModule",{value:!0});GF.InstrumentationNodeModuleDefinition=void 0;var QK=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}};GF.InstrumentationNodeModuleDefinition=QK});var d1e=F(zF=>{"use strict";A();Object.defineProperty(zF,"__esModule",{value:!0});zF.InstrumentationNodeModuleFile=void 0;var z0t=UK(),FK=class{name;supportedVersions;patch;unpatch;constructor(t,n,r,o){this.name=(0,z0t.normalize)(t),this.supportedVersions=n,this.patch=r,this.unpatch=o}};zF.InstrumentationNodeModuleFile=FK});var p1e=F(hS=>{"use strict";A();Object.defineProperty(hS,"__esModule",{value:!0});hS.semconvStabilityFromStr=hS.SemconvStability=void 0;var jF;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(jF=hS.SemconvStability||(hS.SemconvStability={}));function j0t(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}hS.semconvStabilityFromStr=j0t});var m1e=F(rs=>{"use strict";A();Object.defineProperty(rs,"__esModule",{value:!0});rs.semconvStabilityFromStr=rs.SemconvStability=rs.safeExecuteInTheMiddleAsync=rs.safeExecuteInTheMiddle=rs.isWrapped=rs.InstrumentationNodeModuleFile=rs.InstrumentationNodeModuleDefinition=rs.InstrumentationBase=rs.registerInstrumentations=void 0;var H0t=MDe();Object.defineProperty(rs,"registerInstrumentations",{enumerable:!0,get:function(){return H0t.registerInstrumentations}});var $0t=UK();Object.defineProperty(rs,"InstrumentationBase",{enumerable:!0,get:function(){return $0t.InstrumentationBase}});var q0t=l1e();Object.defineProperty(rs,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return q0t.InstrumentationNodeModuleDefinition}});var V0t=d1e();Object.defineProperty(rs,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return V0t.InstrumentationNodeModuleFile}});var GK=PK();Object.defineProperty(rs,"isWrapped",{enumerable:!0,get:function(){return GK.isWrapped}});Object.defineProperty(rs,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return GK.safeExecuteInTheMiddle}});Object.defineProperty(rs,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return GK.safeExecuteInTheMiddleAsync}});var f1e=p1e();Object.defineProperty(rs,"SemconvStability",{enumerable:!0,get:function(){return f1e.SemconvStability}});Object.defineProperty(rs,"semconvStabilityFromStr",{enumerable:!0,get:function(){return f1e.semconvStabilityFromStr}})});var A1e=F((w_n,Y0t)=>{Y0t.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 h1e=F(_S=>{"use strict";A();Object.defineProperty(_S,"__esModule",{value:!0});_S.range=_S.balanced=void 0;var K0t=(e,t,n)=>{let r=e instanceof RegExp?g1e(e,n):e,o=t instanceof RegExp?g1e(t,n):t,i=r!==null&&o!=null&&(0,_S.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)}};_S.balanced=K0t;var g1e=(e,t)=>{let n=t.match(e);return n?n[0]:null},J0t=(e,t,n)=>{let r,o,i,s,c,l=n.indexOf(e),f=n.indexOf(t,l+1),h=l;if(l>=0&&f>0){if(e===t)return[l,f];for(r=[],i=n.length;h>=0&&!c;){if(h===l)r.push(h),l=n.indexOf(e,h+1);else if(r.length===1){let y=r.pop();y!==void 0&&(c=[y,f])}else o=r.pop(),o!==void 0&&o<i&&(i=o,s=f),f=n.indexOf(t,h+1);h=l<f&&l>=0?l:f}r.length&&s!==void 0&&(c=[i,s])}return c};_S.range=J0t});var b1e=F(wv=>{"use strict";A();Object.defineProperty(wv,"__esModule",{value:!0});wv.EXPANSION_MAX=void 0;wv.expand=cyt;var _1e=h1e(),E1e="\0SLASH"+Math.random()+"\0",y1e="\0OPEN"+Math.random()+"\0",jK="\0CLOSE"+Math.random()+"\0",S1e="\0COMMA"+Math.random()+"\0",T1e="\0PERIOD"+Math.random()+"\0",Z0t=new RegExp(E1e,"g"),W0t=new RegExp(y1e,"g"),X0t=new RegExp(jK,"g"),eyt=new RegExp(S1e,"g"),tyt=new RegExp(T1e,"g"),nyt=/\\\\/g,ryt=/\\{/g,oyt=/\\}/g,iyt=/\\,/g,syt=/\\\./g;wv.EXPANSION_MAX=1e5;function zK(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function ayt(e){return e.replace(nyt,E1e).replace(ryt,y1e).replace(oyt,jK).replace(iyt,S1e).replace(syt,T1e)}function uyt(e){return e.replace(Z0t,"\\").replace(W0t,"{").replace(X0t,"}").replace(eyt,",").replace(tyt,".")}function I1e(e){if(!e)return[""];let t=[],n=(0,_1e.balanced)("{","}",e);if(!n)return e.split(",");let{pre:r,body:o,post:i}=n,s=r.split(",");s[s.length-1]+="{"+o+"}";let c=I1e(i);return i.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function cyt(e,t={}){if(!e)return[];let{max:n=wv.EXPANSION_MAX}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),JN(ayt(e),n,!0).map(uyt)}function lyt(e){return"{"+e+"}"}function dyt(e){return/^-?0\d/.test(e)}function pyt(e,t){return e<=t}function fyt(e,t){return e>=t}function JN(e,t,n){let r=[],o=(0,_1e.balanced)("{","}",e);if(!o)return[e];let i=o.pre,s=o.post.length?JN(o.post,t,!1):[""];if(/\$$/.test(o.pre))for(let c=0;c<s.length&&c<t;c++){let l=i+"{"+o.body+"}"+s[c];r.push(l)}else{let c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=c||l,h=o.body.indexOf(",")>=0;if(!f&&!h)return o.post.match(/,(?!,).*\}/)?(e=o.pre+"{"+o.body+jK+o.post,JN(e,t,!0)):[e];let y;if(f)y=o.body.split(/\.\./);else if(y=I1e(o.body),y.length===1&&y[0]!==void 0&&(y=JN(y[0],t,!1).map(lyt),y.length===1))return s.map(b=>o.pre+y[0]+b);let S;if(f&&y[0]!==void 0&&y[1]!==void 0){let b=zK(y[0]),v=zK(y[1]),x=Math.max(y[0].length,y[1].length),D=y.length===3&&y[2]!==void 0?Math.max(Math.abs(zK(y[2])),1):1,k=pyt;v<b&&(D*=-1,k=fyt);let z=y.some(dyt);S=[];for(let G=b;k(G,v)&&S.length<t;G+=D){let $;if(l)$=String.fromCharCode(G),$==="\\"&&($="");else if($=String(G),z){let ie=x-$.length;if(ie>0){let ge=new Array(ie+1).join("0");G<0?$="-"+ge+$.slice(1):$=ge+$}}S.push($)}}else{S=[];for(let b=0;b<y.length;b++)S.push.apply(S,JN(y[b],t,!1))}for(let b=0;b<S.length;b++)for(let v=0;v<s.length&&r.length<t;v++){let x=i+S[b]+s[v];(!n||f||x)&&r.push(x)}}return r}});var C1e=F(HF=>{"use strict";A();Object.defineProperty(HF,"__esModule",{value:!0});HF.assertValidPattern=void 0;var myt=1024*64,Ayt=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>myt)throw new TypeError("pattern is too long")};HF.assertValidPattern=Ayt});var R1e=F($F=>{"use strict";A();Object.defineProperty($F,"__esModule",{value:!0});$F.parseClass=void 0;var gyt={"[: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]},ZN=e=>e.replace(/[[\]\\-]/g,"\\$&"),hyt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),v1e=e=>e.join(""),_yt=(e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],i=n+1,s=!1,c=!1,l=!1,f=!1,h=n,y="";e:for(;i<e.length;){let x=e.charAt(i);if((x==="!"||x==="^")&&i===n+1){f=!0,i++;continue}if(x==="]"&&s&&!l){h=i+1;break}if(s=!0,x==="\\"&&!l){l=!0,i++;continue}if(x==="["&&!l){for(let[D,[k,Q,z]]of Object.entries(gyt))if(e.startsWith(D,i)){if(y)return["$.",!1,e.length-n,!0];i+=D.length,z?o.push(k):r.push(k),c=c||Q;continue e}}if(l=!1,y){x>y?r.push(ZN(y)+"-"+ZN(x)):x===y&&r.push(ZN(x)),y="",i++;continue}if(e.startsWith("-]",i+1)){r.push(ZN(x+"-")),i+=2;continue}if(e.startsWith("-",i+1)){y=x,i+=2;continue}r.push(ZN(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])&&!f){let x=r[0].length===2?r[0].slice(-1):r[0];return[hyt(x),!1,h-n,!1]}let S="["+(f?"^":"")+v1e(r)+"]",b="["+(f?"":"^")+v1e(o)+"]";return[r.length&&o.length?"("+S+"|"+b+")":r.length?S:b,c,h-n,!0]};$F.parseClass=_yt});var VF=F(qF=>{"use strict";A();Object.defineProperty(qF,"__esModule",{value:!0});qF.unescape=void 0;var Eyt=(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");qF.unescape=Eyt});var qK=F(ZF=>{"use strict";A();var Fc;Object.defineProperty(ZF,"__esModule",{value:!0});ZF.AST=void 0;var yyt=R1e(),YF=VF(),Syt=new Set(["!","?","+","*","@"]),HK=e=>Syt.has(e),x1e=e=>HK(e.type),Tyt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Iyt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),byt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),D1e=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Cyt="(?!(?:^|/)\\.\\.?(?:$|/))",KF="(?!\\.)",vyt=new Set(["[","."]),Ryt=new Set(["..","."]),xyt=new Set("().*{}+?[]^$\\!"),Dyt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),$K="[^/]",B1e=$K+"*?",N1e=$K+"+?",Byt=0,JF=class{type;#n;#r;#o=!1;#e=[];#t;#a;#c;#u=!1;#i;#s;#l=!1;id=++Byt;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.#a=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.#s!==void 0?this.#s:this.type?this.#s=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#s=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.#a+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 Fc&&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.#a===0)return!0;let t=this.#t;for(let n=0;n<this.#a;n++){let r=t.#e[n];if(!(r instanceof Fc&&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.#a===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new Fc(this.type,t);for(let r of this.#e)n.copyIn(r);return n}static#d(t,n,r,o,i){let s=o.maxExtglobRecursion??2,c=!1,l=!1,f=-1,h=!1;if(n.type===null){let x=r,D="";for(;x<t.length;){let k=t.charAt(x++);if(c||k==="\\"){c=!c,D+=k;continue}if(l){x===f+1?(k==="^"||k==="!")&&(h=!0):k==="]"&&!(x===f+2&&h)&&(l=!1),D+=k;continue}else if(k==="["){l=!0,f=x,h=!1,D+=k;continue}if(!o.noext&&HK(k)&&t.charAt(x)==="("&&i<=s){n.push(D),D="";let z=new Fc(k,n);x=Fc.#d(t,z,x,o,i+1),n.push(z);continue}D+=k}return n.push(D),x}let y=r+1,S=new Fc(null,n),b=[],v="";for(;y<t.length;){let x=t.charAt(y++);if(c||x==="\\"){c=!c,v+=x;continue}if(l){y===f+1?(x==="^"||x==="!")&&(h=!0):x==="]"&&!(y===f+2&&h)&&(l=!1),v+=x;continue}else if(x==="["){l=!0,f=y,h=!1,v+=x;continue}if(!o.noext&&HK(x)&&t.charAt(y)==="("&&(i<=s||n&&n.#p(x))){let k=n&&n.#p(x)?0:1;S.push(v),v="";let Q=new Fc(x,S);S.push(Q),y=Fc.#d(t,Q,y,o,i+k);continue}if(x==="|"){S.push(v),v="",b.push(S),S=new Fc(null,n);continue}if(x===")")return v===""&&n.#e.length===0&&(n.#l=!0),S.push(v),v="",n.push(...b,S),y;v+=x}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],y}#_(t){return this.#m(t,Iyt)}#m(t,n=Tyt){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=byt){return!!n.get(this.type)?.includes(t)}#E(t,n){let r=t.#e[0],o=new Fc(null,r,this.options);o.#e.push(""),r.push(o),this.#A(t,n)}#A(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.#s=void 0}#y(t){return!!D1e.get(this.type)?.has(t)}#S(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.#y(n.type)}#T(t){let n=D1e.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.#s=void 0,this.#l=!1}static fromGlob(t,n={}){let r=new Fc(null,void 0,n);return Fc.#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()),!x1e(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(b=>typeof b!="string"),f=this.#e.map(b=>{let[v,x,D,k]=typeof b=="string"?Fc.#I(b,this.#r,l):b.toRegExpSource(t);return this.#r=this.#r||D,this.#o=this.#o||k,v}).join(""),h="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&Ryt.has(this.#e[0]))){let v=vyt,x=n&&v.has(f.charAt(0))||f.startsWith("\\.")&&v.has(f.charAt(2))||f.startsWith("\\.\\.")&&v.has(f.charAt(4)),D=!n&&!t&&v.has(f.charAt(0));h=x?Cyt:D?KF:""}let y="";return this.isEnd()&&this.#n.#u&&this.#t?.type==="!"&&(y="(?:$|\\/)"),[h+f+y,(0,YF.unescape)(f),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 l=this.toString(),f=this;return f.#e=[l],f.type=null,f.#r=void 0,[l,(0,YF.unescape)(this.toString()),!1,!1]}let s=!r||t||n||!KF?"":this.#g(!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!n?KF:"")+N1e;else{let l=this.type==="!"?"))"+(this.isStart()&&!n&&!t?KF:"")+B1e+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;c=o+i+l}return[c,(0,YF.unescape)(i),this.#r=!!this.#r,this.#o]}#f(){if(x1e(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.#m(o)?(n=!1,this.#A(o,r)):this.#_(o)?(n=!1,this.#E(o,r)):this.#S(o)&&(n=!1,this.#T(o)))}}while(!n&&++t<10)}else for(let t of this.#e)typeof t=="object"&&t.#f();this.#s=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,s]=n.toRegExpSource(t);return this.#o=this.#o||s,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#I(t,n,r=!1){let o=!1,i="",s=!1,c=!1;for(let l=0;l<t.length;l++){let f=t.charAt(l);if(o){o=!1,i+=(xyt.has(f)?"\\":"")+f;continue}if(f==="*"){if(c)continue;c=!0,i+=r&&/^[*]+$/.test(t)?N1e:B1e,n=!0;continue}else c=!1;if(f==="\\"){l===t.length-1?i+="\\\\":o=!0;continue}if(f==="["){let[h,y,S,b]=(0,yyt.parseClass)(t,l);if(S){i+=h,s=s||y,l+=S-1,n=n||b;continue}}if(f==="?"){i+=$K,n=!0;continue}i+=Dyt(f)}return[i,(0,YF.unescape)(t),!!n,s]}};ZF.AST=JF;Fc=JF});var VK=F(WF=>{"use strict";A();Object.defineProperty(WF,"__esModule",{value:!0});WF.escape=void 0;var Nyt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");WF.escape=Nyt});var U1e=F(ft=>{"use strict";A();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 Oyt=b1e(),XF=C1e(),k1e=qK(),wyt=VK(),kyt=VF(),Pyt=(e,t,n={})=>((0,XF.assertValidPattern)(t),!n.nocomment&&t.charAt(0)==="#"?!1:new ES(t,n).match(e));ft.minimatch=Pyt;var Myt=/^\*+([^+@!?\*\[\(]*)$/,Lyt=e=>t=>!t.startsWith(".")&&t.endsWith(e),Uyt=e=>t=>t.endsWith(e),Qyt=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Fyt=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Gyt=/^\*+\.\*+$/,zyt=e=>!e.startsWith(".")&&e.includes("."),jyt=e=>e!=="."&&e!==".."&&e.includes("."),Hyt=/^\.\*+$/,$yt=e=>e!=="."&&e!==".."&&e.startsWith("."),qyt=/^\*+$/,Vyt=e=>e.length!==0&&!e.startsWith("."),Yyt=e=>e.length!==0&&e!=="."&&e!=="..",Kyt=/^\?+([^+@!?\*\[\(]*)?$/,Jyt=([e,t=""])=>{let n=P1e([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},Zyt=([e,t=""])=>{let n=M1e([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},Wyt=([e,t=""])=>{let n=M1e([e]);return t?r=>n(r)&&r.endsWith(t):n},Xyt=([e,t=""])=>{let n=P1e([e]);return t?r=>n(r)&&r.endsWith(t):n},P1e=([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},M1e=([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},L1e=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",O1e={win32:{sep:"\\"},posix:{sep:"/"}};ft.sep=L1e==="win32"?O1e.win32.sep:O1e.posix.sep;ft.minimatch.sep=ft.sep;ft.GLOBSTAR=Symbol("globstar **");ft.minimatch.GLOBSTAR=ft.GLOBSTAR;var eSt="[^/]",tSt=eSt+"*?",nSt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",rSt="(?:(?!(?:\\/|^)\\.).)*?",oSt=(e,t={})=>n=>(0,ft.minimatch)(n,e,t);ft.filter=oSt;ft.minimatch.filter=ft.filter;var Vd=(e,t={})=>Object.assign({},e,t),iSt=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,Vd(e,i)),{Minimatch:class extends t.Minimatch{constructor(o,i={}){super(o,Vd(e,i))}static defaults(o){return t.defaults(Vd(e,o)).Minimatch}},AST:class extends t.AST{constructor(o,i,s={}){super(o,i,Vd(e,s))}static fromGlob(o,i={}){return t.AST.fromGlob(o,Vd(e,i))}},unescape:(r,o={})=>t.unescape(r,Vd(e,o)),escape:(r,o={})=>t.escape(r,Vd(e,o)),filter:(r,o={})=>t.filter(r,Vd(e,o)),defaults:r=>t.defaults(Vd(e,r)),makeRe:(r,o={})=>t.makeRe(r,Vd(e,o)),braceExpand:(r,o={})=>t.braceExpand(r,Vd(e,o)),match:(r,o,i={})=>t.match(r,o,Vd(e,i)),sep:t.sep,GLOBSTAR:ft.GLOBSTAR})};ft.defaults=iSt;ft.minimatch.defaults=ft.defaults;var sSt=(e,t={})=>((0,XF.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,Oyt.expand)(e,{max:t.braceExpandMax}));ft.braceExpand=sSt;ft.minimatch.braceExpand=ft.braceExpand;var aSt=(e,t={})=>new ES(e,t).makeRe();ft.makeRe=aSt;ft.minimatch.makeRe=ft.makeRe;var uSt=(e,t,n={})=>{let r=new ES(t,n);return e=e.filter(o=>r.match(o)),r.options.nonull&&!e.length&&e.push(t),e};ft.match=uSt;ft.minimatch.match=ft.match;var w1e=/[?*]|[+@!]\(.*?\)|\[|\]/,cSt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ES=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){(0,XF.assertValidPattern)(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||L1e,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,s,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=i[0]===""&&i[1]===""&&(i[2]==="?"||!w1e.test(i[2]))&&!w1e.test(i[3]),f=/^[a-z]:/i.test(i[0]);if(l)return[...i.slice(0,4),...i.slice(4).map(h=>this.parse(h))];if(f)return[i[0],...i.slice(1).map(h=>this.parse(h))]}return i.map(l=>this.parse(l))});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 s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[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 s=o;for(;r[s+1]==="**";)s++;s>o&&r.splice(o+1,s-o);let c=r[o+1],l=r[o+2],f=r[o+3];if(c!==".."||!l||l==="."||l===".."||!f||f==="."||f==="..")continue;n=!0,r.splice(o,1);let h=r.slice(0);h[o]="**",t.push(h),o--}if(!this.preserveMultipleSlashes){for(let s=1;s<r.length-1;s++){let c=r[s];s===1&&c===""&&r[0]===""||(c==="."||c==="")&&(n=!0,r.splice(s,1),s--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let s=r[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;let l=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...l),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,s=[],c="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])s.push(c==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])s.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])s.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",s.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",s.push(n[i]),o++,i++}else return!1;return t.length===n.length&&s}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]),l=!c&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),f=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),h=!f&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),y=l?3:c?0:void 0,S=h?3:f?0:void 0;if(typeof y=="number"&&typeof S=="number"){let[b,v]=[t[y],n[S]];b.toLowerCase()===v.toLowerCase()&&(n[S]=b,i=S,o=y)}}let{optimizationLevel:s=1}=this.options;return s>=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 s=n.indexOf(ft.GLOBSTAR,i),c=n.lastIndexOf(ft.GLOBSTAR),[l,f,h]=r?[n.slice(i,s),n.slice(s+1),[]]:[n.slice(i,s),n.slice(s+1,c),n.slice(c+1)];if(l.length){let Q=t.slice(o,o+l.length);if(!this.#o(Q,l,r,0,0))return!1;o+=l.length,i+=l.length}let y=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))y=h.length;else{if(t[t.length-1]!==""||o+h.length===t.length||(Q--,!this.#o(t,h,r,Q,0)))return!1;y=h.length+1}}if(!f.length){let Q=!!y;for(let z=o;z<t.length-y;z++){let G=String(t[z]);if(Q=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||Q}let S=[[[],0]],b=S[0],v=0,x=[0];for(let Q of f)Q===ft.GLOBSTAR?(x.push(v),b=[[],0],S.push(b)):(b[0].push(Q),v++);let D=S.length-1,k=t.length-y;for(let Q of S)Q[1]=k-(x[D--]+Q[0].length);return!!this.#r(t,S,o,0,r,0,!!y)}#r(t,n,r,o,i,s,c){let l=n[o];if(!l){for(let y=r;y<t.length;y++){c=!0;let S=t[y];if(S==="."||S===".."||!this.options.dot&&S.startsWith("."))return!1}return c}let[f,h]=l;for(;r<=h;){if(this.#o(t.slice(0,r+f.length),f,i,r,0)&&s<this.maxGlobstarRecursion){let b=this.#r(t,n,r+f.length,o+1,i,s+1,c);if(b!==!1)return b}let S=t[r];if(S==="."||S===".."||!this.options.dot&&S.startsWith("."))return!1;r++}return i||null}#o(t,n,r,o,i){let s,c,l,f;for(s=o,c=i,f=t.length,l=n.length;s<f&&c<l;s++,c++){this.debug("matchOne loop");let h=n[c],y=t[s];if(this.debug(n,h,y),h===!1||h===ft.GLOBSTAR)return!1;let S;if(typeof h=="string"?(S=y===h,this.debug("string match",h,y,S)):(S=h.test(y),this.debug("pattern match",h,y,S)),!S)return!1}if(s===f&&c===l)return!0;if(s===f)return r;if(c===l)return s===f-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return(0,ft.braceExpand)(this.pattern,this.options)}parse(t){(0,XF.assertValidPattern)(t);let n=this.options;if(t==="**")return ft.GLOBSTAR;if(t==="")return"";let r,o=null;(r=t.match(qyt))?o=n.dot?Yyt:Vyt:(r=t.match(Myt))?o=(n.nocase?n.dot?Fyt:Qyt:n.dot?Uyt:Lyt)(r[1]):(r=t.match(Kyt))?o=(n.nocase?n.dot?Zyt:Jyt:n.dot?Wyt:Xyt)(r):(r=t.match(Gyt))?o=n.dot?jyt:zyt:(r=t.match(Hyt))&&(o=$yt);let i=k1e.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?tSt:n.dot?nSt:rSt,o=new Set(n.nocase?["i"]:[]),i=t.map(l=>{let f=l.map(y=>{if(y instanceof RegExp)for(let S of y.flags.split(""))o.add(S);return typeof y=="string"?cSt(y):y===ft.GLOBSTAR?ft.GLOBSTAR:y._src});f.forEach((y,S)=>{let b=f[S+1],v=f[S-1];y!==ft.GLOBSTAR||v===ft.GLOBSTAR||(v===void 0?b!==void 0&&b!==ft.GLOBSTAR?f[S+1]="(?:\\/|"+r+"\\/)?"+b:f[S]=r:b===void 0?f[S-1]=v+"(?:\\/|\\/"+r+")?":b!==ft.GLOBSTAR&&(f[S-1]=v+"(?:\\/|\\/"+r+"\\/)"+b,f[S+1]=ft.GLOBSTAR))});let h=f.filter(y=>y!==ft.GLOBSTAR);if(this.partial&&h.length>=1){let y=[];for(let S=1;S<=h.length;S++)y.push(h.slice(0,S).join("/"));return"(?:"+y.join("|")+")"}return h.join("/")}).join("|"),[s,c]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+c+"$",this.partial&&(i="^(?:\\/|"+s+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 s=o[o.length-1];if(!s)for(let c=o.length-2;!s&&c>=0;c--)s=o[c];for(let c=0;c<i.length;c++){let l=i[c],f=o;if(r.matchBase&&l.length===1&&(f=[s]),this.matchOne(f,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return ft.minimatch.defaults(t).Minimatch}};ft.Minimatch=ES;var lSt=qK();Object.defineProperty(ft,"AST",{enumerable:!0,get:function(){return lSt.AST}});var dSt=VK();Object.defineProperty(ft,"escape",{enumerable:!0,get:function(){return dSt.escape}});var pSt=VF();Object.defineProperty(ft,"unescape",{enumerable:!0,get:function(){return pSt.unescape}});ft.minimatch.AST=k1e.AST;ft.minimatch.Minimatch=ES;ft.minimatch.escape=wyt.escape;ft.minimatch.unescape=kyt.unescape});var $1e=F((W_n,JK)=>{"use strict";A();var Q1e=Fe("node:diagnostics_channel"),{context:e4,trace:YK,SpanStatusCode:t4,propagation:KK,diag:fSt}=(ze(),Me(We)),{getRPCMetadata:mSt,RPCType:ASt}=br(),{ATTR_HTTP_ROUTE:n4,ATTR_HTTP_RESPONSE_STATUS_CODE:F1e,ATTR_HTTP_REQUEST_METHOD:gSt,ATTR_URL_PATH:hSt}=(Zn(),Me(Fr)),{InstrumentationBase:_St}=m1e(),{version:ESt,name:G1e}=A1e(),ySt=">=4.0.0 <6",z1e=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],To={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},Z_={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},kg="anonymous",W_=Symbol("fastify otel instance"),X_=Symbol("fastify otel request spans"),WN=Symbol("fastify otel request context"),j1e=Symbol("fastify otel addhook original"),H1e=Symbol("fastify otel setnotfound original"),XN=Symbol("fastify otel ignore path"),eO=Symbol("fastify otel record exceptions"),r4=class extends _St{logger=null;_requestHook=null;_lifecycleHook=null;constructor(t){if(super(G1e,ESt,t),this.logger=fSt.createComponentLogger({namespace:G1e}),this[XN]=null,this[eO]=!0,t?.recordExceptions!=null){if(typeof t.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[eO]=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[XN]=o=>typeof n=="function"?n(o):(r==null&&(r=U1e().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)},Q1e.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(Q1e.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:ySt,name:"@fastify/otel"},n;function n(r,o,i){r.decorate(W_,t),r.decorate(j1e,r.addHook),r.decorate(H1e,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let b=this[WN],v=this[X_];return{enabled:this.routeOptions.config?.otel!==!1,span:v,tracer:t.tracer,context:b,inject:(x,D)=>KK.inject(b,x,D),extract:(x,D)=>KK.extract(b,x,D)}}),r.decorateRequest(X_,null),r.decorateRequest(WN,null),r.addHook("onRoute",function(b){if(t[XN]?.(b)===!0){t.logger.debug(`Ignoring route instrumentation ${b.method} ${b.url} because it matches the ignore path`);return}if(b.config?.otel===!1){t.logger.debug(`Ignoring route instrumentation ${b.method} ${b.url} because it is disabled`);return}for(let v of z1e)if(b[v]!=null){let x=b[v];if(typeof x=="function")b[v]=y(x,v,{[To.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[To.FASTIFY_TYPE]:Z_.ROUTE,[n4]:b.url,[To.HOOK_CALLBACK_NAME]:x.name?.length>0?x.name:kg});else if(Array.isArray(x)){let D=[];for(let k of x)D.push(y(k,v,{[To.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[To.FASTIFY_TYPE]:Z_.ROUTE,[n4]:b.url,[To.HOOK_CALLBACK_NAME]:k.name?.length>0?k.name:kg}));b[v]=D}}b.onSend!=null?b.onSend=Array.isArray(b.onSend)?[...b.onSend,s]:[b.onSend,s]:b.onSend=s,b.onError!=null?b.onError=Array.isArray(b.onError)?[...b.onError,c]:[b.onError,c]:b.onError=c,b.handler=y(b.handler,"handler",{[To.HOOK_NAME]:`${this.pluginName} - route-handler`,[To.FASTIFY_TYPE]:Z_.HANDLER,[n4]:b.url,[To.HOOK_CALLBACK_NAME]:b.handler.name.length>0?b.handler.name:kg})}),r.addHook("onRequest",function(b,v,x){if(this[W_].isEnabled()===!1||b.routeOptions.config?.otel===!1)return x();if(this[W_][XN]?.({url:b.url,method:b.method})===!0)return this[W_].logger.debug(`Ignoring request ${b.method} ${b.url} because it matches the ignore path`),x();let D=e4.active();YK.getSpan(D)==null&&(D=KK.extract(D,b.headers));let k=mSt(D);b.routeOptions.url!=null&&k?.type===ASt.HTTP&&(k.route=b.routeOptions.url);let Q={[To.ROOT]:"@fastify/otel",[gSt]:b.method,[hSt]:b.url};b.routeOptions.url!=null&&(Q[n4]=b.routeOptions.url);let z=this[W_].tracer.startSpan("request",{attributes:Q},D);try{this[W_]._requestHook?.(z,b)}catch(G){this[W_].logger.error({err:G},"requestHook threw")}b[WN]=YK.setSpan(D,z),b[X_]=z,e4.with(b[WN],()=>{x()})}),r.addHook("onResponse",function(b,v,x){let D=b[X_];D!=null&&(D.setAttributes({[F1e]:v.statusCode}),D.end()),b[X_]=null,x()}),r.addHook=l,r.setNotFoundHandler=f,i();function s(S,b,v,x){let D=S[X_];D!=null&&(b.statusCode>=500&&D.setStatus({code:t4.ERROR}),D.setAttributes({[F1e]:b.statusCode}),D.end()),S[X_]=null,x(null,v)}function c(S,b,v,x){let D=S[X_];D!=null&&(D.setStatus({code:t4.ERROR,message:v.message}),t[eO]!==!1&&D.recordException(v)),x()}function l(S,b){let v=this[j1e];return z1e.includes(S)?v.call(this,S,y(b,S,{[To.HOOK_NAME]:`${this.pluginName} - ${S}`,[To.FASTIFY_TYPE]:Z_.INSTANCE,[To.HOOK_CALLBACK_NAME]:b.name?.length>0?b.name:kg})):v.call(this,S,b)}function f(S,b){let v=this[H1e];typeof S=="function"?(b=y(S,"notFoundHandler",{[To.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[To.FASTIFY_TYPE]:Z_.INSTANCE,[To.HOOK_CALLBACK_NAME]:S.name?.length>0?S.name:kg}),v.call(this,b)):(S.preValidation!=null&&(S.preValidation=y(S.preValidation,"notFoundHandler - preValidation",{[To.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[To.FASTIFY_TYPE]:Z_.INSTANCE,[To.HOOK_CALLBACK_NAME]:S.preValidation.name?.length>0?S.preValidation.name:kg})),S.preHandler!=null&&(S.preHandler=y(S.preHandler,"notFoundHandler - preHandler",{[To.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[To.FASTIFY_TYPE]:Z_.INSTANCE,[To.HOOK_CALLBACK_NAME]:S.preHandler.name?.length>0?S.preHandler.name:kg})),b=y(b,"notFoundHandler",{[To.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[To.FASTIFY_TYPE]:Z_.INSTANCE,[To.HOOK_CALLBACK_NAME]:b.name?.length>0?b.name:kg}),v.call(this,S,b))}function h(S){for(let b of S)if(b?.routeOptions&&b.url&&b.method)return b;return null}function y(S,b,v={}){return function(...D){let k=this[W_],Q=h(D);if(Q===null)return k.logger.debug(`Ignoring route instrumentation because ${b} was called without a Fastify request argument`),S.call(this,...D);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`),S.call(this,...D);if(k[XN]?.({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`),S.call(this,...D);let z=Q[WN]??e4.active(),G=S.name?.length>0?S.name:this.pluginName??kg,$=k.tracer.startSpan(`${b} - ${G}`,{attributes:v},z);if(k._lifecycleHook!=null)try{k._lifecycleHook($,{hookName:b,request:Q,handler:G})}catch(ie){k.logger.error({err:ie},"Execution of lifecycleHook failed")}return e4.with(YK.setSpan(z,$),function(){try{let ie=S.call(this,...D);return typeof ie?.then=="function"?ie.then(ge=>($.end(),ge),ge=>($.setStatus({code:t4.ERROR,message:ge.message}),k[eO]!==!1&&$.recordException(ge),$.end(),Promise.reject(ge))):($.end(),ie)}catch(ie){throw $.setStatus({code:t4.ERROR,message:ie.message}),k[eO]!==!1&&$.recordException(ie),$.end(),ie}},this)}}}}};JK.exports=r4;JK.exports.FastifyOtelInstrumentation=r4});var Pg,tO,nO,q1e=O(()=>{A();(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})(Pg||(Pg={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request_handler";e.REQUEST_HANDLER=n})(tO||(tO={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request handler";e.REQUEST_HANDLER=n})(nO||(nO={}))});var rO,V1e=O(()=>{A();rO=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function ZK(e,t,n,r={}){let o=t.startSpan(n,{attributes:r}),i=e[rO]||[];return i.push(o),Object.defineProperty(e,rO,{enumerable:!1,configurable:!0,value:i}),o}function o4(e,t){let n=e[rO]||[];n.length&&(n.forEach(r=>{t&&(r.setStatus({code:di.ERROR,message:t.message}),r.recordException(t)),r.end()}),delete e[rO])}function K1e(e,t,n){let r,o;try{o=e(),Y1e(o)&&o.then(i=>t(void 0,i),i=>t(i))}catch(i){r=i}finally{if(!Y1e(o)&&(t(r,o),r))throw r;return o}}function Y1e(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var J1e=O(()=>{A();ze();V1e()});function bSt(){let e=gt();e&&e.on("spanStart",t=>{W1e(t)})}function W1e(e){let t=Ot(e).data,n=t["fastify.type"];if(t[Xt]||!n)return;e.setAttributes({[kt]:"auto.http.otel.fastify",[Xt]:`${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 s4,yS,SSt,TSt,Z1e,ISt,i4,X1e=O(()=>{A();ze();s4=se(br(),1),yS=se(on(),1);Zn();dt();q1e();J1e();SSt="0.1.0",TSt="@sentry/instrumentation-fastify-v3",Z1e="anonymous",ISt=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),i4=class extends yS.InstrumentationBase{constructor(t={}){super(TSt,SSt,t)}init(){return[new yS.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 s=r,c=(0,s4.getRPCMetadata)(Ke.active()),l=s.routeOptions?s.routeOptions.url:r.routerPath;l&&c?.type===s4.RPCType.HTTP&&(c.route=l);let f=r.method||"GET";vn().setTransactionName(`${f} ${l}`),i()}}_wrapHandler(t,n,r,o){let i=this;return this._diag.debug("Patching fastify route.handler function"),function(...s){if(!i.isEnabled())return r.apply(this,s);let c=r.name||t||Z1e,l=`${nO.MIDDLEWARE} - ${c}`,f=s[1],h=ZK(f,i.tracer,l,{[Pg.FASTIFY_TYPE]:tO.MIDDLEWARE,[Pg.PLUGIN_NAME]:t,[Pg.HOOK_NAME]:n}),y=o&&s[s.length-1];return y&&(s[s.length-1]=function(...S){o4(f),y.apply(this,S)}),Ke.with($t.setSpan(Ke.active(),h),()=>K1e(()=>r.apply(this,s),S=>{S instanceof Error&&(h.setStatus({code:di.ERROR,message:S.message}),h.recordException(S)),o||o4(f)}))}}_wrapAddHook(){let t=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let i=o[0],s=o[1],c=this.pluginName;if(!ISt.has(i))return n.apply(this,o);let l=typeof o[o.length-1]=="function"&&s.constructor.name!=="AsyncFunction";return n.apply(this,[i,t._wrapHandler(c,i,s,l)])}}}_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()),bSt(),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 s=i[0];return t.isEnabled()?(0,yS.safeExecuteInTheMiddle)(()=>r.apply(this,i),c=>{!c&&s instanceof Error&&(c=s),o4(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 s=r,c=s.routeOptions?.handler||s.context?.handler,l=c?.name.startsWith("bound ")?c.name.substring(6):c?.name,f=`${nO.REQUEST_HANDLER} - ${l||this.pluginName||Z1e}`,h={[Pg.PLUGIN_NAME]:this.pluginName,[Pg.FASTIFY_TYPE]:tO.REQUEST_HANDLER,[F9]:s.routeOptions?s.routeOptions.url:r.routerPath};l&&(h[Pg.FASTIFY_NAME]=l);let y=ZK(o,t.tracer,f,h);W1e(y);let{requestHook:S}=t.getConfig();return S&&(0,yS.safeExecuteInTheMiddle)(()=>S(y,{request:r}),b=>{b&&t._diag.error("request hook failed",b)},!0),Ke.with($t.setSpan(Ke.active(),y),()=>{i()})}}}});import*as WK from"node:diagnostics_channel";function CSt(){let e=gt();if(e)return e.getIntegrationByName(a4)}function eBe(e,t,n,r){let o=CSt()?.getShouldHandleError()||iBe;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){bs&&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)&&nn(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function iBe(e,t,n){let r=n.statusCode;return r>=500||r<=299}function sBe(e){let t=Ot(e),n=t.description,r=t.data,o=r["fastify.type"],i=o==="hook",s=o===n?.startsWith("handler -"),c=n==="request"||o==="request-handler";if(r[Xt]||!s&&!c&&!i)return;let l=i?"hook":s?"middleware":c?"request_handler":"<unknown>";e.setAttributes({[kt]:"auto.http.otel.fastify",[Xt]:`${l}.fastify`});let f=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof f=="string"){let h=f.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(h)}}function RSt(){let e=gt();e&&e.on("spanStart",t=>{sBe(t)})}function xSt(e){e.addHook("onRequest",async(t,n)=>{if(t.opentelemetry){let{span:i}=t.opentelemetry();i&&sBe(i)}let r=t.routeOptions?.url,o=t.method||"GET";vn().setTransactionName(`${o} ${r}`)})}var tBe,a4,nBe,rBe,vSt,oBe,aBe=O(()=>{A();tBe=se($1e(),1);dt();gr();gS();X1e();a4="Fastify",nBe=at(`${a4}.v3`,()=>new i4);rBe=at(`${a4}.v5`,()=>{let e=new tBe.FastifyOtelInstrumentation,t=e.plugin();return WK.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(t).after(o=>{o?bs&&J.error("Failed to setup Fastify instrumentation",o):(RSt(),r&&xSt(r))})}),WK.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:i}=n;eBe.call(eBe,r,o,i,"diagnostics-channel")}),e}),vSt=(({shouldHandleError:e})=>{let t;return{name:a4,setupOnce(){t=e||iBe,nBe(),rBe()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}}),oBe=(e={})=>vSt(e)});var XK=F(mf=>{"use strict";A();Object.defineProperty(mf,"__esModule",{value:!0});mf.SpanNames=mf.TokenKind=mf.AllowedOperationTypes=void 0;var DSt;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(DSt=mf.AllowedOperationTypes||(mf.AllowedOperationTypes={}));var BSt;(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"})(BSt=mf.TokenKind||(mf.TokenKind={}));var NSt;(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"})(NSt=mf.SpanNames||(mf.SpanNames={}))});var eJ=F(oO=>{"use strict";A();Object.defineProperty(oO,"__esModule",{value:!0});oO.AttributeNames=void 0;var OSt;(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"})(OSt=oO.AttributeNames||(oO.AttributeNames={}))});var u4=F(kv=>{"use strict";A();Object.defineProperty(kv,"__esModule",{value:!0});kv.OTEL_GRAPHQL_DATA_SYMBOL=kv.OTEL_PATCHED_SYMBOL=void 0;kv.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");kv.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var uBe=F(c4=>{"use strict";A();Object.defineProperty(c4,"__esModule",{value:!0});c4.OPERATION_NOT_SUPPORTED=void 0;var REn=u4();c4.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var TBe=F(Cs=>{"use strict";A();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.wrapFieldResolver=Cs.wrapFields=Cs.getSourceFromLocation=Cs.getOperation=Cs.endSpan=Cs.addSpanSource=Cs.addInputVariableAttributes=Cs.isPromise=void 0;var Pv=(ze(),Me(We)),eE=XK(),SS=eJ(),Mg=u4(),cBe=Object.values(eE.AllowedOperationTypes),wSt=e=>typeof e?.then=="function";Cs.isPromise=wSt;var kSt=e=>typeof e=="object"&&e!==null;function tJ(e,t,n){Array.isArray(n)?n.forEach((r,o)=>{tJ(e,`${t}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{tJ(e,`${t}.${r}`,o)}):e.setAttribute(`${SS.AttributeNames.VARIABLES}${String(t)}`,n)}function PSt(e,t){Object.entries(t).forEach(([n,r])=>{tJ(e,n,r)})}Cs.addInputVariableAttributes=PSt;function fBe(e,t,n,r,o){let i=_Be(t,n,r,o);e.setAttribute(SS.AttributeNames.SOURCE,i)}Cs.addSpanSource=fBe;function MSt(e,t,n,r,o){let i=mBe(n,o);if(i)return{field:i,spanAdded:!1};let c=t().flatResolveSpans?gBe(n):ABe(n,o);return i={span:LSt(e,t,n,r,o,c)},FSt(n,o,i),{field:i,spanAdded:!0}}function LSt(e,t,n,r,o,i){let s={[SS.AttributeNames.FIELD_NAME]:r.fieldName,[SS.AttributeNames.FIELD_PATH]:o.join("."),[SS.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[SS.AttributeNames.PARENT_NAME]:r.parentType.name},c=e.startSpan(`${eE.SpanNames.RESOLVE} ${s[SS.AttributeNames.FIELD_PATH]}`,{attributes:s},i?Pv.trace.setSpan(Pv.context.active(),i):void 0),l=n[Mg.OTEL_GRAPHQL_DATA_SYMBOL].source,f=r.fieldNodes.find(h=>h.kind==="Field");return f&&fBe(c,l.loc,t().allowValues,f.loc?.start,f.loc?.end),c}function USt(e,t){t&&e.recordException(t),e.end()}Cs.endSpan=USt;function QSt(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>cBe.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>cBe.indexOf(n?.operation)!==-1)}Cs.getOperation=QSt;function FSt(e,t,n){return e[Mg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]=n}function mBe(e,t){return e[Mg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]}function ABe(e,t){for(let n=t.length-1;n>0;n--){let r=mBe(e,t.slice(0,n));if(r)return r.span}return gBe(e)}function gBe(e){return e[Mg.OTEL_GRAPHQL_DATA_SYMBOL].span}function GSt(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 zSt(e){return hBe(`
|
|
37
37
|
`,e)}function lBe(e){return hBe(" ",e)}function hBe(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}var jSt=[eE.TokenKind.FLOAT,eE.TokenKind.STRING,eE.TokenKind.INT,eE.TokenKind.BLOCK_STRING];function _Be(e,t=!1,n,r){let o="";if(e?.startToken){let i=typeof n=="number"?n:e.start,s=typeof r=="number"?r:e.end,c=e.startToken.next,l=1;for(;c;){if(c.start<i){c=c.next,l=c?.line;continue}if(c.end>s){c=c.next,l=c?.line;continue}let f=c.value||c.kind,h="";!t&&jSt.indexOf(c.kind)>=0&&(f="*"),c.kind===eE.TokenKind.STRING&&(f=`"${f}"`),c.kind===eE.TokenKind.EOF&&(f=""),c.line>l?(o+=zSt(c.line-l),l=c.line,h=lBe(c.column-1)):c.line===c.prev?.line&&(h=lBe(c.start-(c.prev?.end||0))),o+=h+f,c&&(c=c.next)}}return o}Cs.getSourceFromLocation=_Be;function EBe(e,t,n){if(!e||e[Mg.OTEL_PATCHED_SYMBOL])return;let r=e.getFields();e[Mg.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let i=r[o];if(i&&(i.resolve&&(i.resolve=SBe(t,n,i.resolve)),i.type)){let s=yBe(i.type);for(let c of s)EBe(c,t,n)}})}Cs.wrapFields=EBe;function yBe(e){return"ofType"in e?yBe(e.ofType):HSt(e)?e.getTypes():$St(e)?[e]:[]}function HSt(e){return"getTypes"in e&&typeof e.getTypes=="function"}function $St(e){return"getFields"in e&&typeof e.getFields=="function"}var dBe=(e,t,n)=>{n&&(e.recordException(t),e.setStatus({code:Pv.SpanStatusCode.ERROR,message:t.message}),e.end())},pBe=(e,t)=>{t&&e.end()};function SBe(e,t,n,r=!1){if(o[Mg.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(i,s,c,l){if(!n)return;let f=t();if(f.ignoreTrivialResolveSpans&&r&&(kSt(i)||typeof i=="function")&&typeof i[l.fieldName]!="function")return n.call(this,i,s,c,l);if(!c[Mg.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,i,s,c,l);let h=GSt(f.mergeItems,l&&l.path),y=h.filter(v=>typeof v=="string").length,S,b=!1;if(f.depth>=0&&f.depth<y)S=ABe(c,h);else{let{field:v,spanAdded:x}=MSt(e,t,c,l,h);S=v.span,b=x}return Pv.context.with(Pv.trace.setSpan(Pv.context.active(),S),()=>{try{let v=n.call(this,i,s,c,l);return(0,Cs.isPromise)(v)?v.then(x=>(pBe(S,b),x),x=>{throw dBe(S,x,b),x}):(pBe(S,b),v)}catch(v){throw dBe(S,v,b),v}})}return o[Mg.OTEL_PATCHED_SYMBOL]=!0,o}Cs.wrapFieldResolver=SBe});var IBe=F(Mv=>{"use strict";A();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-graphql"});var vBe=F(p4=>{"use strict";A();Object.defineProperty(p4,"__esModule",{value:!0});p4.GraphQLInstrumentation=void 0;var Lg=(ze(),Me(We)),Yd=on(),iO=XK(),l4=eJ(),nJ=u4(),qSt=uBe(),iu=TBe(),bBe=IBe(),CBe={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},d4=[">=14.0.0 <17"],rJ=class extends Yd.InstrumentationBase{constructor(t={}){super(bBe.PACKAGE_NAME,bBe.PACKAGE_VERSION,{...CBe,...t})}setConfig(t={}){super.setConfig({...CBe,...t})}init(){let t=new Yd.InstrumentationNodeModuleDefinition("graphql",d4);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new Yd.InstrumentationNodeModuleFile("graphql/execution/execute.js",d4,t=>((0,Yd.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 Yd.InstrumentationNodeModuleFile("graphql/language/parser.js",d4,t=>((0,Yd.isWrapped)(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new Yd.InstrumentationNodeModuleFile("graphql/validation/validate.js",d4,t=>((0,Yd.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 s;if(arguments.length>=2){let f=arguments;s=n._wrapExecuteArgs(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],t)}else{let f=arguments[0];s=n._wrapExecuteArgs(f.schema,f.document,f.rootValue,f.contextValue,f.variableValues,f.operationName,f.fieldResolver,f.typeResolver,t)}let c=(0,iu.getOperation)(s.document,s.operationName),l=n._createExecuteSpan(c,s);return s.contextValue[nJ.OTEL_GRAPHQL_DATA_SYMBOL]={source:s.document?s.document||s.document[nJ.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:l,fields:{}},Lg.context.with(Lg.trace.setSpan(Lg.context.active(),l),()=>(0,Yd.safeExecuteInTheMiddle)(()=>o.apply(this,[s]),(f,h)=>{n._handleExecutionResult(l,f,h)}))}}}_handleExecutionResult(t,n,r){let o=this.getConfig();if(r===void 0||n){(0,iu.endSpan)(t,n);return}if((0,iu.isPromise)(r))r.then(i=>{if(typeof o.responseHook!="function"){(0,iu.endSpan)(t);return}this._executeResponseHook(t,i)},i=>{(0,iu.endSpan)(t,i)});else{if(typeof o.responseHook!="function"){(0,iu.endSpan)(t);return}this._executeResponseHook(t,r)}}_executeResponseHook(t,n){let{responseHook:r}=this.getConfig();r&&(0,Yd.safeExecuteInTheMiddle)(()=>{r(t,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,iu.endSpan)(t,void 0)},!0)}_patchParse(){let t=this;return function(r){return function(i,s){return t._parse(this,r,i,s)}}}_patchValidate(){let t=this;return function(r){return function(i,s,c,l,f){return t._validate(this,r,i,s,c,f,l)}}}_parse(t,n,r,o){let i=this.getConfig(),s=this.tracer.startSpan(iO.SpanNames.PARSE);return Lg.context.with(Lg.trace.setSpan(Lg.context.active(),s),()=>(0,Yd.safeExecuteInTheMiddle)(()=>n.call(t,r,o),(c,l)=>{l&&((0,iu.getOperation)(l)?l.loc&&(0,iu.addSpanSource)(s,l.loc,i.allowValues):s.updateName(iO.SpanNames.SCHEMA_PARSE)),(0,iu.endSpan)(s,c)}))}_validate(t,n,r,o,i,s,c){let l=this.tracer.startSpan(iO.SpanNames.VALIDATE,{});return Lg.context.with(Lg.trace.setSpan(Lg.context.active(),l),()=>(0,Yd.safeExecuteInTheMiddle)(()=>n.call(t,r,o,i,c,s),(f,h)=>{o.loc||l.updateName(iO.SpanNames.SCHEMA_VALIDATE),h&&h.length&&l.recordException({name:l4.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(h)}),(0,iu.endSpan)(l,f)}))}_createExecuteSpan(t,n){let r=this.getConfig(),o=this.tracer.startSpan(iO.SpanNames.EXECUTE,{});if(t){let{operation:i,name:s}=t;o.setAttribute(l4.AttributeNames.OPERATION_TYPE,i);let c=s?.value;c?(o.setAttribute(l4.AttributeNames.OPERATION_NAME,c),o.updateName(`${i} ${c}`)):o.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=qSt.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),o.setAttribute(l4.AttributeNames.OPERATION_NAME,i)}return n.document?.loc&&(0,iu.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,iu.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(t,n,r,o,i,s,c,l,f){if(o||(o={}),o[nJ.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:c,typeResolver:l};let h=c==null,y=c??f;return c=(0,iu.wrapFieldResolver)(this.tracer,()=>this.getConfig(),y,h),t&&((0,iu.wrapFields)(t.getQueryType(),this.tracer,()=>this.getConfig()),(0,iu.wrapFields)(t.getMutationType(),this.tracer,()=>this.getConfig())),{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:c,typeResolver:l}}};p4.GraphQLInstrumentation=rJ});var RBe=F(f4=>{"use strict";A();Object.defineProperty(f4,"__esModule",{value:!0});f4.GraphQLInstrumentation=void 0;var VSt=vBe();Object.defineProperty(f4,"GraphQLInstrumentation",{enumerable:!0,get:function(){return VSt.GraphQLInstrumentation}})});function OBe(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function KSt(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 xBe,DBe,BBe,YSt,NBe,wBe=O(()=>{A();ze();xBe=se(RBe(),1);dt();gr();yv();DBe="Graphql",BBe=at(DBe,xBe.GraphQLInstrumentation,e=>{let t=OBe(e);return{...t,responseHook(n,r){zr(n,"auto.graphql.otel.graphql"),r.errors?.length&&!Ot(n).status&&n.setStatus({code:di.ERROR});let i=Ot(n).data,s=i["graphql.operation.type"],c=i["graphql.operation.name"];if(t.useOperationNameForRootSpan&&s){let l=pi(n),h=Ot(l).data[_v]||[],y=c?`${s} ${c}`:`${s}`;Array.isArray(h)?(h.push(y),l.setAttribute(_v,h)):typeof h=="string"?l.setAttribute(_v,[h,y]):l.setAttribute(_v,y),Ot(l).data["original-description"]||l.setAttribute("original-description",Ot(l).description),l.updateName(`${Ot(l).data["original-description"]} (${KSt(h)})`)}}}}),YSt=((e={})=>({name:DBe,setupOnce(){BBe(OBe(e))}})),NBe=YSt});var kBe=F(m4=>{"use strict";A();Object.defineProperty(m4,"__esModule",{value:!0});m4.EVENT_LISTENERS_SET=void 0;m4.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var PBe=F(A4=>{"use strict";A();Object.defineProperty(A4,"__esModule",{value:!0});A4.bufferTextMapGetter=void 0;A4.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 MBe=F(rr=>{"use strict";A();Object.defineProperty(rr,"__esModule",{value:!0});rr.METRIC_MESSAGING_PROCESS_DURATION=rr.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=rr.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=rr.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=rr.MESSAGING_SYSTEM_VALUE_KAFKA=rr.MESSAGING_OPERATION_TYPE_VALUE_SEND=rr.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=rr.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=rr.ATTR_MESSAGING_SYSTEM=rr.ATTR_MESSAGING_OPERATION_TYPE=rr.ATTR_MESSAGING_OPERATION_NAME=rr.ATTR_MESSAGING_KAFKA_OFFSET=rr.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=rr.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=rr.ATTR_MESSAGING_DESTINATION_PARTITION_ID=rr.ATTR_MESSAGING_DESTINATION_NAME=rr.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;rr.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";rr.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";rr.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";rr.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";rr.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";rr.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";rr.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";rr.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";rr.ATTR_MESSAGING_SYSTEM="messaging.system";rr.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";rr.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";rr.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";rr.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";rr.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";rr.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";rr.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";rr.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var LBe=F(Lv=>{"use strict";A();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.PACKAGE_NAME=Lv.PACKAGE_VERSION=void 0;Lv.PACKAGE_VERSION="0.23.0";Lv.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var jBe=F(h4=>{"use strict";A();Object.defineProperty(h4,"__esModule",{value:!0});h4.KafkaJsInstrumentation=void 0;var jr=(ze(),Me(We)),Kd=on(),Uv=(Zn(),Me(Fr)),UBe=kBe(),QBe=PBe(),mt=MBe(),FBe=LBe();function g4(e,t,n){return r=>{e.add(t,{...n,...r?{[Uv.ATTR_ERROR_TYPE]:r}:{}})}}function GBe(e,t,n){return r=>{e.record((Date.now()-t)/1e3,{...n,...r?{[Uv.ATTR_ERROR_TYPE]:r}:{}})}}var zBe=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],oJ=class extends Kd.InstrumentationBase{constructor(t={}){super(FBe.PACKAGE_NAME,FBe.PACKAGE_VERSION,t)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(mt.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:zBe}}),this._sentMessages=this.meter.createCounter(mt.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(mt.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(mt.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:zBe}})}init(){let t=r=>{(0,Kd.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,Kd.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new Kd.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,Kd.isWrapped)(i.run)&&t._unwrap(i,"run"),t._wrap(i,"run",t._getConsumerRunPatch()),t._setKafkaEventListeners(i),i}}_setKafkaEventListeners(t){t[UBe.EVENT_LISTENERS_SET]||(t.events?.REQUEST&&t.on(t.events.REQUEST,this._recordClientDurationMetric.bind(this)),t[UBe.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(t){let[n,r]=t.payload.broker.split(":");this._clientDuration.record(t.payload.duration/1e3,{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_OPERATION_NAME]:`${t.payload.apiName}`,[Uv.ATTR_SERVER_ADDRESS]:n,[Uv.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,Kd.isWrapped)(i.sendBatch)&&t._unwrap(i,"sendBatch"),t._wrap(i,"sendBatch",t._getSendBatchPatch()),(0,Kd.isWrapped)(i.send)&&t._unwrap(i,"send"),t._wrap(i,"send",t._getSendPatch()),(0,Kd.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,Kd.isWrapped)(i.eachMessage)&&t._unwrap(i,"eachMessage"),t._wrap(i,"eachMessage",t._getConsumerEachMessagePatch())),i?.eachBatch&&((0,Kd.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],s=jr.propagation.extract(jr.ROOT_CONTEXT,i.message.headers,QBe.bufferTextMapGetter),c=t._startConsumerSpan({topic:i.topic,message:i.message,operationType:mt.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:s,attributes:{[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),l=[GBe(t._processDuration,Date.now(),{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_OPERATION_NAME]:"process",[mt.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),g4(t._consumedMessages,1,{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_OPERATION_NAME]:"process",[mt.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],f=jr.context.with(jr.trace.setSpan(s,c),()=>n.apply(this,o));return t._endSpansOnPromise([c],l,f)}}_getConsumerEachBatchPatch(){return t=>{let n=this;return function(...o){let i=o[0],s=n._startConsumerSpan({topic:i.batch.topic,message:void 0,operationType:mt.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:jr.ROOT_CONTEXT,attributes:{[mt.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return jr.context.with(jr.trace.setSpan(jr.context.active(),s),()=>{let c=Date.now(),l=[],f=[g4(n._consumedMessages,i.batch.messages.length,{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_OPERATION_NAME]:"process",[mt.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(y=>{let S=jr.propagation.extract(jr.ROOT_CONTEXT,y.headers,QBe.bufferTextMapGetter),b=jr.trace.getSpan(S)?.spanContext(),v;b&&(v={context:b}),l.push(n._startConsumerSpan({topic:i.batch.topic,message:y,operationType:mt.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:v,attributes:{[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),f.push(GBe(n._processDuration,c,{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_OPERATION_NAME]:"process",[mt.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}))});let h=t.apply(this,o);return l.unshift(s),n._endSpansOnPromise(l,f,h)})}}}_getProducerTransactionPatch(){let t=this;return n=>function(...o){let i=t.tracer.startSpan("transaction"),s=n.apply(this,o);return s.then(c=>{let l=c.send;c.send=function(...b){return jr.context.with(jr.trace.setSpan(jr.context.active(),i),()=>t._getSendPatch()(l).apply(this,b).catch(x=>{throw i.setStatus({code:jr.SpanStatusCode.ERROR,message:x?.message}),i.recordException(x),x}))};let f=c.sendBatch;c.sendBatch=function(...b){return jr.context.with(jr.trace.setSpan(jr.context.active(),i),()=>t._getSendBatchPatch()(f).apply(this,b).catch(x=>{throw i.setStatus({code:jr.SpanStatusCode.ERROR,message:x?.message}),i.recordException(x),x}))};let h=c.commit;c.commit=function(...b){let v=h.apply(this,b).then(()=>{i.setStatus({code:jr.SpanStatusCode.OK})});return t._endSpansOnPromise([i],[],v)};let y=c.abort;c.abort=function(...b){let v=y.apply(this,b);return t._endSpansOnPromise([i],[],v)}}).catch(c=>{i.setStatus({code:jr.SpanStatusCode.ERROR,message:c?.message}),i.recordException(c),i.end()}),s}}_getSendBatchPatch(){let t=this;return n=>function(...o){let s=o[0].topicMessages||[],c=[],l=[];s.forEach(h=>{h.messages.forEach(y=>{c.push(t._startProducerSpan(h.topic,y)),l.push(g4(t._sentMessages,1,{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_OPERATION_NAME]:"send",[mt.ATTR_MESSAGING_DESTINATION_NAME]:h.topic,...y.partition!==void 0?{[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(y.partition)}:{}}))})});let f=n.apply(this,o);return t._endSpansOnPromise(c,l,f)}}_getSendPatch(){let t=this;return n=>function(...o){let i=o[0],s=i.messages.map(f=>t._startProducerSpan(i.topic,f)),c=i.messages.map(f=>g4(t._sentMessages,1,{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_OPERATION_NAME]:"send",[mt.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,...f.partition!==void 0?{[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(f.partition)}:{}})),l=n.apply(this,o);return t._endSpansOnPromise(s,c,l)}}_endSpansOnPromise(t,n,r){return Promise.resolve(r).then(o=>(n.forEach(i=>i()),o)).catch(o=>{let i,s=Uv.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,s=o.constructor.name),n.forEach(c=>c(s)),t.forEach(c=>{c.setAttribute(Uv.ATTR_ERROR_TYPE,s),c.setStatus({code:jr.SpanStatusCode.ERROR,message:i})}),o}).finally(()=>{t.forEach(o=>o.end())})}_startConsumerSpan({topic:t,message:n,operationType:r,ctx:o,link:i,attributes:s}){let c=r===mt.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,l=this.tracer.startSpan(`${c} ${t}`,{kind:r===mt.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?jr.SpanKind.CLIENT:jr.SpanKind.CONSUMER,attributes:{...s,[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_DESTINATION_NAME]:t,[mt.ATTR_MESSAGING_OPERATION_TYPE]:r,[mt.ATTR_MESSAGING_OPERATION_NAME]:c,[mt.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[mt.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[mt.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:i?[i]:[]},o),{consumerHook:f}=this.getConfig();return f&&n&&(0,Kd.safeExecuteInTheMiddle)(()=>f(l,{topic:t,message:n}),h=>{h&&this._diag.error("consumerHook error",h)},!0),l}_startProducerSpan(t,n){let r=this.tracer.startSpan(`send ${t}`,{kind:jr.SpanKind.PRODUCER,attributes:{[mt.ATTR_MESSAGING_SYSTEM]:mt.MESSAGING_SYSTEM_VALUE_KAFKA,[mt.ATTR_MESSAGING_DESTINATION_NAME]:t,[mt.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[mt.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[mt.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[mt.ATTR_MESSAGING_OPERATION_NAME]:"send",[mt.ATTR_MESSAGING_OPERATION_TYPE]:mt.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},jr.propagation.inject(jr.trace.setSpan(jr.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,Kd.safeExecuteInTheMiddle)(()=>o(r,{topic:t,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),r}};h4.KafkaJsInstrumentation=oJ});var HBe=F(_4=>{"use strict";A();Object.defineProperty(_4,"__esModule",{value:!0});_4.KafkaJsInstrumentation=void 0;var JSt=jBe();Object.defineProperty(_4,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return JSt.KafkaJsInstrumentation}})});var $Be,qBe,VBe,ZSt,YBe,KBe=O(()=>{A();$Be=se(HBe(),1);gr();qBe="Kafka",VBe=at(qBe,()=>new $Be.KafkaJsInstrumentation({consumerHook(e){zr(e,"auto.kafkajs.otel.consumer")},producerHook(e){zr(e,"auto.kafkajs.otel.producer")}})),ZSt=(()=>({name:qBe,setupOnce(){VBe()}})),YBe=ZSt});var JBe=F(Qv=>{"use strict";A();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.PACKAGE_NAME=Qv.PACKAGE_VERSION=void 0;Qv.PACKAGE_VERSION="0.58.0";Qv.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var eNe=F(E4=>{"use strict";A();Object.defineProperty(E4,"__esModule",{value:!0});E4.LruMemoizerInstrumentation=void 0;var ZBe=(ze(),Me(We)),WBe=on(),XBe=JBe(),iJ=class extends WBe.InstrumentationBase{constructor(t={}){super(XBe.PACKAGE_NAME,XBe.PACKAGE_VERSION,t)}init(){return[new WBe.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],t=>{let n=function(){let r=t.apply(this,arguments);return function(){let o=[...arguments],i=o.pop(),s=typeof i=="function"?ZBe.context.bind(ZBe.context.active(),i):i;return o.push(s),r.apply(this,o)}};return n.sync=t.sync,n},void 0)]}};E4.LruMemoizerInstrumentation=iJ});var tNe=F(y4=>{"use strict";A();Object.defineProperty(y4,"__esModule",{value:!0});y4.LruMemoizerInstrumentation=void 0;var WSt=eNe();Object.defineProperty(y4,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return WSt.LruMemoizerInstrumentation}})});var nNe,rNe,oNe,XSt,iNe,sNe=O(()=>{A();nNe=se(tNe(),1);gr();rNe="LruMemoizer",oNe=at(rNe,()=>new nNe.LruMemoizerInstrumentation),XSt=(()=>({name:rNe,setupOnce(){oNe()}})),iNe=XSt});var aNe=F(wo=>{"use strict";A();Object.defineProperty(wo,"__esModule",{value:!0});wo.METRIC_DB_CLIENT_CONNECTIONS_USAGE=wo.DB_SYSTEM_VALUE_MONGODB=wo.DB_SYSTEM_NAME_VALUE_MONGODB=wo.ATTR_NET_PEER_PORT=wo.ATTR_NET_PEER_NAME=wo.ATTR_DB_SYSTEM=wo.ATTR_DB_STATEMENT=wo.ATTR_DB_OPERATION=wo.ATTR_DB_NAME=wo.ATTR_DB_MONGODB_COLLECTION=wo.ATTR_DB_CONNECTION_STRING=void 0;wo.ATTR_DB_CONNECTION_STRING="db.connection_string";wo.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";wo.ATTR_DB_NAME="db.name";wo.ATTR_DB_OPERATION="db.operation";wo.ATTR_DB_STATEMENT="db.statement";wo.ATTR_DB_SYSTEM="db.system";wo.ATTR_NET_PEER_NAME="net.peer.name";wo.ATTR_NET_PEER_PORT="net.peer.port";wo.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";wo.DB_SYSTEM_VALUE_MONGODB="mongodb";wo.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var uNe=F(sO=>{"use strict";A();Object.defineProperty(sO,"__esModule",{value:!0});sO.MongodbCommandType=void 0;var eTt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.AGGREGATE="aggregate",e.UNKNOWN="unknown"})(eTt=sO.MongodbCommandType||(sO.MongodbCommandType={}))});var cNe=F(Fv=>{"use strict";A();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.PACKAGE_NAME=Fv.PACKAGE_VERSION=void 0;Fv.PACKAGE_VERSION="0.67.0";Fv.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var pNe=F(S4=>{"use strict";A();Object.defineProperty(S4,"__esModule",{value:!0});S4.MongoDBInstrumentation=void 0;var Zo=(ze(),Me(We)),or=on(),Ug=(Zn(),Me(Fr)),zl=aNe(),TS=uNe(),lNe=cNe(),dNe={requireParentSpan:!0},sJ=class e extends or.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(lNe.PACKAGE_NAME,lNe.PACKAGE_VERSION,{...dNe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,or.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,or.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...dNe,...t})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(zl.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:s,v4UnpatchConnection:c}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:l,v4UnpatchConnectionPool:f}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:h,v4UnpatchSessions:y}=this._getV4SessionsPatches();return[new or.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new or.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new or.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new or.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],i,c),new or.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],s,c),new or.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],l,f),new or.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new or.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],h,y)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>((0,or.isWrapped)(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",this._getV3PatchOperation("insert")),(0,or.isWrapped)(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",this._getV3PatchOperation("remove")),(0,or.isWrapped)(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",this._getV3PatchOperation("update")),(0,or.isWrapped)(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",this._getV3PatchCommand()),(0,or.isWrapped)(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",this._getV3PatchFind()),(0,or.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,or.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),this._wrap(t.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,or.isWrapped)(t.release)&&this._unwrap(t,"release"),this._wrap(t.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),t),v4UnpatchSessions:t=>{t!==void 0&&((0,or.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),(0,or.isWrapped)(t.release)&&this._unwrap(t,"release"))}}}_getV4AcquireCommand(){let t=this;return n=>function(){let o=this.sessions.length,i=n.call(this),s=this.sessions.length;return o===s?t._connCountAdd(1,t._poolName,"used"):o-1===s&&(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,or.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,or.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=Zo.context.bind(Zo.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 s=function(c,l){if(c||!l){i(c,l);return}t.setPoolName(o),i(c,l)};return n.call(this,o,s)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>((0,or.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandCallback()),t),v4PatchConnectionPromise:t=>((0,or.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,s,c,l,f){let h=Zo.trace.getSpan(Zo.context.active()),y=n._checkSkipInstrumentation(h),S=typeof l=="function"?l:f;if(y||typeof S!="function"||typeof c!="object")return typeof l=="function"?r.call(this,i,s,c,l):r.call(this,i,s,c,l,f);let b=n._getV3SpanAttributes(s,i,c[0],t),v=n._spanNameFromAttrs(b),x=n.tracer.startSpan(v,{kind:Zo.SpanKind.CLIENT,attributes:b}),D=n._patchEnd(x,S);return typeof l=="function"?r.call(this,i,s,c,D):r.call(this,i,s,c,l,D)}}_getV3PatchCommand(){let t=this;return n=>function(o,i,s,c,l){let f=Zo.trace.getSpan(Zo.context.active()),h=t._checkSkipInstrumentation(f),y=typeof c=="function"?c:l;if(h||typeof y!="function"||typeof s!="object")return typeof c=="function"?n.call(this,o,i,s,c):n.call(this,o,i,s,c,l);let S=e._getCommandType(s),b=S===TS.MongodbCommandType.UNKNOWN?void 0:S,v=t._getV3SpanAttributes(i,o,s,b),x=t._spanNameFromAttrs(v),D=t.tracer.startSpan(x,{kind:Zo.SpanKind.CLIENT,attributes:v}),k=t._patchEnd(D,y);return typeof c=="function"?n.call(this,o,i,s,k):n.call(this,o,i,s,c,k)}}_getV4PatchCommandCallback(){let t=this;return n=>function(o,i,s,c){let l=Zo.trace.getSpan(Zo.context.active()),f=t._checkSkipInstrumentation(l),h=c,y=Object.keys(i)[0];if(typeof i!="object"||i.ismaster||i.hello)return n.call(this,o,i,s,c);let S;if(!f){let v=t._getV4SpanAttributes(this,o,i,y),x=t._spanNameFromAttrs(v);S=t.tracer.startSpan(x,{kind:Zo.SpanKind.CLIENT,attributes:v})}let b=t._patchEnd(S,h,this.id,y);return n.call(this,o,i,s,b)}}_getV4PatchCommandPromise(){let t=this;return n=>function(...o){let[i,s]=o,c=Zo.trace.getSpan(Zo.context.active()),l=t._checkSkipInstrumentation(c),f=Object.keys(s)[0],h=()=>{};if(typeof s!="object"||s.ismaster||s.hello)return n.apply(this,o);let y;if(!l){let v=t._getV4SpanAttributes(this,i,s,f),x=t._spanNameFromAttrs(v);y=t.tracer.startSpan(x,{kind:Zo.SpanKind.CLIENT,attributes:v})}let S=t._patchEnd(y,h,this.id,f),b=n.apply(this,o);return b.then(v=>S(null,v),v=>S(v)),b}}_getV3PatchFind(){let t=this;return n=>function(o,i,s,c,l,f){let h=Zo.trace.getSpan(Zo.context.active()),y=t._checkSkipInstrumentation(h),S=typeof l=="function"?l:f;if(y||typeof S!="function"||typeof s!="object")return typeof l=="function"?n.call(this,o,i,s,c,l):n.call(this,o,i,s,c,l,f);let b=t._getV3SpanAttributes(i,o,s,"find"),v=t._spanNameFromAttrs(b),x=t.tracer.startSpan(v,{kind:Zo.SpanKind.CLIENT,attributes:b}),D=t._patchEnd(x,S);return typeof l=="function"?n.call(this,o,i,s,c,D):n.call(this,o,i,s,c,l,D)}}_getV3PatchCursor(){let t=this;return n=>function(o,i,s,c,l,f){let h=Zo.trace.getSpan(Zo.context.active()),y=t._checkSkipInstrumentation(h),S=typeof l=="function"?l:f;if(y||typeof S!="function")return typeof l=="function"?n.call(this,o,i,s,c,l):n.call(this,o,i,s,c,l,f);let b=t._getV3SpanAttributes(i,o,s.cmd,"getMore"),v=t._spanNameFromAttrs(b),x=t.tracer.startSpan(v,{kind:Zo.SpanKind.CLIENT,attributes:b}),D=t._patchEnd(x,S);return typeof l=="function"?n.call(this,o,i,s,c,D):n.call(this,o,i,s,c,l,D)}}static _getCommandType(t){return t.createIndexes!==void 0?TS.MongodbCommandType.CREATE_INDEXES:t.findandmodify!==void 0?TS.MongodbCommandType.FIND_AND_MODIFY:t.ismaster!==void 0?TS.MongodbCommandType.IS_MASTER:t.count!==void 0?TS.MongodbCommandType.COUNT:t.aggregate!==void 0?TS.MongodbCommandType.AGGREGATE:TS.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(t,n,r,o){let i,s;if(t){let l=typeof t.address=="string"?t.address.split(":"):"";l.length===2&&(i=l[0],s=l[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,s,c,o)}_getV3SpanAttributes(t,n,r,o){let i,s;if(n&&n.s&&(i=n.s.options?.host??n.s.host,s=(n.s.options?.port??n.s.port)?.toString(),i==null||s==null)){let h=n.description?.address;if(h){let y=h.split(":");i=y[0],s=y[1]}}let[c,l]=t.toString().split("."),f=r?.query??r?.q??r;return this._getSpanAttributes(c,l,i,s,f,o)}_getSpanAttributes(t,n,r,o,i,s){let c={};if(this._dbSemconvStability&or.SemconvStability.OLD&&(c[zl.ATTR_DB_SYSTEM]=zl.DB_SYSTEM_VALUE_MONGODB,c[zl.ATTR_DB_NAME]=t,c[zl.ATTR_DB_MONGODB_COLLECTION]=n,c[zl.ATTR_DB_OPERATION]=s,c[zl.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${t}`),this._dbSemconvStability&or.SemconvStability.STABLE&&(c[Ug.ATTR_DB_SYSTEM_NAME]=zl.DB_SYSTEM_NAME_VALUE_MONGODB,c[Ug.ATTR_DB_NAMESPACE]=t,c[Ug.ATTR_DB_OPERATION_NAME]=s,c[Ug.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&or.SemconvStability.OLD&&(c[zl.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&or.SemconvStability.STABLE&&(c[Ug.ATTR_SERVER_ADDRESS]=r);let l=parseInt(o,10);isNaN(l)||(this._netSemconvStability&or.SemconvStability.OLD&&(c[zl.ATTR_NET_PEER_PORT]=l),this._netSemconvStability&or.SemconvStability.STABLE&&(c[Ug.ATTR_SERVER_PORT]=l))}if(i){let{dbStatementSerializer:l}=this.getConfig(),f=typeof l=="function"?l:this._defaultDbStatementSerializer.bind(this);(0,or.safeExecuteInTheMiddle)(()=>{let h=f(i);this._dbSemconvStability&or.SemconvStability.OLD&&(c[zl.ATTR_DB_STATEMENT]=h),this._dbSemconvStability&or.SemconvStability.STABLE&&(c[Ug.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&or.SemconvStability.STABLE?n=[t[Ug.ATTR_DB_OPERATION_NAME],t[Ug.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||zl.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${t[zl.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,or.safeExecuteInTheMiddle)(()=>{r(t,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(t,n,r,o){let i=Zo.context.active(),s=this,c=!1;return function(...f){if(!c){c=!0;let h=f[0];if(t){if(h instanceof Error)t.setStatus({code:Zo.SpanStatusCode.ERROR,message:h.message});else{let y=f[1];s._handleExecutionResult(t,y)}t.end()}o==="endSessions"&&s._connCountAdd(-1,s._poolName,"idle")}return Zo.context.with(i,()=>n.apply(this,f))}}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}};S4.MongoDBInstrumentation=sJ});var fNe=F(aO=>{"use strict";A();Object.defineProperty(aO,"__esModule",{value:!0});aO.MongodbCommandType=void 0;var tTt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.UNKNOWN="unknown"})(tTt=aO.MongodbCommandType||(aO.MongodbCommandType={}))});var mNe=F(Gv=>{"use strict";A();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.MongodbCommandType=Gv.MongoDBInstrumentation=void 0;var nTt=pNe();Object.defineProperty(Gv,"MongoDBInstrumentation",{enumerable:!0,get:function(){return nTt.MongoDBInstrumentation}});var rTt=fNe();Object.defineProperty(Gv,"MongodbCommandType",{enumerable:!0,get:function(){return rTt.MongodbCommandType}})});function oTt(e){let t=aJ(e);return JSON.stringify(t)}function aJ(e){if(Array.isArray(e))return e.map(t=>aJ(t));if(iTt(e)){let t={};return Object.entries(e).map(([n,r])=>[n,aJ(r)]).reduce((n,r)=>(aTt(r)&&(n[r[0]]=r[1]),n),t)}return"?"}function iTt(e){return typeof e=="object"&&e!==null&&!sTt(e)}function sTt(e){let t=!1;return typeof Buffer<"u"&&(t=Buffer.isBuffer(e)),t}function aTt(e){return Array.isArray(e)}var ANe,gNe,hNe,uTt,_Ne,ENe=O(()=>{A();ANe=se(mNe(),1);gr();gNe="Mongo",hNe=at(gNe,()=>new ANe.MongoDBInstrumentation({dbStatementSerializer:oTt,responseHook(e){zr(e,"auto.db.otel.mongo")}}));uTt=(()=>({name:gNe,setupOnce(){hNe()}})),_Ne=uTt});var uJ=F(os=>{"use strict";A();Object.defineProperty(os,"__esModule",{value:!0});os.DB_SYSTEM_NAME_VALUE_MONGODB=os.ATTR_NET_PEER_PORT=os.ATTR_NET_PEER_NAME=os.ATTR_DB_USER=os.ATTR_DB_SYSTEM=os.ATTR_DB_STATEMENT=os.ATTR_DB_OPERATION=os.ATTR_DB_NAME=os.ATTR_DB_MONGODB_COLLECTION=void 0;os.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";os.ATTR_DB_NAME="db.name";os.ATTR_DB_OPERATION="db.operation";os.ATTR_DB_STATEMENT="db.statement";os.ATTR_DB_SYSTEM="db.system";os.ATTR_DB_USER="db.user";os.ATTR_NET_PEER_NAME="net.peer.name";os.ATTR_NET_PEER_PORT="net.peer.port";os.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var TNe=F(tE=>{"use strict";A();Object.defineProperty(tE,"__esModule",{value:!0});tE.handleCallbackResponse=tE.handlePromiseResponse=tE.getAttributesFromCollection=void 0;var yNe=(ze(),Me(We)),cO=on(),uO=uJ(),T4=(Zn(),Me(Fr));function cTt(e,t,n){let r={};return t&cO.SemconvStability.OLD&&(r[uO.ATTR_DB_MONGODB_COLLECTION]=e.name,r[uO.ATTR_DB_NAME]=e.conn.name,r[uO.ATTR_DB_USER]=e.conn.user),t&cO.SemconvStability.STABLE&&(r[T4.ATTR_DB_COLLECTION_NAME]=e.name,r[T4.ATTR_DB_NAMESPACE]=e.conn.name),n&cO.SemconvStability.OLD&&(r[uO.ATTR_NET_PEER_NAME]=e.conn.host,r[uO.ATTR_NET_PEER_PORT]=e.conn.port),n&cO.SemconvStability.STABLE&&(r[T4.ATTR_SERVER_ADDRESS]=e.conn.host,r[T4.ATTR_SERVER_PORT]=e.conn.port),r}tE.getAttributesFromCollection=cTt;function SNe(e,t={}){e.recordException(t),e.setStatus({code:yNe.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`
|
|
38
|
-
Mongoose Error Code: ${t.code}`:""}`})}function cJ(e,t,n,r=void 0){n&&(0,cO.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&yNe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function lTt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(cJ(t,o,n,r),o)).catch(o=>{throw SNe(t,o),o}).finally(()=>t.end()):(cJ(t,e,n,r),t.end(),e)}tE.handlePromiseResponse=lTt;function dTt(e,t,n,r,o,i,s=void 0){let c=0;return o.length===2?c=1:o.length===3&&(c=2),o[c]=(l,f)=>(l?SNe(r,l):cJ(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}tE.handleCallbackResponse=dTt});var INe=F(zv=>{"use strict";A();Object.defineProperty(zv,"__esModule",{value:!0});zv.PACKAGE_NAME=zv.PACKAGE_VERSION=void 0;zv.PACKAGE_VERSION="0.60.0";zv.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var xNe=F(Gc=>{"use strict";A();Object.defineProperty(Gc,"__esModule",{value:!0});Gc.MongooseInstrumentation=Gc._ALREADY_INSTRUMENTED=Gc._STORED_PARENT_SPAN=void 0;var vs=(ze(),Me(We)),pTt=br(),lJ=TNe(),Oa=on(),bNe=INe(),nE=uJ(),IS=(Zn(),Me(Fr)),I4=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],fTt=["remove","count","findOneAndRemove",...I4],mTt=["count","findOneAndRemove",...I4],ATt=[...I4];function CNe(e){return e?e.startsWith("6.")||e.startsWith("5.")?fTt:e.startsWith("7.")?mTt:ATt:I4}function vNe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function RNe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Gc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Gc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var dJ=class extends Oa.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(bNe.PACKAGE_NAME,bNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Oa.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Oa.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Oa.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,vNe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),RNe(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)),CNe(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=CNe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,vNe(n)&&this._unwrap(r.Model.prototype,"remove"),RNe(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&&vs.trace.getSpan(vs.context.active())===void 0)return r.apply(this,arguments);let s=this[Gc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Oa.SemconvStability.OLD&&(c[nE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Oa.SemconvStability.STABLE&&(c[IS.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",c,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Gc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return r.apply(this,arguments);let s=this[Gc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Oa.SemconvStability.OLD&&(c[nE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Oa.SemconvStability.STABLE&&(c[IS.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,c,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,c){if(r.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return o.apply(this,arguments);let l={document:this};s&&!(s instanceof Function)&&(l.options=s);let f={},{dbStatementSerializer:h}=r.getConfig();if(h){let S=h(t,l);r._dbSemconvStability&Oa.SemconvStability.OLD&&(f[nE.ATTR_DB_STATEMENT]=S),r._dbSemconvStability&Oa.SemconvStability.STABLE&&(f[IS.ATTR_DB_QUERY_TEXT]=S)}let y=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(c=s,s=void 0),r._handleResponse(y,o,this,arguments,c,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,c,l){if(r.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,y=c;typeof s=="function"?(f=s,h=void 0,y=void 0):typeof c=="function"&&(f=c,y=void 0);let S={},b=r.getConfig().dbStatementSerializer;if(b){let D=b(t,{condition:{_id:this._id},updates:h,options:y});r._dbSemconvStability&Oa.SemconvStability.OLD&&(S[nE.ATTR_DB_STATEMENT]=D),r._dbSemconvStability&Oa.SemconvStability.STABLE&&(S[IS.ATTR_DB_QUERY_TEXT]=D)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,S),x=r._handleResponse(v,o,this,arguments,f,n);return x&&typeof x=="object"&&(x[Gc._ALREADY_INSTRUMENTED]=!0),x}}patchModelStatic(t,n){let r=this;return o=>function(s,c,l){if(r.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return o.apply(this,arguments);typeof c=="function"&&(l=c,c=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}c!==void 0&&(f.options=c);let h={},{dbStatementSerializer:y}=r.getConfig();if(y){let b=y(t,f);r._dbSemconvStability&Oa.SemconvStability.OLD&&(h[nE.ATTR_DB_STATEMENT]=b),r._dbSemconvStability&Oa.SemconvStability.STABLE&&(h[IS.ATTR_DB_QUERY_TEXT]=b)}let S=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(S,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=vs.trace.getSpan(vs.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Gc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Gc._STORED_PARENT_SPAN]=vs.trace.getSpan(vs.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,lJ.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Oa.SemconvStability.OLD&&(s[nE.ATTR_DB_OPERATION]=r,s[nE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Oa.SemconvStability.STABLE&&(s[IS.ATTR_DB_OPERATION_NAME]=r,s[IS.ATTR_DB_SYSTEM_NAME]=nE.DB_SYSTEM_NAME_VALUE_MONGODB);let c=this._dbSemconvStability&Oa.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(c,{kind:vs.SpanKind.CLIENT,attributes:s},i?vs.trace.setSpan(vs.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let c=this;if(i instanceof Function)return c._callOriginalFunction(()=>(0,lJ.handleCallbackResponse)(i,n,r,t,o,c.getConfig().responseHook,s));{let l=c._callOriginalFunction(()=>n.apply(r,o));return(0,lJ.handlePromiseResponse)(l,t,c.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?vs.context.with((0,pTt.suppressTracing)(vs.context.active()),t):t()}};Gc.MongooseInstrumentation=dJ});var DNe=F(b4=>{"use strict";A();Object.defineProperty(b4,"__esModule",{value:!0});b4.MongooseInstrumentation=void 0;var gTt=xNe();Object.defineProperty(b4,"MongooseInstrumentation",{enumerable:!0,get:function(){return gTt.MongooseInstrumentation}})});var BNe,NNe,ONe,hTt,wNe,kNe=O(()=>{A();BNe=se(DNe(),1);gr();NNe="Mongoose",ONe=at(NNe,()=>new BNe.MongooseInstrumentation({responseHook(e){zr(e,"auto.db.otel.mongoose")}})),hTt=(()=>({name:NNe,setupOnce(){ONe()}})),wNe=hTt});var PNe=F(is=>{"use strict";A();Object.defineProperty(is,"__esModule",{value:!0});is.METRIC_DB_CLIENT_CONNECTIONS_USAGE=is.DB_SYSTEM_VALUE_MYSQL=is.ATTR_NET_PEER_PORT=is.ATTR_NET_PEER_NAME=is.ATTR_DB_USER=is.ATTR_DB_SYSTEM=is.ATTR_DB_STATEMENT=is.ATTR_DB_NAME=is.ATTR_DB_CONNECTION_STRING=void 0;is.ATTR_DB_CONNECTION_STRING="db.connection_string";is.ATTR_DB_NAME="db.name";is.ATTR_DB_STATEMENT="db.statement";is.ATTR_DB_SYSTEM="db.system";is.ATTR_DB_USER="db.user";is.ATTR_NET_PEER_NAME="net.peer.name";is.ATTR_NET_PEER_PORT="net.peer.port";is.DB_SYSTEM_VALUE_MYSQL="mysql";is.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var MNe=F(lO=>{"use strict";A();Object.defineProperty(lO,"__esModule",{value:!0});lO.AttributeNames=void 0;var _Tt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(_Tt=lO.AttributeNames||(lO.AttributeNames={}))});var LNe=F(su=>{"use strict";A();Object.defineProperty(su,"__esModule",{value:!0});su.getPoolNameOld=su.arrayStringifyHelper=su.getSpanName=su.getDbValues=su.getDbQueryText=su.getJDBCString=su.getConfig=void 0;function ETt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}su.getConfig=ETt;function yTt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}su.getJDBCString=yTt;function STt(e){return typeof e=="string"?e:e.sql}su.getDbQueryText=STt;function TTt(e,t){return pJ(typeof e=="string"?t:t||e.values)}su.getDbValues=TTt;function ITt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}su.getSpanName=ITt;function pJ(e){return e?`[${e.toString()}]`:""}su.arrayStringifyHelper=pJ;function bTt(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()}su.getPoolNameOld=bTt});var UNe=F(jv=>{"use strict";A();Object.defineProperty(jv,"__esModule",{value:!0});jv.PACKAGE_NAME=jv.PACKAGE_VERSION=void 0;jv.PACKAGE_VERSION="0.60.0";jv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var FNe=F(C4=>{"use strict";A();Object.defineProperty(C4,"__esModule",{value:!0});C4.MySQLInstrumentation=void 0;var zc=(ze(),Me(We)),Jd=on(),Hv=(Zn(),Me(Fr)),Qg=PNe(),CTt=MNe(),bS=LNe(),QNe=UNe(),fJ=class extends Jd.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(QNe.PACKAGE_NAME,QNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Jd.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Jd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Qg.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 Jd.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,Jd.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,Jd.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,Jd.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 s=t._allConnections.length,c=t._freeConnections.length,l=s-c,f=(0,bS.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-c,f,"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,s){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let c=t._nodes;if(c){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=c[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,c){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let l=r._getConnectionCallbackPatchFn(i);return n.call(t,l)}if(arguments.length===2&&typeof s=="function"){let l=r._getConnectionCallbackPatchFn(s);return n.call(t,i,l)}if(arguments.length===3&&typeof c=="function"){let l=r._getConnectionCallbackPatchFn(c);return n.call(t,i,s,l)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=zc.context.active();return function(o,i){i&&((0,Jd.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&zc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,s){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let c={},{host:l,port:f,database:h,user:y}=(0,bS.getConfig)(t.config),S=parseInt(f,10),b=(0,bS.getDbQueryText)(o);r._dbSemconvStability&Jd.SemconvStability.OLD&&(c[Qg.ATTR_DB_SYSTEM]=Qg.DB_SYSTEM_VALUE_MYSQL,c[Qg.ATTR_DB_CONNECTION_STRING]=(0,bS.getJDBCString)(l,f,h),c[Qg.ATTR_DB_NAME]=h,c[Qg.ATTR_DB_USER]=y,c[Qg.ATTR_DB_STATEMENT]=b),r._dbSemconvStability&Jd.SemconvStability.STABLE&&(c[Hv.ATTR_DB_SYSTEM_NAME]=Hv.DB_SYSTEM_NAME_VALUE_MYSQL,c[Hv.ATTR_DB_NAMESPACE]=h,c[Hv.ATTR_DB_QUERY_TEXT]=b),r._netSemconvStability&Jd.SemconvStability.OLD&&(c[Qg.ATTR_NET_PEER_NAME]=l,isNaN(S)||(c[Qg.ATTR_NET_PEER_PORT]=S)),r._netSemconvStability&Jd.SemconvStability.STABLE&&(c[Hv.ATTR_SERVER_ADDRESS]=l,isNaN(S)||(c[Hv.ATTR_SERVER_PORT]=S));let v=r.tracer.startSpan((0,bS.getSpanName)(o),{kind:zc.SpanKind.CLIENT,attributes:c});if(r.getConfig().enhancedDatabaseReporting){let k;Array.isArray(i)?k=i:arguments[2]&&(k=[i]),v.setAttribute(CTt.AttributeNames.MYSQL_VALUES,(0,bS.getDbValues)(o,k))}let x=Array.from(arguments).findIndex(k=>typeof k=="function"),D=zc.context.active();if(x===-1){let k=zc.context.with(zc.trace.setSpan(zc.context.active(),v),()=>n.apply(t,arguments));return zc.context.bind(D,k),k.on("error",Q=>v.setStatus({code:zc.SpanStatusCode.ERROR,message:Q.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,x,r._patchCallbackQuery(v,D)),zc.context.with(zc.trace.setSpan(zc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,s){return o&&t.setStatus({code:zc.SpanStatusCode.ERROR,message:o.message}),t.end(),zc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,bS.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")})}};C4.MySQLInstrumentation=fJ});var GNe=F(v4=>{"use strict";A();Object.defineProperty(v4,"__esModule",{value:!0});v4.MySQLInstrumentation=void 0;var vTt=FNe();Object.defineProperty(v4,"MySQLInstrumentation",{enumerable:!0,get:function(){return vTt.MySQLInstrumentation}})});var zNe,jNe,HNe,RTt,$Ne,qNe=O(()=>{A();zNe=se(GNe(),1);gr();jNe="Mysql",HNe=at(jNe,()=>new zNe.MySQLInstrumentation({})),RTt=(()=>({name:jNe,setupOnce(){HNe()}})),$Ne=RTt});var mJ=F(na=>{"use strict";A();Object.defineProperty(na,"__esModule",{value:!0});na.DB_SYSTEM_VALUE_MYSQL=na.ATTR_NET_PEER_PORT=na.ATTR_NET_PEER_NAME=na.ATTR_DB_USER=na.ATTR_DB_SYSTEM=na.ATTR_DB_STATEMENT=na.ATTR_DB_NAME=na.ATTR_DB_CONNECTION_STRING=void 0;na.ATTR_DB_CONNECTION_STRING="db.connection_string";na.ATTR_DB_NAME="db.name";na.ATTR_DB_STATEMENT="db.statement";na.ATTR_DB_SYSTEM="db.system";na.ATTR_DB_USER="db.user";na.ATTR_NET_PEER_NAME="net.peer.name";na.ATTR_NET_PEER_PORT="net.peer.port";na.DB_SYSTEM_VALUE_MYSQL="mysql"});var gJ=F(R4=>{"use strict";A();Object.defineProperty(R4,"__esModule",{value:!0});R4.addSqlCommenterComment=void 0;var AJ=(ze(),Me(We)),xTt=br();function DTt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function BTt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function NTt(e,t){if(typeof t!="string"||t.length===0||DTt(t))return t;let n=new xTt.W3CTraceContextPropagator,r={};n.inject(AJ.trace.setSpan(AJ.ROOT_CONTEXT,e),r,AJ.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let c=BTt(r[s]);return`${s}='${c}'`}).join(",");return`${t} /*${i}*/`}R4.addSqlCommenterComment=NTt});var VNe=F(Zd=>{"use strict";A();Object.defineProperty(Zd,"__esModule",{value:!0});Zd.getConnectionPrototypeToInstrument=Zd.once=Zd.getSpanName=Zd.getQueryText=Zd.getConnectionAttributes=void 0;var dO=mJ(),x4=on(),hJ=(Zn(),Me(Fr));function OTt(e,t,n){let{host:r,port:o,database:i,user:s}=wTt(e),c={};t&x4.SemconvStability.OLD&&(c[dO.ATTR_DB_CONNECTION_STRING]=kTt(r,o,i),c[dO.ATTR_DB_NAME]=i,c[dO.ATTR_DB_USER]=s),t&x4.SemconvStability.STABLE&&(c[hJ.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&x4.SemconvStability.OLD&&(c[dO.ATTR_NET_PEER_NAME]=r,isNaN(l)||(c[dO.ATTR_NET_PEER_PORT]=l)),n&x4.SemconvStability.STABLE&&(c[hJ.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(c[hJ.ATTR_SERVER_PORT]=l)),c}Zd.getConnectionAttributes=OTt;function wTt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function kTt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function PTt(e,t,n,r=!1,o=MTt){let[i,s]=typeof e=="string"?[e,n]:[e.sql,LTt(e)?n||e.values:n];try{return r?o(i):t&&s?t(i,s):i}catch{return"Could not determine the query due to an error in masking or formatting"}}Zd.getQueryText=PTt;function MTt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function LTt(e){return"values"in e}function UTt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}Zd.getSpanName=UTt;var QTt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};Zd.once=QTt;function FTt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}Zd.getConnectionPrototypeToInstrument=FTt});var YNe=F($v=>{"use strict";A();Object.defineProperty($v,"__esModule",{value:!0});$v.PACKAGE_NAME=$v.PACKAGE_VERSION=void 0;$v.PACKAGE_VERSION="0.60.0";$v.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var WNe=F(D4=>{"use strict";A();Object.defineProperty(D4,"__esModule",{value:!0});D4.MySQL2Instrumentation=void 0;var KNe=(ze(),Me(We)),Af=on(),_J=mJ(),JNe=gJ(),qv=VNe(),ZNe=YNe(),EJ=(Zn(),Me(Fr)),yJ=[">=1.4.2 <4"],SJ=class extends Af.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(ZNe.PACKAGE_NAME,ZNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Af.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Af.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,Af.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,Af.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 Af.InstrumentationNodeModuleDefinition("mysql2",yJ,i=>(n(i),i),()=>{},[new Af.InstrumentationNodeModuleFile("mysql2/promise.js",yJ,i=>(n(i),i),()=>{}),new Af.InstrumentationNodeModuleFile("mysql2/lib/connection.js",yJ,i=>{let s=(0,qv.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,qv.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,c){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:y}=o.getConfig(),S=(0,qv.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),b=(0,qv.getQueryText)(i,t,l,f,h);o._dbSemconvStability&Af.SemconvStability.OLD&&(S[_J.ATTR_DB_SYSTEM]=_J.DB_SYSTEM_VALUE_MYSQL,S[_J.ATTR_DB_STATEMENT]=b),o._dbSemconvStability&Af.SemconvStability.STABLE&&(S[EJ.ATTR_DB_SYSTEM_NAME]=EJ.DB_SYSTEM_NAME_VALUE_MYSQL,S[EJ.ATTR_DB_QUERY_TEXT]=b);let v=o.tracer.startSpan((0,qv.getSpanName)(i),{kind:KNe.SpanKind.CLIENT,attributes:S});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,JNe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,JNe.addSqlCommenterComment)(v,i.sql)}));let x=(0,qv.once)((D,k)=>{D?v.setStatus({code:KNe.SpanStatusCode.ERROR,message:D.message}):typeof y=="function"&&(0,Af.safeExecuteInTheMiddle)(()=>{y(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 D=r.apply(this,arguments);return D.once("error",k=>{x(k)}).once("result",k=>{x(void 0,k)}),D}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)}}};D4.MySQL2Instrumentation=SJ});var XNe=F(B4=>{"use strict";A();Object.defineProperty(B4,"__esModule",{value:!0});B4.MySQL2Instrumentation=void 0;var GTt=WNe();Object.defineProperty(B4,"MySQL2Instrumentation",{enumerable:!0,get:function(){return GTt.MySQL2Instrumentation}})});var eOe,tOe,nOe,zTt,rOe,oOe=O(()=>{A();eOe=se(XNe(),1);gr();tOe="Mysql2",nOe=at(tOe,()=>new eOe.MySQL2Instrumentation({responseHook(e){zr(e,"auto.db.otel.mysql2")}})),zTt=(()=>({name:tOe,setupOnce(){nOe()}})),rOe=zTt});var iOe=F(au=>{"use strict";A();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 sOe=F(N4=>{"use strict";A();Object.defineProperty(N4,"__esModule",{value:!0});N4.endSpan=void 0;var jTt=(ze(),Me(We)),HTt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:jTt.SpanStatusCode.ERROR,message:t.message})),e.end()};N4.endSpan=HTt});var w4=F(O4=>{"use strict";A();Object.defineProperty(O4,"__esModule",{value:!0});O4.defaultDbStatementSerializer=void 0;var $Tt=[{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}],qTt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=$Tt.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};O4.defaultDbStatementSerializer=qTt});var aOe=F(Vv=>{"use strict";A();Object.defineProperty(Vv,"__esModule",{value:!0});Vv.PACKAGE_NAME=Vv.PACKAGE_VERSION=void 0;Vv.PACKAGE_VERSION="0.62.0";Vv.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var dOe=F(k4=>{"use strict";A();Object.defineProperty(k4,"__esModule",{value:!0});k4.IORedisInstrumentation=void 0;var rE=(ze(),Me(We)),jc=on(),oE=(Zn(),Me(Fr)),Hc=iOe(),uOe=on(),pO=sOe(),VTt=w4(),cOe=aOe(),lOe={requireParentSpan:!0},TJ=class extends jc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(cOe.PACKAGE_NAME,cOe.PACKAGE_VERSION,{...lOe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,jc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,jc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...lOe,...t})}init(){return[new jc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,jc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,jc.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(),s=i.dbStatementSerializer||VTt.defaultDbStatementSerializer,c=rE.trace.getSpan(rE.context.active())===void 0;if(i.requireParentSpan===!0&&c)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,y=s(o.name,o.args);r._dbSemconvStability&jc.SemconvStability.OLD&&(l[Hc.ATTR_DB_SYSTEM]=Hc.DB_SYSTEM_VALUE_REDIS,l[Hc.ATTR_DB_STATEMENT]=y,l[Hc.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&jc.SemconvStability.STABLE&&(l[oE.ATTR_DB_SYSTEM_NAME]=Hc.DB_SYSTEM_NAME_VALUE_REDIS,l[oE.ATTR_DB_QUERY_TEXT]=y),r._netSemconvStability&jc.SemconvStability.OLD&&(l[Hc.ATTR_NET_PEER_NAME]=f,l[Hc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&jc.SemconvStability.STABLE&&(l[oE.ATTR_SERVER_ADDRESS]=f,l[oE.ATTR_SERVER_PORT]=h);let S=r.tracer.startSpan(o.name,{kind:rE.SpanKind.CLIENT,attributes:l}),{requestHook:b}=i;b&&(0,uOe.safeExecuteInTheMiddle)(()=>b(S,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&rE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),x=o.resolve;o.resolve=function(k){(0,uOe.safeExecuteInTheMiddle)(()=>i.responseHook?.(S,o.name,o.args,k),Q=>{Q&&rE.diag.error("ioredis instrumentation: response hook failed",Q)},!0),(0,pO.endSpan)(S,null),x(k)};let D=o.reject;return o.reject=function(k){(0,pO.endSpan)(S,k),D(k)},v}catch(v){throw(0,pO.endSpan)(S,v),v}}}_traceConnection(t){let n=this;return function(){let r=rE.trace.getSpan(rE.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:s}=this.options;n._dbSemconvStability&jc.SemconvStability.OLD&&(o[Hc.ATTR_DB_SYSTEM]=Hc.DB_SYSTEM_VALUE_REDIS,o[Hc.ATTR_DB_STATEMENT]="connect",o[Hc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&jc.SemconvStability.STABLE&&(o[oE.ATTR_DB_SYSTEM_NAME]=Hc.DB_SYSTEM_NAME_VALUE_REDIS,o[oE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&jc.SemconvStability.OLD&&(o[Hc.ATTR_NET_PEER_NAME]=i,o[Hc.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&jc.SemconvStability.STABLE&&(o[oE.ATTR_SERVER_ADDRESS]=i,o[oE.ATTR_SERVER_PORT]=s);let c=n.tracer.startSpan("connect",{kind:rE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,pO.endSpan)(c,null),l}catch(l){throw(0,pO.endSpan)(c,l),l}}}};k4.IORedisInstrumentation=TJ});var pOe=F(P4=>{"use strict";A();Object.defineProperty(P4,"__esModule",{value:!0});P4.IORedisInstrumentation=void 0;var YTt=dOe();Object.defineProperty(P4,"IORedisInstrumentation",{enumerable:!0,get:function(){return YTt.IORedisInstrumentation}})});var M4=F(Yv=>{"use strict";A();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.PACKAGE_NAME=Yv.PACKAGE_VERSION=void 0;Yv.PACKAGE_VERSION="0.62.0";Yv.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var fOe=F(iE=>{"use strict";A();Object.defineProperty(iE,"__esModule",{value:!0});iE.getTracedCreateStreamTrace=iE.getTracedCreateClient=iE.endSpan=void 0;var fO=(ze(),Me(We)),KTt=(e,t)=>{t&&e.setStatus({code:fO.SpanStatusCode.ERROR,message:t.message}),e.end()};iE.endSpan=KTt;var JTt=e=>function(){let n=e.apply(this,arguments);return fO.context.bind(fO.context.active(),n)};iE.getTracedCreateClient=JTt;var ZTt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){fO.context.bind(fO.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};iE.getTracedCreateStreamTrace=ZTt});var L4=F(uu=>{"use strict";A();Object.defineProperty(uu,"__esModule",{value:!0});uu.DB_SYSTEM_VALUE_REDIS=uu.DB_SYSTEM_NAME_VALUE_REDIS=uu.ATTR_NET_PEER_PORT=uu.ATTR_NET_PEER_NAME=uu.ATTR_DB_SYSTEM=uu.ATTR_DB_STATEMENT=uu.ATTR_DB_CONNECTION_STRING=void 0;uu.ATTR_DB_CONNECTION_STRING="db.connection_string";uu.ATTR_DB_STATEMENT="db.statement";uu.ATTR_DB_SYSTEM="db.system";uu.ATTR_NET_PEER_NAME="net.peer.name";uu.ATTR_NET_PEER_PORT="net.peer.port";uu.DB_SYSTEM_NAME_VALUE_REDIS="redis";uu.DB_SYSTEM_VALUE_REDIS="redis"});var AOe=F(Q4=>{"use strict";A();Object.defineProperty(Q4,"__esModule",{value:!0});Q4.RedisInstrumentationV2_V3=void 0;var jl=on(),U4=fOe(),mOe=M4(),mO=(ze(),Me(We)),AO=(Zn(),Me(Fr)),CS=L4(),WTt=w4(),IJ=class e extends jl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(mOe.PACKAGE_NAME,mOe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,jl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,jl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new jl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,jl.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,jl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,jl.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 s=t.getConfig(),c=mO.trace.getSpan(mO.context.active())===void 0;if(s.requireParentSpan===!0&&c)return r.apply(this,arguments);let l=s?.dbStatementSerializer||WTt.defaultDbStatementSerializer,f={};t._semconvStability&jl.SemconvStability.OLD&&Object.assign(f,{[CS.ATTR_DB_SYSTEM]:CS.DB_SYSTEM_VALUE_REDIS,[CS.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&jl.SemconvStability.STABLE&&Object.assign(f,{[AO.ATTR_DB_SYSTEM_NAME]:CS.DB_SYSTEM_NAME_VALUE_REDIS,[AO.ATTR_DB_OPERATION_NAME]:i.command,[AO.ATTR_DB_QUERY_TEXT]:l(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:mO.SpanKind.CLIENT,attributes:f});if(this.connection_options){let S={};t._semconvStability&jl.SemconvStability.OLD&&Object.assign(S,{[CS.ATTR_NET_PEER_NAME]:this.connection_options.host,[CS.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&jl.SemconvStability.STABLE&&Object.assign(S,{[AO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[AO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(S)}this.address&&t._semconvStability&jl.SemconvStability.OLD&&h.setAttribute(CS.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let y=arguments[0].callback;if(y){let S=mO.context.active();arguments[0].callback=function(v,x){if(s?.responseHook){let D=s.responseHook;(0,jl.safeExecuteInTheMiddle)(()=>{D(h,i.command,i.args,x)},k=>{k&&t._diag.error("Error executing responseHook",k)},!0)}return(0,U4.endSpan)(h,v),mO.context.with(S,y,this,...arguments)}}try{return r.apply(this,arguments)}catch(S){throw(0,U4.endSpan)(h,S),S}}}}_getPatchCreateClient(){return function(n){return(0,U4.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,U4.getTracedCreateStreamTrace)(n)}}};Q4.RedisInstrumentationV2_V3=IJ});var hOe=F(F4=>{"use strict";A();Object.defineProperty(F4,"__esModule",{value:!0});F4.getClientAttributes=void 0;var bJ=(Zn(),Me(Fr)),Kv=L4(),gOe=on();function XTt(e,t,n){let r={};return n&gOe.SemconvStability.OLD&&Object.assign(r,{[Kv.ATTR_DB_SYSTEM]:Kv.DB_SYSTEM_VALUE_REDIS,[Kv.ATTR_NET_PEER_NAME]:t?.socket?.host,[Kv.ATTR_NET_PEER_PORT]:t?.socket?.port,[Kv.ATTR_DB_CONNECTION_STRING]:eIt(e,t?.url)}),n&gOe.SemconvStability.STABLE&&Object.assign(r,{[bJ.ATTR_DB_SYSTEM_NAME]:Kv.DB_SYSTEM_NAME_VALUE_REDIS,[bJ.ATTR_SERVER_ADDRESS]:t?.socket?.host,[bJ.ATTR_SERVER_PORT]:t?.socket?.port}),r}F4.getClientAttributes=XTt;function eIt(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 SOe=F(G4=>{"use strict";A();Object.defineProperty(G4,"__esModule",{value:!0});G4.RedisInstrumentationV4_V5=void 0;var Wd=(ze(),Me(We)),Io=on(),_Oe=hOe(),tIt=w4(),EOe=M4(),CJ=(Zn(),Me(Fr)),nIt=L4(),gO=Symbol("opentelemetry.instrumentation.redis.open_spans"),yOe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),vJ=class e extends Io.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(EOe.PACKAGE_NAME,EOe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Io.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Io.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 Io.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let c=i.transformCommandArguments;if(!c)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Io.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(c)),i},i=>{(0,Io.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Io.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Io.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Io.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Io.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Io.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Io.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Io.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Io.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Io.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Io.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Io.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(s,"connect",this._getPatchedClientConnect()),i},i=>{let s=i?.default?.prototype;(0,Io.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Io.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Io.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Io.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(s){if(s?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let c=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(c,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let s=o.apply(this,arguments);return typeof s?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),s):s.then(c=>{let l=this[gO];return n._endSpansWithRedisReplies(l,c,t),c}).catch(c=>{let l=this[gO];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=c.constructor.name==="MultiErrorReply"?c.replies:new Array(l.length).fill(c);n._endSpansWithRedisReplies(l,f,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[yOe]=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,s=(0,_Oe.getClientAttributes)(t._diag,i,t._semconvStability),c=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:Wd.SpanKind.CLIENT,attributes:s});return Wd.context.with(Wd.trace.setSpan(Wd.context.active(),c),()=>r.apply(this)).then(f=>(c.end(),f)).catch(f=>(c.recordException(f),c.setStatus({code:Wd.SpanStatusCode.ERROR,message:f.message}),c.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(Wd.trace.getSpan(Wd.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[yOe],c=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||tIt.defaultDbStatementSerializer,h=(0,_Oe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Io.SemconvStability.STABLE&&(h[CJ.ATTR_DB_OPERATION_NAME]=c);try{let b=f(c,l);b!=null&&(this._semconvStability&Io.SemconvStability.OLD&&(h[nIt.ATTR_DB_STATEMENT]=b),this._semconvStability&Io.SemconvStability.STABLE&&(h[CJ.ATTR_DB_QUERY_TEXT]=b))}catch(b){this._diag.error("dbStatementSerializer throw an exception",b,{commandName:c})}let y=this.tracer.startSpan(`${e.COMPONENT}-${c}`,{kind:Wd.SpanKind.CLIENT,attributes:h}),S=Wd.context.with(Wd.trace.setSpan(Wd.context.active(),y),()=>t.apply(n,r));if(typeof S?.then=="function")S.then(b=>{this._endSpanWithResponse(y,c,l,b,void 0)},b=>{this._endSpanWithResponse(y,c,l,null,b)});else{let b=S;b[gO]=b[gO]||[],b[gO].push({span:y,commandName:c,commandArgs:l})}return S}_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),s=o.every(c=>c===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let c=0;c<t.length;c++){let{span:l,commandArgs:f}=t[c],h=n[c],[y,S]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Io.SemconvStability.STABLE&&l.setAttribute(CJ.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[c],f,y,S)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(c){this._diag.error("responseHook throw an exception",c)}i&&(t.recordException(i),t.setStatus({code:Wd.SpanStatusCode.ERROR,message:i?.message})),t.end()}};G4.RedisInstrumentationV4_V5=vJ});var bOe=F(z4=>{"use strict";A();Object.defineProperty(z4,"__esModule",{value:!0});z4.RedisInstrumentation=void 0;var rIt=on(),TOe=M4(),oIt=AOe(),iIt=SOe(),IOe={requireParentSpan:!1},RJ=class extends rIt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...IOe,...t};super(TOe.PACKAGE_NAME,TOe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new oIt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new iIt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...IOe,...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())}};z4.RedisInstrumentation=RJ});var COe=F(j4=>{"use strict";A();Object.defineProperty(j4,"__esModule",{value:!0});j4.RedisInstrumentation=void 0;var sIt=bOe();Object.defineProperty(j4,"RedisInstrumentation",{enumerable:!0,get:function(){return sIt.RedisInstrumentation}})});function hO(e,t){return e.includes(t.toLowerCase())}function DJ(e){return hO(xJ,e)?"cache.get":hO(uIt,e)?"cache.put":void 0}function cIt(e,t){return t.some(n=>e.startsWith(n))}function ROe(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)?vOe(o.map(i=>n(i))):["<unknown>"],r=t[0];return hO(aIt,e)&&r!=null?n(r):vOe(t.map(o=>n(o)))}catch{return}}function xOe(e,t,n){if(!DJ(e))return!1;for(let r of t)if(cIt(r,n))return!0;return!1}function DOe(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 vOe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var aIt,xJ,uIt,BOe=O(()=>{A();aIt=["get","set","setex"],xJ=["get","mget"],uIt=["set","setex"]});var NOe,OOe,H4,_O,wOe,lIt,dIt,kOe,pIt,POe,MOe=O(()=>{A();NOe=se(pOe(),1),OOe=se(COe(),1);dt();gr();BOe();H4="Redis",_O={},wOe=(e,t,n,r)=>{e.setAttribute(kt,"auto.db.otel.redis");let o=ROe(t,n),i=DJ(t);if(!o||!i||!_O.cachePrefixes||!xOe(t,o,_O.cachePrefixes))return;let s=Ot(e).data["net.peer.name"],c=Ot(e).data["net.peer.port"];c&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":c});let l=DOe(r);l&&e.setAttribute(wq,l),hO(xJ,t)&&l!==void 0&&e.setAttribute(Nq,l>0),e.setAttributes({[Xt]:i,[Oq]:o});let f=o.join(", ");e.updateName(_O.maxCacheKeyLength?y_(f,_O.maxCacheKeyLength):f)},lIt=at(`${H4}.IORedis`,()=>new NOe.IORedisInstrumentation({responseHook:wOe})),dIt=at(`${H4}.Redis`,()=>new OOe.RedisInstrumentation({responseHook:wOe})),kOe=Object.assign(()=>{lIt(),dIt()},{id:H4}),pIt=((e={})=>({name:H4,setupOnce(){_O=e,kOe()}})),POe=pIt});var LOe=F($4=>{"use strict";A();Object.defineProperty($4,"__esModule",{value:!0});$4.EVENT_LISTENERS_SET=void 0;$4.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var BJ=F(EO=>{"use strict";A();Object.defineProperty(EO,"__esModule",{value:!0});EO.AttributeNames=void 0;var fIt;(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"})(fIt=EO.AttributeNames||(EO.AttributeNames={}))});var NJ=F(Br=>{"use strict";A();Object.defineProperty(Br,"__esModule",{value:!0});Br.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Br.METRIC_DB_CLIENT_CONNECTION_COUNT=Br.DB_SYSTEM_VALUE_POSTGRESQL=Br.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Br.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Br.ATTR_NET_PEER_PORT=Br.ATTR_NET_PEER_NAME=Br.ATTR_DB_USER=Br.ATTR_DB_SYSTEM=Br.ATTR_DB_STATEMENT=Br.ATTR_DB_NAME=Br.ATTR_DB_CONNECTION_STRING=Br.ATTR_DB_CLIENT_CONNECTION_STATE=Br.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Br.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Br.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Br.ATTR_DB_CONNECTION_STRING="db.connection_string";Br.ATTR_DB_NAME="db.name";Br.ATTR_DB_STATEMENT="db.statement";Br.ATTR_DB_SYSTEM="db.system";Br.ATTR_DB_USER="db.user";Br.ATTR_NET_PEER_NAME="net.peer.name";Br.ATTR_NET_PEER_PORT="net.peer.port";Br.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Br.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Br.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Br.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Br.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var OJ=F(yO=>{"use strict";A();Object.defineProperty(yO,"__esModule",{value:!0});yO.SpanNames=void 0;var mIt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(mIt=yO.SpanNames||(yO.SpanNames={}))});var HOe=F(ir=>{"use strict";A();Object.defineProperty(ir,"__esModule",{value:!0});ir.sanitizedErrorMessage=ir.isObjectWithTextString=ir.getErrorMessage=ir.patchClientConnectCallback=ir.patchCallbackPGPool=ir.updateCounter=ir.getPoolName=ir.patchCallback=ir.handleExecutionResult=ir.handleConfigQuery=ir.shouldSkipInstrumentation=ir.getSemanticAttributesFromPoolConnection=ir.getSemanticAttributesFromConnection=ir.getConnectionString=ir.parseAndMaskConnectionString=ir.parseNormalizedOperationName=ir.getQuerySpanName=void 0;var sE=(ze(),Me(We)),q4=BJ(),Xd=(Zn(),Me(Fr)),Ai=NJ(),vS=on(),UOe=OJ();function QOe(e,t){if(!t)return UOe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:FOe(t.text);return`${UOe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}ir.getQuerySpanName=QOe;function FOe(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}ir.parseNormalizedOperationName=FOe;function GOe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}ir.parseAndMaskConnectionString=GOe;function wJ(e){if("connectionString"in e&&e.connectionString)return GOe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}ir.getConnectionString=wJ;function V4(e){if(Number.isInteger(e))return e}function zOe(e,t){let n={};return t&vS.SemconvStability.OLD&&(n={...n,[Ai.ATTR_DB_SYSTEM]:Ai.DB_SYSTEM_VALUE_POSTGRESQL,[Ai.ATTR_DB_NAME]:e.database,[Ai.ATTR_DB_CONNECTION_STRING]:wJ(e),[Ai.ATTR_DB_USER]:e.user,[Ai.ATTR_NET_PEER_NAME]:e.host,[Ai.ATTR_NET_PEER_PORT]:V4(e.port)}),t&vS.SemconvStability.STABLE&&(n={...n,[Xd.ATTR_DB_SYSTEM_NAME]:Xd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Xd.ATTR_DB_NAMESPACE]:e.namespace,[Xd.ATTR_SERVER_ADDRESS]:e.host,[Xd.ATTR_SERVER_PORT]:V4(e.port)}),n}ir.getSemanticAttributesFromConnection=zOe;function AIt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[q4.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[q4.AttributeNames.MAX_CLIENT]:e.maxClient};return t&vS.SemconvStability.OLD&&(r={...r,[Ai.ATTR_DB_SYSTEM]:Ai.DB_SYSTEM_VALUE_POSTGRESQL,[Ai.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[Ai.ATTR_DB_CONNECTION_STRING]:wJ(e),[Ai.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[Ai.ATTR_NET_PEER_PORT]:Number(n?.port)||V4(e.port),[Ai.ATTR_DB_USER]:n?.username??e.user}),t&vS.SemconvStability.STABLE&&(r={...r,[Xd.ATTR_DB_SYSTEM_NAME]:Xd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Xd.ATTR_DB_NAMESPACE]:e.namespace,[Xd.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[Xd.ATTR_SERVER_PORT]:Number(n?.port)||V4(e.port)}),r}ir.getSemanticAttributesFromPoolConnection=AIt;function gIt(e){return e.requireParentSpan===!0&&sE.trace.getSpan(sE.context.active())===void 0}ir.shouldSkipInstrumentation=gIt;function hIt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=QOe(i,r),c=e.startSpan(s,{kind:sE.SpanKind.CLIENT,attributes:zOe(o,n)});if(!r)return c;if(r.text&&(n&vS.SemconvStability.OLD&&c.setAttribute(Ai.ATTR_DB_STATEMENT,r.text),n&vS.SemconvStability.STABLE&&c.setAttribute(Xd.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let l=r.values.map(f=>f==null?"null":f instanceof Buffer?f.toString():typeof f=="object"?typeof f.toPostgres=="function"?f.toPostgres():JSON.stringify(f):f.toString());c.setAttribute(q4.AttributeNames.PG_VALUES,l)}catch(l){sE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&c.setAttribute(q4.AttributeNames.PG_PLAN,r.name),c}ir.handleConfigQuery=hIt;function jOe(e,t,n){typeof e.responseHook=="function"&&(0,vS.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&sE.diag.error("Error running response hook",r)},!0)}ir.handleExecutionResult=jOe;function _It(e,t,n,r,o){return function(s,c){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[Xd.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(Y4(s)),t.setStatus({code:sE.SpanStatusCode.ERROR,message:s.message})):jOe(e,t,c),o(),t.end(),n.call(this,s,c)}}ir.patchCallback=_It;function EIt(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()}ir.getPoolName=EIt;function yIt(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,c=t.idleCount,l=i-c;return n.add(l-o.used,{[Ai.ATTR_DB_CLIENT_CONNECTION_STATE]:Ai.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ai.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(c-o.idle,{[Ai.ATTR_DB_CLIENT_CONNECTION_STATE]:Ai.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ai.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[Ai.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:c,pending:s}}ir.updateCounter=yIt;function SIt(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(Y4(r)),e.setStatus({code:sE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}ir.patchCallbackPGPool=SIt;function TIt(e,t){return function(r){r&&(r instanceof Error&&e.recordException(Y4(r)),e.setStatus({code:sE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}ir.patchClientConnectCallback=TIt;function IIt(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}ir.getErrorMessage=IIt;function bIt(e){return typeof e=="object"&&typeof e?.text=="string"}ir.isObjectWithTextString=bIt;function Y4(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}ir.sanitizedErrorMessage=Y4});var $Oe=F(Jv=>{"use strict";A();Object.defineProperty(Jv,"__esModule",{value:!0});Jv.PACKAGE_NAME=Jv.PACKAGE_VERSION=void 0;Jv.PACKAGE_VERSION="0.66.0";Jv.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var ZOe=F(J4=>{"use strict";A();Object.defineProperty(J4,"__esModule",{value:!0});J4.PgInstrumentation=void 0;var qu=on(),Hr=(ze(),Me(We)),qOe=LOe(),Wo=HOe(),VOe=gJ(),YOe=$Oe(),KOe=OJ(),K4=br(),gf=(Zn(),Me(Fr)),SO=NJ();function Zv(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var kJ=class extends qu.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(YOe.PACKAGE_NAME,YOe.PACKAGE_VERSION,t),this._semconvStability=(0,qu.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(gf.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Hr.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 qu.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new qu.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new qu.InstrumentationNodeModuleDefinition("pg",t,c=>{let l=Zv(c);return this._patchPgClient(l.Client),c},c=>{let l=Zv(c);return this._unpatchPgClient(l.Client),c},[o,r]),s=new qu.InstrumentationNodeModuleDefinition("pg-pool",n,c=>{let l=Zv(c);return(0,qu.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},c=>{let l=Zv(c);(0,qu.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=Zv(t);return(0,qu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,qu.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=Zv(t);return(0,qu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,qu.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Wo.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(KOe.SpanNames.CONNECT,{kind:Hr.SpanKind.CLIENT,attributes:Wo.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Hr.trace.getSpan(Hr.context.active());o=Wo.patchClientConnectCallback(s,o),l&&(o=Hr.context.bind(Hr.context.active(),o))}let c=Hr.context.with(Hr.trace.setSpan(Hr.context.active(),s),()=>n.call(this,o));return JOe(s,c)}}recordOperationDuration(t,n){let r={},o=[gf.ATTR_DB_NAMESPACE,gf.ATTR_ERROR_TYPE,gf.ATTR_SERVER_PORT,gf.ATTR_SERVER_ADDRESS,gf.ATTR_DB_OPERATION_NAME];this._semconvStability&qu.SemconvStability.OLD&&o.push(SO.ATTR_DB_SYSTEM),this._semconvStability&qu.SemconvStability.STABLE&&o.push(gf.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,K4.hrTimeToMilliseconds)((0,K4.hrTimeDuration)(n,(0,K4.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Wo.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,K4.hrTime)(),s=o[0],c=typeof s=="string",l=Wo.isObjectWithTextString(s),f=c?{text:s,values:Array.isArray(o[1])?o[1]:void 0}:l?{...s,name:s.name,text:s.text,values:s.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[SO.ATTR_DB_SYSTEM]:SO.DB_SYSTEM_VALUE_POSTGRESQL,[gf.ATTR_DB_NAMESPACE]:this.database,[gf.ATTR_SERVER_PORT]:this.connectionParameters.port,[gf.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[gf.ATTR_DB_OPERATION_NAME]=Wo.parseNormalizedOperationName(f?.text));let y=()=>{t.recordOperationDuration(h,i)},S=t.getConfig(),b=Wo.handleConfigQuery.call(this,t.tracer,S,t._semconvStability,f);if(S.addSqlCommenterCommentToQueries&&(c?o[0]=(0,VOe.addSqlCommenterComment)(b,s):l&&!("name"in s)&&(o[0]={...s,text:(0,VOe.addSqlCommenterComment)(b,s.text)})),o.length>0){let D=Hr.trace.getSpan(Hr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Wo.patchCallback(S,b,o[o.length-1],h,y),D&&(o[o.length-1]=Hr.context.bind(Hr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let k=Wo.patchCallback(t.getConfig(),b,f.callback,h,y);D&&(k=Hr.context.bind(Hr.context.active(),k)),o[0].callback=k}}let{requestHook:v}=S;typeof v=="function"&&f&&(0,qu.safeExecuteInTheMiddle)(()=>{let{database:D,host:k,port:Q,user:z}=this.connectionParameters;v(b,{connection:{database:D,host:k,port:Q,user:z},query:{text:f.text,values:f.values,name:f.name}})},D=>{D&&t._diag.error("Error running query hook",D)},!0);let x;try{x=n.apply(this,o)}catch(D){throw D instanceof Error&&b.recordException(Wo.sanitizedErrorMessage(D)),b.setStatus({code:Hr.SpanStatusCode.ERROR,message:Wo.getErrorMessage(D)}),b.end(),D}return x instanceof Promise?x.then(D=>new Promise(k=>{Wo.handleExecutionResult(t.getConfig(),b,D),y(),b.end(),k(D)})).catch(D=>new Promise((k,Q)=>{D instanceof Error&&b.recordException(Wo.sanitizedErrorMessage(D)),b.setStatus({code:Hr.SpanStatusCode.ERROR,message:D.message}),y(),b.end(),Q(D)})):x})}_setPoolConnectEventListeners(t){if(t[qOe.EVENT_LISTENERS_SET])return;let n=Wo.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[qOe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Wo.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(KOe.SpanNames.POOL_CONNECT,{kind:Hr.SpanKind.CLIENT,attributes:Wo.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Hr.trace.getSpan(Hr.context.active());o=Wo.patchCallbackPGPool(s,o),l&&(o=Hr.context.bind(Hr.context.active(),o))}let c=Hr.context.with(Hr.trace.setSpan(Hr.context.active(),s),()=>n.call(this,o));return JOe(s,c)}}};J4.PgInstrumentation=kJ;function JOe(e,t){if(!(t instanceof Promise))return t;let n=t;return Hr.context.bind(Hr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(Wo.sanitizedErrorMessage(r)),e.setStatus({code:Hr.SpanStatusCode.ERROR,message:Wo.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var WOe=F(Wv=>{"use strict";A();Object.defineProperty(Wv,"__esModule",{value:!0});Wv.AttributeNames=Wv.PgInstrumentation=void 0;var CIt=ZOe();Object.defineProperty(Wv,"PgInstrumentation",{enumerable:!0,get:function(){return CIt.PgInstrumentation}});var vIt=BJ();Object.defineProperty(Wv,"AttributeNames",{enumerable:!0,get:function(){return vIt.AttributeNames}})});var XOe,ewe,twe,RIt,nwe,rwe=O(()=>{A();XOe=se(WOe(),1);gr();ewe="Postgres",twe=at(ewe,XOe.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){zr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),RIt=(e=>({name:ewe,setupOnce(){twe(e)}})),nwe=RIt});var aE,MJ,owe,xIt,DIt,iwe,PJ,BIt,swe,awe=O(()=>{A();ze();aE=se(on(),1);Zn();dt();gr();gS();MJ="PostgresJs",owe=[">=3.0.0 <4"],xIt=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,DIt=Symbol.for("sentry.query.from.instrumented.sql"),iwe=at(MJ,e=>new PJ({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),PJ=class extends aE.InstrumentationBase{constructor(t){super("sentry-postgres-js",Wn,t)}init(){let t=new aE.InstrumentationNodeModuleDefinition("postgres",owe,n=>{try{return this._patchPostgres(n)}catch(r){return bs&&J.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new aE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,owe,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 bs&&J.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let c=Reflect.construct(r,s);if(!c||typeof c!="function")return bs&&J.warn("postgres() did not return a valid instance"),c;let l=o.getConfig();return PV(c,{requireParentSpan:l.requireParentSpan,requestHook:l.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let c=Object.getOwnPropertyDescriptor(r,s);c&&Object.defineProperty(i,s,c)}return n?i:(gN(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return $t.getSpan(Ke.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(oC,r);return}let o=n?.match(xIt);o?.[1]&&t.setAttribute(oC,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[DIt])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return Ws({name:s||"postgresjs.query",op:"db"},c=>{zr(c,"auto.db.postgresjs"),c.setAttributes({[Py]:"postgres",[V9]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,aE.safeExecuteInTheMiddle)(()=>f(c,s,void 0),S=>{S&&(c.setAttribute("sentry.hook.error","requestHook failed"),bs&&J.error(`Error in requestHook for ${MJ} integration:`,S))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(S,b,v)=>{try{n._setOperationName(c,s,v?.[0]?.command),c.end()}catch(x){bs&&J.error("Error ending span in resolve callback:",x)}return Reflect.apply(S,b,v)}});let y=this.reject;this.reject=new Proxy(y,{apply:(S,b,v)=>{try{c.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),c.setAttribute(Y9,v?.[0]?.code||"unknown"),c.setAttribute(K9,v?.[0]?.name||"unknown"),n._setOperationName(c,s),c.end()}catch(x){bs&&J.error("Error ending span in reject callback:",x)}return Reflect.apply(S,b,v)}});try{return r.apply(this,o)}catch(S){throw c.setStatus({code:2,message:S instanceof Error?S.message:"unknown_error"}),c.end(),S}})},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}},BIt=(e=>({name:MJ,setupOnce(){iwe(e)}})),swe=BIt});var uwe=F(TO=>{"use strict";A();Object.defineProperty(TO,"__esModule",{value:!0});TO.SeverityNumber=void 0;var NIt;(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"})(NIt=TO.SeverityNumber||(TO.SeverityNumber={}))});var W4=F(Xv=>{"use strict";A();Object.defineProperty(Xv,"__esModule",{value:!0});Xv.NOOP_LOGGER=Xv.NoopLogger=void 0;var Z4=class{emit(t){}};Xv.NoopLogger=Z4;Xv.NOOP_LOGGER=new Z4});var e3=F(eR=>{"use strict";A();Object.defineProperty(eR,"__esModule",{value:!0});eR.NOOP_LOGGER_PROVIDER=eR.NoopLoggerProvider=void 0;var OIt=W4(),X4=class{getLogger(t,n,r){return new OIt.NoopLogger}};eR.NoopLoggerProvider=X4;eR.NOOP_LOGGER_PROVIDER=new X4});var UJ=F(t3=>{"use strict";A();Object.defineProperty(t3,"__esModule",{value:!0});t3.ProxyLogger=void 0;var wIt=W4(),LJ=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):wIt.NOOP_LOGGER}};t3.ProxyLogger=LJ});var FJ=F(n3=>{"use strict";A();Object.defineProperty(n3,"__esModule",{value:!0});n3.ProxyLoggerProvider=void 0;var kIt=e3(),PIt=UJ(),QJ=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new PIt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:kIt.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)}};n3.ProxyLoggerProvider=QJ});var cwe=F(r3=>{"use strict";A();Object.defineProperty(r3,"__esModule",{value:!0});r3._globalThis=void 0;r3._globalThis=typeof globalThis=="object"?globalThis:global});var lwe=F(o3=>{"use strict";A();Object.defineProperty(o3,"__esModule",{value:!0});o3._globalThis=void 0;var MIt=cwe();Object.defineProperty(o3,"_globalThis",{enumerable:!0,get:function(){return MIt._globalThis}})});var dwe=F(i3=>{"use strict";A();Object.defineProperty(i3,"__esModule",{value:!0});i3._globalThis=void 0;var LIt=lwe();Object.defineProperty(i3,"_globalThis",{enumerable:!0,get:function(){return LIt._globalThis}})});var pwe=F(Hm=>{"use strict";A();Object.defineProperty(Hm,"__esModule",{value:!0});Hm.API_BACKWARDS_COMPATIBILITY_VERSION=Hm.makeGetter=Hm._global=Hm.GLOBAL_LOGS_API_KEY=void 0;var UIt=dwe();Hm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Hm._global=UIt._globalThis;function QIt(e,t,n){return r=>r===e?t:n}Hm.makeGetter=QIt;Hm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var mwe=F(s3=>{"use strict";A();Object.defineProperty(s3,"__esModule",{value:!0});s3.LogsAPI=void 0;var ep=pwe(),FIt=e3(),fwe=FJ(),GJ=class e{constructor(){this._proxyLoggerProvider=new fwe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return ep._global[ep.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(ep._global[ep.GLOBAL_LOGS_API_KEY]=(0,ep.makeGetter)(ep.API_BACKWARDS_COMPATIBILITY_VERSION,t,FIt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=ep._global[ep.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(ep._global,ep.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete ep._global[ep.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new fwe.ProxyLoggerProvider}};s3.LogsAPI=GJ});var zJ=F(ra=>{"use strict";A();Object.defineProperty(ra,"__esModule",{value:!0});ra.logs=ra.ProxyLoggerProvider=ra.ProxyLogger=ra.NoopLoggerProvider=ra.NOOP_LOGGER_PROVIDER=ra.NoopLogger=ra.NOOP_LOGGER=ra.SeverityNumber=void 0;var GIt=uwe();Object.defineProperty(ra,"SeverityNumber",{enumerable:!0,get:function(){return GIt.SeverityNumber}});var Awe=W4();Object.defineProperty(ra,"NOOP_LOGGER",{enumerable:!0,get:function(){return Awe.NOOP_LOGGER}});Object.defineProperty(ra,"NoopLogger",{enumerable:!0,get:function(){return Awe.NoopLogger}});var gwe=e3();Object.defineProperty(ra,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return gwe.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ra,"NoopLoggerProvider",{enumerable:!0,get:function(){return gwe.NoopLoggerProvider}});var zIt=UJ();Object.defineProperty(ra,"ProxyLogger",{enumerable:!0,get:function(){return zIt.ProxyLogger}});var jIt=FJ();Object.defineProperty(ra,"ProxyLoggerProvider",{enumerable:!0,get:function(){return jIt.ProxyLoggerProvider}});var HIt=mwe();ra.logs=HIt.LogsAPI.getInstance()});var hwe=F(tR=>{"use strict";A();Object.defineProperty(tR,"__esModule",{value:!0});tR.disableInstrumentations=tR.enableInstrumentations=void 0;function $It(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}tR.enableInstrumentations=$It;function qIt(e){e.forEach(t=>t.disable())}tR.disableInstrumentations=qIt});var ywe=F(a3=>{"use strict";A();Object.defineProperty(a3,"__esModule",{value:!0});a3.registerInstrumentations=void 0;var _we=(ze(),Me(We)),VIt=zJ(),Ewe=hwe();function YIt(e){let t=e.tracerProvider||_we.trace.getTracerProvider(),n=e.meterProvider||_we.metrics.getMeterProvider(),r=e.loggerProvider||VIt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Ewe.enableInstrumentations)(o,t,n,r),()=>{(0,Ewe.disableInstrumentations)(o)}}a3.registerInstrumentations=YIt});var Dwe=F(u3=>{"use strict";A();Object.defineProperty(u3,"__esModule",{value:!0});u3.satisfies=void 0;var qJ=(ze(),Me(We)),Cwe=/^(?: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-]+)*))?$/,KIt=/^(?<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-]+)*))?$/,JIt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function ZIt(e,t,n){if(!WIt(e))return qJ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=nbt(e);if(!r)return!1;let o=[],i=vwe(r,t,o,n);return i&&!n?.includePrerelease?ebt(r,o):i}u3.satisfies=ZIt;function WIt(e){return typeof e=="string"&&Cwe.test(e)}function vwe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(jJ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=Ibt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!jJ(e,i,n,r))return!1;return!0}return jJ(e,t,n,r)}function jJ(e,t,n,r){if(t=tbt(t,r),t.includes(" "))return vwe(e,t,n,r);{let o=rbt(t);return n.push(o),XIt(e,o)}}function XIt(e,t){if(t.invalid)return!1;if(!t.version||$J(t.version))return!0;let n=Twe(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=Twe(r,o)}return JIt[t.op]?.includes(n)}function ebt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function tbt(e,t){return e=e.trim(),e=Sbt(e,t),e=ybt(e),e=Tbt(e,t),e=e.trim(),e}function Vu(e){return!e||e.toLowerCase()==="x"||e==="*"}function nbt(e){let t=e.match(Cwe);if(!t){qJ.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function rbt(e){if(!e)return{};let t=e.match(KIt);if(!t)return qJ.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function $J(e){return e==="*"||e==="x"||e==="X"}function Swe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function obt(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 ibt(e,t){if($J(e)||$J(t))return 0;let[n,r]=obt(Swe(e),Swe(t));return n>r?1:n<r?-1:0}function Twe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=ibt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var Rwe="[a-zA-Z0-9-]",xwe="0|[1-9]\\d*",sbt=`\\d*[a-zA-Z-]${Rwe}*`,abt="((?:<|>)?=?)",Iwe=`(?:${xwe}|${sbt})`,ubt=`(?:-(${Iwe}(?:\\.${Iwe})*))`,bwe=`${Rwe}+`,cbt=`(?:\\+(${bwe}(?:\\.${bwe})*))`,HJ=`${xwe}|x|X|\\*`,IO=`[v=\\s]*(${HJ})(?:\\.(${HJ})(?:\\.(${HJ})(?:${ubt})?${cbt}?)?)?`,lbt=`^${abt}\\s*${IO}$`,dbt=new RegExp(lbt),pbt=`^\\s*(${IO})\\s+-\\s+(${IO})\\s*$`,fbt=new RegExp(pbt),mbt="(?:~>?)",Abt=`^${mbt}${IO}$`,gbt=new RegExp(Abt),hbt="(?:\\^)",_bt=`^${hbt}${IO}$`,Ebt=new RegExp(_bt);function ybt(e){let t=gbt;return e.replace(t,(n,r,o,i,s)=>{let c;return Vu(r)?c="":Vu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Vu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?c=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function Sbt(e,t){let n=Ebt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,c,l)=>{let f;return Vu(i)?f="":Vu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Vu(c)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${c}-${l} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${c}${r} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c} <${+i+1}.0.0-0`,f})}function Tbt(e,t){let n=dbt;return e.replace(n,(r,o,i,s,c,l)=>{let f=Vu(i),h=f||Vu(s),y=h||Vu(c),S=y;return o==="="&&S&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&S?(h&&(s=0),c=0,o===">"?(o=">=",h?(i=+i+1,s=0,c=0):(s=+s+1,c=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${c}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:y&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function Ibt(e,t){let n=fbt;return e.replace(n,(r,o,i,s,c,l,f,h,y,S,b,v)=>(Vu(i)?o="":Vu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Vu(c)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Vu(y)?h="":Vu(S)?h=`<${+y+1}.0.0-0`:Vu(b)?h=`<${y}.${+S+1}.0-0`:v?h=`<=${y}.${S}.${b}-${v}`:t?.includePrerelease?h=`<${y}.${S}.${+b+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var VJ=F(wa=>{"use strict";A();Object.defineProperty(wa,"__esModule",{value:!0});wa.massUnwrap=wa.unwrap=wa.massWrap=wa.wrap=void 0;var Yu=console.error.bind(console);function bO(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 bbt=(e,t,n)=>{if(!e||!e[t]){Yu("no original function "+String(t)+" to wrap");return}if(!n){Yu("no wrapper function"),Yu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){Yu("original object and wrapper must be functions");return}let o=n(r,t);return bO(o,"__original",r),bO(o,"__unwrap",()=>{e[t]===o&&bO(e,t,r)}),bO(o,"__wrapped",!0),bO(e,t,o),o};wa.wrap=bbt;var Cbt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Yu("must provide one or more modules to patch"),Yu(new Error().stack);return}if(!(t&&Array.isArray(t))){Yu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,wa.wrap)(r,o,n)})})};wa.massWrap=Cbt;var vbt=(e,t)=>{if(!e||!e[t]){Yu("no function to unwrap."),Yu(new Error().stack);return}let n=e[t];if(!n.__unwrap)Yu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};wa.unwrap=vbt;var Rbt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Yu("must provide one or more modules to patch"),Yu(new Error().stack);return}if(!(t&&Array.isArray(t))){Yu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,wa.unwrap)(n,r)})})};wa.massUnwrap=Rbt;function CO(e){e&&e.logger&&(typeof e.logger!="function"?Yu("new logger isn't a function, not replacing"):Yu=e.logger)}wa.default=CO;CO.wrap=wa.wrap;CO.massWrap=wa.massWrap;CO.unwrap=wa.unwrap;CO.massUnwrap=wa.massUnwrap});var Bwe=F(l3=>{"use strict";A();Object.defineProperty(l3,"__esModule",{value:!0});l3.InstrumentationAbstract=void 0;var YJ=(ze(),Me(We)),xbt=zJ(),c3=VJ(),KJ=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=YJ.diag.createComponentLogger({namespace:t}),this._tracer=YJ.trace.getTracer(t,n),this._meter=YJ.metrics.getMeter(t,n),this._logger=xbt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=c3.wrap;_unwrap=c3.unwrap;_massWrap=c3.massWrap;_massUnwrap=c3.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)}}};l3.InstrumentationAbstract=KJ});var Nwe=F(uE=>{"use strict";A();Object.defineProperty(uE,"__esModule",{value:!0});uE.ModuleNameTrie=uE.ModuleNameSeparator=void 0;uE.ModuleNameSeparator="/";var d3=class{hooks=[];children=new Map},JJ=class{_trie=new d3;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(uE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new d3,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=[],s=!0;for(let c of t.split(uE.ModuleNameSeparator)){let l=o.children.get(c);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,l)=>c.insertedId-l.insertedId),i.map(({hook:c})=>c))}};uE.ModuleNameTrie=JJ});var wwe=F(p3=>{"use strict";A();Object.defineProperty(p3,"__esModule",{value:!0});p3.RequireInTheMiddleSingleton=void 0;var Dbt=Gy(),Owe=Fe("path"),ZJ=Nwe(),Bbt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),WJ=class e{_moduleNameTrie=new ZJ.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new Dbt.Hook(null,{internals:!0},(t,n,r)=>{let o=Nbt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return Bbt?new e:this._instance=this._instance??new e}};p3.RequireInTheMiddleSingleton=WJ;function Nbt(e){return Owe.sep!==ZJ.ModuleNameSeparator?e.split(Owe.sep).join(ZJ.ModuleNameSeparator):e}});var XJ=F(cE=>{"use strict";A();Object.defineProperty(cE,"__esModule",{value:!0});cE.isWrapped=cE.safeExecuteInTheMiddleAsync=cE.safeExecuteInTheMiddle=void 0;function Obt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}cE.safeExecuteInTheMiddle=Obt;async function wbt(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}}cE.safeExecuteInTheMiddleAsync=wbt;function kbt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}cE.isWrapped=kbt});var Mwe=F(f3=>{"use strict";A();Object.defineProperty(f3,"__esModule",{value:!0});f3.InstrumentationBase=void 0;var vO=Fe("path"),kwe=Fe("util"),Pbt=Dwe(),eZ=VJ(),Mbt=Bwe(),Lbt=wwe(),Ubt=kK(),RO=(ze(),Me(We)),Qbt=Gy(),Fbt=Fe("fs"),Gbt=XJ(),tZ=class extends Mbt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=Lbt.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,Gbt.isWrapped)(t[n])&&this._unwrap(t,n),kwe.types.isProxy(t)){let o=(0,eZ.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,eZ.wrap)(t,n,r)};_unwrap=(t,n)=>kwe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,eZ.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.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{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.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=Fe.resolve(n);Fe.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,Fbt.readFileSync)(vO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{RO.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 Pwe(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 s=t.files??[],c=vO.normalize(r);return s.filter(f=>f.name===c).filter(f=>Pwe(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,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(f,t.moduleVersion)):f),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,c,l)=>{if(!l&&vO.isAbsolute(c)){let f=vO.parse(c);c=f.name,l=f.dir}return this._onRequire(t,s,c,l)},r=(s,c,l)=>this._onRequire(t,s,c,l),o=vO.isAbsolute(t.name)?new Qbt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new Ubt.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}};f3.InstrumentationBase=tZ;function Pwe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,Pbt.satisfies)(t,r,{includePrerelease:n}))}});var Lwe=F(m3=>{"use strict";A();Object.defineProperty(m3,"__esModule",{value:!0});m3.normalize=void 0;var zbt=Fe("path");Object.defineProperty(m3,"normalize",{enumerable:!0,get:function(){return zbt.normalize}})});var Uwe=F(nR=>{"use strict";A();Object.defineProperty(nR,"__esModule",{value:!0});nR.normalize=nR.InstrumentationBase=void 0;var jbt=Mwe();Object.defineProperty(nR,"InstrumentationBase",{enumerable:!0,get:function(){return jbt.InstrumentationBase}});var Hbt=Lwe();Object.defineProperty(nR,"normalize",{enumerable:!0,get:function(){return Hbt.normalize}})});var nZ=F(rR=>{"use strict";A();Object.defineProperty(rR,"__esModule",{value:!0});rR.normalize=rR.InstrumentationBase=void 0;var Qwe=Uwe();Object.defineProperty(rR,"InstrumentationBase",{enumerable:!0,get:function(){return Qwe.InstrumentationBase}});Object.defineProperty(rR,"normalize",{enumerable:!0,get:function(){return Qwe.normalize}})});var Fwe=F(A3=>{"use strict";A();Object.defineProperty(A3,"__esModule",{value:!0});A3.InstrumentationNodeModuleDefinition=void 0;var rZ=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||[]}};A3.InstrumentationNodeModuleDefinition=rZ});var Gwe=F(g3=>{"use strict";A();Object.defineProperty(g3,"__esModule",{value:!0});g3.InstrumentationNodeModuleFile=void 0;var $bt=nZ(),oZ=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,$bt.normalize)(t)}};g3.InstrumentationNodeModuleFile=oZ});var zwe=F(RS=>{"use strict";A();Object.defineProperty(RS,"__esModule",{value:!0});RS.semconvStabilityFromStr=RS.SemconvStability=void 0;var h3;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(h3=RS.SemconvStability||(RS.SemconvStability={}));function qbt(e,t){let n=h3.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=h3.DUPLICATE;break}else o.toLowerCase()===e&&(n=h3.STABLE);return n}RS.semconvStabilityFromStr=qbt});var Hwe=F(ss=>{"use strict";A();Object.defineProperty(ss,"__esModule",{value:!0});ss.semconvStabilityFromStr=ss.SemconvStability=ss.safeExecuteInTheMiddleAsync=ss.safeExecuteInTheMiddle=ss.isWrapped=ss.InstrumentationNodeModuleFile=ss.InstrumentationNodeModuleDefinition=ss.InstrumentationBase=ss.registerInstrumentations=void 0;var Vbt=ywe();Object.defineProperty(ss,"registerInstrumentations",{enumerable:!0,get:function(){return Vbt.registerInstrumentations}});var Ybt=nZ();Object.defineProperty(ss,"InstrumentationBase",{enumerable:!0,get:function(){return Ybt.InstrumentationBase}});var Kbt=Fwe();Object.defineProperty(ss,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return Kbt.InstrumentationNodeModuleDefinition}});var Jbt=Gwe();Object.defineProperty(ss,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return Jbt.InstrumentationNodeModuleFile}});var iZ=XJ();Object.defineProperty(ss,"isWrapped",{enumerable:!0,get:function(){return iZ.isWrapped}});Object.defineProperty(ss,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return iZ.safeExecuteInTheMiddle}});Object.defineProperty(ss,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return iZ.safeExecuteInTheMiddleAsync}});var jwe=zwe();Object.defineProperty(ss,"SemconvStability",{enumerable:!0,get:function(){return jwe.SemconvStability}});Object.defineProperty(ss,"semconvStabilityFromStr",{enumerable:!0,get:function(){return jwe.semconvStabilityFromStr}})});function Xbt(){let e=oR[aZ];return e?.helper?e.helper:oR[sZ]?.helper}function eCt(e){let t={helper:e};oR[aZ]=t,oR[sZ]=t}function tCt(){delete oR[aZ],delete oR[sZ]}function oCt(e){return e==="client"?co.CLIENT:co.INTERNAL}function Vwe(e,t,n,r,o){if(Ywe(t.name,o))return;let i={attributes:t.attributes,kind:oCt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,s=>{r.set(t.id,s.spanContext().spanId),t.links&&s.addLinks(t.links.flatMap(l=>{let f=r.get(l);return f?{context:{spanId:f,traceId:s.spanContext().traceId,traceFlags:s.spanContext().traceFlags}}:[]}));let c=n.filter(l=>l.parentId===t.id);for(let l of c)Vwe(e,l,n,r,o);s.end(t.endTime)})}function $we(e,t){return sCt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function sCt(e){return e!=null&&typeof e.then=="function"}function Ywe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var _3,Zbt,Wbt,sZ,aZ,oR,nCt,rCt,iCt,Kwe,qwe,aCt,uCt,Jwe,Zwe=O(()=>{A();ze();_3=se(Hwe(),1);ze();Zbt={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"}},Wbt=Zbt.version.split(".")[0],sZ="PRISMA_INSTRUMENTATION",aZ=`V${Wbt}_PRISMA_INSTRUMENTATION`,oR=globalThis;nCt=process.env.PRISMA_SHOW_ALL_TRACES==="true",rCt="00-10-10-00";iCt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=$t.getSpanContext(e??Ke.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:rCt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)Vwe(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return Ke.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!nCt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(Ywe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return $we(i,t(i,r))}return n.startActiveSpan(o,e,i=>$we(i,t(i,r)))}};Kwe={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},qwe=Kwe.version,aCt=Kwe.name,uCt="@prisma/client",Jwe=class extends _3.InstrumentationBase{tracerProvider;constructor(e={}){super(aCt,qwe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new _3.InstrumentationNodeModuleDefinition(uCt,[qwe])]}enable(){let e=this._config;eCt(new iCt({tracerProvider:this.tracerProvider??$t.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){tCt()}isEnabled(){return Xbt()!==void 0}}});function cCt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function Xwe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function lCt(e){return e==="client"?co.CLIENT:co.INTERNAL}var Wwe,uZ,dCt,eke,tke=O(()=>{A();ze();Zwe();dt();gr();Wwe="Prisma";uZ=class extends Jwe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=Xwe();cCt(t)&&(t.createEngineSpan=n=>{let r=$t.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Ko(()=>{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 s=lCt(i.kind),c=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(S=>({context:{traceId:S.trace_id,spanId:S.span_id,traceFlags:Ja.SAMPLED}})),y=$t.setSpanContext(Ke.active(),{traceId:f,spanId:c,traceFlags:Ja.SAMPLED});Ke.with(y,()=>{let S={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=S,r.startSpan(i.name,{kind:s,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};dCt=at(Wwe,e=>new uZ(e)),eke=e=>({name:Wwe,setupOnce(){dCt(e)},setup(t){Xwe()&&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 nke=F(iR=>{"use strict";A();Object.defineProperty(iR,"__esModule",{value:!0});iR.PACKAGE_NAME=iR.PACKAGE_VERSION=void 0;iR.PACKAGE_VERSION="0.60.0";iR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var cZ=F($m=>{"use strict";A();Object.defineProperty($m,"__esModule",{value:!0});$m.HapiLifecycleMethodNames=$m.HapiLayerType=$m.handlerPatched=$m.HapiComponentName=void 0;$m.HapiComponentName="@hapi/hapi";$m.handlerPatched=Symbol("hapi-handler-patched");$m.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};$m.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var rke=F(E3=>{"use strict";A();Object.defineProperty(E3,"__esModule",{value:!0});E3.ATTR_HTTP_METHOD=void 0;E3.ATTR_HTTP_METHOD="http.method"});var lZ=F(xO=>{"use strict";A();Object.defineProperty(xO,"__esModule",{value:!0});xO.AttributeNames=void 0;var pCt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(pCt=xO.AttributeNames||(xO.AttributeNames={}))});var ske=F(as=>{"use strict";A();Object.defineProperty(as,"__esModule",{value:!0});as.getPluginFromInput=as.getExtMetadata=as.getRouteMetadata=as.isPatchableExtMethod=as.isDirectExtInput=as.isLifecycleExtEventObj=as.isLifecycleExtType=as.getPluginName=void 0;var oke=(Zn(),Me(Fr)),fCt=rke(),DO=cZ(),lE=lZ(),ike=on();function mCt(e){return e.name?e.name:e.pkg.name}as.getPluginName=mCt;var ACt=e=>typeof e=="string"&&DO.HapiLifecycleMethodNames.has(e);as.isLifecycleExtType=ACt;var gCt=e=>{let t=e?.type;return t!==void 0&&(0,as.isLifecycleExtType)(t)};as.isLifecycleExtEventObj=gCt;var hCt=e=>Array.isArray(e)&&e.length<=3&&(0,as.isLifecycleExtType)(e[0])&&typeof e[1]=="function";as.isDirectExtInput=hCt;var _Ct=e=>!Array.isArray(e);as.isPatchableExtMethod=_Ct;var ECt=(e,t,n)=>{let r={[oke.ATTR_HTTP_ROUTE]:e.path};t&ike.SemconvStability.OLD&&(r[fCt.ATTR_HTTP_METHOD]=e.method),t&ike.SemconvStability.STABLE&&(r[oke.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[lE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.PLUGIN,r[lE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[lE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};as.getRouteMetadata=ECt;var yCt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[lE.AttributeNames.EXT_TYPE]:e,[lE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT,[lE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[lE.AttributeNames.EXT_TYPE]:e,[lE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT},name:r}};as.getExtMetadata=yCt;var SCt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;as.getPluginFromInput=SCt});var cke=F(y3=>{"use strict";A();Object.defineProperty(y3,"__esModule",{value:!0});y3.HapiInstrumentation=void 0;var Hl=(ze(),Me(We)),ake=br(),BO=on(),uke=nke(),NO=cZ(),Fg=ske(),dZ=class extends BO.InstrumentationBase{_semconvStability;constructor(t={}){super(uke.PACKAGE_NAME,uke.PACKAGE_VERSION,t),this._semconvStability=(0,BO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new BO.InstrumentationNodeModuleDefinition(NO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,BO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,BO.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 s=t.apply(this,[i]);return r._wrap(s,"route",c=>n._getServerRoutePatch.bind(n)(c)),r._wrap(s,"ext",c=>n._getServerExtPatch.bind(n)(c)),r._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let s of o){let c=(0,Fg.getPluginFromInput)(s);n._wrapRegisterHandler(c)}else{let s=(0,Fg.getPluginFromInput)(o);n._wrapRegisterHandler(s)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let s=i[0];for(let c=0;c<s.length;c++){let l=s[c];if((0,Fg.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[c]=f}}return t.apply(this,i)}else if((0,Fg.isDirectExtInput)(i)){let s=i,c=s[1],l=r._wrapExtMethods(c,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,Fg.isLifecycleExtEventObj)(i[0])){let s=i[0],c=r._wrapExtMethods(s.method,s.type,n);return s.method=c,t.call(this,s)}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 s=r._wrapRouteHandler.call(r,o[i],n);o[i]=s}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Fg.getPluginName)(t),o=t.register,i=this,s=function(c,l){return i._wrap(c,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(c,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,c,l)};t.register=s}_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,Fg.isPatchableExtMethod)(t))return t[NO.handlerPatched]===!0?t:(t[NO.handlerPatched]=!0,async function(...s){if(Hl.trace.getSpan(Hl.context.active())===void 0)return await t.apply(this,s);let c=(0,Fg.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Hl.context.with(Hl.trace.setSpan(Hl.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:Hl.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[NO.handlerPatched]===!0)return t;t[NO.handlerPatched]=!0;let o=i=>async function(...s){if(Hl.trace.getSpan(Hl.context.active())===void 0)return await i.call(this,...s);let c=(0,ake.getRPCMetadata)(Hl.context.active());c?.type===ake.RPCType.HTTP&&(c.route=t.path);let l=(0,Fg.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await Hl.context.with(Hl.trace.setSpan(Hl.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:Hl.SpanStatusCode.ERROR,message:h.message}),h}finally{f.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(s){let c=i(s);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}};y3.HapiInstrumentation=dZ});var lke=F(sR=>{"use strict";A();Object.defineProperty(sR,"__esModule",{value:!0});sR.AttributeNames=sR.HapiInstrumentation=void 0;var TCt=cke();Object.defineProperty(sR,"HapiInstrumentation",{enumerable:!0,get:function(){return TCt.HapiInstrumentation}});var ICt=lZ();Object.defineProperty(sR,"AttributeNames",{enumerable:!0,get:function(){return ICt.AttributeNames}})});var dke,pke,fke,bCt,mke,Ake=O(()=>{A();dke=se(lke(),1);gr();pke="Hapi",fke=at(pke,()=>new dke.HapiInstrumentation),bCt=(()=>({name:pke,setupOnce(){fke()}})),mke=bCt});var dE,OO,pZ=O(()=>{A();dE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},OO={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var T3,CCt,vCt,S3,gke=O(()=>{A();ze();T3=se(on(),1);dt();pZ();CCt="@sentry/instrumentation-hono",vCt="0.0.1",S3=class extends T3.InstrumentationBase{constructor(t={}){super(CCt,vCt,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 s=o.slice(1);return n.apply(this,[i,...s.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(s=>t._wrapHandler(s))])}}}_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 s=o.slice(1);return n.apply(this,[i,...s.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,s=n.tracer.startSpan(i);return Ke.with($t.setSpan(Ke.active(),s),()=>n._safeExecute(()=>{let c=t.apply(this,[r,o]);if(ba(c))return c.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[dE.HONO_TYPE]:f,[dE.HONO_NAME]:f===OO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(c);return s.setAttributes({[dE.HONO_TYPE]:l,[dE.HONO_NAME]:l===OO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),c}},()=>s.end(),c=>{n._handleError(s,c),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return ba(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?OO.MIDDLEWARE:OO.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:di.ERROR,message:n.message}),t.recordException(n))}}});function RCt(e){let t=Ot(e).data,n=t[dE.HONO_TYPE];if(t[Xt]||!n)return;e.setAttributes({[kt]:"auto.http.otel.hono",[Xt]:`${n}.hono`});let r=t[dE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),vn()===Qd()){bs&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[fg],i=t[My];typeof o=="string"&&typeof i=="string"&&vn().setTransactionName(`${i} ${o}`)}var hke,_ke,xCt,Eke,yke=O(()=>{A();Zn();dt();gr();gS();pZ();gke();hke="Hono";_ke=at(hke,()=>new S3({responseHook:e=>{RCt(e)}})),xCt=(()=>({name:hke,setupOnce(){_ke()}})),Eke=xCt});var I3=F(wO=>{"use strict";A();Object.defineProperty(wO,"__esModule",{value:!0});wO.KoaLayerType=void 0;var DCt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(DCt=wO.KoaLayerType||(wO.KoaLayerType={}))});var Ske=F(aR=>{"use strict";A();Object.defineProperty(aR,"__esModule",{value:!0});aR.PACKAGE_NAME=aR.PACKAGE_VERSION=void 0;aR.PACKAGE_VERSION="0.62.0";aR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var fZ=F(kO=>{"use strict";A();Object.defineProperty(kO,"__esModule",{value:!0});kO.AttributeNames=void 0;var BCt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(BCt=kO.AttributeNames||(kO.AttributeNames={}))});var Ike=F(uR=>{"use strict";A();Object.defineProperty(uR,"__esModule",{value:!0});uR.isLayerIgnored=uR.getMiddlewareMetadata=void 0;var Tke=I3(),b3=fZ(),NCt=(Zn(),Me(Fr)),OCt=(e,t,n,r)=>n?{attributes:{[b3.AttributeNames.KOA_NAME]:r?.toString(),[b3.AttributeNames.KOA_TYPE]:Tke.KoaLayerType.ROUTER,[NCt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[b3.AttributeNames.KOA_NAME]:t.name??"middleware",[b3.AttributeNames.KOA_TYPE]:Tke.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};uR.getMiddlewareMetadata=OCt;var wCt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));uR.isLayerIgnored=wCt});var bke=F(C3=>{"use strict";A();Object.defineProperty(C3,"__esModule",{value:!0});C3.kLayerPatched=void 0;C3.kLayerPatched=Symbol("koa-layer-patched")});var Bke=F(v3=>{"use strict";A();Object.defineProperty(v3,"__esModule",{value:!0});v3.KoaInstrumentation=void 0;var qm=(ze(),Me(We)),PO=on(),Cke=I3(),vke=Ske(),Rke=Ike(),xke=br(),Dke=bke(),mZ=class extends PO.InstrumentationBase{constructor(t={}){super(vke.PACKAGE_NAME,vke.PACKAGE_VERSION,t)}init(){return new PO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,PO.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,PO.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){qm.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,s=o.stack;for(let c=0;c<s.length;c++){let l=s[c];s[c]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?Cke.KoaLayerType.ROUTER:Cke.KoaLayerType.MIDDLEWARE;return t[Dke.kLayerPatched]===!0||(0,Rke.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(qm.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[Dke.kLayerPatched]=!0,qm.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(qm.trace.getSpan(qm.context.active())===void 0)return t(i,s);let l=(0,Rke.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,xke.getRPCMetadata)(qm.context.active());h?.type===xke.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:y}=this.getConfig();y&&(0,PO.safeExecuteInTheMiddle)(()=>y(f,{context:i,middlewareLayer:t,layerType:o}),b=>{b&&qm.diag.error("koa instrumentation: request hook failed",b)},!0);let S=qm.trace.setSpan(qm.context.active(),f);return qm.context.with(S,async()=>{try{return await t(i,s)}catch(b){throw f.recordException(b),b}finally{f.end()}})})}};v3.KoaInstrumentation=mZ});var Nke=F(pE=>{"use strict";A();Object.defineProperty(pE,"__esModule",{value:!0});pE.KoaLayerType=pE.AttributeNames=pE.KoaInstrumentation=void 0;var kCt=Bke();Object.defineProperty(pE,"KoaInstrumentation",{enumerable:!0,get:function(){return kCt.KoaInstrumentation}});var PCt=fZ();Object.defineProperty(pE,"AttributeNames",{enumerable:!0,get:function(){return PCt.AttributeNames}});var MCt=I3();Object.defineProperty(pE,"KoaLayerType",{enumerable:!0,get:function(){return MCt.KoaLayerType}})});var Oke,wke,kke,LCt,Pke,Mke=O(()=>{A();Oke=se(Nke(),1);Zn();dt();gr();gS();wke="Koa",kke=at(wke,Oke.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){zr(t,"auto.http.otel.koa");let r=Ot(t).data,o=r["koa.type"];o&&t.setAttribute(Xt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),vn()===Qd()){bs&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[fg],c=n.context?.request?.method?.toUpperCase()||"GET";s&&vn().setTransactionName(`${c} ${s}`)}})),LCt=((e={})=>({name:wke,setupOnce(){kke(e)}})),Pke=LCt});var AZ=F(hf=>{"use strict";A();Object.defineProperty(hf,"__esModule",{value:!0});hf.ConnectNames=hf.ConnectTypes=hf.AttributeNames=void 0;var UCt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(UCt=hf.AttributeNames||(hf.AttributeNames={}));var QCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(QCt=hf.ConnectTypes||(hf.ConnectTypes={}));var FCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(FCt=hf.ConnectNames||(hf.ConnectNames={}))});var Lke=F(cR=>{"use strict";A();Object.defineProperty(cR,"__esModule",{value:!0});cR.PACKAGE_NAME=cR.PACKAGE_VERSION=void 0;cR.PACKAGE_VERSION="0.57.0";cR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Uke=F(R3=>{"use strict";A();Object.defineProperty(R3,"__esModule",{value:!0});R3._LAYERS_STORE_PROPERTY=void 0;R3._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Qke=F(mE=>{"use strict";A();Object.defineProperty(mE,"__esModule",{value:!0});mE.generateRoute=mE.replaceCurrentStackRoute=mE.addNewStackLayer=void 0;var GCt=(ze(),Me(We)),fE=Uke(),zCt=e=>{Array.isArray(e[fE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,fE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[fE._LAYERS_STORE_PROPERTY].push("/");let t=e[fE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[fE._LAYERS_STORE_PROPERTY].length?e[fE._LAYERS_STORE_PROPERTY].pop():GCt.diag.warn("Connect: Trying to pop the stack multiple time")}};mE.addNewStackLayer=zCt;var jCt=(e,t)=>{t&&e[fE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};mE.replaceCurrentStackRoute=jCt;var HCt=e=>e[fE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);mE.generateRoute=HCt});var zke=F(AE=>{"use strict";A();Object.defineProperty(AE,"__esModule",{value:!0});AE.ConnectInstrumentation=AE.ANONYMOUS_NAME=void 0;var $Ct=(ze(),Me(We)),Fke=br(),lR=AZ(),Gke=Lke(),x3=on(),qCt=(Zn(),Me(Fr)),gZ=Qke();AE.ANONYMOUS_NAME="anonymous";var hZ=class extends x3.InstrumentationBase{constructor(t={}){super(Gke.PACKAGE_NAME,Gke.PACKAGE_VERSION,t)}init(){return[new x3.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,x3.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,x3.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=lR.ConnectTypes.REQUEST_HANDLER,i=lR.ConnectNames.REQUEST_HANDLER,o=t):(r=lR.ConnectTypes.MIDDLEWARE,i=lR.ConnectNames.MIDDLEWARE,o=n.name||AE.ANONYMOUS_NAME);let s=`${i} - ${o}`,c={attributes:{[qCt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[lR.AttributeNames.CONNECT_TYPE]:r,[lR.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,c)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,c,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[c],y=arguments[l];(0,gZ.replaceCurrentStackRoute)(f,t);let S=(0,Fke.getRPCMetadata)($Ct.context.active());t&&S?.type===Fke.RPCType.HTTP&&(S.route=(0,gZ.generateRoute)(f));let b="";t?b=`request handler - ${t}`:b=`middleware - ${n.name||AE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",b);let x=!1;function D(){x?r._diag.debug(`span ${v.name} - already finished`):(x=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",D)}return h.addListener("close",D),arguments[l]=r._patchNext(y,D),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],s=arguments[o],c=(0,gZ.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,c)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};AE.ConnectInstrumentation=hZ});var Hke=F(tp=>{"use strict";A();Object.defineProperty(tp,"__esModule",{value:!0});tp.ConnectTypes=tp.ConnectNames=tp.AttributeNames=tp.ANONYMOUS_NAME=tp.ConnectInstrumentation=void 0;var jke=zke();Object.defineProperty(tp,"ConnectInstrumentation",{enumerable:!0,get:function(){return jke.ConnectInstrumentation}});Object.defineProperty(tp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return jke.ANONYMOUS_NAME}});var _Z=AZ();Object.defineProperty(tp,"AttributeNames",{enumerable:!0,get:function(){return _Z.AttributeNames}});Object.defineProperty(tp,"ConnectNames",{enumerable:!0,get:function(){return _Z.ConnectNames}});Object.defineProperty(tp,"ConnectTypes",{enumerable:!0,get:function(){return _Z.ConnectTypes}})});var $ke,qke,Vke,VCt,Yke,Kke=O(()=>{A();$ke=se(Hke(),1);gr();qke="Connect",Vke=at(qke,()=>new $ke.ConnectInstrumentation),VCt=(()=>({name:qke,setupOnce(){Vke()}})),Yke=VCt});var Jke=F(oa=>{"use strict";A();Object.defineProperty(oa,"__esModule",{value:!0});oa.DB_SYSTEM_VALUE_MSSQL=oa.ATTR_NET_PEER_PORT=oa.ATTR_NET_PEER_NAME=oa.ATTR_DB_USER=oa.ATTR_DB_SYSTEM=oa.ATTR_DB_STATEMENT=oa.ATTR_DB_SQL_TABLE=oa.ATTR_DB_NAME=void 0;oa.ATTR_DB_NAME="db.name";oa.ATTR_DB_SQL_TABLE="db.sql.table";oa.ATTR_DB_STATEMENT="db.statement";oa.ATTR_DB_SYSTEM="db.system";oa.ATTR_DB_USER="db.user";oa.ATTR_NET_PEER_NAME="net.peer.name";oa.ATTR_NET_PEER_PORT="net.peer.port";oa.DB_SYSTEM_VALUE_MSSQL="mssql"});var Zke=F(dR=>{"use strict";A();Object.defineProperty(dR,"__esModule",{value:!0});dR.once=dR.getSpanName=void 0;function YCt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}dR.getSpanName=YCt;var KCt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};dR.once=KCt});var Wke=F(pR=>{"use strict";A();Object.defineProperty(pR,"__esModule",{value:!0});pR.PACKAGE_NAME=pR.PACKAGE_VERSION=void 0;pR.PACKAGE_VERSION="0.33.0";pR.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var rPe=F(hE=>{"use strict";A();Object.defineProperty(hE,"__esModule",{value:!0});hE.TediousInstrumentation=hE.INJECTED_CTX=void 0;var fR=(ze(),Me(We)),JCt=Fe("events"),Vm=on(),xS=(Zn(),Me(Fr)),gE=Jke(),Xke=Zke(),ePe=Wke(),nPe=Symbol("opentelemetry.instrumentation-tedious.current-database");hE.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var tPe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function D3(e){Object.defineProperty(this,nPe,{value:e,writable:!0})}var EZ=class e extends Vm.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(ePe.PACKAGE_NAME,ePe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Vm.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Vm.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Vm.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of tPe)(0,Vm.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,Vm.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 tPe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return D3.call(this,this.config?.options?.database),this.removeListener("databaseChange",D3),this.on("databaseChange",D3),this.once("end",()=>{this.removeListener("databaseChange",D3)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||fR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",s=new n.Request(i,l=>{o()});Object.defineProperty(s,hE.INJECTED_CTX,{value:!0});let c=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,c,{length:c.length}),t.execSql(s)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(s){if(s?.[hE.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof JCt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let c=0,l=0,f=()=>l++,h=()=>c++,y=this[nPe],S=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),b={};o._dbSemconvStability&Vm.SemconvStability.OLD&&(b[gE.ATTR_DB_SYSTEM]=gE.DB_SYSTEM_VALUE_MSSQL,b[gE.ATTR_DB_NAME]=y,b[gE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,b[gE.ATTR_DB_STATEMENT]=S,b[gE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&Vm.SemconvStability.STABLE&&(b[xS.ATTR_DB_NAMESPACE]=y,b[xS.ATTR_DB_SYSTEM_NAME]=xS.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,b[xS.ATTR_DB_QUERY_TEXT]=S,b[xS.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&Vm.SemconvStability.OLD&&(b[gE.ATTR_NET_PEER_NAME]=this.config?.server,b[gE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&Vm.SemconvStability.STABLE&&(b[xS.ATTR_SERVER_ADDRESS]=this.config?.server,b[xS.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,Xke.getSpanName)(t,y,S,s.table),{kind:fR.SpanKind.CLIENT,attributes:b}),x=(0,Xke.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",x),this.removeListener("end",x),v.setAttribute("tedious.procedure_count",c),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:fR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",x),this.on("end",x),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(x)):o._diag.error("Expected request.callback to be a function");let D=()=>fR.context.with(fR.trace.setSpan(fR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return D();let z=o._buildTraceparent(v);o._injectContextInfo(this,n,z).finally(D)}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)}}};hE.TediousInstrumentation=EZ});var oPe=F(B3=>{"use strict";A();Object.defineProperty(B3,"__esModule",{value:!0});B3.TediousInstrumentation=void 0;var ZCt=rPe();Object.defineProperty(B3,"TediousInstrumentation",{enumerable:!0,get:function(){return ZCt.TediousInstrumentation}})});var iPe,WCt,sPe,aPe,XCt,uPe,cPe=O(()=>{A();iPe=se(oPe(),1);dt();gr();WCt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),sPe="Tedious",aPe=at(sPe,()=>new iPe.TediousInstrumentation({})),XCt=(()=>{let e;return{name:sPe,setupOnce(){let t=aPe();e=_N(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]||"";WCt.has(i)&&n.setAttribute(kt,"auto.db.otel.tedious")}))}}}),uPe=XCt});var lPe=F(mR=>{"use strict";A();Object.defineProperty(mR,"__esModule",{value:!0});mR.PACKAGE_NAME=mR.PACKAGE_VERSION=void 0;mR.PACKAGE_VERSION="0.57.0";mR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var pPe=F(N3=>{"use strict";A();Object.defineProperty(N3,"__esModule",{value:!0});N3.GenericPoolInstrumentation=void 0;var AR=(ze(),Me(We)),DS=on(),dPe=lPe(),yZ="generic-pool",SZ=class extends DS.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(dPe.PACKAGE_NAME,dPe.PACKAGE_VERSION,t)}init(){return[new DS.InstrumentationNodeModuleDefinition(yZ,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,DS.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 DS.InstrumentationNodeModuleDefinition(yZ,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,DS.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 DS.InstrumentationNodeModuleDefinition(yZ,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,DS.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=AR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return AR.context.with(AR.trace.setSpan(i,s),()=>t.call(this,...o).then(c=>(s.end(),c),c=>{throw s.recordException(c),s.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 s=AR.context.active(),c=n.tracer.startSpan("generic-pool.acquire",{},s);return AR.context.with(AR.trace.setSpan(s,c),()=>{t.call(this,(l,f)=>{if(c.end(),o)return o(l,f)},i)})}}};N3.GenericPoolInstrumentation=SZ});var fPe=F(O3=>{"use strict";A();Object.defineProperty(O3,"__esModule",{value:!0});O3.GenericPoolInstrumentation=void 0;var evt=pPe();Object.defineProperty(O3,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return evt.GenericPoolInstrumentation}})});var mPe,APe,gPe,tvt,hPe,_Pe=O(()=>{A();mPe=se(fPe(),1);dt();gr();APe="GenericPool",gPe=at(APe,()=>new mPe.GenericPoolInstrumentation({})),tvt=(()=>{let e;return{name:APe,setupOnce(){let t=gPe();e=_N(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")}))}}}),hPe=tvt});var TZ=F(Ym=>{"use strict";A();Object.defineProperty(Ym,"__esModule",{value:!0});Ym.ATTR_NET_PEER_PORT=Ym.ATTR_NET_PEER_NAME=Ym.ATTR_MESSAGING_SYSTEM=Ym.ATTR_MESSAGING_OPERATION=void 0;Ym.ATTR_MESSAGING_OPERATION="messaging.operation";Ym.ATTR_MESSAGING_SYSTEM="messaging.system";Ym.ATTR_NET_PEER_NAME="net.peer.name";Ym.ATTR_NET_PEER_PORT="net.peer.port"});var IZ=F(gi=>{"use strict";A();Object.defineProperty(gi,"__esModule",{value:!0});gi.ATTR_MESSAGING_CONVERSATION_ID=gi.OLD_ATTR_MESSAGING_MESSAGE_ID=gi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=gi.ATTR_MESSAGING_URL=gi.ATTR_MESSAGING_PROTOCOL_VERSION=gi.ATTR_MESSAGING_PROTOCOL=gi.MESSAGING_OPERATION_VALUE_PROCESS=gi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=gi.ATTR_MESSAGING_DESTINATION_KIND=gi.ATTR_MESSAGING_DESTINATION=void 0;gi.ATTR_MESSAGING_DESTINATION="messaging.destination";gi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";gi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";gi.MESSAGING_OPERATION_VALUE_PROCESS="process";gi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";gi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";gi.ATTR_MESSAGING_URL="messaging.url";gi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";gi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";gi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var bZ=F(BS=>{"use strict";A();Object.defineProperty(BS,"__esModule",{value:!0});BS.DEFAULT_CONFIG=BS.EndOperation=void 0;var nvt;(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"})(nvt=BS.EndOperation||(BS.EndOperation={}));BS.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var TPe=F(hi=>{"use strict";A();Object.defineProperty(hi,"__esModule",{value:!0});hi.isConfirmChannelTracing=hi.unmarkConfirmChannelTracing=hi.markConfirmChannelTracing=hi.getConnectionAttributesFromUrl=hi.getConnectionAttributesFromServer=hi.normalizeExchange=hi.CONNECTION_ATTRIBUTES=hi.CHANNEL_CONSUME_TIMEOUT_TIMER=hi.CHANNEL_SPANS_NOT_ENDED=hi.MESSAGE_STORED_SPAN=void 0;var CZ=(ze(),Me(We)),_E=on(),w3=(Zn(),Me(Fr)),MO=TZ(),k3=IZ();hi.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");hi.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");hi.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");hi.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var vZ=(0,CZ.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),rvt=e=>e!==""?e:"<default>";hi.normalizeExchange=rvt;var ovt=e=>e.replace(/:[^:@/]*@/,":***@"),EPe=(e,t)=>e||(t==="AMQP"?5672:5671),yPe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},SPe=e=>e||"localhost",Km=(e,t,n,r)=>n?{[t]:n}:(CZ.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),ivt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[MO.ATTR_MESSAGING_SYSTEM]:t}:{}};hi.getConnectionAttributesFromServer=ivt;var svt=(e,t)=>{let n={[k3.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=yPe(r?.protocol);Object.assign(n,{...Km(e,k3.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=SPe(r?.hostname);t&_E.SemconvStability.OLD&&Object.assign(n,{...Km(e,MO.ATTR_NET_PEER_NAME,i,"hostname")}),t&_E.SemconvStability.STABLE&&Object.assign(n,{...Km(e,w3.ATTR_SERVER_ADDRESS,i,"hostname")});let s=EPe(r.port,o);t&_E.SemconvStability.OLD&&Object.assign(n,Km(e,MO.ATTR_NET_PEER_PORT,s,"port")),t&_E.SemconvStability.STABLE&&Object.assign(n,Km(e,w3.ATTR_SERVER_PORT,s,"port"))}else{let r=ovt(e);n[k3.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=yPe(o.protocol);Object.assign(n,{...Km(r,k3.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=SPe(o.hostname);t&_E.SemconvStability.OLD&&Object.assign(n,{...Km(r,MO.ATTR_NET_PEER_NAME,s,"hostname")}),t&_E.SemconvStability.STABLE&&Object.assign(n,{...Km(r,w3.ATTR_SERVER_ADDRESS,s,"hostname")});let c=EPe(o.port?parseInt(o.port):void 0,i);t&_E.SemconvStability.OLD&&Object.assign(n,Km(r,MO.ATTR_NET_PEER_PORT,c,"port")),t&_E.SemconvStability.STABLE&&Object.assign(n,Km(r,w3.ATTR_SERVER_PORT,c,"port"))}catch(o){CZ.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};hi.getConnectionAttributesFromUrl=svt;var avt=e=>e.setValue(vZ,!0);hi.markConfirmChannelTracing=avt;var uvt=e=>e.deleteValue(vZ);hi.unmarkConfirmChannelTracing=uvt;var cvt=e=>e.getValue(vZ)===!0;hi.isConfirmChannelTracing=cvt});var IPe=F(gR=>{"use strict";A();Object.defineProperty(gR,"__esModule",{value:!0});gR.PACKAGE_NAME=gR.PACKAGE_VERSION=void 0;gR.PACKAGE_VERSION="0.61.0";gR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var CPe=F(L3=>{"use strict";A();Object.defineProperty(L3,"__esModule",{value:!0});L3.AmqplibInstrumentation=void 0;var Xo=(ze(),Me(We)),P3=br(),vr=on(),lvt=TZ(),$l=IZ(),Ku=bZ(),_i=TPe(),bPe=IPe(),M3=[">=0.5.5 <1"],RZ=class extends vr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(bPe.PACKAGE_NAME,bPe.PACKAGE_VERSION,{...Ku.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,vr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...Ku.DEFAULT_CONFIG,...t})}init(){let t=new vr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",M3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new vr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",M3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new vr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",M3,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new vr.InstrumentationNodeModuleDefinition("amqplib",M3,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,vr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,vr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,vr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,vr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,vr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,Ku.EndOperation.Ack)),(0,vr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,Ku.EndOperation.Nack)),(0,vr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,Ku.EndOperation.Reject)),(0,vr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,Ku.EndOperation.AckAll)),(0,vr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,Ku.EndOperation.NackAll)),(0,vr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,vr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,vr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,vr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,vr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,vr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,vr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,vr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,vr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,vr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,vr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,s){return t.call(this,o,i,function(c,l){if(c==null){let f=(0,_i.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,_i.getConnectionAttributesFromServer)(l);l[_i.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,Ku.EndOperation.ChannelClosed,void 0);let i=this[_i.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[_i.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,Ku.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(s){return o.endAllSpansOnChannel(this,t,n,s),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(s,c,l){let f=this,h=n===Ku.EndOperation.Reject?c:l,y=f[_i.CHANNEL_SPANS_NOT_ENDED]??[],S=y.findIndex(b=>b.msg===s);if(S<0)o.endConsumerSpan(s,t,n,h);else if(n!==Ku.EndOperation.Reject&&c){for(let b=0;b<=S;b++)o.endConsumerSpan(y[b].msg,t,n,h);y.splice(0,S+1)}else o.endConsumerSpan(s,t,n,h),y.splice(S,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,c){let l=this;if(!Object.prototype.hasOwnProperty.call(l,_i.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let y=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);y.unref(),l[_i.CHANNEL_CONSUME_TIMEOUT_TIMER]=y}l[_i.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let y=h.properties.headers??{},S=Xo.propagation.extract(Xo.ROOT_CONTEXT,y),b=h.fields?.exchange,v;if(r._config.useLinksForConsume){let Q=S?Xo.trace.getSpan(S)?.spanContext():void 0;S=void 0,Q&&(v=[{context:Q}])}let x=r.tracer.startSpan(`${i} process`,{kind:Xo.SpanKind.CONSUMER,attributes:{...l?.connection?.[_i.CONNECTION_ATTRIBUTES],[$l.ATTR_MESSAGING_DESTINATION]:b,[$l.ATTR_MESSAGING_DESTINATION_KIND]:$l.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[$l.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[lvt.ATTR_MESSAGING_OPERATION]:$l.MESSAGING_OPERATION_VALUE_PROCESS,[$l.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[$l.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},S),{consumeHook:D}=r.getConfig();D&&(0,vr.safeExecuteInTheMiddle)(()=>D(x,{moduleVersion:t,msg:h}),Q=>{Q&&Xo.diag.error("amqplib instrumentation: consumerHook error",Q)},!0),c?.noAck||(l[_i.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,P3.hrTime)()}),h[_i.MESSAGE_STORED_SPAN]=x);let k=S||Xo.ROOT_CONTEXT;Xo.context.with(Xo.trace.setSpan(k,x),()=>{s.call(this,h)}),c?.noAck&&(r.callConsumeEndHook(x,h,!1,Ku.EndOperation.AutoAck),x.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,c,l,f){let h=this,{span:y,modifiedOptions:S}=r.createPublishSpan(r,i,s,h,l),{publishHook:b}=r.getConfig();b&&(0,vr.safeExecuteInTheMiddle)(()=>b(y,{moduleVersion:t,exchange:i,routingKey:s,content:c,options:S,isConfirmChannel:!0}),k=>{k&&Xo.diag.error("amqplib instrumentation: publishHook error",k)},!0);let v=function(k,Q){try{f?.call(this,k,Q)}finally{let{publishConfirmHook:z}=r.getConfig();z&&(0,vr.safeExecuteInTheMiddle)(()=>z(y,{moduleVersion:t,exchange:i,routingKey:s,content:c,options:l,isConfirmChannel:!0,confirmError:k}),G=>{G&&Xo.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),k&&y.setStatus({code:Xo.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),y.end()}},x=(0,_i.markConfirmChannelTracing)(Xo.context.active()),D=[...arguments];return D[3]=S,D[4]=Xo.context.bind((0,_i.unmarkConfirmChannelTracing)(Xo.trace.setSpan(x,y)),v),Xo.context.with(x,n.bind(this,...D))}}getPublishPatch(t,n){let r=this;return function(i,s,c,l){if((0,_i.isConfirmChannelTracing)(Xo.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:y}=r.createPublishSpan(r,i,s,f,l),{publishHook:S}=r.getConfig();S&&(0,vr.safeExecuteInTheMiddle)(()=>S(h,{moduleVersion:t,exchange:i,routingKey:s,content:c,options:y,isConfirmChannel:!1}),x=>{x&&Xo.diag.error("amqplib instrumentation: publishHook error",x)},!0);let b=[...arguments];b[3]=y;let v=n.apply(this,b);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,_i.normalizeExchange)(n),c=t.tracer.startSpan(`publish ${s}`,{kind:Xo.SpanKind.PRODUCER,attributes:{...o.connection[_i.CONNECTION_ATTRIBUTES],[$l.ATTR_MESSAGING_DESTINATION]:n,[$l.ATTR_MESSAGING_DESTINATION_KIND]:$l.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[$l.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[$l.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[$l.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},Xo.propagation.inject(Xo.trace.setSpan(Xo.context.active(),c),l.headers),{span:c,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[_i.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:Xo.SpanStatusCode.ERROR,message:r!==Ku.EndOperation.ChannelClosed&&r!==Ku.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[_i.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[_i.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[_i.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,vr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&Xo.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,P3.hrTime)(),r=t[_i.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],c=(0,P3.hrTimeDuration)(s.timeOfConsume,n);if((0,P3.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(s.msg,null,Ku.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};L3.AmqplibInstrumentation=RZ});var RPe=F(EE=>{"use strict";A();Object.defineProperty(EE,"__esModule",{value:!0});EE.EndOperation=EE.DEFAULT_CONFIG=EE.AmqplibInstrumentation=void 0;var dvt=CPe();Object.defineProperty(EE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return dvt.AmqplibInstrumentation}});var vPe=bZ();Object.defineProperty(EE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return vPe.DEFAULT_CONFIG}});Object.defineProperty(EE,"EndOperation",{enumerable:!0,get:function(){return vPe.EndOperation}})});var xPe,DPe,pvt,BPe,fvt,NPe,OPe=O(()=>{A();xPe=se(RPe(),1);gr();DPe="Amqplib",pvt={consumeEndHook:e=>{zr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{zr(e,"auto.amqplib.otel.publisher")}},BPe=at(DPe,()=>new xPe.AmqplibInstrumentation(pvt)),fvt=(()=>({name:DPe,setupOnce(){BPe()}})),NPe=fvt});var LO,xZ=O(()=>{A();LO="VercelAI"});function Avt(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 gvt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(hvt(t.content),_vt(t.content))}function hvt(e){for(let t of e){if(!Avt(t))continue;let n=o7(t.toolCallId);n?wl(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"),nn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):wl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),nn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function _vt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&i7(t.toolCallId)}function Evt(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 Q3,mvt,wPe,U3,kPe=O(()=>{A();Q3=se(on(),1);dt();xZ();mvt=[">=3.0.0 <7"],wPe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];U3=class e extends Q3.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 Q3.InstrumentationNodeModuleDefinition("ai",mvt,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,s)=>{let c=s[0].experimental_telemetry||{},l=c.isEnabled,f=gt(),h=f?.getIntegrationByName(LO),y=h?.options,S=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:b,recordOutputs:v}=Evt(y,c,l,S);return s[0].experimental_telemetry={...c,isEnabled:l!==void 0?l:!0,recordInputs:b,recordOutputs:v},df(()=>Reflect.apply(o,i,s),x=>{x&&typeof x=="object"&&Xi(x,"_sentry_active_span",Pc())},()=>{},x=>{gvt(x)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of wPe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=wPe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function yvt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var PPe,Svt,MPe,LPe=O(()=>{A();dt();gr();xZ();kPe();PPe=at(LO,()=>new U3({}));Svt=((e={})=>{let t;return{name:LO,options:e,setupOnce(){t=PPe()},afterAllSetup(n){e.force??yvt(n)?HU(n):t?.callWhenPatched(()=>HU(n))}}}),MPe=Svt});var G3,Tvt,F3,UPe=O(()=>{A();G3=se(on(),1);dt();Tvt=[">=4.0.0 <7"],F3=class extends G3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",Wn,t)}init(){return new G3.InstrumentationNodeModuleDefinition("openai",Tvt,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(...s){if(Xy(j_))return Reflect.construct(r,s);let c=Reflect.construct(r,s);return VU(c,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let c=Object.getOwnPropertyDescriptor(r,s);c&&Object.defineProperty(i,s,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 QPe,Ivt,FPe,GPe=O(()=>{A();dt();gr();UPe();QPe=at(j_,e=>new F3(e)),Ivt=((e={})=>({name:j_,setupOnce(){QPe(e)}})),FPe=Ivt});var j3,bvt,z3,zPe=O(()=>{A();j3=se(on(),1);dt();bvt=[">=0.19.2 <1.0.0"],z3=class extends j3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",Wn,t)}init(){return new j3.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",bvt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(Xy(H_))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return YU(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}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 jPe,Cvt,HPe,$Pe=O(()=>{A();dt();gr();zPe();jPe=at(H_,e=>new z3(e)),Cvt=((e={})=>({name:H_,options:e,setupOnce(){jPe(e)}})),HPe=Cvt});var hR,qPe,H3,VPe=O(()=>{A();hR=se(on(),1);dt();qPe=[">=0.10.0 <2"],H3=class extends hR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",Wn,t)}init(){return new hR.InstrumentationNodeModuleDefinition("@google/genai",qPe,n=>this._patch(n),n=>n,[new hR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",qPe,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(Xy($_))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return KU(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}return gN(t,"GoogleGenAI",o),t}}});var YPe,vvt,KPe,JPe=O(()=>{A();dt();gr();VPe();YPe=at($_,e=>new H3(e)),vvt=((e={})=>({name:$_,setupOnce(){YPe(e)}})),KPe=vvt});function Rvt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function xvt(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 l=c.callbacks,f=Rvt(l,t);return c.callbacks=f,Reflect.apply(r,o,i)}})}var yE,$3,q3,ZPe=O(()=>{A();yE=se(on(),1);dt();$3=[">=0.1.0 <2.0.0"];q3=class extends yE.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 yE.InstrumentationNodeModuleDefinition(r,$3,this._patch.bind(this),o=>o,[new yE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,$3,this._patch.bind(this),o=>o)]));return t.push(new yE.InstrumentationNodeModuleDefinition("langchain",$3,this._patch.bind(this),r=>r,[new yE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",$3,this._patch.bind(this),r=>r)])),t}_patch(t){SV([j_,H_,$_]);let n=XU(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(l=>typeof l=="function"&&r.includes(l.name));if(!i)return;let s=i.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let c=["invoke","stream","batch"];for(let l of c){let f=s[l];typeof f=="function"&&(s[l]=xvt(f,n))}}}});var WPe,Dvt,XPe,e2e=O(()=>{A();dt();gr();ZPe();WPe=at(JU,e=>new q3(e)),Dvt=((e={})=>({name:JU,setupOnce(){WPe(e)}})),XPe=Dvt});var _R,t2e,V3,n2e=O(()=>{A();_R=se(on(),1);dt();t2e=[">=0.0.0 <2.0.0"],V3=class extends _R.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",Wn,t)}init(){return new _R.InstrumentationNodeModuleDefinition("@langchain/langgraph",t2e,this._patch.bind(this),n=>n,[new _R.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",t2e,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&tQ(t.StateGraph.prototype,this.getConfig()),t}}});var r2e,Bvt,o2e,i2e=O(()=>{A();dt();gr();n2e();r2e=at(eQ,e=>new V3(e)),Bvt=((e={})=>({name:eQ,setupOnce(){r2e(e)}})),o2e=Bvt});import*as a2e from"node:net";function u2e(e,t,n,r,o){let s=()=>{},c=o.firestoreSpanCreationHook;typeof c=="function"&&(s=h=>{(0,Gg.safeExecuteInTheMiddle)(()=>c(h),y=>{y&&Bl.error(y?.message)},!0)});let l=new Gg.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>s2e(h,n,r,e,s)),f=["@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 f)l.files.push(new Gg.InstrumentationNodeModuleFile(h,t,y=>s2e(y,n,r,e,s),y=>c2e(y,r)));return l}function s2e(e,t,n,r,o){return c2e(e,n),t(e,"addDoc",Nvt(r,o)),t(e,"getDocs",wvt(r,o)),t(e,"setDoc",kvt(r,o)),t(e,"deleteDoc",Ovt(r,o)),e}function c2e(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Gg.isWrapped)(e[n])&&t(e,n);return e}function Nvt(e,t){return function(r){return function(o,i){let s=K3(e,"addDoc",o);return t(s),Y3(s,()=>r(o,i))}}}function Ovt(e,t){return function(r){return function(o){let i=K3(e,"deleteDoc",o.parent||o);return t(i),Y3(i,()=>r(o))}}}function wvt(e,t){return function(r){return function(o){let i=K3(e,"getDocs",o);return t(i),Y3(i,()=>r(o))}}}function kvt(e,t){return function(r){return function(o,i,s){let c=K3(e,"setDoc",o.parent||o);return t(c),Y3(c,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function Y3(e,t){return Ke.with($t.setSpan(Ke.active(),e),()=>(0,Gg.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function K3(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:co.CLIENT});return Mvt(r,n),r.setAttribute(oC,t),r}function Pvt(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(a2e.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 Mvt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[$9]:t.path,[q9]:n.name,[Py]:"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:l}=Pvt(i);c&&(s[e5]=c),l&&(s[t5]=l),e.setAttributes(s)}var Gg,l2e=O(()=>{A();ze();Gg=se(on(),1);Zn()});function d2e(e,t,n,r,o){let i=()=>{},s=()=>{},c=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(S,b)=>{(0,zg.safeExecuteInTheMiddle)(()=>f(S,b),v=>{v&&Bl.error(v?.message)},!0)}),typeof l=="function"&&(i=S=>{(0,zg.safeExecuteInTheMiddle)(()=>l(S),b=>{b&&Bl.error(b?.message)},!0)});let h=new zg.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:S,triggerType:b})=>{h.files.push(new zg.InstrumentationNodeModuleFile(S,t,v=>Lvt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:c},b),v=>p2e(v,r)))}),h}function Ju(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],c=typeof i[0]=="function"?void 0:i[0];if(!s)return o.call(this,...i);let l=async function(...f){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",y=e.startSpan(`firebase.function.${n}`,{kind:co.SERVER}),S={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(S["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(S["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),y.setAttributes(S),t?.requestHook?.(y),Ke.with($t.setSpan(Ke.active(),y),async()=>{let b,v;try{v=await s.apply(this,f)}catch(x){b=x}if(t?.responseHook?.(y,b),b&&y.recordException(b),y.end(),b)throw await t?.errorHook?.(y,b),b;return v})};return c?o.call(this,c,l):o.call(this,l)}}}function Lvt(e,t,n,r,o,i){switch(p2e(e,n),i){case"function":t(e,"onRequest",Ju(r,o,"http.request")),t(e,"onCall",Ju(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",Ju(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",Ju(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",Ju(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",Ju(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",Ju(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",Ju(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",Ju(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",Ju(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",Ju(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",Ju(r,o,"storage.object.finalized")),t(e,"onObjectArchived",Ju(r,o,"storage.object.archived")),t(e,"onObjectDeleted",Ju(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",Ju(r,o,"storage.object.metadataUpdated"));break}return e}function p2e(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,zg.isWrapped)(e[r])&&t(e,r);return e}var zg,f2e=O(()=>{A();ze();zg=se(on(),1)});var A2e,m2e,Uvt,Qvt,J3,g2e=O(()=>{A();A2e=se(on(),1);dt();l2e();f2e();m2e={},Uvt=[">=3.0.0 <5"],Qvt=[">=6.0.0 <7"],J3=class extends A2e.InstrumentationBase{constructor(t=m2e){super("@sentry/instrumentation-firebase",Wn,t)}setConfig(t={}){super.setConfig({...m2e,...t})}init(){let t=[];return t.push(u2e(this.tracer,Uvt,this._wrap,this._unwrap,this.getConfig())),t.push(d2e(this.tracer,Qvt,this._wrap,this._unwrap,this.getConfig())),t}}});var h2e,Fvt,_2e,Gvt,E2e,y2e=O(()=>{A();dt();gr();g2e();h2e="Firebase",Fvt={firestoreSpanCreationHook:e=>{zr(e,"auto.firebase.otel.firestore"),e.setAttribute(Xt,"db.query")},functions:{requestHook:e=>{zr(e,"auto.firebase.otel.functions"),e.setAttribute(Xt,"http.request")},errorHook:async(e,t)=>{t&&(nn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await zC(2e3))}}},_2e=at(h2e,()=>new J3(Fvt)),Gvt=(()=>({name:h2e,setupOnce(){_2e()}})),E2e=Gvt});function S2e(){return[bDe(),oBe(),NBe(),Eke(),_Ne(),wNe(),$Ne(),rOe(),POe(),nwe(),eke(),mke(),Pke(),Yke(),uPe(),hPe(),YBe(),NPe(),iNe(),XPe(),o2e(),MPe(),FPe(),HPe(),KPe(),swe(),E2e()]}var T2e=O(()=>{A();OPe();$Pe();Kke();CDe();aBe();y2e();_Pe();JPe();wBe();Ake();yke();KBe();Mke();e2e();i2e();sNe();ENe();kNe();qNe();oOe();GPe();rwe();awe();tke();MOe();cPe();LPe()});function b2e(e,t={}){e.getOptions().debug&&MY();let[n,r]=zvt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function zvt(e,t={}){let n=new I2e.BasicTracerProvider({sampler:new aF(e),resource:(0,Z3.defaultResource)().merge((0,Z3.resourceFromAttributes)({[n5]:"node",[H9]:"sentry",[r5]:Wn})),forceFlushTimeoutMillis:500,spanProcessors:[new sF({timeout:jvt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});$t.setGlobalTracerProvider(n),ef.setGlobalPropagator(new iF);let r=new cF;return Ke.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function jvt(e){if(e!=null){if(e>DZ)return bs&&J.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${DZ}`),DZ;if(e<=0||Number.isNaN(e)){bs&&J.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var Z3,I2e,DZ,C2e=O(()=>{A();ze();Z3=se(K7(),1),I2e=se(SY(),1);Zn();dt();gr();yv();gS();DZ=1e6});function v2e(){return gF().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(eDe(),cDe())}function R2e(e){return[...v2e(),...ki(e)?S2e():[]]}function BZ(e={}){return Hvt(e,R2e)}function Hvt(e={},t){eS(e,"node");let n=uK({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(b2e(n,{spanProcessors:e.openTelemetrySpanProcessors}),hF()),n}var x2e=O(()=>{A();dt();gr();tDe();lDe();T2e();C2e()});var ER=O(()=>{A();x2e();dt();gr()});function Zr(){return $vt}function cu(){return D2e}function B2e(){return qvt}var $vt,D2e,qvt,$c=O(()=>{"use strict";A();$vt="prod",D2e="0.1.157",qvt=`@tanagram/lore/${D2e}`});function Zvt(e=""){if(!Kvt.test(e))return e!==e.toLowerCase()}function N2e(e,t){let n=t??Jvt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let c of e){let l=n.includes(c);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Zvt(c);if(s===!1){if(i===!1&&f===!0){r.push(o),o=c,i=f;continue}if(i===!0&&f===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+c,i=f;continue}}o+=c,i=f,s=l}return r.push(o),r}function Wvt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Xvt(e){return e?e[0].toLowerCase()+e.slice(1):""}function eRt(e,t){return e?(Array.isArray(e)?e:N2e(e)).map(n=>Wvt(t?.normalize?n.toLowerCase():n)).join(""):""}function QO(e,t){return Xvt(eRt(e||"",t))}function W3(e,t){return e?(Array.isArray(e)?e:N2e(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function O2e(e){return W3(e||"","_")}var Kvt,Jvt,w2e=O(()=>{A();Kvt=/\d/,Jvt=["-","_","/","."]});import{parseArgs as tRt}from"node:util";function n6(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function NZ(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 cJ(e,t,n,r=void 0){n&&(0,cO.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&yNe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function lTt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(cJ(t,o,n,r),o)).catch(o=>{throw SNe(t,o),o}).finally(()=>t.end()):(cJ(t,e,n,r),t.end(),e)}tE.handlePromiseResponse=lTt;function dTt(e,t,n,r,o,i,s=void 0){let c=0;return o.length===2?c=1:o.length===3&&(c=2),o[c]=(l,f)=>(l?SNe(r,l):cJ(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}tE.handleCallbackResponse=dTt});var INe=F(zv=>{"use strict";A();Object.defineProperty(zv,"__esModule",{value:!0});zv.PACKAGE_NAME=zv.PACKAGE_VERSION=void 0;zv.PACKAGE_VERSION="0.60.0";zv.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var xNe=F(Gc=>{"use strict";A();Object.defineProperty(Gc,"__esModule",{value:!0});Gc.MongooseInstrumentation=Gc._ALREADY_INSTRUMENTED=Gc._STORED_PARENT_SPAN=void 0;var vs=(ze(),Me(We)),pTt=br(),lJ=TNe(),Oa=on(),bNe=INe(),nE=uJ(),IS=(Zn(),Me(Fr)),I4=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],fTt=["remove","count","findOneAndRemove",...I4],mTt=["count","findOneAndRemove",...I4],ATt=[...I4];function CNe(e){return e?e.startsWith("6.")||e.startsWith("5.")?fTt:e.startsWith("7.")?mTt:ATt:I4}function vNe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function RNe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Gc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Gc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var dJ=class extends Oa.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(bNe.PACKAGE_NAME,bNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Oa.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Oa.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Oa.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,vNe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),RNe(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)),CNe(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=CNe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,vNe(n)&&this._unwrap(r.Model.prototype,"remove"),RNe(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&&vs.trace.getSpan(vs.context.active())===void 0)return r.apply(this,arguments);let s=this[Gc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Oa.SemconvStability.OLD&&(c[nE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Oa.SemconvStability.STABLE&&(c[IS.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",c,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Gc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return r.apply(this,arguments);let s=this[Gc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Oa.SemconvStability.OLD&&(c[nE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Oa.SemconvStability.STABLE&&(c[IS.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,c,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,c){if(r.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return o.apply(this,arguments);let l={document:this};s&&!(s instanceof Function)&&(l.options=s);let f={},{dbStatementSerializer:h}=r.getConfig();if(h){let S=h(t,l);r._dbSemconvStability&Oa.SemconvStability.OLD&&(f[nE.ATTR_DB_STATEMENT]=S),r._dbSemconvStability&Oa.SemconvStability.STABLE&&(f[IS.ATTR_DB_QUERY_TEXT]=S)}let y=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(c=s,s=void 0),r._handleResponse(y,o,this,arguments,c,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,c,l){if(r.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,y=c;typeof s=="function"?(f=s,h=void 0,y=void 0):typeof c=="function"&&(f=c,y=void 0);let S={},b=r.getConfig().dbStatementSerializer;if(b){let D=b(t,{condition:{_id:this._id},updates:h,options:y});r._dbSemconvStability&Oa.SemconvStability.OLD&&(S[nE.ATTR_DB_STATEMENT]=D),r._dbSemconvStability&Oa.SemconvStability.STABLE&&(S[IS.ATTR_DB_QUERY_TEXT]=D)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,S),x=r._handleResponse(v,o,this,arguments,f,n);return x&&typeof x=="object"&&(x[Gc._ALREADY_INSTRUMENTED]=!0),x}}patchModelStatic(t,n){let r=this;return o=>function(s,c,l){if(r.getConfig().requireParentSpan&&vs.trace.getSpan(vs.context.active())===void 0)return o.apply(this,arguments);typeof c=="function"&&(l=c,c=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}c!==void 0&&(f.options=c);let h={},{dbStatementSerializer:y}=r.getConfig();if(y){let b=y(t,f);r._dbSemconvStability&Oa.SemconvStability.OLD&&(h[nE.ATTR_DB_STATEMENT]=b),r._dbSemconvStability&Oa.SemconvStability.STABLE&&(h[IS.ATTR_DB_QUERY_TEXT]=b)}let S=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(S,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=vs.trace.getSpan(vs.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Gc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Gc._STORED_PARENT_SPAN]=vs.trace.getSpan(vs.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,lJ.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Oa.SemconvStability.OLD&&(s[nE.ATTR_DB_OPERATION]=r,s[nE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Oa.SemconvStability.STABLE&&(s[IS.ATTR_DB_OPERATION_NAME]=r,s[IS.ATTR_DB_SYSTEM_NAME]=nE.DB_SYSTEM_NAME_VALUE_MONGODB);let c=this._dbSemconvStability&Oa.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(c,{kind:vs.SpanKind.CLIENT,attributes:s},i?vs.trace.setSpan(vs.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let c=this;if(i instanceof Function)return c._callOriginalFunction(()=>(0,lJ.handleCallbackResponse)(i,n,r,t,o,c.getConfig().responseHook,s));{let l=c._callOriginalFunction(()=>n.apply(r,o));return(0,lJ.handlePromiseResponse)(l,t,c.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?vs.context.with((0,pTt.suppressTracing)(vs.context.active()),t):t()}};Gc.MongooseInstrumentation=dJ});var DNe=F(b4=>{"use strict";A();Object.defineProperty(b4,"__esModule",{value:!0});b4.MongooseInstrumentation=void 0;var gTt=xNe();Object.defineProperty(b4,"MongooseInstrumentation",{enumerable:!0,get:function(){return gTt.MongooseInstrumentation}})});var BNe,NNe,ONe,hTt,wNe,kNe=O(()=>{A();BNe=se(DNe(),1);gr();NNe="Mongoose",ONe=at(NNe,()=>new BNe.MongooseInstrumentation({responseHook(e){zr(e,"auto.db.otel.mongoose")}})),hTt=(()=>({name:NNe,setupOnce(){ONe()}})),wNe=hTt});var PNe=F(is=>{"use strict";A();Object.defineProperty(is,"__esModule",{value:!0});is.METRIC_DB_CLIENT_CONNECTIONS_USAGE=is.DB_SYSTEM_VALUE_MYSQL=is.ATTR_NET_PEER_PORT=is.ATTR_NET_PEER_NAME=is.ATTR_DB_USER=is.ATTR_DB_SYSTEM=is.ATTR_DB_STATEMENT=is.ATTR_DB_NAME=is.ATTR_DB_CONNECTION_STRING=void 0;is.ATTR_DB_CONNECTION_STRING="db.connection_string";is.ATTR_DB_NAME="db.name";is.ATTR_DB_STATEMENT="db.statement";is.ATTR_DB_SYSTEM="db.system";is.ATTR_DB_USER="db.user";is.ATTR_NET_PEER_NAME="net.peer.name";is.ATTR_NET_PEER_PORT="net.peer.port";is.DB_SYSTEM_VALUE_MYSQL="mysql";is.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var MNe=F(lO=>{"use strict";A();Object.defineProperty(lO,"__esModule",{value:!0});lO.AttributeNames=void 0;var _Tt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(_Tt=lO.AttributeNames||(lO.AttributeNames={}))});var LNe=F(su=>{"use strict";A();Object.defineProperty(su,"__esModule",{value:!0});su.getPoolNameOld=su.arrayStringifyHelper=su.getSpanName=su.getDbValues=su.getDbQueryText=su.getJDBCString=su.getConfig=void 0;function ETt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}su.getConfig=ETt;function yTt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}su.getJDBCString=yTt;function STt(e){return typeof e=="string"?e:e.sql}su.getDbQueryText=STt;function TTt(e,t){return pJ(typeof e=="string"?t:t||e.values)}su.getDbValues=TTt;function ITt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}su.getSpanName=ITt;function pJ(e){return e?`[${e.toString()}]`:""}su.arrayStringifyHelper=pJ;function bTt(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()}su.getPoolNameOld=bTt});var UNe=F(jv=>{"use strict";A();Object.defineProperty(jv,"__esModule",{value:!0});jv.PACKAGE_NAME=jv.PACKAGE_VERSION=void 0;jv.PACKAGE_VERSION="0.60.0";jv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var FNe=F(C4=>{"use strict";A();Object.defineProperty(C4,"__esModule",{value:!0});C4.MySQLInstrumentation=void 0;var zc=(ze(),Me(We)),Jd=on(),Hv=(Zn(),Me(Fr)),Qg=PNe(),CTt=MNe(),bS=LNe(),QNe=UNe(),fJ=class extends Jd.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(QNe.PACKAGE_NAME,QNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Jd.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Jd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Qg.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 Jd.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,Jd.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,Jd.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,Jd.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 s=t._allConnections.length,c=t._freeConnections.length,l=s-c,f=(0,bS.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-c,f,"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,s){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let c=t._nodes;if(c){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=c[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,c){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let l=r._getConnectionCallbackPatchFn(i);return n.call(t,l)}if(arguments.length===2&&typeof s=="function"){let l=r._getConnectionCallbackPatchFn(s);return n.call(t,i,l)}if(arguments.length===3&&typeof c=="function"){let l=r._getConnectionCallbackPatchFn(c);return n.call(t,i,s,l)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=zc.context.active();return function(o,i){i&&((0,Jd.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&zc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,s){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let c={},{host:l,port:f,database:h,user:y}=(0,bS.getConfig)(t.config),S=parseInt(f,10),b=(0,bS.getDbQueryText)(o);r._dbSemconvStability&Jd.SemconvStability.OLD&&(c[Qg.ATTR_DB_SYSTEM]=Qg.DB_SYSTEM_VALUE_MYSQL,c[Qg.ATTR_DB_CONNECTION_STRING]=(0,bS.getJDBCString)(l,f,h),c[Qg.ATTR_DB_NAME]=h,c[Qg.ATTR_DB_USER]=y,c[Qg.ATTR_DB_STATEMENT]=b),r._dbSemconvStability&Jd.SemconvStability.STABLE&&(c[Hv.ATTR_DB_SYSTEM_NAME]=Hv.DB_SYSTEM_NAME_VALUE_MYSQL,c[Hv.ATTR_DB_NAMESPACE]=h,c[Hv.ATTR_DB_QUERY_TEXT]=b),r._netSemconvStability&Jd.SemconvStability.OLD&&(c[Qg.ATTR_NET_PEER_NAME]=l,isNaN(S)||(c[Qg.ATTR_NET_PEER_PORT]=S)),r._netSemconvStability&Jd.SemconvStability.STABLE&&(c[Hv.ATTR_SERVER_ADDRESS]=l,isNaN(S)||(c[Hv.ATTR_SERVER_PORT]=S));let v=r.tracer.startSpan((0,bS.getSpanName)(o),{kind:zc.SpanKind.CLIENT,attributes:c});if(r.getConfig().enhancedDatabaseReporting){let k;Array.isArray(i)?k=i:arguments[2]&&(k=[i]),v.setAttribute(CTt.AttributeNames.MYSQL_VALUES,(0,bS.getDbValues)(o,k))}let x=Array.from(arguments).findIndex(k=>typeof k=="function"),D=zc.context.active();if(x===-1){let k=zc.context.with(zc.trace.setSpan(zc.context.active(),v),()=>n.apply(t,arguments));return zc.context.bind(D,k),k.on("error",Q=>v.setStatus({code:zc.SpanStatusCode.ERROR,message:Q.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,x,r._patchCallbackQuery(v,D)),zc.context.with(zc.trace.setSpan(zc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,s){return o&&t.setStatus({code:zc.SpanStatusCode.ERROR,message:o.message}),t.end(),zc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,bS.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")})}};C4.MySQLInstrumentation=fJ});var GNe=F(v4=>{"use strict";A();Object.defineProperty(v4,"__esModule",{value:!0});v4.MySQLInstrumentation=void 0;var vTt=FNe();Object.defineProperty(v4,"MySQLInstrumentation",{enumerable:!0,get:function(){return vTt.MySQLInstrumentation}})});var zNe,jNe,HNe,RTt,$Ne,qNe=O(()=>{A();zNe=se(GNe(),1);gr();jNe="Mysql",HNe=at(jNe,()=>new zNe.MySQLInstrumentation({})),RTt=(()=>({name:jNe,setupOnce(){HNe()}})),$Ne=RTt});var mJ=F(na=>{"use strict";A();Object.defineProperty(na,"__esModule",{value:!0});na.DB_SYSTEM_VALUE_MYSQL=na.ATTR_NET_PEER_PORT=na.ATTR_NET_PEER_NAME=na.ATTR_DB_USER=na.ATTR_DB_SYSTEM=na.ATTR_DB_STATEMENT=na.ATTR_DB_NAME=na.ATTR_DB_CONNECTION_STRING=void 0;na.ATTR_DB_CONNECTION_STRING="db.connection_string";na.ATTR_DB_NAME="db.name";na.ATTR_DB_STATEMENT="db.statement";na.ATTR_DB_SYSTEM="db.system";na.ATTR_DB_USER="db.user";na.ATTR_NET_PEER_NAME="net.peer.name";na.ATTR_NET_PEER_PORT="net.peer.port";na.DB_SYSTEM_VALUE_MYSQL="mysql"});var gJ=F(R4=>{"use strict";A();Object.defineProperty(R4,"__esModule",{value:!0});R4.addSqlCommenterComment=void 0;var AJ=(ze(),Me(We)),xTt=br();function DTt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function BTt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function NTt(e,t){if(typeof t!="string"||t.length===0||DTt(t))return t;let n=new xTt.W3CTraceContextPropagator,r={};n.inject(AJ.trace.setSpan(AJ.ROOT_CONTEXT,e),r,AJ.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let c=BTt(r[s]);return`${s}='${c}'`}).join(",");return`${t} /*${i}*/`}R4.addSqlCommenterComment=NTt});var VNe=F(Zd=>{"use strict";A();Object.defineProperty(Zd,"__esModule",{value:!0});Zd.getConnectionPrototypeToInstrument=Zd.once=Zd.getSpanName=Zd.getQueryText=Zd.getConnectionAttributes=void 0;var dO=mJ(),x4=on(),hJ=(Zn(),Me(Fr));function OTt(e,t,n){let{host:r,port:o,database:i,user:s}=wTt(e),c={};t&x4.SemconvStability.OLD&&(c[dO.ATTR_DB_CONNECTION_STRING]=kTt(r,o,i),c[dO.ATTR_DB_NAME]=i,c[dO.ATTR_DB_USER]=s),t&x4.SemconvStability.STABLE&&(c[hJ.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&x4.SemconvStability.OLD&&(c[dO.ATTR_NET_PEER_NAME]=r,isNaN(l)||(c[dO.ATTR_NET_PEER_PORT]=l)),n&x4.SemconvStability.STABLE&&(c[hJ.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(c[hJ.ATTR_SERVER_PORT]=l)),c}Zd.getConnectionAttributes=OTt;function wTt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function kTt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function PTt(e,t,n,r=!1,o=MTt){let[i,s]=typeof e=="string"?[e,n]:[e.sql,LTt(e)?n||e.values:n];try{return r?o(i):t&&s?t(i,s):i}catch{return"Could not determine the query due to an error in masking or formatting"}}Zd.getQueryText=PTt;function MTt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function LTt(e){return"values"in e}function UTt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}Zd.getSpanName=UTt;var QTt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};Zd.once=QTt;function FTt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}Zd.getConnectionPrototypeToInstrument=FTt});var YNe=F($v=>{"use strict";A();Object.defineProperty($v,"__esModule",{value:!0});$v.PACKAGE_NAME=$v.PACKAGE_VERSION=void 0;$v.PACKAGE_VERSION="0.60.0";$v.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var WNe=F(D4=>{"use strict";A();Object.defineProperty(D4,"__esModule",{value:!0});D4.MySQL2Instrumentation=void 0;var KNe=(ze(),Me(We)),Af=on(),_J=mJ(),JNe=gJ(),qv=VNe(),ZNe=YNe(),EJ=(Zn(),Me(Fr)),yJ=[">=1.4.2 <4"],SJ=class extends Af.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(ZNe.PACKAGE_NAME,ZNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Af.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Af.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,Af.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,Af.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 Af.InstrumentationNodeModuleDefinition("mysql2",yJ,i=>(n(i),i),()=>{},[new Af.InstrumentationNodeModuleFile("mysql2/promise.js",yJ,i=>(n(i),i),()=>{}),new Af.InstrumentationNodeModuleFile("mysql2/lib/connection.js",yJ,i=>{let s=(0,qv.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,qv.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,c){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:y}=o.getConfig(),S=(0,qv.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),b=(0,qv.getQueryText)(i,t,l,f,h);o._dbSemconvStability&Af.SemconvStability.OLD&&(S[_J.ATTR_DB_SYSTEM]=_J.DB_SYSTEM_VALUE_MYSQL,S[_J.ATTR_DB_STATEMENT]=b),o._dbSemconvStability&Af.SemconvStability.STABLE&&(S[EJ.ATTR_DB_SYSTEM_NAME]=EJ.DB_SYSTEM_NAME_VALUE_MYSQL,S[EJ.ATTR_DB_QUERY_TEXT]=b);let v=o.tracer.startSpan((0,qv.getSpanName)(i),{kind:KNe.SpanKind.CLIENT,attributes:S});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,JNe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,JNe.addSqlCommenterComment)(v,i.sql)}));let x=(0,qv.once)((D,k)=>{D?v.setStatus({code:KNe.SpanStatusCode.ERROR,message:D.message}):typeof y=="function"&&(0,Af.safeExecuteInTheMiddle)(()=>{y(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 D=r.apply(this,arguments);return D.once("error",k=>{x(k)}).once("result",k=>{x(void 0,k)}),D}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)}}};D4.MySQL2Instrumentation=SJ});var XNe=F(B4=>{"use strict";A();Object.defineProperty(B4,"__esModule",{value:!0});B4.MySQL2Instrumentation=void 0;var GTt=WNe();Object.defineProperty(B4,"MySQL2Instrumentation",{enumerable:!0,get:function(){return GTt.MySQL2Instrumentation}})});var eOe,tOe,nOe,zTt,rOe,oOe=O(()=>{A();eOe=se(XNe(),1);gr();tOe="Mysql2",nOe=at(tOe,()=>new eOe.MySQL2Instrumentation({responseHook(e){zr(e,"auto.db.otel.mysql2")}})),zTt=(()=>({name:tOe,setupOnce(){nOe()}})),rOe=zTt});var iOe=F(au=>{"use strict";A();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 sOe=F(N4=>{"use strict";A();Object.defineProperty(N4,"__esModule",{value:!0});N4.endSpan=void 0;var jTt=(ze(),Me(We)),HTt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:jTt.SpanStatusCode.ERROR,message:t.message})),e.end()};N4.endSpan=HTt});var w4=F(O4=>{"use strict";A();Object.defineProperty(O4,"__esModule",{value:!0});O4.defaultDbStatementSerializer=void 0;var $Tt=[{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}],qTt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=$Tt.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};O4.defaultDbStatementSerializer=qTt});var aOe=F(Vv=>{"use strict";A();Object.defineProperty(Vv,"__esModule",{value:!0});Vv.PACKAGE_NAME=Vv.PACKAGE_VERSION=void 0;Vv.PACKAGE_VERSION="0.62.0";Vv.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var dOe=F(k4=>{"use strict";A();Object.defineProperty(k4,"__esModule",{value:!0});k4.IORedisInstrumentation=void 0;var rE=(ze(),Me(We)),jc=on(),oE=(Zn(),Me(Fr)),Hc=iOe(),uOe=on(),pO=sOe(),VTt=w4(),cOe=aOe(),lOe={requireParentSpan:!0},TJ=class extends jc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(cOe.PACKAGE_NAME,cOe.PACKAGE_VERSION,{...lOe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,jc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,jc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...lOe,...t})}init(){return[new jc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,jc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,jc.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(),s=i.dbStatementSerializer||VTt.defaultDbStatementSerializer,c=rE.trace.getSpan(rE.context.active())===void 0;if(i.requireParentSpan===!0&&c)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,y=s(o.name,o.args);r._dbSemconvStability&jc.SemconvStability.OLD&&(l[Hc.ATTR_DB_SYSTEM]=Hc.DB_SYSTEM_VALUE_REDIS,l[Hc.ATTR_DB_STATEMENT]=y,l[Hc.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&jc.SemconvStability.STABLE&&(l[oE.ATTR_DB_SYSTEM_NAME]=Hc.DB_SYSTEM_NAME_VALUE_REDIS,l[oE.ATTR_DB_QUERY_TEXT]=y),r._netSemconvStability&jc.SemconvStability.OLD&&(l[Hc.ATTR_NET_PEER_NAME]=f,l[Hc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&jc.SemconvStability.STABLE&&(l[oE.ATTR_SERVER_ADDRESS]=f,l[oE.ATTR_SERVER_PORT]=h);let S=r.tracer.startSpan(o.name,{kind:rE.SpanKind.CLIENT,attributes:l}),{requestHook:b}=i;b&&(0,uOe.safeExecuteInTheMiddle)(()=>b(S,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&rE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),x=o.resolve;o.resolve=function(k){(0,uOe.safeExecuteInTheMiddle)(()=>i.responseHook?.(S,o.name,o.args,k),Q=>{Q&&rE.diag.error("ioredis instrumentation: response hook failed",Q)},!0),(0,pO.endSpan)(S,null),x(k)};let D=o.reject;return o.reject=function(k){(0,pO.endSpan)(S,k),D(k)},v}catch(v){throw(0,pO.endSpan)(S,v),v}}}_traceConnection(t){let n=this;return function(){let r=rE.trace.getSpan(rE.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:s}=this.options;n._dbSemconvStability&jc.SemconvStability.OLD&&(o[Hc.ATTR_DB_SYSTEM]=Hc.DB_SYSTEM_VALUE_REDIS,o[Hc.ATTR_DB_STATEMENT]="connect",o[Hc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&jc.SemconvStability.STABLE&&(o[oE.ATTR_DB_SYSTEM_NAME]=Hc.DB_SYSTEM_NAME_VALUE_REDIS,o[oE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&jc.SemconvStability.OLD&&(o[Hc.ATTR_NET_PEER_NAME]=i,o[Hc.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&jc.SemconvStability.STABLE&&(o[oE.ATTR_SERVER_ADDRESS]=i,o[oE.ATTR_SERVER_PORT]=s);let c=n.tracer.startSpan("connect",{kind:rE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,pO.endSpan)(c,null),l}catch(l){throw(0,pO.endSpan)(c,l),l}}}};k4.IORedisInstrumentation=TJ});var pOe=F(P4=>{"use strict";A();Object.defineProperty(P4,"__esModule",{value:!0});P4.IORedisInstrumentation=void 0;var YTt=dOe();Object.defineProperty(P4,"IORedisInstrumentation",{enumerable:!0,get:function(){return YTt.IORedisInstrumentation}})});var M4=F(Yv=>{"use strict";A();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.PACKAGE_NAME=Yv.PACKAGE_VERSION=void 0;Yv.PACKAGE_VERSION="0.62.0";Yv.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var fOe=F(iE=>{"use strict";A();Object.defineProperty(iE,"__esModule",{value:!0});iE.getTracedCreateStreamTrace=iE.getTracedCreateClient=iE.endSpan=void 0;var fO=(ze(),Me(We)),KTt=(e,t)=>{t&&e.setStatus({code:fO.SpanStatusCode.ERROR,message:t.message}),e.end()};iE.endSpan=KTt;var JTt=e=>function(){let n=e.apply(this,arguments);return fO.context.bind(fO.context.active(),n)};iE.getTracedCreateClient=JTt;var ZTt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){fO.context.bind(fO.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};iE.getTracedCreateStreamTrace=ZTt});var L4=F(uu=>{"use strict";A();Object.defineProperty(uu,"__esModule",{value:!0});uu.DB_SYSTEM_VALUE_REDIS=uu.DB_SYSTEM_NAME_VALUE_REDIS=uu.ATTR_NET_PEER_PORT=uu.ATTR_NET_PEER_NAME=uu.ATTR_DB_SYSTEM=uu.ATTR_DB_STATEMENT=uu.ATTR_DB_CONNECTION_STRING=void 0;uu.ATTR_DB_CONNECTION_STRING="db.connection_string";uu.ATTR_DB_STATEMENT="db.statement";uu.ATTR_DB_SYSTEM="db.system";uu.ATTR_NET_PEER_NAME="net.peer.name";uu.ATTR_NET_PEER_PORT="net.peer.port";uu.DB_SYSTEM_NAME_VALUE_REDIS="redis";uu.DB_SYSTEM_VALUE_REDIS="redis"});var AOe=F(Q4=>{"use strict";A();Object.defineProperty(Q4,"__esModule",{value:!0});Q4.RedisInstrumentationV2_V3=void 0;var jl=on(),U4=fOe(),mOe=M4(),mO=(ze(),Me(We)),AO=(Zn(),Me(Fr)),CS=L4(),WTt=w4(),IJ=class e extends jl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(mOe.PACKAGE_NAME,mOe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,jl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,jl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new jl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,jl.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,jl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,jl.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 s=t.getConfig(),c=mO.trace.getSpan(mO.context.active())===void 0;if(s.requireParentSpan===!0&&c)return r.apply(this,arguments);let l=s?.dbStatementSerializer||WTt.defaultDbStatementSerializer,f={};t._semconvStability&jl.SemconvStability.OLD&&Object.assign(f,{[CS.ATTR_DB_SYSTEM]:CS.DB_SYSTEM_VALUE_REDIS,[CS.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&jl.SemconvStability.STABLE&&Object.assign(f,{[AO.ATTR_DB_SYSTEM_NAME]:CS.DB_SYSTEM_NAME_VALUE_REDIS,[AO.ATTR_DB_OPERATION_NAME]:i.command,[AO.ATTR_DB_QUERY_TEXT]:l(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:mO.SpanKind.CLIENT,attributes:f});if(this.connection_options){let S={};t._semconvStability&jl.SemconvStability.OLD&&Object.assign(S,{[CS.ATTR_NET_PEER_NAME]:this.connection_options.host,[CS.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&jl.SemconvStability.STABLE&&Object.assign(S,{[AO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[AO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(S)}this.address&&t._semconvStability&jl.SemconvStability.OLD&&h.setAttribute(CS.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let y=arguments[0].callback;if(y){let S=mO.context.active();arguments[0].callback=function(v,x){if(s?.responseHook){let D=s.responseHook;(0,jl.safeExecuteInTheMiddle)(()=>{D(h,i.command,i.args,x)},k=>{k&&t._diag.error("Error executing responseHook",k)},!0)}return(0,U4.endSpan)(h,v),mO.context.with(S,y,this,...arguments)}}try{return r.apply(this,arguments)}catch(S){throw(0,U4.endSpan)(h,S),S}}}}_getPatchCreateClient(){return function(n){return(0,U4.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,U4.getTracedCreateStreamTrace)(n)}}};Q4.RedisInstrumentationV2_V3=IJ});var hOe=F(F4=>{"use strict";A();Object.defineProperty(F4,"__esModule",{value:!0});F4.getClientAttributes=void 0;var bJ=(Zn(),Me(Fr)),Kv=L4(),gOe=on();function XTt(e,t,n){let r={};return n&gOe.SemconvStability.OLD&&Object.assign(r,{[Kv.ATTR_DB_SYSTEM]:Kv.DB_SYSTEM_VALUE_REDIS,[Kv.ATTR_NET_PEER_NAME]:t?.socket?.host,[Kv.ATTR_NET_PEER_PORT]:t?.socket?.port,[Kv.ATTR_DB_CONNECTION_STRING]:eIt(e,t?.url)}),n&gOe.SemconvStability.STABLE&&Object.assign(r,{[bJ.ATTR_DB_SYSTEM_NAME]:Kv.DB_SYSTEM_NAME_VALUE_REDIS,[bJ.ATTR_SERVER_ADDRESS]:t?.socket?.host,[bJ.ATTR_SERVER_PORT]:t?.socket?.port}),r}F4.getClientAttributes=XTt;function eIt(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 SOe=F(G4=>{"use strict";A();Object.defineProperty(G4,"__esModule",{value:!0});G4.RedisInstrumentationV4_V5=void 0;var Wd=(ze(),Me(We)),Io=on(),_Oe=hOe(),tIt=w4(),EOe=M4(),CJ=(Zn(),Me(Fr)),nIt=L4(),gO=Symbol("opentelemetry.instrumentation.redis.open_spans"),yOe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),vJ=class e extends Io.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(EOe.PACKAGE_NAME,EOe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Io.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Io.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 Io.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let c=i.transformCommandArguments;if(!c)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Io.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(c)),i},i=>{(0,Io.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Io.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Io.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Io.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Io.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Io.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Io.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Io.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Io.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Io.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Io.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Io.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(s,"connect",this._getPatchedClientConnect()),i},i=>{let s=i?.default?.prototype;(0,Io.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Io.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Io.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Io.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(s){if(s?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let c=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(c,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let s=o.apply(this,arguments);return typeof s?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),s):s.then(c=>{let l=this[gO];return n._endSpansWithRedisReplies(l,c,t),c}).catch(c=>{let l=this[gO];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=c.constructor.name==="MultiErrorReply"?c.replies:new Array(l.length).fill(c);n._endSpansWithRedisReplies(l,f,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[yOe]=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,s=(0,_Oe.getClientAttributes)(t._diag,i,t._semconvStability),c=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:Wd.SpanKind.CLIENT,attributes:s});return Wd.context.with(Wd.trace.setSpan(Wd.context.active(),c),()=>r.apply(this)).then(f=>(c.end(),f)).catch(f=>(c.recordException(f),c.setStatus({code:Wd.SpanStatusCode.ERROR,message:f.message}),c.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(Wd.trace.getSpan(Wd.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[yOe],c=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||tIt.defaultDbStatementSerializer,h=(0,_Oe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Io.SemconvStability.STABLE&&(h[CJ.ATTR_DB_OPERATION_NAME]=c);try{let b=f(c,l);b!=null&&(this._semconvStability&Io.SemconvStability.OLD&&(h[nIt.ATTR_DB_STATEMENT]=b),this._semconvStability&Io.SemconvStability.STABLE&&(h[CJ.ATTR_DB_QUERY_TEXT]=b))}catch(b){this._diag.error("dbStatementSerializer throw an exception",b,{commandName:c})}let y=this.tracer.startSpan(`${e.COMPONENT}-${c}`,{kind:Wd.SpanKind.CLIENT,attributes:h}),S=Wd.context.with(Wd.trace.setSpan(Wd.context.active(),y),()=>t.apply(n,r));if(typeof S?.then=="function")S.then(b=>{this._endSpanWithResponse(y,c,l,b,void 0)},b=>{this._endSpanWithResponse(y,c,l,null,b)});else{let b=S;b[gO]=b[gO]||[],b[gO].push({span:y,commandName:c,commandArgs:l})}return S}_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),s=o.every(c=>c===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let c=0;c<t.length;c++){let{span:l,commandArgs:f}=t[c],h=n[c],[y,S]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Io.SemconvStability.STABLE&&l.setAttribute(CJ.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[c],f,y,S)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(c){this._diag.error("responseHook throw an exception",c)}i&&(t.recordException(i),t.setStatus({code:Wd.SpanStatusCode.ERROR,message:i?.message})),t.end()}};G4.RedisInstrumentationV4_V5=vJ});var bOe=F(z4=>{"use strict";A();Object.defineProperty(z4,"__esModule",{value:!0});z4.RedisInstrumentation=void 0;var rIt=on(),TOe=M4(),oIt=AOe(),iIt=SOe(),IOe={requireParentSpan:!1},RJ=class extends rIt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...IOe,...t};super(TOe.PACKAGE_NAME,TOe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new oIt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new iIt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...IOe,...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())}};z4.RedisInstrumentation=RJ});var COe=F(j4=>{"use strict";A();Object.defineProperty(j4,"__esModule",{value:!0});j4.RedisInstrumentation=void 0;var sIt=bOe();Object.defineProperty(j4,"RedisInstrumentation",{enumerable:!0,get:function(){return sIt.RedisInstrumentation}})});function hO(e,t){return e.includes(t.toLowerCase())}function DJ(e){return hO(xJ,e)?"cache.get":hO(uIt,e)?"cache.put":void 0}function cIt(e,t){return t.some(n=>e.startsWith(n))}function ROe(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)?vOe(o.map(i=>n(i))):["<unknown>"],r=t[0];return hO(aIt,e)&&r!=null?n(r):vOe(t.map(o=>n(o)))}catch{return}}function xOe(e,t,n){if(!DJ(e))return!1;for(let r of t)if(cIt(r,n))return!0;return!1}function DOe(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 vOe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var aIt,xJ,uIt,BOe=O(()=>{A();aIt=["get","set","setex"],xJ=["get","mget"],uIt=["set","setex"]});var NOe,OOe,H4,_O,wOe,lIt,dIt,kOe,pIt,POe,MOe=O(()=>{A();NOe=se(pOe(),1),OOe=se(COe(),1);dt();gr();BOe();H4="Redis",_O={},wOe=(e,t,n,r)=>{e.setAttribute(kt,"auto.db.otel.redis");let o=ROe(t,n),i=DJ(t);if(!o||!i||!_O.cachePrefixes||!xOe(t,o,_O.cachePrefixes))return;let s=Ot(e).data["net.peer.name"],c=Ot(e).data["net.peer.port"];c&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":c});let l=DOe(r);l&&e.setAttribute(wq,l),hO(xJ,t)&&l!==void 0&&e.setAttribute(Nq,l>0),e.setAttributes({[Xt]:i,[Oq]:o});let f=o.join(", ");e.updateName(_O.maxCacheKeyLength?y_(f,_O.maxCacheKeyLength):f)},lIt=at(`${H4}.IORedis`,()=>new NOe.IORedisInstrumentation({responseHook:wOe})),dIt=at(`${H4}.Redis`,()=>new OOe.RedisInstrumentation({responseHook:wOe})),kOe=Object.assign(()=>{lIt(),dIt()},{id:H4}),pIt=((e={})=>({name:H4,setupOnce(){_O=e,kOe()}})),POe=pIt});var LOe=F($4=>{"use strict";A();Object.defineProperty($4,"__esModule",{value:!0});$4.EVENT_LISTENERS_SET=void 0;$4.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var BJ=F(EO=>{"use strict";A();Object.defineProperty(EO,"__esModule",{value:!0});EO.AttributeNames=void 0;var fIt;(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"})(fIt=EO.AttributeNames||(EO.AttributeNames={}))});var NJ=F(Br=>{"use strict";A();Object.defineProperty(Br,"__esModule",{value:!0});Br.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Br.METRIC_DB_CLIENT_CONNECTION_COUNT=Br.DB_SYSTEM_VALUE_POSTGRESQL=Br.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Br.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Br.ATTR_NET_PEER_PORT=Br.ATTR_NET_PEER_NAME=Br.ATTR_DB_USER=Br.ATTR_DB_SYSTEM=Br.ATTR_DB_STATEMENT=Br.ATTR_DB_NAME=Br.ATTR_DB_CONNECTION_STRING=Br.ATTR_DB_CLIENT_CONNECTION_STATE=Br.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Br.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Br.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Br.ATTR_DB_CONNECTION_STRING="db.connection_string";Br.ATTR_DB_NAME="db.name";Br.ATTR_DB_STATEMENT="db.statement";Br.ATTR_DB_SYSTEM="db.system";Br.ATTR_DB_USER="db.user";Br.ATTR_NET_PEER_NAME="net.peer.name";Br.ATTR_NET_PEER_PORT="net.peer.port";Br.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Br.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Br.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Br.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Br.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var OJ=F(yO=>{"use strict";A();Object.defineProperty(yO,"__esModule",{value:!0});yO.SpanNames=void 0;var mIt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(mIt=yO.SpanNames||(yO.SpanNames={}))});var HOe=F(ir=>{"use strict";A();Object.defineProperty(ir,"__esModule",{value:!0});ir.sanitizedErrorMessage=ir.isObjectWithTextString=ir.getErrorMessage=ir.patchClientConnectCallback=ir.patchCallbackPGPool=ir.updateCounter=ir.getPoolName=ir.patchCallback=ir.handleExecutionResult=ir.handleConfigQuery=ir.shouldSkipInstrumentation=ir.getSemanticAttributesFromPoolConnection=ir.getSemanticAttributesFromConnection=ir.getConnectionString=ir.parseAndMaskConnectionString=ir.parseNormalizedOperationName=ir.getQuerySpanName=void 0;var sE=(ze(),Me(We)),q4=BJ(),Xd=(Zn(),Me(Fr)),Ai=NJ(),vS=on(),UOe=OJ();function QOe(e,t){if(!t)return UOe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:FOe(t.text);return`${UOe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}ir.getQuerySpanName=QOe;function FOe(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}ir.parseNormalizedOperationName=FOe;function GOe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}ir.parseAndMaskConnectionString=GOe;function wJ(e){if("connectionString"in e&&e.connectionString)return GOe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}ir.getConnectionString=wJ;function V4(e){if(Number.isInteger(e))return e}function zOe(e,t){let n={};return t&vS.SemconvStability.OLD&&(n={...n,[Ai.ATTR_DB_SYSTEM]:Ai.DB_SYSTEM_VALUE_POSTGRESQL,[Ai.ATTR_DB_NAME]:e.database,[Ai.ATTR_DB_CONNECTION_STRING]:wJ(e),[Ai.ATTR_DB_USER]:e.user,[Ai.ATTR_NET_PEER_NAME]:e.host,[Ai.ATTR_NET_PEER_PORT]:V4(e.port)}),t&vS.SemconvStability.STABLE&&(n={...n,[Xd.ATTR_DB_SYSTEM_NAME]:Xd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Xd.ATTR_DB_NAMESPACE]:e.namespace,[Xd.ATTR_SERVER_ADDRESS]:e.host,[Xd.ATTR_SERVER_PORT]:V4(e.port)}),n}ir.getSemanticAttributesFromConnection=zOe;function AIt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[q4.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[q4.AttributeNames.MAX_CLIENT]:e.maxClient};return t&vS.SemconvStability.OLD&&(r={...r,[Ai.ATTR_DB_SYSTEM]:Ai.DB_SYSTEM_VALUE_POSTGRESQL,[Ai.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[Ai.ATTR_DB_CONNECTION_STRING]:wJ(e),[Ai.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[Ai.ATTR_NET_PEER_PORT]:Number(n?.port)||V4(e.port),[Ai.ATTR_DB_USER]:n?.username??e.user}),t&vS.SemconvStability.STABLE&&(r={...r,[Xd.ATTR_DB_SYSTEM_NAME]:Xd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Xd.ATTR_DB_NAMESPACE]:e.namespace,[Xd.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[Xd.ATTR_SERVER_PORT]:Number(n?.port)||V4(e.port)}),r}ir.getSemanticAttributesFromPoolConnection=AIt;function gIt(e){return e.requireParentSpan===!0&&sE.trace.getSpan(sE.context.active())===void 0}ir.shouldSkipInstrumentation=gIt;function hIt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=QOe(i,r),c=e.startSpan(s,{kind:sE.SpanKind.CLIENT,attributes:zOe(o,n)});if(!r)return c;if(r.text&&(n&vS.SemconvStability.OLD&&c.setAttribute(Ai.ATTR_DB_STATEMENT,r.text),n&vS.SemconvStability.STABLE&&c.setAttribute(Xd.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let l=r.values.map(f=>f==null?"null":f instanceof Buffer?f.toString():typeof f=="object"?typeof f.toPostgres=="function"?f.toPostgres():JSON.stringify(f):f.toString());c.setAttribute(q4.AttributeNames.PG_VALUES,l)}catch(l){sE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&c.setAttribute(q4.AttributeNames.PG_PLAN,r.name),c}ir.handleConfigQuery=hIt;function jOe(e,t,n){typeof e.responseHook=="function"&&(0,vS.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&sE.diag.error("Error running response hook",r)},!0)}ir.handleExecutionResult=jOe;function _It(e,t,n,r,o){return function(s,c){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[Xd.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(Y4(s)),t.setStatus({code:sE.SpanStatusCode.ERROR,message:s.message})):jOe(e,t,c),o(),t.end(),n.call(this,s,c)}}ir.patchCallback=_It;function EIt(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()}ir.getPoolName=EIt;function yIt(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,c=t.idleCount,l=i-c;return n.add(l-o.used,{[Ai.ATTR_DB_CLIENT_CONNECTION_STATE]:Ai.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ai.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(c-o.idle,{[Ai.ATTR_DB_CLIENT_CONNECTION_STATE]:Ai.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ai.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[Ai.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:c,pending:s}}ir.updateCounter=yIt;function SIt(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(Y4(r)),e.setStatus({code:sE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}ir.patchCallbackPGPool=SIt;function TIt(e,t){return function(r){r&&(r instanceof Error&&e.recordException(Y4(r)),e.setStatus({code:sE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}ir.patchClientConnectCallback=TIt;function IIt(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}ir.getErrorMessage=IIt;function bIt(e){return typeof e=="object"&&typeof e?.text=="string"}ir.isObjectWithTextString=bIt;function Y4(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}ir.sanitizedErrorMessage=Y4});var $Oe=F(Jv=>{"use strict";A();Object.defineProperty(Jv,"__esModule",{value:!0});Jv.PACKAGE_NAME=Jv.PACKAGE_VERSION=void 0;Jv.PACKAGE_VERSION="0.66.0";Jv.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var ZOe=F(J4=>{"use strict";A();Object.defineProperty(J4,"__esModule",{value:!0});J4.PgInstrumentation=void 0;var qu=on(),Hr=(ze(),Me(We)),qOe=LOe(),Wo=HOe(),VOe=gJ(),YOe=$Oe(),KOe=OJ(),K4=br(),gf=(Zn(),Me(Fr)),SO=NJ();function Zv(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var kJ=class extends qu.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(YOe.PACKAGE_NAME,YOe.PACKAGE_VERSION,t),this._semconvStability=(0,qu.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(gf.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Hr.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 qu.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new qu.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new qu.InstrumentationNodeModuleDefinition("pg",t,c=>{let l=Zv(c);return this._patchPgClient(l.Client),c},c=>{let l=Zv(c);return this._unpatchPgClient(l.Client),c},[o,r]),s=new qu.InstrumentationNodeModuleDefinition("pg-pool",n,c=>{let l=Zv(c);return(0,qu.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},c=>{let l=Zv(c);(0,qu.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=Zv(t);return(0,qu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,qu.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=Zv(t);return(0,qu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,qu.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Wo.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(KOe.SpanNames.CONNECT,{kind:Hr.SpanKind.CLIENT,attributes:Wo.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Hr.trace.getSpan(Hr.context.active());o=Wo.patchClientConnectCallback(s,o),l&&(o=Hr.context.bind(Hr.context.active(),o))}let c=Hr.context.with(Hr.trace.setSpan(Hr.context.active(),s),()=>n.call(this,o));return JOe(s,c)}}recordOperationDuration(t,n){let r={},o=[gf.ATTR_DB_NAMESPACE,gf.ATTR_ERROR_TYPE,gf.ATTR_SERVER_PORT,gf.ATTR_SERVER_ADDRESS,gf.ATTR_DB_OPERATION_NAME];this._semconvStability&qu.SemconvStability.OLD&&o.push(SO.ATTR_DB_SYSTEM),this._semconvStability&qu.SemconvStability.STABLE&&o.push(gf.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,K4.hrTimeToMilliseconds)((0,K4.hrTimeDuration)(n,(0,K4.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Wo.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,K4.hrTime)(),s=o[0],c=typeof s=="string",l=Wo.isObjectWithTextString(s),f=c?{text:s,values:Array.isArray(o[1])?o[1]:void 0}:l?{...s,name:s.name,text:s.text,values:s.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[SO.ATTR_DB_SYSTEM]:SO.DB_SYSTEM_VALUE_POSTGRESQL,[gf.ATTR_DB_NAMESPACE]:this.database,[gf.ATTR_SERVER_PORT]:this.connectionParameters.port,[gf.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[gf.ATTR_DB_OPERATION_NAME]=Wo.parseNormalizedOperationName(f?.text));let y=()=>{t.recordOperationDuration(h,i)},S=t.getConfig(),b=Wo.handleConfigQuery.call(this,t.tracer,S,t._semconvStability,f);if(S.addSqlCommenterCommentToQueries&&(c?o[0]=(0,VOe.addSqlCommenterComment)(b,s):l&&!("name"in s)&&(o[0]={...s,text:(0,VOe.addSqlCommenterComment)(b,s.text)})),o.length>0){let D=Hr.trace.getSpan(Hr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Wo.patchCallback(S,b,o[o.length-1],h,y),D&&(o[o.length-1]=Hr.context.bind(Hr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let k=Wo.patchCallback(t.getConfig(),b,f.callback,h,y);D&&(k=Hr.context.bind(Hr.context.active(),k)),o[0].callback=k}}let{requestHook:v}=S;typeof v=="function"&&f&&(0,qu.safeExecuteInTheMiddle)(()=>{let{database:D,host:k,port:Q,user:z}=this.connectionParameters;v(b,{connection:{database:D,host:k,port:Q,user:z},query:{text:f.text,values:f.values,name:f.name}})},D=>{D&&t._diag.error("Error running query hook",D)},!0);let x;try{x=n.apply(this,o)}catch(D){throw D instanceof Error&&b.recordException(Wo.sanitizedErrorMessage(D)),b.setStatus({code:Hr.SpanStatusCode.ERROR,message:Wo.getErrorMessage(D)}),b.end(),D}return x instanceof Promise?x.then(D=>new Promise(k=>{Wo.handleExecutionResult(t.getConfig(),b,D),y(),b.end(),k(D)})).catch(D=>new Promise((k,Q)=>{D instanceof Error&&b.recordException(Wo.sanitizedErrorMessage(D)),b.setStatus({code:Hr.SpanStatusCode.ERROR,message:D.message}),y(),b.end(),Q(D)})):x})}_setPoolConnectEventListeners(t){if(t[qOe.EVENT_LISTENERS_SET])return;let n=Wo.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=Wo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[qOe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Wo.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(KOe.SpanNames.POOL_CONNECT,{kind:Hr.SpanKind.CLIENT,attributes:Wo.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Hr.trace.getSpan(Hr.context.active());o=Wo.patchCallbackPGPool(s,o),l&&(o=Hr.context.bind(Hr.context.active(),o))}let c=Hr.context.with(Hr.trace.setSpan(Hr.context.active(),s),()=>n.call(this,o));return JOe(s,c)}}};J4.PgInstrumentation=kJ;function JOe(e,t){if(!(t instanceof Promise))return t;let n=t;return Hr.context.bind(Hr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(Wo.sanitizedErrorMessage(r)),e.setStatus({code:Hr.SpanStatusCode.ERROR,message:Wo.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var WOe=F(Wv=>{"use strict";A();Object.defineProperty(Wv,"__esModule",{value:!0});Wv.AttributeNames=Wv.PgInstrumentation=void 0;var CIt=ZOe();Object.defineProperty(Wv,"PgInstrumentation",{enumerable:!0,get:function(){return CIt.PgInstrumentation}});var vIt=BJ();Object.defineProperty(Wv,"AttributeNames",{enumerable:!0,get:function(){return vIt.AttributeNames}})});var XOe,ewe,twe,RIt,nwe,rwe=O(()=>{A();XOe=se(WOe(),1);gr();ewe="Postgres",twe=at(ewe,XOe.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){zr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),RIt=(e=>({name:ewe,setupOnce(){twe(e)}})),nwe=RIt});var aE,MJ,owe,xIt,DIt,iwe,PJ,BIt,swe,awe=O(()=>{A();ze();aE=se(on(),1);Zn();dt();gr();gS();MJ="PostgresJs",owe=[">=3.0.0 <4"],xIt=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,DIt=Symbol.for("sentry.query.from.instrumented.sql"),iwe=at(MJ,e=>new PJ({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),PJ=class extends aE.InstrumentationBase{constructor(t){super("sentry-postgres-js",Wn,t)}init(){let t=new aE.InstrumentationNodeModuleDefinition("postgres",owe,n=>{try{return this._patchPostgres(n)}catch(r){return bs&&J.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new aE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,owe,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 bs&&J.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let c=Reflect.construct(r,s);if(!c||typeof c!="function")return bs&&J.warn("postgres() did not return a valid instance"),c;let l=o.getConfig();return PV(c,{requireParentSpan:l.requireParentSpan,requestHook:l.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let c=Object.getOwnPropertyDescriptor(r,s);c&&Object.defineProperty(i,s,c)}return n?i:(gN(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return $t.getSpan(Ke.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(oC,r);return}let o=n?.match(xIt);o?.[1]&&t.setAttribute(oC,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[DIt])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return Ws({name:s||"postgresjs.query",op:"db"},c=>{zr(c,"auto.db.postgresjs"),c.setAttributes({[Py]:"postgres",[V9]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,aE.safeExecuteInTheMiddle)(()=>f(c,s,void 0),S=>{S&&(c.setAttribute("sentry.hook.error","requestHook failed"),bs&&J.error(`Error in requestHook for ${MJ} integration:`,S))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(S,b,v)=>{try{n._setOperationName(c,s,v?.[0]?.command),c.end()}catch(x){bs&&J.error("Error ending span in resolve callback:",x)}return Reflect.apply(S,b,v)}});let y=this.reject;this.reject=new Proxy(y,{apply:(S,b,v)=>{try{c.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),c.setAttribute(Y9,v?.[0]?.code||"unknown"),c.setAttribute(K9,v?.[0]?.name||"unknown"),n._setOperationName(c,s),c.end()}catch(x){bs&&J.error("Error ending span in reject callback:",x)}return Reflect.apply(S,b,v)}});try{return r.apply(this,o)}catch(S){throw c.setStatus({code:2,message:S instanceof Error?S.message:"unknown_error"}),c.end(),S}})},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}},BIt=(e=>({name:MJ,setupOnce(){iwe(e)}})),swe=BIt});var uwe=F(TO=>{"use strict";A();Object.defineProperty(TO,"__esModule",{value:!0});TO.SeverityNumber=void 0;var NIt;(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"})(NIt=TO.SeverityNumber||(TO.SeverityNumber={}))});var W4=F(Xv=>{"use strict";A();Object.defineProperty(Xv,"__esModule",{value:!0});Xv.NOOP_LOGGER=Xv.NoopLogger=void 0;var Z4=class{emit(t){}};Xv.NoopLogger=Z4;Xv.NOOP_LOGGER=new Z4});var e3=F(eR=>{"use strict";A();Object.defineProperty(eR,"__esModule",{value:!0});eR.NOOP_LOGGER_PROVIDER=eR.NoopLoggerProvider=void 0;var OIt=W4(),X4=class{getLogger(t,n,r){return new OIt.NoopLogger}};eR.NoopLoggerProvider=X4;eR.NOOP_LOGGER_PROVIDER=new X4});var UJ=F(t3=>{"use strict";A();Object.defineProperty(t3,"__esModule",{value:!0});t3.ProxyLogger=void 0;var wIt=W4(),LJ=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):wIt.NOOP_LOGGER}};t3.ProxyLogger=LJ});var FJ=F(n3=>{"use strict";A();Object.defineProperty(n3,"__esModule",{value:!0});n3.ProxyLoggerProvider=void 0;var kIt=e3(),PIt=UJ(),QJ=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new PIt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:kIt.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)}};n3.ProxyLoggerProvider=QJ});var cwe=F(r3=>{"use strict";A();Object.defineProperty(r3,"__esModule",{value:!0});r3._globalThis=void 0;r3._globalThis=typeof globalThis=="object"?globalThis:global});var lwe=F(o3=>{"use strict";A();Object.defineProperty(o3,"__esModule",{value:!0});o3._globalThis=void 0;var MIt=cwe();Object.defineProperty(o3,"_globalThis",{enumerable:!0,get:function(){return MIt._globalThis}})});var dwe=F(i3=>{"use strict";A();Object.defineProperty(i3,"__esModule",{value:!0});i3._globalThis=void 0;var LIt=lwe();Object.defineProperty(i3,"_globalThis",{enumerable:!0,get:function(){return LIt._globalThis}})});var pwe=F(Hm=>{"use strict";A();Object.defineProperty(Hm,"__esModule",{value:!0});Hm.API_BACKWARDS_COMPATIBILITY_VERSION=Hm.makeGetter=Hm._global=Hm.GLOBAL_LOGS_API_KEY=void 0;var UIt=dwe();Hm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Hm._global=UIt._globalThis;function QIt(e,t,n){return r=>r===e?t:n}Hm.makeGetter=QIt;Hm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var mwe=F(s3=>{"use strict";A();Object.defineProperty(s3,"__esModule",{value:!0});s3.LogsAPI=void 0;var ep=pwe(),FIt=e3(),fwe=FJ(),GJ=class e{constructor(){this._proxyLoggerProvider=new fwe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return ep._global[ep.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(ep._global[ep.GLOBAL_LOGS_API_KEY]=(0,ep.makeGetter)(ep.API_BACKWARDS_COMPATIBILITY_VERSION,t,FIt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=ep._global[ep.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(ep._global,ep.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete ep._global[ep.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new fwe.ProxyLoggerProvider}};s3.LogsAPI=GJ});var zJ=F(ra=>{"use strict";A();Object.defineProperty(ra,"__esModule",{value:!0});ra.logs=ra.ProxyLoggerProvider=ra.ProxyLogger=ra.NoopLoggerProvider=ra.NOOP_LOGGER_PROVIDER=ra.NoopLogger=ra.NOOP_LOGGER=ra.SeverityNumber=void 0;var GIt=uwe();Object.defineProperty(ra,"SeverityNumber",{enumerable:!0,get:function(){return GIt.SeverityNumber}});var Awe=W4();Object.defineProperty(ra,"NOOP_LOGGER",{enumerable:!0,get:function(){return Awe.NOOP_LOGGER}});Object.defineProperty(ra,"NoopLogger",{enumerable:!0,get:function(){return Awe.NoopLogger}});var gwe=e3();Object.defineProperty(ra,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return gwe.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ra,"NoopLoggerProvider",{enumerable:!0,get:function(){return gwe.NoopLoggerProvider}});var zIt=UJ();Object.defineProperty(ra,"ProxyLogger",{enumerable:!0,get:function(){return zIt.ProxyLogger}});var jIt=FJ();Object.defineProperty(ra,"ProxyLoggerProvider",{enumerable:!0,get:function(){return jIt.ProxyLoggerProvider}});var HIt=mwe();ra.logs=HIt.LogsAPI.getInstance()});var hwe=F(tR=>{"use strict";A();Object.defineProperty(tR,"__esModule",{value:!0});tR.disableInstrumentations=tR.enableInstrumentations=void 0;function $It(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}tR.enableInstrumentations=$It;function qIt(e){e.forEach(t=>t.disable())}tR.disableInstrumentations=qIt});var ywe=F(a3=>{"use strict";A();Object.defineProperty(a3,"__esModule",{value:!0});a3.registerInstrumentations=void 0;var _we=(ze(),Me(We)),VIt=zJ(),Ewe=hwe();function YIt(e){let t=e.tracerProvider||_we.trace.getTracerProvider(),n=e.meterProvider||_we.metrics.getMeterProvider(),r=e.loggerProvider||VIt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Ewe.enableInstrumentations)(o,t,n,r),()=>{(0,Ewe.disableInstrumentations)(o)}}a3.registerInstrumentations=YIt});var Dwe=F(u3=>{"use strict";A();Object.defineProperty(u3,"__esModule",{value:!0});u3.satisfies=void 0;var qJ=(ze(),Me(We)),Cwe=/^(?: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-]+)*))?$/,KIt=/^(?<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-]+)*))?$/,JIt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function ZIt(e,t,n){if(!WIt(e))return qJ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=nbt(e);if(!r)return!1;let o=[],i=vwe(r,t,o,n);return i&&!n?.includePrerelease?ebt(r,o):i}u3.satisfies=ZIt;function WIt(e){return typeof e=="string"&&Cwe.test(e)}function vwe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(jJ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=Ibt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!jJ(e,i,n,r))return!1;return!0}return jJ(e,t,n,r)}function jJ(e,t,n,r){if(t=tbt(t,r),t.includes(" "))return vwe(e,t,n,r);{let o=rbt(t);return n.push(o),XIt(e,o)}}function XIt(e,t){if(t.invalid)return!1;if(!t.version||$J(t.version))return!0;let n=Twe(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=Twe(r,o)}return JIt[t.op]?.includes(n)}function ebt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function tbt(e,t){return e=e.trim(),e=Sbt(e,t),e=ybt(e),e=Tbt(e,t),e=e.trim(),e}function Vu(e){return!e||e.toLowerCase()==="x"||e==="*"}function nbt(e){let t=e.match(Cwe);if(!t){qJ.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function rbt(e){if(!e)return{};let t=e.match(KIt);if(!t)return qJ.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function $J(e){return e==="*"||e==="x"||e==="X"}function Swe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function obt(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 ibt(e,t){if($J(e)||$J(t))return 0;let[n,r]=obt(Swe(e),Swe(t));return n>r?1:n<r?-1:0}function Twe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=ibt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var Rwe="[a-zA-Z0-9-]",xwe="0|[1-9]\\d*",sbt=`\\d*[a-zA-Z-]${Rwe}*`,abt="((?:<|>)?=?)",Iwe=`(?:${xwe}|${sbt})`,ubt=`(?:-(${Iwe}(?:\\.${Iwe})*))`,bwe=`${Rwe}+`,cbt=`(?:\\+(${bwe}(?:\\.${bwe})*))`,HJ=`${xwe}|x|X|\\*`,IO=`[v=\\s]*(${HJ})(?:\\.(${HJ})(?:\\.(${HJ})(?:${ubt})?${cbt}?)?)?`,lbt=`^${abt}\\s*${IO}$`,dbt=new RegExp(lbt),pbt=`^\\s*(${IO})\\s+-\\s+(${IO})\\s*$`,fbt=new RegExp(pbt),mbt="(?:~>?)",Abt=`^${mbt}${IO}$`,gbt=new RegExp(Abt),hbt="(?:\\^)",_bt=`^${hbt}${IO}$`,Ebt=new RegExp(_bt);function ybt(e){let t=gbt;return e.replace(t,(n,r,o,i,s)=>{let c;return Vu(r)?c="":Vu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Vu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?c=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function Sbt(e,t){let n=Ebt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,c,l)=>{let f;return Vu(i)?f="":Vu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Vu(c)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${c}-${l} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${c}${r} <${i}.${s}.${+c+1}-0`:f=`>=${i}.${s}.${c}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${c} <${+i+1}.0.0-0`,f})}function Tbt(e,t){let n=dbt;return e.replace(n,(r,o,i,s,c,l)=>{let f=Vu(i),h=f||Vu(s),y=h||Vu(c),S=y;return o==="="&&S&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&S?(h&&(s=0),c=0,o===">"?(o=">=",h?(i=+i+1,s=0,c=0):(s=+s+1,c=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${c}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:y&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function Ibt(e,t){let n=fbt;return e.replace(n,(r,o,i,s,c,l,f,h,y,S,b,v)=>(Vu(i)?o="":Vu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Vu(c)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Vu(y)?h="":Vu(S)?h=`<${+y+1}.0.0-0`:Vu(b)?h=`<${y}.${+S+1}.0-0`:v?h=`<=${y}.${S}.${b}-${v}`:t?.includePrerelease?h=`<${y}.${S}.${+b+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var VJ=F(wa=>{"use strict";A();Object.defineProperty(wa,"__esModule",{value:!0});wa.massUnwrap=wa.unwrap=wa.massWrap=wa.wrap=void 0;var Yu=console.error.bind(console);function bO(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 bbt=(e,t,n)=>{if(!e||!e[t]){Yu("no original function "+String(t)+" to wrap");return}if(!n){Yu("no wrapper function"),Yu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){Yu("original object and wrapper must be functions");return}let o=n(r,t);return bO(o,"__original",r),bO(o,"__unwrap",()=>{e[t]===o&&bO(e,t,r)}),bO(o,"__wrapped",!0),bO(e,t,o),o};wa.wrap=bbt;var Cbt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Yu("must provide one or more modules to patch"),Yu(new Error().stack);return}if(!(t&&Array.isArray(t))){Yu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,wa.wrap)(r,o,n)})})};wa.massWrap=Cbt;var vbt=(e,t)=>{if(!e||!e[t]){Yu("no function to unwrap."),Yu(new Error().stack);return}let n=e[t];if(!n.__unwrap)Yu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};wa.unwrap=vbt;var Rbt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Yu("must provide one or more modules to patch"),Yu(new Error().stack);return}if(!(t&&Array.isArray(t))){Yu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,wa.unwrap)(n,r)})})};wa.massUnwrap=Rbt;function CO(e){e&&e.logger&&(typeof e.logger!="function"?Yu("new logger isn't a function, not replacing"):Yu=e.logger)}wa.default=CO;CO.wrap=wa.wrap;CO.massWrap=wa.massWrap;CO.unwrap=wa.unwrap;CO.massUnwrap=wa.massUnwrap});var Bwe=F(l3=>{"use strict";A();Object.defineProperty(l3,"__esModule",{value:!0});l3.InstrumentationAbstract=void 0;var YJ=(ze(),Me(We)),xbt=zJ(),c3=VJ(),KJ=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=YJ.diag.createComponentLogger({namespace:t}),this._tracer=YJ.trace.getTracer(t,n),this._meter=YJ.metrics.getMeter(t,n),this._logger=xbt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=c3.wrap;_unwrap=c3.unwrap;_massWrap=c3.massWrap;_massUnwrap=c3.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)}}};l3.InstrumentationAbstract=KJ});var Nwe=F(uE=>{"use strict";A();Object.defineProperty(uE,"__esModule",{value:!0});uE.ModuleNameTrie=uE.ModuleNameSeparator=void 0;uE.ModuleNameSeparator="/";var d3=class{hooks=[];children=new Map},JJ=class{_trie=new d3;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(uE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new d3,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=[],s=!0;for(let c of t.split(uE.ModuleNameSeparator)){let l=o.children.get(c);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,l)=>c.insertedId-l.insertedId),i.map(({hook:c})=>c))}};uE.ModuleNameTrie=JJ});var wwe=F(p3=>{"use strict";A();Object.defineProperty(p3,"__esModule",{value:!0});p3.RequireInTheMiddleSingleton=void 0;var Dbt=Gy(),Owe=Fe("path"),ZJ=Nwe(),Bbt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),WJ=class e{_moduleNameTrie=new ZJ.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new Dbt.Hook(null,{internals:!0},(t,n,r)=>{let o=Nbt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return Bbt?new e:this._instance=this._instance??new e}};p3.RequireInTheMiddleSingleton=WJ;function Nbt(e){return Owe.sep!==ZJ.ModuleNameSeparator?e.split(Owe.sep).join(ZJ.ModuleNameSeparator):e}});var XJ=F(cE=>{"use strict";A();Object.defineProperty(cE,"__esModule",{value:!0});cE.isWrapped=cE.safeExecuteInTheMiddleAsync=cE.safeExecuteInTheMiddle=void 0;function Obt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}cE.safeExecuteInTheMiddle=Obt;async function wbt(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}}cE.safeExecuteInTheMiddleAsync=wbt;function kbt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}cE.isWrapped=kbt});var Mwe=F(f3=>{"use strict";A();Object.defineProperty(f3,"__esModule",{value:!0});f3.InstrumentationBase=void 0;var vO=Fe("path"),kwe=Fe("util"),Pbt=Dwe(),eZ=VJ(),Mbt=Bwe(),Lbt=wwe(),Ubt=kK(),RO=(ze(),Me(We)),Qbt=Gy(),Fbt=Fe("fs"),Gbt=XJ(),tZ=class extends Mbt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=Lbt.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,Gbt.isWrapped)(t[n])&&this._unwrap(t,n),kwe.types.isProxy(t)){let o=(0,eZ.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,eZ.wrap)(t,n,r)};_unwrap=(t,n)=>kwe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,eZ.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.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{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.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=Fe.resolve(n);Fe.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,Fbt.readFileSync)(vO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{RO.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 Pwe(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 s=t.files??[],c=vO.normalize(r);return s.filter(f=>f.name===c).filter(f=>Pwe(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,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(f,t.moduleVersion)):f),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,c,l)=>{if(!l&&vO.isAbsolute(c)){let f=vO.parse(c);c=f.name,l=f.dir}return this._onRequire(t,s,c,l)},r=(s,c,l)=>this._onRequire(t,s,c,l),o=vO.isAbsolute(t.name)?new Qbt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new Ubt.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}};f3.InstrumentationBase=tZ;function Pwe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,Pbt.satisfies)(t,r,{includePrerelease:n}))}});var Lwe=F(m3=>{"use strict";A();Object.defineProperty(m3,"__esModule",{value:!0});m3.normalize=void 0;var zbt=Fe("path");Object.defineProperty(m3,"normalize",{enumerable:!0,get:function(){return zbt.normalize}})});var Uwe=F(nR=>{"use strict";A();Object.defineProperty(nR,"__esModule",{value:!0});nR.normalize=nR.InstrumentationBase=void 0;var jbt=Mwe();Object.defineProperty(nR,"InstrumentationBase",{enumerable:!0,get:function(){return jbt.InstrumentationBase}});var Hbt=Lwe();Object.defineProperty(nR,"normalize",{enumerable:!0,get:function(){return Hbt.normalize}})});var nZ=F(rR=>{"use strict";A();Object.defineProperty(rR,"__esModule",{value:!0});rR.normalize=rR.InstrumentationBase=void 0;var Qwe=Uwe();Object.defineProperty(rR,"InstrumentationBase",{enumerable:!0,get:function(){return Qwe.InstrumentationBase}});Object.defineProperty(rR,"normalize",{enumerable:!0,get:function(){return Qwe.normalize}})});var Fwe=F(A3=>{"use strict";A();Object.defineProperty(A3,"__esModule",{value:!0});A3.InstrumentationNodeModuleDefinition=void 0;var rZ=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||[]}};A3.InstrumentationNodeModuleDefinition=rZ});var Gwe=F(g3=>{"use strict";A();Object.defineProperty(g3,"__esModule",{value:!0});g3.InstrumentationNodeModuleFile=void 0;var $bt=nZ(),oZ=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,$bt.normalize)(t)}};g3.InstrumentationNodeModuleFile=oZ});var zwe=F(RS=>{"use strict";A();Object.defineProperty(RS,"__esModule",{value:!0});RS.semconvStabilityFromStr=RS.SemconvStability=void 0;var h3;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(h3=RS.SemconvStability||(RS.SemconvStability={}));function qbt(e,t){let n=h3.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=h3.DUPLICATE;break}else o.toLowerCase()===e&&(n=h3.STABLE);return n}RS.semconvStabilityFromStr=qbt});var Hwe=F(ss=>{"use strict";A();Object.defineProperty(ss,"__esModule",{value:!0});ss.semconvStabilityFromStr=ss.SemconvStability=ss.safeExecuteInTheMiddleAsync=ss.safeExecuteInTheMiddle=ss.isWrapped=ss.InstrumentationNodeModuleFile=ss.InstrumentationNodeModuleDefinition=ss.InstrumentationBase=ss.registerInstrumentations=void 0;var Vbt=ywe();Object.defineProperty(ss,"registerInstrumentations",{enumerable:!0,get:function(){return Vbt.registerInstrumentations}});var Ybt=nZ();Object.defineProperty(ss,"InstrumentationBase",{enumerable:!0,get:function(){return Ybt.InstrumentationBase}});var Kbt=Fwe();Object.defineProperty(ss,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return Kbt.InstrumentationNodeModuleDefinition}});var Jbt=Gwe();Object.defineProperty(ss,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return Jbt.InstrumentationNodeModuleFile}});var iZ=XJ();Object.defineProperty(ss,"isWrapped",{enumerable:!0,get:function(){return iZ.isWrapped}});Object.defineProperty(ss,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return iZ.safeExecuteInTheMiddle}});Object.defineProperty(ss,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return iZ.safeExecuteInTheMiddleAsync}});var jwe=zwe();Object.defineProperty(ss,"SemconvStability",{enumerable:!0,get:function(){return jwe.SemconvStability}});Object.defineProperty(ss,"semconvStabilityFromStr",{enumerable:!0,get:function(){return jwe.semconvStabilityFromStr}})});function Xbt(){let e=oR[aZ];return e?.helper?e.helper:oR[sZ]?.helper}function eCt(e){let t={helper:e};oR[aZ]=t,oR[sZ]=t}function tCt(){delete oR[aZ],delete oR[sZ]}function oCt(e){return e==="client"?co.CLIENT:co.INTERNAL}function Vwe(e,t,n,r,o){if(Ywe(t.name,o))return;let i={attributes:t.attributes,kind:oCt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,s=>{r.set(t.id,s.spanContext().spanId),t.links&&s.addLinks(t.links.flatMap(l=>{let f=r.get(l);return f?{context:{spanId:f,traceId:s.spanContext().traceId,traceFlags:s.spanContext().traceFlags}}:[]}));let c=n.filter(l=>l.parentId===t.id);for(let l of c)Vwe(e,l,n,r,o);s.end(t.endTime)})}function $we(e,t){return sCt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function sCt(e){return e!=null&&typeof e.then=="function"}function Ywe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var _3,Zbt,Wbt,sZ,aZ,oR,nCt,rCt,iCt,Kwe,qwe,aCt,uCt,Jwe,Zwe=O(()=>{A();ze();_3=se(Hwe(),1);ze();Zbt={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"}},Wbt=Zbt.version.split(".")[0],sZ="PRISMA_INSTRUMENTATION",aZ=`V${Wbt}_PRISMA_INSTRUMENTATION`,oR=globalThis;nCt=process.env.PRISMA_SHOW_ALL_TRACES==="true",rCt="00-10-10-00";iCt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=$t.getSpanContext(e??Ke.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:rCt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)Vwe(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return Ke.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!nCt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(Ywe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return $we(i,t(i,r))}return n.startActiveSpan(o,e,i=>$we(i,t(i,r)))}};Kwe={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},qwe=Kwe.version,aCt=Kwe.name,uCt="@prisma/client",Jwe=class extends _3.InstrumentationBase{tracerProvider;constructor(e={}){super(aCt,qwe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new _3.InstrumentationNodeModuleDefinition(uCt,[qwe])]}enable(){let e=this._config;eCt(new iCt({tracerProvider:this.tracerProvider??$t.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){tCt()}isEnabled(){return Xbt()!==void 0}}});function cCt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function Xwe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function lCt(e){return e==="client"?co.CLIENT:co.INTERNAL}var Wwe,uZ,dCt,eke,tke=O(()=>{A();ze();Zwe();dt();gr();Wwe="Prisma";uZ=class extends Jwe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=Xwe();cCt(t)&&(t.createEngineSpan=n=>{let r=$t.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Ko(()=>{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 s=lCt(i.kind),c=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(S=>({context:{traceId:S.trace_id,spanId:S.span_id,traceFlags:Ja.SAMPLED}})),y=$t.setSpanContext(Ke.active(),{traceId:f,spanId:c,traceFlags:Ja.SAMPLED});Ke.with(y,()=>{let S={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=S,r.startSpan(i.name,{kind:s,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};dCt=at(Wwe,e=>new uZ(e)),eke=e=>({name:Wwe,setupOnce(){dCt(e)},setup(t){Xwe()&&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 nke=F(iR=>{"use strict";A();Object.defineProperty(iR,"__esModule",{value:!0});iR.PACKAGE_NAME=iR.PACKAGE_VERSION=void 0;iR.PACKAGE_VERSION="0.60.0";iR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var cZ=F($m=>{"use strict";A();Object.defineProperty($m,"__esModule",{value:!0});$m.HapiLifecycleMethodNames=$m.HapiLayerType=$m.handlerPatched=$m.HapiComponentName=void 0;$m.HapiComponentName="@hapi/hapi";$m.handlerPatched=Symbol("hapi-handler-patched");$m.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};$m.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var rke=F(E3=>{"use strict";A();Object.defineProperty(E3,"__esModule",{value:!0});E3.ATTR_HTTP_METHOD=void 0;E3.ATTR_HTTP_METHOD="http.method"});var lZ=F(xO=>{"use strict";A();Object.defineProperty(xO,"__esModule",{value:!0});xO.AttributeNames=void 0;var pCt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(pCt=xO.AttributeNames||(xO.AttributeNames={}))});var ske=F(as=>{"use strict";A();Object.defineProperty(as,"__esModule",{value:!0});as.getPluginFromInput=as.getExtMetadata=as.getRouteMetadata=as.isPatchableExtMethod=as.isDirectExtInput=as.isLifecycleExtEventObj=as.isLifecycleExtType=as.getPluginName=void 0;var oke=(Zn(),Me(Fr)),fCt=rke(),DO=cZ(),lE=lZ(),ike=on();function mCt(e){return e.name?e.name:e.pkg.name}as.getPluginName=mCt;var ACt=e=>typeof e=="string"&&DO.HapiLifecycleMethodNames.has(e);as.isLifecycleExtType=ACt;var gCt=e=>{let t=e?.type;return t!==void 0&&(0,as.isLifecycleExtType)(t)};as.isLifecycleExtEventObj=gCt;var hCt=e=>Array.isArray(e)&&e.length<=3&&(0,as.isLifecycleExtType)(e[0])&&typeof e[1]=="function";as.isDirectExtInput=hCt;var _Ct=e=>!Array.isArray(e);as.isPatchableExtMethod=_Ct;var ECt=(e,t,n)=>{let r={[oke.ATTR_HTTP_ROUTE]:e.path};t&ike.SemconvStability.OLD&&(r[fCt.ATTR_HTTP_METHOD]=e.method),t&ike.SemconvStability.STABLE&&(r[oke.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[lE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.PLUGIN,r[lE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[lE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};as.getRouteMetadata=ECt;var yCt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[lE.AttributeNames.EXT_TYPE]:e,[lE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT,[lE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[lE.AttributeNames.EXT_TYPE]:e,[lE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT},name:r}};as.getExtMetadata=yCt;var SCt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;as.getPluginFromInput=SCt});var cke=F(y3=>{"use strict";A();Object.defineProperty(y3,"__esModule",{value:!0});y3.HapiInstrumentation=void 0;var Hl=(ze(),Me(We)),ake=br(),BO=on(),uke=nke(),NO=cZ(),Fg=ske(),dZ=class extends BO.InstrumentationBase{_semconvStability;constructor(t={}){super(uke.PACKAGE_NAME,uke.PACKAGE_VERSION,t),this._semconvStability=(0,BO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new BO.InstrumentationNodeModuleDefinition(NO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,BO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,BO.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 s=t.apply(this,[i]);return r._wrap(s,"route",c=>n._getServerRoutePatch.bind(n)(c)),r._wrap(s,"ext",c=>n._getServerExtPatch.bind(n)(c)),r._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let s of o){let c=(0,Fg.getPluginFromInput)(s);n._wrapRegisterHandler(c)}else{let s=(0,Fg.getPluginFromInput)(o);n._wrapRegisterHandler(s)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let s=i[0];for(let c=0;c<s.length;c++){let l=s[c];if((0,Fg.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[c]=f}}return t.apply(this,i)}else if((0,Fg.isDirectExtInput)(i)){let s=i,c=s[1],l=r._wrapExtMethods(c,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,Fg.isLifecycleExtEventObj)(i[0])){let s=i[0],c=r._wrapExtMethods(s.method,s.type,n);return s.method=c,t.call(this,s)}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 s=r._wrapRouteHandler.call(r,o[i],n);o[i]=s}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Fg.getPluginName)(t),o=t.register,i=this,s=function(c,l){return i._wrap(c,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(c,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,c,l)};t.register=s}_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,Fg.isPatchableExtMethod)(t))return t[NO.handlerPatched]===!0?t:(t[NO.handlerPatched]=!0,async function(...s){if(Hl.trace.getSpan(Hl.context.active())===void 0)return await t.apply(this,s);let c=(0,Fg.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Hl.context.with(Hl.trace.setSpan(Hl.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:Hl.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[NO.handlerPatched]===!0)return t;t[NO.handlerPatched]=!0;let o=i=>async function(...s){if(Hl.trace.getSpan(Hl.context.active())===void 0)return await i.call(this,...s);let c=(0,ake.getRPCMetadata)(Hl.context.active());c?.type===ake.RPCType.HTTP&&(c.route=t.path);let l=(0,Fg.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await Hl.context.with(Hl.trace.setSpan(Hl.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:Hl.SpanStatusCode.ERROR,message:h.message}),h}finally{f.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(s){let c=i(s);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}};y3.HapiInstrumentation=dZ});var lke=F(sR=>{"use strict";A();Object.defineProperty(sR,"__esModule",{value:!0});sR.AttributeNames=sR.HapiInstrumentation=void 0;var TCt=cke();Object.defineProperty(sR,"HapiInstrumentation",{enumerable:!0,get:function(){return TCt.HapiInstrumentation}});var ICt=lZ();Object.defineProperty(sR,"AttributeNames",{enumerable:!0,get:function(){return ICt.AttributeNames}})});var dke,pke,fke,bCt,mke,Ake=O(()=>{A();dke=se(lke(),1);gr();pke="Hapi",fke=at(pke,()=>new dke.HapiInstrumentation),bCt=(()=>({name:pke,setupOnce(){fke()}})),mke=bCt});var dE,OO,pZ=O(()=>{A();dE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},OO={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var T3,CCt,vCt,S3,gke=O(()=>{A();ze();T3=se(on(),1);dt();pZ();CCt="@sentry/instrumentation-hono",vCt="0.0.1",S3=class extends T3.InstrumentationBase{constructor(t={}){super(CCt,vCt,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 s=o.slice(1);return n.apply(this,[i,...s.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(s=>t._wrapHandler(s))])}}}_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 s=o.slice(1);return n.apply(this,[i,...s.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,s=n.tracer.startSpan(i);return Ke.with($t.setSpan(Ke.active(),s),()=>n._safeExecute(()=>{let c=t.apply(this,[r,o]);if(ba(c))return c.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[dE.HONO_TYPE]:f,[dE.HONO_NAME]:f===OO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(c);return s.setAttributes({[dE.HONO_TYPE]:l,[dE.HONO_NAME]:l===OO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),c}},()=>s.end(),c=>{n._handleError(s,c),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return ba(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?OO.MIDDLEWARE:OO.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:di.ERROR,message:n.message}),t.recordException(n))}}});function RCt(e){let t=Ot(e).data,n=t[dE.HONO_TYPE];if(t[Xt]||!n)return;e.setAttributes({[kt]:"auto.http.otel.hono",[Xt]:`${n}.hono`});let r=t[dE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),vn()===Qd()){bs&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[fg],i=t[My];typeof o=="string"&&typeof i=="string"&&vn().setTransactionName(`${i} ${o}`)}var hke,_ke,xCt,Eke,yke=O(()=>{A();Zn();dt();gr();gS();pZ();gke();hke="Hono";_ke=at(hke,()=>new S3({responseHook:e=>{RCt(e)}})),xCt=(()=>({name:hke,setupOnce(){_ke()}})),Eke=xCt});var I3=F(wO=>{"use strict";A();Object.defineProperty(wO,"__esModule",{value:!0});wO.KoaLayerType=void 0;var DCt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(DCt=wO.KoaLayerType||(wO.KoaLayerType={}))});var Ske=F(aR=>{"use strict";A();Object.defineProperty(aR,"__esModule",{value:!0});aR.PACKAGE_NAME=aR.PACKAGE_VERSION=void 0;aR.PACKAGE_VERSION="0.62.0";aR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var fZ=F(kO=>{"use strict";A();Object.defineProperty(kO,"__esModule",{value:!0});kO.AttributeNames=void 0;var BCt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(BCt=kO.AttributeNames||(kO.AttributeNames={}))});var Ike=F(uR=>{"use strict";A();Object.defineProperty(uR,"__esModule",{value:!0});uR.isLayerIgnored=uR.getMiddlewareMetadata=void 0;var Tke=I3(),b3=fZ(),NCt=(Zn(),Me(Fr)),OCt=(e,t,n,r)=>n?{attributes:{[b3.AttributeNames.KOA_NAME]:r?.toString(),[b3.AttributeNames.KOA_TYPE]:Tke.KoaLayerType.ROUTER,[NCt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[b3.AttributeNames.KOA_NAME]:t.name??"middleware",[b3.AttributeNames.KOA_TYPE]:Tke.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};uR.getMiddlewareMetadata=OCt;var wCt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));uR.isLayerIgnored=wCt});var bke=F(C3=>{"use strict";A();Object.defineProperty(C3,"__esModule",{value:!0});C3.kLayerPatched=void 0;C3.kLayerPatched=Symbol("koa-layer-patched")});var Bke=F(v3=>{"use strict";A();Object.defineProperty(v3,"__esModule",{value:!0});v3.KoaInstrumentation=void 0;var qm=(ze(),Me(We)),PO=on(),Cke=I3(),vke=Ske(),Rke=Ike(),xke=br(),Dke=bke(),mZ=class extends PO.InstrumentationBase{constructor(t={}){super(vke.PACKAGE_NAME,vke.PACKAGE_VERSION,t)}init(){return new PO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,PO.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,PO.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){qm.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,s=o.stack;for(let c=0;c<s.length;c++){let l=s[c];s[c]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?Cke.KoaLayerType.ROUTER:Cke.KoaLayerType.MIDDLEWARE;return t[Dke.kLayerPatched]===!0||(0,Rke.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(qm.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[Dke.kLayerPatched]=!0,qm.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(qm.trace.getSpan(qm.context.active())===void 0)return t(i,s);let l=(0,Rke.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,xke.getRPCMetadata)(qm.context.active());h?.type===xke.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:y}=this.getConfig();y&&(0,PO.safeExecuteInTheMiddle)(()=>y(f,{context:i,middlewareLayer:t,layerType:o}),b=>{b&&qm.diag.error("koa instrumentation: request hook failed",b)},!0);let S=qm.trace.setSpan(qm.context.active(),f);return qm.context.with(S,async()=>{try{return await t(i,s)}catch(b){throw f.recordException(b),b}finally{f.end()}})})}};v3.KoaInstrumentation=mZ});var Nke=F(pE=>{"use strict";A();Object.defineProperty(pE,"__esModule",{value:!0});pE.KoaLayerType=pE.AttributeNames=pE.KoaInstrumentation=void 0;var kCt=Bke();Object.defineProperty(pE,"KoaInstrumentation",{enumerable:!0,get:function(){return kCt.KoaInstrumentation}});var PCt=fZ();Object.defineProperty(pE,"AttributeNames",{enumerable:!0,get:function(){return PCt.AttributeNames}});var MCt=I3();Object.defineProperty(pE,"KoaLayerType",{enumerable:!0,get:function(){return MCt.KoaLayerType}})});var Oke,wke,kke,LCt,Pke,Mke=O(()=>{A();Oke=se(Nke(),1);Zn();dt();gr();gS();wke="Koa",kke=at(wke,Oke.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){zr(t,"auto.http.otel.koa");let r=Ot(t).data,o=r["koa.type"];o&&t.setAttribute(Xt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),vn()===Qd()){bs&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[fg],c=n.context?.request?.method?.toUpperCase()||"GET";s&&vn().setTransactionName(`${c} ${s}`)}})),LCt=((e={})=>({name:wke,setupOnce(){kke(e)}})),Pke=LCt});var AZ=F(hf=>{"use strict";A();Object.defineProperty(hf,"__esModule",{value:!0});hf.ConnectNames=hf.ConnectTypes=hf.AttributeNames=void 0;var UCt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(UCt=hf.AttributeNames||(hf.AttributeNames={}));var QCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(QCt=hf.ConnectTypes||(hf.ConnectTypes={}));var FCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(FCt=hf.ConnectNames||(hf.ConnectNames={}))});var Lke=F(cR=>{"use strict";A();Object.defineProperty(cR,"__esModule",{value:!0});cR.PACKAGE_NAME=cR.PACKAGE_VERSION=void 0;cR.PACKAGE_VERSION="0.57.0";cR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Uke=F(R3=>{"use strict";A();Object.defineProperty(R3,"__esModule",{value:!0});R3._LAYERS_STORE_PROPERTY=void 0;R3._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Qke=F(mE=>{"use strict";A();Object.defineProperty(mE,"__esModule",{value:!0});mE.generateRoute=mE.replaceCurrentStackRoute=mE.addNewStackLayer=void 0;var GCt=(ze(),Me(We)),fE=Uke(),zCt=e=>{Array.isArray(e[fE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,fE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[fE._LAYERS_STORE_PROPERTY].push("/");let t=e[fE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[fE._LAYERS_STORE_PROPERTY].length?e[fE._LAYERS_STORE_PROPERTY].pop():GCt.diag.warn("Connect: Trying to pop the stack multiple time")}};mE.addNewStackLayer=zCt;var jCt=(e,t)=>{t&&e[fE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};mE.replaceCurrentStackRoute=jCt;var HCt=e=>e[fE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);mE.generateRoute=HCt});var zke=F(AE=>{"use strict";A();Object.defineProperty(AE,"__esModule",{value:!0});AE.ConnectInstrumentation=AE.ANONYMOUS_NAME=void 0;var $Ct=(ze(),Me(We)),Fke=br(),lR=AZ(),Gke=Lke(),x3=on(),qCt=(Zn(),Me(Fr)),gZ=Qke();AE.ANONYMOUS_NAME="anonymous";var hZ=class extends x3.InstrumentationBase{constructor(t={}){super(Gke.PACKAGE_NAME,Gke.PACKAGE_VERSION,t)}init(){return[new x3.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,x3.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,x3.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=lR.ConnectTypes.REQUEST_HANDLER,i=lR.ConnectNames.REQUEST_HANDLER,o=t):(r=lR.ConnectTypes.MIDDLEWARE,i=lR.ConnectNames.MIDDLEWARE,o=n.name||AE.ANONYMOUS_NAME);let s=`${i} - ${o}`,c={attributes:{[qCt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[lR.AttributeNames.CONNECT_TYPE]:r,[lR.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,c)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,c,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[c],y=arguments[l];(0,gZ.replaceCurrentStackRoute)(f,t);let S=(0,Fke.getRPCMetadata)($Ct.context.active());t&&S?.type===Fke.RPCType.HTTP&&(S.route=(0,gZ.generateRoute)(f));let b="";t?b=`request handler - ${t}`:b=`middleware - ${n.name||AE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",b);let x=!1;function D(){x?r._diag.debug(`span ${v.name} - already finished`):(x=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",D)}return h.addListener("close",D),arguments[l]=r._patchNext(y,D),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],s=arguments[o],c=(0,gZ.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,c)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};AE.ConnectInstrumentation=hZ});var Hke=F(tp=>{"use strict";A();Object.defineProperty(tp,"__esModule",{value:!0});tp.ConnectTypes=tp.ConnectNames=tp.AttributeNames=tp.ANONYMOUS_NAME=tp.ConnectInstrumentation=void 0;var jke=zke();Object.defineProperty(tp,"ConnectInstrumentation",{enumerable:!0,get:function(){return jke.ConnectInstrumentation}});Object.defineProperty(tp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return jke.ANONYMOUS_NAME}});var _Z=AZ();Object.defineProperty(tp,"AttributeNames",{enumerable:!0,get:function(){return _Z.AttributeNames}});Object.defineProperty(tp,"ConnectNames",{enumerable:!0,get:function(){return _Z.ConnectNames}});Object.defineProperty(tp,"ConnectTypes",{enumerable:!0,get:function(){return _Z.ConnectTypes}})});var $ke,qke,Vke,VCt,Yke,Kke=O(()=>{A();$ke=se(Hke(),1);gr();qke="Connect",Vke=at(qke,()=>new $ke.ConnectInstrumentation),VCt=(()=>({name:qke,setupOnce(){Vke()}})),Yke=VCt});var Jke=F(oa=>{"use strict";A();Object.defineProperty(oa,"__esModule",{value:!0});oa.DB_SYSTEM_VALUE_MSSQL=oa.ATTR_NET_PEER_PORT=oa.ATTR_NET_PEER_NAME=oa.ATTR_DB_USER=oa.ATTR_DB_SYSTEM=oa.ATTR_DB_STATEMENT=oa.ATTR_DB_SQL_TABLE=oa.ATTR_DB_NAME=void 0;oa.ATTR_DB_NAME="db.name";oa.ATTR_DB_SQL_TABLE="db.sql.table";oa.ATTR_DB_STATEMENT="db.statement";oa.ATTR_DB_SYSTEM="db.system";oa.ATTR_DB_USER="db.user";oa.ATTR_NET_PEER_NAME="net.peer.name";oa.ATTR_NET_PEER_PORT="net.peer.port";oa.DB_SYSTEM_VALUE_MSSQL="mssql"});var Zke=F(dR=>{"use strict";A();Object.defineProperty(dR,"__esModule",{value:!0});dR.once=dR.getSpanName=void 0;function YCt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}dR.getSpanName=YCt;var KCt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};dR.once=KCt});var Wke=F(pR=>{"use strict";A();Object.defineProperty(pR,"__esModule",{value:!0});pR.PACKAGE_NAME=pR.PACKAGE_VERSION=void 0;pR.PACKAGE_VERSION="0.33.0";pR.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var rPe=F(hE=>{"use strict";A();Object.defineProperty(hE,"__esModule",{value:!0});hE.TediousInstrumentation=hE.INJECTED_CTX=void 0;var fR=(ze(),Me(We)),JCt=Fe("events"),Vm=on(),xS=(Zn(),Me(Fr)),gE=Jke(),Xke=Zke(),ePe=Wke(),nPe=Symbol("opentelemetry.instrumentation-tedious.current-database");hE.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var tPe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function D3(e){Object.defineProperty(this,nPe,{value:e,writable:!0})}var EZ=class e extends Vm.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(ePe.PACKAGE_NAME,ePe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Vm.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Vm.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Vm.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of tPe)(0,Vm.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,Vm.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 tPe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return D3.call(this,this.config?.options?.database),this.removeListener("databaseChange",D3),this.on("databaseChange",D3),this.once("end",()=>{this.removeListener("databaseChange",D3)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||fR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",s=new n.Request(i,l=>{o()});Object.defineProperty(s,hE.INJECTED_CTX,{value:!0});let c=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,c,{length:c.length}),t.execSql(s)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(s){if(s?.[hE.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof JCt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let c=0,l=0,f=()=>l++,h=()=>c++,y=this[nPe],S=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),b={};o._dbSemconvStability&Vm.SemconvStability.OLD&&(b[gE.ATTR_DB_SYSTEM]=gE.DB_SYSTEM_VALUE_MSSQL,b[gE.ATTR_DB_NAME]=y,b[gE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,b[gE.ATTR_DB_STATEMENT]=S,b[gE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&Vm.SemconvStability.STABLE&&(b[xS.ATTR_DB_NAMESPACE]=y,b[xS.ATTR_DB_SYSTEM_NAME]=xS.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,b[xS.ATTR_DB_QUERY_TEXT]=S,b[xS.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&Vm.SemconvStability.OLD&&(b[gE.ATTR_NET_PEER_NAME]=this.config?.server,b[gE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&Vm.SemconvStability.STABLE&&(b[xS.ATTR_SERVER_ADDRESS]=this.config?.server,b[xS.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,Xke.getSpanName)(t,y,S,s.table),{kind:fR.SpanKind.CLIENT,attributes:b}),x=(0,Xke.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",x),this.removeListener("end",x),v.setAttribute("tedious.procedure_count",c),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:fR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",x),this.on("end",x),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(x)):o._diag.error("Expected request.callback to be a function");let D=()=>fR.context.with(fR.trace.setSpan(fR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return D();let z=o._buildTraceparent(v);o._injectContextInfo(this,n,z).finally(D)}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)}}};hE.TediousInstrumentation=EZ});var oPe=F(B3=>{"use strict";A();Object.defineProperty(B3,"__esModule",{value:!0});B3.TediousInstrumentation=void 0;var ZCt=rPe();Object.defineProperty(B3,"TediousInstrumentation",{enumerable:!0,get:function(){return ZCt.TediousInstrumentation}})});var iPe,WCt,sPe,aPe,XCt,uPe,cPe=O(()=>{A();iPe=se(oPe(),1);dt();gr();WCt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),sPe="Tedious",aPe=at(sPe,()=>new iPe.TediousInstrumentation({})),XCt=(()=>{let e;return{name:sPe,setupOnce(){let t=aPe();e=_N(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]||"";WCt.has(i)&&n.setAttribute(kt,"auto.db.otel.tedious")}))}}}),uPe=XCt});var lPe=F(mR=>{"use strict";A();Object.defineProperty(mR,"__esModule",{value:!0});mR.PACKAGE_NAME=mR.PACKAGE_VERSION=void 0;mR.PACKAGE_VERSION="0.57.0";mR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var pPe=F(N3=>{"use strict";A();Object.defineProperty(N3,"__esModule",{value:!0});N3.GenericPoolInstrumentation=void 0;var AR=(ze(),Me(We)),DS=on(),dPe=lPe(),yZ="generic-pool",SZ=class extends DS.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(dPe.PACKAGE_NAME,dPe.PACKAGE_VERSION,t)}init(){return[new DS.InstrumentationNodeModuleDefinition(yZ,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,DS.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 DS.InstrumentationNodeModuleDefinition(yZ,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,DS.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 DS.InstrumentationNodeModuleDefinition(yZ,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,DS.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=AR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return AR.context.with(AR.trace.setSpan(i,s),()=>t.call(this,...o).then(c=>(s.end(),c),c=>{throw s.recordException(c),s.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 s=AR.context.active(),c=n.tracer.startSpan("generic-pool.acquire",{},s);return AR.context.with(AR.trace.setSpan(s,c),()=>{t.call(this,(l,f)=>{if(c.end(),o)return o(l,f)},i)})}}};N3.GenericPoolInstrumentation=SZ});var fPe=F(O3=>{"use strict";A();Object.defineProperty(O3,"__esModule",{value:!0});O3.GenericPoolInstrumentation=void 0;var evt=pPe();Object.defineProperty(O3,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return evt.GenericPoolInstrumentation}})});var mPe,APe,gPe,tvt,hPe,_Pe=O(()=>{A();mPe=se(fPe(),1);dt();gr();APe="GenericPool",gPe=at(APe,()=>new mPe.GenericPoolInstrumentation({})),tvt=(()=>{let e;return{name:APe,setupOnce(){let t=gPe();e=_N(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")}))}}}),hPe=tvt});var TZ=F(Ym=>{"use strict";A();Object.defineProperty(Ym,"__esModule",{value:!0});Ym.ATTR_NET_PEER_PORT=Ym.ATTR_NET_PEER_NAME=Ym.ATTR_MESSAGING_SYSTEM=Ym.ATTR_MESSAGING_OPERATION=void 0;Ym.ATTR_MESSAGING_OPERATION="messaging.operation";Ym.ATTR_MESSAGING_SYSTEM="messaging.system";Ym.ATTR_NET_PEER_NAME="net.peer.name";Ym.ATTR_NET_PEER_PORT="net.peer.port"});var IZ=F(gi=>{"use strict";A();Object.defineProperty(gi,"__esModule",{value:!0});gi.ATTR_MESSAGING_CONVERSATION_ID=gi.OLD_ATTR_MESSAGING_MESSAGE_ID=gi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=gi.ATTR_MESSAGING_URL=gi.ATTR_MESSAGING_PROTOCOL_VERSION=gi.ATTR_MESSAGING_PROTOCOL=gi.MESSAGING_OPERATION_VALUE_PROCESS=gi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=gi.ATTR_MESSAGING_DESTINATION_KIND=gi.ATTR_MESSAGING_DESTINATION=void 0;gi.ATTR_MESSAGING_DESTINATION="messaging.destination";gi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";gi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";gi.MESSAGING_OPERATION_VALUE_PROCESS="process";gi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";gi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";gi.ATTR_MESSAGING_URL="messaging.url";gi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";gi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";gi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var bZ=F(BS=>{"use strict";A();Object.defineProperty(BS,"__esModule",{value:!0});BS.DEFAULT_CONFIG=BS.EndOperation=void 0;var nvt;(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"})(nvt=BS.EndOperation||(BS.EndOperation={}));BS.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var TPe=F(hi=>{"use strict";A();Object.defineProperty(hi,"__esModule",{value:!0});hi.isConfirmChannelTracing=hi.unmarkConfirmChannelTracing=hi.markConfirmChannelTracing=hi.getConnectionAttributesFromUrl=hi.getConnectionAttributesFromServer=hi.normalizeExchange=hi.CONNECTION_ATTRIBUTES=hi.CHANNEL_CONSUME_TIMEOUT_TIMER=hi.CHANNEL_SPANS_NOT_ENDED=hi.MESSAGE_STORED_SPAN=void 0;var CZ=(ze(),Me(We)),_E=on(),w3=(Zn(),Me(Fr)),MO=TZ(),k3=IZ();hi.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");hi.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");hi.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");hi.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var vZ=(0,CZ.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),rvt=e=>e!==""?e:"<default>";hi.normalizeExchange=rvt;var ovt=e=>e.replace(/:[^:@/]*@/,":***@"),EPe=(e,t)=>e||(t==="AMQP"?5672:5671),yPe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},SPe=e=>e||"localhost",Km=(e,t,n,r)=>n?{[t]:n}:(CZ.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),ivt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[MO.ATTR_MESSAGING_SYSTEM]:t}:{}};hi.getConnectionAttributesFromServer=ivt;var svt=(e,t)=>{let n={[k3.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=yPe(r?.protocol);Object.assign(n,{...Km(e,k3.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=SPe(r?.hostname);t&_E.SemconvStability.OLD&&Object.assign(n,{...Km(e,MO.ATTR_NET_PEER_NAME,i,"hostname")}),t&_E.SemconvStability.STABLE&&Object.assign(n,{...Km(e,w3.ATTR_SERVER_ADDRESS,i,"hostname")});let s=EPe(r.port,o);t&_E.SemconvStability.OLD&&Object.assign(n,Km(e,MO.ATTR_NET_PEER_PORT,s,"port")),t&_E.SemconvStability.STABLE&&Object.assign(n,Km(e,w3.ATTR_SERVER_PORT,s,"port"))}else{let r=ovt(e);n[k3.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=yPe(o.protocol);Object.assign(n,{...Km(r,k3.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=SPe(o.hostname);t&_E.SemconvStability.OLD&&Object.assign(n,{...Km(r,MO.ATTR_NET_PEER_NAME,s,"hostname")}),t&_E.SemconvStability.STABLE&&Object.assign(n,{...Km(r,w3.ATTR_SERVER_ADDRESS,s,"hostname")});let c=EPe(o.port?parseInt(o.port):void 0,i);t&_E.SemconvStability.OLD&&Object.assign(n,Km(r,MO.ATTR_NET_PEER_PORT,c,"port")),t&_E.SemconvStability.STABLE&&Object.assign(n,Km(r,w3.ATTR_SERVER_PORT,c,"port"))}catch(o){CZ.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};hi.getConnectionAttributesFromUrl=svt;var avt=e=>e.setValue(vZ,!0);hi.markConfirmChannelTracing=avt;var uvt=e=>e.deleteValue(vZ);hi.unmarkConfirmChannelTracing=uvt;var cvt=e=>e.getValue(vZ)===!0;hi.isConfirmChannelTracing=cvt});var IPe=F(gR=>{"use strict";A();Object.defineProperty(gR,"__esModule",{value:!0});gR.PACKAGE_NAME=gR.PACKAGE_VERSION=void 0;gR.PACKAGE_VERSION="0.61.0";gR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var CPe=F(L3=>{"use strict";A();Object.defineProperty(L3,"__esModule",{value:!0});L3.AmqplibInstrumentation=void 0;var Xo=(ze(),Me(We)),P3=br(),vr=on(),lvt=TZ(),$l=IZ(),Ku=bZ(),_i=TPe(),bPe=IPe(),M3=[">=0.5.5 <1"],RZ=class extends vr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(bPe.PACKAGE_NAME,bPe.PACKAGE_VERSION,{...Ku.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,vr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...Ku.DEFAULT_CONFIG,...t})}init(){let t=new vr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",M3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new vr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",M3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new vr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",M3,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new vr.InstrumentationNodeModuleDefinition("amqplib",M3,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,vr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,vr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,vr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,vr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,vr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,Ku.EndOperation.Ack)),(0,vr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,Ku.EndOperation.Nack)),(0,vr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,Ku.EndOperation.Reject)),(0,vr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,Ku.EndOperation.AckAll)),(0,vr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,Ku.EndOperation.NackAll)),(0,vr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,vr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,vr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,vr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,vr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,vr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,vr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,vr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,vr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,vr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,vr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,s){return t.call(this,o,i,function(c,l){if(c==null){let f=(0,_i.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,_i.getConnectionAttributesFromServer)(l);l[_i.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,Ku.EndOperation.ChannelClosed,void 0);let i=this[_i.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[_i.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,Ku.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(s){return o.endAllSpansOnChannel(this,t,n,s),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(s,c,l){let f=this,h=n===Ku.EndOperation.Reject?c:l,y=f[_i.CHANNEL_SPANS_NOT_ENDED]??[],S=y.findIndex(b=>b.msg===s);if(S<0)o.endConsumerSpan(s,t,n,h);else if(n!==Ku.EndOperation.Reject&&c){for(let b=0;b<=S;b++)o.endConsumerSpan(y[b].msg,t,n,h);y.splice(0,S+1)}else o.endConsumerSpan(s,t,n,h),y.splice(S,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,c){let l=this;if(!Object.prototype.hasOwnProperty.call(l,_i.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let y=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);y.unref(),l[_i.CHANNEL_CONSUME_TIMEOUT_TIMER]=y}l[_i.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let y=h.properties.headers??{},S=Xo.propagation.extract(Xo.ROOT_CONTEXT,y),b=h.fields?.exchange,v;if(r._config.useLinksForConsume){let Q=S?Xo.trace.getSpan(S)?.spanContext():void 0;S=void 0,Q&&(v=[{context:Q}])}let x=r.tracer.startSpan(`${i} process`,{kind:Xo.SpanKind.CONSUMER,attributes:{...l?.connection?.[_i.CONNECTION_ATTRIBUTES],[$l.ATTR_MESSAGING_DESTINATION]:b,[$l.ATTR_MESSAGING_DESTINATION_KIND]:$l.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[$l.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[lvt.ATTR_MESSAGING_OPERATION]:$l.MESSAGING_OPERATION_VALUE_PROCESS,[$l.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[$l.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},S),{consumeHook:D}=r.getConfig();D&&(0,vr.safeExecuteInTheMiddle)(()=>D(x,{moduleVersion:t,msg:h}),Q=>{Q&&Xo.diag.error("amqplib instrumentation: consumerHook error",Q)},!0),c?.noAck||(l[_i.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,P3.hrTime)()}),h[_i.MESSAGE_STORED_SPAN]=x);let k=S||Xo.ROOT_CONTEXT;Xo.context.with(Xo.trace.setSpan(k,x),()=>{s.call(this,h)}),c?.noAck&&(r.callConsumeEndHook(x,h,!1,Ku.EndOperation.AutoAck),x.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,c,l,f){let h=this,{span:y,modifiedOptions:S}=r.createPublishSpan(r,i,s,h,l),{publishHook:b}=r.getConfig();b&&(0,vr.safeExecuteInTheMiddle)(()=>b(y,{moduleVersion:t,exchange:i,routingKey:s,content:c,options:S,isConfirmChannel:!0}),k=>{k&&Xo.diag.error("amqplib instrumentation: publishHook error",k)},!0);let v=function(k,Q){try{f?.call(this,k,Q)}finally{let{publishConfirmHook:z}=r.getConfig();z&&(0,vr.safeExecuteInTheMiddle)(()=>z(y,{moduleVersion:t,exchange:i,routingKey:s,content:c,options:l,isConfirmChannel:!0,confirmError:k}),G=>{G&&Xo.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),k&&y.setStatus({code:Xo.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),y.end()}},x=(0,_i.markConfirmChannelTracing)(Xo.context.active()),D=[...arguments];return D[3]=S,D[4]=Xo.context.bind((0,_i.unmarkConfirmChannelTracing)(Xo.trace.setSpan(x,y)),v),Xo.context.with(x,n.bind(this,...D))}}getPublishPatch(t,n){let r=this;return function(i,s,c,l){if((0,_i.isConfirmChannelTracing)(Xo.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:y}=r.createPublishSpan(r,i,s,f,l),{publishHook:S}=r.getConfig();S&&(0,vr.safeExecuteInTheMiddle)(()=>S(h,{moduleVersion:t,exchange:i,routingKey:s,content:c,options:y,isConfirmChannel:!1}),x=>{x&&Xo.diag.error("amqplib instrumentation: publishHook error",x)},!0);let b=[...arguments];b[3]=y;let v=n.apply(this,b);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,_i.normalizeExchange)(n),c=t.tracer.startSpan(`publish ${s}`,{kind:Xo.SpanKind.PRODUCER,attributes:{...o.connection[_i.CONNECTION_ATTRIBUTES],[$l.ATTR_MESSAGING_DESTINATION]:n,[$l.ATTR_MESSAGING_DESTINATION_KIND]:$l.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[$l.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[$l.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[$l.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},Xo.propagation.inject(Xo.trace.setSpan(Xo.context.active(),c),l.headers),{span:c,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[_i.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:Xo.SpanStatusCode.ERROR,message:r!==Ku.EndOperation.ChannelClosed&&r!==Ku.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[_i.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[_i.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[_i.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,vr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&Xo.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,P3.hrTime)(),r=t[_i.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],c=(0,P3.hrTimeDuration)(s.timeOfConsume,n);if((0,P3.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(s.msg,null,Ku.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};L3.AmqplibInstrumentation=RZ});var RPe=F(EE=>{"use strict";A();Object.defineProperty(EE,"__esModule",{value:!0});EE.EndOperation=EE.DEFAULT_CONFIG=EE.AmqplibInstrumentation=void 0;var dvt=CPe();Object.defineProperty(EE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return dvt.AmqplibInstrumentation}});var vPe=bZ();Object.defineProperty(EE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return vPe.DEFAULT_CONFIG}});Object.defineProperty(EE,"EndOperation",{enumerable:!0,get:function(){return vPe.EndOperation}})});var xPe,DPe,pvt,BPe,fvt,NPe,OPe=O(()=>{A();xPe=se(RPe(),1);gr();DPe="Amqplib",pvt={consumeEndHook:e=>{zr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{zr(e,"auto.amqplib.otel.publisher")}},BPe=at(DPe,()=>new xPe.AmqplibInstrumentation(pvt)),fvt=(()=>({name:DPe,setupOnce(){BPe()}})),NPe=fvt});var LO,xZ=O(()=>{A();LO="VercelAI"});function Avt(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 gvt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(hvt(t.content),_vt(t.content))}function hvt(e){for(let t of e){if(!Avt(t))continue;let n=o7(t.toolCallId);n?wl(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"),nn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):wl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),nn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function _vt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&i7(t.toolCallId)}function Evt(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 Q3,mvt,wPe,U3,kPe=O(()=>{A();Q3=se(on(),1);dt();xZ();mvt=[">=3.0.0 <7"],wPe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];U3=class e extends Q3.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 Q3.InstrumentationNodeModuleDefinition("ai",mvt,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,s)=>{let c=s[0].experimental_telemetry||{},l=c.isEnabled,f=gt(),h=f?.getIntegrationByName(LO),y=h?.options,S=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:b,recordOutputs:v}=Evt(y,c,l,S);return s[0].experimental_telemetry={...c,isEnabled:l!==void 0?l:!0,recordInputs:b,recordOutputs:v},df(()=>Reflect.apply(o,i,s),x=>{x&&typeof x=="object"&&Xi(x,"_sentry_active_span",Pc())},()=>{},x=>{gvt(x)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of wPe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=wPe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function yvt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var PPe,Svt,MPe,LPe=O(()=>{A();dt();gr();xZ();kPe();PPe=at(LO,()=>new U3({}));Svt=((e={})=>{let t;return{name:LO,options:e,setupOnce(){t=PPe()},afterAllSetup(n){e.force??yvt(n)?HU(n):t?.callWhenPatched(()=>HU(n))}}}),MPe=Svt});var G3,Tvt,F3,UPe=O(()=>{A();G3=se(on(),1);dt();Tvt=[">=4.0.0 <7"],F3=class extends G3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",Wn,t)}init(){return new G3.InstrumentationNodeModuleDefinition("openai",Tvt,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(...s){if(Xy(j_))return Reflect.construct(r,s);let c=Reflect.construct(r,s);return VU(c,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let c=Object.getOwnPropertyDescriptor(r,s);c&&Object.defineProperty(i,s,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 QPe,Ivt,FPe,GPe=O(()=>{A();dt();gr();UPe();QPe=at(j_,e=>new F3(e)),Ivt=((e={})=>({name:j_,setupOnce(){QPe(e)}})),FPe=Ivt});var j3,bvt,z3,zPe=O(()=>{A();j3=se(on(),1);dt();bvt=[">=0.19.2 <1.0.0"],z3=class extends j3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",Wn,t)}init(){return new j3.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",bvt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(Xy(H_))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return YU(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}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 jPe,Cvt,HPe,$Pe=O(()=>{A();dt();gr();zPe();jPe=at(H_,e=>new z3(e)),Cvt=((e={})=>({name:H_,options:e,setupOnce(){jPe(e)}})),HPe=Cvt});var hR,qPe,H3,VPe=O(()=>{A();hR=se(on(),1);dt();qPe=[">=0.10.0 <2"],H3=class extends hR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",Wn,t)}init(){return new hR.InstrumentationNodeModuleDefinition("@google/genai",qPe,n=>this._patch(n),n=>n,[new hR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",qPe,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(Xy($_))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return KU(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}return gN(t,"GoogleGenAI",o),t}}});var YPe,vvt,KPe,JPe=O(()=>{A();dt();gr();VPe();YPe=at($_,e=>new H3(e)),vvt=((e={})=>({name:$_,setupOnce(){YPe(e)}})),KPe=vvt});function Rvt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function xvt(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 l=c.callbacks,f=Rvt(l,t);return c.callbacks=f,Reflect.apply(r,o,i)}})}var yE,$3,q3,ZPe=O(()=>{A();yE=se(on(),1);dt();$3=[">=0.1.0 <2.0.0"];q3=class extends yE.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 yE.InstrumentationNodeModuleDefinition(r,$3,this._patch.bind(this),o=>o,[new yE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,$3,this._patch.bind(this),o=>o)]));return t.push(new yE.InstrumentationNodeModuleDefinition("langchain",$3,this._patch.bind(this),r=>r,[new yE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",$3,this._patch.bind(this),r=>r)])),t}_patch(t){SV([j_,H_,$_]);let n=XU(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(l=>typeof l=="function"&&r.includes(l.name));if(!i)return;let s=i.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let c=["invoke","stream","batch"];for(let l of c){let f=s[l];typeof f=="function"&&(s[l]=xvt(f,n))}}}});var WPe,Dvt,XPe,e2e=O(()=>{A();dt();gr();ZPe();WPe=at(JU,e=>new q3(e)),Dvt=((e={})=>({name:JU,setupOnce(){WPe(e)}})),XPe=Dvt});var _R,t2e,V3,n2e=O(()=>{A();_R=se(on(),1);dt();t2e=[">=0.0.0 <2.0.0"],V3=class extends _R.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",Wn,t)}init(){return new _R.InstrumentationNodeModuleDefinition("@langchain/langgraph",t2e,this._patch.bind(this),n=>n,[new _R.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",t2e,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&tQ(t.StateGraph.prototype,this.getConfig()),t}}});var r2e,Bvt,o2e,i2e=O(()=>{A();dt();gr();n2e();r2e=at(eQ,e=>new V3(e)),Bvt=((e={})=>({name:eQ,setupOnce(){r2e(e)}})),o2e=Bvt});import*as a2e from"node:net";function u2e(e,t,n,r,o){let s=()=>{},c=o.firestoreSpanCreationHook;typeof c=="function"&&(s=h=>{(0,Gg.safeExecuteInTheMiddle)(()=>c(h),y=>{y&&Bl.error(y?.message)},!0)});let l=new Gg.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>s2e(h,n,r,e,s)),f=["@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 f)l.files.push(new Gg.InstrumentationNodeModuleFile(h,t,y=>s2e(y,n,r,e,s),y=>c2e(y,r)));return l}function s2e(e,t,n,r,o){return c2e(e,n),t(e,"addDoc",Nvt(r,o)),t(e,"getDocs",wvt(r,o)),t(e,"setDoc",kvt(r,o)),t(e,"deleteDoc",Ovt(r,o)),e}function c2e(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Gg.isWrapped)(e[n])&&t(e,n);return e}function Nvt(e,t){return function(r){return function(o,i){let s=K3(e,"addDoc",o);return t(s),Y3(s,()=>r(o,i))}}}function Ovt(e,t){return function(r){return function(o){let i=K3(e,"deleteDoc",o.parent||o);return t(i),Y3(i,()=>r(o))}}}function wvt(e,t){return function(r){return function(o){let i=K3(e,"getDocs",o);return t(i),Y3(i,()=>r(o))}}}function kvt(e,t){return function(r){return function(o,i,s){let c=K3(e,"setDoc",o.parent||o);return t(c),Y3(c,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function Y3(e,t){return Ke.with($t.setSpan(Ke.active(),e),()=>(0,Gg.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function K3(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:co.CLIENT});return Mvt(r,n),r.setAttribute(oC,t),r}function Pvt(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(a2e.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 Mvt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[$9]:t.path,[q9]:n.name,[Py]:"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:l}=Pvt(i);c&&(s[e5]=c),l&&(s[t5]=l),e.setAttributes(s)}var Gg,l2e=O(()=>{A();ze();Gg=se(on(),1);Zn()});function d2e(e,t,n,r,o){let i=()=>{},s=()=>{},c=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(S,b)=>{(0,zg.safeExecuteInTheMiddle)(()=>f(S,b),v=>{v&&Bl.error(v?.message)},!0)}),typeof l=="function"&&(i=S=>{(0,zg.safeExecuteInTheMiddle)(()=>l(S),b=>{b&&Bl.error(b?.message)},!0)});let h=new zg.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:S,triggerType:b})=>{h.files.push(new zg.InstrumentationNodeModuleFile(S,t,v=>Lvt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:c},b),v=>p2e(v,r)))}),h}function Ju(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],c=typeof i[0]=="function"?void 0:i[0];if(!s)return o.call(this,...i);let l=async function(...f){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",y=e.startSpan(`firebase.function.${n}`,{kind:co.SERVER}),S={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(S["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(S["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),y.setAttributes(S),t?.requestHook?.(y),Ke.with($t.setSpan(Ke.active(),y),async()=>{let b,v;try{v=await s.apply(this,f)}catch(x){b=x}if(t?.responseHook?.(y,b),b&&y.recordException(b),y.end(),b)throw await t?.errorHook?.(y,b),b;return v})};return c?o.call(this,c,l):o.call(this,l)}}}function Lvt(e,t,n,r,o,i){switch(p2e(e,n),i){case"function":t(e,"onRequest",Ju(r,o,"http.request")),t(e,"onCall",Ju(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",Ju(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",Ju(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",Ju(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",Ju(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",Ju(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",Ju(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",Ju(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",Ju(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",Ju(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",Ju(r,o,"storage.object.finalized")),t(e,"onObjectArchived",Ju(r,o,"storage.object.archived")),t(e,"onObjectDeleted",Ju(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",Ju(r,o,"storage.object.metadataUpdated"));break}return e}function p2e(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,zg.isWrapped)(e[r])&&t(e,r);return e}var zg,f2e=O(()=>{A();ze();zg=se(on(),1)});var A2e,m2e,Uvt,Qvt,J3,g2e=O(()=>{A();A2e=se(on(),1);dt();l2e();f2e();m2e={},Uvt=[">=3.0.0 <5"],Qvt=[">=6.0.0 <7"],J3=class extends A2e.InstrumentationBase{constructor(t=m2e){super("@sentry/instrumentation-firebase",Wn,t)}setConfig(t={}){super.setConfig({...m2e,...t})}init(){let t=[];return t.push(u2e(this.tracer,Uvt,this._wrap,this._unwrap,this.getConfig())),t.push(d2e(this.tracer,Qvt,this._wrap,this._unwrap,this.getConfig())),t}}});var h2e,Fvt,_2e,Gvt,E2e,y2e=O(()=>{A();dt();gr();g2e();h2e="Firebase",Fvt={firestoreSpanCreationHook:e=>{zr(e,"auto.firebase.otel.firestore"),e.setAttribute(Xt,"db.query")},functions:{requestHook:e=>{zr(e,"auto.firebase.otel.functions"),e.setAttribute(Xt,"http.request")},errorHook:async(e,t)=>{t&&(nn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await zC(2e3))}}},_2e=at(h2e,()=>new J3(Fvt)),Gvt=(()=>({name:h2e,setupOnce(){_2e()}})),E2e=Gvt});function S2e(){return[bDe(),oBe(),NBe(),Eke(),_Ne(),wNe(),$Ne(),rOe(),POe(),nwe(),eke(),mke(),Pke(),Yke(),uPe(),hPe(),YBe(),NPe(),iNe(),XPe(),o2e(),MPe(),FPe(),HPe(),KPe(),swe(),E2e()]}var T2e=O(()=>{A();OPe();$Pe();Kke();CDe();aBe();y2e();_Pe();JPe();wBe();Ake();yke();KBe();Mke();e2e();i2e();sNe();ENe();kNe();qNe();oOe();GPe();rwe();awe();tke();MOe();cPe();LPe()});function b2e(e,t={}){e.getOptions().debug&&MY();let[n,r]=zvt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function zvt(e,t={}){let n=new I2e.BasicTracerProvider({sampler:new aF(e),resource:(0,Z3.defaultResource)().merge((0,Z3.resourceFromAttributes)({[n5]:"node",[H9]:"sentry",[r5]:Wn})),forceFlushTimeoutMillis:500,spanProcessors:[new sF({timeout:jvt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});$t.setGlobalTracerProvider(n),ef.setGlobalPropagator(new iF);let r=new cF;return Ke.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function jvt(e){if(e!=null){if(e>DZ)return bs&&J.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${DZ}`),DZ;if(e<=0||Number.isNaN(e)){bs&&J.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var Z3,I2e,DZ,C2e=O(()=>{A();ze();Z3=se(K7(),1),I2e=se(SY(),1);Zn();dt();gr();yv();gS();DZ=1e6});function v2e(){return gF().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(eDe(),cDe())}function R2e(e){return[...v2e(),...ki(e)?S2e():[]]}function BZ(e={}){return Hvt(e,R2e)}function Hvt(e={},t){eS(e,"node");let n=uK({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(b2e(n,{spanProcessors:e.openTelemetrySpanProcessors}),hF()),n}var x2e=O(()=>{A();dt();gr();tDe();lDe();T2e();C2e()});var ER=O(()=>{A();x2e();dt();gr()});function Zr(){return $vt}function cu(){return D2e}function B2e(){return qvt}var $vt,D2e,qvt,$c=O(()=>{"use strict";A();$vt="prod",D2e="0.1.159",qvt=`@tanagram/lore/${D2e}`});function Zvt(e=""){if(!Kvt.test(e))return e!==e.toLowerCase()}function N2e(e,t){let n=t??Jvt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let c of e){let l=n.includes(c);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Zvt(c);if(s===!1){if(i===!1&&f===!0){r.push(o),o=c,i=f;continue}if(i===!0&&f===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+c,i=f;continue}}o+=c,i=f,s=l}return r.push(o),r}function Wvt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Xvt(e){return e?e[0].toLowerCase()+e.slice(1):""}function eRt(e,t){return e?(Array.isArray(e)?e:N2e(e)).map(n=>Wvt(t?.normalize?n.toLowerCase():n)).join(""):""}function QO(e,t){return Xvt(eRt(e||"",t))}function W3(e,t){return e?(Array.isArray(e)?e:N2e(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function O2e(e){return W3(e||"","_")}var Kvt,Jvt,w2e=O(()=>{A();Kvt=/\d/,Jvt=["-","_","/","."]});import{parseArgs as tRt}from"node:util";function n6(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function NZ(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 ql(e){return typeof e=="function"?e():e}function nRt(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),o=t.alias||{},i=t.default||{},s=new Map,c=new Map;for(let[D,k]of Object.entries(o)){let Q=k;for(let z of Q)s.set(D,z),c.has(z)||c.set(z,[]),c.get(z).push(D),s.set(z,D),c.has(D)||c.set(D,[]),c.get(D).push(z)}let l={};function f(D){if(n.has(D))return"boolean";let k=c.get(D)||[];for(let Q of k)if(n.has(Q))return"boolean";return"string"}function h(D){if(r.has(D))return!0;let k=c.get(D)||[];for(let Q of k)if(r.has(Q))return!0;return!1}let y=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(i)]);for(let D of y)l[D]||(l[D]={type:f(D),default:i[D]});for(let[D,k]of s.entries())D.length===1&&l[k]&&!l[k].short&&(l[k].short=D);let S=[],b={};for(let D=0;D<e.length;D++){let k=e[D];if(k==="--"){S.push(...e.slice(D));break}if(k.startsWith("--no-")){let Q=k.slice(5);b[Q]=!0;continue}S.push(k)}let v;try{v=tRt({args:S,options:Object.keys(l).length>0?l:void 0,allowPositionals:!0,strict:!1})}catch{v={values:{},positionals:S}}let x={_:[]};x._=v.positionals;for(let[D,k]of Object.entries(v.values)){let Q=k;f(D)==="boolean"&&typeof k=="string"?Q=k!=="false":h(D)&&typeof k=="boolean"&&(Q=""),x[D]=Q}for(let[D]of Object.entries(b)){x[D]=!1;let k=s.get(D);k&&(x[k]=!1);let Q=c.get(D);if(Q)for(let z of Q)x[z]=!1}for(let[D,k]of s.entries())x[D]!==void 0&&x[k]===void 0&&(x[k]=x[D]),x[k]!==void 0&&x[D]===void 0&&(x[D]=x[k]),x[D]!==x[k]&&i[k]===x[k]&&(x[k]=x[D]);return x}function oRt(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=M2e(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 l=QO(c.name),f=W3(c.name);if(l!==c.name||f!==c.name){let h=n6(n.alias[c.name]||[]);l!==c.name&&!h.includes(l)&&h.push(l),f!==c.name&&!h.includes(f)&&h.push(f),h.length>0&&(n.alias[c.name]=h)}}let o=nRt(e,n),[...i]=o._,s=new Proxy(o,{get(c,l){return c[l]??c[QO(l)]??c[W3(l)]}});for(let[,c]of r.entries())if(c.type==="positional"){let l=i.shift();if(l!==void 0)s[c.name]=l;else{if(c.default===void 0&&c.required!==!1)throw new NS(`Missing required positional argument: ${c.name.toUpperCase()}`,"EARG");s[c.name]=c.default}}else if(c.type==="enum"){let l=s[c.name],f=c.options||[];if(l!==void 0&&f.length>0&&!f.includes(l))throw new NS(`Invalid value for argument: ${_f(`--${c.name}`)} (${_f(l)}). Expected one of: ${f.map(h=>_f(h)).join(", ")}.`,"EARG")}else if(c.required&&s[c.name]===void 0)throw new NS(`Missing required argument: --${c.name}`,"EARG");return s}function M2e(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:n6(r.alias)});return t}async function iRt(e){return Promise.all(e.map(t=>ql(t)))}async function OS(e,t){let n=await ql(e.args||{}),r=oRt(t.rawArgs,n),o={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},i=await iRt(e.plugins??[]),s,c;try{for(let h of i)await h.setup?.(o);typeof e.setup=="function"&&await e.setup(o);let f=await ql(e.subCommands);if(f&&Object.keys(f).length>0){let h=sRt(t.rawArgs,n),y=t.rawArgs[h];if(y){let S=await k2e(f,y);if(!S)throw new NS(`Unknown command ${_f(y)}`,"E_UNKNOWN_COMMAND");await OS(S,{rawArgs:t.rawArgs.slice(h+1)})}else{let S=await ql(e.default);if(S){if(e.run)throw new NS("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let b=await k2e(f,S);if(!b)throw new NS(`Default sub command ${_f(S)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await OS(b,{rawArgs:t.rawArgs})}else if(!e.run)throw new NS("No command specified.","E_NO_COMMAND")}}typeof e.run=="function"&&(s=await e.run(o))}catch(f){c=f}let l=[];if(typeof e.cleanup=="function")try{await e.cleanup(o)}catch(f){l.push(f)}for(let f of[...i].reverse())try{await f.cleanup?.(o)}catch(h){l.push(h)}if(c)throw c;if(l.length===1)throw l[0];if(l.length>1)throw new Error("Multiple cleanup errors",{cause:l});return{result:s}}async function k2e(e,t){if(t in e)return ql(e[t]);for(let n of Object.values(e)){let r=await ql(n),o=await ql(r?.meta);if(o?.alias&&n6(o.alias).includes(t))return r}}function sRt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&aRt(r,t)&&n++;continue}return n}return-1}function aRt(e,t){let n=e.replace(/^-{1,2}/,""),r=QO(n);for(let[o,i]of Object.entries(t))if(!(i.type!=="string"&&i.type!=="enum")&&(r===QO(o)||(Array.isArray(i.alias)?i.alias:i.alias?[i.alias]:[]).includes(n)))return!0;return!1}async function wZ(e,t){let n=await ql(e.meta||{}),r=M2e(await ql(e.args||{})),o=await ql(t?.meta||{}),i=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),s=[],c=[],l=[],f=[];for(let b of r)if(b.type==="positional"){let v=b.name.toUpperCase(),x=b.required!==!1&&b.default===void 0;c.push([_f(v+OZ(b)),P2e(b,x)]),f.push(x?`<${v}>`:`[${v}]`)}else{let v=b.required===!0&&b.default===void 0,x=[...(b.alias||[]).map(D=>`-${D}`),`--${b.name}`].join(", ")+OZ(b);if(s.push([_f(x),P2e(b,v)]),b.type==="boolean"&&(b.default===!0||b.negativeDescription)&&!uRt.test(b.name)){let D=[...(b.alias||[]).map(k=>`--no-${k}`),`--no-${b.name}`].join(", ");s.push([_f(D),[b.negativeDescription,v?t6("(Required)"):""].filter(Boolean).join(" ")])}v&&f.push(`--${b.name}`+OZ(b))}if(e.subCommands){let b=[],v=await ql(e.subCommands);for(let[x,D]of Object.entries(v)){let k=await ql((await ql(D))?.meta);if(k?.hidden)continue;let Q=n6(k?.alias),z=[x,...Q].join(", ");l.push([_f(z),k?.description||""]),b.push(x,...Q)}f.push(b.join("|"))}let h=[],y=n.version||o.version;h.push(t6(`${n.description} (${i+(y?` v${y}`:"")})`),"");let S=s.length>0||c.length>0;return h.push(`${e6(X3("USAGE"))} ${_f(`${i}${S?" [OPTIONS]":""} ${f.join(" ")}`)}`,""),c.length>0&&(h.push(e6(X3("ARGUMENTS")),""),h.push(NZ(c," ")),h.push("")),s.length>0&&(h.push(e6(X3("OPTIONS")),""),h.push(NZ(s," ")),h.push("")),l.length>0&&(h.push(e6(X3("COMMANDS")),""),h.push(NZ(l," ")),h.push("",`Use ${_f(`${i} <command> --help`)} for more information about a command.`)),h.filter(b=>typeof b=="string").join(`
|
|
40
40
|
`)}function OZ(e){let t=e.valueHint?`=<${e.valueHint}>`:"",n=t||`=<${O2e(e.name)}>`;return!e.type||e.type==="positional"||e.type==="boolean"?t:e.type==="enum"&&e.options?.length?`=<${e.options.join("|")}>`:n}function P2e(e,t){let n=t?t6("(Required)"):"",r=e.default===void 0?"":t6(`(Default: ${e.default})`);return[e.description,n,r].filter(Boolean).join(" ")}var NS,rRt,r6,X3,_f,t6,e6,uRt,kZ=O(()=>{A();w2e();NS=class extends Error{code;constructor(e,t){super(e),this.name="CLIError",this.code=t}};rRt=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||e.TEST||e.CI})(),r6=(e,t=39)=>n=>rRt?n:`\x1B[${e}m${n}\x1B[${t}m`,X3=r6(1,22),_f=r6(36),t6=r6(90),e6=r6(4,24);uRt=/^no[-A-Z]/});function lRt(e){F2e=e}function i6(){return F2e}function ut(e,t){let n=s6({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i6(),FO].filter(r=>!!r)});e.common.issues.push(n)}function Rn(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:(s,c)=>s.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"?{message:r??c.defaultError}:{message:n??c.defaultError},description:o}}function SRt(e,t){return!!((t==="v4"||!t)&&_Rt.test(e)||(t==="v6"||!t)&&ERt.test(e))}function TRt(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(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}function yR(e){if(e instanceof pu){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ef.create(yR(r))}return new pu({...e._def,shape:()=>t})}else return e instanceof Hg?new Hg({...e._def,type:yR(e.element)}):e instanceof Ef?Ef.create(yR(e.unwrap())):e instanceof $g?$g.create(yR(e.unwrap())):e instanceof Jm?Jm.create(e.items.map(t=>yR(t))):e}function FZ(e,t){let n=SE(e),r=SE(t);if(e===t)return{valid:!0,data:e};if(n===st.object&&r===st.object){let o=yr.objectKeys(t),i=yr.objectKeys(e).filter(c=>o.indexOf(c)!==-1),s={...e,...t};for(let c of i){let l=FZ(e[c],t[c]);if(!l.valid)return{valid:!1};s[c]=l.data}return{valid:!0,data:s}}else if(n===st.array&&r===st.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],c=t[i],l=FZ(s,c);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===st.date&&r===st.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function z2e(e,t){return new jS({values:e,typeName:Kt.ZodEnum,...Rn(t)})}var yr,LZ,st,SE,qe,cRt,qc,FO,F2e,s6,dRt,du,_n,G2e,Zu,UZ,QZ,GO,a6,Lt,rp,L2e,xn,pRt,fRt,mRt,ARt,gRt,hRt,_Rt,ERt,yRt,TE,wS,kS,PS,MS,SR,LS,US,IE,jg,yf,TR,Hg,pu,QS,o6,u6,FS,Jm,c6,IR,bR,l6,GS,zS,jS,HS,bE,Vl,Ef,$g,$S,CR,vR,IRt,d6,zO,RR,j2e,bRt,Kt,CRt,H2e,$2e,vRt,RRt,q2e,xRt,DRt,BRt,NRt,ORt,wRt,kRt,PRt,MRt,LRt,URt,QRt,FRt,GRt,zRt,jRt,HRt,$Rt,qRt,VRt,YRt,KRt,JRt,ZRt,U2e,WRt,XRt,ext,txt,nxt,rxt,oxt,ixt,sxt,lu,axt,PZ,uxt,np,GZ,DRn,BRn,NRn,V2e,cxt,lxt,dxt,pxt,Y2e,K2e,J2e,MZ,ia,fxt,mxt,Axt,gxt,zZ,jZ,HZ,hxt,Q2e,_xt,Ext,yxt,Sxt,$Z,Sf=O(()=>{A();(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 s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(c=>typeof o[o[c]]!="number"),s={};for(let c of i)s[c]=o[c];return e.objectValues(s)},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 s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},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(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(yr||(yr={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(LZ||(LZ={}));st=yr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),SE=e=>{switch(typeof e){case"undefined":return st.undefined;case"string":return st.string;case"number":return isNaN(e)?st.nan:st.number;case"boolean":return st.boolean;case"function":return st.function;case"bigint":return st.bigint;case"symbol":return st.symbol;case"object":return Array.isArray(e)?st.array:e===null?st.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?st.promise:typeof Map<"u"&&e instanceof Map?st.map:typeof Set<"u"&&e instanceof Set?st.set:typeof Date<"u"&&e instanceof Date?st.date:st.object;default:return st.unknown}},qe=yr.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"]),cRt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),qc=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 s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let c=r,l=0;for(;l<s.path.length;){let f=s.path[l];l===s.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(n(s))):c[f]=c[f]||{_errors:[]},c=c[f],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,yr.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()}};qc.create=e=>new qc(e);FO=(e,t)=>{let n;switch(e.code){case qe.invalid_type:e.received===st.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case qe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,yr.jsonStringifyReplacer)}`;break;case qe.unrecognized_keys:n=`Unrecognized key(s) in object: ${yr.joinValues(e.keys,", ")}`;break;case qe.invalid_union:n="Invalid input";break;case qe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${yr.joinValues(e.options)}`;break;case qe.invalid_enum_value:n=`Invalid enum value. Expected ${yr.joinValues(e.options)}, received '${e.received}'`;break;case qe.invalid_arguments:n="Invalid function arguments";break;case qe.invalid_return_type:n="Invalid function return type";break;case qe.invalid_date:n="Invalid date";break;case qe.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}"`:yr.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case qe.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 qe.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 qe.custom:n="Invalid input";break;case qe.invalid_intersection_types:n="Intersection results could not be merged";break;case qe.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case qe.not_finite:n="Number must be finite";break;default:n=t.defaultError,yr.assertNever(e)}return{message:n}},F2e=FO;s6=e=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i},c="",l=r.filter(f=>!!f).slice().reverse();for(let f of l)c=f(s,{data:t,defaultError:c}).message;return{...o,path:i,message:o.message||c}},dRt=[];du=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 _n;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:s}=o;if(i.status==="aborted"||s.status==="aborted")return _n;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}},_n=Object.freeze({status:"aborted"}),G2e=e=>({status:"dirty",value:e}),Zu=e=>({status:"valid",value:e}),UZ=e=>e.status==="aborted",QZ=e=>e.status==="dirty",GO=e=>e.status==="valid",a6=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})(Lt||(Lt={}));rp=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}},L2e=(e,t)=>{if(GO(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 qc(e.common.issues);return this._error=n,this._error}}};xn=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 SE(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:SE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new du,ctx:{common:t.parent.common,data:t.data,parsedType:SE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(a6(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:SE(t)},i=this._parseSync({data:t,path:o.path,parent:o});return L2e(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:SE(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(a6(o)?o:Promise.resolve(o));return L2e(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 s=t(o),c=()=>i.addIssue({code:qe.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(c(),!1)):s?!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 Vl({schema:this,typeName:Kt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ef.create(this,this._def)}nullable(){return $g.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hg.create(this,this._def)}promise(){return bE.create(this,this._def)}or(t){return QS.create([this,t],this._def)}and(t){return FS.create(this,t,this._def)}transform(t){return new Vl({...Rn(this._def),schema:this,typeName:Kt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new $S({...Rn(this._def),innerType:this,defaultValue:n,typeName:Kt.ZodDefault})}brand(){return new d6({typeName:Kt.ZodBranded,type:this,...Rn(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new CR({...Rn(this._def),innerType:this,catchValue:n,typeName:Kt.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return zO.create(this,t)}readonly(){return RR.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},pRt=/^c[^\s-]{8,}$/i,fRt=/^[a-z][a-z0-9]*$/,mRt=/[0-9A-HJKMNP-TV-Z]{26}/,ARt=/^[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,gRt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hRt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),_Rt=/^(((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}))$/,ERt=/^(([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})))$/,yRt=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$");TE=class e extends xn{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:qe.invalid_string,...Lt.errToObj(r)}),this.nonempty=t=>this.min(1,Lt.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)!==st.string){let i=this._getOrReturnCtx(t);return ut(i,{code:qe.invalid_type,expected:st.string,received:i.parsedType}),_n}let r=new du,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:qe.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:qe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,c=t.data.length<i.value;(s||c)&&(o=this._getOrReturnCtx(t,o),s?ut(o,{code:qe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&ut(o,{code:qe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")gRt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"email",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")hRt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"emoji",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")ARt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"uuid",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")pRt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"cuid",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")fRt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"cuid2",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")mRt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"ulid",code:qe.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:qe.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:qe.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:qe.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:qe.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:qe.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?yRt(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{code:qe.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?SRt(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"ip",code:qe.invalid_string,message:i.message}),r.dirty()):yr.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",...Lt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Lt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Lt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Lt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Lt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Lt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Lt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Lt.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,...Lt.errToObj(t?.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Lt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Lt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Lt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Lt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Lt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Lt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Lt.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}};TE.create=e=>{var t;return new TE({checks:[],typeName:Kt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Rn(e)})};wS=class e extends xn{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)!==st.number){let i=this._getOrReturnCtx(t);return ut(i,{code:qe.invalid_type,expected:st.number,received:i.parsedType}),_n}let r,o=new du;for(let i of this._def.checks)i.kind==="int"?yr.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ut(r,{code:qe.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:qe.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:qe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?TRt(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),ut(r,{code:qe.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:qe.not_finite,message:i.message}),o.dirty()):yr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Lt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Lt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Lt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Lt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Lt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Lt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Lt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Lt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Lt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Lt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Lt.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"&&yr.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)}};wS.create=e=>new wS({checks:[],typeName:Kt.ZodNumber,coerce:e?.coerce||!1,...Rn(e)});kS=class e extends xn{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)!==st.bigint){let i=this._getOrReturnCtx(t);return ut(i,{code:qe.invalid_type,expected:st.bigint,received:i.parsedType}),_n}let r,o=new du;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:qe.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:qe.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:qe.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):yr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Lt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Lt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Lt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Lt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Lt.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:Lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Lt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Lt.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}};kS.create=e=>{var t;return new kS({checks:[],typeName:Kt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Rn(e)})};PS=class extends xn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==st.boolean){let r=this._getOrReturnCtx(t);return ut(r,{code:qe.invalid_type,expected:st.boolean,received:r.parsedType}),_n}return Zu(t.data)}};PS.create=e=>new PS({typeName:Kt.ZodBoolean,coerce:e?.coerce||!1,...Rn(e)});MS=class e extends xn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==st.date){let i=this._getOrReturnCtx(t);return ut(i,{code:qe.invalid_type,expected:st.date,received:i.parsedType}),_n}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ut(i,{code:qe.invalid_date}),_n}let r=new du,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ut(o,{code:qe.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:qe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):yr.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:Lt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Lt.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}};MS.create=e=>new MS({checks:[],coerce:e?.coerce||!1,typeName:Kt.ZodDate,...Rn(e)});SR=class extends xn{_parse(t){if(this._getType(t)!==st.symbol){let r=this._getOrReturnCtx(t);return ut(r,{code:qe.invalid_type,expected:st.symbol,received:r.parsedType}),_n}return Zu(t.data)}};SR.create=e=>new SR({typeName:Kt.ZodSymbol,...Rn(e)});LS=class extends xn{_parse(t){if(this._getType(t)!==st.undefined){let r=this._getOrReturnCtx(t);return ut(r,{code:qe.invalid_type,expected:st.undefined,received:r.parsedType}),_n}return Zu(t.data)}};LS.create=e=>new LS({typeName:Kt.ZodUndefined,...Rn(e)});US=class extends xn{_parse(t){if(this._getType(t)!==st.null){let r=this._getOrReturnCtx(t);return ut(r,{code:qe.invalid_type,expected:st.null,received:r.parsedType}),_n}return Zu(t.data)}};US.create=e=>new US({typeName:Kt.ZodNull,...Rn(e)});IE=class extends xn{constructor(){super(...arguments),this._any=!0}_parse(t){return Zu(t.data)}};IE.create=e=>new IE({typeName:Kt.ZodAny,...Rn(e)});jg=class extends xn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Zu(t.data)}};jg.create=e=>new jg({typeName:Kt.ZodUnknown,...Rn(e)});yf=class extends xn{_parse(t){let n=this._getOrReturnCtx(t);return ut(n,{code:qe.invalid_type,expected:st.never,received:n.parsedType}),_n}};yf.create=e=>new yf({typeName:Kt.ZodNever,...Rn(e)});TR=class extends xn{_parse(t){if(this._getType(t)!==st.undefined){let r=this._getOrReturnCtx(t);return ut(r,{code:qe.invalid_type,expected:st.void,received:r.parsedType}),_n}return Zu(t.data)}};TR.create=e=>new TR({typeName:Kt.ZodVoid,...Rn(e)});Hg=class e extends xn{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==st.array)return ut(n,{code:qe.invalid_type,expected:st.array,received:n.parsedType}),_n;if(o.exactLength!==null){let s=n.data.length>o.exactLength.value,c=n.data.length<o.exactLength.value;(s||c)&&(ut(n,{code:s?qe.too_big:qe.too_small,minimum:c?o.exactLength.value:void 0,maximum:s?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:qe.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:qe.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((s,c)=>o.type._parseAsync(new rp(n,s,n.path,c)))).then(s=>du.mergeArray(r,s));let i=[...n.data].map((s,c)=>o.type._parseSync(new rp(n,s,n.path,c)));return du.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Lt.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Lt.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Lt.toString(n)}})}nonempty(t){return this.min(1,t)}};Hg.create=(e,t)=>new Hg({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Kt.ZodArray,...Rn(t)});pu=class e extends xn{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=yr.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==st.object){let f=this._getOrReturnCtx(t);return ut(f,{code:qe.invalid_type,expected:st.object,received:f.parsedType}),_n}let{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof yf&&this._def.unknownKeys==="strip"))for(let f in o.data)s.includes(f)||c.push(f);let l=[];for(let f of s){let h=i[f],y=o.data[f];l.push({key:{status:"valid",value:f},value:h._parse(new rp(o,y,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof yf){let f=this._def.unknownKeys;if(f==="passthrough")for(let h of c)l.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(f==="strict")c.length>0&&(ut(o,{code:qe.unrecognized_keys,keys:c}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let h of c){let y=o.data[h];l.push({key:{status:"valid",value:h},value:f._parse(new rp(o,y,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let f=[];for(let h of l){let y=await h.key;f.push({key:y,value:await h.value,alwaysSet:h.alwaysSet})}return f}).then(f=>du.mergeObjectSync(r,f)):du.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Lt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,c;let l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=Lt.errToObj(t).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}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:Kt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return yr.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 yr.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return yR(this)}partial(t){let n={};return yr.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 yr.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ef;)i=i._def.innerType;n[r]=i}}),new e({...this._def,shape:()=>n})}keyof(){return z2e(yr.objectKeys(this.shape))}};pu.create=(e,t)=>new pu({shape:()=>e,unknownKeys:"strip",catchall:yf.create(),typeName:Kt.ZodObject,...Rn(t)});pu.strictCreate=(e,t)=>new pu({shape:()=>e,unknownKeys:"strict",catchall:yf.create(),typeName:Kt.ZodObject,...Rn(t)});pu.lazycreate=(e,t)=>new pu({shape:e,unknownKeys:"strip",catchall:yf.create(),typeName:Kt.ZodObject,...Rn(t)});QS=class extends xn{_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 s=i.map(c=>new qc(c.ctx.common.issues));return ut(n,{code:qe.invalid_union,unionErrors:s}),_n}if(n.common.async)return Promise.all(r.map(async i=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of r){let f={...n,common:{...n.common,issues:[]},parent:null},h=l._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:f}),f.common.issues.length&&s.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=s.map(l=>new qc(l));return ut(n,{code:qe.invalid_union,unionErrors:c}),_n}}get options(){return this._def.options}};QS.create=(e,t)=>new QS({options:e,typeName:Kt.ZodUnion,...Rn(t)});o6=e=>e instanceof GS?o6(e.schema):e instanceof Vl?o6(e.innerType()):e instanceof zS?[e.value]:e instanceof jS?e.options:e instanceof HS?Object.keys(e.enum):e instanceof $S?o6(e._def.innerType):e instanceof LS?[void 0]:e instanceof US?[null]:null,u6=class e extends xn{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==st.object)return ut(n,{code:qe.invalid_type,expected:st.object,received:n.parsedType}),_n;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:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_n)}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 s=o6(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of s){if(o.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);o.set(c,i)}}return new e({typeName:Kt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Rn(r)})}};FS=class extends xn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(UZ(i)||UZ(s))return _n;let c=FZ(i.value,s.value);return c.valid?((QZ(i)||QZ(s))&&n.dirty(),{status:n.value,value:c.data}):(ut(r,{code:qe.invalid_intersection_types}),_n)};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,s])=>o(i,s)):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}))}};FS.create=(e,t,n)=>new FS({left:e,right:t,typeName:Kt.ZodIntersection,...Rn(n)});Jm=class e extends xn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==st.array)return ut(r,{code:qe.invalid_type,expected:st.array,received:r.parsedType}),_n;if(r.data.length<this._def.items.length)return ut(r,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_n;!this._def.rest&&r.data.length>this._def.items.length&&(ut(r,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new rp(r,s,r.path,c)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>du.mergeArray(n,s)):du.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Jm.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Jm({items:e,typeName:Kt.ZodTuple,rest:null,...Rn(t)})};c6=class e extends xn{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!==st.object)return ut(r,{code:qe.invalid_type,expected:st.object,received:r.parsedType}),_n;let o=[],i=this._def.keyType,s=this._def.valueType;for(let c in r.data)o.push({key:i._parse(new rp(r,c,r.path,c)),value:s._parse(new rp(r,r.data[c],r.path,c))});return r.common.async?du.mergeObjectAsync(n,o):du.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof xn?new e({keyType:t,valueType:n,typeName:Kt.ZodRecord,...Rn(r)}):new e({keyType:TE.create(),valueType:t,typeName:Kt.ZodRecord,...Rn(n)})}},IR=class extends xn{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!==st.map)return ut(r,{code:qe.invalid_type,expected:st.map,received:r.parsedType}),_n;let o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([c,l],f)=>({key:o._parse(new rp(r,c,r.path,[f,"key"])),value:i._parse(new rp(r,l,r.path,[f,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of s){let f=await l.key,h=await l.value;if(f.status==="aborted"||h.status==="aborted")return _n;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(f.value,h.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let l of s){let f=l.key,h=l.value;if(f.status==="aborted"||h.status==="aborted")return _n;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(f.value,h.value)}return{status:n.value,value:c}}}};IR.create=(e,t,n)=>new IR({valueType:t,keyType:e,typeName:Kt.ZodMap,...Rn(n)});bR=class e extends xn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==st.set)return ut(r,{code:qe.invalid_type,expected:st.set,received:r.parsedType}),_n;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ut(r,{code:qe.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:qe.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function s(l){let f=new Set;for(let h of l){if(h.status==="aborted")return _n;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}let c=[...r.data.values()].map((l,f)=>i._parse(new rp(r,l,r.path,f)));return r.common.async?Promise.all(c).then(l=>s(l)):s(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:Lt.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Lt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};bR.create=(e,t)=>new bR({valueType:e,minSize:null,maxSize:null,typeName:Kt.ZodSet,...Rn(t)});l6=class e extends xn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==st.function)return ut(n,{code:qe.invalid_type,expected:st.function,received:n.parsedType}),_n;function r(c,l){return s6({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i6(),FO].filter(f=>!!f),issueData:{code:qe.invalid_arguments,argumentsError:l}})}function o(c,l){return s6({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i6(),FO].filter(f=>!!f),issueData:{code:qe.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof bE){let c=this;return Zu(async function(...l){let f=new qc([]),h=await c._def.args.parseAsync(l,i).catch(b=>{throw f.addIssue(r(l,b)),f}),y=await Reflect.apply(s,this,h);return await c._def.returns._def.type.parseAsync(y,i).catch(b=>{throw f.addIssue(o(y,b)),f})})}else{let c=this;return Zu(function(...l){let f=c._def.args.safeParse(l,i);if(!f.success)throw new qc([r(l,f.error)]);let h=Reflect.apply(s,this,f.data),y=c._def.returns.safeParse(h,i);if(!y.success)throw new qc([o(h,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Jm.create(t).rest(jg.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||Jm.create([]).rest(jg.create()),returns:n||jg.create(),typeName:Kt.ZodFunction,...Rn(r)})}},GS=class extends xn{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})}};GS.create=(e,t)=>new GS({getter:e,typeName:Kt.ZodLazy,...Rn(t)});zS=class extends xn{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return ut(n,{received:n.data,code:qe.invalid_literal,expected:this._def.value}),_n}return{status:"valid",value:t.data}}get value(){return this._def.value}};zS.create=(e,t)=>new zS({value:e,typeName:Kt.ZodLiteral,...Rn(t)});jS=class e extends xn{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return ut(n,{expected:yr.joinValues(r),received:n.parsedType,code:qe.invalid_type}),_n}if(this._def.values.indexOf(t.data)===-1){let n=this._getOrReturnCtx(t),r=this._def.values;return ut(n,{received:n.data,code:qe.invalid_enum_value,options:r}),_n}return Zu(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)))}};jS.create=z2e;HS=class extends xn{_parse(t){let n=yr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==st.string&&r.parsedType!==st.number){let o=yr.objectValues(n);return ut(r,{expected:yr.joinValues(o),received:r.parsedType,code:qe.invalid_type}),_n}if(n.indexOf(t.data)===-1){let o=yr.objectValues(n);return ut(r,{received:r.data,code:qe.invalid_enum_value,options:o}),_n}return Zu(t.data)}get enum(){return this._def.values}};HS.create=(e,t)=>new HS({values:e,typeName:Kt.ZodNativeEnum,...Rn(t)});bE=class extends xn{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==st.promise&&n.common.async===!1)return ut(n,{code:qe.invalid_type,expected:st.promise,received:n.parsedType}),_n;let r=n.parsedType===st.promise?n.data:Promise.resolve(n.data);return Zu(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};bE.create=(e,t)=>new bE({type:e,typeName:Kt.ZodPromise,...Rn(t)});Vl=class extends xn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Kt.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:s=>{ut(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(c=>this._def.schema._parseAsync({data:c,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){let s=c=>{let l=o.refinement(c,i);if(r.common.async)return Promise.resolve(l);if(l 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"?_n:(c.status==="dirty"&&n.dirty(),s(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"?_n:(c.status==="dirty"&&n.dirty(),s(c.value).then(()=>({status:n.value,value:c.value}))))}if(o.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!GO(s))return s;let c=o.transform(s.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(s=>GO(s)?Promise.resolve(o.transform(s.value,i)).then(c=>({status:n.value,value:c})):s);yr.assertNever(o)}};Vl.create=(e,t,n)=>new Vl({schema:e,typeName:Kt.ZodEffects,effect:t,...Rn(n)});Vl.createWithPreprocess=(e,t,n)=>new Vl({schema:t,effect:{type:"preprocess",transform:e},typeName:Kt.ZodEffects,...Rn(n)});Ef=class extends xn{_parse(t){return this._getType(t)===st.undefined?Zu(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ef.create=(e,t)=>new Ef({innerType:e,typeName:Kt.ZodOptional,...Rn(t)});$g=class extends xn{_parse(t){return this._getType(t)===st.null?Zu(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};$g.create=(e,t)=>new $g({innerType:e,typeName:Kt.ZodNullable,...Rn(t)});$S=class extends xn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===st.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};$S.create=(e,t)=>new $S({innerType:e,typeName:Kt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Rn(t)});CR=class extends xn{_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 a6(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qc(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new qc(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};CR.create=(e,t)=>new CR({innerType:e,typeName:Kt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Rn(t)});vR=class extends xn{_parse(t){if(this._getType(t)!==st.nan){let r=this._getOrReturnCtx(t);return ut(r,{code:qe.invalid_type,expected:st.nan,received:r.parsedType}),_n}return{status:"valid",value:t.data}}};vR.create=e=>new vR({typeName:Kt.ZodNaN,...Rn(e)});IRt=Symbol("zod_brand"),d6=class extends xn{_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}},zO=class e extends xn{_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"?_n:i.status==="dirty"?(n.dirty(),G2e(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"?_n: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:Kt.ZodPipeline})}},RR=class extends xn{_parse(t){let n=this._def.innerType._parse(t);return GO(n)&&(n.value=Object.freeze(n.value)),n}};RR.create=(e,t)=>new RR({innerType:e,typeName:Kt.ZodReadonly,...Rn(t)});j2e=(e,t={},n)=>e?IE.create().superRefine((r,o)=>{var i,s;if(!e(r)){let c=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=c.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,f=typeof c=="string"?{message:c}:c;o.addIssue({code:"custom",...f,fatal:l})}}):IE.create(),bRt={object:pu.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"})(Kt||(Kt={}));CRt=(e,t={message:`Input not instance of ${e.name}`})=>j2e(n=>n instanceof e,t),H2e=TE.create,$2e=wS.create,vRt=vR.create,RRt=kS.create,q2e=PS.create,xRt=MS.create,DRt=SR.create,BRt=LS.create,NRt=US.create,ORt=IE.create,wRt=jg.create,kRt=yf.create,PRt=TR.create,MRt=Hg.create,LRt=pu.create,URt=pu.strictCreate,QRt=QS.create,FRt=u6.create,GRt=FS.create,zRt=Jm.create,jRt=c6.create,HRt=IR.create,$Rt=bR.create,qRt=l6.create,VRt=GS.create,YRt=zS.create,KRt=jS.create,JRt=HS.create,ZRt=bE.create,U2e=Vl.create,WRt=Ef.create,XRt=$g.create,ext=Vl.createWithPreprocess,txt=zO.create,nxt=()=>H2e().optional(),rxt=()=>$2e().optional(),oxt=()=>q2e().optional(),ixt={string:(e=>TE.create({...e,coerce:!0})),number:(e=>wS.create({...e,coerce:!0})),boolean:(e=>PS.create({...e,coerce:!0})),bigint:(e=>kS.create({...e,coerce:!0})),date:(e=>MS.create({...e,coerce:!0}))},sxt=_n,lu=Object.freeze({__proto__:null,defaultErrorMap:FO,setErrorMap:lRt,getErrorMap:i6,makeIssue:s6,EMPTY_PATH:dRt,addIssueToContext:ut,ParseStatus:du,INVALID:_n,DIRTY:G2e,OK:Zu,isAborted:UZ,isDirty:QZ,isValid:GO,isAsync:a6,get util(){return yr},get objectUtil(){return LZ},ZodParsedType:st,getParsedType:SE,ZodType:xn,ZodString:TE,ZodNumber:wS,ZodBigInt:kS,ZodBoolean:PS,ZodDate:MS,ZodSymbol:SR,ZodUndefined:LS,ZodNull:US,ZodAny:IE,ZodUnknown:jg,ZodNever:yf,ZodVoid:TR,ZodArray:Hg,ZodObject:pu,ZodUnion:QS,ZodDiscriminatedUnion:u6,ZodIntersection:FS,ZodTuple:Jm,ZodRecord:c6,ZodMap:IR,ZodSet:bR,ZodFunction:l6,ZodLazy:GS,ZodLiteral:zS,ZodEnum:jS,ZodNativeEnum:HS,ZodPromise:bE,ZodEffects:Vl,ZodTransformer:Vl,ZodOptional:Ef,ZodNullable:$g,ZodDefault:$S,ZodCatch:CR,ZodNaN:vR,BRAND:IRt,ZodBranded:d6,ZodPipeline:zO,ZodReadonly:RR,custom:j2e,Schema:xn,ZodSchema:xn,late:bRt,get ZodFirstPartyTypeKind(){return Kt},coerce:ixt,any:ORt,array:MRt,bigint:RRt,boolean:q2e,date:xRt,discriminatedUnion:FRt,effect:U2e,enum:KRt,function:qRt,instanceof:CRt,intersection:GRt,lazy:VRt,literal:YRt,map:HRt,nan:vRt,nativeEnum:JRt,never:kRt,null:NRt,nullable:XRt,number:$2e,object:LRt,oboolean:oxt,onumber:rxt,optional:WRt,ostring:nxt,pipeline:txt,preprocess:ext,promise:ZRt,record:jRt,set:$Rt,strictObject:URt,string:H2e,symbol:DRt,transformer:U2e,tuple:zRt,undefined:BRt,union:QRt,unknown:wRt,void:PRt,NEVER:sxt,ZodIssueCode:qe,quotelessJson:cRt,ZodError:qc}),axt=e=>typeof e?.safeParse=="function",PZ=e=>typeof e?.passthrough=="function",uxt=(e,t)=>PZ(e)?PZ(t)?e.merge(t):e:PZ(t)?t:Object.assign({},e,t),np=lu.object({name:lu.literal("ZodError"),issues:lu.array(lu.object({path:lu.array(lu.union([lu.string(),lu.number()])),message:lu.string().optional(),code:lu.nativeEnum(lu.ZodIssueCode)}).catchall(lu.any()))}),GZ=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}},DRn=lu.object({message:lu.literal("Request validation failed"),pathParameterErrors:np.nullable(),headerErrors:np.nullable(),queryParameterErrors:np.nullable(),bodyErrors:np.nullable()}),BRn=lu.object({pathParameterErrors:np.nullable(),headerErrors:np.nullable(),queryParameterErrors:np.nullable(),bodyErrors:np.nullable()}),NRn=lu.object({paramsResult:np.nullable(),headersResult:np.nullable(),queryResult:np.nullable(),bodyResult:np.nullable()}),V2e="zod-ts-rest-polyfill",cxt=e=>{if(!e)return!1;let t=e?.["~standard"];return t?t.version===1&&typeof t.validate=="function":!1},lxt=e=>cxt(e)?e:axt(e)?(Object.assign(e,{"~standard":{vendor:V2e,version:1,validate:r=>{let o=e.safeParse(r);return o.success?{value:o.data}:{issues:o.error.issues}}}}),e):null,dxt=(e,t)=>e?t?e instanceof pu&&t instanceof pu?uxt(e,t):{...e,...t}:e:t,pxt=(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===V2e?{error:new qc(r.issues)}:{error:new GZ(r.issues)}:n&&typeof e=="object"&&r.value?{value:{...e,...r.value}}:{value:r.value}},Y2e=Symbol("ContractNoBody"),K2e=e=>"method"in e&&"path"in e,J2e=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>{var o,i,s;return K2e(r)?[n,{...r,path:t?.pathPrefix?t.pathPrefix+r.path:r.path,headers:dxt(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,...(s=r.metadata)!==null&&s!==void 0?s:{}}:r.metadata}]:[n,J2e(r,t)]})),MZ=Symbol("ContractPlainType"),ia=()=>({router:(e,t)=>J2e(e,t),query:e=>e,mutation:e=>e,responses:e=>e,response:()=>MZ,body:()=>MZ,type:()=>MZ,otherResponse:({contentType:e,body:t})=>({contentType:e,body:t}),noBody:()=>Y2e}),fxt=({path:e,params:t})=>{let n=t;return e.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},mxt=(e,t=!1)=>{let n=t?Axt(e):gxt(e);return n?.length>0?"?"+n:""},Axt=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("&"):"",gxt=e=>e?Object.keys(e).flatMap(t=>zZ(t,e[t])).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(n)}`).join("&"):"",zZ=(e,t)=>Array.isArray(t)?t.flatMap((n,r)=>zZ(`${e}[${r}]`,n)):t instanceof Date?[[`${e}`,t.toISOString()]]:t===null?[[`${e}`,""]]:t===void 0?[]:typeof t=="object"?Object.keys(t).flatMap(n=>zZ(`${e}[${n}]`,t[n])):[[`${e}`,`${t}`]],jZ=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}},HZ=async({route:e,path:t,method:n,headers:r,body:o,validateResponse:i,fetchOptions:s})=>{let c=await fetch(t,{...s,method:n,headers:r,body:o}),l=c.headers.get("content-type");if(l?.includes("application/")&&l?.includes("json")){let f=e.responses[c.status],h={status:c.status,body:f===Y2e?void 0:await c.json(),headers:c.headers},y=lxt(f);if(y&&(i??e.validateResponseOnClient)){let S=pxt(h.body,y);if(S.error)throw S.error;return{...h,body:S.value}}return h}return l?.includes("text/")?{status:c.status,body:await c.text(),headers:c.headers}:{status:c.status,body:await c.blob(),headers:c.headers}},hxt=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},Q2e=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t.toLowerCase(),n])),_xt=e=>{let{path:t,clientArgs:n,route:r,body:o,query:i,extraInputArgs:s,headers:c,fetchOptions:l}=e,f=n.api||HZ,h=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([b,v])=>typeof v=="function"?[b,v(e)]:[b,v])),y={...h&&Q2e(h),...Q2e(c)};Object.keys(y).forEach(b=>{y[b]===void 0&&delete y[b]});let S={route:r,path:t,method:r.method,headers:y,body:void 0,rawBody:o,rawQuery:i,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...l},...l?.signal&&{signal:l.signal},...l?.cache&&{cache:l.cache},...l&&"next"in l&&!!l?.next&&{next:l.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?S={...S,contentType:"multipart/form-data",body:o instanceof FormData?o:hxt(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?S={...S,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...S.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(S={...S,contentType:"application/json",headers:{"content-type":"application/json",...S.headers},body:JSON.stringify(o)})),f({...S,...s})},Ext=(e,t,n)=>{let{query:r,params:o,body:i,headers:s,extraHeaders:c,overrideClientOptions:l,fetchOptions:f,cache:h,next:y,...S}=n||{},b={...t,...l},v=typeof o=="object"?Object.fromEntries(Object.entries(o).map(([D,k])=>[D,String(k)])):{};return{path:yxt(r,b.baseUrl,v,e,!!b.jsonQuery),clientArgs:b,route:e,body:i,query:r,extraInputArgs:S,fetchOptions:{...h&&{cache:h},...y&&{next:y},...f},headers:{...c,...s}}},yxt=(e,t,n,r,o)=>{let i=fxt({path:r.path,params:n}),s=mxt(e,o);return t.endsWith("/")&&i.startsWith("/")?`${t}${i.substring(1)}${s}`:`${t}${i}${s}`},Sxt=(e,t)=>{let n=Object.keys(e.responses);return async r=>{let o=Ext(e,t,r),i=await _xt(o);if(!t.throwOnUnknownStatus||n.includes(i.status.toString()))return i;throw new jZ(i,n)}},$Z=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>K2e(r)?[n,Sxt(r,t)]:[n,$Z(r,t)]))});function re(e,t,n){function r(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let f=s.prototype,h=Object.keys(f);for(let y=0;y<h.length;y++){let S=h[y];S in c||(c[S]=f[S].bind(c))}}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(c){var l;let f=n?.Parent?new i:this;r(f,c),(l=f._zod).deferred??(l.deferred=[]);for(let h of f._zod.deferred)h();return f}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Ei(e){return e&&Object.assign(qS,e),qS}var Z2e,qZ,VZ,Tf,CE,qS,VS=O(()=>{A();qZ=Object.freeze({status:"aborted"});VZ=Symbol("zod_brand"),Tf=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},CE=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Z2e=globalThis).__zod_globalConfig??(Z2e.__zod_globalConfig={});qS=globalThis.__zod_globalConfig});var Le={};$s(Le,{BIGINT_FORMAT_RANGES:()=>rW,Class:()=>KZ,NUMBER_FORMAT_RANGES:()=>nW,aborted:()=>DE,allowsEval:()=>WZ,assert:()=>vxt,assertEqual:()=>Txt,assertIs:()=>bxt,assertNever:()=>Cxt,assertNotEqual:()=>Ixt,assignProp:()=>RE,base64ToUint8Array:()=>X2e,base64urlToUint8Array:()=>jxt,cached:()=>DR,captureStackTrace:()=>f6,cleanEnum:()=>zxt,cleanRegex:()=>$O,clone:()=>Wu,cloneDef:()=>xxt,createTransparentProxy:()=>kxt,defineLazy:()=>zn,esc:()=>p6,escapeRegex:()=>op,explicitlyAborted:()=>oW,extend:()=>Lxt,finalizeIssue:()=>Xu,floatSafeRemainder:()=>JZ,getElementAtPath:()=>Dxt,getEnumValues:()=>HO,getLengthableOrigin:()=>YO,getParsedType:()=>wxt,getSizableOrigin:()=>VO,hexToUint8Array:()=>$xt,isObject:()=>YS,isPlainObject:()=>xE,issue:()=>BR,joinValues:()=>ce,jsonStringifyReplacer:()=>xR,merge:()=>Qxt,mergeDefs:()=>qg,normalizeParams:()=>He,nullish:()=>vE,numKeys:()=>Oxt,objectClone:()=>Rxt,omit:()=>Mxt,optionalKeys:()=>tW,parsedType:()=>ke,partial:()=>Fxt,pick:()=>Pxt,prefixIssues:()=>Vc,primitiveTypes:()=>eW,promiseAllObject:()=>Bxt,propertyKeyTypes:()=>qO,randomString:()=>Nxt,required:()=>Gxt,safeExtend:()=>Uxt,shallowClone:()=>XZ,slugify:()=>ZZ,stringifyPrimitive:()=>we,uint8ArrayToBase64:()=>eMe,uint8ArrayToBase64url:()=>Hxt,uint8ArrayToHex:()=>qxt,unwrapMessage:()=>jO});function Txt(e){return e}function Ixt(e){return e}function bxt(e){}function Cxt(e){throw new Error("Unexpected value in exhaustive check")}function vxt(e){}function HO(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 ce(e,t="|"){return e.map(n=>we(n)).join(t)}function xR(e,t){return typeof t=="bigint"?t.toString():t}function DR(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function vE(e){return e==null}function $O(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function JZ(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 zn(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==W2e)return r===void 0&&(r=W2e,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Rxt(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function RE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function qg(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function xxt(e){return qg(e._zod.def)}function Dxt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function Bxt(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 Nxt(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function p6(e){return JSON.stringify(e)}function ZZ(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function YS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xE(e){if(YS(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(YS(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function XZ(e){return xE(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Oxt(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function op(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wu(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function He(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 kxt(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 we(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function tW(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Pxt(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=qg(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(s[c]=n.shape[c])}return RE(this,"shape",s),s},checks:[]});return Wu(e,i)}function Mxt(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=qg(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete s[c]}return RE(this,"shape",s),s},checks:[]});return Wu(e,i)}function Lxt(e,t){if(!xE(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 s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=qg(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return RE(this,"shape",i),i}});return Wu(e,o)}function Uxt(e,t){if(!xE(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=qg(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return RE(this,"shape",r),r}});return Wu(e,n)}function Qxt(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=qg(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return RE(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Wu(e,n)}function Fxt(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 s=qg(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(n)for(let f in n){if(!(f in c))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(l[f]=e?new e({type:"optional",innerType:c[f]}):c[f])}else for(let f in c)l[f]=e?new e({type:"optional",innerType:c[f]}):c[f];return RE(this,"shape",l),l},checks:[]});return Wu(t,s)}function Gxt(e,t,n){let r=qg(t._zod.def,{get shape(){let o=t._zod.def.shape,i={...o};if(n)for(let s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(let s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return RE(this,"shape",i),i}});return Wu(t,r)}function DE(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 oW(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 Vc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function jO(e){return typeof e=="string"?e:e?.message}function Xu(e,t,n){let r=e.message?e.message:jO(e.inst?._zod.def?.error?.(e))??jO(t?.error?.(e))??jO(n.customError?.(e))??jO(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...c}=e;return c.path??(c.path=[]),c.message=r,t?.reportInput&&(c.input=s),c}function VO(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function YO(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ke(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 BR(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function zxt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function X2e(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 eMe(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function jxt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return X2e(t+n)}function Hxt(e){return eMe(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $xt(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 qxt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var W2e,f6,WZ,wxt,qO,eW,nW,rW,KZ,Et=O(()=>{A();VS();W2e=Symbol("evaluating");f6="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};WZ=DR(()=>{if(qS.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});wxt=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}`)}},qO=new Set(["string","number","symbol"]),eW=new Set(["string","number","bigint","boolean","symbol","undefined"]);nW={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]},rW={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};KZ=class{constructor(...t){}}});function JO(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 ZO(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>r({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)n._errors.push(t(s));else{let l=n,f=0;for(;f<c.length;){let h=c[f];f===c.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(s))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}}};return r(e),n}function iW(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s,c;for(let l of o.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(f=>r({issues:f},[...i,...l.path]));else if(l.code==="invalid_key")r({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")r({issues:l.issues},[...i,...l.path]);else{let f=[...i,...l.path];if(f.length===0){n.errors.push(t(l));continue}let h=n,y=0;for(;y<f.length;){let S=f[y],b=y===f.length-1;typeof S=="string"?(h.properties??(h.properties={}),(s=h.properties)[S]??(s[S]={errors:[]}),h=h.properties[S]):(h.items??(h.items=[]),(c=h.items)[S]??(c[S]={errors:[]}),h=h.items[S]),b&&h.errors.push(t(l)),y++}}};return r(e),n}function nMe(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 sW(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 ${nMe(r.path)}`);return t.join(`
|
|
41
41
|
`)}var tMe,KO,Yc,aW=O(()=>{A();VS();Et();tMe=(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,xR,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},KO=re("$ZodError",tMe),Yc=re("$ZodError",tMe,{Parent:Error})});var NR,m6,OR,A6,wR,uW,kR,cW,g6,Yxt,h6,Kxt,_6,Jxt,E6,Zxt,y6,Wxt,S6,Xxt,T6,eDt,I6,tDt,lW=O(()=>{A();VS();aW();Et();NR=e=>(t,n,r,o)=>{let i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Tf;if(s.issues.length){let c=new(o?.Err??e)(s.issues.map(l=>Xu(l,i,Ei())));throw f6(c,o?.callee),c}return s.value},m6=NR(Yc),OR=e=>async(t,n,r,o)=>{let i=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(o?.Err??e)(s.issues.map(l=>Xu(l,i,Ei())));throw f6(c,o?.callee),c}return s.value},A6=OR(Yc),wR=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 Tf;return i.issues.length?{success:!1,error:new(e??KO)(i.issues.map(s=>Xu(s,o,Ei())))}:{success:!0,data:i.value}},uW=wR(Yc),kR=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(s=>Xu(s,o,Ei())))}:{success:!0,data:i.value}},cW=kR(Yc),g6=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return NR(e)(t,n,o)},Yxt=g6(Yc),h6=e=>(t,n,r)=>NR(e)(t,n,r),Kxt=h6(Yc),_6=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return OR(e)(t,n,o)},Jxt=_6(Yc),E6=e=>async(t,n,r)=>OR(e)(t,n,r),Zxt=E6(Yc),y6=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return wR(e)(t,n,o)},Wxt=y6(Yc),S6=e=>(t,n,r)=>wR(e)(t,n,r),Xxt=S6(Yc),T6=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return kR(e)(t,n,o)},eDt=T6(Yc),I6=e=>async(t,n,r)=>kR(e)(t,n,r),tDt=I6(Yc)});var Yl={};$s(Yl,{base64:()=>vW,base64url:()=>b6,bigint:()=>wW,boolean:()=>PW,browserEmail:()=>cDt,cidrv4:()=>bW,cidrv6:()=>CW,cuid:()=>dW,cuid2:()=>pW,date:()=>DW,datetime:()=>NW,domain:()=>pDt,duration:()=>hW,e164:()=>xW,email:()=>EW,emoji:()=>yW,extendedDuration:()=>nDt,guid:()=>_W,hex:()=>fDt,hostname:()=>dDt,html5Email:()=>sDt,httpProtocol:()=>RW,idnEmail:()=>uDt,integer:()=>kW,ipv4:()=>SW,ipv6:()=>TW,ksuid:()=>AW,lowercase:()=>UW,mac:()=>IW,md5_base64:()=>ADt,md5_base64url:()=>gDt,md5_hex:()=>mDt,nanoid:()=>gW,null:()=>MW,number:()=>C6,rfc5322Email:()=>aDt,sha1_base64:()=>_Dt,sha1_base64url:()=>EDt,sha1_hex:()=>hDt,sha256_base64:()=>SDt,sha256_base64url:()=>TDt,sha256_hex:()=>yDt,sha384_base64:()=>bDt,sha384_base64url:()=>CDt,sha384_hex:()=>IDt,sha512_base64:()=>RDt,sha512_base64url:()=>xDt,sha512_hex:()=>vDt,string:()=>OW,time:()=>BW,ulid:()=>fW,undefined:()=>LW,unicodeEmail:()=>rMe,uppercase:()=>QW,uuid:()=>KS,uuid4:()=>rDt,uuid6:()=>oDt,uuid7:()=>iDt,xid:()=>mW});function yW(){return new RegExp(lDt,"u")}function iMe(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 BW(e){return new RegExp(`^${iMe(e)}$`)}function NW(e){let t=iMe({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(`^${oMe}T(?:${r})$`)}function WO(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function XO(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var dW,pW,fW,mW,AW,gW,hW,nDt,_W,KS,rDt,oDt,iDt,EW,sDt,aDt,rMe,uDt,cDt,lDt,SW,TW,IW,bW,CW,vW,b6,dDt,pDt,RW,xW,oMe,DW,OW,wW,kW,C6,PW,MW,LW,UW,QW,fDt,mDt,ADt,gDt,hDt,_Dt,EDt,yDt,SDt,TDt,IDt,bDt,CDt,vDt,RDt,xDt,v6=O(()=>{A();Et();dW=/^[cC][0-9a-z]{6,}$/,pW=/^[0-9a-z]+$/,fW=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,mW=/^[0-9a-vA-V]{20}$/,AW=/^[A-Za-z0-9]{27}$/,gW=/^[a-zA-Z0-9_-]{21}$/,hW=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nDt=/^[-+]?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)?)??$/,_W=/^([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})$/,KS=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)$/,rDt=KS(4),oDt=KS(6),iDt=KS(7),EW=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sDt=/^[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])?)*$/,aDt=/^(([^<>()\[\]\\.,;:\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,}))$/,rMe=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,uDt=rMe,cDt=/^[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])?)*$/,lDt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";SW=/^(?:(?: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])$/,TW=/^(([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}|:))$/,IW=e=>{let t=op(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},bW=/^((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])$/,CW=/^(([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])$/,vW=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b6=/^[A-Za-z0-9_-]*$/,dDt=/^(?=.{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])?)*\.?$/,pDt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,RW=/^https?$/,xW=/^\+[1-9]\d{6,14}$/,oMe="(?:(?:\\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])))",DW=new RegExp(`^${oMe}$`);OW=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},wW=/^-?\d+n?$/,kW=/^-?\d+$/,C6=/^-?\d+(?:\.\d+)?$/,PW=/^(?:true|false)$/i,MW=/^null$/i,LW=/^undefined$/i,UW=/^[^A-Z]*$/,QW=/^[^a-z]*$/,fDt=/^[0-9a-fA-F]*$/;mDt=/^[0-9a-fA-F]{32}$/,ADt=WO(22,"=="),gDt=XO(22),hDt=/^[0-9a-fA-F]{40}$/,_Dt=WO(27,"="),EDt=XO(27),yDt=/^[0-9a-fA-F]{64}$/,SDt=WO(43,"="),TDt=XO(43),IDt=/^[0-9a-fA-F]{96}$/,bDt=WO(64,""),CDt=XO(64),vDt=/^[0-9a-fA-F]{128}$/,RDt=WO(86,"=="),xDt=XO(86)});function sMe(e,t,n){e.issues.length&&t.issues.push(...Vc(n,e.issues))}var Wr,aMe,R6,x6,FW,GW,zW,jW,HW,$W,qW,VW,YW,PR,KW,JW,ZW,WW,XW,eX,tX,nX,rX,D6=O(()=>{A();VS();v6();Et();Wr=re("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),aMe={number:"number",bigint:"bigint",object:"date"},R6=re("$ZodCheckLessThan",(e,t)=>{Wr.init(e,t);let n=aMe[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})}}),x6=re("$ZodCheckGreaterThan",(e,t)=>{Wr.init(e,t);let n=aMe[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})}}),FW=re("$ZodCheckMultipleOf",(e,t)=>{Wr.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):JZ(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})}}),GW=re("$ZodCheckNumberFormat",(e,t)=>{Wr.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=nW[t.format];e._zod.onattach.push(s=>{let c=s._zod.bag;c.format=t.format,c.minimum=o,c.maximum=i,n&&(c.pattern=kW)}),e._zod.check=s=>{let c=s.value;if(n){if(!Number.isInteger(c)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.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}):s.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&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),zW=re("$ZodCheckBigIntFormat",(e,t)=>{Wr.init(e,t);let[n,r]=rW[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})}}),jW=re("$ZodCheckMaxSize",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!vE(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:VO(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),HW=re("$ZodCheckMinSize",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!vE(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:VO(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),$W=re("$ZodCheckSizeEquals",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!vE(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 s=i>t.size;r.issues.push({origin:VO(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),qW=re("$ZodCheckMaxLength",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!vE(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 s=YO(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),VW=re("$ZodCheckMinLength",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!vE(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 s=YO(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),YW=re("$ZodCheckLengthEquals",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!vE(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 s=YO(o),c=i>t.length;r.issues.push({origin:s,...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})}}),PR=re("$ZodCheckStringFormat",(e,t)=>{var n,r;Wr.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=()=>{})}),KW=re("$ZodCheckRegex",(e,t)=>{PR.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})}}),JW=re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=UW),PR.init(e,t)}),ZW=re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=QW),PR.init(e,t)}),WW=re("$ZodCheckIncludes",(e,t)=>{Wr.init(e,t);let n=op(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})}}),XW=re("$ZodCheckStartsWith",(e,t)=>{Wr.init(e,t);let n=new RegExp(`^${op(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})}}),eX=re("$ZodCheckEndsWith",(e,t)=>{Wr.init(e,t);let n=new RegExp(`.*${op(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})}});tX=re("$ZodCheckProperty",(e,t)=>{Wr.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=>sMe(o,n,t.property));sMe(r,n,t.property)}}),nX=re("$ZodCheckMimeType",(e,t)=>{Wr.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})}}),rX=re("$ZodCheckOverwrite",(e,t)=>{Wr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var ew,oX=O(()=>{A();ew=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(`
|
|
@@ -526,7 +526,7 @@ exec ${jue(n)} ${jue(e)} "$@"
|
|
|
526
526
|
Authorization expired. Please try again.
|
|
527
527
|
`);return;case"login_failed":console.log(`
|
|
528
528
|
Login failed: ${e.message}
|
|
529
|
-
`);return}}});import XHt from"node:http";var nVe,e8t,rVe,oVe=O(()=>{"use strict";A();nVe="/callback",e8t='<!doctype html><meta charset="utf-8"><title>Lore</title><body style="font-family:system-ui;padding:3rem;text-align:center"><h1>Signed in to Lore</h1><p>You can close this tab and return to your terminal.</p></body>',rVe=async()=>{let e,t,n=XHt.createServer((c,l)=>{let f=new URL(c.url??"/","http://127.0.0.1");if(f.pathname!==nVe){l.statusCode=404,l.end("not found");return}let h=f.searchParams.get("error"),y=f.searchParams.get("code"),S=f.searchParams.get("state");l.statusCode=h||!y?400:200,l.setHeader("content-type","text/html; charset=utf-8"),l.end(h||!y?`<p>Login failed: ${h??"no code"}. Return to your terminal.</p>`:e8t),r={error:h,code:y,state:S},i()}),r=null,o,i=()=>{};await new Promise((c,l)=>{n.once("error",l),n.listen(0,"127.0.0.1",()=>{n.removeListener("error",l),c()})});let{port:s}=n.address();return{redirectUri:`http://127.0.0.1:${s}${nVe}`,waitForCallback:(c,l)=>new Promise((f,h)=>{o={state:c},e=f,t=h;let y=setTimeout(()=>{t=void 0,h(new Error("authorization timed out"))},l);y.unref&&y.unref(),i=()=>{if(!r||!e&&!t)return;let S=r;r=null,clearTimeout(y);let b={resolve:e,reject:t};e=void 0,t=void 0,S.error?b.reject?.(new Error(`authorization failed: ${S.error}`)):S.code?o&&S.state!==o.state?b.reject?.(new Error("authorization state mismatch")):b.resolve?.({code:S.code}):b.reject?.(new Error("authorization callback missing code"))},i()}),close:()=>{n.close()}}}});var N5e={};$s(N5e,{buildStoredAnalyticsPersonPropertiesFromWhoAmI:()=>uVe,getOpenBrowserCommand:()=>mVe,loginCommand:()=>Kue,openBrowser:()=>fVe,pollForTokens:()=>pVe,requestDeviceAuthorization:()=>dVe,runLogin:()=>AVe});import{spawn as t8t}from"node:child_process";function uVe(e){return{email:e.emailAddress,name:e.name??e.user.display_name,display_name:e.user.display_name,handle:e.user.handle}}async function o8t(e){let n=await Pt({token:e}).whoAmI({headers:{}});n.status===200&&(E4e(`lore_${n.body.user.id}`),T4e(uVe(n.body)))}async function cVe(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function lVe(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Authorization failed"}async function i8t(e){return Az({resource:e,stateDir:Mr()})}function s8t(e){return process.env.LORE_DEVICE_AUTH&&process.env.LORE_DEVICE_AUTH!=="0"?!1:e==="linux"?!!(process.env.DISPLAY||process.env.WAYLAND_DISPLAY):!0}async function dVe(e){let t=await fetch(e.deviceAuthorizationEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:e.clientId,scope:Nre})}),n=await cVe(t);if(!t.ok)throw new Error(lVe(n));return n}async function pVe(e){let t=AbortSignal.timeout(Math.min(e.timeoutMs,e.expiresIn*1e3)),n=e.interval;for(;;){let r;try{r=await fetch(e.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:r8t,device_code:e.deviceCode,client_id:e.clientId}),signal:t})}catch(s){throw s instanceof Error&&s.name==="TimeoutError"?new Error("authorization timed out"):s}let o=await cVe(r);if(r.ok){let s=o.access_token,c=o.refresh_token,l=o.expires_in;if(typeof s!="string")throw new Error("device token response missing access_token");return{access_token:s,refresh_token:typeof c=="string"?c:"",expires_at:Date.now()+(typeof l=="number"?l:0)*1e3,scope:typeof o.scope=="string"?o.scope:""}}let i=o;switch(i.error){case"authorization_pending":await iVe(n*1e3);break;case"slow_down":n+=1,await iVe(n*1e3);break;case"access_denied":throw new Error("Authorization denied");case"expired_token":throw new Error("Authorization expired");default:throw new Error(lVe(i))}}}async function fVe(e){let{command:t,args:n}=mVe(process.platform,e);await new Promise((r,o)=>{let i=t8t(t,n,{detached:!0,stdio:"ignore"});i.once("error",o),i.once("spawn",()=>{i.unref(),r()})})}function mVe(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 a8t(e){if(!await Qt())return!1;try{return(await e.whoAmI({headers:{}})).status===200}catch{return!1}}async function u8t(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:sp()})}catch(r){X.warn("auto_enable_failed",{error:r instanceof Error?r.message:String(r)}),n({kind:"auto_enable_failed"})}}function c8t(e){if(lx(e))return`Could not reach the Lore API at ${rA()}. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared.`}function sVe(){let e=process.env.LORE_AUTHKIT_RESOURCE_INDICATORS?.trim();return e==="1"||e==="true"}async function aVe(e){let t=await e.deps.createLoopbackReceiver();try{let n=e.deps.generatePkce(),r=e.deps.generateState(),o=i4e({authorizationEndpoint:e.endpoints.authorizationEndpoint,clientId:e.clientId,redirectUri:t.redirectUri,codeChallenge:n.codeChallenge,resource:e.resource,scope:Nre,state:r,...e.silent?{prompt:"none"}:{}});e.emitProgress&&e.progress({kind:"browser_url",url:o});try{await e.deps.openBrowser(o),e.emitProgress&&e.progress({kind:"browser_opened"})}catch(s){X.warn("open_browser_failed",{error:s instanceof Error?s.message:String(s)}),e.emitProgress&&e.progress({kind:"browser_open_failed"})}e.emitProgress&&e.progress({kind:"waiting_for_authorization"});let{code:i}=await t.waitForCallback(r,e.timeoutMs);return await e.deps.exchangeCode({tokenEndpoint:e.endpoints.tokenEndpoint,clientId:e.clientId,code:i,codeVerifier:n.codeVerifier,redirectUri:t.redirectUri,resource:e.resource})}finally{t.close()}}async function AVe({client:e=Pt(),enableLaunchAgent:t=s8,openBrowser:n=fVe,platform:r=process.platform,discoverEndpoints:o=i8t,createLoopbackReceiver:i=rVe,generatePkce:s=r4e,generateState:c=o4e,exchangeCode:l=s4e,requestDeviceAuthorization:f=dVe,pollForTokens:h=pVe,isBrowserAvailable:y=()=>s8t(r),writeBootstrappedTokens:S=v4e,setTokens:b=C4e,cacheAnalyticsDistinctId:v=o8t,timeoutMs:x=n8t,progress:D=eVe}={}){if(await a8t(e)){D({kind:"already_logged_in"});return}try{let k=Yre(),Q=await o(k),z;if(y()){let G={createLoopbackReceiver:i,openBrowser:n,generatePkce:s,generateState:c,exchangeCode:l},$=await aVe({endpoints:Q,clientId:ax,resource:sVe()?k:void 0,silent:!1,deps:G,progress:D,emitProgress:!0,timeoutMs:x}),ie=await aVe({endpoints:Q,clientId:ZFe,resource:sVe()?H4e():void 0,silent:!0,deps:G,progress:D,emitProgress:!1,timeoutMs:x});S($,ie),z=$.access_token}else{let G=await f({deviceAuthorizationEndpoint:Q.deviceAuthorizationEndpoint,clientId:ax});D({kind:"device_authorized",userCode:G.user_code,verificationUri:G.verification_uri,verificationUriComplete:G.verification_uri_complete}),D({kind:"browser_url",url:G.verification_uri_complete}),D({kind:"waiting_for_authorization"});let $=await h({tokenEndpoint:Q.tokenEndpoint,clientId:ax,deviceCode:G.device_code,expiresIn:G.expires_in,interval:G.interval,timeoutMs:x});b($),z=$.access_token}v(z).catch(G=>{X.warn("cache_analytics_distinct_id_failed",{error:G instanceof Error?G.message:String(G)})}),D({kind:"logged_in"}),await u8t(t,r,D)}catch(k){k instanceof Error&&k.message==="authorization timed out"?(D({kind:"authorization_timed_out"}),Gw()):k instanceof Error&&k.message==="Authorization denied"?(D({kind:"authorization_denied"}),Gw()):k instanceof Error&&k.message==="Authorization expired"&&(D({kind:"authorization_expired"}),Gw());let Q=c8t(k);throw Q&&(D({kind:"login_failed",message:Q}),Gw()),k}}var n8t,r8t,iVe,Kue,Tue=O(async()=>{"use strict";A();_z();Or();dn();Cz();hr();yi();QE();await Eue();await B5e();nP();lT();tVe();oVe();n8t=300*1e3,r8t="urn:ietf:params:oauth:grant-type:device_code";iVe=e=>new Promise(t=>setTimeout(t,e));Kue={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:e}){X.info("command_start",{command:"login"});let t={client:e?.client,enableLaunchAgent:e?.enableLaunchAgent,openBrowser:e?.openBrowser,platform:e?.platform,discoverEndpoints:e?.discoverEndpoints,createLoopbackReceiver:e?.createLoopbackReceiver,generatePkce:e?.generatePkce,generateState:e?.generateState,exchangeCode:e?.exchangeCode,requestDeviceAuthorization:e?.requestDeviceAuthorization,pollForTokens:e?.pollForTokens,isBrowserAvailable:e?.isBrowserAvailable,writeBootstrappedTokens:e?.writeBootstrappedTokens,setTokens:e?.setTokens,cacheAnalyticsDistinctId:e?.cacheAnalyticsDistinctId,timeoutMs:e?.timeoutMs};if(gu()&&!e?.progress){await D5e(t),await zH({skipIfAlreadyConfigured:!0});return}await AVe({...t,progress:e?.progress})}}});A();A();(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]="
|
|
529
|
+
`);return}}});import XHt from"node:http";var nVe,e8t,rVe,oVe=O(()=>{"use strict";A();nVe="/callback",e8t='<!doctype html><meta charset="utf-8"><title>Lore</title><body style="font-family:system-ui;padding:3rem;text-align:center"><h1>Signed in to Lore</h1><p>You can close this tab and return to your terminal.</p></body>',rVe=async()=>{let e,t,n=XHt.createServer((c,l)=>{let f=new URL(c.url??"/","http://127.0.0.1");if(f.pathname!==nVe){l.statusCode=404,l.end("not found");return}let h=f.searchParams.get("error"),y=f.searchParams.get("code"),S=f.searchParams.get("state");l.statusCode=h||!y?400:200,l.setHeader("content-type","text/html; charset=utf-8"),l.end(h||!y?`<p>Login failed: ${h??"no code"}. Return to your terminal.</p>`:e8t),r={error:h,code:y,state:S},i()}),r=null,o,i=()=>{};await new Promise((c,l)=>{n.once("error",l),n.listen(0,"127.0.0.1",()=>{n.removeListener("error",l),c()})});let{port:s}=n.address();return{redirectUri:`http://127.0.0.1:${s}${nVe}`,waitForCallback:(c,l)=>new Promise((f,h)=>{o={state:c},e=f,t=h;let y=setTimeout(()=>{t=void 0,h(new Error("authorization timed out"))},l);y.unref&&y.unref(),i=()=>{if(!r||!e&&!t)return;let S=r;r=null,clearTimeout(y);let b={resolve:e,reject:t};e=void 0,t=void 0,S.error?b.reject?.(new Error(`authorization failed: ${S.error}`)):S.code?o&&S.state!==o.state?b.reject?.(new Error("authorization state mismatch")):b.resolve?.({code:S.code}):b.reject?.(new Error("authorization callback missing code"))},i()}),close:()=>{n.close()}}}});var N5e={};$s(N5e,{buildStoredAnalyticsPersonPropertiesFromWhoAmI:()=>uVe,getOpenBrowserCommand:()=>mVe,loginCommand:()=>Kue,openBrowser:()=>fVe,pollForTokens:()=>pVe,requestDeviceAuthorization:()=>dVe,runLogin:()=>AVe});import{spawn as t8t}from"node:child_process";function uVe(e){return{email:e.emailAddress,name:e.name??e.user.display_name,display_name:e.user.display_name,handle:e.user.handle}}async function o8t(e){let n=await Pt({token:e}).whoAmI({headers:{}});n.status===200&&(E4e(`lore_${n.body.user.id}`),T4e(uVe(n.body)))}async function cVe(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function lVe(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Authorization failed"}async function i8t(e){return Az({resource:e,stateDir:Mr()})}function s8t(e){return process.env.LORE_DEVICE_AUTH&&process.env.LORE_DEVICE_AUTH!=="0"?!1:e==="linux"?!!(process.env.DISPLAY||process.env.WAYLAND_DISPLAY):!0}async function dVe(e){let t=await fetch(e.deviceAuthorizationEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:e.clientId,scope:Nre})}),n=await cVe(t);if(!t.ok)throw new Error(lVe(n));return n}async function pVe(e){let t=AbortSignal.timeout(Math.min(e.timeoutMs,e.expiresIn*1e3)),n=e.interval;for(;;){let r;try{r=await fetch(e.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:r8t,device_code:e.deviceCode,client_id:e.clientId}),signal:t})}catch(s){throw s instanceof Error&&s.name==="TimeoutError"?new Error("authorization timed out"):s}let o=await cVe(r);if(r.ok){let s=o.access_token,c=o.refresh_token,l=o.expires_in;if(typeof s!="string")throw new Error("device token response missing access_token");return{access_token:s,refresh_token:typeof c=="string"?c:"",expires_at:Date.now()+(typeof l=="number"?l:0)*1e3,scope:typeof o.scope=="string"?o.scope:""}}let i=o;switch(i.error){case"authorization_pending":await iVe(n*1e3);break;case"slow_down":n+=1,await iVe(n*1e3);break;case"access_denied":throw new Error("Authorization denied");case"expired_token":throw new Error("Authorization expired");default:throw new Error(lVe(i))}}}async function fVe(e){let{command:t,args:n}=mVe(process.platform,e);await new Promise((r,o)=>{let i=t8t(t,n,{detached:!0,stdio:"ignore"});i.once("error",o),i.once("spawn",()=>{i.unref(),r()})})}function mVe(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 a8t(e){if(!await Qt())return!1;try{return(await e.whoAmI({headers:{}})).status===200}catch{return!1}}async function u8t(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:sp()})}catch(r){X.warn("auto_enable_failed",{error:r instanceof Error?r.message:String(r)}),n({kind:"auto_enable_failed"})}}function c8t(e){if(lx(e))return`Could not reach the Lore API at ${rA()}. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared.`}function sVe(){let e=process.env.LORE_AUTHKIT_RESOURCE_INDICATORS?.trim();return e==="1"||e==="true"}async function aVe(e){let t=await e.deps.createLoopbackReceiver();try{let n=e.deps.generatePkce(),r=e.deps.generateState(),o=i4e({authorizationEndpoint:e.endpoints.authorizationEndpoint,clientId:e.clientId,redirectUri:t.redirectUri,codeChallenge:n.codeChallenge,resource:e.resource,scope:Nre,state:r,...e.silent?{prompt:"none"}:{}});e.emitProgress&&e.progress({kind:"browser_url",url:o});try{await e.deps.openBrowser(o),e.emitProgress&&e.progress({kind:"browser_opened"})}catch(s){X.warn("open_browser_failed",{error:s instanceof Error?s.message:String(s)}),e.emitProgress&&e.progress({kind:"browser_open_failed"})}e.emitProgress&&e.progress({kind:"waiting_for_authorization"});let{code:i}=await t.waitForCallback(r,e.timeoutMs);return await e.deps.exchangeCode({tokenEndpoint:e.endpoints.tokenEndpoint,clientId:e.clientId,code:i,codeVerifier:n.codeVerifier,redirectUri:t.redirectUri,resource:e.resource})}finally{t.close()}}async function AVe({client:e=Pt(),enableLaunchAgent:t=s8,openBrowser:n=fVe,platform:r=process.platform,discoverEndpoints:o=i8t,createLoopbackReceiver:i=rVe,generatePkce:s=r4e,generateState:c=o4e,exchangeCode:l=s4e,requestDeviceAuthorization:f=dVe,pollForTokens:h=pVe,isBrowserAvailable:y=()=>s8t(r),writeBootstrappedTokens:S=v4e,setTokens:b=C4e,cacheAnalyticsDistinctId:v=o8t,timeoutMs:x=n8t,progress:D=eVe}={}){if(await a8t(e)){D({kind:"already_logged_in"});return}try{let k=Yre(),Q=await o(k),z;if(y()){let G={createLoopbackReceiver:i,openBrowser:n,generatePkce:s,generateState:c,exchangeCode:l},$=await aVe({endpoints:Q,clientId:ax,resource:sVe()?k:void 0,silent:!1,deps:G,progress:D,emitProgress:!0,timeoutMs:x}),ie=await aVe({endpoints:Q,clientId:ZFe,resource:sVe()?H4e():void 0,silent:!0,deps:G,progress:D,emitProgress:!1,timeoutMs:x});S($,ie),z=$.access_token}else{let G=await f({deviceAuthorizationEndpoint:Q.deviceAuthorizationEndpoint,clientId:ax});D({kind:"device_authorized",userCode:G.user_code,verificationUri:G.verification_uri,verificationUriComplete:G.verification_uri_complete}),D({kind:"browser_url",url:G.verification_uri_complete}),D({kind:"waiting_for_authorization"});let $=await h({tokenEndpoint:Q.tokenEndpoint,clientId:ax,deviceCode:G.device_code,expiresIn:G.expires_in,interval:G.interval,timeoutMs:x});b($),z=$.access_token}v(z).catch(G=>{X.warn("cache_analytics_distinct_id_failed",{error:G instanceof Error?G.message:String(G)})}),D({kind:"logged_in"}),await u8t(t,r,D)}catch(k){k instanceof Error&&k.message==="authorization timed out"?(D({kind:"authorization_timed_out"}),Gw()):k instanceof Error&&k.message==="Authorization denied"?(D({kind:"authorization_denied"}),Gw()):k instanceof Error&&k.message==="Authorization expired"&&(D({kind:"authorization_expired"}),Gw());let Q=c8t(k);throw Q&&(D({kind:"login_failed",message:Q}),Gw()),k}}var n8t,r8t,iVe,Kue,Tue=O(async()=>{"use strict";A();_z();Or();dn();Cz();hr();yi();QE();await Eue();await B5e();nP();lT();tVe();oVe();n8t=300*1e3,r8t="urn:ietf:params:oauth:grant-type:device_code";iVe=e=>new Promise(t=>setTimeout(t,e));Kue={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:e}){X.info("command_start",{command:"login"});let t={client:e?.client,enableLaunchAgent:e?.enableLaunchAgent,openBrowser:e?.openBrowser,platform:e?.platform,discoverEndpoints:e?.discoverEndpoints,createLoopbackReceiver:e?.createLoopbackReceiver,generatePkce:e?.generatePkce,generateState:e?.generateState,exchangeCode:e?.exchangeCode,requestDeviceAuthorization:e?.requestDeviceAuthorization,pollForTokens:e?.pollForTokens,isBrowserAvailable:e?.isBrowserAvailable,writeBootstrappedTokens:e?.writeBootstrappedTokens,setTokens:e?.setTokens,cacheAnalyticsDistinctId:e?.cacheAnalyticsDistinctId,timeoutMs:e?.timeoutMs};if(gu()&&!e?.progress){await D5e(t),await zH({skipIfAlreadyConfigured:!0});return}await AVe({...t,progress:e?.progress})}}});A();A();(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]="7e41b086-1e44-492e-8c92-0c8341839659",e._sentryDebugIdIdentifier="sentry-dbid-7e41b086-1e44-492e-8c92-0c8341839659")}catch{}})();A();A();A();function sde(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 ade=sde();ade.ok||(process.stderr.write(`lore: ${ade.message}.
|
|
530
530
|
Upgrade Node (e.g. \`nvm install 20\`) and re-run.
|
|
531
531
|
`),process.exit(1));A();ER();$c();function Vvt(){let e=process.env.SENTRY_SPOTLIGHT?.trim();return!e||e==="0"||e==="false"?!1:e==="1"||e==="true"?!0:e}var Yvt=Vvt();BZ({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:Zr(),release:cu(),sendDefaultPii:!0,enableLogs:!0,spotlight:Yvt,tracesSampleRate:1});AU("service_name","lore-cli");ER();kZ();import{realpathSync as d5t}from"node:fs";import{fileURLToPath as p5t,pathToFileURL as IYe}from"node:url";A();A();az();Or();dn();hr();A();function zw(e){let t=e;return t._def??t.def??{}}function B2t(e){let t=zw(e);return typeof t.typeName=="string"?t.typeName:typeof t.type=="string"?t.type:void 0}function Wc(e,t,n){let r=B2t(e);return r===t||r===n}function q4e(e){let t=zw(e);if(t.element)return t.element;if(typeof t.type=="object"&&t.type!==null)return t.type}function N2t(e){let t=e.options;if(Array.isArray(t))return[...t];let n=zw(e);return Array.isArray(n.values)?[...n.values]:n.entries&&typeof n.entries=="object"?Object.values(n.entries):[]}function Kre(e){if(!e||!Wc(e,"ZodObject","object"))return;let t=e.shape;if(typeof t=="function")return t();if(t&&typeof t=="object")return t;let n=zw(e).shape;if(typeof n=="function")return n();if(n&&typeof n=="object")return n}function V4e(e){let t=e,n=!1,r,o=e.description;for(;;){o=t.description??o;let i=zw(t);if(Wc(t,"ZodOptional","optional"))n=!0,t=i.innerType;else if(Wc(t,"ZodNullable","nullable"))n=!0,t=i.innerType;else if(Wc(t,"ZodDefault","default"))r=typeof i.defaultValue=="function"?i.defaultValue():i.defaultValue,t=i.innerType;else if(Wc(t,"ZodEffects","effects"))t=i.schema;else if(Wc(t,"ZodPipeline","pipe"))t=i.in;else break}return{inner:t,optional:n,defaultValue:r,description:o}}function O2t(e,t={}){let{inner:n,optional:r,defaultValue:o,description:i}=V4e(e),s=!1,c=n;Wc(c,"ZodArray","array")&&(s=!0,c=q4e(c)??c);let l=!r&&o===void 0;return t.positional?{arg:{type:"positional",description:i,required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:Wc(c,"ZodEnum","enum")?{arg:{type:"enum",description:i,options:N2t(c),required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:Wc(c,"ZodBoolean","boolean")?{arg:{type:"boolean",description:i,required:l,...typeof o=="boolean"?{default:o}:{}},optional:r,isArray:s}:{arg:{type:"string",description:s?`${i??""}${i?" ":""}(comma-separated)`.trim()||void 0:i,required:l,...o!==void 0?{default:String(o)}:{},...s?{valueHint:"a,b,c"}:{}},optional:r,isArray:s}}function Jre(e,t={}){let n={},r={};for(let[o,i]of Object.entries(e)){let{arg:s,isArray:c}=O2t(i,t);n[o]=s,r[o]={isArray:c,leafKind:w2t(i)}}return{args:n,fields:r}}function Zre(e,t={}){let n=Kre(e);return n?Jre(n,t):{args:{},fields:{}}}function w2t(e){let{inner:t}=V4e(e),n=t;return Wc(n,"ZodArray","array")&&(n=q4e(n)??n),Wc(n,"ZodNumber","number")?"number":Wc(n,"ZodBoolean","boolean")?"boolean":Wc(n,"ZodEnum","enum")?"enum":Wc(n,"ZodString","string")?"string":"other"}function k2t(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 P2t(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 Wre(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 M2t(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 L2t(e,t){let n=t.path.map(o=>String(o)).join(".");return` ${n?`${e}.${n}`:e}: ${t.message}`}function Xre(e,t,n){if(!e)return[];let r=t??{},o=e.safeParse(r);return o.success?[]:(o.error.issues??[]).map(s=>L2t(n,s))}function U2t(e,t,n){return e.resource==="threads"&&t==="id"?M2t(n):n}function Y4e(e){let t=k2t(mz,e.path),n=Kre(t.pathParams),r=e.positional??(n?Object.keys(n):[]),o=new Set(r),i=Jre(n?Object.fromEntries(r.map(h=>[h,n[h]])):{},{positional:!0}),s=Zre(t.query),c=t.method==="GET"||t.method==="DELETE"?{args:{},fields:{}}:Zre(t.body);for(let h of Object.keys(c.args))if(s.args[h]!==void 0||o.has(h))throw new Error(`route [${e.path.join(".")}] has overlapping field "${h}" across path/query/body`);let l={...i.args,...s.args,...c.args},f=e.description??t.summary??`${t.method} ${t.path}`;return{meta:{name:e.op,description:f},args:l,async run({args:h,data:y}){X.info("command_start",{command:`${e.resource} ${e.op}`,route:e.path.join(".")});let S=y;if(!await(S?.getAccessToken??Qt)())throw new be("not logged in \u2014 run 'lore login' first");let v={};for(let ge of r){let Ce=h[ge],ve=Wre(Ce,i.fields[ge])??Ce;v[ge]=U2t(e,ge,ve)}let x={};for(let[ge,Ce]of Object.entries(s.fields)){let ve=Wre(h[ge],Ce);ve!==void 0&&(x[ge]=ve)}let D={};for(let[ge,Ce]of Object.entries(c.fields)){let ve=Wre(h[ge],Ce);ve!==void 0&&(D[ge]=ve)}let k=[...Xre(t.pathParams,v,"path"),...Xre(t.query,x,"query"),...t.method==="GET"||t.method==="DELETE"?[]:Xre(t.body,D,"body")];if(k.length>0)throw new be(`Invalid request for \`lore ${e.resource} ${e.op}\`:
|
|
532
532
|
${k.join(`
|
|
@@ -545,14 +545,14 @@ Inspect: lore quarantine show <id> Discard: lore quarantine discard <id> Ret
|
|
|
545
545
|
The held transcript is never uploaded, and secret values are never shown.`)}},D8t={meta:{name:"discard",description:"Delete a quarantined thread locally (it is never uploaded)"},args:{id:{type:"positional",required:!0,description:"Quarantine id or prefix"}},async run({args:e}){let t=await ice(String(e.id));await Wk(t.id),console.log(`Discarded quarantine ${t.id.slice(0,12)} (deleted locally).`)}},B8t={meta:{name:"release",description:"Re-scan the current source transcript and upload it only if it is now clean"},args:{id:{type:"positional",required:!0,description:"Quarantine id or prefix"}},async run({args:e}){let t=await ice(String(e.id)),n=await Fi(t.sourcePath);if(!n.exists)throw new be(`source transcript no longer exists: ${t.sourcePath} \u2014 run \`lore quarantine discard ${t.id.slice(0,12)}\``);if(!await Qt())throw new be("not logged in \u2014 run 'lore login' first");let r=R8t.has(t.harness)?t.harness:"unspecified",o=await td(t.sourcePath),i={key:t.id,filename:t.filename,sourcePath:t.sourcePath,repoOriginPath:"",tempPath:o.tempPath,md5:o.md5,fileType:"transcript",harness:r,harnessInternalId:t.harnessInternalId,watchedState:n};try{let[s]=await SA(Pt(),[i]);if(!s||s.status==="no_upload"){console.log("Nothing to upload.");return}if(s.status==="quarantined"){s.quarantineId!==t.id&&await Wk(t.id),console.log(`Still held: ${s.findingCount} finding(s) remain in the current source. Remove them, then release again.`);return}await Wk(t.id),console.log(`Released ${t.id.slice(0,12)} \u2014 uploaded${s.status==="deduped"?" (already on Lore)":""} and removed from quarantine.`)}finally{await Ap(o.tempPath)}}},YVe={meta:{name:"quarantine",description:"Inspect and manage transcripts the scrubber held locally (never uploaded)"},subCommands:{list:VVe,show:x8t,discard:D8t,release:B8t},run:VVe.run};A();kZ();Vk();dn();$k();import{spawn as G8t}from"node:child_process";import{stdin as o7e,stdout as z8t}from"node:process";import{createInterface as j8t}from"node:readline/promises";A();dn();hr();yi();r8();t8();QE();A();await po();var uP=se(an(),1);await zT();A();await po();await AA();await HT();await gA();await $T();await qT();var sc=se(Ft(),1),N8t={enable:"lore enable",disable:"lore disable",restart:"lore restart"},O8t={enable:"installing the launchd agent (\u2264 1 minute)\u2026",disable:"unloading the launchd agent\u2026",restart:"kickstarting the launchd agent\u2026"},w8t={enable:"Background uploads enabled",disable:"Background uploads disabled",restart:"Background uploads restarted"};function KVe(){return{phase:"starting"}}function JVe(e,t){switch(t.kind){case"enable_started":case"restart_started":case"disable_started":return{...e,phase:"in_progress"};case"enable_finished":return{...e,phase:"finished",result:{plistPath:t.plistPath,binaryPath:t.binaryPath,logFile:t.logFile}};case"restart_finished":case"disable_finished":return{...e,phase:"finished"};case"error":return{...e,phase:"errored",errorMessage:t.message}}}function a0({mode:e,state:t}){return(0,sc.jsxs)(he,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,sc.jsx)(Bs,{title:N8t[e],subtitle:"background uploads"}),t.phase==="starting"||t.phase==="in_progress"?(0,sc.jsx)(Ln,{title:"Working",children:(0,sc.jsx)(Ma,{label:O8t[e]})}):null,t.phase==="finished"?(0,sc.jsx)(Ns,{kind:"success",title:w8t[e],children:k8t(e,t)}):null,t.phase==="errored"?(0,sc.jsx)(Ns,{kind:"error",title:"Failed",children:(0,sc.jsx)(Ae,{children:t.errorMessage??"Unknown error."})}):null]})}function k8t(e,t){return e==="disable"?(0,sc.jsx)(Ae,{children:"The Lore launchd agent has been unloaded and its stable binary removed."}):t.result?(0,sc.jsxs)(he,{flexDirection:"column",children:[(0,sc.jsx)(rn,{label:"LaunchAgent",value:t.result.plistPath}),(0,sc.jsx)(rn,{label:"Stable binary",value:t.result.binaryPath}),(0,sc.jsx)(rn,{label:"Log file",value:t.result.logFile})]}):(0,sc.jsx)(Ae,{children:"The Lore launchd agent is running again. Run lore status to inspect it."})}A();await po();await AA();await HT();await gA();await qT();Ds();var Vr=se(Ft(),1);function sP({report:e}){let t=e.healthy?"success":e.enabled?"warning":"idle";return(0,Vr.jsxs)(he,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Vr.jsx)(Bs,{title:"lore status",subtitle:"background uploads"}),(0,Vr.jsxs)(he,{flexDirection:"row",gap:2,children:[(0,Vr.jsx)(he,{flexDirection:"column",width:"50%",children:(0,Vr.jsxs)(Ln,{title:"Health",children:[(0,Vr.jsx)(rn,{label:"State",value:e.health,kind:t}),(0,Vr.jsx)(rn,{label:"Enabled",value:e.enabled?"yes":"no",kind:e.enabled?"success":"idle"}),(0,Vr.jsx)(rn,{label:"Loaded",value:e.loaded?"yes":"no",kind:e.loaded?"success":"idle"}),(0,Vr.jsx)(rn,{label:"Running",value:e.running?"yes":"no",kind:e.running?"success":"idle"}),(0,Vr.jsx)(rn,{label:"Heartbeat",value:e.status?.last_heartbeat_at?ZVe(e.status.last_heartbeat_at):"never",kind:e.heartbeat_fresh?"success":"idle"}),(0,Vr.jsx)(rn,{label:"Last upload",value:e.status?.last_success_at?ZVe(e.status.last_success_at):"never"})]})}),(0,Vr.jsx)(he,{flexDirection:"column",width:"50%",children:(0,Vr.jsxs)(Ln,{title:"Paths",children:[(0,Vr.jsx)(rn,{label:"LaunchAgent",value:e.plist_path}),(0,Vr.jsx)(rn,{label:"Stable binary",value:e.binary_path}),(0,Vr.jsx)(rn,{label:"Status file",value:e.status_path}),(0,Vr.jsx)(rn,{label:"Install source",value:e.install_source_path}),(0,Vr.jsx)(rn,{label:"Label",value:e.label})]})})]}),e.status?.last_error?(0,Vr.jsx)(he,{marginTop:1,children:(0,Vr.jsx)(Ns,{kind:"error",title:"Last error",children:(0,Vr.jsx)(Ae,{color:Re.danger,children:e.status.last_error})})}):null,e.healthy?null:(0,Vr.jsx)(he,{marginTop:1,children:(0,Vr.jsx)(Ns,{kind:"warning",title:`Not healthy: ${e.health}`,children:(0,Vr.jsxs)(Ae,{children:["Run ",(0,Vr.jsx)(Ae,{bold:!0,children:"lore restart"})," to kick the agent, or ",(0,Vr.jsx)(Ae,{bold:!0,children:"lore logs"})," to inspect recent activity."]})})})]})}function ZVe(e){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`}var aP=se(Ft(),1);function P8t({mode:e,perform:t}){let[n,r]=(0,uP.useState)(KVe),{exit:o}=Rs();return(0,uP.useEffect)(()=>{let i=!1,s=c=>{i||r(l=>JVe(l,c))};return(async()=>{try{await t(s)}catch(c){s({kind:"error",message:c instanceof Error?c.message:String(c)}),setTimeout(()=>o(c instanceof Error?c:new Error(String(c))),100);return}setTimeout(()=>o(),100)})(),()=>{i=!0}},[]),(0,aP.jsx)(a0,{mode:e,state:n})}async function sce(e,t){await el((0,aP.jsx)(P8t,{mode:e,perform:t})).waitUntilExit()}async function WVe(e){function t(){let{exit:r}=Rs();return(0,uP.useEffect)(()=>{setTimeout(()=>r(),50)},[]),(0,aP.jsx)(sP,{report:e})}await el((0,aP.jsx)(t,{})).waitUntilExit()}nP();A();yi();var f8=e=>{switch(e.kind){case"enable_started":console.log("(we're waiting on macOS launchd; this takes up to a minute \u2026)");return;case"enable_finished":console.log("Lore background uploads enabled."),console.log(`LaunchAgent: ${e.plistPath}`),console.log(`Stable binary: ${e.binaryPath}`),console.log(`Log file: ${e.logFile}`);return;case"disable_started":return;case"disable_finished":console.log("Lore background uploads disabled.");return;case"restart_started":console.log("(we're waiting on macOS launchd; this takes up to a minute \u2026)");return;case"restart_finished":console.log("Lore background uploads restarted.");return;case"error":console.error(e.message);return}};var XVe="(we're waiting on macOS launchd; this takes up to a minute \u2026)";function M8t(){if(!process.stdout.isTTY)return console.log(XVe),{stop(){}};let e=["|","/","-","\\"],t=0,n=()=>{process.stdout.write(`\r${e[t%e.length]} ${XVe}`),t++};n();let r=setInterval(n,100);return{stop(){clearInterval(r),process.stdout.write("\r\x1B[2K")}}}async function ace(e,t,n){t(e==="enable"?{kind:"enable_started"}:{kind:"restart_started"});let{plistPath:r,binaryPath:o}=await n();t(e==="enable"?{kind:"enable_finished",plistPath:r,binaryPath:o,logFile:sp()}:{kind:"restart_finished"})}async function uce(e,t){e({kind:"disable_started"}),await t(),e({kind:"disable_finished"})}async function cce(e,t){let n=t?.enableLaunchAgent??s8,r=t?.disableLaunchAgent??$qe;if(e==="disable"){if(t?.progress){await uce(t.progress,r);return}if(gu()){await sce("disable",s=>uce(s,r));return}await uce(f8,r);return}if(t?.progress){await ace(e,t.progress,n);return}if(gu()){await sce(e,s=>ace(e,s,n));return}let o=M8t(),i=[];try{await ace(e,s=>i.push(s),n)}finally{o.stop()}if(e==="enable"){X.info("daemon.enable.captured",{kinds:i.map(c=>c?.kind??"unknown")});let s=L8t(i);f8({kind:"enable_finished",plistPath:s.plistPath,binaryPath:s.binaryPath,logFile:sp()})}else f8({kind:"restart_finished"})}function L8t(e){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r?.kind==="enable_finished")return{plistPath:r.plistPath,binaryPath:r.binaryPath}}let t=e.map(n=>n?.kind??"unknown").join(", ");throw new Error(`enable_finished event was never emitted (captured: [${t}])`)}var t7e={meta:{name:"enable",description:"Install and start background uploads"},async run({data:e}){await cce("enable",e)}},m8={meta:{name:"disable",description:"Stop and remove background uploads"},async run({data:e}){await cce("disable",e)}},n7e={meta:{name:"restart",description:"Restart background uploads"},async run({data:e}){await cce("restart",e)}};function U8t(e){let t=[];return t.push(`Lore: ${e.health}`),t.push(`Enabled: ${e.enabled}`),t.push(`Loaded: ${e.loaded}`),t.push(`Running: ${e.running}`),t.push(`Healthy: ${e.healthy}`),e.status?.last_heartbeat_at&&t.push(`Last heartbeat: ${e.status.last_heartbeat_at}`),e.status?.last_success_at&&t.push(`Last success: ${e.status.last_success_at}`),e.status?.last_error&&t.push(`Last error: ${e.status.last_error}`),t.push(`LaunchAgent: ${e.plist_path}`),t.push(`Stable binary: ${e.binary_path}`),t.push(`Status file: ${e.status_path}`),t.join(`
|
|
546
546
|
`)}async function Q8t(){await n8(new Date);let e=(await iD()).length,t=Nqe(),n=t.source?`v${t.schemaVersion} (bundled, ${t.source.tool} ${t.source.ref})`:`v${t.schemaVersion} (bundled)`;return{quarantined:e,ruleset:n}}function e7e(e){return`Scrubber: ${e.quarantined===0?"no quarantined threads":`${e.quarantined} quarantined thread(s) \u2014 run \`lore quarantine\``}; ruleset ${e.ruleset}`}var r7e={meta:{name:"status",description:"Show background upload status"},args:{json:{type:"boolean",description:"Output status as JSON"}},async run({args:e,data:t}){let r=await(t?.getLaunchAgentStatusReport??a8)(),o=await Q8t();if(e.json){if(console.log(JSON.stringify({...r,scrubber:o},null,2)),!r.healthy)throw new be(`Lore background uploads are not healthy: ${r.health}`);return}if(gu()){if(await WVe(r),console.log(e7e(o)),!r.healthy)throw new be("");return}if(console.log(U8t(r)),console.log(e7e(o)),!r.healthy)throw new be(`Lore background uploads are not healthy: ${r.health}`)}};var cP="@tanagram/lore",A8={command:"npm",args:["uninstall","-g",cP]};function H8t(e){switch(e){case"yarn":return{command:"yarn",args:["global","remove",cP]};case"pnpm":return{command:"pnpm",args:["remove","-g",cP]};case"npm":case"unknown":return A8}}async function $8t(){if(!o7e.isTTY)return"";let e=j8t({input:o7e,output:z8t});try{return await e.question("Why are you uninstalling Lore? (optional) ")}finally{e.close()}}async function q8t({promptForReason:e=$8t,track:t=uh,detectPackageManager:n=YH,runDisable:r=Y8t,runPackageCommand:o=K8t,log:i=console.log}={}){let s=(await e()).trim();s&&await lce({log:i,startMessage:"Recording uninstall feedback...",failureAction:"record uninstall feedback",manualInstruction:"You can send feedback to support@tanagram.ai.",run:()=>t("lore.cli.uninstall.feedback",{reason:s})}),await lce({log:i,startMessage:"Stopping background uploads...",failureAction:"stop background uploads",manualInstruction:"You can run `lore disable` manually.",run:r});let c=await V8t(n,i),l=i7e(c.command,c.args);await lce({log:i,startMessage:`Uninstalling ${cP} with ${c.command}...`,failureAction:`uninstall ${cP}`,manualInstruction:`You can run \`${l}\` manually.`,run:()=>o(c.command,c.args)}),i("goodbye")}async function V8t(e,t){try{let{packageManager:n}=await e();return H8t(n)}catch(n){return t(`Could not detect package manager: ${Xn(n)}`),t(`Falling back to \`${i7e(A8.command,A8.args)}\`.`),A8}}async function lce({log:e,startMessage:t,failureAction:n,manualInstruction:r,run:o}){e(t);try{await o()}catch(i){e(`Could not ${n}: ${Xn(i)}`),e(r)}}function i7e(e,t){return[e,...t].join(" ")}async function Y8t(){await OS(m8,{rawArgs:[]})}function K8t(e,t){return new Promise((n,r)=>{let o=G8t(e,t,{stdio:"inherit"});o.on("error",r),o.on("close",(i,s)=>{if(i===0){n();return}let c=s?`signal ${s}`:`exit code ${i??"unknown"}`;r(new Error(`${e} ${t.join(" ")} failed with ${c}`))})})}var s7e={meta:{name:"uninstall",description:"Uninstall Lore and remove local integrations",skipAutoupdate:!0},async run(){await q8t()}};A();Vk();dn();var lP="@tanagram/lore";async function J8t({runUpdate:e=X5e,log:t=console.log}={}){t("Checking for Lore CLI updates...");let n=await e();if(Z8t(n,t))throw new be("")}function Z8t(e,t){return e?e.error?(t(`Update failed: ${e.error}`),!0):e.newVersion?(t(`Updated ${lP} from ${e.oldVersion} to ${e.newVersion}.`),!1):e.latestVersion===e.oldVersion?(t(`Lore CLI is already up to date (${e.oldVersion}).`),!1):e.pnpmUpdateMessage?(t(e.pnpmUpdateMessage),!1):e.packageManager==="unknown"?(t(`Could not determine how Lore was installed. Run \`npm install -g ${lP}\` to update manually.`),!1):e.latestVersion?(t(`A newer version of ${lP} is available (${e.latestVersion}). Run \`npm install -g ${lP}\` to update manually.`),!1):(t("No update was applied."),!1):(t(`This CLI build cannot be updated automatically. Install ${lP} with npm to update.`),!1)}var a7e={meta:{name:"update",description:"Update the Lore CLI in the foreground",skipAutoupdate:!0},async run(){await J8t()}};A();$c();var u7e={meta:{name:"version",description:"Print the Lore CLI version"},run(){console.log(cu())}};A();A();Or();dn();async function c7e(){if(!await Qt())throw new be("not logged in \u2014 run 'lore login' first")}dn();hr();QE();await Eue();rc();var l7e={meta:{name:"configure",description:"Re-run the guided setup for which directories Lore auto-uploads from."},args:{json:{type:"boolean",description:"Print the upload filter allowlist as JSON and exit."},set:{type:"string",description:"Replace the upload filter allowlist with the given JSON document (the same shape `--json` prints). Prints the normalized result as JSON."}},async run({args:e,data:t}){if(X.info("command_start",{command:"configure"}),await c7e(),typeof e.set=="string"){let n;try{n=JSON.parse(e.set)}catch(o){let i=o instanceof Error?o.message:String(o);throw new be(`--set must be valid JSON: ${i}`)}let r;try{r=Wae(n,"from --set")}catch(o){let i=o instanceof Error?o.message:String(o);throw new be(i)}await ed(r),console.log(JSON.stringify(DH(r),null,2));return}if(e.json){let n=await bi();console.log(JSON.stringify(DH(n),null,2));return}if(!gu())throw new be("lore configure needs an interactive terminal \u2014 use `lore configure --json` / `lore configure --set <json>` or `lore listen create <path>` to manage upload filters non-interactively.");await zH({client:t?.client})}};Vk();$c();dn();hr();A();VH();var W8t=()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||!!e.CI},d7e="\x1B",g8=(e,t,n)=>r=>n?r:`${d7e}[${e}m${r}${d7e}[${t}m`,X8t=e=>({cyan:g8(36,39,e),gray:g8(90,39,e),bold:g8(1,22,e),underline:g8(4,24,e)});async function dce(e,t={}){let n=t.noColor??W8t(),{cyan:r,gray:o,bold:i,underline:s}=X8t(n),c=await La(e.meta),l=c?.name??"lore",f=c?.description??"",h=await La(e.subCommands),y=[];for(let[x,D]of Object.entries(h??{})){let k=await La(D),Q=await La(k.meta);Q?.hidden||y.push({name:x,description:Q?.description??"",subDef:k})}let S=[];for(let x of y){S.push([r(x.name),x.description]);let D=await La(x.subDef.subCommands);if(D)for(let[k,Q]of Object.entries(D)){let z=await La(Q),G=await La(z.meta);G?.hidden||S.push([` ${r(k)}`,G?.description??""])}}let b=S.reduce((x,[D])=>Math.max(x,D.length),0),v=[];v.push(o(`${f} (${l})`),""),v.push(`${s(i("USAGE"))} ${r(`${l} ${y.map(x=>x.name).join("|")}`)}`,""),v.push(s(i("COMMANDS")),"");for(let[x,D]of S)v.push(` ${x.padEnd(b)} ${D}`);return v.push("",`Use ${r(`${l} <command> --help`)} for more information about a command.`),v.join(`
|
|
547
547
|
`)}A();VH();async function p7e(e,t){let n=t.filter(i=>!i.startsWith("-")),r=e,o;for(let i of n){let s=await La(r.subCommands);if(!s||!(i in s))break;let c=await La(s[i]);if(!c)break;o=r,r=c}return[r,o]}A();dn();hr();LT();rc();function e$t(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 h8(){return await Of(),bi()}function pce(e){let t=yu(e);if(!t)throw new be("path must not be empty");return t}async function f7e(){let e=await h8();return e$t(e)}function m7e(e){return e.length>0}function t$t(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 n$t={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}){X.info("command_start",{command:"listen create"});let t=await h8(),n=pce(String(e.path));await ed({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),console.log(`uploading from ${n}`)}},r$t={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}){X.info("command_start",{command:"listen list"});let t=await f7e();if(e.json){console.log(JSON.stringify({version:1,locations:t},null,2));return}if(!m7e(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}t$t(t)}},o$t={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}){X.info("command_start",{command:"listen delete"});let t=await h8(),n=pce(String(e.path)),r=t.include.cwd.filter(o=>o!==n);if(r.length===t.include.cwd.length)throw new be(`no upload directory at ${n}`);await ed({...t,include:{...t.include,cwd:r}}),console.log(`stopped uploading from ${n}`)}},i$t={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}){X.info("command_start",{command:"listen update"});let t=pce(String(e.path));throw(await h8()).include.cwd.includes(t)?new be("`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 be(`no upload directory at ${t}`)}},A7e={meta:{name:"listen",description:"Manage the directories Lore is allowed to auto-upload from."},subCommands:{create:n$t,list:r$t,update:i$t,delete:o$t},async run({rawArgs:e}){let t=new Set(["create","list","update","delete"]);if(e.some(r=>t.has(r)))return;X.info("command_start",{command:"listen"});let n=await f7e();if(console.log(`lore listen \u2014 locations Lore is allowed to auto-upload from
|
|
548
|
-
`),!m7e(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")}};A();LT();A();dn();yi();XE();rc();import s$t from"node:fs/promises";async function a$t(e){try{return await s$t.access(e),!0}catch(t){if(Xr(t,"ENOENT"))return!1;throw t}}async function u$t({uploadFilterPath:e=sT()}={}){if(!await a$t(e))return;let t=await bi(e),n=[],r=[];for(let o of t.include.cwd){let i=await Fk(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await ed({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var g7e={id:"20260519000000-upload-filter-cwds-to-repos",run:u$t};var c$t=[W9e,g7e];async function l$t(e=c$t,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 h7e={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await l$t()}};$re();$k();A();Or();$c();hr();Cue();import{platform as d$t,release as p$t}from"node:os";function f$t(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function _7e(e){try{let t={command:f$t(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:cu(),nodeVersion:process.version,platform:d$t(),release:p$t()};(await L5e({error:e.error,context:t,logger:X,send:async r=>{let i=await Pt().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"&&X.info("error_report_sent")}catch(t){X.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}A();Or();dn();A();dn();hr();rc();import E7e from"node:fs";import m$t from"node:fs/promises";import{watch as A$t}from"node:fs/promises";import{setTimeout as g$t}from"node:timers/promises";async function fce(e){let t=await e.listSkillInstallationSync({});if(t.status!==200){let s=t.body?.message??`listSkillInstallationSync returned ${t.status}`;throw new be(s)}X.info("skill_installation_sync_listed",{remote_count:t.body.objects.length});let n=0,r=0,o=new Map;for(let s of t.body.objects){o.set(s.skill_id,s);let c=await cD(s.skill_id),l=c?.installPath??iP(s.root_kind,s.name),f=await S7e(l),h=f===null?null:Ep(f);if(f!==null&&!c){X.warn("skill_installation_conflict_detected",{skill_id:s.skill_id,installation_id:s.id,name:s.name,install_path:l,reason:"unmanaged_local_file"}),await ic(v$t(s,l)),r+=1;continue}if(c&&h!==null&&h!==c.lastInstalledHash&&h!==s.latest_content_hash&&s.latest_version!==c.lastInstalledVersion){X.warn("skill_installation_conflict_detected",{skill_id:s.skill_id,installation_id:s.id,name:s.name,install_path:l,reason:"local_and_remote_changed"}),await ic({...c,lastSyncStatus:"conflict"}),r+=1;continue}if(c&&h===s.latest_content_hash){s.installed_version!==s.latest_version&&(await _8(e,s.id,s.latest_version),X.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version})),await ic({...c,installationId:s.id,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"});continue}if(c?.lastSyncStatus==="proposed"&&h===c.lastInstalledHash)continue;if(c?.lastInstalledVersion===s.latest_version&&f!==null){s.installed_version!==s.latest_version&&(await _8(e,s.id,s.latest_version),X.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await ic({...c,installationId:s.id}));continue}X.info("skill_installation_download_started",{skill_id:s.skill_id,installation_id:s.id,name:s.name,version:s.latest_version,root_kind:s.root_kind,install_path:l});let y=await C$t(e,s.skill_id,s.latest_version);if(Ep(y)!==s.latest_content_hash)throw new be(`downloaded SKILL.md hash did not match metadata for ${s.skill_id}`);let b=await d8(s.root_kind,s.name,y);await _8(e,s.id,s.latest_version),X.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await ic({installationId:s.id,skillId:s.skill_id,name:s.name,rootKind:s.root_kind,installPath:b,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"}),X.info("skill_installation_download_applied",{skill_id:s.skill_id,installation_id:s.id,name:s.name,version:s.latest_version,root_kind:s.root_kind,install_path:b}),n+=1}let i=await T$t(e,o);return{installedUpdated:n,localEditsUploaded:i,conflicts:r}}async function y7e(e){if(e.signal?.aborted)return;let t=e.sleep??S$t;X.info("skill_sync_daemon_start",{watch:!!e.watch,poll_interval_ms:e.pollIntervalMs,watch_debounce_ms:e.watchDebounceMs});let n=Promise.resolve(),r=async(l,f)=>{n=n.then(async()=>{if(e.signal?.aborted)return;let h=Date.now();X.info("skill_sync_pass_started",{reason:l,event_type:f?.type,event_id_present:!!f?.id});try{let y=await(e.syncLocalSkills??QVe)(e.client),S=await fce(e.client),b={captured:y.pushed.length,installedUpdated:S.installedUpdated,localEditsUploaded:S.localEditsUploaded,conflicts:S.conflicts};X.info("skill_sync_pass_completed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,captured_pushed:y.pushed.length,captured_unchanged:y.unchanged.length,captured_skipped:y.skipped.length,installed_updated:S.installedUpdated,local_edits_uploaded:S.localEditsUploaded,conflicts:S.conflicts,duration_ms:Date.now()-h}),await e.onSyncPass?.({reason:l,event:f,result:b}),f?.id&&await ece(f.id)}catch(y){throw X.error("skill_sync_pass_failed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,error:Xn(y),duration_ms:Date.now()-h}),y}}),await n},o=async l=>{let f=l.id;f&&(n=n.then(async()=>{e.signal?.aborted||await ece(f)}),await n)};await r("startup");let i=(async()=>{for await(let l of e.events??E$t()){if(e.signal?.aborted)return;if(l.type==="stream.reconnected"){await r("reconnect",l);continue}if(!y$t(l)){await o(l);continue}await r(l.type==="stream.catchup_truncated"?"catchup_truncated":"event",l)}})(),s=e.watch?h$t({signal:e.signal,debounceMs:e.watchDebounceMs,sleep:t,runPass:()=>r("fs_event")}):Promise.resolve(),c=(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 i;return}await Promise.race([i,c,s])}async function h$t(e){let t=e.debounceMs??2e3,n=await bi(),r=n.include.cwd.length,o=SVe(process.cwd(),n.include.cwd).filter(y=>{try{return E7e.existsSync(y)&&E7e.statSync(y).isDirectory()}catch{return!1}});if(o.length===0)return X.info("skill_watch_no_roots",{configured_project_root_count:r}),_$t(e.signal);X.info("skill_watch_started",{watch_root_count:o.length,debounce_ms:t});let i=!1,s=!1,c,l=async()=>{if(i){s=!0;return}i=!0;try{do s=!1,e.signal?.aborted||await e.runPass();while(s&&!e.signal?.aborted)}finally{i=!1}},f=()=>{X.info("skill_watch_pass_scheduled",{debounce_ms:t}),c&&clearTimeout(c),c=setTimeout(()=>{c=void 0,l()},t),c.unref?.()},h=async y=>{for(;!e.signal?.aborted;)try{for await(let S of A$t(y,{signal:e.signal,recursive:!0})){if(e.signal?.aborted)break;let b=S.filename?String(S.filename):null,v=!b||b.endsWith("SKILL.md");X.info("skill_watch_event",{root:y,filename:b,filename_is_skill_md:v}),v&&f()}}catch(S){if(e.signal?.aborted||S?.name==="AbortError")break;X.warn("skill_watch_retry",{root:y,retry_ms:3e4,error:Xn(S)}),await e.sleep(3e4,e.signal)}};try{await Promise.all(o.map(h))}finally{for(c&&clearTimeout(c);i;)await g$t(50).catch(()=>{})}}async function _$t(e){e?.aborted||await new Promise(t=>e?.addEventListener("abort",()=>t(),{once:!0}))}async function*E$t(){}function y$t(e){return e.type.startsWith("skill.version.")||e.type==="skill.published"||e.type==="stream.catchup_truncated"}function S$t(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 T$t(e,t){let n=0,r;for(let o of await wVe()){if(o.lastSyncStatus==="conflict")continue;let i=await S7e(o.installPath);if(i===null||Ep(i)===o.lastInstalledHash)continue;X.info("skill_local_edit_detected",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,base_version:o.baseVersion,last_sync_status:o.lastSyncStatus});let c=t.get(o.skillId);if(c&&c.latest_version!==o.baseVersion){X.warn("skill_installation_conflict_detected",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,reason:"remote_advanced_before_upload",base_version:o.baseVersion,remote_version:c.latest_version}),await ic({...o,lastSyncStatus:"conflict"});continue}r??=await I$t(e);let l=await b$t(e,o.skillId),f=l&&l===r?"owner_update":"subscriber_update",h;try{h=await lD(e,{skillId:o.skillId,name:o.name,description:null,bodyMd:i,filePath:o.installPath,rootKind:o.rootKind},{syncAction:f,baseVersion:o.baseVersion})}catch(y){throw X.warn("skill_local_edit_upload_failed",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,sync_action:f,base_version:o.baseVersion,error:Xn(y)}),y}X.info("skill_local_edit_uploaded",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,sync_action:f,version:h.version,version_status:h.version_status}),h.version_status==="accepted"?(await _8(e,o.installationId,h.version),await ic({...o,baseVersion:h.version,baseContentHash:h.content_hash,lastInstalledVersion:h.version,lastInstalledHash:h.content_hash,lastSyncStatus:"current"})):h.version_status==="proposed"&&await ic({...o,lastInstalledVersion:h.version,lastInstalledHash:h.content_hash,lastSyncStatus:"proposed"}),n+=1}return n}async function _8(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 be(`wrote skill locally, but failed to record installed version: ${o}`)}}async function I$t(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}async function b$t(e,t){let n=await e.getSkillDetail({params:{id:t}});return n.status!==200?null:n.body.owner?.id??null}async function C$t(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 be(o)}return typeof r.body=="string"?r.body:String(r.body)}function v$t(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 S7e(e){try{return await m$t.readFile(e,"utf8")}catch{return null}}A();Or();dn();hr();import{setTimeout as R$t}from"node:timers/promises";var x$t=75e3,D$t=1e3,B$t=6e4,N$t=250,E8=class extends be{constructor(t){super(`skill sync event stream returned ${t}; login is required`),this.name="SkillSyncEventStreamAuthError"}};async function*I7e(e){if(!e.userId)throw new be("workspace skill sync daemon needs a user subject to subscribe to");if(e.organizationIds.length===0)throw new be("workspace skill sync daemon needs at least one workspace to subscribe to");let t=e.reconnect??!1,n=P$t(e.backoff),r=e.lastEventId,o=!1;for(;!e.signal?.aborted;)try{o&&(yield{type:"stream.reconnected"});let i=!1;for await(let s of O$t({...e,lastEventId:r}))i=!0,s.id&&(r=s.id),X.info("skill_event_stream_event_received",{event_type:s.type,event_id_present:!!s.id}),yield s;if(!t||e.signal?.aborted)return;o=!0,X.warn("skill_event_stream_disconnected",{saw_frame:i,will_reconnect:!0}),i&&n.reset(),X.info("skill_event_stream_reconnect_scheduled",{reason:"eof"}),await n.sleep(e.signal)}catch(i){if(e.signal?.aborted||i?.name==="AbortError")return;if(i instanceof E8||!t)throw i;o=!0,X.warn("skill_event_stream_disconnected",{saw_frame:!1,will_reconnect:!0,error:Xn(i)}),X.info("skill_event_stream_reconnect_scheduled",{reason:"error"}),await n.sleep(e.signal)}}async function*O$t(e){let t=e.token??await(e.getAccessToken??Qt)();if(!t)throw new be("workspace skill sync daemon requires login \u2014 run 'lore login' first");let n=new URL("/api/events/stream",e.apiBaseUrl??rA());n.searchParams.append("subject",`user:${e.userId}`);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),X.info("skill_event_stream_connecting",{organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});let o=await(e.fetch??fetch)(n,{headers:r,signal:e.signal});if(o.status===401||o.status===403)throw X.warn("skill_event_stream_auth_failed",{status:o.status}),new E8(o.status);if(!o.ok)throw new be(`skill sync event stream returned ${o.status}`);if(!o.body)throw new be("skill sync event stream returned no response body");X.info("skill_event_stream_connected",{status:o.status,organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});for await(let i of w$t(o.body,{signal:e.signal,heartbeatTimeoutMs:e.heartbeatTimeoutMs??x$t}))yield{id:i.id,type:i.event??"message"}}async function*w$t(e,t={}){let n=new TextDecoder,r=e.getReader(),o="";try{for(;;){let{done:s,value:c}=await k$t(r,t.heartbeatTimeoutMs,t.signal);if(s)break;o+=n.decode(c,{stream:!0});let l=o.split(/\r?\n\r?\n/);o=l.pop()??"";for(let f of l){let h=T7e(f);h&&(yield h)}}o+=n.decode();let i=T7e(o);i&&(yield i)}finally{r.releaseLock()}}async function k$t(e,t,n){if(t===void 0||t<=0)return e.read();let r,o;try{return await Promise.race([e.read(),new Promise((i,s)=>{r=setTimeout(()=>s(new be("skill sync event stream heartbeat stalled")),t),r.unref?.(),o=()=>s(new DOMException("Aborted","AbortError")),n?.addEventListener("abort",o,{once:!0})})])}finally{r&&clearTimeout(r),o&&n?.removeEventListener("abort",o)}}function T7e(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}
|
|
548
|
+
`),!m7e(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")}};A();LT();A();dn();yi();XE();rc();import s$t from"node:fs/promises";async function a$t(e){try{return await s$t.access(e),!0}catch(t){if(Xr(t,"ENOENT"))return!1;throw t}}async function u$t({uploadFilterPath:e=sT()}={}){if(!await a$t(e))return;let t=await bi(e),n=[],r=[];for(let o of t.include.cwd){let i=await Fk(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await ed({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var g7e={id:"20260519000000-upload-filter-cwds-to-repos",run:u$t};var c$t=[W9e,g7e];async function l$t(e=c$t,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 h7e={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await l$t()}};$re();$k();A();Or();$c();hr();Cue();import{platform as d$t,release as p$t}from"node:os";function f$t(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function _7e(e){try{let t={command:f$t(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:cu(),nodeVersion:process.version,platform:d$t(),release:p$t()};(await L5e({error:e.error,context:t,logger:X,send:async r=>{let i=await Pt().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"&&X.info("error_report_sent")}catch(t){X.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}A();Or();dn();A();dn();hr();rc();import E7e from"node:fs";import m$t from"node:fs/promises";import{watch as A$t}from"node:fs/promises";import{setTimeout as g$t}from"node:timers/promises";async function fce(e){let t=await e.listSkillInstallationSync({});if(t.status!==200){let s=t.body?.message??`listSkillInstallationSync returned ${t.status}`;throw new be(s)}X.info("skill_installation_sync_listed",{remote_count:t.body.objects.length});let n=0,r=0,o=new Map;for(let s of t.body.objects){o.set(s.skill_id,s);let c=await cD(s.skill_id),l=c?.installPath??iP(s.root_kind,s.name),f=await S7e(l),h=f===null?null:Ep(f);if(f!==null&&!c){X.warn("skill_installation_conflict_detected",{skill_id:s.skill_id,installation_id:s.id,name:s.name,install_path:l,reason:"unmanaged_local_file"}),await ic(v$t(s,l)),r+=1;continue}if(c&&h!==null&&h!==c.lastInstalledHash&&h!==s.latest_content_hash&&s.latest_version!==c.lastInstalledVersion){X.warn("skill_installation_conflict_detected",{skill_id:s.skill_id,installation_id:s.id,name:s.name,install_path:l,reason:"local_and_remote_changed"}),await ic({...c,lastSyncStatus:"conflict"}),r+=1;continue}if(c&&h===s.latest_content_hash){s.installed_version!==s.latest_version&&(await _8(e,s.id,s.latest_version),X.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version})),await ic({...c,installationId:s.id,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"});continue}if(c?.lastSyncStatus==="proposed"&&h===c.lastInstalledHash)continue;if(c?.lastInstalledVersion===s.latest_version&&f!==null){s.installed_version!==s.latest_version&&(await _8(e,s.id,s.latest_version),X.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await ic({...c,installationId:s.id}));continue}X.info("skill_installation_download_started",{skill_id:s.skill_id,installation_id:s.id,name:s.name,version:s.latest_version,root_kind:s.root_kind,install_path:l});let y=await C$t(e,s.skill_id,s.latest_version);if(Ep(y)!==s.latest_content_hash)throw new be(`downloaded SKILL.md hash did not match metadata for ${s.skill_id}`);let b=await d8(s.root_kind,s.name,y);await _8(e,s.id,s.latest_version),X.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await ic({installationId:s.id,skillId:s.skill_id,name:s.name,rootKind:s.root_kind,installPath:b,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"}),X.info("skill_installation_download_applied",{skill_id:s.skill_id,installation_id:s.id,name:s.name,version:s.latest_version,root_kind:s.root_kind,install_path:b}),n+=1}let i=await T$t(e,o);return{installedUpdated:n,localEditsUploaded:i,conflicts:r}}async function y7e(e){if(e.signal?.aborted)return;let t=e.sleep??S$t;X.info("skill_sync_daemon_start",{watch:!!e.watch,poll_interval_ms:e.pollIntervalMs,watch_debounce_ms:e.watchDebounceMs});let n=Promise.resolve(),r=async(l,f)=>{n=n.then(async()=>{if(e.signal?.aborted)return;let h=Date.now();X.info("skill_sync_pass_started",{reason:l,event_type:f?.type,event_id_present:!!f?.id});try{let y=await(e.syncLocalSkills??QVe)(e.client),S=await fce(e.client),b={captured:y.pushed.length,installedUpdated:S.installedUpdated,localEditsUploaded:S.localEditsUploaded,conflicts:S.conflicts};X.info("skill_sync_pass_completed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,captured_pushed:y.pushed.length,captured_unchanged:y.unchanged.length,captured_skipped:y.skipped.length,installed_updated:S.installedUpdated,local_edits_uploaded:S.localEditsUploaded,conflicts:S.conflicts,duration_ms:Date.now()-h}),await e.onSyncPass?.({reason:l,event:f,result:b}),f?.id&&await ece(f.id)}catch(y){throw X.error("skill_sync_pass_failed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,error:Xn(y),duration_ms:Date.now()-h}),y}}),await n},o=async l=>{let f=l.id;f&&(n=n.then(async()=>{e.signal?.aborted||await ece(f)}),await n)};await r("startup");let i=(async()=>{for await(let l of e.events??E$t()){if(e.signal?.aborted)return;if(l.type==="stream.reconnected"){await r("reconnect",l);continue}if(!y$t(l)){await o(l);continue}await r(l.type==="stream.catchup_truncated"?"catchup_truncated":"event",l)}})(),s=e.watch?h$t({signal:e.signal,debounceMs:e.watchDebounceMs,sleep:t,watchRoots:e.watchRoots,watchEventSource:e.watchEventSource,runPass:()=>r("fs_event")}):Promise.resolve(),c=(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 i;return}await Promise.race([i,c,s])}async function h$t(e){let t=e.debounceMs??2e3,n=await bi(),r=n.include.cwd.length,o=(e.watchRoots??SVe(process.cwd(),n.include.cwd)).filter(y=>{try{return E7e.existsSync(y)&&E7e.statSync(y).isDirectory()}catch{return!1}});if(o.length===0)return X.info("skill_watch_no_roots",{configured_project_root_count:r}),_$t(e.signal);X.info("skill_watch_started",{watch_root_count:o.length,debounce_ms:t});let i=!1,s=!1,c,l=async()=>{if(i){s=!0;return}i=!0;try{do s=!1,e.signal?.aborted||await e.runPass();while(s&&!e.signal?.aborted)}finally{i=!1}},f=()=>{X.info("skill_watch_pass_scheduled",{debounce_ms:t}),c&&clearTimeout(c),c=setTimeout(()=>{c=void 0,l()},t),c.unref?.()},h=async y=>{for(;!e.signal?.aborted;)try{let S=e.watchEventSource?.(y,e.signal)??A$t(y,{signal:e.signal,recursive:!0});for await(let b of S){if(e.signal?.aborted)break;let v=b.filename?String(b.filename):null,x=!v||v.endsWith("SKILL.md");X.info("skill_watch_event",{root:y,filename:v,filename_is_skill_md:x}),x&&f()}}catch(S){if(e.signal?.aborted||S?.name==="AbortError")break;X.warn("skill_watch_retry",{root:y,retry_ms:3e4,error:Xn(S)}),await e.sleep(3e4,e.signal)}};try{await Promise.all(o.map(h))}finally{for(c&&clearTimeout(c);i;)await g$t(50).catch(()=>{})}}async function _$t(e){e?.aborted||await new Promise(t=>e?.addEventListener("abort",()=>t(),{once:!0}))}async function*E$t(){}function y$t(e){return e.type.startsWith("skill.version.")||e.type==="skill.published"||e.type==="stream.catchup_truncated"}function S$t(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 T$t(e,t){let n=0,r;for(let o of await wVe()){if(o.lastSyncStatus==="conflict")continue;let i=await S7e(o.installPath);if(i===null||Ep(i)===o.lastInstalledHash)continue;X.info("skill_local_edit_detected",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,base_version:o.baseVersion,last_sync_status:o.lastSyncStatus});let c=t.get(o.skillId);if(c&&c.latest_version!==o.baseVersion){X.warn("skill_installation_conflict_detected",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,reason:"remote_advanced_before_upload",base_version:o.baseVersion,remote_version:c.latest_version}),await ic({...o,lastSyncStatus:"conflict"});continue}r??=await I$t(e);let l=await b$t(e,o.skillId),f=l&&l===r?"owner_update":"subscriber_update",h;try{h=await lD(e,{skillId:o.skillId,name:o.name,description:null,bodyMd:i,filePath:o.installPath,rootKind:o.rootKind},{syncAction:f,baseVersion:o.baseVersion})}catch(y){throw X.warn("skill_local_edit_upload_failed",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,sync_action:f,base_version:o.baseVersion,error:Xn(y)}),y}X.info("skill_local_edit_uploaded",{skill_id:o.skillId,installation_id:o.installationId,name:o.name,install_path:o.installPath,sync_action:f,version:h.version,version_status:h.version_status}),h.version_status==="accepted"?(await _8(e,o.installationId,h.version),await ic({...o,baseVersion:h.version,baseContentHash:h.content_hash,lastInstalledVersion:h.version,lastInstalledHash:h.content_hash,lastSyncStatus:"current"})):h.version_status==="proposed"&&await ic({...o,lastInstalledVersion:h.version,lastInstalledHash:h.content_hash,lastSyncStatus:"proposed"}),n+=1}return n}async function _8(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 be(`wrote skill locally, but failed to record installed version: ${o}`)}}async function I$t(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}async function b$t(e,t){let n=await e.getSkillDetail({params:{id:t}});return n.status!==200?null:n.body.owner?.id??null}async function C$t(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 be(o)}return typeof r.body=="string"?r.body:String(r.body)}function v$t(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 S7e(e){try{return await m$t.readFile(e,"utf8")}catch{return null}}A();Or();dn();hr();import{setTimeout as R$t}from"node:timers/promises";var x$t=75e3,D$t=1e3,B$t=6e4,N$t=250,E8=class extends be{constructor(t){super(`skill sync event stream returned ${t}; login is required`),this.name="SkillSyncEventStreamAuthError"}};async function*I7e(e){if(!e.userId)throw new be("workspace skill sync daemon needs a user subject to subscribe to");if(e.organizationIds.length===0)throw new be("workspace skill sync daemon needs at least one workspace to subscribe to");let t=e.reconnect??!1,n=P$t(e.backoff),r=e.lastEventId,o=!1;for(;!e.signal?.aborted;)try{o&&(yield{type:"stream.reconnected"});let i=!1;for await(let s of O$t({...e,lastEventId:r}))i=!0,s.id&&(r=s.id),X.info("skill_event_stream_event_received",{event_type:s.type,event_id_present:!!s.id}),yield s;if(!t||e.signal?.aborted)return;o=!0,X.warn("skill_event_stream_disconnected",{saw_frame:i,will_reconnect:!0}),i&&n.reset(),X.info("skill_event_stream_reconnect_scheduled",{reason:"eof"}),await n.sleep(e.signal)}catch(i){if(e.signal?.aborted||i?.name==="AbortError")return;if(i instanceof E8||!t)throw i;o=!0,X.warn("skill_event_stream_disconnected",{saw_frame:!1,will_reconnect:!0,error:Xn(i)}),X.info("skill_event_stream_reconnect_scheduled",{reason:"error"}),await n.sleep(e.signal)}}async function*O$t(e){let t=e.token??await(e.getAccessToken??Qt)();if(!t)throw new be("workspace skill sync daemon requires login \u2014 run 'lore login' first");let n=new URL("/api/events/stream",e.apiBaseUrl??rA());n.searchParams.append("subject",`user:${e.userId}`);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),X.info("skill_event_stream_connecting",{organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});let o=await(e.fetch??fetch)(n,{headers:r,signal:e.signal});if(o.status===401||o.status===403)throw X.warn("skill_event_stream_auth_failed",{status:o.status}),new E8(o.status);if(!o.ok)throw new be(`skill sync event stream returned ${o.status}`);if(!o.body)throw new be("skill sync event stream returned no response body");X.info("skill_event_stream_connected",{status:o.status,organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});for await(let i of w$t(o.body,{signal:e.signal,heartbeatTimeoutMs:e.heartbeatTimeoutMs??x$t}))yield{id:i.id,type:i.event??"message"}}async function*w$t(e,t={}){let n=new TextDecoder,r=e.getReader(),o="";try{for(;;){let{done:s,value:c}=await k$t(r,t.heartbeatTimeoutMs,t.signal);if(s)break;o+=n.decode(c,{stream:!0});let l=o.split(/\r?\n\r?\n/);o=l.pop()??"";for(let f of l){let h=T7e(f);h&&(yield h)}}o+=n.decode();let i=T7e(o);i&&(yield i)}finally{r.releaseLock()}}async function k$t(e,t,n){if(t===void 0||t<=0)return e.read();let r,o;try{return await Promise.race([e.read(),new Promise((i,s)=>{r=setTimeout(()=>s(new be("skill sync event stream heartbeat stalled")),t),r.unref?.(),o=()=>s(new DOMException("Aborted","AbortError")),n?.addEventListener("abort",o,{once:!0})})])}finally{r&&clearTimeout(r),o&&n?.removeEventListener("abort",o)}}function T7e(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}
|
|
549
549
|
`)}return!t.id&&!t.event&&!t.data?null:(t.data.endsWith(`
|
|
550
550
|
`)&&(t.data=t.data.slice(0,-1)),t)}function P$t(e={}){let t=e.initialMs??D$t,n=e.maxMs??B$t,r=e.jitterMs??N$t,o=e.random??Math.random,i=e.sleep??((c,l)=>R$t(c,void 0,{signal:l}).catch(()=>{})),s=t;return{async sleep(c){let l=Math.min(n,s)+Math.floor(o()*r);s=Math.min(n,Math.max(t,s*2)),await i(l,c)},reset(){s=t}}}var y8={meta:{name:"_run_skill_sync",description:"Run the workspace skill sync daemon.",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously with filesystem watchers, SSE, and fallback polling.",default:!1},"poll-interval-ms":{type:"string",description:"Fallback full-sync poll interval in milliseconds.",default:"1800000"},"watch-debounce-ms":{type:"string",description:"Filesystem watcher debounce interval in milliseconds.",default:"2000"}},async run({args:e,data:t}){let n=t,r=n?.getAccessToken??Qt,o=await r();if(!o)throw new be("workspace skill sync daemon requires login \u2014 run 'lore login' first");let i=n?.client??Pt({token:o}),s=await i.whoAmI({headers:{}});if(s.status!==200)throw new be(`whoAmI returned ${s.status}`);let c=s.body.organizations.map(b=>b.id),l=s.body.user.id,{lastEventId:f}=await tl(),h=(n?.createEventStream??I7e)({userId:l,organizationIds:c,getAccessToken:r,reconnect:!0,...f?{lastEventId:f}:{}}),y=Number(e["poll-interval-ms"]);if(!Number.isFinite(y)||y<=0)throw new be("--poll-interval-ms must be a positive number");let S=Number(e["watch-debounce-ms"]);if(!Number.isFinite(S)||S<=0)throw new be("--watch-debounce-ms must be a positive number");await(n?.runSkillSyncDaemon??y7e)({client:i,events:h,pollIntervalMs:y,watch:!!e.watch,watchDebounceMs:S,onSyncPass:({reason:b,result:v})=>{console.log(`skill sync ${b}: ${v.installedUpdated} updated, ${v.localEditsUploaded} local edit${v.localEditsUploaded===1?"":"s"} uploaded, ${v.conflicts} conflict${v.conflicts===1?"":"s"}`)}})}};A();A();Or();dn();var b7e={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 Qt())throw new be("skill approval requires login \u2014 run 'lore login' first");await M$t(Pt(),{id:e.id,version:e.version})}};async function M$t(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new be("--version must be a positive integer timestamp");let r=await e.approveSkillVersion({params:{id:t.id,version:n},body:{}});if(r.status!==200){let o=r.body?.message??`approveSkillVersion returned ${r.status}`;throw new be(o)}console.log(`approved /${r.body.name} v${r.body.version} (${r.body.id})`)}A();import L$t from"node:fs/promises";import C7e from"node:path";Or();dn();hr();var v7e={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 be("install needs a skill ID \u2014 e.g. `lore skills install sk_01j...`");if(!await Qt())throw new be("workspace skill installs require login \u2014 run 'lore login' first");let n=Pt();await U$t(n,t)}};async function U$t(e,t){X.info("skill_install_started",{skill_id:t});try{let n=await Q$t(e,t);X.info("skill_install_registered",{skill_id:n.body.skill.id,installation_id:n.body.installation_id,already_registered:n.body.already_registered,name:n.body.skill.name,root_kind:n.body.skill.root_kind,latest_version:n.body.skill.latest_version});let r={skillId:n.body.skill.id,installationId:n.body.installation_id,name:n.body.skill.name,rootKind:n.body.skill.root_kind,latestVersion:n.body.skill.latest_version,contentHash:n.body.skill.content_hash,bodyMd:await G$t(n.body.body_md_url,n.body.skill.content_hash)};if(!oP(r.name))throw new be(`refusing to install skill with invalid name: ${JSON.stringify(r.name)}`);let o=iP(r.rootKind,r.name),i=await z$t(o),s=await cD(r.skillId),c=s?.installPath!=null&&C7e.resolve(s.installPath)===C7e.resolve(o);if(i!==null&&!c)throw X.warn("skill_install_refused_unmanaged_target",{skill_id:r.skillId,name:r.name,root_kind:r.rootKind,install_path:o}),new be(`refusing to overwrite ${o}; it already exists and is not managed by Lore`);let l=await d8(r.rootKind,r.name,r.bodyMd),f=r.latestVersion,h={installationId:r.installationId,skillId:r.skillId,name:r.name,rootKind:r.rootKind,installPath:l,baseVersion:f,baseContentHash:r.contentHash,lastInstalledVersion:f,lastInstalledHash:r.contentHash,lastSyncStatus:"current"};await ic(h);try{await F$t(e,r.installationId,f)}catch(y){throw await ic({...h,lastSyncStatus:"error"}),X.warn("skill_install_failed",{skill_id:r.skillId,installation_id:r.installationId,phase:"update_installed_version",error:Xn(y)}),y}X.info("skill_install_written",{skill_id:r.skillId,installation_id:r.installationId,name:r.name,root_kind:r.rootKind,install_path:l,latest_version:f,already_up_to_date:i===r.bodyMd}),i===r.bodyMd?console.log(`/${r.name} is already up to date at ${l}`):console.log(`installed /${r.name} (${r.skillId}) -> ${l}`)}catch(n){throw X.warn("skill_install_failed",{skill_id:t,phase:"install",error:Xn(n)}),n}}async function Q$t(e,t){let n=await e.installSkill({params:{id:t},body:{}});if(n.status!==200){let r=n.body?.message??`installSkill returned ${n.status}`;throw new be(r)}return n}async function F$t(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 be(`installed ${t} locally, but failed to record installed version: ${o}`)}}async function G$t(e,t){let n=new URL(e,rA()),r=await Qt(),o=await fetch(n,{headers:{...r?{authorization:`Bearer ${r}`}:{}}});if(!o.ok)throw new be(`failed to download SKILL.md from ${e}: HTTP ${o.status}`);let i=await o.text();if(Ep(i)!==t)throw new be("downloaded SKILL.md hash did not match the skill metadata");return i}async function z$t(e){try{return await L$t.readFile(e,"utf8")}catch{return null}}A();Or();dn();var j$t=[{visibility:"workspace",heading:"workspace skills"},{visibility:"private",heading:"private captured skills"}];function H$t(e){if(e===null)return"updated unknown";let t=new Date(e),n=t.getUTCFullYear(),r=`${t.getUTCMonth()+1}`.padStart(2,"0"),o=`${t.getUTCDate()}`.padStart(2,"0"),i=`${t.getUTCHours()}`.padStart(2,"0"),s=`${t.getUTCMinutes()}`.padStart(2,"0");return`updated ${n}-${r}-${o} ${i}:${s}`}function $$t(e){if(e.length===0)return"no skills in this workspace yet";let t=[];for(let n of j$t){let r=e.filter(o=>o.visibility===n.visibility);r.length!==0&&t.push([n.heading,...r.map(o=>`${o.id} /${o.name} ${o.root_kind} ${H$t(o.latest_version)}`)].join(`
|
|
551
551
|
`))}return t.join(`
|
|
552
552
|
|
|
553
553
|
`)}var R7e={meta:{name:"list",description:"List skills available in your workspace."},async run({data:e}){let t=e;if(!await(t?.getAccessToken??Qt)())throw new be("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Pt()).listSkills({});if(o.status!==200){let i=o.body?.message??`listSkills returned ${o.status}`;throw new be(i)}console.log($$t(o.body.objects))}};A();Or();dn();var x7e={meta:{name:"proposals",description:"List proposed versions awaiting owner review for a skill."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."}},async run({args:e}){if(!await Qt())throw new be("skill proposals require login \u2014 run 'lore login' first");await q$t(Pt(),e.id)}};async function q$t(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status!==200){let o=n.body?.message??`getSkillDetail returned ${n.status}`;throw new be(o)}let r=n.body.versions.filter(o=>o.status==="proposed");if(r.length===0){console.log(`no proposed versions for ${t}`);return}for(let o of r){let i=o.created_by?`${o.created_by.display_name} (${o.created_by.id})`:"unknown";console.log(`${n.body.id} /${n.body.name} version=${o.version} proposer=${i} created_at=${o.created_at}`)}}A();import{readFile as V$t}from"node:fs/promises";Or();dn();hr();var D7e={meta:{name:"publish",description:"Publish a local or captured skill to your workspace, or upload local edits for an already-published skill."},args:{target:{type:"positional",required:!0,description:"Local skill name/path, private captured sk_* ID, or workspace published sk_* ID"}},async run({args:e}){if(!await Qt())throw new be("not logged in \u2014 run 'lore login' first");let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new be("pass a skill name, path, or sk_* ID to publish");let n=await Y$t(Pt(),t);t9t(n)}};async function Y$t(e,t){let n=t.trim();if(!n)throw new be("pass a skill name, path, or sk_* ID to publish");let r=n.startsWith("sk_")?"skill_id":"local_name_or_path";X.info("skill_publish_started",{target_kind:r,target:n});try{if(n.startsWith("sk_"))return await B7e(e,n);let o=await TVe(n)??await IVe(n);if(!o)throw new be(`no SKILL.md found for ${n}`);return await K$t(e,o)}catch(o){throw X.warn("skill_publish_failed",{target_kind:r,target:n,phase:"publish",error:Xn(o)}),o}}async function K$t(e,t){let n=Ep(t.bodyMd),r=await UVe(t);X.info("skill_publish_local_resolved",{name:t.name,file_path:t.filePath,root_kind:t.rootKind,captured_skill_id:r,captured_skill_id_present:!!r});let o=r;if(!o||await J$t(o)!==n){let s=await lD(e,{...t,...o?{skillId:o}:{}},{syncAction:"capture"});o=s.skill_id,X.info("skill_publish_capture_uploaded",{name:t.name,file_path:t.filePath,skill_id:s.skill_id,version:s.version,root_kind:s.root_kind})}let i=await B7e(e,o);return i.kind!=="conflict"&&i.kind!=="remote_newer"&&await rce(t,{skillId:o,version:i.version}),i}async function J$t(e){return(await tl()).captured[e]?.lastPushedHash??null}async function B7e(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status===200&&n.body.visibility==="workspace")return Z$t(e,t,n.body);let r=await e.publishSkill({params:{id:t},body:{}});if(r.status!==200)throw e9t("publish skill",r.status,r.body);return X.info("skill_publish_promoted",{skill_id:r.body.id,version:r.body.latest_version??0,name:r.body.name}),{kind:"promoted",skillId:r.body.id,version:r.body.latest_version??0}}async function Z$t(e,t,n){let r=await tl(),o=r.installed[t]??null,i=r.captured[t]??null,s=r.published[t]??null,c=o?.installPath??i?.filePath,l=o?.rootKind??i?.rootKind??n.root_kind,f=o?.name??i?.name??n.name;if(!c)throw new be(`no managed local SKILL.md found for ${t}; install or capture it first`);let h=await V$t(c,"utf8"),y=Ep(h),S=n.latest_version??0,b=n.content_hash??"",v=W$t(o,s,i);if(y===b)return X.info("skill_publish_noop",{skill_id:t,version:S,reason:"local_matches_remote"}),{kind:"unchanged",skillId:t,version:S};if(v.version>0&&S>v.version)return y===v.hash?(X.info("skill_publish_noop",{skill_id:t,version:S,reason:"remote_newer_local_unchanged",local_version:v.version}),{kind:"remote_newer",skillId:t,localVersion:v.version,remoteVersion:S}):(o&&await ic({...o,lastSyncStatus:"conflict"}),X.warn("skill_publish_conflict",{skill_id:t,local_version:v.version,remote_version:S,name:f,file_path:c}),{kind:"conflict",skillId:t,localVersion:v.version,remoteVersion:S});if(y===v.hash)return X.info("skill_publish_noop",{skill_id:t,version:S,reason:"local_matches_base"}),{kind:"unchanged",skillId:t,version:S};let x=await X$t(e),D=n.owner?.id&&n.owner.id===x?"owner_update":"subscriber_update",k=await lD(e,{skillId:t,name:f,description:null,bodyMd:h,filePath:c,rootKind:l},{syncAction:D,...v.version>0?{baseVersion:v.version}:{}});return o&&await ic({...o,...k.version_status==="accepted"?{baseVersion:k.version,baseContentHash:k.content_hash,lastSyncStatus:"current"}:{lastSyncStatus:"proposed"},lastInstalledVersion:k.version,lastInstalledHash:k.content_hash}),await rce({name:f,bodyMd:h,filePath:c,rootKind:l},{skillId:k.skill_id,version:k.version}),X.info("skill_publish_update_uploaded",{skill_id:k.skill_id,name:f,file_path:c,sync_action:D,version:k.version,version_status:k.version_status}),{kind:"uploaded",skillId:k.skill_id,version:k.version,versionStatus:k.version_status==="proposed"?"proposed":"accepted"}}function W$t(e,t,n){return e?{hash:e.baseContentHash,version:e.baseVersion}:t?{hash:t.lastPublishedHash,version:t.lastPublishedVersion}:n?{hash:n.lastPushedHash,version:n.lastPushedVersion}:{hash:"",version:0}}async function X$t(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}function e9t(e,t,n){let r=n?.message??`${e} returned ${t}`;return new be(r)}function t9t(e){switch(e.kind){case"promoted":console.log(`published ${e.skillId} (v${e.version})`);break;case"uploaded":console.log(`${e.versionStatus} ${e.skillId} (v${e.version})`);break;case"unchanged":console.log(`already up to date ${e.skillId} (v${e.version})`);break;case"remote_newer":console.log(`remote newer ${e.skillId}: local base is v${e.localVersion}, remote is v${e.remoteVersion}; run lore skills sync`);break;case"conflict":console.log(`conflict ${e.skillId}: remote advanced from v${e.localVersion} to v${e.remoteVersion}; run lore skills sync`);break}}A();Or();dn();var N7e={meta:{name:"reject",description:"Reject a proposed skill version without changing 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 reject"},reason:{type:"string",required:!1,description:"Optional rejection reason shown with the reviewed version"}},async run({args:e}){if(!await Qt())throw new be("skill rejection requires login \u2014 run 'lore login' first");await n9t(Pt(),{id:e.id,version:e.version,reason:e.reason})}};async function n9t(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new be("--version must be a positive integer timestamp");let r=t.reason?.trim(),o=await e.rejectSkillVersion({params:{id:t.id,version:n},body:r?{reason:r}:{}});if(o.status!==200){let i=o.body?.message??`rejectSkillVersion returned ${o.status}`;throw new be(i)}console.log(`rejected /${o.body.name} v${o.body.version} (${o.body.id})`)}A();Or();dn();var O7e={meta:{name:"status",description:"Show local Lore-managed skill sync state."},async run(){if(!await Qt())throw new be("skill status requires login \u2014 run 'lore login' first");await r9t()}};async function r9t(){let e=await tl(),t=[];for(let n of Object.values(e.installed).sort((r,o)=>r.skillId.localeCompare(o.skillId)))t.push(["installed",n.skillId,`/${n.name}`,`status=${n.lastSyncStatus}`,`base=${n.baseVersion}`,`installed=${n.lastInstalledVersion}`,`root=${n.rootKind}`,`path=${n.installPath}`].join(" "));for(let n of Object.values(e.captured).sort((r,o)=>r.skillId.localeCompare(o.skillId))){let r=e.published[n.skillId];t.push(["captured",n.skillId,`/${n.name}`,`status=${r?"published":"private"}`,`version=${n.lastPushedVersion}`,`root=${n.rootKind}`,`path=${n.filePath}`].join(" "))}for(let[n,r]of Object.entries(e.published).sort(([o],[i])=>o.localeCompare(i)))e.captured[n]||t.push(["published",n,`version=${r.lastPublishedVersion}`,`hash=${r.lastPublishedHash}`].join(" "));if(t.length===0){console.log("no local skills tracked by Lore");return}console.log(t.join(`
|
|
554
554
|
`))}A();Or();dn();var w7e={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await Qt())throw new be("workspace skill sync requires login \u2014 run 'lore login' first");let e=await fce(Pt());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};A();import k7e from"node:fs/promises";import o9t from"node:path";Or();dn();var P7e={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 be("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await Qt())throw new be("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Pt();await i9t(n,t)}};async function i9t(e,t){let n=await cD(t);n&&(await k7e.rm(n.installPath,{force:!0}),await k7e.rmdir(o9t.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 be(o)}if(await OVe(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}var M7e={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:D7e,install:v7e,uninstall:P7e,sync:w7e,daemon:y8,approve:b7e,reject:N7e,proposals:x7e,status:O7e,list:R7e}};A();A();Or();dn();var L7e={meta:{name:"channels",description:"List Slack channels the bot can see for your workspace."},async run(){if(!await Qt())throw new be("not logged in \u2014 run 'lore login' first");let t=await Pt().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 be("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let n=t.body?.message??`unexpected status ${t.status}`;throw new be(n)}};A();Or();dn();var U7e={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 Qt())throw new be("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 be("channel name is required \u2014 e.g. `lore slack post general --thread-id th_...`");if(!n)throw new be("--thread-id is required \u2014 e.g. `lore slack post general --thread-id th_...`");let o=await Pt().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 be("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let i=o.body?.message??`unexpected status ${o.status}`;throw new be(i)}};var Q7e={meta:{name:"slack",description:"Slack integration commands."},subCommands:{channels:L7e,post:U7e}};QE();A();await po();var x8=se(an(),1);$c();await zT();A();await po();var C8=se(an(),1);await AA();A();await po();var dD=se(an(),1);Ds();var nd=se(Ft(),1);function pD({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[s,c]=(0,dD.useState)(F7e(e,n)),l=(0,dD.useRef)(s);return(0,dD.useEffect)(()=>{let f=F7e(e,n);l.current=f,c(f)},[e,n]),_u((f,h)=>{if(e.length!==0){if(h.upArrow||f==="k"){let y=s9t(e,l.current);l.current=y,c(y);return}if(h.downArrow||f==="j"){let y=G7e(e,l.current);l.current=y,c(y);return}if(h.return||f===" "){let y=e[l.current];y&&!y.disabled&&t(y)}}},{isActive:!r}),e.length===0?(0,nd.jsx)(Ae,{color:Re.muted,children:"no actions available"}):(0,nd.jsxs)(he,{flexDirection:"column",children:[e.map((f,h)=>{let y=h===s,S=f.disabled?Re.muted:y?Re.primary:Re.highlight;return(0,nd.jsxs)(he,{children:[(0,nd.jsx)(he,{width:2,flexShrink:0,children:(0,nd.jsx)(Ae,{color:y?Re.primary:Re.muted,children:y?"\u203A":" "})}),(0,nd.jsx)(he,{width:i,flexShrink:0,children:(0,nd.jsx)(Ae,{color:S,bold:y&&!f.disabled,children:f.label})}),f.description?(0,nd.jsx)(he,{flexGrow:1,flexShrink:1,children:(0,nd.jsx)(Ae,{color:Re.muted,children:f.description})}):null]},f.id)}),o?(0,nd.jsx)(he,{marginTop:1,children:(0,nd.jsx)(Ae,{color:Re.muted,children:o})}):null]})}function F7e(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?G7e(e,n-1):n}function G7e(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 s9t(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 gA();await $T();await qT();Ds();A();Or();LT();nP();rc();async function S8(e){if(!await(e.hasAccessToken??(async()=>!!await Qt()))())return{state:"logged_out"};let n=e.client??Pt();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:z7e(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 T8(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??a8;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function I8(e){if(!await(e.hasAccessToken??(async()=>!!await Qt()))())return{state:"logged_out"};let n=e.client??Pt();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:z7e(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(s=>s.visibility==="workspace").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function b8(){try{await Of();let e=await bi();return a9t(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function a9t(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function z7e(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=se(Ft(),1);function u0({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=Rs(),[i,s]=(0,C8.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,C8.useEffect)(()=>{if(t)return;let l=!1;return(async()=>{let[f,h,y,S]=await Promise.all([S8(n),T8(n),I8(n),b8()]);l||s({identity:f,daemon:h,skills:y,uploadDirs:S})})(),()=>{l=!0}},[]),_u((l,f)=>{(l==="q"||f.ctrl&&l==="c"||f.escape)&&(r("quit"),o())});let c=f9t(i);return(0,Bt.jsxs)(he,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,Bt.jsx)(Bs,{title:"lore",subtitle:c9t(i.identity),right:`v${e}`}),(0,Bt.jsxs)(he,{flexDirection:"row",gap:2,children:[(0,Bt.jsx)(he,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Ln,{title:"Daemon",children:(0,Bt.jsx)(l9t,{daemon:i.daemon})})}),(0,Bt.jsx)(he,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Ln,{title:"Workspace",children:(0,Bt.jsx)(d9t,{identity:i.identity,skills:i.skills})})})]}),(0,Bt.jsx)(he,{marginTop:1,children:(0,Bt.jsx)(Ln,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,Bt.jsx)(u9t,{uploadDirs:i.uploadDirs})})}),(0,Bt.jsx)(he,{marginTop:1,children:(0,Bt.jsx)(Ln,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Bt.jsx)(pD,{items:c,onSelect:l=>{r(l.id),o()}})})})]})}function u9t({uploadDirs:e}){return e.state==="loading"?(0,Bt.jsx)(Ma,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(rn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:Re.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(rn,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,Bt.jsx)(he,{marginTop:1,children:(0,Bt.jsxs)(Ae,{color:Re.muted,children:["Run ",(0,Bt.jsx)(Ae,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,Bt.jsxs)(he,{flexDirection:"column",children:[e.cwd.map(t=>(0,Bt.jsx)(rn,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,Bt.jsx)(rn,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function c9t(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 l9t({daemon:e}){if(e.state==="loading")return(0,Bt.jsx)(Ma,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(Ae,{color:Re.muted,children:"Background uploads are macOS-only today."}),(0,Bt.jsxs)(Ae,{color:Re.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(rn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:Re.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(rn,{label:"Status",value:t.health,kind:n}),(0,Bt.jsx)(rn,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,Bt.jsx)(rn,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,Bt.jsx)(rn,{label:"Heartbeat",value:j7e(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,Bt.jsx)(rn,{label:"Last upload",value:j7e(t.status?.last_success_at)}),t.status?.last_error?(0,Bt.jsx)(rn,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function d9t({identity:e,skills:t}){return e.state==="loading"?(0,Bt.jsx)(Ma,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(rn,{label:"Status",value:"signed out",kind:"warning"}),(0,Bt.jsx)(Ae,{color:Re.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(rn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:Re.danger,children:e.message})]}):(0,Bt.jsxs)(he,{flexDirection:"column",children:[(0,Bt.jsx)(rn,{label:"User",value:e.email,kind:"success"}),(0,Bt.jsx)(rn,{label:"Display name",value:e.displayName}),(0,Bt.jsx)(rn,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,Bt.jsx)(rn,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,Bt.jsx)(rn,{label:"Skills",value:p9t(t)})]})}function p9t(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 f9t(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 j7e(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`}A();await po();await AA();await gA();Ds();var ni=se(Ft(),1),m9t=[{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 v8({cliVersion:e,onSelect:t}){let{exit:n}=Rs();return _u((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,ni.jsxs)(he,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,ni.jsx)(Bs,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,ni.jsx)(Ln,{title:"What is Lore?",children:(0,ni.jsxs)(he,{flexDirection:"column",children:[(0,ni.jsx)(Ae,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,ni.jsxs)(he,{marginTop:1,flexDirection:"column",children:[(0,ni.jsx)(Ae,{color:Re.muted,children:"You'll get:"}),(0,ni.jsxs)(Ae,{children:[(0,ni.jsx)(Ae,{color:Re.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,ni.jsxs)(Ae,{children:[(0,ni.jsx)(Ae,{color:Re.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,ni.jsxs)(Ae,{children:[(0,ni.jsx)(Ae,{color:Re.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,ni.jsxs)(Ae,{children:[(0,ni.jsx)(Ae,{color:Re.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,ni.jsx)(he,{marginTop:1,children:(0,ni.jsx)(Ln,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,ni.jsx)(pD,{items:m9t,onSelect:r=>{t(r.id),n()}})})}),(0,ni.jsx)(he,{marginTop:1,children:(0,ni.jsxs)(Ae,{color:Re.muted,children:["New to Lore? Run ",(0,ni.jsx)(Ae,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var R8=se(Ft(),1),A9t={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 g9t({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,x8.useState)(void 0),{exit:i}=Rs();return(0,x8.useEffect)(()=>{let s=!1;return(async()=>{let[c,l,f,h]=await Promise.all([S8(t),T8(t),I8(t),b8()]);s||o({identity:c,daemon:l,skills:f,uploadDirs:h})})(),()=>{s=!0}},[]),r?r.identity.state==="logged_out"?(0,R8.jsx)(v8,{cliVersion:e,onSelect:s=>{n(s),i()}}):(0,R8.jsx)(u0,{cliVersion:e,initialData:r,onSelect:n}):null}async function H7e(){let e="quit";return await el((0,R8.jsx)(g9t,{cliVersion:cu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:A9t[e]}}A();await zT();A();await po();var gP=se(an(),1);await AA();await gA();Ds();A();await po();await uue();await AA();await HT();await gA();await due();A();await po();Ds();var fD=se(Ft(),1),h9t="\u2588",_9t="\u2591";function $7e({value:e,width:t=24,label:n,color:r=Re.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),s=Math.max(0,t-i);return(0,fD.jsxs)(he,{children:[(0,fD.jsx)(Ae,{color:r,children:h9t.repeat(i)}),(0,fD.jsx)(Ae,{color:Re.muted,children:_9t.repeat(s)}),n?(0,fD.jsxs)(Ae,{color:Re.muted,children:[" ",n]}):null]})}await $T();await qT();await cue();await hue();await yue();A();await po();await AA();await HT();await gA();await $T();Ds();var fo=se(Ft(),1),V7e=[{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 dP(){return{steps:V7e.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function D8(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?`${q7e(n.key)} (${t.label})`:q7e(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function q7e(e){return V7e.find(t=>t.key===e)?.label??e}function dh({title:e,subtitle:t,state:n}){return(0,fo.jsxs)(he,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,fo.jsx)(Bs,{title:e,subtitle:t}),(0,fo.jsx)(Ln,{title:"Pipeline",children:(0,fo.jsx)(he,{flexDirection:"column",children:n.steps.map(r=>(0,fo.jsx)(E9t,{step:r},r.key))})}),n.result?(0,fo.jsx)(he,{marginTop:1,flexDirection:"column",children:(0,fo.jsx)(Ns,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,fo.jsxs)(he,{flexDirection:"column",children:[(0,fo.jsx)(Ae,{children:n.result.url}),(0,fo.jsx)(he,{marginTop:1,children:(0,fo.jsxs)(Ae,{color:Re.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,fo.jsx)(he,{marginTop:1,children:(0,fo.jsx)(Ns,{kind:"error",title:"Failed",children:(0,fo.jsx)(Ae,{children:n.errorMessage})})}):null]})}function E9t({step:e}){return e.status==="active"?(0,fo.jsxs)(he,{children:[(0,fo.jsx)(Ma,{}),(0,fo.jsx)(Ae,{children:" "}),(0,fo.jsx)(Ae,{color:Re.primary,children:e.label})]}):e.status==="done"?(0,fo.jsxs)(he,{children:[(0,fo.jsx)(Ae,{color:Re.success,children:"\u2713 "}),(0,fo.jsx)(Ae,{color:Re.muted,children:e.label})]}):(0,fo.jsxs)(he,{children:[(0,fo.jsx)(Ae,{color:Re.muted,children:"\u25CB "}),(0,fo.jsx)(Ae,{color:Re.muted,children:e.label})]})}Ds();A();var pP=Date.parse("2026-05-16T12:00:00.000Z");function fP(e){return new Date(pP-e*6e4).toISOString()}var Lf={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"},Y7e=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:pP-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:pP-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:pP-180*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:pP-1560*6e4}],y9t=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],mD={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:Lf.plist,binary_path:Lf.binary,status_path:Lf.status,install_source_path:Lf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:fP(60),last_heartbeat_at:fP(1),last_success_at:fP(5),last_completed_at:fP(5),last_thread_ids:["thr_01hx_story"]}},K7e={...mD,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...mD.status,state:"error",last_heartbeat_at:fP(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},S9t={...mD,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},T9t={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"},mP={identity:T9t,daemon:{state:"ready",report:mD},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:y9t,repo:[]}},J7e={...mP,uploadDirs:{state:"ready",cwd:[],repo:[]}},Z7e={...mP,daemon:{state:"error",message:"launchctl print failed: service not found"}},W7e={...mP,daemon:{state:"unsupported",platform:"linux"}},X7e={identity:{state:"logged_out"},daemon:{state:"ready",report:S9t},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},eYe=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var ht=se(Ft(),1),eo=()=>{};function c0(...e){return e.reduce(jH,Hk())}function AP(...e){return e.reduce(D8,dP())}var IA=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,ht.jsx)(v8,{cliVersion:"0.1.0",onSelect:eo})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,ht.jsx)(hp,{state:Hk()})},{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)(hp,{state:c0({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)(hp,{state:c0({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)(hp,{state:c0({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)(hp,{state:c0({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:Lf.plist,binaryPath:Lf.binary,logFile:Lf.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)(hp,{state:c0({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)(hp,{state:c0({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)(hp,{state:c0({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)(hp,{state:c0({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)(EA,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:eo,onSkip:eo})},{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)(EA,{state:{phase:"choose",suggestions:Y7e,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:eo,onSkip:eo})},{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)(EA,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:eo,onSkip:eo})},{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)(EA,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:eo,onSkip:eo})},{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)(EA,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:eo,onSkip:eo})},{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)(EA,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:eo,onSkip:eo})},{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)(EA,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:eo,onSkip:eo})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,ht.jsx)(u0,{cliVersion:"0.1.0",initialData:mP,onSelect:eo})},{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)(u0,{cliVersion:"0.1.0",initialData:J7e,onSelect:eo})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,ht.jsx)(u0,{cliVersion:"0.1.0",initialData:Z7e,onSelect:eo})},{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)(u0,{cliVersion:"0.1.0",initialData:W7e,onSelect:eo})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,ht.jsx)(u0,{cliVersion:"0.1.0",initialData:X7e,onSelect:eo})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,ht.jsx)(dh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:dP()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,ht.jsx)(dh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:AP({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)(dh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:AP({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)(dh,{title:"lore share-codex",state:AP({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.link/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)(dh,{title:"lore share-cowork",state:AP({kind:"completed",url:"https://lore.link/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)(dh,{title:"lore export",state:AP({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)(a0,{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)(a0,{mode:"enable",state:{phase:"finished",result:{plistPath:Lf.plist,binaryPath:Lf.binary,logFile:Lf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,ht.jsx)(a0,{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)(a0,{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)(a0,{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)(sP,{report:mD})},{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)(sP,{report:K7e})},{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)(Bs,{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)(Ln,{title:"Panel",subtitle:"focused",focused:!0,children:(0,ht.jsx)(Ae,{color:Re.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)(Ln,{title:"StatusLine",children:[(0,ht.jsx)(rn,{label:"Healthy",value:"yes",kind:"success"}),(0,ht.jsx)(rn,{label:"Warning",value:"needs attention",kind:"warning"}),(0,ht.jsx)(rn,{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)(Ln,{title:"ProgressBar",children:(0,ht.jsx)($7e,{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)(he,{flexDirection:"column",children:[(0,ht.jsx)(Ns,{kind:"success",title:"Shared",children:(0,ht.jsx)(Ae,{children:"Copied the Lore URL to your clipboard."})}),(0,ht.jsx)(he,{marginTop:1,children:(0,ht.jsx)(Ns,{kind:"error",title:"Failed",children:(0,ht.jsx)(Ae,{color:Re.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)(Ln,{title:"Spinner",children:(0,ht.jsx)(Ma,{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)(Ln,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,ht.jsx)(pD,{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:eo})})},{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)(Ln,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,ht.jsx)(zk,{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:eo,onAction:eo})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,ht.jsx)(Ln,{title:"TextInput",children:(0,ht.jsx)(UH,{initialValue:"~/code",onSubmit:eo,onCancel:eo})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,ht.jsx)(Ln,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,ht.jsx)(QH,{initialValue:"/Users/alex/code",loadSuggestions:async()=>eYe,onSubmit:eo,onCancel:eo})})}];function tYe(e){return IA.find(t=>t.id===e)}function AD(e){return e.path.slice(1).join(" / ")}var Lr=se(Ft(),1);function rYe({initialStoryId:e}){let t=Math.max(0,IA.findIndex(f=>f.id===e)),[n,r]=(0,gP.useState)(t),[o,i]=(0,gP.useState)("sidebar"),s=(0,gP.useRef)(o);s.current=o;let{exit:c}=Rs();_u((f,h)=>{if(h.ctrl&&f==="c"){c();return}if(s.current==="sidebar"&&f==="q"){c();return}if(h.escape){if(s.current==="preview"){s.current="sidebar",i("sidebar");return}c();return}if(s.current==="preview"&&h.tab&&h.shift){s.current="sidebar",i("sidebar");return}if(s.current==="sidebar"&&h.tab&&!h.shift){s.current="preview",i("preview");return}if(s.current==="sidebar"){if(h.upArrow||f==="k"){r(y=>nYe(y-1));return}(h.downArrow||f==="j")&&r(y=>nYe(y+1))}});let l=IA[n]??IA[0];return(0,Lr.jsxs)(he,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Lr.jsx)(Bs,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${IA.length}`}),(0,Lr.jsx)(he,{marginBottom:1,children:(0,Lr.jsx)(Ae,{color:Re.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,Lr.jsxs)(he,{flexDirection:"row",gap:2,children:[(0,Lr.jsx)(he,{width:36,flexShrink:0,children:(0,Lr.jsx)(Ln,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,Lr.jsx)(I9t,{stories:IA,selectedIndex:n,focused:o==="sidebar"})})}),(0,Lr.jsx)(he,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,Lr.jsx)(Ln,{title:l.title,focused:o==="preview",subtitle:o==="preview"?`${AD(l)} \xB7 focused`:AD(l),children:(0,Lr.jsxs)(he,{flexDirection:"column",children:[(0,Lr.jsx)(Ae,{color:Re.muted,children:l.description}),o==="sidebar"?(0,Lr.jsxs)(Ae,{color:Re.muted,children:["Press ",(0,Lr.jsx)(Ae,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,Lr.jsx)(he,{marginTop:1,children:l.render()})]})})})]})]})}function I9t({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,s)=>{let c=i.path.slice(1),l=x9t(o,c);for(let f=l;f<c.length;f++)r.push((0,Lr.jsx)(b9t,{label:c[f]??"",level:f,marginTop:R9t(c[f]??"",f,l),focused:n},`group:${c.slice(0,f+1).join("/")}`));r.push((0,Lr.jsx)(C9t,{story:i,selected:s===t,focused:n},i.id)),o=c}),(0,Lr.jsx)(he,{flexDirection:"column",children:r})}function b9t({label:e,level:t,marginTop:n,focused:r}){return(0,Lr.jsx)(he,{marginLeft:oYe(t),marginTop:n,children:(0,Lr.jsx)(Ae,{color:r?Re.primary:Re.muted,bold:r,wrap:"truncate-end",children:e})})}function C9t({story:e,selected:t,focused:n}){let r=n?t?Re.accent:Re.highlight:Re.muted;return(0,Lr.jsxs)(he,{marginLeft:oYe(e.path.slice(1).length),children:[(0,Lr.jsx)(Ae,{color:n&&t?Re.accent:Re.muted,children:t?"\u203A ":" "}),(0,Lr.jsx)(Ae,{color:r,bold:n&&t,wrap:"truncate-end",children:v9t(e)})]})}function v9t(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function oYe(e){return Math.min(e,4)}function R9t(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function x9t(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 nYe(e){let t=IA.length;return(e%t+t)%t}function iYe({story:e}){let{exit:t}=Rs();return _u((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,Lr.jsxs)(he,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Lr.jsx)(Bs,{title:e.title,subtitle:AD(e),right:"Esc to exit"}),(0,Lr.jsx)(he,{marginBottom:1,children:(0,Lr.jsx)(Ae,{color:Re.muted,children:e.description})}),e.render()]})}var mce=se(Ft(),1),sYe={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){D9t();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=tYe(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 el((0,mce.jsx)(iYe,{story:n})).waitUntilExit();return}await el((0,mce.jsx)(rYe,{})).waitUntilExit()}};function D9t(){for(let e of IA)console.log(`${e.id} ${AD(e)} ${e.title}`)}A();hr();QE();A();await po();var B8=se(an(),1);await zT();var Ace=se(Ft(),1);function B9t({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,s]=(0,B8.useState)(dP),{exit:c}=Rs();return(0,B8.useEffect)(()=>{let l=!1,f=h=>{l||s(y=>D8(y,h))};return(async()=>{try{let h=await n(f);if(l)return;r(h),setTimeout(()=>c(),100)}catch(h){if(f({kind:"error",message:h instanceof Error?h.message:String(h)}),l)return;o(h),setTimeout(()=>c(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{l=!0}},[]),(0,Ace.jsx)(dh,{title:e,subtitle:t,state:i})}async function gD(e){let t,n,r=!1;if(await el((0,Ace.jsx)(B9t,{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}A();ER();Or();import M9t from"node:os";import cYe from"node:path";A();import{spawn as N9t}from"node:child_process";import O9t from"node:os";async function aYe(e,t={}){let n=t.timeoutMs??2e3,r=w9t();for(let o of r)if(await k9t(o,e,n))return!0;return!1}function w9t(){switch(O9t.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 k9t(e,t,n){return new Promise(r=>{let o;try{o=N9t(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,s=l=>{i||(i=!0,r(l))},c=setTimeout(()=>{o.kill("SIGKILL"),s(!1)},n);o.on("error",()=>{clearTimeout(c),s(!1)}),o.on("close",l=>{clearTimeout(c),s(l===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}dn();hr();Jk();$k();wf();PH();XE();A();var hD=()=>{};A();hr();i0();async function P9t(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw _p(`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 N8(e,t,n){try{return await P9t(e,t,n)}catch(r){return X.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}A();dn();i0();function uYe(e){if(e instanceof dx)return"billing_required";if(e instanceof Zk)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof be)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"}i0();sD();var L9t=new Set(["private","workspace","public"]);function U9t(e){let t=(e??"").trim();if(!t)return"";if(!L9t.has(t))throw new be(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function gce(e={}){let t=e.progress??hD,n=U9t(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",s=null;try{t({kind:"step",step:"resolving_session"});let c=await f5e({sessionId:o,project:r});i="auth",await j9t();let l=e.client??Pt();i="collecting_local_file",s=await Q9t(c),t({kind:"step",step:"uploading",label:s.filename}),i="uploading";let f=await F9t(l,s);if(f.quarantined)return t({kind:"step",step:"done"}),{quarantined:!0,reason:f.reason,finding_count:f.findingCount,session_id:c.sessionId?.trim()??""};let{reused:h,thread:y}=f;X.info("export_upload_single_file_result",{filename:s.filename,reused:h,response:JSON.stringify(y)});let S=y?.id?.trim();if(!S)throw Jn().setContext("upload_single_file_response",{filename:s.filename,reused:h,response:y}),new Error(`upload session response missing thread id for ${s.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await oD(l,S);let b=y?.visibility?.trim()??"",v=b;n&&n!==b&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),v=await G9t(l,S,n));let x=z9t(S),D,k=e.highlight?.trim();if(k){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let z=await N8(l,S,k);z&&(x=z.url,D={query:k,matched:z.matched,start_block_id:z.start_block_id,end_block_id:z.end_block_id})}let Q=await aYe(x);return t({kind:"completed",url:x,reused:h,visibility:v,clipboardCopied:Q,sessionId:c.sessionId?.trim()??""}),t({kind:"step",step:"done"}),uh("lore.cli.thread_exported",{thread_id:S,harness:s.harness,visibility:v,reused:h}),{thread_id:S,url:x,session_id:c.sessionId?.trim()??"",project:c.project,reused:h,visibility:v,clipboard_copied:Q,...D?{highlight:D}:{}}}catch(c){throw uh("lore.cli.upload_failed",{error_category:uYe(c),error_message:Xn(c),step:i}),c}finally{s&&await Ap(s.tempPath)}}async function Q9t(e){let t=await m5e(e),n=await Fi(t.fullPath);if(!n.exists)throw new be(`session transcript not found at ${H9t(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await mp(e.project),o=await td(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 F9t(e,t){let[n]=await SA(e,[t]);if(!n)throw new Error("upload session response missing thread file");if(n.status==="quarantined")return{quarantined:!0,reason:n.reason,findingCount:n.findingCount};if(n.status==="no_upload"){let r=n.error?.trim()?`: ${n.error.trim()}`:"";throw new be(`upload session for ${t.filename} returned no upload URL and no reusable thread${r}`)}return{quarantined:!1,reused:n.status==="deduped",thread:n.thread}}async function G9t(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw _p(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function z9t(e){return`${o0().replace(/\/+$/,"")}/thread/${e}`}async function j9t(){let e=await Qt();if(!e)throw new be("not logged in \u2014 run 'lore login' first");return e}function H9t(e){let t=M9t.homedir();if(!t)return e;let n=cYe.relative(t,e);return!n||n.startsWith("..")?e:cYe.join("~",n)}var lYe={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}){X.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(gu()&&!t?.progress){let o=await gD({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:i=>gce({...n,progress:i})});"quarantined"in o&&o.quarantined&&console.log(`
|
|
555
|
-
Held locally \u2014 not uploaded. ${o.finding_count} finding(s); reason: ${o.reason}. See \`lore quarantine\`.`);return}let r=await gce({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};A();A();lT();Or();$c();dn();hr();LT();rc();var $9t=5,q9t=1e3;async function pYe(e={}){(e.environment??Zr())!=="dev"||!await V9t({fetchFn:e.fetchFn})||await Y9t({client:e.client})}async function V9t(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return X.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??$9t,o=e.retryDelayMs??q9t,i=`${rA()}/api/cli-auth/dev-token`;for(let s=1;s<=r;s+=1)try{let c=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(c.status===404){let f=await dYe(c);return Kg(),X.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:f,url:i}),!1}if(!c.ok){let f=await dYe(c);return Kg(),X.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:f}),!1}let l=await c.json();return l.access_token?(bz(l.access_token),X.info("dev_preflight_token_minted",{email:t,expiresIn:l.expires_in}),!0):(Kg(),X.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(c){if(s===r)return Kg(),X.warn("dev_preflight_token_unreachable",{url:i,error:Xn(c)}),!1;await K9t(o)}return!1}async function Y9t(e={}){await Of();let t=await bi();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=yu(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Pt();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){X.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){X.warn("dev_preflight_whoami_error",{error:Xn(o)});return}await ed({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),X.info("dev_preflight_upload_dir_seeded",{path:n})}async function dYe(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 K9t(e){return new Promise(t=>{setTimeout(t,e)})}eP();A();dn();hr();eP();import fYe from"node:fs";import{watch as J9t}from"node:fs/promises";import mYe from"node:path";import{setTimeout as hce}from"node:timers/promises";var Z9t=2e3,W9t=3e4;function X9t(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??Xk).map(n=>n.historyFilePath())}async function AYe(e={}){let t=e.debounceMs??Z9t,n=e.pollIntervalMs??W9t,r=X9t(e),o=e.runUploadFn??o8,i=e.signal?void 0:new AbortController,s=e.signal??i.signal,c=()=>i?.abort();i&&(process.once("SIGINT",c),process.once("SIGTERM",c));let l=!1,f=!1,h=async x=>{if(l){f=!0;return}l=!0;try{do{if(f=!1,s.aborted)break;try{let D=await o(e.uploadOptions);X.info("watch_sync_complete",{reason:x,uploaded:D.length})}catch(D){X.error("watch_sync_failed",{reason:x,error:Xn(D)})}}while(f&&!s.aborted)}finally{l=!1}},y,S=x=>{y&&clearTimeout(y),y=setTimeout(()=>{y=void 0,h(x)},t),y.unref?.()};X.info("watch_start",{watchPaths:r,debounceMs:t,pollIntervalMs:n}),h("startup");let b=async x=>{for(;!s.aborted;)try{let D=fYe.existsSync(x)&&fYe.statSync(x).isDirectory(),k=D?x:mYe.dirname(x),Q=D?void 0:mYe.basename(x)
|
|
555
|
+
Held locally \u2014 not uploaded. ${o.finding_count} finding(s); reason: ${o.reason}. See \`lore quarantine\`.`);return}let r=await gce({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};A();A();lT();Or();$c();dn();hr();LT();rc();var $9t=5,q9t=1e3;async function pYe(e={}){(e.environment??Zr())!=="dev"||!await V9t({fetchFn:e.fetchFn})||await Y9t({client:e.client})}async function V9t(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return X.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??$9t,o=e.retryDelayMs??q9t,i=`${rA()}/api/cli-auth/dev-token`;for(let s=1;s<=r;s+=1)try{let c=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(c.status===404){let f=await dYe(c);return Kg(),X.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:f,url:i}),!1}if(!c.ok){let f=await dYe(c);return Kg(),X.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:f}),!1}let l=await c.json();return l.access_token?(bz(l.access_token),X.info("dev_preflight_token_minted",{email:t,expiresIn:l.expires_in}),!0):(Kg(),X.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(c){if(s===r)return Kg(),X.warn("dev_preflight_token_unreachable",{url:i,error:Xn(c)}),!1;await K9t(o)}return!1}async function Y9t(e={}){await Of();let t=await bi();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=yu(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Pt();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){X.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){X.warn("dev_preflight_whoami_error",{error:Xn(o)});return}await ed({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),X.info("dev_preflight_upload_dir_seeded",{path:n})}async function dYe(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 K9t(e){return new Promise(t=>{setTimeout(t,e)})}eP();A();dn();hr();eP();import fYe from"node:fs";import{watch as J9t}from"node:fs/promises";import mYe from"node:path";import{setTimeout as hce}from"node:timers/promises";var Z9t=2e3,W9t=3e4;function X9t(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??Xk).map(n=>n.historyFilePath())}async function AYe(e={}){let t=e.debounceMs??Z9t,n=e.pollIntervalMs??W9t,r=X9t(e),o=e.runUploadFn??o8,i=e.signal?void 0:new AbortController,s=e.signal??i.signal,c=()=>i?.abort();i&&(process.once("SIGINT",c),process.once("SIGTERM",c));let l=!1,f=!1,h=async x=>{if(l){f=!0;return}l=!0;try{do{if(f=!1,s.aborted)break;try{let D=await o(e.uploadOptions);X.info("watch_sync_complete",{reason:x,uploaded:D.length})}catch(D){X.error("watch_sync_failed",{reason:x,error:Xn(D)})}}while(f&&!s.aborted)}finally{l=!1}},y,S=x=>{y&&clearTimeout(y),y=setTimeout(()=>{y=void 0,h(x)},t),y.unref?.()};X.info("watch_start",{watchPaths:r,debounceMs:t,pollIntervalMs:n}),h("startup");let b=async x=>{for(;!s.aborted;)try{let D=fYe.existsSync(x)&&fYe.statSync(x).isDirectory(),k=D?x:mYe.dirname(x),Q=D?void 0:mYe.basename(x),z=e.watchEventSource?.({watchDir:k,watchPath:x,recursive:D,signal:s})??J9t(k,{signal:s,recursive:D});for await(let G of z){if(s.aborted)break;(Q===void 0||!G.filename||G.filename===Q)&&S("fs-event")}}catch(D){if(s.aborted||D?.name==="AbortError")break;X.warn("watch_fs_retry",{path:x,error:Xn(D)}),await hce(n,void 0,{signal:s}).catch(()=>{})}},v=async()=>{for(;!s.aborted;){try{await hce(n,void 0,{signal:s})}catch{break}if(s.aborted)break;h("poll")}};try{await Promise.all([...r.map(b),v()])}finally{for(y&&clearTimeout(y),i&&(process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c));l;)await hce(50).catch(()=>{});X.info("watch_stop",{})}}var gYe={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 pYe(),await AYe({uploadOptions:n});return}let r=await o8(n);console.log(JSON.stringify(r))}};A();QE();A();Or();Jk();wf();eP();import{spawn as e5t}from"node:child_process";import hYe from"node:path";i0();sD();async function _ce(e){let t=e.progress??hD;if(!await Qt())throw new aD;t({kind:"step",step:"resolving_session"});let r=hYe.resolve(e.sessionFile),o=hYe.basename(r),i=e.harnessInternalId?.trim()||o5t(o)||o,s=await Fi(r);if(!s.exists)throw new Error(`session file does not exist: ${r}`);let c=await td(r),l={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:c.tempPath,md5:c.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:s},f=e.client??Pt();try{t({kind:"step",step:"uploading",label:o});let[h]=await SA(f,[l]);if(!h)throw new Error("create upload session returned no thread files");if(h.status==="quarantined")return t({kind:"step",step:"done"}),{quarantined:!0,reason:h.reason,finding_count:h.findingCount,session_id:i};if(h.status==="no_upload"){let ie=h.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${ie}`)}let y=h.status==="deduped",S=h.thread,b=S?.id?.trim();if(!b)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await oD(f,b);let v=S?.visibility?.trim()??"",x=v,D=e.visibility;D&&D!==v&&(t({kind:"step",step:"updating_visibility"}),x=await t5t(f,b,D));let k=`${o0().replace(/\/+$/,"")}/thread/${b}`,Q,z=e.highlight?.trim();if(z){t({kind:"step",step:"resolving_highlight"});let ie=await N8(f,b,z);ie&&(k=ie.url,Q={query:z,matched:ie.matched,start_block_id:ie.start_block_id,end_block_id:ie.end_block_id})}let G=await i5t(k),$=r5t(x)?x:"private";return t({kind:"completed",url:k,reused:y,visibility:$,clipboardCopied:G,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:b,url:k,session_id:i,project:"",reused:y,visibility:$,clipboard_copied:G,...Q?{highlight:Q}:{}}}finally{await Ap(c.tempPath)}}async function t5t(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw _p(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var n5t=new Set(["private","workspace","public"]);function r5t(e){return n5t.has(e)}function o5t(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 i5t(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 s5t(n,r,e))return!0;return!1}function s5t(e,t,n){return new Promise(r=>{let o;try{o=e5t(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 _Ye=["private","workspace","public"],EYe={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=a5t(e.visibility);if(gu()){let r=await gD({title:"lore share-codex",subtitle:"sharing this Codex session",perform:o=>_ce({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:o})});"quarantined"in r&&r.quarantined&&console.log(`
|
|
556
556
|
Held locally \u2014 not uploaded. ${r.finding_count} finding(s); reason: ${r.reason}. See \`lore quarantine\`.`)}else{let r=await _ce({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}}};function a5t(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!_Ye.includes(e))throw new Error(`--visibility must be one of: ${_Ye.join(", ")}`);return e}}A();Or();hr();Jk();QE();Nue();Oue();A();wf();sD();async function Ece(e,t,n={}){let r=n.progress??hD,{contents:o,accountId:i,orgId:s,sessionId:c}=t;r({kind:"step",step:"resolving_session",label:c});let l=await wH("audit.jsonl",o.transcript),f={key:c,filename:"audit.jsonl",sourcePath:o.transcriptPath,repoOriginPath:"",tempPath:l.tempPath,md5:l.md5,fileType:"transcript",harness:"cowork",harnessInternalId:c,watchedState:{exists:!0,size:0,modTimeUnixMs:0},artifactMetadata:{uploads:o.uploads,outputs:o.outputs}};try{r({kind:"step",step:"uploading"});let[h]=await SA(e,[f]);if(!h)throw new Error("createUploadSession returned no thread files");if(h.status==="quarantined")return{quarantined:!0,reason:h.reason,findingCount:h.findingCount};if(h.status==="no_upload")throw new Error(`createUploadSession returned no presigned_url and no existing thread: ${JSON.stringify(h)}`);let y=h.thread?.id;if(!y)throw new Error(`upload session did not return a thread id: ${JSON.stringify(h)}`);return{threadId:y,duplicate:h.status==="deduped"}}finally{await Ap(l.tempPath)}}var yYe={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}){X.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=KH();if(e.list){let f=rD(n);if(f.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of f)console.log(c5t(h));return}let r=u5t(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
|
|
557
557
|
${n}
|
|
558
558
|
Run with --list to see available sessions.`),new Error("no session resolved");let o=t?.client??Pt(),i=uqe(r.sessionDir),s=o0();if(gu()){let f=await gD({title:"lore share-cowork",subtitle:`session ${r.sessionId}`,perform:async h=>{let y=await Ece(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i},{progress:h});return y.quarantined?(h({kind:"step",step:"done"}),y):(h({kind:"completed",url:`${s.replace(/\/+$/,"")}/thread/${y.threadId}`,reused:y.duplicate,clipboardCopied:!1,sessionId:r.sessionId}),h({kind:"step",step:"done"}),y)}});f.quarantined&&console.log(`
|