@tanagram/lore 0.1.194 → 0.1.195

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +24 -24
  2. package/package.json +3 -3
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 Btt=Object.create;var PL=Object.defineProperty;var wtt=Object.getOwnPropertyDescriptor;var Ott=Object.getOwnPropertyNames;var ktt=Object.getPrototypeOf,Ptt=Object.prototype.hasOwnProperty;var Ue=(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 w=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var M=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Zs=(e,t)=>{for(var n in t)PL(e,n,{get:t[n],enumerable:!0})},sAe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ott(t))!Ptt.call(e,o)&&o!==n&&PL(e,o,{get:()=>t[o],enumerable:!(r=wtt(t,o))||r.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?Btt(ktt(e)):{},sAe(t||!e||!e.__esModule?PL(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>sAe(PL({},"__esModule",{value:!0}),e);var m=w(()=>{(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.194"}}catch{}})()});var Ig,g5=w(()=>{m();Ig="1.9.1"});function Mtt(e){let t=new Set([e]),n=new Set,r=e.match(cAe);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(u){return n.add(u),!1}function s(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(cAe);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 cAe,lAe,dAe=w(()=>{m();g5();cAe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;lAe=Mtt(Ig)});function vm(e,t,n,r=!1){var o;let i=sB[iB]=(o=sB[iB])!==null&&o!==void 0?o:{version:Ig};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!==Ig){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Ig}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Ig}.`),!0}function Ul(e){var t,n;let r=(t=sB[iB])===null||t===void 0?void 0:t.version;if(!(!r||!lAe(r)))return(n=sB[iB])===null||n===void 0?void 0:n[e]}function Rm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Ig}.`);let n=sB[iB];n&&delete n[e]}var Ltt,iB,sB,uS=w(()=>{m();g5();dAe();Ltt=Ig.split(".")[0],iB=Symbol.for(`opentelemetry.js.api.${Ltt}`),sB=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function aB(e,t,n){let r=Ul("diag");if(r)return r[e](t,...n)}var ML,pAe=w(()=>{m();uS();ML=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 Cs,LL=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Cs||(Cs={}))});function fAe(e,t){e<Cs.NONE?e=Cs.NONE:e>Cs.ALL&&(e=Cs.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",Cs.ERROR),warn:n("warn",Cs.WARN),info:n("info",Cs.INFO),debug:n("debug",Cs.DEBUG),verbose:n("verbose",Cs.VERBOSE)}}var mAe=w(()=>{m();LL()});var Utt,Ws,cS=w(()=>{m();pAe();mAe();LL();uS();Utt="diag",Ws=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=Ul("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:Cs.INFO})=>{var s,u,l;if(o===n){let _=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=_.stack)!==null&&s!==void 0?s:_.message),!1}typeof i=="number"&&(i={logLevel:i});let f=Ul("diag"),h=fAe((u=i.logLevel)!==null&&u!==void 0?u:Cs.INFO,o);if(f&&!i.suppressOverrideMessage){let _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${_}`),h.warn(`Current logger will overwrite one already registered from ${_}`)}return vm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Rm(Utt,n)},n.createComponentLogger=o=>new ML(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var UL,AAe=w(()=>{m();UL=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 gAe,hAe=w(()=>{m();gAe=Symbol("BaggageEntryMetadata")});function _Ae(e={}){return new UL(new Map(Object.entries(e)))}function EAe(e){return typeof e!="string"&&(Qtt.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:gAe,toString(){return e}}}var Qtt,h5=w(()=>{m();cS();AAe();hAe();Qtt=Ws.instance()});function Ql(e){return Symbol.for(e)}var _5,BC,uB=w(()=>{m();_5=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}}},BC=new _5});var E5,y5,QL,yAe=w(()=>{m();E5=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],y5={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(y5[t]=console[t])}QL=class{constructor(){function t(n){return function(...r){let o=y5[n];if(typeof o!="function"&&(o=y5.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<E5.length;n++)this[E5[n].n]=t(E5[n].c)}}});function SAe(){return D5}var S5,wC,T5,b5,I5,C5,cB,v5,R5,x5,D5,Ftt,Gtt,jtt,ztt,Htt,$tt,qtt,N5=w(()=>{m();S5=class{constructor(){}createGauge(t,n){return Gtt}createHistogram(t,n){return jtt}createCounter(t,n){return Ftt}createUpDownCounter(t,n){return ztt}createObservableGauge(t,n){return $tt}createObservableCounter(t,n){return Htt}createObservableUpDownCounter(t,n){return qtt}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},wC=class{},T5=class extends wC{add(t,n){}},b5=class extends wC{add(t,n){}},I5=class extends wC{record(t,n){}},C5=class extends wC{record(t,n){}},cB=class{addCallback(t){}removeCallback(t){}},v5=class extends cB{},R5=class extends cB{},x5=class extends cB{},D5=new S5,Ftt=new T5,Gtt=new I5,jtt=new C5,ztt=new b5,Htt=new v5,$tt=new R5,qtt=new x5});var FL,TAe=w(()=>{m();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(FL||(FL={}))});var GL,jL,B5=w(()=>{m();GL={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},jL={set(e,t,n){e!=null&&(e[t]=n)}}});var zL,bAe=w(()=>{m();uB();zL=class{active(){return BC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var w5,Vtt,xm,lB=w(()=>{m();bAe();uS();cS();w5="context",Vtt=new zL,xm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return vm(w5,t,Ws.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 Ul(w5)||Vtt}disable(){this._getContextManager().disable(),Rm(w5,Ws.instance())}}});var ou,O5=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ou||(ou={}))});var dB,lS,HL,$L=w(()=>{m();O5();dB="0000000000000000",lS="00000000000000000000000000000000",HL={traceId:lS,spanId:dB,traceFlags:ou.NONE}});var Dm,qL=w(()=>{m();$L();Dm=class{constructor(t=HL){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 VL(e){return e.getValue(k5)||void 0}function IAe(){return VL(xm.getInstance().active())}function pB(e,t){return e.setValue(k5,t)}function CAe(e){return e.deleteValue(k5)}function vAe(e,t){return pB(e,new Dm(t))}function YL(e){var t;return(t=VL(e))===null||t===void 0?void 0:t.spanContext()}var k5,P5=w(()=>{m();uB();qL();lB();k5=Ql("OpenTelemetry Context Key SPAN")});function RAe(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(KL[e.charCodeAt(r)]|0)+(KL[e.charCodeAt(r+1)]|0)+(KL[e.charCodeAt(r+2)]|0)+(KL[e.charCodeAt(r+3)]|0);return n===t}function M5(e){return RAe(e,32)&&e!==lS}function L5(e){return RAe(e,16)&&e!==dB}function Cg(e){return M5(e.traceId)&&L5(e.spanId)}function xAe(e){return new Dm(e)}var KL,JL=w(()=>{m();$L();qL();KL=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 Ytt(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 U5,OC,Q5=w(()=>{m();lB();P5();qL();JL();U5=xm.getInstance(),OC=class{startSpan(t,n,r=U5.active()){if(!!n?.root)return new Dm;let i=r&&YL(r);return Ytt(i)&&Cg(i)?new Dm(i):new Dm}startActiveSpan(t,n,r,o){let i,s,u;if(arguments.length<2)return;arguments.length===2?u=n:arguments.length===3?(i=n,u=r):(i=n,s=r,u=o);let l=s??U5.active(),f=this.startSpan(t,i,l),h=pB(l,f);return U5.with(h,u,void 0,f)}}});var Ktt,kC,F5=w(()=>{m();Q5();Ktt=new OC,kC=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):Ktt}}});var ZL,DAe=w(()=>{m();Q5();ZL=class{getTracer(t,n,r){return new OC}}});var Jtt,dS,G5=w(()=>{m();F5();DAe();Jtt=new ZL,dS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new kC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Jtt}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 WL,NAe=w(()=>{m();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(WL||(WL={}))});var fo,BAe=w(()=>{m();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(fo||(fo={}))});var Ai,wAe=w(()=>{m();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Ai||(Ai={}))});function OAe(e){return Xtt.test(e)}function kAe(e){return ent.test(e)&&!tnt.test(e)}var j5,Ztt,Wtt,Xtt,ent,tnt,PAe=w(()=>{m();j5="[_0-9a-z-*/]",Ztt=`[a-z]${j5}{0,255}`,Wtt=`[a-z0-9]${j5}{0,240}@[a-z]${j5}{0,13}`,Xtt=new RegExp(`^(?:${Ztt}|${Wtt})$`),ent=/^[ -~]{0,255}[!-~]$/,tnt=/,|=/});var MAe,nnt,LAe,UAe,XL,QAe=w(()=>{m();PAe();MAe=32,nnt=512,LAe=",",UAe="=",XL=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+UAe+this.get(n)),t),[]).join(LAe)}_parse(t){t.length>nnt||(this._internalState=t.split(LAe).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(UAe);if(i!==-1){let s=o.slice(0,i),u=o.slice(i+1,r.length);OAe(s)&&kAe(u)&&n.set(s,u)}return n},new Map),this._internalState.size>MAe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,MAe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function FAe(e){return new XL(e)}var GAe=w(()=>{m();QAe()});var We,jAe=w(()=>{m();lB();We=xm.getInstance()});var Fl,zAe=w(()=>{m();cS();Fl=Ws.instance()});var z5,HAe,$Ae=w(()=>{m();N5();z5=class{getMeter(t,n,r){return D5}},HAe=new z5});var H5,eU,qAe=w(()=>{m();$Ae();uS();cS();H5="metrics",eU=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return vm(H5,t,Ws.instance())}getMeterProvider(){return Ul(H5)||HAe}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Rm(H5,Ws.instance())}}});var $5,VAe=w(()=>{m();qAe();$5=eU.getInstance()});var tU,YAe=w(()=>{m();tU=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function V5(e){return e.getValue(q5)||void 0}function KAe(){return V5(xm.getInstance().active())}function JAe(e,t){return e.setValue(q5,t)}function ZAe(e){return e.deleteValue(q5)}var q5,WAe=w(()=>{m();lB();uB();q5=Ql("OpenTelemetry Baggage Key")});var Y5,rnt,nU,XAe=w(()=>{m();uS();YAe();B5();WAe();h5();cS();Y5="propagation",rnt=new tU,nU=class e{constructor(){this.createBaggage=_Ae,this.getBaggage=V5,this.getActiveBaggage=KAe,this.setBaggage=JAe,this.deleteBaggage=ZAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return vm(Y5,t,Ws.instance())}inject(t,n,r=jL){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=GL){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Rm(Y5,Ws.instance())}_getGlobalPropagator(){return Ul(Y5)||rnt}}});var mf,ege=w(()=>{m();XAe();mf=nU.getInstance()});var K5,rU,tge=w(()=>{m();uS();G5();JL();P5();cS();K5="trace",rU=class e{constructor(){this._proxyTracerProvider=new dS,this.wrapSpanContext=xAe,this.isSpanContextValid=Cg,this.deleteSpan=CAe,this.getSpan=VL,this.getActiveSpan=IAe,this.getSpanContext=YL,this.setSpan=pB,this.setSpanContext=vAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=vm(K5,this._proxyTracerProvider,Ws.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return Ul(K5)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Rm(K5,Ws.instance()),this._proxyTracerProvider=new dS}}});var Vt,nge=w(()=>{m();tge();Vt=rU.getInstance()});var tt={};Zs(tt,{DiagConsoleLogger:()=>QL,DiagLogLevel:()=>Cs,INVALID_SPANID:()=>dB,INVALID_SPAN_CONTEXT:()=>HL,INVALID_TRACEID:()=>lS,ProxyTracer:()=>kC,ProxyTracerProvider:()=>dS,ROOT_CONTEXT:()=>BC,SamplingDecision:()=>WL,SpanKind:()=>fo,SpanStatusCode:()=>Ai,TraceFlags:()=>ou,ValueType:()=>FL,baggageEntryMetadataFromString:()=>EAe,context:()=>We,createContextKey:()=>Ql,createNoopMeter:()=>SAe,createTraceState:()=>FAe,default:()=>ont,defaultTextMapGetter:()=>GL,defaultTextMapSetter:()=>jL,diag:()=>Fl,isSpanContextValid:()=>Cg,isValidSpanId:()=>L5,isValidTraceId:()=>M5,metrics:()=>$5,propagation:()=>mf,trace:()=>Vt});var ont,He=w(()=>{m();h5();uB();yAe();LL();N5();TAe();B5();F5();G5();NAe();BAe();wAe();O5();GAe();JL();$L();jAe();zAe();VAe();ege();nge();ont={context:We,diag:Fl,metrics:$5,propagation:mf,trace:Vt}});var fB=M(R_=>{"use strict";m();Object.defineProperty(R_,"__esModule",{value:!0});R_.isTracingSuppressed=R_.unsuppressTracing=R_.suppressTracing=void 0;var int=(He(),Me(tt)),J5=(0,int.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function snt(e){return e.setValue(J5,!0)}R_.suppressTracing=snt;function ant(e){return e.deleteValue(J5)}R_.unsuppressTracing=ant;function unt(e){return e.getValue(J5)===!0}R_.isTracingSuppressed=unt});var Z5=M(iu=>{"use strict";m();Object.defineProperty(iu,"__esModule",{value:!0});iu.BAGGAGE_MAX_TOTAL_LENGTH=iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=iu.BAGGAGE_HEADER=iu.BAGGAGE_ITEMS_SEPARATOR=iu.BAGGAGE_PROPERTIES_SEPARATOR=iu.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;iu.BAGGAGE_KEY_PAIR_SEPARATOR="=";iu.BAGGAGE_PROPERTIES_SEPARATOR=";";iu.BAGGAGE_ITEMS_SEPARATOR=",";iu.BAGGAGE_HEADER="baggage";iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;iu.BAGGAGE_MAX_TOTAL_LENGTH=8192});var X5=M(qd=>{"use strict";m();Object.defineProperty(qd,"__esModule",{value:!0});qd.parseKeyPairsIntoRecord=qd.parseBaggageHeaderString=qd.parsePairKeyValue=qd.getKeyPairs=qd.serializeKeyPairs=void 0;var cnt=(He(),Me(tt)),Nm=Z5();function lnt(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?Nm.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Nm.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}qd.serializeKeyPairs=lnt;function dnt(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Nm.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}qd.getKeyPairs=dnt;function W5(e){if(!e)return;let t=e.indexOf(Nm.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(Nm.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,u;try{s=decodeURIComponent(o),u=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,cnt.baggageEntryMetadataFromString)(f)}return{key:s,value:u,metadata:l}}qd.parsePairKeyValue=W5;function pnt(e,t,n,r){let o=0;for(;o<e.length&&n<Nm.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(Nm.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,u=s-o;if(u<=Nm.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=W5(e.substring(o,s));if(l){let f=(n===0?0:1)+u;if(r+f>Nm.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]}qd.parseBaggageHeaderString=pnt;function fnt(e){let t={};return typeof e=="string"&&e.length>0&&e.split(Nm.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=W5(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}qd.parseKeyPairsIntoRecord=fnt});var rge=M(iU=>{"use strict";m();Object.defineProperty(iU,"__esModule",{value:!0});iU.W3CBaggagePropagator=void 0;var eV=(He(),Me(tt)),mnt=fB(),mB=Z5(),oU=X5(),tV=class{inject(t,n,r){let o=eV.propagation.getBaggage(t);if(!o||(0,mnt.isTracingSuppressed)(t))return;let i=(0,oU.getKeyPairs)(o).filter(u=>u.length<=mB.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,mB.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,oU.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,u=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,u]=(0,oU.parseBaggageHeaderString)(o[l],i,s,u);else[s]=(0,oU.parseBaggageHeaderString)(o,i,s,u);return s===0?t:eV.propagation.setBaggage(t,eV.propagation.createBaggage(i))}fields(){return[mB.BAGGAGE_HEADER]}};iU.W3CBaggagePropagator=tV});var oge=M(sU=>{"use strict";m();Object.defineProperty(sU,"__esModule",{value:!0});sU.AnchoredClock=void 0;var nV=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}};sU.AnchoredClock=nV});var cge=M(x_=>{"use strict";m();Object.defineProperty(x_,"__esModule",{value:!0});x_.isAttributeValue=x_.isAttributeKey=x_.sanitizeAttributes=void 0;var ige=(He(),Me(tt));function Ant(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(!sge(n)){ige.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!age(r)){ige.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}x_.sanitizeAttributes=Ant;function sge(e){return typeof e=="string"&&e!==""}x_.isAttributeKey=sge;function age(e){return e==null?!0:Array.isArray(e)?gnt(e):uge(typeof e)}x_.isAttributeValue=age;function gnt(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(uge(r)){t=r;continue}return!1}return!1}}return!0}function uge(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var rV=M(aU=>{"use strict";m();Object.defineProperty(aU,"__esModule",{value:!0});aU.loggingErrorHandler=void 0;var hnt=(He(),Me(tt));function _nt(){return e=>{hnt.diag.error(Ent(e))}}aU.loggingErrorHandler=_nt;function Ent(e){return typeof e=="string"?e:JSON.stringify(ynt(e))}function ynt(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 dge=M(PC=>{"use strict";m();Object.defineProperty(PC,"__esModule",{value:!0});PC.globalErrorHandler=PC.setGlobalErrorHandler=void 0;var Snt=rV(),lge=(0,Snt.loggingErrorHandler)();function Tnt(e){lge=e}PC.setGlobalErrorHandler=Tnt;function bnt(e){try{lge(e)}catch{}}PC.globalErrorHandler=bnt});var Age=M(Bm=>{"use strict";m();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.getStringListFromEnv=Bm.getBooleanFromEnv=Bm.getStringFromEnv=Bm.getNumberFromEnv=void 0;var pge=(He(),Me(tt)),fge=Ue("util");function Int(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){pge.diag.warn(`Unknown value ${(0,fge.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}Bm.getNumberFromEnv=Int;function mge(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}Bm.getStringFromEnv=mge;function Cnt(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||pge.diag.warn(`Unknown value ${(0,fge.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Bm.getBooleanFromEnv=Cnt;function vnt(e){return mge(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}Bm.getStringListFromEnv=vnt});var gge=M(uU=>{"use strict";m();Object.defineProperty(uU,"__esModule",{value:!0});uU._globalThis=void 0;uU._globalThis=globalThis});var hge=M(cU=>{"use strict";m();Object.defineProperty(cU,"__esModule",{value:!0});cU.VERSION=void 0;cU.VERSION="2.8.0"});function Oi(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 oV=w(()=>{m()});var _ge,Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,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,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e,Rnt,iV,xnt,Dnt,Nnt,Bnt,sV,wnt,Ont,knt,Pnt,Mnt,Lnt,Unt,Qnt,Fnt,Gnt,jnt,znt,Hnt,$nt,qnt,Vnt,Ynt,Knt,aV,Jnt,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,srt,art,uV,urt,crt,cV,lV,lrt,drt,prt,frt,mrt,Art,grt,hrt,_rt,Ert,yrt,Srt,Trt,brt,Irt,Crt,vrt,AB,MC,dV,Rrt,xrt,pS,Drt,Nrt,Brt,wrt,pV,fV,Ort,mV,krt,Prt,Mrt,Lrt,Urt,Qrt,Frt,Grt,jrt,zrt,Hrt,$rt,qrt,Vrt,Yrt,Krt,Jrt,Zrt,Wrt,Xrt,eot,tot,not,AV,rot,oot,iot,sot,aot,uot,cot,lot,dot,pot,fot,mot,Aot,got,hot,_ot,Eot,yot,Sot,gV,Tot,hV,bot,Iot,Cot,vot,Rot,xot,Dot,Not,Bot,U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,wot,Oot,kot,Pot,Mot,Lot,Uot,Qot,Fot,Got,jot,zot,Hot,$ot,qot,Vot,Yot,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,rit,oit,iit,sit,ait,uit,cit,lit,dit,pit,fit,mit,Ait,git,hit,_it,Eit,yit,Sit,Tit,bit,Iit,Cit,BEe,wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,vit,Rit,xit,Dit,Nit,Bit,wit,Oit,kit,Pit,Mit,Lit,jEe,zEe,HEe,$Ee,qEe,Uit,Qit,Fit,Git,jit,zit,VEe,YEe,KEe,Hit,$it,qit,Vit,JEe,ZEe,WEe,XEe,Yit,Kit,Jit,Zit,Wit,e0e,t0e,n0e,r0e,o0e,i0e,s0e,Xit,est,tst,nst,rst,ost,ist,sst,a0e,u0e,c0e,l0e,d0e,ast,ust,cst,lst,dst,pst,p0e,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e,fst,mst,Ast,gst,hst,_st,Est,yst,Sst,Tst,bst,Ist,Cst,vst,Rst,xst,Dst,Nst,Bst,wst,Ost,kst,O0e,k0e,P0e,M0e,L0e,Pst,Mst,Lst,Ust,Qst,Fst,U0e,Q0e,Gst,jst,zst,F0e,G0e,Hst,$st,qst,j0e,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eye,tye,nye,rye,oye,Vst,Yst,Kst,Jst,Zst,Wst,Xst,eat,tat,nat,rat,oat,iat,sat,aat,uat,cat,lat,iye,sye,dat,pat,fat,aye=w(()=>{m();oV();_ge="aws.lambda.invoked_arn",Ege="db.system",yge="db.connection_string",Sge="db.user",Tge="db.jdbc.driver_classname",bge="db.name",Ige="db.statement",Cge="db.operation",vge="db.mssql.instance_name",Rge="db.cassandra.keyspace",xge="db.cassandra.page_size",Dge="db.cassandra.consistency_level",Nge="db.cassandra.table",Bge="db.cassandra.idempotence",wge="db.cassandra.speculative_execution_count",Oge="db.cassandra.coordinator.id",kge="db.cassandra.coordinator.dc",Pge="db.hbase.namespace",Mge="db.redis.database_index",Lge="db.mongodb.collection",Uge="db.sql.table",Qge="exception.type",Fge="exception.message",Gge="exception.stacktrace",jge="exception.escaped",zge="faas.trigger",Hge="faas.execution",$ge="faas.document.collection",qge="faas.document.operation",Vge="faas.document.time",Yge="faas.document.name",Kge="faas.time",Jge="faas.cron",Zge="faas.coldstart",Wge="faas.invoked_name",Xge="faas.invoked_provider",ehe="faas.invoked_region",the="net.transport",nhe="net.peer.ip",rhe="net.peer.port",ohe="net.peer.name",ihe="net.host.ip",she="net.host.port",ahe="net.host.name",uhe="net.host.connection.type",che="net.host.connection.subtype",lhe="net.host.carrier.name",dhe="net.host.carrier.mcc",phe="net.host.carrier.mnc",fhe="net.host.carrier.icc",mhe="peer.service",Ahe="enduser.id",ghe="enduser.role",hhe="enduser.scope",_he="thread.id",Ehe="thread.name",yhe="code.function",She="code.namespace",The="code.filepath",bhe="code.lineno",Ihe="http.method",Che="http.url",vhe="http.target",Rhe="http.host",xhe="http.scheme",Dhe="http.status_code",Nhe="http.flavor",Bhe="http.user_agent",whe="http.request_content_length",Ohe="http.request_content_length_uncompressed",khe="http.response_content_length",Phe="http.response_content_length_uncompressed",Mhe="http.server_name",Lhe="http.route",Uhe="http.client_ip",Qhe="aws.dynamodb.table_names",Fhe="aws.dynamodb.consumed_capacity",Ghe="aws.dynamodb.item_collection_metrics",jhe="aws.dynamodb.provisioned_read_capacity",zhe="aws.dynamodb.provisioned_write_capacity",Hhe="aws.dynamodb.consistent_read",$he="aws.dynamodb.projection",qhe="aws.dynamodb.limit",Vhe="aws.dynamodb.attributes_to_get",Yhe="aws.dynamodb.index_name",Khe="aws.dynamodb.select",Jhe="aws.dynamodb.global_secondary_indexes",Zhe="aws.dynamodb.local_secondary_indexes",Whe="aws.dynamodb.exclusive_start_table",Xhe="aws.dynamodb.table_count",e_e="aws.dynamodb.scan_forward",t_e="aws.dynamodb.segment",n_e="aws.dynamodb.total_segments",r_e="aws.dynamodb.count",o_e="aws.dynamodb.scanned_count",i_e="aws.dynamodb.attribute_definitions",s_e="aws.dynamodb.global_secondary_index_updates",a_e="messaging.system",u_e="messaging.destination",c_e="messaging.destination_kind",l_e="messaging.temp_destination",d_e="messaging.protocol",p_e="messaging.protocol_version",f_e="messaging.url",m_e="messaging.message_id",A_e="messaging.conversation_id",g_e="messaging.message_payload_size_bytes",h_e="messaging.message_payload_compressed_size_bytes",__e="messaging.operation",E_e="messaging.consumer_id",y_e="messaging.rabbitmq.routing_key",S_e="messaging.kafka.message_key",T_e="messaging.kafka.consumer_group",b_e="messaging.kafka.client_id",I_e="messaging.kafka.partition",C_e="messaging.kafka.tombstone",v_e="rpc.system",R_e="rpc.service",x_e="rpc.method",D_e="rpc.grpc.status_code",N_e="rpc.jsonrpc.version",B_e="rpc.jsonrpc.request_id",w_e="rpc.jsonrpc.error_code",O_e="rpc.jsonrpc.error_message",k_e="message.type",P_e="message.id",M_e="message.compressed_size",L_e="message.uncompressed_size",Rnt=_ge,iV=Ege,xnt=yge,Dnt=Sge,Nnt=Tge,Bnt=bge,sV=Ige,wnt=Cge,Ont=vge,knt=Rge,Pnt=xge,Mnt=Dge,Lnt=Nge,Unt=Bge,Qnt=wge,Fnt=Oge,Gnt=kge,jnt=Pge,znt=Mge,Hnt=Lge,$nt=Uge,qnt=Qge,Vnt=Fge,Ynt=Gge,Knt=jge,aV=zge,Jnt=Hge,Znt=$ge,Wnt=qge,Xnt=Vge,ert=Yge,trt=Kge,nrt=Jge,rrt=Zge,ort=Wge,irt=Xge,srt=ehe,art=the,uV=nhe,urt=rhe,crt=ohe,cV=ihe,lV=she,lrt=ahe,drt=uhe,prt=che,frt=lhe,mrt=dhe,Art=phe,grt=fhe,hrt=mhe,_rt=Ahe,Ert=ghe,yrt=hhe,Srt=_he,Trt=Ehe,brt=yhe,Irt=She,Crt=The,vrt=bhe,AB=Ihe,MC=Che,dV=vhe,Rrt=Rhe,xrt=xhe,pS=Dhe,Drt=Nhe,Nrt=Bhe,Brt=whe,wrt=Ohe,pV=khe,fV=Phe,Ort=Mhe,mV=Lhe,krt=Uhe,Prt=Qhe,Mrt=Fhe,Lrt=Ghe,Urt=jhe,Qrt=zhe,Frt=Hhe,Grt=$he,jrt=qhe,zrt=Vhe,Hrt=Yhe,$rt=Khe,qrt=Jhe,Vrt=Zhe,Yrt=Whe,Krt=Xhe,Jrt=e_e,Zrt=t_e,Wrt=n_e,Xrt=r_e,eot=o_e,tot=i_e,not=s_e,AV=a_e,rot=u_e,oot=c_e,iot=l_e,sot=d_e,aot=p_e,uot=f_e,cot=m_e,lot=A_e,dot=g_e,pot=h_e,fot=__e,mot=E_e,Aot=y_e,got=S_e,hot=T_e,_ot=b_e,Eot=I_e,yot=C_e,Sot=v_e,gV=R_e,Tot=x_e,hV=D_e,bot=N_e,Iot=B_e,Cot=w_e,vot=O_e,Rot=k_e,xot=P_e,Dot=M_e,Not=L_e,Bot=Oi([_ge,Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,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,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e]),U_e="other_sql",Q_e="mssql",F_e="mysql",G_e="oracle",j_e="db2",z_e="postgresql",H_e="redshift",$_e="hive",q_e="cloudscape",V_e="hsqldb",Y_e="progress",K_e="maxdb",J_e="hanadb",Z_e="ingres",W_e="firstsql",X_e="edb",eEe="cache",tEe="adabas",nEe="firebird",rEe="derby",oEe="filemaker",iEe="informix",sEe="instantdb",aEe="interbase",uEe="mariadb",cEe="netezza",lEe="pervasive",dEe="pointbase",pEe="sqlite",fEe="sybase",mEe="teradata",AEe="vertica",gEe="h2",hEe="coldfusion",_Ee="cassandra",EEe="hbase",yEe="mongodb",SEe="redis",TEe="couchbase",bEe="couchdb",IEe="cosmosdb",CEe="dynamodb",vEe="neo4j",REe="geode",xEe="elasticsearch",DEe="memcached",NEe="cockroachdb",wot=U_e,Oot=Q_e,kot=F_e,Pot=G_e,Mot=j_e,Lot=z_e,Uot=H_e,Qot=$_e,Fot=q_e,Got=V_e,jot=Y_e,zot=K_e,Hot=J_e,$ot=Z_e,qot=W_e,Vot=X_e,Yot=eEe,Kot=tEe,Jot=nEe,Zot=rEe,Wot=oEe,Xot=iEe,eit=sEe,tit=aEe,nit=uEe,rit=cEe,oit=lEe,iit=dEe,sit=pEe,ait=fEe,uit=mEe,cit=AEe,lit=gEe,dit=hEe,pit=_Ee,fit=EEe,mit=yEe,Ait=SEe,git=TEe,hit=bEe,_it=IEe,Eit=CEe,yit=vEe,Sit=REe,Tit=xEe,bit=DEe,Iit=NEe,Cit=Oi([U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe]),BEe="all",wEe="each_quorum",OEe="quorum",kEe="local_quorum",PEe="one",MEe="two",LEe="three",UEe="local_one",QEe="any",FEe="serial",GEe="local_serial",vit=BEe,Rit=wEe,xit=OEe,Dit=kEe,Nit=PEe,Bit=MEe,wit=LEe,Oit=UEe,kit=QEe,Pit=FEe,Mit=GEe,Lit=Oi([BEe,wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe]),jEe="datasource",zEe="http",HEe="pubsub",$Ee="timer",qEe="other",Uit=jEe,Qit=zEe,Fit=HEe,Git=$Ee,jit=qEe,zit=Oi([jEe,zEe,HEe,$Ee,qEe]),VEe="insert",YEe="edit",KEe="delete",Hit=VEe,$it=YEe,qit=KEe,Vit=Oi([VEe,YEe,KEe]),JEe="alibaba_cloud",ZEe="aws",WEe="azure",XEe="gcp",Yit=JEe,Kit=ZEe,Jit=WEe,Zit=XEe,Wit=Oi([JEe,ZEe,WEe,XEe]),e0e="ip_tcp",t0e="ip_udp",n0e="ip",r0e="unix",o0e="pipe",i0e="inproc",s0e="other",Xit=e0e,est=t0e,tst=n0e,nst=r0e,rst=o0e,ost=i0e,ist=s0e,sst=Oi([e0e,t0e,n0e,r0e,o0e,i0e,s0e]),a0e="wifi",u0e="wired",c0e="cell",l0e="unavailable",d0e="unknown",ast=a0e,ust=u0e,cst=c0e,lst=l0e,dst=d0e,pst=Oi([a0e,u0e,c0e,l0e,d0e]),p0e="gprs",f0e="edge",m0e="umts",A0e="cdma",g0e="evdo_0",h0e="evdo_a",_0e="cdma2000_1xrtt",E0e="hsdpa",y0e="hsupa",S0e="hspa",T0e="iden",b0e="evdo_b",I0e="lte",C0e="ehrpd",v0e="hspap",R0e="gsm",x0e="td_scdma",D0e="iwlan",N0e="nr",B0e="nrnsa",w0e="lte_ca",fst=p0e,mst=f0e,Ast=m0e,gst=A0e,hst=g0e,_st=h0e,Est=_0e,yst=E0e,Sst=y0e,Tst=S0e,bst=T0e,Ist=b0e,Cst=I0e,vst=C0e,Rst=v0e,xst=R0e,Dst=x0e,Nst=D0e,Bst=N0e,wst=B0e,Ost=w0e,kst=Oi([p0e,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e]),O0e="1.0",k0e="1.1",P0e="2.0",M0e="SPDY",L0e="QUIC",Pst=O0e,Mst=k0e,Lst=P0e,Ust=M0e,Qst=L0e,Fst={HTTP_1_0:O0e,HTTP_1_1:k0e,HTTP_2_0:P0e,SPDY:M0e,QUIC:L0e},U0e="queue",Q0e="topic",Gst=U0e,jst=Q0e,zst=Oi([U0e,Q0e]),F0e="receive",G0e="process",Hst=F0e,$st=G0e,qst=Oi([F0e,G0e]),j0e=0,z0e=1,H0e=2,$0e=3,q0e=4,V0e=5,Y0e=6,K0e=7,J0e=8,Z0e=9,W0e=10,X0e=11,eye=12,tye=13,nye=14,rye=15,oye=16,Vst=j0e,Yst=z0e,Kst=H0e,Jst=$0e,Zst=q0e,Wst=V0e,Xst=Y0e,eat=K0e,tat=J0e,nat=Z0e,rat=W0e,oat=X0e,iat=eye,sat=tye,aat=nye,uat=rye,cat=oye,lat={OK:j0e,CANCELLED:z0e,UNKNOWN:H0e,INVALID_ARGUMENT:$0e,DEADLINE_EXCEEDED:q0e,NOT_FOUND:V0e,ALREADY_EXISTS:Y0e,PERMISSION_DENIED:K0e,RESOURCE_EXHAUSTED:J0e,FAILED_PRECONDITION:Z0e,ABORTED:W0e,OUT_OF_RANGE:X0e,UNIMPLEMENTED:eye,INTERNAL:tye,UNAVAILABLE:nye,DATA_LOSS:rye,UNAUTHENTICATED:oye},iye="SENT",sye="RECEIVED",dat=iye,pat=sye,fat=Oi([iye,sye])});var uye=w(()=>{m();aye()});var cye,lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe,mat,Aat,gat,hat,_at,Eat,yat,Sat,Tat,bat,Iat,Cat,vat,Rat,xat,Dat,Nat,Bat,wat,Oat,kat,Pat,Mat,Lat,Uat,Qat,Fat,Gat,jat,zat,Hat,$at,qat,Vat,Yat,Kat,Jat,Zat,Wat,Xat,eut,tut,nut,rut,out,iut,sut,aut,uut,cut,lut,dut,put,fut,mut,Aut,gut,hut,_ut,Eut,yut,Sut,Tut,but,Iut,Cut,vut,Rut,xut,Dut,Nut,_V,But,wut,Out,kut,Put,Mut,Lut,Uut,Qut,Fut,MSe,LSe,USe,QSe,Gut,jut,zut,Hut,$ut,FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,qut,Vut,Yut,Kut,Jut,Zut,Wut,Xut,ect,tct,nct,rct,oct,ict,sct,act,uct,cct,rTe,oTe,lct,dct,pct,iTe,sTe,aTe,uTe,cTe,lTe,dTe,fct,mct,Act,gct,hct,_ct,Ect,yct,pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,Sct,Tct,bct,Ict,Cct,vct,Rct,xct,Dct,Nct,Bct,wct,bTe,ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe,Oct,kct,Pct,Mct,Lct,Uct,Qct,Fct,Gct,jct,zct,OTe=w(()=>{m();oV();cye="cloud.provider",lye="cloud.account.id",dye="cloud.region",pye="cloud.availability_zone",fye="cloud.platform",mye="aws.ecs.container.arn",Aye="aws.ecs.cluster.arn",gye="aws.ecs.launchtype",hye="aws.ecs.task.arn",_ye="aws.ecs.task.family",Eye="aws.ecs.task.revision",yye="aws.eks.cluster.arn",Sye="aws.log.group.names",Tye="aws.log.group.arns",bye="aws.log.stream.names",Iye="aws.log.stream.arns",Cye="container.name",vye="container.id",Rye="container.runtime",xye="container.image.name",Dye="container.image.tag",Nye="deployment.environment",Bye="device.id",wye="device.model.identifier",Oye="device.model.name",kye="faas.name",Pye="faas.id",Mye="faas.version",Lye="faas.instance",Uye="faas.max_memory",Qye="host.id",Fye="host.name",Gye="host.type",jye="host.arch",zye="host.image.name",Hye="host.image.id",$ye="host.image.version",qye="k8s.cluster.name",Vye="k8s.node.name",Yye="k8s.node.uid",Kye="k8s.namespace.name",Jye="k8s.pod.uid",Zye="k8s.pod.name",Wye="k8s.container.name",Xye="k8s.replicaset.uid",eSe="k8s.replicaset.name",tSe="k8s.deployment.uid",nSe="k8s.deployment.name",rSe="k8s.statefulset.uid",oSe="k8s.statefulset.name",iSe="k8s.daemonset.uid",sSe="k8s.daemonset.name",aSe="k8s.job.uid",uSe="k8s.job.name",cSe="k8s.cronjob.uid",lSe="k8s.cronjob.name",dSe="os.type",pSe="os.description",fSe="os.name",mSe="os.version",ASe="process.pid",gSe="process.executable.name",hSe="process.executable.path",_Se="process.command",ESe="process.command_line",ySe="process.command_args",SSe="process.owner",TSe="process.runtime.name",bSe="process.runtime.version",ISe="process.runtime.description",CSe="service.name",vSe="service.namespace",RSe="service.instance.id",xSe="service.version",DSe="telemetry.sdk.name",NSe="telemetry.sdk.language",BSe="telemetry.sdk.version",wSe="telemetry.auto.version",OSe="webengine.name",kSe="webengine.version",PSe="webengine.description",mat=cye,Aat=lye,gat=dye,hat=pye,_at=fye,Eat=mye,yat=Aye,Sat=gye,Tat=hye,bat=_ye,Iat=Eye,Cat=yye,vat=Sye,Rat=Tye,xat=bye,Dat=Iye,Nat=Cye,Bat=vye,wat=Rye,Oat=xye,kat=Dye,Pat=Nye,Mat=Bye,Lat=wye,Uat=Oye,Qat=kye,Fat=Pye,Gat=Mye,jat=Lye,zat=Uye,Hat=Qye,$at=Fye,qat=Gye,Vat=jye,Yat=zye,Kat=Hye,Jat=$ye,Zat=qye,Wat=Vye,Xat=Yye,eut=Kye,tut=Jye,nut=Zye,rut=Wye,out=Xye,iut=eSe,sut=tSe,aut=nSe,uut=rSe,cut=oSe,lut=iSe,dut=sSe,put=aSe,fut=uSe,mut=cSe,Aut=lSe,gut=dSe,hut=pSe,_ut=fSe,Eut=mSe,yut=ASe,Sut=gSe,Tut=hSe,but=_Se,Iut=ESe,Cut=ySe,vut=SSe,Rut=TSe,xut=bSe,Dut=ISe,Nut=CSe,_V=vSe,But=RSe,wut=xSe,Out=DSe,kut=NSe,Put=BSe,Mut=wSe,Lut=OSe,Uut=kSe,Qut=PSe,Fut=Oi([cye,lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe]),MSe="alibaba_cloud",LSe="aws",USe="azure",QSe="gcp",Gut=MSe,jut=LSe,zut=USe,Hut=QSe,$ut=Oi([MSe,LSe,USe,QSe]),FSe="alibaba_cloud_ecs",GSe="alibaba_cloud_fc",jSe="aws_ec2",zSe="aws_ecs",HSe="aws_eks",$Se="aws_lambda",qSe="aws_elastic_beanstalk",VSe="azure_vm",YSe="azure_container_instances",KSe="azure_aks",JSe="azure_functions",ZSe="azure_app_service",WSe="gcp_compute_engine",XSe="gcp_cloud_run",eTe="gcp_kubernetes_engine",tTe="gcp_cloud_functions",nTe="gcp_app_engine",qut=FSe,Vut=GSe,Yut=jSe,Kut=zSe,Jut=HSe,Zut=$Se,Wut=qSe,Xut=VSe,ect=YSe,tct=KSe,nct=JSe,rct=ZSe,oct=WSe,ict=XSe,sct=eTe,act=tTe,uct=nTe,cct=Oi([FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe]),rTe="ec2",oTe="fargate",lct=rTe,dct=oTe,pct=Oi([rTe,oTe]),iTe="amd64",sTe="arm32",aTe="arm64",uTe="ia64",cTe="ppc32",lTe="ppc64",dTe="x86",fct=iTe,mct=sTe,Act=aTe,gct=uTe,hct=cTe,_ct=lTe,Ect=dTe,yct=Oi([iTe,sTe,aTe,uTe,cTe,lTe,dTe]),pTe="windows",fTe="linux",mTe="darwin",ATe="freebsd",gTe="netbsd",hTe="openbsd",_Te="dragonflybsd",ETe="hpux",yTe="aix",STe="solaris",TTe="z_os",Sct=pTe,Tct=fTe,bct=mTe,Ict=ATe,Cct=gTe,vct=hTe,Rct=_Te,xct=ETe,Dct=yTe,Nct=STe,Bct=TTe,wct=Oi([pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe]),bTe="cpp",ITe="dotnet",CTe="erlang",vTe="go",RTe="java",xTe="nodejs",DTe="php",NTe="python",BTe="ruby",wTe="webjs",Oct=bTe,kct=ITe,Pct=CTe,Mct=vTe,Lct=RTe,Uct=xTe,Qct=DTe,Fct=NTe,Gct=BTe,jct=wTe,zct=Oi([bTe,ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe])});var kTe=w(()=>{m();OTe()});var Hct,$ct,qct,Vct,Yct,Kct,Jct,Zct,Wct,Xct,elt,tlt,nlt,rlt,olt,ilt,slt,alt,ult,clt,llt,dlt,plt,flt,mlt,EV,yV,Alt,LC,glt,SV,TV,hlt,fS,_lt,Elt,ylt,Slt,Tlt,blt,Ilt,Clt,msn,Asn,bV,vlt,Rlt,xlt,Dlt,Nlt,Blt,mS,wlt,Olt,klt,gsn,Plt,Mlt,Llt,Ult,hsn,Qlt,Flt,Glt,jlt,vg,Rg,zlt,Hlt,$lt,qlt,Vlt,Ylt,Klt,Jlt,Zlt,_sn,Wlt,Xlt,edt,tdt,ndt,rdt,IV,CV,odt,vV,RV,idt,sdt,Esn,ysn,adt,udt,cdt,ldt,ddt,pdt,fdt,mdt,Ssn,Adt,xV,DV,gdt,NV,hdt,BV,_dt,Edt,ydt,Sdt,Tdt,bdt,Idt,Cdt,vdt,Tsn,Rdt,xdt,bsn,Ddt,Ndt,Isn,Bdt,wdt,Odt,kdt,Pdt,Mdt,Ldt,Udt,D_,Qdt,Fdt,Gdt,wV,PTe=w(()=>{m();Hct="aspnetcore.diagnostics.exception.result",$ct="aborted",qct="handled",Vct="skipped",Yct="unhandled",Kct="aspnetcore.diagnostics.handler.type",Jct="aspnetcore.rate_limiting.policy",Zct="aspnetcore.rate_limiting.result",Wct="acquired",Xct="endpoint_limiter",elt="global_limiter",tlt="request_canceled",nlt="aspnetcore.request.is_unhandled",rlt="aspnetcore.routing.is_fallback",olt="aspnetcore.routing.match_status",ilt="failure",slt="success",alt="aspnetcore.user.is_authenticated",ult="client.address",clt="client.port",llt="code.column.number",dlt="code.file.path",plt="code.function.name",flt="code.line.number",mlt="code.stacktrace",EV="db.collection.name",yV="db.namespace",Alt="db.operation.batch.size",LC="db.operation.name",glt="db.query.summary",SV="db.query.text",TV="db.response.status_code",hlt="db.stored_procedure.name",fS="db.system.name",_lt="mariadb",Elt="microsoft.sql_server",ylt="mysql",Slt="postgresql",Tlt="dotnet.gc.heap.generation",blt="gen0",Ilt="gen1",Clt="gen2",msn="loh",Asn="poh",bV="error.type",vlt="_OTHER",Rlt="exception.escaped",xlt="exception.message",Dlt="exception.stacktrace",Nlt="exception.type",Blt=e=>`http.request.header.${e}`,mS="http.request.method",wlt="_OTHER",Olt="CONNECT",klt="DELETE",gsn="GET",Plt="HEAD",Mlt="OPTIONS",Llt="PATCH",Ult="POST",hsn="PUT",Qlt="TRACE",Flt="http.request.method_original",Glt="http.request.resend_count",jlt=e=>`http.response.header.${e}`,vg="http.response.status_code",Rg="http.route",zlt="jvm.gc.action",Hlt="jvm.gc.name",$lt="jvm.memory.pool.name",qlt="jvm.memory.type",Vlt="heap",Ylt="non_heap",Klt="jvm.thread.daemon",Jlt="jvm.thread.state",Zlt="blocked",_sn="new",Wlt="runnable",Xlt="terminated",edt="timed_waiting",tdt="waiting",ndt="network.local.address",rdt="network.local.port",IV="network.peer.address",CV="network.peer.port",odt="network.protocol.name",vV="network.protocol.version",RV="network.transport",idt="pipe",sdt="quic",Esn="tcp",ysn="udp",adt="unix",udt="network.type",cdt="ipv4",ldt="ipv6",ddt="otel.scope.name",pdt="otel.scope.version",fdt="otel.status_code",mdt="ERROR",Ssn="OK",Adt="otel.status_description",xV="server.address",DV="server.port",gdt="service.instance.id",NV="service.name",hdt="service.namespace",BV="service.version",_dt="signalr.connection.status",Edt="app_shutdown",ydt="normal_closure",Sdt="timeout",Tdt="signalr.transport",bdt="long_polling",Idt="server_sent_events",Cdt="web_sockets",vdt="telemetry.sdk.language",Tsn="cpp",Rdt="dotnet",xdt="erlang",bsn="go",Ddt="java",Ndt="nodejs",Isn="php",Bdt="python",wdt="ruby",Odt="rust",kdt="swift",Pdt="webjs",Mdt="telemetry.sdk.name",Ldt="telemetry.sdk.version",Udt="url.fragment",D_="url.full",Qdt="url.path",Fdt="url.query",Gdt="url.scheme",wV="user_agent.original"});var jdt,zdt,Hdt,$dt,qdt,Vdt,Ydt,Kdt,Jdt,Zdt,Wdt,Xdt,ept,tpt,npt,rpt,opt,ipt,spt,apt,upt,cpt,lpt,dpt,ppt,fpt,mpt,Apt,gpt,hpt,_pt,Ept,ypt,Spt,Tpt,bpt,Ipt,Cpt,vpt,Rpt,xpt,Dpt,Npt,Bpt,wpt,Opt,kpt,Ppt,Mpt,Lpt,Upt,MTe=w(()=>{m();jdt="aspnetcore.diagnostics.exceptions",zdt="aspnetcore.rate_limiting.active_request_leases",Hdt="aspnetcore.rate_limiting.queued_requests",$dt="aspnetcore.rate_limiting.request.time_in_queue",qdt="aspnetcore.rate_limiting.request_lease.duration",Vdt="aspnetcore.rate_limiting.requests",Ydt="aspnetcore.routing.match_attempts",Kdt="db.client.operation.duration",Jdt="dotnet.assembly.count",Zdt="dotnet.exceptions",Wdt="dotnet.gc.collections",Xdt="dotnet.gc.heap.total_allocated",ept="dotnet.gc.last_collection.heap.fragmentation.size",tpt="dotnet.gc.last_collection.heap.size",npt="dotnet.gc.last_collection.memory.committed_size",rpt="dotnet.gc.pause.time",opt="dotnet.jit.compilation.time",ipt="dotnet.jit.compiled_il.size",spt="dotnet.jit.compiled_methods",apt="dotnet.monitor.lock_contentions",upt="dotnet.process.cpu.count",cpt="dotnet.process.cpu.time",lpt="dotnet.process.memory.working_set",dpt="dotnet.thread_pool.queue.length",ppt="dotnet.thread_pool.thread.count",fpt="dotnet.thread_pool.work_item.count",mpt="dotnet.timer.count",Apt="http.client.request.duration",gpt="http.server.request.duration",hpt="jvm.class.count",_pt="jvm.class.loaded",Ept="jvm.class.unloaded",ypt="jvm.cpu.count",Spt="jvm.cpu.recent_utilization",Tpt="jvm.cpu.time",bpt="jvm.gc.duration",Ipt="jvm.memory.committed",Cpt="jvm.memory.limit",vpt="jvm.memory.used",Rpt="jvm.memory.used_after_last_gc",xpt="jvm.thread.count",Dpt="kestrel.active_connections",Npt="kestrel.active_tls_handshakes",Bpt="kestrel.connection.duration",wpt="kestrel.queued_connections",Opt="kestrel.queued_requests",kpt="kestrel.rejected_connections",Ppt="kestrel.tls_handshake.duration",Mpt="kestrel.upgraded_connections",Lpt="signalr.server.active_connections",Upt="signalr.server.connection.duration"});var Qpt,LTe=w(()=>{m();Qpt="exception"});var Hr={};Zs(Hr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>$ct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>qct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Vct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Yct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Wct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Xct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>elt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>tlt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>ilt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>slt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Hct,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Kct,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Jct,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Zct,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>nlt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>rlt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>olt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>alt,ATTR_CLIENT_ADDRESS:()=>ult,ATTR_CLIENT_PORT:()=>clt,ATTR_CODE_COLUMN_NUMBER:()=>llt,ATTR_CODE_FILE_PATH:()=>dlt,ATTR_CODE_FUNCTION_NAME:()=>plt,ATTR_CODE_LINE_NUMBER:()=>flt,ATTR_CODE_STACKTRACE:()=>mlt,ATTR_DB_COLLECTION_NAME:()=>EV,ATTR_DB_NAMESPACE:()=>yV,ATTR_DB_OPERATION_BATCH_SIZE:()=>Alt,ATTR_DB_OPERATION_NAME:()=>LC,ATTR_DB_QUERY_SUMMARY:()=>glt,ATTR_DB_QUERY_TEXT:()=>SV,ATTR_DB_RESPONSE_STATUS_CODE:()=>TV,ATTR_DB_STORED_PROCEDURE_NAME:()=>hlt,ATTR_DB_SYSTEM_NAME:()=>fS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Tlt,ATTR_ERROR_TYPE:()=>bV,ATTR_EXCEPTION_ESCAPED:()=>Rlt,ATTR_EXCEPTION_MESSAGE:()=>xlt,ATTR_EXCEPTION_STACKTRACE:()=>Dlt,ATTR_EXCEPTION_TYPE:()=>Nlt,ATTR_HTTP_REQUEST_HEADER:()=>Blt,ATTR_HTTP_REQUEST_METHOD:()=>mS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Flt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Glt,ATTR_HTTP_RESPONSE_HEADER:()=>jlt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>vg,ATTR_HTTP_ROUTE:()=>Rg,ATTR_JVM_GC_ACTION:()=>zlt,ATTR_JVM_GC_NAME:()=>Hlt,ATTR_JVM_MEMORY_POOL_NAME:()=>$lt,ATTR_JVM_MEMORY_TYPE:()=>qlt,ATTR_JVM_THREAD_DAEMON:()=>Klt,ATTR_JVM_THREAD_STATE:()=>Jlt,ATTR_NETWORK_LOCAL_ADDRESS:()=>ndt,ATTR_NETWORK_LOCAL_PORT:()=>rdt,ATTR_NETWORK_PEER_ADDRESS:()=>IV,ATTR_NETWORK_PEER_PORT:()=>CV,ATTR_NETWORK_PROTOCOL_NAME:()=>odt,ATTR_NETWORK_PROTOCOL_VERSION:()=>vV,ATTR_NETWORK_TRANSPORT:()=>RV,ATTR_NETWORK_TYPE:()=>udt,ATTR_OTEL_SCOPE_NAME:()=>ddt,ATTR_OTEL_SCOPE_VERSION:()=>pdt,ATTR_OTEL_STATUS_CODE:()=>fdt,ATTR_OTEL_STATUS_DESCRIPTION:()=>Adt,ATTR_SERVER_ADDRESS:()=>xV,ATTR_SERVER_PORT:()=>DV,ATTR_SERVICE_INSTANCE_ID:()=>gdt,ATTR_SERVICE_NAME:()=>NV,ATTR_SERVICE_NAMESPACE:()=>hdt,ATTR_SERVICE_VERSION:()=>BV,ATTR_SIGNALR_CONNECTION_STATUS:()=>_dt,ATTR_SIGNALR_TRANSPORT:()=>Tdt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>vdt,ATTR_TELEMETRY_SDK_NAME:()=>Mdt,ATTR_TELEMETRY_SDK_VERSION:()=>Ldt,ATTR_URL_FRAGMENT:()=>Udt,ATTR_URL_FULL:()=>D_,ATTR_URL_PATH:()=>Qdt,ATTR_URL_QUERY:()=>Fdt,ATTR_URL_SCHEME:()=>Gdt,ATTR_USER_AGENT_ORIGINAL:()=>wV,AWSECSLAUNCHTYPEVALUES_EC2:()=>lct,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>dct,AwsEcsLaunchtypeValues:()=>pct,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>qut,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Vut,CLOUDPLATFORMVALUES_AWS_EC2:()=>Yut,CLOUDPLATFORMVALUES_AWS_ECS:()=>Kut,CLOUDPLATFORMVALUES_AWS_EKS:()=>Jut,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Wut,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Zut,CLOUDPLATFORMVALUES_AZURE_AKS:()=>tct,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>rct,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>ect,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>nct,CLOUDPLATFORMVALUES_AZURE_VM:()=>Xut,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>uct,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>act,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>ict,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>oct,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>sct,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Gut,CLOUDPROVIDERVALUES_AWS:()=>jut,CLOUDPROVIDERVALUES_AZURE:()=>zut,CLOUDPROVIDERVALUES_GCP:()=>Hut,CloudPlatformValues:()=>cct,CloudProviderValues:()=>$ut,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>vit,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>kit,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Rit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Oit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Dit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Mit,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Nit,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>xit,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Pit,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>wit,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Bit,DBSYSTEMVALUES_ADABAS:()=>Kot,DBSYSTEMVALUES_CACHE:()=>Yot,DBSYSTEMVALUES_CASSANDRA:()=>pit,DBSYSTEMVALUES_CLOUDSCAPE:()=>Fot,DBSYSTEMVALUES_COCKROACHDB:()=>Iit,DBSYSTEMVALUES_COLDFUSION:()=>dit,DBSYSTEMVALUES_COSMOSDB:()=>_it,DBSYSTEMVALUES_COUCHBASE:()=>git,DBSYSTEMVALUES_COUCHDB:()=>hit,DBSYSTEMVALUES_DB2:()=>Mot,DBSYSTEMVALUES_DERBY:()=>Zot,DBSYSTEMVALUES_DYNAMODB:()=>Eit,DBSYSTEMVALUES_EDB:()=>Vot,DBSYSTEMVALUES_ELASTICSEARCH:()=>Tit,DBSYSTEMVALUES_FILEMAKER:()=>Wot,DBSYSTEMVALUES_FIREBIRD:()=>Jot,DBSYSTEMVALUES_FIRSTSQL:()=>qot,DBSYSTEMVALUES_GEODE:()=>Sit,DBSYSTEMVALUES_H2:()=>lit,DBSYSTEMVALUES_HANADB:()=>Hot,DBSYSTEMVALUES_HBASE:()=>fit,DBSYSTEMVALUES_HIVE:()=>Qot,DBSYSTEMVALUES_HSQLDB:()=>Got,DBSYSTEMVALUES_INFORMIX:()=>Xot,DBSYSTEMVALUES_INGRES:()=>$ot,DBSYSTEMVALUES_INSTANTDB:()=>eit,DBSYSTEMVALUES_INTERBASE:()=>tit,DBSYSTEMVALUES_MARIADB:()=>nit,DBSYSTEMVALUES_MAXDB:()=>zot,DBSYSTEMVALUES_MEMCACHED:()=>bit,DBSYSTEMVALUES_MONGODB:()=>mit,DBSYSTEMVALUES_MSSQL:()=>Oot,DBSYSTEMVALUES_MYSQL:()=>kot,DBSYSTEMVALUES_NEO4J:()=>yit,DBSYSTEMVALUES_NETEZZA:()=>rit,DBSYSTEMVALUES_ORACLE:()=>Pot,DBSYSTEMVALUES_OTHER_SQL:()=>wot,DBSYSTEMVALUES_PERVASIVE:()=>oit,DBSYSTEMVALUES_POINTBASE:()=>iit,DBSYSTEMVALUES_POSTGRESQL:()=>Lot,DBSYSTEMVALUES_PROGRESS:()=>jot,DBSYSTEMVALUES_REDIS:()=>Ait,DBSYSTEMVALUES_REDSHIFT:()=>Uot,DBSYSTEMVALUES_SQLITE:()=>sit,DBSYSTEMVALUES_SYBASE:()=>ait,DBSYSTEMVALUES_TERADATA:()=>uit,DBSYSTEMVALUES_VERTICA:()=>cit,DB_SYSTEM_NAME_VALUE_MARIADB:()=>_lt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Elt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>ylt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Slt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>blt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Ilt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Clt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>msn,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Asn,DbCassandraConsistencyLevelValues:()=>Lit,DbSystemValues:()=>Cit,ERROR_TYPE_VALUE_OTHER:()=>vlt,EVENT_EXCEPTION:()=>Qpt,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>qit,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>$it,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Hit,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Yit,FAASINVOKEDPROVIDERVALUES_AWS:()=>Kit,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Jit,FAASINVOKEDPROVIDERVALUES_GCP:()=>Zit,FAASTRIGGERVALUES_DATASOURCE:()=>Uit,FAASTRIGGERVALUES_HTTP:()=>Qit,FAASTRIGGERVALUES_OTHER:()=>jit,FAASTRIGGERVALUES_PUBSUB:()=>Fit,FAASTRIGGERVALUES_TIMER:()=>Git,FaasDocumentOperationValues:()=>Vit,FaasInvokedProviderValues:()=>Wit,FaasTriggerValues:()=>zit,HOSTARCHVALUES_AMD64:()=>fct,HOSTARCHVALUES_ARM32:()=>mct,HOSTARCHVALUES_ARM64:()=>Act,HOSTARCHVALUES_IA64:()=>gct,HOSTARCHVALUES_PPC32:()=>hct,HOSTARCHVALUES_PPC64:()=>_ct,HOSTARCHVALUES_X86:()=>Ect,HTTPFLAVORVALUES_HTTP_1_0:()=>Pst,HTTPFLAVORVALUES_HTTP_1_1:()=>Mst,HTTPFLAVORVALUES_HTTP_2_0:()=>Lst,HTTPFLAVORVALUES_QUIC:()=>Qst,HTTPFLAVORVALUES_SPDY:()=>Ust,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Olt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>klt,HTTP_REQUEST_METHOD_VALUE_GET:()=>gsn,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Plt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Mlt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>wlt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Llt,HTTP_REQUEST_METHOD_VALUE_POST:()=>Ult,HTTP_REQUEST_METHOD_VALUE_PUT:()=>hsn,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Qlt,HostArchValues:()=>yct,HttpFlavorValues:()=>Fst,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Vlt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Ylt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Zlt,JVM_THREAD_STATE_VALUE_NEW:()=>_sn,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Wlt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Xlt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>edt,JVM_THREAD_STATE_VALUE_WAITING:()=>tdt,MESSAGETYPEVALUES_RECEIVED:()=>pat,MESSAGETYPEVALUES_SENT:()=>dat,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Gst,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>jst,MESSAGINGOPERATIONVALUES_PROCESS:()=>$st,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Hst,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>jdt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>zdt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Hdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Vdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>qdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>$dt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Ydt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Kdt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Jdt,METRIC_DOTNET_EXCEPTIONS:()=>Zdt,METRIC_DOTNET_GC_COLLECTIONS:()=>Wdt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>Xdt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>ept,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>tpt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>npt,METRIC_DOTNET_GC_PAUSE_TIME:()=>rpt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>opt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>ipt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>spt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>apt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>upt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>cpt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>lpt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>dpt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>ppt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>fpt,METRIC_DOTNET_TIMER_COUNT:()=>mpt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Apt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>gpt,METRIC_JVM_CLASS_COUNT:()=>hpt,METRIC_JVM_CLASS_LOADED:()=>_pt,METRIC_JVM_CLASS_UNLOADED:()=>Ept,METRIC_JVM_CPU_COUNT:()=>ypt,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Spt,METRIC_JVM_CPU_TIME:()=>Tpt,METRIC_JVM_GC_DURATION:()=>bpt,METRIC_JVM_MEMORY_COMMITTED:()=>Ipt,METRIC_JVM_MEMORY_LIMIT:()=>Cpt,METRIC_JVM_MEMORY_USED:()=>vpt,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Rpt,METRIC_JVM_THREAD_COUNT:()=>xpt,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Dpt,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Npt,METRIC_KESTREL_CONNECTION_DURATION:()=>Bpt,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>wpt,METRIC_KESTREL_QUEUED_REQUESTS:()=>Opt,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>kpt,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Ppt,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Mpt,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Lpt,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Upt,MessageTypeValues:()=>fat,MessagingDestinationKindValues:()=>zst,MessagingOperationValues:()=>qst,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>gst,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Est,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>mst,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>vst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>hst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>_st,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Ist,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>fst,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>xst,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>yst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Tst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Rst,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Sst,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>bst,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Nst,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Cst,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Ost,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Bst,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>wst,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Dst,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Ast,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>cst,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>lst,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>dst,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>ast,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>ust,NETTRANSPORTVALUES_INPROC:()=>ost,NETTRANSPORTVALUES_IP:()=>tst,NETTRANSPORTVALUES_IP_TCP:()=>Xit,NETTRANSPORTVALUES_IP_UDP:()=>est,NETTRANSPORTVALUES_OTHER:()=>ist,NETTRANSPORTVALUES_PIPE:()=>rst,NETTRANSPORTVALUES_UNIX:()=>nst,NETWORK_TRANSPORT_VALUE_PIPE:()=>idt,NETWORK_TRANSPORT_VALUE_QUIC:()=>sdt,NETWORK_TRANSPORT_VALUE_TCP:()=>Esn,NETWORK_TRANSPORT_VALUE_UDP:()=>ysn,NETWORK_TRANSPORT_VALUE_UNIX:()=>adt,NETWORK_TYPE_VALUE_IPV4:()=>cdt,NETWORK_TYPE_VALUE_IPV6:()=>ldt,NetHostConnectionSubtypeValues:()=>kst,NetHostConnectionTypeValues:()=>pst,NetTransportValues:()=>sst,OSTYPEVALUES_AIX:()=>Dct,OSTYPEVALUES_DARWIN:()=>bct,OSTYPEVALUES_DRAGONFLYBSD:()=>Rct,OSTYPEVALUES_FREEBSD:()=>Ict,OSTYPEVALUES_HPUX:()=>xct,OSTYPEVALUES_LINUX:()=>Tct,OSTYPEVALUES_NETBSD:()=>Cct,OSTYPEVALUES_OPENBSD:()=>vct,OSTYPEVALUES_SOLARIS:()=>Nct,OSTYPEVALUES_WINDOWS:()=>Sct,OSTYPEVALUES_Z_OS:()=>Bct,OTEL_STATUS_CODE_VALUE_ERROR:()=>mdt,OTEL_STATUS_CODE_VALUE_OK:()=>Ssn,OsTypeValues:()=>wct,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>rat,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Xst,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Yst,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>uat,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Zst,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>nat,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>sat,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Jst,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Wst,RPCGRPCSTATUSCODEVALUES_OK:()=>Vst,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>oat,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>eat,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>tat,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>cat,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>aat,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>iat,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Kst,RpcGrpcStatusCodeValues:()=>lat,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>zrt,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>tot,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>Frt,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Mrt,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Xrt,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Yrt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>qrt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>not,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Hrt,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Lrt,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>jrt,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Vrt,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Grt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Urt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Qrt,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>eot,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Jrt,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Zrt,SEMATTRS_AWS_DYNAMODB_SELECT:()=>$rt,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Krt,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Prt,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Wrt,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Rnt,SEMATTRS_CODE_FILEPATH:()=>Crt,SEMATTRS_CODE_FUNCTION:()=>brt,SEMATTRS_CODE_LINENO:()=>vrt,SEMATTRS_CODE_NAMESPACE:()=>Irt,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Mnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Gnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Fnt,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Unt,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>knt,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Pnt,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Qnt,SEMATTRS_DB_CASSANDRA_TABLE:()=>Lnt,SEMATTRS_DB_CONNECTION_STRING:()=>xnt,SEMATTRS_DB_HBASE_NAMESPACE:()=>jnt,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Nnt,SEMATTRS_DB_MONGODB_COLLECTION:()=>Hnt,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Ont,SEMATTRS_DB_NAME:()=>Bnt,SEMATTRS_DB_OPERATION:()=>wnt,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>znt,SEMATTRS_DB_SQL_TABLE:()=>$nt,SEMATTRS_DB_STATEMENT:()=>sV,SEMATTRS_DB_SYSTEM:()=>iV,SEMATTRS_DB_USER:()=>Dnt,SEMATTRS_ENDUSER_ID:()=>_rt,SEMATTRS_ENDUSER_ROLE:()=>Ert,SEMATTRS_ENDUSER_SCOPE:()=>yrt,SEMATTRS_EXCEPTION_ESCAPED:()=>Knt,SEMATTRS_EXCEPTION_MESSAGE:()=>Vnt,SEMATTRS_EXCEPTION_STACKTRACE:()=>Ynt,SEMATTRS_EXCEPTION_TYPE:()=>qnt,SEMATTRS_FAAS_COLDSTART:()=>rrt,SEMATTRS_FAAS_CRON:()=>nrt,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Znt,SEMATTRS_FAAS_DOCUMENT_NAME:()=>ert,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Wnt,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Xnt,SEMATTRS_FAAS_EXECUTION:()=>Jnt,SEMATTRS_FAAS_INVOKED_NAME:()=>ort,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>irt,SEMATTRS_FAAS_INVOKED_REGION:()=>srt,SEMATTRS_FAAS_TIME:()=>trt,SEMATTRS_FAAS_TRIGGER:()=>aV,SEMATTRS_HTTP_CLIENT_IP:()=>krt,SEMATTRS_HTTP_FLAVOR:()=>Drt,SEMATTRS_HTTP_HOST:()=>Rrt,SEMATTRS_HTTP_METHOD:()=>AB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Brt,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>wrt,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>pV,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>fV,SEMATTRS_HTTP_ROUTE:()=>mV,SEMATTRS_HTTP_SCHEME:()=>xrt,SEMATTRS_HTTP_SERVER_NAME:()=>Ort,SEMATTRS_HTTP_STATUS_CODE:()=>pS,SEMATTRS_HTTP_TARGET:()=>dV,SEMATTRS_HTTP_URL:()=>MC,SEMATTRS_HTTP_USER_AGENT:()=>Nrt,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Dot,SEMATTRS_MESSAGE_ID:()=>xot,SEMATTRS_MESSAGE_TYPE:()=>Rot,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Not,SEMATTRS_MESSAGING_CONSUMER_ID:()=>mot,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>lot,SEMATTRS_MESSAGING_DESTINATION:()=>rot,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>oot,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>_ot,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>hot,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>got,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Eot,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>yot,SEMATTRS_MESSAGING_MESSAGE_ID:()=>cot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>pot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>dot,SEMATTRS_MESSAGING_OPERATION:()=>fot,SEMATTRS_MESSAGING_PROTOCOL:()=>sot,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>aot,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Aot,SEMATTRS_MESSAGING_SYSTEM:()=>AV,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>iot,SEMATTRS_MESSAGING_URL:()=>uot,SEMATTRS_NET_HOST_CARRIER_ICC:()=>grt,SEMATTRS_NET_HOST_CARRIER_MCC:()=>mrt,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Art,SEMATTRS_NET_HOST_CARRIER_NAME:()=>frt,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>prt,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>drt,SEMATTRS_NET_HOST_IP:()=>cV,SEMATTRS_NET_HOST_NAME:()=>lrt,SEMATTRS_NET_HOST_PORT:()=>lV,SEMATTRS_NET_PEER_IP:()=>uV,SEMATTRS_NET_PEER_NAME:()=>crt,SEMATTRS_NET_PEER_PORT:()=>urt,SEMATTRS_NET_TRANSPORT:()=>art,SEMATTRS_PEER_SERVICE:()=>hrt,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>hV,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Cot,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>vot,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Iot,SEMATTRS_RPC_JSONRPC_VERSION:()=>bot,SEMATTRS_RPC_METHOD:()=>Tot,SEMATTRS_RPC_SERVICE:()=>gV,SEMATTRS_RPC_SYSTEM:()=>Sot,SEMATTRS_THREAD_ID:()=>Srt,SEMATTRS_THREAD_NAME:()=>Trt,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>yat,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Eat,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Sat,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Tat,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>bat,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Iat,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Cat,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Rat,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>vat,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Dat,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>xat,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Aat,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>hat,SEMRESATTRS_CLOUD_PLATFORM:()=>_at,SEMRESATTRS_CLOUD_PROVIDER:()=>mat,SEMRESATTRS_CLOUD_REGION:()=>gat,SEMRESATTRS_CONTAINER_ID:()=>Bat,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Oat,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>kat,SEMRESATTRS_CONTAINER_NAME:()=>Nat,SEMRESATTRS_CONTAINER_RUNTIME:()=>wat,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Pat,SEMRESATTRS_DEVICE_ID:()=>Mat,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Lat,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Uat,SEMRESATTRS_FAAS_ID:()=>Fat,SEMRESATTRS_FAAS_INSTANCE:()=>jat,SEMRESATTRS_FAAS_MAX_MEMORY:()=>zat,SEMRESATTRS_FAAS_NAME:()=>Qat,SEMRESATTRS_FAAS_VERSION:()=>Gat,SEMRESATTRS_HOST_ARCH:()=>Vat,SEMRESATTRS_HOST_ID:()=>Hat,SEMRESATTRS_HOST_IMAGE_ID:()=>Kat,SEMRESATTRS_HOST_IMAGE_NAME:()=>Yat,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Jat,SEMRESATTRS_HOST_NAME:()=>$at,SEMRESATTRS_HOST_TYPE:()=>qat,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Zat,SEMRESATTRS_K8S_CONTAINER_NAME:()=>rut,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Aut,SEMRESATTRS_K8S_CRONJOB_UID:()=>mut,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>dut,SEMRESATTRS_K8S_DAEMONSET_UID:()=>lut,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>aut,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>sut,SEMRESATTRS_K8S_JOB_NAME:()=>fut,SEMRESATTRS_K8S_JOB_UID:()=>put,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>eut,SEMRESATTRS_K8S_NODE_NAME:()=>Wat,SEMRESATTRS_K8S_NODE_UID:()=>Xat,SEMRESATTRS_K8S_POD_NAME:()=>nut,SEMRESATTRS_K8S_POD_UID:()=>tut,SEMRESATTRS_K8S_REPLICASET_NAME:()=>iut,SEMRESATTRS_K8S_REPLICASET_UID:()=>out,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>cut,SEMRESATTRS_K8S_STATEFULSET_UID:()=>uut,SEMRESATTRS_OS_DESCRIPTION:()=>hut,SEMRESATTRS_OS_NAME:()=>_ut,SEMRESATTRS_OS_TYPE:()=>gut,SEMRESATTRS_OS_VERSION:()=>Eut,SEMRESATTRS_PROCESS_COMMAND:()=>but,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Cut,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Iut,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Sut,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Tut,SEMRESATTRS_PROCESS_OWNER:()=>vut,SEMRESATTRS_PROCESS_PID:()=>yut,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Dut,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Rut,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>xut,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>But,SEMRESATTRS_SERVICE_NAME:()=>Nut,SEMRESATTRS_SERVICE_NAMESPACE:()=>_V,SEMRESATTRS_SERVICE_VERSION:()=>wut,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Mut,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>kut,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Out,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Put,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Qut,SEMRESATTRS_WEBENGINE_NAME:()=>Lut,SEMRESATTRS_WEBENGINE_VERSION:()=>Uut,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Edt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>ydt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Sdt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>bdt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Idt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Cdt,SemanticAttributes:()=>Bot,SemanticResourceAttributes:()=>Fut,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Oct,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>kct,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Pct,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Mct,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Lct,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Uct,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Qct,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Fct,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Gct,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>jct,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Tsn,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Rdt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>xdt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>bsn,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Ddt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Ndt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>Isn,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Bdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>wdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Odt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>kdt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Pdt,TelemetrySdkLanguageValues:()=>zct});var Xn=w(()=>{m();uye();kTe();PTe();MTe();LTe()});var UTe=M(lU=>{"use strict";m();Object.defineProperty(lU,"__esModule",{value:!0});lU.ATTR_PROCESS_RUNTIME_NAME=void 0;lU.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var QTe=M(pU=>{"use strict";m();Object.defineProperty(pU,"__esModule",{value:!0});pU.SDK_INFO=void 0;var Fpt=hge(),dU=(Xn(),Me(Hr)),Gpt=UTe();pU.SDK_INFO={[dU.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[Gpt.ATTR_PROCESS_RUNTIME_NAME]:"node",[dU.ATTR_TELEMETRY_SDK_LANGUAGE]:dU.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[dU.ATTR_TELEMETRY_SDK_VERSION]:Fpt.VERSION}});var FTe=M(su=>{"use strict";m();Object.defineProperty(su,"__esModule",{value:!0});su.otperformance=su.SDK_INFO=su._globalThis=su.getStringListFromEnv=su.getNumberFromEnv=su.getBooleanFromEnv=su.getStringFromEnv=void 0;var fU=Age();Object.defineProperty(su,"getStringFromEnv",{enumerable:!0,get:function(){return fU.getStringFromEnv}});Object.defineProperty(su,"getBooleanFromEnv",{enumerable:!0,get:function(){return fU.getBooleanFromEnv}});Object.defineProperty(su,"getNumberFromEnv",{enumerable:!0,get:function(){return fU.getNumberFromEnv}});Object.defineProperty(su,"getStringListFromEnv",{enumerable:!0,get:function(){return fU.getStringListFromEnv}});var jpt=gge();Object.defineProperty(su,"_globalThis",{enumerable:!0,get:function(){return jpt._globalThis}});var zpt=QTe();Object.defineProperty(su,"SDK_INFO",{enumerable:!0,get:function(){return zpt.SDK_INFO}});su.otperformance=performance});var OV=M(au=>{"use strict";m();Object.defineProperty(au,"__esModule",{value:!0});au.getStringListFromEnv=au.getNumberFromEnv=au.getStringFromEnv=au.getBooleanFromEnv=au.otperformance=au._globalThis=au.SDK_INFO=void 0;var AS=FTe();Object.defineProperty(au,"SDK_INFO",{enumerable:!0,get:function(){return AS.SDK_INFO}});Object.defineProperty(au,"_globalThis",{enumerable:!0,get:function(){return AS._globalThis}});Object.defineProperty(au,"otperformance",{enumerable:!0,get:function(){return AS.otperformance}});Object.defineProperty(au,"getBooleanFromEnv",{enumerable:!0,get:function(){return AS.getBooleanFromEnv}});Object.defineProperty(au,"getStringFromEnv",{enumerable:!0,get:function(){return AS.getStringFromEnv}});Object.defineProperty(au,"getNumberFromEnv",{enumerable:!0,get:function(){return AS.getNumberFromEnv}});Object.defineProperty(au,"getStringListFromEnv",{enumerable:!0,get:function(){return AS.getStringListFromEnv}})});var HTe=M($r=>{"use strict";m();Object.defineProperty($r,"__esModule",{value:!0});$r.addHrTimes=$r.isTimeInput=$r.isTimeInputHrTime=$r.hrTimeToSeconds=$r.hrTimeToMilliseconds=$r.hrTimeToMicroseconds=$r.hrTimeToNanoseconds=$r.hrTimeToTimeStamp=$r.hrTimeDuration=$r.timeInputToHrTime=$r.hrTime=$r.getTimeOrigin=$r.millisToHrTime=void 0;var mU=OV(),GTe=9,Hpt=6,$pt=Math.pow(10,Hpt),gB=Math.pow(10,GTe);function hB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*$pt);return[n,r]}$r.millisToHrTime=hB;function qpt(){return mU.otperformance.timeOrigin}$r.getTimeOrigin=qpt;function jTe(e){let t=hB(mU.otperformance.timeOrigin),n=hB(typeof e=="number"?e:mU.otperformance.now());return zTe(t,n)}$r.hrTime=jTe;function Vpt(e){if(kV(e))return e;if(typeof e=="number")return e<mU.otperformance.timeOrigin?jTe(e):hB(e);if(e instanceof Date)return hB(e.getTime());throw TypeError("Invalid input type")}$r.timeInputToHrTime=Vpt;function Ypt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=gB),[n,r]}$r.hrTimeDuration=Ypt;function Kpt(e){let t=GTe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}$r.hrTimeToTimeStamp=Kpt;function Jpt(e){return e[0]*gB+e[1]}$r.hrTimeToNanoseconds=Jpt;function Zpt(e){return e[0]*1e6+e[1]/1e3}$r.hrTimeToMicroseconds=Zpt;function Wpt(e){return e[0]*1e3+e[1]/1e6}$r.hrTimeToMilliseconds=Wpt;function Xpt(e){return e[0]+e[1]/gB}$r.hrTimeToSeconds=Xpt;function kV(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}$r.isTimeInputHrTime=kV;function eft(e){return kV(e)||typeof e=="number"||e instanceof Date}$r.isTimeInput=eft;function zTe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=gB&&(n[1]-=gB,n[0]+=1),n}$r.addHrTimes=zTe});var $Te=M(AU=>{"use strict";m();Object.defineProperty(AU,"__esModule",{value:!0});AU.unrefTimer=void 0;function tft(e){typeof e!="number"&&e.unref()}AU.unrefTimer=tft});var qTe=M(_B=>{"use strict";m();Object.defineProperty(_B,"__esModule",{value:!0});_B.ExportResultCode=void 0;var nft;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(nft=_B.ExportResultCode||(_B.ExportResultCode={}))});var YTe=M(gU=>{"use strict";m();Object.defineProperty(gU,"__esModule",{value:!0});gU.CompositePropagator=void 0;var VTe=(He(),Me(tt)),PV=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){VTe.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){VTe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};gU.CompositePropagator=PV});var KTe=M(UC=>{"use strict";m();Object.defineProperty(UC,"__esModule",{value:!0});UC.validateValue=UC.validateKey=void 0;var MV="[_0-9a-z-*/]",rft=`[a-z]${MV}{0,255}`,oft=`[a-z0-9]${MV}{0,240}@[a-z]${MV}{0,13}`,ift=new RegExp(`^(?:${rft}|${oft})$`),sft=/^[ -~]{0,255}[!-~]$/,aft=/,|=/;function uft(e){return ift.test(e)}UC.validateKey=uft;function cft(e){return sft.test(e)&&!aft.test(e)}UC.validateValue=cft});var UV=M(_U=>{"use strict";m();Object.defineProperty(_U,"__esModule",{value:!0});_U.TraceState=void 0;var hU=KTe(),lft=32,JTe=512,ZTe=",",WTe="=",LV=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,hU.validateKey)(t)||!(0,hU.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>JTe)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=ZTe+t),t=`${r[0]}${WTe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(ZTe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(WTe);if(s===-1)continue;let u=i.slice(0,s),l=i.slice(s+1);if(!(0,hU.validateKey)(u)||!(0,hU.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>JTe)&&(n.set(u,l),r=f,n.size>=lft))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}};_U.TraceState=LV});var ebe=M(uu=>{"use strict";m();Object.defineProperty(uu,"__esModule",{value:!0});uu.W3CTraceContextPropagator=uu.parseTraceParent=uu.TRACE_STATE_HEADER=uu.TRACE_PARENT_HEADER=void 0;var EU=(He(),Me(tt)),dft=fB(),pft=UV();uu.TRACE_PARENT_HEADER="traceparent";uu.TRACE_STATE_HEADER="tracestate";var fft="00",mft="(?!ff)[\\da-f]{2}",Aft="(?![0]{32})[\\da-f]{32}",gft="(?![0]{16})[\\da-f]{16}",hft="[\\da-f]{2}",_ft=new RegExp(`^\\s?(${mft})-(${Aft})-(${gft})-(${hft})(-.*)?\\s?$`);function XTe(e){let t=_ft.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}uu.parseTraceParent=XTe;var QV=class{inject(t,n,r){let o=EU.trace.getSpanContext(t);if(!o||(0,dft.isTracingSuppressed)(t)||!(0,EU.isSpanContextValid)(o))return;let i=`${fft}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||EU.TraceFlags.NONE).toString(16)}`;r.set(n,uu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,uu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,uu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=XTe(i);if(!s)return t;s.isRemote=!0;let u=r.get(n,uu.TRACE_STATE_HEADER);if(u){let l=Array.isArray(u)?u.join(","):u;s.traceState=new pft.TraceState(typeof l=="string"?l:void 0)}return EU.trace.setSpanContext(t,s)}fields(){return[uu.TRACE_PARENT_HEADER,uu.TRACE_STATE_HEADER]}};uu.W3CTraceContextPropagator=QV});var tbe=M(Af=>{"use strict";m();Object.defineProperty(Af,"__esModule",{value:!0});Af.getRPCMetadata=Af.deleteRPCMetadata=Af.setRPCMetadata=Af.RPCType=void 0;var Eft=(He(),Me(tt)),FV=(0,Eft.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),yft;(function(e){e.HTTP="http"})(yft=Af.RPCType||(Af.RPCType={}));function Sft(e,t){return e.setValue(FV,t)}Af.setRPCMetadata=Sft;function Tft(e){return e.deleteValue(FV)}Af.deleteRPCMetadata=Tft;function bft(e){return e.getValue(FV)}Af.getRPCMetadata=bft});var sbe=M(yU=>{"use strict";m();Object.defineProperty(yU,"__esModule",{value:!0});yU.isPlainObject=void 0;var Ift="[object Object]",Cft="[object Null]",vft="[object Undefined]",Rft=Function.prototype,nbe=Rft.toString,xft=nbe.call(Object),Dft=Object.getPrototypeOf,rbe=Object.prototype,obe=rbe.hasOwnProperty,gS=Symbol?Symbol.toStringTag:void 0,ibe=rbe.toString;function Nft(e){if(!Bft(e)||wft(e)!==Ift)return!1;let t=Dft(e);if(t===null)return!0;let n=obe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&nbe.call(n)===xft}yU.isPlainObject=Nft;function Bft(e){return e!=null&&typeof e=="object"}function wft(e){return e==null?e===void 0?vft:Cft:gS&&gS in Object(e)?Oft(e):kft(e)}function Oft(e){let t=obe.call(e,gS),n=e[gS],r=!1;try{e[gS]=void 0,r=!0}catch{}let o=ibe.call(e);return r&&(t?e[gS]=n:delete e[gS]),o}function kft(e){return ibe.call(e)}});var dbe=M(bU=>{"use strict";m();Object.defineProperty(bU,"__esModule",{value:!0});bU.merge=void 0;var abe=sbe(),Pft=20;function Mft(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=cbe(t,e.shift(),0,n);return t}bU.merge=Mft;function GV(e){return TU(e)?e.slice():e}function cbe(e,t,n=0,r){let o;if(!(n>Pft)){if(n++,SU(e)||SU(t)||lbe(t))o=GV(t);else if(TU(e)){if(o=e.slice(),TU(t))for(let i=0,s=t.length;i<s;i++)o.push(GV(t[i]));else if(EB(t)){let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=GV(t[l]))}}}else if(EB(e))if(EB(t)){if(!Lft(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(SU(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],_=f;if(ube(e,l,r)||ube(t,l,r))delete o[l];else{if(EB(h)&&EB(_)){let y=r.get(h)||[],T=r.get(_)||[];y.push({obj:e,key:l}),T.push({obj:t,key:l}),r.set(h,y),r.set(_,T)}o[l]=cbe(o[l],f,n,r)}}}}else o=t;return o}}function ube(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 TU(e){return Array.isArray(e)}function lbe(e){return typeof e=="function"}function EB(e){return!SU(e)&&!TU(e)&&!lbe(e)&&typeof e=="object"}function SU(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Lft(e,t){return!(!(0,abe.isPlainObject)(e)||!(0,abe.isPlainObject)(t))}});var pbe=M(QC=>{"use strict";m();Object.defineProperty(QC,"__esModule",{value:!0});QC.callWithTimeout=QC.TimeoutError=void 0;var IU=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};QC.TimeoutError=IU;function Uft(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new IU("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}QC.callWithTimeout=Uft});var mbe=M(FC=>{"use strict";m();Object.defineProperty(FC,"__esModule",{value:!0});FC.isUrlIgnored=FC.urlMatches=void 0;function fbe(e,t){return typeof t=="string"?e===t:!!e.match(t)}FC.urlMatches=fbe;function Qft(e,t){if(!t)return!1;for(let n of t)if(fbe(e,n))return!0;return!1}FC.isUrlIgnored=Qft});var Abe=M(CU=>{"use strict";m();Object.defineProperty(CU,"__esModule",{value:!0});CU.Deferred=void 0;var jV=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)}};CU.Deferred=jV});var gbe=M(vU=>{"use strict";m();Object.defineProperty(vU,"__esModule",{value:!0});vU.BindOnceFuture=void 0;var Fft=Abe(),zV=class{_isCalled=!1;_deferred=new Fft.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}};vU.BindOnceFuture=zV});var _be=M(RU=>{"use strict";m();Object.defineProperty(RU,"__esModule",{value:!0});RU.diagLogLevelFromString=void 0;var xg=(He(),Me(tt)),hbe={ALL:xg.DiagLogLevel.ALL,VERBOSE:xg.DiagLogLevel.VERBOSE,DEBUG:xg.DiagLogLevel.DEBUG,INFO:xg.DiagLogLevel.INFO,WARN:xg.DiagLogLevel.WARN,ERROR:xg.DiagLogLevel.ERROR,NONE:xg.DiagLogLevel.NONE};function Gft(e){if(e==null)return;let t=hbe[e.toUpperCase()];return t??(xg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(hbe)}, using default`),xg.DiagLogLevel.INFO)}RU.diagLogLevelFromString=Gft});var ybe=M(xU=>{"use strict";m();Object.defineProperty(xU,"__esModule",{value:!0});xU._export=void 0;var Ebe=(He(),Me(tt)),jft=fB();function zft(e,t){return new Promise(n=>{Ebe.context.with((0,jft.suppressTracing)(Ebe.context.active()),()=>{e.export(t,n)})})}xU._export=zft});var vr=M(Be=>{"use strict";m();Object.defineProperty(Be,"__esModule",{value:!0});Be.diagLogLevelFromString=Be.BindOnceFuture=Be.urlMatches=Be.isUrlIgnored=Be.callWithTimeout=Be.TimeoutError=Be.merge=Be.TraceState=Be.unsuppressTracing=Be.suppressTracing=Be.isTracingSuppressed=Be.setRPCMetadata=Be.getRPCMetadata=Be.deleteRPCMetadata=Be.RPCType=Be.parseTraceParent=Be.W3CTraceContextPropagator=Be.TRACE_STATE_HEADER=Be.TRACE_PARENT_HEADER=Be.CompositePropagator=Be.otperformance=Be.getStringListFromEnv=Be.getNumberFromEnv=Be.getBooleanFromEnv=Be.getStringFromEnv=Be._globalThis=Be.SDK_INFO=Be.parseKeyPairsIntoRecord=Be.ExportResultCode=Be.unrefTimer=Be.timeInputToHrTime=Be.millisToHrTime=Be.isTimeInputHrTime=Be.isTimeInput=Be.hrTimeToTimeStamp=Be.hrTimeToSeconds=Be.hrTimeToNanoseconds=Be.hrTimeToMilliseconds=Be.hrTimeToMicroseconds=Be.hrTimeDuration=Be.hrTime=Be.getTimeOrigin=Be.addHrTimes=Be.loggingErrorHandler=Be.setGlobalErrorHandler=Be.globalErrorHandler=Be.sanitizeAttributes=Be.isAttributeValue=Be.AnchoredClock=Be.W3CBaggagePropagator=void 0;Be.internal=void 0;var Hft=rge();Object.defineProperty(Be,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Hft.W3CBaggagePropagator}});var $ft=oge();Object.defineProperty(Be,"AnchoredClock",{enumerable:!0,get:function(){return $ft.AnchoredClock}});var Sbe=cge();Object.defineProperty(Be,"isAttributeValue",{enumerable:!0,get:function(){return Sbe.isAttributeValue}});Object.defineProperty(Be,"sanitizeAttributes",{enumerable:!0,get:function(){return Sbe.sanitizeAttributes}});var Tbe=dge();Object.defineProperty(Be,"globalErrorHandler",{enumerable:!0,get:function(){return Tbe.globalErrorHandler}});Object.defineProperty(Be,"setGlobalErrorHandler",{enumerable:!0,get:function(){return Tbe.setGlobalErrorHandler}});var qft=rV();Object.defineProperty(Be,"loggingErrorHandler",{enumerable:!0,get:function(){return qft.loggingErrorHandler}});var Gl=HTe();Object.defineProperty(Be,"addHrTimes",{enumerable:!0,get:function(){return Gl.addHrTimes}});Object.defineProperty(Be,"getTimeOrigin",{enumerable:!0,get:function(){return Gl.getTimeOrigin}});Object.defineProperty(Be,"hrTime",{enumerable:!0,get:function(){return Gl.hrTime}});Object.defineProperty(Be,"hrTimeDuration",{enumerable:!0,get:function(){return Gl.hrTimeDuration}});Object.defineProperty(Be,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMicroseconds}});Object.defineProperty(Be,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMilliseconds}});Object.defineProperty(Be,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Gl.hrTimeToNanoseconds}});Object.defineProperty(Be,"hrTimeToSeconds",{enumerable:!0,get:function(){return Gl.hrTimeToSeconds}});Object.defineProperty(Be,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Gl.hrTimeToTimeStamp}});Object.defineProperty(Be,"isTimeInput",{enumerable:!0,get:function(){return Gl.isTimeInput}});Object.defineProperty(Be,"isTimeInputHrTime",{enumerable:!0,get:function(){return Gl.isTimeInputHrTime}});Object.defineProperty(Be,"millisToHrTime",{enumerable:!0,get:function(){return Gl.millisToHrTime}});Object.defineProperty(Be,"timeInputToHrTime",{enumerable:!0,get:function(){return Gl.timeInputToHrTime}});var Vft=$Te();Object.defineProperty(Be,"unrefTimer",{enumerable:!0,get:function(){return Vft.unrefTimer}});var Yft=qTe();Object.defineProperty(Be,"ExportResultCode",{enumerable:!0,get:function(){return Yft.ExportResultCode}});var Kft=X5();Object.defineProperty(Be,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Kft.parseKeyPairsIntoRecord}});var hS=OV();Object.defineProperty(Be,"SDK_INFO",{enumerable:!0,get:function(){return hS.SDK_INFO}});Object.defineProperty(Be,"_globalThis",{enumerable:!0,get:function(){return hS._globalThis}});Object.defineProperty(Be,"getStringFromEnv",{enumerable:!0,get:function(){return hS.getStringFromEnv}});Object.defineProperty(Be,"getBooleanFromEnv",{enumerable:!0,get:function(){return hS.getBooleanFromEnv}});Object.defineProperty(Be,"getNumberFromEnv",{enumerable:!0,get:function(){return hS.getNumberFromEnv}});Object.defineProperty(Be,"getStringListFromEnv",{enumerable:!0,get:function(){return hS.getStringListFromEnv}});Object.defineProperty(Be,"otperformance",{enumerable:!0,get:function(){return hS.otperformance}});var Jft=YTe();Object.defineProperty(Be,"CompositePropagator",{enumerable:!0,get:function(){return Jft.CompositePropagator}});var DU=ebe();Object.defineProperty(Be,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return DU.TRACE_PARENT_HEADER}});Object.defineProperty(Be,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return DU.TRACE_STATE_HEADER}});Object.defineProperty(Be,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return DU.W3CTraceContextPropagator}});Object.defineProperty(Be,"parseTraceParent",{enumerable:!0,get:function(){return DU.parseTraceParent}});var NU=tbe();Object.defineProperty(Be,"RPCType",{enumerable:!0,get:function(){return NU.RPCType}});Object.defineProperty(Be,"deleteRPCMetadata",{enumerable:!0,get:function(){return NU.deleteRPCMetadata}});Object.defineProperty(Be,"getRPCMetadata",{enumerable:!0,get:function(){return NU.getRPCMetadata}});Object.defineProperty(Be,"setRPCMetadata",{enumerable:!0,get:function(){return NU.setRPCMetadata}});var HV=fB();Object.defineProperty(Be,"isTracingSuppressed",{enumerable:!0,get:function(){return HV.isTracingSuppressed}});Object.defineProperty(Be,"suppressTracing",{enumerable:!0,get:function(){return HV.suppressTracing}});Object.defineProperty(Be,"unsuppressTracing",{enumerable:!0,get:function(){return HV.unsuppressTracing}});var Zft=UV();Object.defineProperty(Be,"TraceState",{enumerable:!0,get:function(){return Zft.TraceState}});var Wft=dbe();Object.defineProperty(Be,"merge",{enumerable:!0,get:function(){return Wft.merge}});var bbe=pbe();Object.defineProperty(Be,"TimeoutError",{enumerable:!0,get:function(){return bbe.TimeoutError}});Object.defineProperty(Be,"callWithTimeout",{enumerable:!0,get:function(){return bbe.callWithTimeout}});var Ibe=mbe();Object.defineProperty(Be,"isUrlIgnored",{enumerable:!0,get:function(){return Ibe.isUrlIgnored}});Object.defineProperty(Be,"urlMatches",{enumerable:!0,get:function(){return Ibe.urlMatches}});var Xft=gbe();Object.defineProperty(Be,"BindOnceFuture",{enumerable:!0,get:function(){return Xft.BindOnceFuture}});var emt=_be();Object.defineProperty(Be,"diagLogLevelFromString",{enumerable:!0,get:function(){return emt.diagLogLevelFromString}});var tmt=ybe();Be.internal={_export:tmt._export}});var Cbe=M(BU=>{"use strict";m();Object.defineProperty(BU,"__esModule",{value:!0});BU.VERSION=void 0;BU.VERSION="0.214.0"});var vbe=M(yB=>{"use strict";m();Object.defineProperty(yB,"__esModule",{value:!0});yB.SeverityNumber=void 0;var nmt;(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"})(nmt=yB.SeverityNumber||(yB.SeverityNumber={}))});var OU=M(GC=>{"use strict";m();Object.defineProperty(GC,"__esModule",{value:!0});GC.NOOP_LOGGER=GC.NoopLogger=void 0;var wU=class{emit(t){}};GC.NoopLogger=wU;GC.NOOP_LOGGER=new wU});var Rbe=M(wm=>{"use strict";m();Object.defineProperty(wm,"__esModule",{value:!0});wm.API_BACKWARDS_COMPATIBILITY_VERSION=wm.makeGetter=wm._global=wm.GLOBAL_LOGS_API_KEY=void 0;wm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");wm._global=globalThis;function rmt(e,t,n){return r=>r===e?t:n}wm.makeGetter=rmt;wm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var $V=M(jC=>{"use strict";m();Object.defineProperty(jC,"__esModule",{value:!0});jC.NOOP_LOGGER_PROVIDER=jC.NoopLoggerProvider=void 0;var omt=OU(),kU=class{getLogger(t,n,r){return new omt.NoopLogger}};jC.NoopLoggerProvider=kU;jC.NOOP_LOGGER_PROVIDER=new kU});var xbe=M(PU=>{"use strict";m();Object.defineProperty(PU,"__esModule",{value:!0});PU.ProxyLogger=void 0;var imt=OU(),qV=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):imt.NOOP_LOGGER}};PU.ProxyLogger=qV});var Dbe=M(MU=>{"use strict";m();Object.defineProperty(MU,"__esModule",{value:!0});MU.ProxyLoggerProvider=void 0;var smt=$V(),amt=xbe(),VV=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new amt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:smt.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)}};MU.ProxyLoggerProvider=VV});var Bbe=M(LU=>{"use strict";m();Object.defineProperty(LU,"__esModule",{value:!0});LU.LogsAPI=void 0;var Vd=Rbe(),umt=$V(),Nbe=Dbe(),YV=class e{constructor(){this._proxyLoggerProvider=new Nbe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Vd._global[Vd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Vd._global[Vd.GLOBAL_LOGS_API_KEY]=(0,Vd.makeGetter)(Vd.API_BACKWARDS_COMPATIBILITY_VERSION,t,umt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Vd._global[Vd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Vd._global,Vd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Vd._global[Vd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Nbe.ProxyLoggerProvider}};LU.LogsAPI=YV});var KV=M(Om=>{"use strict";m();Object.defineProperty(Om,"__esModule",{value:!0});Om.logs=Om.NoopLogger=Om.NOOP_LOGGER=Om.SeverityNumber=void 0;var cmt=vbe();Object.defineProperty(Om,"SeverityNumber",{enumerable:!0,get:function(){return cmt.SeverityNumber}});var wbe=OU();Object.defineProperty(Om,"NOOP_LOGGER",{enumerable:!0,get:function(){return wbe.NOOP_LOGGER}});Object.defineProperty(Om,"NoopLogger",{enumerable:!0,get:function(){return wbe.NoopLogger}});var lmt=Bbe();Om.logs=lmt.LogsAPI.getInstance()});var Obe=M(zC=>{"use strict";m();Object.defineProperty(zC,"__esModule",{value:!0});zC.disableInstrumentations=zC.enableInstrumentations=void 0;function dmt(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()}}zC.enableInstrumentations=dmt;function pmt(e){e.forEach(t=>t.disable())}zC.disableInstrumentations=pmt});var Mbe=M(UU=>{"use strict";m();Object.defineProperty(UU,"__esModule",{value:!0});UU.registerInstrumentations=void 0;var kbe=(He(),Me(tt)),fmt=KV(),Pbe=Obe();function mmt(e){let t=e.tracerProvider||kbe.trace.getTracerProvider(),n=e.meterProvider||kbe.metrics.getMeterProvider(),r=e.loggerProvider||fmt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Pbe.enableInstrumentations)(o,t,n,r),()=>{(0,Pbe.disableInstrumentations)(o)}}UU.registerInstrumentations=mmt});var $be=M(QU=>{"use strict";m();Object.defineProperty(QU,"__esModule",{value:!0});QU.satisfies=void 0;var XV=(He(),Me(tt)),Gbe=/^(?: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-]+)*))?$/,Amt=/^(?<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-]+)*))?$/,gmt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function hmt(e,t,n){if(!_mt(e))return XV.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Tmt(e);if(!r)return!1;let o=[],i=jbe(r,t,o,n);return i&&!n?.includePrerelease?ymt(r,o):i}QU.satisfies=hmt;function _mt(e){return typeof e=="string"&&Gbe.test(e)}function jbe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(JV(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=zmt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!JV(e,i,n,r))return!1;return!0}return JV(e,t,n,r)}function JV(e,t,n,r){if(t=Smt(t,r),t.includes(" "))return jbe(e,t,n,r);{let o=bmt(t);return n.push(o),Emt(e,o)}}function Emt(e,t){if(t.invalid)return!1;if(!t.version||WV(t.version))return!0;let n=Ube(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=Ube(r,o)}return gmt[t.op]?.includes(n)}function ymt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Smt(e,t){return e=e.trim(),e=Gmt(e,t),e=Fmt(e),e=jmt(e,t),e=e.trim(),e}function $u(e){return!e||e.toLowerCase()==="x"||e==="*"}function Tmt(e){let t=e.match(Gbe);if(!t){XV.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 bmt(e){if(!e)return{};let t=e.match(Amt);if(!t)return XV.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("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function WV(e){return e==="*"||e==="x"||e==="X"}function Lbe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Imt(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 Cmt(e,t){if(WV(e)||WV(t))return 0;let[n,r]=Imt(Lbe(e),Lbe(t));return n>r?1:n<r?-1:0}function Ube(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=Cmt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var zbe="[a-zA-Z0-9-]",Hbe="0|[1-9]\\d*",vmt=`\\d*[a-zA-Z-]${zbe}*`,Rmt="((?:<|>)?=?)",Qbe=`(?:${Hbe}|${vmt})`,xmt=`(?:-(${Qbe}(?:\\.${Qbe})*))`,Fbe=`${zbe}+`,Dmt=`(?:\\+(${Fbe}(?:\\.${Fbe})*))`,ZV=`${Hbe}|x|X|\\*`,SB=`[v=\\s]*(${ZV})(?:\\.(${ZV})(?:\\.(${ZV})(?:${xmt})?${Dmt}?)?)?`,Nmt=`^${Rmt}\\s*${SB}$`,Bmt=new RegExp(Nmt),wmt=`^\\s*(${SB})\\s+-\\s+(${SB})\\s*$`,Omt=new RegExp(wmt),kmt="(?:~>?)",Pmt=`^${kmt}${SB}$`,Mmt=new RegExp(Pmt),Lmt="(?:\\^)",Umt=`^${Lmt}${SB}$`,Qmt=new RegExp(Umt);function Fmt(e){let t=Mmt;return e.replace(t,(n,r,o,i,s)=>{let u;return $u(r)?u="":$u(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:$u(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function Gmt(e,t){let n=Qmt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return $u(i)?f="":$u(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:$u(u)?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}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function jmt(e,t){let n=Bmt;return e.replace(n,(r,o,i,s,u,l)=>{let f=$u(i),h=f||$u(s),_=h||$u(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function zmt(e,t){let n=Omt;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>($u(i)?o="":$u(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:$u(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,$u(_)?h="":$u(y)?h=`<${+_+1}.0.0-0`:$u(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var e7=M(Ra=>{"use strict";m();Object.defineProperty(Ra,"__esModule",{value:!0});Ra.massUnwrap=Ra.unwrap=Ra.massWrap=Ra.wrap=void 0;var qu=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 Hmt=(e,t,n)=>{if(!e||!e[t]){qu("no original function "+String(t)+" to wrap");return}if(!n){qu("no wrapper function"),qu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){qu("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};Ra.wrap=Hmt;var $mt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ra.wrap)(r,o,n)})})};Ra.massWrap=$mt;var qmt=(e,t)=>{if(!e||!e[t]){qu("no function to unwrap."),qu(new Error().stack);return}let n=e[t];if(!n.__unwrap)qu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ra.unwrap=qmt;var Vmt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ra.unwrap)(n,r)})})};Ra.massUnwrap=Vmt;function bB(e){e&&e.logger&&(typeof e.logger!="function"?qu("new logger isn't a function, not replacing"):qu=e.logger)}Ra.default=bB;bB.wrap=Ra.wrap;bB.massWrap=Ra.massWrap;bB.unwrap=Ra.unwrap;bB.massUnwrap=Ra.massUnwrap});var qbe=M(GU=>{"use strict";m();Object.defineProperty(GU,"__esModule",{value:!0});GU.InstrumentationAbstract=void 0;var t7=(He(),Me(tt)),Ymt=KV(),FU=e7(),n7=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=t7.diag.createComponentLogger({namespace:t}),this._tracer=t7.trace.getTracer(t,n),this._meter=t7.metrics.getMeter(t,n),this._logger=Ymt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=FU.wrap;_unwrap=FU.unwrap;_massWrap=FU.massWrap;_massUnwrap=FU.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)}}};GU.InstrumentationAbstract=n7});var Ybe=M((Xan,Vbe)=>{m();var HC=1e3,$C=HC*60,qC=$C*60,_S=qC*24,Kmt=_S*7,Jmt=_S*365.25;Vbe.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Zmt(e);if(n==="number"&&isFinite(e))return t.long?Xmt(e):Wmt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Zmt(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*Jmt;case"weeks":case"week":case"w":return n*Kmt;case"days":case"day":case"d":return n*_S;case"hours":case"hour":case"hrs":case"hr":case"h":return n*qC;case"minutes":case"minute":case"mins":case"min":case"m":return n*$C;case"seconds":case"second":case"secs":case"sec":case"s":return n*HC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Wmt(e){var t=Math.abs(e);return t>=_S?Math.round(e/_S)+"d":t>=qC?Math.round(e/qC)+"h":t>=$C?Math.round(e/$C)+"m":t>=HC?Math.round(e/HC)+"s":e+"ms"}function Xmt(e){var t=Math.abs(e);return t>=_S?jU(e,t,_S,"day"):t>=qC?jU(e,t,qC,"hour"):t>=$C?jU(e,t,$C,"minute"):t>=HC?jU(e,t,HC,"second"):e+" ms"}function jU(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var r7=M((tun,Kbe)=>{m();function eAt(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=u,n.humanize=Ybe(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let _=0;for(let y=0;y<h.length;y++)_=(_<<5)-_+h.charCodeAt(y),_|=0;return n.colors[Math.abs(_)%n.colors.length]}n.selectColor=t;function n(h){let _,y=null,T,v;function R(...x){if(!R.enabled)return;let O=R,P=Number(new Date),j=P-(_||P);O.diff=j,O.prev=_,O.curr=P,_=P,x[0]=n.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let G=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(V,ae)=>{if(V==="%%")return"%";G++;let re=n.formatters[ae];if(typeof re=="function"){let _e=x[G];V=re.call(O,_e),x.splice(G,1),G--}return V}),n.formatArgs.call(O,x),(O.log||n.log).apply(O,x)}return R.namespace=h,R.useColors=n.useColors(),R.color=n.selectColor(h),R.extend=r,R.destroy=n.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,v=n.enabled(h)),v),set:x=>{y=x}}),typeof n.init=="function"&&n.init(R),R}function r(h,_){let y=n(this.namespace+(typeof _>"u"?":":_)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let _=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of _)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,_){let y=0,T=0,v=-1,R=0;for(;y<h.length;)if(T<_.length&&(_[T]===h[y]||_[T]==="*"))_[T]==="*"?(v=T,R=y,T++):(y++,T++);else if(v!==-1)T=v+1,R++,y=R;else return!1;for(;T<_.length&&_[T]==="*";)T++;return T===_.length}function s(){let h=[...n.names,...n.skips.map(_=>"-"+_)].join(",");return n.enable(""),h}function u(h){for(let _ of n.skips)if(i(h,_))return!1;for(let _ of n.names)if(i(h,_))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}Kbe.exports=eAt});var Jbe=M((Gc,zU)=>{m();Gc.formatArgs=nAt;Gc.save=rAt;Gc.load=oAt;Gc.useColors=tAt;Gc.storage=iAt();Gc.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`."))}})();Gc.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 tAt(){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 nAt(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+zU.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)}Gc.log=console.debug||console.log||(()=>{});function rAt(e){try{e?Gc.storage.setItem("debug",e):Gc.storage.removeItem("debug")}catch{}}function oAt(){let e;try{e=Gc.storage.getItem("debug")||Gc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function iAt(){try{return localStorage}catch{}}zU.exports=r7()(Gc);var{formatters:sAt}=zU.exports;sAt.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Wbe=M((oun,Zbe)=>{"use strict";m();Zbe.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 tIe=M((sun,eIe)=>{"use strict";m();var aAt=Ue("os"),Xbe=Ue("tty"),Yd=Wbe(),{env:Xs}=process,N_;Yd("no-color")||Yd("no-colors")||Yd("color=false")||Yd("color=never")?N_=0:(Yd("color")||Yd("colors")||Yd("color=true")||Yd("color=always"))&&(N_=1);"FORCE_COLOR"in Xs&&(Xs.FORCE_COLOR==="true"?N_=1:Xs.FORCE_COLOR==="false"?N_=0:N_=Xs.FORCE_COLOR.length===0?1:Math.min(parseInt(Xs.FORCE_COLOR,10),3));function o7(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i7(e,t){if(N_===0)return 0;if(Yd("color=16m")||Yd("color=full")||Yd("color=truecolor"))return 3;if(Yd("color=256"))return 2;if(e&&!t&&N_===void 0)return 0;let n=N_||0;if(Xs.TERM==="dumb")return n;if(process.platform==="win32"){let r=aAt.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Xs)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Xs)||Xs.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Xs)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Xs.TEAMCITY_VERSION)?1:0;if(Xs.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Xs){let r=parseInt((Xs.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Xs.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Xs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Xs.TERM)||"COLORTERM"in Xs?1:n}function uAt(e){let t=i7(e,e&&e.isTTY);return o7(t)}eIe.exports={supportsColor:uAt,stdout:o7(i7(!0,Xbe.isatty(1))),stderr:o7(i7(!0,Xbe.isatty(2)))}});var rIe=M((ea,$U)=>{m();var cAt=Ue("tty"),HU=Ue("util");ea.init=gAt;ea.log=fAt;ea.formatArgs=dAt;ea.save=mAt;ea.load=AAt;ea.useColors=lAt;ea.destroy=HU.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ea.colors=[6,2,3,4,5,1];try{let e=tIe();e&&(e.stderr||e).level>=2&&(ea.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{}ea.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 lAt(){return"colors"in ea.inspectOpts?!!ea.inspectOpts.colors:cAt.isatty(process.stderr.fd)}function dAt(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 Btt=Object.create;var PL=Object.defineProperty;var wtt=Object.getOwnPropertyDescriptor;var Ott=Object.getOwnPropertyNames;var ktt=Object.getPrototypeOf,Ptt=Object.prototype.hasOwnProperty;var Ue=(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 w=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var M=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Zs=(e,t)=>{for(var n in t)PL(e,n,{get:t[n],enumerable:!0})},sAe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ott(t))!Ptt.call(e,o)&&o!==n&&PL(e,o,{get:()=>t[o],enumerable:!(r=wtt(t,o))||r.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?Btt(ktt(e)):{},sAe(t||!e||!e.__esModule?PL(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>sAe(PL({},"__esModule",{value:!0}),e);var m=w(()=>{(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.195"}}catch{}})()});var Ig,g5=w(()=>{m();Ig="1.9.1"});function Mtt(e){let t=new Set([e]),n=new Set,r=e.match(cAe);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(u){return n.add(u),!1}function s(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(cAe);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 cAe,lAe,dAe=w(()=>{m();g5();cAe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;lAe=Mtt(Ig)});function vm(e,t,n,r=!1){var o;let i=sB[iB]=(o=sB[iB])!==null&&o!==void 0?o:{version:Ig};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!==Ig){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Ig}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Ig}.`),!0}function Ul(e){var t,n;let r=(t=sB[iB])===null||t===void 0?void 0:t.version;if(!(!r||!lAe(r)))return(n=sB[iB])===null||n===void 0?void 0:n[e]}function Rm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Ig}.`);let n=sB[iB];n&&delete n[e]}var Ltt,iB,sB,uS=w(()=>{m();g5();dAe();Ltt=Ig.split(".")[0],iB=Symbol.for(`opentelemetry.js.api.${Ltt}`),sB=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function aB(e,t,n){let r=Ul("diag");if(r)return r[e](t,...n)}var ML,pAe=w(()=>{m();uS();ML=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 Cs,LL=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Cs||(Cs={}))});function fAe(e,t){e<Cs.NONE?e=Cs.NONE:e>Cs.ALL&&(e=Cs.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",Cs.ERROR),warn:n("warn",Cs.WARN),info:n("info",Cs.INFO),debug:n("debug",Cs.DEBUG),verbose:n("verbose",Cs.VERBOSE)}}var mAe=w(()=>{m();LL()});var Utt,Ws,cS=w(()=>{m();pAe();mAe();LL();uS();Utt="diag",Ws=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=Ul("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:Cs.INFO})=>{var s,u,l;if(o===n){let _=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=_.stack)!==null&&s!==void 0?s:_.message),!1}typeof i=="number"&&(i={logLevel:i});let f=Ul("diag"),h=fAe((u=i.logLevel)!==null&&u!==void 0?u:Cs.INFO,o);if(f&&!i.suppressOverrideMessage){let _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${_}`),h.warn(`Current logger will overwrite one already registered from ${_}`)}return vm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Rm(Utt,n)},n.createComponentLogger=o=>new ML(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var UL,AAe=w(()=>{m();UL=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 gAe,hAe=w(()=>{m();gAe=Symbol("BaggageEntryMetadata")});function _Ae(e={}){return new UL(new Map(Object.entries(e)))}function EAe(e){return typeof e!="string"&&(Qtt.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:gAe,toString(){return e}}}var Qtt,h5=w(()=>{m();cS();AAe();hAe();Qtt=Ws.instance()});function Ql(e){return Symbol.for(e)}var _5,BC,uB=w(()=>{m();_5=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}}},BC=new _5});var E5,y5,QL,yAe=w(()=>{m();E5=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],y5={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(y5[t]=console[t])}QL=class{constructor(){function t(n){return function(...r){let o=y5[n];if(typeof o!="function"&&(o=y5.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<E5.length;n++)this[E5[n].n]=t(E5[n].c)}}});function SAe(){return D5}var S5,wC,T5,b5,I5,C5,cB,v5,R5,x5,D5,Ftt,Gtt,jtt,ztt,Htt,$tt,qtt,N5=w(()=>{m();S5=class{constructor(){}createGauge(t,n){return Gtt}createHistogram(t,n){return jtt}createCounter(t,n){return Ftt}createUpDownCounter(t,n){return ztt}createObservableGauge(t,n){return $tt}createObservableCounter(t,n){return Htt}createObservableUpDownCounter(t,n){return qtt}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},wC=class{},T5=class extends wC{add(t,n){}},b5=class extends wC{add(t,n){}},I5=class extends wC{record(t,n){}},C5=class extends wC{record(t,n){}},cB=class{addCallback(t){}removeCallback(t){}},v5=class extends cB{},R5=class extends cB{},x5=class extends cB{},D5=new S5,Ftt=new T5,Gtt=new I5,jtt=new C5,ztt=new b5,Htt=new v5,$tt=new R5,qtt=new x5});var FL,TAe=w(()=>{m();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(FL||(FL={}))});var GL,jL,B5=w(()=>{m();GL={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},jL={set(e,t,n){e!=null&&(e[t]=n)}}});var zL,bAe=w(()=>{m();uB();zL=class{active(){return BC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var w5,Vtt,xm,lB=w(()=>{m();bAe();uS();cS();w5="context",Vtt=new zL,xm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return vm(w5,t,Ws.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 Ul(w5)||Vtt}disable(){this._getContextManager().disable(),Rm(w5,Ws.instance())}}});var ou,O5=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ou||(ou={}))});var dB,lS,HL,$L=w(()=>{m();O5();dB="0000000000000000",lS="00000000000000000000000000000000",HL={traceId:lS,spanId:dB,traceFlags:ou.NONE}});var Dm,qL=w(()=>{m();$L();Dm=class{constructor(t=HL){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 VL(e){return e.getValue(k5)||void 0}function IAe(){return VL(xm.getInstance().active())}function pB(e,t){return e.setValue(k5,t)}function CAe(e){return e.deleteValue(k5)}function vAe(e,t){return pB(e,new Dm(t))}function YL(e){var t;return(t=VL(e))===null||t===void 0?void 0:t.spanContext()}var k5,P5=w(()=>{m();uB();qL();lB();k5=Ql("OpenTelemetry Context Key SPAN")});function RAe(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(KL[e.charCodeAt(r)]|0)+(KL[e.charCodeAt(r+1)]|0)+(KL[e.charCodeAt(r+2)]|0)+(KL[e.charCodeAt(r+3)]|0);return n===t}function M5(e){return RAe(e,32)&&e!==lS}function L5(e){return RAe(e,16)&&e!==dB}function Cg(e){return M5(e.traceId)&&L5(e.spanId)}function xAe(e){return new Dm(e)}var KL,JL=w(()=>{m();$L();qL();KL=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 Ytt(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 U5,OC,Q5=w(()=>{m();lB();P5();qL();JL();U5=xm.getInstance(),OC=class{startSpan(t,n,r=U5.active()){if(!!n?.root)return new Dm;let i=r&&YL(r);return Ytt(i)&&Cg(i)?new Dm(i):new Dm}startActiveSpan(t,n,r,o){let i,s,u;if(arguments.length<2)return;arguments.length===2?u=n:arguments.length===3?(i=n,u=r):(i=n,s=r,u=o);let l=s??U5.active(),f=this.startSpan(t,i,l),h=pB(l,f);return U5.with(h,u,void 0,f)}}});var Ktt,kC,F5=w(()=>{m();Q5();Ktt=new OC,kC=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):Ktt}}});var ZL,DAe=w(()=>{m();Q5();ZL=class{getTracer(t,n,r){return new OC}}});var Jtt,dS,G5=w(()=>{m();F5();DAe();Jtt=new ZL,dS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new kC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Jtt}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 WL,NAe=w(()=>{m();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(WL||(WL={}))});var fo,BAe=w(()=>{m();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(fo||(fo={}))});var Ai,wAe=w(()=>{m();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Ai||(Ai={}))});function OAe(e){return Xtt.test(e)}function kAe(e){return ent.test(e)&&!tnt.test(e)}var j5,Ztt,Wtt,Xtt,ent,tnt,PAe=w(()=>{m();j5="[_0-9a-z-*/]",Ztt=`[a-z]${j5}{0,255}`,Wtt=`[a-z0-9]${j5}{0,240}@[a-z]${j5}{0,13}`,Xtt=new RegExp(`^(?:${Ztt}|${Wtt})$`),ent=/^[ -~]{0,255}[!-~]$/,tnt=/,|=/});var MAe,nnt,LAe,UAe,XL,QAe=w(()=>{m();PAe();MAe=32,nnt=512,LAe=",",UAe="=",XL=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+UAe+this.get(n)),t),[]).join(LAe)}_parse(t){t.length>nnt||(this._internalState=t.split(LAe).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(UAe);if(i!==-1){let s=o.slice(0,i),u=o.slice(i+1,r.length);OAe(s)&&kAe(u)&&n.set(s,u)}return n},new Map),this._internalState.size>MAe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,MAe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function FAe(e){return new XL(e)}var GAe=w(()=>{m();QAe()});var We,jAe=w(()=>{m();lB();We=xm.getInstance()});var Fl,zAe=w(()=>{m();cS();Fl=Ws.instance()});var z5,HAe,$Ae=w(()=>{m();N5();z5=class{getMeter(t,n,r){return D5}},HAe=new z5});var H5,eU,qAe=w(()=>{m();$Ae();uS();cS();H5="metrics",eU=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return vm(H5,t,Ws.instance())}getMeterProvider(){return Ul(H5)||HAe}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Rm(H5,Ws.instance())}}});var $5,VAe=w(()=>{m();qAe();$5=eU.getInstance()});var tU,YAe=w(()=>{m();tU=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function V5(e){return e.getValue(q5)||void 0}function KAe(){return V5(xm.getInstance().active())}function JAe(e,t){return e.setValue(q5,t)}function ZAe(e){return e.deleteValue(q5)}var q5,WAe=w(()=>{m();lB();uB();q5=Ql("OpenTelemetry Baggage Key")});var Y5,rnt,nU,XAe=w(()=>{m();uS();YAe();B5();WAe();h5();cS();Y5="propagation",rnt=new tU,nU=class e{constructor(){this.createBaggage=_Ae,this.getBaggage=V5,this.getActiveBaggage=KAe,this.setBaggage=JAe,this.deleteBaggage=ZAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return vm(Y5,t,Ws.instance())}inject(t,n,r=jL){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=GL){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Rm(Y5,Ws.instance())}_getGlobalPropagator(){return Ul(Y5)||rnt}}});var mf,ege=w(()=>{m();XAe();mf=nU.getInstance()});var K5,rU,tge=w(()=>{m();uS();G5();JL();P5();cS();K5="trace",rU=class e{constructor(){this._proxyTracerProvider=new dS,this.wrapSpanContext=xAe,this.isSpanContextValid=Cg,this.deleteSpan=CAe,this.getSpan=VL,this.getActiveSpan=IAe,this.getSpanContext=YL,this.setSpan=pB,this.setSpanContext=vAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=vm(K5,this._proxyTracerProvider,Ws.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return Ul(K5)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Rm(K5,Ws.instance()),this._proxyTracerProvider=new dS}}});var Vt,nge=w(()=>{m();tge();Vt=rU.getInstance()});var tt={};Zs(tt,{DiagConsoleLogger:()=>QL,DiagLogLevel:()=>Cs,INVALID_SPANID:()=>dB,INVALID_SPAN_CONTEXT:()=>HL,INVALID_TRACEID:()=>lS,ProxyTracer:()=>kC,ProxyTracerProvider:()=>dS,ROOT_CONTEXT:()=>BC,SamplingDecision:()=>WL,SpanKind:()=>fo,SpanStatusCode:()=>Ai,TraceFlags:()=>ou,ValueType:()=>FL,baggageEntryMetadataFromString:()=>EAe,context:()=>We,createContextKey:()=>Ql,createNoopMeter:()=>SAe,createTraceState:()=>FAe,default:()=>ont,defaultTextMapGetter:()=>GL,defaultTextMapSetter:()=>jL,diag:()=>Fl,isSpanContextValid:()=>Cg,isValidSpanId:()=>L5,isValidTraceId:()=>M5,metrics:()=>$5,propagation:()=>mf,trace:()=>Vt});var ont,He=w(()=>{m();h5();uB();yAe();LL();N5();TAe();B5();F5();G5();NAe();BAe();wAe();O5();GAe();JL();$L();jAe();zAe();VAe();ege();nge();ont={context:We,diag:Fl,metrics:$5,propagation:mf,trace:Vt}});var fB=M(R_=>{"use strict";m();Object.defineProperty(R_,"__esModule",{value:!0});R_.isTracingSuppressed=R_.unsuppressTracing=R_.suppressTracing=void 0;var int=(He(),Me(tt)),J5=(0,int.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function snt(e){return e.setValue(J5,!0)}R_.suppressTracing=snt;function ant(e){return e.deleteValue(J5)}R_.unsuppressTracing=ant;function unt(e){return e.getValue(J5)===!0}R_.isTracingSuppressed=unt});var Z5=M(iu=>{"use strict";m();Object.defineProperty(iu,"__esModule",{value:!0});iu.BAGGAGE_MAX_TOTAL_LENGTH=iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=iu.BAGGAGE_HEADER=iu.BAGGAGE_ITEMS_SEPARATOR=iu.BAGGAGE_PROPERTIES_SEPARATOR=iu.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;iu.BAGGAGE_KEY_PAIR_SEPARATOR="=";iu.BAGGAGE_PROPERTIES_SEPARATOR=";";iu.BAGGAGE_ITEMS_SEPARATOR=",";iu.BAGGAGE_HEADER="baggage";iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;iu.BAGGAGE_MAX_TOTAL_LENGTH=8192});var X5=M(qd=>{"use strict";m();Object.defineProperty(qd,"__esModule",{value:!0});qd.parseKeyPairsIntoRecord=qd.parseBaggageHeaderString=qd.parsePairKeyValue=qd.getKeyPairs=qd.serializeKeyPairs=void 0;var cnt=(He(),Me(tt)),Nm=Z5();function lnt(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?Nm.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Nm.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}qd.serializeKeyPairs=lnt;function dnt(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Nm.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}qd.getKeyPairs=dnt;function W5(e){if(!e)return;let t=e.indexOf(Nm.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(Nm.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,u;try{s=decodeURIComponent(o),u=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,cnt.baggageEntryMetadataFromString)(f)}return{key:s,value:u,metadata:l}}qd.parsePairKeyValue=W5;function pnt(e,t,n,r){let o=0;for(;o<e.length&&n<Nm.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(Nm.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,u=s-o;if(u<=Nm.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=W5(e.substring(o,s));if(l){let f=(n===0?0:1)+u;if(r+f>Nm.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]}qd.parseBaggageHeaderString=pnt;function fnt(e){let t={};return typeof e=="string"&&e.length>0&&e.split(Nm.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=W5(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}qd.parseKeyPairsIntoRecord=fnt});var rge=M(iU=>{"use strict";m();Object.defineProperty(iU,"__esModule",{value:!0});iU.W3CBaggagePropagator=void 0;var eV=(He(),Me(tt)),mnt=fB(),mB=Z5(),oU=X5(),tV=class{inject(t,n,r){let o=eV.propagation.getBaggage(t);if(!o||(0,mnt.isTracingSuppressed)(t))return;let i=(0,oU.getKeyPairs)(o).filter(u=>u.length<=mB.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,mB.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,oU.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,u=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,u]=(0,oU.parseBaggageHeaderString)(o[l],i,s,u);else[s]=(0,oU.parseBaggageHeaderString)(o,i,s,u);return s===0?t:eV.propagation.setBaggage(t,eV.propagation.createBaggage(i))}fields(){return[mB.BAGGAGE_HEADER]}};iU.W3CBaggagePropagator=tV});var oge=M(sU=>{"use strict";m();Object.defineProperty(sU,"__esModule",{value:!0});sU.AnchoredClock=void 0;var nV=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}};sU.AnchoredClock=nV});var cge=M(x_=>{"use strict";m();Object.defineProperty(x_,"__esModule",{value:!0});x_.isAttributeValue=x_.isAttributeKey=x_.sanitizeAttributes=void 0;var ige=(He(),Me(tt));function Ant(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(!sge(n)){ige.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!age(r)){ige.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}x_.sanitizeAttributes=Ant;function sge(e){return typeof e=="string"&&e!==""}x_.isAttributeKey=sge;function age(e){return e==null?!0:Array.isArray(e)?gnt(e):uge(typeof e)}x_.isAttributeValue=age;function gnt(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(uge(r)){t=r;continue}return!1}return!1}}return!0}function uge(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var rV=M(aU=>{"use strict";m();Object.defineProperty(aU,"__esModule",{value:!0});aU.loggingErrorHandler=void 0;var hnt=(He(),Me(tt));function _nt(){return e=>{hnt.diag.error(Ent(e))}}aU.loggingErrorHandler=_nt;function Ent(e){return typeof e=="string"?e:JSON.stringify(ynt(e))}function ynt(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 dge=M(PC=>{"use strict";m();Object.defineProperty(PC,"__esModule",{value:!0});PC.globalErrorHandler=PC.setGlobalErrorHandler=void 0;var Snt=rV(),lge=(0,Snt.loggingErrorHandler)();function Tnt(e){lge=e}PC.setGlobalErrorHandler=Tnt;function bnt(e){try{lge(e)}catch{}}PC.globalErrorHandler=bnt});var Age=M(Bm=>{"use strict";m();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.getStringListFromEnv=Bm.getBooleanFromEnv=Bm.getStringFromEnv=Bm.getNumberFromEnv=void 0;var pge=(He(),Me(tt)),fge=Ue("util");function Int(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){pge.diag.warn(`Unknown value ${(0,fge.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}Bm.getNumberFromEnv=Int;function mge(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}Bm.getStringFromEnv=mge;function Cnt(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||pge.diag.warn(`Unknown value ${(0,fge.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Bm.getBooleanFromEnv=Cnt;function vnt(e){return mge(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}Bm.getStringListFromEnv=vnt});var gge=M(uU=>{"use strict";m();Object.defineProperty(uU,"__esModule",{value:!0});uU._globalThis=void 0;uU._globalThis=globalThis});var hge=M(cU=>{"use strict";m();Object.defineProperty(cU,"__esModule",{value:!0});cU.VERSION=void 0;cU.VERSION="2.8.0"});function Oi(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 oV=w(()=>{m()});var _ge,Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,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,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e,Rnt,iV,xnt,Dnt,Nnt,Bnt,sV,wnt,Ont,knt,Pnt,Mnt,Lnt,Unt,Qnt,Fnt,Gnt,jnt,znt,Hnt,$nt,qnt,Vnt,Ynt,Knt,aV,Jnt,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,srt,art,uV,urt,crt,cV,lV,lrt,drt,prt,frt,mrt,Art,grt,hrt,_rt,Ert,yrt,Srt,Trt,brt,Irt,Crt,vrt,AB,MC,dV,Rrt,xrt,pS,Drt,Nrt,Brt,wrt,pV,fV,Ort,mV,krt,Prt,Mrt,Lrt,Urt,Qrt,Frt,Grt,jrt,zrt,Hrt,$rt,qrt,Vrt,Yrt,Krt,Jrt,Zrt,Wrt,Xrt,eot,tot,not,AV,rot,oot,iot,sot,aot,uot,cot,lot,dot,pot,fot,mot,Aot,got,hot,_ot,Eot,yot,Sot,gV,Tot,hV,bot,Iot,Cot,vot,Rot,xot,Dot,Not,Bot,U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,wot,Oot,kot,Pot,Mot,Lot,Uot,Qot,Fot,Got,jot,zot,Hot,$ot,qot,Vot,Yot,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,rit,oit,iit,sit,ait,uit,cit,lit,dit,pit,fit,mit,Ait,git,hit,_it,Eit,yit,Sit,Tit,bit,Iit,Cit,BEe,wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,vit,Rit,xit,Dit,Nit,Bit,wit,Oit,kit,Pit,Mit,Lit,jEe,zEe,HEe,$Ee,qEe,Uit,Qit,Fit,Git,jit,zit,VEe,YEe,KEe,Hit,$it,qit,Vit,JEe,ZEe,WEe,XEe,Yit,Kit,Jit,Zit,Wit,e0e,t0e,n0e,r0e,o0e,i0e,s0e,Xit,est,tst,nst,rst,ost,ist,sst,a0e,u0e,c0e,l0e,d0e,ast,ust,cst,lst,dst,pst,p0e,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e,fst,mst,Ast,gst,hst,_st,Est,yst,Sst,Tst,bst,Ist,Cst,vst,Rst,xst,Dst,Nst,Bst,wst,Ost,kst,O0e,k0e,P0e,M0e,L0e,Pst,Mst,Lst,Ust,Qst,Fst,U0e,Q0e,Gst,jst,zst,F0e,G0e,Hst,$st,qst,j0e,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eye,tye,nye,rye,oye,Vst,Yst,Kst,Jst,Zst,Wst,Xst,eat,tat,nat,rat,oat,iat,sat,aat,uat,cat,lat,iye,sye,dat,pat,fat,aye=w(()=>{m();oV();_ge="aws.lambda.invoked_arn",Ege="db.system",yge="db.connection_string",Sge="db.user",Tge="db.jdbc.driver_classname",bge="db.name",Ige="db.statement",Cge="db.operation",vge="db.mssql.instance_name",Rge="db.cassandra.keyspace",xge="db.cassandra.page_size",Dge="db.cassandra.consistency_level",Nge="db.cassandra.table",Bge="db.cassandra.idempotence",wge="db.cassandra.speculative_execution_count",Oge="db.cassandra.coordinator.id",kge="db.cassandra.coordinator.dc",Pge="db.hbase.namespace",Mge="db.redis.database_index",Lge="db.mongodb.collection",Uge="db.sql.table",Qge="exception.type",Fge="exception.message",Gge="exception.stacktrace",jge="exception.escaped",zge="faas.trigger",Hge="faas.execution",$ge="faas.document.collection",qge="faas.document.operation",Vge="faas.document.time",Yge="faas.document.name",Kge="faas.time",Jge="faas.cron",Zge="faas.coldstart",Wge="faas.invoked_name",Xge="faas.invoked_provider",ehe="faas.invoked_region",the="net.transport",nhe="net.peer.ip",rhe="net.peer.port",ohe="net.peer.name",ihe="net.host.ip",she="net.host.port",ahe="net.host.name",uhe="net.host.connection.type",che="net.host.connection.subtype",lhe="net.host.carrier.name",dhe="net.host.carrier.mcc",phe="net.host.carrier.mnc",fhe="net.host.carrier.icc",mhe="peer.service",Ahe="enduser.id",ghe="enduser.role",hhe="enduser.scope",_he="thread.id",Ehe="thread.name",yhe="code.function",She="code.namespace",The="code.filepath",bhe="code.lineno",Ihe="http.method",Che="http.url",vhe="http.target",Rhe="http.host",xhe="http.scheme",Dhe="http.status_code",Nhe="http.flavor",Bhe="http.user_agent",whe="http.request_content_length",Ohe="http.request_content_length_uncompressed",khe="http.response_content_length",Phe="http.response_content_length_uncompressed",Mhe="http.server_name",Lhe="http.route",Uhe="http.client_ip",Qhe="aws.dynamodb.table_names",Fhe="aws.dynamodb.consumed_capacity",Ghe="aws.dynamodb.item_collection_metrics",jhe="aws.dynamodb.provisioned_read_capacity",zhe="aws.dynamodb.provisioned_write_capacity",Hhe="aws.dynamodb.consistent_read",$he="aws.dynamodb.projection",qhe="aws.dynamodb.limit",Vhe="aws.dynamodb.attributes_to_get",Yhe="aws.dynamodb.index_name",Khe="aws.dynamodb.select",Jhe="aws.dynamodb.global_secondary_indexes",Zhe="aws.dynamodb.local_secondary_indexes",Whe="aws.dynamodb.exclusive_start_table",Xhe="aws.dynamodb.table_count",e_e="aws.dynamodb.scan_forward",t_e="aws.dynamodb.segment",n_e="aws.dynamodb.total_segments",r_e="aws.dynamodb.count",o_e="aws.dynamodb.scanned_count",i_e="aws.dynamodb.attribute_definitions",s_e="aws.dynamodb.global_secondary_index_updates",a_e="messaging.system",u_e="messaging.destination",c_e="messaging.destination_kind",l_e="messaging.temp_destination",d_e="messaging.protocol",p_e="messaging.protocol_version",f_e="messaging.url",m_e="messaging.message_id",A_e="messaging.conversation_id",g_e="messaging.message_payload_size_bytes",h_e="messaging.message_payload_compressed_size_bytes",__e="messaging.operation",E_e="messaging.consumer_id",y_e="messaging.rabbitmq.routing_key",S_e="messaging.kafka.message_key",T_e="messaging.kafka.consumer_group",b_e="messaging.kafka.client_id",I_e="messaging.kafka.partition",C_e="messaging.kafka.tombstone",v_e="rpc.system",R_e="rpc.service",x_e="rpc.method",D_e="rpc.grpc.status_code",N_e="rpc.jsonrpc.version",B_e="rpc.jsonrpc.request_id",w_e="rpc.jsonrpc.error_code",O_e="rpc.jsonrpc.error_message",k_e="message.type",P_e="message.id",M_e="message.compressed_size",L_e="message.uncompressed_size",Rnt=_ge,iV=Ege,xnt=yge,Dnt=Sge,Nnt=Tge,Bnt=bge,sV=Ige,wnt=Cge,Ont=vge,knt=Rge,Pnt=xge,Mnt=Dge,Lnt=Nge,Unt=Bge,Qnt=wge,Fnt=Oge,Gnt=kge,jnt=Pge,znt=Mge,Hnt=Lge,$nt=Uge,qnt=Qge,Vnt=Fge,Ynt=Gge,Knt=jge,aV=zge,Jnt=Hge,Znt=$ge,Wnt=qge,Xnt=Vge,ert=Yge,trt=Kge,nrt=Jge,rrt=Zge,ort=Wge,irt=Xge,srt=ehe,art=the,uV=nhe,urt=rhe,crt=ohe,cV=ihe,lV=she,lrt=ahe,drt=uhe,prt=che,frt=lhe,mrt=dhe,Art=phe,grt=fhe,hrt=mhe,_rt=Ahe,Ert=ghe,yrt=hhe,Srt=_he,Trt=Ehe,brt=yhe,Irt=She,Crt=The,vrt=bhe,AB=Ihe,MC=Che,dV=vhe,Rrt=Rhe,xrt=xhe,pS=Dhe,Drt=Nhe,Nrt=Bhe,Brt=whe,wrt=Ohe,pV=khe,fV=Phe,Ort=Mhe,mV=Lhe,krt=Uhe,Prt=Qhe,Mrt=Fhe,Lrt=Ghe,Urt=jhe,Qrt=zhe,Frt=Hhe,Grt=$he,jrt=qhe,zrt=Vhe,Hrt=Yhe,$rt=Khe,qrt=Jhe,Vrt=Zhe,Yrt=Whe,Krt=Xhe,Jrt=e_e,Zrt=t_e,Wrt=n_e,Xrt=r_e,eot=o_e,tot=i_e,not=s_e,AV=a_e,rot=u_e,oot=c_e,iot=l_e,sot=d_e,aot=p_e,uot=f_e,cot=m_e,lot=A_e,dot=g_e,pot=h_e,fot=__e,mot=E_e,Aot=y_e,got=S_e,hot=T_e,_ot=b_e,Eot=I_e,yot=C_e,Sot=v_e,gV=R_e,Tot=x_e,hV=D_e,bot=N_e,Iot=B_e,Cot=w_e,vot=O_e,Rot=k_e,xot=P_e,Dot=M_e,Not=L_e,Bot=Oi([_ge,Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,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,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e]),U_e="other_sql",Q_e="mssql",F_e="mysql",G_e="oracle",j_e="db2",z_e="postgresql",H_e="redshift",$_e="hive",q_e="cloudscape",V_e="hsqldb",Y_e="progress",K_e="maxdb",J_e="hanadb",Z_e="ingres",W_e="firstsql",X_e="edb",eEe="cache",tEe="adabas",nEe="firebird",rEe="derby",oEe="filemaker",iEe="informix",sEe="instantdb",aEe="interbase",uEe="mariadb",cEe="netezza",lEe="pervasive",dEe="pointbase",pEe="sqlite",fEe="sybase",mEe="teradata",AEe="vertica",gEe="h2",hEe="coldfusion",_Ee="cassandra",EEe="hbase",yEe="mongodb",SEe="redis",TEe="couchbase",bEe="couchdb",IEe="cosmosdb",CEe="dynamodb",vEe="neo4j",REe="geode",xEe="elasticsearch",DEe="memcached",NEe="cockroachdb",wot=U_e,Oot=Q_e,kot=F_e,Pot=G_e,Mot=j_e,Lot=z_e,Uot=H_e,Qot=$_e,Fot=q_e,Got=V_e,jot=Y_e,zot=K_e,Hot=J_e,$ot=Z_e,qot=W_e,Vot=X_e,Yot=eEe,Kot=tEe,Jot=nEe,Zot=rEe,Wot=oEe,Xot=iEe,eit=sEe,tit=aEe,nit=uEe,rit=cEe,oit=lEe,iit=dEe,sit=pEe,ait=fEe,uit=mEe,cit=AEe,lit=gEe,dit=hEe,pit=_Ee,fit=EEe,mit=yEe,Ait=SEe,git=TEe,hit=bEe,_it=IEe,Eit=CEe,yit=vEe,Sit=REe,Tit=xEe,bit=DEe,Iit=NEe,Cit=Oi([U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe]),BEe="all",wEe="each_quorum",OEe="quorum",kEe="local_quorum",PEe="one",MEe="two",LEe="three",UEe="local_one",QEe="any",FEe="serial",GEe="local_serial",vit=BEe,Rit=wEe,xit=OEe,Dit=kEe,Nit=PEe,Bit=MEe,wit=LEe,Oit=UEe,kit=QEe,Pit=FEe,Mit=GEe,Lit=Oi([BEe,wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe]),jEe="datasource",zEe="http",HEe="pubsub",$Ee="timer",qEe="other",Uit=jEe,Qit=zEe,Fit=HEe,Git=$Ee,jit=qEe,zit=Oi([jEe,zEe,HEe,$Ee,qEe]),VEe="insert",YEe="edit",KEe="delete",Hit=VEe,$it=YEe,qit=KEe,Vit=Oi([VEe,YEe,KEe]),JEe="alibaba_cloud",ZEe="aws",WEe="azure",XEe="gcp",Yit=JEe,Kit=ZEe,Jit=WEe,Zit=XEe,Wit=Oi([JEe,ZEe,WEe,XEe]),e0e="ip_tcp",t0e="ip_udp",n0e="ip",r0e="unix",o0e="pipe",i0e="inproc",s0e="other",Xit=e0e,est=t0e,tst=n0e,nst=r0e,rst=o0e,ost=i0e,ist=s0e,sst=Oi([e0e,t0e,n0e,r0e,o0e,i0e,s0e]),a0e="wifi",u0e="wired",c0e="cell",l0e="unavailable",d0e="unknown",ast=a0e,ust=u0e,cst=c0e,lst=l0e,dst=d0e,pst=Oi([a0e,u0e,c0e,l0e,d0e]),p0e="gprs",f0e="edge",m0e="umts",A0e="cdma",g0e="evdo_0",h0e="evdo_a",_0e="cdma2000_1xrtt",E0e="hsdpa",y0e="hsupa",S0e="hspa",T0e="iden",b0e="evdo_b",I0e="lte",C0e="ehrpd",v0e="hspap",R0e="gsm",x0e="td_scdma",D0e="iwlan",N0e="nr",B0e="nrnsa",w0e="lte_ca",fst=p0e,mst=f0e,Ast=m0e,gst=A0e,hst=g0e,_st=h0e,Est=_0e,yst=E0e,Sst=y0e,Tst=S0e,bst=T0e,Ist=b0e,Cst=I0e,vst=C0e,Rst=v0e,xst=R0e,Dst=x0e,Nst=D0e,Bst=N0e,wst=B0e,Ost=w0e,kst=Oi([p0e,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e]),O0e="1.0",k0e="1.1",P0e="2.0",M0e="SPDY",L0e="QUIC",Pst=O0e,Mst=k0e,Lst=P0e,Ust=M0e,Qst=L0e,Fst={HTTP_1_0:O0e,HTTP_1_1:k0e,HTTP_2_0:P0e,SPDY:M0e,QUIC:L0e},U0e="queue",Q0e="topic",Gst=U0e,jst=Q0e,zst=Oi([U0e,Q0e]),F0e="receive",G0e="process",Hst=F0e,$st=G0e,qst=Oi([F0e,G0e]),j0e=0,z0e=1,H0e=2,$0e=3,q0e=4,V0e=5,Y0e=6,K0e=7,J0e=8,Z0e=9,W0e=10,X0e=11,eye=12,tye=13,nye=14,rye=15,oye=16,Vst=j0e,Yst=z0e,Kst=H0e,Jst=$0e,Zst=q0e,Wst=V0e,Xst=Y0e,eat=K0e,tat=J0e,nat=Z0e,rat=W0e,oat=X0e,iat=eye,sat=tye,aat=nye,uat=rye,cat=oye,lat={OK:j0e,CANCELLED:z0e,UNKNOWN:H0e,INVALID_ARGUMENT:$0e,DEADLINE_EXCEEDED:q0e,NOT_FOUND:V0e,ALREADY_EXISTS:Y0e,PERMISSION_DENIED:K0e,RESOURCE_EXHAUSTED:J0e,FAILED_PRECONDITION:Z0e,ABORTED:W0e,OUT_OF_RANGE:X0e,UNIMPLEMENTED:eye,INTERNAL:tye,UNAVAILABLE:nye,DATA_LOSS:rye,UNAUTHENTICATED:oye},iye="SENT",sye="RECEIVED",dat=iye,pat=sye,fat=Oi([iye,sye])});var uye=w(()=>{m();aye()});var cye,lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe,mat,Aat,gat,hat,_at,Eat,yat,Sat,Tat,bat,Iat,Cat,vat,Rat,xat,Dat,Nat,Bat,wat,Oat,kat,Pat,Mat,Lat,Uat,Qat,Fat,Gat,jat,zat,Hat,$at,qat,Vat,Yat,Kat,Jat,Zat,Wat,Xat,eut,tut,nut,rut,out,iut,sut,aut,uut,cut,lut,dut,put,fut,mut,Aut,gut,hut,_ut,Eut,yut,Sut,Tut,but,Iut,Cut,vut,Rut,xut,Dut,Nut,_V,But,wut,Out,kut,Put,Mut,Lut,Uut,Qut,Fut,MSe,LSe,USe,QSe,Gut,jut,zut,Hut,$ut,FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,qut,Vut,Yut,Kut,Jut,Zut,Wut,Xut,ect,tct,nct,rct,oct,ict,sct,act,uct,cct,rTe,oTe,lct,dct,pct,iTe,sTe,aTe,uTe,cTe,lTe,dTe,fct,mct,Act,gct,hct,_ct,Ect,yct,pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,Sct,Tct,bct,Ict,Cct,vct,Rct,xct,Dct,Nct,Bct,wct,bTe,ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe,Oct,kct,Pct,Mct,Lct,Uct,Qct,Fct,Gct,jct,zct,OTe=w(()=>{m();oV();cye="cloud.provider",lye="cloud.account.id",dye="cloud.region",pye="cloud.availability_zone",fye="cloud.platform",mye="aws.ecs.container.arn",Aye="aws.ecs.cluster.arn",gye="aws.ecs.launchtype",hye="aws.ecs.task.arn",_ye="aws.ecs.task.family",Eye="aws.ecs.task.revision",yye="aws.eks.cluster.arn",Sye="aws.log.group.names",Tye="aws.log.group.arns",bye="aws.log.stream.names",Iye="aws.log.stream.arns",Cye="container.name",vye="container.id",Rye="container.runtime",xye="container.image.name",Dye="container.image.tag",Nye="deployment.environment",Bye="device.id",wye="device.model.identifier",Oye="device.model.name",kye="faas.name",Pye="faas.id",Mye="faas.version",Lye="faas.instance",Uye="faas.max_memory",Qye="host.id",Fye="host.name",Gye="host.type",jye="host.arch",zye="host.image.name",Hye="host.image.id",$ye="host.image.version",qye="k8s.cluster.name",Vye="k8s.node.name",Yye="k8s.node.uid",Kye="k8s.namespace.name",Jye="k8s.pod.uid",Zye="k8s.pod.name",Wye="k8s.container.name",Xye="k8s.replicaset.uid",eSe="k8s.replicaset.name",tSe="k8s.deployment.uid",nSe="k8s.deployment.name",rSe="k8s.statefulset.uid",oSe="k8s.statefulset.name",iSe="k8s.daemonset.uid",sSe="k8s.daemonset.name",aSe="k8s.job.uid",uSe="k8s.job.name",cSe="k8s.cronjob.uid",lSe="k8s.cronjob.name",dSe="os.type",pSe="os.description",fSe="os.name",mSe="os.version",ASe="process.pid",gSe="process.executable.name",hSe="process.executable.path",_Se="process.command",ESe="process.command_line",ySe="process.command_args",SSe="process.owner",TSe="process.runtime.name",bSe="process.runtime.version",ISe="process.runtime.description",CSe="service.name",vSe="service.namespace",RSe="service.instance.id",xSe="service.version",DSe="telemetry.sdk.name",NSe="telemetry.sdk.language",BSe="telemetry.sdk.version",wSe="telemetry.auto.version",OSe="webengine.name",kSe="webengine.version",PSe="webengine.description",mat=cye,Aat=lye,gat=dye,hat=pye,_at=fye,Eat=mye,yat=Aye,Sat=gye,Tat=hye,bat=_ye,Iat=Eye,Cat=yye,vat=Sye,Rat=Tye,xat=bye,Dat=Iye,Nat=Cye,Bat=vye,wat=Rye,Oat=xye,kat=Dye,Pat=Nye,Mat=Bye,Lat=wye,Uat=Oye,Qat=kye,Fat=Pye,Gat=Mye,jat=Lye,zat=Uye,Hat=Qye,$at=Fye,qat=Gye,Vat=jye,Yat=zye,Kat=Hye,Jat=$ye,Zat=qye,Wat=Vye,Xat=Yye,eut=Kye,tut=Jye,nut=Zye,rut=Wye,out=Xye,iut=eSe,sut=tSe,aut=nSe,uut=rSe,cut=oSe,lut=iSe,dut=sSe,put=aSe,fut=uSe,mut=cSe,Aut=lSe,gut=dSe,hut=pSe,_ut=fSe,Eut=mSe,yut=ASe,Sut=gSe,Tut=hSe,but=_Se,Iut=ESe,Cut=ySe,vut=SSe,Rut=TSe,xut=bSe,Dut=ISe,Nut=CSe,_V=vSe,But=RSe,wut=xSe,Out=DSe,kut=NSe,Put=BSe,Mut=wSe,Lut=OSe,Uut=kSe,Qut=PSe,Fut=Oi([cye,lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe]),MSe="alibaba_cloud",LSe="aws",USe="azure",QSe="gcp",Gut=MSe,jut=LSe,zut=USe,Hut=QSe,$ut=Oi([MSe,LSe,USe,QSe]),FSe="alibaba_cloud_ecs",GSe="alibaba_cloud_fc",jSe="aws_ec2",zSe="aws_ecs",HSe="aws_eks",$Se="aws_lambda",qSe="aws_elastic_beanstalk",VSe="azure_vm",YSe="azure_container_instances",KSe="azure_aks",JSe="azure_functions",ZSe="azure_app_service",WSe="gcp_compute_engine",XSe="gcp_cloud_run",eTe="gcp_kubernetes_engine",tTe="gcp_cloud_functions",nTe="gcp_app_engine",qut=FSe,Vut=GSe,Yut=jSe,Kut=zSe,Jut=HSe,Zut=$Se,Wut=qSe,Xut=VSe,ect=YSe,tct=KSe,nct=JSe,rct=ZSe,oct=WSe,ict=XSe,sct=eTe,act=tTe,uct=nTe,cct=Oi([FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe]),rTe="ec2",oTe="fargate",lct=rTe,dct=oTe,pct=Oi([rTe,oTe]),iTe="amd64",sTe="arm32",aTe="arm64",uTe="ia64",cTe="ppc32",lTe="ppc64",dTe="x86",fct=iTe,mct=sTe,Act=aTe,gct=uTe,hct=cTe,_ct=lTe,Ect=dTe,yct=Oi([iTe,sTe,aTe,uTe,cTe,lTe,dTe]),pTe="windows",fTe="linux",mTe="darwin",ATe="freebsd",gTe="netbsd",hTe="openbsd",_Te="dragonflybsd",ETe="hpux",yTe="aix",STe="solaris",TTe="z_os",Sct=pTe,Tct=fTe,bct=mTe,Ict=ATe,Cct=gTe,vct=hTe,Rct=_Te,xct=ETe,Dct=yTe,Nct=STe,Bct=TTe,wct=Oi([pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe]),bTe="cpp",ITe="dotnet",CTe="erlang",vTe="go",RTe="java",xTe="nodejs",DTe="php",NTe="python",BTe="ruby",wTe="webjs",Oct=bTe,kct=ITe,Pct=CTe,Mct=vTe,Lct=RTe,Uct=xTe,Qct=DTe,Fct=NTe,Gct=BTe,jct=wTe,zct=Oi([bTe,ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe])});var kTe=w(()=>{m();OTe()});var Hct,$ct,qct,Vct,Yct,Kct,Jct,Zct,Wct,Xct,elt,tlt,nlt,rlt,olt,ilt,slt,alt,ult,clt,llt,dlt,plt,flt,mlt,EV,yV,Alt,LC,glt,SV,TV,hlt,fS,_lt,Elt,ylt,Slt,Tlt,blt,Ilt,Clt,msn,Asn,bV,vlt,Rlt,xlt,Dlt,Nlt,Blt,mS,wlt,Olt,klt,gsn,Plt,Mlt,Llt,Ult,hsn,Qlt,Flt,Glt,jlt,vg,Rg,zlt,Hlt,$lt,qlt,Vlt,Ylt,Klt,Jlt,Zlt,_sn,Wlt,Xlt,edt,tdt,ndt,rdt,IV,CV,odt,vV,RV,idt,sdt,Esn,ysn,adt,udt,cdt,ldt,ddt,pdt,fdt,mdt,Ssn,Adt,xV,DV,gdt,NV,hdt,BV,_dt,Edt,ydt,Sdt,Tdt,bdt,Idt,Cdt,vdt,Tsn,Rdt,xdt,bsn,Ddt,Ndt,Isn,Bdt,wdt,Odt,kdt,Pdt,Mdt,Ldt,Udt,D_,Qdt,Fdt,Gdt,wV,PTe=w(()=>{m();Hct="aspnetcore.diagnostics.exception.result",$ct="aborted",qct="handled",Vct="skipped",Yct="unhandled",Kct="aspnetcore.diagnostics.handler.type",Jct="aspnetcore.rate_limiting.policy",Zct="aspnetcore.rate_limiting.result",Wct="acquired",Xct="endpoint_limiter",elt="global_limiter",tlt="request_canceled",nlt="aspnetcore.request.is_unhandled",rlt="aspnetcore.routing.is_fallback",olt="aspnetcore.routing.match_status",ilt="failure",slt="success",alt="aspnetcore.user.is_authenticated",ult="client.address",clt="client.port",llt="code.column.number",dlt="code.file.path",plt="code.function.name",flt="code.line.number",mlt="code.stacktrace",EV="db.collection.name",yV="db.namespace",Alt="db.operation.batch.size",LC="db.operation.name",glt="db.query.summary",SV="db.query.text",TV="db.response.status_code",hlt="db.stored_procedure.name",fS="db.system.name",_lt="mariadb",Elt="microsoft.sql_server",ylt="mysql",Slt="postgresql",Tlt="dotnet.gc.heap.generation",blt="gen0",Ilt="gen1",Clt="gen2",msn="loh",Asn="poh",bV="error.type",vlt="_OTHER",Rlt="exception.escaped",xlt="exception.message",Dlt="exception.stacktrace",Nlt="exception.type",Blt=e=>`http.request.header.${e}`,mS="http.request.method",wlt="_OTHER",Olt="CONNECT",klt="DELETE",gsn="GET",Plt="HEAD",Mlt="OPTIONS",Llt="PATCH",Ult="POST",hsn="PUT",Qlt="TRACE",Flt="http.request.method_original",Glt="http.request.resend_count",jlt=e=>`http.response.header.${e}`,vg="http.response.status_code",Rg="http.route",zlt="jvm.gc.action",Hlt="jvm.gc.name",$lt="jvm.memory.pool.name",qlt="jvm.memory.type",Vlt="heap",Ylt="non_heap",Klt="jvm.thread.daemon",Jlt="jvm.thread.state",Zlt="blocked",_sn="new",Wlt="runnable",Xlt="terminated",edt="timed_waiting",tdt="waiting",ndt="network.local.address",rdt="network.local.port",IV="network.peer.address",CV="network.peer.port",odt="network.protocol.name",vV="network.protocol.version",RV="network.transport",idt="pipe",sdt="quic",Esn="tcp",ysn="udp",adt="unix",udt="network.type",cdt="ipv4",ldt="ipv6",ddt="otel.scope.name",pdt="otel.scope.version",fdt="otel.status_code",mdt="ERROR",Ssn="OK",Adt="otel.status_description",xV="server.address",DV="server.port",gdt="service.instance.id",NV="service.name",hdt="service.namespace",BV="service.version",_dt="signalr.connection.status",Edt="app_shutdown",ydt="normal_closure",Sdt="timeout",Tdt="signalr.transport",bdt="long_polling",Idt="server_sent_events",Cdt="web_sockets",vdt="telemetry.sdk.language",Tsn="cpp",Rdt="dotnet",xdt="erlang",bsn="go",Ddt="java",Ndt="nodejs",Isn="php",Bdt="python",wdt="ruby",Odt="rust",kdt="swift",Pdt="webjs",Mdt="telemetry.sdk.name",Ldt="telemetry.sdk.version",Udt="url.fragment",D_="url.full",Qdt="url.path",Fdt="url.query",Gdt="url.scheme",wV="user_agent.original"});var jdt,zdt,Hdt,$dt,qdt,Vdt,Ydt,Kdt,Jdt,Zdt,Wdt,Xdt,ept,tpt,npt,rpt,opt,ipt,spt,apt,upt,cpt,lpt,dpt,ppt,fpt,mpt,Apt,gpt,hpt,_pt,Ept,ypt,Spt,Tpt,bpt,Ipt,Cpt,vpt,Rpt,xpt,Dpt,Npt,Bpt,wpt,Opt,kpt,Ppt,Mpt,Lpt,Upt,MTe=w(()=>{m();jdt="aspnetcore.diagnostics.exceptions",zdt="aspnetcore.rate_limiting.active_request_leases",Hdt="aspnetcore.rate_limiting.queued_requests",$dt="aspnetcore.rate_limiting.request.time_in_queue",qdt="aspnetcore.rate_limiting.request_lease.duration",Vdt="aspnetcore.rate_limiting.requests",Ydt="aspnetcore.routing.match_attempts",Kdt="db.client.operation.duration",Jdt="dotnet.assembly.count",Zdt="dotnet.exceptions",Wdt="dotnet.gc.collections",Xdt="dotnet.gc.heap.total_allocated",ept="dotnet.gc.last_collection.heap.fragmentation.size",tpt="dotnet.gc.last_collection.heap.size",npt="dotnet.gc.last_collection.memory.committed_size",rpt="dotnet.gc.pause.time",opt="dotnet.jit.compilation.time",ipt="dotnet.jit.compiled_il.size",spt="dotnet.jit.compiled_methods",apt="dotnet.monitor.lock_contentions",upt="dotnet.process.cpu.count",cpt="dotnet.process.cpu.time",lpt="dotnet.process.memory.working_set",dpt="dotnet.thread_pool.queue.length",ppt="dotnet.thread_pool.thread.count",fpt="dotnet.thread_pool.work_item.count",mpt="dotnet.timer.count",Apt="http.client.request.duration",gpt="http.server.request.duration",hpt="jvm.class.count",_pt="jvm.class.loaded",Ept="jvm.class.unloaded",ypt="jvm.cpu.count",Spt="jvm.cpu.recent_utilization",Tpt="jvm.cpu.time",bpt="jvm.gc.duration",Ipt="jvm.memory.committed",Cpt="jvm.memory.limit",vpt="jvm.memory.used",Rpt="jvm.memory.used_after_last_gc",xpt="jvm.thread.count",Dpt="kestrel.active_connections",Npt="kestrel.active_tls_handshakes",Bpt="kestrel.connection.duration",wpt="kestrel.queued_connections",Opt="kestrel.queued_requests",kpt="kestrel.rejected_connections",Ppt="kestrel.tls_handshake.duration",Mpt="kestrel.upgraded_connections",Lpt="signalr.server.active_connections",Upt="signalr.server.connection.duration"});var Qpt,LTe=w(()=>{m();Qpt="exception"});var Hr={};Zs(Hr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>$ct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>qct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Vct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Yct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Wct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Xct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>elt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>tlt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>ilt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>slt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Hct,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Kct,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Jct,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Zct,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>nlt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>rlt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>olt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>alt,ATTR_CLIENT_ADDRESS:()=>ult,ATTR_CLIENT_PORT:()=>clt,ATTR_CODE_COLUMN_NUMBER:()=>llt,ATTR_CODE_FILE_PATH:()=>dlt,ATTR_CODE_FUNCTION_NAME:()=>plt,ATTR_CODE_LINE_NUMBER:()=>flt,ATTR_CODE_STACKTRACE:()=>mlt,ATTR_DB_COLLECTION_NAME:()=>EV,ATTR_DB_NAMESPACE:()=>yV,ATTR_DB_OPERATION_BATCH_SIZE:()=>Alt,ATTR_DB_OPERATION_NAME:()=>LC,ATTR_DB_QUERY_SUMMARY:()=>glt,ATTR_DB_QUERY_TEXT:()=>SV,ATTR_DB_RESPONSE_STATUS_CODE:()=>TV,ATTR_DB_STORED_PROCEDURE_NAME:()=>hlt,ATTR_DB_SYSTEM_NAME:()=>fS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Tlt,ATTR_ERROR_TYPE:()=>bV,ATTR_EXCEPTION_ESCAPED:()=>Rlt,ATTR_EXCEPTION_MESSAGE:()=>xlt,ATTR_EXCEPTION_STACKTRACE:()=>Dlt,ATTR_EXCEPTION_TYPE:()=>Nlt,ATTR_HTTP_REQUEST_HEADER:()=>Blt,ATTR_HTTP_REQUEST_METHOD:()=>mS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Flt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Glt,ATTR_HTTP_RESPONSE_HEADER:()=>jlt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>vg,ATTR_HTTP_ROUTE:()=>Rg,ATTR_JVM_GC_ACTION:()=>zlt,ATTR_JVM_GC_NAME:()=>Hlt,ATTR_JVM_MEMORY_POOL_NAME:()=>$lt,ATTR_JVM_MEMORY_TYPE:()=>qlt,ATTR_JVM_THREAD_DAEMON:()=>Klt,ATTR_JVM_THREAD_STATE:()=>Jlt,ATTR_NETWORK_LOCAL_ADDRESS:()=>ndt,ATTR_NETWORK_LOCAL_PORT:()=>rdt,ATTR_NETWORK_PEER_ADDRESS:()=>IV,ATTR_NETWORK_PEER_PORT:()=>CV,ATTR_NETWORK_PROTOCOL_NAME:()=>odt,ATTR_NETWORK_PROTOCOL_VERSION:()=>vV,ATTR_NETWORK_TRANSPORT:()=>RV,ATTR_NETWORK_TYPE:()=>udt,ATTR_OTEL_SCOPE_NAME:()=>ddt,ATTR_OTEL_SCOPE_VERSION:()=>pdt,ATTR_OTEL_STATUS_CODE:()=>fdt,ATTR_OTEL_STATUS_DESCRIPTION:()=>Adt,ATTR_SERVER_ADDRESS:()=>xV,ATTR_SERVER_PORT:()=>DV,ATTR_SERVICE_INSTANCE_ID:()=>gdt,ATTR_SERVICE_NAME:()=>NV,ATTR_SERVICE_NAMESPACE:()=>hdt,ATTR_SERVICE_VERSION:()=>BV,ATTR_SIGNALR_CONNECTION_STATUS:()=>_dt,ATTR_SIGNALR_TRANSPORT:()=>Tdt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>vdt,ATTR_TELEMETRY_SDK_NAME:()=>Mdt,ATTR_TELEMETRY_SDK_VERSION:()=>Ldt,ATTR_URL_FRAGMENT:()=>Udt,ATTR_URL_FULL:()=>D_,ATTR_URL_PATH:()=>Qdt,ATTR_URL_QUERY:()=>Fdt,ATTR_URL_SCHEME:()=>Gdt,ATTR_USER_AGENT_ORIGINAL:()=>wV,AWSECSLAUNCHTYPEVALUES_EC2:()=>lct,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>dct,AwsEcsLaunchtypeValues:()=>pct,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>qut,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Vut,CLOUDPLATFORMVALUES_AWS_EC2:()=>Yut,CLOUDPLATFORMVALUES_AWS_ECS:()=>Kut,CLOUDPLATFORMVALUES_AWS_EKS:()=>Jut,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Wut,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Zut,CLOUDPLATFORMVALUES_AZURE_AKS:()=>tct,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>rct,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>ect,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>nct,CLOUDPLATFORMVALUES_AZURE_VM:()=>Xut,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>uct,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>act,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>ict,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>oct,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>sct,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Gut,CLOUDPROVIDERVALUES_AWS:()=>jut,CLOUDPROVIDERVALUES_AZURE:()=>zut,CLOUDPROVIDERVALUES_GCP:()=>Hut,CloudPlatformValues:()=>cct,CloudProviderValues:()=>$ut,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>vit,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>kit,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Rit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Oit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Dit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Mit,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Nit,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>xit,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Pit,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>wit,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Bit,DBSYSTEMVALUES_ADABAS:()=>Kot,DBSYSTEMVALUES_CACHE:()=>Yot,DBSYSTEMVALUES_CASSANDRA:()=>pit,DBSYSTEMVALUES_CLOUDSCAPE:()=>Fot,DBSYSTEMVALUES_COCKROACHDB:()=>Iit,DBSYSTEMVALUES_COLDFUSION:()=>dit,DBSYSTEMVALUES_COSMOSDB:()=>_it,DBSYSTEMVALUES_COUCHBASE:()=>git,DBSYSTEMVALUES_COUCHDB:()=>hit,DBSYSTEMVALUES_DB2:()=>Mot,DBSYSTEMVALUES_DERBY:()=>Zot,DBSYSTEMVALUES_DYNAMODB:()=>Eit,DBSYSTEMVALUES_EDB:()=>Vot,DBSYSTEMVALUES_ELASTICSEARCH:()=>Tit,DBSYSTEMVALUES_FILEMAKER:()=>Wot,DBSYSTEMVALUES_FIREBIRD:()=>Jot,DBSYSTEMVALUES_FIRSTSQL:()=>qot,DBSYSTEMVALUES_GEODE:()=>Sit,DBSYSTEMVALUES_H2:()=>lit,DBSYSTEMVALUES_HANADB:()=>Hot,DBSYSTEMVALUES_HBASE:()=>fit,DBSYSTEMVALUES_HIVE:()=>Qot,DBSYSTEMVALUES_HSQLDB:()=>Got,DBSYSTEMVALUES_INFORMIX:()=>Xot,DBSYSTEMVALUES_INGRES:()=>$ot,DBSYSTEMVALUES_INSTANTDB:()=>eit,DBSYSTEMVALUES_INTERBASE:()=>tit,DBSYSTEMVALUES_MARIADB:()=>nit,DBSYSTEMVALUES_MAXDB:()=>zot,DBSYSTEMVALUES_MEMCACHED:()=>bit,DBSYSTEMVALUES_MONGODB:()=>mit,DBSYSTEMVALUES_MSSQL:()=>Oot,DBSYSTEMVALUES_MYSQL:()=>kot,DBSYSTEMVALUES_NEO4J:()=>yit,DBSYSTEMVALUES_NETEZZA:()=>rit,DBSYSTEMVALUES_ORACLE:()=>Pot,DBSYSTEMVALUES_OTHER_SQL:()=>wot,DBSYSTEMVALUES_PERVASIVE:()=>oit,DBSYSTEMVALUES_POINTBASE:()=>iit,DBSYSTEMVALUES_POSTGRESQL:()=>Lot,DBSYSTEMVALUES_PROGRESS:()=>jot,DBSYSTEMVALUES_REDIS:()=>Ait,DBSYSTEMVALUES_REDSHIFT:()=>Uot,DBSYSTEMVALUES_SQLITE:()=>sit,DBSYSTEMVALUES_SYBASE:()=>ait,DBSYSTEMVALUES_TERADATA:()=>uit,DBSYSTEMVALUES_VERTICA:()=>cit,DB_SYSTEM_NAME_VALUE_MARIADB:()=>_lt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Elt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>ylt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Slt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>blt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Ilt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Clt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>msn,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Asn,DbCassandraConsistencyLevelValues:()=>Lit,DbSystemValues:()=>Cit,ERROR_TYPE_VALUE_OTHER:()=>vlt,EVENT_EXCEPTION:()=>Qpt,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>qit,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>$it,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Hit,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Yit,FAASINVOKEDPROVIDERVALUES_AWS:()=>Kit,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Jit,FAASINVOKEDPROVIDERVALUES_GCP:()=>Zit,FAASTRIGGERVALUES_DATASOURCE:()=>Uit,FAASTRIGGERVALUES_HTTP:()=>Qit,FAASTRIGGERVALUES_OTHER:()=>jit,FAASTRIGGERVALUES_PUBSUB:()=>Fit,FAASTRIGGERVALUES_TIMER:()=>Git,FaasDocumentOperationValues:()=>Vit,FaasInvokedProviderValues:()=>Wit,FaasTriggerValues:()=>zit,HOSTARCHVALUES_AMD64:()=>fct,HOSTARCHVALUES_ARM32:()=>mct,HOSTARCHVALUES_ARM64:()=>Act,HOSTARCHVALUES_IA64:()=>gct,HOSTARCHVALUES_PPC32:()=>hct,HOSTARCHVALUES_PPC64:()=>_ct,HOSTARCHVALUES_X86:()=>Ect,HTTPFLAVORVALUES_HTTP_1_0:()=>Pst,HTTPFLAVORVALUES_HTTP_1_1:()=>Mst,HTTPFLAVORVALUES_HTTP_2_0:()=>Lst,HTTPFLAVORVALUES_QUIC:()=>Qst,HTTPFLAVORVALUES_SPDY:()=>Ust,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Olt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>klt,HTTP_REQUEST_METHOD_VALUE_GET:()=>gsn,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Plt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Mlt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>wlt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Llt,HTTP_REQUEST_METHOD_VALUE_POST:()=>Ult,HTTP_REQUEST_METHOD_VALUE_PUT:()=>hsn,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Qlt,HostArchValues:()=>yct,HttpFlavorValues:()=>Fst,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Vlt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Ylt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Zlt,JVM_THREAD_STATE_VALUE_NEW:()=>_sn,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Wlt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Xlt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>edt,JVM_THREAD_STATE_VALUE_WAITING:()=>tdt,MESSAGETYPEVALUES_RECEIVED:()=>pat,MESSAGETYPEVALUES_SENT:()=>dat,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Gst,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>jst,MESSAGINGOPERATIONVALUES_PROCESS:()=>$st,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Hst,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>jdt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>zdt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Hdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Vdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>qdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>$dt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Ydt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Kdt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Jdt,METRIC_DOTNET_EXCEPTIONS:()=>Zdt,METRIC_DOTNET_GC_COLLECTIONS:()=>Wdt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>Xdt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>ept,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>tpt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>npt,METRIC_DOTNET_GC_PAUSE_TIME:()=>rpt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>opt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>ipt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>spt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>apt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>upt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>cpt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>lpt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>dpt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>ppt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>fpt,METRIC_DOTNET_TIMER_COUNT:()=>mpt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Apt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>gpt,METRIC_JVM_CLASS_COUNT:()=>hpt,METRIC_JVM_CLASS_LOADED:()=>_pt,METRIC_JVM_CLASS_UNLOADED:()=>Ept,METRIC_JVM_CPU_COUNT:()=>ypt,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Spt,METRIC_JVM_CPU_TIME:()=>Tpt,METRIC_JVM_GC_DURATION:()=>bpt,METRIC_JVM_MEMORY_COMMITTED:()=>Ipt,METRIC_JVM_MEMORY_LIMIT:()=>Cpt,METRIC_JVM_MEMORY_USED:()=>vpt,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Rpt,METRIC_JVM_THREAD_COUNT:()=>xpt,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Dpt,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Npt,METRIC_KESTREL_CONNECTION_DURATION:()=>Bpt,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>wpt,METRIC_KESTREL_QUEUED_REQUESTS:()=>Opt,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>kpt,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Ppt,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Mpt,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Lpt,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Upt,MessageTypeValues:()=>fat,MessagingDestinationKindValues:()=>zst,MessagingOperationValues:()=>qst,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>gst,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Est,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>mst,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>vst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>hst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>_st,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Ist,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>fst,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>xst,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>yst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Tst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Rst,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Sst,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>bst,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Nst,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Cst,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Ost,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Bst,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>wst,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Dst,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Ast,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>cst,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>lst,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>dst,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>ast,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>ust,NETTRANSPORTVALUES_INPROC:()=>ost,NETTRANSPORTVALUES_IP:()=>tst,NETTRANSPORTVALUES_IP_TCP:()=>Xit,NETTRANSPORTVALUES_IP_UDP:()=>est,NETTRANSPORTVALUES_OTHER:()=>ist,NETTRANSPORTVALUES_PIPE:()=>rst,NETTRANSPORTVALUES_UNIX:()=>nst,NETWORK_TRANSPORT_VALUE_PIPE:()=>idt,NETWORK_TRANSPORT_VALUE_QUIC:()=>sdt,NETWORK_TRANSPORT_VALUE_TCP:()=>Esn,NETWORK_TRANSPORT_VALUE_UDP:()=>ysn,NETWORK_TRANSPORT_VALUE_UNIX:()=>adt,NETWORK_TYPE_VALUE_IPV4:()=>cdt,NETWORK_TYPE_VALUE_IPV6:()=>ldt,NetHostConnectionSubtypeValues:()=>kst,NetHostConnectionTypeValues:()=>pst,NetTransportValues:()=>sst,OSTYPEVALUES_AIX:()=>Dct,OSTYPEVALUES_DARWIN:()=>bct,OSTYPEVALUES_DRAGONFLYBSD:()=>Rct,OSTYPEVALUES_FREEBSD:()=>Ict,OSTYPEVALUES_HPUX:()=>xct,OSTYPEVALUES_LINUX:()=>Tct,OSTYPEVALUES_NETBSD:()=>Cct,OSTYPEVALUES_OPENBSD:()=>vct,OSTYPEVALUES_SOLARIS:()=>Nct,OSTYPEVALUES_WINDOWS:()=>Sct,OSTYPEVALUES_Z_OS:()=>Bct,OTEL_STATUS_CODE_VALUE_ERROR:()=>mdt,OTEL_STATUS_CODE_VALUE_OK:()=>Ssn,OsTypeValues:()=>wct,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>rat,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Xst,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Yst,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>uat,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Zst,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>nat,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>sat,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Jst,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Wst,RPCGRPCSTATUSCODEVALUES_OK:()=>Vst,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>oat,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>eat,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>tat,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>cat,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>aat,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>iat,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Kst,RpcGrpcStatusCodeValues:()=>lat,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>zrt,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>tot,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>Frt,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Mrt,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Xrt,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Yrt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>qrt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>not,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Hrt,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Lrt,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>jrt,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Vrt,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Grt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Urt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Qrt,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>eot,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Jrt,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Zrt,SEMATTRS_AWS_DYNAMODB_SELECT:()=>$rt,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Krt,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Prt,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Wrt,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Rnt,SEMATTRS_CODE_FILEPATH:()=>Crt,SEMATTRS_CODE_FUNCTION:()=>brt,SEMATTRS_CODE_LINENO:()=>vrt,SEMATTRS_CODE_NAMESPACE:()=>Irt,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Mnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Gnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Fnt,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Unt,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>knt,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Pnt,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Qnt,SEMATTRS_DB_CASSANDRA_TABLE:()=>Lnt,SEMATTRS_DB_CONNECTION_STRING:()=>xnt,SEMATTRS_DB_HBASE_NAMESPACE:()=>jnt,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Nnt,SEMATTRS_DB_MONGODB_COLLECTION:()=>Hnt,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Ont,SEMATTRS_DB_NAME:()=>Bnt,SEMATTRS_DB_OPERATION:()=>wnt,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>znt,SEMATTRS_DB_SQL_TABLE:()=>$nt,SEMATTRS_DB_STATEMENT:()=>sV,SEMATTRS_DB_SYSTEM:()=>iV,SEMATTRS_DB_USER:()=>Dnt,SEMATTRS_ENDUSER_ID:()=>_rt,SEMATTRS_ENDUSER_ROLE:()=>Ert,SEMATTRS_ENDUSER_SCOPE:()=>yrt,SEMATTRS_EXCEPTION_ESCAPED:()=>Knt,SEMATTRS_EXCEPTION_MESSAGE:()=>Vnt,SEMATTRS_EXCEPTION_STACKTRACE:()=>Ynt,SEMATTRS_EXCEPTION_TYPE:()=>qnt,SEMATTRS_FAAS_COLDSTART:()=>rrt,SEMATTRS_FAAS_CRON:()=>nrt,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Znt,SEMATTRS_FAAS_DOCUMENT_NAME:()=>ert,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Wnt,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Xnt,SEMATTRS_FAAS_EXECUTION:()=>Jnt,SEMATTRS_FAAS_INVOKED_NAME:()=>ort,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>irt,SEMATTRS_FAAS_INVOKED_REGION:()=>srt,SEMATTRS_FAAS_TIME:()=>trt,SEMATTRS_FAAS_TRIGGER:()=>aV,SEMATTRS_HTTP_CLIENT_IP:()=>krt,SEMATTRS_HTTP_FLAVOR:()=>Drt,SEMATTRS_HTTP_HOST:()=>Rrt,SEMATTRS_HTTP_METHOD:()=>AB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Brt,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>wrt,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>pV,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>fV,SEMATTRS_HTTP_ROUTE:()=>mV,SEMATTRS_HTTP_SCHEME:()=>xrt,SEMATTRS_HTTP_SERVER_NAME:()=>Ort,SEMATTRS_HTTP_STATUS_CODE:()=>pS,SEMATTRS_HTTP_TARGET:()=>dV,SEMATTRS_HTTP_URL:()=>MC,SEMATTRS_HTTP_USER_AGENT:()=>Nrt,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Dot,SEMATTRS_MESSAGE_ID:()=>xot,SEMATTRS_MESSAGE_TYPE:()=>Rot,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Not,SEMATTRS_MESSAGING_CONSUMER_ID:()=>mot,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>lot,SEMATTRS_MESSAGING_DESTINATION:()=>rot,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>oot,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>_ot,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>hot,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>got,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Eot,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>yot,SEMATTRS_MESSAGING_MESSAGE_ID:()=>cot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>pot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>dot,SEMATTRS_MESSAGING_OPERATION:()=>fot,SEMATTRS_MESSAGING_PROTOCOL:()=>sot,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>aot,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Aot,SEMATTRS_MESSAGING_SYSTEM:()=>AV,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>iot,SEMATTRS_MESSAGING_URL:()=>uot,SEMATTRS_NET_HOST_CARRIER_ICC:()=>grt,SEMATTRS_NET_HOST_CARRIER_MCC:()=>mrt,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Art,SEMATTRS_NET_HOST_CARRIER_NAME:()=>frt,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>prt,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>drt,SEMATTRS_NET_HOST_IP:()=>cV,SEMATTRS_NET_HOST_NAME:()=>lrt,SEMATTRS_NET_HOST_PORT:()=>lV,SEMATTRS_NET_PEER_IP:()=>uV,SEMATTRS_NET_PEER_NAME:()=>crt,SEMATTRS_NET_PEER_PORT:()=>urt,SEMATTRS_NET_TRANSPORT:()=>art,SEMATTRS_PEER_SERVICE:()=>hrt,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>hV,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Cot,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>vot,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Iot,SEMATTRS_RPC_JSONRPC_VERSION:()=>bot,SEMATTRS_RPC_METHOD:()=>Tot,SEMATTRS_RPC_SERVICE:()=>gV,SEMATTRS_RPC_SYSTEM:()=>Sot,SEMATTRS_THREAD_ID:()=>Srt,SEMATTRS_THREAD_NAME:()=>Trt,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>yat,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Eat,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Sat,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Tat,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>bat,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Iat,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Cat,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Rat,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>vat,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Dat,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>xat,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Aat,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>hat,SEMRESATTRS_CLOUD_PLATFORM:()=>_at,SEMRESATTRS_CLOUD_PROVIDER:()=>mat,SEMRESATTRS_CLOUD_REGION:()=>gat,SEMRESATTRS_CONTAINER_ID:()=>Bat,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Oat,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>kat,SEMRESATTRS_CONTAINER_NAME:()=>Nat,SEMRESATTRS_CONTAINER_RUNTIME:()=>wat,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Pat,SEMRESATTRS_DEVICE_ID:()=>Mat,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Lat,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Uat,SEMRESATTRS_FAAS_ID:()=>Fat,SEMRESATTRS_FAAS_INSTANCE:()=>jat,SEMRESATTRS_FAAS_MAX_MEMORY:()=>zat,SEMRESATTRS_FAAS_NAME:()=>Qat,SEMRESATTRS_FAAS_VERSION:()=>Gat,SEMRESATTRS_HOST_ARCH:()=>Vat,SEMRESATTRS_HOST_ID:()=>Hat,SEMRESATTRS_HOST_IMAGE_ID:()=>Kat,SEMRESATTRS_HOST_IMAGE_NAME:()=>Yat,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Jat,SEMRESATTRS_HOST_NAME:()=>$at,SEMRESATTRS_HOST_TYPE:()=>qat,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Zat,SEMRESATTRS_K8S_CONTAINER_NAME:()=>rut,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Aut,SEMRESATTRS_K8S_CRONJOB_UID:()=>mut,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>dut,SEMRESATTRS_K8S_DAEMONSET_UID:()=>lut,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>aut,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>sut,SEMRESATTRS_K8S_JOB_NAME:()=>fut,SEMRESATTRS_K8S_JOB_UID:()=>put,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>eut,SEMRESATTRS_K8S_NODE_NAME:()=>Wat,SEMRESATTRS_K8S_NODE_UID:()=>Xat,SEMRESATTRS_K8S_POD_NAME:()=>nut,SEMRESATTRS_K8S_POD_UID:()=>tut,SEMRESATTRS_K8S_REPLICASET_NAME:()=>iut,SEMRESATTRS_K8S_REPLICASET_UID:()=>out,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>cut,SEMRESATTRS_K8S_STATEFULSET_UID:()=>uut,SEMRESATTRS_OS_DESCRIPTION:()=>hut,SEMRESATTRS_OS_NAME:()=>_ut,SEMRESATTRS_OS_TYPE:()=>gut,SEMRESATTRS_OS_VERSION:()=>Eut,SEMRESATTRS_PROCESS_COMMAND:()=>but,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Cut,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Iut,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Sut,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Tut,SEMRESATTRS_PROCESS_OWNER:()=>vut,SEMRESATTRS_PROCESS_PID:()=>yut,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Dut,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Rut,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>xut,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>But,SEMRESATTRS_SERVICE_NAME:()=>Nut,SEMRESATTRS_SERVICE_NAMESPACE:()=>_V,SEMRESATTRS_SERVICE_VERSION:()=>wut,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Mut,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>kut,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Out,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Put,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Qut,SEMRESATTRS_WEBENGINE_NAME:()=>Lut,SEMRESATTRS_WEBENGINE_VERSION:()=>Uut,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Edt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>ydt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Sdt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>bdt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Idt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Cdt,SemanticAttributes:()=>Bot,SemanticResourceAttributes:()=>Fut,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Oct,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>kct,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Pct,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Mct,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Lct,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Uct,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Qct,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Fct,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Gct,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>jct,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Tsn,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Rdt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>xdt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>bsn,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Ddt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Ndt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>Isn,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Bdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>wdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Odt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>kdt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Pdt,TelemetrySdkLanguageValues:()=>zct});var Xn=w(()=>{m();uye();kTe();PTe();MTe();LTe()});var UTe=M(lU=>{"use strict";m();Object.defineProperty(lU,"__esModule",{value:!0});lU.ATTR_PROCESS_RUNTIME_NAME=void 0;lU.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var QTe=M(pU=>{"use strict";m();Object.defineProperty(pU,"__esModule",{value:!0});pU.SDK_INFO=void 0;var Fpt=hge(),dU=(Xn(),Me(Hr)),Gpt=UTe();pU.SDK_INFO={[dU.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[Gpt.ATTR_PROCESS_RUNTIME_NAME]:"node",[dU.ATTR_TELEMETRY_SDK_LANGUAGE]:dU.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[dU.ATTR_TELEMETRY_SDK_VERSION]:Fpt.VERSION}});var FTe=M(su=>{"use strict";m();Object.defineProperty(su,"__esModule",{value:!0});su.otperformance=su.SDK_INFO=su._globalThis=su.getStringListFromEnv=su.getNumberFromEnv=su.getBooleanFromEnv=su.getStringFromEnv=void 0;var fU=Age();Object.defineProperty(su,"getStringFromEnv",{enumerable:!0,get:function(){return fU.getStringFromEnv}});Object.defineProperty(su,"getBooleanFromEnv",{enumerable:!0,get:function(){return fU.getBooleanFromEnv}});Object.defineProperty(su,"getNumberFromEnv",{enumerable:!0,get:function(){return fU.getNumberFromEnv}});Object.defineProperty(su,"getStringListFromEnv",{enumerable:!0,get:function(){return fU.getStringListFromEnv}});var jpt=gge();Object.defineProperty(su,"_globalThis",{enumerable:!0,get:function(){return jpt._globalThis}});var zpt=QTe();Object.defineProperty(su,"SDK_INFO",{enumerable:!0,get:function(){return zpt.SDK_INFO}});su.otperformance=performance});var OV=M(au=>{"use strict";m();Object.defineProperty(au,"__esModule",{value:!0});au.getStringListFromEnv=au.getNumberFromEnv=au.getStringFromEnv=au.getBooleanFromEnv=au.otperformance=au._globalThis=au.SDK_INFO=void 0;var AS=FTe();Object.defineProperty(au,"SDK_INFO",{enumerable:!0,get:function(){return AS.SDK_INFO}});Object.defineProperty(au,"_globalThis",{enumerable:!0,get:function(){return AS._globalThis}});Object.defineProperty(au,"otperformance",{enumerable:!0,get:function(){return AS.otperformance}});Object.defineProperty(au,"getBooleanFromEnv",{enumerable:!0,get:function(){return AS.getBooleanFromEnv}});Object.defineProperty(au,"getStringFromEnv",{enumerable:!0,get:function(){return AS.getStringFromEnv}});Object.defineProperty(au,"getNumberFromEnv",{enumerable:!0,get:function(){return AS.getNumberFromEnv}});Object.defineProperty(au,"getStringListFromEnv",{enumerable:!0,get:function(){return AS.getStringListFromEnv}})});var HTe=M($r=>{"use strict";m();Object.defineProperty($r,"__esModule",{value:!0});$r.addHrTimes=$r.isTimeInput=$r.isTimeInputHrTime=$r.hrTimeToSeconds=$r.hrTimeToMilliseconds=$r.hrTimeToMicroseconds=$r.hrTimeToNanoseconds=$r.hrTimeToTimeStamp=$r.hrTimeDuration=$r.timeInputToHrTime=$r.hrTime=$r.getTimeOrigin=$r.millisToHrTime=void 0;var mU=OV(),GTe=9,Hpt=6,$pt=Math.pow(10,Hpt),gB=Math.pow(10,GTe);function hB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*$pt);return[n,r]}$r.millisToHrTime=hB;function qpt(){return mU.otperformance.timeOrigin}$r.getTimeOrigin=qpt;function jTe(e){let t=hB(mU.otperformance.timeOrigin),n=hB(typeof e=="number"?e:mU.otperformance.now());return zTe(t,n)}$r.hrTime=jTe;function Vpt(e){if(kV(e))return e;if(typeof e=="number")return e<mU.otperformance.timeOrigin?jTe(e):hB(e);if(e instanceof Date)return hB(e.getTime());throw TypeError("Invalid input type")}$r.timeInputToHrTime=Vpt;function Ypt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=gB),[n,r]}$r.hrTimeDuration=Ypt;function Kpt(e){let t=GTe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}$r.hrTimeToTimeStamp=Kpt;function Jpt(e){return e[0]*gB+e[1]}$r.hrTimeToNanoseconds=Jpt;function Zpt(e){return e[0]*1e6+e[1]/1e3}$r.hrTimeToMicroseconds=Zpt;function Wpt(e){return e[0]*1e3+e[1]/1e6}$r.hrTimeToMilliseconds=Wpt;function Xpt(e){return e[0]+e[1]/gB}$r.hrTimeToSeconds=Xpt;function kV(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}$r.isTimeInputHrTime=kV;function eft(e){return kV(e)||typeof e=="number"||e instanceof Date}$r.isTimeInput=eft;function zTe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=gB&&(n[1]-=gB,n[0]+=1),n}$r.addHrTimes=zTe});var $Te=M(AU=>{"use strict";m();Object.defineProperty(AU,"__esModule",{value:!0});AU.unrefTimer=void 0;function tft(e){typeof e!="number"&&e.unref()}AU.unrefTimer=tft});var qTe=M(_B=>{"use strict";m();Object.defineProperty(_B,"__esModule",{value:!0});_B.ExportResultCode=void 0;var nft;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(nft=_B.ExportResultCode||(_B.ExportResultCode={}))});var YTe=M(gU=>{"use strict";m();Object.defineProperty(gU,"__esModule",{value:!0});gU.CompositePropagator=void 0;var VTe=(He(),Me(tt)),PV=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){VTe.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){VTe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};gU.CompositePropagator=PV});var KTe=M(UC=>{"use strict";m();Object.defineProperty(UC,"__esModule",{value:!0});UC.validateValue=UC.validateKey=void 0;var MV="[_0-9a-z-*/]",rft=`[a-z]${MV}{0,255}`,oft=`[a-z0-9]${MV}{0,240}@[a-z]${MV}{0,13}`,ift=new RegExp(`^(?:${rft}|${oft})$`),sft=/^[ -~]{0,255}[!-~]$/,aft=/,|=/;function uft(e){return ift.test(e)}UC.validateKey=uft;function cft(e){return sft.test(e)&&!aft.test(e)}UC.validateValue=cft});var UV=M(_U=>{"use strict";m();Object.defineProperty(_U,"__esModule",{value:!0});_U.TraceState=void 0;var hU=KTe(),lft=32,JTe=512,ZTe=",",WTe="=",LV=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,hU.validateKey)(t)||!(0,hU.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>JTe)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=ZTe+t),t=`${r[0]}${WTe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(ZTe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(WTe);if(s===-1)continue;let u=i.slice(0,s),l=i.slice(s+1);if(!(0,hU.validateKey)(u)||!(0,hU.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>JTe)&&(n.set(u,l),r=f,n.size>=lft))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}};_U.TraceState=LV});var ebe=M(uu=>{"use strict";m();Object.defineProperty(uu,"__esModule",{value:!0});uu.W3CTraceContextPropagator=uu.parseTraceParent=uu.TRACE_STATE_HEADER=uu.TRACE_PARENT_HEADER=void 0;var EU=(He(),Me(tt)),dft=fB(),pft=UV();uu.TRACE_PARENT_HEADER="traceparent";uu.TRACE_STATE_HEADER="tracestate";var fft="00",mft="(?!ff)[\\da-f]{2}",Aft="(?![0]{32})[\\da-f]{32}",gft="(?![0]{16})[\\da-f]{16}",hft="[\\da-f]{2}",_ft=new RegExp(`^\\s?(${mft})-(${Aft})-(${gft})-(${hft})(-.*)?\\s?$`);function XTe(e){let t=_ft.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}uu.parseTraceParent=XTe;var QV=class{inject(t,n,r){let o=EU.trace.getSpanContext(t);if(!o||(0,dft.isTracingSuppressed)(t)||!(0,EU.isSpanContextValid)(o))return;let i=`${fft}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||EU.TraceFlags.NONE).toString(16)}`;r.set(n,uu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,uu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,uu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=XTe(i);if(!s)return t;s.isRemote=!0;let u=r.get(n,uu.TRACE_STATE_HEADER);if(u){let l=Array.isArray(u)?u.join(","):u;s.traceState=new pft.TraceState(typeof l=="string"?l:void 0)}return EU.trace.setSpanContext(t,s)}fields(){return[uu.TRACE_PARENT_HEADER,uu.TRACE_STATE_HEADER]}};uu.W3CTraceContextPropagator=QV});var tbe=M(Af=>{"use strict";m();Object.defineProperty(Af,"__esModule",{value:!0});Af.getRPCMetadata=Af.deleteRPCMetadata=Af.setRPCMetadata=Af.RPCType=void 0;var Eft=(He(),Me(tt)),FV=(0,Eft.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),yft;(function(e){e.HTTP="http"})(yft=Af.RPCType||(Af.RPCType={}));function Sft(e,t){return e.setValue(FV,t)}Af.setRPCMetadata=Sft;function Tft(e){return e.deleteValue(FV)}Af.deleteRPCMetadata=Tft;function bft(e){return e.getValue(FV)}Af.getRPCMetadata=bft});var sbe=M(yU=>{"use strict";m();Object.defineProperty(yU,"__esModule",{value:!0});yU.isPlainObject=void 0;var Ift="[object Object]",Cft="[object Null]",vft="[object Undefined]",Rft=Function.prototype,nbe=Rft.toString,xft=nbe.call(Object),Dft=Object.getPrototypeOf,rbe=Object.prototype,obe=rbe.hasOwnProperty,gS=Symbol?Symbol.toStringTag:void 0,ibe=rbe.toString;function Nft(e){if(!Bft(e)||wft(e)!==Ift)return!1;let t=Dft(e);if(t===null)return!0;let n=obe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&nbe.call(n)===xft}yU.isPlainObject=Nft;function Bft(e){return e!=null&&typeof e=="object"}function wft(e){return e==null?e===void 0?vft:Cft:gS&&gS in Object(e)?Oft(e):kft(e)}function Oft(e){let t=obe.call(e,gS),n=e[gS],r=!1;try{e[gS]=void 0,r=!0}catch{}let o=ibe.call(e);return r&&(t?e[gS]=n:delete e[gS]),o}function kft(e){return ibe.call(e)}});var dbe=M(bU=>{"use strict";m();Object.defineProperty(bU,"__esModule",{value:!0});bU.merge=void 0;var abe=sbe(),Pft=20;function Mft(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=cbe(t,e.shift(),0,n);return t}bU.merge=Mft;function GV(e){return TU(e)?e.slice():e}function cbe(e,t,n=0,r){let o;if(!(n>Pft)){if(n++,SU(e)||SU(t)||lbe(t))o=GV(t);else if(TU(e)){if(o=e.slice(),TU(t))for(let i=0,s=t.length;i<s;i++)o.push(GV(t[i]));else if(EB(t)){let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=GV(t[l]))}}}else if(EB(e))if(EB(t)){if(!Lft(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(SU(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],_=f;if(ube(e,l,r)||ube(t,l,r))delete o[l];else{if(EB(h)&&EB(_)){let y=r.get(h)||[],T=r.get(_)||[];y.push({obj:e,key:l}),T.push({obj:t,key:l}),r.set(h,y),r.set(_,T)}o[l]=cbe(o[l],f,n,r)}}}}else o=t;return o}}function ube(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 TU(e){return Array.isArray(e)}function lbe(e){return typeof e=="function"}function EB(e){return!SU(e)&&!TU(e)&&!lbe(e)&&typeof e=="object"}function SU(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Lft(e,t){return!(!(0,abe.isPlainObject)(e)||!(0,abe.isPlainObject)(t))}});var pbe=M(QC=>{"use strict";m();Object.defineProperty(QC,"__esModule",{value:!0});QC.callWithTimeout=QC.TimeoutError=void 0;var IU=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};QC.TimeoutError=IU;function Uft(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new IU("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}QC.callWithTimeout=Uft});var mbe=M(FC=>{"use strict";m();Object.defineProperty(FC,"__esModule",{value:!0});FC.isUrlIgnored=FC.urlMatches=void 0;function fbe(e,t){return typeof t=="string"?e===t:!!e.match(t)}FC.urlMatches=fbe;function Qft(e,t){if(!t)return!1;for(let n of t)if(fbe(e,n))return!0;return!1}FC.isUrlIgnored=Qft});var Abe=M(CU=>{"use strict";m();Object.defineProperty(CU,"__esModule",{value:!0});CU.Deferred=void 0;var jV=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)}};CU.Deferred=jV});var gbe=M(vU=>{"use strict";m();Object.defineProperty(vU,"__esModule",{value:!0});vU.BindOnceFuture=void 0;var Fft=Abe(),zV=class{_isCalled=!1;_deferred=new Fft.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}};vU.BindOnceFuture=zV});var _be=M(RU=>{"use strict";m();Object.defineProperty(RU,"__esModule",{value:!0});RU.diagLogLevelFromString=void 0;var xg=(He(),Me(tt)),hbe={ALL:xg.DiagLogLevel.ALL,VERBOSE:xg.DiagLogLevel.VERBOSE,DEBUG:xg.DiagLogLevel.DEBUG,INFO:xg.DiagLogLevel.INFO,WARN:xg.DiagLogLevel.WARN,ERROR:xg.DiagLogLevel.ERROR,NONE:xg.DiagLogLevel.NONE};function Gft(e){if(e==null)return;let t=hbe[e.toUpperCase()];return t??(xg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(hbe)}, using default`),xg.DiagLogLevel.INFO)}RU.diagLogLevelFromString=Gft});var ybe=M(xU=>{"use strict";m();Object.defineProperty(xU,"__esModule",{value:!0});xU._export=void 0;var Ebe=(He(),Me(tt)),jft=fB();function zft(e,t){return new Promise(n=>{Ebe.context.with((0,jft.suppressTracing)(Ebe.context.active()),()=>{e.export(t,n)})})}xU._export=zft});var vr=M(Be=>{"use strict";m();Object.defineProperty(Be,"__esModule",{value:!0});Be.diagLogLevelFromString=Be.BindOnceFuture=Be.urlMatches=Be.isUrlIgnored=Be.callWithTimeout=Be.TimeoutError=Be.merge=Be.TraceState=Be.unsuppressTracing=Be.suppressTracing=Be.isTracingSuppressed=Be.setRPCMetadata=Be.getRPCMetadata=Be.deleteRPCMetadata=Be.RPCType=Be.parseTraceParent=Be.W3CTraceContextPropagator=Be.TRACE_STATE_HEADER=Be.TRACE_PARENT_HEADER=Be.CompositePropagator=Be.otperformance=Be.getStringListFromEnv=Be.getNumberFromEnv=Be.getBooleanFromEnv=Be.getStringFromEnv=Be._globalThis=Be.SDK_INFO=Be.parseKeyPairsIntoRecord=Be.ExportResultCode=Be.unrefTimer=Be.timeInputToHrTime=Be.millisToHrTime=Be.isTimeInputHrTime=Be.isTimeInput=Be.hrTimeToTimeStamp=Be.hrTimeToSeconds=Be.hrTimeToNanoseconds=Be.hrTimeToMilliseconds=Be.hrTimeToMicroseconds=Be.hrTimeDuration=Be.hrTime=Be.getTimeOrigin=Be.addHrTimes=Be.loggingErrorHandler=Be.setGlobalErrorHandler=Be.globalErrorHandler=Be.sanitizeAttributes=Be.isAttributeValue=Be.AnchoredClock=Be.W3CBaggagePropagator=void 0;Be.internal=void 0;var Hft=rge();Object.defineProperty(Be,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Hft.W3CBaggagePropagator}});var $ft=oge();Object.defineProperty(Be,"AnchoredClock",{enumerable:!0,get:function(){return $ft.AnchoredClock}});var Sbe=cge();Object.defineProperty(Be,"isAttributeValue",{enumerable:!0,get:function(){return Sbe.isAttributeValue}});Object.defineProperty(Be,"sanitizeAttributes",{enumerable:!0,get:function(){return Sbe.sanitizeAttributes}});var Tbe=dge();Object.defineProperty(Be,"globalErrorHandler",{enumerable:!0,get:function(){return Tbe.globalErrorHandler}});Object.defineProperty(Be,"setGlobalErrorHandler",{enumerable:!0,get:function(){return Tbe.setGlobalErrorHandler}});var qft=rV();Object.defineProperty(Be,"loggingErrorHandler",{enumerable:!0,get:function(){return qft.loggingErrorHandler}});var Gl=HTe();Object.defineProperty(Be,"addHrTimes",{enumerable:!0,get:function(){return Gl.addHrTimes}});Object.defineProperty(Be,"getTimeOrigin",{enumerable:!0,get:function(){return Gl.getTimeOrigin}});Object.defineProperty(Be,"hrTime",{enumerable:!0,get:function(){return Gl.hrTime}});Object.defineProperty(Be,"hrTimeDuration",{enumerable:!0,get:function(){return Gl.hrTimeDuration}});Object.defineProperty(Be,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMicroseconds}});Object.defineProperty(Be,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMilliseconds}});Object.defineProperty(Be,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Gl.hrTimeToNanoseconds}});Object.defineProperty(Be,"hrTimeToSeconds",{enumerable:!0,get:function(){return Gl.hrTimeToSeconds}});Object.defineProperty(Be,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Gl.hrTimeToTimeStamp}});Object.defineProperty(Be,"isTimeInput",{enumerable:!0,get:function(){return Gl.isTimeInput}});Object.defineProperty(Be,"isTimeInputHrTime",{enumerable:!0,get:function(){return Gl.isTimeInputHrTime}});Object.defineProperty(Be,"millisToHrTime",{enumerable:!0,get:function(){return Gl.millisToHrTime}});Object.defineProperty(Be,"timeInputToHrTime",{enumerable:!0,get:function(){return Gl.timeInputToHrTime}});var Vft=$Te();Object.defineProperty(Be,"unrefTimer",{enumerable:!0,get:function(){return Vft.unrefTimer}});var Yft=qTe();Object.defineProperty(Be,"ExportResultCode",{enumerable:!0,get:function(){return Yft.ExportResultCode}});var Kft=X5();Object.defineProperty(Be,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Kft.parseKeyPairsIntoRecord}});var hS=OV();Object.defineProperty(Be,"SDK_INFO",{enumerable:!0,get:function(){return hS.SDK_INFO}});Object.defineProperty(Be,"_globalThis",{enumerable:!0,get:function(){return hS._globalThis}});Object.defineProperty(Be,"getStringFromEnv",{enumerable:!0,get:function(){return hS.getStringFromEnv}});Object.defineProperty(Be,"getBooleanFromEnv",{enumerable:!0,get:function(){return hS.getBooleanFromEnv}});Object.defineProperty(Be,"getNumberFromEnv",{enumerable:!0,get:function(){return hS.getNumberFromEnv}});Object.defineProperty(Be,"getStringListFromEnv",{enumerable:!0,get:function(){return hS.getStringListFromEnv}});Object.defineProperty(Be,"otperformance",{enumerable:!0,get:function(){return hS.otperformance}});var Jft=YTe();Object.defineProperty(Be,"CompositePropagator",{enumerable:!0,get:function(){return Jft.CompositePropagator}});var DU=ebe();Object.defineProperty(Be,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return DU.TRACE_PARENT_HEADER}});Object.defineProperty(Be,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return DU.TRACE_STATE_HEADER}});Object.defineProperty(Be,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return DU.W3CTraceContextPropagator}});Object.defineProperty(Be,"parseTraceParent",{enumerable:!0,get:function(){return DU.parseTraceParent}});var NU=tbe();Object.defineProperty(Be,"RPCType",{enumerable:!0,get:function(){return NU.RPCType}});Object.defineProperty(Be,"deleteRPCMetadata",{enumerable:!0,get:function(){return NU.deleteRPCMetadata}});Object.defineProperty(Be,"getRPCMetadata",{enumerable:!0,get:function(){return NU.getRPCMetadata}});Object.defineProperty(Be,"setRPCMetadata",{enumerable:!0,get:function(){return NU.setRPCMetadata}});var HV=fB();Object.defineProperty(Be,"isTracingSuppressed",{enumerable:!0,get:function(){return HV.isTracingSuppressed}});Object.defineProperty(Be,"suppressTracing",{enumerable:!0,get:function(){return HV.suppressTracing}});Object.defineProperty(Be,"unsuppressTracing",{enumerable:!0,get:function(){return HV.unsuppressTracing}});var Zft=UV();Object.defineProperty(Be,"TraceState",{enumerable:!0,get:function(){return Zft.TraceState}});var Wft=dbe();Object.defineProperty(Be,"merge",{enumerable:!0,get:function(){return Wft.merge}});var bbe=pbe();Object.defineProperty(Be,"TimeoutError",{enumerable:!0,get:function(){return bbe.TimeoutError}});Object.defineProperty(Be,"callWithTimeout",{enumerable:!0,get:function(){return bbe.callWithTimeout}});var Ibe=mbe();Object.defineProperty(Be,"isUrlIgnored",{enumerable:!0,get:function(){return Ibe.isUrlIgnored}});Object.defineProperty(Be,"urlMatches",{enumerable:!0,get:function(){return Ibe.urlMatches}});var Xft=gbe();Object.defineProperty(Be,"BindOnceFuture",{enumerable:!0,get:function(){return Xft.BindOnceFuture}});var emt=_be();Object.defineProperty(Be,"diagLogLevelFromString",{enumerable:!0,get:function(){return emt.diagLogLevelFromString}});var tmt=ybe();Be.internal={_export:tmt._export}});var Cbe=M(BU=>{"use strict";m();Object.defineProperty(BU,"__esModule",{value:!0});BU.VERSION=void 0;BU.VERSION="0.214.0"});var vbe=M(yB=>{"use strict";m();Object.defineProperty(yB,"__esModule",{value:!0});yB.SeverityNumber=void 0;var nmt;(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"})(nmt=yB.SeverityNumber||(yB.SeverityNumber={}))});var OU=M(GC=>{"use strict";m();Object.defineProperty(GC,"__esModule",{value:!0});GC.NOOP_LOGGER=GC.NoopLogger=void 0;var wU=class{emit(t){}};GC.NoopLogger=wU;GC.NOOP_LOGGER=new wU});var Rbe=M(wm=>{"use strict";m();Object.defineProperty(wm,"__esModule",{value:!0});wm.API_BACKWARDS_COMPATIBILITY_VERSION=wm.makeGetter=wm._global=wm.GLOBAL_LOGS_API_KEY=void 0;wm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");wm._global=globalThis;function rmt(e,t,n){return r=>r===e?t:n}wm.makeGetter=rmt;wm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var $V=M(jC=>{"use strict";m();Object.defineProperty(jC,"__esModule",{value:!0});jC.NOOP_LOGGER_PROVIDER=jC.NoopLoggerProvider=void 0;var omt=OU(),kU=class{getLogger(t,n,r){return new omt.NoopLogger}};jC.NoopLoggerProvider=kU;jC.NOOP_LOGGER_PROVIDER=new kU});var xbe=M(PU=>{"use strict";m();Object.defineProperty(PU,"__esModule",{value:!0});PU.ProxyLogger=void 0;var imt=OU(),qV=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):imt.NOOP_LOGGER}};PU.ProxyLogger=qV});var Dbe=M(MU=>{"use strict";m();Object.defineProperty(MU,"__esModule",{value:!0});MU.ProxyLoggerProvider=void 0;var smt=$V(),amt=xbe(),VV=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new amt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:smt.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)}};MU.ProxyLoggerProvider=VV});var Bbe=M(LU=>{"use strict";m();Object.defineProperty(LU,"__esModule",{value:!0});LU.LogsAPI=void 0;var Vd=Rbe(),umt=$V(),Nbe=Dbe(),YV=class e{constructor(){this._proxyLoggerProvider=new Nbe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Vd._global[Vd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Vd._global[Vd.GLOBAL_LOGS_API_KEY]=(0,Vd.makeGetter)(Vd.API_BACKWARDS_COMPATIBILITY_VERSION,t,umt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Vd._global[Vd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Vd._global,Vd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Vd._global[Vd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Nbe.ProxyLoggerProvider}};LU.LogsAPI=YV});var KV=M(Om=>{"use strict";m();Object.defineProperty(Om,"__esModule",{value:!0});Om.logs=Om.NoopLogger=Om.NOOP_LOGGER=Om.SeverityNumber=void 0;var cmt=vbe();Object.defineProperty(Om,"SeverityNumber",{enumerable:!0,get:function(){return cmt.SeverityNumber}});var wbe=OU();Object.defineProperty(Om,"NOOP_LOGGER",{enumerable:!0,get:function(){return wbe.NOOP_LOGGER}});Object.defineProperty(Om,"NoopLogger",{enumerable:!0,get:function(){return wbe.NoopLogger}});var lmt=Bbe();Om.logs=lmt.LogsAPI.getInstance()});var Obe=M(zC=>{"use strict";m();Object.defineProperty(zC,"__esModule",{value:!0});zC.disableInstrumentations=zC.enableInstrumentations=void 0;function dmt(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()}}zC.enableInstrumentations=dmt;function pmt(e){e.forEach(t=>t.disable())}zC.disableInstrumentations=pmt});var Mbe=M(UU=>{"use strict";m();Object.defineProperty(UU,"__esModule",{value:!0});UU.registerInstrumentations=void 0;var kbe=(He(),Me(tt)),fmt=KV(),Pbe=Obe();function mmt(e){let t=e.tracerProvider||kbe.trace.getTracerProvider(),n=e.meterProvider||kbe.metrics.getMeterProvider(),r=e.loggerProvider||fmt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Pbe.enableInstrumentations)(o,t,n,r),()=>{(0,Pbe.disableInstrumentations)(o)}}UU.registerInstrumentations=mmt});var $be=M(QU=>{"use strict";m();Object.defineProperty(QU,"__esModule",{value:!0});QU.satisfies=void 0;var XV=(He(),Me(tt)),Gbe=/^(?: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-]+)*))?$/,Amt=/^(?<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-]+)*))?$/,gmt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function hmt(e,t,n){if(!_mt(e))return XV.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Tmt(e);if(!r)return!1;let o=[],i=jbe(r,t,o,n);return i&&!n?.includePrerelease?ymt(r,o):i}QU.satisfies=hmt;function _mt(e){return typeof e=="string"&&Gbe.test(e)}function jbe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(JV(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=zmt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!JV(e,i,n,r))return!1;return!0}return JV(e,t,n,r)}function JV(e,t,n,r){if(t=Smt(t,r),t.includes(" "))return jbe(e,t,n,r);{let o=bmt(t);return n.push(o),Emt(e,o)}}function Emt(e,t){if(t.invalid)return!1;if(!t.version||WV(t.version))return!0;let n=Ube(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=Ube(r,o)}return gmt[t.op]?.includes(n)}function ymt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Smt(e,t){return e=e.trim(),e=Gmt(e,t),e=Fmt(e),e=jmt(e,t),e=e.trim(),e}function $u(e){return!e||e.toLowerCase()==="x"||e==="*"}function Tmt(e){let t=e.match(Gbe);if(!t){XV.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 bmt(e){if(!e)return{};let t=e.match(Amt);if(!t)return XV.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("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function WV(e){return e==="*"||e==="x"||e==="X"}function Lbe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Imt(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 Cmt(e,t){if(WV(e)||WV(t))return 0;let[n,r]=Imt(Lbe(e),Lbe(t));return n>r?1:n<r?-1:0}function Ube(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=Cmt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var zbe="[a-zA-Z0-9-]",Hbe="0|[1-9]\\d*",vmt=`\\d*[a-zA-Z-]${zbe}*`,Rmt="((?:<|>)?=?)",Qbe=`(?:${Hbe}|${vmt})`,xmt=`(?:-(${Qbe}(?:\\.${Qbe})*))`,Fbe=`${zbe}+`,Dmt=`(?:\\+(${Fbe}(?:\\.${Fbe})*))`,ZV=`${Hbe}|x|X|\\*`,SB=`[v=\\s]*(${ZV})(?:\\.(${ZV})(?:\\.(${ZV})(?:${xmt})?${Dmt}?)?)?`,Nmt=`^${Rmt}\\s*${SB}$`,Bmt=new RegExp(Nmt),wmt=`^\\s*(${SB})\\s+-\\s+(${SB})\\s*$`,Omt=new RegExp(wmt),kmt="(?:~>?)",Pmt=`^${kmt}${SB}$`,Mmt=new RegExp(Pmt),Lmt="(?:\\^)",Umt=`^${Lmt}${SB}$`,Qmt=new RegExp(Umt);function Fmt(e){let t=Mmt;return e.replace(t,(n,r,o,i,s)=>{let u;return $u(r)?u="":$u(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:$u(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function Gmt(e,t){let n=Qmt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return $u(i)?f="":$u(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:$u(u)?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}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function jmt(e,t){let n=Bmt;return e.replace(n,(r,o,i,s,u,l)=>{let f=$u(i),h=f||$u(s),_=h||$u(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function zmt(e,t){let n=Omt;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>($u(i)?o="":$u(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:$u(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,$u(_)?h="":$u(y)?h=`<${+_+1}.0.0-0`:$u(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var e7=M(Ra=>{"use strict";m();Object.defineProperty(Ra,"__esModule",{value:!0});Ra.massUnwrap=Ra.unwrap=Ra.massWrap=Ra.wrap=void 0;var qu=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 Hmt=(e,t,n)=>{if(!e||!e[t]){qu("no original function "+String(t)+" to wrap");return}if(!n){qu("no wrapper function"),qu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){qu("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};Ra.wrap=Hmt;var $mt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ra.wrap)(r,o,n)})})};Ra.massWrap=$mt;var qmt=(e,t)=>{if(!e||!e[t]){qu("no function to unwrap."),qu(new Error().stack);return}let n=e[t];if(!n.__unwrap)qu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ra.unwrap=qmt;var Vmt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ra.unwrap)(n,r)})})};Ra.massUnwrap=Vmt;function bB(e){e&&e.logger&&(typeof e.logger!="function"?qu("new logger isn't a function, not replacing"):qu=e.logger)}Ra.default=bB;bB.wrap=Ra.wrap;bB.massWrap=Ra.massWrap;bB.unwrap=Ra.unwrap;bB.massUnwrap=Ra.massUnwrap});var qbe=M(GU=>{"use strict";m();Object.defineProperty(GU,"__esModule",{value:!0});GU.InstrumentationAbstract=void 0;var t7=(He(),Me(tt)),Ymt=KV(),FU=e7(),n7=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=t7.diag.createComponentLogger({namespace:t}),this._tracer=t7.trace.getTracer(t,n),this._meter=t7.metrics.getMeter(t,n),this._logger=Ymt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=FU.wrap;_unwrap=FU.unwrap;_massWrap=FU.massWrap;_massUnwrap=FU.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)}}};GU.InstrumentationAbstract=n7});var Ybe=M((Xan,Vbe)=>{m();var HC=1e3,$C=HC*60,qC=$C*60,_S=qC*24,Kmt=_S*7,Jmt=_S*365.25;Vbe.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Zmt(e);if(n==="number"&&isFinite(e))return t.long?Xmt(e):Wmt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Zmt(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*Jmt;case"weeks":case"week":case"w":return n*Kmt;case"days":case"day":case"d":return n*_S;case"hours":case"hour":case"hrs":case"hr":case"h":return n*qC;case"minutes":case"minute":case"mins":case"min":case"m":return n*$C;case"seconds":case"second":case"secs":case"sec":case"s":return n*HC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Wmt(e){var t=Math.abs(e);return t>=_S?Math.round(e/_S)+"d":t>=qC?Math.round(e/qC)+"h":t>=$C?Math.round(e/$C)+"m":t>=HC?Math.round(e/HC)+"s":e+"ms"}function Xmt(e){var t=Math.abs(e);return t>=_S?jU(e,t,_S,"day"):t>=qC?jU(e,t,qC,"hour"):t>=$C?jU(e,t,$C,"minute"):t>=HC?jU(e,t,HC,"second"):e+" ms"}function jU(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var r7=M((tun,Kbe)=>{m();function eAt(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=u,n.humanize=Ybe(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let _=0;for(let y=0;y<h.length;y++)_=(_<<5)-_+h.charCodeAt(y),_|=0;return n.colors[Math.abs(_)%n.colors.length]}n.selectColor=t;function n(h){let _,y=null,T,v;function R(...x){if(!R.enabled)return;let O=R,P=Number(new Date),j=P-(_||P);O.diff=j,O.prev=_,O.curr=P,_=P,x[0]=n.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let G=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(V,ae)=>{if(V==="%%")return"%";G++;let re=n.formatters[ae];if(typeof re=="function"){let _e=x[G];V=re.call(O,_e),x.splice(G,1),G--}return V}),n.formatArgs.call(O,x),(O.log||n.log).apply(O,x)}return R.namespace=h,R.useColors=n.useColors(),R.color=n.selectColor(h),R.extend=r,R.destroy=n.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,v=n.enabled(h)),v),set:x=>{y=x}}),typeof n.init=="function"&&n.init(R),R}function r(h,_){let y=n(this.namespace+(typeof _>"u"?":":_)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let _=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of _)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,_){let y=0,T=0,v=-1,R=0;for(;y<h.length;)if(T<_.length&&(_[T]===h[y]||_[T]==="*"))_[T]==="*"?(v=T,R=y,T++):(y++,T++);else if(v!==-1)T=v+1,R++,y=R;else return!1;for(;T<_.length&&_[T]==="*";)T++;return T===_.length}function s(){let h=[...n.names,...n.skips.map(_=>"-"+_)].join(",");return n.enable(""),h}function u(h){for(let _ of n.skips)if(i(h,_))return!1;for(let _ of n.names)if(i(h,_))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}Kbe.exports=eAt});var Jbe=M((Gc,zU)=>{m();Gc.formatArgs=nAt;Gc.save=rAt;Gc.load=oAt;Gc.useColors=tAt;Gc.storage=iAt();Gc.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`."))}})();Gc.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 tAt(){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 nAt(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+zU.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)}Gc.log=console.debug||console.log||(()=>{});function rAt(e){try{e?Gc.storage.setItem("debug",e):Gc.storage.removeItem("debug")}catch{}}function oAt(){let e;try{e=Gc.storage.getItem("debug")||Gc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function iAt(){try{return localStorage}catch{}}zU.exports=r7()(Gc);var{formatters:sAt}=zU.exports;sAt.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Wbe=M((oun,Zbe)=>{"use strict";m();Zbe.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 tIe=M((sun,eIe)=>{"use strict";m();var aAt=Ue("os"),Xbe=Ue("tty"),Yd=Wbe(),{env:Xs}=process,N_;Yd("no-color")||Yd("no-colors")||Yd("color=false")||Yd("color=never")?N_=0:(Yd("color")||Yd("colors")||Yd("color=true")||Yd("color=always"))&&(N_=1);"FORCE_COLOR"in Xs&&(Xs.FORCE_COLOR==="true"?N_=1:Xs.FORCE_COLOR==="false"?N_=0:N_=Xs.FORCE_COLOR.length===0?1:Math.min(parseInt(Xs.FORCE_COLOR,10),3));function o7(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i7(e,t){if(N_===0)return 0;if(Yd("color=16m")||Yd("color=full")||Yd("color=truecolor"))return 3;if(Yd("color=256"))return 2;if(e&&!t&&N_===void 0)return 0;let n=N_||0;if(Xs.TERM==="dumb")return n;if(process.platform==="win32"){let r=aAt.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Xs)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Xs)||Xs.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Xs)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Xs.TEAMCITY_VERSION)?1:0;if(Xs.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Xs){let r=parseInt((Xs.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Xs.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Xs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Xs.TERM)||"COLORTERM"in Xs?1:n}function uAt(e){let t=i7(e,e&&e.isTTY);return o7(t)}eIe.exports={supportsColor:uAt,stdout:o7(i7(!0,Xbe.isatty(1))),stderr:o7(i7(!0,Xbe.isatty(2)))}});var rIe=M((ea,$U)=>{m();var cAt=Ue("tty"),HU=Ue("util");ea.init=gAt;ea.log=fAt;ea.formatArgs=dAt;ea.save=mAt;ea.load=AAt;ea.useColors=lAt;ea.destroy=HU.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ea.colors=[6,2,3,4,5,1];try{let e=tIe();e&&(e.stderr||e).level>=2&&(ea.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{}ea.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 lAt(){return"colors"in ea.inspectOpts?!!ea.inspectOpts.colors:cAt.isatty(process.stderr.fd)}function dAt(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+"+$U.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=pAt()+t+" "+e[0]}function pAt(){return ea.inspectOpts.hideDate?"":new Date().toISOString()+" "}function fAt(...e){return process.stderr.write(HU.formatWithOptions(ea.inspectOpts,...e)+`
6
6
  `)}function mAt(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function AAt(){return process.env.DEBUG}function gAt(e){e.inspectOpts={};let t=Object.keys(ea.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=ea.inspectOpts[t[n]]}$U.exports=r7()(ea);var{formatters:nIe}=$U.exports;nIe.o=function(e){return this.inspectOpts.colors=this.useColors,HU.inspect(e,this.inspectOpts).split(`
@@ -35,7 +35,7 @@ Url: ${tF(e)}`),!0}return!1}function w_t(e,t){return t?.length?JQ(e).some(n=>F_(
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(),u=o.substring(i+1).trim(),l=n.get(s);l&&Array.isArray(l)?l.push(u):l?n.set(s,[l,u]):n.set(s,u)}}return n}onRequestCreated({request:t}){let n=this.getConfig(),r=n.enabled!==!1;if((0,Qw.safeExecuteInTheMiddle)(()=>!r||t.method==="CONNECT"||n.ignoreRequestHook?.(t),V=>V&&this._diag.error("caught ignoreRequestHook error: ",V),!0))return;let i=(0,H4.hrTime)(),s;try{s=new MIt.URL(t.path,t.origin)}catch(V){this._diag.warn("could not determine url.full:",V);return}let u=s.protocol.replace(":",""),l=this.getRequestMethod(t.method),f={[os.ATTR_HTTP_REQUEST_METHOD]:l,[os.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:t.method,[os.ATTR_URL_FULL]:s.toString(),[os.ATTR_URL_PATH]:s.pathname,[os.ATTR_URL_QUERY]:s.search,[os.ATTR_URL_SCHEME]:u},h={https:"443",http:"80"},_=s.hostname,y=s.port||h[u];f[os.ATTR_SERVER_ADDRESS]=_,y&&!isNaN(Number(y))&&(f[os.ATTR_SERVER_PORT]=Number(y));let v=this.parseRequestHeaders(t).get("user-agent");if(v){let V=Array.isArray(v)?v[v.length-1]:v;f[os.ATTR_USER_AGENT_ORIGINAL]=V}let R=(0,Qw.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(t),V=>V&&this._diag.error("caught startSpanHook error: ",V),!0);R&&Object.entries(R).forEach(([V,ae])=>{f[V]=ae});let x=Zl.context.active(),O=Zl.trace.getSpan(x),P;n.requireParentforSpans&&(!O||!Zl.trace.isSpanContextValid(O.spanContext()))?P=Zl.trace.wrapSpanContext(Zl.INVALID_SPAN_CONTEXT):P=this.tracer.startSpan(l==="_OTHER"?"HTTP":l,{kind:Zl.SpanKind.CLIENT,attributes:f},x),(0,Qw.safeExecuteInTheMiddle)(()=>n.requestHook?.(P,t),V=>V&&this._diag.error("caught requestHook error: ",V),!0);let j=Zl.trace.setSpan(Zl.context.active(),P),G={};Zl.propagation.inject(j,G);let H=Object.entries(G);for(let V=0;V<H.length;V++){let[ae,re]=H[V];typeof t.addHeader=="function"?t.addHeader(ae,re):typeof t.headers=="string"?t.headers+=`${ae}: ${re}\r
36
36
  `:Array.isArray(t.headers)&&t.headers.push(ae,re)}this._recordFromReq.set(t,{span:P,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:u}=n,l={[os.ATTR_NETWORK_PEER_ADDRESS]:s,[os.ATTR_NETWORK_PEER_PORT]:u};if(o.headersToSpanAttributes?.requestHeaders){let f=new Set(o.headersToSpanAttributes.requestHeaders.map(_=>_.toLowerCase())),h=this.parseRequestHeaders(t);for(let[_,y]of h.entries())if(f.has(_)){let T=Array.isArray(y)?y:[y];l[`http.request.header.${_}`]=T}}i.setAttributes(l)}onResponseHeaders({request:t,response:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i}=r,s={[os.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},u=this.getConfig();if((0,Qw.safeExecuteInTheMiddle)(()=>u.responseHook?.(o,{request:t,response:n}),l=>l&&this._diag.error("caught responseHook error: ",l),!0),u.headersToSpanAttributes?.responseHeaders){let l=new Set;u.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(),_=n.headers[f+1];if(l.has(h)){let y=`http.response.header.${h}`;Object.hasOwn(s,y)?s[y].push(_.toString()):s[y]=[_.toString()]}}}o.setAttributes(s),o.setStatus({code:n.statusCode>=400?Zl.SpanStatusCode.ERROR:Zl.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:Zl.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(t),i[os.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(i,s)}recordRequestDuration(t,n){let r={};[os.ATTR_HTTP_RESPONSE_STATUS_CODE,os.ATTR_HTTP_REQUEST_METHOD,os.ATTR_SERVER_ADDRESS,os.ATTR_SERVER_PORT,os.ATTR_URL_SCHEME,os.ATTR_ERROR_TYPE].forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,H4.hrTimeToMilliseconds)((0,H4.hrTimeDuration)(n,(0,H4.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"}};$4.UndiciInstrumentation=QZ});var swe=M(q4=>{"use strict";m();Object.defineProperty(q4,"__esModule",{value:!0});q4.UndiciInstrumentation=void 0;var LIt=iwe();Object.defineProperty(q4,"UndiciInstrumentation",{enumerable:!0,get:function(){return LIt.UndiciInstrumentation}})});function awe(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}function GIt(e,t={}){return typeof e.spans=="boolean"?e.spans:!t.skipOpenTelemetrySetup&&Mi(t)}function jIt(e={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=awe(n.origin,n.path),o=e.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=awe(n.origin,n.path);if(r.startsWith("data:")){let o=Iv(r);return{[Mt]:"auto.http.otel.node_fetch","http.url":o,[$_]:o,[Wd]:`${n.method||"GET"} ${o}`}}return{[Mt]:"auto.http.otel.node_fetch"}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}var uwe,cwe,UIt,QIt,FIt,lwe,dwe=w(()=>{m();uwe=ue(swe(),1);At();_r();cwe="NodeFetch",UIt=ct(cwe,uwe.UndiciInstrumentation,e=>jIt(e)),QIt=ct(`${cwe}.sentry`,GS,e=>e),FIt=((e={})=>({name:"NodeFetch",setupOnce(){GIt(e,Et()?.getOptions())&&UIt(e),QIt(e)}})),lwe=FIt});var V4=M(Fw=>{"use strict";m();Object.defineProperty(Fw,"__esModule",{value:!0});Fw.ExpressLayerType=void 0;var zIt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(zIt=Fw.ExpressLayerType||(Fw.ExpressLayerType={}))});var Y4=M(Gw=>{"use strict";m();Object.defineProperty(Gw,"__esModule",{value:!0});Gw.AttributeNames=void 0;var HIt;(function(e){e.EXPRESS_TYPE="express.type",e.EXPRESS_NAME="express.name"})(HIt=Gw.AttributeNames||(Gw.AttributeNames={}))});var FZ=M(tR=>{"use strict";m();Object.defineProperty(tR,"__esModule",{value:!0});tR._LAYERS_STORE_PROPERTY=tR.kLayerPatched=void 0;tR.kLayerPatched=Symbol("express-layer-patched");tR._LAYERS_STORE_PROPERTY="__ot_middlewares"});var mwe=M(is=>{"use strict";m();Object.defineProperty(is,"__esModule",{value:!0});is.getActualMatchedRoute=is.getConstructedRoute=is.getLayerPath=is.asErrorAndMessage=is.isLayerIgnored=is.getLayerMetadata=is.getRouterPath=is.storeLayerPath=void 0;var GZ=V4(),nR=Y4(),VS=FZ(),$It=(e,t)=>(Array.isArray(e[VS._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,VS._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t===void 0?{isLayerPathStored:!1}:(e[VS._LAYERS_STORE_PROPERTY].push(t),{isLayerPathStored:!0}));is.storeLayerPath=$It;var qIt=(e,t)=>{let n=t.handle?.stack?.[0];return n?.route?.path?`${e}${n.route.path}`:n?.handle?.stack?(0,is.getRouterPath)(e,n):e};is.getRouterPath=qIt;var VIt=(e,t,n)=>{if(t.name==="router"){let r=(0,is.getRouterPath)("",t),o=r||n||e||"/";return{attributes:{[nR.AttributeNames.EXPRESS_NAME]:o,[nR.AttributeNames.EXPRESS_TYPE]:GZ.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[nR.AttributeNames.EXPRESS_NAME]:(e||n)??"request handler",[nR.AttributeNames.EXPRESS_TYPE]:GZ.ExpressLayerType.REQUEST_HANDLER},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[nR.AttributeNames.EXPRESS_NAME]:t.name,[nR.AttributeNames.EXPRESS_TYPE]:GZ.ExpressLayerType.MIDDLEWARE},name:`middleware - ${t.name}`}};is.getLayerMetadata=VIt;var YIt=(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")},KIt=(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(YIt(e,r))return!0}catch{}return!1};is.isLayerIgnored=KIt;var JIt=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];is.asErrorAndMessage=JIt;var ZIt=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>pwe(n)||"").join(","):pwe(t)};is.getLayerPath=ZIt;var pwe=e=>{if(typeof e=="string")return e;if(e instanceof RegExp||typeof e=="number")return e.toString()};function fwe(e){let n=(Array.isArray(e[VS._LAYERS_STORE_PROPERTY])?e[VS._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}is.getConstructedRoute=fwe;function WIt(e){let t=Array.isArray(e[VS._LAYERS_STORE_PROPERTY])?e[VS._LAYERS_STORE_PROPERTY]:[];if(t.length===0)return;if(t.every(i=>i==="/"))return e.originalUrl==="/"?"/":void 0;let n=fwe(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)||XIt(r))?r:void 0}is.getActualMatchedRoute=WIt;function XIt(e){return e.includes(":")||e.includes("*")}});var Awe=M(rR=>{"use strict";m();Object.defineProperty(rR,"__esModule",{value:!0});rR.PACKAGE_NAME=rR.PACKAGE_VERSION=void 0;rR.PACKAGE_VERSION="0.62.0";rR.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var ywe=M(J4=>{"use strict";m();Object.defineProperty(J4,"__esModule",{value:!0});J4.ExpressInstrumentation=void 0;var gwe=vr(),Yc=(He(),Me(tt)),hwe=V4(),_we=Y4(),Xm=mwe(),Ewe=Awe(),oR=un(),eCt=(Xn(),Me(Hr)),K4=FZ(),jZ=class extends oR.InstrumentationBase{constructor(t={}){super(Ewe.PACKAGE_NAME,Ewe.PACKAGE_VERSION,t)}init(){return[new oR.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],t=>{let n=typeof t?.Router?.prototype?.route=="function",r=n?t.Router.prototype:t.Router;return(0,oR.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,oR.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,oR.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,Xm.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,Xm.getLayerPath)(o)),i}}}_getAppUsePatch(t){let n=this;return function(r){return function(...i){let s=t?this.router:this._router,u=r.apply(this,i);if(s){let l=s.stack[s.stack.length-1];n._applyPatch(l,(0,Xm.getLayerPath)(i))}return u}}}_applyPatch(t,n){let r=this;t[K4.kLayerPatched]!==!0&&(t[K4.kLayerPatched]=!0,this._wrap(t,"handle",o=>{if(o.length===4)return o;let i=function(s,u){let{isLayerPathStored:l}=(0,Xm.storeLayerPath)(s,n),f=(0,Xm.getConstructedRoute)(s),h=(0,Xm.getActualMatchedRoute)(s),_={[eCt.ATTR_HTTP_ROUTE]:h},y=(0,Xm.getLayerMetadata)(f,t,n),T=y.attributes[_we.AttributeNames.EXPRESS_TYPE],v=(0,gwe.getRPCMetadata)(Yc.context.active());if(v?.type===gwe.RPCType.HTTP&&(v.route=h),(0,Xm.isLayerIgnored)(y.name,T,r.getConfig()))return T===hwe.ExpressLayerType.MIDDLEWARE&&s[K4._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Yc.trace.getSpan(Yc.context.active())===void 0)return o.apply(this,arguments);let R=r._getSpanName({request:s,layerType:T,route:f},y.name),x=r.tracer.startSpan(R,{attributes:Object.assign(_,y.attributes)}),O=Yc.context.active(),P=Yc.trace.setSpan(O,x),{requestHook:j}=r.getConfig();j&&(0,oR.safeExecuteInTheMiddle)(()=>j(x,{request:s,layerType:T,route:f}),re=>{re&&Yc.diag.error("express instrumentation: request hook failed",re)},!0);let G=!1;y.attributes[_we.AttributeNames.EXPRESS_TYPE]===hwe.ExpressLayerType.ROUTER&&(x.end(),G=!0,P=O);let H=()=>{G===!1&&(G=!0,x.end())},V=Array.from(arguments),ae=V.findIndex(re=>typeof re=="function");ae>=0&&(arguments[ae]=function(){let re=arguments[0],_e=![void 0,null,"route","router"].includes(re);if(!G&&_e){let[Tt,ye]=(0,Xm.asErrorAndMessage)(re);x.recordException(Tt),x.setStatus({code:Yc.SpanStatusCode.ERROR,message:ye})}G===!1&&(G=!0,s.res?.removeListener("finish",H),x.end()),!(s.route&&_e)&&l&&s[K4._LAYERS_STORE_PROPERTY].pop();let Qe=V[ae],pt=Yc.context.active(),Ge=Yc.trace.getSpan(O),Pt=Ge?Yc.trace.setSpan(pt,Ge):pt;return Yc.context.bind(Pt,Qe).apply(this,arguments)});try{return Yc.context.bind(P,o).apply(this,arguments)}catch(re){let[_e,Qe]=(0,Xm.asErrorAndMessage)(re);throw x.recordException(_e),x.setStatus({code:Yc.SpanStatusCode.ERROR,message:Qe}),re}finally{G||u.once("finish",H)}};for(let s in o)Object.defineProperty(i,s,{get(){return o[s]},set(u){o[s]=u}});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 Yc.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};J4.ExpressInstrumentation=jZ});var Swe=M(fE=>{"use strict";m();Object.defineProperty(fE,"__esModule",{value:!0});fE.AttributeNames=fE.ExpressLayerType=fE.ExpressInstrumentation=void 0;var tCt=ywe();Object.defineProperty(fE,"ExpressInstrumentation",{enumerable:!0,get:function(){return tCt.ExpressInstrumentation}});var nCt=V4();Object.defineProperty(fE,"ExpressLayerType",{enumerable:!0,get:function(){return nCt.ExpressLayerType}});var rCt=Y4();Object.defineProperty(fE,"AttributeNames",{enumerable:!0,get:function(){return rCt.AttributeNames}})});var Ds,YS=w(()=>{m();Ds=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__});function oCt(e){qr(e,"auto.http.otel.express");let t=kt(e).data,n=t["express.type"];n&&e.setAttribute(Xt,`${n}.express`);let r=t["express.name"];typeof r=="string"&&e.updateName(r)}function iCt(e,t){if(Rn()===Zd())return Ds&&W.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";Rn().setTransactionName(`${r} ${e.route}`)}return t}var Twe,bwe,Iwe,sCt,Cwe,vwe=w(()=>{m();Twe=ue(Swe(),1);At();_r();YS();bwe="Express";Iwe=ct(bwe,()=>new Twe.ExpressInstrumentation({requestHook:e=>oCt(e),spanNameHook:(e,t)=>iCt(e,t)})),sCt=(()=>({name:bwe,setupOnce(){Iwe()}})),Cwe=sCt});var Rwe=M(jw=>{"use strict";m();Object.defineProperty(jw,"__esModule",{value:!0});jw.SeverityNumber=void 0;var aCt;(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"})(aCt=jw.SeverityNumber||(jw.SeverityNumber={}))});var X4=M(iR=>{"use strict";m();Object.defineProperty(iR,"__esModule",{value:!0});iR.NOOP_LOGGER=iR.NoopLogger=void 0;var W4=class{emit(t){}};iR.NoopLogger=W4;iR.NOOP_LOGGER=new W4});var xwe=M(eA=>{"use strict";m();Object.defineProperty(eA,"__esModule",{value:!0});eA.API_BACKWARDS_COMPATIBILITY_VERSION=eA.makeGetter=eA._global=eA.GLOBAL_LOGS_API_KEY=void 0;eA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");eA._global=globalThis;function uCt(e,t,n){return r=>r===e?t:n}eA.makeGetter=uCt;eA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var zZ=M(sR=>{"use strict";m();Object.defineProperty(sR,"__esModule",{value:!0});sR.NOOP_LOGGER_PROVIDER=sR.NoopLoggerProvider=void 0;var cCt=X4(),e3=class{getLogger(t,n,r){return new cCt.NoopLogger}};sR.NoopLoggerProvider=e3;sR.NOOP_LOGGER_PROVIDER=new e3});var Dwe=M(t3=>{"use strict";m();Object.defineProperty(t3,"__esModule",{value:!0});t3.ProxyLogger=void 0;var lCt=X4(),HZ=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):lCt.NOOP_LOGGER}};t3.ProxyLogger=HZ});var Nwe=M(n3=>{"use strict";m();Object.defineProperty(n3,"__esModule",{value:!0});n3.ProxyLoggerProvider=void 0;var dCt=zZ(),pCt=Dwe(),$Z=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new pCt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:dCt.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=$Z});var wwe=M(r3=>{"use strict";m();Object.defineProperty(r3,"__esModule",{value:!0});r3.LogsAPI=void 0;var op=xwe(),fCt=zZ(),Bwe=Nwe(),qZ=class e{constructor(){this._proxyLoggerProvider=new Bwe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return op._global[op.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(op._global[op.GLOBAL_LOGS_API_KEY]=(0,op.makeGetter)(op.API_BACKWARDS_COMPATIBILITY_VERSION,t,fCt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=op._global[op.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(op._global,op.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete op._global[op.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Bwe.ProxyLoggerProvider}};r3.LogsAPI=qZ});var VZ=M(tA=>{"use strict";m();Object.defineProperty(tA,"__esModule",{value:!0});tA.logs=tA.NoopLogger=tA.NOOP_LOGGER=tA.SeverityNumber=void 0;var mCt=Rwe();Object.defineProperty(tA,"SeverityNumber",{enumerable:!0,get:function(){return mCt.SeverityNumber}});var Owe=X4();Object.defineProperty(tA,"NOOP_LOGGER",{enumerable:!0,get:function(){return Owe.NOOP_LOGGER}});Object.defineProperty(tA,"NoopLogger",{enumerable:!0,get:function(){return Owe.NoopLogger}});var ACt=wwe();tA.logs=ACt.LogsAPI.getInstance()});var kwe=M(aR=>{"use strict";m();Object.defineProperty(aR,"__esModule",{value:!0});aR.disableInstrumentations=aR.enableInstrumentations=void 0;function gCt(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()}}aR.enableInstrumentations=gCt;function hCt(e){e.forEach(t=>t.disable())}aR.disableInstrumentations=hCt});var Lwe=M(o3=>{"use strict";m();Object.defineProperty(o3,"__esModule",{value:!0});o3.registerInstrumentations=void 0;var Pwe=(He(),Me(tt)),_Ct=VZ(),Mwe=kwe();function ECt(e){let t=e.tracerProvider||Pwe.trace.getTracerProvider(),n=e.meterProvider||Pwe.metrics.getMeterProvider(),r=e.loggerProvider||_Ct.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Mwe.enableInstrumentations)(o,t,n,r),()=>{(0,Mwe.disableInstrumentations)(o)}}o3.registerInstrumentations=ECt});var qwe=M(i3=>{"use strict";m();Object.defineProperty(i3,"__esModule",{value:!0});i3.satisfies=void 0;var ZZ=(He(),Me(tt)),jwe=/^(?: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-]+)*))?$/,yCt=/^(?<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-]+)*))?$/,SCt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function TCt(e,t,n){if(!bCt(e))return ZZ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=RCt(e);if(!r)return!1;let o=[],i=zwe(r,t,o,n);return i&&!n?.includePrerelease?CCt(r,o):i}i3.satisfies=TCt;function bCt(e){return typeof e=="string"&&jwe.test(e)}function zwe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(YZ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=YCt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!YZ(e,i,n,r))return!1;return!0}return YZ(e,t,n,r)}function YZ(e,t,n,r){if(t=vCt(t,r),t.includes(" "))return zwe(e,t,n,r);{let o=xCt(t);return n.push(o),ICt(e,o)}}function ICt(e,t){if(t.invalid)return!1;if(!t.version||JZ(t.version))return!0;let n=Qwe(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=Qwe(r,o)}return SCt[t.op]?.includes(n)}function CCt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function vCt(e,t){return e=e.trim(),e=qCt(e,t),e=$Ct(e),e=VCt(e,t),e=e.trim(),e}function Xu(e){return!e||e.toLowerCase()==="x"||e==="*"}function RCt(e){let t=e.match(jwe);if(!t){ZZ.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 xCt(e){if(!e)return{};let t=e.match(yCt);if(!t)return ZZ.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("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function JZ(e){return e==="*"||e==="x"||e==="X"}function Uwe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function DCt(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 NCt(e,t){if(JZ(e)||JZ(t))return 0;let[n,r]=DCt(Uwe(e),Uwe(t));return n>r?1:n<r?-1:0}function Qwe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=NCt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var Hwe="[a-zA-Z0-9-]",$we="0|[1-9]\\d*",BCt=`\\d*[a-zA-Z-]${Hwe}*`,wCt="((?:<|>)?=?)",Fwe=`(?:${$we}|${BCt})`,OCt=`(?:-(${Fwe}(?:\\.${Fwe})*))`,Gwe=`${Hwe}+`,kCt=`(?:\\+(${Gwe}(?:\\.${Gwe})*))`,KZ=`${$we}|x|X|\\*`,zw=`[v=\\s]*(${KZ})(?:\\.(${KZ})(?:\\.(${KZ})(?:${OCt})?${kCt}?)?)?`,PCt=`^${wCt}\\s*${zw}$`,MCt=new RegExp(PCt),LCt=`^\\s*(${zw})\\s+-\\s+(${zw})\\s*$`,UCt=new RegExp(LCt),QCt="(?:~>?)",FCt=`^${QCt}${zw}$`,GCt=new RegExp(FCt),jCt="(?:\\^)",zCt=`^${jCt}${zw}$`,HCt=new RegExp(zCt);function $Ct(e){let t=GCt;return e.replace(t,(n,r,o,i,s)=>{let u;return Xu(r)?u="":Xu(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:Xu(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function qCt(e,t){let n=HCt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return Xu(i)?f="":Xu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Xu(u)?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}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function VCt(e,t){let n=MCt;return e.replace(n,(r,o,i,s,u,l)=>{let f=Xu(i),h=f||Xu(s),_=h||Xu(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function YCt(e,t){let n=UCt;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>(Xu(i)?o="":Xu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Xu(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Xu(_)?h="":Xu(y)?h=`<${+_+1}.0.0-0`:Xu(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var WZ=M(Pa=>{"use strict";m();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.massUnwrap=Pa.unwrap=Pa.massWrap=Pa.wrap=void 0;var ec=console.error.bind(console);function Hw(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 KCt=(e,t,n)=>{if(!e||!e[t]){ec("no original function "+String(t)+" to wrap");return}if(!n){ec("no wrapper function"),ec(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){ec("original object and wrapper must be functions");return}let o=n(r,t);return Hw(o,"__original",r),Hw(o,"__unwrap",()=>{e[t]===o&&Hw(e,t,r)}),Hw(o,"__wrapped",!0),Hw(e,t,o),o};Pa.wrap=KCt;var JCt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ec("must provide one or more modules to patch"),ec(new Error().stack);return}if(!(t&&Array.isArray(t))){ec("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Pa.wrap)(r,o,n)})})};Pa.massWrap=JCt;var ZCt=(e,t)=>{if(!e||!e[t]){ec("no function to unwrap."),ec(new Error().stack);return}let n=e[t];if(!n.__unwrap)ec("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Pa.unwrap=ZCt;var WCt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{ec("must provide one or more modules to patch"),ec(new Error().stack);return}if(!(t&&Array.isArray(t))){ec("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Pa.unwrap)(n,r)})})};Pa.massUnwrap=WCt;function $w(e){e&&e.logger&&(typeof e.logger!="function"?ec("new logger isn't a function, not replacing"):ec=e.logger)}Pa.default=$w;$w.wrap=Pa.wrap;$w.massWrap=Pa.massWrap;$w.unwrap=Pa.unwrap;$w.massUnwrap=Pa.massUnwrap});var Vwe=M(a3=>{"use strict";m();Object.defineProperty(a3,"__esModule",{value:!0});a3.InstrumentationAbstract=void 0;var XZ=(He(),Me(tt)),XCt=VZ(),s3=WZ(),eW=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=XZ.diag.createComponentLogger({namespace:t}),this._tracer=XZ.trace.getTracer(t,n),this._meter=XZ.metrics.getMeter(t,n),this._logger=XCt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=s3.wrap;_unwrap=s3.unwrap;_massWrap=s3.massWrap;_massUnwrap=s3.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)}}};a3.InstrumentationAbstract=eW});var Ywe=M(mE=>{"use strict";m();Object.defineProperty(mE,"__esModule",{value:!0});mE.ModuleNameTrie=mE.ModuleNameSeparator=void 0;mE.ModuleNameSeparator="/";var u3=class{hooks=[];children=new Map},tW=class{_trie=new u3;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(mE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new u3,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 u of t.split(mE.ModuleNameSeparator)){let l=o.children.get(u);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((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};mE.ModuleNameTrie=tW});var Jwe=M(c3=>{"use strict";m();Object.defineProperty(c3,"__esModule",{value:!0});c3.RequireInTheMiddleSingleton=void 0;var evt=ES(),Kwe=Ue("path"),nW=Ywe(),tvt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),rW=class e{_moduleNameTrie=new nW.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new evt.Hook(null,{internals:!0},(t,n,r)=>{let o=nvt(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 tvt?new e:this._instance=this._instance??new e}};c3.RequireInTheMiddleSingleton=rW;function nvt(e){return Kwe.sep!==nW.ModuleNameSeparator?e.split(Kwe.sep).join(nW.ModuleNameSeparator):e}});var tOe=M(qw=>{m();var Zwe=[],oW=new WeakMap,Wwe=new WeakMap,Xwe=new Map,eOe=[],rvt={set(e,t,n){let r=oW.get(e),o=r&&r[t];return typeof o=="function"?o(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=Wwe.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=oW.get(e),o=r&&r[t];return typeof o=="function"?o(n.value):!0}};function ovt(e,t,n,r,o){Xwe.set(e,o),oW.set(t,n),Wwe.set(t,r);let i=new Proxy(t,rvt);Zwe.forEach(s=>s(e,i,o)),eOe.push([e,i,o])}qw.register=ovt;qw.importHooks=Zwe;qw.specifiers=Xwe;qw.toHook=eOe});var uW=M((gDn,cR)=>{m();var nOe=Ue("path"),ivt=qU(),{fileURLToPath:svt}=Ue("url"),{MessageChannel:avt}=Ue("worker_threads"),{isBuiltin:iW}=Ue("module");iW||(iW=()=>!0);var{importHooks:sW,specifiers:uvt,toHook:cvt}=tOe();function rOe(e){sW.push(e),cvt.forEach(([t,n,r])=>e(t,n,r))}function oOe(e){let t=sW.indexOf(e);t>-1&&sW.splice(t,1)}function uR(e,t,n,r){let o=e(t,n,r);o&&o!==t&&"default"in t&&(t.default=o)}var aW;function lvt(){let{port1:e,port2:t}=new avt,n=0,r;aW=u=>{n++,e.postMessage(u)},e.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let u=setInterval(()=>{},1e3),l=new Promise(f=>{r=f}).then(()=>{clearInterval(u)});return n===0&&r(),l}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:o}}function Vw(e,t,n){if(!(this instanceof Vw))return new Vw(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;aW&&Array.isArray(e)&&aW(e),this._iitmHook=(o,i,s)=>{let u=o,l=u.startsWith("node:"),f,h;if(l){let _=o.slice(5);iW(_)&&(o=_)}else if(u.startsWith("file://")){let _=Error.stackTraceLimit;Error.stackTraceLimit=0;try{f=svt(o),o=f}catch{}if(Error.stackTraceLimit=_,f){let y=ivt(f);y&&(o=y.name,h=y.basedir)}}if(e)for(let _ of e)if(f&&_===f)uR(n,i,f,void 0);else if(_===o){if(!h)uR(n,i,o,h);else if(h.endsWith(uvt.get(u)))uR(n,i,o,h);else if(r){let y=o+nOe.sep+nOe.relative(h,f);uR(n,i,y,h)}}else _===s&&uR(n,i,s,h);else uR(n,i,o,h)},rOe(this._iitmHook)}Vw.prototype.unhook=function(){oOe(this._iitmHook)};cR.exports=Vw;cR.exports.Hook=Vw;cR.exports.addHook=rOe;cR.exports.removeHook=oOe;cR.exports.createAddHookMessageChannel=lvt});var cW=M(AE=>{"use strict";m();Object.defineProperty(AE,"__esModule",{value:!0});AE.isWrapped=AE.safeExecuteInTheMiddleAsync=AE.safeExecuteInTheMiddle=void 0;function dvt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}AE.safeExecuteInTheMiddle=dvt;async function pvt(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}}AE.safeExecuteInTheMiddleAsync=pvt;function fvt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}AE.isWrapped=fvt});var aOe=M(l3=>{"use strict";m();Object.defineProperty(l3,"__esModule",{value:!0});l3.InstrumentationBase=void 0;var Yw=Ue("path"),iOe=Ue("util"),mvt=qwe(),lW=WZ(),Avt=Vwe(),gvt=Jwe(),hvt=uW(),Kw=(He(),Me(tt)),_vt=ES(),Evt=Ue("fs"),yvt=cW(),dW=class extends Avt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=gvt.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,yvt.isWrapped)(t[n])&&this._unwrap(t,n),iOe.types.isProxy(t)){let o=(0,lW.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,lW.wrap)(t,n,r)};_unwrap=(t,n)=>iOe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,lW.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Kw.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Kw.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{Kw.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Kw.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=Ue.resolve(n);Ue.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,Evt.readFileSync)(Yw.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Kw.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 sOe(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??[],u=Yw.normalize(r);return s.filter(f=>f.name===u&&sOe(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,u,l)=>{if(!l&&Yw.isAbsolute(u)){let f=Yw.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=Yw.isAbsolute(t.name)?new _vt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new hvt.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}};l3.InstrumentationBase=dW;function sOe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,mvt.satisfies)(t,r,{includePrerelease:n}))}});var uOe=M(d3=>{"use strict";m();Object.defineProperty(d3,"__esModule",{value:!0});d3.normalize=void 0;var Svt=Ue("path");Object.defineProperty(d3,"normalize",{enumerable:!0,get:function(){return Svt.normalize}})});var cOe=M(lR=>{"use strict";m();Object.defineProperty(lR,"__esModule",{value:!0});lR.normalize=lR.InstrumentationBase=void 0;var Tvt=aOe();Object.defineProperty(lR,"InstrumentationBase",{enumerable:!0,get:function(){return Tvt.InstrumentationBase}});var bvt=uOe();Object.defineProperty(lR,"normalize",{enumerable:!0,get:function(){return bvt.normalize}})});var pW=M(dR=>{"use strict";m();Object.defineProperty(dR,"__esModule",{value:!0});dR.normalize=dR.InstrumentationBase=void 0;var lOe=cOe();Object.defineProperty(dR,"InstrumentationBase",{enumerable:!0,get:function(){return lOe.InstrumentationBase}});Object.defineProperty(dR,"normalize",{enumerable:!0,get:function(){return lOe.normalize}})});var dOe=M(p3=>{"use strict";m();Object.defineProperty(p3,"__esModule",{value:!0});p3.InstrumentationNodeModuleDefinition=void 0;var fW=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}};p3.InstrumentationNodeModuleDefinition=fW});var pOe=M(f3=>{"use strict";m();Object.defineProperty(f3,"__esModule",{value:!0});f3.InstrumentationNodeModuleFile=void 0;var Ivt=pW(),mW=class{name;supportedVersions;patch;unpatch;constructor(t,n,r,o){this.name=(0,Ivt.normalize)(t),this.supportedVersions=n,this.patch=r,this.unpatch=o}};f3.InstrumentationNodeModuleFile=mW});var fOe=M(KS=>{"use strict";m();Object.defineProperty(KS,"__esModule",{value:!0});KS.semconvStabilityFromStr=KS.SemconvStability=void 0;var m3;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(m3=KS.SemconvStability||(KS.SemconvStability={}));function Cvt(e,t){let n=m3.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=m3.DUPLICATE;break}else o.toLowerCase()===e&&(n=m3.STABLE);return n}KS.semconvStabilityFromStr=Cvt});var AOe=M(ss=>{"use strict";m();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 vvt=Lwe();Object.defineProperty(ss,"registerInstrumentations",{enumerable:!0,get:function(){return vvt.registerInstrumentations}});var Rvt=pW();Object.defineProperty(ss,"InstrumentationBase",{enumerable:!0,get:function(){return Rvt.InstrumentationBase}});var xvt=dOe();Object.defineProperty(ss,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return xvt.InstrumentationNodeModuleDefinition}});var Dvt=pOe();Object.defineProperty(ss,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return Dvt.InstrumentationNodeModuleFile}});var AW=cW();Object.defineProperty(ss,"isWrapped",{enumerable:!0,get:function(){return AW.isWrapped}});Object.defineProperty(ss,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return AW.safeExecuteInTheMiddle}});Object.defineProperty(ss,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return AW.safeExecuteInTheMiddleAsync}});var mOe=fOe();Object.defineProperty(ss,"SemconvStability",{enumerable:!0,get:function(){return mOe.SemconvStability}});Object.defineProperty(ss,"semconvStabilityFromStr",{enumerable:!0,get:function(){return mOe.semconvStabilityFromStr}})});var gOe=M((LDn,Nvt)=>{Nvt.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 _Oe=M(JS=>{"use strict";m();Object.defineProperty(JS,"__esModule",{value:!0});JS.range=JS.balanced=void 0;var Bvt=(e,t,n)=>{let r=e instanceof RegExp?hOe(e,n):e,o=t instanceof RegExp?hOe(t,n):t,i=r!==null&&o!=null&&(0,JS.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)}};JS.balanced=Bvt;var hOe=(e,t)=>{let n=t.match(e);return n?n[0]:null},wvt=(e,t,n)=>{let r,o,i,s,u,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&&!u;){if(h===l)r.push(h),l=n.indexOf(e,h+1);else if(r.length===1){let _=r.pop();_!==void 0&&(u=[_,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&&(u=[i,s])}return u};JS.range=wvt});var COe=M(pR=>{"use strict";m();Object.defineProperty(pR,"__esModule",{value:!0});pR.EXPANSION_MAX=void 0;pR.expand=$vt;var EOe=_Oe(),yOe="\0SLASH"+Math.random()+"\0",SOe="\0OPEN"+Math.random()+"\0",hW="\0CLOSE"+Math.random()+"\0",TOe="\0COMMA"+Math.random()+"\0",bOe="\0PERIOD"+Math.random()+"\0",Ovt=new RegExp(yOe,"g"),kvt=new RegExp(SOe,"g"),Pvt=new RegExp(hW,"g"),Mvt=new RegExp(TOe,"g"),Lvt=new RegExp(bOe,"g"),Uvt=/\\\\/g,Qvt=/\\{/g,Fvt=/\\}/g,Gvt=/\\,/g,jvt=/\\\./g;pR.EXPANSION_MAX=1e5;function gW(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function zvt(e){return e.replace(Uvt,yOe).replace(Qvt,SOe).replace(Fvt,hW).replace(Gvt,TOe).replace(jvt,bOe)}function Hvt(e){return e.replace(Ovt,"\\").replace(kvt,"{").replace(Pvt,"}").replace(Mvt,",").replace(Lvt,".")}function IOe(e){if(!e)return[""];let t=[],n=(0,EOe.balanced)("{","}",e);if(!n)return e.split(",");let{pre:r,body:o,post:i}=n,s=r.split(",");s[s.length-1]+="{"+o+"}";let u=IOe(i);return i.length&&(s[s.length-1]+=u.shift(),s.push.apply(s,u)),t.push.apply(t,s),t}function $vt(e,t={}){if(!e)return[];let{max:n=pR.EXPANSION_MAX}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Jw(zvt(e),n,!0).map(Hvt)}function qvt(e){return"{"+e+"}"}function Vvt(e){return/^-?0\d/.test(e)}function Yvt(e,t){return e<=t}function Kvt(e,t){return e>=t}function Jw(e,t,n){let r=[],o=(0,EOe.balanced)("{","}",e);if(!o)return[e];let i=o.pre,s=o.post.length?Jw(o.post,t,!1):[""];if(/\$$/.test(o.pre))for(let u=0;u<s.length&&u<t;u++){let l=i+"{"+o.body+"}"+s[u];r.push(l)}else{let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=u||l,h=o.body.indexOf(",")>=0;if(!f&&!h)return o.post.match(/,(?!,).*\}/)?(e=o.pre+"{"+o.body+hW+o.post,Jw(e,t,!0)):[e];let _;if(f)_=o.body.split(/\.\./);else if(_=IOe(o.body),_.length===1&&_[0]!==void 0&&(_=Jw(_[0],t,!1).map(qvt),_.length===1))return s.map(T=>o.pre+_[0]+T);let y;if(f&&_[0]!==void 0&&_[1]!==void 0){let T=gW(_[0]),v=gW(_[1]),R=Math.max(_[0].length,_[1].length),x=_.length===3&&_[2]!==void 0?Math.max(Math.abs(gW(_[2])),1):1,O=Yvt;v<T&&(x*=-1,O=Kvt);let j=_.some(Vvt);y=[];for(let G=T;O(G,v)&&y.length<t;G+=x){let H;if(l)H=String.fromCharCode(G),H==="\\"&&(H="");else if(H=String(G),j){let V=R-H.length;if(V>0){let ae=new Array(V+1).join("0");G<0?H="-"+ae+H.slice(1):H=ae+H}}y.push(H)}}else{y=[];for(let T=0;T<_.length;T++)y.push.apply(y,Jw(_[T],t,!1))}for(let T=0;T<y.length;T++)for(let v=0;v<s.length&&r.length<t;v++){let R=i+y[T]+s[v];(!n||f||R)&&r.push(R)}}return r}});var vOe=M(A3=>{"use strict";m();Object.defineProperty(A3,"__esModule",{value:!0});A3.assertValidPattern=void 0;var Jvt=1024*64,Zvt=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Jvt)throw new TypeError("pattern is too long")};A3.assertValidPattern=Zvt});var xOe=M(g3=>{"use strict";m();Object.defineProperty(g3,"__esModule",{value:!0});g3.parseClass=void 0;var Wvt={"[: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]},Zw=e=>e.replace(/[[\]\\-]/g,"\\$&"),Xvt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ROe=e=>e.join(""),eRt=(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,u=!1,l=!1,f=!1,h=n,_="";e:for(;i<e.length;){let R=e.charAt(i);if((R==="!"||R==="^")&&i===n+1){f=!0,i++;continue}if(R==="]"&&s&&!l){h=i+1;break}if(s=!0,R==="\\"&&!l){l=!0,i++;continue}if(R==="["&&!l){for(let[x,[O,P,j]]of Object.entries(Wvt))if(e.startsWith(x,i)){if(_)return["$.",!1,e.length-n,!0];i+=x.length,j?o.push(O):r.push(O),u=u||P;continue e}}if(l=!1,_){R>_?r.push(Zw(_)+"-"+Zw(R)):R===_&&r.push(Zw(R)),_="",i++;continue}if(e.startsWith("-]",i+1)){r.push(Zw(R+"-")),i+=2;continue}if(e.startsWith("-",i+1)){_=R,i+=2;continue}r.push(Zw(R)),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 R=r[0].length===2?r[0].slice(-1):r[0];return[Xvt(R),!1,h-n,!1]}let y="["+(f?"^":"")+ROe(r)+"]",T="["+(f?"":"^")+ROe(o)+"]";return[r.length&&o.length?"("+y+"|"+T+")":r.length?y:T,u,h-n,!0]};g3.parseClass=eRt});var _3=M(h3=>{"use strict";m();Object.defineProperty(h3,"__esModule",{value:!0});h3.unescape=void 0;var tRt=(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");h3.unescape=tRt});var yW=M(T3=>{"use strict";m();var Kc;Object.defineProperty(T3,"__esModule",{value:!0});T3.AST=void 0;var nRt=xOe(),E3=_3(),rRt=new Set(["!","?","+","*","@"]),_W=e=>rRt.has(e),DOe=e=>_W(e.type),oRt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),iRt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),sRt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),NOe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),aRt="(?!(?:^|/)\\.\\.?(?:$|/))",y3="(?!\\.)",uRt=new Set(["[","."]),cRt=new Set(["..","."]),lRt=new Set("().*{}+?[]^$\\!"),dRt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),EW="[^/]",BOe=EW+"*?",wOe=EW+"+?",pRt=0,S3=class{type;#n;#r;#o=!1;#e=[];#t;#a;#c;#u=!1;#i;#s;#l=!1;id=++pRt;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 Kc&&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 Kc&&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 Kc(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,u=!1,l=!1,f=-1,h=!1;if(n.type===null){let R=r,x="";for(;R<t.length;){let O=t.charAt(R++);if(u||O==="\\"){u=!u,x+=O;continue}if(l){R===f+1?(O==="^"||O==="!")&&(h=!0):O==="]"&&!(R===f+2&&h)&&(l=!1),x+=O;continue}else if(O==="["){l=!0,f=R,h=!1,x+=O;continue}if(!o.noext&&_W(O)&&t.charAt(R)==="("&&i<=s){n.push(x),x="";let j=new Kc(O,n);R=Kc.#d(t,j,R,o,i+1),n.push(j);continue}x+=O}return n.push(x),R}let _=r+1,y=new Kc(null,n),T=[],v="";for(;_<t.length;){let R=t.charAt(_++);if(u||R==="\\"){u=!u,v+=R;continue}if(l){_===f+1?(R==="^"||R==="!")&&(h=!0):R==="]"&&!(_===f+2&&h)&&(l=!1),v+=R;continue}else if(R==="["){l=!0,f=_,h=!1,v+=R;continue}if(!o.noext&&_W(R)&&t.charAt(_)==="("&&(i<=s||n&&n.#p(R))){let O=n&&n.#p(R)?0:1;y.push(v),v="";let P=new Kc(R,y);y.push(P),_=Kc.#d(t,P,_,o,i+O);continue}if(R==="|"){y.push(v),v="",T.push(y),y=new Kc(null,n);continue}if(R===")")return v===""&&n.#e.length===0&&(n.#l=!0),y.push(v),v="",n.push(...T,y),_;v+=R}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],_}#_(t){return this.#m(t,iRt)}#m(t,n=oRt){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=sRt){return!!n.get(this.type)?.includes(t)}#E(t,n){let r=t.#e[0],o=new Kc(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!!NOe.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=NOe.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 Kc(null,void 0,n);return Kc.#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 u=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,u),{_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()),!DOe(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(T=>typeof T!="string"),f=this.#e.map(T=>{let[v,R,x,O]=typeof T=="string"?Kc.#b(T,this.#r,l):T.toRegExpSource(t);return this.#r=this.#r||x,this.#o=this.#o||O,v}).join(""),h="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&cRt.has(this.#e[0]))){let v=uRt,R=n&&v.has(f.charAt(0))||f.startsWith("\\.")&&v.has(f.charAt(2))||f.startsWith("\\.\\.")&&v.has(f.charAt(4)),x=!n&&!t&&v.has(f.charAt(0));h=R?aRt:x?y3:""}let _="";return this.isEnd()&&this.#n.#u&&this.#t?.type==="!"&&(_="(?:$|\\/)"),[h+f+_,(0,E3.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,E3.unescape)(this.toString()),!1,!1]}let s=!r||t||n||!y3?"":this.#g(!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let u="";if(this.type==="!"&&this.#l)u=(this.isStart()&&!n?y3:"")+wOe;else{let l=this.type==="!"?"))"+(this.isStart()&&!n&&!t?y3:"")+BOe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;u=o+i+l}return[u,(0,E3.unescape)(i),this.#r=!!this.#r,this.#o]}#f(){if(DOe(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#b(t,n,r=!1){let o=!1,i="",s=!1,u=!1;for(let l=0;l<t.length;l++){let f=t.charAt(l);if(o){o=!1,i+=(lRt.has(f)?"\\":"")+f;continue}if(f==="*"){if(u)continue;u=!0,i+=r&&/^[*]+$/.test(t)?wOe:BOe,n=!0;continue}else u=!1;if(f==="\\"){l===t.length-1?i+="\\\\":o=!0;continue}if(f==="["){let[h,_,y,T]=(0,nRt.parseClass)(t,l);if(y){i+=h,s=s||_,l+=y-1,n=n||T;continue}}if(f==="?"){i+=EW,n=!0;continue}i+=dRt(f)}return[i,(0,E3.unescape)(t),!!n,s]}};T3.AST=S3;Kc=S3});var SW=M(b3=>{"use strict";m();Object.defineProperty(b3,"__esModule",{value:!0});b3.escape=void 0;var fRt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");b3.escape=fRt});var QOe=M(gt=>{"use strict";m();Object.defineProperty(gt,"__esModule",{value:!0});gt.unescape=gt.escape=gt.AST=gt.Minimatch=gt.match=gt.makeRe=gt.braceExpand=gt.defaults=gt.filter=gt.GLOBSTAR=gt.sep=gt.minimatch=void 0;var mRt=COe(),I3=vOe(),POe=yW(),ARt=SW(),gRt=_3(),hRt=(e,t,n={})=>((0,I3.assertValidPattern)(t),!n.nocomment&&t.charAt(0)==="#"?!1:new ZS(t,n).match(e));gt.minimatch=hRt;var _Rt=/^\*+([^+@!?\*\[\(]*)$/,ERt=e=>t=>!t.startsWith(".")&&t.endsWith(e),yRt=e=>t=>t.endsWith(e),SRt=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),TRt=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),bRt=/^\*+\.\*+$/,IRt=e=>!e.startsWith(".")&&e.includes("."),CRt=e=>e!=="."&&e!==".."&&e.includes("."),vRt=/^\.\*+$/,RRt=e=>e!=="."&&e!==".."&&e.startsWith("."),xRt=/^\*+$/,DRt=e=>e.length!==0&&!e.startsWith("."),NRt=e=>e.length!==0&&e!=="."&&e!=="..",BRt=/^\?+([^+@!?\*\[\(]*)?$/,wRt=([e,t=""])=>{let n=MOe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},ORt=([e,t=""])=>{let n=LOe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},kRt=([e,t=""])=>{let n=LOe([e]);return t?r=>n(r)&&r.endsWith(t):n},PRt=([e,t=""])=>{let n=MOe([e]);return t?r=>n(r)&&r.endsWith(t):n},MOe=([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},LOe=([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},UOe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",OOe={win32:{sep:"\\"},posix:{sep:"/"}};gt.sep=UOe==="win32"?OOe.win32.sep:OOe.posix.sep;gt.minimatch.sep=gt.sep;gt.GLOBSTAR=Symbol("globstar **");gt.minimatch.GLOBSTAR=gt.GLOBSTAR;var MRt="[^/]",LRt=MRt+"*?",URt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",QRt="(?:(?!(?:\\/|^)\\.).)*?",FRt=(e,t={})=>n=>(0,gt.minimatch)(n,e,t);gt.filter=FRt;gt.minimatch.filter=gt.filter;var ip=(e,t={})=>Object.assign({},e,t),GRt=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return gt.minimatch;let t=gt.minimatch;return Object.assign((r,o,i={})=>t(r,o,ip(e,i)),{Minimatch:class extends t.Minimatch{constructor(o,i={}){super(o,ip(e,i))}static defaults(o){return t.defaults(ip(e,o)).Minimatch}},AST:class extends t.AST{constructor(o,i,s={}){super(o,i,ip(e,s))}static fromGlob(o,i={}){return t.AST.fromGlob(o,ip(e,i))}},unescape:(r,o={})=>t.unescape(r,ip(e,o)),escape:(r,o={})=>t.escape(r,ip(e,o)),filter:(r,o={})=>t.filter(r,ip(e,o)),defaults:r=>t.defaults(ip(e,r)),makeRe:(r,o={})=>t.makeRe(r,ip(e,o)),braceExpand:(r,o={})=>t.braceExpand(r,ip(e,o)),match:(r,o,i={})=>t.match(r,o,ip(e,i)),sep:t.sep,GLOBSTAR:gt.GLOBSTAR})};gt.defaults=GRt;gt.minimatch.defaults=gt.defaults;var jRt=(e,t={})=>((0,I3.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,mRt.expand)(e,{max:t.braceExpandMax}));gt.braceExpand=jRt;gt.minimatch.braceExpand=gt.braceExpand;var zRt=(e,t={})=>new ZS(e,t).makeRe();gt.makeRe=zRt;gt.minimatch.makeRe=gt.makeRe;var HRt=(e,t,n={})=>{let r=new ZS(t,n);return e=e.filter(o=>r.match(o)),r.options.nonull&&!e.length&&e.push(t),e};gt.match=HRt;gt.minimatch.match=gt.match;var kOe=/[?*]|[+@!]\(.*?\)|\[|\]/,$Rt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ZS=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){(0,I3.assertValidPattern)(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||UOe,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,u)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=i[0]===""&&i[1]===""&&(i[2]==="?"||!kOe.test(i[2]))&&!kOe.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 u=r[o+1],l=r[o+2],f=r[o+3];if(u!==".."||!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 u=r[s];s===1&&u===""&&r[0]===""||(u==="."||u==="")&&(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=[],u="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])s.push(u==="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(u==="b")return!1;u="a",s.push(t[o]),o++,i++}else if(n[i]==="*"&&t[o]&&(this.options.dot||!t[o].startsWith("."))&&t[o]!=="**"){if(u==="a")return!1;u="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 u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!u&&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]),_=l?3:u?0:void 0,y=h?3:f?0:void 0;if(typeof _=="number"&&typeof y=="number"){let[T,v]=[t[_],n[y]];T.toLowerCase()===v.toLowerCase()&&(n[y]=T,i=y,o=_)}}let{optimizationLevel:s=1}=this.options;return s>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(gt.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(gt.GLOBSTAR,i),u=n.lastIndexOf(gt.GLOBSTAR),[l,f,h]=r?[n.slice(i,s),n.slice(s+1),[]]:[n.slice(i,s),n.slice(s+1,u),n.slice(u+1)];if(l.length){let P=t.slice(o,o+l.length);if(!this.#o(P,l,r,0,0))return!1;o+=l.length,i+=l.length}let _=0;if(h.length){if(h.length+o>t.length)return!1;let P=t.length-h.length;if(this.#o(t,h,r,P,0))_=h.length;else{if(t[t.length-1]!==""||o+h.length===t.length||(P--,!this.#o(t,h,r,P,0)))return!1;_=h.length+1}}if(!f.length){let P=!!_;for(let j=o;j<t.length-_;j++){let G=String(t[j]);if(P=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||P}let y=[[[],0]],T=y[0],v=0,R=[0];for(let P of f)P===gt.GLOBSTAR?(R.push(v),T=[[],0],y.push(T)):(T[0].push(P),v++);let x=y.length-1,O=t.length-_;for(let P of y)P[1]=O-(R[x--]+P[0].length);return!!this.#r(t,y,o,0,r,0,!!_)}#r(t,n,r,o,i,s,u){let l=n[o];if(!l){for(let _=r;_<t.length;_++){u=!0;let y=t[_];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1}return u}let[f,h]=l;for(;r<=h;){if(this.#o(t.slice(0,r+f.length),f,i,r,0)&&s<this.maxGlobstarRecursion){let T=this.#r(t,n,r+f.length,o+1,i,s+1,u);if(T!==!1)return T}let y=t[r];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1;r++}return i||null}#o(t,n,r,o,i){let s,u,l,f;for(s=o,u=i,f=t.length,l=n.length;s<f&&u<l;s++,u++){this.debug("matchOne loop");let h=n[u],_=t[s];if(this.debug(n,h,_),h===!1||h===gt.GLOBSTAR)return!1;let y;if(typeof h=="string"?(y=_===h,this.debug("string match",h,_,y)):(y=h.test(_),this.debug("pattern match",h,_,y)),!y)return!1}if(s===f&&u===l)return!0;if(s===f)return r;if(u===l)return s===f-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return(0,gt.braceExpand)(this.pattern,this.options)}parse(t){(0,I3.assertValidPattern)(t);let n=this.options;if(t==="**")return gt.GLOBSTAR;if(t==="")return"";let r,o=null;(r=t.match(xRt))?o=n.dot?NRt:DRt:(r=t.match(_Rt))?o=(n.nocase?n.dot?TRt:SRt:n.dot?yRt:ERt)(r[1]):(r=t.match(BRt))?o=(n.nocase?n.dot?ORt:wRt:n.dot?kRt:PRt)(r):(r=t.match(bRt))?o=n.dot?CRt:IRt:(r=t.match(vRt))&&(o=RRt);let i=POe.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?LRt:n.dot?URt:QRt,o=new Set(n.nocase?["i"]:[]),i=t.map(l=>{let f=l.map(_=>{if(_ instanceof RegExp)for(let y of _.flags.split(""))o.add(y);return typeof _=="string"?$Rt(_):_===gt.GLOBSTAR?gt.GLOBSTAR:_._src});f.forEach((_,y)=>{let T=f[y+1],v=f[y-1];_!==gt.GLOBSTAR||v===gt.GLOBSTAR||(v===void 0?T!==void 0&&T!==gt.GLOBSTAR?f[y+1]="(?:\\/|"+r+"\\/)?"+T:f[y]=r:T===void 0?f[y-1]=v+"(?:\\/|\\/"+r+")?":T!==gt.GLOBSTAR&&(f[y-1]=v+"(?:\\/|\\/"+r+"\\/)"+T,f[y+1]=gt.GLOBSTAR))});let h=f.filter(_=>_!==gt.GLOBSTAR);if(this.partial&&h.length>=1){let _=[];for(let y=1;y<=h.length;y++)_.push(h.slice(0,y).join("/"));return"(?:"+_.join("|")+")"}return h.join("/")}).join("|"),[s,u]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+u+"$",this.partial&&(i="^(?:\\/|"+s+i.slice(1,-1)+u+")$"),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 u=o.length-2;!s&&u>=0;u--)s=o[u];for(let u=0;u<i.length;u++){let l=i[u],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 gt.minimatch.defaults(t).Minimatch}};gt.Minimatch=ZS;var qRt=yW();Object.defineProperty(gt,"AST",{enumerable:!0,get:function(){return qRt.AST}});var VRt=SW();Object.defineProperty(gt,"escape",{enumerable:!0,get:function(){return VRt.escape}});var YRt=_3();Object.defineProperty(gt,"unescape",{enumerable:!0,get:function(){return YRt.unescape}});gt.minimatch.AST=POe.AST;gt.minimatch.Minimatch=ZS;gt.minimatch.escape=ARt.escape;gt.minimatch.unescape=gRt.unescape});var qOe=M((n1n,IW)=>{"use strict";m();var FOe=Ue("node:diagnostics_channel"),{context:C3,trace:TW,SpanStatusCode:v3,propagation:bW,diag:KRt}=(He(),Me(tt)),{getRPCMetadata:JRt,RPCType:ZRt}=vr(),{ATTR_HTTP_ROUTE:R3,ATTR_HTTP_RESPONSE_STATUS_CODE:GOe,ATTR_HTTP_REQUEST_METHOD:WRt,ATTR_URL_PATH:XRt}=(Xn(),Me(Hr)),{InstrumentationBase:ext}=AOe(),{version:txt,name:jOe}=gOe(),nxt=">=4.0.0 <6",zOe=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],Io={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},gE={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Yg="anonymous",hE=Symbol("fastify otel instance"),_E=Symbol("fastify otel request spans"),Ww=Symbol("fastify otel request context"),HOe=Symbol("fastify otel addhook original"),$Oe=Symbol("fastify otel setnotfound original"),Xw=Symbol("fastify otel ignore path"),eO=Symbol("fastify otel record exceptions"),x3=class extends ext{logger=null;_requestHook=null;_lifecycleHook=null;constructor(t){if(super(jOe,txt,t),this.logger=KRt.createComponentLogger({namespace:jOe}),this[Xw]=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[Xw]=o=>typeof n=="function"?n(o):(r==null&&(r=QOe().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)},FOe.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(FOe.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:nxt,name:"@fastify/otel"},n;function n(r,o,i){r.decorate(hE,t),r.decorate(HOe,r.addHook),r.decorate($Oe,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let T=this[Ww],v=this[_E];return{enabled:this.routeOptions.config?.otel!==!1,span:v,tracer:t.tracer,context:T,inject:(R,x)=>bW.inject(T,R,x),extract:(R,x)=>bW.extract(T,R,x)}}),r.decorateRequest(_E,null),r.decorateRequest(Ww,null),r.addHook("onRoute",function(T){if(t[Xw]?.(T)===!0){t.logger.debug(`Ignoring route instrumentation ${T.method} ${T.url} because it matches the ignore path`);return}if(T.config?.otel===!1){t.logger.debug(`Ignoring route instrumentation ${T.method} ${T.url} because it is disabled`);return}for(let v of zOe)if(T[v]!=null){let R=T[v];if(typeof R=="function")T[v]=_(R,v,{[Io.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[Io.FASTIFY_TYPE]:gE.ROUTE,[R3]:T.url,[Io.HOOK_CALLBACK_NAME]:R.name?.length>0?R.name:Yg});else if(Array.isArray(R)){let x=[];for(let O of R)x.push(_(O,v,{[Io.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[Io.FASTIFY_TYPE]:gE.ROUTE,[R3]:T.url,[Io.HOOK_CALLBACK_NAME]:O.name?.length>0?O.name:Yg}));T[v]=x}}T.onSend!=null?T.onSend=Array.isArray(T.onSend)?[...T.onSend,s]:[T.onSend,s]:T.onSend=s,T.onError!=null?T.onError=Array.isArray(T.onError)?[...T.onError,u]:[T.onError,u]:T.onError=u,T.handler=_(T.handler,"handler",{[Io.HOOK_NAME]:`${this.pluginName} - route-handler`,[Io.FASTIFY_TYPE]:gE.HANDLER,[R3]:T.url,[Io.HOOK_CALLBACK_NAME]:T.handler.name.length>0?T.handler.name:Yg})}),r.addHook("onRequest",function(T,v,R){if(this[hE].isEnabled()===!1||T.routeOptions.config?.otel===!1)return R();if(this[hE][Xw]?.({url:T.url,method:T.method})===!0)return this[hE].logger.debug(`Ignoring request ${T.method} ${T.url} because it matches the ignore path`),R();let x=C3.active();TW.getSpan(x)==null&&(x=bW.extract(x,T.headers));let O=JRt(x);T.routeOptions.url!=null&&O?.type===ZRt.HTTP&&(O.route=T.routeOptions.url);let P={[Io.ROOT]:"@fastify/otel",[WRt]:T.method,[XRt]:T.url};T.routeOptions.url!=null&&(P[R3]=T.routeOptions.url);let j=this[hE].tracer.startSpan("request",{attributes:P},x);try{this[hE]._requestHook?.(j,T)}catch(G){this[hE].logger.error({err:G},"requestHook threw")}T[Ww]=TW.setSpan(x,j),T[_E]=j,C3.with(T[Ww],()=>{R()})}),r.addHook("onResponse",function(T,v,R){let x=T[_E];x!=null&&(x.setAttributes({[GOe]:v.statusCode}),x.end()),T[_E]=null,R()}),r.addHook=l,r.setNotFoundHandler=f,i();function s(y,T,v,R){let x=y[_E];x!=null&&(T.statusCode>=500&&x.setStatus({code:v3.ERROR}),x.setAttributes({[GOe]:T.statusCode}),x.end()),y[_E]=null,R(null,v)}function u(y,T,v,R){let x=y[_E];x!=null&&(x.setStatus({code:v3.ERROR,message:v.message}),t[eO]!==!1&&x.recordException(v)),R()}function l(y,T){let v=this[HOe];return zOe.includes(y)?v.call(this,y,_(T,y,{[Io.HOOK_NAME]:`${this.pluginName} - ${y}`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:Yg})):v.call(this,y,T)}function f(y,T){let v=this[$Oe];typeof y=="function"?(T=_(y,"notFoundHandler",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:y.name?.length>0?y.name:Yg}),v.call(this,T)):(y.preValidation!=null&&(y.preValidation=_(y.preValidation,"notFoundHandler - preValidation",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:y.preValidation.name?.length>0?y.preValidation.name:Yg})),y.preHandler!=null&&(y.preHandler=_(y.preHandler,"notFoundHandler - preHandler",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:y.preHandler.name?.length>0?y.preHandler.name:Yg})),T=_(T,"notFoundHandler",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:Yg}),v.call(this,y,T))}function h(y){for(let T of y)if(T?.routeOptions&&T.url&&T.method)return T;return null}function _(y,T,v={}){return function(...x){let O=this[hE],P=h(x);if(P===null)return O.logger.debug(`Ignoring route instrumentation because ${T} was called without a Fastify request argument`),y.call(this,...x);if(O.isEnabled()===!1||P.routeOptions.config?.otel===!1)return O.logger.debug(`Ignoring route instrumentation ${P.routeOptions.method} ${P.routeOptions.url} because it is disabled`),y.call(this,...x);if(O[Xw]?.({url:P.url,method:P.method})===!0)return O.logger.debug(`Ignoring route instrumentation ${P.routeOptions.method} ${P.routeOptions.url} because it matches the ignore path`),y.call(this,...x);let j=P[Ww]??C3.active(),G=y.name?.length>0?y.name:this.pluginName??Yg,H=O.tracer.startSpan(`${T} - ${G}`,{attributes:v},j);if(O._lifecycleHook!=null)try{O._lifecycleHook(H,{hookName:T,request:P,handler:G})}catch(V){O.logger.error({err:V},"Execution of lifecycleHook failed")}return C3.with(TW.setSpan(j,H),function(){try{let V=y.call(this,...x);return typeof V?.then=="function"?V.then(ae=>(H.end(),ae),ae=>(H.setStatus({code:v3.ERROR,message:ae.message}),O[eO]!==!1&&H.recordException(ae),H.end(),Promise.reject(ae))):(H.end(),V)}catch(V){throw H.setStatus({code:v3.ERROR,message:V.message}),O[eO]!==!1&&H.recordException(V),H.end(),V}},this)}}}}};IW.exports=x3;IW.exports.FastifyOtelInstrumentation=x3});var Kg,tO,nO,VOe=w(()=>{m();(function(e){let t="fastify.name";e.FASTIFY_NAME=t;let n="fastify.type";e.FASTIFY_TYPE=n;let r="hook.name";e.HOOK_NAME=r;let o="plugin.name";e.PLUGIN_NAME=o})(Kg||(Kg={}));(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,YOe=w(()=>{m();rO=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function CW(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 D3(e,t){let n=e[rO]||[];n.length&&(n.forEach(r=>{t&&(r.setStatus({code:Ai.ERROR,message:t.message}),r.recordException(t)),r.end()}),delete e[rO])}function JOe(e,t,n){let r,o;try{o=e(),KOe(o)&&o.then(i=>t(void 0,i),i=>t(i))}catch(i){r=i}finally{if(!KOe(o)&&(t(r,o),r))throw r;return o}}function KOe(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var ZOe=w(()=>{m();He();YOe()});function sxt(){let e=Et();e&&e.on("spanStart",t=>{XOe(t)})}function XOe(e){let t=kt(e).data,n=t["fastify.type"];if(t[Xt]||!n)return;e.setAttributes({[Mt]:"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 B3,WS,rxt,oxt,WOe,ixt,N3,eke=w(()=>{m();He();B3=ue(vr(),1),WS=ue(un(),1);Xn();At();VOe();ZOe();rxt="0.1.0",oxt="@sentry/instrumentation-fastify-v3",WOe="anonymous",ixt=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),N3=class extends WS.InstrumentationBase{constructor(t={}){super(oxt,rxt,t)}init(){return[new WS.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,u=(0,B3.getRPCMetadata)(We.active()),l=s.routeOptions?s.routeOptions.url:r.routerPath;l&&u?.type===B3.RPCType.HTTP&&(u.route=l);let f=r.method||"GET";Rn().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 u=r.name||t||WOe,l=`${nO.MIDDLEWARE} - ${u}`,f=s[1],h=CW(f,i.tracer,l,{[Kg.FASTIFY_TYPE]:tO.MIDDLEWARE,[Kg.PLUGIN_NAME]:t,[Kg.HOOK_NAME]:n}),_=o&&s[s.length-1];return _&&(s[s.length-1]=function(...y){D3(f),_.apply(this,y)}),We.with(Vt.setSpan(We.active(),h),()=>JOe(()=>r.apply(this,s),y=>{y instanceof Error&&(h.setStatus({code:Ai.ERROR,message:y.message}),h.recordException(y)),o||D3(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],u=this.pluginName;if(!ixt.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(u,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()),sxt(),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,WS.safeExecuteInTheMiddle)(()=>r.apply(this,i),u=>{!u&&s instanceof Error&&(u=s),D3(this,u)}):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,u=s.routeOptions?.handler||s.context?.handler,l=u?.name.startsWith("bound ")?u.name.substring(6):u?.name,f=`${nO.REQUEST_HANDLER} - ${l||this.pluginName||WOe}`,h={[Kg.PLUGIN_NAME]:this.pluginName,[Kg.FASTIFY_TYPE]:tO.REQUEST_HANDLER,[mV]:s.routeOptions?s.routeOptions.url:r.routerPath};l&&(h[Kg.FASTIFY_NAME]=l);let _=CW(o,t.tracer,f,h);XOe(_);let{requestHook:y}=t.getConfig();return y&&(0,WS.safeExecuteInTheMiddle)(()=>y(_,{request:r}),T=>{T&&t._diag.error("request hook failed",T)},!0),We.with(Vt.setSpan(We.active(),_),()=>{i()})}}}});import*as vW from"node:diagnostics_channel";function axt(){let e=Et();if(e)return e.getIntegrationByName(w3)}function tke(e,t,n,r){let o=axt()?.getShouldHandleError()||ske;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){Ds&&W.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)&&rn(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function ske(e,t,n){let r=n.statusCode;return r>=500||r<=299}function ake(e){let t=kt(e),n=t.description,r=t.data,o=r["fastify.type"],i=o==="hook",s=o===n?.startsWith("handler -"),u=n==="request"||o==="request-handler";if(r[Xt]||!s&&!u&&!i)return;let l=i?"hook":s?"middleware":u?"request_handler":"<unknown>";e.setAttributes({[Mt]:"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 cxt(){let e=Et();e&&e.on("spanStart",t=>{ake(t)})}function lxt(e){e.addHook("onRequest",async(t,n)=>{if(t.opentelemetry){let{span:i}=t.opentelemetry();i&&ake(i)}let r=t.routeOptions?.url,o=t.method||"GET";Rn().setTransactionName(`${o} ${r}`)})}var nke,w3,rke,oke,uxt,ike,uke=w(()=>{m();nke=ue(qOe(),1);At();_r();YS();eke();w3="Fastify",rke=ct(`${w3}.v3`,()=>new N3);oke=ct(`${w3}.v5`,()=>{let e=new nke.FastifyOtelInstrumentation,t=e.plugin();return vW.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(t).after(o=>{o?Ds&&W.error("Failed to setup Fastify instrumentation",o):(cxt(),r&&lxt(r))})}),vW.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:i}=n;tke.call(tke,r,o,i,"diagnostics-channel")}),e}),uxt=(({shouldHandleError:e})=>{let t;return{name:w3,setupOnce(){t=e||ske,rke(),oke()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}}),ike=(e={})=>uxt(e)});var RW=M(Rf=>{"use strict";m();Object.defineProperty(Rf,"__esModule",{value:!0});Rf.SpanNames=Rf.TokenKind=Rf.AllowedOperationTypes=void 0;var dxt;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(dxt=Rf.AllowedOperationTypes||(Rf.AllowedOperationTypes={}));var pxt;(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"})(pxt=Rf.TokenKind||(Rf.TokenKind={}));var fxt;(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"})(fxt=Rf.SpanNames||(Rf.SpanNames={}))});var xW=M(oO=>{"use strict";m();Object.defineProperty(oO,"__esModule",{value:!0});oO.AttributeNames=void 0;var mxt;(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"})(mxt=oO.AttributeNames||(oO.AttributeNames={}))});var O3=M(fR=>{"use strict";m();Object.defineProperty(fR,"__esModule",{value:!0});fR.OTEL_GRAPHQL_DATA_SYMBOL=fR.OTEL_PATCHED_SYMBOL=void 0;fR.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");fR.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var cke=M(k3=>{"use strict";m();Object.defineProperty(k3,"__esModule",{value:!0});k3.OPERATION_NOT_SUPPORTED=void 0;var B1n=O3();k3.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var bke=M(Ns=>{"use strict";m();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.wrapFieldResolver=Ns.wrapFields=Ns.getSourceFromLocation=Ns.getOperation=Ns.endSpan=Ns.addSpanSource=Ns.addInputVariableAttributes=Ns.isPromise=void 0;var mR=(He(),Me(tt)),EE=RW(),XS=xW(),Jg=O3(),lke=Object.values(EE.AllowedOperationTypes),Axt=e=>typeof e?.then=="function";Ns.isPromise=Axt;var gxt=e=>typeof e=="object"&&e!==null;function DW(e,t,n){Array.isArray(n)?n.forEach((r,o)=>{DW(e,`${t}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{DW(e,`${t}.${r}`,o)}):e.setAttribute(`${XS.AttributeNames.VARIABLES}${String(t)}`,n)}function hxt(e,t){Object.entries(t).forEach(([n,r])=>{DW(e,n,r)})}Ns.addInputVariableAttributes=hxt;function mke(e,t,n,r,o){let i=Eke(t,n,r,o);e.setAttribute(XS.AttributeNames.SOURCE,i)}Ns.addSpanSource=mke;function _xt(e,t,n,r,o){let i=Ake(n,o);if(i)return{field:i,spanAdded:!1};let u=t().flatResolveSpans?hke(n):gke(n,o);return i={span:Ext(e,t,n,r,o,u)},Txt(n,o,i),{field:i,spanAdded:!0}}function Ext(e,t,n,r,o,i){let s={[XS.AttributeNames.FIELD_NAME]:r.fieldName,[XS.AttributeNames.FIELD_PATH]:o.join("."),[XS.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[XS.AttributeNames.PARENT_NAME]:r.parentType.name},u=e.startSpan(`${EE.SpanNames.RESOLVE} ${s[XS.AttributeNames.FIELD_PATH]}`,{attributes:s},i?mR.trace.setSpan(mR.context.active(),i):void 0),l=n[Jg.OTEL_GRAPHQL_DATA_SYMBOL].source,f=r.fieldNodes.find(h=>h.kind==="Field");return f&&mke(u,l.loc,t().allowValues,f.loc?.start,f.loc?.end),u}function yxt(e,t){t&&e.recordException(t),e.end()}Ns.endSpan=yxt;function Sxt(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>lke.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>lke.indexOf(n?.operation)!==-1)}Ns.getOperation=Sxt;function Txt(e,t,n){return e[Jg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]=n}function Ake(e,t){return e[Jg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]}function gke(e,t){for(let n=t.length-1;n>0;n--){let r=Ake(e,t.slice(0,n));if(r)return r.span}return hke(e)}function hke(e){return e[Jg.OTEL_GRAPHQL_DATA_SYMBOL].span}function bxt(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 Ixt(e){return _ke(`
37
37
  `,e)}function dke(e){return _ke(" ",e)}function _ke(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}var Cxt=[EE.TokenKind.FLOAT,EE.TokenKind.STRING,EE.TokenKind.INT,EE.TokenKind.BLOCK_STRING];function Eke(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,u=e.startToken.next,l=1;for(;u;){if(u.start<i){u=u.next,l=u?.line;continue}if(u.end>s){u=u.next,l=u?.line;continue}let f=u.value||u.kind,h="";!t&&Cxt.indexOf(u.kind)>=0&&(f="*"),u.kind===EE.TokenKind.STRING&&(f=`"${f}"`),u.kind===EE.TokenKind.EOF&&(f=""),u.line>l?(o+=Ixt(u.line-l),l=u.line,h=dke(u.column-1)):u.line===u.prev?.line&&(h=dke(u.start-(u.prev?.end||0))),o+=h+f,u&&(u=u.next)}}return o}Ns.getSourceFromLocation=Eke;function yke(e,t,n){if(!e||e[Jg.OTEL_PATCHED_SYMBOL])return;let r=e.getFields();e[Jg.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let i=r[o];if(i&&(i.resolve&&(i.resolve=Tke(t,n,i.resolve)),i.type)){let s=Ske(i.type);for(let u of s)yke(u,t,n)}})}Ns.wrapFields=yke;function Ske(e){return"ofType"in e?Ske(e.ofType):vxt(e)?e.getTypes():Rxt(e)?[e]:[]}function vxt(e){return"getTypes"in e&&typeof e.getTypes=="function"}function Rxt(e){return"getFields"in e&&typeof e.getFields=="function"}var pke=(e,t,n)=>{n&&(e.recordException(t),e.setStatus({code:mR.SpanStatusCode.ERROR,message:t.message}),e.end())},fke=(e,t)=>{t&&e.end()};function Tke(e,t,n,r=!1){if(o[Jg.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(i,s,u,l){if(!n)return;let f=t();if(f.ignoreTrivialResolveSpans&&r&&(gxt(i)||typeof i=="function")&&typeof i[l.fieldName]!="function")return n.call(this,i,s,u,l);if(!u[Jg.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,i,s,u,l);let h=bxt(f.mergeItems,l&&l.path),_=h.filter(v=>typeof v=="string").length,y,T=!1;if(f.depth>=0&&f.depth<_)y=gke(u,h);else{let{field:v,spanAdded:R}=_xt(e,t,u,l,h);y=v.span,T=R}return mR.context.with(mR.trace.setSpan(mR.context.active(),y),()=>{try{let v=n.call(this,i,s,u,l);return(0,Ns.isPromise)(v)?v.then(R=>(fke(y,T),R),R=>{throw pke(y,R,T),R}):(fke(y,T),v)}catch(v){throw pke(y,v,T),v}})}return o[Jg.OTEL_PATCHED_SYMBOL]=!0,o}Ns.wrapFieldResolver=Tke});var Ike=M(AR=>{"use strict";m();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-graphql"});var Rke=M(L3=>{"use strict";m();Object.defineProperty(L3,"__esModule",{value:!0});L3.GraphQLInstrumentation=void 0;var Zg=(He(),Me(tt)),sp=un(),iO=RW(),P3=xW(),NW=O3(),xxt=cke(),fu=bke(),Cke=Ike(),vke={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},M3=[">=14.0.0 <17"],BW=class extends sp.InstrumentationBase{constructor(t={}){super(Cke.PACKAGE_NAME,Cke.PACKAGE_VERSION,{...vke,...t})}setConfig(t={}){super.setConfig({...vke,...t})}init(){let t=new sp.InstrumentationNodeModuleDefinition("graphql",M3);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new sp.InstrumentationNodeModuleFile("graphql/execution/execute.js",M3,t=>((0,sp.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 sp.InstrumentationNodeModuleFile("graphql/language/parser.js",M3,t=>((0,sp.isWrapped)(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new sp.InstrumentationNodeModuleFile("graphql/validation/validate.js",M3,t=>((0,sp.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 u=(0,fu.getOperation)(s.document,s.operationName),l=n._createExecuteSpan(u,s);return s.contextValue[NW.OTEL_GRAPHQL_DATA_SYMBOL]={source:s.document?s.document||s.document[NW.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:l,fields:{}},Zg.context.with(Zg.trace.setSpan(Zg.context.active(),l),()=>(0,sp.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,fu.endSpan)(t,n);return}if((0,fu.isPromise)(r))r.then(i=>{if(typeof o.responseHook!="function"){(0,fu.endSpan)(t);return}this._executeResponseHook(t,i)},i=>{(0,fu.endSpan)(t,i)});else{if(typeof o.responseHook!="function"){(0,fu.endSpan)(t);return}this._executeResponseHook(t,r)}}_executeResponseHook(t,n){let{responseHook:r}=this.getConfig();r&&(0,sp.safeExecuteInTheMiddle)(()=>{r(t,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,fu.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,u,l,f){return t._validate(this,r,i,s,u,f,l)}}}_parse(t,n,r,o){let i=this.getConfig(),s=this.tracer.startSpan(iO.SpanNames.PARSE);return Zg.context.with(Zg.trace.setSpan(Zg.context.active(),s),()=>(0,sp.safeExecuteInTheMiddle)(()=>n.call(t,r,o),(u,l)=>{l&&((0,fu.getOperation)(l)?l.loc&&(0,fu.addSpanSource)(s,l.loc,i.allowValues):s.updateName(iO.SpanNames.SCHEMA_PARSE)),(0,fu.endSpan)(s,u)}))}_validate(t,n,r,o,i,s,u){let l=this.tracer.startSpan(iO.SpanNames.VALIDATE,{});return Zg.context.with(Zg.trace.setSpan(Zg.context.active(),l),()=>(0,sp.safeExecuteInTheMiddle)(()=>n.call(t,r,o,i,u,s),(f,h)=>{o.loc||l.updateName(iO.SpanNames.SCHEMA_VALIDATE),h&&h.length&&l.recordException({name:P3.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(h)}),(0,fu.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(P3.AttributeNames.OPERATION_TYPE,i);let u=s?.value;u?(o.setAttribute(P3.AttributeNames.OPERATION_NAME,u),o.updateName(`${i} ${u}`)):o.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=xxt.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),o.setAttribute(P3.AttributeNames.OPERATION_NAME,i)}return n.document?.loc&&(0,fu.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,fu.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(t,n,r,o,i,s,u,l,f){if(o||(o={}),o[NW.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:u,typeResolver:l};let h=u==null,_=u??f;return u=(0,fu.wrapFieldResolver)(this.tracer,()=>this.getConfig(),_,h),t&&((0,fu.wrapFields)(t.getQueryType(),this.tracer,()=>this.getConfig()),(0,fu.wrapFields)(t.getMutationType(),this.tracer,()=>this.getConfig())),{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:u,typeResolver:l}}};L3.GraphQLInstrumentation=BW});var xke=M(U3=>{"use strict";m();Object.defineProperty(U3,"__esModule",{value:!0});U3.GraphQLInstrumentation=void 0;var Dxt=Rke();Object.defineProperty(U3,"GraphQLInstrumentation",{enumerable:!0,get:function(){return Dxt.GraphQLInstrumentation}})});function Oke(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function Bxt(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 Dke,Nke,Bke,Nxt,wke,kke=w(()=>{m();He();Dke=ue(xke(),1);At();_r();Xv();Nke="Graphql",Bke=ct(Nke,Dke.GraphQLInstrumentation,e=>{let t=Oke(e);return{...t,responseHook(n,r){qr(n,"auto.graphql.otel.graphql"),r.errors?.length&&!kt(n).status&&n.setStatus({code:Ai.ERROR});let i=kt(n).data,s=i["graphql.operation.type"],u=i["graphql.operation.name"];if(t.useOperationNameForRootSpan&&s){let l=gi(n),h=kt(l).data[Zv]||[],_=u?`${s} ${u}`:`${s}`;Array.isArray(h)?(h.push(_),l.setAttribute(Zv,h)):typeof h=="string"?l.setAttribute(Zv,[h,_]):l.setAttribute(Zv,_),kt(l).data["original-description"]||l.setAttribute("original-description",kt(l).description),l.updateName(`${kt(l).data["original-description"]} (${Bxt(h)})`)}}}}),Nxt=((e={})=>({name:Nke,setupOnce(){Bke(Oke(e))}})),wke=Nxt});var Pke=M(Q3=>{"use strict";m();Object.defineProperty(Q3,"__esModule",{value:!0});Q3.EVENT_LISTENERS_SET=void 0;Q3.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var Mke=M(F3=>{"use strict";m();Object.defineProperty(F3,"__esModule",{value:!0});F3.bufferTextMapGetter=void 0;F3.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 Lke=M(or=>{"use strict";m();Object.defineProperty(or,"__esModule",{value:!0});or.METRIC_MESSAGING_PROCESS_DURATION=or.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=or.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=or.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=or.MESSAGING_SYSTEM_VALUE_KAFKA=or.MESSAGING_OPERATION_TYPE_VALUE_SEND=or.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=or.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=or.ATTR_MESSAGING_SYSTEM=or.ATTR_MESSAGING_OPERATION_TYPE=or.ATTR_MESSAGING_OPERATION_NAME=or.ATTR_MESSAGING_KAFKA_OFFSET=or.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=or.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=or.ATTR_MESSAGING_DESTINATION_PARTITION_ID=or.ATTR_MESSAGING_DESTINATION_NAME=or.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;or.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";or.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";or.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";or.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";or.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";or.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";or.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";or.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";or.ATTR_MESSAGING_SYSTEM="messaging.system";or.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";or.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";or.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";or.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";or.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";or.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";or.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";or.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var Uke=M(gR=>{"use strict";m();Object.defineProperty(gR,"__esModule",{value:!0});gR.PACKAGE_NAME=gR.PACKAGE_VERSION=void 0;gR.PACKAGE_VERSION="0.23.0";gR.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var Hke=M(j3=>{"use strict";m();Object.defineProperty(j3,"__esModule",{value:!0});j3.KafkaJsInstrumentation=void 0;var Vr=(He(),Me(tt)),ap=un(),hR=(Xn(),Me(Hr)),Qke=Pke(),Fke=Mke(),ht=Lke(),Gke=Uke();function G3(e,t,n){return r=>{e.add(t,{...n,...r?{[hR.ATTR_ERROR_TYPE]:r}:{}})}}function jke(e,t,n){return r=>{e.record((Date.now()-t)/1e3,{...n,...r?{[hR.ATTR_ERROR_TYPE]:r}:{}})}}var zke=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],wW=class extends ap.InstrumentationBase{constructor(t={}){super(Gke.PACKAGE_NAME,Gke.PACKAGE_VERSION,t)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(ht.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:zke}}),this._sentMessages=this.meter.createCounter(ht.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(ht.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(ht.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:zke}})}init(){let t=r=>{(0,ap.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,ap.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new ap.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,ap.isWrapped)(i.run)&&t._unwrap(i,"run"),t._wrap(i,"run",t._getConsumerRunPatch()),t._setKafkaEventListeners(i),i}}_setKafkaEventListeners(t){t[Qke.EVENT_LISTENERS_SET]||(t.events?.REQUEST&&t.on(t.events.REQUEST,this._recordClientDurationMetric.bind(this)),t[Qke.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(t){let[n,r]=t.payload.broker.split(":");this._clientDuration.record(t.payload.duration/1e3,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:`${t.payload.apiName}`,[hR.ATTR_SERVER_ADDRESS]:n,[hR.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,ap.isWrapped)(i.sendBatch)&&t._unwrap(i,"sendBatch"),t._wrap(i,"sendBatch",t._getSendBatchPatch()),(0,ap.isWrapped)(i.send)&&t._unwrap(i,"send"),t._wrap(i,"send",t._getSendPatch()),(0,ap.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,ap.isWrapped)(i.eachMessage)&&t._unwrap(i,"eachMessage"),t._wrap(i,"eachMessage",t._getConsumerEachMessagePatch())),i?.eachBatch&&((0,ap.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=Vr.propagation.extract(Vr.ROOT_CONTEXT,i.message.headers,Fke.bufferTextMapGetter),u=t._startConsumerSpan({topic:i.topic,message:i.message,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:s,attributes:{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),l=[jke(t._processDuration,Date.now(),{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),G3(t._consumedMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],f=Vr.context.with(Vr.trace.setSpan(s,u),()=>n.apply(this,o));return t._endSpansOnPromise([u],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:ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:Vr.ROOT_CONTEXT,attributes:{[ht.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return Vr.context.with(Vr.trace.setSpan(Vr.context.active(),s),()=>{let u=Date.now(),l=[],f=[G3(n._consumedMessages,i.batch.messages.length,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(_=>{let y=Vr.propagation.extract(Vr.ROOT_CONTEXT,_.headers,Fke.bufferTextMapGetter),T=Vr.trace.getSpan(y)?.spanContext(),v;T&&(v={context:T}),l.push(n._startConsumerSpan({topic:i.batch.topic,message:_,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:v,attributes:{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),f.push(jke(n._processDuration,u,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[ht.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(u=>{let l=u.send;u.send=function(...T){return Vr.context.with(Vr.trace.setSpan(Vr.context.active(),i),()=>t._getSendPatch()(l).apply(this,T).catch(R=>{throw i.setStatus({code:Vr.SpanStatusCode.ERROR,message:R?.message}),i.recordException(R),R}))};let f=u.sendBatch;u.sendBatch=function(...T){return Vr.context.with(Vr.trace.setSpan(Vr.context.active(),i),()=>t._getSendBatchPatch()(f).apply(this,T).catch(R=>{throw i.setStatus({code:Vr.SpanStatusCode.ERROR,message:R?.message}),i.recordException(R),R}))};let h=u.commit;u.commit=function(...T){let v=h.apply(this,T).then(()=>{i.setStatus({code:Vr.SpanStatusCode.OK})});return t._endSpansOnPromise([i],[],v)};let _=u.abort;u.abort=function(...T){let v=_.apply(this,T);return t._endSpansOnPromise([i],[],v)}}).catch(u=>{i.setStatus({code:Vr.SpanStatusCode.ERROR,message:u?.message}),i.recordException(u),i.end()}),s}}_getSendBatchPatch(){let t=this;return n=>function(...o){let s=o[0].topicMessages||[],u=[],l=[];s.forEach(h=>{h.messages.forEach(_=>{u.push(t._startProducerSpan(h.topic,_)),l.push(G3(t._sentMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_DESTINATION_NAME]:h.topic,..._.partition!==void 0?{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(_.partition)}:{}}))})});let f=n.apply(this,o);return t._endSpansOnPromise(u,l,f)}}_getSendPatch(){let t=this;return n=>function(...o){let i=o[0],s=i.messages.map(f=>t._startProducerSpan(i.topic,f)),u=i.messages.map(f=>G3(t._sentMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,...f.partition!==void 0?{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(f.partition)}:{}})),l=n.apply(this,o);return t._endSpansOnPromise(s,u,l)}}_endSpansOnPromise(t,n,r){return Promise.resolve(r).then(o=>(n.forEach(i=>i()),o)).catch(o=>{let i,s=hR.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(u=>u(s)),t.forEach(u=>{u.setAttribute(hR.ATTR_ERROR_TYPE,s),u.setStatus({code:Vr.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 u=r===ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,l=this.tracer.startSpan(`${u} ${t}`,{kind:r===ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?Vr.SpanKind.CLIENT:Vr.SpanKind.CONSUMER,attributes:{...s,[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_DESTINATION_NAME]:t,[ht.ATTR_MESSAGING_OPERATION_TYPE]:r,[ht.ATTR_MESSAGING_OPERATION_NAME]:u,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[ht.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:i?[i]:[]},o),{consumerHook:f}=this.getConfig();return f&&n&&(0,ap.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:Vr.SpanKind.PRODUCER,attributes:{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_DESTINATION_NAME]:t,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_OPERATION_TYPE]:ht.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},Vr.propagation.inject(Vr.trace.setSpan(Vr.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,ap.safeExecuteInTheMiddle)(()=>o(r,{topic:t,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),r}};j3.KafkaJsInstrumentation=wW});var $ke=M(z3=>{"use strict";m();Object.defineProperty(z3,"__esModule",{value:!0});z3.KafkaJsInstrumentation=void 0;var wxt=Hke();Object.defineProperty(z3,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return wxt.KafkaJsInstrumentation}})});var qke,Vke,Yke,Oxt,Kke,Jke=w(()=>{m();qke=ue($ke(),1);_r();Vke="Kafka",Yke=ct(Vke,()=>new qke.KafkaJsInstrumentation({consumerHook(e){qr(e,"auto.kafkajs.otel.consumer")},producerHook(e){qr(e,"auto.kafkajs.otel.producer")}})),Oxt=(()=>({name:Vke,setupOnce(){Yke()}})),Kke=Oxt});var Zke=M(_R=>{"use strict";m();Object.defineProperty(_R,"__esModule",{value:!0});_R.PACKAGE_NAME=_R.PACKAGE_VERSION=void 0;_R.PACKAGE_VERSION="0.58.0";_R.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var tPe=M(H3=>{"use strict";m();Object.defineProperty(H3,"__esModule",{value:!0});H3.LruMemoizerInstrumentation=void 0;var Wke=(He(),Me(tt)),Xke=un(),ePe=Zke(),OW=class extends Xke.InstrumentationBase{constructor(t={}){super(ePe.PACKAGE_NAME,ePe.PACKAGE_VERSION,t)}init(){return[new Xke.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"?Wke.context.bind(Wke.context.active(),i):i;return o.push(s),r.apply(this,o)}};return n.sync=t.sync,n},void 0)]}};H3.LruMemoizerInstrumentation=OW});var nPe=M($3=>{"use strict";m();Object.defineProperty($3,"__esModule",{value:!0});$3.LruMemoizerInstrumentation=void 0;var kxt=tPe();Object.defineProperty($3,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return kxt.LruMemoizerInstrumentation}})});var rPe,oPe,iPe,Pxt,sPe,aPe=w(()=>{m();rPe=ue(nPe(),1);_r();oPe="LruMemoizer",iPe=ct(oPe,()=>new rPe.LruMemoizerInstrumentation),Pxt=(()=>({name:oPe,setupOnce(){iPe()}})),sPe=Pxt});var uPe=M(Po=>{"use strict";m();Object.defineProperty(Po,"__esModule",{value:!0});Po.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Po.DB_SYSTEM_VALUE_MONGODB=Po.DB_SYSTEM_NAME_VALUE_MONGODB=Po.ATTR_NET_PEER_PORT=Po.ATTR_NET_PEER_NAME=Po.ATTR_DB_SYSTEM=Po.ATTR_DB_STATEMENT=Po.ATTR_DB_OPERATION=Po.ATTR_DB_NAME=Po.ATTR_DB_MONGODB_COLLECTION=Po.ATTR_DB_CONNECTION_STRING=void 0;Po.ATTR_DB_CONNECTION_STRING="db.connection_string";Po.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Po.ATTR_DB_NAME="db.name";Po.ATTR_DB_OPERATION="db.operation";Po.ATTR_DB_STATEMENT="db.statement";Po.ATTR_DB_SYSTEM="db.system";Po.ATTR_NET_PEER_NAME="net.peer.name";Po.ATTR_NET_PEER_PORT="net.peer.port";Po.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";Po.DB_SYSTEM_VALUE_MONGODB="mongodb";Po.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var cPe=M(sO=>{"use strict";m();Object.defineProperty(sO,"__esModule",{value:!0});sO.MongodbCommandType=void 0;var Mxt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.AGGREGATE="aggregate",e.UNKNOWN="unknown"})(Mxt=sO.MongodbCommandType||(sO.MongodbCommandType={}))});var lPe=M(ER=>{"use strict";m();Object.defineProperty(ER,"__esModule",{value:!0});ER.PACKAGE_NAME=ER.PACKAGE_VERSION=void 0;ER.PACKAGE_VERSION="0.67.0";ER.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var fPe=M(q3=>{"use strict";m();Object.defineProperty(q3,"__esModule",{value:!0});q3.MongoDBInstrumentation=void 0;var ti=(He(),Me(tt)),ir=un(),Wg=(Xn(),Me(Hr)),Wl=uPe(),eT=cPe(),dPe=lPe(),pPe={requireParentSpan:!0},kW=class e extends ir.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(dPe.PACKAGE_NAME,dPe.PACKAGE_VERSION,{...pPe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ir.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ir.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...pPe,...t})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(Wl.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:u}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:l,v4UnpatchConnectionPool:f}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:h,v4UnpatchSessions:_}=this._getV4SessionsPatches();return[new ir.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new ir.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new ir.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],i,u),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],s,u),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],l,f),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new ir.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],h,_)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>((0,ir.isWrapped)(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",this._getV3PatchOperation("insert")),(0,ir.isWrapped)(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",this._getV3PatchOperation("remove")),(0,ir.isWrapped)(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",this._getV3PatchOperation("update")),(0,ir.isWrapped)(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",this._getV3PatchCommand()),(0,ir.isWrapped)(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",this._getV3PatchFind()),(0,ir.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,ir.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),this._wrap(t.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,ir.isWrapped)(t.release)&&this._unwrap(t,"release"),this._wrap(t.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),t),v4UnpatchSessions:t=>{t!==void 0&&((0,ir.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),(0,ir.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,ir.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,ir.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=ti.context.bind(ti.context.active(),r);return t.call(this,o)}}_getV4ConnectCommand(){let t=this;return n=>function(o,i){if(n.length===1){let u=n.call(this,o);return u&&typeof u.then=="function"&&u.then(()=>t.setPoolName(o),()=>{}),u}let s=function(u,l){if(u||!l){i(u,l);return}t.setPoolName(o),i(u,l)};return n.call(this,o,s)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>((0,ir.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandCallback()),t),v4PatchConnectionPromise:t=>((0,ir.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,u,l,f){let h=ti.trace.getSpan(ti.context.active()),_=n._checkSkipInstrumentation(h),y=typeof l=="function"?l:f;if(_||typeof y!="function"||typeof u!="object")return typeof l=="function"?r.call(this,i,s,u,l):r.call(this,i,s,u,l,f);let T=n._getV3SpanAttributes(s,i,u[0],t),v=n._spanNameFromAttrs(T),R=n.tracer.startSpan(v,{kind:ti.SpanKind.CLIENT,attributes:T}),x=n._patchEnd(R,y);return typeof l=="function"?r.call(this,i,s,u,x):r.call(this,i,s,u,l,x)}}_getV3PatchCommand(){let t=this;return n=>function(o,i,s,u,l){let f=ti.trace.getSpan(ti.context.active()),h=t._checkSkipInstrumentation(f),_=typeof u=="function"?u:l;if(h||typeof _!="function"||typeof s!="object")return typeof u=="function"?n.call(this,o,i,s,u):n.call(this,o,i,s,u,l);let y=e._getCommandType(s),T=y===eT.MongodbCommandType.UNKNOWN?void 0:y,v=t._getV3SpanAttributes(i,o,s,T),R=t._spanNameFromAttrs(v),x=t.tracer.startSpan(R,{kind:ti.SpanKind.CLIENT,attributes:v}),O=t._patchEnd(x,_);return typeof u=="function"?n.call(this,o,i,s,O):n.call(this,o,i,s,u,O)}}_getV4PatchCommandCallback(){let t=this;return n=>function(o,i,s,u){let l=ti.trace.getSpan(ti.context.active()),f=t._checkSkipInstrumentation(l),h=u,_=Object.keys(i)[0];if(typeof i!="object"||i.ismaster||i.hello)return n.call(this,o,i,s,u);let y;if(!f){let v=t._getV4SpanAttributes(this,o,i,_),R=t._spanNameFromAttrs(v);y=t.tracer.startSpan(R,{kind:ti.SpanKind.CLIENT,attributes:v})}let T=t._patchEnd(y,h,this.id,_);return n.call(this,o,i,s,T)}}_getV4PatchCommandPromise(){let t=this;return n=>function(...o){let[i,s]=o,u=ti.trace.getSpan(ti.context.active()),l=t._checkSkipInstrumentation(u),f=Object.keys(s)[0],h=()=>{};if(typeof s!="object"||s.ismaster||s.hello)return n.apply(this,o);let _;if(!l){let v=t._getV4SpanAttributes(this,i,s,f),R=t._spanNameFromAttrs(v);_=t.tracer.startSpan(R,{kind:ti.SpanKind.CLIENT,attributes:v})}let y=t._patchEnd(_,h,this.id,f),T=n.apply(this,o);return T.then(v=>y(null,v),v=>y(v)),T}}_getV3PatchFind(){let t=this;return n=>function(o,i,s,u,l,f){let h=ti.trace.getSpan(ti.context.active()),_=t._checkSkipInstrumentation(h),y=typeof l=="function"?l:f;if(_||typeof y!="function"||typeof s!="object")return typeof l=="function"?n.call(this,o,i,s,u,l):n.call(this,o,i,s,u,l,f);let T=t._getV3SpanAttributes(i,o,s,"find"),v=t._spanNameFromAttrs(T),R=t.tracer.startSpan(v,{kind:ti.SpanKind.CLIENT,attributes:T}),x=t._patchEnd(R,y);return typeof l=="function"?n.call(this,o,i,s,u,x):n.call(this,o,i,s,u,l,x)}}_getV3PatchCursor(){let t=this;return n=>function(o,i,s,u,l,f){let h=ti.trace.getSpan(ti.context.active()),_=t._checkSkipInstrumentation(h),y=typeof l=="function"?l:f;if(_||typeof y!="function")return typeof l=="function"?n.call(this,o,i,s,u,l):n.call(this,o,i,s,u,l,f);let T=t._getV3SpanAttributes(i,o,s.cmd,"getMore"),v=t._spanNameFromAttrs(T),R=t.tracer.startSpan(v,{kind:ti.SpanKind.CLIENT,attributes:T}),x=t._patchEnd(R,y);return typeof l=="function"?n.call(this,o,i,s,u,x):n.call(this,o,i,s,u,l,x)}}static _getCommandType(t){return t.createIndexes!==void 0?eT.MongodbCommandType.CREATE_INDEXES:t.findandmodify!==void 0?eT.MongodbCommandType.FIND_AND_MODIFY:t.ismaster!==void 0?eT.MongodbCommandType.IS_MASTER:t.count!==void 0?eT.MongodbCommandType.COUNT:t.aggregate!==void 0?eT.MongodbCommandType.AGGREGATE:eT.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 u;return r?.documents&&r.documents[0]?u=r.documents[0]:r?.cursors?u=r.cursors:u=r,this._getSpanAttributes(n.db,n.collection,i,s,u,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 _=h.split(":");i=_[0],s=_[1]}}let[u,l]=t.toString().split("."),f=r?.query??r?.q??r;return this._getSpanAttributes(u,l,i,s,f,o)}_getSpanAttributes(t,n,r,o,i,s){let u={};if(this._dbSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_DB_SYSTEM]=Wl.DB_SYSTEM_VALUE_MONGODB,u[Wl.ATTR_DB_NAME]=t,u[Wl.ATTR_DB_MONGODB_COLLECTION]=n,u[Wl.ATTR_DB_OPERATION]=s,u[Wl.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${t}`),this._dbSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_DB_SYSTEM_NAME]=Wl.DB_SYSTEM_NAME_VALUE_MONGODB,u[Wg.ATTR_DB_NAMESPACE]=t,u[Wg.ATTR_DB_OPERATION_NAME]=s,u[Wg.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_SERVER_ADDRESS]=r);let l=parseInt(o,10);isNaN(l)||(this._netSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_NET_PEER_PORT]=l),this._netSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_SERVER_PORT]=l))}if(i){let{dbStatementSerializer:l}=this.getConfig(),f=typeof l=="function"?l:this._defaultDbStatementSerializer.bind(this);(0,ir.safeExecuteInTheMiddle)(()=>{let h=f(i);this._dbSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_DB_STATEMENT]=h),this._dbSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_DB_QUERY_TEXT]=h)},h=>{h&&this._diag.error("Error running dbStatementSerializer hook",h)},!0)}return u}_spanNameFromAttrs(t){let n;return this._dbSemconvStability&ir.SemconvStability.STABLE?n=[t[Wg.ATTR_DB_OPERATION_NAME],t[Wg.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||Wl.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${t[Wl.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,ir.safeExecuteInTheMiddle)(()=>{r(t,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(t,n,r,o){let i=ti.context.active(),s=this,u=!1;return function(...f){if(!u){u=!0;let h=f[0];if(t){if(h instanceof Error)t.setStatus({code:ti.SpanStatusCode.ERROR,message:h.message});else{let _=f[1];s._handleExecutionResult(t,_)}t.end()}o==="endSessions"&&s._connCountAdd(-1,s._poolName,"idle")}return ti.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}};q3.MongoDBInstrumentation=kW});var mPe=M(aO=>{"use strict";m();Object.defineProperty(aO,"__esModule",{value:!0});aO.MongodbCommandType=void 0;var Lxt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.UNKNOWN="unknown"})(Lxt=aO.MongodbCommandType||(aO.MongodbCommandType={}))});var APe=M(yR=>{"use strict";m();Object.defineProperty(yR,"__esModule",{value:!0});yR.MongodbCommandType=yR.MongoDBInstrumentation=void 0;var Uxt=fPe();Object.defineProperty(yR,"MongoDBInstrumentation",{enumerable:!0,get:function(){return Uxt.MongoDBInstrumentation}});var Qxt=mPe();Object.defineProperty(yR,"MongodbCommandType",{enumerable:!0,get:function(){return Qxt.MongodbCommandType}})});function Fxt(e){let t=PW(e);return JSON.stringify(t)}function PW(e){if(Array.isArray(e))return e.map(t=>PW(t));if(Gxt(e)){let t={};return Object.entries(e).map(([n,r])=>[n,PW(r)]).reduce((n,r)=>(zxt(r)&&(n[r[0]]=r[1]),n),t)}return"?"}function Gxt(e){return typeof e=="object"&&e!==null&&!jxt(e)}function jxt(e){let t=!1;return typeof Buffer<"u"&&(t=Buffer.isBuffer(e)),t}function zxt(e){return Array.isArray(e)}var gPe,hPe,_Pe,Hxt,EPe,yPe=w(()=>{m();gPe=ue(APe(),1);_r();hPe="Mongo",_Pe=ct(hPe,()=>new gPe.MongoDBInstrumentation({dbStatementSerializer:Fxt,responseHook(e){qr(e,"auto.db.otel.mongo")}}));Hxt=(()=>({name:hPe,setupOnce(){_Pe()}})),EPe=Hxt});var MW=M(as=>{"use strict";m();Object.defineProperty(as,"__esModule",{value:!0});as.DB_SYSTEM_NAME_VALUE_MONGODB=as.ATTR_NET_PEER_PORT=as.ATTR_NET_PEER_NAME=as.ATTR_DB_USER=as.ATTR_DB_SYSTEM=as.ATTR_DB_STATEMENT=as.ATTR_DB_OPERATION=as.ATTR_DB_NAME=as.ATTR_DB_MONGODB_COLLECTION=void 0;as.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";as.ATTR_DB_NAME="db.name";as.ATTR_DB_OPERATION="db.operation";as.ATTR_DB_STATEMENT="db.statement";as.ATTR_DB_SYSTEM="db.system";as.ATTR_DB_USER="db.user";as.ATTR_NET_PEER_NAME="net.peer.name";as.ATTR_NET_PEER_PORT="net.peer.port";as.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var bPe=M(yE=>{"use strict";m();Object.defineProperty(yE,"__esModule",{value:!0});yE.handleCallbackResponse=yE.handlePromiseResponse=yE.getAttributesFromCollection=void 0;var SPe=(He(),Me(tt)),cO=un(),uO=MW(),V3=(Xn(),Me(Hr));function $xt(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[V3.ATTR_DB_COLLECTION_NAME]=e.name,r[V3.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[V3.ATTR_SERVER_ADDRESS]=e.conn.host,r[V3.ATTR_SERVER_PORT]=e.conn.port),r}yE.getAttributesFromCollection=$xt;function TPe(e,t={}){e.recordException(t),e.setStatus({code:SPe.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`
38
- Mongoose Error Code: ${t.code}`:""}`})}function LW(e,t,n,r=void 0){n&&(0,cO.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&SPe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function qxt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(LW(t,o,n,r),o)).catch(o=>{throw TPe(t,o),o}).finally(()=>t.end()):(LW(t,e,n,r),t.end(),e)}yE.handlePromiseResponse=qxt;function Vxt(e,t,n,r,o,i,s=void 0){let u=0;return o.length===2?u=1:o.length===3&&(u=2),o[u]=(l,f)=>(l?TPe(r,l):LW(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}yE.handleCallbackResponse=Vxt});var IPe=M(SR=>{"use strict";m();Object.defineProperty(SR,"__esModule",{value:!0});SR.PACKAGE_NAME=SR.PACKAGE_VERSION=void 0;SR.PACKAGE_VERSION="0.60.0";SR.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var DPe=M(Jc=>{"use strict";m();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.MongooseInstrumentation=Jc._ALREADY_INSTRUMENTED=Jc._STORED_PARENT_SPAN=void 0;var Bs=(He(),Me(tt)),Yxt=vr(),UW=bPe(),Ma=un(),CPe=IPe(),SE=MW(),tT=(Xn(),Me(Hr)),Y3=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],Kxt=["remove","count","findOneAndRemove",...Y3],Jxt=["count","findOneAndRemove",...Y3],Zxt=[...Y3];function vPe(e){return e?e.startsWith("6.")||e.startsWith("5.")?Kxt:e.startsWith("7.")?Jxt:Zxt:Y3}function RPe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function xPe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Jc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Jc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var QW=class extends Ma.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(CPe.PACKAGE_NAME,CPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ma.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ma.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Ma.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,RPe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),xPe(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)),vPe(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=vPe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,RPe(n)&&this._unwrap(r.Model.prototype,"remove"),xPe(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&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Ma.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ma.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Jc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{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&Ma.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ma.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,u){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.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 y=h(t,l);r._dbSemconvStability&Ma.SemconvStability.OLD&&(f[SE.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&Ma.SemconvStability.STABLE&&(f[tT.ATTR_DB_QUERY_TEXT]=y)}let _=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(u=s,s=void 0),r._handleResponse(_,o,this,arguments,u,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,_=u;typeof s=="function"?(f=s,h=void 0,_=void 0):typeof u=="function"&&(f=u,_=void 0);let y={},T=r.getConfig().dbStatementSerializer;if(T){let x=T(t,{condition:{_id:this._id},updates:h,options:_});r._dbSemconvStability&Ma.SemconvStability.OLD&&(y[SE.ATTR_DB_STATEMENT]=x),r._dbSemconvStability&Ma.SemconvStability.STABLE&&(y[tT.ATTR_DB_QUERY_TEXT]=x)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),R=r._handleResponse(v,o,this,arguments,f,n);return R&&typeof R=="object"&&(R[Jc._ALREADY_INSTRUMENTED]=!0),R}}patchModelStatic(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);typeof u=="function"&&(l=u,u=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}u!==void 0&&(f.options=u);let h={},{dbStatementSerializer:_}=r.getConfig();if(_){let T=_(t,f);r._dbSemconvStability&Ma.SemconvStability.OLD&&(h[SE.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&Ma.SemconvStability.STABLE&&(h[tT.ATTR_DB_QUERY_TEXT]=T)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Bs.trace.getSpan(Bs.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Jc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Jc._STORED_PARENT_SPAN]=Bs.trace.getSpan(Bs.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,UW.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Ma.SemconvStability.OLD&&(s[SE.ATTR_DB_OPERATION]=r,s[SE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Ma.SemconvStability.STABLE&&(s[tT.ATTR_DB_OPERATION_NAME]=r,s[tT.ATTR_DB_SYSTEM_NAME]=SE.DB_SYSTEM_NAME_VALUE_MONGODB);let u=this._dbSemconvStability&Ma.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(u,{kind:Bs.SpanKind.CLIENT,attributes:s},i?Bs.trace.setSpan(Bs.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let u=this;if(i instanceof Function)return u._callOriginalFunction(()=>(0,UW.handleCallbackResponse)(i,n,r,t,o,u.getConfig().responseHook,s));{let l=u._callOriginalFunction(()=>n.apply(r,o));return(0,UW.handlePromiseResponse)(l,t,u.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Bs.context.with((0,Yxt.suppressTracing)(Bs.context.active()),t):t()}};Jc.MongooseInstrumentation=QW});var NPe=M(K3=>{"use strict";m();Object.defineProperty(K3,"__esModule",{value:!0});K3.MongooseInstrumentation=void 0;var Wxt=DPe();Object.defineProperty(K3,"MongooseInstrumentation",{enumerable:!0,get:function(){return Wxt.MongooseInstrumentation}})});var BPe,wPe,OPe,Xxt,kPe,PPe=w(()=>{m();BPe=ue(NPe(),1);_r();wPe="Mongoose",OPe=ct(wPe,()=>new BPe.MongooseInstrumentation({responseHook(e){qr(e,"auto.db.otel.mongoose")}})),Xxt=(()=>({name:wPe,setupOnce(){OPe()}})),kPe=Xxt});var MPe=M(us=>{"use strict";m();Object.defineProperty(us,"__esModule",{value:!0});us.METRIC_DB_CLIENT_CONNECTIONS_USAGE=us.DB_SYSTEM_VALUE_MYSQL=us.ATTR_NET_PEER_PORT=us.ATTR_NET_PEER_NAME=us.ATTR_DB_USER=us.ATTR_DB_SYSTEM=us.ATTR_DB_STATEMENT=us.ATTR_DB_NAME=us.ATTR_DB_CONNECTION_STRING=void 0;us.ATTR_DB_CONNECTION_STRING="db.connection_string";us.ATTR_DB_NAME="db.name";us.ATTR_DB_STATEMENT="db.statement";us.ATTR_DB_SYSTEM="db.system";us.ATTR_DB_USER="db.user";us.ATTR_NET_PEER_NAME="net.peer.name";us.ATTR_NET_PEER_PORT="net.peer.port";us.DB_SYSTEM_VALUE_MYSQL="mysql";us.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var LPe=M(lO=>{"use strict";m();Object.defineProperty(lO,"__esModule",{value:!0});lO.AttributeNames=void 0;var eDt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(eDt=lO.AttributeNames||(lO.AttributeNames={}))});var UPe=M(mu=>{"use strict";m();Object.defineProperty(mu,"__esModule",{value:!0});mu.getPoolNameOld=mu.arrayStringifyHelper=mu.getSpanName=mu.getDbValues=mu.getDbQueryText=mu.getJDBCString=mu.getConfig=void 0;function tDt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}mu.getConfig=tDt;function nDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}mu.getJDBCString=nDt;function rDt(e){return typeof e=="string"?e:e.sql}mu.getDbQueryText=rDt;function oDt(e,t){return FW(typeof e=="string"?t:t||e.values)}mu.getDbValues=oDt;function iDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}mu.getSpanName=iDt;function FW(e){return e?`[${e.toString()}]`:""}mu.arrayStringifyHelper=FW;function sDt(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()}mu.getPoolNameOld=sDt});var QPe=M(TR=>{"use strict";m();Object.defineProperty(TR,"__esModule",{value:!0});TR.PACKAGE_NAME=TR.PACKAGE_VERSION=void 0;TR.PACKAGE_VERSION="0.60.0";TR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var GPe=M(J3=>{"use strict";m();Object.defineProperty(J3,"__esModule",{value:!0});J3.MySQLInstrumentation=void 0;var Zc=(He(),Me(tt)),up=un(),bR=(Xn(),Me(Hr)),Xg=MPe(),aDt=LPe(),nT=UPe(),FPe=QPe(),GW=class extends up.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(FPe.PACKAGE_NAME,FPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,up.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,up.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new up.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,up.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,up.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,up.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,u=t._freeConnections.length,l=s-u,f=(0,nT.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-u,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 u=t._nodes;if(u){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=u[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,u){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 u=="function"){let l=r._getConnectionCallbackPatchFn(u);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,up.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 u={},{host:l,port:f,database:h,user:_}=(0,nT.getConfig)(t.config),y=parseInt(f,10),T=(0,nT.getDbQueryText)(o);r._dbSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_DB_SYSTEM]=Xg.DB_SYSTEM_VALUE_MYSQL,u[Xg.ATTR_DB_CONNECTION_STRING]=(0,nT.getJDBCString)(l,f,h),u[Xg.ATTR_DB_NAME]=h,u[Xg.ATTR_DB_USER]=_,u[Xg.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_DB_SYSTEM_NAME]=bR.DB_SYSTEM_NAME_VALUE_MYSQL,u[bR.ATTR_DB_NAMESPACE]=h,u[bR.ATTR_DB_QUERY_TEXT]=T),r._netSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_NET_PEER_NAME]=l,isNaN(y)||(u[Xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_SERVER_ADDRESS]=l,isNaN(y)||(u[bR.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,nT.getSpanName)(o),{kind:Zc.SpanKind.CLIENT,attributes:u});if(r.getConfig().enhancedDatabaseReporting){let O;Array.isArray(i)?O=i:arguments[2]&&(O=[i]),v.setAttribute(aDt.AttributeNames.MYSQL_VALUES,(0,nT.getDbValues)(o,O))}let R=Array.from(arguments).findIndex(O=>typeof O=="function"),x=Zc.context.active();if(R===-1){let O=Zc.context.with(Zc.trace.setSpan(Zc.context.active(),v),()=>n.apply(t,arguments));return Zc.context.bind(x,O),O.on("error",P=>v.setStatus({code:Zc.SpanStatusCode.ERROR,message:P.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,R,r._patchCallbackQuery(v,x)),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,nT.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")})}};J3.MySQLInstrumentation=GW});var jPe=M(Z3=>{"use strict";m();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.MySQLInstrumentation=void 0;var uDt=GPe();Object.defineProperty(Z3,"MySQLInstrumentation",{enumerable:!0,get:function(){return uDt.MySQLInstrumentation}})});var zPe,HPe,$Pe,cDt,qPe,VPe=w(()=>{m();zPe=ue(jPe(),1);_r();HPe="Mysql",$Pe=ct(HPe,()=>new zPe.MySQLInstrumentation({})),cDt=(()=>({name:HPe,setupOnce(){$Pe()}})),qPe=cDt});var jW=M(ua=>{"use strict";m();Object.defineProperty(ua,"__esModule",{value:!0});ua.DB_SYSTEM_VALUE_MYSQL=ua.ATTR_NET_PEER_PORT=ua.ATTR_NET_PEER_NAME=ua.ATTR_DB_USER=ua.ATTR_DB_SYSTEM=ua.ATTR_DB_STATEMENT=ua.ATTR_DB_NAME=ua.ATTR_DB_CONNECTION_STRING=void 0;ua.ATTR_DB_CONNECTION_STRING="db.connection_string";ua.ATTR_DB_NAME="db.name";ua.ATTR_DB_STATEMENT="db.statement";ua.ATTR_DB_SYSTEM="db.system";ua.ATTR_DB_USER="db.user";ua.ATTR_NET_PEER_NAME="net.peer.name";ua.ATTR_NET_PEER_PORT="net.peer.port";ua.DB_SYSTEM_VALUE_MYSQL="mysql"});var HW=M(W3=>{"use strict";m();Object.defineProperty(W3,"__esModule",{value:!0});W3.addSqlCommenterComment=void 0;var zW=(He(),Me(tt)),lDt=vr();function dDt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function pDt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function fDt(e,t){if(typeof t!="string"||t.length===0||dDt(t))return t;let n=new lDt.W3CTraceContextPropagator,r={};n.inject(zW.trace.setSpan(zW.ROOT_CONTEXT,e),r,zW.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let u=pDt(r[s]);return`${s}='${u}'`}).join(",");return`${t} /*${i}*/`}W3.addSqlCommenterComment=fDt});var YPe=M(cp=>{"use strict";m();Object.defineProperty(cp,"__esModule",{value:!0});cp.getConnectionPrototypeToInstrument=cp.once=cp.getSpanName=cp.getQueryText=cp.getConnectionAttributes=void 0;var dO=jW(),X3=un(),$W=(Xn(),Me(Hr));function mDt(e,t,n){let{host:r,port:o,database:i,user:s}=ADt(e),u={};t&X3.SemconvStability.OLD&&(u[dO.ATTR_DB_CONNECTION_STRING]=gDt(r,o,i),u[dO.ATTR_DB_NAME]=i,u[dO.ATTR_DB_USER]=s),t&X3.SemconvStability.STABLE&&(u[$W.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&X3.SemconvStability.OLD&&(u[dO.ATTR_NET_PEER_NAME]=r,isNaN(l)||(u[dO.ATTR_NET_PEER_PORT]=l)),n&X3.SemconvStability.STABLE&&(u[$W.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(u[$W.ATTR_SERVER_PORT]=l)),u}cp.getConnectionAttributes=mDt;function ADt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function gDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function hDt(e,t,n,r=!1,o=_Dt){let[i,s]=typeof e=="string"?[e,n]:[e.sql,EDt(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"}}cp.getQueryText=hDt;function _Dt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function EDt(e){return"values"in e}function yDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}cp.getSpanName=yDt;var SDt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};cp.once=SDt;function TDt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}cp.getConnectionPrototypeToInstrument=TDt});var KPe=M(IR=>{"use strict";m();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-mysql2"});var XPe=M(e6=>{"use strict";m();Object.defineProperty(e6,"__esModule",{value:!0});e6.MySQL2Instrumentation=void 0;var JPe=(He(),Me(tt)),xf=un(),qW=jW(),ZPe=HW(),CR=YPe(),WPe=KPe(),VW=(Xn(),Me(Hr)),YW=[">=1.4.2 <4"],KW=class extends xf.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(WPe.PACKAGE_NAME,WPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,xf.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,xf.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,xf.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 xf.InstrumentationNodeModuleDefinition("mysql2",YW,i=>(n(i),i),()=>{},[new xf.InstrumentationNodeModuleFile("mysql2/promise.js",YW,i=>(n(i),i),()=>{}),new xf.InstrumentationNodeModuleFile("mysql2/lib/connection.js",YW,i=>{let s=(0,CR.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,CR.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,u){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:_}=o.getConfig(),y=(0,CR.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),T=(0,CR.getQueryText)(i,t,l,f,h);o._dbSemconvStability&xf.SemconvStability.OLD&&(y[qW.ATTR_DB_SYSTEM]=qW.DB_SYSTEM_VALUE_MYSQL,y[qW.ATTR_DB_STATEMENT]=T),o._dbSemconvStability&xf.SemconvStability.STABLE&&(y[VW.ATTR_DB_SYSTEM_NAME]=VW.DB_SYSTEM_NAME_VALUE_MYSQL,y[VW.ATTR_DB_QUERY_TEXT]=T);let v=o.tracer.startSpan((0,CR.getSpanName)(i),{kind:JPe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,ZPe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,ZPe.addSqlCommenterComment)(v,i.sql)}));let R=(0,CR.once)((x,O)=>{x?v.setStatus({code:JPe.SpanStatusCode.ERROR,message:x.message}):typeof _=="function"&&(0,xf.safeExecuteInTheMiddle)(()=>{_(v,{queryResults:O})},P=>{P&&o._diag.warn("Failed executing responseHook",P)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(R));let x=r.apply(this,arguments);return x.once("error",O=>{R(O)}).once("result",O=>{R(void 0,O)}),x}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(R)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(R)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};e6.MySQL2Instrumentation=KW});var eMe=M(t6=>{"use strict";m();Object.defineProperty(t6,"__esModule",{value:!0});t6.MySQL2Instrumentation=void 0;var bDt=XPe();Object.defineProperty(t6,"MySQL2Instrumentation",{enumerable:!0,get:function(){return bDt.MySQL2Instrumentation}})});var tMe,nMe,rMe,IDt,oMe,iMe=w(()=>{m();tMe=ue(eMe(),1);_r();nMe="Mysql2",rMe=ct(nMe,()=>new tMe.MySQL2Instrumentation({responseHook(e){qr(e,"auto.db.otel.mysql2")}})),IDt=(()=>({name:nMe,setupOnce(){rMe()}})),oMe=IDt});var sMe=M(Au=>{"use strict";m();Object.defineProperty(Au,"__esModule",{value:!0});Au.DB_SYSTEM_VALUE_REDIS=Au.DB_SYSTEM_NAME_VALUE_REDIS=Au.ATTR_NET_PEER_PORT=Au.ATTR_NET_PEER_NAME=Au.ATTR_DB_SYSTEM=Au.ATTR_DB_STATEMENT=Au.ATTR_DB_CONNECTION_STRING=void 0;Au.ATTR_DB_CONNECTION_STRING="db.connection_string";Au.ATTR_DB_STATEMENT="db.statement";Au.ATTR_DB_SYSTEM="db.system";Au.ATTR_NET_PEER_NAME="net.peer.name";Au.ATTR_NET_PEER_PORT="net.peer.port";Au.DB_SYSTEM_NAME_VALUE_REDIS="redis";Au.DB_SYSTEM_VALUE_REDIS="redis"});var aMe=M(n6=>{"use strict";m();Object.defineProperty(n6,"__esModule",{value:!0});n6.endSpan=void 0;var CDt=(He(),Me(tt)),vDt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:CDt.SpanStatusCode.ERROR,message:t.message})),e.end()};n6.endSpan=vDt});var o6=M(r6=>{"use strict";m();Object.defineProperty(r6,"__esModule",{value:!0});r6.defaultDbStatementSerializer=void 0;var RDt=[{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}],xDt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=RDt.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};r6.defaultDbStatementSerializer=xDt});var uMe=M(vR=>{"use strict";m();Object.defineProperty(vR,"__esModule",{value:!0});vR.PACKAGE_NAME=vR.PACKAGE_VERSION=void 0;vR.PACKAGE_VERSION="0.62.0";vR.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var pMe=M(i6=>{"use strict";m();Object.defineProperty(i6,"__esModule",{value:!0});i6.IORedisInstrumentation=void 0;var TE=(He(),Me(tt)),Wc=un(),bE=(Xn(),Me(Hr)),Xc=sMe(),cMe=un(),pO=aMe(),DDt=o6(),lMe=uMe(),dMe={requireParentSpan:!0},JW=class extends Wc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(lMe.PACKAGE_NAME,lMe.PACKAGE_VERSION,{...dMe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Wc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Wc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...dMe,...t})}init(){return[new Wc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Wc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Wc.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||DDt.defaultDbStatementSerializer,u=TE.trace.getSpan(TE.context.active())===void 0;if(i.requireParentSpan===!0&&u)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,_=s(o.name,o.args);r._dbSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,l[Xc.ATTR_DB_STATEMENT]=_,l[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,l[bE.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_NET_PEER_NAME]=f,l[Xc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_SERVER_ADDRESS]=f,l[bE.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:TE.SpanKind.CLIENT,attributes:l}),{requestHook:T}=i;T&&(0,cMe.safeExecuteInTheMiddle)(()=>T(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&TE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),R=o.resolve;o.resolve=function(O){(0,cMe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,O),P=>{P&&TE.diag.error("ioredis instrumentation: response hook failed",P)},!0),(0,pO.endSpan)(y,null),R(O)};let x=o.reject;return o.reject=function(O){(0,pO.endSpan)(y,O),x(O)},v}catch(v){throw(0,pO.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=TE.trace.getSpan(TE.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&Wc.SemconvStability.OLD&&(o[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,o[Xc.ATTR_DB_STATEMENT]="connect",o[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,o[bE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Wc.SemconvStability.OLD&&(o[Xc.ATTR_NET_PEER_NAME]=i,o[Xc.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_SERVER_ADDRESS]=i,o[bE.ATTR_SERVER_PORT]=s);let u=n.tracer.startSpan("connect",{kind:TE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,pO.endSpan)(u,null),l}catch(l){throw(0,pO.endSpan)(u,l),l}}}};i6.IORedisInstrumentation=JW});var fMe=M(s6=>{"use strict";m();Object.defineProperty(s6,"__esModule",{value:!0});s6.IORedisInstrumentation=void 0;var NDt=pMe();Object.defineProperty(s6,"IORedisInstrumentation",{enumerable:!0,get:function(){return NDt.IORedisInstrumentation}})});var a6=M(RR=>{"use strict";m();Object.defineProperty(RR,"__esModule",{value:!0});RR.PACKAGE_NAME=RR.PACKAGE_VERSION=void 0;RR.PACKAGE_VERSION="0.62.0";RR.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var mMe=M(IE=>{"use strict";m();Object.defineProperty(IE,"__esModule",{value:!0});IE.getTracedCreateStreamTrace=IE.getTracedCreateClient=IE.endSpan=void 0;var fO=(He(),Me(tt)),BDt=(e,t)=>{t&&e.setStatus({code:fO.SpanStatusCode.ERROR,message:t.message}),e.end()};IE.endSpan=BDt;var wDt=e=>function(){let n=e.apply(this,arguments);return fO.context.bind(fO.context.active(),n)};IE.getTracedCreateClient=wDt;var ODt=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=ODt});var u6=M(gu=>{"use strict";m();Object.defineProperty(gu,"__esModule",{value:!0});gu.DB_SYSTEM_VALUE_REDIS=gu.DB_SYSTEM_NAME_VALUE_REDIS=gu.ATTR_NET_PEER_PORT=gu.ATTR_NET_PEER_NAME=gu.ATTR_DB_SYSTEM=gu.ATTR_DB_STATEMENT=gu.ATTR_DB_CONNECTION_STRING=void 0;gu.ATTR_DB_CONNECTION_STRING="db.connection_string";gu.ATTR_DB_STATEMENT="db.statement";gu.ATTR_DB_SYSTEM="db.system";gu.ATTR_NET_PEER_NAME="net.peer.name";gu.ATTR_NET_PEER_PORT="net.peer.port";gu.DB_SYSTEM_NAME_VALUE_REDIS="redis";gu.DB_SYSTEM_VALUE_REDIS="redis"});var gMe=M(l6=>{"use strict";m();Object.defineProperty(l6,"__esModule",{value:!0});l6.RedisInstrumentationV2_V3=void 0;var Xl=un(),c6=mMe(),AMe=a6(),mO=(He(),Me(tt)),AO=(Xn(),Me(Hr)),rT=u6(),kDt=o6(),ZW=class e extends Xl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(AMe.PACKAGE_NAME,AMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Xl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,Xl.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,Xl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Xl.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(),u=mO.trace.getSpan(mO.context.active())===void 0;if(s.requireParentSpan===!0&&u)return r.apply(this,arguments);let l=s?.dbStatementSerializer||kDt.defaultDbStatementSerializer,f={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(f,{[rT.ATTR_DB_SYSTEM]:rT.DB_SYSTEM_VALUE_REDIS,[rT.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(f,{[AO.ATTR_DB_SYSTEM_NAME]:rT.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 y={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(y,{[rT.ATTR_NET_PEER_NAME]:this.connection_options.host,[rT.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(y,{[AO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[AO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&Xl.SemconvStability.OLD&&h.setAttribute(rT.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let _=arguments[0].callback;if(_){let y=mO.context.active();arguments[0].callback=function(v,R){if(s?.responseHook){let x=s.responseHook;(0,Xl.safeExecuteInTheMiddle)(()=>{x(h,i.command,i.args,R)},O=>{O&&t._diag.error("Error executing responseHook",O)},!0)}return(0,c6.endSpan)(h,v),mO.context.with(y,_,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,c6.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,c6.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,c6.getTracedCreateStreamTrace)(n)}}};l6.RedisInstrumentationV2_V3=ZW});var _Me=M(d6=>{"use strict";m();Object.defineProperty(d6,"__esModule",{value:!0});d6.getClientAttributes=void 0;var WW=(Xn(),Me(Hr)),xR=u6(),hMe=un();function PDt(e,t,n){let r={};return n&hMe.SemconvStability.OLD&&Object.assign(r,{[xR.ATTR_DB_SYSTEM]:xR.DB_SYSTEM_VALUE_REDIS,[xR.ATTR_NET_PEER_NAME]:t?.socket?.host,[xR.ATTR_NET_PEER_PORT]:t?.socket?.port,[xR.ATTR_DB_CONNECTION_STRING]:MDt(e,t?.url)}),n&hMe.SemconvStability.STABLE&&Object.assign(r,{[WW.ATTR_DB_SYSTEM_NAME]:xR.DB_SYSTEM_NAME_VALUE_REDIS,[WW.ATTR_SERVER_ADDRESS]:t?.socket?.host,[WW.ATTR_SERVER_PORT]:t?.socket?.port}),r}d6.getClientAttributes=PDt;function MDt(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 TMe=M(p6=>{"use strict";m();Object.defineProperty(p6,"__esModule",{value:!0});p6.RedisInstrumentationV4_V5=void 0;var lp=(He(),Me(tt)),Co=un(),EMe=_Me(),LDt=o6(),yMe=a6(),XW=(Xn(),Me(Hr)),UDt=u6(),gO=Symbol("opentelemetry.instrumentation.redis.open_spans"),SMe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),eX=class e extends Co.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(yMe.PACKAGE_NAME,yMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.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 Co.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let u=i.transformCommandArguments;if(!u)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Co.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(u)),i},i=>{(0,Co.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Co.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Co.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Co.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,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Co.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Co.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 u=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(u,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(u=>{let l=this[gO];return n._endSpansWithRedisReplies(l,u,t),u}).catch(u=>{let l=this[gO];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=u.constructor.name==="MultiErrorReply"?u.replies:new Array(l.length).fill(u);n._endSpansWithRedisReplies(l,f,t)}return Promise.reject(u)})}}}_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[SMe]=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,EMe.getClientAttributes)(t._diag,i,t._semconvStability),u=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:lp.SpanKind.CLIENT,attributes:s});return lp.context.with(lp.trace.setSpan(lp.context.active(),u),()=>r.apply(this)).then(f=>(u.end(),f)).catch(f=>(u.recordException(f),u.setStatus({code:lp.SpanStatusCode.ERROR,message:f.message}),u.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(lp.trace.getSpan(lp.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[SMe],u=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||LDt.defaultDbStatementSerializer,h=(0,EMe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_OPERATION_NAME]=u);try{let T=f(u,l);T!=null&&(this._semconvStability&Co.SemconvStability.OLD&&(h[UDt.ATTR_DB_STATEMENT]=T),this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_QUERY_TEXT]=T))}catch(T){this._diag.error("dbStatementSerializer throw an exception",T,{commandName:u})}let _=this.tracer.startSpan(`${e.COMPONENT}-${u}`,{kind:lp.SpanKind.CLIENT,attributes:h}),y=lp.context.with(lp.trace.setSpan(lp.context.active(),_),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(T=>{this._endSpanWithResponse(_,u,l,T,void 0)},T=>{this._endSpanWithResponse(_,u,l,null,T)});else{let T=y;T[gO]=T[gO]||[],T[gO].push({span:_,commandName:u,commandArgs:l})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(u=>u.commandName),s=o.every(u=>u===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let u=0;u<t.length;u++){let{span:l,commandArgs:f}=t[u],h=n[u],[_,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Co.SemconvStability.STABLE&&l.setAttribute(XW.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[u],f,_,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(u){this._diag.error("responseHook throw an exception",u)}i&&(t.recordException(i),t.setStatus({code:lp.SpanStatusCode.ERROR,message:i?.message})),t.end()}};p6.RedisInstrumentationV4_V5=eX});var CMe=M(f6=>{"use strict";m();Object.defineProperty(f6,"__esModule",{value:!0});f6.RedisInstrumentation=void 0;var QDt=un(),bMe=a6(),FDt=gMe(),GDt=TMe(),IMe={requireParentSpan:!1},tX=class extends QDt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...IMe,...t};super(bMe.PACKAGE_NAME,bMe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new FDt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new GDt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...IMe,...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())}};f6.RedisInstrumentation=tX});var vMe=M(m6=>{"use strict";m();Object.defineProperty(m6,"__esModule",{value:!0});m6.RedisInstrumentation=void 0;var jDt=CMe();Object.defineProperty(m6,"RedisInstrumentation",{enumerable:!0,get:function(){return jDt.RedisInstrumentation}})});function hO(e,t){return e.includes(t.toLowerCase())}function rX(e){return hO(nX,e)?"cache.get":hO(HDt,e)?"cache.put":void 0}function $Dt(e,t){return t.some(n=>e.startsWith(n))}function xMe(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)?RMe(o.map(i=>n(i))):["<unknown>"],r=t[0];return hO(zDt,e)&&r!=null?n(r):RMe(t.map(o=>n(o)))}catch{return}}function DMe(e,t,n){if(!rX(e))return!1;for(let r of t)if($Dt(r,n))return!0;return!1}function NMe(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 RMe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var zDt,nX,HDt,BMe=w(()=>{m();zDt=["get","set","setex"],nX=["get","mget"],HDt=["set","setex"]});var wMe,OMe,A6,_O,kMe,qDt,VDt,PMe,YDt,MMe,LMe=w(()=>{m();wMe=ue(fMe(),1),OMe=ue(vMe(),1);At();_r();BMe();A6="Redis",_O={},kMe=(e,t,n,r)=>{e.setAttribute(Mt,"auto.db.otel.redis");let o=xMe(t,n),i=rX(t);if(!o||!i||!_O.cachePrefixes||!DMe(t,o,_O.cachePrefixes))return;let s=kt(e).data["net.peer.name"],u=kt(e).data["net.peer.port"];u&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":u});let l=NMe(r);l&&e.setAttribute(aY,l),hO(nX,t)&&l!==void 0&&e.setAttribute(iY,l>0),e.setAttributes({[Xt]:i,[sY]:o});let f=o.join(", ");e.updateName(_O.maxCacheKeyLength?Q_(f,_O.maxCacheKeyLength):f)},qDt=ct(`${A6}.IORedis`,()=>new wMe.IORedisInstrumentation({responseHook:kMe})),VDt=ct(`${A6}.Redis`,()=>new OMe.RedisInstrumentation({responseHook:kMe})),PMe=Object.assign(()=>{qDt(),VDt()},{id:A6}),YDt=((e={})=>({name:A6,setupOnce(){_O=e,PMe()}})),MMe=YDt});var UMe=M(g6=>{"use strict";m();Object.defineProperty(g6,"__esModule",{value:!0});g6.EVENT_LISTENERS_SET=void 0;g6.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var oX=M(EO=>{"use strict";m();Object.defineProperty(EO,"__esModule",{value:!0});EO.AttributeNames=void 0;var KDt;(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"})(KDt=EO.AttributeNames||(EO.AttributeNames={}))});var iX=M(wr=>{"use strict";m();Object.defineProperty(wr,"__esModule",{value:!0});wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=wr.METRIC_DB_CLIENT_CONNECTION_COUNT=wr.DB_SYSTEM_VALUE_POSTGRESQL=wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=wr.ATTR_NET_PEER_PORT=wr.ATTR_NET_PEER_NAME=wr.ATTR_DB_USER=wr.ATTR_DB_SYSTEM=wr.ATTR_DB_STATEMENT=wr.ATTR_DB_NAME=wr.ATTR_DB_CONNECTION_STRING=wr.ATTR_DB_CLIENT_CONNECTION_STATE=wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";wr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";wr.ATTR_DB_CONNECTION_STRING="db.connection_string";wr.ATTR_DB_NAME="db.name";wr.ATTR_DB_STATEMENT="db.statement";wr.ATTR_DB_SYSTEM="db.system";wr.ATTR_DB_USER="db.user";wr.ATTR_NET_PEER_NAME="net.peer.name";wr.ATTR_NET_PEER_PORT="net.peer.port";wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";wr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";wr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var sX=M(yO=>{"use strict";m();Object.defineProperty(yO,"__esModule",{value:!0});yO.SpanNames=void 0;var JDt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(JDt=yO.SpanNames||(yO.SpanNames={}))});var $Me=M(sr=>{"use strict";m();Object.defineProperty(sr,"__esModule",{value:!0});sr.sanitizedErrorMessage=sr.isObjectWithTextString=sr.getErrorMessage=sr.patchClientConnectCallback=sr.patchCallbackPGPool=sr.updateCounter=sr.getPoolName=sr.patchCallback=sr.handleExecutionResult=sr.handleConfigQuery=sr.shouldSkipInstrumentation=sr.getSemanticAttributesFromPoolConnection=sr.getSemanticAttributesFromConnection=sr.getConnectionString=sr.parseAndMaskConnectionString=sr.parseNormalizedOperationName=sr.getQuerySpanName=void 0;var CE=(He(),Me(tt)),h6=oX(),dp=(Xn(),Me(Hr)),Ei=iX(),oT=un(),QMe=sX();function FMe(e,t){if(!t)return QMe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:GMe(t.text);return`${QMe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}sr.getQuerySpanName=FMe;function GMe(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}sr.parseNormalizedOperationName=GMe;function jMe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}sr.parseAndMaskConnectionString=jMe;function aX(e){if("connectionString"in e&&e.connectionString)return jMe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}sr.getConnectionString=aX;function _6(e){if(Number.isInteger(e))return e}function zMe(e,t){let n={};return t&oT.SemconvStability.OLD&&(n={...n,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_DB_USER]:e.user,[Ei.ATTR_NET_PEER_NAME]:e.host,[Ei.ATTR_NET_PEER_PORT]:_6(e.port)}),t&oT.SemconvStability.STABLE&&(n={...n,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:e.host,[dp.ATTR_SERVER_PORT]:_6(e.port)}),n}sr.getSemanticAttributesFromConnection=zMe;function ZDt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[h6.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[h6.AttributeNames.MAX_CLIENT]:e.maxClient};return t&oT.SemconvStability.OLD&&(r={...r,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[Ei.ATTR_NET_PEER_PORT]:Number(n?.port)||_6(e.port),[Ei.ATTR_DB_USER]:n?.username??e.user}),t&oT.SemconvStability.STABLE&&(r={...r,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[dp.ATTR_SERVER_PORT]:Number(n?.port)||_6(e.port)}),r}sr.getSemanticAttributesFromPoolConnection=ZDt;function WDt(e){return e.requireParentSpan===!0&&CE.trace.getSpan(CE.context.active())===void 0}sr.shouldSkipInstrumentation=WDt;function XDt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=FMe(i,r),u=e.startSpan(s,{kind:CE.SpanKind.CLIENT,attributes:zMe(o,n)});if(!r)return u;if(r.text&&(n&oT.SemconvStability.OLD&&u.setAttribute(Ei.ATTR_DB_STATEMENT,r.text),n&oT.SemconvStability.STABLE&&u.setAttribute(dp.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());u.setAttribute(h6.AttributeNames.PG_VALUES,l)}catch(l){CE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&u.setAttribute(h6.AttributeNames.PG_PLAN,r.name),u}sr.handleConfigQuery=XDt;function HMe(e,t,n){typeof e.responseHook=="function"&&(0,oT.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&CE.diag.error("Error running response hook",r)},!0)}sr.handleExecutionResult=HMe;function e1t(e,t,n,r,o){return function(s,u){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[dp.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(E6(s)),t.setStatus({code:CE.SpanStatusCode.ERROR,message:s.message})):HMe(e,t,u),o(),t.end(),n.call(this,s,u)}}sr.patchCallback=e1t;function t1t(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()}sr.getPoolName=t1t;function n1t(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,u=t.idleCount,l=i-u;return n.add(l-o.used,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(u-o.idle,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:u,pending:s}}sr.updateCounter=n1t;function r1t(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(E6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}sr.patchCallbackPGPool=r1t;function o1t(e,t){return function(r){r&&(r instanceof Error&&e.recordException(E6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}sr.patchClientConnectCallback=o1t;function i1t(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}sr.getErrorMessage=i1t;function s1t(e){return typeof e=="object"&&typeof e?.text=="string"}sr.isObjectWithTextString=s1t;function E6(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}sr.sanitizedErrorMessage=E6});var qMe=M(DR=>{"use strict";m();Object.defineProperty(DR,"__esModule",{value:!0});DR.PACKAGE_NAME=DR.PACKAGE_VERSION=void 0;DR.PACKAGE_VERSION="0.66.0";DR.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var WMe=M(S6=>{"use strict";m();Object.defineProperty(S6,"__esModule",{value:!0});S6.PgInstrumentation=void 0;var tc=un(),Yr=(He(),Me(tt)),VMe=UMe(),ni=$Me(),YMe=HW(),KMe=qMe(),JMe=sX(),y6=vr(),Df=(Xn(),Me(Hr)),SO=iX();function NR(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var uX=class extends tc.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(KMe.PACKAGE_NAME,KMe.PACKAGE_VERSION,t),this._semconvStability=(0,tc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Df.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Yr.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 tc.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new tc.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new tc.InstrumentationNodeModuleDefinition("pg",t,u=>{let l=NR(u);return this._patchPgClient(l.Client),u},u=>{let l=NR(u);return this._unpatchPgClient(l.Client),u},[o,r]),s=new tc.InstrumentationNodeModuleDefinition("pg-pool",n,u=>{let l=NR(u);return(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},u=>{let l=NR(u);(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.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=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(JMe.SpanNames.CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchClientConnectCallback(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return ZMe(s,u)}}recordOperationDuration(t,n){let r={},o=[Df.ATTR_DB_NAMESPACE,Df.ATTR_ERROR_TYPE,Df.ATTR_SERVER_PORT,Df.ATTR_SERVER_ADDRESS,Df.ATTR_DB_OPERATION_NAME];this._semconvStability&tc.SemconvStability.OLD&&o.push(SO.ATTR_DB_SYSTEM),this._semconvStability&tc.SemconvStability.STABLE&&o.push(Df.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,y6.hrTimeToMilliseconds)((0,y6.hrTimeDuration)(n,(0,y6.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ni.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,y6.hrTime)(),s=o[0],u=typeof s=="string",l=ni.isObjectWithTextString(s),f=u?{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,[Df.ATTR_DB_NAMESPACE]:this.database,[Df.ATTR_SERVER_PORT]:this.connectionParameters.port,[Df.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[Df.ATTR_DB_OPERATION_NAME]=ni.parseNormalizedOperationName(f?.text));let _=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),T=ni.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,f);if(y.addSqlCommenterCommentToQueries&&(u?o[0]=(0,YMe.addSqlCommenterComment)(T,s):l&&!("name"in s)&&(o[0]={...s,text:(0,YMe.addSqlCommenterComment)(T,s.text)})),o.length>0){let x=Yr.trace.getSpan(Yr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ni.patchCallback(y,T,o[o.length-1],h,_),x&&(o[o.length-1]=Yr.context.bind(Yr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let O=ni.patchCallback(t.getConfig(),T,f.callback,h,_);x&&(O=Yr.context.bind(Yr.context.active(),O)),o[0].callback=O}}let{requestHook:v}=y;typeof v=="function"&&f&&(0,tc.safeExecuteInTheMiddle)(()=>{let{database:x,host:O,port:P,user:j}=this.connectionParameters;v(T,{connection:{database:x,host:O,port:P,user:j},query:{text:f.text,values:f.values,name:f.name}})},x=>{x&&t._diag.error("Error running query hook",x)},!0);let R;try{R=n.apply(this,o)}catch(x){throw x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(x)}),T.end(),x}return R instanceof Promise?R.then(x=>new Promise(O=>{ni.handleExecutionResult(t.getConfig(),T,x),_(),T.end(),O(x)})).catch(x=>new Promise((O,P)=>{x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:x.message}),_(),T.end(),P(x)})):R})}_setPoolConnectEventListeners(t){if(t[VMe.EVENT_LISTENERS_SET])return;let n=ni.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[VMe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(JMe.SpanNames.POOL_CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchCallbackPGPool(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return ZMe(s,u)}}};S6.PgInstrumentation=uX;function ZMe(e,t){if(!(t instanceof Promise))return t;let n=t;return Yr.context.bind(Yr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(ni.sanitizedErrorMessage(r)),e.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var XMe=M(BR=>{"use strict";m();Object.defineProperty(BR,"__esModule",{value:!0});BR.AttributeNames=BR.PgInstrumentation=void 0;var a1t=WMe();Object.defineProperty(BR,"PgInstrumentation",{enumerable:!0,get:function(){return a1t.PgInstrumentation}});var u1t=oX();Object.defineProperty(BR,"AttributeNames",{enumerable:!0,get:function(){return u1t.AttributeNames}})});var e2e,t2e,n2e,c1t,r2e,o2e=w(()=>{m();e2e=ue(XMe(),1);_r();t2e="Postgres",n2e=ct(t2e,e2e.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){qr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),c1t=(e=>({name:t2e,setupOnce(){n2e(e)}})),r2e=c1t});var vE,lX,i2e,l1t,d1t,s2e,cX,p1t,a2e,u2e=w(()=>{m();He();vE=ue(un(),1);Xn();At();_r();YS();lX="PostgresJs",i2e=[">=3.0.0 <4"],l1t=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,d1t=Symbol.for("sentry.query.from.instrumented.sql"),s2e=ct(lX,e=>new cX({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),cX=class extends vE.InstrumentationBase{constructor(t){super("sentry-postgres-js",er,t)}init(){let t=new vE.InstrumentationNodeModuleDefinition("postgres",i2e,n=>{try{return this._patchPostgres(n)}catch(r){return Ds&&W.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new vE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,i2e,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 Ds&&W.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let u=Reflect.construct(r,s);if(!u||typeof u!="function")return Ds&&W.warn("postgres() did not return a valid instance"),u;let l=o.getConfig();return cK(u,{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 u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}return n?i:(gw(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Vt.getSpan(We.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(LC,r);return}let o=n?.match(l1t);o?.[1]&&t.setAttribute(LC,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[d1t])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return oa({name:s||"postgresjs.query",op:"db"},u=>{qr(u,"auto.db.postgresjs"),u.setAttributes({[fS]:"postgres",[SV]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,vE.safeExecuteInTheMiddle)(()=>f(u,s,void 0),y=>{y&&(u.setAttribute("sentry.hook.error","requestHook failed"),Ds&&W.error(`Error in requestHook for ${lX} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,T,v)=>{try{n._setOperationName(u,s,v?.[0]?.command),u.end()}catch(R){Ds&&W.error("Error ending span in resolve callback:",R)}return Reflect.apply(y,T,v)}});let _=this.reject;this.reject=new Proxy(_,{apply:(y,T,v)=>{try{u.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),u.setAttribute(TV,v?.[0]?.code||"unknown"),u.setAttribute(bV,v?.[0]?.name||"unknown"),n._setOperationName(u,s),u.end()}catch(R){Ds&&W.error("Error ending span in reject callback:",R)}return Reflect.apply(y,T,v)}});try{return r.apply(this,o)}catch(y){throw u.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),u.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},p1t=(e=>({name:lX,setupOnce(){s2e(e)}})),a2e=p1t});var c2e=M(TO=>{"use strict";m();Object.defineProperty(TO,"__esModule",{value:!0});TO.SeverityNumber=void 0;var f1t;(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"})(f1t=TO.SeverityNumber||(TO.SeverityNumber={}))});var b6=M(wR=>{"use strict";m();Object.defineProperty(wR,"__esModule",{value:!0});wR.NOOP_LOGGER=wR.NoopLogger=void 0;var T6=class{emit(t){}};wR.NoopLogger=T6;wR.NOOP_LOGGER=new T6});var C6=M(OR=>{"use strict";m();Object.defineProperty(OR,"__esModule",{value:!0});OR.NOOP_LOGGER_PROVIDER=OR.NoopLoggerProvider=void 0;var m1t=b6(),I6=class{getLogger(t,n,r){return new m1t.NoopLogger}};OR.NoopLoggerProvider=I6;OR.NOOP_LOGGER_PROVIDER=new I6});var pX=M(v6=>{"use strict";m();Object.defineProperty(v6,"__esModule",{value:!0});v6.ProxyLogger=void 0;var A1t=b6(),dX=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):A1t.NOOP_LOGGER}};v6.ProxyLogger=dX});var mX=M(R6=>{"use strict";m();Object.defineProperty(R6,"__esModule",{value:!0});R6.ProxyLoggerProvider=void 0;var g1t=C6(),h1t=pX(),fX=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new h1t.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:g1t.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)}};R6.ProxyLoggerProvider=fX});var l2e=M(x6=>{"use strict";m();Object.defineProperty(x6,"__esModule",{value:!0});x6._globalThis=void 0;x6._globalThis=typeof globalThis=="object"?globalThis:global});var d2e=M(D6=>{"use strict";m();Object.defineProperty(D6,"__esModule",{value:!0});D6._globalThis=void 0;var _1t=l2e();Object.defineProperty(D6,"_globalThis",{enumerable:!0,get:function(){return _1t._globalThis}})});var p2e=M(N6=>{"use strict";m();Object.defineProperty(N6,"__esModule",{value:!0});N6._globalThis=void 0;var E1t=d2e();Object.defineProperty(N6,"_globalThis",{enumerable:!0,get:function(){return E1t._globalThis}})});var f2e=M(nA=>{"use strict";m();Object.defineProperty(nA,"__esModule",{value:!0});nA.API_BACKWARDS_COMPATIBILITY_VERSION=nA.makeGetter=nA._global=nA.GLOBAL_LOGS_API_KEY=void 0;var y1t=p2e();nA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");nA._global=y1t._globalThis;function S1t(e,t,n){return r=>r===e?t:n}nA.makeGetter=S1t;nA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var A2e=M(B6=>{"use strict";m();Object.defineProperty(B6,"__esModule",{value:!0});B6.LogsAPI=void 0;var pp=f2e(),T1t=C6(),m2e=mX(),AX=class e{constructor(){this._proxyLoggerProvider=new m2e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return pp._global[pp.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(pp._global[pp.GLOBAL_LOGS_API_KEY]=(0,pp.makeGetter)(pp.API_BACKWARDS_COMPATIBILITY_VERSION,t,T1t.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=pp._global[pp.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(pp._global,pp.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete pp._global[pp.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new m2e.ProxyLoggerProvider}};B6.LogsAPI=AX});var gX=M(ca=>{"use strict";m();Object.defineProperty(ca,"__esModule",{value:!0});ca.logs=ca.ProxyLoggerProvider=ca.ProxyLogger=ca.NoopLoggerProvider=ca.NOOP_LOGGER_PROVIDER=ca.NoopLogger=ca.NOOP_LOGGER=ca.SeverityNumber=void 0;var b1t=c2e();Object.defineProperty(ca,"SeverityNumber",{enumerable:!0,get:function(){return b1t.SeverityNumber}});var g2e=b6();Object.defineProperty(ca,"NOOP_LOGGER",{enumerable:!0,get:function(){return g2e.NOOP_LOGGER}});Object.defineProperty(ca,"NoopLogger",{enumerable:!0,get:function(){return g2e.NoopLogger}});var h2e=C6();Object.defineProperty(ca,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return h2e.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ca,"NoopLoggerProvider",{enumerable:!0,get:function(){return h2e.NoopLoggerProvider}});var I1t=pX();Object.defineProperty(ca,"ProxyLogger",{enumerable:!0,get:function(){return I1t.ProxyLogger}});var C1t=mX();Object.defineProperty(ca,"ProxyLoggerProvider",{enumerable:!0,get:function(){return C1t.ProxyLoggerProvider}});var v1t=A2e();ca.logs=v1t.LogsAPI.getInstance()});var _2e=M(kR=>{"use strict";m();Object.defineProperty(kR,"__esModule",{value:!0});kR.disableInstrumentations=kR.enableInstrumentations=void 0;function R1t(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()}}kR.enableInstrumentations=R1t;function x1t(e){e.forEach(t=>t.disable())}kR.disableInstrumentations=x1t});var S2e=M(w6=>{"use strict";m();Object.defineProperty(w6,"__esModule",{value:!0});w6.registerInstrumentations=void 0;var E2e=(He(),Me(tt)),D1t=gX(),y2e=_2e();function N1t(e){let t=e.tracerProvider||E2e.trace.getTracerProvider(),n=e.meterProvider||E2e.metrics.getMeterProvider(),r=e.loggerProvider||D1t.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,y2e.enableInstrumentations)(o,t,n,r),()=>{(0,y2e.disableInstrumentations)(o)}}w6.registerInstrumentations=N1t});var N2e=M(O6=>{"use strict";m();Object.defineProperty(O6,"__esModule",{value:!0});O6.satisfies=void 0;var yX=(He(),Me(tt)),v2e=/^(?: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-]+)*))?$/,B1t=/^(?<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-]+)*))?$/,w1t={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function O1t(e,t,n){if(!k1t(e))return yX.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=U1t(e);if(!r)return!1;let o=[],i=R2e(r,t,o,n);return i&&!n?.includePrerelease?M1t(r,o):i}O6.satisfies=O1t;function k1t(e){return typeof e=="string"&&v2e.test(e)}function R2e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(hX(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=iNt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!hX(e,i,n,r))return!1;return!0}return hX(e,t,n,r)}function hX(e,t,n,r){if(t=L1t(t,r),t.includes(" "))return R2e(e,t,n,r);{let o=Q1t(t);return n.push(o),P1t(e,o)}}function P1t(e,t){if(t.invalid)return!1;if(!t.version||EX(t.version))return!0;let n=b2e(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=b2e(r,o)}return w1t[t.op]?.includes(n)}function M1t(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function L1t(e,t){return e=e.trim(),e=rNt(e,t),e=nNt(e),e=oNt(e,t),e=e.trim(),e}function nc(e){return!e||e.toLowerCase()==="x"||e==="*"}function U1t(e){let t=e.match(v2e);if(!t){yX.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 Q1t(e){if(!e)return{};let t=e.match(B1t);if(!t)return yX.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("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function EX(e){return e==="*"||e==="x"||e==="X"}function T2e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function F1t(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 G1t(e,t){if(EX(e)||EX(t))return 0;let[n,r]=F1t(T2e(e),T2e(t));return n>r?1:n<r?-1:0}function b2e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=G1t(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var x2e="[a-zA-Z0-9-]",D2e="0|[1-9]\\d*",j1t=`\\d*[a-zA-Z-]${x2e}*`,z1t="((?:<|>)?=?)",I2e=`(?:${D2e}|${j1t})`,H1t=`(?:-(${I2e}(?:\\.${I2e})*))`,C2e=`${x2e}+`,$1t=`(?:\\+(${C2e}(?:\\.${C2e})*))`,_X=`${D2e}|x|X|\\*`,bO=`[v=\\s]*(${_X})(?:\\.(${_X})(?:\\.(${_X})(?:${H1t})?${$1t}?)?)?`,q1t=`^${z1t}\\s*${bO}$`,V1t=new RegExp(q1t),Y1t=`^\\s*(${bO})\\s+-\\s+(${bO})\\s*$`,K1t=new RegExp(Y1t),J1t="(?:~>?)",Z1t=`^${J1t}${bO}$`,W1t=new RegExp(Z1t),X1t="(?:\\^)",eNt=`^${X1t}${bO}$`,tNt=new RegExp(eNt);function nNt(e){let t=W1t;return e.replace(t,(n,r,o,i,s)=>{let u;return nc(r)?u="":nc(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:nc(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function rNt(e,t){let n=tNt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return nc(i)?f="":nc(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:nc(u)?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}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function oNt(e,t){let n=V1t;return e.replace(n,(r,o,i,s,u,l)=>{let f=nc(i),h=f||nc(s),_=h||nc(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function iNt(e,t){let n=K1t;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>(nc(i)?o="":nc(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:nc(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,nc(_)?h="":nc(y)?h=`<${+_+1}.0.0-0`:nc(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var SX=M(La=>{"use strict";m();Object.defineProperty(La,"__esModule",{value:!0});La.massUnwrap=La.unwrap=La.massWrap=La.wrap=void 0;var rc=console.error.bind(console);function IO(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 sNt=(e,t,n)=>{if(!e||!e[t]){rc("no original function "+String(t)+" to wrap");return}if(!n){rc("no wrapper function"),rc(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){rc("original object and wrapper must be functions");return}let o=n(r,t);return IO(o,"__original",r),IO(o,"__unwrap",()=>{e[t]===o&&IO(e,t,r)}),IO(o,"__wrapped",!0),IO(e,t,o),o};La.wrap=sNt;var aNt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,La.wrap)(r,o,n)})})};La.massWrap=aNt;var uNt=(e,t)=>{if(!e||!e[t]){rc("no function to unwrap."),rc(new Error().stack);return}let n=e[t];if(!n.__unwrap)rc("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};La.unwrap=uNt;var cNt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,La.unwrap)(n,r)})})};La.massUnwrap=cNt;function CO(e){e&&e.logger&&(typeof e.logger!="function"?rc("new logger isn't a function, not replacing"):rc=e.logger)}La.default=CO;CO.wrap=La.wrap;CO.massWrap=La.massWrap;CO.unwrap=La.unwrap;CO.massUnwrap=La.massUnwrap});var B2e=M(P6=>{"use strict";m();Object.defineProperty(P6,"__esModule",{value:!0});P6.InstrumentationAbstract=void 0;var TX=(He(),Me(tt)),lNt=gX(),k6=SX(),bX=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=TX.diag.createComponentLogger({namespace:t}),this._tracer=TX.trace.getTracer(t,n),this._meter=TX.metrics.getMeter(t,n),this._logger=lNt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=k6.wrap;_unwrap=k6.unwrap;_massWrap=k6.massWrap;_massUnwrap=k6.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)}}};P6.InstrumentationAbstract=bX});var w2e=M(RE=>{"use strict";m();Object.defineProperty(RE,"__esModule",{value:!0});RE.ModuleNameTrie=RE.ModuleNameSeparator=void 0;RE.ModuleNameSeparator="/";var M6=class{hooks=[];children=new Map},IX=class{_trie=new M6;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(RE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new M6,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 u of t.split(RE.ModuleNameSeparator)){let l=o.children.get(u);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((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};RE.ModuleNameTrie=IX});var k2e=M(L6=>{"use strict";m();Object.defineProperty(L6,"__esModule",{value:!0});L6.RequireInTheMiddleSingleton=void 0;var dNt=ES(),O2e=Ue("path"),CX=w2e(),pNt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),vX=class e{_moduleNameTrie=new CX.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new dNt.Hook(null,{internals:!0},(t,n,r)=>{let o=fNt(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 pNt?new e:this._instance=this._instance??new e}};L6.RequireInTheMiddleSingleton=vX;function fNt(e){return O2e.sep!==CX.ModuleNameSeparator?e.split(O2e.sep).join(CX.ModuleNameSeparator):e}});var RX=M(xE=>{"use strict";m();Object.defineProperty(xE,"__esModule",{value:!0});xE.isWrapped=xE.safeExecuteInTheMiddleAsync=xE.safeExecuteInTheMiddle=void 0;function mNt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddle=mNt;async function ANt(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}}xE.safeExecuteInTheMiddleAsync=ANt;function gNt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}xE.isWrapped=gNt});var L2e=M(U6=>{"use strict";m();Object.defineProperty(U6,"__esModule",{value:!0});U6.InstrumentationBase=void 0;var vO=Ue("path"),P2e=Ue("util"),hNt=N2e(),xX=SX(),_Nt=B2e(),ENt=k2e(),yNt=uW(),RO=(He(),Me(tt)),SNt=ES(),TNt=Ue("fs"),bNt=RX(),DX=class extends _Nt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=ENt.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,bNt.isWrapped)(t[n])&&this._unwrap(t,n),P2e.types.isProxy(t)){let o=(0,xX.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,xX.wrap)(t,n,r)};_unwrap=(t,n)=>P2e.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,xX.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=Ue.resolve(n);Ue.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,TNt.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 M2e(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??[],u=vO.normalize(r);return s.filter(f=>f.name===u).filter(f=>M2e(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,u,l)=>{if(!l&&vO.isAbsolute(u)){let f=vO.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=vO.isAbsolute(t.name)?new SNt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new yNt.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}};U6.InstrumentationBase=DX;function M2e(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,hNt.satisfies)(t,r,{includePrerelease:n}))}});var U2e=M(Q6=>{"use strict";m();Object.defineProperty(Q6,"__esModule",{value:!0});Q6.normalize=void 0;var INt=Ue("path");Object.defineProperty(Q6,"normalize",{enumerable:!0,get:function(){return INt.normalize}})});var Q2e=M(PR=>{"use strict";m();Object.defineProperty(PR,"__esModule",{value:!0});PR.normalize=PR.InstrumentationBase=void 0;var CNt=L2e();Object.defineProperty(PR,"InstrumentationBase",{enumerable:!0,get:function(){return CNt.InstrumentationBase}});var vNt=U2e();Object.defineProperty(PR,"normalize",{enumerable:!0,get:function(){return vNt.normalize}})});var NX=M(MR=>{"use strict";m();Object.defineProperty(MR,"__esModule",{value:!0});MR.normalize=MR.InstrumentationBase=void 0;var F2e=Q2e();Object.defineProperty(MR,"InstrumentationBase",{enumerable:!0,get:function(){return F2e.InstrumentationBase}});Object.defineProperty(MR,"normalize",{enumerable:!0,get:function(){return F2e.normalize}})});var G2e=M(F6=>{"use strict";m();Object.defineProperty(F6,"__esModule",{value:!0});F6.InstrumentationNodeModuleDefinition=void 0;var BX=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||[]}};F6.InstrumentationNodeModuleDefinition=BX});var j2e=M(G6=>{"use strict";m();Object.defineProperty(G6,"__esModule",{value:!0});G6.InstrumentationNodeModuleFile=void 0;var RNt=NX(),wX=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,RNt.normalize)(t)}};G6.InstrumentationNodeModuleFile=wX});var z2e=M(iT=>{"use strict";m();Object.defineProperty(iT,"__esModule",{value:!0});iT.semconvStabilityFromStr=iT.SemconvStability=void 0;var j6;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(j6=iT.SemconvStability||(iT.SemconvStability={}));function xNt(e,t){let n=j6.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=j6.DUPLICATE;break}else o.toLowerCase()===e&&(n=j6.STABLE);return n}iT.semconvStabilityFromStr=xNt});var $2e=M(cs=>{"use strict";m();Object.defineProperty(cs,"__esModule",{value:!0});cs.semconvStabilityFromStr=cs.SemconvStability=cs.safeExecuteInTheMiddleAsync=cs.safeExecuteInTheMiddle=cs.isWrapped=cs.InstrumentationNodeModuleFile=cs.InstrumentationNodeModuleDefinition=cs.InstrumentationBase=cs.registerInstrumentations=void 0;var DNt=S2e();Object.defineProperty(cs,"registerInstrumentations",{enumerable:!0,get:function(){return DNt.registerInstrumentations}});var NNt=NX();Object.defineProperty(cs,"InstrumentationBase",{enumerable:!0,get:function(){return NNt.InstrumentationBase}});var BNt=G2e();Object.defineProperty(cs,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return BNt.InstrumentationNodeModuleDefinition}});var wNt=j2e();Object.defineProperty(cs,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return wNt.InstrumentationNodeModuleFile}});var OX=RX();Object.defineProperty(cs,"isWrapped",{enumerable:!0,get:function(){return OX.isWrapped}});Object.defineProperty(cs,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddle}});Object.defineProperty(cs,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddleAsync}});var H2e=z2e();Object.defineProperty(cs,"SemconvStability",{enumerable:!0,get:function(){return H2e.SemconvStability}});Object.defineProperty(cs,"semconvStabilityFromStr",{enumerable:!0,get:function(){return H2e.semconvStabilityFromStr}})});function PNt(){let e=LR[PX];return e?.helper?e.helper:LR[kX]?.helper}function MNt(e){let t={helper:e};LR[PX]=t,LR[kX]=t}function LNt(){delete LR[PX],delete LR[kX]}function FNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}function Y2e(e,t,n,r,o){if(K2e(t.name,o))return;let i={attributes:t.attributes,kind:FNt(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 u=n.filter(l=>l.parentId===t.id);for(let l of u)Y2e(e,l,n,r,o);s.end(t.endTime)})}function q2e(e,t){return jNt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function jNt(e){return e!=null&&typeof e.then=="function"}function K2e(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var z6,ONt,kNt,kX,PX,LR,UNt,QNt,GNt,J2e,V2e,zNt,HNt,Z2e,W2e=w(()=>{m();He();z6=ue($2e(),1);He();ONt={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"}},kNt=ONt.version.split(".")[0],kX="PRISMA_INSTRUMENTATION",PX=`V${kNt}_PRISMA_INSTRUMENTATION`,LR=globalThis;UNt=process.env.PRISMA_SHOW_ALL_TRACES==="true",QNt="00-10-10-00";GNt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Vt.getSpanContext(e??We.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:QNt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)Y2e(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return We.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!UNt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(K2e(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return q2e(i,t(i,r))}return n.startActiveSpan(o,e,i=>q2e(i,t(i,r)))}};J2e={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},V2e=J2e.version,zNt=J2e.name,HNt="@prisma/client",Z2e=class extends z6.InstrumentationBase{tracerProvider;constructor(e={}){super(zNt,V2e,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new z6.InstrumentationNodeModuleDefinition(HNt,[V2e])]}enable(){let e=this._config;MNt(new GNt({tracerProvider:this.tracerProvider??Vt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){LNt()}isEnabled(){return PNt()!==void 0}}});function $Nt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function eLe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function qNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}var X2e,MX,VNt,tLe,nLe=w(()=>{m();He();W2e();At();_r();X2e="Prisma";MX=class extends Z2e{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=eLe();$Nt(t)&&(t.createEngineSpan=n=>{let r=Vt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Xo(()=>{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=qNt(i.kind),u=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:ou.SAMPLED}})),_=Vt.setSpanContext(We.active(),{traceId:f,spanId:u,traceFlags:ou.SAMPLED});We.with(_,()=>{let y={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=y,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}})}};VNt=ct(X2e,e=>new MX(e)),tLe=e=>({name:X2e,setupOnce(){VNt(e)},setup(t){eLe()&&t.on("spanStart",n=>{let r=kt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Mt,"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 rLe=M(UR=>{"use strict";m();Object.defineProperty(UR,"__esModule",{value:!0});UR.PACKAGE_NAME=UR.PACKAGE_VERSION=void 0;UR.PACKAGE_VERSION="0.60.0";UR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var LX=M(rA=>{"use strict";m();Object.defineProperty(rA,"__esModule",{value:!0});rA.HapiLifecycleMethodNames=rA.HapiLayerType=rA.handlerPatched=rA.HapiComponentName=void 0;rA.HapiComponentName="@hapi/hapi";rA.handlerPatched=Symbol("hapi-handler-patched");rA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};rA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var oLe=M(H6=>{"use strict";m();Object.defineProperty(H6,"__esModule",{value:!0});H6.ATTR_HTTP_METHOD=void 0;H6.ATTR_HTTP_METHOD="http.method"});var UX=M(xO=>{"use strict";m();Object.defineProperty(xO,"__esModule",{value:!0});xO.AttributeNames=void 0;var YNt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(YNt=xO.AttributeNames||(xO.AttributeNames={}))});var aLe=M(ls=>{"use strict";m();Object.defineProperty(ls,"__esModule",{value:!0});ls.getPluginFromInput=ls.getExtMetadata=ls.getRouteMetadata=ls.isPatchableExtMethod=ls.isDirectExtInput=ls.isLifecycleExtEventObj=ls.isLifecycleExtType=ls.getPluginName=void 0;var iLe=(Xn(),Me(Hr)),KNt=oLe(),DO=LX(),DE=UX(),sLe=un();function JNt(e){return e.name?e.name:e.pkg.name}ls.getPluginName=JNt;var ZNt=e=>typeof e=="string"&&DO.HapiLifecycleMethodNames.has(e);ls.isLifecycleExtType=ZNt;var WNt=e=>{let t=e?.type;return t!==void 0&&(0,ls.isLifecycleExtType)(t)};ls.isLifecycleExtEventObj=WNt;var XNt=e=>Array.isArray(e)&&e.length<=3&&(0,ls.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ls.isDirectExtInput=XNt;var eBt=e=>!Array.isArray(e);ls.isPatchableExtMethod=eBt;var tBt=(e,t,n)=>{let r={[iLe.ATTR_HTTP_ROUTE]:e.path};t&sLe.SemconvStability.OLD&&(r[KNt.ATTR_HTTP_METHOD]=e.method),t&sLe.SemconvStability.STABLE&&(r[iLe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.PLUGIN,r[DE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ls.getRouteMetadata=tBt;var nBt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT,[DE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT},name:r}};ls.getExtMetadata=nBt;var rBt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ls.getPluginFromInput=rBt});var lLe=M($6=>{"use strict";m();Object.defineProperty($6,"__esModule",{value:!0});$6.HapiInstrumentation=void 0;var ed=(He(),Me(tt)),uLe=vr(),NO=un(),cLe=rLe(),BO=LX(),eh=aLe(),QX=class extends NO.InstrumentationBase{_semconvStability;constructor(t={}){super(cLe.PACKAGE_NAME,cLe.PACKAGE_VERSION,t),this._semconvStability=(0,NO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new NO.InstrumentationNodeModuleDefinition(BO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,NO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,NO.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",u=>n._getServerRoutePatch.bind(n)(u)),r._wrap(s,"ext",u=>n._getServerExtPatch.bind(n)(u)),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 u=(0,eh.getPluginFromInput)(s);n._wrapRegisterHandler(u)}else{let s=(0,eh.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 u=0;u<s.length;u++){let l=s[u];if((0,eh.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[u]=f}}return t.apply(this,i)}else if((0,eh.isDirectExtInput)(i)){let s=i,u=s[1],l=r._wrapExtMethods(u,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,eh.isLifecycleExtEventObj)(i[0])){let s=i[0],u=r._wrapExtMethods(s.method,s.type,n);return s.method=u,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,eh.getPluginName)(t),o=t.register,i=this,s=function(u,l){return i._wrap(u,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(u,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,u,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,eh.isPatchableExtMethod)(t))return t[BO.handlerPatched]===!0?t:(t[BO.handlerPatched]=!0,async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await t.apply(this,s);let u=(0,eh.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:ed.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[BO.handlerPatched]===!0)return t;t[BO.handlerPatched]=!0;let o=i=>async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await i.call(this,...s);let u=(0,uLe.getRPCMetadata)(ed.context.active());u?.type===uLe.RPCType.HTTP&&(u.route=t.path);let l=(0,eh.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:ed.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 u=i(s);return typeof u.handler=="function"&&(u.handler=o(u.handler)),u}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};$6.HapiInstrumentation=QX});var dLe=M(QR=>{"use strict";m();Object.defineProperty(QR,"__esModule",{value:!0});QR.AttributeNames=QR.HapiInstrumentation=void 0;var oBt=lLe();Object.defineProperty(QR,"HapiInstrumentation",{enumerable:!0,get:function(){return oBt.HapiInstrumentation}});var iBt=UX();Object.defineProperty(QR,"AttributeNames",{enumerable:!0,get:function(){return iBt.AttributeNames}})});var pLe,fLe,mLe,sBt,ALe,gLe=w(()=>{m();pLe=ue(dLe(),1);_r();fLe="Hapi",mLe=ct(fLe,()=>new pLe.HapiInstrumentation),sBt=(()=>({name:fLe,setupOnce(){mLe()}})),ALe=sBt});var NE,wO,FX=w(()=>{m();NE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},wO={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var V6,aBt,uBt,q6,hLe=w(()=>{m();He();V6=ue(un(),1);At();FX();aBt="@sentry/instrumentation-hono",uBt="0.0.1",q6=class extends V6.InstrumentationBase{constructor(t={}){super(aBt,uBt,t)}init(){return[new V6.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(u=>t._wrapHandler(u))])}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(u=>t._wrapHandler(u))])}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 We.with(Vt.setSpan(We.active(),s),()=>n._safeExecute(()=>{let u=t.apply(this,[r,o]);if(xa(u))return u.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[NE.HONO_TYPE]:f,[NE.HONO_NAME]:f===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(u);return s.setAttributes({[NE.HONO_TYPE]:l,[NE.HONO_NAME]:l===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),u}},()=>s.end(),u=>{n._handleError(s,u),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return xa(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?wO.MIDDLEWARE:wO.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:Ai.ERROR,message:n.message}),t.recordException(n))}}});function cBt(e){let t=kt(e).data,n=t[NE.HONO_TYPE];if(t[Xt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.hono",[Xt]:`${n}.hono`});let r=t[NE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[Rg],i=t[mS];typeof o=="string"&&typeof i=="string"&&Rn().setTransactionName(`${i} ${o}`)}var _Le,ELe,lBt,yLe,SLe=w(()=>{m();Xn();At();_r();YS();FX();hLe();_Le="Hono";ELe=ct(_Le,()=>new q6({responseHook:e=>{cBt(e)}})),lBt=(()=>({name:_Le,setupOnce(){ELe()}})),yLe=lBt});var Y6=M(OO=>{"use strict";m();Object.defineProperty(OO,"__esModule",{value:!0});OO.KoaLayerType=void 0;var dBt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(dBt=OO.KoaLayerType||(OO.KoaLayerType={}))});var TLe=M(FR=>{"use strict";m();Object.defineProperty(FR,"__esModule",{value:!0});FR.PACKAGE_NAME=FR.PACKAGE_VERSION=void 0;FR.PACKAGE_VERSION="0.62.0";FR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var GX=M(kO=>{"use strict";m();Object.defineProperty(kO,"__esModule",{value:!0});kO.AttributeNames=void 0;var pBt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(pBt=kO.AttributeNames||(kO.AttributeNames={}))});var ILe=M(GR=>{"use strict";m();Object.defineProperty(GR,"__esModule",{value:!0});GR.isLayerIgnored=GR.getMiddlewareMetadata=void 0;var bLe=Y6(),K6=GX(),fBt=(Xn(),Me(Hr)),mBt=(e,t,n,r)=>n?{attributes:{[K6.AttributeNames.KOA_NAME]:r?.toString(),[K6.AttributeNames.KOA_TYPE]:bLe.KoaLayerType.ROUTER,[fBt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[K6.AttributeNames.KOA_NAME]:t.name??"middleware",[K6.AttributeNames.KOA_TYPE]:bLe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};GR.getMiddlewareMetadata=mBt;var ABt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));GR.isLayerIgnored=ABt});var CLe=M(J6=>{"use strict";m();Object.defineProperty(J6,"__esModule",{value:!0});J6.kLayerPatched=void 0;J6.kLayerPatched=Symbol("koa-layer-patched")});var BLe=M(Z6=>{"use strict";m();Object.defineProperty(Z6,"__esModule",{value:!0});Z6.KoaInstrumentation=void 0;var oA=(He(),Me(tt)),PO=un(),vLe=Y6(),RLe=TLe(),xLe=ILe(),DLe=vr(),NLe=CLe(),jX=class extends PO.InstrumentationBase{constructor(t={}){super(RLe.PACKAGE_NAME,RLe.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){oA.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 u=0;u<s.length;u++){let l=s[u];s[u]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?vLe.KoaLayerType.ROUTER:vLe.KoaLayerType.MIDDLEWARE;return t[NLe.kLayerPatched]===!0||(0,xLe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(oA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[NLe.kLayerPatched]=!0,oA.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(oA.trace.getSpan(oA.context.active())===void 0)return t(i,s);let l=(0,xLe.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,DLe.getRPCMetadata)(oA.context.active());h?.type===DLe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:_}=this.getConfig();_&&(0,PO.safeExecuteInTheMiddle)(()=>_(f,{context:i,middlewareLayer:t,layerType:o}),T=>{T&&oA.diag.error("koa instrumentation: request hook failed",T)},!0);let y=oA.trace.setSpan(oA.context.active(),f);return oA.context.with(y,async()=>{try{return await t(i,s)}catch(T){throw f.recordException(T),T}finally{f.end()}})})}};Z6.KoaInstrumentation=jX});var wLe=M(BE=>{"use strict";m();Object.defineProperty(BE,"__esModule",{value:!0});BE.KoaLayerType=BE.AttributeNames=BE.KoaInstrumentation=void 0;var gBt=BLe();Object.defineProperty(BE,"KoaInstrumentation",{enumerable:!0,get:function(){return gBt.KoaInstrumentation}});var hBt=GX();Object.defineProperty(BE,"AttributeNames",{enumerable:!0,get:function(){return hBt.AttributeNames}});var _Bt=Y6();Object.defineProperty(BE,"KoaLayerType",{enumerable:!0,get:function(){return _Bt.KoaLayerType}})});var OLe,kLe,PLe,EBt,MLe,LLe=w(()=>{m();OLe=ue(wLe(),1);Xn();At();_r();YS();kLe="Koa",PLe=ct(kLe,OLe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){qr(t,"auto.http.otel.koa");let r=kt(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 >"),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[Rg],u=n.context?.request?.method?.toUpperCase()||"GET";s&&Rn().setTransactionName(`${u} ${s}`)}})),EBt=((e={})=>({name:kLe,setupOnce(){PLe(e)}})),MLe=EBt});var zX=M(Nf=>{"use strict";m();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.ConnectNames=Nf.ConnectTypes=Nf.AttributeNames=void 0;var yBt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(yBt=Nf.AttributeNames||(Nf.AttributeNames={}));var SBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(SBt=Nf.ConnectTypes||(Nf.ConnectTypes={}));var TBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(TBt=Nf.ConnectNames||(Nf.ConnectNames={}))});var ULe=M(jR=>{"use strict";m();Object.defineProperty(jR,"__esModule",{value:!0});jR.PACKAGE_NAME=jR.PACKAGE_VERSION=void 0;jR.PACKAGE_VERSION="0.57.0";jR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var QLe=M(W6=>{"use strict";m();Object.defineProperty(W6,"__esModule",{value:!0});W6._LAYERS_STORE_PROPERTY=void 0;W6._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var FLe=M(OE=>{"use strict";m();Object.defineProperty(OE,"__esModule",{value:!0});OE.generateRoute=OE.replaceCurrentStackRoute=OE.addNewStackLayer=void 0;var bBt=(He(),Me(tt)),wE=QLe(),IBt=e=>{Array.isArray(e[wE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,wE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[wE._LAYERS_STORE_PROPERTY].push("/");let t=e[wE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[wE._LAYERS_STORE_PROPERTY].length?e[wE._LAYERS_STORE_PROPERTY].pop():bBt.diag.warn("Connect: Trying to pop the stack multiple time")}};OE.addNewStackLayer=IBt;var CBt=(e,t)=>{t&&e[wE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};OE.replaceCurrentStackRoute=CBt;var vBt=e=>e[wE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);OE.generateRoute=vBt});var zLe=M(kE=>{"use strict";m();Object.defineProperty(kE,"__esModule",{value:!0});kE.ConnectInstrumentation=kE.ANONYMOUS_NAME=void 0;var RBt=(He(),Me(tt)),GLe=vr(),zR=zX(),jLe=ULe(),X6=un(),xBt=(Xn(),Me(Hr)),HX=FLe();kE.ANONYMOUS_NAME="anonymous";var $X=class extends X6.InstrumentationBase{constructor(t={}){super(jLe.PACKAGE_NAME,jLe.PACKAGE_VERSION,t)}init(){return[new X6.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,X6.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,X6.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=zR.ConnectTypes.REQUEST_HANDLER,i=zR.ConnectNames.REQUEST_HANDLER,o=t):(r=zR.ConnectTypes.MIDDLEWARE,i=zR.ConnectNames.MIDDLEWARE,o=n.name||kE.ANONYMOUS_NAME);let s=`${i} - ${o}`,u={attributes:{[xBt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[zR.AttributeNames.CONNECT_TYPE]:r,[zR.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,u)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,u,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[u],_=arguments[l];(0,HX.replaceCurrentStackRoute)(f,t);let y=(0,GLe.getRPCMetadata)(RBt.context.active());t&&y?.type===GLe.RPCType.HTTP&&(y.route=(0,HX.generateRoute)(f));let T="";t?T=`request handler - ${t}`:T=`middleware - ${n.name||kE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",T);let R=!1;function x(){R?r._diag.debug(`span ${v.name} - already finished`):(R=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",x)}return h.addListener("close",x),arguments[l]=r._patchNext(_,x),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],u=(0,HX.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,u)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};kE.ConnectInstrumentation=$X});var $Le=M(fp=>{"use strict";m();Object.defineProperty(fp,"__esModule",{value:!0});fp.ConnectTypes=fp.ConnectNames=fp.AttributeNames=fp.ANONYMOUS_NAME=fp.ConnectInstrumentation=void 0;var HLe=zLe();Object.defineProperty(fp,"ConnectInstrumentation",{enumerable:!0,get:function(){return HLe.ConnectInstrumentation}});Object.defineProperty(fp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return HLe.ANONYMOUS_NAME}});var qX=zX();Object.defineProperty(fp,"AttributeNames",{enumerable:!0,get:function(){return qX.AttributeNames}});Object.defineProperty(fp,"ConnectNames",{enumerable:!0,get:function(){return qX.ConnectNames}});Object.defineProperty(fp,"ConnectTypes",{enumerable:!0,get:function(){return qX.ConnectTypes}})});var qLe,VLe,YLe,DBt,KLe,JLe=w(()=>{m();qLe=ue($Le(),1);_r();VLe="Connect",YLe=ct(VLe,()=>new qLe.ConnectInstrumentation),DBt=(()=>({name:VLe,setupOnce(){YLe()}})),KLe=DBt});var ZLe=M(la=>{"use strict";m();Object.defineProperty(la,"__esModule",{value:!0});la.DB_SYSTEM_VALUE_MSSQL=la.ATTR_NET_PEER_PORT=la.ATTR_NET_PEER_NAME=la.ATTR_DB_USER=la.ATTR_DB_SYSTEM=la.ATTR_DB_STATEMENT=la.ATTR_DB_SQL_TABLE=la.ATTR_DB_NAME=void 0;la.ATTR_DB_NAME="db.name";la.ATTR_DB_SQL_TABLE="db.sql.table";la.ATTR_DB_STATEMENT="db.statement";la.ATTR_DB_SYSTEM="db.system";la.ATTR_DB_USER="db.user";la.ATTR_NET_PEER_NAME="net.peer.name";la.ATTR_NET_PEER_PORT="net.peer.port";la.DB_SYSTEM_VALUE_MSSQL="mssql"});var WLe=M(HR=>{"use strict";m();Object.defineProperty(HR,"__esModule",{value:!0});HR.once=HR.getSpanName=void 0;function NBt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}HR.getSpanName=NBt;var BBt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};HR.once=BBt});var XLe=M($R=>{"use strict";m();Object.defineProperty($R,"__esModule",{value:!0});$R.PACKAGE_NAME=$R.PACKAGE_VERSION=void 0;$R.PACKAGE_VERSION="0.33.0";$R.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var oUe=M(ME=>{"use strict";m();Object.defineProperty(ME,"__esModule",{value:!0});ME.TediousInstrumentation=ME.INJECTED_CTX=void 0;var qR=(He(),Me(tt)),wBt=Ue("events"),iA=un(),sT=(Xn(),Me(Hr)),PE=ZLe(),eUe=WLe(),tUe=XLe(),rUe=Symbol("opentelemetry.instrumentation-tedious.current-database");ME.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var nUe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function eG(e){Object.defineProperty(this,rUe,{value:e,writable:!0})}var VX=class e extends iA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(tUe.PACKAGE_NAME,tUe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,iA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,iA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new iA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of nUe)(0,iA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,iA.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 nUe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return eG.call(this,this.config?.options?.database),this.removeListener("databaseChange",eG),this.on("databaseChange",eG),this.once("end",()=>{this.removeListener("databaseChange",eG)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||qR.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,ME.INJECTED_CTX,{value:!0});let u=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,u,{length:u.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?.[ME.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof wBt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let u=0,l=0,f=()=>l++,h=()=>u++,_=this[rUe],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),T={};o._dbSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_DB_SYSTEM]=PE.DB_SYSTEM_VALUE_MSSQL,T[PE.ATTR_DB_NAME]=_,T[PE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,T[PE.ATTR_DB_STATEMENT]=y,T[PE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_DB_NAMESPACE]=_,T[sT.ATTR_DB_SYSTEM_NAME]=sT.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,T[sT.ATTR_DB_QUERY_TEXT]=y,T[sT.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_NET_PEER_NAME]=this.config?.server,T[PE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_SERVER_ADDRESS]=this.config?.server,T[sT.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,eUe.getSpanName)(t,_,y,s.table),{kind:qR.SpanKind.CLIENT,attributes:T}),R=(0,eUe.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",R),this.removeListener("end",R),v.setAttribute("tedious.procedure_count",u),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:qR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",R),this.on("end",R),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(R)):o._diag.error("Expected request.callback to be a function");let x=()=>qR.context.with(qR.trace.setSpan(qR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return x();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(x)}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)}}};ME.TediousInstrumentation=VX});var iUe=M(tG=>{"use strict";m();Object.defineProperty(tG,"__esModule",{value:!0});tG.TediousInstrumentation=void 0;var OBt=oUe();Object.defineProperty(tG,"TediousInstrumentation",{enumerable:!0,get:function(){return OBt.TediousInstrumentation}})});var sUe,kBt,aUe,uUe,PBt,cUe,lUe=w(()=>{m();sUe=ue(iUe(),1);At();_r();kBt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),aUe="Tedious",uUe=ct(aUe,()=>new sUe.TediousInstrumentation({})),PBt=(()=>{let e;return{name:aUe,setupOnce(){let t=uUe();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=kt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";kBt.has(i)&&n.setAttribute(Mt,"auto.db.otel.tedious")}))}}}),cUe=PBt});var dUe=M(VR=>{"use strict";m();Object.defineProperty(VR,"__esModule",{value:!0});VR.PACKAGE_NAME=VR.PACKAGE_VERSION=void 0;VR.PACKAGE_VERSION="0.57.0";VR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var fUe=M(nG=>{"use strict";m();Object.defineProperty(nG,"__esModule",{value:!0});nG.GenericPoolInstrumentation=void 0;var YR=(He(),Me(tt)),aT=un(),pUe=dUe(),YX="generic-pool",KX=class extends aT.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(pUe.PACKAGE_NAME,pUe.PACKAGE_VERSION,t)}init(){return[new aT.InstrumentationNodeModuleDefinition(YX,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,aT.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 aT.InstrumentationNodeModuleDefinition(YX,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,aT.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 aT.InstrumentationNodeModuleDefinition(YX,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,aT.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=YR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return YR.context.with(YR.trace.setSpan(i,s),()=>t.call(this,...o).then(u=>(s.end(),u),u=>{throw s.recordException(u),s.end(),u}))}}_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=YR.context.active(),u=n.tracer.startSpan("generic-pool.acquire",{},s);return YR.context.with(YR.trace.setSpan(s,u),()=>{t.call(this,(l,f)=>{if(u.end(),o)return o(l,f)},i)})}}};nG.GenericPoolInstrumentation=KX});var mUe=M(rG=>{"use strict";m();Object.defineProperty(rG,"__esModule",{value:!0});rG.GenericPoolInstrumentation=void 0;var MBt=fUe();Object.defineProperty(rG,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return MBt.GenericPoolInstrumentation}})});var AUe,gUe,hUe,LBt,_Ue,EUe=w(()=>{m();AUe=ue(mUe(),1);At();_r();gUe="GenericPool",hUe=ct(gUe,()=>new AUe.GenericPoolInstrumentation({})),LBt=(()=>{let e;return{name:gUe,setupOnce(){let t=hUe();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=kt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Mt,"auto.db.otel.generic_pool")}))}}}),_Ue=LBt});var JX=M(sA=>{"use strict";m();Object.defineProperty(sA,"__esModule",{value:!0});sA.ATTR_NET_PEER_PORT=sA.ATTR_NET_PEER_NAME=sA.ATTR_MESSAGING_SYSTEM=sA.ATTR_MESSAGING_OPERATION=void 0;sA.ATTR_MESSAGING_OPERATION="messaging.operation";sA.ATTR_MESSAGING_SYSTEM="messaging.system";sA.ATTR_NET_PEER_NAME="net.peer.name";sA.ATTR_NET_PEER_PORT="net.peer.port"});var ZX=M(yi=>{"use strict";m();Object.defineProperty(yi,"__esModule",{value:!0});yi.ATTR_MESSAGING_CONVERSATION_ID=yi.OLD_ATTR_MESSAGING_MESSAGE_ID=yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=yi.ATTR_MESSAGING_URL=yi.ATTR_MESSAGING_PROTOCOL_VERSION=yi.ATTR_MESSAGING_PROTOCOL=yi.MESSAGING_OPERATION_VALUE_PROCESS=yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=yi.ATTR_MESSAGING_DESTINATION_KIND=yi.ATTR_MESSAGING_DESTINATION=void 0;yi.ATTR_MESSAGING_DESTINATION="messaging.destination";yi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";yi.MESSAGING_OPERATION_VALUE_PROCESS="process";yi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";yi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";yi.ATTR_MESSAGING_URL="messaging.url";yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";yi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";yi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var WX=M(uT=>{"use strict";m();Object.defineProperty(uT,"__esModule",{value:!0});uT.DEFAULT_CONFIG=uT.EndOperation=void 0;var UBt;(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"})(UBt=uT.EndOperation||(uT.EndOperation={}));uT.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var bUe=M(Si=>{"use strict";m();Object.defineProperty(Si,"__esModule",{value:!0});Si.isConfirmChannelTracing=Si.unmarkConfirmChannelTracing=Si.markConfirmChannelTracing=Si.getConnectionAttributesFromUrl=Si.getConnectionAttributesFromServer=Si.normalizeExchange=Si.CONNECTION_ATTRIBUTES=Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Si.CHANNEL_SPANS_NOT_ENDED=Si.MESSAGE_STORED_SPAN=void 0;var XX=(He(),Me(tt)),LE=un(),oG=(Xn(),Me(Hr)),MO=JX(),iG=ZX();Si.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Si.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Si.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var eee=(0,XX.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),QBt=e=>e!==""?e:"<default>";Si.normalizeExchange=QBt;var FBt=e=>e.replace(/:[^:@/]*@/,":***@"),yUe=(e,t)=>e||(t==="AMQP"?5672:5671),SUe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},TUe=e=>e||"localhost",aA=(e,t,n,r)=>n?{[t]:n}:(XX.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),GBt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[MO.ATTR_MESSAGING_SYSTEM]:t}:{}};Si.getConnectionAttributesFromServer=GBt;var jBt=(e,t)=>{let n={[iG.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=SUe(r?.protocol);Object.assign(n,{...aA(e,iG.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=TUe(r?.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(e,MO.ATTR_NET_PEER_NAME,i,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(e,oG.ATTR_SERVER_ADDRESS,i,"hostname")});let s=yUe(r.port,o);t&LE.SemconvStability.OLD&&Object.assign(n,aA(e,MO.ATTR_NET_PEER_PORT,s,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(e,oG.ATTR_SERVER_PORT,s,"port"))}else{let r=FBt(e);n[iG.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=SUe(o.protocol);Object.assign(n,{...aA(r,iG.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=TUe(o.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(r,MO.ATTR_NET_PEER_NAME,s,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(r,oG.ATTR_SERVER_ADDRESS,s,"hostname")});let u=yUe(o.port?parseInt(o.port):void 0,i);t&LE.SemconvStability.OLD&&Object.assign(n,aA(r,MO.ATTR_NET_PEER_PORT,u,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(r,oG.ATTR_SERVER_PORT,u,"port"))}catch(o){XX.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Si.getConnectionAttributesFromUrl=jBt;var zBt=e=>e.setValue(eee,!0);Si.markConfirmChannelTracing=zBt;var HBt=e=>e.deleteValue(eee);Si.unmarkConfirmChannelTracing=HBt;var $Bt=e=>e.getValue(eee)===!0;Si.isConfirmChannelTracing=$Bt});var IUe=M(KR=>{"use strict";m();Object.defineProperty(KR,"__esModule",{value:!0});KR.PACKAGE_NAME=KR.PACKAGE_VERSION=void 0;KR.PACKAGE_VERSION="0.61.0";KR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var vUe=M(uG=>{"use strict";m();Object.defineProperty(uG,"__esModule",{value:!0});uG.AmqplibInstrumentation=void 0;var ri=(He(),Me(tt)),sG=vr(),xr=un(),qBt=JX(),td=ZX(),oc=WX(),Ti=bUe(),CUe=IUe(),aG=[">=0.5.5 <1"],tee=class extends xr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(CUe.PACKAGE_NAME,CUe.PACKAGE_VERSION,{...oc.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...oc.DEFAULT_CONFIG,...t})}init(){let t=new xr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",aG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new xr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",aG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new xr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",aG,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new xr.InstrumentationNodeModuleDefinition("amqplib",aG,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,xr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,xr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,xr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,oc.EndOperation.Ack)),(0,xr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,oc.EndOperation.Nack)),(0,xr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,oc.EndOperation.Reject)),(0,xr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,oc.EndOperation.AckAll)),(0,xr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,oc.EndOperation.NackAll)),(0,xr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,xr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,xr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,xr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,xr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,xr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,xr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,xr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,xr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,xr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,xr.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(u,l){if(u==null){let f=(0,Ti.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,Ti.getConnectionAttributesFromServer)(l);l[Ti.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelClosed,void 0);let i=this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,oc.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,u,l){let f=this,h=n===oc.EndOperation.Reject?u:l,_=f[Ti.CHANNEL_SPANS_NOT_ENDED]??[],y=_.findIndex(T=>T.msg===s);if(y<0)o.endConsumerSpan(s,t,n,h);else if(n!==oc.EndOperation.Reject&&u){for(let T=0;T<=y;T++)o.endConsumerSpan(_[T].msg,t,n,h);_.splice(0,y+1)}else o.endConsumerSpan(s,t,n,h),_.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,u){let l=this;if(!Object.prototype.hasOwnProperty.call(l,Ti.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let _=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);_.unref(),l[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=_}l[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let _=h.properties.headers??{},y=ri.propagation.extract(ri.ROOT_CONTEXT,_),T=h.fields?.exchange,v;if(r._config.useLinksForConsume){let P=y?ri.trace.getSpan(y)?.spanContext():void 0;y=void 0,P&&(v=[{context:P}])}let R=r.tracer.startSpan(`${i} process`,{kind:ri.SpanKind.CONSUMER,attributes:{...l?.connection?.[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:T,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[qBt.ATTR_MESSAGING_OPERATION]:td.MESSAGING_OPERATION_VALUE_PROCESS,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:x}=r.getConfig();x&&(0,xr.safeExecuteInTheMiddle)(()=>x(R,{moduleVersion:t,msg:h}),P=>{P&&ri.diag.error("amqplib instrumentation: consumerHook error",P)},!0),u?.noAck||(l[Ti.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,sG.hrTime)()}),h[Ti.MESSAGE_STORED_SPAN]=R);let O=y||ri.ROOT_CONTEXT;ri.context.with(ri.trace.setSpan(O,R),()=>{s.call(this,h)}),u?.noAck&&(r.callConsumeEndHook(R,h,!1,oc.EndOperation.AutoAck),R.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,u,l,f){let h=this,{span:_,modifiedOptions:y}=r.createPublishSpan(r,i,s,h,l),{publishHook:T}=r.getConfig();T&&(0,xr.safeExecuteInTheMiddle)(()=>T(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:y,isConfirmChannel:!0}),O=>{O&&ri.diag.error("amqplib instrumentation: publishHook error",O)},!0);let v=function(O,P){try{f?.call(this,O,P)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,xr.safeExecuteInTheMiddle)(()=>j(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:l,isConfirmChannel:!0,confirmError:O}),G=>{G&&ri.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),O&&_.setStatus({code:ri.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),_.end()}},R=(0,Ti.markConfirmChannelTracing)(ri.context.active()),x=[...arguments];return x[3]=y,x[4]=ri.context.bind((0,Ti.unmarkConfirmChannelTracing)(ri.trace.setSpan(R,_)),v),ri.context.with(R,n.bind(this,...x))}}getPublishPatch(t,n){let r=this;return function(i,s,u,l){if((0,Ti.isConfirmChannelTracing)(ri.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:_}=r.createPublishSpan(r,i,s,f,l),{publishHook:y}=r.getConfig();y&&(0,xr.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:_,isConfirmChannel:!1}),R=>{R&&ri.diag.error("amqplib instrumentation: publishHook error",R)},!0);let T=[...arguments];T[3]=_;let v=n.apply(this,T);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,Ti.normalizeExchange)(n),u=t.tracer.startSpan(`publish ${s}`,{kind:ri.SpanKind.PRODUCER,attributes:{...o.connection[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:n,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},ri.propagation.inject(ri.trace.setSpan(ri.context.active(),u),l.headers),{span:u,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[Ti.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:ri.SpanStatusCode.ERROR,message:r!==oc.EndOperation.ChannelClosed&&r!==oc.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[Ti.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[Ti.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,xr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&ri.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,sG.hrTime)(),r=t[Ti.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],u=(0,sG.hrTimeDuration)(s.timeOfConsume,n);if((0,sG.hrTimeToMilliseconds)(u)<i)break;this.endConsumerSpan(s.msg,null,oc.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};uG.AmqplibInstrumentation=tee});var xUe=M(UE=>{"use strict";m();Object.defineProperty(UE,"__esModule",{value:!0});UE.EndOperation=UE.DEFAULT_CONFIG=UE.AmqplibInstrumentation=void 0;var VBt=vUe();Object.defineProperty(UE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return VBt.AmqplibInstrumentation}});var RUe=WX();Object.defineProperty(UE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return RUe.DEFAULT_CONFIG}});Object.defineProperty(UE,"EndOperation",{enumerable:!0,get:function(){return RUe.EndOperation}})});var DUe,NUe,YBt,BUe,KBt,wUe,OUe=w(()=>{m();DUe=ue(xUe(),1);_r();NUe="Amqplib",YBt={consumeEndHook:e=>{qr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{qr(e,"auto.amqplib.otel.publisher")}},BUe=ct(NUe,()=>new DUe.AmqplibInstrumentation(YBt)),KBt=(()=>({name:NUe,setupOnce(){BUe()}})),wUe=KBt});var LO,nee=w(()=>{m();LO="VercelAI"});function ZBt(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 WBt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(XBt(t.content),ewt(t.content))}function XBt(e){for(let t of e){if(!ZBt(t))continue;let n=wK(t.toolCallId);n?zl(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"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):zl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function ewt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&OK(t.toolCallId)}function twt(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 lG,JBt,kUe,cG,PUe=w(()=>{m();lG=ue(un(),1);At();nee();JBt=[">=3.0.0 <7"],kUe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];cG=class e extends lG.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",er,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new lG.InstrumentationNodeModuleDefinition("ai",JBt,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 u=s[0].experimental_telemetry||{},l=u.isEnabled,f=Et(),h=f?.getIntegrationByName(LO),_=h?.options,y=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:T,recordOutputs:v}=twt(_,u,l,y);return s[0].experimental_telemetry={...u,isEnabled:l!==void 0?l:!0,recordInputs:T,recordOutputs:v},If(()=>Reflect.apply(o,i,s),R=>{R&&typeof R=="object"&&ns(R,"_sentry_active_span",Hc())},()=>{},R=>{WBt(R)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of kUe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=kUe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function nwt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var MUe,rwt,LUe,UUe=w(()=>{m();At();_r();nee();PUe();MUe=ct(LO,()=>new cG({}));rwt=((e={})=>{let t;return{name:LO,options:e,setupOnce(){t=MUe()},afterAllSetup(n){e.force??nwt(n)?AF(n):t?.callWhenPatched(()=>AF(n))}}}),LUe=rwt});var pG,owt,dG,QUe=w(()=>{m();pG=ue(un(),1);At();owt=[">=4.0.0 <7"],dG=class extends pG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",er,t)}init(){return new pG.InstrumentationNodeModuleDefinition("openai",owt,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(BS(uE))return Reflect.construct(r,s);let u=Reflect.construct(r,s);return _F(u,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 u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}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 FUe,iwt,GUe,jUe=w(()=>{m();At();_r();QUe();FUe=ct(uE,e=>new dG(e)),iwt=((e={})=>({name:uE,setupOnce(){FUe(e)}})),GUe=iwt});var mG,swt,fG,zUe=w(()=>{m();mG=ue(un(),1);At();swt=[">=0.19.2 <1.0.0"],fG=class extends mG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",er,t)}init(){return new mG.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",swt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(BS(cE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return EF(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 HUe,awt,$Ue,qUe=w(()=>{m();At();_r();zUe();HUe=ct(cE,e=>new fG(e)),awt=((e={})=>({name:cE,options:e,setupOnce(){HUe(e)}})),$Ue=awt});var JR,VUe,AG,YUe=w(()=>{m();JR=ue(un(),1);At();VUe=[">=0.10.0 <2"],AG=class extends JR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",er,t)}init(){return new JR.InstrumentationNodeModuleDefinition("@google/genai",VUe,n=>this._patch(n),n=>n,[new JR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",VUe,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(BS(lE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return yF(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 gw(t,"GoogleGenAI",o),t}}});var KUe,uwt,JUe,ZUe=w(()=>{m();At();_r();YUe();KUe=ct(lE,e=>new AG(e)),uwt=((e={})=>({name:lE,setupOnce(){KUe(e)}})),JUe=uwt});function cwt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function lwt(e,t,n){return new Proxy(e,{apply(r,o,i){let u=i[1];(!u||typeof u!="object"||Array.isArray(u))&&(u={},i[1]=u);let l=u.callbacks,f=cwt(l,t);return u.callbacks=f,Reflect.apply(r,o,i)}})}var QE,gG,hG,WUe=w(()=>{m();QE=ue(un(),1);At();gG=[">=0.1.0 <2.0.0"];hG=class extends QE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",er,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 QE.InstrumentationNodeModuleDefinition(r,gG,this._patch.bind(this),o=>o,[new QE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,gG,this._patch.bind(this),o=>o)]));return t.push(new QE.InstrumentationNodeModuleDefinition("langchain",gG,this._patch.bind(this),r=>r,[new QE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",gG,this._patch.bind(this),r=>r)])),t}_patch(t){KY([uE,cE,lE]);let n=IF(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 u=["invoke","stream","batch"];for(let l of u){let f=s[l];typeof f=="function"&&(s[l]=lwt(f,n))}}}});var XUe,dwt,eQe,tQe=w(()=>{m();At();_r();WUe();XUe=ct(SF,e=>new hG(e)),dwt=((e={})=>({name:SF,setupOnce(){XUe(e)}})),eQe=dwt});var ZR,nQe,_G,rQe=w(()=>{m();ZR=ue(un(),1);At();nQe=[">=0.0.0 <2.0.0"],_G=class extends ZR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",er,t)}init(){return new ZR.InstrumentationNodeModuleDefinition("@langchain/langgraph",nQe,this._patch.bind(this),n=>n,[new ZR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",nQe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&vF(t.StateGraph.prototype,this.getConfig()),t}}});var oQe,pwt,iQe,sQe=w(()=>{m();At();_r();rQe();oQe=ct(CF,e=>new _G(e)),pwt=((e={})=>({name:CF,setupOnce(){oQe(e)}})),iQe=pwt});import*as uQe from"node:net";function cQe(e,t,n,r,o){let s=()=>{},u=o.firestoreSpanCreationHook;typeof u=="function"&&(s=h=>{(0,th.safeExecuteInTheMiddle)(()=>u(h),_=>{_&&Fl.error(_?.message)},!0)});let l=new th.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>aQe(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 th.InstrumentationNodeModuleFile(h,t,_=>aQe(_,n,r,e,s),_=>lQe(_,r)));return l}function aQe(e,t,n,r,o){return lQe(e,n),t(e,"addDoc",fwt(r,o)),t(e,"getDocs",Awt(r,o)),t(e,"setDoc",gwt(r,o)),t(e,"deleteDoc",mwt(r,o)),e}function lQe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,th.isWrapped)(e[n])&&t(e,n);return e}function fwt(e,t){return function(r){return function(o,i){let s=yG(e,"addDoc",o);return t(s),EG(s,()=>r(o,i))}}}function mwt(e,t){return function(r){return function(o){let i=yG(e,"deleteDoc",o.parent||o);return t(i),EG(i,()=>r(o))}}}function Awt(e,t){return function(r){return function(o){let i=yG(e,"getDocs",o);return t(i),EG(i,()=>r(o))}}}function gwt(e,t){return function(r){return function(o,i,s){let u=yG(e,"setDoc",o.parent||o);return t(u),EG(u,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function EG(e,t){return We.with(Vt.setSpan(We.active(),e),()=>(0,th.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function yG(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:fo.CLIENT});return _wt(r,n),r.setAttribute(LC,t),r}function hwt(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(uQe.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 _wt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[EV]:t.path,[yV]:n.name,[fS]:"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:u,port:l}=hwt(i);u&&(s[xV]=u),l&&(s[DV]=l),e.setAttributes(s)}var th,dQe=w(()=>{m();He();th=ue(un(),1);Xn()});function pQe(e,t,n,r,o){let i=()=>{},s=()=>{},u=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(y,T)=>{(0,nh.safeExecuteInTheMiddle)(()=>f(y,T),v=>{v&&Fl.error(v?.message)},!0)}),typeof l=="function"&&(i=y=>{(0,nh.safeExecuteInTheMiddle)(()=>l(y),T=>{T&&Fl.error(T?.message)},!0)});let h=new nh.InstrumentationNodeModuleDefinition("firebase-functions",t);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:y,triggerType:T})=>{h.files.push(new nh.InstrumentationNodeModuleFile(y,t,v=>Ewt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:u},T),v=>fQe(v,r)))}),h}function ic(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],u=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",_=e.startSpan(`firebase.function.${n}`,{kind:fo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),_.setAttributes(y),t?.requestHook?.(_),We.with(Vt.setSpan(We.active(),_),async()=>{let T,v;try{v=await s.apply(this,f)}catch(R){T=R}if(t?.responseHook?.(_,T),T&&_.recordException(T),_.end(),T)throw await t?.errorHook?.(_,T),T;return v})};return u?o.call(this,u,l):o.call(this,l)}}}function Ewt(e,t,n,r,o,i){switch(fQe(e,n),i){case"function":t(e,"onRequest",ic(r,o,"http.request")),t(e,"onCall",ic(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",ic(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",ic(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",ic(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",ic(r,o,"storage.object.finalized")),t(e,"onObjectArchived",ic(r,o,"storage.object.archived")),t(e,"onObjectDeleted",ic(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",ic(r,o,"storage.object.metadataUpdated"));break}return e}function fQe(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,nh.isWrapped)(e[r])&&t(e,r);return e}var nh,mQe=w(()=>{m();He();nh=ue(un(),1)});var gQe,AQe,ywt,Swt,SG,hQe=w(()=>{m();gQe=ue(un(),1);At();dQe();mQe();AQe={},ywt=[">=3.0.0 <5"],Swt=[">=6.0.0 <7"],SG=class extends gQe.InstrumentationBase{constructor(t=AQe){super("@sentry/instrumentation-firebase",er,t)}setConfig(t={}){super.setConfig({...AQe,...t})}init(){let t=[];return t.push(cQe(this.tracer,ywt,this._wrap,this._unwrap,this.getConfig())),t.push(pQe(this.tracer,Swt,this._wrap,this._unwrap,this.getConfig())),t}}});var _Qe,Twt,EQe,bwt,yQe,SQe=w(()=>{m();At();_r();hQe();_Qe="Firebase",Twt={firestoreSpanCreationHook:e=>{qr(e,"auto.firebase.otel.firestore"),e.setAttribute(Xt,"db.query")},functions:{requestHook:e=>{qr(e,"auto.firebase.otel.functions"),e.setAttribute(Xt,"http.request")},errorHook:async(e,t)=>{t&&(rn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Sv(2e3))}}},EQe=ct(_Qe,()=>new SG(Twt)),bwt=(()=>({name:_Qe,setupOnce(){EQe()}})),yQe=bwt});function TQe(){return[Cwe(),ike(),wke(),yLe(),EPe(),kPe(),qPe(),oMe(),MMe(),r2e(),tLe(),ALe(),MLe(),KLe(),cUe(),_Ue(),Kke(),wUe(),sPe(),eQe(),iQe(),LUe(),GUe(),$Ue(),JUe(),a2e(),yQe()]}var bQe=w(()=>{m();OUe();qUe();JLe();vwe();uke();SQe();EUe();ZUe();kke();gLe();SLe();Jke();LLe();tQe();sQe();aPe();yPe();PPe();VPe();iMe();jUe();o2e();u2e();nLe();LMe();lUe();UUe()});function CQe(e,t={}){e.getOptions().debug&&lZ();let[n,r]=Iwt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function Iwt(e,t={}){let n=new IQe.BasicTracerProvider({sampler:new w4(e),resource:(0,TG.defaultResource)().merge((0,TG.resourceFromAttributes)({[NV]:"node",[_V]:"sentry",[BV]:er})),forceFlushTimeoutMillis:500,spanProcessors:[new B4({timeout:Cwt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Vt.setGlobalTracerProvider(n),mf.setGlobalPropagator(new N4);let r=new k4;return We.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function Cwt(e){if(e!=null){if(e>ree)return Ds&&W.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ree}`),ree;if(e<=0||Number.isNaN(e)){Ds&&W.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var TG,IQe,ree,vQe=w(()=>{m();He();TG=ue(bJ(),1),IQe=ue(KJ(),1);Xn();At();_r();Xv();YS();ree=1e6});function RQe(){return G4().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(twe(),lwe())}function xQe(e){return[...RQe(),...Mi(e)?TQe():[]]}function oee(e={}){return vwt(e,xQe)}function vwt(e={},t){wS(e,"node");let n=MZ({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(CQe(n,{spanProcessors:e.openTelemetrySpanProcessors}),j4()),n}var DQe=w(()=>{m();At();_r();nwe();dwe();bQe();vQe()});var WR=w(()=>{m();DQe();At();_r()});function to(){return Rwt}function hu(){return NQe}function BQe(){return xwt}var Rwt,NQe,xwt,sc=w(()=>{"use strict";m();Rwt="prod",NQe="0.1.194",xwt=`@loredotlink/cli/${NQe}`});function Owt(e=""){if(!Bwt.test(e))return e!==e.toLowerCase()}function wQe(e,t){let n=t??wwt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let u of e){let l=n.includes(u);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Owt(u);if(s===!1){if(i===!1&&f===!0){r.push(o),o=u,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+u,i=f;continue}}o+=u,i=f,s=l}return r.push(o),r}function kwt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Pwt(e){return e?e[0].toLowerCase()+e.slice(1):""}function Mwt(e,t){return e?(Array.isArray(e)?e:wQe(e)).map(n=>kwt(t?.normalize?n.toLowerCase():n)).join(""):""}function QO(e,t){return Pwt(Mwt(e||"",t))}function bG(e,t){return e?(Array.isArray(e)?e:wQe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function OQe(e){return bG(e||"","_")}var Bwt,wwt,kQe=w(()=>{m();Bwt=/\d/,wwt=["-","_","/","."]});import{parseArgs as Lwt}from"node:util";function RG(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function iee(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 LW(e,t,n,r=void 0){n&&(0,cO.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&SPe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function qxt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(LW(t,o,n,r),o)).catch(o=>{throw TPe(t,o),o}).finally(()=>t.end()):(LW(t,e,n,r),t.end(),e)}yE.handlePromiseResponse=qxt;function Vxt(e,t,n,r,o,i,s=void 0){let u=0;return o.length===2?u=1:o.length===3&&(u=2),o[u]=(l,f)=>(l?TPe(r,l):LW(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}yE.handleCallbackResponse=Vxt});var IPe=M(SR=>{"use strict";m();Object.defineProperty(SR,"__esModule",{value:!0});SR.PACKAGE_NAME=SR.PACKAGE_VERSION=void 0;SR.PACKAGE_VERSION="0.60.0";SR.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var DPe=M(Jc=>{"use strict";m();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.MongooseInstrumentation=Jc._ALREADY_INSTRUMENTED=Jc._STORED_PARENT_SPAN=void 0;var Bs=(He(),Me(tt)),Yxt=vr(),UW=bPe(),Ma=un(),CPe=IPe(),SE=MW(),tT=(Xn(),Me(Hr)),Y3=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],Kxt=["remove","count","findOneAndRemove",...Y3],Jxt=["count","findOneAndRemove",...Y3],Zxt=[...Y3];function vPe(e){return e?e.startsWith("6.")||e.startsWith("5.")?Kxt:e.startsWith("7.")?Jxt:Zxt:Y3}function RPe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function xPe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Jc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Jc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var QW=class extends Ma.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(CPe.PACKAGE_NAME,CPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ma.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ma.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Ma.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,RPe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),xPe(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)),vPe(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=vPe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,RPe(n)&&this._unwrap(r.Model.prototype,"remove"),xPe(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&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Ma.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ma.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Jc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{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&Ma.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ma.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,u){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.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 y=h(t,l);r._dbSemconvStability&Ma.SemconvStability.OLD&&(f[SE.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&Ma.SemconvStability.STABLE&&(f[tT.ATTR_DB_QUERY_TEXT]=y)}let _=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(u=s,s=void 0),r._handleResponse(_,o,this,arguments,u,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,_=u;typeof s=="function"?(f=s,h=void 0,_=void 0):typeof u=="function"&&(f=u,_=void 0);let y={},T=r.getConfig().dbStatementSerializer;if(T){let x=T(t,{condition:{_id:this._id},updates:h,options:_});r._dbSemconvStability&Ma.SemconvStability.OLD&&(y[SE.ATTR_DB_STATEMENT]=x),r._dbSemconvStability&Ma.SemconvStability.STABLE&&(y[tT.ATTR_DB_QUERY_TEXT]=x)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),R=r._handleResponse(v,o,this,arguments,f,n);return R&&typeof R=="object"&&(R[Jc._ALREADY_INSTRUMENTED]=!0),R}}patchModelStatic(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);typeof u=="function"&&(l=u,u=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}u!==void 0&&(f.options=u);let h={},{dbStatementSerializer:_}=r.getConfig();if(_){let T=_(t,f);r._dbSemconvStability&Ma.SemconvStability.OLD&&(h[SE.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&Ma.SemconvStability.STABLE&&(h[tT.ATTR_DB_QUERY_TEXT]=T)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Bs.trace.getSpan(Bs.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Jc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Jc._STORED_PARENT_SPAN]=Bs.trace.getSpan(Bs.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,UW.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Ma.SemconvStability.OLD&&(s[SE.ATTR_DB_OPERATION]=r,s[SE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Ma.SemconvStability.STABLE&&(s[tT.ATTR_DB_OPERATION_NAME]=r,s[tT.ATTR_DB_SYSTEM_NAME]=SE.DB_SYSTEM_NAME_VALUE_MONGODB);let u=this._dbSemconvStability&Ma.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(u,{kind:Bs.SpanKind.CLIENT,attributes:s},i?Bs.trace.setSpan(Bs.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let u=this;if(i instanceof Function)return u._callOriginalFunction(()=>(0,UW.handleCallbackResponse)(i,n,r,t,o,u.getConfig().responseHook,s));{let l=u._callOriginalFunction(()=>n.apply(r,o));return(0,UW.handlePromiseResponse)(l,t,u.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Bs.context.with((0,Yxt.suppressTracing)(Bs.context.active()),t):t()}};Jc.MongooseInstrumentation=QW});var NPe=M(K3=>{"use strict";m();Object.defineProperty(K3,"__esModule",{value:!0});K3.MongooseInstrumentation=void 0;var Wxt=DPe();Object.defineProperty(K3,"MongooseInstrumentation",{enumerable:!0,get:function(){return Wxt.MongooseInstrumentation}})});var BPe,wPe,OPe,Xxt,kPe,PPe=w(()=>{m();BPe=ue(NPe(),1);_r();wPe="Mongoose",OPe=ct(wPe,()=>new BPe.MongooseInstrumentation({responseHook(e){qr(e,"auto.db.otel.mongoose")}})),Xxt=(()=>({name:wPe,setupOnce(){OPe()}})),kPe=Xxt});var MPe=M(us=>{"use strict";m();Object.defineProperty(us,"__esModule",{value:!0});us.METRIC_DB_CLIENT_CONNECTIONS_USAGE=us.DB_SYSTEM_VALUE_MYSQL=us.ATTR_NET_PEER_PORT=us.ATTR_NET_PEER_NAME=us.ATTR_DB_USER=us.ATTR_DB_SYSTEM=us.ATTR_DB_STATEMENT=us.ATTR_DB_NAME=us.ATTR_DB_CONNECTION_STRING=void 0;us.ATTR_DB_CONNECTION_STRING="db.connection_string";us.ATTR_DB_NAME="db.name";us.ATTR_DB_STATEMENT="db.statement";us.ATTR_DB_SYSTEM="db.system";us.ATTR_DB_USER="db.user";us.ATTR_NET_PEER_NAME="net.peer.name";us.ATTR_NET_PEER_PORT="net.peer.port";us.DB_SYSTEM_VALUE_MYSQL="mysql";us.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var LPe=M(lO=>{"use strict";m();Object.defineProperty(lO,"__esModule",{value:!0});lO.AttributeNames=void 0;var eDt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(eDt=lO.AttributeNames||(lO.AttributeNames={}))});var UPe=M(mu=>{"use strict";m();Object.defineProperty(mu,"__esModule",{value:!0});mu.getPoolNameOld=mu.arrayStringifyHelper=mu.getSpanName=mu.getDbValues=mu.getDbQueryText=mu.getJDBCString=mu.getConfig=void 0;function tDt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}mu.getConfig=tDt;function nDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}mu.getJDBCString=nDt;function rDt(e){return typeof e=="string"?e:e.sql}mu.getDbQueryText=rDt;function oDt(e,t){return FW(typeof e=="string"?t:t||e.values)}mu.getDbValues=oDt;function iDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}mu.getSpanName=iDt;function FW(e){return e?`[${e.toString()}]`:""}mu.arrayStringifyHelper=FW;function sDt(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()}mu.getPoolNameOld=sDt});var QPe=M(TR=>{"use strict";m();Object.defineProperty(TR,"__esModule",{value:!0});TR.PACKAGE_NAME=TR.PACKAGE_VERSION=void 0;TR.PACKAGE_VERSION="0.60.0";TR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var GPe=M(J3=>{"use strict";m();Object.defineProperty(J3,"__esModule",{value:!0});J3.MySQLInstrumentation=void 0;var Zc=(He(),Me(tt)),up=un(),bR=(Xn(),Me(Hr)),Xg=MPe(),aDt=LPe(),nT=UPe(),FPe=QPe(),GW=class extends up.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(FPe.PACKAGE_NAME,FPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,up.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,up.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new up.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,up.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,up.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,up.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,u=t._freeConnections.length,l=s-u,f=(0,nT.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-u,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 u=t._nodes;if(u){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=u[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,u){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 u=="function"){let l=r._getConnectionCallbackPatchFn(u);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,up.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 u={},{host:l,port:f,database:h,user:_}=(0,nT.getConfig)(t.config),y=parseInt(f,10),T=(0,nT.getDbQueryText)(o);r._dbSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_DB_SYSTEM]=Xg.DB_SYSTEM_VALUE_MYSQL,u[Xg.ATTR_DB_CONNECTION_STRING]=(0,nT.getJDBCString)(l,f,h),u[Xg.ATTR_DB_NAME]=h,u[Xg.ATTR_DB_USER]=_,u[Xg.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_DB_SYSTEM_NAME]=bR.DB_SYSTEM_NAME_VALUE_MYSQL,u[bR.ATTR_DB_NAMESPACE]=h,u[bR.ATTR_DB_QUERY_TEXT]=T),r._netSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_NET_PEER_NAME]=l,isNaN(y)||(u[Xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_SERVER_ADDRESS]=l,isNaN(y)||(u[bR.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,nT.getSpanName)(o),{kind:Zc.SpanKind.CLIENT,attributes:u});if(r.getConfig().enhancedDatabaseReporting){let O;Array.isArray(i)?O=i:arguments[2]&&(O=[i]),v.setAttribute(aDt.AttributeNames.MYSQL_VALUES,(0,nT.getDbValues)(o,O))}let R=Array.from(arguments).findIndex(O=>typeof O=="function"),x=Zc.context.active();if(R===-1){let O=Zc.context.with(Zc.trace.setSpan(Zc.context.active(),v),()=>n.apply(t,arguments));return Zc.context.bind(x,O),O.on("error",P=>v.setStatus({code:Zc.SpanStatusCode.ERROR,message:P.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,R,r._patchCallbackQuery(v,x)),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,nT.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")})}};J3.MySQLInstrumentation=GW});var jPe=M(Z3=>{"use strict";m();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.MySQLInstrumentation=void 0;var uDt=GPe();Object.defineProperty(Z3,"MySQLInstrumentation",{enumerable:!0,get:function(){return uDt.MySQLInstrumentation}})});var zPe,HPe,$Pe,cDt,qPe,VPe=w(()=>{m();zPe=ue(jPe(),1);_r();HPe="Mysql",$Pe=ct(HPe,()=>new zPe.MySQLInstrumentation({})),cDt=(()=>({name:HPe,setupOnce(){$Pe()}})),qPe=cDt});var jW=M(ua=>{"use strict";m();Object.defineProperty(ua,"__esModule",{value:!0});ua.DB_SYSTEM_VALUE_MYSQL=ua.ATTR_NET_PEER_PORT=ua.ATTR_NET_PEER_NAME=ua.ATTR_DB_USER=ua.ATTR_DB_SYSTEM=ua.ATTR_DB_STATEMENT=ua.ATTR_DB_NAME=ua.ATTR_DB_CONNECTION_STRING=void 0;ua.ATTR_DB_CONNECTION_STRING="db.connection_string";ua.ATTR_DB_NAME="db.name";ua.ATTR_DB_STATEMENT="db.statement";ua.ATTR_DB_SYSTEM="db.system";ua.ATTR_DB_USER="db.user";ua.ATTR_NET_PEER_NAME="net.peer.name";ua.ATTR_NET_PEER_PORT="net.peer.port";ua.DB_SYSTEM_VALUE_MYSQL="mysql"});var HW=M(W3=>{"use strict";m();Object.defineProperty(W3,"__esModule",{value:!0});W3.addSqlCommenterComment=void 0;var zW=(He(),Me(tt)),lDt=vr();function dDt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function pDt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function fDt(e,t){if(typeof t!="string"||t.length===0||dDt(t))return t;let n=new lDt.W3CTraceContextPropagator,r={};n.inject(zW.trace.setSpan(zW.ROOT_CONTEXT,e),r,zW.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let u=pDt(r[s]);return`${s}='${u}'`}).join(",");return`${t} /*${i}*/`}W3.addSqlCommenterComment=fDt});var YPe=M(cp=>{"use strict";m();Object.defineProperty(cp,"__esModule",{value:!0});cp.getConnectionPrototypeToInstrument=cp.once=cp.getSpanName=cp.getQueryText=cp.getConnectionAttributes=void 0;var dO=jW(),X3=un(),$W=(Xn(),Me(Hr));function mDt(e,t,n){let{host:r,port:o,database:i,user:s}=ADt(e),u={};t&X3.SemconvStability.OLD&&(u[dO.ATTR_DB_CONNECTION_STRING]=gDt(r,o,i),u[dO.ATTR_DB_NAME]=i,u[dO.ATTR_DB_USER]=s),t&X3.SemconvStability.STABLE&&(u[$W.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&X3.SemconvStability.OLD&&(u[dO.ATTR_NET_PEER_NAME]=r,isNaN(l)||(u[dO.ATTR_NET_PEER_PORT]=l)),n&X3.SemconvStability.STABLE&&(u[$W.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(u[$W.ATTR_SERVER_PORT]=l)),u}cp.getConnectionAttributes=mDt;function ADt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function gDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function hDt(e,t,n,r=!1,o=_Dt){let[i,s]=typeof e=="string"?[e,n]:[e.sql,EDt(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"}}cp.getQueryText=hDt;function _Dt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function EDt(e){return"values"in e}function yDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}cp.getSpanName=yDt;var SDt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};cp.once=SDt;function TDt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}cp.getConnectionPrototypeToInstrument=TDt});var KPe=M(IR=>{"use strict";m();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-mysql2"});var XPe=M(e6=>{"use strict";m();Object.defineProperty(e6,"__esModule",{value:!0});e6.MySQL2Instrumentation=void 0;var JPe=(He(),Me(tt)),xf=un(),qW=jW(),ZPe=HW(),CR=YPe(),WPe=KPe(),VW=(Xn(),Me(Hr)),YW=[">=1.4.2 <4"],KW=class extends xf.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(WPe.PACKAGE_NAME,WPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,xf.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,xf.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,xf.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 xf.InstrumentationNodeModuleDefinition("mysql2",YW,i=>(n(i),i),()=>{},[new xf.InstrumentationNodeModuleFile("mysql2/promise.js",YW,i=>(n(i),i),()=>{}),new xf.InstrumentationNodeModuleFile("mysql2/lib/connection.js",YW,i=>{let s=(0,CR.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,CR.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,u){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:_}=o.getConfig(),y=(0,CR.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),T=(0,CR.getQueryText)(i,t,l,f,h);o._dbSemconvStability&xf.SemconvStability.OLD&&(y[qW.ATTR_DB_SYSTEM]=qW.DB_SYSTEM_VALUE_MYSQL,y[qW.ATTR_DB_STATEMENT]=T),o._dbSemconvStability&xf.SemconvStability.STABLE&&(y[VW.ATTR_DB_SYSTEM_NAME]=VW.DB_SYSTEM_NAME_VALUE_MYSQL,y[VW.ATTR_DB_QUERY_TEXT]=T);let v=o.tracer.startSpan((0,CR.getSpanName)(i),{kind:JPe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,ZPe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,ZPe.addSqlCommenterComment)(v,i.sql)}));let R=(0,CR.once)((x,O)=>{x?v.setStatus({code:JPe.SpanStatusCode.ERROR,message:x.message}):typeof _=="function"&&(0,xf.safeExecuteInTheMiddle)(()=>{_(v,{queryResults:O})},P=>{P&&o._diag.warn("Failed executing responseHook",P)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(R));let x=r.apply(this,arguments);return x.once("error",O=>{R(O)}).once("result",O=>{R(void 0,O)}),x}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(R)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(R)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};e6.MySQL2Instrumentation=KW});var eMe=M(t6=>{"use strict";m();Object.defineProperty(t6,"__esModule",{value:!0});t6.MySQL2Instrumentation=void 0;var bDt=XPe();Object.defineProperty(t6,"MySQL2Instrumentation",{enumerable:!0,get:function(){return bDt.MySQL2Instrumentation}})});var tMe,nMe,rMe,IDt,oMe,iMe=w(()=>{m();tMe=ue(eMe(),1);_r();nMe="Mysql2",rMe=ct(nMe,()=>new tMe.MySQL2Instrumentation({responseHook(e){qr(e,"auto.db.otel.mysql2")}})),IDt=(()=>({name:nMe,setupOnce(){rMe()}})),oMe=IDt});var sMe=M(Au=>{"use strict";m();Object.defineProperty(Au,"__esModule",{value:!0});Au.DB_SYSTEM_VALUE_REDIS=Au.DB_SYSTEM_NAME_VALUE_REDIS=Au.ATTR_NET_PEER_PORT=Au.ATTR_NET_PEER_NAME=Au.ATTR_DB_SYSTEM=Au.ATTR_DB_STATEMENT=Au.ATTR_DB_CONNECTION_STRING=void 0;Au.ATTR_DB_CONNECTION_STRING="db.connection_string";Au.ATTR_DB_STATEMENT="db.statement";Au.ATTR_DB_SYSTEM="db.system";Au.ATTR_NET_PEER_NAME="net.peer.name";Au.ATTR_NET_PEER_PORT="net.peer.port";Au.DB_SYSTEM_NAME_VALUE_REDIS="redis";Au.DB_SYSTEM_VALUE_REDIS="redis"});var aMe=M(n6=>{"use strict";m();Object.defineProperty(n6,"__esModule",{value:!0});n6.endSpan=void 0;var CDt=(He(),Me(tt)),vDt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:CDt.SpanStatusCode.ERROR,message:t.message})),e.end()};n6.endSpan=vDt});var o6=M(r6=>{"use strict";m();Object.defineProperty(r6,"__esModule",{value:!0});r6.defaultDbStatementSerializer=void 0;var RDt=[{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}],xDt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=RDt.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};r6.defaultDbStatementSerializer=xDt});var uMe=M(vR=>{"use strict";m();Object.defineProperty(vR,"__esModule",{value:!0});vR.PACKAGE_NAME=vR.PACKAGE_VERSION=void 0;vR.PACKAGE_VERSION="0.62.0";vR.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var pMe=M(i6=>{"use strict";m();Object.defineProperty(i6,"__esModule",{value:!0});i6.IORedisInstrumentation=void 0;var TE=(He(),Me(tt)),Wc=un(),bE=(Xn(),Me(Hr)),Xc=sMe(),cMe=un(),pO=aMe(),DDt=o6(),lMe=uMe(),dMe={requireParentSpan:!0},JW=class extends Wc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(lMe.PACKAGE_NAME,lMe.PACKAGE_VERSION,{...dMe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Wc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Wc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...dMe,...t})}init(){return[new Wc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Wc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Wc.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||DDt.defaultDbStatementSerializer,u=TE.trace.getSpan(TE.context.active())===void 0;if(i.requireParentSpan===!0&&u)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,_=s(o.name,o.args);r._dbSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,l[Xc.ATTR_DB_STATEMENT]=_,l[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,l[bE.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_NET_PEER_NAME]=f,l[Xc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_SERVER_ADDRESS]=f,l[bE.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:TE.SpanKind.CLIENT,attributes:l}),{requestHook:T}=i;T&&(0,cMe.safeExecuteInTheMiddle)(()=>T(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&TE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),R=o.resolve;o.resolve=function(O){(0,cMe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,O),P=>{P&&TE.diag.error("ioredis instrumentation: response hook failed",P)},!0),(0,pO.endSpan)(y,null),R(O)};let x=o.reject;return o.reject=function(O){(0,pO.endSpan)(y,O),x(O)},v}catch(v){throw(0,pO.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=TE.trace.getSpan(TE.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&Wc.SemconvStability.OLD&&(o[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,o[Xc.ATTR_DB_STATEMENT]="connect",o[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,o[bE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Wc.SemconvStability.OLD&&(o[Xc.ATTR_NET_PEER_NAME]=i,o[Xc.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_SERVER_ADDRESS]=i,o[bE.ATTR_SERVER_PORT]=s);let u=n.tracer.startSpan("connect",{kind:TE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,pO.endSpan)(u,null),l}catch(l){throw(0,pO.endSpan)(u,l),l}}}};i6.IORedisInstrumentation=JW});var fMe=M(s6=>{"use strict";m();Object.defineProperty(s6,"__esModule",{value:!0});s6.IORedisInstrumentation=void 0;var NDt=pMe();Object.defineProperty(s6,"IORedisInstrumentation",{enumerable:!0,get:function(){return NDt.IORedisInstrumentation}})});var a6=M(RR=>{"use strict";m();Object.defineProperty(RR,"__esModule",{value:!0});RR.PACKAGE_NAME=RR.PACKAGE_VERSION=void 0;RR.PACKAGE_VERSION="0.62.0";RR.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var mMe=M(IE=>{"use strict";m();Object.defineProperty(IE,"__esModule",{value:!0});IE.getTracedCreateStreamTrace=IE.getTracedCreateClient=IE.endSpan=void 0;var fO=(He(),Me(tt)),BDt=(e,t)=>{t&&e.setStatus({code:fO.SpanStatusCode.ERROR,message:t.message}),e.end()};IE.endSpan=BDt;var wDt=e=>function(){let n=e.apply(this,arguments);return fO.context.bind(fO.context.active(),n)};IE.getTracedCreateClient=wDt;var ODt=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=ODt});var u6=M(gu=>{"use strict";m();Object.defineProperty(gu,"__esModule",{value:!0});gu.DB_SYSTEM_VALUE_REDIS=gu.DB_SYSTEM_NAME_VALUE_REDIS=gu.ATTR_NET_PEER_PORT=gu.ATTR_NET_PEER_NAME=gu.ATTR_DB_SYSTEM=gu.ATTR_DB_STATEMENT=gu.ATTR_DB_CONNECTION_STRING=void 0;gu.ATTR_DB_CONNECTION_STRING="db.connection_string";gu.ATTR_DB_STATEMENT="db.statement";gu.ATTR_DB_SYSTEM="db.system";gu.ATTR_NET_PEER_NAME="net.peer.name";gu.ATTR_NET_PEER_PORT="net.peer.port";gu.DB_SYSTEM_NAME_VALUE_REDIS="redis";gu.DB_SYSTEM_VALUE_REDIS="redis"});var gMe=M(l6=>{"use strict";m();Object.defineProperty(l6,"__esModule",{value:!0});l6.RedisInstrumentationV2_V3=void 0;var Xl=un(),c6=mMe(),AMe=a6(),mO=(He(),Me(tt)),AO=(Xn(),Me(Hr)),rT=u6(),kDt=o6(),ZW=class e extends Xl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(AMe.PACKAGE_NAME,AMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Xl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,Xl.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,Xl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Xl.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(),u=mO.trace.getSpan(mO.context.active())===void 0;if(s.requireParentSpan===!0&&u)return r.apply(this,arguments);let l=s?.dbStatementSerializer||kDt.defaultDbStatementSerializer,f={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(f,{[rT.ATTR_DB_SYSTEM]:rT.DB_SYSTEM_VALUE_REDIS,[rT.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(f,{[AO.ATTR_DB_SYSTEM_NAME]:rT.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 y={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(y,{[rT.ATTR_NET_PEER_NAME]:this.connection_options.host,[rT.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(y,{[AO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[AO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&Xl.SemconvStability.OLD&&h.setAttribute(rT.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let _=arguments[0].callback;if(_){let y=mO.context.active();arguments[0].callback=function(v,R){if(s?.responseHook){let x=s.responseHook;(0,Xl.safeExecuteInTheMiddle)(()=>{x(h,i.command,i.args,R)},O=>{O&&t._diag.error("Error executing responseHook",O)},!0)}return(0,c6.endSpan)(h,v),mO.context.with(y,_,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,c6.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,c6.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,c6.getTracedCreateStreamTrace)(n)}}};l6.RedisInstrumentationV2_V3=ZW});var _Me=M(d6=>{"use strict";m();Object.defineProperty(d6,"__esModule",{value:!0});d6.getClientAttributes=void 0;var WW=(Xn(),Me(Hr)),xR=u6(),hMe=un();function PDt(e,t,n){let r={};return n&hMe.SemconvStability.OLD&&Object.assign(r,{[xR.ATTR_DB_SYSTEM]:xR.DB_SYSTEM_VALUE_REDIS,[xR.ATTR_NET_PEER_NAME]:t?.socket?.host,[xR.ATTR_NET_PEER_PORT]:t?.socket?.port,[xR.ATTR_DB_CONNECTION_STRING]:MDt(e,t?.url)}),n&hMe.SemconvStability.STABLE&&Object.assign(r,{[WW.ATTR_DB_SYSTEM_NAME]:xR.DB_SYSTEM_NAME_VALUE_REDIS,[WW.ATTR_SERVER_ADDRESS]:t?.socket?.host,[WW.ATTR_SERVER_PORT]:t?.socket?.port}),r}d6.getClientAttributes=PDt;function MDt(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 TMe=M(p6=>{"use strict";m();Object.defineProperty(p6,"__esModule",{value:!0});p6.RedisInstrumentationV4_V5=void 0;var lp=(He(),Me(tt)),Co=un(),EMe=_Me(),LDt=o6(),yMe=a6(),XW=(Xn(),Me(Hr)),UDt=u6(),gO=Symbol("opentelemetry.instrumentation.redis.open_spans"),SMe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),eX=class e extends Co.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(yMe.PACKAGE_NAME,yMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.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 Co.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let u=i.transformCommandArguments;if(!u)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Co.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(u)),i},i=>{(0,Co.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Co.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Co.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Co.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,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Co.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Co.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 u=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(u,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(u=>{let l=this[gO];return n._endSpansWithRedisReplies(l,u,t),u}).catch(u=>{let l=this[gO];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=u.constructor.name==="MultiErrorReply"?u.replies:new Array(l.length).fill(u);n._endSpansWithRedisReplies(l,f,t)}return Promise.reject(u)})}}}_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[SMe]=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,EMe.getClientAttributes)(t._diag,i,t._semconvStability),u=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:lp.SpanKind.CLIENT,attributes:s});return lp.context.with(lp.trace.setSpan(lp.context.active(),u),()=>r.apply(this)).then(f=>(u.end(),f)).catch(f=>(u.recordException(f),u.setStatus({code:lp.SpanStatusCode.ERROR,message:f.message}),u.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(lp.trace.getSpan(lp.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[SMe],u=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||LDt.defaultDbStatementSerializer,h=(0,EMe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_OPERATION_NAME]=u);try{let T=f(u,l);T!=null&&(this._semconvStability&Co.SemconvStability.OLD&&(h[UDt.ATTR_DB_STATEMENT]=T),this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_QUERY_TEXT]=T))}catch(T){this._diag.error("dbStatementSerializer throw an exception",T,{commandName:u})}let _=this.tracer.startSpan(`${e.COMPONENT}-${u}`,{kind:lp.SpanKind.CLIENT,attributes:h}),y=lp.context.with(lp.trace.setSpan(lp.context.active(),_),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(T=>{this._endSpanWithResponse(_,u,l,T,void 0)},T=>{this._endSpanWithResponse(_,u,l,null,T)});else{let T=y;T[gO]=T[gO]||[],T[gO].push({span:_,commandName:u,commandArgs:l})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(u=>u.commandName),s=o.every(u=>u===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let u=0;u<t.length;u++){let{span:l,commandArgs:f}=t[u],h=n[u],[_,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Co.SemconvStability.STABLE&&l.setAttribute(XW.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[u],f,_,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(u){this._diag.error("responseHook throw an exception",u)}i&&(t.recordException(i),t.setStatus({code:lp.SpanStatusCode.ERROR,message:i?.message})),t.end()}};p6.RedisInstrumentationV4_V5=eX});var CMe=M(f6=>{"use strict";m();Object.defineProperty(f6,"__esModule",{value:!0});f6.RedisInstrumentation=void 0;var QDt=un(),bMe=a6(),FDt=gMe(),GDt=TMe(),IMe={requireParentSpan:!1},tX=class extends QDt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...IMe,...t};super(bMe.PACKAGE_NAME,bMe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new FDt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new GDt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...IMe,...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())}};f6.RedisInstrumentation=tX});var vMe=M(m6=>{"use strict";m();Object.defineProperty(m6,"__esModule",{value:!0});m6.RedisInstrumentation=void 0;var jDt=CMe();Object.defineProperty(m6,"RedisInstrumentation",{enumerable:!0,get:function(){return jDt.RedisInstrumentation}})});function hO(e,t){return e.includes(t.toLowerCase())}function rX(e){return hO(nX,e)?"cache.get":hO(HDt,e)?"cache.put":void 0}function $Dt(e,t){return t.some(n=>e.startsWith(n))}function xMe(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)?RMe(o.map(i=>n(i))):["<unknown>"],r=t[0];return hO(zDt,e)&&r!=null?n(r):RMe(t.map(o=>n(o)))}catch{return}}function DMe(e,t,n){if(!rX(e))return!1;for(let r of t)if($Dt(r,n))return!0;return!1}function NMe(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 RMe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var zDt,nX,HDt,BMe=w(()=>{m();zDt=["get","set","setex"],nX=["get","mget"],HDt=["set","setex"]});var wMe,OMe,A6,_O,kMe,qDt,VDt,PMe,YDt,MMe,LMe=w(()=>{m();wMe=ue(fMe(),1),OMe=ue(vMe(),1);At();_r();BMe();A6="Redis",_O={},kMe=(e,t,n,r)=>{e.setAttribute(Mt,"auto.db.otel.redis");let o=xMe(t,n),i=rX(t);if(!o||!i||!_O.cachePrefixes||!DMe(t,o,_O.cachePrefixes))return;let s=kt(e).data["net.peer.name"],u=kt(e).data["net.peer.port"];u&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":u});let l=NMe(r);l&&e.setAttribute(aY,l),hO(nX,t)&&l!==void 0&&e.setAttribute(iY,l>0),e.setAttributes({[Xt]:i,[sY]:o});let f=o.join(", ");e.updateName(_O.maxCacheKeyLength?Q_(f,_O.maxCacheKeyLength):f)},qDt=ct(`${A6}.IORedis`,()=>new wMe.IORedisInstrumentation({responseHook:kMe})),VDt=ct(`${A6}.Redis`,()=>new OMe.RedisInstrumentation({responseHook:kMe})),PMe=Object.assign(()=>{qDt(),VDt()},{id:A6}),YDt=((e={})=>({name:A6,setupOnce(){_O=e,PMe()}})),MMe=YDt});var UMe=M(g6=>{"use strict";m();Object.defineProperty(g6,"__esModule",{value:!0});g6.EVENT_LISTENERS_SET=void 0;g6.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var oX=M(EO=>{"use strict";m();Object.defineProperty(EO,"__esModule",{value:!0});EO.AttributeNames=void 0;var KDt;(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"})(KDt=EO.AttributeNames||(EO.AttributeNames={}))});var iX=M(wr=>{"use strict";m();Object.defineProperty(wr,"__esModule",{value:!0});wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=wr.METRIC_DB_CLIENT_CONNECTION_COUNT=wr.DB_SYSTEM_VALUE_POSTGRESQL=wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=wr.ATTR_NET_PEER_PORT=wr.ATTR_NET_PEER_NAME=wr.ATTR_DB_USER=wr.ATTR_DB_SYSTEM=wr.ATTR_DB_STATEMENT=wr.ATTR_DB_NAME=wr.ATTR_DB_CONNECTION_STRING=wr.ATTR_DB_CLIENT_CONNECTION_STATE=wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";wr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";wr.ATTR_DB_CONNECTION_STRING="db.connection_string";wr.ATTR_DB_NAME="db.name";wr.ATTR_DB_STATEMENT="db.statement";wr.ATTR_DB_SYSTEM="db.system";wr.ATTR_DB_USER="db.user";wr.ATTR_NET_PEER_NAME="net.peer.name";wr.ATTR_NET_PEER_PORT="net.peer.port";wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";wr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";wr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var sX=M(yO=>{"use strict";m();Object.defineProperty(yO,"__esModule",{value:!0});yO.SpanNames=void 0;var JDt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(JDt=yO.SpanNames||(yO.SpanNames={}))});var $Me=M(sr=>{"use strict";m();Object.defineProperty(sr,"__esModule",{value:!0});sr.sanitizedErrorMessage=sr.isObjectWithTextString=sr.getErrorMessage=sr.patchClientConnectCallback=sr.patchCallbackPGPool=sr.updateCounter=sr.getPoolName=sr.patchCallback=sr.handleExecutionResult=sr.handleConfigQuery=sr.shouldSkipInstrumentation=sr.getSemanticAttributesFromPoolConnection=sr.getSemanticAttributesFromConnection=sr.getConnectionString=sr.parseAndMaskConnectionString=sr.parseNormalizedOperationName=sr.getQuerySpanName=void 0;var CE=(He(),Me(tt)),h6=oX(),dp=(Xn(),Me(Hr)),Ei=iX(),oT=un(),QMe=sX();function FMe(e,t){if(!t)return QMe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:GMe(t.text);return`${QMe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}sr.getQuerySpanName=FMe;function GMe(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}sr.parseNormalizedOperationName=GMe;function jMe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}sr.parseAndMaskConnectionString=jMe;function aX(e){if("connectionString"in e&&e.connectionString)return jMe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}sr.getConnectionString=aX;function _6(e){if(Number.isInteger(e))return e}function zMe(e,t){let n={};return t&oT.SemconvStability.OLD&&(n={...n,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_DB_USER]:e.user,[Ei.ATTR_NET_PEER_NAME]:e.host,[Ei.ATTR_NET_PEER_PORT]:_6(e.port)}),t&oT.SemconvStability.STABLE&&(n={...n,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:e.host,[dp.ATTR_SERVER_PORT]:_6(e.port)}),n}sr.getSemanticAttributesFromConnection=zMe;function ZDt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[h6.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[h6.AttributeNames.MAX_CLIENT]:e.maxClient};return t&oT.SemconvStability.OLD&&(r={...r,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[Ei.ATTR_NET_PEER_PORT]:Number(n?.port)||_6(e.port),[Ei.ATTR_DB_USER]:n?.username??e.user}),t&oT.SemconvStability.STABLE&&(r={...r,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[dp.ATTR_SERVER_PORT]:Number(n?.port)||_6(e.port)}),r}sr.getSemanticAttributesFromPoolConnection=ZDt;function WDt(e){return e.requireParentSpan===!0&&CE.trace.getSpan(CE.context.active())===void 0}sr.shouldSkipInstrumentation=WDt;function XDt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=FMe(i,r),u=e.startSpan(s,{kind:CE.SpanKind.CLIENT,attributes:zMe(o,n)});if(!r)return u;if(r.text&&(n&oT.SemconvStability.OLD&&u.setAttribute(Ei.ATTR_DB_STATEMENT,r.text),n&oT.SemconvStability.STABLE&&u.setAttribute(dp.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());u.setAttribute(h6.AttributeNames.PG_VALUES,l)}catch(l){CE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&u.setAttribute(h6.AttributeNames.PG_PLAN,r.name),u}sr.handleConfigQuery=XDt;function HMe(e,t,n){typeof e.responseHook=="function"&&(0,oT.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&CE.diag.error("Error running response hook",r)},!0)}sr.handleExecutionResult=HMe;function e1t(e,t,n,r,o){return function(s,u){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[dp.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(E6(s)),t.setStatus({code:CE.SpanStatusCode.ERROR,message:s.message})):HMe(e,t,u),o(),t.end(),n.call(this,s,u)}}sr.patchCallback=e1t;function t1t(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()}sr.getPoolName=t1t;function n1t(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,u=t.idleCount,l=i-u;return n.add(l-o.used,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(u-o.idle,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:u,pending:s}}sr.updateCounter=n1t;function r1t(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(E6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}sr.patchCallbackPGPool=r1t;function o1t(e,t){return function(r){r&&(r instanceof Error&&e.recordException(E6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}sr.patchClientConnectCallback=o1t;function i1t(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}sr.getErrorMessage=i1t;function s1t(e){return typeof e=="object"&&typeof e?.text=="string"}sr.isObjectWithTextString=s1t;function E6(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}sr.sanitizedErrorMessage=E6});var qMe=M(DR=>{"use strict";m();Object.defineProperty(DR,"__esModule",{value:!0});DR.PACKAGE_NAME=DR.PACKAGE_VERSION=void 0;DR.PACKAGE_VERSION="0.66.0";DR.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var WMe=M(S6=>{"use strict";m();Object.defineProperty(S6,"__esModule",{value:!0});S6.PgInstrumentation=void 0;var tc=un(),Yr=(He(),Me(tt)),VMe=UMe(),ni=$Me(),YMe=HW(),KMe=qMe(),JMe=sX(),y6=vr(),Df=(Xn(),Me(Hr)),SO=iX();function NR(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var uX=class extends tc.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(KMe.PACKAGE_NAME,KMe.PACKAGE_VERSION,t),this._semconvStability=(0,tc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Df.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Yr.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 tc.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new tc.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new tc.InstrumentationNodeModuleDefinition("pg",t,u=>{let l=NR(u);return this._patchPgClient(l.Client),u},u=>{let l=NR(u);return this._unpatchPgClient(l.Client),u},[o,r]),s=new tc.InstrumentationNodeModuleDefinition("pg-pool",n,u=>{let l=NR(u);return(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},u=>{let l=NR(u);(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.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=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(JMe.SpanNames.CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchClientConnectCallback(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return ZMe(s,u)}}recordOperationDuration(t,n){let r={},o=[Df.ATTR_DB_NAMESPACE,Df.ATTR_ERROR_TYPE,Df.ATTR_SERVER_PORT,Df.ATTR_SERVER_ADDRESS,Df.ATTR_DB_OPERATION_NAME];this._semconvStability&tc.SemconvStability.OLD&&o.push(SO.ATTR_DB_SYSTEM),this._semconvStability&tc.SemconvStability.STABLE&&o.push(Df.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,y6.hrTimeToMilliseconds)((0,y6.hrTimeDuration)(n,(0,y6.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ni.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,y6.hrTime)(),s=o[0],u=typeof s=="string",l=ni.isObjectWithTextString(s),f=u?{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,[Df.ATTR_DB_NAMESPACE]:this.database,[Df.ATTR_SERVER_PORT]:this.connectionParameters.port,[Df.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[Df.ATTR_DB_OPERATION_NAME]=ni.parseNormalizedOperationName(f?.text));let _=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),T=ni.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,f);if(y.addSqlCommenterCommentToQueries&&(u?o[0]=(0,YMe.addSqlCommenterComment)(T,s):l&&!("name"in s)&&(o[0]={...s,text:(0,YMe.addSqlCommenterComment)(T,s.text)})),o.length>0){let x=Yr.trace.getSpan(Yr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ni.patchCallback(y,T,o[o.length-1],h,_),x&&(o[o.length-1]=Yr.context.bind(Yr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let O=ni.patchCallback(t.getConfig(),T,f.callback,h,_);x&&(O=Yr.context.bind(Yr.context.active(),O)),o[0].callback=O}}let{requestHook:v}=y;typeof v=="function"&&f&&(0,tc.safeExecuteInTheMiddle)(()=>{let{database:x,host:O,port:P,user:j}=this.connectionParameters;v(T,{connection:{database:x,host:O,port:P,user:j},query:{text:f.text,values:f.values,name:f.name}})},x=>{x&&t._diag.error("Error running query hook",x)},!0);let R;try{R=n.apply(this,o)}catch(x){throw x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(x)}),T.end(),x}return R instanceof Promise?R.then(x=>new Promise(O=>{ni.handleExecutionResult(t.getConfig(),T,x),_(),T.end(),O(x)})).catch(x=>new Promise((O,P)=>{x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:x.message}),_(),T.end(),P(x)})):R})}_setPoolConnectEventListeners(t){if(t[VMe.EVENT_LISTENERS_SET])return;let n=ni.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[VMe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(JMe.SpanNames.POOL_CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchCallbackPGPool(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return ZMe(s,u)}}};S6.PgInstrumentation=uX;function ZMe(e,t){if(!(t instanceof Promise))return t;let n=t;return Yr.context.bind(Yr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(ni.sanitizedErrorMessage(r)),e.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var XMe=M(BR=>{"use strict";m();Object.defineProperty(BR,"__esModule",{value:!0});BR.AttributeNames=BR.PgInstrumentation=void 0;var a1t=WMe();Object.defineProperty(BR,"PgInstrumentation",{enumerable:!0,get:function(){return a1t.PgInstrumentation}});var u1t=oX();Object.defineProperty(BR,"AttributeNames",{enumerable:!0,get:function(){return u1t.AttributeNames}})});var e2e,t2e,n2e,c1t,r2e,o2e=w(()=>{m();e2e=ue(XMe(),1);_r();t2e="Postgres",n2e=ct(t2e,e2e.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){qr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),c1t=(e=>({name:t2e,setupOnce(){n2e(e)}})),r2e=c1t});var vE,lX,i2e,l1t,d1t,s2e,cX,p1t,a2e,u2e=w(()=>{m();He();vE=ue(un(),1);Xn();At();_r();YS();lX="PostgresJs",i2e=[">=3.0.0 <4"],l1t=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,d1t=Symbol.for("sentry.query.from.instrumented.sql"),s2e=ct(lX,e=>new cX({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),cX=class extends vE.InstrumentationBase{constructor(t){super("sentry-postgres-js",er,t)}init(){let t=new vE.InstrumentationNodeModuleDefinition("postgres",i2e,n=>{try{return this._patchPostgres(n)}catch(r){return Ds&&W.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new vE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,i2e,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 Ds&&W.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let u=Reflect.construct(r,s);if(!u||typeof u!="function")return Ds&&W.warn("postgres() did not return a valid instance"),u;let l=o.getConfig();return cK(u,{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 u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}return n?i:(gw(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Vt.getSpan(We.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(LC,r);return}let o=n?.match(l1t);o?.[1]&&t.setAttribute(LC,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[d1t])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return oa({name:s||"postgresjs.query",op:"db"},u=>{qr(u,"auto.db.postgresjs"),u.setAttributes({[fS]:"postgres",[SV]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,vE.safeExecuteInTheMiddle)(()=>f(u,s,void 0),y=>{y&&(u.setAttribute("sentry.hook.error","requestHook failed"),Ds&&W.error(`Error in requestHook for ${lX} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,T,v)=>{try{n._setOperationName(u,s,v?.[0]?.command),u.end()}catch(R){Ds&&W.error("Error ending span in resolve callback:",R)}return Reflect.apply(y,T,v)}});let _=this.reject;this.reject=new Proxy(_,{apply:(y,T,v)=>{try{u.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),u.setAttribute(TV,v?.[0]?.code||"unknown"),u.setAttribute(bV,v?.[0]?.name||"unknown"),n._setOperationName(u,s),u.end()}catch(R){Ds&&W.error("Error ending span in reject callback:",R)}return Reflect.apply(y,T,v)}});try{return r.apply(this,o)}catch(y){throw u.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),u.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},p1t=(e=>({name:lX,setupOnce(){s2e(e)}})),a2e=p1t});var c2e=M(TO=>{"use strict";m();Object.defineProperty(TO,"__esModule",{value:!0});TO.SeverityNumber=void 0;var f1t;(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"})(f1t=TO.SeverityNumber||(TO.SeverityNumber={}))});var b6=M(wR=>{"use strict";m();Object.defineProperty(wR,"__esModule",{value:!0});wR.NOOP_LOGGER=wR.NoopLogger=void 0;var T6=class{emit(t){}};wR.NoopLogger=T6;wR.NOOP_LOGGER=new T6});var C6=M(OR=>{"use strict";m();Object.defineProperty(OR,"__esModule",{value:!0});OR.NOOP_LOGGER_PROVIDER=OR.NoopLoggerProvider=void 0;var m1t=b6(),I6=class{getLogger(t,n,r){return new m1t.NoopLogger}};OR.NoopLoggerProvider=I6;OR.NOOP_LOGGER_PROVIDER=new I6});var pX=M(v6=>{"use strict";m();Object.defineProperty(v6,"__esModule",{value:!0});v6.ProxyLogger=void 0;var A1t=b6(),dX=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):A1t.NOOP_LOGGER}};v6.ProxyLogger=dX});var mX=M(R6=>{"use strict";m();Object.defineProperty(R6,"__esModule",{value:!0});R6.ProxyLoggerProvider=void 0;var g1t=C6(),h1t=pX(),fX=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new h1t.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:g1t.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)}};R6.ProxyLoggerProvider=fX});var l2e=M(x6=>{"use strict";m();Object.defineProperty(x6,"__esModule",{value:!0});x6._globalThis=void 0;x6._globalThis=typeof globalThis=="object"?globalThis:global});var d2e=M(D6=>{"use strict";m();Object.defineProperty(D6,"__esModule",{value:!0});D6._globalThis=void 0;var _1t=l2e();Object.defineProperty(D6,"_globalThis",{enumerable:!0,get:function(){return _1t._globalThis}})});var p2e=M(N6=>{"use strict";m();Object.defineProperty(N6,"__esModule",{value:!0});N6._globalThis=void 0;var E1t=d2e();Object.defineProperty(N6,"_globalThis",{enumerable:!0,get:function(){return E1t._globalThis}})});var f2e=M(nA=>{"use strict";m();Object.defineProperty(nA,"__esModule",{value:!0});nA.API_BACKWARDS_COMPATIBILITY_VERSION=nA.makeGetter=nA._global=nA.GLOBAL_LOGS_API_KEY=void 0;var y1t=p2e();nA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");nA._global=y1t._globalThis;function S1t(e,t,n){return r=>r===e?t:n}nA.makeGetter=S1t;nA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var A2e=M(B6=>{"use strict";m();Object.defineProperty(B6,"__esModule",{value:!0});B6.LogsAPI=void 0;var pp=f2e(),T1t=C6(),m2e=mX(),AX=class e{constructor(){this._proxyLoggerProvider=new m2e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return pp._global[pp.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(pp._global[pp.GLOBAL_LOGS_API_KEY]=(0,pp.makeGetter)(pp.API_BACKWARDS_COMPATIBILITY_VERSION,t,T1t.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=pp._global[pp.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(pp._global,pp.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete pp._global[pp.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new m2e.ProxyLoggerProvider}};B6.LogsAPI=AX});var gX=M(ca=>{"use strict";m();Object.defineProperty(ca,"__esModule",{value:!0});ca.logs=ca.ProxyLoggerProvider=ca.ProxyLogger=ca.NoopLoggerProvider=ca.NOOP_LOGGER_PROVIDER=ca.NoopLogger=ca.NOOP_LOGGER=ca.SeverityNumber=void 0;var b1t=c2e();Object.defineProperty(ca,"SeverityNumber",{enumerable:!0,get:function(){return b1t.SeverityNumber}});var g2e=b6();Object.defineProperty(ca,"NOOP_LOGGER",{enumerable:!0,get:function(){return g2e.NOOP_LOGGER}});Object.defineProperty(ca,"NoopLogger",{enumerable:!0,get:function(){return g2e.NoopLogger}});var h2e=C6();Object.defineProperty(ca,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return h2e.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ca,"NoopLoggerProvider",{enumerable:!0,get:function(){return h2e.NoopLoggerProvider}});var I1t=pX();Object.defineProperty(ca,"ProxyLogger",{enumerable:!0,get:function(){return I1t.ProxyLogger}});var C1t=mX();Object.defineProperty(ca,"ProxyLoggerProvider",{enumerable:!0,get:function(){return C1t.ProxyLoggerProvider}});var v1t=A2e();ca.logs=v1t.LogsAPI.getInstance()});var _2e=M(kR=>{"use strict";m();Object.defineProperty(kR,"__esModule",{value:!0});kR.disableInstrumentations=kR.enableInstrumentations=void 0;function R1t(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()}}kR.enableInstrumentations=R1t;function x1t(e){e.forEach(t=>t.disable())}kR.disableInstrumentations=x1t});var S2e=M(w6=>{"use strict";m();Object.defineProperty(w6,"__esModule",{value:!0});w6.registerInstrumentations=void 0;var E2e=(He(),Me(tt)),D1t=gX(),y2e=_2e();function N1t(e){let t=e.tracerProvider||E2e.trace.getTracerProvider(),n=e.meterProvider||E2e.metrics.getMeterProvider(),r=e.loggerProvider||D1t.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,y2e.enableInstrumentations)(o,t,n,r),()=>{(0,y2e.disableInstrumentations)(o)}}w6.registerInstrumentations=N1t});var N2e=M(O6=>{"use strict";m();Object.defineProperty(O6,"__esModule",{value:!0});O6.satisfies=void 0;var yX=(He(),Me(tt)),v2e=/^(?: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-]+)*))?$/,B1t=/^(?<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-]+)*))?$/,w1t={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function O1t(e,t,n){if(!k1t(e))return yX.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=U1t(e);if(!r)return!1;let o=[],i=R2e(r,t,o,n);return i&&!n?.includePrerelease?M1t(r,o):i}O6.satisfies=O1t;function k1t(e){return typeof e=="string"&&v2e.test(e)}function R2e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(hX(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=iNt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!hX(e,i,n,r))return!1;return!0}return hX(e,t,n,r)}function hX(e,t,n,r){if(t=L1t(t,r),t.includes(" "))return R2e(e,t,n,r);{let o=Q1t(t);return n.push(o),P1t(e,o)}}function P1t(e,t){if(t.invalid)return!1;if(!t.version||EX(t.version))return!0;let n=b2e(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=b2e(r,o)}return w1t[t.op]?.includes(n)}function M1t(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function L1t(e,t){return e=e.trim(),e=rNt(e,t),e=nNt(e),e=oNt(e,t),e=e.trim(),e}function nc(e){return!e||e.toLowerCase()==="x"||e==="*"}function U1t(e){let t=e.match(v2e);if(!t){yX.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 Q1t(e){if(!e)return{};let t=e.match(B1t);if(!t)return yX.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("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function EX(e){return e==="*"||e==="x"||e==="X"}function T2e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function F1t(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 G1t(e,t){if(EX(e)||EX(t))return 0;let[n,r]=F1t(T2e(e),T2e(t));return n>r?1:n<r?-1:0}function b2e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=G1t(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var x2e="[a-zA-Z0-9-]",D2e="0|[1-9]\\d*",j1t=`\\d*[a-zA-Z-]${x2e}*`,z1t="((?:<|>)?=?)",I2e=`(?:${D2e}|${j1t})`,H1t=`(?:-(${I2e}(?:\\.${I2e})*))`,C2e=`${x2e}+`,$1t=`(?:\\+(${C2e}(?:\\.${C2e})*))`,_X=`${D2e}|x|X|\\*`,bO=`[v=\\s]*(${_X})(?:\\.(${_X})(?:\\.(${_X})(?:${H1t})?${$1t}?)?)?`,q1t=`^${z1t}\\s*${bO}$`,V1t=new RegExp(q1t),Y1t=`^\\s*(${bO})\\s+-\\s+(${bO})\\s*$`,K1t=new RegExp(Y1t),J1t="(?:~>?)",Z1t=`^${J1t}${bO}$`,W1t=new RegExp(Z1t),X1t="(?:\\^)",eNt=`^${X1t}${bO}$`,tNt=new RegExp(eNt);function nNt(e){let t=W1t;return e.replace(t,(n,r,o,i,s)=>{let u;return nc(r)?u="":nc(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:nc(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function rNt(e,t){let n=tNt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return nc(i)?f="":nc(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:nc(u)?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}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function oNt(e,t){let n=V1t;return e.replace(n,(r,o,i,s,u,l)=>{let f=nc(i),h=f||nc(s),_=h||nc(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function iNt(e,t){let n=K1t;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>(nc(i)?o="":nc(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:nc(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,nc(_)?h="":nc(y)?h=`<${+_+1}.0.0-0`:nc(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var SX=M(La=>{"use strict";m();Object.defineProperty(La,"__esModule",{value:!0});La.massUnwrap=La.unwrap=La.massWrap=La.wrap=void 0;var rc=console.error.bind(console);function IO(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 sNt=(e,t,n)=>{if(!e||!e[t]){rc("no original function "+String(t)+" to wrap");return}if(!n){rc("no wrapper function"),rc(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){rc("original object and wrapper must be functions");return}let o=n(r,t);return IO(o,"__original",r),IO(o,"__unwrap",()=>{e[t]===o&&IO(e,t,r)}),IO(o,"__wrapped",!0),IO(e,t,o),o};La.wrap=sNt;var aNt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,La.wrap)(r,o,n)})})};La.massWrap=aNt;var uNt=(e,t)=>{if(!e||!e[t]){rc("no function to unwrap."),rc(new Error().stack);return}let n=e[t];if(!n.__unwrap)rc("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};La.unwrap=uNt;var cNt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,La.unwrap)(n,r)})})};La.massUnwrap=cNt;function CO(e){e&&e.logger&&(typeof e.logger!="function"?rc("new logger isn't a function, not replacing"):rc=e.logger)}La.default=CO;CO.wrap=La.wrap;CO.massWrap=La.massWrap;CO.unwrap=La.unwrap;CO.massUnwrap=La.massUnwrap});var B2e=M(P6=>{"use strict";m();Object.defineProperty(P6,"__esModule",{value:!0});P6.InstrumentationAbstract=void 0;var TX=(He(),Me(tt)),lNt=gX(),k6=SX(),bX=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=TX.diag.createComponentLogger({namespace:t}),this._tracer=TX.trace.getTracer(t,n),this._meter=TX.metrics.getMeter(t,n),this._logger=lNt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=k6.wrap;_unwrap=k6.unwrap;_massWrap=k6.massWrap;_massUnwrap=k6.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)}}};P6.InstrumentationAbstract=bX});var w2e=M(RE=>{"use strict";m();Object.defineProperty(RE,"__esModule",{value:!0});RE.ModuleNameTrie=RE.ModuleNameSeparator=void 0;RE.ModuleNameSeparator="/";var M6=class{hooks=[];children=new Map},IX=class{_trie=new M6;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(RE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new M6,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 u of t.split(RE.ModuleNameSeparator)){let l=o.children.get(u);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((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};RE.ModuleNameTrie=IX});var k2e=M(L6=>{"use strict";m();Object.defineProperty(L6,"__esModule",{value:!0});L6.RequireInTheMiddleSingleton=void 0;var dNt=ES(),O2e=Ue("path"),CX=w2e(),pNt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),vX=class e{_moduleNameTrie=new CX.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new dNt.Hook(null,{internals:!0},(t,n,r)=>{let o=fNt(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 pNt?new e:this._instance=this._instance??new e}};L6.RequireInTheMiddleSingleton=vX;function fNt(e){return O2e.sep!==CX.ModuleNameSeparator?e.split(O2e.sep).join(CX.ModuleNameSeparator):e}});var RX=M(xE=>{"use strict";m();Object.defineProperty(xE,"__esModule",{value:!0});xE.isWrapped=xE.safeExecuteInTheMiddleAsync=xE.safeExecuteInTheMiddle=void 0;function mNt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddle=mNt;async function ANt(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}}xE.safeExecuteInTheMiddleAsync=ANt;function gNt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}xE.isWrapped=gNt});var L2e=M(U6=>{"use strict";m();Object.defineProperty(U6,"__esModule",{value:!0});U6.InstrumentationBase=void 0;var vO=Ue("path"),P2e=Ue("util"),hNt=N2e(),xX=SX(),_Nt=B2e(),ENt=k2e(),yNt=uW(),RO=(He(),Me(tt)),SNt=ES(),TNt=Ue("fs"),bNt=RX(),DX=class extends _Nt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=ENt.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,bNt.isWrapped)(t[n])&&this._unwrap(t,n),P2e.types.isProxy(t)){let o=(0,xX.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,xX.wrap)(t,n,r)};_unwrap=(t,n)=>P2e.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,xX.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=Ue.resolve(n);Ue.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,TNt.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 M2e(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??[],u=vO.normalize(r);return s.filter(f=>f.name===u).filter(f=>M2e(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,u,l)=>{if(!l&&vO.isAbsolute(u)){let f=vO.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=vO.isAbsolute(t.name)?new SNt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new yNt.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}};U6.InstrumentationBase=DX;function M2e(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,hNt.satisfies)(t,r,{includePrerelease:n}))}});var U2e=M(Q6=>{"use strict";m();Object.defineProperty(Q6,"__esModule",{value:!0});Q6.normalize=void 0;var INt=Ue("path");Object.defineProperty(Q6,"normalize",{enumerable:!0,get:function(){return INt.normalize}})});var Q2e=M(PR=>{"use strict";m();Object.defineProperty(PR,"__esModule",{value:!0});PR.normalize=PR.InstrumentationBase=void 0;var CNt=L2e();Object.defineProperty(PR,"InstrumentationBase",{enumerable:!0,get:function(){return CNt.InstrumentationBase}});var vNt=U2e();Object.defineProperty(PR,"normalize",{enumerable:!0,get:function(){return vNt.normalize}})});var NX=M(MR=>{"use strict";m();Object.defineProperty(MR,"__esModule",{value:!0});MR.normalize=MR.InstrumentationBase=void 0;var F2e=Q2e();Object.defineProperty(MR,"InstrumentationBase",{enumerable:!0,get:function(){return F2e.InstrumentationBase}});Object.defineProperty(MR,"normalize",{enumerable:!0,get:function(){return F2e.normalize}})});var G2e=M(F6=>{"use strict";m();Object.defineProperty(F6,"__esModule",{value:!0});F6.InstrumentationNodeModuleDefinition=void 0;var BX=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||[]}};F6.InstrumentationNodeModuleDefinition=BX});var j2e=M(G6=>{"use strict";m();Object.defineProperty(G6,"__esModule",{value:!0});G6.InstrumentationNodeModuleFile=void 0;var RNt=NX(),wX=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,RNt.normalize)(t)}};G6.InstrumentationNodeModuleFile=wX});var z2e=M(iT=>{"use strict";m();Object.defineProperty(iT,"__esModule",{value:!0});iT.semconvStabilityFromStr=iT.SemconvStability=void 0;var j6;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(j6=iT.SemconvStability||(iT.SemconvStability={}));function xNt(e,t){let n=j6.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=j6.DUPLICATE;break}else o.toLowerCase()===e&&(n=j6.STABLE);return n}iT.semconvStabilityFromStr=xNt});var $2e=M(cs=>{"use strict";m();Object.defineProperty(cs,"__esModule",{value:!0});cs.semconvStabilityFromStr=cs.SemconvStability=cs.safeExecuteInTheMiddleAsync=cs.safeExecuteInTheMiddle=cs.isWrapped=cs.InstrumentationNodeModuleFile=cs.InstrumentationNodeModuleDefinition=cs.InstrumentationBase=cs.registerInstrumentations=void 0;var DNt=S2e();Object.defineProperty(cs,"registerInstrumentations",{enumerable:!0,get:function(){return DNt.registerInstrumentations}});var NNt=NX();Object.defineProperty(cs,"InstrumentationBase",{enumerable:!0,get:function(){return NNt.InstrumentationBase}});var BNt=G2e();Object.defineProperty(cs,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return BNt.InstrumentationNodeModuleDefinition}});var wNt=j2e();Object.defineProperty(cs,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return wNt.InstrumentationNodeModuleFile}});var OX=RX();Object.defineProperty(cs,"isWrapped",{enumerable:!0,get:function(){return OX.isWrapped}});Object.defineProperty(cs,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddle}});Object.defineProperty(cs,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddleAsync}});var H2e=z2e();Object.defineProperty(cs,"SemconvStability",{enumerable:!0,get:function(){return H2e.SemconvStability}});Object.defineProperty(cs,"semconvStabilityFromStr",{enumerable:!0,get:function(){return H2e.semconvStabilityFromStr}})});function PNt(){let e=LR[PX];return e?.helper?e.helper:LR[kX]?.helper}function MNt(e){let t={helper:e};LR[PX]=t,LR[kX]=t}function LNt(){delete LR[PX],delete LR[kX]}function FNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}function Y2e(e,t,n,r,o){if(K2e(t.name,o))return;let i={attributes:t.attributes,kind:FNt(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 u=n.filter(l=>l.parentId===t.id);for(let l of u)Y2e(e,l,n,r,o);s.end(t.endTime)})}function q2e(e,t){return jNt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function jNt(e){return e!=null&&typeof e.then=="function"}function K2e(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var z6,ONt,kNt,kX,PX,LR,UNt,QNt,GNt,J2e,V2e,zNt,HNt,Z2e,W2e=w(()=>{m();He();z6=ue($2e(),1);He();ONt={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"}},kNt=ONt.version.split(".")[0],kX="PRISMA_INSTRUMENTATION",PX=`V${kNt}_PRISMA_INSTRUMENTATION`,LR=globalThis;UNt=process.env.PRISMA_SHOW_ALL_TRACES==="true",QNt="00-10-10-00";GNt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Vt.getSpanContext(e??We.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:QNt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)Y2e(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return We.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!UNt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(K2e(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return q2e(i,t(i,r))}return n.startActiveSpan(o,e,i=>q2e(i,t(i,r)))}};J2e={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},V2e=J2e.version,zNt=J2e.name,HNt="@prisma/client",Z2e=class extends z6.InstrumentationBase{tracerProvider;constructor(e={}){super(zNt,V2e,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new z6.InstrumentationNodeModuleDefinition(HNt,[V2e])]}enable(){let e=this._config;MNt(new GNt({tracerProvider:this.tracerProvider??Vt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){LNt()}isEnabled(){return PNt()!==void 0}}});function $Nt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function eLe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function qNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}var X2e,MX,VNt,tLe,nLe=w(()=>{m();He();W2e();At();_r();X2e="Prisma";MX=class extends Z2e{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=eLe();$Nt(t)&&(t.createEngineSpan=n=>{let r=Vt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Xo(()=>{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=qNt(i.kind),u=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:ou.SAMPLED}})),_=Vt.setSpanContext(We.active(),{traceId:f,spanId:u,traceFlags:ou.SAMPLED});We.with(_,()=>{let y={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=y,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}})}};VNt=ct(X2e,e=>new MX(e)),tLe=e=>({name:X2e,setupOnce(){VNt(e)},setup(t){eLe()&&t.on("spanStart",n=>{let r=kt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Mt,"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 rLe=M(UR=>{"use strict";m();Object.defineProperty(UR,"__esModule",{value:!0});UR.PACKAGE_NAME=UR.PACKAGE_VERSION=void 0;UR.PACKAGE_VERSION="0.60.0";UR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var LX=M(rA=>{"use strict";m();Object.defineProperty(rA,"__esModule",{value:!0});rA.HapiLifecycleMethodNames=rA.HapiLayerType=rA.handlerPatched=rA.HapiComponentName=void 0;rA.HapiComponentName="@hapi/hapi";rA.handlerPatched=Symbol("hapi-handler-patched");rA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};rA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var oLe=M(H6=>{"use strict";m();Object.defineProperty(H6,"__esModule",{value:!0});H6.ATTR_HTTP_METHOD=void 0;H6.ATTR_HTTP_METHOD="http.method"});var UX=M(xO=>{"use strict";m();Object.defineProperty(xO,"__esModule",{value:!0});xO.AttributeNames=void 0;var YNt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(YNt=xO.AttributeNames||(xO.AttributeNames={}))});var aLe=M(ls=>{"use strict";m();Object.defineProperty(ls,"__esModule",{value:!0});ls.getPluginFromInput=ls.getExtMetadata=ls.getRouteMetadata=ls.isPatchableExtMethod=ls.isDirectExtInput=ls.isLifecycleExtEventObj=ls.isLifecycleExtType=ls.getPluginName=void 0;var iLe=(Xn(),Me(Hr)),KNt=oLe(),DO=LX(),DE=UX(),sLe=un();function JNt(e){return e.name?e.name:e.pkg.name}ls.getPluginName=JNt;var ZNt=e=>typeof e=="string"&&DO.HapiLifecycleMethodNames.has(e);ls.isLifecycleExtType=ZNt;var WNt=e=>{let t=e?.type;return t!==void 0&&(0,ls.isLifecycleExtType)(t)};ls.isLifecycleExtEventObj=WNt;var XNt=e=>Array.isArray(e)&&e.length<=3&&(0,ls.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ls.isDirectExtInput=XNt;var eBt=e=>!Array.isArray(e);ls.isPatchableExtMethod=eBt;var tBt=(e,t,n)=>{let r={[iLe.ATTR_HTTP_ROUTE]:e.path};t&sLe.SemconvStability.OLD&&(r[KNt.ATTR_HTTP_METHOD]=e.method),t&sLe.SemconvStability.STABLE&&(r[iLe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.PLUGIN,r[DE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ls.getRouteMetadata=tBt;var nBt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT,[DE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT},name:r}};ls.getExtMetadata=nBt;var rBt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ls.getPluginFromInput=rBt});var lLe=M($6=>{"use strict";m();Object.defineProperty($6,"__esModule",{value:!0});$6.HapiInstrumentation=void 0;var ed=(He(),Me(tt)),uLe=vr(),NO=un(),cLe=rLe(),BO=LX(),eh=aLe(),QX=class extends NO.InstrumentationBase{_semconvStability;constructor(t={}){super(cLe.PACKAGE_NAME,cLe.PACKAGE_VERSION,t),this._semconvStability=(0,NO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new NO.InstrumentationNodeModuleDefinition(BO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,NO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,NO.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",u=>n._getServerRoutePatch.bind(n)(u)),r._wrap(s,"ext",u=>n._getServerExtPatch.bind(n)(u)),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 u=(0,eh.getPluginFromInput)(s);n._wrapRegisterHandler(u)}else{let s=(0,eh.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 u=0;u<s.length;u++){let l=s[u];if((0,eh.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[u]=f}}return t.apply(this,i)}else if((0,eh.isDirectExtInput)(i)){let s=i,u=s[1],l=r._wrapExtMethods(u,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,eh.isLifecycleExtEventObj)(i[0])){let s=i[0],u=r._wrapExtMethods(s.method,s.type,n);return s.method=u,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,eh.getPluginName)(t),o=t.register,i=this,s=function(u,l){return i._wrap(u,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(u,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,u,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,eh.isPatchableExtMethod)(t))return t[BO.handlerPatched]===!0?t:(t[BO.handlerPatched]=!0,async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await t.apply(this,s);let u=(0,eh.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:ed.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[BO.handlerPatched]===!0)return t;t[BO.handlerPatched]=!0;let o=i=>async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await i.call(this,...s);let u=(0,uLe.getRPCMetadata)(ed.context.active());u?.type===uLe.RPCType.HTTP&&(u.route=t.path);let l=(0,eh.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:ed.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 u=i(s);return typeof u.handler=="function"&&(u.handler=o(u.handler)),u}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};$6.HapiInstrumentation=QX});var dLe=M(QR=>{"use strict";m();Object.defineProperty(QR,"__esModule",{value:!0});QR.AttributeNames=QR.HapiInstrumentation=void 0;var oBt=lLe();Object.defineProperty(QR,"HapiInstrumentation",{enumerable:!0,get:function(){return oBt.HapiInstrumentation}});var iBt=UX();Object.defineProperty(QR,"AttributeNames",{enumerable:!0,get:function(){return iBt.AttributeNames}})});var pLe,fLe,mLe,sBt,ALe,gLe=w(()=>{m();pLe=ue(dLe(),1);_r();fLe="Hapi",mLe=ct(fLe,()=>new pLe.HapiInstrumentation),sBt=(()=>({name:fLe,setupOnce(){mLe()}})),ALe=sBt});var NE,wO,FX=w(()=>{m();NE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},wO={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var V6,aBt,uBt,q6,hLe=w(()=>{m();He();V6=ue(un(),1);At();FX();aBt="@sentry/instrumentation-hono",uBt="0.0.1",q6=class extends V6.InstrumentationBase{constructor(t={}){super(aBt,uBt,t)}init(){return[new V6.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(u=>t._wrapHandler(u))])}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(u=>t._wrapHandler(u))])}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 We.with(Vt.setSpan(We.active(),s),()=>n._safeExecute(()=>{let u=t.apply(this,[r,o]);if(xa(u))return u.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[NE.HONO_TYPE]:f,[NE.HONO_NAME]:f===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(u);return s.setAttributes({[NE.HONO_TYPE]:l,[NE.HONO_NAME]:l===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),u}},()=>s.end(),u=>{n._handleError(s,u),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return xa(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?wO.MIDDLEWARE:wO.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:Ai.ERROR,message:n.message}),t.recordException(n))}}});function cBt(e){let t=kt(e).data,n=t[NE.HONO_TYPE];if(t[Xt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.hono",[Xt]:`${n}.hono`});let r=t[NE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[Rg],i=t[mS];typeof o=="string"&&typeof i=="string"&&Rn().setTransactionName(`${i} ${o}`)}var _Le,ELe,lBt,yLe,SLe=w(()=>{m();Xn();At();_r();YS();FX();hLe();_Le="Hono";ELe=ct(_Le,()=>new q6({responseHook:e=>{cBt(e)}})),lBt=(()=>({name:_Le,setupOnce(){ELe()}})),yLe=lBt});var Y6=M(OO=>{"use strict";m();Object.defineProperty(OO,"__esModule",{value:!0});OO.KoaLayerType=void 0;var dBt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(dBt=OO.KoaLayerType||(OO.KoaLayerType={}))});var TLe=M(FR=>{"use strict";m();Object.defineProperty(FR,"__esModule",{value:!0});FR.PACKAGE_NAME=FR.PACKAGE_VERSION=void 0;FR.PACKAGE_VERSION="0.62.0";FR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var GX=M(kO=>{"use strict";m();Object.defineProperty(kO,"__esModule",{value:!0});kO.AttributeNames=void 0;var pBt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(pBt=kO.AttributeNames||(kO.AttributeNames={}))});var ILe=M(GR=>{"use strict";m();Object.defineProperty(GR,"__esModule",{value:!0});GR.isLayerIgnored=GR.getMiddlewareMetadata=void 0;var bLe=Y6(),K6=GX(),fBt=(Xn(),Me(Hr)),mBt=(e,t,n,r)=>n?{attributes:{[K6.AttributeNames.KOA_NAME]:r?.toString(),[K6.AttributeNames.KOA_TYPE]:bLe.KoaLayerType.ROUTER,[fBt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[K6.AttributeNames.KOA_NAME]:t.name??"middleware",[K6.AttributeNames.KOA_TYPE]:bLe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};GR.getMiddlewareMetadata=mBt;var ABt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));GR.isLayerIgnored=ABt});var CLe=M(J6=>{"use strict";m();Object.defineProperty(J6,"__esModule",{value:!0});J6.kLayerPatched=void 0;J6.kLayerPatched=Symbol("koa-layer-patched")});var BLe=M(Z6=>{"use strict";m();Object.defineProperty(Z6,"__esModule",{value:!0});Z6.KoaInstrumentation=void 0;var oA=(He(),Me(tt)),PO=un(),vLe=Y6(),RLe=TLe(),xLe=ILe(),DLe=vr(),NLe=CLe(),jX=class extends PO.InstrumentationBase{constructor(t={}){super(RLe.PACKAGE_NAME,RLe.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){oA.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 u=0;u<s.length;u++){let l=s[u];s[u]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?vLe.KoaLayerType.ROUTER:vLe.KoaLayerType.MIDDLEWARE;return t[NLe.kLayerPatched]===!0||(0,xLe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(oA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[NLe.kLayerPatched]=!0,oA.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(oA.trace.getSpan(oA.context.active())===void 0)return t(i,s);let l=(0,xLe.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,DLe.getRPCMetadata)(oA.context.active());h?.type===DLe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:_}=this.getConfig();_&&(0,PO.safeExecuteInTheMiddle)(()=>_(f,{context:i,middlewareLayer:t,layerType:o}),T=>{T&&oA.diag.error("koa instrumentation: request hook failed",T)},!0);let y=oA.trace.setSpan(oA.context.active(),f);return oA.context.with(y,async()=>{try{return await t(i,s)}catch(T){throw f.recordException(T),T}finally{f.end()}})})}};Z6.KoaInstrumentation=jX});var wLe=M(BE=>{"use strict";m();Object.defineProperty(BE,"__esModule",{value:!0});BE.KoaLayerType=BE.AttributeNames=BE.KoaInstrumentation=void 0;var gBt=BLe();Object.defineProperty(BE,"KoaInstrumentation",{enumerable:!0,get:function(){return gBt.KoaInstrumentation}});var hBt=GX();Object.defineProperty(BE,"AttributeNames",{enumerable:!0,get:function(){return hBt.AttributeNames}});var _Bt=Y6();Object.defineProperty(BE,"KoaLayerType",{enumerable:!0,get:function(){return _Bt.KoaLayerType}})});var OLe,kLe,PLe,EBt,MLe,LLe=w(()=>{m();OLe=ue(wLe(),1);Xn();At();_r();YS();kLe="Koa",PLe=ct(kLe,OLe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){qr(t,"auto.http.otel.koa");let r=kt(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 >"),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[Rg],u=n.context?.request?.method?.toUpperCase()||"GET";s&&Rn().setTransactionName(`${u} ${s}`)}})),EBt=((e={})=>({name:kLe,setupOnce(){PLe(e)}})),MLe=EBt});var zX=M(Nf=>{"use strict";m();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.ConnectNames=Nf.ConnectTypes=Nf.AttributeNames=void 0;var yBt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(yBt=Nf.AttributeNames||(Nf.AttributeNames={}));var SBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(SBt=Nf.ConnectTypes||(Nf.ConnectTypes={}));var TBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(TBt=Nf.ConnectNames||(Nf.ConnectNames={}))});var ULe=M(jR=>{"use strict";m();Object.defineProperty(jR,"__esModule",{value:!0});jR.PACKAGE_NAME=jR.PACKAGE_VERSION=void 0;jR.PACKAGE_VERSION="0.57.0";jR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var QLe=M(W6=>{"use strict";m();Object.defineProperty(W6,"__esModule",{value:!0});W6._LAYERS_STORE_PROPERTY=void 0;W6._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var FLe=M(OE=>{"use strict";m();Object.defineProperty(OE,"__esModule",{value:!0});OE.generateRoute=OE.replaceCurrentStackRoute=OE.addNewStackLayer=void 0;var bBt=(He(),Me(tt)),wE=QLe(),IBt=e=>{Array.isArray(e[wE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,wE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[wE._LAYERS_STORE_PROPERTY].push("/");let t=e[wE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[wE._LAYERS_STORE_PROPERTY].length?e[wE._LAYERS_STORE_PROPERTY].pop():bBt.diag.warn("Connect: Trying to pop the stack multiple time")}};OE.addNewStackLayer=IBt;var CBt=(e,t)=>{t&&e[wE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};OE.replaceCurrentStackRoute=CBt;var vBt=e=>e[wE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);OE.generateRoute=vBt});var zLe=M(kE=>{"use strict";m();Object.defineProperty(kE,"__esModule",{value:!0});kE.ConnectInstrumentation=kE.ANONYMOUS_NAME=void 0;var RBt=(He(),Me(tt)),GLe=vr(),zR=zX(),jLe=ULe(),X6=un(),xBt=(Xn(),Me(Hr)),HX=FLe();kE.ANONYMOUS_NAME="anonymous";var $X=class extends X6.InstrumentationBase{constructor(t={}){super(jLe.PACKAGE_NAME,jLe.PACKAGE_VERSION,t)}init(){return[new X6.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,X6.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,X6.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=zR.ConnectTypes.REQUEST_HANDLER,i=zR.ConnectNames.REQUEST_HANDLER,o=t):(r=zR.ConnectTypes.MIDDLEWARE,i=zR.ConnectNames.MIDDLEWARE,o=n.name||kE.ANONYMOUS_NAME);let s=`${i} - ${o}`,u={attributes:{[xBt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[zR.AttributeNames.CONNECT_TYPE]:r,[zR.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,u)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,u,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[u],_=arguments[l];(0,HX.replaceCurrentStackRoute)(f,t);let y=(0,GLe.getRPCMetadata)(RBt.context.active());t&&y?.type===GLe.RPCType.HTTP&&(y.route=(0,HX.generateRoute)(f));let T="";t?T=`request handler - ${t}`:T=`middleware - ${n.name||kE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",T);let R=!1;function x(){R?r._diag.debug(`span ${v.name} - already finished`):(R=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",x)}return h.addListener("close",x),arguments[l]=r._patchNext(_,x),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],u=(0,HX.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,u)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};kE.ConnectInstrumentation=$X});var $Le=M(fp=>{"use strict";m();Object.defineProperty(fp,"__esModule",{value:!0});fp.ConnectTypes=fp.ConnectNames=fp.AttributeNames=fp.ANONYMOUS_NAME=fp.ConnectInstrumentation=void 0;var HLe=zLe();Object.defineProperty(fp,"ConnectInstrumentation",{enumerable:!0,get:function(){return HLe.ConnectInstrumentation}});Object.defineProperty(fp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return HLe.ANONYMOUS_NAME}});var qX=zX();Object.defineProperty(fp,"AttributeNames",{enumerable:!0,get:function(){return qX.AttributeNames}});Object.defineProperty(fp,"ConnectNames",{enumerable:!0,get:function(){return qX.ConnectNames}});Object.defineProperty(fp,"ConnectTypes",{enumerable:!0,get:function(){return qX.ConnectTypes}})});var qLe,VLe,YLe,DBt,KLe,JLe=w(()=>{m();qLe=ue($Le(),1);_r();VLe="Connect",YLe=ct(VLe,()=>new qLe.ConnectInstrumentation),DBt=(()=>({name:VLe,setupOnce(){YLe()}})),KLe=DBt});var ZLe=M(la=>{"use strict";m();Object.defineProperty(la,"__esModule",{value:!0});la.DB_SYSTEM_VALUE_MSSQL=la.ATTR_NET_PEER_PORT=la.ATTR_NET_PEER_NAME=la.ATTR_DB_USER=la.ATTR_DB_SYSTEM=la.ATTR_DB_STATEMENT=la.ATTR_DB_SQL_TABLE=la.ATTR_DB_NAME=void 0;la.ATTR_DB_NAME="db.name";la.ATTR_DB_SQL_TABLE="db.sql.table";la.ATTR_DB_STATEMENT="db.statement";la.ATTR_DB_SYSTEM="db.system";la.ATTR_DB_USER="db.user";la.ATTR_NET_PEER_NAME="net.peer.name";la.ATTR_NET_PEER_PORT="net.peer.port";la.DB_SYSTEM_VALUE_MSSQL="mssql"});var WLe=M(HR=>{"use strict";m();Object.defineProperty(HR,"__esModule",{value:!0});HR.once=HR.getSpanName=void 0;function NBt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}HR.getSpanName=NBt;var BBt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};HR.once=BBt});var XLe=M($R=>{"use strict";m();Object.defineProperty($R,"__esModule",{value:!0});$R.PACKAGE_NAME=$R.PACKAGE_VERSION=void 0;$R.PACKAGE_VERSION="0.33.0";$R.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var oUe=M(ME=>{"use strict";m();Object.defineProperty(ME,"__esModule",{value:!0});ME.TediousInstrumentation=ME.INJECTED_CTX=void 0;var qR=(He(),Me(tt)),wBt=Ue("events"),iA=un(),sT=(Xn(),Me(Hr)),PE=ZLe(),eUe=WLe(),tUe=XLe(),rUe=Symbol("opentelemetry.instrumentation-tedious.current-database");ME.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var nUe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function eG(e){Object.defineProperty(this,rUe,{value:e,writable:!0})}var VX=class e extends iA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(tUe.PACKAGE_NAME,tUe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,iA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,iA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new iA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of nUe)(0,iA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,iA.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 nUe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return eG.call(this,this.config?.options?.database),this.removeListener("databaseChange",eG),this.on("databaseChange",eG),this.once("end",()=>{this.removeListener("databaseChange",eG)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||qR.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,ME.INJECTED_CTX,{value:!0});let u=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,u,{length:u.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?.[ME.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof wBt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let u=0,l=0,f=()=>l++,h=()=>u++,_=this[rUe],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),T={};o._dbSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_DB_SYSTEM]=PE.DB_SYSTEM_VALUE_MSSQL,T[PE.ATTR_DB_NAME]=_,T[PE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,T[PE.ATTR_DB_STATEMENT]=y,T[PE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_DB_NAMESPACE]=_,T[sT.ATTR_DB_SYSTEM_NAME]=sT.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,T[sT.ATTR_DB_QUERY_TEXT]=y,T[sT.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_NET_PEER_NAME]=this.config?.server,T[PE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_SERVER_ADDRESS]=this.config?.server,T[sT.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,eUe.getSpanName)(t,_,y,s.table),{kind:qR.SpanKind.CLIENT,attributes:T}),R=(0,eUe.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",R),this.removeListener("end",R),v.setAttribute("tedious.procedure_count",u),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:qR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",R),this.on("end",R),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(R)):o._diag.error("Expected request.callback to be a function");let x=()=>qR.context.with(qR.trace.setSpan(qR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return x();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(x)}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)}}};ME.TediousInstrumentation=VX});var iUe=M(tG=>{"use strict";m();Object.defineProperty(tG,"__esModule",{value:!0});tG.TediousInstrumentation=void 0;var OBt=oUe();Object.defineProperty(tG,"TediousInstrumentation",{enumerable:!0,get:function(){return OBt.TediousInstrumentation}})});var sUe,kBt,aUe,uUe,PBt,cUe,lUe=w(()=>{m();sUe=ue(iUe(),1);At();_r();kBt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),aUe="Tedious",uUe=ct(aUe,()=>new sUe.TediousInstrumentation({})),PBt=(()=>{let e;return{name:aUe,setupOnce(){let t=uUe();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=kt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";kBt.has(i)&&n.setAttribute(Mt,"auto.db.otel.tedious")}))}}}),cUe=PBt});var dUe=M(VR=>{"use strict";m();Object.defineProperty(VR,"__esModule",{value:!0});VR.PACKAGE_NAME=VR.PACKAGE_VERSION=void 0;VR.PACKAGE_VERSION="0.57.0";VR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var fUe=M(nG=>{"use strict";m();Object.defineProperty(nG,"__esModule",{value:!0});nG.GenericPoolInstrumentation=void 0;var YR=(He(),Me(tt)),aT=un(),pUe=dUe(),YX="generic-pool",KX=class extends aT.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(pUe.PACKAGE_NAME,pUe.PACKAGE_VERSION,t)}init(){return[new aT.InstrumentationNodeModuleDefinition(YX,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,aT.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 aT.InstrumentationNodeModuleDefinition(YX,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,aT.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 aT.InstrumentationNodeModuleDefinition(YX,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,aT.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=YR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return YR.context.with(YR.trace.setSpan(i,s),()=>t.call(this,...o).then(u=>(s.end(),u),u=>{throw s.recordException(u),s.end(),u}))}}_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=YR.context.active(),u=n.tracer.startSpan("generic-pool.acquire",{},s);return YR.context.with(YR.trace.setSpan(s,u),()=>{t.call(this,(l,f)=>{if(u.end(),o)return o(l,f)},i)})}}};nG.GenericPoolInstrumentation=KX});var mUe=M(rG=>{"use strict";m();Object.defineProperty(rG,"__esModule",{value:!0});rG.GenericPoolInstrumentation=void 0;var MBt=fUe();Object.defineProperty(rG,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return MBt.GenericPoolInstrumentation}})});var AUe,gUe,hUe,LBt,_Ue,EUe=w(()=>{m();AUe=ue(mUe(),1);At();_r();gUe="GenericPool",hUe=ct(gUe,()=>new AUe.GenericPoolInstrumentation({})),LBt=(()=>{let e;return{name:gUe,setupOnce(){let t=hUe();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=kt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Mt,"auto.db.otel.generic_pool")}))}}}),_Ue=LBt});var JX=M(sA=>{"use strict";m();Object.defineProperty(sA,"__esModule",{value:!0});sA.ATTR_NET_PEER_PORT=sA.ATTR_NET_PEER_NAME=sA.ATTR_MESSAGING_SYSTEM=sA.ATTR_MESSAGING_OPERATION=void 0;sA.ATTR_MESSAGING_OPERATION="messaging.operation";sA.ATTR_MESSAGING_SYSTEM="messaging.system";sA.ATTR_NET_PEER_NAME="net.peer.name";sA.ATTR_NET_PEER_PORT="net.peer.port"});var ZX=M(yi=>{"use strict";m();Object.defineProperty(yi,"__esModule",{value:!0});yi.ATTR_MESSAGING_CONVERSATION_ID=yi.OLD_ATTR_MESSAGING_MESSAGE_ID=yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=yi.ATTR_MESSAGING_URL=yi.ATTR_MESSAGING_PROTOCOL_VERSION=yi.ATTR_MESSAGING_PROTOCOL=yi.MESSAGING_OPERATION_VALUE_PROCESS=yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=yi.ATTR_MESSAGING_DESTINATION_KIND=yi.ATTR_MESSAGING_DESTINATION=void 0;yi.ATTR_MESSAGING_DESTINATION="messaging.destination";yi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";yi.MESSAGING_OPERATION_VALUE_PROCESS="process";yi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";yi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";yi.ATTR_MESSAGING_URL="messaging.url";yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";yi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";yi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var WX=M(uT=>{"use strict";m();Object.defineProperty(uT,"__esModule",{value:!0});uT.DEFAULT_CONFIG=uT.EndOperation=void 0;var UBt;(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"})(UBt=uT.EndOperation||(uT.EndOperation={}));uT.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var bUe=M(Si=>{"use strict";m();Object.defineProperty(Si,"__esModule",{value:!0});Si.isConfirmChannelTracing=Si.unmarkConfirmChannelTracing=Si.markConfirmChannelTracing=Si.getConnectionAttributesFromUrl=Si.getConnectionAttributesFromServer=Si.normalizeExchange=Si.CONNECTION_ATTRIBUTES=Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Si.CHANNEL_SPANS_NOT_ENDED=Si.MESSAGE_STORED_SPAN=void 0;var XX=(He(),Me(tt)),LE=un(),oG=(Xn(),Me(Hr)),MO=JX(),iG=ZX();Si.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Si.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Si.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var eee=(0,XX.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),QBt=e=>e!==""?e:"<default>";Si.normalizeExchange=QBt;var FBt=e=>e.replace(/:[^:@/]*@/,":***@"),yUe=(e,t)=>e||(t==="AMQP"?5672:5671),SUe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},TUe=e=>e||"localhost",aA=(e,t,n,r)=>n?{[t]:n}:(XX.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),GBt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[MO.ATTR_MESSAGING_SYSTEM]:t}:{}};Si.getConnectionAttributesFromServer=GBt;var jBt=(e,t)=>{let n={[iG.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=SUe(r?.protocol);Object.assign(n,{...aA(e,iG.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=TUe(r?.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(e,MO.ATTR_NET_PEER_NAME,i,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(e,oG.ATTR_SERVER_ADDRESS,i,"hostname")});let s=yUe(r.port,o);t&LE.SemconvStability.OLD&&Object.assign(n,aA(e,MO.ATTR_NET_PEER_PORT,s,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(e,oG.ATTR_SERVER_PORT,s,"port"))}else{let r=FBt(e);n[iG.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=SUe(o.protocol);Object.assign(n,{...aA(r,iG.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=TUe(o.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(r,MO.ATTR_NET_PEER_NAME,s,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(r,oG.ATTR_SERVER_ADDRESS,s,"hostname")});let u=yUe(o.port?parseInt(o.port):void 0,i);t&LE.SemconvStability.OLD&&Object.assign(n,aA(r,MO.ATTR_NET_PEER_PORT,u,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(r,oG.ATTR_SERVER_PORT,u,"port"))}catch(o){XX.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Si.getConnectionAttributesFromUrl=jBt;var zBt=e=>e.setValue(eee,!0);Si.markConfirmChannelTracing=zBt;var HBt=e=>e.deleteValue(eee);Si.unmarkConfirmChannelTracing=HBt;var $Bt=e=>e.getValue(eee)===!0;Si.isConfirmChannelTracing=$Bt});var IUe=M(KR=>{"use strict";m();Object.defineProperty(KR,"__esModule",{value:!0});KR.PACKAGE_NAME=KR.PACKAGE_VERSION=void 0;KR.PACKAGE_VERSION="0.61.0";KR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var vUe=M(uG=>{"use strict";m();Object.defineProperty(uG,"__esModule",{value:!0});uG.AmqplibInstrumentation=void 0;var ri=(He(),Me(tt)),sG=vr(),xr=un(),qBt=JX(),td=ZX(),oc=WX(),Ti=bUe(),CUe=IUe(),aG=[">=0.5.5 <1"],tee=class extends xr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(CUe.PACKAGE_NAME,CUe.PACKAGE_VERSION,{...oc.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...oc.DEFAULT_CONFIG,...t})}init(){let t=new xr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",aG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new xr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",aG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new xr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",aG,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new xr.InstrumentationNodeModuleDefinition("amqplib",aG,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,xr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,xr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,xr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,oc.EndOperation.Ack)),(0,xr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,oc.EndOperation.Nack)),(0,xr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,oc.EndOperation.Reject)),(0,xr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,oc.EndOperation.AckAll)),(0,xr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,oc.EndOperation.NackAll)),(0,xr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,xr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,xr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,xr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,xr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,xr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,xr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,xr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,xr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,xr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,xr.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(u,l){if(u==null){let f=(0,Ti.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,Ti.getConnectionAttributesFromServer)(l);l[Ti.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelClosed,void 0);let i=this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,oc.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,u,l){let f=this,h=n===oc.EndOperation.Reject?u:l,_=f[Ti.CHANNEL_SPANS_NOT_ENDED]??[],y=_.findIndex(T=>T.msg===s);if(y<0)o.endConsumerSpan(s,t,n,h);else if(n!==oc.EndOperation.Reject&&u){for(let T=0;T<=y;T++)o.endConsumerSpan(_[T].msg,t,n,h);_.splice(0,y+1)}else o.endConsumerSpan(s,t,n,h),_.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,u){let l=this;if(!Object.prototype.hasOwnProperty.call(l,Ti.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let _=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);_.unref(),l[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=_}l[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let _=h.properties.headers??{},y=ri.propagation.extract(ri.ROOT_CONTEXT,_),T=h.fields?.exchange,v;if(r._config.useLinksForConsume){let P=y?ri.trace.getSpan(y)?.spanContext():void 0;y=void 0,P&&(v=[{context:P}])}let R=r.tracer.startSpan(`${i} process`,{kind:ri.SpanKind.CONSUMER,attributes:{...l?.connection?.[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:T,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[qBt.ATTR_MESSAGING_OPERATION]:td.MESSAGING_OPERATION_VALUE_PROCESS,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:x}=r.getConfig();x&&(0,xr.safeExecuteInTheMiddle)(()=>x(R,{moduleVersion:t,msg:h}),P=>{P&&ri.diag.error("amqplib instrumentation: consumerHook error",P)},!0),u?.noAck||(l[Ti.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,sG.hrTime)()}),h[Ti.MESSAGE_STORED_SPAN]=R);let O=y||ri.ROOT_CONTEXT;ri.context.with(ri.trace.setSpan(O,R),()=>{s.call(this,h)}),u?.noAck&&(r.callConsumeEndHook(R,h,!1,oc.EndOperation.AutoAck),R.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,u,l,f){let h=this,{span:_,modifiedOptions:y}=r.createPublishSpan(r,i,s,h,l),{publishHook:T}=r.getConfig();T&&(0,xr.safeExecuteInTheMiddle)(()=>T(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:y,isConfirmChannel:!0}),O=>{O&&ri.diag.error("amqplib instrumentation: publishHook error",O)},!0);let v=function(O,P){try{f?.call(this,O,P)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,xr.safeExecuteInTheMiddle)(()=>j(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:l,isConfirmChannel:!0,confirmError:O}),G=>{G&&ri.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),O&&_.setStatus({code:ri.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),_.end()}},R=(0,Ti.markConfirmChannelTracing)(ri.context.active()),x=[...arguments];return x[3]=y,x[4]=ri.context.bind((0,Ti.unmarkConfirmChannelTracing)(ri.trace.setSpan(R,_)),v),ri.context.with(R,n.bind(this,...x))}}getPublishPatch(t,n){let r=this;return function(i,s,u,l){if((0,Ti.isConfirmChannelTracing)(ri.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:_}=r.createPublishSpan(r,i,s,f,l),{publishHook:y}=r.getConfig();y&&(0,xr.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:_,isConfirmChannel:!1}),R=>{R&&ri.diag.error("amqplib instrumentation: publishHook error",R)},!0);let T=[...arguments];T[3]=_;let v=n.apply(this,T);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,Ti.normalizeExchange)(n),u=t.tracer.startSpan(`publish ${s}`,{kind:ri.SpanKind.PRODUCER,attributes:{...o.connection[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:n,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},ri.propagation.inject(ri.trace.setSpan(ri.context.active(),u),l.headers),{span:u,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[Ti.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:ri.SpanStatusCode.ERROR,message:r!==oc.EndOperation.ChannelClosed&&r!==oc.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[Ti.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[Ti.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,xr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&ri.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,sG.hrTime)(),r=t[Ti.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],u=(0,sG.hrTimeDuration)(s.timeOfConsume,n);if((0,sG.hrTimeToMilliseconds)(u)<i)break;this.endConsumerSpan(s.msg,null,oc.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};uG.AmqplibInstrumentation=tee});var xUe=M(UE=>{"use strict";m();Object.defineProperty(UE,"__esModule",{value:!0});UE.EndOperation=UE.DEFAULT_CONFIG=UE.AmqplibInstrumentation=void 0;var VBt=vUe();Object.defineProperty(UE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return VBt.AmqplibInstrumentation}});var RUe=WX();Object.defineProperty(UE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return RUe.DEFAULT_CONFIG}});Object.defineProperty(UE,"EndOperation",{enumerable:!0,get:function(){return RUe.EndOperation}})});var DUe,NUe,YBt,BUe,KBt,wUe,OUe=w(()=>{m();DUe=ue(xUe(),1);_r();NUe="Amqplib",YBt={consumeEndHook:e=>{qr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{qr(e,"auto.amqplib.otel.publisher")}},BUe=ct(NUe,()=>new DUe.AmqplibInstrumentation(YBt)),KBt=(()=>({name:NUe,setupOnce(){BUe()}})),wUe=KBt});var LO,nee=w(()=>{m();LO="VercelAI"});function ZBt(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 WBt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(XBt(t.content),ewt(t.content))}function XBt(e){for(let t of e){if(!ZBt(t))continue;let n=wK(t.toolCallId);n?zl(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"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):zl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function ewt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&OK(t.toolCallId)}function twt(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 lG,JBt,kUe,cG,PUe=w(()=>{m();lG=ue(un(),1);At();nee();JBt=[">=3.0.0 <7"],kUe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];cG=class e extends lG.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",er,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new lG.InstrumentationNodeModuleDefinition("ai",JBt,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 u=s[0].experimental_telemetry||{},l=u.isEnabled,f=Et(),h=f?.getIntegrationByName(LO),_=h?.options,y=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:T,recordOutputs:v}=twt(_,u,l,y);return s[0].experimental_telemetry={...u,isEnabled:l!==void 0?l:!0,recordInputs:T,recordOutputs:v},If(()=>Reflect.apply(o,i,s),R=>{R&&typeof R=="object"&&ns(R,"_sentry_active_span",Hc())},()=>{},R=>{WBt(R)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of kUe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=kUe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function nwt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var MUe,rwt,LUe,UUe=w(()=>{m();At();_r();nee();PUe();MUe=ct(LO,()=>new cG({}));rwt=((e={})=>{let t;return{name:LO,options:e,setupOnce(){t=MUe()},afterAllSetup(n){e.force??nwt(n)?AF(n):t?.callWhenPatched(()=>AF(n))}}}),LUe=rwt});var pG,owt,dG,QUe=w(()=>{m();pG=ue(un(),1);At();owt=[">=4.0.0 <7"],dG=class extends pG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",er,t)}init(){return new pG.InstrumentationNodeModuleDefinition("openai",owt,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(BS(uE))return Reflect.construct(r,s);let u=Reflect.construct(r,s);return _F(u,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 u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}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 FUe,iwt,GUe,jUe=w(()=>{m();At();_r();QUe();FUe=ct(uE,e=>new dG(e)),iwt=((e={})=>({name:uE,setupOnce(){FUe(e)}})),GUe=iwt});var mG,swt,fG,zUe=w(()=>{m();mG=ue(un(),1);At();swt=[">=0.19.2 <1.0.0"],fG=class extends mG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",er,t)}init(){return new mG.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",swt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(BS(cE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return EF(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 HUe,awt,$Ue,qUe=w(()=>{m();At();_r();zUe();HUe=ct(cE,e=>new fG(e)),awt=((e={})=>({name:cE,options:e,setupOnce(){HUe(e)}})),$Ue=awt});var JR,VUe,AG,YUe=w(()=>{m();JR=ue(un(),1);At();VUe=[">=0.10.0 <2"],AG=class extends JR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",er,t)}init(){return new JR.InstrumentationNodeModuleDefinition("@google/genai",VUe,n=>this._patch(n),n=>n,[new JR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",VUe,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(BS(lE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return yF(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 gw(t,"GoogleGenAI",o),t}}});var KUe,uwt,JUe,ZUe=w(()=>{m();At();_r();YUe();KUe=ct(lE,e=>new AG(e)),uwt=((e={})=>({name:lE,setupOnce(){KUe(e)}})),JUe=uwt});function cwt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function lwt(e,t,n){return new Proxy(e,{apply(r,o,i){let u=i[1];(!u||typeof u!="object"||Array.isArray(u))&&(u={},i[1]=u);let l=u.callbacks,f=cwt(l,t);return u.callbacks=f,Reflect.apply(r,o,i)}})}var QE,gG,hG,WUe=w(()=>{m();QE=ue(un(),1);At();gG=[">=0.1.0 <2.0.0"];hG=class extends QE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",er,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 QE.InstrumentationNodeModuleDefinition(r,gG,this._patch.bind(this),o=>o,[new QE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,gG,this._patch.bind(this),o=>o)]));return t.push(new QE.InstrumentationNodeModuleDefinition("langchain",gG,this._patch.bind(this),r=>r,[new QE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",gG,this._patch.bind(this),r=>r)])),t}_patch(t){KY([uE,cE,lE]);let n=IF(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 u=["invoke","stream","batch"];for(let l of u){let f=s[l];typeof f=="function"&&(s[l]=lwt(f,n))}}}});var XUe,dwt,eQe,tQe=w(()=>{m();At();_r();WUe();XUe=ct(SF,e=>new hG(e)),dwt=((e={})=>({name:SF,setupOnce(){XUe(e)}})),eQe=dwt});var ZR,nQe,_G,rQe=w(()=>{m();ZR=ue(un(),1);At();nQe=[">=0.0.0 <2.0.0"],_G=class extends ZR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",er,t)}init(){return new ZR.InstrumentationNodeModuleDefinition("@langchain/langgraph",nQe,this._patch.bind(this),n=>n,[new ZR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",nQe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&vF(t.StateGraph.prototype,this.getConfig()),t}}});var oQe,pwt,iQe,sQe=w(()=>{m();At();_r();rQe();oQe=ct(CF,e=>new _G(e)),pwt=((e={})=>({name:CF,setupOnce(){oQe(e)}})),iQe=pwt});import*as uQe from"node:net";function cQe(e,t,n,r,o){let s=()=>{},u=o.firestoreSpanCreationHook;typeof u=="function"&&(s=h=>{(0,th.safeExecuteInTheMiddle)(()=>u(h),_=>{_&&Fl.error(_?.message)},!0)});let l=new th.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>aQe(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 th.InstrumentationNodeModuleFile(h,t,_=>aQe(_,n,r,e,s),_=>lQe(_,r)));return l}function aQe(e,t,n,r,o){return lQe(e,n),t(e,"addDoc",fwt(r,o)),t(e,"getDocs",Awt(r,o)),t(e,"setDoc",gwt(r,o)),t(e,"deleteDoc",mwt(r,o)),e}function lQe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,th.isWrapped)(e[n])&&t(e,n);return e}function fwt(e,t){return function(r){return function(o,i){let s=yG(e,"addDoc",o);return t(s),EG(s,()=>r(o,i))}}}function mwt(e,t){return function(r){return function(o){let i=yG(e,"deleteDoc",o.parent||o);return t(i),EG(i,()=>r(o))}}}function Awt(e,t){return function(r){return function(o){let i=yG(e,"getDocs",o);return t(i),EG(i,()=>r(o))}}}function gwt(e,t){return function(r){return function(o,i,s){let u=yG(e,"setDoc",o.parent||o);return t(u),EG(u,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function EG(e,t){return We.with(Vt.setSpan(We.active(),e),()=>(0,th.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function yG(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:fo.CLIENT});return _wt(r,n),r.setAttribute(LC,t),r}function hwt(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(uQe.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 _wt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[EV]:t.path,[yV]:n.name,[fS]:"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:u,port:l}=hwt(i);u&&(s[xV]=u),l&&(s[DV]=l),e.setAttributes(s)}var th,dQe=w(()=>{m();He();th=ue(un(),1);Xn()});function pQe(e,t,n,r,o){let i=()=>{},s=()=>{},u=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(y,T)=>{(0,nh.safeExecuteInTheMiddle)(()=>f(y,T),v=>{v&&Fl.error(v?.message)},!0)}),typeof l=="function"&&(i=y=>{(0,nh.safeExecuteInTheMiddle)(()=>l(y),T=>{T&&Fl.error(T?.message)},!0)});let h=new nh.InstrumentationNodeModuleDefinition("firebase-functions",t);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:y,triggerType:T})=>{h.files.push(new nh.InstrumentationNodeModuleFile(y,t,v=>Ewt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:u},T),v=>fQe(v,r)))}),h}function ic(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],u=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",_=e.startSpan(`firebase.function.${n}`,{kind:fo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),_.setAttributes(y),t?.requestHook?.(_),We.with(Vt.setSpan(We.active(),_),async()=>{let T,v;try{v=await s.apply(this,f)}catch(R){T=R}if(t?.responseHook?.(_,T),T&&_.recordException(T),_.end(),T)throw await t?.errorHook?.(_,T),T;return v})};return u?o.call(this,u,l):o.call(this,l)}}}function Ewt(e,t,n,r,o,i){switch(fQe(e,n),i){case"function":t(e,"onRequest",ic(r,o,"http.request")),t(e,"onCall",ic(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",ic(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",ic(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",ic(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",ic(r,o,"storage.object.finalized")),t(e,"onObjectArchived",ic(r,o,"storage.object.archived")),t(e,"onObjectDeleted",ic(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",ic(r,o,"storage.object.metadataUpdated"));break}return e}function fQe(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,nh.isWrapped)(e[r])&&t(e,r);return e}var nh,mQe=w(()=>{m();He();nh=ue(un(),1)});var gQe,AQe,ywt,Swt,SG,hQe=w(()=>{m();gQe=ue(un(),1);At();dQe();mQe();AQe={},ywt=[">=3.0.0 <5"],Swt=[">=6.0.0 <7"],SG=class extends gQe.InstrumentationBase{constructor(t=AQe){super("@sentry/instrumentation-firebase",er,t)}setConfig(t={}){super.setConfig({...AQe,...t})}init(){let t=[];return t.push(cQe(this.tracer,ywt,this._wrap,this._unwrap,this.getConfig())),t.push(pQe(this.tracer,Swt,this._wrap,this._unwrap,this.getConfig())),t}}});var _Qe,Twt,EQe,bwt,yQe,SQe=w(()=>{m();At();_r();hQe();_Qe="Firebase",Twt={firestoreSpanCreationHook:e=>{qr(e,"auto.firebase.otel.firestore"),e.setAttribute(Xt,"db.query")},functions:{requestHook:e=>{qr(e,"auto.firebase.otel.functions"),e.setAttribute(Xt,"http.request")},errorHook:async(e,t)=>{t&&(rn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Sv(2e3))}}},EQe=ct(_Qe,()=>new SG(Twt)),bwt=(()=>({name:_Qe,setupOnce(){EQe()}})),yQe=bwt});function TQe(){return[Cwe(),ike(),wke(),yLe(),EPe(),kPe(),qPe(),oMe(),MMe(),r2e(),tLe(),ALe(),MLe(),KLe(),cUe(),_Ue(),Kke(),wUe(),sPe(),eQe(),iQe(),LUe(),GUe(),$Ue(),JUe(),a2e(),yQe()]}var bQe=w(()=>{m();OUe();qUe();JLe();vwe();uke();SQe();EUe();ZUe();kke();gLe();SLe();Jke();LLe();tQe();sQe();aPe();yPe();PPe();VPe();iMe();jUe();o2e();u2e();nLe();LMe();lUe();UUe()});function CQe(e,t={}){e.getOptions().debug&&lZ();let[n,r]=Iwt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function Iwt(e,t={}){let n=new IQe.BasicTracerProvider({sampler:new w4(e),resource:(0,TG.defaultResource)().merge((0,TG.resourceFromAttributes)({[NV]:"node",[_V]:"sentry",[BV]:er})),forceFlushTimeoutMillis:500,spanProcessors:[new B4({timeout:Cwt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Vt.setGlobalTracerProvider(n),mf.setGlobalPropagator(new N4);let r=new k4;return We.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function Cwt(e){if(e!=null){if(e>ree)return Ds&&W.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ree}`),ree;if(e<=0||Number.isNaN(e)){Ds&&W.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var TG,IQe,ree,vQe=w(()=>{m();He();TG=ue(bJ(),1),IQe=ue(KJ(),1);Xn();At();_r();Xv();YS();ree=1e6});function RQe(){return G4().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(twe(),lwe())}function xQe(e){return[...RQe(),...Mi(e)?TQe():[]]}function oee(e={}){return vwt(e,xQe)}function vwt(e={},t){wS(e,"node");let n=MZ({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(CQe(n,{spanProcessors:e.openTelemetrySpanProcessors}),j4()),n}var DQe=w(()=>{m();At();_r();nwe();dwe();bQe();vQe()});var WR=w(()=>{m();DQe();At();_r()});function to(){return Rwt}function hu(){return NQe}function BQe(){return xwt}var Rwt,NQe,xwt,sc=w(()=>{"use strict";m();Rwt="prod",NQe="0.1.195",xwt=`@loredotlink/cli/${NQe}`});function Owt(e=""){if(!Bwt.test(e))return e!==e.toLowerCase()}function wQe(e,t){let n=t??wwt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let u of e){let l=n.includes(u);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Owt(u);if(s===!1){if(i===!1&&f===!0){r.push(o),o=u,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+u,i=f;continue}}o+=u,i=f,s=l}return r.push(o),r}function kwt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Pwt(e){return e?e[0].toLowerCase()+e.slice(1):""}function Mwt(e,t){return e?(Array.isArray(e)?e:wQe(e)).map(n=>kwt(t?.normalize?n.toLowerCase():n)).join(""):""}function QO(e,t){return Pwt(Mwt(e||"",t))}function bG(e,t){return e?(Array.isArray(e)?e:wQe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function OQe(e){return bG(e||"","_")}var Bwt,wwt,kQe=w(()=>{m();Bwt=/\d/,wwt=["-","_","/","."]});import{parseArgs as Lwt}from"node:util";function RG(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function iee(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 nd(e){return typeof e=="function"?e():e}function Uwt(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),o=t.alias||{},i=t.default||{},s=new Map,u=new Map;for(let[x,O]of Object.entries(o)){let P=O;for(let j of P)s.set(x,j),u.has(j)||u.set(j,[]),u.get(j).push(x),s.set(j,x),u.has(x)||u.set(x,[]),u.get(x).push(j)}let l={};function f(x){if(n.has(x))return"boolean";let O=u.get(x)||[];for(let P of O)if(n.has(P))return"boolean";return"string"}function h(x){if(r.has(x))return!0;let O=u.get(x)||[];for(let P of O)if(r.has(P))return!0;return!1}let _=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(i)]);for(let x of _)l[x]||(l[x]={type:f(x),default:i[x]});for(let[x,O]of s.entries())x.length===1&&l[O]&&!l[O].short&&(l[O].short=x);let y=[],T={};for(let x=0;x<e.length;x++){let O=e[x];if(O==="--"){y.push(...e.slice(x));break}if(O.startsWith("--no-")){let P=O.slice(5);T[P]=!0;continue}y.push(O)}let v;try{v=Lwt({args:y,options:Object.keys(l).length>0?l:void 0,allowPositionals:!0,strict:!1})}catch{v={values:{},positionals:y}}let R={_:[]};R._=v.positionals;for(let[x,O]of Object.entries(v.values)){let P=O;f(x)==="boolean"&&typeof O=="string"?P=O!=="false":h(x)&&typeof O=="boolean"&&(P=""),R[x]=P}for(let[x]of Object.entries(T)){R[x]=!1;let O=s.get(x);O&&(R[O]=!1);let P=u.get(x);if(P)for(let j of P)R[j]=!1}for(let[x,O]of s.entries())R[x]!==void 0&&R[O]===void 0&&(R[O]=R[x]),R[O]!==void 0&&R[x]===void 0&&(R[x]=R[O]),R[x]!==R[O]&&i[O]===R[O]&&(R[O]=R[x]);return R}function Fwt(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=LQe(t);for(let u of r){if(u.type==="positional")continue;u.type==="string"||u.type==="enum"?n.string.push(u.name):u.type==="boolean"&&n.boolean.push(u.name),u.default!==void 0&&(n.default[u.name]=u.default),u.alias&&(n.alias[u.name]=u.alias);let l=QO(u.name),f=bG(u.name);if(l!==u.name||f!==u.name){let h=RG(n.alias[u.name]||[]);l!==u.name&&!h.includes(l)&&h.push(l),f!==u.name&&!h.includes(f)&&h.push(f),h.length>0&&(n.alias[u.name]=h)}}let o=Uwt(e,n),[...i]=o._,s=new Proxy(o,{get(u,l){return u[l]??u[QO(l)]??u[bG(l)]}});for(let[,u]of r.entries())if(u.type==="positional"){let l=i.shift();if(l!==void 0)s[u.name]=l;else{if(u.default===void 0&&u.required!==!1)throw new cT(`Missing required positional argument: ${u.name.toUpperCase()}`,"EARG");s[u.name]=u.default}}else if(u.type==="enum"){let l=s[u.name],f=u.options||[];if(l!==void 0&&f.length>0&&!f.includes(l))throw new cT(`Invalid value for argument: ${Bf(`--${u.name}`)} (${Bf(l)}). Expected one of: ${f.map(h=>Bf(h)).join(", ")}.`,"EARG")}else if(u.required&&s[u.name]===void 0)throw new cT(`Missing required argument: --${u.name}`,"EARG");return s}function LQe(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:RG(r.alias)});return t}async function Gwt(e){return Promise.all(e.map(t=>nd(t)))}async function lT(e,t){let n=await nd(e.args||{}),r=Fwt(t.rawArgs,n),o={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},i=await Gwt(e.plugins??[]),s,u;try{for(let h of i)await h.setup?.(o);typeof e.setup=="function"&&await e.setup(o);let f=await nd(e.subCommands);if(f&&Object.keys(f).length>0){let h=jwt(t.rawArgs,n),_=t.rawArgs[h];if(_){let y=await PQe(f,_);if(!y)throw new cT(`Unknown command ${Bf(_)}`,"E_UNKNOWN_COMMAND");await lT(y,{rawArgs:t.rawArgs.slice(h+1)})}else{let y=await nd(e.default);if(y){if(e.run)throw new cT("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let T=await PQe(f,y);if(!T)throw new cT(`Default sub command ${Bf(y)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await lT(T,{rawArgs:t.rawArgs})}else if(!e.run)throw new cT("No command specified.","E_NO_COMMAND")}}typeof e.run=="function"&&(s=await e.run(o))}catch(f){u=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(u)throw u;if(l.length===1)throw l[0];if(l.length>1)throw new Error("Multiple cleanup errors",{cause:l});return{result:s}}async function PQe(e,t){if(t in e)return nd(e[t]);for(let n of Object.values(e)){let r=await nd(n),o=await nd(r?.meta);if(o?.alias&&RG(o.alias).includes(t))return r}}function jwt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&zwt(r,t)&&n++;continue}return n}return-1}function zwt(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 aee(e,t){let n=await nd(e.meta||{}),r=LQe(await nd(e.args||{})),o=await nd(t?.meta||{}),i=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),s=[],u=[],l=[],f=[];for(let T of r)if(T.type==="positional"){let v=T.name.toUpperCase(),R=T.required!==!1&&T.default===void 0;u.push([Bf(v+see(T)),MQe(T,R)]),f.push(R?`<${v}>`:`[${v}]`)}else{let v=T.required===!0&&T.default===void 0,R=[...(T.alias||[]).map(x=>`-${x}`),`--${T.name}`].join(", ")+see(T);if(s.push([Bf(R),MQe(T,v)]),T.type==="boolean"&&(T.default===!0||T.negativeDescription)&&!Hwt.test(T.name)){let x=[...(T.alias||[]).map(O=>`--no-${O}`),`--no-${T.name}`].join(", ");s.push([Bf(x),[T.negativeDescription,v?vG("(Required)"):""].filter(Boolean).join(" ")])}v&&f.push(`--${T.name}`+see(T))}if(e.subCommands){let T=[],v=await nd(e.subCommands);for(let[R,x]of Object.entries(v)){let O=await nd((await nd(x))?.meta);if(O?.hidden)continue;let P=RG(O?.alias),j=[R,...P].join(", ");l.push([Bf(j),O?.description||""]),T.push(R,...P)}f.push(T.join("|"))}let h=[],_=n.version||o.version;h.push(vG(`${n.description} (${i+(_?` v${_}`:"")})`),"");let y=s.length>0||u.length>0;return h.push(`${CG(IG("USAGE"))} ${Bf(`${i}${y?" [OPTIONS]":""} ${f.join(" ")}`)}`,""),u.length>0&&(h.push(CG(IG("ARGUMENTS")),""),h.push(iee(u," ")),h.push("")),s.length>0&&(h.push(CG(IG("OPTIONS")),""),h.push(iee(s," ")),h.push("")),l.length>0&&(h.push(CG(IG("COMMANDS")),""),h.push(iee(l," ")),h.push("",`Use ${Bf(`${i} <command> --help`)} for more information about a command.`)),h.filter(T=>typeof T=="string").join(`
40
40
  `)}function see(e){let t=e.valueHint?`=<${e.valueHint}>`:"",n=t||`=<${OQe(e.name)}>`;return!e.type||e.type==="positional"||e.type==="boolean"?t:e.type==="enum"&&e.options?.length?`=<${e.options.join("|")}>`:n}function MQe(e,t){let n=t?vG("(Required)"):"",r=e.default===void 0?"":vG(`(Default: ${e.default})`);return[e.description,n,r].filter(Boolean).join(" ")}var cT,Qwt,xG,IG,Bf,vG,CG,Hwt,uee=w(()=>{m();kQe();cT=class extends Error{code;constructor(e,t){super(e),this.name="CLIError",this.code=t}};Qwt=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||e.TEST||e.CI})(),xG=(e,t=39)=>n=>Qwt?n:`\x1B[${e}m${n}\x1B[${t}m`,IG=xG(1,22),Bf=xG(36),vG=xG(90),CG=xG(4,24);Hwt=/^no[-A-Z]/});var cee,UQe,$wt,QQe,OLn,lee=w(()=>{"use strict";m();cee=["free","creator","team"],UQe=typeof process<"u"&&process.env?.NODE_ENV!=="production",$wt={stripe:{plans:[{tier:"free",subjectType:"user",name:"Free",description:"Share any thread from Claude Code, Codex, or Cowork. Share with friends or keep private. Share skills with your team instantly.",price:0,priceId:null,features:[{name:"Share threads from Claude Code, Codex, and Cowork"},{name:"Share with friends or keep private"},{name:"Skills tab \u2014 tool usage across every thread"},{name:"Share skills with your team instantly"}],entitlements:{workspaceScope:!1,review:!1,sharedThreadTtlDays:3}},{tier:"creator",subjectType:"user",name:"Creator",description:"For builders who share a lot. Permanent share links that never expire.",price:29,isFeatured:!0,priceId:UQe?"price_1TP9BSKwvRM43sh64waIrvjj":"price_1TPA2gKwvRM43sh6Kp4ZCpJZ",features:[{name:"Everything in Free"},{name:"Shared threads live forever"}],entitlements:{workspaceScope:!1,review:!1,sharedThreadTtlDays:null}},{tier:"team",subjectType:"organization",name:"Team",description:"GitHub for Prompts. Org-wide thread sharing plus the review surface.",price:19,minSeats:2,priceId:UQe?"price_1TP9MpKwvRM43sh6TBIFxVCd":"price_1TPA3CKwvRM43sh6k0bgPTsQ",features:[{name:"Everything in Creator"},{name:"Workspace-wide thread sharing"},{name:"Minimum 2 seats"},{name:"Review feature (beta)"}],entitlements:{workspaceScope:!0,review:!0,sharedThreadTtlDays:null}}]}},QQe=$wt.stripe.plans,OLn=Object.freeze(Object.fromEntries(QQe.map(e=>[e.tier,e])))});var FQe=w(()=>{"use strict";m();lee();lee()});function Vwt(e){HQe=e}function NG(){return HQe}function lt(e,t){let n=BG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,NG(),FO].filter(r=>!!r)});e.common.issues.push(n)}function xn(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,u)=>s.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:o}}function oOt(e,t){return!!((t==="v4"||!t)&&tOt.test(e)||(t==="v6"||!t)&&nOt.test(e))}function iOt(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 XR(e){if(e instanceof yu){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=wf.create(XR(r))}return new yu({...e._def,shape:()=>t})}else return e instanceof oh?new oh({...e._def,type:XR(e.element)}):e instanceof wf?wf.create(XR(e.unwrap())):e instanceof ih?ih.create(XR(e.unwrap())):e instanceof uA?uA.create(e.items.map(t=>XR(t))):e}function gee(e,t){let n=FE(e),r=FE(t);if(e===t)return{valid:!0,data:e};if(n===at.object&&r===at.object){let o=Tr.objectKeys(t),i=Tr.objectKeys(e).filter(u=>o.indexOf(u)!==-1),s={...e,...t};for(let u of i){let l=gee(e[u],t[u]);if(!l.valid)return{valid:!1};s[u]=l.data}return{valid:!0,data:s}}else if(n===at.array&&r===at.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],u=t[i],l=gee(s,u);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===at.date&&r===at.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function qQe(e,t){return new ST({values:e,typeName:Jt.ZodEnum,...xn(t)})}var Tr,fee,at,FE,Ye,qwt,el,FO,HQe,BG,Ywt,Eu,En,$Qe,ac,mee,Aee,GO,wG,Qt,Ap,GQe,Dn,Kwt,Jwt,Zwt,Wwt,Xwt,eOt,tOt,nOt,rOt,GE,dT,pT,fT,mT,ex,AT,gT,jE,rh,Of,tx,oh,yu,hT,DG,OG,_T,uA,kG,nx,rx,PG,ET,yT,ST,TT,zE,rd,wf,ih,bT,ox,ix,sOt,MG,jO,sx,VQe,aOt,Jt,uOt,YQe,KQe,cOt,lOt,JQe,dOt,pOt,fOt,mOt,AOt,gOt,hOt,_Ot,EOt,yOt,SOt,TOt,bOt,IOt,COt,vOt,ROt,xOt,DOt,NOt,BOt,wOt,OOt,kOt,jQe,POt,MOt,LOt,UOt,QOt,FOt,GOt,jOt,zOt,_u,HOt,dee,$Ot,mp,hee,YLn,KLn,JLn,ZQe,qOt,VOt,YOt,KOt,WQe,XQe,eFe,pee,Su,JOt,ZOt,WOt,XOt,_ee,Eee,yee,ekt,zQe,tkt,nkt,rkt,okt,See,cA=w(()=>{m();(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(u=>typeof o[o[u]]!="number"),s={};for(let u of i)s[u]=o[u];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})(Tr||(Tr={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fee||(fee={}));at=Tr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),FE=e=>{switch(typeof e){case"undefined":return at.undefined;case"string":return at.string;case"number":return isNaN(e)?at.nan:at.number;case"boolean":return at.boolean;case"function":return at.function;case"bigint":return at.bigint;case"symbol":return at.symbol;case"object":return Array.isArray(e)?at.array:e===null?at.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?at.promise:typeof Map<"u"&&e instanceof Map?at.map:typeof Set<"u"&&e instanceof Set?at.set:typeof Date<"u"&&e instanceof Date?at.date:at.object;default:return at.unknown}},Ye=Tr.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"]),qwt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),el=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 u=r,l=0;for(;l<s.path.length;){let f=s.path[l];l===s.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(s))):u[f]=u[f]||{_errors:[]},u=u[f],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tr.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()}};el.create=e=>new el(e);FO=(e,t)=>{let n;switch(e.code){case Ye.invalid_type:e.received===at.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ye.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Tr.jsonStringifyReplacer)}`;break;case Ye.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tr.joinValues(e.keys,", ")}`;break;case Ye.invalid_union:n="Invalid input";break;case Ye.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tr.joinValues(e.options)}`;break;case Ye.invalid_enum_value:n=`Invalid enum value. Expected ${Tr.joinValues(e.options)}, received '${e.received}'`;break;case Ye.invalid_arguments:n="Invalid function arguments";break;case Ye.invalid_return_type:n="Invalid function return type";break;case Ye.invalid_date:n="Invalid date";break;case Ye.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}"`:Tr.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ye.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 Ye.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 Ye.custom:n="Invalid input";break;case Ye.invalid_intersection_types:n="Intersection results could not be merged";break;case Ye.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ye.not_finite:n="Number must be finite";break;default:n=t.defaultError,Tr.assertNever(e)}return{message:n}},HQe=FO;BG=e=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i},u="",l=r.filter(f=>!!f).slice().reverse();for(let f of l)u=f(s,{data:t,defaultError:u}).message;return{...o,path:i,message:o.message||u}},Ywt=[];Eu=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 En;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 En;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}}},En=Object.freeze({status:"aborted"}),$Qe=e=>({status:"dirty",value:e}),ac=e=>({status:"valid",value:e}),mee=e=>e.status==="aborted",Aee=e=>e.status==="dirty",GO=e=>e.status==="valid",wG=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})(Qt||(Qt={}));Ap=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}},GQe=(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 el(e.common.issues);return this._error=n,this._error}}};Dn=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 FE(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:FE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Eu,ctx:{common:t.parent.common,data:t.data,parsedType:FE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(wG(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:FE(t)},i=this._parseSync({data:t,path:o.path,parent:o});return GQe(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:FE(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(wG(o)?o:Promise.resolve(o));return GQe(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),u=()=>i.addIssue({code:Ye.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(u(),!1)):s?!0:(u(),!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 rd({schema:this,typeName:Jt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return wf.create(this,this._def)}nullable(){return ih.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return oh.create(this,this._def)}promise(){return zE.create(this,this._def)}or(t){return hT.create([this,t],this._def)}and(t){return _T.create(this,t,this._def)}transform(t){return new rd({...xn(this._def),schema:this,typeName:Jt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new bT({...xn(this._def),innerType:this,defaultValue:n,typeName:Jt.ZodDefault})}brand(){return new MG({typeName:Jt.ZodBranded,type:this,...xn(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new ox({...xn(this._def),innerType:this,catchValue:n,typeName:Jt.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return jO.create(this,t)}readonly(){return sx.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Kwt=/^c[^\s-]{8,}$/i,Jwt=/^[a-z][a-z0-9]*$/,Zwt=/[0-9A-HJKMNP-TV-Z]{26}/,Wwt=/^[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,Xwt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eOt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),tOt=/^(((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}))$/,nOt=/^(([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})))$/,rOt=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$");GE=class e extends Dn{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:Ye.invalid_string,...Qt.errToObj(r)}),this.nonempty=t=>this.min(1,Qt.errToObj(t)),this.trim=()=>new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==at.string){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.string,received:i.parsedType}),En}let r=new Eu,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.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),lt(o,{code:Ye.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,u=t.data.length<i.value;(s||u)&&(o=this._getOrReturnCtx(t,o),s?lt(o,{code:Ye.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&lt(o,{code:Ye.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Xwt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"email",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")eOt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"emoji",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Wwt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"uuid",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Kwt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"cuid",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Jwt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"cuid2",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Zwt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"ulid",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),lt(o,{validation:"url",code:Ye.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),lt(o,{validation:"regex",code:Ye.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),lt(o,{code:Ye.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),lt(o,{code:Ye.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?rOt(i).test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?oOt(t.data,i.version)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"ip",code:Ye.invalid_string,message:i.message}),r.dirty()):Tr.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",...Qt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Qt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Qt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Qt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Qt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Qt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Qt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Qt.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,...Qt.errToObj(t?.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Qt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Qt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Qt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Qt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Qt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Qt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Qt.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}};GE.create=e=>{var t;return new GE({checks:[],typeName:Jt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...xn(e)})};dT=class e extends Dn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==at.number){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.number,received:i.parsedType}),En}let r,o=new Eu;for(let i of this._def.checks)i.kind==="int"?Tr.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.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),lt(r,{code:Ye.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),lt(r,{code:Ye.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?iOt(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.not_finite,message:i.message}),o.dirty()):Tr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Qt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Qt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Qt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Qt.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"&&Tr.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)}};dT.create=e=>new dT({checks:[],typeName:Jt.ZodNumber,coerce:e?.coerce||!1,...xn(e)});pT=class e extends Dn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==at.bigint){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.bigint,received:i.parsedType}),En}let r,o=new Eu;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),lt(r,{code:Ye.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),lt(r,{code:Ye.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),lt(r,{code:Ye.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Tr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qt.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:Qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Qt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qt.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}};pT.create=e=>{var t;return new pT({checks:[],typeName:Jt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...xn(e)})};fT=class extends Dn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==at.boolean){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.boolean,received:r.parsedType}),En}return ac(t.data)}};fT.create=e=>new fT({typeName:Jt.ZodBoolean,coerce:e?.coerce||!1,...xn(e)});mT=class e extends Dn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==at.date){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.date,received:i.parsedType}),En}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_date}),En}let r=new Eu,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.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),lt(o,{code:Ye.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Tr.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:Qt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Qt.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}};mT.create=e=>new mT({checks:[],coerce:e?.coerce||!1,typeName:Jt.ZodDate,...xn(e)});ex=class extends Dn{_parse(t){if(this._getType(t)!==at.symbol){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.symbol,received:r.parsedType}),En}return ac(t.data)}};ex.create=e=>new ex({typeName:Jt.ZodSymbol,...xn(e)});AT=class extends Dn{_parse(t){if(this._getType(t)!==at.undefined){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.undefined,received:r.parsedType}),En}return ac(t.data)}};AT.create=e=>new AT({typeName:Jt.ZodUndefined,...xn(e)});gT=class extends Dn{_parse(t){if(this._getType(t)!==at.null){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.null,received:r.parsedType}),En}return ac(t.data)}};gT.create=e=>new gT({typeName:Jt.ZodNull,...xn(e)});jE=class extends Dn{constructor(){super(...arguments),this._any=!0}_parse(t){return ac(t.data)}};jE.create=e=>new jE({typeName:Jt.ZodAny,...xn(e)});rh=class extends Dn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ac(t.data)}};rh.create=e=>new rh({typeName:Jt.ZodUnknown,...xn(e)});Of=class extends Dn{_parse(t){let n=this._getOrReturnCtx(t);return lt(n,{code:Ye.invalid_type,expected:at.never,received:n.parsedType}),En}};Of.create=e=>new Of({typeName:Jt.ZodNever,...xn(e)});tx=class extends Dn{_parse(t){if(this._getType(t)!==at.undefined){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.void,received:r.parsedType}),En}return ac(t.data)}};tx.create=e=>new tx({typeName:Jt.ZodVoid,...xn(e)});oh=class e extends Dn{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==at.array)return lt(n,{code:Ye.invalid_type,expected:at.array,received:n.parsedType}),En;if(o.exactLength!==null){let s=n.data.length>o.exactLength.value,u=n.data.length<o.exactLength.value;(s||u)&&(lt(n,{code:s?Ye.too_big:Ye.too_small,minimum:u?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&&(lt(n,{code:Ye.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&&(lt(n,{code:Ye.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,u)=>o.type._parseAsync(new Ap(n,s,n.path,u)))).then(s=>Eu.mergeArray(r,s));let i=[...n.data].map((s,u)=>o.type._parseSync(new Ap(n,s,n.path,u)));return Eu.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Qt.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Qt.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Qt.toString(n)}})}nonempty(t){return this.min(1,t)}};oh.create=(e,t)=>new oh({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Jt.ZodArray,...xn(t)});yu=class e extends Dn{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=Tr.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==at.object){let f=this._getOrReturnCtx(t);return lt(f,{code:Ye.invalid_type,expected:at.object,received:f.parsedType}),En}let{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),u=[];if(!(this._def.catchall instanceof Of&&this._def.unknownKeys==="strip"))for(let f in o.data)s.includes(f)||u.push(f);let l=[];for(let f of s){let h=i[f],_=o.data[f];l.push({key:{status:"valid",value:f},value:h._parse(new Ap(o,_,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Of){let f=this._def.unknownKeys;if(f==="passthrough")for(let h of u)l.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(f==="strict")u.length>0&&(lt(o,{code:Ye.unrecognized_keys,keys:u}),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 u){let _=o.data[h];l.push({key:{status:"valid",value:h},value:f._parse(new Ap(o,_,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let f=[];for(let h of l){let _=await h.key;f.push({key:_,value:await h.value,alwaysSet:h.alwaysSet})}return f}).then(f=>Eu.mergeObjectSync(r,f)):Eu.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Qt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,u;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:(u=Qt.errToObj(t).message)!==null&&u!==void 0?u: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:Jt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return Tr.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 Tr.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return XR(this)}partial(t){let n={};return Tr.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 Tr.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof wf;)i=i._def.innerType;n[r]=i}}),new e({...this._def,shape:()=>n})}keyof(){return qQe(Tr.objectKeys(this.shape))}};yu.create=(e,t)=>new yu({shape:()=>e,unknownKeys:"strip",catchall:Of.create(),typeName:Jt.ZodObject,...xn(t)});yu.strictCreate=(e,t)=>new yu({shape:()=>e,unknownKeys:"strict",catchall:Of.create(),typeName:Jt.ZodObject,...xn(t)});yu.lazycreate=(e,t)=>new yu({shape:e,unknownKeys:"strip",catchall:Of.create(),typeName:Jt.ZodObject,...xn(t)});hT=class extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(let u of i)if(u.result.status==="valid")return u.result;for(let u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let s=i.map(u=>new el(u.ctx.common.issues));return lt(n,{code:Ye.invalid_union,unionErrors:s}),En}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 u=s.map(l=>new el(l));return lt(n,{code:Ye.invalid_union,unionErrors:u}),En}}get options(){return this._def.options}};hT.create=(e,t)=>new hT({options:e,typeName:Jt.ZodUnion,...xn(t)});DG=e=>e instanceof ET?DG(e.schema):e instanceof rd?DG(e.innerType()):e instanceof yT?[e.value]:e instanceof ST?e.options:e instanceof TT?Object.keys(e.enum):e instanceof bT?DG(e._def.innerType):e instanceof AT?[void 0]:e instanceof gT?[null]:null,OG=class e extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.object)return lt(n,{code:Ye.invalid_type,expected:at.object,received:n.parsedType}),En;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}):(lt(n,{code:Ye.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),En)}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=DG(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of s){if(o.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);o.set(u,i)}}return new e({typeName:Jt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...xn(r)})}};_T=class extends Dn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(mee(i)||mee(s))return En;let u=gee(i.value,s.value);return u.valid?((Aee(i)||Aee(s))&&n.dirty(),{status:n.value,value:u.data}):(lt(r,{code:Ye.invalid_intersection_types}),En)};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}))}};_T.create=(e,t,n)=>new _T({left:e,right:t,typeName:Jt.ZodIntersection,...xn(n)});uA=class e extends Dn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.array)return lt(r,{code:Ye.invalid_type,expected:at.array,received:r.parsedType}),En;if(r.data.length<this._def.items.length)return lt(r,{code:Ye.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),En;!this._def.rest&&r.data.length>this._def.items.length&&(lt(r,{code:Ye.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((s,u)=>{let l=this._def.items[u]||this._def.rest;return l?l._parse(new Ap(r,s,r.path,u)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Eu.mergeArray(n,s)):Eu.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};uA.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new uA({items:e,typeName:Jt.ZodTuple,rest:null,...xn(t)})};kG=class e extends Dn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.object)return lt(r,{code:Ye.invalid_type,expected:at.object,received:r.parsedType}),En;let o=[],i=this._def.keyType,s=this._def.valueType;for(let u in r.data)o.push({key:i._parse(new Ap(r,u,r.path,u)),value:s._parse(new Ap(r,r.data[u],r.path,u))});return r.common.async?Eu.mergeObjectAsync(n,o):Eu.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Dn?new e({keyType:t,valueType:n,typeName:Jt.ZodRecord,...xn(r)}):new e({keyType:GE.create(),valueType:t,typeName:Jt.ZodRecord,...xn(n)})}},nx=class extends Dn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.map)return lt(r,{code:Ye.invalid_type,expected:at.map,received:r.parsedType}),En;let o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([u,l],f)=>({key:o._parse(new Ap(r,u,r.path,[f,"key"])),value:i._parse(new Ap(r,l,r.path,[f,"value"]))}));if(r.common.async){let u=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 En;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let l of s){let f=l.key,h=l.value;if(f.status==="aborted"||h.status==="aborted")return En;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}}}};nx.create=(e,t,n)=>new nx({valueType:t,keyType:e,typeName:Jt.ZodMap,...xn(n)});rx=class e extends Dn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.set)return lt(r,{code:Ye.invalid_type,expected:at.set,received:r.parsedType}),En;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(lt(r,{code:Ye.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&&(lt(r,{code:Ye.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 En;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}let u=[...r.data.values()].map((l,f)=>i._parse(new Ap(r,l,r.path,f)));return r.common.async?Promise.all(u).then(l=>s(l)):s(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:Qt.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Qt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};rx.create=(e,t)=>new rx({valueType:e,minSize:null,maxSize:null,typeName:Jt.ZodSet,...xn(t)});PG=class e extends Dn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.function)return lt(n,{code:Ye.invalid_type,expected:at.function,received:n.parsedType}),En;function r(u,l){return BG({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,NG(),FO].filter(f=>!!f),issueData:{code:Ye.invalid_arguments,argumentsError:l}})}function o(u,l){return BG({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,NG(),FO].filter(f=>!!f),issueData:{code:Ye.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof zE){let u=this;return ac(async function(...l){let f=new el([]),h=await u._def.args.parseAsync(l,i).catch(T=>{throw f.addIssue(r(l,T)),f}),_=await Reflect.apply(s,this,h);return await u._def.returns._def.type.parseAsync(_,i).catch(T=>{throw f.addIssue(o(_,T)),f})})}else{let u=this;return ac(function(...l){let f=u._def.args.safeParse(l,i);if(!f.success)throw new el([r(l,f.error)]);let h=Reflect.apply(s,this,f.data),_=u._def.returns.safeParse(h,i);if(!_.success)throw new el([o(h,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:uA.create(t).rest(rh.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||uA.create([]).rest(rh.create()),returns:n||rh.create(),typeName:Jt.ZodFunction,...xn(r)})}},ET=class extends Dn{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})}};ET.create=(e,t)=>new ET({getter:e,typeName:Jt.ZodLazy,...xn(t)});yT=class extends Dn{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return lt(n,{received:n.data,code:Ye.invalid_literal,expected:this._def.value}),En}return{status:"valid",value:t.data}}get value(){return this._def.value}};yT.create=(e,t)=>new yT({value:e,typeName:Jt.ZodLiteral,...xn(t)});ST=class e extends Dn{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return lt(n,{expected:Tr.joinValues(r),received:n.parsedType,code:Ye.invalid_type}),En}if(this._def.values.indexOf(t.data)===-1){let n=this._getOrReturnCtx(t),r=this._def.values;return lt(n,{received:n.data,code:Ye.invalid_enum_value,options:r}),En}return ac(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)))}};ST.create=qQe;TT=class extends Dn{_parse(t){let n=Tr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==at.string&&r.parsedType!==at.number){let o=Tr.objectValues(n);return lt(r,{expected:Tr.joinValues(o),received:r.parsedType,code:Ye.invalid_type}),En}if(n.indexOf(t.data)===-1){let o=Tr.objectValues(n);return lt(r,{received:r.data,code:Ye.invalid_enum_value,options:o}),En}return ac(t.data)}get enum(){return this._def.values}};TT.create=(e,t)=>new TT({values:e,typeName:Jt.ZodNativeEnum,...xn(t)});zE=class extends Dn{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.promise&&n.common.async===!1)return lt(n,{code:Ye.invalid_type,expected:at.promise,received:n.parsedType}),En;let r=n.parsedType===at.promise?n.data:Promise.resolve(n.data);return ac(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};zE.create=(e,t)=>new zE({type:e,typeName:Jt.ZodPromise,...xn(t)});rd=class extends Dn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Jt.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=>{lt(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(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){let s=u=>{let l=o.refinement(u,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 u};if(r.common.async===!1){let u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?En:(u.status==="dirty"&&n.dirty(),s(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?En:(u.status==="dirty"&&n.dirty(),s(u.value).then(()=>({status:n.value,value:u.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 u=o.transform(s.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}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(u=>({status:n.value,value:u})):s);Tr.assertNever(o)}};rd.create=(e,t,n)=>new rd({schema:e,typeName:Jt.ZodEffects,effect:t,...xn(n)});rd.createWithPreprocess=(e,t,n)=>new rd({schema:t,effect:{type:"preprocess",transform:e},typeName:Jt.ZodEffects,...xn(n)});wf=class extends Dn{_parse(t){return this._getType(t)===at.undefined?ac(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wf.create=(e,t)=>new wf({innerType:e,typeName:Jt.ZodOptional,...xn(t)});ih=class extends Dn{_parse(t){return this._getType(t)===at.null?ac(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ih.create=(e,t)=>new ih({innerType:e,typeName:Jt.ZodNullable,...xn(t)});bT=class extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===at.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};bT.create=(e,t)=>new bT({innerType:e,typeName:Jt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xn(t)});ox=class extends Dn{_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 wG(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new el(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new el(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ox.create=(e,t)=>new ox({innerType:e,typeName:Jt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xn(t)});ix=class extends Dn{_parse(t){if(this._getType(t)!==at.nan){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.nan,received:r.parsedType}),En}return{status:"valid",value:t.data}}};ix.create=e=>new ix({typeName:Jt.ZodNaN,...xn(e)});sOt=Symbol("zod_brand"),MG=class extends Dn{_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}},jO=class e extends Dn{_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"?En:i.status==="dirty"?(n.dirty(),$Qe(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"?En: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:Jt.ZodPipeline})}},sx=class extends Dn{_parse(t){let n=this._def.innerType._parse(t);return GO(n)&&(n.value=Object.freeze(n.value)),n}};sx.create=(e,t)=>new sx({innerType:e,typeName:Jt.ZodReadonly,...xn(t)});VQe=(e,t={},n)=>e?jE.create().superRefine((r,o)=>{var i,s;if(!e(r)){let u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=u.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,f=typeof u=="string"?{message:u}:u;o.addIssue({code:"custom",...f,fatal:l})}}):jE.create(),aOt={object:yu.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"})(Jt||(Jt={}));uOt=(e,t={message:`Input not instance of ${e.name}`})=>VQe(n=>n instanceof e,t),YQe=GE.create,KQe=dT.create,cOt=ix.create,lOt=pT.create,JQe=fT.create,dOt=mT.create,pOt=ex.create,fOt=AT.create,mOt=gT.create,AOt=jE.create,gOt=rh.create,hOt=Of.create,_Ot=tx.create,EOt=oh.create,yOt=yu.create,SOt=yu.strictCreate,TOt=hT.create,bOt=OG.create,IOt=_T.create,COt=uA.create,vOt=kG.create,ROt=nx.create,xOt=rx.create,DOt=PG.create,NOt=ET.create,BOt=yT.create,wOt=ST.create,OOt=TT.create,kOt=zE.create,jQe=rd.create,POt=wf.create,MOt=ih.create,LOt=rd.createWithPreprocess,UOt=jO.create,QOt=()=>YQe().optional(),FOt=()=>KQe().optional(),GOt=()=>JQe().optional(),jOt={string:(e=>GE.create({...e,coerce:!0})),number:(e=>dT.create({...e,coerce:!0})),boolean:(e=>fT.create({...e,coerce:!0})),bigint:(e=>pT.create({...e,coerce:!0})),date:(e=>mT.create({...e,coerce:!0}))},zOt=En,_u=Object.freeze({__proto__:null,defaultErrorMap:FO,setErrorMap:Vwt,getErrorMap:NG,makeIssue:BG,EMPTY_PATH:Ywt,addIssueToContext:lt,ParseStatus:Eu,INVALID:En,DIRTY:$Qe,OK:ac,isAborted:mee,isDirty:Aee,isValid:GO,isAsync:wG,get util(){return Tr},get objectUtil(){return fee},ZodParsedType:at,getParsedType:FE,ZodType:Dn,ZodString:GE,ZodNumber:dT,ZodBigInt:pT,ZodBoolean:fT,ZodDate:mT,ZodSymbol:ex,ZodUndefined:AT,ZodNull:gT,ZodAny:jE,ZodUnknown:rh,ZodNever:Of,ZodVoid:tx,ZodArray:oh,ZodObject:yu,ZodUnion:hT,ZodDiscriminatedUnion:OG,ZodIntersection:_T,ZodTuple:uA,ZodRecord:kG,ZodMap:nx,ZodSet:rx,ZodFunction:PG,ZodLazy:ET,ZodLiteral:yT,ZodEnum:ST,ZodNativeEnum:TT,ZodPromise:zE,ZodEffects:rd,ZodTransformer:rd,ZodOptional:wf,ZodNullable:ih,ZodDefault:bT,ZodCatch:ox,ZodNaN:ix,BRAND:sOt,ZodBranded:MG,ZodPipeline:jO,ZodReadonly:sx,custom:VQe,Schema:Dn,ZodSchema:Dn,late:aOt,get ZodFirstPartyTypeKind(){return Jt},coerce:jOt,any:AOt,array:EOt,bigint:lOt,boolean:JQe,date:dOt,discriminatedUnion:bOt,effect:jQe,enum:wOt,function:DOt,instanceof:uOt,intersection:IOt,lazy:NOt,literal:BOt,map:ROt,nan:cOt,nativeEnum:OOt,never:hOt,null:mOt,nullable:MOt,number:KQe,object:yOt,oboolean:GOt,onumber:FOt,optional:POt,ostring:QOt,pipeline:UOt,preprocess:LOt,promise:kOt,record:vOt,set:xOt,strictObject:SOt,string:YQe,symbol:pOt,transformer:jQe,tuple:COt,undefined:fOt,union:TOt,unknown:gOt,void:_Ot,NEVER:zOt,ZodIssueCode:Ye,quotelessJson:qwt,ZodError:el}),HOt=e=>typeof e?.safeParse=="function",dee=e=>typeof e?.passthrough=="function",$Ot=(e,t)=>dee(e)?dee(t)?e.merge(t):e:dee(t)?t:Object.assign({},e,t),mp=_u.object({name:_u.literal("ZodError"),issues:_u.array(_u.object({path:_u.array(_u.union([_u.string(),_u.number()])),message:_u.string().optional(),code:_u.nativeEnum(_u.ZodIssueCode)}).catchall(_u.any()))}),hee=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}},YLn=_u.object({message:_u.literal("Request validation failed"),pathParameterErrors:mp.nullable(),headerErrors:mp.nullable(),queryParameterErrors:mp.nullable(),bodyErrors:mp.nullable()}),KLn=_u.object({pathParameterErrors:mp.nullable(),headerErrors:mp.nullable(),queryParameterErrors:mp.nullable(),bodyErrors:mp.nullable()}),JLn=_u.object({paramsResult:mp.nullable(),headersResult:mp.nullable(),queryResult:mp.nullable(),bodyResult:mp.nullable()}),ZQe="zod-ts-rest-polyfill",qOt=e=>{if(!e)return!1;let t=e?.["~standard"];return t?t.version===1&&typeof t.validate=="function":!1},VOt=e=>qOt(e)?e:HOt(e)?(Object.assign(e,{"~standard":{vendor:ZQe,version:1,validate:r=>{let o=e.safeParse(r);return o.success?{value:o.data}:{issues:o.error.issues}}}}),e):null,YOt=(e,t)=>e?t?e instanceof yu&&t instanceof yu?$Ot(e,t):{...e,...t}:e:t,KOt=(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===ZQe?{error:new el(r.issues)}:{error:new hee(r.issues)}:n&&typeof e=="object"&&r.value?{value:{...e,...r.value}}:{value:r.value}},WQe=Symbol("ContractNoBody"),XQe=e=>"method"in e&&"path"in e,eFe=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>{var o,i,s;return XQe(r)?[n,{...r,path:t?.pathPrefix?t.pathPrefix+r.path:r.path,headers:YOt(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,eFe(r,t)]})),pee=Symbol("ContractPlainType"),Su=()=>({router:(e,t)=>eFe(e,t),query:e=>e,mutation:e=>e,responses:e=>e,response:()=>pee,body:()=>pee,type:()=>pee,otherResponse:({contentType:e,body:t})=>({contentType:e,body:t}),noBody:()=>WQe}),JOt=({path:e,params:t})=>{let n=t;return e.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},ZOt=(e,t=!1)=>{let n=t?WOt(e):XOt(e);return n?.length>0?"?"+n:""},WOt=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("&"):"",XOt=e=>e?Object.keys(e).flatMap(t=>_ee(t,e[t])).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(n)}`).join("&"):"",_ee=(e,t)=>Array.isArray(t)?t.flatMap((n,r)=>_ee(`${e}[${r}]`,n)):t instanceof Date?[[`${e}`,t.toISOString()]]:t===null?[[`${e}`,""]]:t===void 0?[]:typeof t=="object"?Object.keys(t).flatMap(n=>_ee(`${e}[${n}]`,t[n])):[[`${e}`,`${t}`]],Eee=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}},yee=async({route:e,path:t,method:n,headers:r,body:o,validateResponse:i,fetchOptions:s})=>{let u=await fetch(t,{...s,method:n,headers:r,body:o}),l=u.headers.get("content-type");if(l?.includes("application/")&&l?.includes("json")){let f=e.responses[u.status],h={status:u.status,body:f===WQe?void 0:await u.json(),headers:u.headers},_=VOt(f);if(_&&(i??e.validateResponseOnClient)){let y=KOt(h.body,_);if(y.error)throw y.error;return{...h,body:y.value}}return h}return l?.includes("text/")?{status:u.status,body:await u.text(),headers:u.headers}:{status:u.status,body:await u.blob(),headers:u.headers}},ekt=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},zQe=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t.toLowerCase(),n])),tkt=e=>{let{path:t,clientArgs:n,route:r,body:o,query:i,extraInputArgs:s,headers:u,fetchOptions:l}=e,f=n.api||yee,h=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([T,v])=>typeof v=="function"?[T,v(e)]:[T,v])),_={...h&&zQe(h),...zQe(u)};Object.keys(_).forEach(T=>{_[T]===void 0&&delete _[T]});let y={route:r,path:t,method:r.method,headers:_,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"?y={...y,contentType:"multipart/form-data",body:o instanceof FormData?o:ekt(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?y={...y,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...y.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(y={...y,contentType:"application/json",headers:{"content-type":"application/json",...y.headers},body:JSON.stringify(o)})),f({...y,...s})},nkt=(e,t,n)=>{let{query:r,params:o,body:i,headers:s,extraHeaders:u,overrideClientOptions:l,fetchOptions:f,cache:h,next:_,...y}=n||{},T={...t,...l},v=typeof o=="object"?Object.fromEntries(Object.entries(o).map(([x,O])=>[x,String(O)])):{};return{path:rkt(r,T.baseUrl,v,e,!!T.jsonQuery),clientArgs:T,route:e,body:i,query:r,extraInputArgs:y,fetchOptions:{...h&&{cache:h},..._&&{next:_},...f},headers:{...u,...s}}},rkt=(e,t,n,r,o)=>{let i=JOt({path:r.path,params:n}),s=ZOt(e,o);return t.endsWith("/")&&i.startsWith("/")?`${t}${i.substring(1)}${s}`:`${t}${i}${s}`},okt=(e,t)=>{let n=Object.keys(e.responses);return async r=>{let o=nkt(e,t,r),i=await tkt(o);if(!t.throwOnUnknownStatus||n.includes(i.status.toString()))return i;throw new Eee(i,n)}},See=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>XQe(r)?[n,okt(r,t)]:[n,See(r,t)]))});function ie(e,t,n){function r(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,l);let f=s.prototype,h=Object.keys(f);for(let _=0;_<h.length;_++){let y=h[_];y in u||(u[y]=f[y].bind(u))}}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(u){var l;let f=n?.Parent?new i:this;r(f,u),(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:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function bi(e){return e&&Object.assign(IT,e),IT}var tFe,Tee,bee,kf,HE,IT,CT=w(()=>{m();Tee=Object.freeze({status:"aborted"});bee=Symbol("zod_brand"),kf=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},HE=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(tFe=globalThis).__zod_globalConfig??(tFe.__zod_globalConfig={});IT=globalThis.__zod_globalConfig});var Le={};Zs(Le,{BIGINT_FORMAT_RANGES:()=>Oee,Class:()=>Cee,NUMBER_FORMAT_RANGES:()=>wee,aborted:()=>YE,allowsEval:()=>xee,assert:()=>ckt,assertEqual:()=>ikt,assertIs:()=>akt,assertNever:()=>ukt,assertNotEqual:()=>skt,assignProp:()=>qE,base64ToUint8Array:()=>rFe,base64urlToUint8Array:()=>vkt,cached:()=>ux,captureStackTrace:()=>UG,cleanEnum:()=>Ckt,cleanRegex:()=>$O,clone:()=>uc,cloneDef:()=>dkt,createTransparentProxy:()=>hkt,defineLazy:()=>Hn,esc:()=>LG,escapeRegex:()=>gp,explicitlyAborted:()=>kee,extend:()=>ykt,finalizeIssue:()=>cc,floatSafeRemainder:()=>vee,getElementAtPath:()=>pkt,getEnumValues:()=>HO,getLengthableOrigin:()=>YO,getParsedType:()=>gkt,getSizableOrigin:()=>VO,hexToUint8Array:()=>xkt,isObject:()=>vT,isPlainObject:()=>VE,issue:()=>cx,joinValues:()=>de,jsonStringifyReplacer:()=>ax,merge:()=>Tkt,mergeDefs:()=>sh,normalizeParams:()=>qe,nullish:()=>$E,numKeys:()=>Akt,objectClone:()=>lkt,omit:()=>Ekt,optionalKeys:()=>Bee,parsedType:()=>ke,partial:()=>bkt,pick:()=>_kt,prefixIssues:()=>tl,primitiveTypes:()=>Nee,promiseAllObject:()=>fkt,propertyKeyTypes:()=>qO,randomString:()=>mkt,required:()=>Ikt,safeExtend:()=>Skt,shallowClone:()=>Dee,slugify:()=>Ree,stringifyPrimitive:()=>Oe,uint8ArrayToBase64:()=>oFe,uint8ArrayToBase64url:()=>Rkt,uint8ArrayToHex:()=>Dkt,unwrapMessage:()=>zO});function ikt(e){return e}function skt(e){return e}function akt(e){}function ukt(e){throw new Error("Unexpected value in exhaustive check")}function ckt(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 de(e,t="|"){return e.map(n=>Oe(n)).join(t)}function ax(e,t){return typeof t=="bigint"?t.toString():t}function ux(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function $E(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 vee(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 Hn(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==nFe)return r===void 0&&(r=nFe,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function lkt(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function qE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sh(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function dkt(e){return sh(e._zod.def)}function pkt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function fkt(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 mkt(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function LG(e){return JSON.stringify(e)}function Ree(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function vT(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function VE(e){if(vT(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(vT(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Dee(e){return VE(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Akt(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function gp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uc(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(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 hkt(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 Oe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Bee(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function _kt(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=sh(e._zod.def,{get shape(){let s={};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=n.shape[u])}return qE(this,"shape",s),s},checks:[]});return uc(e,i)}function Ekt(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=sh(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete s[u]}return qE(this,"shape",s),s},checks:[]});return uc(e,i)}function ykt(e,t){if(!VE(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=sh(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return qE(this,"shape",i),i}});return uc(e,o)}function Skt(e,t){if(!VE(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=sh(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return qE(this,"shape",r),r}});return uc(e,n)}function Tkt(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=sh(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return qE(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return uc(e,n)}function bkt(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=sh(t._zod.def,{get shape(){let u=t._zod.def.shape,l={...u};if(n)for(let f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(l[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(let f in u)l[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return qE(this,"shape",l),l},checks:[]});return uc(t,s)}function Ikt(e,t,n){let r=sh(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 qE(this,"shape",i),i}});return uc(t,r)}function YE(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 kee(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 tl(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function zO(e){return typeof e=="string"?e:e?.message}function cc(e,t,n){let r=e.message?e.message:zO(e.inst?._zod.def?.error?.(e))??zO(t?.error?.(e))??zO(n.customError?.(e))??zO(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...u}=e;return u.path??(u.path=[]),u.message=r,t?.reportInput&&(u.input=s),u}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 cx(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Ckt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function rFe(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 oFe(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function vkt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return rFe(t+n)}function Rkt(e){return oFe(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xkt(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 Dkt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var nFe,UG,xee,gkt,qO,Nee,wee,Oee,Cee,St=w(()=>{m();CT();nFe=Symbol("evaluating");UG="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};xee=ux(()=>{if(IT.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});gkt=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"]),Nee=new Set(["string","number","bigint","boolean","symbol","undefined"]);wee={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]},Oee={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Cee=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(u=>r({issues:u},[...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 u=[...i,...s.path];if(u.length===0)n._errors.push(t(s));else{let l=n,f=0;for(;f<u.length;){let h=u[f];f===u.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 Pee(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s,u;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,_=0;for(;_<f.length;){let y=f[_],T=_===f.length-1;typeof y=="string"?(h.properties??(h.properties={}),(s=h.properties)[y]??(s[y]={errors:[]}),h=h.properties[y]):(h.items??(h.items=[]),(u=h.items)[y]??(u[y]={errors:[]}),h=h.items[y]),T&&h.errors.push(t(l)),_++}}};return r(e),n}function sFe(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 Mee(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 ${sFe(r.path)}`);return t.join(`
41
41
  `)}var iFe,KO,nl,Lee=w(()=>{m();CT();St();iFe=(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,ax,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},KO=ie("$ZodError",iFe),nl=ie("$ZodError",iFe,{Parent:Error})});var lx,QG,dx,FG,px,Uee,fx,Qee,GG,Bkt,jG,wkt,zG,Okt,HG,kkt,$G,Pkt,qG,Mkt,VG,Lkt,YG,Ukt,Fee=w(()=>{m();CT();Lee();St();lx=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 kf;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(l=>cc(l,i,bi())));throw UG(u,o?.callee),u}return s.value},QG=lx(nl),dx=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 u=new(o?.Err??e)(s.issues.map(l=>cc(l,i,bi())));throw UG(u,o?.callee),u}return s.value},FG=dx(nl),px=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 kf;return i.issues.length?{success:!1,error:new(e??KO)(i.issues.map(s=>cc(s,o,bi())))}:{success:!0,data:i.value}},Uee=px(nl),fx=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=>cc(s,o,bi())))}:{success:!0,data:i.value}},Qee=fx(nl),GG=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return lx(e)(t,n,o)},Bkt=GG(nl),jG=e=>(t,n,r)=>lx(e)(t,n,r),wkt=jG(nl),zG=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return dx(e)(t,n,o)},Okt=zG(nl),HG=e=>async(t,n,r)=>dx(e)(t,n,r),kkt=HG(nl),$G=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return px(e)(t,n,o)},Pkt=$G(nl),qG=e=>(t,n,r)=>px(e)(t,n,r),Mkt=qG(nl),VG=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return fx(e)(t,n,o)},Lkt=VG(nl),YG=e=>async(t,n,r)=>fx(e)(t,n,r),Ukt=YG(nl)});var od={};Zs(od,{base64:()=>nte,base64url:()=>KG,bigint:()=>cte,boolean:()=>dte,browserEmail:()=>qkt,cidrv4:()=>ete,cidrv6:()=>tte,cuid:()=>Gee,cuid2:()=>jee,date:()=>ite,datetime:()=>ate,domain:()=>Kkt,duration:()=>Vee,e164:()=>ote,email:()=>Kee,emoji:()=>Jee,extendedDuration:()=>Qkt,guid:()=>Yee,hex:()=>Jkt,hostname:()=>Ykt,html5Email:()=>zkt,httpProtocol:()=>rte,idnEmail:()=>$kt,integer:()=>lte,ipv4:()=>Zee,ipv6:()=>Wee,ksuid:()=>$ee,lowercase:()=>mte,mac:()=>Xee,md5_base64:()=>Wkt,md5_base64url:()=>Xkt,md5_hex:()=>Zkt,nanoid:()=>qee,null:()=>pte,number:()=>JG,rfc5322Email:()=>Hkt,sha1_base64:()=>tPt,sha1_base64url:()=>nPt,sha1_hex:()=>ePt,sha256_base64:()=>oPt,sha256_base64url:()=>iPt,sha256_hex:()=>rPt,sha384_base64:()=>aPt,sha384_base64url:()=>uPt,sha384_hex:()=>sPt,sha512_base64:()=>lPt,sha512_base64url:()=>dPt,sha512_hex:()=>cPt,string:()=>ute,time:()=>ste,ulid:()=>zee,undefined:()=>fte,unicodeEmail:()=>aFe,uppercase:()=>Ate,uuid:()=>RT,uuid4:()=>Fkt,uuid6:()=>Gkt,uuid7:()=>jkt,xid:()=>Hee});function Jee(){return new RegExp(Vkt,"u")}function cFe(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 ste(e){return new RegExp(`^${cFe(e)}$`)}function ate(e){let t=cFe({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(`^${uFe}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 Gee,jee,zee,Hee,$ee,qee,Vee,Qkt,Yee,RT,Fkt,Gkt,jkt,Kee,zkt,Hkt,aFe,$kt,qkt,Vkt,Zee,Wee,Xee,ete,tte,nte,KG,Ykt,Kkt,rte,ote,uFe,ite,ute,cte,lte,JG,dte,pte,fte,mte,Ate,Jkt,Zkt,Wkt,Xkt,ePt,tPt,nPt,rPt,oPt,iPt,sPt,aPt,uPt,cPt,lPt,dPt,ZG=w(()=>{m();St();Gee=/^[cC][0-9a-z]{6,}$/,jee=/^[0-9a-z]+$/,zee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Hee=/^[0-9a-vA-V]{20}$/,$ee=/^[A-Za-z0-9]{27}$/,qee=/^[a-zA-Z0-9_-]{21}$/,Vee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qkt=/^[-+]?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)?)??$/,Yee=/^([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})$/,RT=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)$/,Fkt=RT(4),Gkt=RT(6),jkt=RT(7),Kee=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zkt=/^[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])?)*$/,Hkt=/^(([^<>()\[\]\\.,;:\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,}))$/,aFe=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$kt=aFe,qkt=/^[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])?)*$/,Vkt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Zee=/^(?:(?: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])$/,Wee=/^(([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}|:))$/,Xee=e=>{let t=gp(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ete=/^((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])$/,tte=/^(([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])$/,nte=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,KG=/^[A-Za-z0-9_-]*$/,Ykt=/^(?=.{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])?)*\.?$/,Kkt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,rte=/^https?$/,ote=/^\+[1-9]\d{6,14}$/,uFe="(?:(?:\\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])))",ite=new RegExp(`^${uFe}$`);ute=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},cte=/^-?\d+n?$/,lte=/^-?\d+$/,JG=/^-?\d+(?:\.\d+)?$/,dte=/^(?:true|false)$/i,pte=/^null$/i,fte=/^undefined$/i,mte=/^[^A-Z]*$/,Ate=/^[^a-z]*$/,Jkt=/^[0-9a-fA-F]*$/;Zkt=/^[0-9a-fA-F]{32}$/,Wkt=WO(22,"=="),Xkt=XO(22),ePt=/^[0-9a-fA-F]{40}$/,tPt=WO(27,"="),nPt=XO(27),rPt=/^[0-9a-fA-F]{64}$/,oPt=WO(43,"="),iPt=XO(43),sPt=/^[0-9a-fA-F]{96}$/,aPt=WO(64,""),uPt=XO(64),cPt=/^[0-9a-fA-F]{128}$/,lPt=WO(86,"=="),dPt=XO(86)});function lFe(e,t,n){e.issues.length&&t.issues.push(...tl(n,e.issues))}var no,dFe,WG,XG,gte,hte,_te,Ete,yte,Ste,Tte,bte,Ite,mx,Cte,vte,Rte,xte,Dte,Nte,Bte,wte,Ote,ej=w(()=>{m();CT();ZG();St();no=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),dFe={number:"number",bigint:"bigint",object:"date"},WG=ie("$ZodCheckLessThan",(e,t)=>{no.init(e,t);let n=dFe[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})}}),XG=ie("$ZodCheckGreaterThan",(e,t)=>{no.init(e,t);let n=dFe[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})}}),gte=ie("$ZodCheckMultipleOf",(e,t)=>{no.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):vee(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})}}),hte=ie("$ZodCheckNumberFormat",(e,t)=>{no.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=wee[t.format];e._zod.onattach.push(s=>{let u=s._zod.bag;u.format=t.format,u.minimum=o,u.maximum=i,n&&(u.pattern=lte)}),e._zod.check=s=>{let u=s.value;if(n){if(!Number.isInteger(u)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,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:u,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}}u<o&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>i&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),_te=ie("$ZodCheckBigIntFormat",(e,t)=>{no.init(e,t);let[n,r]=Oee[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})}}),Ete=ie("$ZodCheckMaxSize",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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})}}),yte=ie("$ZodCheckMinSize",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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})}}),Ste=ie("$ZodCheckSizeEquals",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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})}}),Tte=ie("$ZodCheckMaxLength",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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})}}),bte=ie("$ZodCheckMinLength",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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})}}),Ite=ie("$ZodCheckLengthEquals",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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),u=i>t.length;r.issues.push({origin:s,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),mx=ie("$ZodCheckStringFormat",(e,t)=>{var n,r;no.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=()=>{})}),Cte=ie("$ZodCheckRegex",(e,t)=>{mx.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})}}),vte=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mte),mx.init(e,t)}),Rte=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ate),mx.init(e,t)}),xte=ie("$ZodCheckIncludes",(e,t)=>{no.init(e,t);let n=gp(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})}}),Dte=ie("$ZodCheckStartsWith",(e,t)=>{no.init(e,t);let n=new RegExp(`^${gp(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})}}),Nte=ie("$ZodCheckEndsWith",(e,t)=>{no.init(e,t);let n=new RegExp(`.*${gp(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})}});Bte=ie("$ZodCheckProperty",(e,t)=>{no.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=>lFe(o,n,t.property));lFe(r,n,t.property)}}),wte=ie("$ZodCheckMimeType",(e,t)=>{no.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})}}),Ote=ie("$ZodCheckOverwrite",(e,t)=>{no.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var ek,kte=w(()=>{m();ek=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(`
@@ -104,7 +104,7 @@ Mongoose Error Code: ${t.code}`:""}`})}function LW(e,t,n,r=void 0){n&&(0,cO.safe
104
104
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let u=s[1];if(t===s[0]){i(s);continue}if(e.external){let f=e.external.registry.get(s[0])?.id;if(t!==s[0]&&f){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(u.cycle){i(s);continue}if(u.count>1&&e.reused==="ref"){i(s);continue}}}function XE(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=u=>{let l=e.seen.get(u);if(l.ref===null)return;let f=l.def??l.schema,h={...f},_=l.ref;if(l.ref=null,_){r(_);let T=e.seen.get(_),v=T.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(v)):Object.assign(f,v),Object.assign(f,h),u._zod.parent===_)for(let x in f)x==="$ref"||x==="allOf"||x in h||delete f[x];if(v.$ref&&T.def)for(let x in f)x==="$ref"||x==="allOf"||x in T.def&&JSON.stringify(f[x])===JSON.stringify(T.def[x])&&delete f[x]}let y=u._zod.parent;if(y&&y!==_){r(y);let T=e.seen.get(y);if(T?.schema.$ref&&(f.$ref=T.schema.$ref,T.def))for(let v in f)v==="$ref"||v==="allOf"||v in T.def&&JSON.stringify(f[v])===JSON.stringify(T.def[v])&&delete f[v]}e.override({zodSchema:u,jsonSchema:f,path:l.path??[]})};for(let u of[...e.seen.entries()].reverse())r(u[0]);let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}Object.assign(o,n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};for(let u of e.seen.entries()){let l=u[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Dx(t,"input",e.processors),output:Dx(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function dc(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return dc(r.element,n);if(r.type==="set")return dc(r.valueType,n);if(r.type==="lazy")return dc(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return dc(r.innerType,n);if(r.type==="intersection")return dc(r.left,n)||dc(r.right,n);if(r.type==="record"||r.type==="map")return dc(r.keyType,n)||dc(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:dc(r.in,n)||dc(r.out,n);if(r.type==="object"){for(let o in r.shape)if(dc(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(dc(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(dc(o,n))return!0;return!!(r.rest&&dc(r.rest,n))}return!1}var Qre,Dx,ck=w(()=>{m();sk();Qre=(e,t={})=>n=>{let r=ZE({...n,processors:t});return Or(e,r),WE(r,e),XE(r,e)},Dx=(e,t,n={})=>r=>{let{libraryOptions:o,target:i}=r??{},s=ZE({...o??{},target:i,io:t,processors:n});return Or(e,s),WE(s,e),XE(s,e)}});function zj(e,t){if("_idmap"in e){let r=e,o=ZE({...t,processors:Fj}),i={};for(let l of r._idmap.entries()){let[f,h]=l;Or(h,o)}let s={},u={registry:r,uri:t?.uri,defs:i};o.external=u;for(let l of r._idmap.entries()){let[f,h]=l;WE(o,h),s[f]=XE(o,h)}if(Object.keys(i).length>0){let l=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:i}}return{schemas:s}}let n=ZE({...t,processors:Fj});return Or(e,n),WE(n,e),XE(n,e)}var OMt,Fre,Gre,jre,zre,Hre,$re,qre,Vre,Yre,Kre,Jre,Zre,Wre,Xre,eoe,toe,noe,roe,ooe,ioe,soe,aoe,uoe,coe,loe,Gj,doe,poe,foe,moe,Aoe,goe,hoe,_oe,Eoe,yoe,Soe,jj,Toe,Fj,lk=w(()=>{m();ck();St();OMt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Fre=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:u,patterns:l,contentEncoding:f}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),u&&(o.format=OMt[u]??u,o.format===""&&delete o.format,u==="time"&&delete o.format),f&&(o.contentEncoding=f),l&&l.size>0){let h=[...l];h.length===1?o.pattern=h[0].source:h.length>1&&(o.allOf=[...h.map(_=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:_.source}))])}},Gre=(e,t,n,r)=>{let o=n,{minimum:i,maximum:s,format:u,multipleOf:l,exclusiveMaximum:f,exclusiveMinimum:h}=e._zod.bag;typeof u=="string"&&u.includes("int")?o.type="integer":o.type="number";let _=typeof h=="number"&&h>=(i??Number.NEGATIVE_INFINITY),y=typeof f=="number"&&f<=(s??Number.POSITIVE_INFINITY),T=t.target==="draft-04"||t.target==="openapi-3.0";_?T?(o.minimum=h,o.exclusiveMinimum=!0):o.exclusiveMinimum=h:typeof i=="number"&&(o.minimum=i),y?T?(o.maximum=f,o.exclusiveMaximum=!0):o.exclusiveMaximum=f:typeof s=="number"&&(o.maximum=s),typeof l=="number"&&(o.multipleOf=l)},jre=(e,t,n,r)=>{n.type="boolean"},zre=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Hre=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},$re=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},qre=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Vre=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Yre=(e,t,n,r)=>{n.not={}},Kre=(e,t,n,r)=>{},Jre=(e,t,n,r)=>{},Zre=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Wre=(e,t,n,r)=>{let o=e._zod.def,i=HO(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},Xre=(e,t,n,r)=>{let o=e._zod.def,i=[];for(let s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},eoe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},toe=(e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},noe=(e,t,n,r)=>{let o=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:u,mime:l}=e._zod.bag;s!==void 0&&(i.minLength=s),u!==void 0&&(i.maxLength=u),l?l.length===1?(i.contentMediaType=l[0],Object.assign(o,i)):(Object.assign(o,i),o.anyOf=l.map(f=>({contentMediaType:f}))):Object.assign(o,i)},roe=(e,t,n,r)=>{n.type="boolean"},ooe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ioe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},soe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},aoe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},uoe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},coe=(e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:u}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=Or(i.element,t,{...r,path:[...r.path,"items"]})},loe=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object",o.properties={};let s=i.shape;for(let f in s)o.properties[f]=Or(s[f],t,{...r,path:[...r.path,"properties",f]});let u=new Set(Object.keys(s)),l=new Set([...u].filter(f=>{let h=i.shape[f]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Or(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Gj=(e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((u,l)=>Or(u,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=s:n.anyOf=s},doe=(e,t,n,r)=>{let o=e._zod.def,i=Or(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Or(o.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,l=[...u(i)?i.allOf:[i],...u(s)?s.allOf:[s]];n.allOf=l},poe=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",u=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((y,T)=>Or(y,t,{...r,path:[...r.path,s,T]})),f=i.rest?Or(i.rest,t,{...r,path:[...r.path,u,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=l,f&&(o.items=f)):t.target==="openapi-3.0"?(o.items={anyOf:l},f&&o.items.anyOf.push(f),o.minItems=l.length,f||(o.maxItems=l.length)):(o.items=l,f&&(o.additionalItems=f));let{minimum:h,maximum:_}=e._zod.bag;typeof h=="number"&&(o.minItems=h),typeof _=="number"&&(o.maxItems=_)},foe=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let h=Or(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let _ of l)o.patternProperties[_.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Or(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Or(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let f=s._zod.values;if(f){let h=[...f].filter(_=>typeof _=="string"||typeof _=="number");h.length>0&&(o.required=h)}},moe=(e,t,n,r)=>{let o=e._zod.def,i=Or(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Aoe=(e,t,n,r)=>{let o=e._zod.def;Or(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},goe=(e,t,n,r)=>{let o=e._zod.def;Or(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},hoe=(e,t,n,r)=>{let o=e._zod.def;Or(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},_oe=(e,t,n,r)=>{let o=e._zod.def;Or(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Eoe=(e,t,n,r)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;Or(s,t,r);let u=t.seen.get(e);u.ref=s},yoe=(e,t,n,r)=>{let o=e._zod.def;Or(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Soe=(e,t,n,r)=>{let o=e._zod.def;Or(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},jj=(e,t,n,r)=>{let o=e._zod.def;Or(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Toe=(e,t,n,r)=>{let o=e._zod.innerType;Or(o,t,r);let i=t.seen.get(e);i.ref=o},Fj={string:Fre,number:Gre,boolean:jre,bigint:zre,symbol:Hre,null:$re,undefined:qre,void:Vre,never:Yre,any:Kre,unknown:Jre,date:Zre,enum:Wre,literal:Xre,nan:eoe,template_literal:toe,file:noe,success:roe,custom:ooe,function:ioe,transform:soe,map:aoe,set:uoe,array:coe,object:loe,union:Gj,intersection:doe,tuple:poe,record:foe,nullable:moe,nonoptional:Aoe,default:goe,prefault:hoe,catch:_oe,pipe:Eoe,readonly:yoe,promise:Soe,optional:jj,lazy:Toe}});var Hj,D3e=w(()=>{m();lk();ck();Hj=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=ZE({processors:Fj,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return Or(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),WE(this.ctx,t);let r=XE(this.ctx,t),{"~standard":o,...i}=r;return i}}});var N3e={};var B3e=w(()=>{m()});var uh={};Zs(uh,{$ZodAny:()=>Ane,$ZodArray:()=>yne,$ZodAsyncError:()=>kf,$ZodBase64:()=>ine,$ZodBase64URL:()=>sne,$ZodBigInt:()=>sj,$ZodBigIntFormat:()=>dne,$ZodBoolean:()=>tk,$ZodCIDRv4:()=>nne,$ZodCIDRv6:()=>rne,$ZodCUID:()=>Hte,$ZodCUID2:()=>$te,$ZodCatch:()=>Une,$ZodCheck:()=>no,$ZodCheckBigIntFormat:()=>_te,$ZodCheckEndsWith:()=>Nte,$ZodCheckGreaterThan:()=>XG,$ZodCheckIncludes:()=>xte,$ZodCheckLengthEquals:()=>Ite,$ZodCheckLessThan:()=>WG,$ZodCheckLowerCase:()=>vte,$ZodCheckMaxLength:()=>Tte,$ZodCheckMaxSize:()=>Ete,$ZodCheckMimeType:()=>wte,$ZodCheckMinLength:()=>bte,$ZodCheckMinSize:()=>yte,$ZodCheckMultipleOf:()=>gte,$ZodCheckNumberFormat:()=>hte,$ZodCheckOverwrite:()=>Ote,$ZodCheckProperty:()=>Bte,$ZodCheckRegex:()=>Cte,$ZodCheckSizeEquals:()=>Ste,$ZodCheckStartsWith:()=>Dte,$ZodCheckStringFormat:()=>mx,$ZodCheckUpperCase:()=>Rte,$ZodCodec:()=>rk,$ZodCustom:()=>qne,$ZodCustomStringFormat:()=>cne,$ZodDate:()=>Ene,$ZodDefault:()=>kne,$ZodDiscriminatedUnion:()=>bne,$ZodE164:()=>ane,$ZodEmail:()=>Fte,$ZodEmoji:()=>jte,$ZodEncodeError:()=>HE,$ZodEnum:()=>xne,$ZodError:()=>KO,$ZodExactOptional:()=>wne,$ZodFile:()=>Nne,$ZodFunction:()=>zne,$ZodGUID:()=>Ute,$ZodIPv4:()=>Xte,$ZodIPv6:()=>ene,$ZodISODate:()=>Jte,$ZodISODateTime:()=>Kte,$ZodISODuration:()=>Wte,$ZodISOTime:()=>Zte,$ZodIntersection:()=>Ine,$ZodJWT:()=>une,$ZodKSUID:()=>Yte,$ZodLazy:()=>$ne,$ZodLiteral:()=>Dne,$ZodMAC:()=>tne,$ZodMap:()=>vne,$ZodNaN:()=>Qne,$ZodNanoID:()=>zte,$ZodNever:()=>hne,$ZodNonOptional:()=>Mne,$ZodNull:()=>mne,$ZodNullable:()=>One,$ZodNumber:()=>ij,$ZodNumberFormat:()=>lne,$ZodObject:()=>BFe,$ZodObjectJIT:()=>Sne,$ZodOptional:()=>uj,$ZodPipe:()=>cj,$ZodPrefault:()=>Pne,$ZodPreprocess:()=>Fne,$ZodPromise:()=>Hne,$ZodReadonly:()=>Gne,$ZodRealError:()=>nl,$ZodRecord:()=>Cne,$ZodRegistry:()=>fj,$ZodSet:()=>Rne,$ZodString:()=>xT,$ZodStringFormat:()=>Kr,$ZodSuccess:()=>Lne,$ZodSymbol:()=>pne,$ZodTemplateLiteral:()=>jne,$ZodTransform:()=>Bne,$ZodTuple:()=>aj,$ZodType:()=>cn,$ZodULID:()=>qte,$ZodURL:()=>Gte,$ZodUUID:()=>Qte,$ZodUndefined:()=>fne,$ZodUnion:()=>nk,$ZodUnknown:()=>gne,$ZodVoid:()=>_ne,$ZodXID:()=>Vte,$ZodXor:()=>Tne,$brand:()=>bee,$constructor:()=>ie,$input:()=>Xne,$output:()=>Wne,Doc:()=>ek,JSONSchema:()=>N3e,JSONSchemaGenerator:()=>Hj,NEVER:()=>Tee,TimePrecision:()=>rre,_any:()=>Ire,_array:()=>Bre,_base64:()=>Bj,_base64url:()=>wj,_bigint:()=>hre,_boolean:()=>Are,_catch:()=>RMt,_check:()=>R3e,_cidrv4:()=>Dj,_cidrv6:()=>Nj,_coercedBigint:()=>_re,_coercedBoolean:()=>gre,_coercedDate:()=>Dre,_coercedNumber:()=>cre,_coercedString:()=>tre,_cuid:()=>Tj,_cuid2:()=>bj,_custom:()=>Ore,_date:()=>xre,_decode:()=>jG,_decodeAsync:()=>HG,_default:()=>IMt,_discriminatedUnion:()=>pMt,_e164:()=>Oj,_email:()=>Aj,_emoji:()=>yj,_encode:()=>GG,_encodeAsync:()=>zG,_endsWith:()=>Sx,_enum:()=>_Mt,_file:()=>wre,_float32:()=>dre,_float64:()=>pre,_gt:()=>dA,_gte:()=>lc,_guid:()=>ak,_includes:()=>Ex,_int:()=>lre,_int32:()=>fre,_int64:()=>Ere,_intersection:()=>fMt,_ipv4:()=>Rj,_ipv6:()=>xj,_isoDate:()=>ire,_isoDateTime:()=>ore,_isoDuration:()=>are,_isoTime:()=>sre,_jwt:()=>kj,_ksuid:()=>vj,_lazy:()=>BMt,_length:()=>BT,_literal:()=>yMt,_lowercase:()=>hx,_lt:()=>lA,_lte:()=>id,_mac:()=>nre,_map:()=>gMt,_max:()=>id,_maxLength:()=>NT,_maxSize:()=>JE,_mime:()=>Tx,_min:()=>lc,_minLength:()=>ah,_minSize:()=>pA,_multipleOf:()=>KE,_nan:()=>Nre,_nanoid:()=>Sj,_nativeEnum:()=>EMt,_negative:()=>Mj,_never:()=>vre,_nonnegative:()=>Uj,_nonoptional:()=>CMt,_nonpositive:()=>Lj,_normalize:()=>bx,_null:()=>bre,_nullable:()=>bMt,_number:()=>ure,_optional:()=>TMt,_overwrite:()=>Pf,_parse:()=>lx,_parseAsync:()=>dx,_pipe:()=>xMt,_positive:()=>Pj,_promise:()=>wMt,_property:()=>Qj,_readonly:()=>DMt,_record:()=>AMt,_refine:()=>kre,_regex:()=>gx,_safeDecode:()=>qG,_safeDecodeAsync:()=>YG,_safeEncode:()=>$G,_safeEncodeAsync:()=>VG,_safeParse:()=>px,_safeParseAsync:()=>fx,_set:()=>hMt,_size:()=>DT,_slugify:()=>Rx,_startsWith:()=>yx,_string:()=>ere,_stringFormat:()=>xx,_stringbool:()=>Ure,_success:()=>vMt,_superRefine:()=>Pre,_symbol:()=>Sre,_templateLiteral:()=>NMt,_toLowerCase:()=>Cx,_toUpperCase:()=>vx,_transform:()=>SMt,_trim:()=>Ix,_tuple:()=>mMt,_uint32:()=>mre,_uint64:()=>yre,_ulid:()=>Ij,_undefined:()=>Tre,_union:()=>lMt,_unknown:()=>Cre,_uppercase:()=>_x,_url:()=>uk,_uuid:()=>gj,_uuidv4:()=>hj,_uuidv6:()=>_j,_uuidv7:()=>Ej,_void:()=>Rre,_xid:()=>Cj,_xor:()=>dMt,clone:()=>uc,config:()=>bi,createStandardJSONSchemaMethod:()=>Dx,createToJSONSchemaMethod:()=>Qre,decode:()=>wkt,decodeAsync:()=>kkt,describe:()=>Mre,encode:()=>Bkt,encodeAsync:()=>Okt,extractDefs:()=>WE,finalize:()=>XE,flattenError:()=>JO,formatError:()=>ZO,globalConfig:()=>IT,globalRegistry:()=>Ua,initializeContext:()=>ZE,isValidBase64:()=>one,isValidBase64URL:()=>RFe,isValidJWT:()=>xFe,locales:()=>ik,meta:()=>Lre,parse:()=>QG,parseAsync:()=>FG,prettifyError:()=>Mee,process:()=>Or,regexes:()=>od,registry:()=>mj,safeDecode:()=>Mkt,safeDecodeAsync:()=>Ukt,safeEncode:()=>Pkt,safeEncodeAsync:()=>Lkt,safeParse:()=>Uee,safeParseAsync:()=>Qee,toDotPath:()=>sFe,toJSONSchema:()=>zj,treeifyError:()=>Pee,util:()=>Le,version:()=>Pte});var sd=w(()=>{m();CT();Fee();Lee();Vne();ej();Mte();St();ZG();Zne();sk();kte();x3e();ck();lk();D3e();B3e()});var $j={};Zs($j,{endsWith:()=>Sx,gt:()=>dA,gte:()=>lc,includes:()=>Ex,length:()=>BT,lowercase:()=>hx,lt:()=>lA,lte:()=>id,maxLength:()=>NT,maxSize:()=>JE,mime:()=>Tx,minLength:()=>ah,minSize:()=>pA,multipleOf:()=>KE,negative:()=>Mj,nonnegative:()=>Uj,nonpositive:()=>Lj,normalize:()=>bx,overwrite:()=>Pf,positive:()=>Pj,property:()=>Qj,regex:()=>gx,size:()=>DT,slugify:()=>Rx,startsWith:()=>yx,toLowerCase:()=>Cx,toUpperCase:()=>vx,trim:()=>Ix,uppercase:()=>_x});var qj=w(()=>{m();sd()});var Nx={};Zs(Nx,{ZodISODate:()=>Yj,ZodISODateTime:()=>Vj,ZodISODuration:()=>Jj,ZodISOTime:()=>Kj,date:()=>Ioe,datetime:()=>boe,duration:()=>voe,time:()=>Coe});function boe(e){return ore(Vj,e)}function Ioe(e){return ire(Yj,e)}function Coe(e){return sre(Kj,e)}function voe(e){return are(Jj,e)}var Vj,Yj,Kj,Jj,dk=w(()=>{m();sd();fk();Vj=ie("ZodISODateTime",(e,t)=>{Kte.init(e,t),Jr.init(e,t)});Yj=ie("ZodISODate",(e,t)=>{Jte.init(e,t),Jr.init(e,t)});Kj=ie("ZodISOTime",(e,t)=>{Zte.init(e,t),Jr.init(e,t)});Jj=ie("ZodISODuration",(e,t)=>{Wte.init(e,t),Jr.init(e,t)})});var w3e,PMt,rl,Roe=w(()=>{m();sd();sd();St();w3e=(e,t)=>{KO.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ZO(e,n)},flatten:{value:n=>JO(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ax,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ax,2)}},isEmpty:{get(){return e.issues.length===0}}})},PMt=ie("ZodError",w3e),rl=ie("ZodError",w3e,{Parent:Error})});var xoe,Doe,Noe,Boe,woe,Ooe,koe,Poe,Moe,Loe,Uoe,Qoe,Foe=w(()=>{m();sd();Roe();xoe=lx(rl),Doe=dx(rl),Noe=px(rl),Boe=fx(rl),woe=GG(rl),Ooe=jG(rl),koe=zG(rl),Poe=HG(rl),Moe=$G(rl),Loe=qG(rl),Uoe=VG(rl),Qoe=YG(rl)});var pk={};Zs(pk,{ZodAny:()=>Yoe,ZodArray:()=>Woe,ZodBase64:()=>pz,ZodBase64URL:()=>fz,ZodBigInt:()=>Lx,ZodBigIntFormat:()=>gz,ZodBoolean:()=>Mx,ZodCIDRv4:()=>lz,ZodCIDRv6:()=>dz,ZodCUID:()=>rz,ZodCUID2:()=>oz,ZodCatch:()=>yie,ZodCodec:()=>Ck,ZodCustom:()=>vk,ZodCustomStringFormat:()=>kx,ZodDate:()=>yk,ZodDefault:()=>mie,ZodDiscriminatedUnion:()=>eie,ZodE164:()=>mz,ZodEmail:()=>ez,ZodEmoji:()=>tz,ZodEnum:()=>wx,ZodExactOptional:()=>die,ZodFile:()=>cie,ZodFunction:()=>Nie,ZodGUID:()=>Ak,ZodIPv4:()=>uz,ZodIPv6:()=>cz,ZodIntersection:()=>tie,ZodJWT:()=>Az,ZodKSUID:()=>az,ZodLazy:()=>Rie,ZodLiteral:()=>uie,ZodMAC:()=>Goe,ZodMap:()=>sie,ZodNaN:()=>Tie,ZodNanoID:()=>nz,ZodNever:()=>Joe,ZodNonOptional:()=>Tz,ZodNull:()=>qoe,ZodNullable:()=>fie,ZodNumber:()=>Px,ZodNumberFormat:()=>OT,ZodObject:()=>Tk,ZodOptional:()=>Sz,ZodPipe:()=>Ik,ZodPrefault:()=>gie,ZodPreprocess:()=>bie,ZodPromise:()=>Die,ZodReadonly:()=>Iie,ZodRecord:()=>Bx,ZodSet:()=>aie,ZodString:()=>Ox,ZodStringFormat:()=>Jr,ZodSuccess:()=>Eie,ZodSymbol:()=>Hoe,ZodTemplateLiteral:()=>vie,ZodTransform:()=>lie,ZodTuple:()=>rie,ZodType:()=>Nn,ZodULID:()=>iz,ZodURL:()=>Ek,ZodUUID:()=>fA,ZodUndefined:()=>$oe,ZodUnion:()=>bk,ZodUnknown:()=>Koe,ZodVoid:()=>Zoe,ZodXID:()=>sz,ZodXor:()=>Xoe,_ZodString:()=>Xj,_default:()=>Aie,_function:()=>F6e,any:()=>h6e,array:()=>Sk,base64:()=>e6e,base64url:()=>t6e,bigint:()=>p6e,boolean:()=>zoe,catch:()=>Sie,check:()=>G6e,cidrv4:()=>W3e,cidrv6:()=>X3e,codec:()=>M6e,cuid:()=>H3e,cuid2:()=>$3e,custom:()=>j6e,date:()=>E6e,describe:()=>z6e,discriminatedUnion:()=>C6e,e164:()=>n6e,email:()=>k3e,emoji:()=>j3e,enum:()=>Ez,exactOptional:()=>pie,file:()=>w6e,float32:()=>u6e,float64:()=>c6e,function:()=>F6e,guid:()=>P3e,hash:()=>a6e,hex:()=>s6e,hostname:()=>i6e,httpUrl:()=>G3e,instanceof:()=>$6e,int:()=>Zj,int32:()=>l6e,int64:()=>f6e,intersection:()=>nie,invertCodec:()=>L6e,ipv4:()=>K3e,ipv6:()=>Z3e,json:()=>V6e,jwt:()=>r6e,keyof:()=>y6e,ksuid:()=>Y3e,lazy:()=>xie,literal:()=>B6e,looseObject:()=>b6e,looseRecord:()=>R6e,mac:()=>J3e,map:()=>x6e,meta:()=>H6e,nan:()=>P6e,nanoid:()=>z3e,nativeEnum:()=>N6e,never:()=>hz,nonoptional:()=>_ie,null:()=>Voe,nullable:()=>hk,nullish:()=>O6e,number:()=>joe,object:()=>S6e,optional:()=>gk,partialRecord:()=>v6e,pipe:()=>Wj,prefault:()=>hie,preprocess:()=>Y6e,promise:()=>Q6e,readonly:()=>Cie,record:()=>iie,refine:()=>Bie,set:()=>D6e,strictObject:()=>T6e,string:()=>mk,stringFormat:()=>o6e,stringbool:()=>q6e,success:()=>k6e,superRefine:()=>wie,symbol:()=>A6e,templateLiteral:()=>U6e,transform:()=>yz,tuple:()=>oie,uint32:()=>d6e,uint64:()=>m6e,ulid:()=>q3e,undefined:()=>g6e,union:()=>_z,unknown:()=>wT,url:()=>F3e,uuid:()=>M3e,uuidv4:()=>L3e,uuidv6:()=>U3e,uuidv7:()=>Q3e,void:()=>_6e,xid:()=>V3e,xor:()=>I6e});function _k(e,t,n){let r=Object.getPrototypeOf(e),o=O3e.get(r);if(o||(o=new Set,O3e.set(r,o)),!o.has(t)){o.add(t);for(let i in n){let s=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){let u=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:u}),u},set(u){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:u})}})}}}function mk(e){return ere(Ox,e)}function k3e(e){return Aj(ez,e)}function P3e(e){return ak(Ak,e)}function M3e(e){return gj(fA,e)}function L3e(e){return hj(fA,e)}function U3e(e){return _j(fA,e)}function Q3e(e){return Ej(fA,e)}function F3e(e){return uk(Ek,e)}function G3e(e){return uk(Ek,{protocol:od.httpProtocol,hostname:od.domain,...Le.normalizeParams(e)})}function j3e(e){return yj(tz,e)}function z3e(e){return Sj(nz,e)}function H3e(e){return Tj(rz,e)}function $3e(e){return bj(oz,e)}function q3e(e){return Ij(iz,e)}function V3e(e){return Cj(sz,e)}function Y3e(e){return vj(az,e)}function K3e(e){return Rj(uz,e)}function J3e(e){return nre(Goe,e)}function Z3e(e){return xj(cz,e)}function W3e(e){return Dj(lz,e)}function X3e(e){return Nj(dz,e)}function e6e(e){return Bj(pz,e)}function t6e(e){return wj(fz,e)}function n6e(e){return Oj(mz,e)}function r6e(e){return kj(Az,e)}function o6e(e,t,n={}){return xx(kx,e,t,n)}function i6e(e){return xx(kx,"hostname",od.hostname,e)}function s6e(e){return xx(kx,"hex",od.hex,e)}function a6e(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,o=od[r];if(!o)throw new Error(`Unrecognized hash format: ${r}`);return xx(kx,r,o,t)}function joe(e){return ure(Px,e)}function Zj(e){return lre(OT,e)}function u6e(e){return dre(OT,e)}function c6e(e){return pre(OT,e)}function l6e(e){return fre(OT,e)}function d6e(e){return mre(OT,e)}function zoe(e){return Are(Mx,e)}function p6e(e){return hre(Lx,e)}function f6e(e){return Ere(gz,e)}function m6e(e){return yre(gz,e)}function A6e(e){return Sre(Hoe,e)}function g6e(e){return Tre($oe,e)}function Voe(e){return bre(qoe,e)}function h6e(){return Ire(Yoe)}function wT(){return Cre(Koe)}function hz(e){return vre(Joe,e)}function _6e(e){return Rre(Zoe,e)}function E6e(e){return xre(yk,e)}function Sk(e,t){return Bre(Woe,e,t)}function y6e(e){let t=e._zod.def.shape;return Ez(Object.keys(t))}function S6e(e,t){let n={type:"object",shape:e??{},...Le.normalizeParams(t)};return new Tk(n)}function T6e(e,t){return new Tk({type:"object",shape:e,catchall:hz(),...Le.normalizeParams(t)})}function b6e(e,t){return new Tk({type:"object",shape:e,catchall:wT(),...Le.normalizeParams(t)})}function _z(e,t){return new bk({type:"union",options:e,...Le.normalizeParams(t)})}function I6e(e,t){return new Xoe({type:"union",options:e,inclusive:!1,...Le.normalizeParams(t)})}function C6e(e,t,n){return new eie({type:"union",options:t,discriminator:e,...Le.normalizeParams(n)})}function nie(e,t){return new tie({type:"intersection",left:e,right:t})}function oie(e,t,n){let r=t instanceof cn,o=r?n:t,i=r?t:null;return new rie({type:"tuple",items:e,rest:i,...Le.normalizeParams(o)})}function iie(e,t,n){return!t||!t._zod?new Bx({type:"record",keyType:mk(),valueType:e,...Le.normalizeParams(t)}):new Bx({type:"record",keyType:e,valueType:t,...Le.normalizeParams(n)})}function v6e(e,t,n){let r=uc(e);return r._zod.values=void 0,new Bx({type:"record",keyType:r,valueType:t,...Le.normalizeParams(n)})}function R6e(e,t,n){return new Bx({type:"record",keyType:e,valueType:t,mode:"loose",...Le.normalizeParams(n)})}function x6e(e,t,n){return new sie({type:"map",keyType:e,valueType:t,...Le.normalizeParams(n)})}function D6e(e,t){return new aie({type:"set",valueType:e,...Le.normalizeParams(t)})}function Ez(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new wx({type:"enum",entries:n,...Le.normalizeParams(t)})}function N6e(e,t){return new wx({type:"enum",entries:e,...Le.normalizeParams(t)})}function B6e(e,t){return new uie({type:"literal",values:Array.isArray(e)?e:[e],...Le.normalizeParams(t)})}function w6e(e){return wre(cie,e)}function yz(e){return new lie({type:"transform",transform:e})}function gk(e){return new Sz({type:"optional",innerType:e})}function pie(e){return new die({type:"optional",innerType:e})}function hk(e){return new fie({type:"nullable",innerType:e})}function O6e(e){return gk(hk(e))}function Aie(e,t){return new mie({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Le.shallowClone(t)}})}function hie(e,t){return new gie({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Le.shallowClone(t)}})}function _ie(e,t){return new Tz({type:"nonoptional",innerType:e,...Le.normalizeParams(t)})}function k6e(e){return new Eie({type:"success",innerType:e})}function Sie(e,t){return new yie({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function P6e(e){return Nre(Tie,e)}function Wj(e,t){return new Ik({type:"pipe",in:e,out:t})}function M6e(e,t,n){return new Ck({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function L6e(e){let t=e._zod.def;return new Ck({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Cie(e){return new Iie({type:"readonly",innerType:e})}function U6e(e,t){return new vie({type:"template_literal",parts:e,...Le.normalizeParams(t)})}function xie(e){return new Rie({type:"lazy",getter:e})}function Q6e(e){return new Die({type:"promise",innerType:e})}function F6e(e){return new Nie({type:"function",input:Array.isArray(e?.input)?oie(e?.input):e?.input??Sk(wT()),output:e?.output??wT()})}function G6e(e){let t=new no({check:"custom"});return t._zod.check=e,t}function j6e(e,t){return Ore(vk,e??(()=>!0),t)}function Bie(e,t={}){return kre(vk,e,t)}function wie(e,t){return Pre(e,t)}function $6e(e,t={}){let n=new vk({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Le.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function V6e(e){let t=xie(()=>_z([mk(e),joe(),zoe(),Voe(),Sk(t),iie(mk(),t)]));return t}function Y6e(e,t){return new bie({type:"pipe",in:yz(e),out:t})}var O3e,Nn,Xj,Ox,Jr,ez,Ak,fA,Ek,tz,nz,rz,oz,iz,sz,az,uz,Goe,cz,lz,dz,pz,fz,mz,Az,kx,Px,OT,Mx,Lx,gz,Hoe,$oe,qoe,Yoe,Koe,Joe,Zoe,yk,Woe,Tk,bk,Xoe,eie,tie,rie,Bx,sie,aie,wx,uie,cie,lie,Sz,die,fie,mie,gie,Tz,Eie,yie,Tie,Ik,Ck,bie,Iie,vie,Rie,Die,Nie,vk,z6e,H6e,q6e,fk=w(()=>{m();sd();sd();lk();ck();qj();dk();Foe();O3e=new WeakMap;Nn=ie("ZodType",(e,t)=>(cn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Dx(e,"input"),output:Dx(e,"output")}}),e.toJSONSchema=Qre(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>xoe(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Noe(e,n,r),e.parseAsync=async(n,r)=>Doe(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Boe(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>woe(e,n,r),e.decode=(n,r)=>Ooe(e,n,r),e.encodeAsync=async(n,r)=>koe(e,n,r),e.decodeAsync=async(n,r)=>Poe(e,n,r),e.safeEncode=(n,r)=>Moe(e,n,r),e.safeDecode=(n,r)=>Loe(e,n,r),e.safeEncodeAsync=async(n,r)=>Uoe(e,n,r),e.safeDecodeAsync=async(n,r)=>Qoe(e,n,r),_k(e,"ZodType",{check(...n){let r=this.def;return this.clone(Le.mergeDefs(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return uc(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(Bie(n,r))},superRefine(n,r){return this.check(wie(n,r))},overwrite(n){return this.check(Pf(n))},optional(){return gk(this)},exactOptional(){return pie(this)},nullable(){return hk(this)},nullish(){return gk(hk(this))},nonoptional(n){return _ie(this,n)},array(){return Sk(this)},or(n){return _z([this,n])},and(n){return nie(this,n)},transform(n){return Wj(this,yz(n))},default(n){return Aie(this,n)},prefault(n){return hie(this,n)},catch(n){return Sie(this,n)},pipe(n){return Wj(this,n)},readonly(){return Cie(this)},describe(n){let r=this.clone();return Ua.add(r,{description:n}),r},meta(...n){if(n.length===0)return Ua.get(this);let r=this.clone();return Ua.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Ua.get(e)?.description},configurable:!0}),e)),Xj=ie("_ZodString",(e,t)=>{xT.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Fre(e,r,o,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,_k(e,"_ZodString",{regex(...r){return this.check(gx(...r))},includes(...r){return this.check(Ex(...r))},startsWith(...r){return this.check(yx(...r))},endsWith(...r){return this.check(Sx(...r))},min(...r){return this.check(ah(...r))},max(...r){return this.check(NT(...r))},length(...r){return this.check(BT(...r))},nonempty(...r){return this.check(ah(1,...r))},lowercase(r){return this.check(hx(r))},uppercase(r){return this.check(_x(r))},trim(){return this.check(Ix())},normalize(...r){return this.check(bx(...r))},toLowerCase(){return this.check(Cx())},toUpperCase(){return this.check(vx())},slugify(){return this.check(Rx())}})}),Ox=ie("ZodString",(e,t)=>{xT.init(e,t),Xj.init(e,t),e.email=n=>e.check(Aj(ez,n)),e.url=n=>e.check(uk(Ek,n)),e.jwt=n=>e.check(kj(Az,n)),e.emoji=n=>e.check(yj(tz,n)),e.guid=n=>e.check(ak(Ak,n)),e.uuid=n=>e.check(gj(fA,n)),e.uuidv4=n=>e.check(hj(fA,n)),e.uuidv6=n=>e.check(_j(fA,n)),e.uuidv7=n=>e.check(Ej(fA,n)),e.nanoid=n=>e.check(Sj(nz,n)),e.guid=n=>e.check(ak(Ak,n)),e.cuid=n=>e.check(Tj(rz,n)),e.cuid2=n=>e.check(bj(oz,n)),e.ulid=n=>e.check(Ij(iz,n)),e.base64=n=>e.check(Bj(pz,n)),e.base64url=n=>e.check(wj(fz,n)),e.xid=n=>e.check(Cj(sz,n)),e.ksuid=n=>e.check(vj(az,n)),e.ipv4=n=>e.check(Rj(uz,n)),e.ipv6=n=>e.check(xj(cz,n)),e.cidrv4=n=>e.check(Dj(lz,n)),e.cidrv6=n=>e.check(Nj(dz,n)),e.e164=n=>e.check(Oj(mz,n)),e.datetime=n=>e.check(boe(n)),e.date=n=>e.check(Ioe(n)),e.time=n=>e.check(Coe(n)),e.duration=n=>e.check(voe(n))});Jr=ie("ZodStringFormat",(e,t)=>{Kr.init(e,t),Xj.init(e,t)}),ez=ie("ZodEmail",(e,t)=>{Fte.init(e,t),Jr.init(e,t)});Ak=ie("ZodGUID",(e,t)=>{Ute.init(e,t),Jr.init(e,t)});fA=ie("ZodUUID",(e,t)=>{Qte.init(e,t),Jr.init(e,t)});Ek=ie("ZodURL",(e,t)=>{Gte.init(e,t),Jr.init(e,t)});tz=ie("ZodEmoji",(e,t)=>{jte.init(e,t),Jr.init(e,t)});nz=ie("ZodNanoID",(e,t)=>{zte.init(e,t),Jr.init(e,t)});rz=ie("ZodCUID",(e,t)=>{Hte.init(e,t),Jr.init(e,t)});oz=ie("ZodCUID2",(e,t)=>{$te.init(e,t),Jr.init(e,t)});iz=ie("ZodULID",(e,t)=>{qte.init(e,t),Jr.init(e,t)});sz=ie("ZodXID",(e,t)=>{Vte.init(e,t),Jr.init(e,t)});az=ie("ZodKSUID",(e,t)=>{Yte.init(e,t),Jr.init(e,t)});uz=ie("ZodIPv4",(e,t)=>{Xte.init(e,t),Jr.init(e,t)});Goe=ie("ZodMAC",(e,t)=>{tne.init(e,t),Jr.init(e,t)});cz=ie("ZodIPv6",(e,t)=>{ene.init(e,t),Jr.init(e,t)});lz=ie("ZodCIDRv4",(e,t)=>{nne.init(e,t),Jr.init(e,t)});dz=ie("ZodCIDRv6",(e,t)=>{rne.init(e,t),Jr.init(e,t)});pz=ie("ZodBase64",(e,t)=>{ine.init(e,t),Jr.init(e,t)});fz=ie("ZodBase64URL",(e,t)=>{sne.init(e,t),Jr.init(e,t)});mz=ie("ZodE164",(e,t)=>{ane.init(e,t),Jr.init(e,t)});Az=ie("ZodJWT",(e,t)=>{une.init(e,t),Jr.init(e,t)});kx=ie("ZodCustomStringFormat",(e,t)=>{cne.init(e,t),Jr.init(e,t)});Px=ie("ZodNumber",(e,t)=>{ij.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Gre(e,r,o,i),_k(e,"ZodNumber",{gt(r,o){return this.check(dA(r,o))},gte(r,o){return this.check(lc(r,o))},min(r,o){return this.check(lc(r,o))},lt(r,o){return this.check(lA(r,o))},lte(r,o){return this.check(id(r,o))},max(r,o){return this.check(id(r,o))},int(r){return this.check(Zj(r))},safe(r){return this.check(Zj(r))},positive(r){return this.check(dA(0,r))},nonnegative(r){return this.check(lc(0,r))},negative(r){return this.check(lA(0,r))},nonpositive(r){return this.check(id(0,r))},multipleOf(r,o){return this.check(KE(r,o))},step(r,o){return this.check(KE(r,o))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});OT=ie("ZodNumberFormat",(e,t)=>{lne.init(e,t),Px.init(e,t)});Mx=ie("ZodBoolean",(e,t)=>{tk.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jre(e,n,r,o)});Lx=ie("ZodBigInt",(e,t)=>{sj.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(r,o,i)=>zre(e,r,o,i),e.gte=(r,o)=>e.check(lc(r,o)),e.min=(r,o)=>e.check(lc(r,o)),e.gt=(r,o)=>e.check(dA(r,o)),e.gte=(r,o)=>e.check(lc(r,o)),e.min=(r,o)=>e.check(lc(r,o)),e.lt=(r,o)=>e.check(lA(r,o)),e.lte=(r,o)=>e.check(id(r,o)),e.max=(r,o)=>e.check(id(r,o)),e.positive=r=>e.check(dA(BigInt(0),r)),e.negative=r=>e.check(lA(BigInt(0),r)),e.nonpositive=r=>e.check(id(BigInt(0),r)),e.nonnegative=r=>e.check(lc(BigInt(0),r)),e.multipleOf=(r,o)=>e.check(KE(r,o));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});gz=ie("ZodBigIntFormat",(e,t)=>{dne.init(e,t),Lx.init(e,t)});Hoe=ie("ZodSymbol",(e,t)=>{pne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hre(e,n,r,o)});$oe=ie("ZodUndefined",(e,t)=>{fne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qre(e,n,r,o)});qoe=ie("ZodNull",(e,t)=>{mne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$re(e,n,r,o)});Yoe=ie("ZodAny",(e,t)=>{Ane.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kre(e,n,r,o)});Koe=ie("ZodUnknown",(e,t)=>{gne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jre(e,n,r,o)});Joe=ie("ZodNever",(e,t)=>{hne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yre(e,n,r,o)});Zoe=ie("ZodVoid",(e,t)=>{_ne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vre(e,n,r,o)});yk=ie("ZodDate",(e,t)=>{Ene.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Zre(e,r,o,i),e.min=(r,o)=>e.check(lc(r,o)),e.max=(r,o)=>e.check(id(r,o));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});Woe=ie("ZodArray",(e,t)=>{yne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>coe(e,n,r,o),e.element=t.element,_k(e,"ZodArray",{min(n,r){return this.check(ah(n,r))},nonempty(n){return this.check(ah(1,n))},max(n,r){return this.check(NT(n,r))},length(n,r){return this.check(BT(n,r))},unwrap(){return this.element}})});Tk=ie("ZodObject",(e,t)=>{Sne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>loe(e,n,r,o),Le.defineLazy(e,"shape",()=>t.shape),_k(e,"ZodObject",{keyof(){return Ez(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:wT()})},loose(){return this.clone({...this._zod.def,catchall:wT()})},strict(){return this.clone({...this._zod.def,catchall:hz()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Le.extend(this,n)},safeExtend(n){return Le.safeExtend(this,n)},merge(n){return Le.merge(this,n)},pick(n){return Le.pick(this,n)},omit(n){return Le.omit(this,n)},partial(...n){return Le.partial(Sz,this,n[0])},required(...n){return Le.required(Tz,this,n[0])}})});bk=ie("ZodUnion",(e,t)=>{nk.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gj(e,n,r,o),e.options=t.options});Xoe=ie("ZodXor",(e,t)=>{bk.init(e,t),Tne.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gj(e,n,r,o),e.options=t.options});eie=ie("ZodDiscriminatedUnion",(e,t)=>{bk.init(e,t),bne.init(e,t)});tie=ie("ZodIntersection",(e,t)=>{Ine.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>doe(e,n,r,o)});rie=ie("ZodTuple",(e,t)=>{aj.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>poe(e,n,r,o),e.rest=n=>e.clone({...e._zod.def,rest:n})});Bx=ie("ZodRecord",(e,t)=>{Cne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>foe(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});sie=ie("ZodMap",(e,t)=>{vne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aoe(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(pA(...n)),e.nonempty=n=>e.check(pA(1,n)),e.max=(...n)=>e.check(JE(...n)),e.size=(...n)=>e.check(DT(...n))});aie=ie("ZodSet",(e,t)=>{Rne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uoe(e,n,r,o),e.min=(...n)=>e.check(pA(...n)),e.nonempty=n=>e.check(pA(1,n)),e.max=(...n)=>e.check(JE(...n)),e.size=(...n)=>e.check(DT(...n))});wx=ie("ZodEnum",(e,t)=>{xne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Wre(e,r,o,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let i={};for(let s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new wx({...t,checks:[],...Le.normalizeParams(o),entries:i})},e.exclude=(r,o)=>{let i={...t.entries};for(let s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new wx({...t,checks:[],...Le.normalizeParams(o),entries:i})}});uie=ie("ZodLiteral",(e,t)=>{Dne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xre(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});cie=ie("ZodFile",(e,t)=>{Nne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>noe(e,n,r,o),e.min=(n,r)=>e.check(pA(n,r)),e.max=(n,r)=>e.check(JE(n,r)),e.mime=(n,r)=>e.check(Tx(Array.isArray(n)?n:[n],r))});lie=ie("ZodTransform",(e,t)=>{Bne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>soe(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new HE(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Le.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(Le.issue(s))}};let o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});Sz=ie("ZodOptional",(e,t)=>{uj.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jj(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});die=ie("ZodExactOptional",(e,t)=>{wne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jj(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});fie=ie("ZodNullable",(e,t)=>{One.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>moe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});mie=ie("ZodDefault",(e,t)=>{kne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>goe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});gie=ie("ZodPrefault",(e,t)=>{Pne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hoe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Tz=ie("ZodNonOptional",(e,t)=>{Mne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Aoe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Eie=ie("ZodSuccess",(e,t)=>{Lne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>roe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});yie=ie("ZodCatch",(e,t)=>{Une.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_oe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Tie=ie("ZodNaN",(e,t)=>{Qne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eoe(e,n,r,o)});Ik=ie("ZodPipe",(e,t)=>{cj.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Eoe(e,n,r,o),e.in=t.in,e.out=t.out});Ck=ie("ZodCodec",(e,t)=>{Ik.init(e,t),rk.init(e,t)});bie=ie("ZodPreprocess",(e,t)=>{Ik.init(e,t),Fne.init(e,t)}),Iie=ie("ZodReadonly",(e,t)=>{Gne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yoe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});vie=ie("ZodTemplateLiteral",(e,t)=>{jne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>toe(e,n,r,o)});Rie=ie("ZodLazy",(e,t)=>{$ne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Toe(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});Die=ie("ZodPromise",(e,t)=>{Hne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Soe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Nie=ie("ZodFunction",(e,t)=>{zne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ioe(e,n,r,o)});vk=ie("ZodCustom",(e,t)=>{qne.init(e,t),Nn.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ooe(e,n,r,o)});z6e=Mre,H6e=Lre;q6e=(...e)=>Ure({Codec:Ck,Boolean:Mx,String:Ox},...e)});function UMt(e){bi({customError:e})}function QMt(){return bi().customError}var LMt,Oie,K6e=w(()=>{m();sd();LMt={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Oie||(Oie={})});function GMt(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function jMt(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let o=n[1];if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function J6e(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Xe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return Xe.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=jMt(o,t),s=Tu(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return Xe.null();if(o.length===0)return Xe.never();if(o.length===1)return Xe.literal(o[0]);if(o.every(s=>typeof s=="string"))return Xe.enum(o);let i=o.map(s=>Xe.literal(s));return i.length<2?i[0]:Xe.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return Xe.literal(e.const);let n=e.type;if(Array.isArray(n)){let o=n.map(i=>{let s={...e,type:i};return J6e(s,t)});return o.length===0?Xe.never():o.length===1?o[0]:Xe.union(o)}if(!n)return Xe.any();let r;switch(n){case"string":{let o=Xe.string();if(e.format){let i=e.format;i==="email"?o=o.check(Xe.email()):i==="uri"||i==="uri-reference"?o=o.check(Xe.url()):i==="uuid"||i==="guid"?o=o.check(Xe.uuid()):i==="date-time"?o=o.check(Xe.iso.datetime()):i==="date"?o=o.check(Xe.iso.date()):i==="time"?o=o.check(Xe.iso.time()):i==="duration"?o=o.check(Xe.iso.duration()):i==="ipv4"?o=o.check(Xe.ipv4()):i==="ipv6"?o=o.check(Xe.ipv6()):i==="mac"?o=o.check(Xe.mac()):i==="cidr"?o=o.check(Xe.cidrv4()):i==="cidr-v6"?o=o.check(Xe.cidrv6()):i==="base64"?o=o.check(Xe.base64()):i==="base64url"?o=o.check(Xe.base64url()):i==="e164"?o=o.check(Xe.e164()):i==="jwt"?o=o.check(Xe.jwt()):i==="emoji"?o=o.check(Xe.emoji()):i==="nanoid"?o=o.check(Xe.nanoid()):i==="cuid"?o=o.check(Xe.cuid()):i==="cuid2"?o=o.check(Xe.cuid2()):i==="ulid"?o=o.check(Xe.ulid()):i==="xid"?o=o.check(Xe.xid()):i==="ksuid"&&(o=o.check(Xe.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),r=o;break}case"number":case"integer":{let o=n==="integer"?Xe.number().int():Xe.number();typeof e.minimum=="number"&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),r=o;break}case"boolean":{r=Xe.boolean();break}case"null":{r=Xe.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]);for(let[l,f]of Object.entries(i)){let h=Tu(f,t);o[l]=s.has(l)?h:h.optional()}if(e.propertyNames){let l=Tu(e.propertyNames,t),f=e.additionalProperties&&typeof e.additionalProperties=="object"?Tu(e.additionalProperties,t):Xe.any();if(Object.keys(o).length===0){r=Xe.record(l,f);break}let h=Xe.object(o).passthrough(),_=Xe.looseRecord(l,f);r=Xe.intersection(h,_);break}if(e.patternProperties){let l=e.patternProperties,f=Object.keys(l),h=[];for(let y of f){let T=Tu(l[y],t),v=Xe.string().regex(new RegExp(y));h.push(Xe.looseRecord(v,T))}let _=[];if(Object.keys(o).length>0&&_.push(Xe.object(o).passthrough()),_.push(...h),_.length===0)r=Xe.object({}).passthrough();else if(_.length===1)r=_[0];else{let y=Xe.intersection(_[0],_[1]);for(let T=2;T<_.length;T++)y=Xe.intersection(y,_[T]);r=y}break}let u=Xe.object(o);e.additionalProperties===!1?r=u.strict():typeof e.additionalProperties=="object"?r=u.catchall(Tu(e.additionalProperties,t)):r=u.passthrough();break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=o.map(l=>Tu(l,t)),u=i&&typeof i=="object"&&!Array.isArray(i)?Tu(i,t):void 0;u?r=Xe.tuple(s).rest(u):r=Xe.tuple(s),typeof e.minItems=="number"&&(r=r.check(Xe.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(Xe.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(l=>Tu(l,t)),u=e.additionalItems&&typeof e.additionalItems=="object"?Tu(e.additionalItems,t):void 0;u?r=Xe.tuple(s).rest(u):r=Xe.tuple(s),typeof e.minItems=="number"&&(r=r.check(Xe.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(Xe.maxLength(e.maxItems)))}else if(i!==void 0){let s=Tu(i,t),u=Xe.array(s);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),r=u}else r=Xe.array(Xe.any());break}default:throw new Error(`Unsupported type: ${n}`)}return r}function Tu(e,t){if(typeof e=="boolean")return e?Xe.any():Xe.never();let n=J6e(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(f=>Tu(f,t)),l=Xe.union(u);n=r?Xe.intersection(n,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(f=>Tu(f,t)),l=Xe.xor(u);n=r?Xe.intersection(n,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:Xe.any();else{let u=r?n:Tu(e.allOf[0],t),l=r?0:1;for(let f=l;f<e.allOf.length;f++)u=Xe.intersection(u,Tu(e.allOf[f],t));n=u}e.nullable===!0&&t.version==="openapi-3.0"&&(n=Xe.nullable(n)),e.readOnly===!0&&(n=Xe.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of i)u in e&&(o[u]=e[u]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let u of s)u in e&&(o[u]=e[u]);for(let u of Object.keys(e))FMt.has(u)||(o[u]=e[u]);return Object.keys(o).length>0&&t.registry.add(n,o),e.description&&(n=n.describe(e.description)),n}function Z6e(e,t){if(typeof e=="boolean")return e?Xe.any():Xe.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=GMt(n,t?.defaultTarget),o=n.$defs||n.definitions||{},i={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Ua};return Tu(n,i)}var Xe,FMt,W6e=w(()=>{m();sk();qj();dk();fk();Xe={...pk,...$j,iso:Nx},FMt=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var kie={};Zs(kie,{bigint:()=>qMt,boolean:()=>$Mt,date:()=>VMt,number:()=>HMt,string:()=>zMt});function zMt(e){return tre(Ox,e)}function HMt(e){return cre(Px,e)}function $Mt(e){return gre(Mx,e)}function qMt(e){return _re(Lx,e)}function VMt(e){return Dre(yk,e)}var X6e=w(()=>{m();sd();fk()});var A={};Zs(A,{$brand:()=>bee,$input:()=>Xne,$output:()=>Wne,NEVER:()=>Tee,TimePrecision:()=>rre,ZodAny:()=>Yoe,ZodArray:()=>Woe,ZodBase64:()=>pz,ZodBase64URL:()=>fz,ZodBigInt:()=>Lx,ZodBigIntFormat:()=>gz,ZodBoolean:()=>Mx,ZodCIDRv4:()=>lz,ZodCIDRv6:()=>dz,ZodCUID:()=>rz,ZodCUID2:()=>oz,ZodCatch:()=>yie,ZodCodec:()=>Ck,ZodCustom:()=>vk,ZodCustomStringFormat:()=>kx,ZodDate:()=>yk,ZodDefault:()=>mie,ZodDiscriminatedUnion:()=>eie,ZodE164:()=>mz,ZodEmail:()=>ez,ZodEmoji:()=>tz,ZodEnum:()=>wx,ZodError:()=>PMt,ZodExactOptional:()=>die,ZodFile:()=>cie,ZodFirstPartyTypeKind:()=>Oie,ZodFunction:()=>Nie,ZodGUID:()=>Ak,ZodIPv4:()=>uz,ZodIPv6:()=>cz,ZodISODate:()=>Yj,ZodISODateTime:()=>Vj,ZodISODuration:()=>Jj,ZodISOTime:()=>Kj,ZodIntersection:()=>tie,ZodIssueCode:()=>LMt,ZodJWT:()=>Az,ZodKSUID:()=>az,ZodLazy:()=>Rie,ZodLiteral:()=>uie,ZodMAC:()=>Goe,ZodMap:()=>sie,ZodNaN:()=>Tie,ZodNanoID:()=>nz,ZodNever:()=>Joe,ZodNonOptional:()=>Tz,ZodNull:()=>qoe,ZodNullable:()=>fie,ZodNumber:()=>Px,ZodNumberFormat:()=>OT,ZodObject:()=>Tk,ZodOptional:()=>Sz,ZodPipe:()=>Ik,ZodPrefault:()=>gie,ZodPreprocess:()=>bie,ZodPromise:()=>Die,ZodReadonly:()=>Iie,ZodRealError:()=>rl,ZodRecord:()=>Bx,ZodSet:()=>aie,ZodString:()=>Ox,ZodStringFormat:()=>Jr,ZodSuccess:()=>Eie,ZodSymbol:()=>Hoe,ZodTemplateLiteral:()=>vie,ZodTransform:()=>lie,ZodTuple:()=>rie,ZodType:()=>Nn,ZodULID:()=>iz,ZodURL:()=>Ek,ZodUUID:()=>fA,ZodUndefined:()=>$oe,ZodUnion:()=>bk,ZodUnknown:()=>Koe,ZodVoid:()=>Zoe,ZodXID:()=>sz,ZodXor:()=>Xoe,_ZodString:()=>Xj,_default:()=>Aie,_function:()=>F6e,any:()=>h6e,array:()=>Sk,base64:()=>e6e,base64url:()=>t6e,bigint:()=>p6e,boolean:()=>zoe,catch:()=>Sie,check:()=>G6e,cidrv4:()=>W3e,cidrv6:()=>X3e,clone:()=>uc,codec:()=>M6e,coerce:()=>kie,config:()=>bi,core:()=>uh,cuid:()=>H3e,cuid2:()=>$3e,custom:()=>j6e,date:()=>E6e,decode:()=>Ooe,decodeAsync:()=>Poe,describe:()=>z6e,discriminatedUnion:()=>C6e,e164:()=>n6e,email:()=>k3e,emoji:()=>j3e,encode:()=>woe,encodeAsync:()=>koe,endsWith:()=>Sx,enum:()=>Ez,exactOptional:()=>pie,file:()=>w6e,flattenError:()=>JO,float32:()=>u6e,float64:()=>c6e,formatError:()=>ZO,fromJSONSchema:()=>Z6e,function:()=>F6e,getErrorMap:()=>QMt,globalRegistry:()=>Ua,gt:()=>dA,gte:()=>lc,guid:()=>P3e,hash:()=>a6e,hex:()=>s6e,hostname:()=>i6e,httpUrl:()=>G3e,includes:()=>Ex,instanceof:()=>$6e,int:()=>Zj,int32:()=>l6e,int64:()=>f6e,intersection:()=>nie,invertCodec:()=>L6e,ipv4:()=>K3e,ipv6:()=>Z3e,iso:()=>Nx,json:()=>V6e,jwt:()=>r6e,keyof:()=>y6e,ksuid:()=>Y3e,lazy:()=>xie,length:()=>BT,literal:()=>B6e,locales:()=>ik,looseObject:()=>b6e,looseRecord:()=>R6e,lowercase:()=>hx,lt:()=>lA,lte:()=>id,mac:()=>J3e,map:()=>x6e,maxLength:()=>NT,maxSize:()=>JE,meta:()=>H6e,mime:()=>Tx,minLength:()=>ah,minSize:()=>pA,multipleOf:()=>KE,nan:()=>P6e,nanoid:()=>z3e,nativeEnum:()=>N6e,negative:()=>Mj,never:()=>hz,nonnegative:()=>Uj,nonoptional:()=>_ie,nonpositive:()=>Lj,normalize:()=>bx,null:()=>Voe,nullable:()=>hk,nullish:()=>O6e,number:()=>joe,object:()=>S6e,optional:()=>gk,overwrite:()=>Pf,parse:()=>xoe,parseAsync:()=>Doe,partialRecord:()=>v6e,pipe:()=>Wj,positive:()=>Pj,prefault:()=>hie,preprocess:()=>Y6e,prettifyError:()=>Mee,promise:()=>Q6e,property:()=>Qj,readonly:()=>Cie,record:()=>iie,refine:()=>Bie,regex:()=>gx,regexes:()=>od,registry:()=>mj,safeDecode:()=>Loe,safeDecodeAsync:()=>Qoe,safeEncode:()=>Moe,safeEncodeAsync:()=>Uoe,safeParse:()=>Noe,safeParseAsync:()=>Boe,set:()=>D6e,setErrorMap:()=>UMt,size:()=>DT,slugify:()=>Rx,startsWith:()=>yx,strictObject:()=>T6e,string:()=>mk,stringFormat:()=>o6e,stringbool:()=>q6e,success:()=>k6e,superRefine:()=>wie,symbol:()=>A6e,templateLiteral:()=>U6e,toJSONSchema:()=>zj,toLowerCase:()=>Cx,toUpperCase:()=>vx,transform:()=>yz,treeifyError:()=>Pee,trim:()=>Ix,tuple:()=>oie,uint32:()=>d6e,uint64:()=>m6e,ulid:()=>q3e,undefined:()=>g6e,union:()=>_z,unknown:()=>wT,uppercase:()=>_x,url:()=>F3e,util:()=>Le,uuid:()=>M3e,uuidv4:()=>L3e,uuidv6:()=>U3e,uuidv7:()=>Q3e,void:()=>_6e,xid:()=>V3e,xor:()=>I6e});var Pie=w(()=>{m();sd();fk();qj();Roe();Foe();K6e();sd();Yne();sd();lk();W6e();Zne();dk();dk();X6e();bi(lj())});var pc=w(()=>{m();Pie();Pie()});var YMt,bu,Mie,kT,bz,KMt,Iz,eGe,tGe,Lie,JMt,ZMt,WMt,XMt,e2t,t2t,n2t,nGe,Cz=w(()=>{"use strict";m();cA();pc();YMt=Su(),bu=A.object({message:A.string()}),Mie=A.record(A.string(),A.unknown()),kT=A.string().regex(/^doc_[0-9A-Za-z]{22}$/),bz=A.string().regex(/^proj_[0-9A-Za-z]{22}$/),KMt=["active","archived"],Iz=A.enum(KMt),eGe=A.object({id:A.string().min(1),display_name:A.string().min(1)}),tGe=A.object({id:bz,name:A.string().min(1)}),Lie=A.object({id:kT,title:A.string().min(1),status:Iz,author:eGe,project:tGe.nullable(),created_at:A.string().datetime(),updated_at:A.string().datetime(),archived_at:A.string().datetime().nullable()}),JMt=A.object({type:A.literal("list"),list_type:A.literal("doc"),objects:A.array(Lie)}),ZMt=A.object({project_id:bz.optional(),status:Iz.optional()}),WMt=A.object({title:A.string().trim().min(1).max(300).optional(),prosemirror_json:Mie.optional(),project_id:bz.nullable().optional()}),XMt=A.object({id:kT,created_at:A.string().datetime()}),e2t=A.object({title:A.string().trim().min(1).max(300).optional(),prosemirror_json:Mie.optional(),project_id:bz.nullable().optional(),status:Iz.optional()}).refine(e=>Object.keys(e).length>0,{message:"At least one field must be provided"}),t2t=A.object({id:kT,updated_at:A.string().datetime()}),n2t=A.object({id:kT,title:A.string().min(1),prosemirror_json:Mie,status:Iz,author:eGe,project:tGe.nullable(),created_at:A.string().datetime(),updated_at:A.string().datetime(),archived_at:A.string().datetime().nullable()}),nGe=YMt.router({listDocs:{method:"GET",path:"/docs",headers:A.object({authorization:A.string().min(1).optional()}),query:ZMt,responses:{200:JMt,401:bu,403:bu},summary:"List docs in the authenticated user\u2019s organization. Optional project_id filter scopes to a single project."},createDoc:{method:"POST",path:"/docs",headers:A.object({authorization:A.string().min(1).optional()}),body:WMt,responses:{201:XMt,401:bu,403:bu,404:bu,422:bu},summary:"Create a doc. If project_id is provided, the doc is scoped to that project; otherwise it lives at the workspace level."},getDoc:{method:"GET",path:"/docs/:docId",pathParams:A.object({docId:kT}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:n2t,401:bu,403:bu,404:bu},summary:"Get a doc by id with its rich-text body and parent project (if any)"},updateDoc:{method:"PATCH",path:"/docs/:docId",pathParams:A.object({docId:kT}),headers:A.object({authorization:A.string().min(1).optional()}),body:e2t,responses:{200:t2t,401:bu,403:bu,404:bu,422:bu},summary:"Update a doc. If prosemirror_json changes, the server re-syncs lore.mention_references from mention nodes."},deleteDoc:{method:"DELETE",path:"/docs/:docId",pathParams:A.object({docId:kT}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{204:A.object({}),401:bu,403:bu,404:bu},summary:"Hard-delete a doc and any mention references it owns"}})});var r2t,Mf,I3n,C3n,o2t,v3n,i2t,Ux,vz=w(()=>{"use strict";m();pc();r2t=["person","foot_gun"],Mf=A.enum(r2t),I3n=A.enum(["authored","commented","edited","mentioned"]),C3n=A.enum(["observed_in","reaffirmed_in"]),o2t=["primary"],v3n=A.enum(o2t),i2t=["supports","supersedes"],Ux=A.enum(i2t)});var s2t,Uie=w(()=>{"use strict";m();pc();s2t=A.object({user_id:A.string().nullable()})});var a2t,Qie=w(()=>{"use strict";m();pc();a2t=A.object({typical_phrasings:A.array(A.string()).default([])})});var Fie=w(()=>{"use strict";m();vz();Uie();Qie();vz();Uie();Qie()});var u2t,Qi,ad,c2t,oGe,iGe,l2t,rGe,PT,d2t,p2t,f2t,m2t,A2t,sGe,Gie=w(()=>{"use strict";m();cA();pc();Fie();u2t=Su(),Qi=A.object({message:A.string()}),ad=A.string().regex(/^ent_[0-9A-Za-z]{22}$/),c2t=["active","archived"],oGe=A.enum(c2t),iGe=A.object({id:ad,kind:Mf,slug:A.string(),name:A.string(),blurb:A.string().nullable(),status:oGe,lifecycle:A.string().nullable(),human_edited_at:A.string().datetime().nullable(),last_active_at:A.string().datetime(),created_at:A.string().datetime(),updated_at:A.string().datetime()}),l2t=A.object({thread_id:A.string(),thread_title:A.string(),role:A.string(),score:A.number().nullable(),added_at:A.string().datetime(),added_by:A.object({id:A.string(),display_name:A.string()})}),rGe=A.object({entity_id:ad,name:A.string(),slug:A.string(),kind:Mf,edge_kind:Ux}),PT=iGe.extend({payload:A.record(A.string(),A.unknown()),attachments:A.array(l2t),edges:A.object({outgoing:A.array(rGe),incoming:A.array(rGe)})}),d2t=A.object({type:A.literal("list"),list_type:A.literal("entities"),has_more:A.boolean(),objects:A.array(iGe)}),p2t=A.object({kind:Mf.optional().describe("Filter to a single entity kind"),status:oGe.optional().describe("Filter by entity status"),after:ad.optional().describe("Cursor: return entities after this id"),before:ad.optional().describe("Cursor: return entities before this id")}),f2t=A.object({name:A.string().min(1).optional().describe("New display name for the entity"),blurb:A.string().nullable().optional().describe("New blurb; null clears it"),payload:A.record(A.string(),A.unknown()).optional().describe("Replacement payload for the entity")}),m2t=A.object({thread_id:A.string().min(1).describe("Id of the thread to attach"),role:A.string().min(1).describe("Role of the thread relative to the entity"),score:A.number().min(0).max(1).nullable().optional().describe("Optional relevance score in [0, 1]")}),A2t=A.object({to_id:ad.describe("Id of the target entity for the edge"),kind:Ux.describe("Kind of edge to create")}),sGe=u2t.router({listEntities:{method:"GET",path:"/entities",headers:A.object({authorization:A.string().min(1).optional()}),query:p2t,responses:{200:d2t,401:Qi},summary:"List entities in the authenticated user\u2019s organization"},getEntity:{method:"GET",path:"/entities/:entityId",pathParams:A.object({entityId:ad.describe("Id of the entity to fetch")}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:PT,401:Qi,404:Qi},summary:"Get an entity with its payload, attachments, and edges"},patchEntity:{method:"PATCH",path:"/entities/:entityId",pathParams:A.object({entityId:ad.describe("Id of the entity to update")}),headers:A.object({authorization:A.string().min(1).optional()}),body:f2t,responses:{200:PT,401:Qi,403:Qi,404:Qi},summary:"Update an entity\u2019s name, blurb, or payload"},archiveEntity:{method:"POST",path:"/entities/:entityId/archive",pathParams:A.object({entityId:ad.describe("Id of the entity to archive")}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}),responses:{200:PT,401:Qi,403:Qi,404:Qi},summary:"Archive an entity"},attachEntityThread:{method:"POST",path:"/entities/:entityId/threads",pathParams:A.object({entityId:ad.describe("Id of the entity to attach a thread to")}),headers:A.object({authorization:A.string().min(1).optional()}),body:m2t,responses:{200:PT,401:Qi,403:Qi,404:Qi},summary:"Attach a thread to an entity"},detachEntityThread:{method:"DELETE",path:"/entities/:entityId/threads/:threadId",pathParams:A.object({entityId:ad.describe("Id of the entity to detach a thread from"),threadId:A.string().min(1).describe("Id of the thread to detach")}),headers:A.object({authorization:A.string().min(1).optional()}),query:A.object({role:A.string().min(1).describe("Role of the thread membership to remove")}),responses:{200:PT,401:Qi,403:Qi,404:Qi},summary:"Detach a thread from an entity"},addEntityEdge:{method:"POST",path:"/entities/:entityId/edges",pathParams:A.object({entityId:ad.describe("Id of the source entity for the edge")}),headers:A.object({authorization:A.string().min(1).optional()}),body:A2t,responses:{200:PT,401:Qi,403:Qi,404:Qi},summary:"Add an edge from this entity to another entity"},removeEntityEdge:{method:"DELETE",path:"/entities/:entityId/edges/:toId/:kind",pathParams:A.object({entityId:ad.describe("Id of the source entity for the edge"),toId:ad.describe("Id of the target entity for the edge"),kind:Ux.describe("Kind of edge to remove")}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:PT,401:Qi,403:Qi,404:Qi},summary:"Remove an edge from this entity to another entity"}})});var g2t,h2t,da,aGe,_2t,E2t,y2t,S2t,uGe,T2t,b2t,cGe,jie=w(()=>{"use strict";m();cA();pc();g2t=Su(),h2t=A.object({type:A.literal("list"),list_type:A.literal("thread"),has_more:A.boolean(),objects:A.array(A.unknown())}),da=A.object({message:A.string()}),aGe=A.object({thread_id:A.string().min(1),is_favorited:A.boolean(),favorited_at:A.string().datetime().nullable()}),_2t=A.object({before:A.string().min(1).max(64).optional()}),E2t=A.object({id:A.string().min(1),display_name:A.string().min(1)}),y2t=A.object({block_id:A.string().min(1),thread_id:A.string().min(1),thread_title:A.string(),thread_visibility:A.enum(["private","workspace","public"]),author:E2t,preview:A.string(),prompted_at:A.string().datetime().nullable(),favorited_at:A.string().datetime()}),S2t=A.object({type:A.literal("list"),list_type:A.literal("favorite_prompt"),has_more:A.boolean(),objects:A.array(y2t)}),uGe=A.object({block_id:A.string().min(1),thread_id:A.string().min(1).nullable(),is_favorited:A.boolean(),favorited_at:A.string().datetime().nullable()}),T2t=A.object({before:A.string().min(1).max(64).optional()}),b2t=A.object({block_ids:A.array(A.string().min(1))}),cGe=g2t.router({addThreadFavorite:{method:"POST",path:"/threads/:id/favorite",pathParams:A.object({id:A.string().min(1).max(64)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{201:aGe,401:da,403:da,404:da},summary:"Bookmark a thread for the authenticated user. Idempotent \u2014 re-favoriting returns the existing membership."},removeThreadFavorite:{method:"DELETE",path:"/threads/:id/favorite",pathParams:A.object({id:A.string().min(1).max(64)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:aGe,401:da,403:da,404:da},summary:"Remove a thread bookmark for the authenticated user (no-op if absent)."},listFavoriteThreads:{method:"GET",path:"/favorites/threads",headers:A.object({authorization:A.string().min(1).optional()}),query:_2t,responses:{200:h2t,401:da,403:da},summary:"List threads the authenticated user has favorited, newest favorited first. Visibility filtering still applies \u2014 a thread the viewer can no longer see (e.g. visibility downgraded) is omitted from the list."},addPromptFavorite:{method:"POST",path:"/thread-blocks/:id/favorite",pathParams:A.object({id:A.string().min(1).max(64)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{201:uGe,401:da,403:da,404:da,409:da},summary:'Bookmark a single user prompt (a thread_blocks row with type="user") for the authenticated user. Idempotent.'},removePromptFavorite:{method:"DELETE",path:"/thread-blocks/:id/favorite",pathParams:A.object({id:A.string().min(1).max(64)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:uGe,401:da,404:da},summary:"Remove a prompt bookmark for the authenticated user (no-op if absent)."},listFavoritePrompts:{method:"GET",path:"/favorites/prompts",headers:A.object({authorization:A.string().min(1).optional()}),query:T2t,responses:{200:S2t,401:da},summary:"List the user's favorited prompts, newest first. Prompts whose parent thread the viewer can no longer see (visibility downgraded) are filtered out at read time."},listFavoritedBlockIdsInThread:{method:"GET",path:"/threads/:id/favorited-blocks",pathParams:A.object({id:A.string().min(1).max(64)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:b2t,401:da,403:da,404:da},summary:"Returns the set of thread_block ids the authenticated viewer has favorited within a single thread, used to bootstrap per-prompt star state on the SessionView."}})});var I2t,Rz,C2t,xz,v2t,R2t,x2t,D2t,N2t,B2t,w2t,O2t,lGe,zie=w(()=>{"use strict";m();cA();pc();I2t=Su(),Rz=A.object({message:A.string()}),C2t=["thread","plan","doc","user"],xz=A.enum(C2t),v2t=["doc","project"],R2t=A.enum(v2t),x2t=A.object({kind:xz,id:A.string().min(1),title:A.string().min(1),href:A.string().min(1)}),D2t=A.object({type:A.literal("list"),list_type:A.literal("mention"),objects:A.array(x2t)}),N2t=A.object({q:A.string().trim().min(1).max(50),kinds:A.string().optional().transform(e=>{if(!e)return;let t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return t.length>0?t:void 0}).pipe(A.array(xz).optional())}),B2t=A.object({source_kind:R2t,source_id:A.string().min(1),source_title:A.string().min(1),source_href:A.string().min(1),target_kind:xz,target_id:A.string().min(1),created_at:A.string().datetime()}),w2t=A.object({type:A.literal("list"),list_type:A.literal("backlink"),objects:A.array(B2t)}),O2t=A.object({target_kind:xz,target_id:A.string().min(1).max(64)}),lGe=I2t.router({searchMentions:{method:"GET",path:"/mentions/search",headers:A.object({authorization:A.string().min(1).optional()}),query:N2t,responses:{200:D2t,401:Rz,422:Rz},summary:"Search threads, plans, files, and users by title/name for @-mention typeahead. Org-scoped, max 10 results across all kinds."},listBacklinks:{method:"GET",path:"/mentions/backlinks",headers:A.object({authorization:A.string().min(1).optional()}),query:O2t,responses:{200:w2t,401:Rz,403:Rz},summary:"List every doc/project body in the caller\u2019s organization that mentions the given target. Newest-first."}})});var k2t,Fi,Hie,mA,P2t,Dz,$ie,dGe,M2t,L2t,U2t,Q2t,F2t,G2t,j2t,z2t,H2t,$2t,q2t,V2t,pGe,qie=w(()=>{"use strict";m();cA();pc();Cz();k2t=Su(),Fi=A.object({message:A.string()}),Hie=A.record(A.string(),A.unknown()),mA=A.string().regex(/^proj_[0-9A-Za-z]{22}$/),P2t=["active","archived"],Dz=A.enum(P2t),$ie=A.object({id:A.string().min(1),display_name:A.string().min(1)}),dGe=A.object({thread_id:A.string().min(1),title:A.string().min(1),added_at:A.string().datetime(),added_by:$ie}),M2t=A.object({id:mA,name:A.string().min(1),status:Dz,author:$ie,thread_count:A.number().int().nonnegative(),doc_count:A.number().int().nonnegative(),created_at:A.string().datetime(),updated_at:A.string().datetime(),archived_at:A.string().datetime().nullable()}),L2t=A.object({type:A.literal("list"),list_type:A.literal("project"),objects:A.array(M2t)}),U2t=A.object({status:Dz.optional()}),Q2t=A.object({name:A.string().trim().min(1).max(200),prosemirror_json:Hie.optional()}),F2t=A.object({id:mA,created_at:A.string().datetime()}),G2t=A.object({name:A.string().trim().min(1).max(200).optional(),prosemirror_json:Hie.optional()}).refine(e=>Object.keys(e).length>0,{message:"At least one field must be provided"}),j2t=A.object({id:mA,updated_at:A.string().datetime()}),z2t=A.object({archived:A.boolean()}),H2t=A.object({id:mA,status:Dz,archived_at:A.string().datetime().nullable()}),$2t=A.object({id:mA,name:A.string().min(1),prosemirror_json:Hie,status:Dz,author:$ie,created_at:A.string().datetime(),updated_at:A.string().datetime(),archived_at:A.string().datetime().nullable(),threads:A.array(dGe),docs:A.array(Lie)}),q2t=A.object({thread_id:A.string().min(1).max(64)}),V2t=dGe,pGe=k2t.router({listProjects:{method:"GET",path:"/projects",headers:A.object({authorization:A.string().min(1).optional()}),query:U2t,responses:{200:L2t,401:Fi},summary:"List projects in the authenticated user\u2019s organization"},createProject:{method:"POST",path:"/projects",headers:A.object({authorization:A.string().min(1).optional()}),body:Q2t,responses:{201:F2t,401:Fi,422:Fi},summary:"Create a new project in the authenticated user\u2019s organization"},getProject:{method:"GET",path:"/projects/:projectId",pathParams:A.object({projectId:mA}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:$2t,401:Fi,403:Fi,404:Fi},summary:"Get a project with its attached threads and child docs. The project description is the canonical mention source for project-scoped @-mentions."},updateProject:{method:"PATCH",path:"/projects/:projectId",pathParams:A.object({projectId:mA}),headers:A.object({authorization:A.string().min(1).optional()}),body:G2t,responses:{200:j2t,401:Fi,403:Fi,404:Fi,422:Fi},summary:"Update a project\u2019s name or rich-text body. Body changes re-sync mention_references for source_kind=project."},archiveProject:{method:"POST",path:"/projects/:projectId/archive",pathParams:A.object({projectId:mA}),headers:A.object({authorization:A.string().min(1).optional()}),body:z2t,responses:{200:H2t,401:Fi,403:Fi,404:Fi},summary:"Archive (soft-delete) or unarchive a project"},addProjectThread:{method:"POST",path:"/projects/:projectId/threads",pathParams:A.object({projectId:mA}),headers:A.object({authorization:A.string().min(1).optional()}),body:q2t,responses:{201:V2t,401:Fi,403:Fi,404:Fi,409:Fi,422:Fi},summary:"Pin an existing visible thread to this project. Idempotent \u2014 re-adding returns the existing membership."},removeProjectThread:{method:"DELETE",path:"/projects/:projectId/threads/:threadId",pathParams:A.object({projectId:mA,threadId:A.string().min(1).max(64)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{204:A.object({}),401:Fi,403:Fi,404:Fi},summary:"Remove a thread membership from a project"}})});var Y2t,$n,ol,mGe,K2t,Nz,Bz,J2t,Z2t,W2t,fGe,X2t,eLt,AGe,tLt,nLt,rLt,oLt,iLt,sLt,aLt,uLt,cLt,lLt,dLt,pLt,fLt,mLt,ALt,gLt,hLt,_Lt,ELt,yLt,gGe,Vie=w(()=>{"use strict";m();cA();pc();Y2t=Su(),$n=A.object({message:A.string()}),ol=A.string().regex(/^reg_[0-9A-Za-z]{22}$/),mGe=A.string().min(1).max(64),K2t=["active","quiet","dormant","archived"],Nz=A.enum(K2t),Bz=A.object({id:A.string().min(1),display_name:A.string().min(1),avatar_url:A.string().nullable().optional()}),J2t=A.object({id:A.string().min(1),display_name:A.string().min(1),thread_count:A.number().int().positive()}),Z2t=["asked","requested","decided","corrected","shared","requirement"],W2t=A.enum(Z2t),fGe=A.object({id:A.string().min(1),kind:W2t,summary:A.string(),thread_id:A.string().min(1),thread_title:A.string(),created_at:A.string().datetime()}),X2t=A.object({decided_14d:A.number().int().nonnegative(),asked_14d:A.number().int().nonnegative()}),eLt=A.object({id:ol,name:A.string().min(1),overlap_score:A.number().min(0).max(1)}),AGe=A.object({thread_id:A.string().min(1),title:A.string().min(1),is_primary:A.boolean(),added_at:A.string().datetime(),added_by:Bz}),tLt=A.object({id:ol,name:A.string().min(1),blurb:A.string().nullable(),status:Nz,thread_count:A.number().int().nonnegative(),contributor_count:A.number().int().nonnegative(),comment_count:A.number().int().nonnegative(),contributors_preview:A.array(Bz).max(3),top_filepath:A.string().nullable(),last_active_at:A.string().datetime(),created_at:A.string().datetime(),updated_at:A.string().datetime(),archived_at:A.string().datetime().nullable()}),nLt=A.object({type:A.literal("list"),list_type:A.literal("region"),objects:A.array(tLt)}),rLt=A.object({status:Nz.optional()}),oLt=A.object({name:A.string().trim().min(1).max(200),blurb:A.string().trim().max(2e3).optional()}),iLt=A.object({id:ol,created_at:A.string().datetime()}),sLt=A.object({name:A.string().trim().min(1).max(200).optional(),blurb:A.string().trim().max(2e3).nullable().optional()}).refine(e=>Object.keys(e).length>0,{message:"At least one field must be provided"}),aLt=A.object({id:ol,updated_at:A.string().datetime()}),uLt=A.object({archived:A.boolean()}),cLt=A.object({id:ol,status:Nz,archived_at:A.string().datetime().nullable()}),lLt=A.object({id:ol,name:A.string().min(1),blurb:A.string().nullable(),status:Nz,created_by:Bz,thread_count:A.number().int().nonnegative(),last_active_at:A.string().datetime(),created_at:A.string().datetime(),updated_at:A.string().datetime(),archived_at:A.string().datetime().nullable(),synthesized_status:A.string().nullable(),synthesized_status_at:A.string().datetime().nullable(),threads:A.array(AGe),contributors:A.array(J2t),decisions:A.object({decided:A.array(fGe),open:A.array(fGe)}),velocity:X2t,cited_by_active_regions:A.array(eLt)}),dLt=A.object({id:ol,synthesized_status:A.string(),synthesized_status_at:A.string().datetime()}),pLt=A.object({regions_created:A.number().int().nonnegative(),llm_dispatched:A.boolean()}),fLt=A.object({promoted_to_active:A.number().int().nonnegative(),demoted_to_quiet:A.number().int().nonnegative(),demoted_to_dormant:A.number().int().nonnegative()}),mLt=A.object({thread_id:A.string().min(1),region_id:ol,region_name:A.string().min(1),score:A.number().min(0).max(1),signal:A.enum(["file","embedding","combined"])}),ALt=A.object({thread_ids:A.array(A.string().min(1)).min(1).max(50)}),gLt=A.object({type:A.literal("list"),list_type:A.literal("region_suggestion"),objects:A.array(mLt)}),hLt=A.object({thread_id:A.string().min(1),title:A.string(),created_at:A.string().datetime(),author:Bz,user_message_count:A.number().int().nonnegative(),comment_count:A.number().int().nonnegative()}),_Lt=A.object({type:A.literal("list"),list_type:A.literal("unfiled_thread"),objects:A.array(hLt)}),ELt=A.object({thread_id:mGe}),yLt=AGe,gGe=Y2t.router({listRegions:{method:"GET",path:"/regions",headers:A.object({authorization:A.string().min(1).optional()}),query:rLt,responses:{200:nLt,401:$n,403:$n},summary:"List regions in the authenticated user\u2019s organization"},createRegion:{method:"POST",path:"/regions",headers:A.object({authorization:A.string().min(1).optional()}),body:oLt,responses:{201:iLt,401:$n,403:$n,409:$n,422:$n},summary:"Create a new region in the authenticated user\u2019s organization"},getRegion:{method:"GET",path:"/regions/:regionId",pathParams:A.object({regionId:ol}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:lLt,401:$n,403:$n,404:$n},summary:"Get a region with its attached threads and rolled-up contributors"},updateRegion:{method:"PATCH",path:"/regions/:regionId",pathParams:A.object({regionId:ol}),headers:A.object({authorization:A.string().min(1).optional()}),body:sLt,responses:{200:aLt,401:$n,403:$n,404:$n,409:$n,422:$n},summary:"Rename a region or update its blurb"},archiveRegion:{method:"POST",path:"/regions/:regionId/archive",pathParams:A.object({regionId:ol}),headers:A.object({authorization:A.string().min(1).optional()}),body:uLt,responses:{200:cLt,401:$n,403:$n,404:$n},summary:"Archive or unarchive a region"},addRegionThread:{method:"POST",path:"/regions/:regionId/threads",pathParams:A.object({regionId:ol}),headers:A.object({authorization:A.string().min(1).optional()}),body:ELt,responses:{201:yLt,401:$n,403:$n,404:$n,409:$n,422:$n},summary:"Attach an existing visible thread to this region. Primary if the thread has no other primary, otherwise secondary (up to 2). Idempotent."},suggestRegionsForThreads:{method:"POST",path:"/regions/suggest-for-threads",headers:A.object({authorization:A.string().min(1).optional()}),body:ALt,responses:{200:gLt,401:$n,403:$n,422:$n},summary:'Batch lookup: for each thread id, return the highest-scoring active region in the viewer\u2019s workspace (or omit when no region clears the threshold). Used by the per-thread inline "Add to <region>" suggestion chip.'},listUnfiledThreads:{method:"GET",path:"/regions/unfiled",headers:A.object({authorization:A.string().min(1).optional()}),query:A.object({days:A.coerce.number().int().positive().max(180).optional()}),responses:{200:_Lt,401:$n,403:$n},summary:"List threads in the authenticated user\u2019s scope that are not yet attached to any region (default last 30 days)."},transitionRegionLifecycle:{method:"POST",path:"/regions/lifecycle/transition",headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:fLt,401:$n,403:$n},summary:"Sweep regions and demote/promote between active/quiet/dormant based on last_active_at. Idempotent \u2014 safe to run on a cron or on-demand."},refreshRegions:{method:"POST",path:"/regions/refresh",headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:pLt,401:$n,403:$n},summary:"Run the clustering pipeline against unfiled threads and create regions from the resulting clusters. Deterministic pass is synchronous; LLM pass is dispatched as an async Inngest event and lands more regions ~30s later."},synthesizeRegion:{method:"POST",path:"/regions/:regionId/synthesize",pathParams:A.object({regionId:ol}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:dLt,401:$n,403:$n,404:$n,409:$n,503:$n},summary:"Generate (or refresh) the region\u2019s synthesized status using recent decisions and threads. Persists to regions.synthesized_status."},removeRegionThread:{method:"DELETE",path:"/regions/:regionId/threads/:threadId",pathParams:A.object({regionId:ol,threadId:mGe}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{204:A.object({}),401:$n,403:$n,404:$n},summary:"Remove a thread membership from a region"}})});var SLt,hGe,TLt,bLt,ILt,CLt,vLt,_Ge,Yie=w(()=>{"use strict";m();cA();pc();SLt=Su(),hGe=A.object({message:A.string()}),TLt=A.object({id:A.string().min(1),title:A.string(),href:A.string().min(1),author_display_name:A.string().nullable(),author_handle:A.string().nullable()}),bLt=A.object({name:A.string().min(1),usage_count:A.number().int().nonnegative(),href:A.string().min(1)}),ILt=A.object({id:A.string().min(1),display_name:A.string(),handle:A.string().nullable(),avatar_url:A.string().nullable(),href:A.string().min(1)}),CLt=A.object({type:A.literal("global_search"),threads:A.array(TLt),skills:A.array(bLt),people:A.array(ILt)}),vLt=A.object({q:A.string().trim().min(1).max(80)}),_Ge=SLt.router({globalSearch:{method:"GET",path:"/search",headers:A.object({authorization:A.string().min(1).optional()}),query:vLt,responses:{200:CLt,401:hGe,422:hGe},summary:"Global navbar search. Threads and people are searched globally (subject to thread visibility); skills are scoped to the viewer workspace. Max 5 results per kind."}})});var _6n,E6n,y6n,oi,RLt,xLt,DLt,NLt,Kie,S6n,EGe=w(()=>{"use strict";m();pc();vz();Rk();_6n=A.enum(["thread","org","user","public"]),E6n=A.discriminatedUnion("kind",[A.object({kind:A.literal("thread"),id:A.string().min(1)}),A.object({kind:A.literal("org"),id:A.string().min(1)}),A.object({kind:A.literal("user"),id:A.string().min(1)}),A.object({kind:A.literal("public"),id:A.string().min(1)})]),y6n=A.enum(["thread.created","thread.completed","thread.block.appended","thread.comment.created","thread.comment.updated","thread.comment.deleted","thread.vote.cast","thread.vote.cleared","user.followed","user.joined","user.presence","entity.created","entity.updated","entity.archived","entity.thread_attached","entity.thread_detached","entity.linked","entity.superseded","skill.published","skill.version.accepted","skill.version.proposed","skill.version.rejected","skill.installation.deleted"]),oi=A.object({id:A.string().min(1),subjects:A.array(A.string().min(1)).min(1),actor_user_id:A.string().min(1).nullable(),created_at:A.string().datetime()}),RLt=A.object({thread_id:A.string().min(1),title:A.string(),author_id:A.string().min(1),created_at:A.string().datetime()}),xLt=A.enum(["user","assistant","tool","progress","system"]),DLt=A.enum(["claude_global","agents_global","claude_project","agents_project"]),NLt=A.enum(["private","workspace"]),Kie=A.object({skill_id:A.string().min(1),name:A.string().min(1),root_kind:DLt,version:A.number().int().positive(),content_hash:A.string().startsWith("md5:")}),S6n=A.discriminatedUnion("type",[oi.extend({type:A.literal("thread.created"),payload:RLt}),oi.extend({type:A.literal("thread.completed"),payload:A.object({thread_id:A.string().min(1),completed_at:A.string().datetime()})}),oi.extend({type:A.literal("thread.block.appended"),payload:A.object({thread_id:A.string().min(1),block_id:A.string().min(1),block_type:xLt,excerpt:A.string().nullable()})}),oi.extend({type:A.literal("thread.comment.created"),payload:A.object({comment:A.lazy(()=>AA)})}),oi.extend({type:A.literal("thread.comment.updated"),payload:A.object({comment:A.lazy(()=>AA)})}),oi.extend({type:A.literal("thread.comment.deleted"),payload:A.object({thread_id:A.string().min(1),comment_id:A.string().min(1)})}),oi.extend({type:A.literal("thread.vote.cast"),payload:A.object({thread_id:A.string().min(1),vote_count:A.number().int().nonnegative()})}),oi.extend({type:A.literal("thread.vote.cleared"),payload:A.object({thread_id:A.string().min(1),vote_count:A.number().int().nonnegative()})}),oi.extend({type:A.literal("user.followed"),payload:A.object({followee_id:A.string().min(1),followee_handle:A.string().nullable(),followee_display_name:A.string().nullable()})}),oi.extend({type:A.literal("user.joined"),payload:A.object({organization_id:A.string().min(1).nullable(),organization_name:A.string().nullable()})}),oi.extend({type:A.literal("user.presence"),payload:A.object({status:A.literal("online")})}),oi.extend({type:A.literal("entity.created"),payload:A.object({entity_id:A.string().min(1),kind:Mf,slug:A.string().min(1),name:A.string().min(1)})}),oi.extend({type:A.literal("entity.updated"),payload:A.object({entity_id:A.string().min(1),kind:Mf,changed_fields:A.array(A.string()).min(1),actor:A.enum(["agent","human"])})}),oi.extend({type:A.literal("entity.archived"),payload:A.object({entity_id:A.string().min(1),kind:Mf})}),oi.extend({type:A.literal("entity.thread_attached"),payload:A.object({entity_id:A.string().min(1),kind:Mf,thread_id:A.string().min(1),role:A.string().min(1),score:A.number().nullable()})}),oi.extend({type:A.literal("entity.thread_detached"),payload:A.object({entity_id:A.string().min(1),kind:Mf,thread_id:A.string().min(1),role:A.string().min(1)})}),oi.extend({type:A.literal("entity.linked"),payload:A.object({from_id:A.string().min(1),to_id:A.string().min(1),edge_kind:Ux})}),oi.extend({type:A.literal("entity.superseded"),payload:A.object({superseding_id:A.string().min(1),supersedes_id:A.string().min(1)})}),oi.extend({type:A.literal("skill.published"),payload:Kie.extend({visibility:NLt})}),oi.extend({type:A.literal("skill.version.accepted"),payload:Kie}),oi.extend({type:A.literal("skill.version.proposed"),payload:Kie.extend({owner_user_id:A.string().min(1),proposer_user_id:A.string().min(1)})}),oi.extend({type:A.literal("skill.version.rejected"),payload:A.object({skill_id:A.string().min(1),version:A.number().int().positive(),reviewer_user_id:A.string().min(1),proposer_user_id:A.string().min(1)})}),oi.extend({type:A.literal("skill.installation.deleted"),payload:A.object({skill_id:A.string().min(1),installation_id:A.string().min(1),user_id:A.string().min(1)})})])});var BLt,wLt,k6n,OLt,kLt,P6n,q,PLt,BGe,wGe,OGe,MLt,LLt,ULt,yGe,QLt,FLt,kGe,GLt,jLt,zLt,HLt,$Lt,qLt,VLt,YLt,PGe,KLt,JLt,ZLt,WLt,MGe,Mz,XLt,eUt,tUt,nUt,rUt,oUt,iUt,sUt,aUt,uUt,cUt,lUt,dUt,pUt,fUt,mUt,Wie,LGe,AUt,gUt,hUt,_Ut,UGe,EUt,yUt,SUt,TUt,bUt,IUt,Lf,CUt,vUt,RUt,xUt,DUt,Nk,t0,NUt,QGe,Xie,M6n,wz,BUt,wUt,Lz,OUt,FGe,GGe,kUt,xk,ese,SGe,PUt,jGe,TGe,MUt,LUt,AA,UUt,QUt,FUt,GUt,jUt,zUt,L6n,HUt,$Ut,qUt,VUt,tse,zGe,YUt,KUt,JUt,ZUt,WUt,XUt,HGe,eQt,tQt,nQt,rQt,oQt,iQt,sQt,Jie,aQt,uQt,cQt,Dk,lQt,dQt,pQt,fQt,mQt,AQt,gQt,hQt,_Qt,EQt,yQt,SQt,TQt,bQt,bGe,IQt,CQt,vQt,RQt,xQt,DQt,NQt,BQt,wQt,OQt,kQt,kz,PQt,MQt,LQt,UQt,QQt,IGe,FQt,GQt,CGe,jQt,vGe,zQt,HQt,$Qt,qQt,VQt,YQt,KQt,JQt,ZQt,WQt,$Ge,XQt,eFt,tFt,nFt,rFt,qGe,oFt,iFt,sFt,aFt,uFt,cFt,RGe,lFt,dFt,pFt,fFt,Oz,mFt,AFt,gFt,hFt,_Ft,EFt,yFt,SFt,TFt,bFt,IFt,CFt,vFt,Qx,VGe,Zie,RFt,xFt,DFt,NFt,BFt,xGe,Pz,wFt,OFt,kFt,PFt,MFt,LFt,UFt,QFt,FFt,GFt,jFt,e0,DGe,zFt,HFt,$Ft,qFt,VFt,YFt,KFt,JFt,ZFt,WFt,XFt,e4t,t4t,n4t,r4t,o4t,i4t,s4t,a4t,u4t,c4t,NGe,l4t,YGe,d4t,p4t,f4t,m4t,A4t,Uz,Rk=w(()=>{"use strict";m();FQe();cA();pc();Cz();Gie();jie();zie();qie();Vie();Yie();EGe();Fie();qie();Vie();Gie();Cz();zie();jie();Yie();BLt=Su(),wLt=["gmail.com","googlemail.com","hotmail.com","outlook.com","live.com","msn.com","yahoo.com","ymail.com","rocketmail.com","icloud.com","me.com","mac.com","aol.com","proton.me","protonmail.com","pm.me","tutanota.com","tuta.io","fastmail.com","hey.com","mail.com","gmx.com","gmx.net","zoho.com","zohomail.com","hushmail.com","lycos.com","inbox.com","yandex.com","yandex.ru","mail.ru","inbox.ru","bk.ru","list.ru","rambler.ru","qq.com","163.com","126.com","yeah.net","sina.com","naver.com","daum.net","hanmail.net","kakao.com","rediffmail.com","comcast.net","verizon.net","att.net","sbcglobal.net","bellsouth.net","earthlink.net","charter.net","cox.net","roadrunner.com","spectrum.net","btinternet.com","virginmedia.com","sky.com","orange.fr","wanadoo.fr","free.fr","laposte.net","web.de","t-online.de","gmx.de","libero.it","virgilio.it","alice.it","seznam.cz","centrum.cz","wp.pl","interia.pl","o2.pl","onet.pl"],k6n=new Set(wLt),OLt=A.object({id:A.string().uuid(),role:A.enum(["user","assistant"]),content:A.string().min(1),timestamp:A.string().datetime()}),kLt=A.object({id:A.string().uuid(),title:A.string().min(1),author:A.string().min(1),authorAvatar:A.string().min(1).max(4),model:A.string().min(1),turnCount:A.number().int().nonnegative(),createdAt:A.string().datetime(),preview:A.string()}),P6n=kLt.extend({messages:A.array(OLt)}),q=A.object({message:A.string()}),PLt=/^[a-zA-Z0-9_-]{2,32}$/,BGe=A.string().regex(PLt,"Handle must be 2\u201332 characters: letters, numbers, dashes, or underscores."),wGe=A.enum(["friend","events","twitter","linkedin","hacker_news","reddit","discord","youtube","google","ai_search","other"]),OGe=A.object({id:A.string(),first_name:A.string().min(1),last_name:A.string().min(1),display_name:A.string().min(1),handle:A.string().nullable(),bio:A.string().max(280).nullable(),avatar_url:A.string().nullable(),banner_url:A.string().nullable(),share_new_threads_to_workspace:A.boolean(),experimental_features_enabled:A.boolean(),onboarded_at:A.string().nullable(),attribution_source:wGe.nullable(),attribution_source_detail:A.string().nullable()}),MLt=A.object({email:A.string().nullable(),name:A.string().nullable(),handle:A.string().nullable(),created_at:A.string(),onboarded_at:A.string().nullable(),is_admin:A.boolean(),referred_by_user_id:A.string().nullable(),plan_tier:A.enum(["free","creator","team"]),organization_id:A.string().nullable(),signup_source:A.enum(["referral","organic"]),first_upload_at:A.string().nullable(),first_share_at:A.string().nullable(),first_cli_auth_at:A.string().nullable(),first_plugin_activated_at:A.string().nullable(),first_plugin_agent:A.string().nullable()}),LLt=A.object({group_key:A.string().min(1),properties:A.object({name:A.string(),plan_tier:A.enum(["free","creator","team"]),seat_count:A.number().int().nonnegative(),created_at:A.string(),email_domains:A.array(A.string()),default_thread_visibility:A.string(),member_count:A.number().int().nonnegative().nullable()})}),ULt=A.object({authProviderUserId:A.string().min(1).optional(),organizationId:A.string().min(1).optional(),org_name:A.string().min(1).optional(),organizations:A.array(A.object({id:A.string().min(1),name:A.string().min(1)})),emailAddress:A.string().email(),name:A.string().nullable(),user:OGe,is_admin:A.boolean(),is_new_signup:A.boolean(),posthog:A.object({user_properties:MLt,organization:LLt.nullable()})}),yGe=A.object({workos_client_id:A.string().min(1),workos_api_origin:A.string().url()}),QLt=A.object({share_new_threads_to_workspace:A.boolean().optional(),experimental_features_enabled:A.boolean().optional(),onboarded_at:A.union([A.literal("now"),A.null()]).optional(),attribution_source:wGe.nullable().optional(),attribution_source_detail:A.string().max(280).nullable().optional(),display_name:A.string().min(1).max(120).optional(),handle:BGe.optional(),bio:A.string().max(280).nullable().optional(),avatar_storage_url:A.string().min(1).nullable().optional(),banner_storage_url:A.string().min(1).nullable().optional()}).refine(e=>Object.keys(e).length>0,{message:"At least one field must be provided"}),FLt=A.object({id:A.string(),display_name:A.string(),handle:A.string().nullable(),avatar_url:A.string().nullable(),visible_thread_count:A.number().int().nonnegative(),last_active_at:A.string().datetime().nullable(),product_last_seen_at:A.string().datetime().nullable()}),kGe=A.object({id:A.string().min(1),display_name:A.string().min(1),handle:A.string().nullable(),bio:A.string().max(280).nullable(),avatar_url:A.string().nullable(),banner_url:A.string().nullable(),organization_name:A.string().min(1).nullable(),created_at:A.string().min(1),visible_thread_count:A.number().int().nonnegative(),follower_count:A.number().int().nonnegative(),following_count:A.number().int().nonnegative(),published_project_count:A.number().int().nonnegative(),is_following:A.boolean(),is_self:A.boolean()}),GLt=A.object({type:A.literal("list"),list_type:A.literal("organization_member"),objects:A.array(FLt)}),jLt=A.object({email_address:A.string().email()}),zLt=A.object({email_address:A.string().email(),invitation_id:A.string().min(1)}),HLt=A.object({organization_id:A.string().min(1),organization_name:A.string().min(1),domain:A.string().min(1),created:A.boolean()}),$Lt=A.object({location:A.string().trim().min(1),contact:A.string().trim().email()}),qLt=A.object({name:A.string().trim().min(1).max(100).describe("Sender's name"),email:A.string().trim().email().max(200).describe("Reply-to email"),message:A.string().trim().min(1).max(5e3).describe("Message body"),company:A.string().max(200).optional()}),VLt=A.object({ok:A.boolean()}),YLt=A.object({location:A.string().min(1),contact:A.string().email(),created_at:A.string().datetime()}),PGe=A.enum(["general","bug","feature_request","question"]),KLt=A.object({type:PGe,message:A.string().trim().min(1).max(5e3)}),JLt=A.object({id:A.string().min(1),type:PGe,message:A.string().min(1),created_at:A.string().datetime()}),ZLt=A.object({path_glob:A.string().min(1),name:A.string().min(1),description:A.string().min(1)}),WLt=A.object({repo_origin_path:A.string().min(1),building_blocks:A.array(ZLt)}),MGe=A.string().regex(/^th_[0-9A-Za-z]{22}$/),Mz=A.string().regex(/^tb_[0-9A-Za-z]{22}$/),XLt=A.object({id:MGe,author:A.object({id:A.string().min(1),display_name:A.string().min(1)}),title:A.string().min(1),excerpt:A.string(),created_at:A.string().datetime(),repo_origin_path:A.string().min(1),latest_revision_id:Mz,revision_count:A.number().int().positive()}),eUt=A.object({id:A.string().min(1),display_name:A.string().min(1)}),tUt=A.object({id:A.string().min(1),author_id:A.string().min(1).nullable(),author:eUt.nullable(),created_at:A.string().datetime(),deleted_at:A.string().datetime().nullable(),content:A.string().min(1)}),nUt=A.object({id:A.string().min(1),thread_block_id:A.string().min(1),created_at:A.string().datetime(),resolved_at:A.string().datetime().nullable(),comments:A.array(tUt)}),rUt=A.object({thread_block_id:Mz,from_position:A.number().int().positive(),to_position:A.number().int().positive(),selected_text:A.string().min(1),content:A.string().trim().min(1)}),oUt=A.object({id:A.string().min(1)}),iUt=A.object({content:A.string().trim().min(1)}),sUt=A.object({id:A.string().min(1)}),aUt=A.object({content:A.string().trim().min(1)}),uUt=A.object({id:A.string().min(1)}),cUt=A.object({content:A.string().trim().min(1)}),lUt=A.object({id:A.string().min(1)}),dUt=A.object({resolved:A.boolean()}),pUt=A.object({id:A.string().min(1),resolved_at:A.string().datetime().nullable()}),fUt=A.object({resolved:A.boolean()}),mUt=A.object({id:A.string().min(1),resolved_at:A.string().datetime().nullable()}),Wie=A.record(A.string(),A.unknown()),LGe=A.object({id:Mz,body:A.string().nullable(),created_at:A.string().datetime(),prosemirror_json:Wie.nullable(),comment_threads:A.array(nUt)}),AUt=LGe.extend({body:A.string(),prosemirror_json:Wie}),gUt=A.object({id:MGe,created_at:A.string().datetime(),repo_origin_path:A.string().min(1),author:A.object({id:A.string().min(1),display_name:A.string().min(1)}),latest_revision_id:Mz,revision_count:A.number().int().positive(),revisions:A.array(LGe)}),hUt=A.object({type:A.literal("list"),list_type:A.literal("plan"),has_more:A.boolean(),objects:A.array(XLt)}),_Ut=A.object({before:A.string().min(1).optional(),after:A.string().min(1).optional(),author_id:A.string().min(1).optional(),repo_origin_path:A.string().min(1).optional()}),UGe=A.object({id:A.string().min(1),organization_id:A.string().min(1).nullable(),created_at:A.string().min(1),repo_origin_path:A.string().min(1),path_glob:A.string().min(1),name:A.string().min(1),description:A.string().min(1)}),EUt=A.array(UGe),yUt=A.object({type:A.literal("list"),list_type:A.literal("building_block"),has_more:A.boolean(),objects:A.array(UGe)}),SUt=A.object({repo_origin_path:A.string().min(1),before:A.string().min(1).optional(),after:A.string().min(1).optional()}),TUt=A.enum(["thread","building_block"]),bUt=A.object({repo_origin_path:A.string().min(1),sources:A.array(TUt).nonempty()}),IUt=A.object({type:A.literal("list"),list_type:A.literal("repository"),has_more:A.boolean(),objects:A.array(bUt)}),Lf=A.enum(["claudeCode","codex","amp","lore","cursor","cowork","unspecified"]),CUt=A.enum(["claudeCode","codex","amp","cursor","cowork","unspecified"]),vUt=A.object({uploads:A.array(A.string()),outputs:A.array(A.string())}),RUt=A.object({connected:A.boolean(),last_upload_at:A.string().nullable(),harnesses:A.array(Lf)}),xUt=["transcript","plan"],DUt=A.enum(xUt),Nk=A.enum(["private","workspace"]),t0=A.enum(["claude_global","agents_global","claude_project","agents_project"]),NUt=A.object({name:A.string().min(1),description:A.string().nullable(),root_kind:t0,file_path:A.string().min(1),also_seen_at:A.array(A.string().min(1))}),QGe=A.object({type:A.literal("local_skill_scanner_output"),skills:A.record(A.string(),A.array(NUt))}),Xie=A.enum(["accepted","proposed","rejected","superseded"]),M6n=A.enum(["capture","capture_update","owner_update","subscriber_update"]),wz=A.object({md5:A.string().min(1).describe("Raw hex MD5 used to verify uploaded SKILL.md bytes"),name:A.string().min(1).describe("Skill directory/name, e.g. code-review"),filename:A.string().min(1).describe("Upload object filename, usually <name>/SKILL.md").optional(),description:A.string().nullable().describe("Optional skill description extracted from frontmatter").optional(),root_kind:t0.describe("Local root kind where this skill file came from"),base_version:A.number().int().positive().describe("Installed base version for local edits").optional()}),BUt=A.discriminatedUnion("sync_action",[wz.extend({sync_action:A.literal("capture").describe("Capture a local skill without an existing server skill ID"),skill_id:A.never().optional()}),wz.extend({sync_action:A.literal("owner_update").describe("Publish an accepted update to an owned skill"),skill_id:A.string().min(1).describe("Existing skill ID for owner updates")}),wz.extend({sync_action:A.literal("capture_update").describe("Update an existing private captured skill"),skill_id:A.string().min(1).describe("Existing skill ID for private capture updates")}),wz.extend({sync_action:A.literal("subscriber_update").describe("Propose an update to an installed workspace skill"),skill_id:A.string().min(1).describe("Existing skill ID for subscriber update proposals")})]),wUt=A.object({md5:A.string().min(1),harness:CUt,filename:A.string().min(1).optional(),repo_origin_path:A.string().min(1).optional(),harness_internal_id:A.string().min(1).optional(),file_type:DUt.optional(),artifact_metadata:vUt.optional()}).refine(e=>(e.filename?.trim().length??0)>0||(e.harness_internal_id?.trim().length??0)>0,{path:["harness_internal_id"],message:"filename or harness_internal_id is required"}),Lz=A.object({id:A.string().min(1),display_name:A.string().min(1),avatar_url:A.string().nullable()}),OUt=A.object({id:A.string().min(1),display_name:A.string().min(1)}),FGe=A.object({id:A.string().min(1),author_id:A.string().min(1).nullable(),author:OUt.nullable(),created_at:A.string().datetime(),deleted_at:A.string().datetime().nullable(),content:A.string().min(1)}),GGe=A.object({id:A.string().min(1),thread_block_id:A.string().min(1),created_at:A.string().datetime(),resolved_at:A.string().datetime().nullable()}),kUt=GGe.extend({comments:A.array(FGe)}),xk=A.object({id:A.string().min(1),type:A.string().min(1),index_in_thread:A.number().int().nonnegative(),isCritiqued:A.boolean(),comment_threads:A.array(kUt).optional()}).passthrough(),ese=A.object({type:A.literal("list"),list_type:A.literal("thread_block"),has_more:A.boolean(),objects:A.array(xk)}),SGe=xk.extend({type:A.literal("plan"),prosemirror_json:Wie,thread_file_id:A.string().min(1)}),PUt=A.union([A.literal(-1),A.literal(1)]),jGe=A.union([A.literal(-1),A.literal(0),A.literal(1)]),TGe=A.object({score:A.number().int(),up_count:A.number().int().nonnegative(),down_count:A.number().int().nonnegative(),viewer_vote:jGe}),MUt=A.object({value:PUt}),LUt=A.object({id:A.string().min(1),display_name:A.string().min(1),avatar_url:A.string().nullable()}),AA=A.object({id:A.string().min(1),thread_id:A.string().min(1),author_id:A.string().min(1).nullable(),author:LUt.nullable(),parent_comment_id:A.string().min(1).nullable(),content:A.string(),created_at:A.string().datetime(),updated_at:A.string().datetime(),deleted_at:A.string().datetime().nullable()}),UUt=A.object({type:A.literal("list"),list_type:A.literal("thread_comment"),objects:A.array(AA)}),QUt=A.object({content:A.string().trim().min(1).max(4e3),parent_comment_id:A.string().min(1).optional()}),FUt=AA,GUt=A.object({content:A.string().trim().min(1).max(4e3)}),jUt=AA,zUt=AA,L6n=A.discriminatedUnion("kind",[A.object({kind:A.literal("created"),thread_id:A.string().min(1),actor_user_id:A.string().min(1),version:A.number(),comment:AA}),A.object({kind:A.literal("updated"),thread_id:A.string().min(1),actor_user_id:A.string().min(1),version:A.number(),comment:AA}),A.object({kind:A.literal("deleted"),thread_id:A.string().min(1),actor_user_id:A.string().min(1),version:A.number(),comment:AA})]),HUt=A.enum(["pending","generating","ready","failed"]),$Ut=A.enum(["pending","generating","ready","failed"]),qUt=A.enum(["pending","placeholder","ai","user","command"]),VUt=A.enum(["pending","generating","ready","failed"]),tse=A.enum(["pending","generating","ready","failed","disabled"]),zGe=A.enum(["pending","generating","ready","failed"]),YUt=A.object({title:A.string().min(1),body:A.string().min(1),files:A.array(A.string()).optional()}),KUt=A.object({status:tse,url:A.string().nullable(),url_expires_at:A.string().nullable(),generated_at:A.string().nullable(),model:A.string().nullable()}),JUt=A.object({status:zGe,steps:A.array(YUt),generated_at:A.string().nullable()}),ZUt=A.object({cover:KUt,how_to:JUt}),WUt=A.object({id:A.string().min(1),title:A.string().min(1),author:A.object({id:A.string().min(1),display_name:A.string(),handle:A.string().nullable(),avatar_url:A.string().nullable()}),cover:A.object({url:A.string(),url_expires_at:A.string()}),started_at:A.string(),cover_generated_at:A.string()}),XUt=A.object({type:A.literal("list"),list_type:A.literal("card_feed_item"),has_more:A.boolean(),objects:A.array(WUt)}),HGe=A.enum(["asked","requested","decided","corrected","shared","requirement"]),eQt=A.object({id:A.string().min(1),kind:HGe,summary:A.string().min(1),block_id:A.string().min(1)}),tQt=A.object({block_id:A.string().min(1),status:VUt,generated_at:A.string().nullable()}),nQt=A.object({type:A.literal("list"),list_type:A.literal("thread_decision"),objects:A.array(eQt),block_statuses:A.array(tQt)}),rQt=A.object({forker_intent:A.string().min(1).max(2e3).describe("What the forking user wants to do next with this session")}),oQt=A.object({source_thread_id:A.string().min(1),forker_intent:A.string(),source_distilled:A.string().min(1).describe("Intent-conditioned handoff summary of the source thread for a new agent")}),iQt=A.object({question:A.string().trim().min(1).max(2e3).describe("Question to answer from visible Lore thread decisions and titles")}),sQt=A.object({id:A.string().min(1),kind:HGe,summary:A.string().min(1),block_id:A.string().min(1)}),Jie=A.object({thread_id:A.string().min(1),title:A.string().min(1),summary:A.string().nullable(),started_at:A.string().datetime(),score:A.number(),matched_by:A.enum(["summary","decision"]),decisions:A.array(sQt)}),aQt=A.object({id:A.string().min(1),kind:A.enum(["agent","tool","retrieval","answer","sources"]),title:A.string().min(1),status:A.enum(["completed"]),summary:A.string().min(1),duration_ms:A.number().nonnegative().optional(),metadata:A.object({retrieved_decisions:A.number().int().nonnegative().optional(),returned_sources:A.number().int().nonnegative().optional(),cited_sources:A.number().int().nonnegative().optional(),matched_sources:A.array(Jie).optional(),searched_query:A.string().min(1).optional(),since:A.string().min(1).optional(),until:A.string().min(1).optional(),thread_id:A.string().min(1).optional(),thread_ids:A.array(A.string().min(1)).optional(),question:A.string().min(1).optional()}).optional()}),uQt=A.object({steps:A.array(aQt)}),cQt=A.object({answer:A.string(),sources:A.array(Jie),matched_sources:A.array(Jie).describe("Threads matched by the vector decision search before citation filtering"),searched_query:A.string().describe("String embedded for the vector decision search"),trace:uQt.optional()}),Dk=A.object({id:A.string().min(1),thread_file_id:A.string().min(1),organization_id:A.string().min(1).nullable(),deleted_at:A.string().datetime().nullable(),author:Lz,repo:A.string().min(1),title:A.string().min(1),started_at:A.string().min(1),last_activity_at:A.string().datetime().nullable(),blocks:ese,user_message_count:A.number().int().nonnegative(),files_touched:A.array(A.string()),skills_invoked:A.array(A.string()),slash_commands_invoked:A.array(A.string()),harness:Lf,transcript_parsing_state:A.enum(["pending","parsed","too_large_to_parse","failed"]),visibility:A.enum(["private","workspace","public"]),has_plan:A.boolean().optional(),summary:A.string().nullable(),summary_status:HUt,summary_generated_at:A.string().nullable(),title_status:$Ut,title_generated_at:A.string().nullable(),title_source:qUt,score:A.number().int(),up_count:A.number().int().nonnegative(),down_count:A.number().int().nonnegative(),viewer_vote:jGe,comment_count:A.number().int().nonnegative(),is_favorited:A.boolean(),card:ZUt}),lQt=A.object({storage_url:A.string().min(1)}),dQt=A.object({storage_url:A.string().min(1)}),pQt=A.object({storage_url:A.string(),harness:Lf,thread:Dk.nullable()}),fQt=A.object({status:A.literal("complete"),thread_files:A.array(pQt),skill_files:A.array(A.object({storage_url:A.string(),skill:A.object({id:A.string(),name:A.string(),version:A.number().int().positive(),latest_version:A.number().int().positive(),visibility:Nk,root_kind:t0,version_status:Xie.optional(),content_hash:A.string()}).nullable()})).optional()}),mQt=A.object({id:A.string(),presigned_url:A.string().nullable(),presigned_url_expires_at:A.string().nullable(),storage_url:A.string(),harness:Lf,expected_md5:A.string(),error:A.string().nullable(),thread:Dk.nullable()}),AQt=A.object({id:A.string(),presigned_url:A.string().nullable(),presigned_url_expires_at:A.string().nullable(),storage_url:A.string(),expected_md5:A.string(),name:A.string(),error:A.string().nullable()}),gQt=A.object({id:A.string(),substrate:A.enum(["s3","filesystem"]),status:A.enum(["incomplete","locked_for_parsing","complete","error"]),thread_files:A.array(mQt),skill_files:A.array(AQt).optional()}),hQt=A.object({query:A.string().min(1).describe("Natural-language description of the block or block range to highlight")}),_Qt=A.object({thread_id:A.string(),url:A.string().url(),start_block_id:A.string().nullable(),end_block_id:A.string().nullable(),matched:A.boolean()}),EQt=A.object({}),yQt=A.object({thread_id:A.string().min(1)}),SQt=A.object({visibility:A.enum(["private","workspace","public"]).optional(),title:A.string().trim().min(1).max(200).optional()}).refine(e=>e.visibility!==void 0||e.title!==void 0,{message:"At least one of visibility or title must be provided"}),TQt=A.discriminatedUnion("visibility",[A.object({visibility:A.literal("private")}),A.object({visibility:A.literal("workspace")}),A.object({visibility:A.literal("public"),title:A.string().min(1),author_display_name:A.string().min(1),author_avatar_url:A.string().nullable(),first_user_message:A.string().nullable(),summary:A.string().nullable(),started_at:A.string().min(1),harness:Lf,cover_url:A.string().nullable()})]),bQt=A.object({id:A.string().min(1),author:Lz,repo:A.string().min(1),title:A.string().min(1),started_at:A.string().min(1),last_activity_at:A.string().datetime().nullable(),blocks:ese,user_message_count:A.number().int().nonnegative(),comment_count:A.number().int().nonnegative(),files_touched:A.array(A.string()),skills_invoked:A.array(A.string()),harness:Lf,visibility:A.enum(["private","workspace","public"]),has_plan:A.boolean().optional(),is_favorited:A.boolean()}),bGe=A.object({type:A.literal("list"),list_type:A.literal("thread"),has_more:A.boolean(),objects:A.array(bQt)}),IQt=A.enum(["recent","popular"]),CQt=A.enum(["everyone","following"]),vQt=Dk,RQt=A.object({type:A.literal("list"),list_type:A.literal("discover_thread"),has_more:A.boolean(),objects:A.array(vQt)}),xQt=A.object({before:A.string().min(1).optional(),after:A.string().min(1).optional(),sort:IQt.optional(),scope:CQt.optional(),harness:Lf.optional(),search:A.string().max(200).optional()}),DQt=A.object({thread_count:A.number().int().nonnegative(),author_count:A.number().int().nonnegative(),organization_count:A.number().int().nonnegative(),harness_breakdown:A.record(A.string(),A.number().int().nonnegative()).refine(e=>Object.keys(e).every(t=>Lf.safeParse(t).success),"Harness breakdown keys must be known harness values")}),NQt=A.object({id:A.string(),status:A.enum(["incomplete","locked_for_parsing","complete","error"]),created_at:A.string(),thread_count:A.number().int().nonnegative(),skill_count:A.number().int().nonnegative().default(0),thread_ids:A.array(A.string()).default([])}),BQt=A.object({type:A.literal("list"),list_type:A.literal("upload_session"),objects:A.array(NQt)}),wQt=A.object({before:A.string().min(1).optional(),after:A.string().min(1).optional()}),OQt=A.object({before:A.string().min(1).optional(),after:A.string().min(1).optional(),author_ids:A.string().min(1).optional(),created_at:A.string().min(1).optional(),filepath_prefixes:A.string().min(1).optional(),q:A.string().trim().min(1).max(200).optional()}),kQt=A.object({path:A.string().min(1),start_offset:A.number().int().nonnegative(),end_offset:A.number().int().positive()}),kz=A.object({id:A.string(),display_name:A.string(),avatar_url:A.string().nullable()}),PQt=A.object({before:A.string().min(1).optional().describe("Skill ID cursor. Returns skills newer than this cursor in descending created_at order."),after:A.string().min(1).optional().describe("Skill ID cursor. Returns skills older than this cursor in descending created_at order.")}),MQt=A.object({id:A.string(),name:A.string(),description:A.string().nullable(),visibility:Nk,root_kind:t0,latest_version:A.number().int().nonnegative().nullable(),content_hash:A.string().nullable(),has_content:A.boolean(),owner:kz.nullable(),usage_count:A.number().int().nonnegative(),author_count:A.number().int().nonnegative(),first_used_at:A.string().nullable(),last_used_at:A.string().nullable()}),LQt=A.object({type:A.literal("list"),list_type:A.literal("skill"),has_more:A.boolean(),objects:A.array(MQt)}),UQt=A.object({id:A.string(),title:A.string(),visibility:A.enum(["private","workspace","public"]),started_at:A.string(),author:Lz,skills_invoked:A.array(A.string())}),QQt=A.object({version:A.number().int().positive().describe("Version timestamp for this SKILL.md body"),content_hash:A.string().describe("Content-addressed skill body hash, prefixed by hash type"),status:Xie.describe("Review status for this skill version"),created_at:A.string().describe("ISO-8601 timestamp when this version was uploaded"),created_by:kz.nullable().describe("User who uploaded/proposed this version, when known"),reviewed_at:A.string().nullable().describe("ISO-8601 timestamp when the owner reviewed this version"),reviewed_by:kz.nullable().describe("Owner who approved or rejected this version"),rejection_reason:A.string().nullable().describe("Owner-provided rejection reason for rejected versions")}),IGe=A.object({id:A.string(),name:A.string(),description:A.string().nullable(),visibility:Nk,root_kind:t0,latest_version:A.number().int().nonnegative().nullable(),content_hash:A.string().nullable(),owner:kz.nullable(),usage_count:A.number().int().nonnegative(),author_count:A.number().int().nonnegative(),first_used_at:A.string().nullable(),last_used_at:A.string().nullable(),versions:A.array(QQt),threads:A.array(UQt)}),FQt=A.object({id:A.string(),name:A.string(),visibility:Nk,root_kind:t0,latest_version:A.number().int().nonnegative(),content_hash:A.string()}),GQt=A.object({installation_id:A.string(),already_registered:A.boolean(),body_md_url:A.string(),skill:FQt}),CGe=A.object({id:A.string(),skill_id:A.string(),installed_version:A.number().int().nonnegative().nullable(),already_registered:A.boolean().optional()}),jQt=A.object({installed_version:A.number().int().nonnegative().describe("Accepted skill version that was successfully written locally")}),vGe=A.object({id:A.string(),name:A.string(),version:A.number().int().positive(),latest_version:A.number().int().positive(),visibility:Nk,root_kind:t0,version_status:Xie,content_hash:A.string()}),zQt=A.object({reason:A.string().optional().describe("Optional owner-provided reason for rejecting the proposed version")}),HQt=A.object({id:A.string(),skill_id:A.string(),name:A.string(),description:A.string().nullable(),root_kind:t0,latest_version:A.number().int().nonnegative(),latest_content_hash:A.string(),installed_version:A.number().int().nonnegative().nullable()}),$Qt=A.object({type:A.literal("list"),list_type:A.literal("skill_installation_sync"),has_more:A.boolean(),objects:A.array(HQt)}),qQt=A.object({path:A.string().min(1),text:A.string().max(64e3)}),VQt=A.enum(["text_edit","redact","delete_block"]),YQt=A.object({id:A.string(),thread_block_id:A.string(),editor:A.object({id:A.string(),display_name:A.string()}),kind:VQt,path:A.string().nullable(),previous_text:A.string().nullable(),new_text:A.string().nullable(),created_at:A.string()}),KQt=A.object({type:A.literal("list"),list_type:A.literal("thread_block_edit"),objects:A.array(YQt)}),JQt=A.object({organization_count:A.number().int().nonnegative(),user_count:A.number().int().nonnegative(),thread_count:A.number().int().nonnegative(),thread_count_last_24h:A.number().int().nonnegative(),user_count_last_24h:A.number().int().nonnegative()}),ZQt=A.object({id:A.string(),name:A.string(),email_domains:A.array(A.string()),member_count:A.number().int().nonnegative(),thread_count:A.number().int().nonnegative(),default_thread_visibility:A.enum(["private","workspace","public"]),created_at:A.string()}),WQt=A.object({type:A.literal("list"),list_type:A.literal("admin_organization"),objects:A.array(ZQt)}),$Ge=A.object({id:A.string(),name:A.string()}),XQt=A.object({id:A.string(),display_name:A.string(),workos_id:A.string(),thread_count:A.number().int().nonnegative(),onboarded_at:A.string().nullable(),created_at:A.string(),organizations:A.array($Ge)}),eFt=A.object({q:A.string().trim().min(1).max(120).optional()}),tFt=A.object({follower_id:A.string().min(1),followee_id:A.string().min(1)}),nFt=A.object({follower_id:A.string().min(1),followee_id:A.string().min(1),is_following:A.literal(!0)}),rFt=A.object({type:A.literal("list"),list_type:A.literal("admin_user"),objects:A.array(XQt)}),qGe=A.object({id:A.string(),title:A.string(),started_at:A.string(),created_at:A.string(),deleted_at:A.string().nullable(),visibility:A.enum(["private","workspace","public"]),harness:Lf,harness_internal_id:A.string(),thread_file_id:A.string(),transcript_parsing_state:A.enum(["pending","parsed","too_large_to_parse","failed"]),author:Lz,organization:$Ge.nullable()}),oFt=A.object({id:A.string(),content_type:A.enum(["transcript","plan"]),harness:Lf,harness_internal_id:A.string(),expected_md5:A.string(),size_in_bytes:A.number().int().nonnegative().nullable(),created_at:A.string()}),iFt=A.object({thread:qGe,latest_transcript_file:oFt.nullable()}),sFt=A.object({type:A.literal("list"),list_type:A.literal("admin_thread"),has_more:A.boolean(),objects:A.array(qGe)}),aFt=A.object({before:A.string().min(1).optional(),after:A.string().min(1).optional()}),uFt=A.object({thread_id:A.string().min(1).optional().describe("Lore thread id, e.g. th_xxx."),thread_file_id:A.string().min(1).optional().describe("Thread file id, e.g. tf_xxx."),harness:Lf.optional().describe("Harness name, e.g. claudeCode."),harness_internal_id:A.string().min(1).optional().describe("Harness-native session id.")}),cFt=A.object({thread_id:A.string().min(1),thread_file_id:A.string().min(1),event_name:A.literal("lore/thread-files.parse.requested")}),RGe=A.object({token:A.string().min(1),thread_id:A.string().min(1)}),lFt=A.object({visitor:A.string().min(1).max(64).optional()}),dFt=A.object({user_id:A.string(),display_name:A.string(),shares_sent:A.number().int().nonnegative(),unique_viewers:A.number().int().nonnegative(),attributed_signups:A.number().int().nonnegative()}),pFt=A.object({window_days:A.number().int().positive(),shares_sent:A.number().int().nonnegative(),unique_viewers:A.number().int().nonnegative(),attributed_signups:A.number().int().nonnegative(),active_sharers:A.number().int().nonnegative(),k_factor:A.number().nullable(),shares_sent_sparkline:A.array(A.number().int().nonnegative()),top_sharers:A.array(dFt)}),fFt=A.object({windows:A.array(pFt)}),Oz=A.object({period:A.string(),active:A.number().int().nonnegative()}),mFt=A.object({daily:A.array(Oz),weekly:A.array(Oz),monthly:A.array(Oz),allTime:A.array(Oz)}),AFt=A.object({quoted_text:A.string().min(1),comment:A.string().nullable(),type:A.enum(["comment","highlight:trapdoor"])}),gFt=GGe,hFt=FGe.extend({comment_thread_id:A.string().min(1)}),_Ft=A.object({markdown:A.string().min(1)}),EFt=A.object({storage_url:A.string().min(1),thread_file_id:A.string().min(1),parsed_plan_block:SGe,critiqued_plan_block:SGe,annotations:A.array(AFt),comment_threads:A.array(gFt),comments:A.array(hFt)}),yFt=A.object({key:A.string().min(1),label:A.string().min(1),description:A.string().optional(),type:A.enum(["text","textarea","url","email"]),required:A.boolean(),defaultValue:A.string()}),SFt=A.object({id:A.string().min(1),name:A.string().min(1),description:A.string().min(1),deliveryTrigger:A.string().min(1),fields:A.array(yFt),availableFormats:A.array(A.enum(["html","text"]))}),TFt=A.object({templates:A.array(SFt)}),bFt=A.object({values:A.record(A.string(),A.string())}),IFt=A.object({subject:A.string().min(1),html:A.string().optional(),text:A.string().optional()}),CFt=A.object({to:A.string().email().describe("Recipient email address."),values:A.record(A.string(),A.string())}),vFt=A.object({id:A.string().min(1)}),Qx=A.enum(cee),VGe=A.object({workspace_scope:A.boolean(),review:A.boolean(),shared_thread_ttl_days:A.number().int().positive().nullable()}),Zie=A.object({subject_type:A.enum(["user","organization"]),subject_id:A.string().min(1),effective_plan:Qx,admin_override:Qx.nullable(),stripe_subscription_status:A.string().nullable(),cancel_at_period_end:A.boolean(),current_period_end:A.string().nullable(),seat_quantity:A.number().int().positive(),member_count:A.number().int().nonnegative().nullable(),features:VGe}),RFt=A.object({effective_plan:Qx,features:VGe,user:Zie,organization:Zie.nullable()}),xFt=A.object({plan:A.enum(["creator","team"]),seat_quantity:A.number().int().positive().optional()}),DFt=A.object({checkout_url:A.string().min(1)}),NFt=A.object({portal_url:A.string().min(1)}),BFt=A.object({seat_quantity:A.number().int().positive()}),xGe=A.object({plan:Qx.nullable()}),Pz=A.object({subject_type:A.enum(["user","organization"]),subject_id:A.string().min(1),label:A.string().min(1),effective_plan:Qx,admin_override:Qx.nullable(),stripe_subscription_status:A.string().nullable(),seat_quantity:A.number().int().positive()}),wFt=A.object({users:A.array(Pz),organizations:A.array(Pz)}),OFt=A.object({id:A.string().min(1),display_name:A.string().min(1),handle:A.string().nullable(),avatar_url:A.string().nullable()}),kFt=A.object({thread_id:A.string().min(1),title:A.string().min(1),author:OFt,last_active_at:A.string().datetime(),last_block_excerpt:A.string().nullable(),last_block_kind:A.string().min(1).nullable(),is_streaming:A.boolean()}),PFt=A.object({type:A.literal("list"),list_type:A.literal("live_thread"),objects:A.array(kFt)}),MFt=A.object({thread_id:A.string().min(1)}),LFt=A.object({thread_id:A.string().min(1),last_seen_at:A.string().datetime(),started_at:A.string().datetime()}),UFt=A.object({user_id:A.string().min(1),organization_id:A.string().min(1).nullable(),last_seen_at:A.string().datetime(),started_at:A.string().datetime()}),QFt=A.object({upload_completed:A.boolean().optional().describe("When true, also bump last_upload_at \u2014 the daemon completed an upload pass.")}),FFt=A.object({last_seen_at:A.string().datetime(),last_upload_at:A.string().datetime().nullable(),started_at:A.string().datetime()}),GFt=A.object({follower_id:A.string().min(1),followee_id:A.string().min(1),is_following:A.literal(!0),follower_count:A.number().int().nonnegative()}),jFt=A.object({follower_id:A.string().min(1),followee_id:A.string().min(1),is_following:A.literal(!1),follower_count:A.number().int().nonnegative()}),e0=A.object({id:A.string().min(1),display_name:A.string().min(1),handle:A.string().nullable(),avatar_url:A.string().nullable(),bio:A.string().max(280).nullable(),is_following:A.boolean(),is_self:A.boolean()}),DGe=A.object({type:A.literal("list"),list_type:A.literal("user_follow"),objects:A.array(e0)}),zFt=e0.extend({mutuals:A.array(e0),mutual_count:A.number().int().nonnegative()}),HFt=A.object({type:A.literal("list"),list_type:A.literal("follow_suggestion"),objects:A.array(zFt)}),$Ft=e0.extend({referred_at:A.string().min(1)}),qFt=A.object({type:A.literal("list"),list_type:A.literal("referral"),count:A.number().int().nonnegative(),recent:A.array($Ft)}),VFt=A.object({date:A.string().regex(/^\d{4}-\d{2}-\d{2}$/),referred:A.number().int().nonnegative(),total:A.number().int().nonnegative()}),YFt=A.object({inviter:e0,organization_name:A.string().nullable(),referred_count:A.number().int().positive(),latest_referred_at:A.string().min(1)}),KFt=A.object({inviter:e0,referee:e0,attributed_at:A.string().min(1)}),JFt=A.object({total_referred_signups:A.number().int().nonnegative(),active_inviters:A.number().int().nonnegative(),referred_signups_last_30d:A.number().int().nonnegative(),total_signups_last_30d:A.number().int().nonnegative(),daily_counts:A.array(VFt),top_inviters:A.array(YFt),recent_attributions:A.array(KFt)}),ZFt=A.object({source:A.string().min(1),signups:A.number().int().nonnegative()}),WFt=A.object({sources:A.array(ZFt),total_with_source:A.number().int().nonnegative(),total_without_source:A.number().int().nonnegative()}),XFt=A.object({date:A.string().regex(/^\d{4}-\d{2}-\d{2}$/),count:A.number().int().nonnegative()}),e4t=A.object({window_start:A.string().datetime(),window_end:A.string().datetime(),total_contributions:A.number().int().nonnegative(),days_active:A.number().int().nonnegative(),daily_average:A.number().nonnegative(),current_streak_days:A.number().int().nonnegative(),days:A.array(XFt)}),t4t=A.object({type:A.literal("thread_created"),occurred_at:A.string().datetime(),id:A.string().min(1),thread:A.object({id:A.string().min(1),title:A.string(),visibility:A.enum(["private","workspace","public"])})}),n4t=A.object({type:A.literal("thread_updated"),occurred_at:A.string().datetime(),id:A.string().min(1),thread:A.object({id:A.string().min(1),title:A.string(),visibility:A.enum(["private","workspace","public"])})}),r4t=A.object({type:A.literal("comment_posted"),occurred_at:A.string().datetime(),id:A.string().min(1),comment_excerpt:A.string(),thread:A.object({id:A.string().min(1),title:A.string(),visibility:A.enum(["private","workspace","public"])})}),o4t=A.object({type:A.literal("project_published"),occurred_at:A.string().datetime(),id:A.string().min(1),project:A.object({id:A.string().min(1),name:A.string().min(1)})}),i4t=A.object({type:A.literal("user_followed"),occurred_at:A.string().datetime(),id:A.string().min(1),followee:e0}),s4t=A.discriminatedUnion("type",[t4t,n4t,r4t,o4t,i4t]),a4t=A.object({type:A.literal("list"),list_type:A.literal("user_activity"),objects:A.array(s4t)}),u4t=A.object({id:A.string().min(1),name:A.string().min(1),excerpt:A.string(),published_at:A.string().datetime(),updated_at:A.string().datetime()}),c4t=A.object({type:A.literal("list"),list_type:A.literal("profile_published_project"),objects:A.array(u4t)}),NGe=A.object({id:A.string().min(1),published_at:A.string().datetime().nullable()}),l4t=A.enum(["avatar","banner"]),YGe=A.enum(["image/png","image/jpeg","image/webp","image/gif"]),d4t=A.object({kind:l4t,content_type:YGe,base64_data:A.string().min(1)}),p4t=A.object({substrate:A.enum(["s3","filesystem"]),storage_url:A.string().min(1)}),f4t=A.object({content_type:YGe,base64_data:A.string().min(1)}),m4t=A.object({cover_status:tse,cover_url:A.string().min(1),cover_url_expires_at:A.string().min(1),cover_generated_at:A.string().min(1)}),A4t=kGe,Uz=BLt.router({health:{method:"GET",path:"/health",responses:{200:A.object({status:A.literal("ok")})},summary:"Health check"},getDeepHealth:{method:"GET",path:"/health/deep",responses:{200:A.object({status:A.enum(["ok","degraded"]),environment:A.string(),checks:A.object({database:A.object({ok:A.boolean(),latencyMs:A.number().int().nonnegative().optional(),error:A.string().optional()}),migrations:A.object({ok:A.boolean(),appliedCount:A.number().int().nonnegative(),pendingCount:A.number().int().nonnegative(),latestApplied:A.string().optional(),pending:A.array(A.string())}),storage:A.object({ok:A.boolean(),bucket:A.string().optional(),error:A.string().optional()})})}),503:A.object({status:A.literal("down"),environment:A.string(),error:A.string()})},summary:"Diagnostic health check covering database connectivity, migration drift, and storage reachability. Used by smoke tests and operators; NOT wired into Railway healthcheckPath."},whoAmI:{method:"GET",path:"/whoami",headers:A.object({authorization:A.string().min(1).optional(),"x-lore-referral-token":A.string().min(1).max(16).optional(),"x-lore-invited-by-user-id":A.string().min(1).max(40).optional(),"user-agent":A.string().min(1).max(1024).optional()}),responses:{200:ULt,401:q,500:q,502:q},summary:"Validate a WorkOS Bearer token and return member plus user fields"},getCliAuthConfig:{method:"GET",path:"/cli-auth/config",responses:{200:yGe,503:q},summary:"Return public WorkOS CLI Auth configuration for the Lore CLI"},getDesktopAuthConfig:{method:"GET",path:"/desktop-auth/config",responses:{200:yGe,503:q},summary:"Return public WorkOS configuration for the Lore desktop app (dedicated native client, separate from the web/CLI client)"},getCliStatus:{method:"GET",path:"/users/me/cli-status",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:RUt,401:q},summary:"Return whether the viewer has connected the Lore CLI (i.e., uploaded any thread under a non-unspecified harness), plus the latest upload timestamp."},recordHeartbeat:{method:"POST",path:"/heartbeat",headers:A.object({authorization:A.string().min(1).optional()}),body:MFt,responses:{200:LFt,401:q,403:q,404:q,422:q},summary:"Record (or refresh) a presence heartbeat for the authenticated user against one of their own threads. Idempotent; the daemon should call this every ~30s while a session is open."},recordProductPresence:{method:"POST",path:"/users/me/presence",headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:UFt,401:q},summary:"Record (or refresh) an authenticated Lore web-app presence heartbeat for the current user. Browser clients call this while the product is open."},recordCliHeartbeat:{method:"POST",path:"/users/me/cli-heartbeat",headers:A.object({authorization:A.string().min(1).optional()}),body:QFt,responses:{200:FFt,401:q},summary:"Record a liveness heartbeat for the authenticated user's CLI watch daemon. Idempotent; the daemon calls this ~every 60s and on each completed upload (upload_completed:true). Daemon-internal \u2014 not a `lore` subcommand."},listLiveThreads:{method:"GET",path:"/threads/live",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:PFt,401:q,403:q},summary:"List people with user-block activity in the last 10 minutes. Includes the viewer\u2019s workspace and followed authors, deduped per author, max 10."},listThreads:{method:"GET",path:"/threads",headers:A.object({authorization:A.string().min(1).optional()}),query:OQt,responses:{200:bGe,401:q},summary:"List threads visible to the authenticated user"},createThread:{method:"POST",path:"/threads",headers:A.object({authorization:A.string().min(1).optional()}),body:EQt,responses:{201:yQt,401:q},summary:"Create an empty Lore-native thread for the authenticated user"},getThread:{method:"GET",path:"/threads/:id",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:Dk,404:q},summary:"Load a visible thread by id"},getSimilarThreads:{method:"GET",path:"/threads/:id/similar",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:bGe,404:q,409:q},summary:"List the top 20 visible threads with the closest summary embedding"},resolveThreadShareHighlight:{method:"POST",path:"/threads/:id/share-highlight",pathParams:A.object({id:A.string().min(1).describe("Thread id to share")}),headers:A.object({authorization:A.string().min(1).optional()}),body:hQt,responses:{200:_Qt,401:q,404:q,409:q},summary:"Resolve a natural-language share highlight to a canonical /thread URL with block anchors"},askThreads:{method:"POST",path:"/threads/ask",headers:A.object({authorization:A.string().min(1).optional()}),body:iQt,responses:{200:cQt,401:q},summary:"Answer a question from the top 20 visible decision matches, grouped back into threads"},forkThread:{method:"POST",path:"/threads/:id/fork",pathParams:A.object({id:A.string().min(1).describe("Thread id or stable harness lookup id to fork")}),headers:A.object({authorization:A.string().min(1).optional()}),body:rQt,responses:{200:oQt,403:q,404:q},summary:"Generate a distilled source handoff for continuing a visible coding-assistant session"},listThreadBlocks:{method:"GET",path:"/threads/:id/blocks",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),query:wQt,responses:{200:ese,401:q},summary:"List blocks for a visible thread"},createThreadBlockCommentThread:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads",pathParams:A.object({threadId:A.string().min(1),blockId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:iUt,responses:{201:sUt,401:q,404:q},summary:"Create a new block-level comment thread on a visible thread block"},createThreadBlockComment:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId/comments",pathParams:A.object({threadId:A.string().min(1),blockId:A.string().min(1),commentThreadId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:cUt,responses:{201:lUt,401:q,404:q,409:q},summary:"Reply to a block-level comment thread on a visible thread block"},updateThreadBlockCommentThread:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId",pathParams:A.object({threadId:A.string().min(1),blockId:A.string().min(1),commentThreadId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:fUt,responses:{200:mUt,401:q,404:q},summary:"Resolve or reopen a block-level comment thread on a visible thread block"},listSkills:{method:"GET",path:"/skills",headers:A.object({authorization:A.string().min(1).optional()}),query:PQt,responses:{200:LQt,401:q},summary:"List visible workspace skills and the viewer's private captured skills"},getSkillDetail:{method:"GET",path:"/skills/:id",pathParams:A.object({id:A.string().min(1).describe("Stable skill ID, e.g. sk_...")}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:IGe,401:q,404:q},summary:"Get visible skill details by stable skill ID"},getSkillRaw:{method:"GET",path:"/skills/:id/raw",pathParams:A.object({id:A.string().min(1).describe("Stable skill ID, e.g. sk_...")}),query:A.object({version:A.coerce.number().int().positive().optional().describe("Version timestamp to download. Defaults to latest accepted version.")}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:A.string(),401:q,403:q,404:q},summary:"Raw SKILL.md body for a skill (download / install path)"},installSkill:{method:"POST",path:"/skills/:id/installations",pathParams:A.object({id:A.string().min(1).describe("Workspace skill ID to install")}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:GQt,401:q,403:q,404:q},summary:"Register the current user as an installer of a visible skill"},uninstallSkill:{method:"DELETE",path:"/skills/:id/installation",pathParams:A.object({id:A.string().min(1).describe("Workspace skill ID to uninstall")}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:CGe,401:q},summary:"Unregister the current user installation for a skill (idempotent)"},updateSkillInstallation:{method:"PATCH",path:"/skills/installations/:id",pathParams:A.object({id:A.string().min(1).describe("Stable skill installation ID, e.g. ski_...")}),headers:A.object({authorization:A.string().min(1).optional()}),body:jQt,responses:{200:CGe,401:q,404:q,422:q},summary:"Record the accepted skill version installed by the current user"},listSkillInstallationSync:{method:"GET",path:"/skills/installations/sync",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:$Qt,401:q},summary:"List installed skills with latest accepted version metadata"},publishSkill:{method:"POST",path:"/skills/:id/publish",pathParams:A.object({id:A.string().min(1).describe("Private captured skill ID to publish")}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:IGe,401:q,403:q,404:q},summary:"Promote a private captured skill to the caller workspace"},approveSkillVersion:{method:"POST",path:"/skills/:id/versions/:version/approve",pathParams:A.object({id:A.string().min(1).describe("Workspace skill ID"),version:A.coerce.number().int().positive().describe("Proposed version timestamp to approve")}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:vGe,400:q,401:q,403:q,404:q},summary:"Approve a proposed skill version and make it latest accepted"},rejectSkillVersion:{method:"POST",path:"/skills/:id/versions/:version/reject",pathParams:A.object({id:A.string().min(1).describe("Workspace skill ID"),version:A.coerce.number().int().positive().describe("Proposed version timestamp to reject")}),headers:A.object({authorization:A.string().min(1).optional()}),body:zQt.optional(),responses:{200:vGe,400:q,401:q,403:q,404:q},summary:"Reject a proposed skill version with an optional owner reason"},redactThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/redactions",pathParams:A.object({threadId:A.string().min(1),blockId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:kQt,responses:{200:xk,401:q,403:q,404:q,422:q},summary:"Permanently redact a character range within a text field of a thread block (author only)"},updateThreadBlockText:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/text",pathParams:A.object({threadId:A.string().min(1),blockId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:qQt,responses:{200:xk,401:q,403:q,404:q,422:q},summary:"Replace a single text leaf in a thread block with new content (author only)"},critiqueThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/critique",pathParams:A.object({threadId:A.string().min(1),blockId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:xk,401:q,403:q,404:q,409:q,422:q},summary:"Critique a plan block once and persist its annotations as nested comment threads (author only)"},listThreadBlockEdits:{method:"GET",path:"/threads/:threadId/blocks/:blockId/edits",pathParams:A.object({threadId:A.string().min(1),blockId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:KQt,401:q,404:q},summary:"List edits made to a thread block (visible to anyone who can see the thread)"},listThreadDecisions:{method:"GET",path:"/threads/:id/decisions",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:nQt,401:q,404:q},summary:"List AI-extracted user decisions for a thread, in chronological order"},updateThread:{method:"PATCH",path:"/threads/:id",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:SQt,responses:{200:Dk,401:q,403:q,404:q},summary:"Update thread visibility (author only)"},deleteThread:{method:"DELETE",path:"/threads/:id",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{204:A.null(),401:q,403:q,404:q},summary:"Soft-delete a thread (author only)"},generateThreadCard:{method:"POST",path:"/threads/:id/card/generate",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:A.object({cover_status:tse,how_to_status:zGe}),401:q,403:q,404:q,429:q.extend({retry_after_seconds:A.number().int().nonnegative()})},summary:"Enqueue cover image + how-to recipe generation for the thread. Author-only. Idempotent \u2014 recently-fired statuses are not double-enqueued. Rate-limited: at most one cover generation per minute per thread (cooldown begins when the previous cover finishes). Used to populate cards on legacy threads (created before Lore Cards) and to retry after a 'failed' status or opt back in from 'disabled'."},uploadThreadCover:{method:"POST",path:"/threads/:id/card/cover/upload",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:f4t,responses:{200:m4t,401:q,403:q,404:q,413:q,422:q},summary:"Upload a custom cover image for a thread. Author or Tanagram admin only. Bytes go to the same storage substrate the AI cover uses (S3 in prod, filesystem in dev), and the threads row is updated atomically with the new cover_storage_url, cover_status='ready', cover_generated_at=now, cover_model='user-uploaded' so subsequent re-rolls / how-to fan-outs treat the upload like any other ready cover."},castThreadVote:{method:"PUT",path:"/threads/:id/vote",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:MUt,responses:{200:TGe,401:q,403:q,404:q,422:q},summary:"Cast or change the caller's up/down vote on a public thread. Idempotent \u2014 re-casting the same value is a no-op."},clearThreadVote:{method:"DELETE",path:"/threads/:id/vote",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:TGe,401:q,404:q},summary:"Clear the caller's vote on a thread. No-op when the caller hasn't voted."},listThreadComments:{method:"GET",path:"/threads/:threadId/comments",pathParams:A.object({threadId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:UUt,403:q,404:q},summary:"List all (live + soft-deleted as tombstones) comments on a public thread, flat with parent_comment_id pointers."},createThreadComment:{method:"POST",path:"/threads/:threadId/comments",pathParams:A.object({threadId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:QUt,responses:{201:FUt,401:q,403:q,404:q,422:q},summary:"Post a top-level or reply comment on a public thread."},updateThreadComment:{method:"PATCH",path:"/threads/:threadId/comments/:commentId",pathParams:A.object({threadId:A.string().min(1),commentId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:GUt,responses:{200:jUt,401:q,403:q,404:q,422:q},summary:"Edit your own thread comment (author only; rejects edits to soft-deleted rows)."},deleteThreadComment:{method:"DELETE",path:"/threads/:threadId/comments/:commentId",pathParams:A.object({threadId:A.string().min(1),commentId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:zUt,401:q,403:q,404:q},summary:"Soft-delete your own thread comment (author only). Idempotent."},getThreadPreview:{method:"GET",path:"/threads/:id/preview",pathParams:A.object({id:A.string().min(1)}),responses:{200:TQt,404:q},summary:"Unauthenticated, visibility-redacted metadata for OG / social preview consumers"},getUser:{method:"GET",path:"/users/:id",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:kGe,404:q},summary:"Public profile for a user. Optional auth \u2014 unauthenticated viewers see only public thread metadata; signed-in viewers see counts scoped to the threads they'd normally be able to access."},updateCurrentUser:{method:"PATCH",path:"/users/me",headers:A.object({authorization:A.string().min(1).optional()}),body:QLt,responses:{200:OGe,401:q,409:q,422:q},summary:"Update the authenticated user profile"},getUserByHandle:{method:"GET",path:"/users/by-handle/:handle",pathParams:A.object({handle:BGe}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:A4t,404:q},summary:"Resolve a public profile by handle \u2014 same shape as GET /users/:id but keyed on the user's chosen handle."},listMyReferrals:{method:"GET",path:"/users/me/referrals",headers:A.object({authorization:A.string().min(1)}),responses:{200:qFt,401:q},summary:"Total count plus the most-recent referees the authenticated user has attributed via `/?invited_by=\u2026` invite links. Mirrors the inviter side of users.referred_by_user_id."},listUserActivity:{method:"GET",path:"/users/:id/activity",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),query:A.object({limit:A.coerce.number().int().positive().max(100).optional()}),responses:{200:a4t,404:q},summary:"Reverse-chronological activity feed for a user, scoped to what the viewer can see (same visibility rules as listThreads)."},getUserContributions:{method:"GET",path:"/users/:id/contributions",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:e4t,404:q},summary:"Daily contribution counts for the trailing 365 days \u2014 counts thread blocks the user authored on threads visible to the viewer."},listUserFollowers:{method:"GET",path:"/users/:id/followers",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:DGe,404:q},summary:"List the users following a given user."},listUserFollowing:{method:"GET",path:"/users/:id/following",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:DGe,404:q},summary:"List the users a given user is following."},listFollowSuggestions:{method:"GET",path:"/users/:id/follow-suggestions",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:HFt,404:q},summary:"Mutual-follow suggestions for a viewer: walks the viewer's followees one hop further and ranks candidates by mutual count. Replaces a 1 \u2192 24 client-side fan-out across `/users/:seed/following`."},followUser:{method:"POST",path:"/users/:id/follow",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:GFt,401:q,404:q,409:q,422:q},summary:"Follow another user. Idempotent \u2014 repeating the call is a no-op."},unfollowUser:{method:"DELETE",path:"/users/:id/follow",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:jFt,401:q,404:q},summary:"Unfollow a user. Idempotent \u2014 repeating the call is a no-op."},listProfilePublishedProjects:{method:"GET",path:"/users/:id/projects",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:c4t,404:q},summary:"Projects the user has published to their public profile."},publishProject:{method:"POST",path:"/projects/:id/publish",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:NGe,401:q,403:q,404:q},summary:"Publish a project to the author's public profile. Stamps published_at with `now()`. Author-only."},unpublishProject:{method:"DELETE",path:"/projects/:id/publish",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:NGe,401:q,403:q,404:q},summary:"Remove a project from the author's public profile."},uploadProfileImage:{method:"POST",path:"/users/me/profile-image",headers:A.object({authorization:A.string().min(1).optional()}),body:d4t,responses:{200:p4t,401:q,413:q,422:q},summary:"Upload an avatar or banner image (base64-encoded JSON body). The API streams the bytes to its configured storage substrate using its own credentials and returns the canonical storage URL the client passes to PATCH /users/me."},listOrganizationMembers:{method:"GET",path:"/organization/members",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:GLt,401:q},summary:"List members of the authenticated user\u2019s organization"},createOrganizationInvite:{method:"POST",path:"/organization/invites",headers:A.object({authorization:A.string().min(1).optional()}),body:jLt,responses:{201:zLt,401:q,403:q,409:q,422:q},summary:"Invite a teammate to the authenticated user\u2019s workspace via WorkOS AuthKit"},ensureWorkOSOrganization:{method:"POST",path:"/organization/workos/ensure",headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:HLt,401:q,422:q,503:q},summary:"Create or reuse a WorkOS organization for the authenticated user\u2019s non-public email domain and add the user as a member."},listRepositories:{method:"GET",path:"/repositories",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:IUt,401:q,403:q},summary:"List repositories known to the authenticated user\u2019s organization across threads and building blocks"},createBuildingBlockSnapshots:{method:"POST",path:"/building_blocks",headers:A.object({authorization:A.string().min(1).optional()}),body:WLt,responses:{201:EUt,401:q,403:q},summary:"Create building block snapshots for the authenticated user\u2019s organization"},getPlan:{method:"GET",path:"/plans/:id",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:gUt,401:q,403:q,404:q},summary:"Load a thread-backed plan container visible to the authenticated user, including all visible plan revisions in that thread (only the latest revision carries body + prosemirror_json; older revisions are metadata-only and load on demand via getPlanRevision)"},getPlanRevision:{method:"GET",path:"/plans/:id/revisions/:revisionId",pathParams:A.object({id:A.string().min(1),revisionId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:AUt,401:q,403:q,404:q},summary:"Load a single revision body + prosemirror_json + comment threads for a thread-backed plan container. Used to fetch non-latest revisions on demand without paying for every revision when the plan is first opened"},createPlanCommentThread:{method:"POST",path:"/plans/:id/comment-threads",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:rUt,responses:{201:oUt,401:q,403:q,404:q,422:q},summary:"Create a new inline comment thread on a specific revision inside a thread-backed plan container"},createPlanComment:{method:"POST",path:"/plans/:id/comment-threads/:threadId/comments",pathParams:A.object({id:A.string().min(1),threadId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:aUt,responses:{201:uUt,401:q,403:q,404:q,409:q},summary:"Reply to an inline comment thread on a thread-backed plan container"},updatePlanCommentThread:{method:"PATCH",path:"/plans/:id/comment-threads/:threadId",pathParams:A.object({id:A.string().min(1),threadId:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:dUt,responses:{200:pUt,401:q,403:q,404:q},summary:"Resolve or reopen an inline comment thread on a thread-backed plan container"},listPlans:{method:"GET",path:"/plans",headers:A.object({authorization:A.string().min(1).optional()}),query:_Ut,responses:{200:hUt,401:q,403:q},summary:"List thread-backed plan containers visible to the authenticated user in their organization, ordered by latest visible revision and optionally filtered by author or repository"},listBuildingBlockSnapshots:{method:"GET",path:"/building_blocks",headers:A.object({authorization:A.string().min(1).optional()}),query:SUt,responses:{200:yUt,401:q,403:q},summary:"List building block snapshots for the authenticated user\u2019s organization and repo origin path"},listUploadSessions:{method:"GET",path:"/upload_sessions",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:BQt,401:q},summary:"List recent upload sessions for the authenticated user"},createUploadSession:{method:"POST",path:"/upload_sessions",headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({thread_files:A.array(wUt).optional(),skill_files:A.array(BUt).optional()}),responses:{201:gQt,400:q,401:q},summary:"Create an upload session with presigned URLs for file uploads"},completeUploadSession:{method:"POST",path:"/upload_sessions/:id/complete",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({thread_files:A.array(lQt).optional(),skill_files:A.array(dQt).optional()}),responses:{200:fQt,400:q,401:q,404:q,409:q,422:q},summary:"Complete an upload session after files have been uploaded to storage"},adminStats:{method:"GET",path:"/admin/stats",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:JQt,401:q,403:q},summary:"Cross-org operational counts. Tanagram admins only."},adminListOrganizations:{method:"GET",path:"/admin/organizations",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:WQt,401:q,403:q},summary:"List every organization with member and thread counts. Tanagram admins only."},adminListUsers:{method:"GET",path:"/admin/users",query:eFt,headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:rFt,401:q,403:q},summary:"List every user with their org memberships and thread count. Tanagram admins only."},adminListThreads:{method:"GET",path:"/admin/threads",headers:A.object({authorization:A.string().min(1).optional()}),query:aFt,responses:{200:sFt,401:q,403:q},summary:"List live threads across every organization. Tanagram admins only."},adminLookupThread:{method:"GET",path:"/admin/threads/lookup",headers:A.object({authorization:A.string().min(1).optional()}),query:uFt,responses:{200:iFt,400:q,401:q,403:q,404:q},summary:"Look up a thread by thread id, thread file id, or harness session id. Tanagram admins only."},adminForceFollow:{method:"POST",path:"/admin/connections/follow",headers:A.object({authorization:A.string().min(1).optional()}),body:tFt,responses:{200:nFt,401:q,403:q,404:q,422:q},summary:"Force follower->followee edge. Admin-only and non-destructive."},adminHardDeleteThread:{method:"DELETE",path:"/admin/threads/:id",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{204:A.null(),401:q,403:q,404:q},summary:"Permanently remove a thread. Tanagram admins only."},adminReparseThreadFile:{method:"POST",path:"/admin/thread-files/:id/reparse",pathParams:A.object({id:A.string().min(1).describe("Thread file id, e.g. tf_xxx.")}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{200:cFt,401:q,403:q,404:q},summary:"Re-enqueue parsing for a thread file. Tanagram admins only."},listCardFeed:{method:"GET",path:"/cards/feed",query:A.object({limit:A.coerce.number().int().min(1).max(48).optional()}),responses:{200:XUt},summary:"Slim feed of public threads with a ready cover image, ordered by cover_generated_at descending. Powers the landing-page UGC card scroll. Returns presigned cover URLs inline so the grid renders without a follow-up round trip per card."},listDiscoverThreads:{method:"GET",path:"/discover/threads",headers:A.object({authorization:A.string().min(1).optional()}),query:xQt,responses:{200:RQt},summary:"Feed of public threads with sort, harness filter, search, and cursor pagination. Auth is optional and populates viewer_vote."},discoverStats:{method:"GET",path:"/discover/stats",responses:{200:DQt},summary:"Unauthenticated rollup of public-thread counts for the Discover header."},createWaitlistEntry:{method:"POST",path:"/waitlist_entries",body:$Lt,responses:{201:YLt,409:q},summary:"Create an unauthenticated waitlist entry keyed by (location, contact)."},submitContactMessage:{method:"POST",path:"/contact",body:qLt,responses:{200:VLt,429:q,503:q},summary:"Submit a contact-form message from the marketing site; emails the Lore team."},createFeedback:{method:"POST",path:"/feedback",headers:A.object({authorization:A.string().min(1).optional()}),body:KLt,responses:{201:JLt,401:q,422:q,429:q},summary:"Submit in-app feedback. Persists to lore.feedback_entries and best-effort posts to the #lore-feedback Slack channel. Rate-limited to 30 submissions/hour per user."},createShareToken:{method:"POST",path:"/threads/:id/share-token",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({}).optional(),responses:{201:RGe,401:q,403:q,404:q,409:q},summary:"Mint a short share-link token for a public thread. Author only. The token powers `/s/:token` short URLs and enables k-factor attribution."},resolveShareToken:{method:"GET",path:"/referrals/resolve/:token",pathParams:A.object({token:A.string().min(1).max(16)}),headers:A.object({authorization:A.string().min(1).optional()}),query:lFt,responses:{200:RGe,404:q},summary:"Resolve a share-link token to its thread and record the view. Works for signed-out viewers; if a bearer token is present we attribute the view to that Lore user for analytics."},adminGrowth:{method:"GET",path:"/admin/growth",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:fFt,401:q,403:q},summary:"Share-link k-factor, funnel, sparkline, and top sharers by window. Tanagram admins only."},adminActiveUsers:{method:"GET",path:"/admin/active-users",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:mFt,401:q,403:q},summary:"DAU/WAU/MAU/all-time active-user buckets \u2014 union of oauth token issuance and thread-event spine. Tanagram admins only."},adminReferrals:{method:"GET",path:"/admin/referrals",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:JFt,401:q,403:q},summary:"Cross-organization invite-link funnel: lifetime + 30-day counts, 60-day daily timeseries, top inviters, recent attributions. Tanagram admins only."},adminOnboardingSources:{method:"GET",path:"/admin/onboarding/sources",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:WFt,401:q,403:q},summary:"Signed-up persons grouped by PostHog `initial_source` first-touch attribution. Powers bucket 1 of /admin's Onboarding flow tab; sourced via HogQL."},adminRunCritiquePlayground:{method:"POST",path:"/admin/critique-playground/run",headers:A.object({authorization:A.string().min(1).optional()}),body:_Ft,responses:{200:EFt,401:q,403:q,409:q},summary:"Admin-only critique playground that saves markdown to a file:// plan artifact and returns parsed + critiqued plan blocks."},adminListEmailTemplates:{method:"GET",path:"/admin/email-templates",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:TFt,401:q,403:q},summary:"List transactional email templates and their editable preview fields. Tanagram admins only."},adminPreviewEmailTemplate:{method:"POST",path:"/admin/email-templates/:id/preview",pathParams:A.object({id:A.string().min(1).describe("Email template id.")}),headers:A.object({authorization:A.string().min(1).optional()}),body:bFt,responses:{200:IFt,400:q,401:q,403:q,404:q},summary:"Render a transactional email template with supplied values. Tanagram admins only."},adminSendEmailTemplate:{method:"POST",path:"/admin/email-templates/:id/send",pathParams:A.object({id:A.string().min(1).describe("Email template id.")}),headers:A.object({authorization:A.string().min(1).optional()}),body:CFt,responses:{200:vFt,400:q,401:q,403:q,404:q,503:q},summary:"Send a transactional email template through Resend. Tanagram admins only."},getBillingState:{method:"GET",path:"/billing/state",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:RFt,401:q},summary:"Resolve the caller's plan, features, seat count, and any admin override."},createBillingCheckout:{method:"POST",path:"/billing/checkout",headers:A.object({authorization:A.string().min(1).optional()}),body:xFt,responses:{200:DFt,400:q,401:q,403:q,503:q},summary:"Start a Stripe Checkout session for Creator ($29/mo) or Team ($19/seat/mo, min 2)."},createBillingPortal:{method:"POST",path:"/billing/portal",headers:A.object({authorization:A.string().min(1).optional()}),body:A.object({subject_type:A.enum(["user","organization"]).default("user")}).optional(),responses:{200:NFt,401:q,404:q,503:q},summary:"Open the Stripe customer portal so the subject can manage their subscription."},updateTeamSeats:{method:"PATCH",path:"/billing/team-seats",headers:A.object({authorization:A.string().min(1).optional()}),body:BFt,responses:{200:Zie,400:q,401:q,403:q,404:q,503:q},summary:"Adjust the caller-organization's Team seat quantity (admin of that org only)."},adminListBilling:{method:"GET",path:"/admin/billing",headers:A.object({authorization:A.string().min(1).optional()}),responses:{200:wFt,401:q,403:q},summary:"List every user and org with current plan + override for the admin panel."},adminSetUserPlanOverride:{method:"PUT",path:"/admin/billing/users/:id/override",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:xGe,responses:{200:Pz,401:q,403:q,404:q},summary:"Admin override for a user's plan tier. Null clears the override."},adminSetOrganizationPlanOverride:{method:"PUT",path:"/admin/billing/organizations/:id/override",pathParams:A.object({id:A.string().min(1)}),headers:A.object({authorization:A.string().min(1).optional()}),body:xGe,responses:{200:Pz,401:q,403:q,404:q},summary:"Admin override for an organization's plan tier. Null clears the override."},projects:pGe,regions:gGe,entities:sGe,docs:nGe,mentions:lGe,favorites:cGe,search:_Ge},{pathPrefix:"/api"})});import{AsyncLocalStorage as g4t}from"node:async_hooks";import ch from"node:fs/promises";import JGe from"node:path";function y4t(e){return JGe.join(e,"tokens-refresh.lock")}async function Bk(e,t,n={}){let r=KGe.getStore();if(r?.has(e))return t();let o=n.waitMs??h4t,i=n.staleMs??_4t,s=n.now??Date.now,u=n.sleep??(v=>new Promise(R=>setTimeout(R,v))),l=y4t(e),f=JGe.join(l,"owner"),h=`${process.pid}:${Date.now()}:${Math.random().toString(36).slice(2)}`,_=s(),y=!1;for(;!y;)try{await ch.mkdir(e,{recursive:!0,mode:448}),await ch.chmod(e,448).catch(()=>{}),await ch.mkdir(l,{mode:448});try{await ch.writeFile(f,h,{mode:384})}catch(v){throw await ch.rm(l,{recursive:!0,force:!0}),v}y=!0}catch(v){if(!S4t(v))throw v;if(await T4t(l,i,s)){await ch.rm(l,{recursive:!0,force:!0});continue}if(s()-_>=o)throw new Error(`Timed out waiting for OAuth token refresh lock at ${l}`);await u(Math.min(E4t,o))}let T=new Set(r??[]);T.add(e);try{return await KGe.run(T,t)}finally{await b4t(l,f,h)}}function ZGe(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function S4t(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}async function T4t(e,t,n){try{let r=await ch.stat(e);return n()-r.mtimeMs>=t}catch(r){if(ZGe(r))return!1;throw r}}async function b4t(e,t,n){try{if(await ch.readFile(t,"utf8")!==n)return}catch(r){if(!ZGe(r))throw r}await ch.rm(e,{recursive:!0,force:!0})}var KGe,h4t,_4t,E4t,X6n,eGn,tGn,nGn,rGn,oGn,Qz,nse=w(()=>{"use strict";m();pc();KGe=new g4t,h4t=3e4,_4t=6e4,E4t=100,X6n=process.env.LORE_PLUGIN_AUTHKIT_CLIENT_ID?.trim()||process.env.PLUGIN_AUTHKIT_CLIENT_ID?.trim()||"client_01KRSDB9SR20N7MB0D9MPS05Q6",eGn=process.env.LORE_CLI_AUTHKIT_CLIENT_ID?.trim()||process.env.CLI_AUTHKIT_CLIENT_ID?.trim()||"client_01KV6K8BBANC2J3998K4DG9840",tGn=A.object({resource:A.string(),endpoints:A.object({audience:A.string(),deviceAuthorizationEndpoint:A.string(),tokenEndpoint:A.string(),authorizationEndpoint:A.string()}),fetchedAt:A.number(),prmEtag:A.string().optional()}),nGn=A.object({resource:A.string().min(1,"`resource` must be a non-empty string"),authorization_servers:A.array(A.string())}),rGn=A.object({issuer:A.string().min(1,"`issuer` must be a non-empty string"),token_endpoint:A.string().min(1,"`token_endpoint` must be a non-empty string"),authorization_endpoint:A.string().optional()}),oGn=A.object({access_token:A.string().min(1),refresh_token:A.string().min(1),expires_in:A.number().int().positive(),token_type:A.string().min(1),scope:A.string().optional()}),Qz=class extends Error{constructor(){super("OAuth refresh token is invalid or expired"),this.name="OAuthInvalidGrantError"}}});import hp from"node:fs";import I4t from"node:path";function rse(e){return I4t.join(e,"tokens.json")}function C4t(e){return`${e}.tmp.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}`}function eje(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function v4t(e,t){let n;try{n=JSON.parse(e)}catch(o){throw new Error(`tokens file at ${t} is not valid JSON: ${o.message}`)}if(typeof n=="object"&&n!==null&&"version"in n){let o=XGe.safeParse(n);if(!o.success)throw new Error(`tokens file at ${t} failed schema validation: ${o.error.message}`);return o.data}let r=Fz.safeParse(n);if(!r.success)throw new Error(`tokens file at ${t} failed schema validation: ${r.error.message}`);return D4t(r.data)}function R4t(e){let t=e.split(".");if(t.length<2||!t[1])return null;try{let n=JSON.parse(Buffer.from(t[1],"base64url").toString("utf8"));if(typeof n!="object"||n===null)return null;let r=n.iss;return typeof r=="string"&&r.length>0?r:null}catch{return null}}function x4t(e){let t=R4t(e.access_token);if(!t)return!1;let n;try{n=new URL(t).host.toLowerCase()}catch{return!1}return n!=="workos.com"&&!n.endsWith(".workos.com")}function D4t(e){let t={};return x4t(e)&&(t.plugin=e),{version:2,clients:t}}function N4t(e){return JSON.stringify(XGe.parse(e))}function ose(e){let t=rse(e),n;try{n=hp.readFileSync(t,"utf8")}catch(r){if(eje(r))return null;throw r}return v4t(n,t)}function tje(e,t){let n=rse(e);hp.mkdirSync(e,{recursive:!0,mode:448}),hp.chmodSync(e,448);let r=C4t(n),o=N4t(t),i;try{i=hp.openSync(r,"w",384),hp.writeSync(i,o),hp.fchmodSync(i,384),hp.fsyncSync(i),hp.closeSync(i),i=void 0,hp.renameSync(r,n)}catch(s){if(i!==void 0)try{hp.closeSync(i)}catch{}try{hp.unlinkSync(r)}catch{}throw s}}function ise(e,t){return ose(e)?.clients[t]??null}function B4t(e){try{return ose(e)??{version:2,clients:{}}}catch{return{version:2,clients:{}}}}function WGe(e){try{hp.rmSync(rse(e))}catch(t){if(!eje(t))throw t}}function nje(e,t,n){let r=B4t(e);r.clients[t]=Fz.parse(n),tje(e,r)}function sse(e,t){let n;try{n=ose(e)}catch{WGe(e);return}if(!(!n||!(t in n.clients))){if(delete n.clients[t],Object.keys(n.clients).length===0){WGe(e);return}tje(e,n)}}var Fz,XGe,ase=w(()=>{"use strict";m();pc();nse();Fz=A.object({access_token:A.string(),refresh_token:A.string(),expires_at:A.number().int(),scope:A.string().default("")}),XGe=A.object({version:A.literal(2),clients:A.record(A.string(),Fz).default({})})});import w4t from"node:fs";import oje from"node:os";import ije from"node:path";function O4t(e=oje.homedir()){return ije.join(e,"Library","Application Support","tanagram","lore","tokens.json")}function use(e){let t=e.split(".");if(t.length<2||!t[1])return null;let n;try{n=JSON.parse(Buffer.from(t[1],"base64url").toString("utf8"))}catch{return null}if(typeof n!="object"||n===null)return null;let r=n.exp;return typeof r=="number"?r*1e3:null}function rje(e){try{w4t.rmSync(e)}catch(t){if(!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT"))throw t}}function Gz(e,t=oje.homedir()){for(let n of k4t)rje(ije.join(e,n));rje(O4t(t))}var k4t,sje=w(()=>{"use strict";m();ase();k4t=["token","refresh_token"]});var jz=w(()=>{"use strict";m();ase();sje();nse()});import zz from"node:os";import Iu from"node:path";function Er(){if(to()==="dev"){let t=process.env.LORE_DEV_STATE_DIR?.trim();if(t)return Iu.resolve(t.replace(/^~(?=$|\/)/,zz.homedir()))}let e=to()==="dev"?".lore-dev":".lore";return Iu.join(zz.homedir(),e)}function _p(){return Iu.join(Er(),"log.txt")}function cse(){return Iu.join(Er(),"upload.log.txt")}function aje(){return Iu.join(Er(),"upload-daemon.lock")}function lse(){return Iu.join(Er(),"skill-sync.log.txt")}function dse(){return Iu.join(Er(),"sync_state.json")}function MT(){return Iu.join(Er(),"upload_filters.json")}function Hz(){return Iu.join(Er(),"upload_dirs.json")}function wk(){return Iu.join(Er(),"status.json")}function Fx(){return Iu.join(Er(),"quarantine")}function LT(){return Iu.join(Er(),"install_source.json")}function UT(){return Iu.join(Er(),"skill_sync_state.json")}function n0(){return Iu.join(Er(),"bin","lore")}function r0(){let e=to();return e==="prod"?"ai.tanagram.lore":`ai.tanagram.lore.${e}`}function Gx(){return`${r0()}.skill-sync`}function jx(){return Iu.join(zz.homedir(),"Library","LaunchAgents",`${r0()}.plist`)}function $z(){return Iu.join(zz.homedir(),"Library","LaunchAgents",`${Gx()}.plist`)}var Mo=w(()=>{"use strict";m();sc()});import cje from"node:fs";function P4t(){let e=Er();uje!==e&&(cje.mkdirSync(e,{recursive:!0}),uje=e)}function M4t(e){let t=typeof e=="string"?e:JSON.stringify(e);return/[\s"=]/.test(t)?JSON.stringify(t):t}function L4t(e,t,n){let r=`${new Date().toISOString()} ${e} ${t}`;if(!n)return`${r}
105
105
  `;let o=Object.entries(n).map(([i,s])=>`${i}=${M4t(s)}`).join(" ");return o?`${r} ${o}
106
106
  `:`${r}
107
- `}function pse(e,t,n){try{let r=L4t(e,t,n);P4t(),cje.appendFileSync(_p(),r),to()==="dev"&&process.stderr.write(r)}catch{}U4t(e,t,n)}function U4t(e,t,n){try{Lw[e](t,Q4t(n))}catch{}}function Q4t(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))if(r!=null){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean"){t[n]=r;continue}try{t[n]=JSON.stringify(r)}catch{t[n]=String(r)}}return t}var uje,$,Bn=w(()=>{"use strict";m();WR();sc();Mo();uje=null;$={info(e,t){pse("info",e,t)},warn(e,t){pse("warn",e,t)},error(e,t){pse("error",e,t)}}});import o0 from"node:fs";import qz from"node:path";function lh(){try{return ise(Er(),Vz)}catch(e){return $.warn("auth_load_tokens_failed",{stateDir:Er(),errorName:e instanceof Error?e.name:void 0,error:e instanceof Error?e.message:String(e)}),null}}function Yz(){try{return ise(Er(),F4t)}catch(e){return $.warn("auth_load_desktop_managed_tokens_failed",{stateDir:Er(),errorName:e instanceof Error?e.name:void 0,error:e instanceof Error?e.message:String(e)}),null}}function fse(){return qz.join(Er(),"analytics_distinct_id")}function lje(){let e;try{e=o0.readFileSync(fse(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return null;throw n}let t=e.trim();return t.length>0?t:null}function dje(e){let t=fse();o0.mkdirSync(qz.dirname(t),{recursive:!0,mode:448}),o0.writeFileSync(t,e,{mode:384})}function pje(){try{o0.rmSync(fse())}catch(e){if(e&&typeof e=="object"&&"code"in e&&e.code==="ENOENT")return;throw e}}function mse(){return qz.join(Er(),"analytics_person_properties.json")}function fje(){let e;try{e=o0.readFileSync(mse(),"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return null;throw t}try{let t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}function mje(e){let t=mse();o0.mkdirSync(qz.dirname(t),{recursive:!0,mode:448}),o0.writeFileSync(t,JSON.stringify(e),{mode:384})}function Aje(){try{o0.rmSync(mse())}catch(e){if(e&&typeof e=="object"&&"code"in e&&e.code==="ENOENT")return;throw e}}function Ase(){let e=process.env.LORE_CLI_ACCESS_TOKEN?.trim()??"";if(e&&!Hx(e,new Date,zx))return{token:e,source:"env"};let t=lh()?.access_token.trim()??"";return!t||Hx(t,new Date,zx)?{token:"",source:"none"}:{token:t,source:"file"}}function gje(){let e=Yz()?.access_token.trim()??"";return!e||Hx(e,new Date,zx)?{token:"",source:"none"}:{token:e,source:"file"}}function hje(){return lh()?.refresh_token.trim()??""}function _je(){return!!lh()?.access_token}function gse(e){let t=Er();nje(t,Vz,e),Gz(t)}function Eje(e){gse(e)}function yje(e){let t=lh();gse({access_token:e,refresh_token:t?.refresh_token??"",expires_at:use(e)??0,scope:t?.scope??""})}function Kz(e,t){let n=lh();gse({access_token:e,refresh_token:t,expires_at:use(e)??0,scope:n?.scope??""})}function dh(){$.warn("auth_delete_access_token",{stateDir:Er()}),sse(Er(),Vz),Gz(Er())}function Sje(){sse(Er(),Vz),Gz(Er())}function j4t(e,t){return new URL(t,e).toString()}async function z4t(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function H4t(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Token refresh failed"}async function Tje({clientId:e,refreshToken:t,workosApiOrigin:n,fetch:r=globalThis.fetch}){let o=await r(j4t(n,"/user_management/authenticate"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:G4t,refresh_token:t,client_id:e})}),i=await z4t(o);if(!o.ok){let s=i,u=H4t(s);throw s.error==="invalid_grant"?new Ok(u):new Error(u)}return i}function kk(e){let t=e.split(".");if(t.length<2)throw new Error("invalid JWT format");return JSON.parse(Buffer.from(t[1],"base64url").toString("utf8"))}function Hx(e,t,n=0){let r;try{r=kk(e)}catch{return!1}return typeof r.exp!="number"?!1:t.getTime()+n>=r.exp*1e3}var Vz,F4t,zx,Ok,G4t,i0=w(()=>{"use strict";m();jz();Bn();Mo();Vz="cli",F4t="desktop",zx=10*1e3;Ok=class extends Error{constructor(t="Refresh token is invalid or expired"){super(t),this.name="RefreshTokenInvalidGrantError"}},G4t="refresh_token"});import{AsyncLocalStorage as $4t}from"node:async_hooks";function Ije(e,t){return bje.run(e,t)}function Cje(){return bje.getStore()}var bje,hse=w(()=>{"use strict";m();bje=new $4t});function ln(e){return e instanceof Error?e.message:String(e)}function kr(e,t){return e!==null&&typeof e=="object"&&"code"in e&&e.code===t}function qx(){return to()==="dev"?"pnpm dev login":"lore login"}function q4t(e){return to()!=="dev"?e:e.replaceAll("'lore login'","'pnpm dev login'").replaceAll("`lore login`","`pnpm dev login`")}function ud(){throw new Ne("")}var Ne,$x,on=w(()=>{"use strict";m();sc();Ne=class extends Error{constructor(t){super(q4t(t)),this.name="CLIError"}};$x=class extends Ne{billingUrl;serverMessage;constructor(t){let n=t.serverMessage.trim(),r=n.replace(/\.+$/,""),o=r?`: ${r}`:"";super(`${t.action} blocked by your billing plan${o}. Manage or upgrade your plan: ${t.billingUrl}`),this.name="BillingBlockedError",this.billingUrl=t.billingUrl,this.serverMessage=n}}});import{setTimeout as V4t}from"node:timers/promises";async function Pk(e,t){let n=t.limit??Y4t,r=t.baseMs??vje,o=t.maxMs??Rje,i=t.sleep??V4t,s=t.logEvent??"fetch_retry";for(let u=0;u<=n;u+=1){let l=u===n;try{return await e()}catch(f){if(!t.isRetryableError(f)||l)throw f;$.warn(s,{attempt:u+1,reason:t.describeRetryReason?.(f)??"retryable_error",...t.logFields})}await i(K4t(u,{baseMs:r,maxMs:o}))}throw new Error("fetchWithRetry: unreachable")}function K4t(e,{baseMs:t=vje,maxMs:n=Rje}={}){let r=Math.min(t*2**e,n),o=Math.floor(r/2);return o+Math.floor(Math.random()*o)}function Vx(e){return e instanceof TypeError?e.message==="fetch failed"||e.message==="terminated":!1}function Mk(e){return xje(e,J4t)}function Lk(e){return xje(e,Z4t)}function xje(e,t){if(!Vx(e))return!1;let n=e.cause;if(!(n instanceof Error))return!1;let r=n.code;return typeof r=="string"&&t.has(r)}function Uk(e){if(!Vx(e))return"unknown";let t=e.cause;if(!(t instanceof Error))return"unknown";let n=t.code;return typeof n=="string"?`${t.name}:${n}`:t.name}function Dje(e){let t=e instanceof Error?e.message:String(e),n=[],r=[],o=e instanceof Error?e.cause:void 0,i=0,s=5;for(;o&&i<s;){if(o instanceof Error){let u=o,l=u.code;l&&r.push(l),n.push(`${u.name}${l?`[${l}]`:""}: ${u.message}`),o=u.cause}else if(typeof o=="string"){n.push(o);break}else{n.push(String(o));break}i+=1}return{message:t,causeChain:n,codes:r}}var Y4t,vje,Rje,J4t,Z4t,Jz=w(()=>{"use strict";m();Bn();Y4t=5,vje=1e3,Rje=16e3;J4t=new Set(["UND_ERR_CONNECT_TIMEOUT","ENOTFOUND","EAI_AGAIN","ECONNREFUSED"]),Z4t=new Set(["ECONNRESET","ETIMEDOUT","EPIPE"])});import{execFileSync as Bje}from"node:child_process";import{createHash as W4t}from"node:crypto";import{resolve as X4t}from"node:path";function t3t(e){if(process.env.LORE_DISABLE_PORTLESS_DISCOVERY!=="1"&&process.env.npm_lifecycle_event!=="test")try{return Bje("portless",["get",e],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim().replace(/\/$/,"")}catch{return}}function Nje(e){return e.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,63)}function n3t(){try{return Bje("git",["rev-parse","--show-toplevel"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return X4t(process.cwd(),"../..")}}function r3t(e){return W4t("sha1").update(e).digest("hex").slice(0,8)}function o3t(){let e=Nje(process.env.LORE_DEV_STACK_NAME??"");if(e)return e;let t=n3t();return[Nje(t.split(/[\\/]/).pop()||"lore"),r3t(t)].filter(Boolean).join("-").slice(0,63)}function i3t(){let e=o3t();return e?`api.${e}.lore`:"api.lore"}function s3t(e){let t=process.env.LORE_TARGET?.trim();return t&&e3t.has(t)?t:e}function cd(e=to(),t=process.env.LORE_API_ORIGIN){let n=t?.trim();if(n)return n.replace(/\/$/,"");let r=s3t(e);return r==="dev"?t3t(i3t())??Xz.dev:Xz[r]}function Cu(){let e=lh(),t=Yz(),n=e?.access_token.trim()??"",r=e?.refresh_token.trim()??"",o=t?.access_token.trim()??"";return{hasTokenRecord:!!e,hasAccessToken:!!n,accessTokenExpiredOrNearExpiry:n?Hx(n,new Date,zx):void 0,hasRefreshToken:!!r,externalTokenManager:kje(),hasDesktopManagedTokenRecord:!!t,hasDesktopManagedAccessToken:!!o,desktopManagedAccessTokenExpiredOrNearExpiry:o?Hx(o,new Date,zx):void 0}}function wje(e){let t=Cje()??Hc();if(!t||t.spanContext().traceFlags!==1)return e;let n=eE({span:t,propagateTraceparent:!0});return!n["sentry-trace"]&&!n.baggage&&!n.traceparent?e:{...e,...!e["sentry-trace"]&&n["sentry-trace"]?{"sentry-trace":n["sentry-trace"]}:{},...!e.baggage&&n.baggage?{baggage:n.baggage}:{},...!e.traceparent&&n.traceparent?{traceparent:n.traceparent}:{}}}async function a3t(){let e=await Oje(`${cd()}/api/cli-auth/config`);if(!e.ok)throw new Error(`CLI auth config failed: HTTP ${e.status}`);return await e.json()}async function u3t(){if(!lh()?.refresh_token.trim())return $.warn("auth_refresh_skipped_no_refresh_token",Cu()),"";Zz?$.info("auth_refresh_join_inflight",Cu()):($.info("auth_refresh_start",Cu()),Zz=Bk(Er(),async()=>{let t=Ase().token;if(t)return $.info("auth_refresh_reused_latest_token",Cu()),t;let n=lh();if(!n?.refresh_token.trim())return $.warn("auth_refresh_skipped_latest_no_refresh_token",Cu()),"";$.info("auth_refresh_cli_auth_config_start",{...Cu(),resource:cd()});let r=await a3t();$.info("auth_refresh_cli_auth_config_success",{...Cu(),tokenEndpoint:new URL("/user_management/authenticate",r.workos_api_origin).toString()});let o=await Tje({clientId:r.workos_client_id,refreshToken:n.refresh_token,workosApiOrigin:r.workos_api_origin,fetch:Oje});return Kz(o.access_token,o.refresh_token??n.refresh_token),$.info("auth_refresh_success",Cu()),o.access_token}).finally(()=>{Zz=void 0}));try{return await Zz}catch(t){return t instanceof Qz||t instanceof Ok?($.warn("auth_refresh_invalid_grant_deleting_tokens",{...Cu(),error:ln(t)}),dh()):$.warn("auth_refresh_failed",{...Cu(),errorName:t instanceof Error?t.name:void 0,error:ln(t)}),""}}function Wz(e){try{let t=kk(e);typeof t.sub=="string"&&GQ({id:t.sub,...typeof t.email=="string"?{email:t.email}:{}})}catch{}}function kje(){let e=process.env.LORE_EXTERNAL_TOKEN_MANAGER;return typeof e=="string"&&c3t.has(e.trim().toLowerCase())}async function sn(){if(kje()){let n=gje().token;if(n)return $.info("auth_get_access_token_valid_desktop_managed_token",Cu()),Wz(n),n;let r=Yz()?.access_token.trim()??"";return $.warn("auth_get_access_token_external_manager_raw_desktop_token",{...Cu(),returnedRawToken:!!r}),r&&Wz(r),r}let e=Ase().token;if(e)return $.info("auth_get_access_token_valid_file_token",Cu()),Wz(e),e;$.warn("auth_get_access_token_no_valid_file_token",Cu());let t=await u3t();return t?($.info("auth_get_access_token_refreshed_token",Cu()),Wz(t)):$.warn("auth_get_access_token_returning_empty",Cu()),t}function Gt(e={}){let t=e.token;return See(Uz,{baseUrl:cd(),baseHeaders:{"User-Agent":BQe(),...t?{authorization:`Bearer ${t}`}:{}},api:async n=>{let r=wje(n.headers);if(t===void 0){let i=await sn();i&&!r.authorization&&(r={...r,authorization:`Bearer ${i}`})}let o=n.method.toUpperCase()==="GET";try{return await Pk(()=>yee({...n,headers:r}),{isRetryableError:o?i=>Mk(i)||Lk(i):Mk,describeRetryReason:i=>`network:${Uk(i)}`,logEvent:"api_request_retry",logFields:{method:n.method,path:n.path}})}catch(i){if(Vx(i)){let s=Dje(i);$.error("api_request_failed",{method:n.method,path:n.path,error:s.message,causeChain:s.causeChain.join(" \u2192 "),codes:s.codes.join(",")})}throw i}}})}var Xz,ljn,e3t,Zz,Oje,c3t,Pr=w(()=>{"use strict";m();Rk();jz();cA();WR();i0();hse();sc();on();Jz();Bn();Mo();Xz={dev:"http://localhost:4000","dev-shared":"https://lore-api.dev.tanagram.ai",prod:"https://lore-api.tanagram.ai"},ljn={dev:`${Xz.dev}/mcp`,"dev-shared":`${Xz["dev-shared"]}/mcp`,prod:"https://mcp.lore.link/mcp"},e3t=new Set(["dev","dev-shared","prod"]);Oje=(async(e,t)=>{let n=wje(Object.fromEntries(new Headers(t?.headers).entries()));return fetch(e,{...t,headers:n})});c3t=new Set(["1","true","yes","on"])});function Fje(e){return typeof e!="string"?!1:E3t.has(e.trim().toLowerCase())}function vu(e={}){let t=e.stdout??process.stdout,n=e.stdin??process.stdin,r=e.env??process.env;return!((e.rawArgs??process.argv.slice(2)).includes(Gje)||Fje(r.LORE_NO_TUI)||Fje(r.CI)||r.TERM==="dumb"||!t?.isTTY||!n?.isTTY)}function jje(e){return e.filter(t=>t!==Gje)}var Gje,E3t,s0=w(()=>{"use strict";m();Gje="--no-tui",E3t=new Set(["1","true","yes","on"])});var Xje=M(Sn=>{"use strict";m();var Cse=Symbol.for("react.transitional.element"),y3t=Symbol.for("react.portal"),S3t=Symbol.for("react.fragment"),T3t=Symbol.for("react.strict_mode"),b3t=Symbol.for("react.profiler"),I3t=Symbol.for("react.consumer"),C3t=Symbol.for("react.context"),v3t=Symbol.for("react.forward_ref"),R3t=Symbol.for("react.suspense"),x3t=Symbol.for("react.memo"),Vje=Symbol.for("react.lazy"),D3t=Symbol.for("react.activity"),zje=Symbol.iterator;function N3t(e){return e===null||typeof e!="object"?null:(e=zje&&e[zje]||e["@@iterator"],typeof e=="function"?e:null)}var Yje={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Kje=Object.assign,Jje={};function Kx(e,t,n){this.props=e,this.context=t,this.refs=Jje,this.updater=n||Yje}Kx.prototype.isReactComponent={};Kx.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Kx.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zje(){}Zje.prototype=Kx.prototype;function vse(e,t,n){this.props=e,this.context=t,this.refs=Jje,this.updater=n||Yje}var Rse=vse.prototype=new Zje;Rse.constructor=vse;Kje(Rse,Kx.prototype);Rse.isPureReactComponent=!0;var Hje=Array.isArray;function Ise(){}var vo={H:null,A:null,T:null,S:null},Wje=Object.prototype.hasOwnProperty;function xse(e,t,n){var r=n.ref;return{$$typeof:Cse,type:e,key:t,ref:r!==void 0?r:null,props:n}}function B3t(e,t){return xse(e.type,t,e.props)}function Dse(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cse}function w3t(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $je=/\/+/g;function bse(e,t){return typeof e=="object"&&e!==null&&e.key!=null?w3t(""+e.key):t.toString(36)}function O3t(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ise,Ise):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Yx(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Cse:case y3t:s=!0;break;case Vje:return s=e._init,Yx(s(e._payload),t,n,r,o)}}if(s)return o=o(e),s=r===""?"."+bse(e,0):r,Hje(o)?(n="",s!=null&&(n=s.replace($je,"$&/")+"/"),Yx(o,t,n,"",function(f){return f})):o!=null&&(Dse(o)&&(o=B3t(o,n+(o.key==null||e&&e.key===o.key?"":(""+o.key).replace($je,"$&/")+"/")+s)),t.push(o)),1;s=0;var u=r===""?".":r+":";if(Hje(e))for(var l=0;l<e.length;l++)r=e[l],i=u+bse(r,l),s+=Yx(r,t,n,i,o);else if(l=N3t(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,i=u+bse(r,l++),s+=Yx(r,t,n,i,o);else if(i==="object"){if(typeof e.then=="function")return Yx(O3t(e),t,n,r,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function eH(e,t,n){if(e==null)return e;var r=[],o=0;return Yx(e,r,"","",function(i){return t.call(n,i,o++)}),r}function k3t(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qje=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},P3t={map:eH,forEach:function(e,t,n){eH(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return eH(e,function(){t++}),t},toArray:function(e){return eH(e,function(t){return t})||[]},only:function(e){if(!Dse(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Sn.Activity=D3t;Sn.Children=P3t;Sn.Component=Kx;Sn.Fragment=S3t;Sn.Profiler=b3t;Sn.PureComponent=vse;Sn.StrictMode=T3t;Sn.Suspense=R3t;Sn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=vo;Sn.__COMPILER_RUNTIME={__proto__:null,c:function(e){return vo.H.useMemoCache(e)}};Sn.cache=function(e){return function(){return e.apply(null,arguments)}};Sn.cacheSignal=function(){return null};Sn.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Kje({},e.props),o=e.key;if(t!=null)for(i in t.key!==void 0&&(o=""+t.key),t)!Wje.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var s=Array(i),u=0;u<i;u++)s[u]=arguments[u+2];r.children=s}return xse(e.type,o,r)};Sn.createContext=function(e){return e={$$typeof:C3t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:I3t,_context:e},e};Sn.createElement=function(e,t,n){var r,o={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)Wje.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1<s){for(var u=Array(s),l=0;l<s;l++)u[l]=arguments[l+2];o.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return xse(e,i,o)};Sn.createRef=function(){return{current:null}};Sn.forwardRef=function(e){return{$$typeof:v3t,render:e}};Sn.isValidElement=Dse;Sn.lazy=function(e){return{$$typeof:Vje,_payload:{_status:-1,_result:e},_init:k3t}};Sn.memo=function(e,t){return{$$typeof:x3t,type:e,compare:t===void 0?null:t}};Sn.startTransition=function(e){var t=vo.T,n={};vo.T=n;try{var r=e(),o=vo.S;o!==null&&o(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Ise,qje)}catch(i){qje(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),vo.T=t}};Sn.unstable_useCacheRefresh=function(){return vo.H.useCacheRefresh()};Sn.use=function(e){return vo.H.use(e)};Sn.useActionState=function(e,t,n){return vo.H.useActionState(e,t,n)};Sn.useCallback=function(e,t){return vo.H.useCallback(e,t)};Sn.useContext=function(e){return vo.H.useContext(e)};Sn.useDebugValue=function(){};Sn.useDeferredValue=function(e,t){return vo.H.useDeferredValue(e,t)};Sn.useEffect=function(e,t){return vo.H.useEffect(e,t)};Sn.useEffectEvent=function(e){return vo.H.useEffectEvent(e)};Sn.useId=function(){return vo.H.useId()};Sn.useImperativeHandle=function(e,t,n){return vo.H.useImperativeHandle(e,t,n)};Sn.useInsertionEffect=function(e,t){return vo.H.useInsertionEffect(e,t)};Sn.useLayoutEffect=function(e,t){return vo.H.useLayoutEffect(e,t)};Sn.useMemo=function(e,t){return vo.H.useMemo(e,t)};Sn.useOptimistic=function(e,t){return vo.H.useOptimistic(e,t)};Sn.useReducer=function(e,t,n){return vo.H.useReducer(e,t,n)};Sn.useRef=function(e){return vo.H.useRef(e)};Sn.useState=function(e){return vo.H.useState(e)};Sn.useSyncExternalStore=function(e,t,n){return vo.H.useSyncExternalStore(e,t,n)};Sn.useTransition=function(){return vo.H.useTransition()};Sn.version="19.2.4"});var eze=M((mn,tH)=>{"use strict";m();process.env.NODE_ENV!=="production"&&(function(){function e(L,ne){Object.defineProperty(r.prototype,L,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",ne[0],ne[1])}})}function t(L){return L===null||typeof L!="object"?null:(L=Mn&&L[Mn]||L["@@iterator"],typeof L=="function"?L:null)}function n(L,ne){L=(L=L.constructor)&&(L.displayName||L.name)||"ReactClass";var ve=L+"."+ne;ft[ve]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",ne,L),ft[ve]=!0)}function r(L,ne,ve){this.props=L,this.context=ne,this.refs=Rt,this.updater=ve||tn}function o(){}function i(L,ne,ve){this.props=L,this.context=ne,this.refs=Rt,this.updater=ve||tn}function s(){}function u(L){return""+L}function l(L){try{u(L);var ne=!1}catch{ne=!0}if(ne){ne=console;var ve=ne.error,$e=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return ve.call(ne,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$e),u(L)}}function f(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===ai?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case Lt:return"Fragment";case be:return"Profiler";case Gr:return"StrictMode";case yr:return"Suspense";case Us:return"SuspenseList";case zt:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case ut:return"Portal";case en:return L.displayName||"Context";case mt:return(L._context.displayName||"Context")+".Consumer";case Tn:var ne=L.render;return L=L.displayName,L||(L=ne.displayName||ne.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case Vn:return ne=L.displayName||null,ne!==null?ne:f(L.type)||"Memo";case ar:ne=L._payload,L=L._init;try{return f(L(ne))}catch{}}return null}function h(L){if(L===Lt)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===ar)return"<...>";try{var ne=f(L);return ne?"<"+ne+">":"<...>"}catch{return"<...>"}}function _(){var L=vt.A;return L===null?null:L.getOwner()}function y(){return Error("react-stack-top-frame")}function T(L){if($i.call(L,"key")){var ne=Object.getOwnPropertyDescriptor(L,"key").get;if(ne&&ne.isReactWarning)return!1}return L.key!==void 0}function v(L,ne){function ve(){xo||(xo=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ne))}ve.isReactWarning=!0,Object.defineProperty(L,"key",{get:ve,configurable:!0})}function R(){var L=f(this.type);return Nu[L]||(Nu[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function x(L,ne,ve,$e,et,Ht){var xt=ve.ref;return L={$$typeof:ot,type:L,key:ne,props:ve,_owner:$e},(xt!==void 0?xt:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:R}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:et}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ht}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function O(L,ne){return ne=x(L.type,ne,L.props,L._owner,L._debugStack,L._debugTask),L._store&&(ne._store.validated=L._store.validated),ne}function P(L){j(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===ar&&(L._payload.status==="fulfilled"?j(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function j(L){return typeof L=="object"&&L!==null&&L.$$typeof===ot}function G(L){var ne={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ve){return ne[ve]})}function H(L,ne){return typeof L=="object"&&L!==null&&L.key!=null?(l(L.key),G(""+L.key)):ne.toString(36)}function V(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(s,s):(L.status="pending",L.then(function(ne){L.status==="pending"&&(L.status="fulfilled",L.value=ne)},function(ne){L.status==="pending"&&(L.status="rejected",L.reason=ne)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function ae(L,ne,ve,$e,et){var Ht=typeof L;(Ht==="undefined"||Ht==="boolean")&&(L=null);var xt=!1;if(L===null)xt=!0;else switch(Ht){case"bigint":case"string":case"number":xt=!0;break;case"object":switch(L.$$typeof){case ot:case ut:xt=!0;break;case ar:return xt=L._init,ae(xt(L._payload),ne,ve,$e,et)}}if(xt){xt=L,et=et(xt);var Fn=$e===""?"."+H(xt,0):$e;return oo(et)?(ve="",Fn!=null&&(ve=Fn.replace(Ad,"$&/")+"/"),ae(et,ne,ve,"",function(ui){return ui})):et!=null&&(j(et)&&(et.key!=null&&(xt&&xt.key===et.key||l(et.key)),ve=O(et,ve+(et.key==null||xt&&xt.key===et.key?"":(""+et.key).replace(Ad,"$&/")+"/")+Fn),$e!==""&&xt!=null&&j(xt)&&xt.key==null&&xt._store&&!xt._store.validated&&(ve._store.validated=2),et=ve),ne.push(et)),1}if(xt=0,Fn=$e===""?".":$e+":",oo(L))for(var pn=0;pn<L.length;pn++)$e=L[pn],Ht=Fn+H($e,pn),xt+=ae($e,ne,ve,Ht,et);else if(pn=t(L),typeof pn=="function")for(pn===L.entries&&(Bu||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Bu=!0),L=pn.call(L),pn=0;!($e=L.next()).done;)$e=$e.value,Ht=Fn+H($e,pn++),xt+=ae($e,ne,ve,Ht,et);else if(Ht==="object"){if(typeof L.then=="function")return ae(V(L),ne,ve,$e,et);throw ne=String(L),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return xt}function re(L,ne,ve){if(L==null)return L;var $e=[],et=0;return ae(L,$e,"","",function(Ht){return ne.call(ve,Ht,et++)}),$e}function _e(L){if(L._status===-1){var ne=L._ioInfo;ne!=null&&(ne.start=ne.end=performance.now()),ne=L._result;var ve=ne();if(ve.then(function(et){if(L._status===0||L._status===-1){L._status=1,L._result=et;var Ht=L._ioInfo;Ht!=null&&(Ht.end=performance.now()),ve.status===void 0&&(ve.status="fulfilled",ve.value=et)}},function(et){if(L._status===0||L._status===-1){L._status=2,L._result=et;var Ht=L._ioInfo;Ht!=null&&(Ht.end=performance.now()),ve.status===void 0&&(ve.status="rejected",ve.reason=et)}}),ne=L._ioInfo,ne!=null){ne.value=ve;var $e=ve.displayName;typeof $e=="string"&&(ne.name=$e)}L._status===-1&&(L._status=0,L._result=ve)}if(L._status===1)return ne=L._result,ne===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
107
+ `}function pse(e,t,n){try{let r=L4t(e,t,n);P4t(),cje.appendFileSync(_p(),r),to()==="dev"&&process.stderr.write(r)}catch{}U4t(e,t,n)}function U4t(e,t,n){try{Lw[e](t,Q4t(n))}catch{}}function Q4t(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))if(r!=null){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean"){t[n]=r;continue}try{t[n]=JSON.stringify(r)}catch{t[n]=String(r)}}return t}var uje,$,Bn=w(()=>{"use strict";m();WR();sc();Mo();uje=null;$={info(e,t){pse("info",e,t)},warn(e,t){pse("warn",e,t)},error(e,t){pse("error",e,t)}}});import o0 from"node:fs";import qz from"node:path";function lh(){try{return ise(Er(),Vz)}catch(e){return $.warn("auth_load_tokens_failed",{stateDir:Er(),errorName:e instanceof Error?e.name:void 0,error:e instanceof Error?e.message:String(e)}),null}}function Yz(){try{return ise(Er(),F4t)}catch(e){return $.warn("auth_load_desktop_managed_tokens_failed",{stateDir:Er(),errorName:e instanceof Error?e.name:void 0,error:e instanceof Error?e.message:String(e)}),null}}function fse(){return qz.join(Er(),"analytics_distinct_id")}function lje(){let e;try{e=o0.readFileSync(fse(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return null;throw n}let t=e.trim();return t.length>0?t:null}function dje(e){let t=fse();o0.mkdirSync(qz.dirname(t),{recursive:!0,mode:448}),o0.writeFileSync(t,e,{mode:384})}function pje(){try{o0.rmSync(fse())}catch(e){if(e&&typeof e=="object"&&"code"in e&&e.code==="ENOENT")return;throw e}}function mse(){return qz.join(Er(),"analytics_person_properties.json")}function fje(){let e;try{e=o0.readFileSync(mse(),"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return null;throw t}try{let t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}function mje(e){let t=mse();o0.mkdirSync(qz.dirname(t),{recursive:!0,mode:448}),o0.writeFileSync(t,JSON.stringify(e),{mode:384})}function Aje(){try{o0.rmSync(mse())}catch(e){if(e&&typeof e=="object"&&"code"in e&&e.code==="ENOENT")return;throw e}}function Ase(){let e=process.env.LORE_CLI_ACCESS_TOKEN?.trim()??"";if(e&&!Hx(e,new Date,zx))return{token:e,source:"env"};let t=lh()?.access_token.trim()??"";return!t||Hx(t,new Date,zx)?{token:"",source:"none"}:{token:t,source:"file"}}function gje(){let e=Yz()?.access_token.trim()??"";return!e||Hx(e,new Date,zx)?{token:"",source:"none"}:{token:e,source:"file"}}function hje(){return lh()?.refresh_token.trim()??""}function _je(){return!!lh()?.access_token}function gse(e){let t=Er();nje(t,Vz,e),Gz(t)}function Eje(e){gse(e)}function yje(e){let t=lh();gse({access_token:e,refresh_token:t?.refresh_token??"",expires_at:use(e)??0,scope:t?.scope??""})}function Kz(e,t){let n=lh();gse({access_token:e,refresh_token:t,expires_at:use(e)??0,scope:n?.scope??""})}function dh(){$.warn("auth_delete_access_token",{stateDir:Er()}),sse(Er(),Vz),Gz(Er())}function Sje(){sse(Er(),Vz),Gz(Er())}function j4t(e,t){return new URL(t,e).toString()}async function z4t(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function H4t(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Token refresh failed"}async function Tje({clientId:e,refreshToken:t,workosApiOrigin:n,fetch:r=globalThis.fetch}){let o=await r(j4t(n,"/user_management/authenticate"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:G4t,refresh_token:t,client_id:e})}),i=await z4t(o);if(!o.ok){let s=i,u=H4t(s);throw s.error==="invalid_grant"?new Ok(u):new Error(u)}return i}function kk(e){let t=e.split(".");if(t.length<2)throw new Error("invalid JWT format");return JSON.parse(Buffer.from(t[1],"base64url").toString("utf8"))}function Hx(e,t,n=0){let r;try{r=kk(e)}catch{return!1}return typeof r.exp!="number"?!1:t.getTime()+n>=r.exp*1e3}var Vz,F4t,zx,Ok,G4t,i0=w(()=>{"use strict";m();jz();Bn();Mo();Vz="cli",F4t="desktop",zx=10*1e3;Ok=class extends Error{constructor(t="Refresh token is invalid or expired"){super(t),this.name="RefreshTokenInvalidGrantError"}},G4t="refresh_token"});import{AsyncLocalStorage as $4t}from"node:async_hooks";function Ije(e,t){return bje.run(e,t)}function Cje(){return bje.getStore()}var bje,hse=w(()=>{"use strict";m();bje=new $4t});function ln(e){return e instanceof Error?e.message:String(e)}function kr(e,t){return e!==null&&typeof e=="object"&&"code"in e&&e.code===t}function qx(){return to()==="dev"?"pnpm dev login":"lore login"}function q4t(e){return to()!=="dev"?e:e.replaceAll("'lore login'","'pnpm dev login'").replaceAll("`lore login`","`pnpm dev login`")}function ud(){throw new De("")}var De,$x,on=w(()=>{"use strict";m();sc();De=class extends Error{constructor(t){super(q4t(t)),this.name="CLIError"}};$x=class extends De{billingUrl;serverMessage;constructor(t){let n=t.serverMessage.trim(),r=n.replace(/\.+$/,""),o=r?`: ${r}`:"";super(`${t.action} blocked by your billing plan${o}. Manage or upgrade your plan: ${t.billingUrl}`),this.name="BillingBlockedError",this.billingUrl=t.billingUrl,this.serverMessage=n}}});import{setTimeout as V4t}from"node:timers/promises";async function Pk(e,t){let n=t.limit??Y4t,r=t.baseMs??vje,o=t.maxMs??Rje,i=t.sleep??V4t,s=t.logEvent??"fetch_retry";for(let u=0;u<=n;u+=1){let l=u===n;try{return await e()}catch(f){if(!t.isRetryableError(f)||l)throw f;$.warn(s,{attempt:u+1,reason:t.describeRetryReason?.(f)??"retryable_error",...t.logFields})}await i(K4t(u,{baseMs:r,maxMs:o}))}throw new Error("fetchWithRetry: unreachable")}function K4t(e,{baseMs:t=vje,maxMs:n=Rje}={}){let r=Math.min(t*2**e,n),o=Math.floor(r/2);return o+Math.floor(Math.random()*o)}function Vx(e){return e instanceof TypeError?e.message==="fetch failed"||e.message==="terminated":!1}function Mk(e){return xje(e,J4t)}function Lk(e){return xje(e,Z4t)}function xje(e,t){if(!Vx(e))return!1;let n=e.cause;if(!(n instanceof Error))return!1;let r=n.code;return typeof r=="string"&&t.has(r)}function Uk(e){if(!Vx(e))return"unknown";let t=e.cause;if(!(t instanceof Error))return"unknown";let n=t.code;return typeof n=="string"?`${t.name}:${n}`:t.name}function Dje(e){let t=e instanceof Error?e.message:String(e),n=[],r=[],o=e instanceof Error?e.cause:void 0,i=0,s=5;for(;o&&i<s;){if(o instanceof Error){let u=o,l=u.code;l&&r.push(l),n.push(`${u.name}${l?`[${l}]`:""}: ${u.message}`),o=u.cause}else if(typeof o=="string"){n.push(o);break}else{n.push(String(o));break}i+=1}return{message:t,causeChain:n,codes:r}}var Y4t,vje,Rje,J4t,Z4t,Jz=w(()=>{"use strict";m();Bn();Y4t=5,vje=1e3,Rje=16e3;J4t=new Set(["UND_ERR_CONNECT_TIMEOUT","ENOTFOUND","EAI_AGAIN","ECONNREFUSED"]),Z4t=new Set(["ECONNRESET","ETIMEDOUT","EPIPE"])});import{execFileSync as Bje}from"node:child_process";import{createHash as W4t}from"node:crypto";import{resolve as X4t}from"node:path";function t3t(e){if(process.env.LORE_DISABLE_PORTLESS_DISCOVERY!=="1"&&process.env.npm_lifecycle_event!=="test")try{return Bje("portless",["get",e],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim().replace(/\/$/,"")}catch{return}}function Nje(e){return e.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,63)}function n3t(){try{return Bje("git",["rev-parse","--show-toplevel"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return X4t(process.cwd(),"../..")}}function r3t(e){return W4t("sha1").update(e).digest("hex").slice(0,8)}function o3t(){let e=Nje(process.env.LORE_DEV_STACK_NAME??"");if(e)return e;let t=n3t();return[Nje(t.split(/[\\/]/).pop()||"lore"),r3t(t)].filter(Boolean).join("-").slice(0,63)}function i3t(){let e=o3t();return e?`api.${e}.lore`:"api.lore"}function s3t(e){let t=process.env.LORE_TARGET?.trim();return t&&e3t.has(t)?t:e}function cd(e=to(),t=process.env.LORE_API_ORIGIN){let n=t?.trim();if(n)return n.replace(/\/$/,"");let r=s3t(e);return r==="dev"?t3t(i3t())??Xz.dev:Xz[r]}function Cu(){let e=lh(),t=Yz(),n=e?.access_token.trim()??"",r=e?.refresh_token.trim()??"",o=t?.access_token.trim()??"";return{hasTokenRecord:!!e,hasAccessToken:!!n,accessTokenExpiredOrNearExpiry:n?Hx(n,new Date,zx):void 0,hasRefreshToken:!!r,externalTokenManager:kje(),hasDesktopManagedTokenRecord:!!t,hasDesktopManagedAccessToken:!!o,desktopManagedAccessTokenExpiredOrNearExpiry:o?Hx(o,new Date,zx):void 0}}function wje(e){let t=Cje()??Hc();if(!t||t.spanContext().traceFlags!==1)return e;let n=eE({span:t,propagateTraceparent:!0});return!n["sentry-trace"]&&!n.baggage&&!n.traceparent?e:{...e,...!e["sentry-trace"]&&n["sentry-trace"]?{"sentry-trace":n["sentry-trace"]}:{},...!e.baggage&&n.baggage?{baggage:n.baggage}:{},...!e.traceparent&&n.traceparent?{traceparent:n.traceparent}:{}}}async function a3t(){let e=await Oje(`${cd()}/api/cli-auth/config`);if(!e.ok)throw new Error(`CLI auth config failed: HTTP ${e.status}`);return await e.json()}async function u3t(){if(!lh()?.refresh_token.trim())return $.warn("auth_refresh_skipped_no_refresh_token",Cu()),"";Zz?$.info("auth_refresh_join_inflight",Cu()):($.info("auth_refresh_start",Cu()),Zz=Bk(Er(),async()=>{let t=Ase().token;if(t)return $.info("auth_refresh_reused_latest_token",Cu()),t;let n=lh();if(!n?.refresh_token.trim())return $.warn("auth_refresh_skipped_latest_no_refresh_token",Cu()),"";$.info("auth_refresh_cli_auth_config_start",{...Cu(),resource:cd()});let r=await a3t();$.info("auth_refresh_cli_auth_config_success",{...Cu(),tokenEndpoint:new URL("/user_management/authenticate",r.workos_api_origin).toString()});let o=await Tje({clientId:r.workos_client_id,refreshToken:n.refresh_token,workosApiOrigin:r.workos_api_origin,fetch:Oje});return Kz(o.access_token,o.refresh_token??n.refresh_token),$.info("auth_refresh_success",Cu()),o.access_token}).finally(()=>{Zz=void 0}));try{return await Zz}catch(t){return t instanceof Qz||t instanceof Ok?($.warn("auth_refresh_invalid_grant_deleting_tokens",{...Cu(),error:ln(t)}),dh()):$.warn("auth_refresh_failed",{...Cu(),errorName:t instanceof Error?t.name:void 0,error:ln(t)}),""}}function Wz(e){try{let t=kk(e);typeof t.sub=="string"&&GQ({id:t.sub,...typeof t.email=="string"?{email:t.email}:{}})}catch{}}function kje(){let e=process.env.LORE_EXTERNAL_TOKEN_MANAGER;return typeof e=="string"&&c3t.has(e.trim().toLowerCase())}async function sn(){if(kje()){let n=gje().token;if(n)return $.info("auth_get_access_token_valid_desktop_managed_token",Cu()),Wz(n),n;let r=Yz()?.access_token.trim()??"";return $.warn("auth_get_access_token_external_manager_raw_desktop_token",{...Cu(),returnedRawToken:!!r}),r&&Wz(r),r}let e=Ase().token;if(e)return $.info("auth_get_access_token_valid_file_token",Cu()),Wz(e),e;$.warn("auth_get_access_token_no_valid_file_token",Cu());let t=await u3t();return t?($.info("auth_get_access_token_refreshed_token",Cu()),Wz(t)):$.warn("auth_get_access_token_returning_empty",Cu()),t}function Gt(e={}){let t=e.token;return See(Uz,{baseUrl:cd(),baseHeaders:{"User-Agent":BQe(),...t?{authorization:`Bearer ${t}`}:{}},api:async n=>{let r=wje(n.headers);if(t===void 0){let i=await sn();i&&!r.authorization&&(r={...r,authorization:`Bearer ${i}`})}let o=n.method.toUpperCase()==="GET";try{return await Pk(()=>yee({...n,headers:r}),{isRetryableError:o?i=>Mk(i)||Lk(i):Mk,describeRetryReason:i=>`network:${Uk(i)}`,logEvent:"api_request_retry",logFields:{method:n.method,path:n.path}})}catch(i){if(Vx(i)){let s=Dje(i);$.error("api_request_failed",{method:n.method,path:n.path,error:s.message,causeChain:s.causeChain.join(" \u2192 "),codes:s.codes.join(",")})}throw i}}})}var Xz,ljn,e3t,Zz,Oje,c3t,Pr=w(()=>{"use strict";m();Rk();jz();cA();WR();i0();hse();sc();on();Jz();Bn();Mo();Xz={dev:"http://localhost:4000","dev-shared":"https://lore-api.dev.tanagram.ai",prod:"https://lore-api.tanagram.ai"},ljn={dev:`${Xz.dev}/mcp`,"dev-shared":`${Xz["dev-shared"]}/mcp`,prod:"https://mcp.lore.link/mcp"},e3t=new Set(["dev","dev-shared","prod"]);Oje=(async(e,t)=>{let n=wje(Object.fromEntries(new Headers(t?.headers).entries()));return fetch(e,{...t,headers:n})});c3t=new Set(["1","true","yes","on"])});function Fje(e){return typeof e!="string"?!1:E3t.has(e.trim().toLowerCase())}function vu(e={}){let t=e.stdout??process.stdout,n=e.stdin??process.stdin,r=e.env??process.env;return!((e.rawArgs??process.argv.slice(2)).includes(Gje)||Fje(r.LORE_NO_TUI)||Fje(r.CI)||r.TERM==="dumb"||!t?.isTTY||!n?.isTTY)}function jje(e){return e.filter(t=>t!==Gje)}var Gje,E3t,s0=w(()=>{"use strict";m();Gje="--no-tui",E3t=new Set(["1","true","yes","on"])});var Xje=M(Sn=>{"use strict";m();var Cse=Symbol.for("react.transitional.element"),y3t=Symbol.for("react.portal"),S3t=Symbol.for("react.fragment"),T3t=Symbol.for("react.strict_mode"),b3t=Symbol.for("react.profiler"),I3t=Symbol.for("react.consumer"),C3t=Symbol.for("react.context"),v3t=Symbol.for("react.forward_ref"),R3t=Symbol.for("react.suspense"),x3t=Symbol.for("react.memo"),Vje=Symbol.for("react.lazy"),D3t=Symbol.for("react.activity"),zje=Symbol.iterator;function N3t(e){return e===null||typeof e!="object"?null:(e=zje&&e[zje]||e["@@iterator"],typeof e=="function"?e:null)}var Yje={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Kje=Object.assign,Jje={};function Kx(e,t,n){this.props=e,this.context=t,this.refs=Jje,this.updater=n||Yje}Kx.prototype.isReactComponent={};Kx.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Kx.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zje(){}Zje.prototype=Kx.prototype;function vse(e,t,n){this.props=e,this.context=t,this.refs=Jje,this.updater=n||Yje}var Rse=vse.prototype=new Zje;Rse.constructor=vse;Kje(Rse,Kx.prototype);Rse.isPureReactComponent=!0;var Hje=Array.isArray;function Ise(){}var vo={H:null,A:null,T:null,S:null},Wje=Object.prototype.hasOwnProperty;function xse(e,t,n){var r=n.ref;return{$$typeof:Cse,type:e,key:t,ref:r!==void 0?r:null,props:n}}function B3t(e,t){return xse(e.type,t,e.props)}function Dse(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cse}function w3t(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $je=/\/+/g;function bse(e,t){return typeof e=="object"&&e!==null&&e.key!=null?w3t(""+e.key):t.toString(36)}function O3t(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ise,Ise):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Yx(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Cse:case y3t:s=!0;break;case Vje:return s=e._init,Yx(s(e._payload),t,n,r,o)}}if(s)return o=o(e),s=r===""?"."+bse(e,0):r,Hje(o)?(n="",s!=null&&(n=s.replace($je,"$&/")+"/"),Yx(o,t,n,"",function(f){return f})):o!=null&&(Dse(o)&&(o=B3t(o,n+(o.key==null||e&&e.key===o.key?"":(""+o.key).replace($je,"$&/")+"/")+s)),t.push(o)),1;s=0;var u=r===""?".":r+":";if(Hje(e))for(var l=0;l<e.length;l++)r=e[l],i=u+bse(r,l),s+=Yx(r,t,n,i,o);else if(l=N3t(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,i=u+bse(r,l++),s+=Yx(r,t,n,i,o);else if(i==="object"){if(typeof e.then=="function")return Yx(O3t(e),t,n,r,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function eH(e,t,n){if(e==null)return e;var r=[],o=0;return Yx(e,r,"","",function(i){return t.call(n,i,o++)}),r}function k3t(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qje=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},P3t={map:eH,forEach:function(e,t,n){eH(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return eH(e,function(){t++}),t},toArray:function(e){return eH(e,function(t){return t})||[]},only:function(e){if(!Dse(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Sn.Activity=D3t;Sn.Children=P3t;Sn.Component=Kx;Sn.Fragment=S3t;Sn.Profiler=b3t;Sn.PureComponent=vse;Sn.StrictMode=T3t;Sn.Suspense=R3t;Sn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=vo;Sn.__COMPILER_RUNTIME={__proto__:null,c:function(e){return vo.H.useMemoCache(e)}};Sn.cache=function(e){return function(){return e.apply(null,arguments)}};Sn.cacheSignal=function(){return null};Sn.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Kje({},e.props),o=e.key;if(t!=null)for(i in t.key!==void 0&&(o=""+t.key),t)!Wje.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var s=Array(i),u=0;u<i;u++)s[u]=arguments[u+2];r.children=s}return xse(e.type,o,r)};Sn.createContext=function(e){return e={$$typeof:C3t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:I3t,_context:e},e};Sn.createElement=function(e,t,n){var r,o={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)Wje.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1<s){for(var u=Array(s),l=0;l<s;l++)u[l]=arguments[l+2];o.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return xse(e,i,o)};Sn.createRef=function(){return{current:null}};Sn.forwardRef=function(e){return{$$typeof:v3t,render:e}};Sn.isValidElement=Dse;Sn.lazy=function(e){return{$$typeof:Vje,_payload:{_status:-1,_result:e},_init:k3t}};Sn.memo=function(e,t){return{$$typeof:x3t,type:e,compare:t===void 0?null:t}};Sn.startTransition=function(e){var t=vo.T,n={};vo.T=n;try{var r=e(),o=vo.S;o!==null&&o(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Ise,qje)}catch(i){qje(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),vo.T=t}};Sn.unstable_useCacheRefresh=function(){return vo.H.useCacheRefresh()};Sn.use=function(e){return vo.H.use(e)};Sn.useActionState=function(e,t,n){return vo.H.useActionState(e,t,n)};Sn.useCallback=function(e,t){return vo.H.useCallback(e,t)};Sn.useContext=function(e){return vo.H.useContext(e)};Sn.useDebugValue=function(){};Sn.useDeferredValue=function(e,t){return vo.H.useDeferredValue(e,t)};Sn.useEffect=function(e,t){return vo.H.useEffect(e,t)};Sn.useEffectEvent=function(e){return vo.H.useEffectEvent(e)};Sn.useId=function(){return vo.H.useId()};Sn.useImperativeHandle=function(e,t,n){return vo.H.useImperativeHandle(e,t,n)};Sn.useInsertionEffect=function(e,t){return vo.H.useInsertionEffect(e,t)};Sn.useLayoutEffect=function(e,t){return vo.H.useLayoutEffect(e,t)};Sn.useMemo=function(e,t){return vo.H.useMemo(e,t)};Sn.useOptimistic=function(e,t){return vo.H.useOptimistic(e,t)};Sn.useReducer=function(e,t,n){return vo.H.useReducer(e,t,n)};Sn.useRef=function(e){return vo.H.useRef(e)};Sn.useState=function(e){return vo.H.useState(e)};Sn.useSyncExternalStore=function(e,t,n){return vo.H.useSyncExternalStore(e,t,n)};Sn.useTransition=function(){return vo.H.useTransition()};Sn.version="19.2.4"});var eze=M((mn,tH)=>{"use strict";m();process.env.NODE_ENV!=="production"&&(function(){function e(L,ne){Object.defineProperty(r.prototype,L,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",ne[0],ne[1])}})}function t(L){return L===null||typeof L!="object"?null:(L=Mn&&L[Mn]||L["@@iterator"],typeof L=="function"?L:null)}function n(L,ne){L=(L=L.constructor)&&(L.displayName||L.name)||"ReactClass";var ve=L+"."+ne;ft[ve]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",ne,L),ft[ve]=!0)}function r(L,ne,ve){this.props=L,this.context=ne,this.refs=Rt,this.updater=ve||tn}function o(){}function i(L,ne,ve){this.props=L,this.context=ne,this.refs=Rt,this.updater=ve||tn}function s(){}function u(L){return""+L}function l(L){try{u(L);var ne=!1}catch{ne=!0}if(ne){ne=console;var ve=ne.error,$e=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return ve.call(ne,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$e),u(L)}}function f(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===ai?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case Lt:return"Fragment";case be:return"Profiler";case Gr:return"StrictMode";case yr:return"Suspense";case Us:return"SuspenseList";case zt:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case ut:return"Portal";case en:return L.displayName||"Context";case mt:return(L._context.displayName||"Context")+".Consumer";case Tn:var ne=L.render;return L=L.displayName,L||(L=ne.displayName||ne.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case Vn:return ne=L.displayName||null,ne!==null?ne:f(L.type)||"Memo";case ar:ne=L._payload,L=L._init;try{return f(L(ne))}catch{}}return null}function h(L){if(L===Lt)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===ar)return"<...>";try{var ne=f(L);return ne?"<"+ne+">":"<...>"}catch{return"<...>"}}function _(){var L=vt.A;return L===null?null:L.getOwner()}function y(){return Error("react-stack-top-frame")}function T(L){if($i.call(L,"key")){var ne=Object.getOwnPropertyDescriptor(L,"key").get;if(ne&&ne.isReactWarning)return!1}return L.key!==void 0}function v(L,ne){function ve(){xo||(xo=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ne))}ve.isReactWarning=!0,Object.defineProperty(L,"key",{get:ve,configurable:!0})}function R(){var L=f(this.type);return Nu[L]||(Nu[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function x(L,ne,ve,$e,et,Ht){var xt=ve.ref;return L={$$typeof:ot,type:L,key:ne,props:ve,_owner:$e},(xt!==void 0?xt:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:R}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:et}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ht}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function O(L,ne){return ne=x(L.type,ne,L.props,L._owner,L._debugStack,L._debugTask),L._store&&(ne._store.validated=L._store.validated),ne}function P(L){j(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===ar&&(L._payload.status==="fulfilled"?j(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function j(L){return typeof L=="object"&&L!==null&&L.$$typeof===ot}function G(L){var ne={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ve){return ne[ve]})}function H(L,ne){return typeof L=="object"&&L!==null&&L.key!=null?(l(L.key),G(""+L.key)):ne.toString(36)}function V(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(s,s):(L.status="pending",L.then(function(ne){L.status==="pending"&&(L.status="fulfilled",L.value=ne)},function(ne){L.status==="pending"&&(L.status="rejected",L.reason=ne)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function ae(L,ne,ve,$e,et){var Ht=typeof L;(Ht==="undefined"||Ht==="boolean")&&(L=null);var xt=!1;if(L===null)xt=!0;else switch(Ht){case"bigint":case"string":case"number":xt=!0;break;case"object":switch(L.$$typeof){case ot:case ut:xt=!0;break;case ar:return xt=L._init,ae(xt(L._payload),ne,ve,$e,et)}}if(xt){xt=L,et=et(xt);var Fn=$e===""?"."+H(xt,0):$e;return oo(et)?(ve="",Fn!=null&&(ve=Fn.replace(Ad,"$&/")+"/"),ae(et,ne,ve,"",function(ui){return ui})):et!=null&&(j(et)&&(et.key!=null&&(xt&&xt.key===et.key||l(et.key)),ve=O(et,ve+(et.key==null||xt&&xt.key===et.key?"":(""+et.key).replace(Ad,"$&/")+"/")+Fn),$e!==""&&xt!=null&&j(xt)&&xt.key==null&&xt._store&&!xt._store.validated&&(ve._store.validated=2),et=ve),ne.push(et)),1}if(xt=0,Fn=$e===""?".":$e+":",oo(L))for(var pn=0;pn<L.length;pn++)$e=L[pn],Ht=Fn+H($e,pn),xt+=ae($e,ne,ve,Ht,et);else if(pn=t(L),typeof pn=="function")for(pn===L.entries&&(Bu||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Bu=!0),L=pn.call(L),pn=0;!($e=L.next()).done;)$e=$e.value,Ht=Fn+H($e,pn++),xt+=ae($e,ne,ve,Ht,et);else if(Ht==="object"){if(typeof L.then=="function")return ae(V(L),ne,ve,$e,et);throw ne=String(L),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return xt}function re(L,ne,ve){if(L==null)return L;var $e=[],et=0;return ae(L,$e,"","",function(Ht){return ne.call(ve,Ht,et++)}),$e}function _e(L){if(L._status===-1){var ne=L._ioInfo;ne!=null&&(ne.start=ne.end=performance.now()),ne=L._result;var ve=ne();if(ve.then(function(et){if(L._status===0||L._status===-1){L._status=1,L._result=et;var Ht=L._ioInfo;Ht!=null&&(Ht.end=performance.now()),ve.status===void 0&&(ve.status="fulfilled",ve.value=et)}},function(et){if(L._status===0||L._status===-1){L._status=2,L._result=et;var Ht=L._ioInfo;Ht!=null&&(Ht.end=performance.now()),ve.status===void 0&&(ve.status="rejected",ve.reason=et)}}),ne=L._ioInfo,ne!=null){ne.value=ve;var $e=ve.displayName;typeof $e=="string"&&(ne.name=$e)}L._status===-1&&(L._status=0,L._result=ve)}if(L._status===1)return ne=L._result,ne===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
108
108
 
109
109
  Your code should look like:
110
110
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -124,14 +124,14 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
124
124
  `)}var gH,P6t,Wse,nHe,M6t,rHe,AH,eHe,tHe,L6t,Zse,U6t,Q6t,Xse=w(()=>{m();Jze();pH();qk();gH=new Set(["\x1B","\x9B"]),P6t=39,Wse="\x07",nHe="[",M6t="]",rHe="m",AH=`${M6t}8;;`,eHe=e=>`${gH.values().next().value}${nHe}${e}${rHe}`,tHe=e=>`${gH.values().next().value}${AH}${e}${Wse}`,L6t=e=>e.split(" ").map(t=>HT(t)),Zse=(e,t,n)=>{let r=[...t],o=!1,i=!1,s=HT(jT(e.at(-1)));for(let[u,l]of r.entries()){let f=HT(l);if(s+f<=n?e[e.length-1]+=l:(e.push(l),s=0),gH.has(l)&&(o=!0,i=r.slice(u+1,u+1+AH.length).join("")===AH),o){i?l===Wse&&(o=!1,i=!1):l===rHe&&(o=!1);continue}s+=f,s===n&&u<r.length-1&&(e.push(""),s=0)}!s&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},U6t=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(HT(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},Q6t=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",o,i,s=L6t(e),u=[""];for(let[_,y]of e.split(" ").entries()){n.trim!==!1&&(u[u.length-1]=u.at(-1).trimStart());let T=HT(u.at(-1));if(_!==0&&(T>=t&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),T=0),(T>0||n.trim===!1)&&(u[u.length-1]+=" ",T++)),n.hard&&s[_]>t){let v=t-T,R=1+Math.floor((s[_]-v-1)/t);Math.floor((s[_]-1)/t)<R&&u.push(""),Zse(u,y,t);continue}if(T+s[_]>t&&T>0&&s[_]>0){if(n.wordWrap===!1&&T<t){Zse(u,y,t);continue}u.push("")}if(T+s[_]>t&&n.wordWrap===!1){Zse(u,y,t);continue}u[u.length-1]+=y}n.trim!==!1&&(u=u.map(_=>U6t(_)));let l=u.join(`
125
125
  `),f=[...l],h=0;for(let[_,y]of f.entries()){if(r+=y,gH.has(y)){let{groups:v}=new RegExp(`(?:\\${nHe}(?<code>\\d+)m|\\${AH}(?<uri>.*)${Wse})`).exec(l.slice(h))||{groups:{}};if(v.code!==void 0){let R=Number.parseFloat(v.code);o=R===P6t?void 0:R}else v.uri!==void 0&&(i=v.uri.length===0?void 0:v.uri)}let T=Ro.codes.get(Number(o));f[_+1]===`
126
126
  `?(i&&(r+=tHe("")),o&&T&&(r+=eHe(T))):y===`
127
- `&&(o&&T&&(r+=eHe(o)),i&&(r+=tHe(i))),h+=y.length}return r}});import $T from"node:process";import{execFileSync as F6t}from"node:child_process";import Yk from"node:fs";import G6t from"node:tty";function nae(){let{env:e,stdout:t,stderr:n}=$T;if(t?.columns&&t?.rows)return hH(t.columns,t.rows);if(n?.columns&&n?.rows)return hH(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return hH(e.COLUMNS,e.LINES);let r={columns:iHe,rows:sHe};return $T.platform==="win32"?eae()??r:$T.platform==="darwin"?oHe()??eae()??r:oHe()??eae()??z6t()??r}var iHe,sHe,tae,hH,aHe,j6t,oHe,eae,z6t,uHe=w(()=>{m();iHe=80,sHe=24,tae=(e,t,{shell:n,env:r}={})=>F6t(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),hH=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),aHe=(e,t)=>{let{columns:n,rows:r}=hH(e,t);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===iHe&&r===sHe))return{columns:n,rows:r}},j6t=()=>{if($T.platform!=="linux")return!0;try{let e=Yk.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;let n=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),o=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(o)||o<=0?!1:r===o}catch{return!1}};oHe=()=>{try{let e=$T.platform==="darwin"?Yk.constants.O_EVTONLY|Yk.constants.O_NONBLOCK:Yk.constants.O_NONBLOCK,{columns:t,rows:n}=G6t.WriteStream(Yk.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},eae=()=>{try{let e=tae("tput",["cols"],{env:{TERM:"dumb",...$T.env}}),t=tae("tput",["lines"],{env:{TERM:"dumb",...$T.env}});if(e&&t)return aHe(e,t)}catch{}},z6t=()=>{try{if(!j6t())return;let e=tae("resize",["-u"]).match(/\d+/g);if(e.length===2)return aHe(e[0],e[1])}catch{}}});import H6t from"node:process";var Kk,rae=w(()=>{m();Kk=()=>H6t.env.DEV==="true"});var _He=M(Qo=>{"use strict";m();function aae(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<_H(o,t))e[r]=t,e[n]=o,n=r;else break e}}function hA(e){return e.length===0?null:e[0]}function yH(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,u=e[s],l=s+1,f=e[l];if(0>_H(u,n))l<o&&0>_H(f,u)?(e[r]=f,e[l]=n,r=l):(e[r]=u,e[s]=n,r=s);else if(l<o&&0>_H(f,n))e[r]=f,e[l]=n,r=l;else break e}}return t}function _H(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}Qo.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(cHe=performance,Qo.unstable_now=function(){return cHe.now()}):(oae=Date,lHe=oae.now(),Qo.unstable_now=function(){return oae.now()-lHe});var cHe,oae,lHe,mh=[],l0=[],$6t=1,Ep=null,Ru=3,uae=!1,Jk=!1,Zk=!1,cae=!1,fHe=typeof setTimeout=="function"?setTimeout:null,mHe=typeof clearTimeout=="function"?clearTimeout:null,dHe=typeof setImmediate<"u"?setImmediate:null;function EH(e){for(var t=hA(l0);t!==null;){if(t.callback===null)yH(l0);else if(t.startTime<=e)yH(l0),t.sortIndex=t.expirationTime,aae(mh,t);else break;t=hA(l0)}}function lae(e){if(Zk=!1,EH(e),!Jk)if(hA(mh)!==null)Jk=!0,aD||(aD=!0,sD());else{var t=hA(l0);t!==null&&dae(lae,t.startTime-e)}}var aD=!1,Wk=-1,AHe=5,gHe=-1;function hHe(){return cae?!0:!(Qo.unstable_now()-gHe<AHe)}function iae(){if(cae=!1,aD){var e=Qo.unstable_now();gHe=e;var t=!0;try{e:{Jk=!1,Zk&&(Zk=!1,mHe(Wk),Wk=-1),uae=!0;var n=Ru;try{t:{for(EH(e),Ep=hA(mh);Ep!==null&&!(Ep.expirationTime>e&&hHe());){var r=Ep.callback;if(typeof r=="function"){Ep.callback=null,Ru=Ep.priorityLevel;var o=r(Ep.expirationTime<=e);if(e=Qo.unstable_now(),typeof o=="function"){Ep.callback=o,EH(e),t=!0;break t}Ep===hA(mh)&&yH(mh),EH(e)}else yH(mh);Ep=hA(mh)}if(Ep!==null)t=!0;else{var i=hA(l0);i!==null&&dae(lae,i.startTime-e),t=!1}}break e}finally{Ep=null,Ru=n,uae=!1}t=void 0}}finally{t?sD():aD=!1}}}var sD;typeof dHe=="function"?sD=function(){dHe(iae)}:typeof MessageChannel<"u"?(sae=new MessageChannel,pHe=sae.port2,sae.port1.onmessage=iae,sD=function(){pHe.postMessage(null)}):sD=function(){fHe(iae,0)};var sae,pHe;function dae(e,t){Wk=fHe(function(){e(Qo.unstable_now())},t)}Qo.unstable_IdlePriority=5;Qo.unstable_ImmediatePriority=1;Qo.unstable_LowPriority=4;Qo.unstable_NormalPriority=3;Qo.unstable_Profiling=null;Qo.unstable_UserBlockingPriority=2;Qo.unstable_cancelCallback=function(e){e.callback=null};Qo.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):AHe=0<e?Math.floor(1e3/e):5};Qo.unstable_getCurrentPriorityLevel=function(){return Ru};Qo.unstable_next=function(e){switch(Ru){case 1:case 2:case 3:var t=3;break;default:t=Ru}var n=Ru;Ru=t;try{return e()}finally{Ru=n}};Qo.unstable_requestPaint=function(){cae=!0};Qo.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Ru;Ru=e;try{return t()}finally{Ru=n}};Qo.unstable_scheduleCallback=function(e,t,n){var r=Qo.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:$6t++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,aae(l0,e),hA(mh)===null&&e===hA(l0)&&(Zk?(mHe(Wk),Wk=-1):Zk=!0,dae(lae,n-r))):(e.sortIndex=o,aae(mh,e),Jk||uae||(Jk=!0,aD||(aD=!0,sD()))),e};Qo.unstable_shouldYield=hHe;Qo.unstable_wrapCallback=function(e){var t=Ru;return function(){var n=Ru;Ru=t;try{return e.apply(this,arguments)}finally{Ru=n}}}});var EHe=M(Fo=>{"use strict";m();process.env.NODE_ENV!=="production"&&(function(){function e(){if(G=!1,re){var ye=Fo.unstable_now();pt=ye;var Je=!0;try{e:{P=!1,j&&(j=!1,V(_e),_e=-1),O=!0;var ot=x;try{t:{for(i(ye),R=n(y);R!==null&&!(R.expirationTime>ye&&u());){var ut=R.callback;if(typeof ut=="function"){R.callback=null,x=R.priorityLevel;var Lt=ut(R.expirationTime<=ye);if(ye=Fo.unstable_now(),typeof Lt=="function"){R.callback=Lt,i(ye),Je=!0;break t}R===n(y)&&r(y),i(ye)}else r(y);R=n(y)}if(R!==null)Je=!0;else{var Gr=n(T);Gr!==null&&l(s,Gr.startTime-ye),Je=!1}}break e}finally{R=null,x=ot,O=!1}Je=void 0}}finally{Je?Ge():re=!1}}}function t(ye,Je){var ot=ye.length;ye.push(Je);e:for(;0<ot;){var ut=ot-1>>>1,Lt=ye[ut];if(0<o(Lt,Je))ye[ut]=Je,ye[ot]=Lt,ot=ut;else break e}}function n(ye){return ye.length===0?null:ye[0]}function r(ye){if(ye.length===0)return null;var Je=ye[0],ot=ye.pop();if(ot!==Je){ye[0]=ot;e:for(var ut=0,Lt=ye.length,Gr=Lt>>>1;ut<Gr;){var be=2*(ut+1)-1,mt=ye[be],en=be+1,Tn=ye[en];if(0>o(mt,ot))en<Lt&&0>o(Tn,mt)?(ye[ut]=Tn,ye[en]=ot,ut=en):(ye[ut]=mt,ye[be]=ot,ut=be);else if(en<Lt&&0>o(Tn,ot))ye[ut]=Tn,ye[en]=ot,ut=en;else break e}}return Je}function o(ye,Je){var ot=ye.sortIndex-Je.sortIndex;return ot!==0?ot:ye.id-Je.id}function i(ye){for(var Je=n(T);Je!==null;){if(Je.callback===null)r(T);else if(Je.startTime<=ye)r(T),Je.sortIndex=Je.expirationTime,t(y,Je);else break;Je=n(T)}}function s(ye){if(j=!1,i(ye),!P)if(n(y)!==null)P=!0,re||(re=!0,Ge());else{var Je=n(T);Je!==null&&l(s,Je.startTime-ye)}}function u(){return G?!0:!(Fo.unstable_now()-pt<Qe)}function l(ye,Je){_e=H(function(){ye(Fo.unstable_now())},Je)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),Fo.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;Fo.unstable_now=function(){return f.now()}}else{var h=Date,_=h.now();Fo.unstable_now=function(){return h.now()-_}}var y=[],T=[],v=1,R=null,x=3,O=!1,P=!1,j=!1,G=!1,H=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,ae=typeof setImmediate<"u"?setImmediate:null,re=!1,_e=-1,Qe=5,pt=-1;if(typeof ae=="function")var Ge=function(){ae(e)};else if(typeof MessageChannel<"u"){var Pt=new MessageChannel,Tt=Pt.port2;Pt.port1.onmessage=e,Ge=function(){Tt.postMessage(null)}}else Ge=function(){H(e,0)};Fo.unstable_IdlePriority=5,Fo.unstable_ImmediatePriority=1,Fo.unstable_LowPriority=4,Fo.unstable_NormalPriority=3,Fo.unstable_Profiling=null,Fo.unstable_UserBlockingPriority=2,Fo.unstable_cancelCallback=function(ye){ye.callback=null},Fo.unstable_forceFrameRate=function(ye){0>ye||125<ye?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Qe=0<ye?Math.floor(1e3/ye):5},Fo.unstable_getCurrentPriorityLevel=function(){return x},Fo.unstable_next=function(ye){switch(x){case 1:case 2:case 3:var Je=3;break;default:Je=x}var ot=x;x=Je;try{return ye()}finally{x=ot}},Fo.unstable_requestPaint=function(){G=!0},Fo.unstable_runWithPriority=function(ye,Je){switch(ye){case 1:case 2:case 3:case 4:case 5:break;default:ye=3}var ot=x;x=ye;try{return Je()}finally{x=ot}},Fo.unstable_scheduleCallback=function(ye,Je,ot){var ut=Fo.unstable_now();switch(typeof ot=="object"&&ot!==null?(ot=ot.delay,ot=typeof ot=="number"&&0<ot?ut+ot:ut):ot=ut,ye){case 1:var Lt=-1;break;case 2:Lt=250;break;case 5:Lt=1073741823;break;case 4:Lt=1e4;break;default:Lt=5e3}return Lt=ot+Lt,ye={id:v++,callback:Je,priorityLevel:ye,startTime:ot,expirationTime:Lt,sortIndex:-1},ot>ut?(ye.sortIndex=ot,t(T,ye),n(y)===null&&ye===n(T)&&(j?(V(_e),_e=-1):j=!0,l(s,ot-ut))):(ye.sortIndex=Lt,t(y,ye),P||O||(P=!0,re||(re=!0,Ge()))),ye},Fo.unstable_shouldYield=u,Fo.unstable_wrapCallback=function(ye){var Je=x;return function(){var ot=x;x=Je;try{return ye.apply(this,arguments)}finally{x=ot}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var SH=M((HHn,pae)=>{"use strict";m();process.env.NODE_ENV==="production"?pae.exports=_He():pae.exports=EHe()});var yHe=M((qHn,Xk)=>{"use strict";m();Xk.exports=function(e){function t(d,p,E,b){return new pI(d,p,E,b)}function n(){}function r(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)p+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+d+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(d){var p=d,E=d;if(d.alternate)for(;p.return;)p=p.return;else{d=p;do p=d,(p.flags&4098)!==0&&(E=p.return),d=p.return;while(d)}return p.tag===3?E:null}function i(d){if(o(d)!==d)throw Error(r(188))}function s(d){var p=d.alternate;if(!p){if(p=o(d),p===null)throw Error(r(188));return p!==d?null:d}for(var E=d,b=p;;){var D=E.return;if(D===null)break;var N=D.alternate;if(N===null){if(b=D.return,b!==null){E=b;continue}break}if(D.child===N.child){for(N=D.child;N;){if(N===E)return i(D),d;if(N===b)return i(D),p;N=N.sibling}throw Error(r(188))}if(E.return!==b.return)E=D,b=N;else{for(var Q=!1,K=D.child;K;){if(K===E){Q=!0,E=D,b=N;break}if(K===b){Q=!0,b=D,E=N;break}K=K.sibling}if(!Q){for(K=N.child;K;){if(K===E){Q=!0,E=N,b=D;break}if(K===b){Q=!0,b=N,E=D;break}K=K.sibling}if(!Q)throw Error(r(189))}}if(E.alternate!==b)throw Error(r(190))}if(E.tag!==3)throw Error(r(188));return E.stateNode.current===E?d:p}function u(d){var p=d.tag;if(p===5||p===26||p===27||p===6)return d;for(d=d.child;d!==null;){if(p=u(d),p!==null)return p;d=d.sibling}return null}function l(d){var p=d.tag;if(p===5||p===26||p===27||p===6)return d;for(d=d.child;d!==null;){if(d.tag!==4&&(p=l(d),p!==null))return p;d=d.sibling}return null}function f(d){return d===null||typeof d!="object"?null:(d=tN&&d[tN]||d["@@iterator"],typeof d=="function"?d:null)}function h(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===nN?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case qA:return"Fragment";case by:return"Profiler";case X1:return"StrictMode";case VA:return"Suspense";case br:return"SuspenseList";case EI:return"Activity"}if(typeof d=="object")switch(d.$$typeof){case sm:return"Portal";case Kp:return d.displayName||"Context";case _I:return(d._context.displayName||"Context")+".Consumer";case zh:var p=d.render;return d=d.displayName,d||(d=p.displayName||p.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case eN:return p=d.displayName||null,p!==null?p:h(d.type)||"Memo";case am:p=d._payload,d=d._init;try{return h(d(p))}catch{}}return null}function _(d){return{current:d}}function y(d){0>Kh||(d.current=wy[Kh],wy[Kh]=null,Kh--)}function T(d,p){Kh++,wy[Kh]=d.current,d.current=p}function v(d){return d>>>=0,d===0?32:31-(H2(d)/$2|0)|0}function R(d){var p=d&42;if(p!==0)return p;switch(d&-d){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return d&261888;case 262144:case 524288:case 1048576:case 2097152:return d&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return d&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return d}}function x(d,p,E){var b=d.pendingLanes;if(b===0)return 0;var D=0,N=d.suspendedLanes,Q=d.pingedLanes;d=d.warmLanes;var K=b&134217727;return K!==0?(b=K&~N,b!==0?D=R(b):(Q&=K,Q!==0?D=R(Q):E||(E=K&~d,E!==0&&(D=R(E))))):(K=b&~N,K!==0?D=R(K):Q!==0?D=R(Q):E||(E=b&~d,E!==0&&(D=R(E)))),D===0?0:p!==0&&p!==D&&(p&N)===0&&(N=D&-D,E=p&-p,N>=E||N===32&&(E&4194048)!==0)?p:D}function O(d,p){return(d.pendingLanes&~(d.suspendedLanes&~d.pingedLanes)&p)===0}function P(d,p){switch(d){case 1:case 2:case 4:case 8:case 64:return p+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function j(){var d=Jh;return Jh<<=1,(Jh&62914560)===0&&(Jh=4194304),d}function G(d){for(var p=[],E=0;31>E;E++)p.push(d);return p}function H(d,p){d.pendingLanes|=p,p!==268435456&&(d.suspendedLanes=0,d.pingedLanes=0,d.warmLanes=0)}function V(d,p,E,b,D,N){var Q=d.pendingLanes;d.pendingLanes=E,d.suspendedLanes=0,d.pingedLanes=0,d.warmLanes=0,d.expiredLanes&=E,d.entangledLanes&=E,d.errorRecoveryDisabledLanes&=E,d.shellSuspendCounter=0;var K=d.entanglements,Ae=d.expirationTimes,De=d.hiddenUpdates;for(E=Q&~E;0<E;){var Ke=31-Ja(E),je=1<<Ke;K[Ke]=0,Ae[Ke]=-1;var nt=De[Ke];if(nt!==null)for(De[Ke]=null,Ke=0;Ke<nt.length;Ke++){var Ut=nt[Ke];Ut!==null&&(Ut.lane&=-536870913)}E&=~je}b!==0&&ae(d,b,0),N!==0&&D===0&&d.tag!==0&&(d.suspendedLanes|=N&~(Q&~p))}function ae(d,p,E){d.pendingLanes|=p,d.suspendedLanes&=~p;var b=31-Ja(p);d.entangledLanes|=p,d.entanglements[b]=d.entanglements[b]|1073741824|E&261930}function re(d,p){var E=d.entangledLanes|=p;for(d=d.entanglements;E;){var b=31-Ja(E),D=1<<b;D&p|d[b]&p&&(d[b]|=p),E&=~D}}function _e(d,p){var E=p&-p;return E=(E&42)!==0?1:Qe(E),(E&(d.suspendedLanes|p))!==0?0:E}function Qe(d){switch(d){case 2:d=1;break;case 8:d=4;break;case 32:d=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:d=128;break;case 268435456:d=134217728;break;default:d=0}return d}function pt(d){return d&=-d,2<d?8<d?(d&134217727)!==0?32:268435456:8:2}function Ge(d){if(typeof PI=="function"&&_N(d),Vo&&typeof Vo.setStrictMode=="function")try{Vo.setStrictMode(tg,d)}catch{}}function Pt(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}function Tt(d){if(Wh===void 0)try{throw Error()}catch(E){var p=E.stack.trim().match(/\n( *(at )?)/);Wh=p&&p[1]||"",Wa=-1<E.stack.indexOf(`
127
+ `&&(o&&T&&(r+=eHe(o)),i&&(r+=tHe(i))),h+=y.length}return r}});import $T from"node:process";import{execFileSync as F6t}from"node:child_process";import Yk from"node:fs";import G6t from"node:tty";function nae(){let{env:e,stdout:t,stderr:n}=$T;if(t?.columns&&t?.rows)return hH(t.columns,t.rows);if(n?.columns&&n?.rows)return hH(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return hH(e.COLUMNS,e.LINES);let r={columns:iHe,rows:sHe};return $T.platform==="win32"?eae()??r:$T.platform==="darwin"?oHe()??eae()??r:oHe()??eae()??z6t()??r}var iHe,sHe,tae,hH,aHe,j6t,oHe,eae,z6t,uHe=w(()=>{m();iHe=80,sHe=24,tae=(e,t,{shell:n,env:r}={})=>F6t(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),hH=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),aHe=(e,t)=>{let{columns:n,rows:r}=hH(e,t);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===iHe&&r===sHe))return{columns:n,rows:r}},j6t=()=>{if($T.platform!=="linux")return!0;try{let e=Yk.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;let n=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),o=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(o)||o<=0?!1:r===o}catch{return!1}};oHe=()=>{try{let e=$T.platform==="darwin"?Yk.constants.O_EVTONLY|Yk.constants.O_NONBLOCK:Yk.constants.O_NONBLOCK,{columns:t,rows:n}=G6t.WriteStream(Yk.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},eae=()=>{try{let e=tae("tput",["cols"],{env:{TERM:"dumb",...$T.env}}),t=tae("tput",["lines"],{env:{TERM:"dumb",...$T.env}});if(e&&t)return aHe(e,t)}catch{}},z6t=()=>{try{if(!j6t())return;let e=tae("resize",["-u"]).match(/\d+/g);if(e.length===2)return aHe(e[0],e[1])}catch{}}});import H6t from"node:process";var Kk,rae=w(()=>{m();Kk=()=>H6t.env.DEV==="true"});var _He=M(Qo=>{"use strict";m();function aae(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<_H(o,t))e[r]=t,e[n]=o,n=r;else break e}}function hA(e){return e.length===0?null:e[0]}function yH(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,u=e[s],l=s+1,f=e[l];if(0>_H(u,n))l<o&&0>_H(f,u)?(e[r]=f,e[l]=n,r=l):(e[r]=u,e[s]=n,r=s);else if(l<o&&0>_H(f,n))e[r]=f,e[l]=n,r=l;else break e}}return t}function _H(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}Qo.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(cHe=performance,Qo.unstable_now=function(){return cHe.now()}):(oae=Date,lHe=oae.now(),Qo.unstable_now=function(){return oae.now()-lHe});var cHe,oae,lHe,mh=[],l0=[],$6t=1,Ep=null,Ru=3,uae=!1,Jk=!1,Zk=!1,cae=!1,fHe=typeof setTimeout=="function"?setTimeout:null,mHe=typeof clearTimeout=="function"?clearTimeout:null,dHe=typeof setImmediate<"u"?setImmediate:null;function EH(e){for(var t=hA(l0);t!==null;){if(t.callback===null)yH(l0);else if(t.startTime<=e)yH(l0),t.sortIndex=t.expirationTime,aae(mh,t);else break;t=hA(l0)}}function lae(e){if(Zk=!1,EH(e),!Jk)if(hA(mh)!==null)Jk=!0,aD||(aD=!0,sD());else{var t=hA(l0);t!==null&&dae(lae,t.startTime-e)}}var aD=!1,Wk=-1,AHe=5,gHe=-1;function hHe(){return cae?!0:!(Qo.unstable_now()-gHe<AHe)}function iae(){if(cae=!1,aD){var e=Qo.unstable_now();gHe=e;var t=!0;try{e:{Jk=!1,Zk&&(Zk=!1,mHe(Wk),Wk=-1),uae=!0;var n=Ru;try{t:{for(EH(e),Ep=hA(mh);Ep!==null&&!(Ep.expirationTime>e&&hHe());){var r=Ep.callback;if(typeof r=="function"){Ep.callback=null,Ru=Ep.priorityLevel;var o=r(Ep.expirationTime<=e);if(e=Qo.unstable_now(),typeof o=="function"){Ep.callback=o,EH(e),t=!0;break t}Ep===hA(mh)&&yH(mh),EH(e)}else yH(mh);Ep=hA(mh)}if(Ep!==null)t=!0;else{var i=hA(l0);i!==null&&dae(lae,i.startTime-e),t=!1}}break e}finally{Ep=null,Ru=n,uae=!1}t=void 0}}finally{t?sD():aD=!1}}}var sD;typeof dHe=="function"?sD=function(){dHe(iae)}:typeof MessageChannel<"u"?(sae=new MessageChannel,pHe=sae.port2,sae.port1.onmessage=iae,sD=function(){pHe.postMessage(null)}):sD=function(){fHe(iae,0)};var sae,pHe;function dae(e,t){Wk=fHe(function(){e(Qo.unstable_now())},t)}Qo.unstable_IdlePriority=5;Qo.unstable_ImmediatePriority=1;Qo.unstable_LowPriority=4;Qo.unstable_NormalPriority=3;Qo.unstable_Profiling=null;Qo.unstable_UserBlockingPriority=2;Qo.unstable_cancelCallback=function(e){e.callback=null};Qo.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):AHe=0<e?Math.floor(1e3/e):5};Qo.unstable_getCurrentPriorityLevel=function(){return Ru};Qo.unstable_next=function(e){switch(Ru){case 1:case 2:case 3:var t=3;break;default:t=Ru}var n=Ru;Ru=t;try{return e()}finally{Ru=n}};Qo.unstable_requestPaint=function(){cae=!0};Qo.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Ru;Ru=e;try{return t()}finally{Ru=n}};Qo.unstable_scheduleCallback=function(e,t,n){var r=Qo.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:$6t++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,aae(l0,e),hA(mh)===null&&e===hA(l0)&&(Zk?(mHe(Wk),Wk=-1):Zk=!0,dae(lae,n-r))):(e.sortIndex=o,aae(mh,e),Jk||uae||(Jk=!0,aD||(aD=!0,sD()))),e};Qo.unstable_shouldYield=hHe;Qo.unstable_wrapCallback=function(e){var t=Ru;return function(){var n=Ru;Ru=t;try{return e.apply(this,arguments)}finally{Ru=n}}}});var EHe=M(Fo=>{"use strict";m();process.env.NODE_ENV!=="production"&&(function(){function e(){if(G=!1,re){var ye=Fo.unstable_now();pt=ye;var Je=!0;try{e:{P=!1,j&&(j=!1,V(_e),_e=-1),O=!0;var ot=x;try{t:{for(i(ye),R=n(y);R!==null&&!(R.expirationTime>ye&&u());){var ut=R.callback;if(typeof ut=="function"){R.callback=null,x=R.priorityLevel;var Lt=ut(R.expirationTime<=ye);if(ye=Fo.unstable_now(),typeof Lt=="function"){R.callback=Lt,i(ye),Je=!0;break t}R===n(y)&&r(y),i(ye)}else r(y);R=n(y)}if(R!==null)Je=!0;else{var Gr=n(T);Gr!==null&&l(s,Gr.startTime-ye),Je=!1}}break e}finally{R=null,x=ot,O=!1}Je=void 0}}finally{Je?Ge():re=!1}}}function t(ye,Je){var ot=ye.length;ye.push(Je);e:for(;0<ot;){var ut=ot-1>>>1,Lt=ye[ut];if(0<o(Lt,Je))ye[ut]=Je,ye[ot]=Lt,ot=ut;else break e}}function n(ye){return ye.length===0?null:ye[0]}function r(ye){if(ye.length===0)return null;var Je=ye[0],ot=ye.pop();if(ot!==Je){ye[0]=ot;e:for(var ut=0,Lt=ye.length,Gr=Lt>>>1;ut<Gr;){var be=2*(ut+1)-1,mt=ye[be],en=be+1,Tn=ye[en];if(0>o(mt,ot))en<Lt&&0>o(Tn,mt)?(ye[ut]=Tn,ye[en]=ot,ut=en):(ye[ut]=mt,ye[be]=ot,ut=be);else if(en<Lt&&0>o(Tn,ot))ye[ut]=Tn,ye[en]=ot,ut=en;else break e}}return Je}function o(ye,Je){var ot=ye.sortIndex-Je.sortIndex;return ot!==0?ot:ye.id-Je.id}function i(ye){for(var Je=n(T);Je!==null;){if(Je.callback===null)r(T);else if(Je.startTime<=ye)r(T),Je.sortIndex=Je.expirationTime,t(y,Je);else break;Je=n(T)}}function s(ye){if(j=!1,i(ye),!P)if(n(y)!==null)P=!0,re||(re=!0,Ge());else{var Je=n(T);Je!==null&&l(s,Je.startTime-ye)}}function u(){return G?!0:!(Fo.unstable_now()-pt<Qe)}function l(ye,Je){_e=H(function(){ye(Fo.unstable_now())},Je)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),Fo.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;Fo.unstable_now=function(){return f.now()}}else{var h=Date,_=h.now();Fo.unstable_now=function(){return h.now()-_}}var y=[],T=[],v=1,R=null,x=3,O=!1,P=!1,j=!1,G=!1,H=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,ae=typeof setImmediate<"u"?setImmediate:null,re=!1,_e=-1,Qe=5,pt=-1;if(typeof ae=="function")var Ge=function(){ae(e)};else if(typeof MessageChannel<"u"){var Pt=new MessageChannel,Tt=Pt.port2;Pt.port1.onmessage=e,Ge=function(){Tt.postMessage(null)}}else Ge=function(){H(e,0)};Fo.unstable_IdlePriority=5,Fo.unstable_ImmediatePriority=1,Fo.unstable_LowPriority=4,Fo.unstable_NormalPriority=3,Fo.unstable_Profiling=null,Fo.unstable_UserBlockingPriority=2,Fo.unstable_cancelCallback=function(ye){ye.callback=null},Fo.unstable_forceFrameRate=function(ye){0>ye||125<ye?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Qe=0<ye?Math.floor(1e3/ye):5},Fo.unstable_getCurrentPriorityLevel=function(){return x},Fo.unstable_next=function(ye){switch(x){case 1:case 2:case 3:var Je=3;break;default:Je=x}var ot=x;x=Je;try{return ye()}finally{x=ot}},Fo.unstable_requestPaint=function(){G=!0},Fo.unstable_runWithPriority=function(ye,Je){switch(ye){case 1:case 2:case 3:case 4:case 5:break;default:ye=3}var ot=x;x=ye;try{return Je()}finally{x=ot}},Fo.unstable_scheduleCallback=function(ye,Je,ot){var ut=Fo.unstable_now();switch(typeof ot=="object"&&ot!==null?(ot=ot.delay,ot=typeof ot=="number"&&0<ot?ut+ot:ut):ot=ut,ye){case 1:var Lt=-1;break;case 2:Lt=250;break;case 5:Lt=1073741823;break;case 4:Lt=1e4;break;default:Lt=5e3}return Lt=ot+Lt,ye={id:v++,callback:Je,priorityLevel:ye,startTime:ot,expirationTime:Lt,sortIndex:-1},ot>ut?(ye.sortIndex=ot,t(T,ye),n(y)===null&&ye===n(T)&&(j?(V(_e),_e=-1):j=!0,l(s,ot-ut))):(ye.sortIndex=Lt,t(y,ye),P||O||(P=!0,re||(re=!0,Ge()))),ye},Fo.unstable_shouldYield=u,Fo.unstable_wrapCallback=function(ye){var Je=x;return function(){var ot=x;x=Je;try{return ye.apply(this,arguments)}finally{x=ot}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var SH=M((HHn,pae)=>{"use strict";m();process.env.NODE_ENV==="production"?pae.exports=_He():pae.exports=EHe()});var yHe=M((qHn,Xk)=>{"use strict";m();Xk.exports=function(e){function t(d,p,E,b){return new pI(d,p,E,b)}function n(){}function r(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)p+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+d+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(d){var p=d,E=d;if(d.alternate)for(;p.return;)p=p.return;else{d=p;do p=d,(p.flags&4098)!==0&&(E=p.return),d=p.return;while(d)}return p.tag===3?E:null}function i(d){if(o(d)!==d)throw Error(r(188))}function s(d){var p=d.alternate;if(!p){if(p=o(d),p===null)throw Error(r(188));return p!==d?null:d}for(var E=d,b=p;;){var D=E.return;if(D===null)break;var N=D.alternate;if(N===null){if(b=D.return,b!==null){E=b;continue}break}if(D.child===N.child){for(N=D.child;N;){if(N===E)return i(D),d;if(N===b)return i(D),p;N=N.sibling}throw Error(r(188))}if(E.return!==b.return)E=D,b=N;else{for(var Q=!1,K=D.child;K;){if(K===E){Q=!0,E=D,b=N;break}if(K===b){Q=!0,b=D,E=N;break}K=K.sibling}if(!Q){for(K=N.child;K;){if(K===E){Q=!0,E=N,b=D;break}if(K===b){Q=!0,b=N,E=D;break}K=K.sibling}if(!Q)throw Error(r(189))}}if(E.alternate!==b)throw Error(r(190))}if(E.tag!==3)throw Error(r(188));return E.stateNode.current===E?d:p}function u(d){var p=d.tag;if(p===5||p===26||p===27||p===6)return d;for(d=d.child;d!==null;){if(p=u(d),p!==null)return p;d=d.sibling}return null}function l(d){var p=d.tag;if(p===5||p===26||p===27||p===6)return d;for(d=d.child;d!==null;){if(d.tag!==4&&(p=l(d),p!==null))return p;d=d.sibling}return null}function f(d){return d===null||typeof d!="object"?null:(d=tN&&d[tN]||d["@@iterator"],typeof d=="function"?d:null)}function h(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===nN?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case qA:return"Fragment";case by:return"Profiler";case X1:return"StrictMode";case VA:return"Suspense";case br:return"SuspenseList";case EI:return"Activity"}if(typeof d=="object")switch(d.$$typeof){case sm:return"Portal";case Kp:return d.displayName||"Context";case _I:return(d._context.displayName||"Context")+".Consumer";case zh:var p=d.render;return d=d.displayName,d||(d=p.displayName||p.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case eN:return p=d.displayName||null,p!==null?p:h(d.type)||"Memo";case am:p=d._payload,d=d._init;try{return h(d(p))}catch{}}return null}function _(d){return{current:d}}function y(d){0>Kh||(d.current=wy[Kh],wy[Kh]=null,Kh--)}function T(d,p){Kh++,wy[Kh]=d.current,d.current=p}function v(d){return d>>>=0,d===0?32:31-(H2(d)/$2|0)|0}function R(d){var p=d&42;if(p!==0)return p;switch(d&-d){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return d&261888;case 262144:case 524288:case 1048576:case 2097152:return d&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return d&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return d}}function x(d,p,E){var b=d.pendingLanes;if(b===0)return 0;var D=0,N=d.suspendedLanes,Q=d.pingedLanes;d=d.warmLanes;var K=b&134217727;return K!==0?(b=K&~N,b!==0?D=R(b):(Q&=K,Q!==0?D=R(Q):E||(E=K&~d,E!==0&&(D=R(E))))):(K=b&~N,K!==0?D=R(K):Q!==0?D=R(Q):E||(E=b&~d,E!==0&&(D=R(E)))),D===0?0:p!==0&&p!==D&&(p&N)===0&&(N=D&-D,E=p&-p,N>=E||N===32&&(E&4194048)!==0)?p:D}function O(d,p){return(d.pendingLanes&~(d.suspendedLanes&~d.pingedLanes)&p)===0}function P(d,p){switch(d){case 1:case 2:case 4:case 8:case 64:return p+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function j(){var d=Jh;return Jh<<=1,(Jh&62914560)===0&&(Jh=4194304),d}function G(d){for(var p=[],E=0;31>E;E++)p.push(d);return p}function H(d,p){d.pendingLanes|=p,p!==268435456&&(d.suspendedLanes=0,d.pingedLanes=0,d.warmLanes=0)}function V(d,p,E,b,D,N){var Q=d.pendingLanes;d.pendingLanes=E,d.suspendedLanes=0,d.pingedLanes=0,d.warmLanes=0,d.expiredLanes&=E,d.entangledLanes&=E,d.errorRecoveryDisabledLanes&=E,d.shellSuspendCounter=0;var K=d.entanglements,Ae=d.expirationTimes,Ne=d.hiddenUpdates;for(E=Q&~E;0<E;){var Ke=31-Ja(E),je=1<<Ke;K[Ke]=0,Ae[Ke]=-1;var nt=Ne[Ke];if(nt!==null)for(Ne[Ke]=null,Ke=0;Ke<nt.length;Ke++){var Ut=nt[Ke];Ut!==null&&(Ut.lane&=-536870913)}E&=~je}b!==0&&ae(d,b,0),N!==0&&D===0&&d.tag!==0&&(d.suspendedLanes|=N&~(Q&~p))}function ae(d,p,E){d.pendingLanes|=p,d.suspendedLanes&=~p;var b=31-Ja(p);d.entangledLanes|=p,d.entanglements[b]=d.entanglements[b]|1073741824|E&261930}function re(d,p){var E=d.entangledLanes|=p;for(d=d.entanglements;E;){var b=31-Ja(E),D=1<<b;D&p|d[b]&p&&(d[b]|=p),E&=~D}}function _e(d,p){var E=p&-p;return E=(E&42)!==0?1:Qe(E),(E&(d.suspendedLanes|p))!==0?0:E}function Qe(d){switch(d){case 2:d=1;break;case 8:d=4;break;case 32:d=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:d=128;break;case 268435456:d=134217728;break;default:d=0}return d}function pt(d){return d&=-d,2<d?8<d?(d&134217727)!==0?32:268435456:8:2}function Ge(d){if(typeof PI=="function"&&_N(d),Vo&&typeof Vo.setStrictMode=="function")try{Vo.setStrictMode(tg,d)}catch{}}function Pt(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}function Tt(d){if(Wh===void 0)try{throw Error()}catch(E){var p=E.stack.trim().match(/\n( *(at )?)/);Wh=p&&p[1]||"",Wa=-1<E.stack.indexOf(`
128
128
  at`)?" (<anonymous>)":-1<E.stack.indexOf("@")?"@unknown:0:0":""}return`
129
129
  `+Wh+d+Wa}function ye(d,p){if(!d||Py)return"";Py=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var b={DetermineComponentFrameRoot:function(){try{if(p){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(Ut){var nt=Ut}Reflect.construct(d,[],je)}else{try{je.call()}catch(Ut){nt=Ut}d.call(je.prototype)}}else{try{throw Error()}catch(Ut){nt=Ut}(je=d())&&typeof je.catch=="function"&&je.catch(function(){})}}catch(Ut){if(Ut&&nt&&typeof Ut.stack=="string")return[Ut.stack,nt.stack]}return[null,null]}};b.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var D=Object.getOwnPropertyDescriptor(b.DetermineComponentFrameRoot,"name");D&&D.configurable&&Object.defineProperty(b.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=b.DetermineComponentFrameRoot(),Q=N[0],K=N[1];if(Q&&K){var Ae=Q.split(`
130
- `),De=K.split(`
131
- `);for(D=b=0;b<Ae.length&&!Ae[b].includes("DetermineComponentFrameRoot");)b++;for(;D<De.length&&!De[D].includes("DetermineComponentFrameRoot");)D++;if(b===Ae.length||D===De.length)for(b=Ae.length-1,D=De.length-1;1<=b&&0<=D&&Ae[b]!==De[D];)D--;for(;1<=b&&0<=D;b--,D--)if(Ae[b]!==De[D]){if(b!==1||D!==1)do if(b--,D--,0>D||Ae[b]!==De[D]){var Ke=`
130
+ `),Ne=K.split(`
131
+ `);for(D=b=0;b<Ae.length&&!Ae[b].includes("DetermineComponentFrameRoot");)b++;for(;D<Ne.length&&!Ne[D].includes("DetermineComponentFrameRoot");)D++;if(b===Ae.length||D===Ne.length)for(b=Ae.length-1,D=Ne.length-1;1<=b&&0<=D&&Ae[b]!==Ne[D];)D--;for(;1<=b&&0<=D;b--,D--)if(Ae[b]!==Ne[D]){if(b!==1||D!==1)do if(b--,D--,0>D||Ae[b]!==Ne[D]){var Ke=`
132
132
  `+Ae[b].replace(" at new "," at ");return d.displayName&&Ke.includes("<anonymous>")&&(Ke=Ke.replace("<anonymous>",d.displayName)),Ke}while(1<=b&&0<=D);break}}}finally{Py=!1,Error.prepareStackTrace=E}return(E=d?d.displayName||d.name:"")?Tt(E):""}function Je(d,p){switch(d.tag){case 26:case 27:case 5:return Tt(d.type);case 16:return Tt("Lazy");case 13:return d.child!==p&&p!==null?Tt("Suspense Fallback"):Tt("Suspense");case 19:return Tt("SuspenseList");case 0:case 15:return ye(d.type,!1);case 11:return ye(d.type.render,!1);case 1:return ye(d.type,!0);case 31:return Tt("Activity");default:return""}}function ot(d){try{var p="",E=null;do p+=Je(d,E),E=d,d=d.return;while(d);return p}catch(b){return`
133
133
  Error generating stack: `+b.message+`
134
- `+b.stack}}function ut(d,p){if(typeof d=="object"&&d!==null){var E=V2.get(d);return E!==void 0?E:(p={value:d,source:p,stack:ot(p)},V2.set(d,p),p)}return{value:d,source:p,stack:ot(p)}}function Lt(d,p){ng[Xh++]=le,ng[Xh++]=li,li=d,le=p}function Gr(d,p,E){Bc[wc++]=Ia,Bc[wc++]=Nd,Bc[wc++]=tf,tf=d;var b=Ia;d=Nd;var D=32-Ja(b)-1;b&=~(1<<D),E+=1;var N=32-Ja(p)+D;if(30<N){var Q=D-D%5;N=(b&(1<<Q)-1).toString(32),b>>=Q,D-=Q,Ia=1<<32-Ja(p)+D|E<<D|b,Nd=N+d}else Ia=1<<N|E<<D|b,Nd=d}function be(d){d.return!==null&&(Lt(d,1),Gr(d,1,0))}function mt(d){for(;d===li;)li=ng[--Xh],ng[Xh]=null,le=ng[--Xh],ng[Xh]=null;for(;d===tf;)tf=Bc[--wc],Bc[wc]=null,Nd=Bc[--wc],Bc[wc]=null,Ia=Bc[--wc],Bc[wc]=null}function en(d,p){Bc[wc++]=Ia,Bc[wc++]=Nd,Bc[wc++]=tf,Ia=p.id,Nd=p.overflow,tf=d}function Tn(d,p){T(dm,p),T(My,d),T(bs,null),d=cq(p),y(bs),T(bs,d)}function yr(){y(bs),y(My),y(dm)}function Us(d){d.memoizedState!==null&&T(LI,d);var p=bs.current,E=o2(p,d.type);p!==E&&(T(My,d),T(bs,E))}function Vn(d){My.current===d&&(y(bs),y(My)),LI.current===d&&(y(LI),Dc?cm._currentValue=ba:cm._currentValue2=ba)}function ar(d){var p=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rt(ut(p,d)),yN}function zt(d,p){if(!ys)throw Error(r(175));qh(d.stateNode,d.type,d.memoizedProps,p,d)||ar(d,!0)}function Mn(d){for(Di=d.return;Di;)switch(Di.tag){case 5:case 31:case 13:Oc=!1;return;case 27:case 3:Oc=!0;return;default:Di=Di.return}}function ft(d){if(!ys||d!==Di)return!1;if(!Un)return Mn(d),Un=!0,!1;var p=d.tag;if(ci?p!==3&&p!==27&&(p!==5||Q2(d.type)&&!vy(d.type,d.memoizedProps))&&ao&&ar(d):p!==3&&(p!==5||Q2(d.type)&&!vy(d.type,d.memoizedProps))&&ao&&ar(d),Mn(d),p===13){if(!ys)throw Error(r(316));if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));ao=O2(d)}else if(p===31){if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));ao=w2(d)}else ao=ci&&p===27?R2(d.type,ao):Di?dN(d.stateNode):null;return!0}function tn(){ys&&(ao=Di=null,Un=!1)}function bn(){var d=nf;return d!==null&&(tu===null?tu=d:tu.push.apply(tu,d),nf=null),d}function Rt(d){nf===null?nf=[d]:nf.push(d)}function Ln(d,p,E){Dc?(T(Bd,p._currentValue),p._currentValue=E):(T(Bd,p._currentValue2),p._currentValue2=E)}function oo(d){var p=Bd.current;Dc?d._currentValue=p:d._currentValue2=p,y(Bd)}function ai(d,p,E){for(;d!==null;){var b=d.alternate;if((d.childLanes&p)!==p?(d.childLanes|=p,b!==null&&(b.childLanes|=p)):b!==null&&(b.childLanes&p)!==p&&(b.childLanes|=p),d===E)break;d=d.return}}function vt(d,p,E,b){var D=d.child;for(D!==null&&(D.return=d);D!==null;){var N=D.dependencies;if(N!==null){var Q=D.child;N=N.firstContext;e:for(;N!==null;){var K=N;N=D;for(var Ae=0;Ae<p.length;Ae++)if(K.context===p[Ae]){N.lanes|=E,K=N.alternate,K!==null&&(K.lanes|=E),ai(N.return,E,d),b||(Q=null);break e}N=K.next}}else if(D.tag===18){if(Q=D.return,Q===null)throw Error(r(341));Q.lanes|=E,N=Q.alternate,N!==null&&(N.lanes|=E),ai(Q,E,d),Q=null}else Q=D.child;if(Q!==null)Q.return=D;else for(Q=D;Q!==null;){if(Q===d){Q=null;break}if(D=Q.sibling,D!==null){D.return=Q.return,Q=D;break}Q=Q.return}D=Q}}function $i(d,p,E,b){d=null;for(var D=p,N=!1;D!==null;){if(!N){if((D.flags&524288)!==0)N=!0;else if((D.flags&262144)!==0)break}if(D.tag===10){var Q=D.alternate;if(Q===null)throw Error(r(387));if(Q=Q.memoizedProps,Q!==null){var K=D.type;Ts(D.pendingProps.value,Q.value)||(d!==null?d.push(K):d=[K])}}else if(D===LI.current){if(Q=D.alternate,Q===null)throw Error(r(387));Q.memoizedState.memoizedState!==D.memoizedState.memoizedState&&(d!==null?d.push(cm):d=[cm])}D=D.return}d!==null&&vt(p,d,E,b),p.flags|=262144}function ms(d){for(d=d.firstContext;d!==null;){var p=d.context;if(!Ts(Dc?p._currentValue:p._currentValue2,d.memoizedValue))return!0;d=d.next}return!1}function xo(d){Ca=d,uo=null,d=d.dependencies,d!==null&&(d.firstContext=null)}function ho(d){return Op(Ca,d)}function Nu(d,p){return Ca===null&&xo(d),Op(d,p)}function Op(d,p){var E=Dc?p._currentValue:p._currentValue2;if(p={context:p,memoizedValue:E,next:null},uo===null){if(d===null)throw Error(r(308));uo=p,d.dependencies={lanes:0,firstContext:p},d.flags|=524288}else uo=uo.next=p;return E}function Jf(){return{controller:new wd,data:new Map,refCount:0}}function Bu(d){d.refCount--,d.refCount===0&&Vs(Tq,function(){d.controller.abort()})}function Ad(){}function Qs(d){d!==Xa&&d.next===null&&(Xa===null?Yo=Xa=d:Xa=Xa.next=d),e_=!0,SN||(SN=!0,Ou())}function wu(d,p){if(!rg&&e_){rg=!0;do for(var E=!1,b=Yo;b!==null;){if(!p)if(d!==0){var D=b.pendingLanes;if(D===0)var N=0;else{var Q=b.suspendedLanes,K=b.pingedLanes;N=(1<<31-Ja(42|d)+1)-1,N&=D&~(Q&~K),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(E=!0,pl(b,N))}else N=Yn,N=x(b,b===Lr?N:0,b.cancelPendingCommit!==null||b.timeoutHandle!==Jp),(N&3)===0||O(b,N)||(E=!0,pl(b,N));b=b.next}while(E);rg=!1}}function gc(){hc()}function hc(){e_=SN=!1;var d=0;Bl!==0&&sN()&&(d=Bl);for(var p=Sr(),E=null,b=Yo;b!==null;){var D=b.next,N=Fs(b,p);N===0?(b.next=null,E===null?Yo=D:E.next=D,D===null&&(Xa=E)):(E=b,(d!==0||(N&3)!==0)&&(e_=!0)),b=D}Cr!==0&&Cr!==5||wu(d,!1),Bl!==0&&(Bl=0)}function Fs(d,p){for(var E=d.suspendedLanes,b=d.pingedLanes,D=d.expirationTimes,N=d.pendingLanes&-62914561;0<N;){var Q=31-Ja(N),K=1<<Q,Ae=D[Q];Ae===-1?((K&E)===0||(K&b)!==0)&&(D[Q]=P(K,p)):Ae<=p&&(d.expiredLanes|=K),N&=~K}if(p=Lr,E=Yn,E=x(d,d===p?E:0,d.cancelPendingCommit!==null||d.timeoutHandle!==Jp),b=d.callbackNode,E===0||d===p&&(Ir===2||Ir===9)||d.cancelPendingCommit!==null)return b!==null&&b!==null&&On(b),d.callbackNode=null,d.callbackPriority=0;if((E&3)===0||O(d,E)){if(p=E&-E,p===d.callbackPriority)return p;switch(b!==null&&On(b),pt(E)){case 2:case 8:E=Xp;break;case 32:E=ef;break;case 268435456:E=Zh;break;default:E=ef}return b=_o.bind(null,d),E=kI(E,b),d.callbackPriority=p,d.callbackNode=E,p}return b!==null&&b!==null&&On(b),d.callbackPriority=2,d.callbackNode=null,2}function _o(d,p){if(Cr!==0&&Cr!==5)return d.callbackNode=null,d.callbackPriority=0,null;var E=d.callbackNode;if(qo()&&d.callbackNode!==E)return null;var b=Yn;return b=x(d,d===Lr?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==Jp),b===0?null:(G1(d,b,p),Fs(d,Sr()),d.callbackNode!=null&&d.callbackNode===E?_o.bind(null,d):null)}function pl(d,p){if(qo())return null;G1(d,p,!0)}function Ou(){p2?xd(function(){(Gn&6)!==0?kI(q2,gc):hc()}):kI(q2,gc)}function L(){if(Bl===0){var d=t_;d===0&&(d=Oy,Oy<<=1,(Oy&261888)===0&&(Oy=256)),Bl=d}return Bl}function ne(d,p){if(Ly===null){var E=Ly=[];TN=0,t_=L(),n_={status:"pending",value:void 0,then:function(b){E.push(b)}}}return TN++,p.then(ve,ve),p}function ve(){if(--TN===0&&Ly!==null){n_!==null&&(n_.status="fulfilled");var d=Ly;Ly=null,t_=0,n_=null;for(var p=0;p<d.length;p++)(0,d[p])()}}function $e(d,p){var E=[],b={status:"pending",value:null,reason:null,then:function(D){E.push(D)}};return d.then(function(){b.status="fulfilled",b.value=p;for(var D=0;D<E.length;D++)(0,E[D])(p)},function(D){for(b.status="rejected",b.reason=D,D=0;D<E.length;D++)(0,E[D])(void 0)}),b}function et(){var d=pm.current;return d!==null?d:Lr.pooledCache}function Ht(d,p){p===null?T(pm,pm.current):T(pm,p.pool)}function xt(){var d=et();return d===null?null:{parent:Dc?Eo._currentValue:Eo._currentValue2,pool:d}}function Fn(d,p){if(Ts(d,p))return!0;if(typeof d!="object"||d===null||typeof p!="object"||p===null)return!1;var E=Object.keys(d),b=Object.keys(p);if(E.length!==b.length)return!1;for(b=0;b<E.length;b++){var D=E[b];if(!EN.call(p,D)||!Ts(d[D],p[D]))return!1}return!0}function pn(d){return d=d.status,d==="fulfilled"||d==="rejected"}function ui(d,p,E){switch(E=d[E],E===void 0?d.push(p):E!==p&&(p.then(Ad,Ad),p=E),p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,fl(d),d;default:if(typeof p.status=="string")p.then(Ad,Ad);else{if(d=Lr,d!==null&&100<d.shellSuspendCounter)throw Error(r(482));d=p,d.status="pending",d.then(function(b){if(p.status==="pending"){var D=p;D.status="fulfilled",D.value=b}},function(b){if(p.status==="pending"){var D=p;D.status="rejected",D.reason=b}})}switch(p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,fl(d),d}throw kc=p,r_}}function Wr(d){try{var p=d._init;return p(d._payload)}catch(E){throw E!==null&&typeof E=="object"&&typeof E.then=="function"?(kc=E,r_):E}}function kp(){if(kc===null)throw Error(r(459));var d=kc;return kc=null,d}function fl(d){if(d===r_||d===FI)throw Error(r(483))}function ga(d){var p=Uy;return Uy+=1,Pc===null&&(Pc=[]),ui(Pc,d,p)}function As(d,p){p=p.props.ref,d.ref=p!==void 0?p:null}function Pp(d,p){throw p.$$typeof===hI?Error(r(525)):(d=Object.prototype.toString.call(p),Error(r(31,d==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":d)))}function z0(d){function p(ce,se){if(d){var fe=ce.deletions;fe===null?(ce.deletions=[se],ce.flags|=16):fe.push(se)}}function E(ce,se){if(!d)return null;for(;se!==null;)p(ce,se),se=se.sibling;return null}function b(ce){for(var se=new Map;ce!==null;)ce.key!==null?se.set(ce.key,ce):se.set(ce.index,ce),ce=ce.sibling;return se}function D(ce,se){return ce=Id(ce,se),ce.index=0,ce.sibling=null,ce}function N(ce,se,fe){return ce.index=fe,d?(fe=ce.alternate,fe!==null?(fe=fe.index,fe<se?(ce.flags|=67108866,se):fe):(ce.flags|=67108866,se)):(ce.flags|=1048576,se)}function Q(ce){return d&&ce.alternate===null&&(ce.flags|=67108866),ce}function K(ce,se,fe,Fe){return se===null||se.tag!==6?(se=yy(fe,ce.mode,Fe),se.return=ce,se):(se=D(se,fe),se.return=ce,se)}function Ae(ce,se,fe,Fe){var Dt=fe.type;return Dt===qA?Ke(ce,se,fe.props.children,Fe,fe.key):se!==null&&(se.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===am&&Wr(Dt)===se.type)?(se=D(se,fe.props),As(se,fe),se.return=ce,se):(se=Ey(fe.type,fe.key,fe.props,null,ce.mode,Fe),As(se,fe),se.return=ce,se)}function De(ce,se,fe,Fe){return se===null||se.tag!==4||se.stateNode.containerInfo!==fe.containerInfo||se.stateNode.implementation!==fe.implementation?(se=mI(fe,ce.mode,Fe),se.return=ce,se):(se=D(se,fe.children||[]),se.return=ce,se)}function Ke(ce,se,fe,Fe,Dt){return se===null||se.tag!==7?(se=Yp(fe,ce.mode,Fe,Dt),se.return=ce,se):(se=D(se,fe),se.return=ce,se)}function je(ce,se,fe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=yy(""+se,ce.mode,fe),se.return=ce,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case Ty:return fe=Ey(se.type,se.key,se.props,null,ce.mode,fe),As(fe,se),fe.return=ce,fe;case sm:return se=mI(se,ce.mode,fe),se.return=ce,se;case am:return se=Wr(se),je(ce,se,fe)}if(um(se)||f(se))return se=Yp(se,ce.mode,fe,null),se.return=ce,se;if(typeof se.then=="function")return je(ce,ga(se),fe);if(se.$$typeof===Kp)return je(ce,Nu(ce,se),fe);Pp(ce,se)}return null}function nt(ce,se,fe,Fe){var Dt=se!==null?se.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Dt!==null?null:K(ce,se,""+fe,Fe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case Ty:return fe.key===Dt?Ae(ce,se,fe,Fe):null;case sm:return fe.key===Dt?De(ce,se,fe,Fe):null;case am:return fe=Wr(fe),nt(ce,se,fe,Fe)}if(um(fe)||f(fe))return Dt!==null?null:Ke(ce,se,fe,Fe,null);if(typeof fe.then=="function")return nt(ce,se,ga(fe),Fe);if(fe.$$typeof===Kp)return nt(ce,se,Nu(ce,fe),Fe);Pp(ce,fe)}return null}function Ut(ce,se,fe,Fe,Dt){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint")return ce=ce.get(fe)||null,K(se,ce,""+Fe,Dt);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case Ty:return ce=ce.get(Fe.key===null?fe:Fe.key)||null,Ae(se,ce,Fe,Dt);case sm:return ce=ce.get(Fe.key===null?fe:Fe.key)||null,De(se,ce,Fe,Dt);case am:return Fe=Wr(Fe),Ut(ce,se,fe,Fe,Dt)}if(um(Fe)||f(Fe))return ce=ce.get(fe)||null,Ke(se,ce,Fe,Dt,null);if(typeof Fe.then=="function")return Ut(ce,se,fe,ga(Fe),Dt);if(Fe.$$typeof===Kp)return Ut(ce,se,fe,Nu(se,Fe),Dt);Pp(se,Fe)}return null}function co(ce,se,fe,Fe){for(var Dt=null,yo=null,$t=se,mr=se=0,Kn=null;$t!==null&&mr<fe.length;mr++){$t.index>mr?(Kn=$t,$t=null):Kn=$t.sibling;var rr=nt(ce,$t,fe[mr],Fe);if(rr===null){$t===null&&($t=Kn);break}d&&$t&&rr.alternate===null&&p(ce,$t),se=N(rr,se,mr),yo===null?Dt=rr:yo.sibling=rr,yo=rr,$t=Kn}if(mr===fe.length)return E(ce,$t),Un&&Lt(ce,mr),Dt;if($t===null){for(;mr<fe.length;mr++)$t=je(ce,fe[mr],Fe),$t!==null&&(se=N($t,se,mr),yo===null?Dt=$t:yo.sibling=$t,yo=$t);return Un&&Lt(ce,mr),Dt}for($t=b($t);mr<fe.length;mr++)Kn=Ut($t,ce,mr,fe[mr],Fe),Kn!==null&&(d&&Kn.alternate!==null&&$t.delete(Kn.key===null?mr:Kn.key),se=N(Kn,se,mr),yo===null?Dt=Kn:yo.sibling=Kn,yo=Kn);return d&&$t.forEach(function(af){return p(ce,af)}),Un&&Lt(ce,mr),Dt}function Ni(ce,se,fe,Fe){if(fe==null)throw Error(r(151));for(var Dt=null,yo=null,$t=se,mr=se=0,Kn=null,rr=fe.next();$t!==null&&!rr.done;mr++,rr=fe.next()){$t.index>mr?(Kn=$t,$t=null):Kn=$t.sibling;var af=nt(ce,$t,rr.value,Fe);if(af===null){$t===null&&($t=Kn);break}d&&$t&&af.alternate===null&&p(ce,$t),se=N(af,se,mr),yo===null?Dt=af:yo.sibling=af,yo=af,$t=Kn}if(rr.done)return E(ce,$t),Un&&Lt(ce,mr),Dt;if($t===null){for(;!rr.done;mr++,rr=fe.next())rr=je(ce,rr.value,Fe),rr!==null&&(se=N(rr,se,mr),yo===null?Dt=rr:yo.sibling=rr,yo=rr);return Un&&Lt(ce,mr),Dt}for($t=b($t);!rr.done;mr++,rr=fe.next())rr=Ut($t,ce,mr,rr.value,Fe),rr!==null&&(d&&rr.alternate!==null&&$t.delete(rr.key===null?mr:rr.key),se=N(rr,se,mr),yo===null?Dt=rr:yo.sibling=rr,yo=rr);return d&&$t.forEach(function(Hy){return p(ce,Hy)}),Un&&Lt(ce,mr),Dt}function ug(ce,se,fe,Fe){if(typeof fe=="object"&&fe!==null&&fe.type===qA&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case Ty:e:{for(var Dt=fe.key;se!==null;){if(se.key===Dt){if(Dt=fe.type,Dt===qA){if(se.tag===7){E(ce,se.sibling),Fe=D(se,fe.props.children),Fe.return=ce,ce=Fe;break e}}else if(se.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===am&&Wr(Dt)===se.type){E(ce,se.sibling),Fe=D(se,fe.props),As(Fe,fe),Fe.return=ce,ce=Fe;break e}E(ce,se);break}else p(ce,se);se=se.sibling}fe.type===qA?(Fe=Yp(fe.props.children,ce.mode,Fe,fe.key),Fe.return=ce,ce=Fe):(Fe=Ey(fe.type,fe.key,fe.props,null,ce.mode,Fe),As(Fe,fe),Fe.return=ce,ce=Fe)}return Q(ce);case sm:e:{for(Dt=fe.key;se!==null;){if(se.key===Dt)if(se.tag===4&&se.stateNode.containerInfo===fe.containerInfo&&se.stateNode.implementation===fe.implementation){E(ce,se.sibling),Fe=D(se,fe.children||[]),Fe.return=ce,ce=Fe;break e}else{E(ce,se);break}else p(ce,se);se=se.sibling}Fe=mI(fe,ce.mode,Fe),Fe.return=ce,ce=Fe}return Q(ce);case am:return fe=Wr(fe),ug(ce,se,fe,Fe)}if(um(fe))return co(ce,se,fe,Fe);if(f(fe)){if(Dt=f(fe),typeof Dt!="function")throw Error(r(150));return fe=Dt.call(fe),Ni(ce,se,fe,Fe)}if(typeof fe.then=="function")return ug(ce,se,ga(fe),Fe);if(fe.$$typeof===Kp)return ug(ce,se,Nu(ce,fe),Fe);Pp(ce,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,se!==null&&se.tag===6?(E(ce,se.sibling),Fe=D(se,fe),Fe.return=ce,ce=Fe):(E(ce,se),Fe=yy(fe,ce.mode,Fe),Fe.return=ce,ce=Fe),Q(ce)):E(ce,se)}return function(ce,se,fe,Fe){try{Uy=0;var Dt=ug(ce,se,fe,Fe);return Pc=null,Dt}catch($t){if($t===r_||$t===FI)throw $t;var yo=t(29,$t,null,ce.mode);return yo.lanes=Fe,yo.return=ce,yo}}}function Dr(){for(var d=wl,p=bN=wl=0;p<d;){var E=Mc[p];Mc[p++]=null;var b=Mc[p];Mc[p++]=null;var D=Mc[p];Mc[p++]=null;var N=Mc[p];if(Mc[p++]=null,b!==null&&D!==null){var Q=b.pending;Q===null?D.next=D:(D.next=Q.next,Q.next=D),b.pending=D}N!==0&&gd(E,D,N)}}function _c(d,p,E,b){Mc[wl++]=d,Mc[wl++]=p,Mc[wl++]=E,Mc[wl++]=b,bN|=b,d.lanes|=b,d=d.alternate,d!==null&&(d.lanes|=b)}function qa(d,p,E,b){return _c(d,p,E,b),ml(d)}function Ec(d,p){return _c(d,null,null,p),ml(d)}function gd(d,p,E){d.lanes|=E;var b=d.alternate;b!==null&&(b.lanes|=E);for(var D=!1,N=d.return;N!==null;)N.childLanes|=E,b=N.alternate,b!==null&&(b.childLanes|=E),N.tag===22&&(d=N.stateNode,d===null||d._visibility&1||(D=!0)),d=N,N=N.return;return d.tag===3?(N=d.stateNode,D&&p!==null&&(D=31-Ja(E),d=N.hiddenUpdates,b=d[D],b===null?d[D]=[p]:b.push(p),p.lane=E|536870912),N):null}function ml(d){if(50<c_)throw c_=0,oC=null,Error(r(185));for(var p=d.return;p!==null;)d=p,p=d.return;return d.tag===3?d.stateNode:null}function Mp(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lp(d,p){d=d.updateQueue,p.updateQueue===d&&(p.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,callbacks:null})}function ha(d){return{lane:d,tag:0,payload:null,callback:null,next:null}}function yc(d,p,E){var b=d.updateQueue;if(b===null)return null;if(b=b.shared,(Gn&2)!==0){var D=b.pending;return D===null?p.next=p:(p.next=D.next,D.next=p),b.pending=p,p=ml(d),gd(d,null,E),p}return _c(d,b,p,E),ml(d)}function UA(d,p,E){if(p=p.updateQueue,p!==null&&(p=p.shared,(E&4194048)!==0)){var b=p.lanes;b&=d.pendingLanes,E|=b,p.lanes=E,re(d,E)}}function H0(d,p){var E=d.updateQueue,b=d.alternate;if(b!==null&&(b=b.updateQueue,E===b)){var D=null,N=null;if(E=E.firstBaseUpdate,E!==null){do{var Q={lane:E.lane,tag:E.tag,payload:E.payload,callback:null,next:null};N===null?D=N=Q:N=N.next=Q,E=E.next}while(E!==null);N===null?D=N=p:N=N.next=p}else D=N=p;E={baseState:b.baseState,firstBaseUpdate:D,lastBaseUpdate:N,shared:b.shared,callbacks:b.callbacks},d.updateQueue=E;return}d=E.lastBaseUpdate,d===null?E.firstBaseUpdate=p:d.next=p,E.lastBaseUpdate=p}function Zf(){if(IN){var d=n_;if(d!==null)throw d}}function Up(d,p,E,b){IN=!1;var D=d.updateQueue;fm=!1;var N=D.firstBaseUpdate,Q=D.lastBaseUpdate,K=D.shared.pending;if(K!==null){D.shared.pending=null;var Ae=K,De=Ae.next;Ae.next=null,Q===null?N=De:Q.next=De,Q=Ae;var Ke=d.alternate;Ke!==null&&(Ke=Ke.updateQueue,K=Ke.lastBaseUpdate,K!==Q&&(K===null?Ke.firstBaseUpdate=De:K.next=De,Ke.lastBaseUpdate=Ae))}if(N!==null){var je=D.baseState;Q=0,Ke=De=Ae=null,K=N;do{var nt=K.lane&-536870913,Ut=nt!==K.lane;if(Ut?(Yn&nt)===nt:(b&nt)===nt){nt!==0&&nt===t_&&(IN=!0),Ke!==null&&(Ke=Ke.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var co=d,Ni=K;nt=p;var ug=E;switch(Ni.tag){case 1:if(co=Ni.payload,typeof co=="function"){je=co.call(ug,je,nt);break e}je=co;break e;case 3:co.flags=co.flags&-65537|128;case 0:if(co=Ni.payload,nt=typeof co=="function"?co.call(ug,je,nt):co,nt==null)break e;je=Pu({},je,nt);break e;case 2:fm=!0}}nt=K.callback,nt!==null&&(d.flags|=64,Ut&&(d.flags|=8192),Ut=D.callbacks,Ut===null?D.callbacks=[nt]:Ut.push(nt))}else Ut={lane:nt,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Ke===null?(De=Ke=Ut,Ae=je):Ke=Ke.next=Ut,Q|=nt;if(K=K.next,K===null){if(K=D.shared.pending,K===null)break;Ut=K,K=Ut.next,Ut.next=null,D.lastBaseUpdate=Ut,D.shared.pending=null}}while(!0);Ke===null&&(Ae=je),D.baseState=Ae,D.firstBaseUpdate=De,D.lastBaseUpdate=Ke,N===null&&(D.shared.lanes=0),gm|=Q,d.lanes=Q,d.memoizedState=je}}function $0(d,p){if(typeof d!="function")throw Error(r(191,d));d.call(p)}function xb(d,p){var E=d.callbacks;if(E!==null)for(d.callbacks=null,d=0;d<E.length;d++)$0(E[d],p)}function it(d,p){d=of,T(jI,d),T(Od,p),of=d|p.baseLanes}function hd(){T(jI,of),T(Od,Od.current)}function Al(){of=jI.current,y(Od),y(jI)}function gl(d){var p=d.alternate;T(Ko,Ko.current&1),T(Lu,d),Lc===null&&(p===null||Od.current!==null||p.memoizedState!==null)&&(Lc=d)}function Qp(d){T(Ko,Ko.current),T(Lu,d),Lc===null&&(Lc=d)}function Sc(d){d.tag===22?(T(Ko,Ko.current),T(Lu,d),Lc===null&&(Lc=d)):Tc(d)}function Tc(){T(Ko,Ko.current),T(Lu,Lu.current)}function Ri(d){y(Lu),Lc===d&&(Lc=null),y(Ko)}function hl(d){for(var p=d;p!==null;){if(p.tag===13){var E=p.memoizedState;if(E!==null&&(E=E.dehydrated,E===null||Ny(E)||By(E)))return p}else if(p.tag===19&&(p.memoizedProps.revealOrder==="forwards"||p.memoizedProps.revealOrder==="backwards"||p.memoizedProps.revealOrder==="unstable_legacy-backwards"||p.memoizedProps.revealOrder==="together")){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}function Xr(){throw Error(r(321))}function bc(d,p){if(p===null)return!1;for(var E=0;E<p.length&&E<d.length;E++)if(!Ts(d[E],p[E]))return!1;return!0}function Fp(d,p,E,b,D,N){return rf=N,gn=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,It.H=d===null||d.memoizedState===null?K2:CN,ig=!1,N=E(b,D),ig=!1,o_&&(N=Gp(p,E,b,D)),Gs(d),N}function Gs(d){It.H=Qy;var p=Nr!==null&&Nr.next!==null;if(rf=0,di=Nr=gn=null,zI=!1,i_=0,s_=null,p)throw Error(r(300));d===null||pi||(d=d.dependencies,d!==null&&ms(d)&&(pi=!0))}function Gp(d,p,E,b){gn=d;var D=0;do{if(o_&&(s_=null),i_=0,o_=!1,25<=D)throw Error(r(301));if(D+=1,di=Nr=null,d.updateQueue!=null){var N=d.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}It.H=J2,N=p(E,b)}while(o_);return N}function QA(){var d=It.H,p=d.useState()[0];return p=typeof p.then=="function"?xe(p):p,d=d.useState()[0],(Nr!==null?Nr.memoizedState:null)!==d&&(gn.flags|=1024),p}function U(){var d=HI!==0;return HI=0,d}function F(d,p,E){p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~E}function Y(d){if(zI){for(d=d.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}zI=!1}rf=0,di=Nr=gn=null,o_=!1,i_=HI=0,s_=null}function X(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return di===null?gn.memoizedState=di=d:di=di.next=d,di}function te(){if(Nr===null){var d=gn.alternate;d=d!==null?d.memoizedState:null}else d=Nr.next;var p=di===null?gn.memoizedState:di.next;if(p!==null)di=p,Nr=d;else{if(d===null)throw gn.alternate===null?Error(r(467)):Error(r(310));Nr=d,d={memoizedState:Nr.memoizedState,baseState:Nr.baseState,baseQueue:Nr.baseQueue,queue:Nr.queue,next:null},di===null?gn.memoizedState=di=d:di=di.next=d}return di}function Se(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xe(d){var p=i_;return i_+=1,s_===null&&(s_=[]),d=ui(s_,d,p),p=gn,(di===null?p.memoizedState:di.next)===null&&(p=p.alternate,It.H=p===null||p.memoizedState===null?K2:CN),d}function Te(d){if(d!==null&&typeof d=="object"){if(typeof d.then=="function")return xe(d);if(d.$$typeof===Kp)return ho(d)}throw Error(r(438,String(d)))}function Ve(d){var p=null,E=gn.updateQueue;if(E!==null&&(p=E.memoCache),p==null){var b=gn.alternate;b!==null&&(b=b.updateQueue,b!==null&&(b=b.memoCache,b!=null&&(p={data:b.data.map(function(D){return D.slice()}),index:0})))}if(p==null&&(p={data:[],index:0}),E===null&&(E=Se(),gn.updateQueue=E),E.memoCache=p,E=p.data[p.index],E===void 0)for(E=p.data[p.index]=Array(d),b=0;b<d;b++)E[b]=Cd;return p.index++,E}function Pe(d,p){return typeof p=="function"?p(d):p}function Ze(d){var p=te();return _t(p,Nr,d)}function _t(d,p,E){var b=d.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=E;var D=d.baseQueue,N=b.pending;if(N!==null){if(D!==null){var Q=D.next;D.next=N.next,N.next=Q}p.baseQueue=D=N,b.pending=null}if(N=d.baseState,D===null)d.memoizedState=N;else{p=D.next;var K=Q=null,Ae=null,De=p,Ke=!1;do{var je=De.lane&-536870913;if(je!==De.lane?(Yn&je)===je:(rf&je)===je){var nt=De.revertLane;if(nt===0)Ae!==null&&(Ae=Ae.next={lane:0,revertLane:0,gesture:null,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null}),je===t_&&(Ke=!0);else if((rf&nt)===nt){De=De.next,nt===t_&&(Ke=!0);continue}else je={lane:0,revertLane:De.revertLane,gesture:null,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null},Ae===null?(K=Ae=je,Q=N):Ae=Ae.next=je,gn.lanes|=nt,gm|=nt;je=De.action,ig&&E(N,je),N=De.hasEagerState?De.eagerState:E(N,je)}else nt={lane:je,revertLane:De.revertLane,gesture:De.gesture,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null},Ae===null?(K=Ae=nt,Q=N):Ae=Ae.next=nt,gn.lanes|=je,gm|=je;De=De.next}while(De!==null&&De!==p);if(Ae===null?Q=N:Ae.next=K,!Ts(N,d.memoizedState)&&(pi=!0,Ke&&(E=n_,E!==null)))throw E;d.memoizedState=N,d.baseState=Q,d.baseQueue=Ae,b.lastRenderedState=N}return D===null&&(b.lanes=0),[d.memoizedState,b.dispatch]}function In(d){var p=te(),E=p.queue;if(E===null)throw Error(r(311));E.lastRenderedReducer=d;var b=E.dispatch,D=E.pending,N=p.memoizedState;if(D!==null){E.pending=null;var Q=D=D.next;do N=d(N,Q.action),Q=Q.next;while(Q!==D);Ts(N,p.memoizedState)||(pi=!0),p.memoizedState=N,p.baseQueue===null&&(p.baseState=N),E.lastRenderedState=N}return[N,b]}function dr(d,p,E){var b=gn,D=te(),N=Un;if(N){if(E===void 0)throw Error(r(407));E=E()}else E=p();var Q=!Ts((Nr||D).memoizedState,E);if(Q&&(D.memoizedState=E,pi=!0),D=D.queue,Nb(gs.bind(null,b,D,d),[d]),D.getSnapshot!==p||Q||di!==null&&di.memoizedState.tag&1){if(b.flags|=2048,Ea(9,{destroy:void 0},io.bind(null,b,D,E,p),null),Lr===null)throw Error(r(349));N||(rf&127)!==0||pr(b,p,E)}return E}function pr(d,p,E){d.flags|=16384,d={getSnapshot:p,value:E},p=gn.updateQueue,p===null?(p=Se(),gn.updateQueue=p,p.stores=[d]):(E=p.stores,E===null?p.stores=[d]:E.push(d))}function io(d,p,E,b){p.value=E,p.getSnapshot=b,Ic(p)&&_a(d)}function gs(d,p,E){return E(function(){Ic(p)&&_a(d)})}function Ic(d){var p=d.getSnapshot;d=d.value;try{var E=p();return!Ts(d,E)}catch{return!0}}function _a(d){var p=Ec(d,2);p!==null&&Sa(p,d,2)}function qi(d){var p=X();if(typeof d=="function"){var E=d;if(d=E(),ig){Ge(!0);try{E()}finally{Ge(!1)}}}return p.memoizedState=p.baseState=d,p.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pe,lastRenderedState:d},p}function hs(d,p,E,b){return d.baseState=E,_t(d,Nr,typeof b=="function"?b:Pe)}function _d(d,p,E,b,D){if(Xf(d))throw Error(r(485));if(d=p.action,d!==null){var N={payload:D,action:d,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Q){N.listeners.push(Q)}};It.T!==null?E(!0):N.isTransition=!1,b(N),E=p.pending,E===null?(N.next=p.pending=N,_l(p,N)):(N.next=E.next,p.pending=E.next=N)}}function _l(d,p){var E=p.action,b=p.payload,D=d.state;if(p.isTransition){var N=It.T,Q={};It.T=Q;try{var K=E(D,b),Ae=It.S;Ae!==null&&Ae(Q,K),El(d,p,K)}catch(De){q0(d,p,De)}finally{N!==null&&Q.types!==null&&(N.types=Q.types),It.T=N}}else try{N=E(D,b),El(d,p,N)}catch(De){q0(d,p,De)}}function El(d,p,E){E!==null&&typeof E=="object"&&typeof E.then=="function"?E.then(function(b){yl(d,p,b)},function(b){return q0(d,p,b)}):yl(d,p,E)}function yl(d,p,E){p.status="fulfilled",p.value=E,Db(p),d.state=E,p=d.pending,p!==null&&(E=p.next,E===p?d.pending=null:(E=E.next,p.next=E,_l(d,E)))}function q0(d,p,E){var b=d.pending;if(d.pending=null,b!==null){b=b.next;do p.status="rejected",p.reason=E,Db(p),p=p.next;while(p!==b)}d.action=null}function Db(d){d=d.listeners;for(var p=0;p<d.length;p++)(0,d[p])()}function _1(d,p){return p}function Sl(d,p){if(Un){var E=Lr.formState;if(E!==null){e:{var b=gn;if(Un){if(ao){var D=C2(ao,Oc);if(D){ao=dN(D),b=v2(D);break e}}ar(b)}b=!1}b&&(p=E[0])}}E=X(),E.memoizedState=E.baseState=p,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_1,lastRenderedState:p},E.queue=b,E=Mb.bind(null,gn,b),b.dispatch=E,b=qi(!1);var N=wh.bind(null,gn,!1,b.queue);return b=X(),D={state:p,dispatch:null,action:d,pending:null},b.queue=D,E=_d.bind(null,gn,D,N,E),D.dispatch=E,b.memoizedState=d,[p,E,!1]}function E1(d){var p=te();return Tl(p,Nr,d)}function Tl(d,p,E){if(p=_t(d,p,_1)[0],d=Ze(Pe)[0],typeof p=="object"&&p!==null&&typeof p.then=="function")try{var b=xe(p)}catch(Q){throw Q===r_?FI:Q}else b=p;p=te();var D=p.queue,N=D.dispatch;return E!==p.memoizedState&&(gn.flags|=2048,Ea(9,{destroy:void 0},V0.bind(null,D,E),null)),[b,N,d]}function V0(d,p){d.action=p}function Y0(d){var p=te(),E=Nr;if(E!==null)return Tl(p,E,d);te(),p=p.memoizedState,E=te();var b=E.queue.dispatch;return E.memoizedState=d,[p,b,!1]}function Ea(d,p,E,b){return d={tag:d,create:E,deps:b,inst:p,next:null},p=gn.updateQueue,p===null&&(p=Se(),gn.updateQueue=p),E=p.lastEffect,E===null?p.lastEffect=d.next=d:(b=E.next,E.next=d,d.next=b,p.lastEffect=d),d}function FA(){return te().memoizedState}function K0(d,p,E,b){var D=X();gn.flags|=d,D.memoizedState=Ea(1|p,{destroy:void 0},E,b===void 0?null:b)}function Bh(d,p,E,b){var D=te();b=b===void 0?null:b;var N=D.memoizedState.inst;Nr!==null&&b!==null&&bc(b,Nr.memoizedState.deps)?D.memoizedState=Ea(p,N,E,b):(gn.flags|=d,D.memoizedState=Ea(1|p,N,E,b))}function y1(d,p){K0(8390656,8,d,p)}function Nb(d,p){Bh(2048,8,d,p)}function jM(d){gn.flags|=4;var p=gn.updateQueue;if(p===null)p=Se(),gn.updateQueue=p,p.events=[d];else{var E=p.events;E===null?p.events=[d]:E.push(d)}}function Bb(d){var p=te().memoizedState;return jM({ref:p,nextImpl:d}),function(){if((Gn&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}function S1(d,p){return Bh(4,2,d,p)}function wb(d,p){return Bh(4,4,d,p)}function zM(d,p){if(typeof p=="function"){d=d();var E=p(d);return function(){typeof E=="function"?E():p(null)}}if(p!=null)return d=d(),p.current=d,function(){p.current=null}}function T1(d,p,E){E=E!=null?E.concat([d]):null,Bh(4,4,zM.bind(null,p,d),E)}function b1(){}function Ob(d,p){var E=te();p=p===void 0?null:p;var b=E.memoizedState;return p!==null&&bc(p,b[1])?b[0]:(E.memoizedState=[d,p],d)}function J0(d,p){var E=te();p=p===void 0?null:p;var b=E.memoizedState;if(p!==null&&bc(p,b[1]))return b[0];if(b=d(),ig){Ge(!0);try{d()}finally{Ge(!1)}}return E.memoizedState=[b,p],b}function kb(d,p,E){return E===void 0||(rf&1073741824)!==0&&(Yn&261930)===0?d.memoizedState=p:(d.memoizedState=E,d=my(),gn.lanes|=d,gm|=d,E)}function Z0(d,p,E,b){return Ts(E,p)?E:Od.current!==null?(d=kb(d,E,b),Ts(d,p)||(pi=!0),d):(rf&42)===0||(rf&1073741824)!==0&&(Yn&261930)===0?(pi=!0,d.memoizedState=E):(d=my(),gn.lanes|=d,gm|=d,p)}function I1(d,p,E,b,D){var N=Rd();xi(N!==0&&8>N?N:8);var Q=It.T,K={};It.T=K,wh(d,!1,p,E);try{var Ae=D(),De=It.S;if(De!==null&&De(K,Ae),Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"){var Ke=$e(Ae,b);Wf(d,p,Ke,Ka(d))}else Wf(d,p,b,Ka(d))}catch(je){Wf(d,p,{then:function(){},status:"rejected",reason:je},Ka())}finally{xi(N),Q!==null&&K.types!==null&&(Q.types=K.types),It.T=Q}}function C1(d){var p=d.memoizedState;if(p!==null)return p;p={memoizedState:ba,baseState:ba,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pe,lastRenderedState:ba},next:null};var E={};return p.next={memoizedState:E,baseState:E,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pe,lastRenderedState:E},next:null},d.memoizedState=p,d=d.alternate,d!==null&&(d.memoizedState=p),p}function Pb(){return ho(cm)}function jp(){return te().memoizedState}function v1(){return te().memoizedState}function HM(d){for(var p=d.return;p!==null;){switch(p.tag){case 24:case 3:var E=Ka();d=ha(E);var b=yc(p,d,E);b!==null&&(Sa(b,p,E),UA(b,p,E)),p={cache:Jf()},d.payload=p;return}p=p.return}}function _s(d,p,E){var b=Ka();E={lane:b,revertLane:0,gesture:null,action:E,hasEagerState:!1,eagerState:null,next:null},Xf(d)?R1(p,E):(E=qa(d,p,E,b),E!==null&&(Sa(E,d,b),W0(E,p,b)))}function Mb(d,p,E){var b=Ka();Wf(d,p,E,b)}function Wf(d,p,E,b){var D={lane:b,revertLane:0,gesture:null,action:E,hasEagerState:!1,eagerState:null,next:null};if(Xf(d))R1(p,D);else{var N=d.alternate;if(d.lanes===0&&(N===null||N.lanes===0)&&(N=p.lastRenderedReducer,N!==null))try{var Q=p.lastRenderedState,K=N(Q,E);if(D.hasEagerState=!0,D.eagerState=K,Ts(K,Q))return _c(d,p,D,0),Lr===null&&Dr(),!1}catch{}if(E=qa(d,p,D,b),E!==null)return Sa(E,d,b),W0(E,p,b),!0}return!1}function wh(d,p,E,b){if(b={lane:2,revertLane:L(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},Xf(d)){if(p)throw Error(r(479))}else p=qa(d,E,b,2),p!==null&&Sa(p,d,2)}function Xf(d){var p=d.alternate;return d===gn||p!==null&&p===gn}function R1(d,p){o_=zI=!0;var E=d.pending;E===null?p.next=p:(p.next=E.next,E.next=p),d.pending=p}function W0(d,p,E){if((E&4194048)!==0){var b=p.lanes;b&=d.pendingLanes,E|=b,p.lanes=E,re(d,E)}}function Lb(d,p,E,b){p=d.memoizedState,E=E(b,p),E=E==null?p:Pu({},p,E),d.memoizedState=E,d.lanes===0&&(d.updateQueue.baseState=E)}function X0(d,p,E,b,D,N,Q){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(b,N,Q):p.prototype&&p.prototype.isPureReactComponent?!Fn(E,b)||!Fn(D,N):!0}function x1(d,p,E,b){d=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(E,b),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(E,b),p.state!==d&&$I.enqueueReplaceState(p,p.state,null)}function Ed(d,p){var E=p;if("ref"in p){E={};for(var b in p)b!=="ref"&&(E[b]=p[b])}if(d=d.defaultProps){E===p&&(E=Pu({},E));for(var D in d)E[D]===void 0&&(E[D]=d[D])}return E}function ey(d,p){try{var E=d.onUncaughtError;E(p.value,{componentStack:p.stack})}catch(b){setTimeout(function(){throw b})}}function D1(d,p,E){try{var b=d.onCaughtError;b(E.value,{componentStack:E.stack,errorBoundary:p.tag===1?p.stateNode:null})}catch(D){setTimeout(function(){throw D})}}function Oh(d,p,E){return E=ha(E),E.tag=3,E.payload={element:null},E.callback=function(){ey(d,p)},E}function ty(d){return d=ha(d),d.tag=3,d}function Ub(d,p,E,b){var D=E.type.getDerivedStateFromError;if(typeof D=="function"){var N=b.value;d.payload=function(){return D(N)},d.callback=function(){D1(p,E,b)}}var Q=E.stateNode;Q!==null&&typeof Q.componentDidCatch=="function"&&(d.callback=function(){D1(p,E,b),typeof D!="function"&&(hm===null?hm=new Set([this]):hm.add(this));var K=b.stack;this.componentDidCatch(b.value,{componentStack:K!==null?K:""})})}function js(d,p,E,b,D){if(E.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){if(p=E.alternate,p!==null&&$i(p,E,D,!0),E=Lu.current,E!==null){switch(E.tag){case 31:case 13:return Lc===null?Gh():E.alternate===null&&No===0&&(No=3),E.flags&=-257,E.flags|=65536,E.lanes=D,b===GI?E.flags|=16384:(p=E.updateQueue,p===null?E.updateQueue=new Set([b]):p.add(b),lI(d,b,D)),!1;case 22:return E.flags|=65536,b===GI?E.flags|=16384:(p=E.updateQueue,p===null?(p={transitions:null,markerInstances:null,retryQueue:new Set([b])},E.updateQueue=p):(E=p.retryQueue,E===null?p.retryQueue=new Set([b]):E.add(b)),lI(d,b,D)),!1}throw Error(r(435,E.tag))}return lI(d,b,D),Gh(),!1}if(Un)return p=Lu.current,p!==null?((p.flags&65536)===0&&(p.flags|=256),p.flags|=65536,p.lanes=D,b!==yN&&(d=Error(r(422),{cause:b}),Rt(ut(d,E)))):(b!==yN&&(p=Error(r(423),{cause:b}),Rt(ut(p,E))),d=d.current.alternate,d.flags|=65536,D&=-D,d.lanes|=D,b=ut(b,E),D=Oh(d.stateNode,b,D),H0(d,D),No!==4&&(No=2)),!1;var N=Error(r(520),{cause:b});if(N=ut(N,E),jy===null?jy=[N]:jy.push(N),No!==4&&(No=2),p===null)return!0;b=ut(b,E),E=p;do{switch(E.tag){case 3:return E.flags|=65536,d=D&-D,E.lanes|=d,d=Oh(E.stateNode,b,d),H0(E,d),!1;case 1:if(p=E.type,N=E.stateNode,(E.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(hm===null||!hm.has(N))))return E.flags|=65536,D&=-D,E.lanes|=D,D=ty(D),Ub(D,d,E,b),H0(E,D),!1}E=E.return}while(E!==null);return!1}function Vi(d,p,E,b){p.child=d===null?Y2(p,null,E,b):og(p,d.child,E,b)}function ny(d,p,E,b,D){E=E.render;var N=p.ref;if("ref"in b){var Q={};for(var K in b)K!=="ref"&&(Q[K]=b[K])}else Q=b;return xo(p),b=Fp(d,p,E,Q,N,D),K=U(),d!==null&&!pi?(F(d,p,D),Va(d,p,D)):(Un&&K&&be(p),p.flags|=1,Vi(d,p,b,D),p.child)}function Qb(d,p,E,b,D){if(d===null){var N=E.type;return typeof N=="function"&&!_y(N)&&N.defaultProps===void 0&&E.compare===null?(p.tag=15,p.type=N,Fb(d,p,N,b,D)):(d=Ey(E.type,null,b,p,p.mode,D),d.ref=p.ref,d.return=p,p.child=d)}if(N=d.child,!Mh(d,D)){var Q=N.memoizedProps;if(E=E.compare,E=E!==null?E:Fn,E(Q,b)&&d.ref===p.ref)return Va(d,p,D)}return p.flags|=1,d=Id(N,b),d.ref=p.ref,d.return=p,p.child=d}function Fb(d,p,E,b,D){if(d!==null){var N=d.memoizedProps;if(Fn(N,b)&&d.ref===p.ref)if(pi=!1,p.pendingProps=b=N,Mh(d,D))(d.flags&131072)!==0&&(pi=!0);else return p.lanes=d.lanes,Va(d,p,D)}return N1(d,p,E,b,D)}function zp(d,p,E,b){var D=b.children,N=d!==null?d.memoizedState:null;if(d===null&&p.stateNode===null&&(p.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),b.mode==="hidden"){if((p.flags&128)!==0){if(N=N!==null?N.baseLanes|E:E,d!==null){for(b=p.child=d.child,D=0;b!==null;)D=D|b.lanes|b.childLanes,b=b.sibling;b=D&~N}else b=0,p.child=null;return kh(d,p,N,E,b)}if((E&536870912)!==0)p.memoizedState={baseLanes:0,cachePool:null},d!==null&&Ht(p,N!==null?N.cachePool:null),N!==null?it(p,N):hd(),Sc(p);else return b=p.lanes=536870912,kh(d,p,N!==null?N.baseLanes|E:E,E,b)}else N!==null?(Ht(p,N.cachePool),it(p,N),Tc(p),p.memoizedState=null):(d!==null&&Ht(p,null),hd(),Tc(p));return Vi(d,p,D,E),p.child}function Cc(d,p){return d!==null&&d.tag===22||p.stateNode!==null||(p.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.sibling}function kh(d,p,E,b,D){var N=et();return N=N===null?null:{parent:Dc?Eo._currentValue:Eo._currentValue2,pool:N},p.memoizedState={baseLanes:E,cachePool:N},d!==null&&Ht(p,null),hd(),Sc(p),d!==null&&$i(d,p,b,!0),p.childLanes=D,null}function GA(d,p){return p=bl({mode:p.mode,children:p.children},d.mode),p.ref=d.ref,d.child=p,p.return=d,p}function Ph(d,p,E){return og(p,d.child,null,E),d=GA(p,p.pendingProps),d.flags|=2,Ri(p),p.memoizedState=null,d}function ry(d,p,E){var b=p.pendingProps,D=(p.flags&128)!==0;if(p.flags&=-129,d===null){if(Un){if(b.mode==="hidden")return d=GA(p,b),p.lanes=536870912,Cc(null,d);if(Qp(p),(d=ao)?(d=N2(d,Oc),d!==null&&(p.memoizedState={dehydrated:d,treeContext:tf!==null?{id:Ia,overflow:Nd}:null,retryLane:536870912,hydrationErrors:null},E=fI(d),E.return=p,p.child=E,Di=p,ao=null)):d=null,d===null)throw ar(p);return p.lanes=536870912,null}return GA(p,b)}var N=d.memoizedState;if(N!==null){var Q=N.dehydrated;if(Qp(p),D)if(p.flags&256)p.flags&=-257,p=Ph(d,p,E);else if(p.memoizedState!==null)p.child=d.child,p.flags|=128,p=null;else throw Error(r(558));else if(pi||$i(d,p,E,!1),D=(E&d.childLanes)!==0,pi||D){if(b=Lr,b!==null&&(Q=_e(b,E),Q!==0&&Q!==N.retryLane))throw N.retryLane=Q,Ec(d,Q),Sa(b,d,Q),qI;Gh(),p=Ph(d,p,E)}else d=N.treeContext,ys&&(ao=pN(Q),Di=p,Un=!0,nf=null,Oc=!1,d!==null&&en(p,d)),p=GA(p,b),p.flags|=4096;return p}return d=Id(d.child,{mode:b.mode,children:b.children}),d.ref=p.ref,p.child=d,d.return=p,d}function oy(d,p){var E=p.ref;if(E===null)d!==null&&d.ref!==null&&(p.flags|=4194816);else{if(typeof E!="function"&&typeof E!="object")throw Error(r(284));(d===null||d.ref!==E)&&(p.flags|=4194816)}}function N1(d,p,E,b,D){return xo(p),E=Fp(d,p,E,b,void 0,D),b=U(),d!==null&&!pi?(F(d,p,D),Va(d,p,D)):(Un&&b&&be(p),p.flags|=1,Vi(d,p,E,D),p.child)}function B1(d,p,E,b,D,N){return xo(p),p.updateQueue=null,E=Gp(p,b,E,D),Gs(d),b=U(),d!==null&&!pi?(F(d,p,N),Va(d,p,N)):(Un&&b&&be(p),p.flags|=1,Vi(d,p,E,N),p.child)}function w1(d,p,E,b,D){if(xo(p),p.stateNode===null){var N=eg,Q=E.contextType;typeof Q=="object"&&Q!==null&&(N=ho(Q)),N=new E(b,N),p.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=$I,p.stateNode=N,N._reactInternals=p,N=p.stateNode,N.props=b,N.state=p.memoizedState,N.refs={},Mp(p),Q=E.contextType,N.context=typeof Q=="object"&&Q!==null?ho(Q):eg,N.state=p.memoizedState,Q=E.getDerivedStateFromProps,typeof Q=="function"&&(Lb(p,E,Q,b),N.state=p.memoizedState),typeof E.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(Q=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),Q!==N.state&&$I.enqueueReplaceState(N,N.state,null),Up(p,b,N,D),Zf(),N.state=p.memoizedState),typeof N.componentDidMount=="function"&&(p.flags|=4194308),b=!0}else if(d===null){N=p.stateNode;var K=p.memoizedProps,Ae=Ed(E,K);N.props=Ae;var De=N.context,Ke=E.contextType;Q=eg,typeof Ke=="object"&&Ke!==null&&(Q=ho(Ke));var je=E.getDerivedStateFromProps;Ke=typeof je=="function"||typeof N.getSnapshotBeforeUpdate=="function",K=p.pendingProps!==K,Ke||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(K||De!==Q)&&x1(p,N,b,Q),fm=!1;var nt=p.memoizedState;N.state=nt,Up(p,b,N,D),Zf(),De=p.memoizedState,K||nt!==De||fm?(typeof je=="function"&&(Lb(p,E,je,b),De=p.memoizedState),(Ae=fm||X0(p,E,Ae,b,nt,De,Q))?(Ke||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(p.flags|=4194308)):(typeof N.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=b,p.memoizedState=De),N.props=b,N.state=De,N.context=Q,b=Ae):(typeof N.componentDidMount=="function"&&(p.flags|=4194308),b=!1)}else{N=p.stateNode,Lp(d,p),Q=p.memoizedProps,Ke=Ed(E,Q),N.props=Ke,je=p.pendingProps,nt=N.context,De=E.contextType,Ae=eg,typeof De=="object"&&De!==null&&(Ae=ho(De)),K=E.getDerivedStateFromProps,(De=typeof K=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Q!==je||nt!==Ae)&&x1(p,N,b,Ae),fm=!1,nt=p.memoizedState,N.state=nt,Up(p,b,N,D),Zf();var Ut=p.memoizedState;Q!==je||nt!==Ut||fm||d!==null&&d.dependencies!==null&&ms(d.dependencies)?(typeof K=="function"&&(Lb(p,E,K,b),Ut=p.memoizedState),(Ke=fm||X0(p,E,Ke,b,nt,Ut,Ae)||d!==null&&d.dependencies!==null&&ms(d.dependencies))?(De||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(b,Ut,Ae),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(b,Ut,Ae)),typeof N.componentDidUpdate=="function"&&(p.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof N.componentDidUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=1024),p.memoizedProps=b,p.memoizedState=Ut),N.props=b,N.state=Ut,N.context=Ae,b=Ke):(typeof N.componentDidUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=1024),b=!1)}return N=b,oy(d,p),b=(p.flags&128)!==0,N||b?(N=p.stateNode,E=b&&typeof E.getDerivedStateFromError!="function"?null:N.render(),p.flags|=1,d!==null&&b?(p.child=og(p,d.child,null,D),p.child=og(p,null,E,D)):Vi(d,p,E,D),p.memoizedState=N.state,d=p.child):d=Va(d,p,D),d}function Gb(d,p,E,b){return tn(),p.flags|=256,Vi(d,p,E,b),p.child}function iy(d){return{baseLanes:d,cachePool:xt()}}function yd(d,p,E){return d=d!==null?d.childLanes&~E:0,p&&(d|=Qu),d}function jb(d,p,E){var b=p.pendingProps,D=!1,N=(p.flags&128)!==0,Q;if((Q=N)||(Q=d!==null&&d.memoizedState===null?!1:(Ko.current&2)!==0),Q&&(D=!0,p.flags&=-129),Q=(p.flags&32)!==0,p.flags&=-33,d===null){if(Un){if(D?gl(p):Tc(p),(d=ao)?(d=gq(d,Oc),d!==null&&(p.memoizedState={dehydrated:d,treeContext:tf!==null?{id:Ia,overflow:Nd}:null,retryLane:536870912,hydrationErrors:null},E=fI(d),E.return=p,p.child=E,Di=p,ao=null)):d=null,d===null)throw ar(p);return By(d)?p.lanes=32:p.lanes=536870912,null}var K=b.children;return b=b.fallback,D?(Tc(p),D=p.mode,K=bl({mode:"hidden",children:K},D),b=Yp(b,D,E,null),K.return=p,b.return=p,K.sibling=b,p.child=K,b=p.child,b.memoizedState=iy(E),b.childLanes=yd(d,Q,E),p.memoizedState=VI,Cc(null,b)):(gl(p),zb(p,K))}var Ae=d.memoizedState;if(Ae!==null&&(K=Ae.dehydrated,K!==null)){if(N)p.flags&256?(gl(p),p.flags&=-257,p=ya(d,p,E)):p.memoizedState!==null?(Tc(p),p.child=d.child,p.flags|=128,p=null):(Tc(p),K=b.fallback,D=p.mode,b=bl({mode:"visible",children:b.children},D),K=Yp(K,D,E,null),K.flags|=2,b.return=p,K.return=p,b.sibling=K,p.child=b,og(p,d.child,null,E),b=p.child,b.memoizedState=iy(E),b.childLanes=yd(d,Q,E),p.memoizedState=VI,p=Cc(null,b));else if(gl(p),By(K))Q=ZA(K).digest,b=Error(r(419)),b.stack="",b.digest=Q,Rt({value:b,source:null,stack:null}),p=ya(d,p,E);else if(pi||$i(d,p,E,!1),Q=(E&d.childLanes)!==0,pi||Q){if(Q=Lr,Q!==null&&(b=_e(Q,E),b!==0&&b!==Ae.retryLane))throw Ae.retryLane=b,Ec(d,b),Sa(Q,d,b),qI;Ny(K)||Gh(),p=ya(d,p,E)}else Ny(K)?(p.flags|=192,p.child=d.child,p=null):(d=Ae.treeContext,ys&&(ao=x2(K),Di=p,Un=!0,nf=null,Oc=!1,d!==null&&en(p,d)),p=zb(p,b.children),p.flags|=4096);return p}return D?(Tc(p),K=b.fallback,D=p.mode,Ae=d.child,N=Ae.sibling,b=Id(Ae,{mode:"hidden",children:b.children}),b.subtreeFlags=Ae.subtreeFlags&65011712,N!==null?K=Id(N,K):(K=Yp(K,D,E,null),K.flags|=2),K.return=p,b.return=p,b.sibling=K,p.child=b,Cc(null,b),b=p.child,K=d.child.memoizedState,K===null?K=iy(E):(D=K.cachePool,D!==null?(Ae=Dc?Eo._currentValue:Eo._currentValue2,D=D.parent!==Ae?{parent:Ae,pool:Ae}:D):D=xt(),K={baseLanes:K.baseLanes|E,cachePool:D}),b.memoizedState=K,b.childLanes=yd(d,Q,E),p.memoizedState=VI,Cc(d.child,b)):(gl(p),E=d.child,d=E.sibling,E=Id(E,{mode:"visible",children:b.children}),E.return=p,E.sibling=null,d!==null&&(Q=p.deletions,Q===null?(p.deletions=[d],p.flags|=16):Q.push(d)),p.child=E,p.memoizedState=null,E)}function zb(d,p){return p=bl({mode:"visible",children:p},d.mode),p.return=d,d.child=p}function bl(d,p){return d=t(22,d,null,p),d.lanes=0,d}function ya(d,p,E){return og(p,d.child,null,E),d=zb(p,p.pendingProps.children),d.flags|=2,p.memoizedState=null,d}function sy(d,p,E){d.lanes|=p;var b=d.alternate;b!==null&&(b.lanes|=p),ai(d.return,p,E)}function An(d,p,E,b,D,N){var Q=d.memoizedState;Q===null?d.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:b,tail:E,tailMode:D,treeForkCount:N}:(Q.isBackwards=p,Q.rendering=null,Q.renderingStartTime=0,Q.last=b,Q.tail=E,Q.tailMode=D,Q.treeForkCount=N)}function we(d,p,E){var b=p.pendingProps,D=b.revealOrder,N=b.tail;b=b.children;var Q=Ko.current,K=(Q&2)!==0;if(K?(Q=Q&1|2,p.flags|=128):Q&=1,T(Ko,Q),Vi(d,p,b,E),b=Un?le:0,!K&&d!==null&&(d.flags&128)!==0)e:for(d=p.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&sy(d,E,p);else if(d.tag===19)sy(d,E,p);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===p)break e;for(;d.sibling===null;){if(d.return===null||d.return===p)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}switch(D){case"forwards":for(E=p.child,D=null;E!==null;)d=E.alternate,d!==null&&hl(d)===null&&(D=E),E=E.sibling;E=D,E===null?(D=p.child,p.child=null):(D=E.sibling,E.sibling=null),An(p,!1,D,E,N,b);break;case"backwards":case"unstable_legacy-backwards":for(E=null,D=p.child,p.child=null;D!==null;){if(d=D.alternate,d!==null&&hl(d)===null){p.child=D;break}d=D.sibling,D.sibling=E,E=D,D=d}An(p,!0,E,null,N,b);break;case"together":An(p,!1,null,null,void 0,b);break;default:p.memoizedState=null}return p.child}function Va(d,p,E){if(d!==null&&(p.dependencies=d.dependencies),gm|=p.lanes,(E&p.childLanes)===0)if(d!==null){if($i(d,p,E,!1),(E&p.childLanes)===0)return null}else return null;if(d!==null&&p.child!==d.child)throw Error(r(153));if(p.child!==null){for(d=p.child,E=Id(d,d.pendingProps),p.child=E,E.return=p;d.sibling!==null;)d=d.sibling,E=E.sibling=Id(d,d.pendingProps),E.return=p;E.sibling=null}return p.child}function Mh(d,p){return(d.lanes&p)!==0?!0:(d=d.dependencies,!!(d!==null&&ms(d)))}function Do(d,p,E){switch(p.tag){case 3:Tn(p,p.stateNode.containerInfo),Ln(p,Eo,d.memoizedState.cache),tn();break;case 27:case 5:Us(p);break;case 4:Tn(p,p.stateNode.containerInfo);break;case 10:Ln(p,p.type,p.memoizedProps.value);break;case 31:if(p.memoizedState!==null)return p.flags|=128,Qp(p),null;break;case 13:var b=p.memoizedState;if(b!==null)return b.dehydrated!==null?(gl(p),p.flags|=128,null):(E&p.child.childLanes)!==0?jb(d,p,E):(gl(p),d=Va(d,p,E),d!==null?d.sibling:null);gl(p);break;case 19:var D=(d.flags&128)!==0;if(b=(E&p.childLanes)!==0,b||($i(d,p,E,!1),b=(E&p.childLanes)!==0),D){if(b)return we(d,p,E);p.flags|=128}if(D=p.memoizedState,D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),T(Ko,Ko.current),b)break;return null;case 22:return p.lanes=0,zp(d,p,E,p.pendingProps);case 24:Ln(p,Eo,d.memoizedState.cache)}return Va(d,p,E)}function Hb(d,p,E){if(d!==null)if(d.memoizedProps!==p.pendingProps)pi=!0;else{if(!Mh(d,E)&&(p.flags&128)===0)return pi=!1,Do(d,p,E);pi=(d.flags&131072)!==0}else pi=!1,Un&&(p.flags&1048576)!==0&&Gr(p,le,p.index);switch(p.lanes=0,p.tag){case 16:e:{var b=p.pendingProps;if(d=Wr(p.elementType),p.type=d,typeof d=="function")_y(d)?(b=Ed(d,b),p.tag=1,p=w1(null,p,d,b,E)):(p.tag=0,p=N1(null,p,d,b,E));else{if(d!=null){var D=d.$$typeof;if(D===zh){p.tag=11,p=ny(null,p,d,b,E);break e}else if(D===eN){p.tag=14,p=Qb(null,p,d,b,E);break e}}throw p=h(d)||d,Error(r(306,p,""))}}return p;case 0:return N1(d,p,p.type,p.pendingProps,E);case 1:return b=p.type,D=Ed(b,p.pendingProps),w1(d,p,b,D,E);case 3:e:{if(Tn(p,p.stateNode.containerInfo),d===null)throw Error(r(387));var N=p.pendingProps;D=p.memoizedState,b=D.element,Lp(d,p),Up(p,N,null,E);var Q=p.memoizedState;if(N=Q.cache,Ln(p,Eo,N),N!==D.cache&&vt(p,[Eo],E,!0),Zf(),N=Q.element,ys&&D.isDehydrated)if(D={element:N,isDehydrated:!1,cache:Q.cache},p.updateQueue.baseState=D,p.memoizedState=D,p.flags&256){p=Gb(d,p,N,E);break e}else if(N!==b){b=ut(Error(r(424)),p),Rt(b),p=Gb(d,p,N,E);break e}else for(ys&&(ao=vI(p.stateNode.containerInfo),Di=p,Un=!0,nf=null,Oc=!0),E=Y2(p,null,N,E),p.child=E;E;)E.flags=E.flags&-3|4096,E=E.sibling;else{if(tn(),N===b){p=Va(d,p,E);break e}Vi(d,p,N,E)}p=p.child}return p;case 26:if(Nc)return oy(d,p),d===null?(E=Yh(p.type,null,p.pendingProps,null))?p.memoizedState=E:Un||(p.stateNode=j2(p.type,p.pendingProps,dm.current,p)):p.memoizedState=Yh(p.type,d.memoizedProps,p.pendingProps,d.memoizedState),null;case 27:if(ci)return Us(p),d===null&&ci&&Un&&(b=p.stateNode=BI(p.type,p.pendingProps,dm.current,bs.current,!1),Di=p,Oc=!0,ao=mq(p.type,b,ao)),Vi(d,p,p.pendingProps.children,E),oy(d,p),d===null&&(p.flags|=4194304),p.child;case 5:return d===null&&Un&&(Eq(p.type,p.pendingProps,bs.current),(D=b=ao)&&(b=Aq(b,p.type,p.pendingProps,Oc),b!==null?(p.stateNode=b,Di=p,ao=CI(b),Oc=!1,D=!0):D=!1),D||ar(p)),Us(p),D=p.type,N=p.pendingProps,Q=d!==null?d.memoizedProps:null,b=N.children,vy(D,N)?b=null:Q!==null&&vy(D,Q)&&(p.flags|=32),p.memoizedState!==null&&(D=Fp(d,p,QA,null,null,E),Dc?cm._currentValue=D:cm._currentValue2=D),oy(d,p),Vi(d,p,b,E),p.child;case 6:return d===null&&Un&&(AN(p.pendingProps,bs.current),(d=E=ao)&&(E=D2(E,p.pendingProps,Oc),E!==null?(p.stateNode=E,Di=p,ao=null,d=!0):d=!1),d||ar(p)),null;case 13:return jb(d,p,E);case 4:return Tn(p,p.stateNode.containerInfo),b=p.pendingProps,d===null?p.child=og(p,null,b,E):Vi(d,p,b,E),p.child;case 11:return ny(d,p,p.type,p.pendingProps,E);case 7:return Vi(d,p,p.pendingProps,E),p.child;case 8:return Vi(d,p,p.pendingProps.children,E),p.child;case 12:return Vi(d,p,p.pendingProps.children,E),p.child;case 10:return b=p.pendingProps,Ln(p,p.type,b.value),Vi(d,p,b.children,E),p.child;case 9:return D=p.type._context,b=p.pendingProps.children,xo(p),D=ho(D),b=b(D),p.flags|=1,Vi(d,p,b,E),p.child;case 14:return Qb(d,p,p.type,p.pendingProps,E);case 15:return Fb(d,p,p.type,p.pendingProps,E);case 19:return we(d,p,E);case 31:return ry(d,p,E);case 22:return zp(d,p,E,p.pendingProps);case 24:return xo(p),b=ho(Eo),d===null?(D=et(),D===null&&(D=Lr,N=Jf(),D.pooledCache=N,N.refCount++,N!==null&&(D.pooledCacheLanes|=E),D=N),p.memoizedState={parent:b,cache:D},Mp(p),Ln(p,Eo,D)):((d.lanes&E)!==0&&(Lp(d,p),Up(p,null,null,E),Zf()),D=d.memoizedState,N=p.memoizedState,D.parent!==b?(D={parent:b,cache:b},p.memoizedState=D,p.lanes===0&&(p.memoizedState=p.updateQueue.baseState=D),Ln(p,Eo,b)):(b=N.cache,Ln(p,Eo,b),b!==D.cache&&vt(p,[Eo],E,!0))),Vi(d,p,p.pendingProps.children,E),p.child;case 29:throw p.pendingProps}throw Error(r(156,p.tag))}function ku(d){d.flags|=4}function ay(d){xl&&(d.flags|=8)}function $b(d,p){if(d!==null&&d.child===p.child)return!1;if((p.flags&16)!==0)return!0;for(d=p.child;d!==null;){if((d.flags&8218)!==0||(d.subtreeFlags&8218)!==0)return!0;d=d.sibling}return!1}function O1(d,p,E,b){if($s)for(E=p.child;E!==null;){if(E.tag===5||E.tag===6)yI(d,E.stateNode);else if(!(E.tag===4||ci&&E.tag===27)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===p)break;for(;E.sibling===null;){if(E.return===null||E.return===p)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else if(xl)for(var D=p.child;D!==null;){if(D.tag===5){var N=D.stateNode;E&&b&&(N=Zp(N,D.type,D.memoizedProps)),yI(d,N)}else if(D.tag===6)N=D.stateNode,E&&b&&(N=Dy(N,D.memoizedProps)),yI(d,N);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)N=D.child,N!==null&&(N.return=D),O1(d,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===p)break;for(;D.sibling===null;){if(D.return===null||D.return===p)return;D=D.return}D.sibling.return=D.return,D=D.sibling}}function qb(d,p,E,b){var D=!1;if(xl)for(var N=p.child;N!==null;){if(N.tag===5){var Q=N.stateNode;E&&b&&(Q=Zp(Q,N.type,N.memoizedProps)),lN(d,Q)}else if(N.tag===6)Q=N.stateNode,E&&b&&(Q=Dy(Q,N.memoizedProps)),lN(d,Q);else if(N.tag!==4){if(N.tag===22&&N.memoizedState!==null)D=N.child,D!==null&&(D.return=N),qb(d,N,!0,!0),D=!0;else if(N.child!==null){N.child.return=N,N=N.child;continue}}if(N===p)break;for(;N.sibling===null;){if(N.return===null||N.return===p)return D;N=N.return}N.sibling.return=N.return,N=N.sibling}return D}function Vb(d,p){if(xl&&$b(d,p)){d=p.stateNode;var E=d.containerInfo,b=so();qb(b,p,!1,!1),d.pendingChildren=b,ku(p),b2(E,b)}}function uy(d,p,E,b){if($s)d.memoizedProps!==b&&ku(p);else if(xl){var D=d.stateNode,N=d.memoizedProps;if((d=$b(d,p))||N!==b){var Q=bs.current;N=T2(D,E,N,b,!d,null),N===D?p.stateNode=D:(ay(p),i2(N,E,b,Q)&&ku(p),p.stateNode=N,d&&O1(N,p,!1,!1))}else p.stateNode=D}}function Es(d,p,E,b,D){if((d.mode&32)!==0&&(E===null?c2(p,b):pq(p,E,b))){if(d.flags|=16777216,(D&335544128)===D||Hh(p,b))if(Ss(d.stateNode,p,b))d.flags|=8192;else if(WM())d.flags|=8192;else throw kc=GI,QI}else d.flags&=-16777217}function hr(d,p){if(yq(p)){if(d.flags|=16777216,!NI(p))if(WM())d.flags|=8192;else throw kc=GI,QI}else d.flags&=-16777217}function jA(d,p){p!==null&&(d.flags|=4),d.flags&16384&&(p=d.tag!==22?j():536870912,d.lanes|=p,a_|=p)}function Hp(d,p){if(!Un)switch(d.tailMode){case"hidden":p=d.tail;for(var E=null;p!==null;)p.alternate!==null&&(E=p),p=p.sibling;E===null?d.tail=null:E.sibling=null;break;case"collapsed":E=d.tail;for(var b=null;E!==null;)E.alternate!==null&&(b=E),E=E.sibling;b===null?p||d.tail===null?d.tail=null:d.tail.sibling=null:b.sibling=null}}function fr(d){var p=d.alternate!==null&&d.alternate.child===d.child,E=0,b=0;if(p)for(var D=d.child;D!==null;)E|=D.lanes|D.childLanes,b|=D.subtreeFlags&65011712,b|=D.flags&65011712,D.return=d,D=D.sibling;else for(D=d.child;D!==null;)E|=D.lanes|D.childLanes,b|=D.subtreeFlags,b|=D.flags,D.return=d,D=D.sibling;return d.subtreeFlags|=b,d.childLanes=E,p}function zA(d,p,E){var b=p.pendingProps;switch(mt(p),p.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fr(p),null;case 1:return fr(p),null;case 3:return E=p.stateNode,b=null,d!==null&&(b=d.memoizedState.cache),p.memoizedState.cache!==b&&(p.flags|=2048),oo(Eo),yr(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(d===null||d.child===null)&&(ft(p)?ku(p):d===null||d.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,bn())),Vb(d,p),fr(p),null;case 26:if(Nc){var D=p.type,N=p.memoizedState;return d===null?(ku(p),N!==null?(fr(p),hr(p,N)):(fr(p),Es(p,D,null,b,E))):N?N!==d.memoizedState?(ku(p),fr(p),hr(p,N)):(fr(p),p.flags&=-16777217):(N=d.memoizedProps,$s?N!==b&&ku(p):uy(d,p,D,b),fr(p),Es(p,D,N,b,E)),null}case 27:if(ci){if(Vn(p),E=dm.current,D=p.type,d!==null&&p.stateNode!=null)$s?d.memoizedProps!==b&&ku(p):uy(d,p,D,b);else{if(!b){if(p.stateNode===null)throw Error(r(166));return fr(p),null}d=bs.current,ft(p)?zt(p,d):(d=BI(D,b,E,d,!0),p.stateNode=d,ku(p))}return fr(p),null}case 5:if(Vn(p),D=p.type,d!==null&&p.stateNode!=null)uy(d,p,D,b);else{if(!b){if(p.stateNode===null)throw Error(r(166));return fr(p),null}if(N=bs.current,ft(p))zt(p,N),M2(p.stateNode,D,b,N)&&(p.flags|=64);else{var Q=vd(D,b,dm.current,N,p);ay(p),O1(Q,p,!1,!1),p.stateNode=Q,i2(Q,D,b,N)&&ku(p)}}return fr(p),Es(p,p.type,d===null?null:d.memoizedProps,p.pendingProps,E),null;case 6:if(d&&p.stateNode!=null)E=d.memoizedProps,$s?E!==b&&ku(p):xl&&(E!==b?(d=dm.current,E=bs.current,ay(p),p.stateNode=SI(b,d,E,p)):p.stateNode=d.stateNode);else{if(typeof b!="string"&&p.stateNode===null)throw Error(r(166));if(d=dm.current,E=bs.current,ft(p)){if(!ys)throw Error(r(176));if(d=p.stateNode,E=p.memoizedProps,b=null,D=Di,D!==null)switch(D.tag){case 27:case 5:b=D.memoizedProps}RI(d,E,p,b)||ar(p,!0)}else ay(p),p.stateNode=SI(b,d,E,p)}return fr(p),null;case 31:if(E=p.memoizedState,d===null||d.memoizedState!==null){if(b=ft(p),E!==null){if(d===null){if(!b)throw Error(r(318));if(!ys)throw Error(r(556));if(d=p.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(557));B2(d,p)}else tn(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;fr(p),d=!1}else E=bn(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=E),d=!0;if(!d)return p.flags&256?(Ri(p),p):(Ri(p),null);if((p.flags&128)!==0)throw Error(r(558))}return fr(p),null;case 13:if(b=p.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(D=ft(p),b!==null&&b.dehydrated!==null){if(d===null){if(!D)throw Error(r(318));if(!ys)throw Error(r(344));if(D=p.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(r(317));fN(D,p)}else tn(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;fr(p),D=!1}else D=bn(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=D),D=!0;if(!D)return p.flags&256?(Ri(p),p):(Ri(p),null)}return Ri(p),(p.flags&128)!==0?(p.lanes=E,p):(E=b!==null,d=d!==null&&d.memoizedState!==null,E&&(b=p.child,D=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(D=b.alternate.memoizedState.cachePool.pool),N=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(N=b.memoizedState.cachePool.pool),N!==D&&(b.flags|=2048)),E!==d&&E&&(p.child.flags|=8192),jA(p,p.updateQueue),fr(p),null);case 4:return yr(),Vb(d,p),d===null&&dq(p.stateNode.containerInfo),fr(p),null;case 10:return oo(p.type),fr(p),null;case 19:if(y(Ko),b=p.memoizedState,b===null)return fr(p),null;if(D=(p.flags&128)!==0,N=b.rendering,N===null)if(D)Hp(b,!1);else{if(No!==0||d!==null&&(d.flags&128)!==0)for(d=p.child;d!==null;){if(N=hl(d),N!==null){for(p.flags|=128,Hp(b,!1),d=N.updateQueue,p.updateQueue=d,jA(p,d),p.subtreeFlags=0,d=E,E=p.child;E!==null;)K1(E,d),E=E.sibling;return T(Ko,Ko.current&1|2),Un&&Lt(p,b.treeForkCount),p.child}d=d.sibling}b.tail!==null&&Sr()>u_&&(p.flags|=128,D=!0,Hp(b,!1),p.lanes=4194304)}else{if(!D)if(d=hl(N),d!==null){if(p.flags|=128,D=!0,d=d.updateQueue,p.updateQueue=d,jA(p,d),Hp(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!Un)return fr(p),null}else 2*Sr()-b.renderingStartTime>u_&&E!==536870912&&(p.flags|=128,D=!0,Hp(b,!1),p.lanes=4194304);b.isBackwards?(N.sibling=p.child,p.child=N):(d=b.last,d!==null?d.sibling=N:p.child=N,b.last=N)}return b.tail!==null?(d=b.tail,b.rendering=d,b.tail=d.sibling,b.renderingStartTime=Sr(),d.sibling=null,E=Ko.current,T(Ko,D?E&1|2:E&1),Un&&Lt(p,b.treeForkCount),d):(fr(p),null);case 22:case 23:return Ri(p),Al(),b=p.memoizedState!==null,d!==null?d.memoizedState!==null!==b&&(p.flags|=8192):b&&(p.flags|=8192),b?(E&536870912)!==0&&(p.flags&128)===0&&(fr(p),p.subtreeFlags&6&&(p.flags|=8192)):fr(p),E=p.updateQueue,E!==null&&jA(p,E.retryQueue),E=null,d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(E=d.memoizedState.cachePool.pool),b=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(b=p.memoizedState.cachePool.pool),b!==E&&(p.flags|=2048),d!==null&&y(pm),null;case 24:return E=null,d!==null&&(E=d.memoizedState.cache),p.memoizedState.cache!==E&&(p.flags|=2048),oo(Eo),fr(p),null;case 25:return null;case 30:return null}throw Error(r(156,p.tag))}function Il(d,p){switch(mt(p),p.tag){case 1:return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 3:return oo(Eo),yr(),d=p.flags,(d&65536)!==0&&(d&128)===0?(p.flags=d&-65537|128,p):null;case 26:case 27:case 5:return Vn(p),null;case 31:if(p.memoizedState!==null){if(Ri(p),p.alternate===null)throw Error(r(340));tn()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 13:if(Ri(p),d=p.memoizedState,d!==null&&d.dehydrated!==null){if(p.alternate===null)throw Error(r(340));tn()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 19:return y(Ko),null;case 4:return yr(),null;case 10:return oo(p.type),null;case 22:case 23:return Ri(p),Al(),d!==null&&y(pm),d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 24:return oo(Eo),null;case 25:return null;default:return null}}function Yb(d,p){switch(mt(p),p.tag){case 3:oo(Eo),yr();break;case 26:case 27:case 5:Vn(p);break;case 4:yr();break;case 31:p.memoizedState!==null&&Ri(p);break;case 13:Ri(p);break;case 19:y(Ko);break;case 10:oo(p.type);break;case 22:case 23:Ri(p),Al(),d!==null&&y(pm);break;case 24:oo(Eo)}}function Sd(d,p){try{var E=p.updateQueue,b=E!==null?E.lastEffect:null;if(b!==null){var D=b.next;E=D;do{if((E.tag&d)===d){b=void 0;var N=E.create,Q=E.inst;b=N(),Q.destroy=b}E=E.next}while(E!==D)}}catch(K){ur(p,p.return,K)}}function Td(d,p,E){try{var b=p.updateQueue,D=b!==null?b.lastEffect:null;if(D!==null){var N=D.next;b=N;do{if((b.tag&d)===d){var Q=b.inst,K=Q.destroy;if(K!==void 0){Q.destroy=void 0,D=p;var Ae=E,De=K;try{De()}catch(Ke){ur(D,Ae,Ke)}}}b=b.next}while(b!==N)}}catch(Ke){ur(p,p.return,Ke)}}function Lh(d){var p=d.updateQueue;if(p!==null){var E=d.stateNode;try{xb(p,E)}catch(b){ur(d,d.return,b)}}}function Kb(d,p,E){E.props=Ed(d.type,d.memoizedProps),E.state=d.memoizedState;try{E.componentWillUnmount()}catch(b){ur(d,p,b)}}function em(d,p){try{var E=d.ref;if(E!==null){switch(d.tag){case 26:case 27:case 5:var b=Iy(d.stateNode);break;case 30:b=d.stateNode;break;default:b=d.stateNode}typeof E=="function"?d.refCleanup=E(b):E.current=b}}catch(D){ur(d,p,D)}}function Cl(d,p){var E=d.ref,b=d.refCleanup;if(E!==null)if(typeof b=="function")try{b()}catch(D){ur(d,p,D)}finally{d.refCleanup=null,d=d.alternate,d!=null&&(d.refCleanup=null)}else if(typeof E=="function")try{E(null)}catch(D){ur(d,p,D)}else E.current=null}function k1(d){var p=d.type,E=d.memoizedProps,b=d.stateNode;try{h2(b,p,E,d)}catch(D){ur(d,d.return,D)}}function Jb(d,p,E){try{TI(d.stateNode,d.type,E,p,d)}catch(b){ur(d,d.return,b)}}function P1(d){return d.tag===5||d.tag===3||(Nc?d.tag===26:!1)||(ci?d.tag===27&&XA(d.type):!1)||d.tag===4}function Zb(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||P1(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(ci&&d.tag===27&&XA(d.type)||d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function cy(d,p,E){var b=d.tag;if(b===5||b===6)d=d.stateNode,p?E2(E,d,p):g2(E,d);else if(b!==4&&(ci&&b===27&&XA(d.type)&&(E=d.stateNode,p=null),d=d.child,d!==null))for(cy(d,p,E),d=d.sibling;d!==null;)cy(d,p,E),d=d.sibling}function Uh(d,p,E){var b=d.tag;if(b===5||b===6)d=d.stateNode,p?_2(E,d,p):A2(E,d);else if(b!==4&&(ci&&b===27&&XA(d.type)&&(E=d.stateNode),d=d.child,d!==null))for(Uh(d,p,E),d=d.sibling;d!==null;)Uh(d,p,E),d=d.sibling}function Wb(d,p,E){d=d.containerInfo;try{I2(d,E)}catch(b){ur(p,p.return,b)}}function M1(d){var p=d.stateNode,E=d.memoizedProps;try{wI(d.type,E,p,d)}catch(b){ur(d,d.return,b)}}function $M(d,p){for(lq(d.containerInfo),Yi=p;Yi!==null;)if(d=Yi,p=d.child,(d.subtreeFlags&1028)!==0&&p!==null)p.return=d,Yi=p;else for(;Yi!==null;){d=Yi;var E=d.alternate;switch(p=d.flags,d.tag){case 0:if((p&4)!==0&&(p=d.updateQueue,p=p!==null?p.events:null,p!==null))for(var b=0;b<p.length;b++){var D=p[b];D.ref.impl=D.nextImpl}break;case 11:case 15:break;case 1:if((p&1024)!==0&&E!==null){p=void 0,b=d,D=E.memoizedProps,E=E.memoizedState;var N=b.stateNode;try{var Q=Ed(b.type,D);p=N.getSnapshotBeforeUpdate(Q,E),N.__reactInternalSnapshotBeforeUpdate=p}catch(K){ur(b,b.return,K)}}break;case 3:(p&1024)!==0&&$s&&Mu(d.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((p&1024)!==0)throw Error(r(163))}if(p=d.sibling,p!==null){p.return=d.return,Yi=p;break}Yi=d.return}}function L1(d,p,E){var b=E.flags;switch(E.tag){case 0:case 11:case 15:Rc(d,E),b&4&&Sd(5,E);break;case 1:if(Rc(d,E),b&4)if(d=E.stateNode,p===null)try{d.componentDidMount()}catch(Q){ur(E,E.return,Q)}else{var D=Ed(E.type,p.memoizedProps);p=p.memoizedState;try{d.componentDidUpdate(D,p,d.__reactInternalSnapshotBeforeUpdate)}catch(Q){ur(E,E.return,Q)}}b&64&&Lh(E),b&512&&em(E,E.return);break;case 3:if(Rc(d,E),b&64&&(b=E.updateQueue,b!==null)){if(d=null,E.child!==null)switch(E.child.tag){case 27:case 5:d=Iy(E.child.stateNode);break;case 1:d=E.child.stateNode}try{xb(b,d)}catch(Q){ur(E,E.return,Q)}}break;case 27:ci&&p===null&&b&4&&M1(E);case 26:case 5:if(Rc(d,E),p===null){if(b&4)k1(E);else if(b&64){d=E.type,p=E.memoizedProps,D=E.stateNode;try{k2(D,d,p,E)}catch(Q){ur(E,E.return,Q)}}}b&512&&em(E,E.return);break;case 12:Rc(d,E);break;case 31:Rc(d,E),b&4&&U1(d,E);break;case 13:Rc(d,E),b&4&&eI(d,E),b&64&&(b=E.memoizedState,b!==null&&(b=b.dehydrated,b!==null&&(E=dI.bind(null,E),$h(b,E))));break;case 22:if(b=E.memoizedState!==null||kd,!b){p=p!==null&&p.memoizedState!==null||Jo,D=kd;var N=Jo;kd=b,(Jo=p)&&!N?vl(d,E,(E.subtreeFlags&8772)!==0):Rc(d,E),kd=D,Jo=N}break;case 30:break;default:Rc(d,E)}}function qM(d){var p=d.alternate;p!==null&&(d.alternate=null,qM(p)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(p=d.stateNode,p!==null&&u2(p)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function vc(d,p,E){for(E=E.child;E!==null;)Xb(d,p,E),E=E.sibling}function Xb(d,p,E){if(Vo&&typeof Vo.onCommitFiberUnmount=="function")try{Vo.onCommitFiberUnmount(tg,E)}catch{}switch(E.tag){case 26:if(Nc){Jo||Cl(E,p),vc(d,p,E),E.memoizedState?G2(E.memoizedState):E.stateNode&&hN(E.stateNode);break}case 27:if(ci){Jo||Cl(E,p);var b=fi,D=eu;XA(E.type)&&(fi=E.stateNode,eu=!1),vc(d,p,E),lm(E.stateNode),fi=b,eu=D;break}case 5:Jo||Cl(E,p);case 6:if($s){if(b=fi,D=eu,fi=null,vc(d,p,E),fi=b,eu=D,fi!==null)if(eu)try{cN(fi,E.stateNode)}catch(N){ur(E,p,N)}else try{uN(fi,E.stateNode)}catch(N){ur(E,p,N)}}else vc(d,p,E);break;case 18:$s&&fi!==null&&(eu?mN(fi,E.stateNode):cr(fi,E.stateNode));break;case 4:$s?(b=fi,D=eu,fi=E.stateNode.containerInfo,eu=!0,vc(d,p,E),fi=b,eu=D):(xl&&Wb(E.stateNode,E,so()),vc(d,p,E));break;case 0:case 11:case 14:case 15:Td(2,E,p),Jo||Td(4,E,p),vc(d,p,E);break;case 1:Jo||(Cl(E,p),b=E.stateNode,typeof b.componentWillUnmount=="function"&&Kb(E,p,b)),vc(d,p,E);break;case 21:vc(d,p,E);break;case 22:Jo=(b=Jo)||E.memoizedState!==null,vc(d,p,E),Jo=b;break;default:vc(d,p,E)}}function U1(d,p){if(ys&&p.memoizedState===null&&(d=p.alternate,d!==null&&(d=d.memoizedState,d!==null))){d=d.dehydrated;try{P2(d)}catch(E){ur(p,p.return,E)}}}function eI(d,p){if(ys&&p.memoizedState===null&&(d=p.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null))))try{Vh(d)}catch(E){ur(p,p.return,E)}}function VM(d){switch(d.tag){case 31:case 13:case 19:var p=d.stateNode;return p===null&&(p=d.stateNode=new YI),p;case 22:return d=d.stateNode,p=d._retryCache,p===null&&(p=d._retryCache=new YI),p;default:throw Error(r(435,d.tag))}}function ly(d,p){var E=VM(d);p.forEach(function(b){if(!E.has(b)){E.add(b);var D=n2.bind(null,d,b);b.then(D,D)}})}function $o(d,p){var E=p.deletions;if(E!==null)for(var b=0;b<E.length;b++){var D=E[b],N=d,Q=p;if($s){var K=Q;e:for(;K!==null;){switch(K.tag){case 27:if(ci){if(XA(K.type)){fi=K.stateNode,eu=!1;break e}break}case 5:fi=K.stateNode,eu=!1;break e;case 3:case 4:fi=K.stateNode.containerInfo,eu=!0;break e}K=K.return}if(fi===null)throw Error(r(160));Xb(N,Q,D),fi=null,eu=!1}else Xb(N,Q,D);N=D.alternate,N!==null&&(N.return=null),D.return=null}if(p.subtreeFlags&13886)for(p=p.child;p!==null;)dy(p,d),p=p.sibling}function dy(d,p){var E=d.alternate,b=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:$o(p,d),zs(d),b&4&&(Td(3,d,d.return),Sd(3,d),Td(5,d,d.return));break;case 1:$o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),b&64&&kd&&(d=d.updateQueue,d!==null&&(b=d.callbacks,b!==null&&(E=d.shared.hiddenCallbacks,d.shared.hiddenCallbacks=E===null?b:E.concat(b))));break;case 26:if(Nc){var D=Ol;if($o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),b&4){b=E!==null?E.memoizedState:null;var N=d.memoizedState;E===null?N===null?d.stateNode===null?d.stateNode=WA(D,d.type,d.memoizedProps,d):DI(D,d.type,d.stateNode):d.stateNode=F2(D,N,d.memoizedProps):b!==N?(b===null?E.stateNode!==null&&hN(E.stateNode):G2(b),N===null?DI(D,d.type,d.stateNode):F2(D,N,d.memoizedProps)):N===null&&d.stateNode!==null&&Jb(d,d.memoizedProps,E.memoizedProps)}break}case 27:if(ci){$o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),E!==null&&b&4&&Jb(d,d.memoizedProps,E.memoizedProps);break}case 5:if($o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),$s){if(d.flags&32){D=d.stateNode;try{bI(D)}catch(je){ur(d,d.return,je)}}b&4&&d.stateNode!=null&&(D=d.memoizedProps,Jb(d,D,E!==null?E.memoizedProps:D)),b&1024&&(Fy=!0)}else xl&&d.alternate!==null&&(d.alternate.stateNode=d.stateNode);break;case 6:if($o(p,d),zs(d),b&4&&$s){if(d.stateNode===null)throw Error(r(162));b=d.memoizedProps,E=E!==null?E.memoizedProps:b,D=d.stateNode;try{xy(D,E,b)}catch(je){ur(d,d.return,je)}}break;case 3:if(Nc?(z2(),D=Ol,Ol=xI(p.containerInfo),$o(p,d),Ol=D):$o(p,d),zs(d),b&4){if($s&&ys&&E!==null&&E.memoizedState.isDehydrated)try{hq(p.containerInfo)}catch(je){ur(d,d.return,je)}if(xl){b=p.containerInfo,E=p.pendingChildren;try{I2(b,E)}catch(je){ur(d,d.return,je)}}}Fy&&(Fy=!1,YM(d));break;case 4:Nc?(E=Ol,Ol=xI(d.stateNode.containerInfo),$o(p,d),zs(d),Ol=E):($o(p,d),zs(d)),b&4&&xl&&Wb(d.stateNode,d,d.stateNode.pendingChildren);break;case 12:$o(p,d),zs(d);break;case 31:$o(p,d),zs(d),b&4&&(b=d.updateQueue,b!==null&&(d.updateQueue=null,ly(d,b)));break;case 13:$o(p,d),zs(d),d.child.flags&8192&&d.memoizedState!==null!=(E!==null&&E.memoizedState!==null)&&(zy=Sr()),b&4&&(b=d.updateQueue,b!==null&&(d.updateQueue=null,ly(d,b)));break;case 22:D=d.memoizedState!==null;var Q=E!==null&&E.memoizedState!==null,K=kd,Ae=Jo;if(kd=K||D,Jo=Ae||Q,$o(p,d),Jo=Ae,kd=K,zs(d),b&8192&&(p=d.stateNode,p._visibility=D?p._visibility&-2:p._visibility|1,D&&(E===null||Q||kd||Jo||xc(d)),$s)){e:if(E=null,$s)for(p=d;;){if(p.tag===5||Nc&&p.tag===26){if(E===null){Q=E=p;try{N=Q.stateNode,D?y2(N):fq(Q.stateNode,Q.memoizedProps)}catch(je){ur(Q,Q.return,je)}}}else if(p.tag===6){if(E===null){Q=p;try{var De=Q.stateNode;D?II(De):S2(De,Q.memoizedProps)}catch(je){ur(Q,Q.return,je)}}}else if(p.tag===18){if(E===null){Q=p;try{var Ke=Q.stateNode;D?_q(Ke):U2(Q.stateNode)}catch(je){ur(Q,Q.return,je)}}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===d)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break e;for(;p.sibling===null;){if(p.return===null||p.return===d)break e;E===p&&(E=null),p=p.return}E===p&&(E=null),p.sibling.return=p.return,p=p.sibling}}b&4&&(b=d.updateQueue,b!==null&&(E=b.retryQueue,E!==null&&(b.retryQueue=null,ly(d,E))));break;case 19:$o(p,d),zs(d),b&4&&(b=d.updateQueue,b!==null&&(d.updateQueue=null,ly(d,b)));break;case 30:break;case 21:break;default:$o(p,d),zs(d)}}function zs(d){var p=d.flags;if(p&2){try{for(var E,b=d.return;b!==null;){if(P1(b)){E=b;break}b=b.return}if($s){if(E==null)throw Error(r(160));switch(E.tag){case 27:if(ci){var D=E.stateNode,N=Zb(d);Uh(d,N,D);break}case 5:var Q=E.stateNode;E.flags&32&&(bI(Q),E.flags&=-33);var K=Zb(d);Uh(d,K,Q);break;case 3:case 4:var Ae=E.stateNode.containerInfo,De=Zb(d);cy(d,De,Ae);break;default:throw Error(r(161))}}}catch(Ke){ur(d,d.return,Ke)}d.flags&=-3}p&4096&&(d.flags&=-4097)}function YM(d){if(d.subtreeFlags&1024)for(d=d.child;d!==null;){var p=d;YM(p),p.tag===5&&p.flags&1024&&YA(p.stateNode),d=d.sibling}}function Rc(d,p){if(p.subtreeFlags&8772)for(p=p.child;p!==null;)L1(d,p.alternate,p),p=p.sibling}function xc(d){for(d=d.child;d!==null;){var p=d;switch(p.tag){case 0:case 11:case 14:case 15:Td(4,p,p.return),xc(p);break;case 1:Cl(p,p.return);var E=p.stateNode;typeof E.componentWillUnmount=="function"&&Kb(p,p.return,E),xc(p);break;case 27:ci&&lm(p.stateNode);case 26:case 5:Cl(p,p.return),xc(p);break;case 22:p.memoizedState===null&&xc(p);break;case 30:xc(p);break;default:xc(p)}d=d.sibling}}function vl(d,p,E){for(E=E&&(p.subtreeFlags&8772)!==0,p=p.child;p!==null;){var b=p.alternate,D=d,N=p,Q=N.flags;switch(N.tag){case 0:case 11:case 15:vl(D,N,E),Sd(4,N);break;case 1:if(vl(D,N,E),b=N,D=b.stateNode,typeof D.componentDidMount=="function")try{D.componentDidMount()}catch(De){ur(b,b.return,De)}if(b=N,D=b.updateQueue,D!==null){var K=b.stateNode;try{var Ae=D.shared.hiddenCallbacks;if(Ae!==null)for(D.shared.hiddenCallbacks=null,D=0;D<Ae.length;D++)$0(Ae[D],K)}catch(De){ur(b,b.return,De)}}E&&Q&64&&Lh(N),em(N,N.return);break;case 27:ci&&M1(N);case 26:case 5:vl(D,N,E),E&&b===null&&Q&4&&k1(N),em(N,N.return);break;case 12:vl(D,N,E);break;case 31:vl(D,N,E),E&&Q&4&&U1(D,N);break;case 13:vl(D,N,E),E&&Q&4&&eI(D,N);break;case 22:N.memoizedState===null&&vl(D,N,E),em(N,N.return);break;case 30:break;default:vl(D,N,E)}p=p.sibling}}function $p(d,p){var E=null;d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(E=d.memoizedState.cachePool.pool),d=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(d=p.memoizedState.cachePool.pool),d!==E&&(d!=null&&d.refCount++,E!=null&&Bu(E))}function Hs(d,p){d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&Bu(d))}function Ya(d,p,E,b){if(p.subtreeFlags&10256)for(p=p.child;p!==null;)KM(d,p,E,b),p=p.sibling}function KM(d,p,E,b){var D=p.flags;switch(p.tag){case 0:case 11:case 15:Ya(d,p,E,b),D&2048&&Sd(9,p);break;case 1:Ya(d,p,E,b);break;case 3:Ya(d,p,E,b),D&2048&&(d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&Bu(d)));break;case 12:if(D&2048){Ya(d,p,E,b),d=p.stateNode;try{var N=p.memoizedProps,Q=N.id,K=N.onPostCommit;typeof K=="function"&&K(Q,p.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(Ae){ur(p,p.return,Ae)}}else Ya(d,p,E,b);break;case 31:Ya(d,p,E,b);break;case 13:Ya(d,p,E,b);break;case 23:break;case 22:N=p.stateNode,Q=p.alternate,p.memoizedState!==null?N._visibility&2?Ya(d,p,E,b):nm(d,p):N._visibility&2?Ya(d,p,E,b):(N._visibility|=2,tm(d,p,E,b,(p.subtreeFlags&10256)!==0||!1)),D&2048&&$p(Q,p);break;case 24:Ya(d,p,E,b),D&2048&&Hs(p.alternate,p);break;default:Ya(d,p,E,b)}}function tm(d,p,E,b,D){for(D=D&&((p.subtreeFlags&10256)!==0||!1),p=p.child;p!==null;){var N=d,Q=p,K=E,Ae=b,De=Q.flags;switch(Q.tag){case 0:case 11:case 15:tm(N,Q,K,Ae,D),Sd(8,Q);break;case 23:break;case 22:var Ke=Q.stateNode;Q.memoizedState!==null?Ke._visibility&2?tm(N,Q,K,Ae,D):nm(N,Q):(Ke._visibility|=2,tm(N,Q,K,Ae,D)),D&&De&2048&&$p(Q.alternate,Q);break;case 24:tm(N,Q,K,Ae,D),D&&De&2048&&Hs(Q.alternate,Q);break;default:tm(N,Q,K,Ae,D)}p=p.sibling}}function nm(d,p){if(p.subtreeFlags&10256)for(p=p.child;p!==null;){var E=d,b=p,D=b.flags;switch(b.tag){case 22:nm(E,b),D&2048&&$p(b.alternate,b);break;case 24:nm(E,b),D&2048&&Hs(b.alternate,b);break;default:nm(E,b)}p=p.sibling}}function qp(d,p,E){if(d.subtreeFlags&mm)for(d=d.child;d!==null;)Q1(d,p,E),d=d.sibling}function Q1(d,p,E){switch(d.tag){case 26:if(qp(d,p,E),d.flags&mm)if(d.memoizedState!==null)Wp(E,Ol,d.memoizedState,d.memoizedProps);else{var b=d.stateNode,D=d.type;d=d.memoizedProps,((p&335544128)===p||Hh(D,d))&&qs(E,b,D,d)}break;case 5:qp(d,p,E),d.flags&mm&&(b=d.stateNode,D=d.type,d=d.memoizedProps,((p&335544128)===p||Hh(D,d))&&qs(E,b,D,d));break;case 3:case 4:Nc?(b=Ol,Ol=xI(d.stateNode.containerInfo),qp(d,p,E),Ol=b):qp(d,p,E);break;case 22:d.memoizedState===null&&(b=d.alternate,b!==null&&b.memoizedState!==null?(b=mm,mm=16777216,qp(d,p,E),mm=b):qp(d,p,E));break;default:qp(d,p,E)}}function tI(d){var p=d.alternate;if(p!==null&&(d=p.child,d!==null)){p.child=null;do p=d.sibling,d.sibling=null,d=p;while(d!==null)}}function rm(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var E=0;E<p.length;E++){var b=p[E];Yi=b,rI(b,d)}tI(d)}if(d.subtreeFlags&10256)for(d=d.child;d!==null;)nI(d),d=d.sibling}function nI(d){switch(d.tag){case 0:case 11:case 15:rm(d),d.flags&2048&&Td(9,d,d.return);break;case 3:rm(d);break;case 12:rm(d);break;case 22:var p=d.stateNode;d.memoizedState!==null&&p._visibility&2&&(d.return===null||d.return.tag!==13)?(p._visibility&=-3,HA(d)):rm(d);break;default:rm(d)}}function HA(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var E=0;E<p.length;E++){var b=p[E];Yi=b,rI(b,d)}tI(d)}for(d=d.child;d!==null;){switch(p=d,p.tag){case 0:case 11:case 15:Td(8,p,p.return),HA(p);break;case 22:E=p.stateNode,E._visibility&2&&(E._visibility&=-3,HA(p));break;default:HA(p)}d=d.sibling}}function rI(d,p){for(;Yi!==null;){var E=Yi;switch(E.tag){case 0:case 11:case 15:Td(8,E,p);break;case 23:case 22:if(E.memoizedState!==null&&E.memoizedState.cachePool!==null){var b=E.memoizedState.cachePool.pool;b!=null&&b.refCount++}break;case 24:Bu(E.memoizedState.cache)}if(b=E.child,b!==null)b.return=E,Yi=b;else e:for(E=d;Yi!==null;){b=Yi;var D=b.sibling,N=b.return;if(qM(b),b===E){Yi=null;break e}if(D!==null){D.return=N,Yi=D;break e}Yi=N}}}function Qh(d){var p=a2(d);if(p!=null){if(typeof p.memoizedProps["data-testname"]!="string")throw Error(r(364));return p}if(d=aN(d),d===null)throw Error(r(362));return d.stateNode.current}function py(d,p){var E=d.tag;switch(p.$$typeof){case KI:if(d.type===p.value)return!0;break;case JI:e:{for(p=p.value,d=[d,0],E=0;E<d.length;){var b=d[E++],D=b.tag,N=d[E++],Q=p[N];if(D!==5&&D!==26&&D!==27||!Dd(b)){for(;Q!=null&&py(b,Q);)N++,Q=p[N];if(N===p.length){p=!0;break e}else for(b=b.child;b!==null;)d.push(b,N),b=b.sibling}}p=!1}return p;case ZI:if((E===5||E===26||E===27)&&m2(d.stateNode,p.value))return!0;break;case XI:if((E===5||E===6||E===26||E===27)&&(d=f2(d),d!==null&&0<=d.indexOf(p.value)))return!0;break;case WI:if((E===5||E===26||E===27)&&(d=d.memoizedProps["data-testname"],typeof d=="string"&&d.toLowerCase()===p.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function oI(d){switch(d.$$typeof){case KI:return"<"+(h(d.value)||"Unknown")+">";case JI:return":has("+(oI(d)||"")+")";case ZI:return'[role="'+d.value+'"]';case XI:return'"'+d.value+'"';case WI:return'[data-testname="'+d.value+'"]';default:throw Error(r(365))}}function F1(d,p){var E=[];d=[d,0];for(var b=0;b<d.length;){var D=d[b++],N=D.tag,Q=d[b++],K=p[Q];if(N!==5&&N!==26&&N!==27||!Dd(D)){for(;K!=null&&py(D,K);)Q++,K=p[Q];if(Q===p.length)E.push(D);else for(D=D.child;D!==null;)d.push(D,Q),D=D.sibling}}return E}function fy(d,p){if(!KA)throw Error(r(363));d=Qh(d),d=F1(d,p),p=[],d=Array.from(d);for(var E=0;E<d.length;){var b=d[E++],D=b.tag;if(D===5||D===26||D===27)Dd(b)||p.push(b.stateNode);else for(b=b.child;b!==null;)d.push(b),b=b.sibling}return p}function Ka(){return(Gn&2)!==0&&Yn!==0?Yn&-Yn:It.T!==null?L():Dl()}function my(){if(Qu===0)if((Yn&536870912)===0||Un){var d=ky;ky<<=1,(ky&3932160)===0&&(ky=262144),Qu=d}else Qu=536870912;return d=Lu.current,d!==null&&(d.flags|=32),Qu}function Sa(d,p,E){(d===Lr&&(Ir===2||Ir===9)||d.cancelPendingCommit!==null)&&(im(d,0),Vp(d,Yn,Qu,!1)),H(d,E),((Gn&2)===0||d!==Lr)&&(d===Lr&&((Gn&2)===0&&(ag|=E),No===4&&Vp(d,Yn,Qu,!1)),Qs(d))}function G1(d,p,E){if((Gn&6)!==0)throw Error(r(327));var b=!E&&(p&127)===0&&(p&d.expiredLanes)===0||O(d,p),D=b?e2(d,p):jh(d,p,!0),N=b;do{if(D===0){sg&&!b&&Vp(d,p,0,!1);break}else{if(E=d.current.alternate,N&&!JM(E)){D=jh(d,p,!1),N=!1;continue}if(D===2){if(N=p,d.errorRecoveryDisabledLanes&N)var Q=0;else Q=d.pendingLanes&-536870913,Q=Q!==0?Q:Q&536870912?536870912:0;if(Q!==0){p=Q;e:{var K=d;D=jy;var Ae=ys&&K.current.memoizedState.isDehydrated;if(Ae&&(im(K,Q).flags|=256),Q=jh(K,Q,!1),Q!==2){if(vN&&!Ae){K.errorRecoveryDisabledLanes|=N,ag|=N,D=4;break e}N=tu,tu=D,N!==null&&(tu===null?tu=N:tu.push.apply(tu,N))}D=Q}if(N=!1,D!==2)continue}}if(D===1){im(d,0),Vp(d,p,0,!0);break}e:{switch(b=d,N=D,N){case 0:case 1:throw Error(r(345));case 4:if((p&4194048)!==p)break;case 6:Vp(b,p,Qu,!Am);break e;case 2:tu=null;break;case 3:case 5:break;default:throw Error(r(329))}if((p&62914560)===p&&(D=zy+300-Sr(),10<D)){if(Vp(b,p,Qu,!Am),x(b,0,!0)!==0)break e;Pd=p,b.timeoutHandle=s2(iI.bind(null,b,E,tu,tC,eC,p,Qu,ag,a_,Am,N,"Throttled",-0,0),D);break e}iI(b,E,tu,tC,eC,p,Qu,ag,a_,Am,N,null,-0,0)}}break}while(!0);Qs(d)}function iI(d,p,E,b,D,N,Q,K,Ae,De,Ke,je,nt,Ut){if(d.timeoutHandle=Jp,je=p.subtreeFlags,je&8192||(je&16785408)===16785408){je=l2(),Q1(p,N,je);var co=(N&62914560)===N?zy-Sr():(N&4194048)===N?xN-Sr():0;if(co=d2(je,co),co!==null){Pd=N,d.cancelPendingCommit=co($1.bind(null,d,p,N,E,b,D,Q,K,Ae,Ke,je,null,nt,Ut)),Vp(d,N,Q,!De);return}}$1(d,p,N,E,b,D,Q,K,Ae)}function JM(d){for(var p=d;;){var E=p.tag;if((E===0||E===11||E===15)&&p.flags&16384&&(E=p.updateQueue,E!==null&&(E=E.stores,E!==null)))for(var b=0;b<E.length;b++){var D=E[b],N=D.getSnapshot;D=D.value;try{if(!Ts(N(),D))return!1}catch{return!1}}if(E=p.child,p.subtreeFlags&16384&&E!==null)E.return=p,p=E;else{if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function Vp(d,p,E,b){p&=~RN,p&=~ag,d.suspendedLanes|=p,d.pingedLanes&=~p,b&&(d.warmLanes|=p),b=d.expirationTimes;for(var D=p;0<D;){var N=31-Ja(D),Q=1<<N;b[N]=-1,D&=~Q}E!==0&&ae(d,E,p)}function om(){return(Gn&6)===0?(wu(0,!1),!1):!0}function Ay(){if(jn!==null){if(Ir===0)var d=jn.return;else d=jn,uo=Ca=null,Y(d),Pc=null,Uy=0,d=jn;for(;d!==null;)Yb(d.alternate,d),d=d.return;jn=null}}function im(d,p){var E=d.timeoutHandle;E!==Jp&&(d.timeoutHandle=Jp,iN(E)),E=d.cancelPendingCommit,E!==null&&(d.cancelPendingCommit=null,E()),Pd=0,Ay(),Lr=d,jn=E=Id(d.current,null),Yn=p,Ir=0,Uu=null,Am=!1,sg=O(d,p),vN=!1,a_=Qu=RN=ag=gm=No=0,tu=jy=null,eC=!1,(p&8)!==0&&(p|=p&32);var b=d.entangledLanes;if(b!==0)for(d=d.entanglements,b&=p;0<b;){var D=31-Ja(b),N=1<<D;p|=d[D],b&=~N}return of=p,Dr(),E}function ZM(d,p){gn=null,It.H=Qy,p===r_||p===FI?(p=kp(),Ir=3):p===QI?(p=kp(),Ir=4):Ir=p===qI?8:p!==null&&typeof p=="object"&&typeof p.then=="function"?6:1,Uu=p,jn===null&&(No=1,ey(d,ut(p,d.current)))}function WM(){var d=Lu.current;return d===null?!0:(Yn&4194048)===Yn?Lc===null:(Yn&62914560)===Yn||(Yn&536870912)!==0?d===Lc:!1}function j1(){var d=It.H;return It.H=Qy,d===null?Qy:d}function Fh(){var d=It.A;return It.A=Iq,d}function Gh(){No=4,Am||(Yn&4194048)!==Yn&&Lu.current!==null||(sg=!0),(gm&134217727)===0&&(ag&134217727)===0||Lr===null||Vp(Lr,Yn,Qu,!1)}function jh(d,p,E){var b=Gn;Gn|=2;var D=j1(),N=Fh();(Lr!==d||Yn!==p)&&(tC=null,im(d,p)),p=!1;var Q=No;e:do try{if(Ir!==0&&jn!==null){var K=jn,Ae=Uu;switch(Ir){case 8:Ay(),Q=6;break e;case 3:case 2:case 9:case 6:Lu.current===null&&(p=!0);var De=Ir;if(Ir=0,Uu=null,$A(d,K,Ae,De),E&&sg){Q=0;break e}break;default:De=Ir,Ir=0,Uu=null,$A(d,K,Ae,De)}}XM(),Q=No;break}catch(Ke){ZM(d,Ke)}while(!0);return p&&d.shellSuspendCounter++,uo=Ca=null,Gn=b,It.H=D,It.A=N,jn===null&&(Lr=null,Yn=0,Dr()),Q}function XM(){for(;jn!==null;)sI(jn)}function e2(d,p){var E=Gn;Gn|=2;var b=j1(),D=Fh();Lr!==d||Yn!==p?(tC=null,u_=Sr()+500,im(d,p)):sg=O(d,p);e:do try{if(Ir!==0&&jn!==null){p=jn;var N=Uu;t:switch(Ir){case 1:Ir=0,Uu=null,$A(d,p,N,1);break;case 2:case 9:if(pn(N)){Ir=0,Uu=null,H1(p);break}p=function(){Ir!==2&&Ir!==9||Lr!==d||(Ir=7),Qs(d)},N.then(p,p);break e;case 3:Ir=7;break e;case 4:Ir=5;break e;case 7:pn(N)?(Ir=0,Uu=null,H1(p)):(Ir=0,Uu=null,$A(d,p,N,7));break;case 5:var Q=null;switch(jn.tag){case 26:Q=jn.memoizedState;case 5:case 27:var K=jn,Ae=K.type,De=K.pendingProps;if(Q?NI(Q):Ss(K.stateNode,Ae,De)){Ir=0,Uu=null;var Ke=K.sibling;if(Ke!==null)jn=Ke;else{var je=K.return;je!==null?(jn=je,bd(je)):jn=null}break t}}Ir=0,Uu=null,$A(d,p,N,5);break;case 6:Ir=0,Uu=null,$A(d,p,N,6);break;case 8:Ay(),No=6;break e;default:throw Error(r(462))}}z1();break}catch(nt){ZM(d,nt)}while(!0);return uo=Ca=null,It.H=b,It.A=D,Gn=E,jn!==null?0:(Lr=null,Yn=0,Dr(),No)}function z1(){for(;jn!==null&&!Sq();)sI(jn)}function sI(d){var p=Hb(d.alternate,d,of);d.memoizedProps=d.pendingProps,p===null?bd(d):jn=p}function H1(d){var p=d,E=p.alternate;switch(p.tag){case 15:case 0:p=B1(E,p,p.pendingProps,p.type,void 0,Yn);break;case 11:p=B1(E,p,p.pendingProps,p.type.render,p.ref,Yn);break;case 5:Y(p);default:Yb(E,p),p=jn=K1(p,of),p=Hb(E,p,of)}d.memoizedProps=d.pendingProps,p===null?bd(d):jn=p}function $A(d,p,E,b){uo=Ca=null,Y(p),Pc=null,Uy=0;var D=p.return;try{if(js(d,D,p,E,Yn)){No=1,ey(d,ut(E,d.current)),jn=null;return}}catch(N){if(D!==null)throw jn=D,N;No=1,ey(d,ut(E,d.current)),jn=null;return}p.flags&32768?(Un||b===1?d=!0:sg||(Yn&536870912)!==0?d=!1:(Am=d=!0,(b===2||b===9||b===3||b===6)&&(b=Lu.current,b!==null&&b.tag===13&&(b.flags|=16384))),gy(p,d)):bd(p)}function bd(d){var p=d;do{if((p.flags&32768)!==0){gy(p,Am);return}d=p.return;var E=zA(p.alternate,p,of);if(E!==null){jn=E;return}if(p=p.sibling,p!==null){jn=p;return}jn=p=d}while(p!==null);No===0&&(No=5)}function gy(d,p){do{var E=Il(d.alternate,d);if(E!==null){E.flags&=32767,jn=E;return}if(E=d.return,E!==null&&(E.flags|=32768,E.subtreeFlags=0,E.deletions=null),!p&&(d=d.sibling,d!==null)){jn=d;return}jn=d=E}while(d!==null);No=6,jn=null}function $1(d,p,E,b,D,N,Q,K,Ae){d.cancelPendingCommit=null;do qo();while(Cr!==0);if((Gn&6)!==0)throw Error(r(327));if(p!==null){if(p===d.current)throw Error(r(177));if(N=p.lanes|p.childLanes,N|=bN,V(d,E,N,Q,K,Ae),d===Lr&&(jn=Lr=null,Yn=0),_m=p,sf=d,Pd=E,nC=N,rC=D,Z2=b,(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?(d.callbackNode=null,d.callbackPriority=0,aq(ef,function(){return q1(),null})):(d.callbackNode=null,d.callbackPriority=0),b=(p.flags&13878)!==0,(p.subtreeFlags&13878)!==0||b){b=It.T,It.T=null,D=Rd(),xi(2),Q=Gn,Gn|=4;try{$M(d,p,E)}finally{Gn=Q,xi(D),It.T=b}}Cr=1,aI(),uI(),cI()}}function aI(){if(Cr===1){Cr=0;var d=sf,p=_m,E=(p.flags&13878)!==0;if((p.subtreeFlags&13878)!==0||E){E=It.T,It.T=null;var b=Rd();xi(2);var D=Gn;Gn|=4;try{dy(p,d),Cy(d.containerInfo)}finally{Gn=D,xi(b),It.T=E}}d.current=p,Cr=2}}function uI(){if(Cr===2){Cr=0;var d=sf,p=_m,E=(p.flags&8772)!==0;if((p.subtreeFlags&8772)!==0||E){E=It.T,It.T=null;var b=Rd();xi(2);var D=Gn;Gn|=4;try{L1(d,p.alternate,p)}finally{Gn=D,xi(b),It.T=E}}Cr=3}}function cI(){if(Cr===4||Cr===3){Cr=0,Za();var d=sf,p=_m,E=Pd,b=Z2;(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?Cr=5:(Cr=0,_m=sf=null,t2(d,d.pendingLanes));var D=d.pendingLanes;if(D===0&&(hm=null),pt(E),p=p.stateNode,Vo&&typeof Vo.onCommitFiberRoot=="function")try{Vo.onCommitFiberRoot(tg,p,void 0,(p.current.flags&128)===128)}catch{}if(b!==null){p=It.T,D=Rd(),xi(2),It.T=null;try{for(var N=d.onRecoverableError,Q=0;Q<b.length;Q++){var K=b[Q];N(K.value,{componentStack:K.stack})}}finally{It.T=p,xi(D)}}(Pd&3)!==0&&qo(),Qs(d),D=d.pendingLanes,(E&261930)!==0&&(D&42)!==0?d===oC?c_++:(c_=0,oC=d):c_=0,ys&&L2(),wu(0,!1)}}function t2(d,p){(d.pooledCacheLanes&=p)===0&&(p=d.pooledCache,p!=null&&(d.pooledCache=null,Bu(p)))}function qo(){return aI(),uI(),cI(),q1()}function q1(){if(Cr!==5)return!1;var d=sf,p=nC;nC=0;var E=pt(Pd),b=32>E?32:E;E=It.T;var D=Rd();try{xi(b),It.T=null,b=rC,rC=null;var N=sf,Q=Pd;if(Cr=0,_m=sf=null,Pd=0,(Gn&6)!==0)throw Error(r(331));var K=Gn;if(Gn|=4,nI(N.current),KM(N,N.current,Q,b),Gn=K,wu(0,!1),Vo&&typeof Vo.onPostCommitFiberRoot=="function")try{Vo.onPostCommitFiberRoot(tg,N)}catch{}return!0}finally{xi(D),It.T=E,t2(d,p)}}function V1(d,p,E){p=ut(E,p),p=Oh(d.stateNode,p,2),d=yc(d,p,2),d!==null&&(H(d,2),Qs(d))}function ur(d,p,E){if(d.tag===3)V1(d,d,E);else for(;p!==null;){if(p.tag===3){V1(p,d,E);break}else if(p.tag===1){var b=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(hm===null||!hm.has(b))){d=ut(E,d),E=ty(2),b=yc(p,E,2),b!==null&&(Ub(E,b,p,d),H(b,2),Qs(b));break}}p=p.return}}function lI(d,p,E){var b=d.pingCache;if(b===null){b=d.pingCache=new Cq;var D=new Set;b.set(p,D)}else D=b.get(p),D===void 0&&(D=new Set,b.set(p,D));D.has(E)||(vN=!0,D.add(E),d=hy.bind(null,d,p,E),p.then(d,d))}function hy(d,p,E){var b=d.pingCache;b!==null&&b.delete(p),d.pingedLanes|=d.suspendedLanes&E,d.warmLanes&=~E,Lr===d&&(Yn&E)===E&&(No===4||No===3&&(Yn&62914560)===Yn&&300>Sr()-zy?(Gn&2)===0&&im(d,0):RN|=E,a_===Yn&&(a_=0)),Qs(d)}function Y1(d,p){p===0&&(p=j()),d=Ec(d,p),d!==null&&(H(d,p),Qs(d))}function dI(d){var p=d.memoizedState,E=0;p!==null&&(E=p.retryLane),Y1(d,E)}function n2(d,p){var E=0;switch(d.tag){case 31:case 13:var b=d.stateNode,D=d.memoizedState;D!==null&&(E=D.retryLane);break;case 19:b=d.stateNode;break;case 22:b=d.stateNode._retryCache;break;default:throw Error(r(314))}b!==null&&b.delete(p),Y1(d,E)}function aq(d,p){return kI(d,p)}function pI(d,p,E,b){this.tag=d,this.key=E,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _y(d){return d=d.prototype,!(!d||!d.isReactComponent)}function Id(d,p){var E=d.alternate;return E===null?(E=t(d.tag,p,d.key,d.mode),E.elementType=d.elementType,E.type=d.type,E.stateNode=d.stateNode,E.alternate=d,d.alternate=E):(E.pendingProps=p,E.type=d.type,E.flags=0,E.subtreeFlags=0,E.deletions=null),E.flags=d.flags&65011712,E.childLanes=d.childLanes,E.lanes=d.lanes,E.child=d.child,E.memoizedProps=d.memoizedProps,E.memoizedState=d.memoizedState,E.updateQueue=d.updateQueue,p=d.dependencies,E.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},E.sibling=d.sibling,E.index=d.index,E.ref=d.ref,E.refCleanup=d.refCleanup,E}function K1(d,p){d.flags&=65011714;var E=d.alternate;return E===null?(d.childLanes=0,d.lanes=p,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=E.childLanes,d.lanes=E.lanes,d.child=E.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=E.memoizedProps,d.memoizedState=E.memoizedState,d.updateQueue=E.updateQueue,d.type=E.type,p=E.dependencies,d.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),d}function Ey(d,p,E,b,D,N){var Q=0;if(b=d,typeof d=="function")_y(d)&&(Q=1);else if(typeof d=="string")Q=Nc&&ci?gN(d,E,bs.current)?26:OI(d)?27:5:Nc?gN(d,E,bs.current)?26:5:ci&&OI(d)?27:5;else e:switch(d){case EI:return d=t(31,E,p,D),d.elementType=EI,d.lanes=N,d;case qA:return Yp(E.children,D,N,p);case X1:Q=8,D|=24;break;case by:return d=t(12,E,p,D|2),d.elementType=by,d.lanes=N,d;case VA:return d=t(13,E,p,D),d.elementType=VA,d.lanes=N,d;case br:return d=t(19,E,p,D),d.elementType=br,d.lanes=N,d;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case Kp:Q=10;break e;case _I:Q=9;break e;case zh:Q=11;break e;case eN:Q=14;break e;case am:Q=16,b=null;break e}Q=29,E=Error(r(130,d===null?"null":typeof d,"")),b=null}return p=t(Q,E,p,D),p.elementType=d,p.type=b,p.lanes=N,p}function Yp(d,p,E,b){return d=t(7,d,b,p),d.lanes=E,d}function yy(d,p,E){return d=t(6,d,null,p),d.lanes=E,d}function fI(d){var p=t(18,null,null,0);return p.stateNode=d,p}function mI(d,p,E){return p=t(4,d.children!==null?d.children:[],d.key,p),p.lanes=E,p.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},p}function J1(d,p,E,b,D,N,Q,K,Ae){this.tag=1,this.containerInfo=d,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Jp,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=G(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=G(0),this.hiddenUpdates=G(null),this.identifierPrefix=b,this.onUncaughtError=D,this.onCaughtError=N,this.onRecoverableError=Q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ae,this.incompleteTransitions=new Map}function Sy(d,p,E,b,D,N,Q,K,Ae,De,Ke,je){return d=new J1(d,p,E,Q,Ae,De,Ke,je,K),p=1,N===!0&&(p|=24),N=t(3,null,null,p),d.current=N,N.stateNode=d,p=Jf(),p.refCount++,d.pooledCache=p,p.refCount++,N.memoizedState={element:b,isDehydrated:E,cache:p},Mp(N),d}function AI(d){return d?(d=eg,d):eg}function Z1(d){var p=d._reactInternals;if(p===void 0)throw typeof d.render=="function"?Error(r(188)):(d=Object.keys(d).join(","),Error(r(268,d)));return d=s(p),d=d!==null?u(d):null,d===null?null:Iy(d.stateNode)}function gI(d,p,E,b,D,N){D=AI(D),b.context===null?b.context=D:b.pendingContext=D,b=ha(p),b.payload={element:E},N=N===void 0?null:N,N!==null&&(b.callback=N),E=yc(d,b,p),E!==null&&(Sa(E,d,p),UA(E,d,p))}function W1(d,p){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var E=d.retryLane;d.retryLane=E!==0&&E<p?E:p}}function Rl(d,p){W1(d,p),(d=d.alternate)&&W1(d,p)}var wn={},uq=dn(),Ta=SH(),Pu=Object.assign,hI=Symbol.for("react.element"),Ty=Symbol.for("react.transitional.element"),sm=Symbol.for("react.portal"),qA=Symbol.for("react.fragment"),X1=Symbol.for("react.strict_mode"),by=Symbol.for("react.profiler"),_I=Symbol.for("react.consumer"),Kp=Symbol.for("react.context"),zh=Symbol.for("react.forward_ref"),VA=Symbol.for("react.suspense"),br=Symbol.for("react.suspense_list"),eN=Symbol.for("react.memo"),am=Symbol.for("react.lazy"),EI=Symbol.for("react.activity"),Cd=Symbol.for("react.memo_cache_sentinel"),tN=Symbol.iterator,nN=Symbol.for("react.client.reference"),um=Array.isArray,It=uq.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,r2=e.rendererVersion,rN=e.rendererPackageName,oN=e.extraDevToolsConfig,Iy=e.getPublicInstance,cq=e.getRootHostContext,o2=e.getChildHostContext,lq=e.prepareForCommit,Cy=e.resetAfterCommit,vd=e.createInstance;e.cloneMutableInstance;var yI=e.appendInitialChild,i2=e.finalizeInitialChildren,vy=e.shouldSetTextContent,SI=e.createTextInstance;e.cloneMutableTextInstance;var s2=e.scheduleTimeout,iN=e.cancelTimeout,Jp=e.noTimeout,Dc=e.isPrimaryRenderer;e.warnsIfNotActing;var $s=e.supportsMutation,xl=e.supportsPersistence,ys=e.supportsHydration,a2=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var dq=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var xi=e.setCurrentUpdatePriority,Rd=e.getCurrentUpdatePriority,Dl=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var sN=e.shouldAttemptEagerTransition,u2=e.detachDeletedInstance;e.requestPostPaintCallback;var c2=e.maySuspendCommit,pq=e.maySuspendCommitOnUpdate,Hh=e.maySuspendCommitInSyncRender,Ss=e.preloadInstance,l2=e.startSuspendingCommit,qs=e.suspendInstance;e.suspendOnActiveViewTransition;var d2=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var ba=e.NotPendingTransition,cm=e.HostTransitionContext,YA=e.resetFormInstance;e.bindToConsole;var p2=e.supportsMicrotasks,xd=e.scheduleMicrotask,KA=e.supportsTestSelectors,aN=e.findFiberRoot,Nl=e.getBoundingRect,f2=e.getTextContent,Dd=e.isHiddenSubtree,m2=e.matchAccessibilityRole,Ry=e.setFocusIfFocusable,JA=e.setupIntersectionObserver,A2=e.appendChild,g2=e.appendChildToContainer,xy=e.commitTextUpdate,h2=e.commitMount,TI=e.commitUpdate,_2=e.insertBefore,E2=e.insertInContainerBefore,uN=e.removeChild,cN=e.removeChildFromContainer,bI=e.resetTextContent,y2=e.hideInstance,II=e.hideTextInstance,fq=e.unhideInstance,S2=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var Mu=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var T2=e.cloneInstance,so=e.createContainerChildSet,lN=e.appendChildToContainerChildSet,b2=e.finalizeContainerChildren,I2=e.replaceContainerChildren,Zp=e.cloneHiddenInstance,Dy=e.cloneHiddenTextInstance,Ny=e.isSuspenseInstancePending,By=e.isSuspenseInstanceFallback,ZA=e.getSuspenseInstanceFallbackErrorDetails,$h=e.registerSuspenseInstanceRetry,C2=e.canHydrateFormStateMarker,v2=e.isFormStateMarkerMatching,dN=e.getNextHydratableSibling,R2=e.getNextHydratableSiblingAfterSingleton,CI=e.getFirstHydratableChild,vI=e.getFirstHydratableChildWithinContainer,pN=e.getFirstHydratableChildWithinActivityInstance,x2=e.getFirstHydratableChildWithinSuspenseInstance,mq=e.getFirstHydratableChildWithinSingleton,Aq=e.canHydrateInstance,D2=e.canHydrateTextInstance,N2=e.canHydrateActivityInstance,gq=e.canHydrateSuspenseInstance,qh=e.hydrateInstance,RI=e.hydrateTextInstance,B2=e.hydrateActivityInstance,fN=e.hydrateSuspenseInstance,w2=e.getNextHydratableInstanceAfterActivityInstance,O2=e.getNextHydratableInstanceAfterSuspenseInstance,k2=e.commitHydratedInstance,hq=e.commitHydratedContainer,P2=e.commitHydratedActivityInstance,Vh=e.commitHydratedSuspenseInstance,M2=e.finalizeHydratedChildren,L2=e.flushHydrationEvents;e.clearActivityBoundary;var cr=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var mN=e.clearSuspenseBoundaryFromContainer,_q=e.hideDehydratedBoundary,U2=e.unhideDehydratedBoundary,Q2=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var Eq=e.validateHydratableInstance,AN=e.validateHydratableTextInstance,Nc=e.supportsResources,gN=e.isHostHoistableType,xI=e.getHoistableRoot,Yh=e.getResource,F2=e.acquireResource,G2=e.releaseResource,WA=e.hydrateHoistable,DI=e.mountHoistable,hN=e.unmountHoistable,j2=e.createHoistableInstance,z2=e.prepareToCommitHoistables,yq=e.mayResourceSuspendCommit,NI=e.preloadResource,Wp=e.suspendResource,ci=e.supportsSingletons,BI=e.resolveSingletonInstance,wI=e.acquireSingletonInstance,lm=e.releaseSingletonInstance,OI=e.isHostSingletonType,XA=e.isSingletonScope,wy=[],Kh=-1,eg={},Ja=Math.clz32?Math.clz32:v,H2=Math.log,$2=Math.LN2,Oy=256,ky=262144,Jh=4194304,kI=Ta.unstable_scheduleCallback,On=Ta.unstable_cancelCallback,Sq=Ta.unstable_shouldYield,Za=Ta.unstable_requestPaint,Sr=Ta.unstable_now,q2=Ta.unstable_ImmediatePriority,Xp=Ta.unstable_UserBlockingPriority,ef=Ta.unstable_NormalPriority,Zh=Ta.unstable_IdlePriority,PI=Ta.log,_N=Ta.unstable_setDisableYieldValue,tg=null,Vo=null,Ts=typeof Object.is=="function"?Object.is:Pt,MI=typeof reportError=="function"?reportError:function(d){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof d=="object"&&d!==null&&typeof d.message=="string"?String(d.message):String(d),error:d});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",d);return}console.error(d)},EN=Object.prototype.hasOwnProperty,Wh,Wa,Py=!1,V2=new WeakMap,ng=[],Xh=0,li=null,le=0,Bc=[],wc=0,tf=null,Ia=1,Nd="",bs=_(null),My=_(null),dm=_(null),LI=_(null),Di=null,ao=null,Un=!1,nf=null,Oc=!1,yN=Error(r(519)),Bd=_(null),Ca=null,uo=null,wd=typeof AbortController<"u"?AbortController:function(){var d=[],p=this.signal={aborted:!1,addEventListener:function(E,b){d.push(b)}};this.abort=function(){p.aborted=!0,d.forEach(function(E){return E()})}},Vs=Ta.unstable_scheduleCallback,Tq=Ta.unstable_NormalPriority,Eo={$$typeof:Kp,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Yo=null,Xa=null,SN=!1,e_=!1,rg=!1,Bl=0,Ly=null,TN=0,t_=0,n_=null,UI=It.S;It.S=function(d,p){xN=Sr(),typeof p=="object"&&p!==null&&typeof p.then=="function"&&ne(d,p),UI!==null&&UI(d,p)};var pm=_(null),r_=Error(r(460)),QI=Error(r(474)),FI=Error(r(542)),GI={then:function(){}},kc=null,Pc=null,Uy=0,og=z0(!0),Y2=z0(!1),Mc=[],wl=0,bN=0,fm=!1,IN=!1,Od=_(null),jI=_(0),Lu=_(null),Lc=null,Ko=_(0),rf=0,gn=null,Nr=null,di=null,zI=!1,o_=!1,ig=!1,HI=0,i_=0,s_=null,bq=0,Qy={readContext:ho,use:Te,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useLayoutEffect:Xr,useInsertionEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useSyncExternalStore:Xr,useId:Xr,useHostTransitionStatus:Xr,useFormState:Xr,useActionState:Xr,useOptimistic:Xr,useMemoCache:Xr,useCacheRefresh:Xr};Qy.useEffectEvent=Xr;var K2={readContext:ho,use:Te,useCallback:function(d,p){return X().memoizedState=[d,p===void 0?null:p],d},useContext:ho,useEffect:y1,useImperativeHandle:function(d,p,E){E=E!=null?E.concat([d]):null,K0(4194308,4,zM.bind(null,p,d),E)},useLayoutEffect:function(d,p){return K0(4194308,4,d,p)},useInsertionEffect:function(d,p){K0(4,2,d,p)},useMemo:function(d,p){var E=X();p=p===void 0?null:p;var b=d();if(ig){Ge(!0);try{d()}finally{Ge(!1)}}return E.memoizedState=[b,p],b},useReducer:function(d,p,E){var b=X();if(E!==void 0){var D=E(p);if(ig){Ge(!0);try{E(p)}finally{Ge(!1)}}}else D=p;return b.memoizedState=b.baseState=D,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:D},b.queue=d,d=d.dispatch=_s.bind(null,gn,d),[b.memoizedState,d]},useRef:function(d){var p=X();return d={current:d},p.memoizedState=d},useState:function(d){d=qi(d);var p=d.queue,E=Mb.bind(null,gn,p);return p.dispatch=E,[d.memoizedState,E]},useDebugValue:b1,useDeferredValue:function(d,p){var E=X();return kb(E,d,p)},useTransition:function(){var d=qi(!1);return d=I1.bind(null,gn,d.queue,!0,!1),X().memoizedState=d,[!1,d]},useSyncExternalStore:function(d,p,E){var b=gn,D=X();if(Un){if(E===void 0)throw Error(r(407));E=E()}else{if(E=p(),Lr===null)throw Error(r(349));(Yn&127)!==0||pr(b,p,E)}D.memoizedState=E;var N={value:E,getSnapshot:p};return D.queue=N,y1(gs.bind(null,b,N,d),[d]),b.flags|=2048,Ea(9,{destroy:void 0},io.bind(null,b,N,E,p),null),E},useId:function(){var d=X(),p=Lr.identifierPrefix;if(Un){var E=Nd,b=Ia;E=(b&~(1<<32-Ja(b)-1)).toString(32)+E,p="_"+p+"R_"+E,E=HI++,0<E&&(p+="H"+E.toString(32)),p+="_"}else E=bq++,p="_"+p+"r_"+E.toString(32)+"_";return d.memoizedState=p},useHostTransitionStatus:Pb,useFormState:Sl,useActionState:Sl,useOptimistic:function(d){var p=X();p.memoizedState=p.baseState=d;var E={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return p.queue=E,p=wh.bind(null,gn,!0,E),E.dispatch=p,[d,p]},useMemoCache:Ve,useCacheRefresh:function(){return X().memoizedState=HM.bind(null,gn)},useEffectEvent:function(d){var p=X(),E={impl:d};return p.memoizedState=E,function(){if((Gn&2)!==0)throw Error(r(440));return E.impl.apply(void 0,arguments)}}},CN={readContext:ho,use:Te,useCallback:Ob,useContext:ho,useEffect:Nb,useImperativeHandle:T1,useInsertionEffect:S1,useLayoutEffect:wb,useMemo:J0,useReducer:Ze,useRef:FA,useState:function(){return Ze(Pe)},useDebugValue:b1,useDeferredValue:function(d,p){var E=te();return Z0(E,Nr.memoizedState,d,p)},useTransition:function(){var d=Ze(Pe)[0],p=te().memoizedState;return[typeof d=="boolean"?d:xe(d),p]},useSyncExternalStore:dr,useId:jp,useHostTransitionStatus:Pb,useFormState:E1,useActionState:E1,useOptimistic:function(d,p){var E=te();return hs(E,Nr,d,p)},useMemoCache:Ve,useCacheRefresh:v1};CN.useEffectEvent=Bb;var J2={readContext:ho,use:Te,useCallback:Ob,useContext:ho,useEffect:Nb,useImperativeHandle:T1,useInsertionEffect:S1,useLayoutEffect:wb,useMemo:J0,useReducer:In,useRef:FA,useState:function(){return In(Pe)},useDebugValue:b1,useDeferredValue:function(d,p){var E=te();return Nr===null?kb(E,d,p):Z0(E,Nr.memoizedState,d,p)},useTransition:function(){var d=In(Pe)[0],p=te().memoizedState;return[typeof d=="boolean"?d:xe(d),p]},useSyncExternalStore:dr,useId:jp,useHostTransitionStatus:Pb,useFormState:Y0,useActionState:Y0,useOptimistic:function(d,p){var E=te();return Nr!==null?hs(E,Nr,d,p):(E.baseState=d,[d,E.queue.dispatch])},useMemoCache:Ve,useCacheRefresh:v1};J2.useEffectEvent=Bb;var $I={enqueueSetState:function(d,p,E){d=d._reactInternals;var b=Ka(),D=ha(b);D.payload=p,E!=null&&(D.callback=E),p=yc(d,D,b),p!==null&&(Sa(p,d,b),UA(p,d,b))},enqueueReplaceState:function(d,p,E){d=d._reactInternals;var b=Ka(),D=ha(b);D.tag=1,D.payload=p,E!=null&&(D.callback=E),p=yc(d,D,b),p!==null&&(Sa(p,d,b),UA(p,d,b))},enqueueForceUpdate:function(d,p){d=d._reactInternals;var E=Ka(),b=ha(E);b.tag=2,p!=null&&(b.callback=p),p=yc(d,b,E),p!==null&&(Sa(p,d,E),UA(p,d,E))}},qI=Error(r(461)),pi=!1,VI={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},kd=!1,Jo=!1,Fy=!1,YI=typeof WeakSet=="function"?WeakSet:Set,Yi=null,fi=null,eu=!1,Ol=null,mm=8192,Iq={getCacheForType:function(d){var p=ho(Eo),E=p.data.get(d);return E===void 0&&(E=d(),p.data.set(d,E)),E},cacheSignal:function(){return ho(Eo).controller.signal}},KI=0,JI=1,ZI=2,WI=3,XI=4;if(typeof Symbol=="function"&&Symbol.for){var Gy=Symbol.for;KI=Gy("selector.component"),JI=Gy("selector.has_pseudo_class"),ZI=Gy("selector.role"),WI=Gy("selector.test_id"),XI=Gy("selector.text")}var Cq=typeof WeakMap=="function"?WeakMap:Map,Gn=0,Lr=null,jn=null,Yn=0,Ir=0,Uu=null,Am=!1,sg=!1,vN=!1,of=0,No=0,gm=0,ag=0,RN=0,Qu=0,a_=0,jy=null,tu=null,eC=!1,zy=0,xN=0,u_=1/0,tC=null,hm=null,Cr=0,sf=null,_m=null,Pd=0,nC=0,rC=null,Z2=null,c_=0,oC=null;return wn.attemptContinuousHydration=function(d){if(d.tag===13||d.tag===31){var p=Ec(d,67108864);p!==null&&Sa(p,d,67108864),Rl(d,67108864)}},wn.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13||d.tag===31){var p=Ka();p=Qe(p);var E=Ec(d,p);E!==null&&Sa(E,d,p),Rl(d,p)}},wn.attemptSynchronousHydration=function(d){switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var p=R(d.pendingLanes);if(p!==0){for(d.pendingLanes|=2,d.entangledLanes|=2;p;){var E=1<<31-Ja(p);d.entanglements[1]|=E,p&=~E}Qs(d),(Gn&6)===0&&(u_=Sr()+500,wu(0,!1))}}break;case 31:case 13:p=Ec(d,2),p!==null&&Sa(p,d,2),om(),Rl(d,2)}},wn.batchedUpdates=function(d,p){return d(p)},wn.createComponentSelector=function(d){return{$$typeof:KI,value:d}},wn.createContainer=function(d,p,E,b,D,N,Q,K,Ae,De){return Sy(d,p,!1,null,E,b,N,null,Q,K,Ae,De)},wn.createHasPseudoClassSelector=function(d){return{$$typeof:JI,value:d}},wn.createHydrationContainer=function(d,p,E,b,D,N,Q,K,Ae,De,Ke,je,nt,Ut){return d=Sy(E,b,!0,d,D,N,K,Ut,Ae,De,Ke,je),d.context=AI(null),E=d.current,b=Ka(),b=Qe(b),D=ha(b),D.callback=p??null,yc(E,D,b),p=b,d.current.lanes=p,H(d,p),Qs(d),d},wn.createPortal=function(d,p,E){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sm,key:b==null?null:""+b,children:d,containerInfo:p,implementation:E}},wn.createRoleSelector=function(d){return{$$typeof:ZI,value:d}},wn.createTestNameSelector=function(d){return{$$typeof:WI,value:d}},wn.createTextSelector=function(d){return{$$typeof:XI,value:d}},wn.defaultOnCaughtError=function(d){console.error(d)},wn.defaultOnRecoverableError=function(d){MI(d)},wn.defaultOnUncaughtError=function(d){MI(d)},wn.deferredUpdates=function(d){var p=It.T,E=Rd();try{return xi(32),It.T=null,d()}finally{xi(E),It.T=p}},wn.discreteUpdates=function(d,p,E,b,D){var N=It.T,Q=Rd();try{return xi(2),It.T=null,d(p,E,b,D)}finally{xi(Q),It.T=N,Gn===0&&(u_=Sr()+500)}},wn.findAllNodes=fy,wn.findBoundingRects=function(d,p){if(!KA)throw Error(r(363));p=fy(d,p),d=[];for(var E=0;E<p.length;E++)d.push(Nl(p[E]));for(p=d.length-1;0<p;p--){E=d[p];for(var b=E.x,D=b+E.width,N=E.y,Q=N+E.height,K=p-1;0<=K;K--)if(p!==K){var Ae=d[K],De=Ae.x,Ke=De+Ae.width,je=Ae.y,nt=je+Ae.height;if(b>=De&&N>=je&&D<=Ke&&Q<=nt){d.splice(p,1);break}else if(b!==De||E.width!==Ae.width||nt<N||je>Q){if(!(N!==je||E.height!==Ae.height||Ke<b||De>D)){De>b&&(Ae.width+=De-b,Ae.x=b),Ke<D&&(Ae.width=D-De),d.splice(p,1);break}}else{je>N&&(Ae.height+=je-N,Ae.y=N),nt<Q&&(Ae.height=Q-je),d.splice(p,1);break}}}return d},wn.findHostInstance=Z1,wn.findHostInstanceWithNoPortals=function(d){return d=s(d),d=d!==null?l(d):null,d===null?null:Iy(d.stateNode)},wn.findHostInstanceWithWarning=function(d){return Z1(d)},wn.flushPassiveEffects=qo,wn.flushSyncFromReconciler=function(d){var p=Gn;Gn|=1;var E=It.T,b=Rd();try{if(xi(2),It.T=null,d)return d()}finally{xi(b),It.T=E,Gn=p,(Gn&6)===0&&wu(0,!1)}},wn.flushSyncWork=om,wn.focusWithin=function(d,p){if(!KA)throw Error(r(363));for(d=Qh(d),p=F1(d,p),p=Array.from(p),d=0;d<p.length;){var E=p[d++],b=E.tag;if(!Dd(E)){if((b===5||b===26||b===27)&&Ry(E.stateNode))return!0;for(E=E.child;E!==null;)p.push(E),E=E.sibling}}return!1},wn.getFindAllNodesFailureDescription=function(d,p){if(!KA)throw Error(r(363));var E=0,b=[];d=[Qh(d),0];for(var D=0;D<d.length;){var N=d[D++],Q=N.tag,K=d[D++],Ae=p[K];if((Q!==5&&Q!==26&&Q!==27||!Dd(N))&&(py(N,Ae)&&(b.push(oI(Ae)),K++,K>E&&(E=K)),K<p.length))for(N=N.child;N!==null;)d.push(N,K),N=N.sibling}if(E<p.length){for(d=[];E<p.length;E++)d.push(oI(p[E]));return`findAllNodes was able to match part of the selector:
134
+ `+b.stack}}function ut(d,p){if(typeof d=="object"&&d!==null){var E=V2.get(d);return E!==void 0?E:(p={value:d,source:p,stack:ot(p)},V2.set(d,p),p)}return{value:d,source:p,stack:ot(p)}}function Lt(d,p){ng[Xh++]=le,ng[Xh++]=li,li=d,le=p}function Gr(d,p,E){Bc[wc++]=Ia,Bc[wc++]=Nd,Bc[wc++]=tf,tf=d;var b=Ia;d=Nd;var D=32-Ja(b)-1;b&=~(1<<D),E+=1;var N=32-Ja(p)+D;if(30<N){var Q=D-D%5;N=(b&(1<<Q)-1).toString(32),b>>=Q,D-=Q,Ia=1<<32-Ja(p)+D|E<<D|b,Nd=N+d}else Ia=1<<N|E<<D|b,Nd=d}function be(d){d.return!==null&&(Lt(d,1),Gr(d,1,0))}function mt(d){for(;d===li;)li=ng[--Xh],ng[Xh]=null,le=ng[--Xh],ng[Xh]=null;for(;d===tf;)tf=Bc[--wc],Bc[wc]=null,Nd=Bc[--wc],Bc[wc]=null,Ia=Bc[--wc],Bc[wc]=null}function en(d,p){Bc[wc++]=Ia,Bc[wc++]=Nd,Bc[wc++]=tf,Ia=p.id,Nd=p.overflow,tf=d}function Tn(d,p){T(dm,p),T(My,d),T(bs,null),d=cq(p),y(bs),T(bs,d)}function yr(){y(bs),y(My),y(dm)}function Us(d){d.memoizedState!==null&&T(LI,d);var p=bs.current,E=o2(p,d.type);p!==E&&(T(My,d),T(bs,E))}function Vn(d){My.current===d&&(y(bs),y(My)),LI.current===d&&(y(LI),Dc?cm._currentValue=ba:cm._currentValue2=ba)}function ar(d){var p=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rt(ut(p,d)),yN}function zt(d,p){if(!ys)throw Error(r(175));qh(d.stateNode,d.type,d.memoizedProps,p,d)||ar(d,!0)}function Mn(d){for(Di=d.return;Di;)switch(Di.tag){case 5:case 31:case 13:Oc=!1;return;case 27:case 3:Oc=!0;return;default:Di=Di.return}}function ft(d){if(!ys||d!==Di)return!1;if(!Un)return Mn(d),Un=!0,!1;var p=d.tag;if(ci?p!==3&&p!==27&&(p!==5||Q2(d.type)&&!vy(d.type,d.memoizedProps))&&ao&&ar(d):p!==3&&(p!==5||Q2(d.type)&&!vy(d.type,d.memoizedProps))&&ao&&ar(d),Mn(d),p===13){if(!ys)throw Error(r(316));if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));ao=O2(d)}else if(p===31){if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));ao=w2(d)}else ao=ci&&p===27?R2(d.type,ao):Di?dN(d.stateNode):null;return!0}function tn(){ys&&(ao=Di=null,Un=!1)}function bn(){var d=nf;return d!==null&&(tu===null?tu=d:tu.push.apply(tu,d),nf=null),d}function Rt(d){nf===null?nf=[d]:nf.push(d)}function Ln(d,p,E){Dc?(T(Bd,p._currentValue),p._currentValue=E):(T(Bd,p._currentValue2),p._currentValue2=E)}function oo(d){var p=Bd.current;Dc?d._currentValue=p:d._currentValue2=p,y(Bd)}function ai(d,p,E){for(;d!==null;){var b=d.alternate;if((d.childLanes&p)!==p?(d.childLanes|=p,b!==null&&(b.childLanes|=p)):b!==null&&(b.childLanes&p)!==p&&(b.childLanes|=p),d===E)break;d=d.return}}function vt(d,p,E,b){var D=d.child;for(D!==null&&(D.return=d);D!==null;){var N=D.dependencies;if(N!==null){var Q=D.child;N=N.firstContext;e:for(;N!==null;){var K=N;N=D;for(var Ae=0;Ae<p.length;Ae++)if(K.context===p[Ae]){N.lanes|=E,K=N.alternate,K!==null&&(K.lanes|=E),ai(N.return,E,d),b||(Q=null);break e}N=K.next}}else if(D.tag===18){if(Q=D.return,Q===null)throw Error(r(341));Q.lanes|=E,N=Q.alternate,N!==null&&(N.lanes|=E),ai(Q,E,d),Q=null}else Q=D.child;if(Q!==null)Q.return=D;else for(Q=D;Q!==null;){if(Q===d){Q=null;break}if(D=Q.sibling,D!==null){D.return=Q.return,Q=D;break}Q=Q.return}D=Q}}function $i(d,p,E,b){d=null;for(var D=p,N=!1;D!==null;){if(!N){if((D.flags&524288)!==0)N=!0;else if((D.flags&262144)!==0)break}if(D.tag===10){var Q=D.alternate;if(Q===null)throw Error(r(387));if(Q=Q.memoizedProps,Q!==null){var K=D.type;Ts(D.pendingProps.value,Q.value)||(d!==null?d.push(K):d=[K])}}else if(D===LI.current){if(Q=D.alternate,Q===null)throw Error(r(387));Q.memoizedState.memoizedState!==D.memoizedState.memoizedState&&(d!==null?d.push(cm):d=[cm])}D=D.return}d!==null&&vt(p,d,E,b),p.flags|=262144}function ms(d){for(d=d.firstContext;d!==null;){var p=d.context;if(!Ts(Dc?p._currentValue:p._currentValue2,d.memoizedValue))return!0;d=d.next}return!1}function xo(d){Ca=d,uo=null,d=d.dependencies,d!==null&&(d.firstContext=null)}function ho(d){return Op(Ca,d)}function Nu(d,p){return Ca===null&&xo(d),Op(d,p)}function Op(d,p){var E=Dc?p._currentValue:p._currentValue2;if(p={context:p,memoizedValue:E,next:null},uo===null){if(d===null)throw Error(r(308));uo=p,d.dependencies={lanes:0,firstContext:p},d.flags|=524288}else uo=uo.next=p;return E}function Jf(){return{controller:new wd,data:new Map,refCount:0}}function Bu(d){d.refCount--,d.refCount===0&&Vs(Tq,function(){d.controller.abort()})}function Ad(){}function Qs(d){d!==Xa&&d.next===null&&(Xa===null?Yo=Xa=d:Xa=Xa.next=d),e_=!0,SN||(SN=!0,Ou())}function wu(d,p){if(!rg&&e_){rg=!0;do for(var E=!1,b=Yo;b!==null;){if(!p)if(d!==0){var D=b.pendingLanes;if(D===0)var N=0;else{var Q=b.suspendedLanes,K=b.pingedLanes;N=(1<<31-Ja(42|d)+1)-1,N&=D&~(Q&~K),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(E=!0,pl(b,N))}else N=Yn,N=x(b,b===Lr?N:0,b.cancelPendingCommit!==null||b.timeoutHandle!==Jp),(N&3)===0||O(b,N)||(E=!0,pl(b,N));b=b.next}while(E);rg=!1}}function gc(){hc()}function hc(){e_=SN=!1;var d=0;Bl!==0&&sN()&&(d=Bl);for(var p=Sr(),E=null,b=Yo;b!==null;){var D=b.next,N=Fs(b,p);N===0?(b.next=null,E===null?Yo=D:E.next=D,D===null&&(Xa=E)):(E=b,(d!==0||(N&3)!==0)&&(e_=!0)),b=D}Cr!==0&&Cr!==5||wu(d,!1),Bl!==0&&(Bl=0)}function Fs(d,p){for(var E=d.suspendedLanes,b=d.pingedLanes,D=d.expirationTimes,N=d.pendingLanes&-62914561;0<N;){var Q=31-Ja(N),K=1<<Q,Ae=D[Q];Ae===-1?((K&E)===0||(K&b)!==0)&&(D[Q]=P(K,p)):Ae<=p&&(d.expiredLanes|=K),N&=~K}if(p=Lr,E=Yn,E=x(d,d===p?E:0,d.cancelPendingCommit!==null||d.timeoutHandle!==Jp),b=d.callbackNode,E===0||d===p&&(Ir===2||Ir===9)||d.cancelPendingCommit!==null)return b!==null&&b!==null&&On(b),d.callbackNode=null,d.callbackPriority=0;if((E&3)===0||O(d,E)){if(p=E&-E,p===d.callbackPriority)return p;switch(b!==null&&On(b),pt(E)){case 2:case 8:E=Xp;break;case 32:E=ef;break;case 268435456:E=Zh;break;default:E=ef}return b=_o.bind(null,d),E=kI(E,b),d.callbackPriority=p,d.callbackNode=E,p}return b!==null&&b!==null&&On(b),d.callbackPriority=2,d.callbackNode=null,2}function _o(d,p){if(Cr!==0&&Cr!==5)return d.callbackNode=null,d.callbackPriority=0,null;var E=d.callbackNode;if(qo()&&d.callbackNode!==E)return null;var b=Yn;return b=x(d,d===Lr?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==Jp),b===0?null:(G1(d,b,p),Fs(d,Sr()),d.callbackNode!=null&&d.callbackNode===E?_o.bind(null,d):null)}function pl(d,p){if(qo())return null;G1(d,p,!0)}function Ou(){p2?xd(function(){(Gn&6)!==0?kI(q2,gc):hc()}):kI(q2,gc)}function L(){if(Bl===0){var d=t_;d===0&&(d=Oy,Oy<<=1,(Oy&261888)===0&&(Oy=256)),Bl=d}return Bl}function ne(d,p){if(Ly===null){var E=Ly=[];TN=0,t_=L(),n_={status:"pending",value:void 0,then:function(b){E.push(b)}}}return TN++,p.then(ve,ve),p}function ve(){if(--TN===0&&Ly!==null){n_!==null&&(n_.status="fulfilled");var d=Ly;Ly=null,t_=0,n_=null;for(var p=0;p<d.length;p++)(0,d[p])()}}function $e(d,p){var E=[],b={status:"pending",value:null,reason:null,then:function(D){E.push(D)}};return d.then(function(){b.status="fulfilled",b.value=p;for(var D=0;D<E.length;D++)(0,E[D])(p)},function(D){for(b.status="rejected",b.reason=D,D=0;D<E.length;D++)(0,E[D])(void 0)}),b}function et(){var d=pm.current;return d!==null?d:Lr.pooledCache}function Ht(d,p){p===null?T(pm,pm.current):T(pm,p.pool)}function xt(){var d=et();return d===null?null:{parent:Dc?Eo._currentValue:Eo._currentValue2,pool:d}}function Fn(d,p){if(Ts(d,p))return!0;if(typeof d!="object"||d===null||typeof p!="object"||p===null)return!1;var E=Object.keys(d),b=Object.keys(p);if(E.length!==b.length)return!1;for(b=0;b<E.length;b++){var D=E[b];if(!EN.call(p,D)||!Ts(d[D],p[D]))return!1}return!0}function pn(d){return d=d.status,d==="fulfilled"||d==="rejected"}function ui(d,p,E){switch(E=d[E],E===void 0?d.push(p):E!==p&&(p.then(Ad,Ad),p=E),p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,fl(d),d;default:if(typeof p.status=="string")p.then(Ad,Ad);else{if(d=Lr,d!==null&&100<d.shellSuspendCounter)throw Error(r(482));d=p,d.status="pending",d.then(function(b){if(p.status==="pending"){var D=p;D.status="fulfilled",D.value=b}},function(b){if(p.status==="pending"){var D=p;D.status="rejected",D.reason=b}})}switch(p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,fl(d),d}throw kc=p,r_}}function Wr(d){try{var p=d._init;return p(d._payload)}catch(E){throw E!==null&&typeof E=="object"&&typeof E.then=="function"?(kc=E,r_):E}}function kp(){if(kc===null)throw Error(r(459));var d=kc;return kc=null,d}function fl(d){if(d===r_||d===FI)throw Error(r(483))}function ga(d){var p=Uy;return Uy+=1,Pc===null&&(Pc=[]),ui(Pc,d,p)}function As(d,p){p=p.props.ref,d.ref=p!==void 0?p:null}function Pp(d,p){throw p.$$typeof===hI?Error(r(525)):(d=Object.prototype.toString.call(p),Error(r(31,d==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":d)))}function z0(d){function p(ce,se){if(d){var fe=ce.deletions;fe===null?(ce.deletions=[se],ce.flags|=16):fe.push(se)}}function E(ce,se){if(!d)return null;for(;se!==null;)p(ce,se),se=se.sibling;return null}function b(ce){for(var se=new Map;ce!==null;)ce.key!==null?se.set(ce.key,ce):se.set(ce.index,ce),ce=ce.sibling;return se}function D(ce,se){return ce=Id(ce,se),ce.index=0,ce.sibling=null,ce}function N(ce,se,fe){return ce.index=fe,d?(fe=ce.alternate,fe!==null?(fe=fe.index,fe<se?(ce.flags|=67108866,se):fe):(ce.flags|=67108866,se)):(ce.flags|=1048576,se)}function Q(ce){return d&&ce.alternate===null&&(ce.flags|=67108866),ce}function K(ce,se,fe,Fe){return se===null||se.tag!==6?(se=yy(fe,ce.mode,Fe),se.return=ce,se):(se=D(se,fe),se.return=ce,se)}function Ae(ce,se,fe,Fe){var Dt=fe.type;return Dt===qA?Ke(ce,se,fe.props.children,Fe,fe.key):se!==null&&(se.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===am&&Wr(Dt)===se.type)?(se=D(se,fe.props),As(se,fe),se.return=ce,se):(se=Ey(fe.type,fe.key,fe.props,null,ce.mode,Fe),As(se,fe),se.return=ce,se)}function Ne(ce,se,fe,Fe){return se===null||se.tag!==4||se.stateNode.containerInfo!==fe.containerInfo||se.stateNode.implementation!==fe.implementation?(se=mI(fe,ce.mode,Fe),se.return=ce,se):(se=D(se,fe.children||[]),se.return=ce,se)}function Ke(ce,se,fe,Fe,Dt){return se===null||se.tag!==7?(se=Yp(fe,ce.mode,Fe,Dt),se.return=ce,se):(se=D(se,fe),se.return=ce,se)}function je(ce,se,fe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=yy(""+se,ce.mode,fe),se.return=ce,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case Ty:return fe=Ey(se.type,se.key,se.props,null,ce.mode,fe),As(fe,se),fe.return=ce,fe;case sm:return se=mI(se,ce.mode,fe),se.return=ce,se;case am:return se=Wr(se),je(ce,se,fe)}if(um(se)||f(se))return se=Yp(se,ce.mode,fe,null),se.return=ce,se;if(typeof se.then=="function")return je(ce,ga(se),fe);if(se.$$typeof===Kp)return je(ce,Nu(ce,se),fe);Pp(ce,se)}return null}function nt(ce,se,fe,Fe){var Dt=se!==null?se.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Dt!==null?null:K(ce,se,""+fe,Fe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case Ty:return fe.key===Dt?Ae(ce,se,fe,Fe):null;case sm:return fe.key===Dt?Ne(ce,se,fe,Fe):null;case am:return fe=Wr(fe),nt(ce,se,fe,Fe)}if(um(fe)||f(fe))return Dt!==null?null:Ke(ce,se,fe,Fe,null);if(typeof fe.then=="function")return nt(ce,se,ga(fe),Fe);if(fe.$$typeof===Kp)return nt(ce,se,Nu(ce,fe),Fe);Pp(ce,fe)}return null}function Ut(ce,se,fe,Fe,Dt){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint")return ce=ce.get(fe)||null,K(se,ce,""+Fe,Dt);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case Ty:return ce=ce.get(Fe.key===null?fe:Fe.key)||null,Ae(se,ce,Fe,Dt);case sm:return ce=ce.get(Fe.key===null?fe:Fe.key)||null,Ne(se,ce,Fe,Dt);case am:return Fe=Wr(Fe),Ut(ce,se,fe,Fe,Dt)}if(um(Fe)||f(Fe))return ce=ce.get(fe)||null,Ke(se,ce,Fe,Dt,null);if(typeof Fe.then=="function")return Ut(ce,se,fe,ga(Fe),Dt);if(Fe.$$typeof===Kp)return Ut(ce,se,fe,Nu(se,Fe),Dt);Pp(se,Fe)}return null}function co(ce,se,fe,Fe){for(var Dt=null,yo=null,$t=se,mr=se=0,Kn=null;$t!==null&&mr<fe.length;mr++){$t.index>mr?(Kn=$t,$t=null):Kn=$t.sibling;var rr=nt(ce,$t,fe[mr],Fe);if(rr===null){$t===null&&($t=Kn);break}d&&$t&&rr.alternate===null&&p(ce,$t),se=N(rr,se,mr),yo===null?Dt=rr:yo.sibling=rr,yo=rr,$t=Kn}if(mr===fe.length)return E(ce,$t),Un&&Lt(ce,mr),Dt;if($t===null){for(;mr<fe.length;mr++)$t=je(ce,fe[mr],Fe),$t!==null&&(se=N($t,se,mr),yo===null?Dt=$t:yo.sibling=$t,yo=$t);return Un&&Lt(ce,mr),Dt}for($t=b($t);mr<fe.length;mr++)Kn=Ut($t,ce,mr,fe[mr],Fe),Kn!==null&&(d&&Kn.alternate!==null&&$t.delete(Kn.key===null?mr:Kn.key),se=N(Kn,se,mr),yo===null?Dt=Kn:yo.sibling=Kn,yo=Kn);return d&&$t.forEach(function(af){return p(ce,af)}),Un&&Lt(ce,mr),Dt}function Ni(ce,se,fe,Fe){if(fe==null)throw Error(r(151));for(var Dt=null,yo=null,$t=se,mr=se=0,Kn=null,rr=fe.next();$t!==null&&!rr.done;mr++,rr=fe.next()){$t.index>mr?(Kn=$t,$t=null):Kn=$t.sibling;var af=nt(ce,$t,rr.value,Fe);if(af===null){$t===null&&($t=Kn);break}d&&$t&&af.alternate===null&&p(ce,$t),se=N(af,se,mr),yo===null?Dt=af:yo.sibling=af,yo=af,$t=Kn}if(rr.done)return E(ce,$t),Un&&Lt(ce,mr),Dt;if($t===null){for(;!rr.done;mr++,rr=fe.next())rr=je(ce,rr.value,Fe),rr!==null&&(se=N(rr,se,mr),yo===null?Dt=rr:yo.sibling=rr,yo=rr);return Un&&Lt(ce,mr),Dt}for($t=b($t);!rr.done;mr++,rr=fe.next())rr=Ut($t,ce,mr,rr.value,Fe),rr!==null&&(d&&rr.alternate!==null&&$t.delete(rr.key===null?mr:rr.key),se=N(rr,se,mr),yo===null?Dt=rr:yo.sibling=rr,yo=rr);return d&&$t.forEach(function(Hy){return p(ce,Hy)}),Un&&Lt(ce,mr),Dt}function ug(ce,se,fe,Fe){if(typeof fe=="object"&&fe!==null&&fe.type===qA&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case Ty:e:{for(var Dt=fe.key;se!==null;){if(se.key===Dt){if(Dt=fe.type,Dt===qA){if(se.tag===7){E(ce,se.sibling),Fe=D(se,fe.props.children),Fe.return=ce,ce=Fe;break e}}else if(se.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===am&&Wr(Dt)===se.type){E(ce,se.sibling),Fe=D(se,fe.props),As(Fe,fe),Fe.return=ce,ce=Fe;break e}E(ce,se);break}else p(ce,se);se=se.sibling}fe.type===qA?(Fe=Yp(fe.props.children,ce.mode,Fe,fe.key),Fe.return=ce,ce=Fe):(Fe=Ey(fe.type,fe.key,fe.props,null,ce.mode,Fe),As(Fe,fe),Fe.return=ce,ce=Fe)}return Q(ce);case sm:e:{for(Dt=fe.key;se!==null;){if(se.key===Dt)if(se.tag===4&&se.stateNode.containerInfo===fe.containerInfo&&se.stateNode.implementation===fe.implementation){E(ce,se.sibling),Fe=D(se,fe.children||[]),Fe.return=ce,ce=Fe;break e}else{E(ce,se);break}else p(ce,se);se=se.sibling}Fe=mI(fe,ce.mode,Fe),Fe.return=ce,ce=Fe}return Q(ce);case am:return fe=Wr(fe),ug(ce,se,fe,Fe)}if(um(fe))return co(ce,se,fe,Fe);if(f(fe)){if(Dt=f(fe),typeof Dt!="function")throw Error(r(150));return fe=Dt.call(fe),Ni(ce,se,fe,Fe)}if(typeof fe.then=="function")return ug(ce,se,ga(fe),Fe);if(fe.$$typeof===Kp)return ug(ce,se,Nu(ce,fe),Fe);Pp(ce,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,se!==null&&se.tag===6?(E(ce,se.sibling),Fe=D(se,fe),Fe.return=ce,ce=Fe):(E(ce,se),Fe=yy(fe,ce.mode,Fe),Fe.return=ce,ce=Fe),Q(ce)):E(ce,se)}return function(ce,se,fe,Fe){try{Uy=0;var Dt=ug(ce,se,fe,Fe);return Pc=null,Dt}catch($t){if($t===r_||$t===FI)throw $t;var yo=t(29,$t,null,ce.mode);return yo.lanes=Fe,yo.return=ce,yo}}}function Dr(){for(var d=wl,p=bN=wl=0;p<d;){var E=Mc[p];Mc[p++]=null;var b=Mc[p];Mc[p++]=null;var D=Mc[p];Mc[p++]=null;var N=Mc[p];if(Mc[p++]=null,b!==null&&D!==null){var Q=b.pending;Q===null?D.next=D:(D.next=Q.next,Q.next=D),b.pending=D}N!==0&&gd(E,D,N)}}function _c(d,p,E,b){Mc[wl++]=d,Mc[wl++]=p,Mc[wl++]=E,Mc[wl++]=b,bN|=b,d.lanes|=b,d=d.alternate,d!==null&&(d.lanes|=b)}function qa(d,p,E,b){return _c(d,p,E,b),ml(d)}function Ec(d,p){return _c(d,null,null,p),ml(d)}function gd(d,p,E){d.lanes|=E;var b=d.alternate;b!==null&&(b.lanes|=E);for(var D=!1,N=d.return;N!==null;)N.childLanes|=E,b=N.alternate,b!==null&&(b.childLanes|=E),N.tag===22&&(d=N.stateNode,d===null||d._visibility&1||(D=!0)),d=N,N=N.return;return d.tag===3?(N=d.stateNode,D&&p!==null&&(D=31-Ja(E),d=N.hiddenUpdates,b=d[D],b===null?d[D]=[p]:b.push(p),p.lane=E|536870912),N):null}function ml(d){if(50<c_)throw c_=0,oC=null,Error(r(185));for(var p=d.return;p!==null;)d=p,p=d.return;return d.tag===3?d.stateNode:null}function Mp(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lp(d,p){d=d.updateQueue,p.updateQueue===d&&(p.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,callbacks:null})}function ha(d){return{lane:d,tag:0,payload:null,callback:null,next:null}}function yc(d,p,E){var b=d.updateQueue;if(b===null)return null;if(b=b.shared,(Gn&2)!==0){var D=b.pending;return D===null?p.next=p:(p.next=D.next,D.next=p),b.pending=p,p=ml(d),gd(d,null,E),p}return _c(d,b,p,E),ml(d)}function UA(d,p,E){if(p=p.updateQueue,p!==null&&(p=p.shared,(E&4194048)!==0)){var b=p.lanes;b&=d.pendingLanes,E|=b,p.lanes=E,re(d,E)}}function H0(d,p){var E=d.updateQueue,b=d.alternate;if(b!==null&&(b=b.updateQueue,E===b)){var D=null,N=null;if(E=E.firstBaseUpdate,E!==null){do{var Q={lane:E.lane,tag:E.tag,payload:E.payload,callback:null,next:null};N===null?D=N=Q:N=N.next=Q,E=E.next}while(E!==null);N===null?D=N=p:N=N.next=p}else D=N=p;E={baseState:b.baseState,firstBaseUpdate:D,lastBaseUpdate:N,shared:b.shared,callbacks:b.callbacks},d.updateQueue=E;return}d=E.lastBaseUpdate,d===null?E.firstBaseUpdate=p:d.next=p,E.lastBaseUpdate=p}function Zf(){if(IN){var d=n_;if(d!==null)throw d}}function Up(d,p,E,b){IN=!1;var D=d.updateQueue;fm=!1;var N=D.firstBaseUpdate,Q=D.lastBaseUpdate,K=D.shared.pending;if(K!==null){D.shared.pending=null;var Ae=K,Ne=Ae.next;Ae.next=null,Q===null?N=Ne:Q.next=Ne,Q=Ae;var Ke=d.alternate;Ke!==null&&(Ke=Ke.updateQueue,K=Ke.lastBaseUpdate,K!==Q&&(K===null?Ke.firstBaseUpdate=Ne:K.next=Ne,Ke.lastBaseUpdate=Ae))}if(N!==null){var je=D.baseState;Q=0,Ke=Ne=Ae=null,K=N;do{var nt=K.lane&-536870913,Ut=nt!==K.lane;if(Ut?(Yn&nt)===nt:(b&nt)===nt){nt!==0&&nt===t_&&(IN=!0),Ke!==null&&(Ke=Ke.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var co=d,Ni=K;nt=p;var ug=E;switch(Ni.tag){case 1:if(co=Ni.payload,typeof co=="function"){je=co.call(ug,je,nt);break e}je=co;break e;case 3:co.flags=co.flags&-65537|128;case 0:if(co=Ni.payload,nt=typeof co=="function"?co.call(ug,je,nt):co,nt==null)break e;je=Pu({},je,nt);break e;case 2:fm=!0}}nt=K.callback,nt!==null&&(d.flags|=64,Ut&&(d.flags|=8192),Ut=D.callbacks,Ut===null?D.callbacks=[nt]:Ut.push(nt))}else Ut={lane:nt,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Ke===null?(Ne=Ke=Ut,Ae=je):Ke=Ke.next=Ut,Q|=nt;if(K=K.next,K===null){if(K=D.shared.pending,K===null)break;Ut=K,K=Ut.next,Ut.next=null,D.lastBaseUpdate=Ut,D.shared.pending=null}}while(!0);Ke===null&&(Ae=je),D.baseState=Ae,D.firstBaseUpdate=Ne,D.lastBaseUpdate=Ke,N===null&&(D.shared.lanes=0),gm|=Q,d.lanes=Q,d.memoizedState=je}}function $0(d,p){if(typeof d!="function")throw Error(r(191,d));d.call(p)}function xb(d,p){var E=d.callbacks;if(E!==null)for(d.callbacks=null,d=0;d<E.length;d++)$0(E[d],p)}function it(d,p){d=of,T(jI,d),T(Od,p),of=d|p.baseLanes}function hd(){T(jI,of),T(Od,Od.current)}function Al(){of=jI.current,y(Od),y(jI)}function gl(d){var p=d.alternate;T(Ko,Ko.current&1),T(Lu,d),Lc===null&&(p===null||Od.current!==null||p.memoizedState!==null)&&(Lc=d)}function Qp(d){T(Ko,Ko.current),T(Lu,d),Lc===null&&(Lc=d)}function Sc(d){d.tag===22?(T(Ko,Ko.current),T(Lu,d),Lc===null&&(Lc=d)):Tc(d)}function Tc(){T(Ko,Ko.current),T(Lu,Lu.current)}function Ri(d){y(Lu),Lc===d&&(Lc=null),y(Ko)}function hl(d){for(var p=d;p!==null;){if(p.tag===13){var E=p.memoizedState;if(E!==null&&(E=E.dehydrated,E===null||Ny(E)||By(E)))return p}else if(p.tag===19&&(p.memoizedProps.revealOrder==="forwards"||p.memoizedProps.revealOrder==="backwards"||p.memoizedProps.revealOrder==="unstable_legacy-backwards"||p.memoizedProps.revealOrder==="together")){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}function Xr(){throw Error(r(321))}function bc(d,p){if(p===null)return!1;for(var E=0;E<p.length&&E<d.length;E++)if(!Ts(d[E],p[E]))return!1;return!0}function Fp(d,p,E,b,D,N){return rf=N,gn=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,It.H=d===null||d.memoizedState===null?K2:CN,ig=!1,N=E(b,D),ig=!1,o_&&(N=Gp(p,E,b,D)),Gs(d),N}function Gs(d){It.H=Qy;var p=Nr!==null&&Nr.next!==null;if(rf=0,di=Nr=gn=null,zI=!1,i_=0,s_=null,p)throw Error(r(300));d===null||pi||(d=d.dependencies,d!==null&&ms(d)&&(pi=!0))}function Gp(d,p,E,b){gn=d;var D=0;do{if(o_&&(s_=null),i_=0,o_=!1,25<=D)throw Error(r(301));if(D+=1,di=Nr=null,d.updateQueue!=null){var N=d.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}It.H=J2,N=p(E,b)}while(o_);return N}function QA(){var d=It.H,p=d.useState()[0];return p=typeof p.then=="function"?xe(p):p,d=d.useState()[0],(Nr!==null?Nr.memoizedState:null)!==d&&(gn.flags|=1024),p}function U(){var d=HI!==0;return HI=0,d}function F(d,p,E){p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~E}function Y(d){if(zI){for(d=d.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}zI=!1}rf=0,di=Nr=gn=null,o_=!1,i_=HI=0,s_=null}function X(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return di===null?gn.memoizedState=di=d:di=di.next=d,di}function te(){if(Nr===null){var d=gn.alternate;d=d!==null?d.memoizedState:null}else d=Nr.next;var p=di===null?gn.memoizedState:di.next;if(p!==null)di=p,Nr=d;else{if(d===null)throw gn.alternate===null?Error(r(467)):Error(r(310));Nr=d,d={memoizedState:Nr.memoizedState,baseState:Nr.baseState,baseQueue:Nr.baseQueue,queue:Nr.queue,next:null},di===null?gn.memoizedState=di=d:di=di.next=d}return di}function Se(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xe(d){var p=i_;return i_+=1,s_===null&&(s_=[]),d=ui(s_,d,p),p=gn,(di===null?p.memoizedState:di.next)===null&&(p=p.alternate,It.H=p===null||p.memoizedState===null?K2:CN),d}function Te(d){if(d!==null&&typeof d=="object"){if(typeof d.then=="function")return xe(d);if(d.$$typeof===Kp)return ho(d)}throw Error(r(438,String(d)))}function Ve(d){var p=null,E=gn.updateQueue;if(E!==null&&(p=E.memoCache),p==null){var b=gn.alternate;b!==null&&(b=b.updateQueue,b!==null&&(b=b.memoCache,b!=null&&(p={data:b.data.map(function(D){return D.slice()}),index:0})))}if(p==null&&(p={data:[],index:0}),E===null&&(E=Se(),gn.updateQueue=E),E.memoCache=p,E=p.data[p.index],E===void 0)for(E=p.data[p.index]=Array(d),b=0;b<d;b++)E[b]=Cd;return p.index++,E}function Pe(d,p){return typeof p=="function"?p(d):p}function Ze(d){var p=te();return _t(p,Nr,d)}function _t(d,p,E){var b=d.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=E;var D=d.baseQueue,N=b.pending;if(N!==null){if(D!==null){var Q=D.next;D.next=N.next,N.next=Q}p.baseQueue=D=N,b.pending=null}if(N=d.baseState,D===null)d.memoizedState=N;else{p=D.next;var K=Q=null,Ae=null,Ne=p,Ke=!1;do{var je=Ne.lane&-536870913;if(je!==Ne.lane?(Yn&je)===je:(rf&je)===je){var nt=Ne.revertLane;if(nt===0)Ae!==null&&(Ae=Ae.next={lane:0,revertLane:0,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),je===t_&&(Ke=!0);else if((rf&nt)===nt){Ne=Ne.next,nt===t_&&(Ke=!0);continue}else je={lane:0,revertLane:Ne.revertLane,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},Ae===null?(K=Ae=je,Q=N):Ae=Ae.next=je,gn.lanes|=nt,gm|=nt;je=Ne.action,ig&&E(N,je),N=Ne.hasEagerState?Ne.eagerState:E(N,je)}else nt={lane:je,revertLane:Ne.revertLane,gesture:Ne.gesture,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},Ae===null?(K=Ae=nt,Q=N):Ae=Ae.next=nt,gn.lanes|=je,gm|=je;Ne=Ne.next}while(Ne!==null&&Ne!==p);if(Ae===null?Q=N:Ae.next=K,!Ts(N,d.memoizedState)&&(pi=!0,Ke&&(E=n_,E!==null)))throw E;d.memoizedState=N,d.baseState=Q,d.baseQueue=Ae,b.lastRenderedState=N}return D===null&&(b.lanes=0),[d.memoizedState,b.dispatch]}function In(d){var p=te(),E=p.queue;if(E===null)throw Error(r(311));E.lastRenderedReducer=d;var b=E.dispatch,D=E.pending,N=p.memoizedState;if(D!==null){E.pending=null;var Q=D=D.next;do N=d(N,Q.action),Q=Q.next;while(Q!==D);Ts(N,p.memoizedState)||(pi=!0),p.memoizedState=N,p.baseQueue===null&&(p.baseState=N),E.lastRenderedState=N}return[N,b]}function dr(d,p,E){var b=gn,D=te(),N=Un;if(N){if(E===void 0)throw Error(r(407));E=E()}else E=p();var Q=!Ts((Nr||D).memoizedState,E);if(Q&&(D.memoizedState=E,pi=!0),D=D.queue,Nb(gs.bind(null,b,D,d),[d]),D.getSnapshot!==p||Q||di!==null&&di.memoizedState.tag&1){if(b.flags|=2048,Ea(9,{destroy:void 0},io.bind(null,b,D,E,p),null),Lr===null)throw Error(r(349));N||(rf&127)!==0||pr(b,p,E)}return E}function pr(d,p,E){d.flags|=16384,d={getSnapshot:p,value:E},p=gn.updateQueue,p===null?(p=Se(),gn.updateQueue=p,p.stores=[d]):(E=p.stores,E===null?p.stores=[d]:E.push(d))}function io(d,p,E,b){p.value=E,p.getSnapshot=b,Ic(p)&&_a(d)}function gs(d,p,E){return E(function(){Ic(p)&&_a(d)})}function Ic(d){var p=d.getSnapshot;d=d.value;try{var E=p();return!Ts(d,E)}catch{return!0}}function _a(d){var p=Ec(d,2);p!==null&&Sa(p,d,2)}function qi(d){var p=X();if(typeof d=="function"){var E=d;if(d=E(),ig){Ge(!0);try{E()}finally{Ge(!1)}}}return p.memoizedState=p.baseState=d,p.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pe,lastRenderedState:d},p}function hs(d,p,E,b){return d.baseState=E,_t(d,Nr,typeof b=="function"?b:Pe)}function _d(d,p,E,b,D){if(Xf(d))throw Error(r(485));if(d=p.action,d!==null){var N={payload:D,action:d,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Q){N.listeners.push(Q)}};It.T!==null?E(!0):N.isTransition=!1,b(N),E=p.pending,E===null?(N.next=p.pending=N,_l(p,N)):(N.next=E.next,p.pending=E.next=N)}}function _l(d,p){var E=p.action,b=p.payload,D=d.state;if(p.isTransition){var N=It.T,Q={};It.T=Q;try{var K=E(D,b),Ae=It.S;Ae!==null&&Ae(Q,K),El(d,p,K)}catch(Ne){q0(d,p,Ne)}finally{N!==null&&Q.types!==null&&(N.types=Q.types),It.T=N}}else try{N=E(D,b),El(d,p,N)}catch(Ne){q0(d,p,Ne)}}function El(d,p,E){E!==null&&typeof E=="object"&&typeof E.then=="function"?E.then(function(b){yl(d,p,b)},function(b){return q0(d,p,b)}):yl(d,p,E)}function yl(d,p,E){p.status="fulfilled",p.value=E,Db(p),d.state=E,p=d.pending,p!==null&&(E=p.next,E===p?d.pending=null:(E=E.next,p.next=E,_l(d,E)))}function q0(d,p,E){var b=d.pending;if(d.pending=null,b!==null){b=b.next;do p.status="rejected",p.reason=E,Db(p),p=p.next;while(p!==b)}d.action=null}function Db(d){d=d.listeners;for(var p=0;p<d.length;p++)(0,d[p])()}function _1(d,p){return p}function Sl(d,p){if(Un){var E=Lr.formState;if(E!==null){e:{var b=gn;if(Un){if(ao){var D=C2(ao,Oc);if(D){ao=dN(D),b=v2(D);break e}}ar(b)}b=!1}b&&(p=E[0])}}E=X(),E.memoizedState=E.baseState=p,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_1,lastRenderedState:p},E.queue=b,E=Mb.bind(null,gn,b),b.dispatch=E,b=qi(!1);var N=wh.bind(null,gn,!1,b.queue);return b=X(),D={state:p,dispatch:null,action:d,pending:null},b.queue=D,E=_d.bind(null,gn,D,N,E),D.dispatch=E,b.memoizedState=d,[p,E,!1]}function E1(d){var p=te();return Tl(p,Nr,d)}function Tl(d,p,E){if(p=_t(d,p,_1)[0],d=Ze(Pe)[0],typeof p=="object"&&p!==null&&typeof p.then=="function")try{var b=xe(p)}catch(Q){throw Q===r_?FI:Q}else b=p;p=te();var D=p.queue,N=D.dispatch;return E!==p.memoizedState&&(gn.flags|=2048,Ea(9,{destroy:void 0},V0.bind(null,D,E),null)),[b,N,d]}function V0(d,p){d.action=p}function Y0(d){var p=te(),E=Nr;if(E!==null)return Tl(p,E,d);te(),p=p.memoizedState,E=te();var b=E.queue.dispatch;return E.memoizedState=d,[p,b,!1]}function Ea(d,p,E,b){return d={tag:d,create:E,deps:b,inst:p,next:null},p=gn.updateQueue,p===null&&(p=Se(),gn.updateQueue=p),E=p.lastEffect,E===null?p.lastEffect=d.next=d:(b=E.next,E.next=d,d.next=b,p.lastEffect=d),d}function FA(){return te().memoizedState}function K0(d,p,E,b){var D=X();gn.flags|=d,D.memoizedState=Ea(1|p,{destroy:void 0},E,b===void 0?null:b)}function Bh(d,p,E,b){var D=te();b=b===void 0?null:b;var N=D.memoizedState.inst;Nr!==null&&b!==null&&bc(b,Nr.memoizedState.deps)?D.memoizedState=Ea(p,N,E,b):(gn.flags|=d,D.memoizedState=Ea(1|p,N,E,b))}function y1(d,p){K0(8390656,8,d,p)}function Nb(d,p){Bh(2048,8,d,p)}function jM(d){gn.flags|=4;var p=gn.updateQueue;if(p===null)p=Se(),gn.updateQueue=p,p.events=[d];else{var E=p.events;E===null?p.events=[d]:E.push(d)}}function Bb(d){var p=te().memoizedState;return jM({ref:p,nextImpl:d}),function(){if((Gn&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}function S1(d,p){return Bh(4,2,d,p)}function wb(d,p){return Bh(4,4,d,p)}function zM(d,p){if(typeof p=="function"){d=d();var E=p(d);return function(){typeof E=="function"?E():p(null)}}if(p!=null)return d=d(),p.current=d,function(){p.current=null}}function T1(d,p,E){E=E!=null?E.concat([d]):null,Bh(4,4,zM.bind(null,p,d),E)}function b1(){}function Ob(d,p){var E=te();p=p===void 0?null:p;var b=E.memoizedState;return p!==null&&bc(p,b[1])?b[0]:(E.memoizedState=[d,p],d)}function J0(d,p){var E=te();p=p===void 0?null:p;var b=E.memoizedState;if(p!==null&&bc(p,b[1]))return b[0];if(b=d(),ig){Ge(!0);try{d()}finally{Ge(!1)}}return E.memoizedState=[b,p],b}function kb(d,p,E){return E===void 0||(rf&1073741824)!==0&&(Yn&261930)===0?d.memoizedState=p:(d.memoizedState=E,d=my(),gn.lanes|=d,gm|=d,E)}function Z0(d,p,E,b){return Ts(E,p)?E:Od.current!==null?(d=kb(d,E,b),Ts(d,p)||(pi=!0),d):(rf&42)===0||(rf&1073741824)!==0&&(Yn&261930)===0?(pi=!0,d.memoizedState=E):(d=my(),gn.lanes|=d,gm|=d,p)}function I1(d,p,E,b,D){var N=Rd();xi(N!==0&&8>N?N:8);var Q=It.T,K={};It.T=K,wh(d,!1,p,E);try{var Ae=D(),Ne=It.S;if(Ne!==null&&Ne(K,Ae),Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"){var Ke=$e(Ae,b);Wf(d,p,Ke,Ka(d))}else Wf(d,p,b,Ka(d))}catch(je){Wf(d,p,{then:function(){},status:"rejected",reason:je},Ka())}finally{xi(N),Q!==null&&K.types!==null&&(Q.types=K.types),It.T=Q}}function C1(d){var p=d.memoizedState;if(p!==null)return p;p={memoizedState:ba,baseState:ba,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pe,lastRenderedState:ba},next:null};var E={};return p.next={memoizedState:E,baseState:E,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pe,lastRenderedState:E},next:null},d.memoizedState=p,d=d.alternate,d!==null&&(d.memoizedState=p),p}function Pb(){return ho(cm)}function jp(){return te().memoizedState}function v1(){return te().memoizedState}function HM(d){for(var p=d.return;p!==null;){switch(p.tag){case 24:case 3:var E=Ka();d=ha(E);var b=yc(p,d,E);b!==null&&(Sa(b,p,E),UA(b,p,E)),p={cache:Jf()},d.payload=p;return}p=p.return}}function _s(d,p,E){var b=Ka();E={lane:b,revertLane:0,gesture:null,action:E,hasEagerState:!1,eagerState:null,next:null},Xf(d)?R1(p,E):(E=qa(d,p,E,b),E!==null&&(Sa(E,d,b),W0(E,p,b)))}function Mb(d,p,E){var b=Ka();Wf(d,p,E,b)}function Wf(d,p,E,b){var D={lane:b,revertLane:0,gesture:null,action:E,hasEagerState:!1,eagerState:null,next:null};if(Xf(d))R1(p,D);else{var N=d.alternate;if(d.lanes===0&&(N===null||N.lanes===0)&&(N=p.lastRenderedReducer,N!==null))try{var Q=p.lastRenderedState,K=N(Q,E);if(D.hasEagerState=!0,D.eagerState=K,Ts(K,Q))return _c(d,p,D,0),Lr===null&&Dr(),!1}catch{}if(E=qa(d,p,D,b),E!==null)return Sa(E,d,b),W0(E,p,b),!0}return!1}function wh(d,p,E,b){if(b={lane:2,revertLane:L(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},Xf(d)){if(p)throw Error(r(479))}else p=qa(d,E,b,2),p!==null&&Sa(p,d,2)}function Xf(d){var p=d.alternate;return d===gn||p!==null&&p===gn}function R1(d,p){o_=zI=!0;var E=d.pending;E===null?p.next=p:(p.next=E.next,E.next=p),d.pending=p}function W0(d,p,E){if((E&4194048)!==0){var b=p.lanes;b&=d.pendingLanes,E|=b,p.lanes=E,re(d,E)}}function Lb(d,p,E,b){p=d.memoizedState,E=E(b,p),E=E==null?p:Pu({},p,E),d.memoizedState=E,d.lanes===0&&(d.updateQueue.baseState=E)}function X0(d,p,E,b,D,N,Q){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(b,N,Q):p.prototype&&p.prototype.isPureReactComponent?!Fn(E,b)||!Fn(D,N):!0}function x1(d,p,E,b){d=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(E,b),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(E,b),p.state!==d&&$I.enqueueReplaceState(p,p.state,null)}function Ed(d,p){var E=p;if("ref"in p){E={};for(var b in p)b!=="ref"&&(E[b]=p[b])}if(d=d.defaultProps){E===p&&(E=Pu({},E));for(var D in d)E[D]===void 0&&(E[D]=d[D])}return E}function ey(d,p){try{var E=d.onUncaughtError;E(p.value,{componentStack:p.stack})}catch(b){setTimeout(function(){throw b})}}function D1(d,p,E){try{var b=d.onCaughtError;b(E.value,{componentStack:E.stack,errorBoundary:p.tag===1?p.stateNode:null})}catch(D){setTimeout(function(){throw D})}}function Oh(d,p,E){return E=ha(E),E.tag=3,E.payload={element:null},E.callback=function(){ey(d,p)},E}function ty(d){return d=ha(d),d.tag=3,d}function Ub(d,p,E,b){var D=E.type.getDerivedStateFromError;if(typeof D=="function"){var N=b.value;d.payload=function(){return D(N)},d.callback=function(){D1(p,E,b)}}var Q=E.stateNode;Q!==null&&typeof Q.componentDidCatch=="function"&&(d.callback=function(){D1(p,E,b),typeof D!="function"&&(hm===null?hm=new Set([this]):hm.add(this));var K=b.stack;this.componentDidCatch(b.value,{componentStack:K!==null?K:""})})}function js(d,p,E,b,D){if(E.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){if(p=E.alternate,p!==null&&$i(p,E,D,!0),E=Lu.current,E!==null){switch(E.tag){case 31:case 13:return Lc===null?Gh():E.alternate===null&&No===0&&(No=3),E.flags&=-257,E.flags|=65536,E.lanes=D,b===GI?E.flags|=16384:(p=E.updateQueue,p===null?E.updateQueue=new Set([b]):p.add(b),lI(d,b,D)),!1;case 22:return E.flags|=65536,b===GI?E.flags|=16384:(p=E.updateQueue,p===null?(p={transitions:null,markerInstances:null,retryQueue:new Set([b])},E.updateQueue=p):(E=p.retryQueue,E===null?p.retryQueue=new Set([b]):E.add(b)),lI(d,b,D)),!1}throw Error(r(435,E.tag))}return lI(d,b,D),Gh(),!1}if(Un)return p=Lu.current,p!==null?((p.flags&65536)===0&&(p.flags|=256),p.flags|=65536,p.lanes=D,b!==yN&&(d=Error(r(422),{cause:b}),Rt(ut(d,E)))):(b!==yN&&(p=Error(r(423),{cause:b}),Rt(ut(p,E))),d=d.current.alternate,d.flags|=65536,D&=-D,d.lanes|=D,b=ut(b,E),D=Oh(d.stateNode,b,D),H0(d,D),No!==4&&(No=2)),!1;var N=Error(r(520),{cause:b});if(N=ut(N,E),jy===null?jy=[N]:jy.push(N),No!==4&&(No=2),p===null)return!0;b=ut(b,E),E=p;do{switch(E.tag){case 3:return E.flags|=65536,d=D&-D,E.lanes|=d,d=Oh(E.stateNode,b,d),H0(E,d),!1;case 1:if(p=E.type,N=E.stateNode,(E.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(hm===null||!hm.has(N))))return E.flags|=65536,D&=-D,E.lanes|=D,D=ty(D),Ub(D,d,E,b),H0(E,D),!1}E=E.return}while(E!==null);return!1}function Vi(d,p,E,b){p.child=d===null?Y2(p,null,E,b):og(p,d.child,E,b)}function ny(d,p,E,b,D){E=E.render;var N=p.ref;if("ref"in b){var Q={};for(var K in b)K!=="ref"&&(Q[K]=b[K])}else Q=b;return xo(p),b=Fp(d,p,E,Q,N,D),K=U(),d!==null&&!pi?(F(d,p,D),Va(d,p,D)):(Un&&K&&be(p),p.flags|=1,Vi(d,p,b,D),p.child)}function Qb(d,p,E,b,D){if(d===null){var N=E.type;return typeof N=="function"&&!_y(N)&&N.defaultProps===void 0&&E.compare===null?(p.tag=15,p.type=N,Fb(d,p,N,b,D)):(d=Ey(E.type,null,b,p,p.mode,D),d.ref=p.ref,d.return=p,p.child=d)}if(N=d.child,!Mh(d,D)){var Q=N.memoizedProps;if(E=E.compare,E=E!==null?E:Fn,E(Q,b)&&d.ref===p.ref)return Va(d,p,D)}return p.flags|=1,d=Id(N,b),d.ref=p.ref,d.return=p,p.child=d}function Fb(d,p,E,b,D){if(d!==null){var N=d.memoizedProps;if(Fn(N,b)&&d.ref===p.ref)if(pi=!1,p.pendingProps=b=N,Mh(d,D))(d.flags&131072)!==0&&(pi=!0);else return p.lanes=d.lanes,Va(d,p,D)}return N1(d,p,E,b,D)}function zp(d,p,E,b){var D=b.children,N=d!==null?d.memoizedState:null;if(d===null&&p.stateNode===null&&(p.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),b.mode==="hidden"){if((p.flags&128)!==0){if(N=N!==null?N.baseLanes|E:E,d!==null){for(b=p.child=d.child,D=0;b!==null;)D=D|b.lanes|b.childLanes,b=b.sibling;b=D&~N}else b=0,p.child=null;return kh(d,p,N,E,b)}if((E&536870912)!==0)p.memoizedState={baseLanes:0,cachePool:null},d!==null&&Ht(p,N!==null?N.cachePool:null),N!==null?it(p,N):hd(),Sc(p);else return b=p.lanes=536870912,kh(d,p,N!==null?N.baseLanes|E:E,E,b)}else N!==null?(Ht(p,N.cachePool),it(p,N),Tc(p),p.memoizedState=null):(d!==null&&Ht(p,null),hd(),Tc(p));return Vi(d,p,D,E),p.child}function Cc(d,p){return d!==null&&d.tag===22||p.stateNode!==null||(p.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.sibling}function kh(d,p,E,b,D){var N=et();return N=N===null?null:{parent:Dc?Eo._currentValue:Eo._currentValue2,pool:N},p.memoizedState={baseLanes:E,cachePool:N},d!==null&&Ht(p,null),hd(),Sc(p),d!==null&&$i(d,p,b,!0),p.childLanes=D,null}function GA(d,p){return p=bl({mode:p.mode,children:p.children},d.mode),p.ref=d.ref,d.child=p,p.return=d,p}function Ph(d,p,E){return og(p,d.child,null,E),d=GA(p,p.pendingProps),d.flags|=2,Ri(p),p.memoizedState=null,d}function ry(d,p,E){var b=p.pendingProps,D=(p.flags&128)!==0;if(p.flags&=-129,d===null){if(Un){if(b.mode==="hidden")return d=GA(p,b),p.lanes=536870912,Cc(null,d);if(Qp(p),(d=ao)?(d=N2(d,Oc),d!==null&&(p.memoizedState={dehydrated:d,treeContext:tf!==null?{id:Ia,overflow:Nd}:null,retryLane:536870912,hydrationErrors:null},E=fI(d),E.return=p,p.child=E,Di=p,ao=null)):d=null,d===null)throw ar(p);return p.lanes=536870912,null}return GA(p,b)}var N=d.memoizedState;if(N!==null){var Q=N.dehydrated;if(Qp(p),D)if(p.flags&256)p.flags&=-257,p=Ph(d,p,E);else if(p.memoizedState!==null)p.child=d.child,p.flags|=128,p=null;else throw Error(r(558));else if(pi||$i(d,p,E,!1),D=(E&d.childLanes)!==0,pi||D){if(b=Lr,b!==null&&(Q=_e(b,E),Q!==0&&Q!==N.retryLane))throw N.retryLane=Q,Ec(d,Q),Sa(b,d,Q),qI;Gh(),p=Ph(d,p,E)}else d=N.treeContext,ys&&(ao=pN(Q),Di=p,Un=!0,nf=null,Oc=!1,d!==null&&en(p,d)),p=GA(p,b),p.flags|=4096;return p}return d=Id(d.child,{mode:b.mode,children:b.children}),d.ref=p.ref,p.child=d,d.return=p,d}function oy(d,p){var E=p.ref;if(E===null)d!==null&&d.ref!==null&&(p.flags|=4194816);else{if(typeof E!="function"&&typeof E!="object")throw Error(r(284));(d===null||d.ref!==E)&&(p.flags|=4194816)}}function N1(d,p,E,b,D){return xo(p),E=Fp(d,p,E,b,void 0,D),b=U(),d!==null&&!pi?(F(d,p,D),Va(d,p,D)):(Un&&b&&be(p),p.flags|=1,Vi(d,p,E,D),p.child)}function B1(d,p,E,b,D,N){return xo(p),p.updateQueue=null,E=Gp(p,b,E,D),Gs(d),b=U(),d!==null&&!pi?(F(d,p,N),Va(d,p,N)):(Un&&b&&be(p),p.flags|=1,Vi(d,p,E,N),p.child)}function w1(d,p,E,b,D){if(xo(p),p.stateNode===null){var N=eg,Q=E.contextType;typeof Q=="object"&&Q!==null&&(N=ho(Q)),N=new E(b,N),p.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=$I,p.stateNode=N,N._reactInternals=p,N=p.stateNode,N.props=b,N.state=p.memoizedState,N.refs={},Mp(p),Q=E.contextType,N.context=typeof Q=="object"&&Q!==null?ho(Q):eg,N.state=p.memoizedState,Q=E.getDerivedStateFromProps,typeof Q=="function"&&(Lb(p,E,Q,b),N.state=p.memoizedState),typeof E.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(Q=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),Q!==N.state&&$I.enqueueReplaceState(N,N.state,null),Up(p,b,N,D),Zf(),N.state=p.memoizedState),typeof N.componentDidMount=="function"&&(p.flags|=4194308),b=!0}else if(d===null){N=p.stateNode;var K=p.memoizedProps,Ae=Ed(E,K);N.props=Ae;var Ne=N.context,Ke=E.contextType;Q=eg,typeof Ke=="object"&&Ke!==null&&(Q=ho(Ke));var je=E.getDerivedStateFromProps;Ke=typeof je=="function"||typeof N.getSnapshotBeforeUpdate=="function",K=p.pendingProps!==K,Ke||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(K||Ne!==Q)&&x1(p,N,b,Q),fm=!1;var nt=p.memoizedState;N.state=nt,Up(p,b,N,D),Zf(),Ne=p.memoizedState,K||nt!==Ne||fm?(typeof je=="function"&&(Lb(p,E,je,b),Ne=p.memoizedState),(Ae=fm||X0(p,E,Ae,b,nt,Ne,Q))?(Ke||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(p.flags|=4194308)):(typeof N.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=b,p.memoizedState=Ne),N.props=b,N.state=Ne,N.context=Q,b=Ae):(typeof N.componentDidMount=="function"&&(p.flags|=4194308),b=!1)}else{N=p.stateNode,Lp(d,p),Q=p.memoizedProps,Ke=Ed(E,Q),N.props=Ke,je=p.pendingProps,nt=N.context,Ne=E.contextType,Ae=eg,typeof Ne=="object"&&Ne!==null&&(Ae=ho(Ne)),K=E.getDerivedStateFromProps,(Ne=typeof K=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Q!==je||nt!==Ae)&&x1(p,N,b,Ae),fm=!1,nt=p.memoizedState,N.state=nt,Up(p,b,N,D),Zf();var Ut=p.memoizedState;Q!==je||nt!==Ut||fm||d!==null&&d.dependencies!==null&&ms(d.dependencies)?(typeof K=="function"&&(Lb(p,E,K,b),Ut=p.memoizedState),(Ke=fm||X0(p,E,Ke,b,nt,Ut,Ae)||d!==null&&d.dependencies!==null&&ms(d.dependencies))?(Ne||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(b,Ut,Ae),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(b,Ut,Ae)),typeof N.componentDidUpdate=="function"&&(p.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof N.componentDidUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=1024),p.memoizedProps=b,p.memoizedState=Ut),N.props=b,N.state=Ut,N.context=Ae,b=Ke):(typeof N.componentDidUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===d.memoizedProps&&nt===d.memoizedState||(p.flags|=1024),b=!1)}return N=b,oy(d,p),b=(p.flags&128)!==0,N||b?(N=p.stateNode,E=b&&typeof E.getDerivedStateFromError!="function"?null:N.render(),p.flags|=1,d!==null&&b?(p.child=og(p,d.child,null,D),p.child=og(p,null,E,D)):Vi(d,p,E,D),p.memoizedState=N.state,d=p.child):d=Va(d,p,D),d}function Gb(d,p,E,b){return tn(),p.flags|=256,Vi(d,p,E,b),p.child}function iy(d){return{baseLanes:d,cachePool:xt()}}function yd(d,p,E){return d=d!==null?d.childLanes&~E:0,p&&(d|=Qu),d}function jb(d,p,E){var b=p.pendingProps,D=!1,N=(p.flags&128)!==0,Q;if((Q=N)||(Q=d!==null&&d.memoizedState===null?!1:(Ko.current&2)!==0),Q&&(D=!0,p.flags&=-129),Q=(p.flags&32)!==0,p.flags&=-33,d===null){if(Un){if(D?gl(p):Tc(p),(d=ao)?(d=gq(d,Oc),d!==null&&(p.memoizedState={dehydrated:d,treeContext:tf!==null?{id:Ia,overflow:Nd}:null,retryLane:536870912,hydrationErrors:null},E=fI(d),E.return=p,p.child=E,Di=p,ao=null)):d=null,d===null)throw ar(p);return By(d)?p.lanes=32:p.lanes=536870912,null}var K=b.children;return b=b.fallback,D?(Tc(p),D=p.mode,K=bl({mode:"hidden",children:K},D),b=Yp(b,D,E,null),K.return=p,b.return=p,K.sibling=b,p.child=K,b=p.child,b.memoizedState=iy(E),b.childLanes=yd(d,Q,E),p.memoizedState=VI,Cc(null,b)):(gl(p),zb(p,K))}var Ae=d.memoizedState;if(Ae!==null&&(K=Ae.dehydrated,K!==null)){if(N)p.flags&256?(gl(p),p.flags&=-257,p=ya(d,p,E)):p.memoizedState!==null?(Tc(p),p.child=d.child,p.flags|=128,p=null):(Tc(p),K=b.fallback,D=p.mode,b=bl({mode:"visible",children:b.children},D),K=Yp(K,D,E,null),K.flags|=2,b.return=p,K.return=p,b.sibling=K,p.child=b,og(p,d.child,null,E),b=p.child,b.memoizedState=iy(E),b.childLanes=yd(d,Q,E),p.memoizedState=VI,p=Cc(null,b));else if(gl(p),By(K))Q=ZA(K).digest,b=Error(r(419)),b.stack="",b.digest=Q,Rt({value:b,source:null,stack:null}),p=ya(d,p,E);else if(pi||$i(d,p,E,!1),Q=(E&d.childLanes)!==0,pi||Q){if(Q=Lr,Q!==null&&(b=_e(Q,E),b!==0&&b!==Ae.retryLane))throw Ae.retryLane=b,Ec(d,b),Sa(Q,d,b),qI;Ny(K)||Gh(),p=ya(d,p,E)}else Ny(K)?(p.flags|=192,p.child=d.child,p=null):(d=Ae.treeContext,ys&&(ao=x2(K),Di=p,Un=!0,nf=null,Oc=!1,d!==null&&en(p,d)),p=zb(p,b.children),p.flags|=4096);return p}return D?(Tc(p),K=b.fallback,D=p.mode,Ae=d.child,N=Ae.sibling,b=Id(Ae,{mode:"hidden",children:b.children}),b.subtreeFlags=Ae.subtreeFlags&65011712,N!==null?K=Id(N,K):(K=Yp(K,D,E,null),K.flags|=2),K.return=p,b.return=p,b.sibling=K,p.child=b,Cc(null,b),b=p.child,K=d.child.memoizedState,K===null?K=iy(E):(D=K.cachePool,D!==null?(Ae=Dc?Eo._currentValue:Eo._currentValue2,D=D.parent!==Ae?{parent:Ae,pool:Ae}:D):D=xt(),K={baseLanes:K.baseLanes|E,cachePool:D}),b.memoizedState=K,b.childLanes=yd(d,Q,E),p.memoizedState=VI,Cc(d.child,b)):(gl(p),E=d.child,d=E.sibling,E=Id(E,{mode:"visible",children:b.children}),E.return=p,E.sibling=null,d!==null&&(Q=p.deletions,Q===null?(p.deletions=[d],p.flags|=16):Q.push(d)),p.child=E,p.memoizedState=null,E)}function zb(d,p){return p=bl({mode:"visible",children:p},d.mode),p.return=d,d.child=p}function bl(d,p){return d=t(22,d,null,p),d.lanes=0,d}function ya(d,p,E){return og(p,d.child,null,E),d=zb(p,p.pendingProps.children),d.flags|=2,p.memoizedState=null,d}function sy(d,p,E){d.lanes|=p;var b=d.alternate;b!==null&&(b.lanes|=p),ai(d.return,p,E)}function An(d,p,E,b,D,N){var Q=d.memoizedState;Q===null?d.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:b,tail:E,tailMode:D,treeForkCount:N}:(Q.isBackwards=p,Q.rendering=null,Q.renderingStartTime=0,Q.last=b,Q.tail=E,Q.tailMode=D,Q.treeForkCount=N)}function we(d,p,E){var b=p.pendingProps,D=b.revealOrder,N=b.tail;b=b.children;var Q=Ko.current,K=(Q&2)!==0;if(K?(Q=Q&1|2,p.flags|=128):Q&=1,T(Ko,Q),Vi(d,p,b,E),b=Un?le:0,!K&&d!==null&&(d.flags&128)!==0)e:for(d=p.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&sy(d,E,p);else if(d.tag===19)sy(d,E,p);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===p)break e;for(;d.sibling===null;){if(d.return===null||d.return===p)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}switch(D){case"forwards":for(E=p.child,D=null;E!==null;)d=E.alternate,d!==null&&hl(d)===null&&(D=E),E=E.sibling;E=D,E===null?(D=p.child,p.child=null):(D=E.sibling,E.sibling=null),An(p,!1,D,E,N,b);break;case"backwards":case"unstable_legacy-backwards":for(E=null,D=p.child,p.child=null;D!==null;){if(d=D.alternate,d!==null&&hl(d)===null){p.child=D;break}d=D.sibling,D.sibling=E,E=D,D=d}An(p,!0,E,null,N,b);break;case"together":An(p,!1,null,null,void 0,b);break;default:p.memoizedState=null}return p.child}function Va(d,p,E){if(d!==null&&(p.dependencies=d.dependencies),gm|=p.lanes,(E&p.childLanes)===0)if(d!==null){if($i(d,p,E,!1),(E&p.childLanes)===0)return null}else return null;if(d!==null&&p.child!==d.child)throw Error(r(153));if(p.child!==null){for(d=p.child,E=Id(d,d.pendingProps),p.child=E,E.return=p;d.sibling!==null;)d=d.sibling,E=E.sibling=Id(d,d.pendingProps),E.return=p;E.sibling=null}return p.child}function Mh(d,p){return(d.lanes&p)!==0?!0:(d=d.dependencies,!!(d!==null&&ms(d)))}function Do(d,p,E){switch(p.tag){case 3:Tn(p,p.stateNode.containerInfo),Ln(p,Eo,d.memoizedState.cache),tn();break;case 27:case 5:Us(p);break;case 4:Tn(p,p.stateNode.containerInfo);break;case 10:Ln(p,p.type,p.memoizedProps.value);break;case 31:if(p.memoizedState!==null)return p.flags|=128,Qp(p),null;break;case 13:var b=p.memoizedState;if(b!==null)return b.dehydrated!==null?(gl(p),p.flags|=128,null):(E&p.child.childLanes)!==0?jb(d,p,E):(gl(p),d=Va(d,p,E),d!==null?d.sibling:null);gl(p);break;case 19:var D=(d.flags&128)!==0;if(b=(E&p.childLanes)!==0,b||($i(d,p,E,!1),b=(E&p.childLanes)!==0),D){if(b)return we(d,p,E);p.flags|=128}if(D=p.memoizedState,D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),T(Ko,Ko.current),b)break;return null;case 22:return p.lanes=0,zp(d,p,E,p.pendingProps);case 24:Ln(p,Eo,d.memoizedState.cache)}return Va(d,p,E)}function Hb(d,p,E){if(d!==null)if(d.memoizedProps!==p.pendingProps)pi=!0;else{if(!Mh(d,E)&&(p.flags&128)===0)return pi=!1,Do(d,p,E);pi=(d.flags&131072)!==0}else pi=!1,Un&&(p.flags&1048576)!==0&&Gr(p,le,p.index);switch(p.lanes=0,p.tag){case 16:e:{var b=p.pendingProps;if(d=Wr(p.elementType),p.type=d,typeof d=="function")_y(d)?(b=Ed(d,b),p.tag=1,p=w1(null,p,d,b,E)):(p.tag=0,p=N1(null,p,d,b,E));else{if(d!=null){var D=d.$$typeof;if(D===zh){p.tag=11,p=ny(null,p,d,b,E);break e}else if(D===eN){p.tag=14,p=Qb(null,p,d,b,E);break e}}throw p=h(d)||d,Error(r(306,p,""))}}return p;case 0:return N1(d,p,p.type,p.pendingProps,E);case 1:return b=p.type,D=Ed(b,p.pendingProps),w1(d,p,b,D,E);case 3:e:{if(Tn(p,p.stateNode.containerInfo),d===null)throw Error(r(387));var N=p.pendingProps;D=p.memoizedState,b=D.element,Lp(d,p),Up(p,N,null,E);var Q=p.memoizedState;if(N=Q.cache,Ln(p,Eo,N),N!==D.cache&&vt(p,[Eo],E,!0),Zf(),N=Q.element,ys&&D.isDehydrated)if(D={element:N,isDehydrated:!1,cache:Q.cache},p.updateQueue.baseState=D,p.memoizedState=D,p.flags&256){p=Gb(d,p,N,E);break e}else if(N!==b){b=ut(Error(r(424)),p),Rt(b),p=Gb(d,p,N,E);break e}else for(ys&&(ao=vI(p.stateNode.containerInfo),Di=p,Un=!0,nf=null,Oc=!0),E=Y2(p,null,N,E),p.child=E;E;)E.flags=E.flags&-3|4096,E=E.sibling;else{if(tn(),N===b){p=Va(d,p,E);break e}Vi(d,p,N,E)}p=p.child}return p;case 26:if(Nc)return oy(d,p),d===null?(E=Yh(p.type,null,p.pendingProps,null))?p.memoizedState=E:Un||(p.stateNode=j2(p.type,p.pendingProps,dm.current,p)):p.memoizedState=Yh(p.type,d.memoizedProps,p.pendingProps,d.memoizedState),null;case 27:if(ci)return Us(p),d===null&&ci&&Un&&(b=p.stateNode=BI(p.type,p.pendingProps,dm.current,bs.current,!1),Di=p,Oc=!0,ao=mq(p.type,b,ao)),Vi(d,p,p.pendingProps.children,E),oy(d,p),d===null&&(p.flags|=4194304),p.child;case 5:return d===null&&Un&&(Eq(p.type,p.pendingProps,bs.current),(D=b=ao)&&(b=Aq(b,p.type,p.pendingProps,Oc),b!==null?(p.stateNode=b,Di=p,ao=CI(b),Oc=!1,D=!0):D=!1),D||ar(p)),Us(p),D=p.type,N=p.pendingProps,Q=d!==null?d.memoizedProps:null,b=N.children,vy(D,N)?b=null:Q!==null&&vy(D,Q)&&(p.flags|=32),p.memoizedState!==null&&(D=Fp(d,p,QA,null,null,E),Dc?cm._currentValue=D:cm._currentValue2=D),oy(d,p),Vi(d,p,b,E),p.child;case 6:return d===null&&Un&&(AN(p.pendingProps,bs.current),(d=E=ao)&&(E=D2(E,p.pendingProps,Oc),E!==null?(p.stateNode=E,Di=p,ao=null,d=!0):d=!1),d||ar(p)),null;case 13:return jb(d,p,E);case 4:return Tn(p,p.stateNode.containerInfo),b=p.pendingProps,d===null?p.child=og(p,null,b,E):Vi(d,p,b,E),p.child;case 11:return ny(d,p,p.type,p.pendingProps,E);case 7:return Vi(d,p,p.pendingProps,E),p.child;case 8:return Vi(d,p,p.pendingProps.children,E),p.child;case 12:return Vi(d,p,p.pendingProps.children,E),p.child;case 10:return b=p.pendingProps,Ln(p,p.type,b.value),Vi(d,p,b.children,E),p.child;case 9:return D=p.type._context,b=p.pendingProps.children,xo(p),D=ho(D),b=b(D),p.flags|=1,Vi(d,p,b,E),p.child;case 14:return Qb(d,p,p.type,p.pendingProps,E);case 15:return Fb(d,p,p.type,p.pendingProps,E);case 19:return we(d,p,E);case 31:return ry(d,p,E);case 22:return zp(d,p,E,p.pendingProps);case 24:return xo(p),b=ho(Eo),d===null?(D=et(),D===null&&(D=Lr,N=Jf(),D.pooledCache=N,N.refCount++,N!==null&&(D.pooledCacheLanes|=E),D=N),p.memoizedState={parent:b,cache:D},Mp(p),Ln(p,Eo,D)):((d.lanes&E)!==0&&(Lp(d,p),Up(p,null,null,E),Zf()),D=d.memoizedState,N=p.memoizedState,D.parent!==b?(D={parent:b,cache:b},p.memoizedState=D,p.lanes===0&&(p.memoizedState=p.updateQueue.baseState=D),Ln(p,Eo,b)):(b=N.cache,Ln(p,Eo,b),b!==D.cache&&vt(p,[Eo],E,!0))),Vi(d,p,p.pendingProps.children,E),p.child;case 29:throw p.pendingProps}throw Error(r(156,p.tag))}function ku(d){d.flags|=4}function ay(d){xl&&(d.flags|=8)}function $b(d,p){if(d!==null&&d.child===p.child)return!1;if((p.flags&16)!==0)return!0;for(d=p.child;d!==null;){if((d.flags&8218)!==0||(d.subtreeFlags&8218)!==0)return!0;d=d.sibling}return!1}function O1(d,p,E,b){if($s)for(E=p.child;E!==null;){if(E.tag===5||E.tag===6)yI(d,E.stateNode);else if(!(E.tag===4||ci&&E.tag===27)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===p)break;for(;E.sibling===null;){if(E.return===null||E.return===p)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else if(xl)for(var D=p.child;D!==null;){if(D.tag===5){var N=D.stateNode;E&&b&&(N=Zp(N,D.type,D.memoizedProps)),yI(d,N)}else if(D.tag===6)N=D.stateNode,E&&b&&(N=Dy(N,D.memoizedProps)),yI(d,N);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)N=D.child,N!==null&&(N.return=D),O1(d,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===p)break;for(;D.sibling===null;){if(D.return===null||D.return===p)return;D=D.return}D.sibling.return=D.return,D=D.sibling}}function qb(d,p,E,b){var D=!1;if(xl)for(var N=p.child;N!==null;){if(N.tag===5){var Q=N.stateNode;E&&b&&(Q=Zp(Q,N.type,N.memoizedProps)),lN(d,Q)}else if(N.tag===6)Q=N.stateNode,E&&b&&(Q=Dy(Q,N.memoizedProps)),lN(d,Q);else if(N.tag!==4){if(N.tag===22&&N.memoizedState!==null)D=N.child,D!==null&&(D.return=N),qb(d,N,!0,!0),D=!0;else if(N.child!==null){N.child.return=N,N=N.child;continue}}if(N===p)break;for(;N.sibling===null;){if(N.return===null||N.return===p)return D;N=N.return}N.sibling.return=N.return,N=N.sibling}return D}function Vb(d,p){if(xl&&$b(d,p)){d=p.stateNode;var E=d.containerInfo,b=so();qb(b,p,!1,!1),d.pendingChildren=b,ku(p),b2(E,b)}}function uy(d,p,E,b){if($s)d.memoizedProps!==b&&ku(p);else if(xl){var D=d.stateNode,N=d.memoizedProps;if((d=$b(d,p))||N!==b){var Q=bs.current;N=T2(D,E,N,b,!d,null),N===D?p.stateNode=D:(ay(p),i2(N,E,b,Q)&&ku(p),p.stateNode=N,d&&O1(N,p,!1,!1))}else p.stateNode=D}}function Es(d,p,E,b,D){if((d.mode&32)!==0&&(E===null?c2(p,b):pq(p,E,b))){if(d.flags|=16777216,(D&335544128)===D||Hh(p,b))if(Ss(d.stateNode,p,b))d.flags|=8192;else if(WM())d.flags|=8192;else throw kc=GI,QI}else d.flags&=-16777217}function hr(d,p){if(yq(p)){if(d.flags|=16777216,!NI(p))if(WM())d.flags|=8192;else throw kc=GI,QI}else d.flags&=-16777217}function jA(d,p){p!==null&&(d.flags|=4),d.flags&16384&&(p=d.tag!==22?j():536870912,d.lanes|=p,a_|=p)}function Hp(d,p){if(!Un)switch(d.tailMode){case"hidden":p=d.tail;for(var E=null;p!==null;)p.alternate!==null&&(E=p),p=p.sibling;E===null?d.tail=null:E.sibling=null;break;case"collapsed":E=d.tail;for(var b=null;E!==null;)E.alternate!==null&&(b=E),E=E.sibling;b===null?p||d.tail===null?d.tail=null:d.tail.sibling=null:b.sibling=null}}function fr(d){var p=d.alternate!==null&&d.alternate.child===d.child,E=0,b=0;if(p)for(var D=d.child;D!==null;)E|=D.lanes|D.childLanes,b|=D.subtreeFlags&65011712,b|=D.flags&65011712,D.return=d,D=D.sibling;else for(D=d.child;D!==null;)E|=D.lanes|D.childLanes,b|=D.subtreeFlags,b|=D.flags,D.return=d,D=D.sibling;return d.subtreeFlags|=b,d.childLanes=E,p}function zA(d,p,E){var b=p.pendingProps;switch(mt(p),p.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fr(p),null;case 1:return fr(p),null;case 3:return E=p.stateNode,b=null,d!==null&&(b=d.memoizedState.cache),p.memoizedState.cache!==b&&(p.flags|=2048),oo(Eo),yr(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(d===null||d.child===null)&&(ft(p)?ku(p):d===null||d.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,bn())),Vb(d,p),fr(p),null;case 26:if(Nc){var D=p.type,N=p.memoizedState;return d===null?(ku(p),N!==null?(fr(p),hr(p,N)):(fr(p),Es(p,D,null,b,E))):N?N!==d.memoizedState?(ku(p),fr(p),hr(p,N)):(fr(p),p.flags&=-16777217):(N=d.memoizedProps,$s?N!==b&&ku(p):uy(d,p,D,b),fr(p),Es(p,D,N,b,E)),null}case 27:if(ci){if(Vn(p),E=dm.current,D=p.type,d!==null&&p.stateNode!=null)$s?d.memoizedProps!==b&&ku(p):uy(d,p,D,b);else{if(!b){if(p.stateNode===null)throw Error(r(166));return fr(p),null}d=bs.current,ft(p)?zt(p,d):(d=BI(D,b,E,d,!0),p.stateNode=d,ku(p))}return fr(p),null}case 5:if(Vn(p),D=p.type,d!==null&&p.stateNode!=null)uy(d,p,D,b);else{if(!b){if(p.stateNode===null)throw Error(r(166));return fr(p),null}if(N=bs.current,ft(p))zt(p,N),M2(p.stateNode,D,b,N)&&(p.flags|=64);else{var Q=vd(D,b,dm.current,N,p);ay(p),O1(Q,p,!1,!1),p.stateNode=Q,i2(Q,D,b,N)&&ku(p)}}return fr(p),Es(p,p.type,d===null?null:d.memoizedProps,p.pendingProps,E),null;case 6:if(d&&p.stateNode!=null)E=d.memoizedProps,$s?E!==b&&ku(p):xl&&(E!==b?(d=dm.current,E=bs.current,ay(p),p.stateNode=SI(b,d,E,p)):p.stateNode=d.stateNode);else{if(typeof b!="string"&&p.stateNode===null)throw Error(r(166));if(d=dm.current,E=bs.current,ft(p)){if(!ys)throw Error(r(176));if(d=p.stateNode,E=p.memoizedProps,b=null,D=Di,D!==null)switch(D.tag){case 27:case 5:b=D.memoizedProps}RI(d,E,p,b)||ar(p,!0)}else ay(p),p.stateNode=SI(b,d,E,p)}return fr(p),null;case 31:if(E=p.memoizedState,d===null||d.memoizedState!==null){if(b=ft(p),E!==null){if(d===null){if(!b)throw Error(r(318));if(!ys)throw Error(r(556));if(d=p.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(557));B2(d,p)}else tn(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;fr(p),d=!1}else E=bn(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=E),d=!0;if(!d)return p.flags&256?(Ri(p),p):(Ri(p),null);if((p.flags&128)!==0)throw Error(r(558))}return fr(p),null;case 13:if(b=p.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(D=ft(p),b!==null&&b.dehydrated!==null){if(d===null){if(!D)throw Error(r(318));if(!ys)throw Error(r(344));if(D=p.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(r(317));fN(D,p)}else tn(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;fr(p),D=!1}else D=bn(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=D),D=!0;if(!D)return p.flags&256?(Ri(p),p):(Ri(p),null)}return Ri(p),(p.flags&128)!==0?(p.lanes=E,p):(E=b!==null,d=d!==null&&d.memoizedState!==null,E&&(b=p.child,D=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(D=b.alternate.memoizedState.cachePool.pool),N=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(N=b.memoizedState.cachePool.pool),N!==D&&(b.flags|=2048)),E!==d&&E&&(p.child.flags|=8192),jA(p,p.updateQueue),fr(p),null);case 4:return yr(),Vb(d,p),d===null&&dq(p.stateNode.containerInfo),fr(p),null;case 10:return oo(p.type),fr(p),null;case 19:if(y(Ko),b=p.memoizedState,b===null)return fr(p),null;if(D=(p.flags&128)!==0,N=b.rendering,N===null)if(D)Hp(b,!1);else{if(No!==0||d!==null&&(d.flags&128)!==0)for(d=p.child;d!==null;){if(N=hl(d),N!==null){for(p.flags|=128,Hp(b,!1),d=N.updateQueue,p.updateQueue=d,jA(p,d),p.subtreeFlags=0,d=E,E=p.child;E!==null;)K1(E,d),E=E.sibling;return T(Ko,Ko.current&1|2),Un&&Lt(p,b.treeForkCount),p.child}d=d.sibling}b.tail!==null&&Sr()>u_&&(p.flags|=128,D=!0,Hp(b,!1),p.lanes=4194304)}else{if(!D)if(d=hl(N),d!==null){if(p.flags|=128,D=!0,d=d.updateQueue,p.updateQueue=d,jA(p,d),Hp(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!Un)return fr(p),null}else 2*Sr()-b.renderingStartTime>u_&&E!==536870912&&(p.flags|=128,D=!0,Hp(b,!1),p.lanes=4194304);b.isBackwards?(N.sibling=p.child,p.child=N):(d=b.last,d!==null?d.sibling=N:p.child=N,b.last=N)}return b.tail!==null?(d=b.tail,b.rendering=d,b.tail=d.sibling,b.renderingStartTime=Sr(),d.sibling=null,E=Ko.current,T(Ko,D?E&1|2:E&1),Un&&Lt(p,b.treeForkCount),d):(fr(p),null);case 22:case 23:return Ri(p),Al(),b=p.memoizedState!==null,d!==null?d.memoizedState!==null!==b&&(p.flags|=8192):b&&(p.flags|=8192),b?(E&536870912)!==0&&(p.flags&128)===0&&(fr(p),p.subtreeFlags&6&&(p.flags|=8192)):fr(p),E=p.updateQueue,E!==null&&jA(p,E.retryQueue),E=null,d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(E=d.memoizedState.cachePool.pool),b=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(b=p.memoizedState.cachePool.pool),b!==E&&(p.flags|=2048),d!==null&&y(pm),null;case 24:return E=null,d!==null&&(E=d.memoizedState.cache),p.memoizedState.cache!==E&&(p.flags|=2048),oo(Eo),fr(p),null;case 25:return null;case 30:return null}throw Error(r(156,p.tag))}function Il(d,p){switch(mt(p),p.tag){case 1:return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 3:return oo(Eo),yr(),d=p.flags,(d&65536)!==0&&(d&128)===0?(p.flags=d&-65537|128,p):null;case 26:case 27:case 5:return Vn(p),null;case 31:if(p.memoizedState!==null){if(Ri(p),p.alternate===null)throw Error(r(340));tn()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 13:if(Ri(p),d=p.memoizedState,d!==null&&d.dehydrated!==null){if(p.alternate===null)throw Error(r(340));tn()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 19:return y(Ko),null;case 4:return yr(),null;case 10:return oo(p.type),null;case 22:case 23:return Ri(p),Al(),d!==null&&y(pm),d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 24:return oo(Eo),null;case 25:return null;default:return null}}function Yb(d,p){switch(mt(p),p.tag){case 3:oo(Eo),yr();break;case 26:case 27:case 5:Vn(p);break;case 4:yr();break;case 31:p.memoizedState!==null&&Ri(p);break;case 13:Ri(p);break;case 19:y(Ko);break;case 10:oo(p.type);break;case 22:case 23:Ri(p),Al(),d!==null&&y(pm);break;case 24:oo(Eo)}}function Sd(d,p){try{var E=p.updateQueue,b=E!==null?E.lastEffect:null;if(b!==null){var D=b.next;E=D;do{if((E.tag&d)===d){b=void 0;var N=E.create,Q=E.inst;b=N(),Q.destroy=b}E=E.next}while(E!==D)}}catch(K){ur(p,p.return,K)}}function Td(d,p,E){try{var b=p.updateQueue,D=b!==null?b.lastEffect:null;if(D!==null){var N=D.next;b=N;do{if((b.tag&d)===d){var Q=b.inst,K=Q.destroy;if(K!==void 0){Q.destroy=void 0,D=p;var Ae=E,Ne=K;try{Ne()}catch(Ke){ur(D,Ae,Ke)}}}b=b.next}while(b!==N)}}catch(Ke){ur(p,p.return,Ke)}}function Lh(d){var p=d.updateQueue;if(p!==null){var E=d.stateNode;try{xb(p,E)}catch(b){ur(d,d.return,b)}}}function Kb(d,p,E){E.props=Ed(d.type,d.memoizedProps),E.state=d.memoizedState;try{E.componentWillUnmount()}catch(b){ur(d,p,b)}}function em(d,p){try{var E=d.ref;if(E!==null){switch(d.tag){case 26:case 27:case 5:var b=Iy(d.stateNode);break;case 30:b=d.stateNode;break;default:b=d.stateNode}typeof E=="function"?d.refCleanup=E(b):E.current=b}}catch(D){ur(d,p,D)}}function Cl(d,p){var E=d.ref,b=d.refCleanup;if(E!==null)if(typeof b=="function")try{b()}catch(D){ur(d,p,D)}finally{d.refCleanup=null,d=d.alternate,d!=null&&(d.refCleanup=null)}else if(typeof E=="function")try{E(null)}catch(D){ur(d,p,D)}else E.current=null}function k1(d){var p=d.type,E=d.memoizedProps,b=d.stateNode;try{h2(b,p,E,d)}catch(D){ur(d,d.return,D)}}function Jb(d,p,E){try{TI(d.stateNode,d.type,E,p,d)}catch(b){ur(d,d.return,b)}}function P1(d){return d.tag===5||d.tag===3||(Nc?d.tag===26:!1)||(ci?d.tag===27&&XA(d.type):!1)||d.tag===4}function Zb(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||P1(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(ci&&d.tag===27&&XA(d.type)||d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function cy(d,p,E){var b=d.tag;if(b===5||b===6)d=d.stateNode,p?E2(E,d,p):g2(E,d);else if(b!==4&&(ci&&b===27&&XA(d.type)&&(E=d.stateNode,p=null),d=d.child,d!==null))for(cy(d,p,E),d=d.sibling;d!==null;)cy(d,p,E),d=d.sibling}function Uh(d,p,E){var b=d.tag;if(b===5||b===6)d=d.stateNode,p?_2(E,d,p):A2(E,d);else if(b!==4&&(ci&&b===27&&XA(d.type)&&(E=d.stateNode),d=d.child,d!==null))for(Uh(d,p,E),d=d.sibling;d!==null;)Uh(d,p,E),d=d.sibling}function Wb(d,p,E){d=d.containerInfo;try{I2(d,E)}catch(b){ur(p,p.return,b)}}function M1(d){var p=d.stateNode,E=d.memoizedProps;try{wI(d.type,E,p,d)}catch(b){ur(d,d.return,b)}}function $M(d,p){for(lq(d.containerInfo),Yi=p;Yi!==null;)if(d=Yi,p=d.child,(d.subtreeFlags&1028)!==0&&p!==null)p.return=d,Yi=p;else for(;Yi!==null;){d=Yi;var E=d.alternate;switch(p=d.flags,d.tag){case 0:if((p&4)!==0&&(p=d.updateQueue,p=p!==null?p.events:null,p!==null))for(var b=0;b<p.length;b++){var D=p[b];D.ref.impl=D.nextImpl}break;case 11:case 15:break;case 1:if((p&1024)!==0&&E!==null){p=void 0,b=d,D=E.memoizedProps,E=E.memoizedState;var N=b.stateNode;try{var Q=Ed(b.type,D);p=N.getSnapshotBeforeUpdate(Q,E),N.__reactInternalSnapshotBeforeUpdate=p}catch(K){ur(b,b.return,K)}}break;case 3:(p&1024)!==0&&$s&&Mu(d.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((p&1024)!==0)throw Error(r(163))}if(p=d.sibling,p!==null){p.return=d.return,Yi=p;break}Yi=d.return}}function L1(d,p,E){var b=E.flags;switch(E.tag){case 0:case 11:case 15:Rc(d,E),b&4&&Sd(5,E);break;case 1:if(Rc(d,E),b&4)if(d=E.stateNode,p===null)try{d.componentDidMount()}catch(Q){ur(E,E.return,Q)}else{var D=Ed(E.type,p.memoizedProps);p=p.memoizedState;try{d.componentDidUpdate(D,p,d.__reactInternalSnapshotBeforeUpdate)}catch(Q){ur(E,E.return,Q)}}b&64&&Lh(E),b&512&&em(E,E.return);break;case 3:if(Rc(d,E),b&64&&(b=E.updateQueue,b!==null)){if(d=null,E.child!==null)switch(E.child.tag){case 27:case 5:d=Iy(E.child.stateNode);break;case 1:d=E.child.stateNode}try{xb(b,d)}catch(Q){ur(E,E.return,Q)}}break;case 27:ci&&p===null&&b&4&&M1(E);case 26:case 5:if(Rc(d,E),p===null){if(b&4)k1(E);else if(b&64){d=E.type,p=E.memoizedProps,D=E.stateNode;try{k2(D,d,p,E)}catch(Q){ur(E,E.return,Q)}}}b&512&&em(E,E.return);break;case 12:Rc(d,E);break;case 31:Rc(d,E),b&4&&U1(d,E);break;case 13:Rc(d,E),b&4&&eI(d,E),b&64&&(b=E.memoizedState,b!==null&&(b=b.dehydrated,b!==null&&(E=dI.bind(null,E),$h(b,E))));break;case 22:if(b=E.memoizedState!==null||kd,!b){p=p!==null&&p.memoizedState!==null||Jo,D=kd;var N=Jo;kd=b,(Jo=p)&&!N?vl(d,E,(E.subtreeFlags&8772)!==0):Rc(d,E),kd=D,Jo=N}break;case 30:break;default:Rc(d,E)}}function qM(d){var p=d.alternate;p!==null&&(d.alternate=null,qM(p)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(p=d.stateNode,p!==null&&u2(p)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function vc(d,p,E){for(E=E.child;E!==null;)Xb(d,p,E),E=E.sibling}function Xb(d,p,E){if(Vo&&typeof Vo.onCommitFiberUnmount=="function")try{Vo.onCommitFiberUnmount(tg,E)}catch{}switch(E.tag){case 26:if(Nc){Jo||Cl(E,p),vc(d,p,E),E.memoizedState?G2(E.memoizedState):E.stateNode&&hN(E.stateNode);break}case 27:if(ci){Jo||Cl(E,p);var b=fi,D=eu;XA(E.type)&&(fi=E.stateNode,eu=!1),vc(d,p,E),lm(E.stateNode),fi=b,eu=D;break}case 5:Jo||Cl(E,p);case 6:if($s){if(b=fi,D=eu,fi=null,vc(d,p,E),fi=b,eu=D,fi!==null)if(eu)try{cN(fi,E.stateNode)}catch(N){ur(E,p,N)}else try{uN(fi,E.stateNode)}catch(N){ur(E,p,N)}}else vc(d,p,E);break;case 18:$s&&fi!==null&&(eu?mN(fi,E.stateNode):cr(fi,E.stateNode));break;case 4:$s?(b=fi,D=eu,fi=E.stateNode.containerInfo,eu=!0,vc(d,p,E),fi=b,eu=D):(xl&&Wb(E.stateNode,E,so()),vc(d,p,E));break;case 0:case 11:case 14:case 15:Td(2,E,p),Jo||Td(4,E,p),vc(d,p,E);break;case 1:Jo||(Cl(E,p),b=E.stateNode,typeof b.componentWillUnmount=="function"&&Kb(E,p,b)),vc(d,p,E);break;case 21:vc(d,p,E);break;case 22:Jo=(b=Jo)||E.memoizedState!==null,vc(d,p,E),Jo=b;break;default:vc(d,p,E)}}function U1(d,p){if(ys&&p.memoizedState===null&&(d=p.alternate,d!==null&&(d=d.memoizedState,d!==null))){d=d.dehydrated;try{P2(d)}catch(E){ur(p,p.return,E)}}}function eI(d,p){if(ys&&p.memoizedState===null&&(d=p.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null))))try{Vh(d)}catch(E){ur(p,p.return,E)}}function VM(d){switch(d.tag){case 31:case 13:case 19:var p=d.stateNode;return p===null&&(p=d.stateNode=new YI),p;case 22:return d=d.stateNode,p=d._retryCache,p===null&&(p=d._retryCache=new YI),p;default:throw Error(r(435,d.tag))}}function ly(d,p){var E=VM(d);p.forEach(function(b){if(!E.has(b)){E.add(b);var D=n2.bind(null,d,b);b.then(D,D)}})}function $o(d,p){var E=p.deletions;if(E!==null)for(var b=0;b<E.length;b++){var D=E[b],N=d,Q=p;if($s){var K=Q;e:for(;K!==null;){switch(K.tag){case 27:if(ci){if(XA(K.type)){fi=K.stateNode,eu=!1;break e}break}case 5:fi=K.stateNode,eu=!1;break e;case 3:case 4:fi=K.stateNode.containerInfo,eu=!0;break e}K=K.return}if(fi===null)throw Error(r(160));Xb(N,Q,D),fi=null,eu=!1}else Xb(N,Q,D);N=D.alternate,N!==null&&(N.return=null),D.return=null}if(p.subtreeFlags&13886)for(p=p.child;p!==null;)dy(p,d),p=p.sibling}function dy(d,p){var E=d.alternate,b=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:$o(p,d),zs(d),b&4&&(Td(3,d,d.return),Sd(3,d),Td(5,d,d.return));break;case 1:$o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),b&64&&kd&&(d=d.updateQueue,d!==null&&(b=d.callbacks,b!==null&&(E=d.shared.hiddenCallbacks,d.shared.hiddenCallbacks=E===null?b:E.concat(b))));break;case 26:if(Nc){var D=Ol;if($o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),b&4){b=E!==null?E.memoizedState:null;var N=d.memoizedState;E===null?N===null?d.stateNode===null?d.stateNode=WA(D,d.type,d.memoizedProps,d):DI(D,d.type,d.stateNode):d.stateNode=F2(D,N,d.memoizedProps):b!==N?(b===null?E.stateNode!==null&&hN(E.stateNode):G2(b),N===null?DI(D,d.type,d.stateNode):F2(D,N,d.memoizedProps)):N===null&&d.stateNode!==null&&Jb(d,d.memoizedProps,E.memoizedProps)}break}case 27:if(ci){$o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),E!==null&&b&4&&Jb(d,d.memoizedProps,E.memoizedProps);break}case 5:if($o(p,d),zs(d),b&512&&(Jo||E===null||Cl(E,E.return)),$s){if(d.flags&32){D=d.stateNode;try{bI(D)}catch(je){ur(d,d.return,je)}}b&4&&d.stateNode!=null&&(D=d.memoizedProps,Jb(d,D,E!==null?E.memoizedProps:D)),b&1024&&(Fy=!0)}else xl&&d.alternate!==null&&(d.alternate.stateNode=d.stateNode);break;case 6:if($o(p,d),zs(d),b&4&&$s){if(d.stateNode===null)throw Error(r(162));b=d.memoizedProps,E=E!==null?E.memoizedProps:b,D=d.stateNode;try{xy(D,E,b)}catch(je){ur(d,d.return,je)}}break;case 3:if(Nc?(z2(),D=Ol,Ol=xI(p.containerInfo),$o(p,d),Ol=D):$o(p,d),zs(d),b&4){if($s&&ys&&E!==null&&E.memoizedState.isDehydrated)try{hq(p.containerInfo)}catch(je){ur(d,d.return,je)}if(xl){b=p.containerInfo,E=p.pendingChildren;try{I2(b,E)}catch(je){ur(d,d.return,je)}}}Fy&&(Fy=!1,YM(d));break;case 4:Nc?(E=Ol,Ol=xI(d.stateNode.containerInfo),$o(p,d),zs(d),Ol=E):($o(p,d),zs(d)),b&4&&xl&&Wb(d.stateNode,d,d.stateNode.pendingChildren);break;case 12:$o(p,d),zs(d);break;case 31:$o(p,d),zs(d),b&4&&(b=d.updateQueue,b!==null&&(d.updateQueue=null,ly(d,b)));break;case 13:$o(p,d),zs(d),d.child.flags&8192&&d.memoizedState!==null!=(E!==null&&E.memoizedState!==null)&&(zy=Sr()),b&4&&(b=d.updateQueue,b!==null&&(d.updateQueue=null,ly(d,b)));break;case 22:D=d.memoizedState!==null;var Q=E!==null&&E.memoizedState!==null,K=kd,Ae=Jo;if(kd=K||D,Jo=Ae||Q,$o(p,d),Jo=Ae,kd=K,zs(d),b&8192&&(p=d.stateNode,p._visibility=D?p._visibility&-2:p._visibility|1,D&&(E===null||Q||kd||Jo||xc(d)),$s)){e:if(E=null,$s)for(p=d;;){if(p.tag===5||Nc&&p.tag===26){if(E===null){Q=E=p;try{N=Q.stateNode,D?y2(N):fq(Q.stateNode,Q.memoizedProps)}catch(je){ur(Q,Q.return,je)}}}else if(p.tag===6){if(E===null){Q=p;try{var Ne=Q.stateNode;D?II(Ne):S2(Ne,Q.memoizedProps)}catch(je){ur(Q,Q.return,je)}}}else if(p.tag===18){if(E===null){Q=p;try{var Ke=Q.stateNode;D?_q(Ke):U2(Q.stateNode)}catch(je){ur(Q,Q.return,je)}}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===d)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break e;for(;p.sibling===null;){if(p.return===null||p.return===d)break e;E===p&&(E=null),p=p.return}E===p&&(E=null),p.sibling.return=p.return,p=p.sibling}}b&4&&(b=d.updateQueue,b!==null&&(E=b.retryQueue,E!==null&&(b.retryQueue=null,ly(d,E))));break;case 19:$o(p,d),zs(d),b&4&&(b=d.updateQueue,b!==null&&(d.updateQueue=null,ly(d,b)));break;case 30:break;case 21:break;default:$o(p,d),zs(d)}}function zs(d){var p=d.flags;if(p&2){try{for(var E,b=d.return;b!==null;){if(P1(b)){E=b;break}b=b.return}if($s){if(E==null)throw Error(r(160));switch(E.tag){case 27:if(ci){var D=E.stateNode,N=Zb(d);Uh(d,N,D);break}case 5:var Q=E.stateNode;E.flags&32&&(bI(Q),E.flags&=-33);var K=Zb(d);Uh(d,K,Q);break;case 3:case 4:var Ae=E.stateNode.containerInfo,Ne=Zb(d);cy(d,Ne,Ae);break;default:throw Error(r(161))}}}catch(Ke){ur(d,d.return,Ke)}d.flags&=-3}p&4096&&(d.flags&=-4097)}function YM(d){if(d.subtreeFlags&1024)for(d=d.child;d!==null;){var p=d;YM(p),p.tag===5&&p.flags&1024&&YA(p.stateNode),d=d.sibling}}function Rc(d,p){if(p.subtreeFlags&8772)for(p=p.child;p!==null;)L1(d,p.alternate,p),p=p.sibling}function xc(d){for(d=d.child;d!==null;){var p=d;switch(p.tag){case 0:case 11:case 14:case 15:Td(4,p,p.return),xc(p);break;case 1:Cl(p,p.return);var E=p.stateNode;typeof E.componentWillUnmount=="function"&&Kb(p,p.return,E),xc(p);break;case 27:ci&&lm(p.stateNode);case 26:case 5:Cl(p,p.return),xc(p);break;case 22:p.memoizedState===null&&xc(p);break;case 30:xc(p);break;default:xc(p)}d=d.sibling}}function vl(d,p,E){for(E=E&&(p.subtreeFlags&8772)!==0,p=p.child;p!==null;){var b=p.alternate,D=d,N=p,Q=N.flags;switch(N.tag){case 0:case 11:case 15:vl(D,N,E),Sd(4,N);break;case 1:if(vl(D,N,E),b=N,D=b.stateNode,typeof D.componentDidMount=="function")try{D.componentDidMount()}catch(Ne){ur(b,b.return,Ne)}if(b=N,D=b.updateQueue,D!==null){var K=b.stateNode;try{var Ae=D.shared.hiddenCallbacks;if(Ae!==null)for(D.shared.hiddenCallbacks=null,D=0;D<Ae.length;D++)$0(Ae[D],K)}catch(Ne){ur(b,b.return,Ne)}}E&&Q&64&&Lh(N),em(N,N.return);break;case 27:ci&&M1(N);case 26:case 5:vl(D,N,E),E&&b===null&&Q&4&&k1(N),em(N,N.return);break;case 12:vl(D,N,E);break;case 31:vl(D,N,E),E&&Q&4&&U1(D,N);break;case 13:vl(D,N,E),E&&Q&4&&eI(D,N);break;case 22:N.memoizedState===null&&vl(D,N,E),em(N,N.return);break;case 30:break;default:vl(D,N,E)}p=p.sibling}}function $p(d,p){var E=null;d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(E=d.memoizedState.cachePool.pool),d=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(d=p.memoizedState.cachePool.pool),d!==E&&(d!=null&&d.refCount++,E!=null&&Bu(E))}function Hs(d,p){d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&Bu(d))}function Ya(d,p,E,b){if(p.subtreeFlags&10256)for(p=p.child;p!==null;)KM(d,p,E,b),p=p.sibling}function KM(d,p,E,b){var D=p.flags;switch(p.tag){case 0:case 11:case 15:Ya(d,p,E,b),D&2048&&Sd(9,p);break;case 1:Ya(d,p,E,b);break;case 3:Ya(d,p,E,b),D&2048&&(d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&Bu(d)));break;case 12:if(D&2048){Ya(d,p,E,b),d=p.stateNode;try{var N=p.memoizedProps,Q=N.id,K=N.onPostCommit;typeof K=="function"&&K(Q,p.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(Ae){ur(p,p.return,Ae)}}else Ya(d,p,E,b);break;case 31:Ya(d,p,E,b);break;case 13:Ya(d,p,E,b);break;case 23:break;case 22:N=p.stateNode,Q=p.alternate,p.memoizedState!==null?N._visibility&2?Ya(d,p,E,b):nm(d,p):N._visibility&2?Ya(d,p,E,b):(N._visibility|=2,tm(d,p,E,b,(p.subtreeFlags&10256)!==0||!1)),D&2048&&$p(Q,p);break;case 24:Ya(d,p,E,b),D&2048&&Hs(p.alternate,p);break;default:Ya(d,p,E,b)}}function tm(d,p,E,b,D){for(D=D&&((p.subtreeFlags&10256)!==0||!1),p=p.child;p!==null;){var N=d,Q=p,K=E,Ae=b,Ne=Q.flags;switch(Q.tag){case 0:case 11:case 15:tm(N,Q,K,Ae,D),Sd(8,Q);break;case 23:break;case 22:var Ke=Q.stateNode;Q.memoizedState!==null?Ke._visibility&2?tm(N,Q,K,Ae,D):nm(N,Q):(Ke._visibility|=2,tm(N,Q,K,Ae,D)),D&&Ne&2048&&$p(Q.alternate,Q);break;case 24:tm(N,Q,K,Ae,D),D&&Ne&2048&&Hs(Q.alternate,Q);break;default:tm(N,Q,K,Ae,D)}p=p.sibling}}function nm(d,p){if(p.subtreeFlags&10256)for(p=p.child;p!==null;){var E=d,b=p,D=b.flags;switch(b.tag){case 22:nm(E,b),D&2048&&$p(b.alternate,b);break;case 24:nm(E,b),D&2048&&Hs(b.alternate,b);break;default:nm(E,b)}p=p.sibling}}function qp(d,p,E){if(d.subtreeFlags&mm)for(d=d.child;d!==null;)Q1(d,p,E),d=d.sibling}function Q1(d,p,E){switch(d.tag){case 26:if(qp(d,p,E),d.flags&mm)if(d.memoizedState!==null)Wp(E,Ol,d.memoizedState,d.memoizedProps);else{var b=d.stateNode,D=d.type;d=d.memoizedProps,((p&335544128)===p||Hh(D,d))&&qs(E,b,D,d)}break;case 5:qp(d,p,E),d.flags&mm&&(b=d.stateNode,D=d.type,d=d.memoizedProps,((p&335544128)===p||Hh(D,d))&&qs(E,b,D,d));break;case 3:case 4:Nc?(b=Ol,Ol=xI(d.stateNode.containerInfo),qp(d,p,E),Ol=b):qp(d,p,E);break;case 22:d.memoizedState===null&&(b=d.alternate,b!==null&&b.memoizedState!==null?(b=mm,mm=16777216,qp(d,p,E),mm=b):qp(d,p,E));break;default:qp(d,p,E)}}function tI(d){var p=d.alternate;if(p!==null&&(d=p.child,d!==null)){p.child=null;do p=d.sibling,d.sibling=null,d=p;while(d!==null)}}function rm(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var E=0;E<p.length;E++){var b=p[E];Yi=b,rI(b,d)}tI(d)}if(d.subtreeFlags&10256)for(d=d.child;d!==null;)nI(d),d=d.sibling}function nI(d){switch(d.tag){case 0:case 11:case 15:rm(d),d.flags&2048&&Td(9,d,d.return);break;case 3:rm(d);break;case 12:rm(d);break;case 22:var p=d.stateNode;d.memoizedState!==null&&p._visibility&2&&(d.return===null||d.return.tag!==13)?(p._visibility&=-3,HA(d)):rm(d);break;default:rm(d)}}function HA(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var E=0;E<p.length;E++){var b=p[E];Yi=b,rI(b,d)}tI(d)}for(d=d.child;d!==null;){switch(p=d,p.tag){case 0:case 11:case 15:Td(8,p,p.return),HA(p);break;case 22:E=p.stateNode,E._visibility&2&&(E._visibility&=-3,HA(p));break;default:HA(p)}d=d.sibling}}function rI(d,p){for(;Yi!==null;){var E=Yi;switch(E.tag){case 0:case 11:case 15:Td(8,E,p);break;case 23:case 22:if(E.memoizedState!==null&&E.memoizedState.cachePool!==null){var b=E.memoizedState.cachePool.pool;b!=null&&b.refCount++}break;case 24:Bu(E.memoizedState.cache)}if(b=E.child,b!==null)b.return=E,Yi=b;else e:for(E=d;Yi!==null;){b=Yi;var D=b.sibling,N=b.return;if(qM(b),b===E){Yi=null;break e}if(D!==null){D.return=N,Yi=D;break e}Yi=N}}}function Qh(d){var p=a2(d);if(p!=null){if(typeof p.memoizedProps["data-testname"]!="string")throw Error(r(364));return p}if(d=aN(d),d===null)throw Error(r(362));return d.stateNode.current}function py(d,p){var E=d.tag;switch(p.$$typeof){case KI:if(d.type===p.value)return!0;break;case JI:e:{for(p=p.value,d=[d,0],E=0;E<d.length;){var b=d[E++],D=b.tag,N=d[E++],Q=p[N];if(D!==5&&D!==26&&D!==27||!Dd(b)){for(;Q!=null&&py(b,Q);)N++,Q=p[N];if(N===p.length){p=!0;break e}else for(b=b.child;b!==null;)d.push(b,N),b=b.sibling}}p=!1}return p;case ZI:if((E===5||E===26||E===27)&&m2(d.stateNode,p.value))return!0;break;case XI:if((E===5||E===6||E===26||E===27)&&(d=f2(d),d!==null&&0<=d.indexOf(p.value)))return!0;break;case WI:if((E===5||E===26||E===27)&&(d=d.memoizedProps["data-testname"],typeof d=="string"&&d.toLowerCase()===p.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function oI(d){switch(d.$$typeof){case KI:return"<"+(h(d.value)||"Unknown")+">";case JI:return":has("+(oI(d)||"")+")";case ZI:return'[role="'+d.value+'"]';case XI:return'"'+d.value+'"';case WI:return'[data-testname="'+d.value+'"]';default:throw Error(r(365))}}function F1(d,p){var E=[];d=[d,0];for(var b=0;b<d.length;){var D=d[b++],N=D.tag,Q=d[b++],K=p[Q];if(N!==5&&N!==26&&N!==27||!Dd(D)){for(;K!=null&&py(D,K);)Q++,K=p[Q];if(Q===p.length)E.push(D);else for(D=D.child;D!==null;)d.push(D,Q),D=D.sibling}}return E}function fy(d,p){if(!KA)throw Error(r(363));d=Qh(d),d=F1(d,p),p=[],d=Array.from(d);for(var E=0;E<d.length;){var b=d[E++],D=b.tag;if(D===5||D===26||D===27)Dd(b)||p.push(b.stateNode);else for(b=b.child;b!==null;)d.push(b),b=b.sibling}return p}function Ka(){return(Gn&2)!==0&&Yn!==0?Yn&-Yn:It.T!==null?L():Dl()}function my(){if(Qu===0)if((Yn&536870912)===0||Un){var d=ky;ky<<=1,(ky&3932160)===0&&(ky=262144),Qu=d}else Qu=536870912;return d=Lu.current,d!==null&&(d.flags|=32),Qu}function Sa(d,p,E){(d===Lr&&(Ir===2||Ir===9)||d.cancelPendingCommit!==null)&&(im(d,0),Vp(d,Yn,Qu,!1)),H(d,E),((Gn&2)===0||d!==Lr)&&(d===Lr&&((Gn&2)===0&&(ag|=E),No===4&&Vp(d,Yn,Qu,!1)),Qs(d))}function G1(d,p,E){if((Gn&6)!==0)throw Error(r(327));var b=!E&&(p&127)===0&&(p&d.expiredLanes)===0||O(d,p),D=b?e2(d,p):jh(d,p,!0),N=b;do{if(D===0){sg&&!b&&Vp(d,p,0,!1);break}else{if(E=d.current.alternate,N&&!JM(E)){D=jh(d,p,!1),N=!1;continue}if(D===2){if(N=p,d.errorRecoveryDisabledLanes&N)var Q=0;else Q=d.pendingLanes&-536870913,Q=Q!==0?Q:Q&536870912?536870912:0;if(Q!==0){p=Q;e:{var K=d;D=jy;var Ae=ys&&K.current.memoizedState.isDehydrated;if(Ae&&(im(K,Q).flags|=256),Q=jh(K,Q,!1),Q!==2){if(vN&&!Ae){K.errorRecoveryDisabledLanes|=N,ag|=N,D=4;break e}N=tu,tu=D,N!==null&&(tu===null?tu=N:tu.push.apply(tu,N))}D=Q}if(N=!1,D!==2)continue}}if(D===1){im(d,0),Vp(d,p,0,!0);break}e:{switch(b=d,N=D,N){case 0:case 1:throw Error(r(345));case 4:if((p&4194048)!==p)break;case 6:Vp(b,p,Qu,!Am);break e;case 2:tu=null;break;case 3:case 5:break;default:throw Error(r(329))}if((p&62914560)===p&&(D=zy+300-Sr(),10<D)){if(Vp(b,p,Qu,!Am),x(b,0,!0)!==0)break e;Pd=p,b.timeoutHandle=s2(iI.bind(null,b,E,tu,tC,eC,p,Qu,ag,a_,Am,N,"Throttled",-0,0),D);break e}iI(b,E,tu,tC,eC,p,Qu,ag,a_,Am,N,null,-0,0)}}break}while(!0);Qs(d)}function iI(d,p,E,b,D,N,Q,K,Ae,Ne,Ke,je,nt,Ut){if(d.timeoutHandle=Jp,je=p.subtreeFlags,je&8192||(je&16785408)===16785408){je=l2(),Q1(p,N,je);var co=(N&62914560)===N?zy-Sr():(N&4194048)===N?xN-Sr():0;if(co=d2(je,co),co!==null){Pd=N,d.cancelPendingCommit=co($1.bind(null,d,p,N,E,b,D,Q,K,Ae,Ke,je,null,nt,Ut)),Vp(d,N,Q,!Ne);return}}$1(d,p,N,E,b,D,Q,K,Ae)}function JM(d){for(var p=d;;){var E=p.tag;if((E===0||E===11||E===15)&&p.flags&16384&&(E=p.updateQueue,E!==null&&(E=E.stores,E!==null)))for(var b=0;b<E.length;b++){var D=E[b],N=D.getSnapshot;D=D.value;try{if(!Ts(N(),D))return!1}catch{return!1}}if(E=p.child,p.subtreeFlags&16384&&E!==null)E.return=p,p=E;else{if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function Vp(d,p,E,b){p&=~RN,p&=~ag,d.suspendedLanes|=p,d.pingedLanes&=~p,b&&(d.warmLanes|=p),b=d.expirationTimes;for(var D=p;0<D;){var N=31-Ja(D),Q=1<<N;b[N]=-1,D&=~Q}E!==0&&ae(d,E,p)}function om(){return(Gn&6)===0?(wu(0,!1),!1):!0}function Ay(){if(jn!==null){if(Ir===0)var d=jn.return;else d=jn,uo=Ca=null,Y(d),Pc=null,Uy=0,d=jn;for(;d!==null;)Yb(d.alternate,d),d=d.return;jn=null}}function im(d,p){var E=d.timeoutHandle;E!==Jp&&(d.timeoutHandle=Jp,iN(E)),E=d.cancelPendingCommit,E!==null&&(d.cancelPendingCommit=null,E()),Pd=0,Ay(),Lr=d,jn=E=Id(d.current,null),Yn=p,Ir=0,Uu=null,Am=!1,sg=O(d,p),vN=!1,a_=Qu=RN=ag=gm=No=0,tu=jy=null,eC=!1,(p&8)!==0&&(p|=p&32);var b=d.entangledLanes;if(b!==0)for(d=d.entanglements,b&=p;0<b;){var D=31-Ja(b),N=1<<D;p|=d[D],b&=~N}return of=p,Dr(),E}function ZM(d,p){gn=null,It.H=Qy,p===r_||p===FI?(p=kp(),Ir=3):p===QI?(p=kp(),Ir=4):Ir=p===qI?8:p!==null&&typeof p=="object"&&typeof p.then=="function"?6:1,Uu=p,jn===null&&(No=1,ey(d,ut(p,d.current)))}function WM(){var d=Lu.current;return d===null?!0:(Yn&4194048)===Yn?Lc===null:(Yn&62914560)===Yn||(Yn&536870912)!==0?d===Lc:!1}function j1(){var d=It.H;return It.H=Qy,d===null?Qy:d}function Fh(){var d=It.A;return It.A=Iq,d}function Gh(){No=4,Am||(Yn&4194048)!==Yn&&Lu.current!==null||(sg=!0),(gm&134217727)===0&&(ag&134217727)===0||Lr===null||Vp(Lr,Yn,Qu,!1)}function jh(d,p,E){var b=Gn;Gn|=2;var D=j1(),N=Fh();(Lr!==d||Yn!==p)&&(tC=null,im(d,p)),p=!1;var Q=No;e:do try{if(Ir!==0&&jn!==null){var K=jn,Ae=Uu;switch(Ir){case 8:Ay(),Q=6;break e;case 3:case 2:case 9:case 6:Lu.current===null&&(p=!0);var Ne=Ir;if(Ir=0,Uu=null,$A(d,K,Ae,Ne),E&&sg){Q=0;break e}break;default:Ne=Ir,Ir=0,Uu=null,$A(d,K,Ae,Ne)}}XM(),Q=No;break}catch(Ke){ZM(d,Ke)}while(!0);return p&&d.shellSuspendCounter++,uo=Ca=null,Gn=b,It.H=D,It.A=N,jn===null&&(Lr=null,Yn=0,Dr()),Q}function XM(){for(;jn!==null;)sI(jn)}function e2(d,p){var E=Gn;Gn|=2;var b=j1(),D=Fh();Lr!==d||Yn!==p?(tC=null,u_=Sr()+500,im(d,p)):sg=O(d,p);e:do try{if(Ir!==0&&jn!==null){p=jn;var N=Uu;t:switch(Ir){case 1:Ir=0,Uu=null,$A(d,p,N,1);break;case 2:case 9:if(pn(N)){Ir=0,Uu=null,H1(p);break}p=function(){Ir!==2&&Ir!==9||Lr!==d||(Ir=7),Qs(d)},N.then(p,p);break e;case 3:Ir=7;break e;case 4:Ir=5;break e;case 7:pn(N)?(Ir=0,Uu=null,H1(p)):(Ir=0,Uu=null,$A(d,p,N,7));break;case 5:var Q=null;switch(jn.tag){case 26:Q=jn.memoizedState;case 5:case 27:var K=jn,Ae=K.type,Ne=K.pendingProps;if(Q?NI(Q):Ss(K.stateNode,Ae,Ne)){Ir=0,Uu=null;var Ke=K.sibling;if(Ke!==null)jn=Ke;else{var je=K.return;je!==null?(jn=je,bd(je)):jn=null}break t}}Ir=0,Uu=null,$A(d,p,N,5);break;case 6:Ir=0,Uu=null,$A(d,p,N,6);break;case 8:Ay(),No=6;break e;default:throw Error(r(462))}}z1();break}catch(nt){ZM(d,nt)}while(!0);return uo=Ca=null,It.H=b,It.A=D,Gn=E,jn!==null?0:(Lr=null,Yn=0,Dr(),No)}function z1(){for(;jn!==null&&!Sq();)sI(jn)}function sI(d){var p=Hb(d.alternate,d,of);d.memoizedProps=d.pendingProps,p===null?bd(d):jn=p}function H1(d){var p=d,E=p.alternate;switch(p.tag){case 15:case 0:p=B1(E,p,p.pendingProps,p.type,void 0,Yn);break;case 11:p=B1(E,p,p.pendingProps,p.type.render,p.ref,Yn);break;case 5:Y(p);default:Yb(E,p),p=jn=K1(p,of),p=Hb(E,p,of)}d.memoizedProps=d.pendingProps,p===null?bd(d):jn=p}function $A(d,p,E,b){uo=Ca=null,Y(p),Pc=null,Uy=0;var D=p.return;try{if(js(d,D,p,E,Yn)){No=1,ey(d,ut(E,d.current)),jn=null;return}}catch(N){if(D!==null)throw jn=D,N;No=1,ey(d,ut(E,d.current)),jn=null;return}p.flags&32768?(Un||b===1?d=!0:sg||(Yn&536870912)!==0?d=!1:(Am=d=!0,(b===2||b===9||b===3||b===6)&&(b=Lu.current,b!==null&&b.tag===13&&(b.flags|=16384))),gy(p,d)):bd(p)}function bd(d){var p=d;do{if((p.flags&32768)!==0){gy(p,Am);return}d=p.return;var E=zA(p.alternate,p,of);if(E!==null){jn=E;return}if(p=p.sibling,p!==null){jn=p;return}jn=p=d}while(p!==null);No===0&&(No=5)}function gy(d,p){do{var E=Il(d.alternate,d);if(E!==null){E.flags&=32767,jn=E;return}if(E=d.return,E!==null&&(E.flags|=32768,E.subtreeFlags=0,E.deletions=null),!p&&(d=d.sibling,d!==null)){jn=d;return}jn=d=E}while(d!==null);No=6,jn=null}function $1(d,p,E,b,D,N,Q,K,Ae){d.cancelPendingCommit=null;do qo();while(Cr!==0);if((Gn&6)!==0)throw Error(r(327));if(p!==null){if(p===d.current)throw Error(r(177));if(N=p.lanes|p.childLanes,N|=bN,V(d,E,N,Q,K,Ae),d===Lr&&(jn=Lr=null,Yn=0),_m=p,sf=d,Pd=E,nC=N,rC=D,Z2=b,(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?(d.callbackNode=null,d.callbackPriority=0,aq(ef,function(){return q1(),null})):(d.callbackNode=null,d.callbackPriority=0),b=(p.flags&13878)!==0,(p.subtreeFlags&13878)!==0||b){b=It.T,It.T=null,D=Rd(),xi(2),Q=Gn,Gn|=4;try{$M(d,p,E)}finally{Gn=Q,xi(D),It.T=b}}Cr=1,aI(),uI(),cI()}}function aI(){if(Cr===1){Cr=0;var d=sf,p=_m,E=(p.flags&13878)!==0;if((p.subtreeFlags&13878)!==0||E){E=It.T,It.T=null;var b=Rd();xi(2);var D=Gn;Gn|=4;try{dy(p,d),Cy(d.containerInfo)}finally{Gn=D,xi(b),It.T=E}}d.current=p,Cr=2}}function uI(){if(Cr===2){Cr=0;var d=sf,p=_m,E=(p.flags&8772)!==0;if((p.subtreeFlags&8772)!==0||E){E=It.T,It.T=null;var b=Rd();xi(2);var D=Gn;Gn|=4;try{L1(d,p.alternate,p)}finally{Gn=D,xi(b),It.T=E}}Cr=3}}function cI(){if(Cr===4||Cr===3){Cr=0,Za();var d=sf,p=_m,E=Pd,b=Z2;(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?Cr=5:(Cr=0,_m=sf=null,t2(d,d.pendingLanes));var D=d.pendingLanes;if(D===0&&(hm=null),pt(E),p=p.stateNode,Vo&&typeof Vo.onCommitFiberRoot=="function")try{Vo.onCommitFiberRoot(tg,p,void 0,(p.current.flags&128)===128)}catch{}if(b!==null){p=It.T,D=Rd(),xi(2),It.T=null;try{for(var N=d.onRecoverableError,Q=0;Q<b.length;Q++){var K=b[Q];N(K.value,{componentStack:K.stack})}}finally{It.T=p,xi(D)}}(Pd&3)!==0&&qo(),Qs(d),D=d.pendingLanes,(E&261930)!==0&&(D&42)!==0?d===oC?c_++:(c_=0,oC=d):c_=0,ys&&L2(),wu(0,!1)}}function t2(d,p){(d.pooledCacheLanes&=p)===0&&(p=d.pooledCache,p!=null&&(d.pooledCache=null,Bu(p)))}function qo(){return aI(),uI(),cI(),q1()}function q1(){if(Cr!==5)return!1;var d=sf,p=nC;nC=0;var E=pt(Pd),b=32>E?32:E;E=It.T;var D=Rd();try{xi(b),It.T=null,b=rC,rC=null;var N=sf,Q=Pd;if(Cr=0,_m=sf=null,Pd=0,(Gn&6)!==0)throw Error(r(331));var K=Gn;if(Gn|=4,nI(N.current),KM(N,N.current,Q,b),Gn=K,wu(0,!1),Vo&&typeof Vo.onPostCommitFiberRoot=="function")try{Vo.onPostCommitFiberRoot(tg,N)}catch{}return!0}finally{xi(D),It.T=E,t2(d,p)}}function V1(d,p,E){p=ut(E,p),p=Oh(d.stateNode,p,2),d=yc(d,p,2),d!==null&&(H(d,2),Qs(d))}function ur(d,p,E){if(d.tag===3)V1(d,d,E);else for(;p!==null;){if(p.tag===3){V1(p,d,E);break}else if(p.tag===1){var b=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(hm===null||!hm.has(b))){d=ut(E,d),E=ty(2),b=yc(p,E,2),b!==null&&(Ub(E,b,p,d),H(b,2),Qs(b));break}}p=p.return}}function lI(d,p,E){var b=d.pingCache;if(b===null){b=d.pingCache=new Cq;var D=new Set;b.set(p,D)}else D=b.get(p),D===void 0&&(D=new Set,b.set(p,D));D.has(E)||(vN=!0,D.add(E),d=hy.bind(null,d,p,E),p.then(d,d))}function hy(d,p,E){var b=d.pingCache;b!==null&&b.delete(p),d.pingedLanes|=d.suspendedLanes&E,d.warmLanes&=~E,Lr===d&&(Yn&E)===E&&(No===4||No===3&&(Yn&62914560)===Yn&&300>Sr()-zy?(Gn&2)===0&&im(d,0):RN|=E,a_===Yn&&(a_=0)),Qs(d)}function Y1(d,p){p===0&&(p=j()),d=Ec(d,p),d!==null&&(H(d,p),Qs(d))}function dI(d){var p=d.memoizedState,E=0;p!==null&&(E=p.retryLane),Y1(d,E)}function n2(d,p){var E=0;switch(d.tag){case 31:case 13:var b=d.stateNode,D=d.memoizedState;D!==null&&(E=D.retryLane);break;case 19:b=d.stateNode;break;case 22:b=d.stateNode._retryCache;break;default:throw Error(r(314))}b!==null&&b.delete(p),Y1(d,E)}function aq(d,p){return kI(d,p)}function pI(d,p,E,b){this.tag=d,this.key=E,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _y(d){return d=d.prototype,!(!d||!d.isReactComponent)}function Id(d,p){var E=d.alternate;return E===null?(E=t(d.tag,p,d.key,d.mode),E.elementType=d.elementType,E.type=d.type,E.stateNode=d.stateNode,E.alternate=d,d.alternate=E):(E.pendingProps=p,E.type=d.type,E.flags=0,E.subtreeFlags=0,E.deletions=null),E.flags=d.flags&65011712,E.childLanes=d.childLanes,E.lanes=d.lanes,E.child=d.child,E.memoizedProps=d.memoizedProps,E.memoizedState=d.memoizedState,E.updateQueue=d.updateQueue,p=d.dependencies,E.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},E.sibling=d.sibling,E.index=d.index,E.ref=d.ref,E.refCleanup=d.refCleanup,E}function K1(d,p){d.flags&=65011714;var E=d.alternate;return E===null?(d.childLanes=0,d.lanes=p,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=E.childLanes,d.lanes=E.lanes,d.child=E.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=E.memoizedProps,d.memoizedState=E.memoizedState,d.updateQueue=E.updateQueue,d.type=E.type,p=E.dependencies,d.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),d}function Ey(d,p,E,b,D,N){var Q=0;if(b=d,typeof d=="function")_y(d)&&(Q=1);else if(typeof d=="string")Q=Nc&&ci?gN(d,E,bs.current)?26:OI(d)?27:5:Nc?gN(d,E,bs.current)?26:5:ci&&OI(d)?27:5;else e:switch(d){case EI:return d=t(31,E,p,D),d.elementType=EI,d.lanes=N,d;case qA:return Yp(E.children,D,N,p);case X1:Q=8,D|=24;break;case by:return d=t(12,E,p,D|2),d.elementType=by,d.lanes=N,d;case VA:return d=t(13,E,p,D),d.elementType=VA,d.lanes=N,d;case br:return d=t(19,E,p,D),d.elementType=br,d.lanes=N,d;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case Kp:Q=10;break e;case _I:Q=9;break e;case zh:Q=11;break e;case eN:Q=14;break e;case am:Q=16,b=null;break e}Q=29,E=Error(r(130,d===null?"null":typeof d,"")),b=null}return p=t(Q,E,p,D),p.elementType=d,p.type=b,p.lanes=N,p}function Yp(d,p,E,b){return d=t(7,d,b,p),d.lanes=E,d}function yy(d,p,E){return d=t(6,d,null,p),d.lanes=E,d}function fI(d){var p=t(18,null,null,0);return p.stateNode=d,p}function mI(d,p,E){return p=t(4,d.children!==null?d.children:[],d.key,p),p.lanes=E,p.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},p}function J1(d,p,E,b,D,N,Q,K,Ae){this.tag=1,this.containerInfo=d,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Jp,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=G(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=G(0),this.hiddenUpdates=G(null),this.identifierPrefix=b,this.onUncaughtError=D,this.onCaughtError=N,this.onRecoverableError=Q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ae,this.incompleteTransitions=new Map}function Sy(d,p,E,b,D,N,Q,K,Ae,Ne,Ke,je){return d=new J1(d,p,E,Q,Ae,Ne,Ke,je,K),p=1,N===!0&&(p|=24),N=t(3,null,null,p),d.current=N,N.stateNode=d,p=Jf(),p.refCount++,d.pooledCache=p,p.refCount++,N.memoizedState={element:b,isDehydrated:E,cache:p},Mp(N),d}function AI(d){return d?(d=eg,d):eg}function Z1(d){var p=d._reactInternals;if(p===void 0)throw typeof d.render=="function"?Error(r(188)):(d=Object.keys(d).join(","),Error(r(268,d)));return d=s(p),d=d!==null?u(d):null,d===null?null:Iy(d.stateNode)}function gI(d,p,E,b,D,N){D=AI(D),b.context===null?b.context=D:b.pendingContext=D,b=ha(p),b.payload={element:E},N=N===void 0?null:N,N!==null&&(b.callback=N),E=yc(d,b,p),E!==null&&(Sa(E,d,p),UA(E,d,p))}function W1(d,p){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var E=d.retryLane;d.retryLane=E!==0&&E<p?E:p}}function Rl(d,p){W1(d,p),(d=d.alternate)&&W1(d,p)}var wn={},uq=dn(),Ta=SH(),Pu=Object.assign,hI=Symbol.for("react.element"),Ty=Symbol.for("react.transitional.element"),sm=Symbol.for("react.portal"),qA=Symbol.for("react.fragment"),X1=Symbol.for("react.strict_mode"),by=Symbol.for("react.profiler"),_I=Symbol.for("react.consumer"),Kp=Symbol.for("react.context"),zh=Symbol.for("react.forward_ref"),VA=Symbol.for("react.suspense"),br=Symbol.for("react.suspense_list"),eN=Symbol.for("react.memo"),am=Symbol.for("react.lazy"),EI=Symbol.for("react.activity"),Cd=Symbol.for("react.memo_cache_sentinel"),tN=Symbol.iterator,nN=Symbol.for("react.client.reference"),um=Array.isArray,It=uq.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,r2=e.rendererVersion,rN=e.rendererPackageName,oN=e.extraDevToolsConfig,Iy=e.getPublicInstance,cq=e.getRootHostContext,o2=e.getChildHostContext,lq=e.prepareForCommit,Cy=e.resetAfterCommit,vd=e.createInstance;e.cloneMutableInstance;var yI=e.appendInitialChild,i2=e.finalizeInitialChildren,vy=e.shouldSetTextContent,SI=e.createTextInstance;e.cloneMutableTextInstance;var s2=e.scheduleTimeout,iN=e.cancelTimeout,Jp=e.noTimeout,Dc=e.isPrimaryRenderer;e.warnsIfNotActing;var $s=e.supportsMutation,xl=e.supportsPersistence,ys=e.supportsHydration,a2=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var dq=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var xi=e.setCurrentUpdatePriority,Rd=e.getCurrentUpdatePriority,Dl=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var sN=e.shouldAttemptEagerTransition,u2=e.detachDeletedInstance;e.requestPostPaintCallback;var c2=e.maySuspendCommit,pq=e.maySuspendCommitOnUpdate,Hh=e.maySuspendCommitInSyncRender,Ss=e.preloadInstance,l2=e.startSuspendingCommit,qs=e.suspendInstance;e.suspendOnActiveViewTransition;var d2=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var ba=e.NotPendingTransition,cm=e.HostTransitionContext,YA=e.resetFormInstance;e.bindToConsole;var p2=e.supportsMicrotasks,xd=e.scheduleMicrotask,KA=e.supportsTestSelectors,aN=e.findFiberRoot,Nl=e.getBoundingRect,f2=e.getTextContent,Dd=e.isHiddenSubtree,m2=e.matchAccessibilityRole,Ry=e.setFocusIfFocusable,JA=e.setupIntersectionObserver,A2=e.appendChild,g2=e.appendChildToContainer,xy=e.commitTextUpdate,h2=e.commitMount,TI=e.commitUpdate,_2=e.insertBefore,E2=e.insertInContainerBefore,uN=e.removeChild,cN=e.removeChildFromContainer,bI=e.resetTextContent,y2=e.hideInstance,II=e.hideTextInstance,fq=e.unhideInstance,S2=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var Mu=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var T2=e.cloneInstance,so=e.createContainerChildSet,lN=e.appendChildToContainerChildSet,b2=e.finalizeContainerChildren,I2=e.replaceContainerChildren,Zp=e.cloneHiddenInstance,Dy=e.cloneHiddenTextInstance,Ny=e.isSuspenseInstancePending,By=e.isSuspenseInstanceFallback,ZA=e.getSuspenseInstanceFallbackErrorDetails,$h=e.registerSuspenseInstanceRetry,C2=e.canHydrateFormStateMarker,v2=e.isFormStateMarkerMatching,dN=e.getNextHydratableSibling,R2=e.getNextHydratableSiblingAfterSingleton,CI=e.getFirstHydratableChild,vI=e.getFirstHydratableChildWithinContainer,pN=e.getFirstHydratableChildWithinActivityInstance,x2=e.getFirstHydratableChildWithinSuspenseInstance,mq=e.getFirstHydratableChildWithinSingleton,Aq=e.canHydrateInstance,D2=e.canHydrateTextInstance,N2=e.canHydrateActivityInstance,gq=e.canHydrateSuspenseInstance,qh=e.hydrateInstance,RI=e.hydrateTextInstance,B2=e.hydrateActivityInstance,fN=e.hydrateSuspenseInstance,w2=e.getNextHydratableInstanceAfterActivityInstance,O2=e.getNextHydratableInstanceAfterSuspenseInstance,k2=e.commitHydratedInstance,hq=e.commitHydratedContainer,P2=e.commitHydratedActivityInstance,Vh=e.commitHydratedSuspenseInstance,M2=e.finalizeHydratedChildren,L2=e.flushHydrationEvents;e.clearActivityBoundary;var cr=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var mN=e.clearSuspenseBoundaryFromContainer,_q=e.hideDehydratedBoundary,U2=e.unhideDehydratedBoundary,Q2=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var Eq=e.validateHydratableInstance,AN=e.validateHydratableTextInstance,Nc=e.supportsResources,gN=e.isHostHoistableType,xI=e.getHoistableRoot,Yh=e.getResource,F2=e.acquireResource,G2=e.releaseResource,WA=e.hydrateHoistable,DI=e.mountHoistable,hN=e.unmountHoistable,j2=e.createHoistableInstance,z2=e.prepareToCommitHoistables,yq=e.mayResourceSuspendCommit,NI=e.preloadResource,Wp=e.suspendResource,ci=e.supportsSingletons,BI=e.resolveSingletonInstance,wI=e.acquireSingletonInstance,lm=e.releaseSingletonInstance,OI=e.isHostSingletonType,XA=e.isSingletonScope,wy=[],Kh=-1,eg={},Ja=Math.clz32?Math.clz32:v,H2=Math.log,$2=Math.LN2,Oy=256,ky=262144,Jh=4194304,kI=Ta.unstable_scheduleCallback,On=Ta.unstable_cancelCallback,Sq=Ta.unstable_shouldYield,Za=Ta.unstable_requestPaint,Sr=Ta.unstable_now,q2=Ta.unstable_ImmediatePriority,Xp=Ta.unstable_UserBlockingPriority,ef=Ta.unstable_NormalPriority,Zh=Ta.unstable_IdlePriority,PI=Ta.log,_N=Ta.unstable_setDisableYieldValue,tg=null,Vo=null,Ts=typeof Object.is=="function"?Object.is:Pt,MI=typeof reportError=="function"?reportError:function(d){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof d=="object"&&d!==null&&typeof d.message=="string"?String(d.message):String(d),error:d});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",d);return}console.error(d)},EN=Object.prototype.hasOwnProperty,Wh,Wa,Py=!1,V2=new WeakMap,ng=[],Xh=0,li=null,le=0,Bc=[],wc=0,tf=null,Ia=1,Nd="",bs=_(null),My=_(null),dm=_(null),LI=_(null),Di=null,ao=null,Un=!1,nf=null,Oc=!1,yN=Error(r(519)),Bd=_(null),Ca=null,uo=null,wd=typeof AbortController<"u"?AbortController:function(){var d=[],p=this.signal={aborted:!1,addEventListener:function(E,b){d.push(b)}};this.abort=function(){p.aborted=!0,d.forEach(function(E){return E()})}},Vs=Ta.unstable_scheduleCallback,Tq=Ta.unstable_NormalPriority,Eo={$$typeof:Kp,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Yo=null,Xa=null,SN=!1,e_=!1,rg=!1,Bl=0,Ly=null,TN=0,t_=0,n_=null,UI=It.S;It.S=function(d,p){xN=Sr(),typeof p=="object"&&p!==null&&typeof p.then=="function"&&ne(d,p),UI!==null&&UI(d,p)};var pm=_(null),r_=Error(r(460)),QI=Error(r(474)),FI=Error(r(542)),GI={then:function(){}},kc=null,Pc=null,Uy=0,og=z0(!0),Y2=z0(!1),Mc=[],wl=0,bN=0,fm=!1,IN=!1,Od=_(null),jI=_(0),Lu=_(null),Lc=null,Ko=_(0),rf=0,gn=null,Nr=null,di=null,zI=!1,o_=!1,ig=!1,HI=0,i_=0,s_=null,bq=0,Qy={readContext:ho,use:Te,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useLayoutEffect:Xr,useInsertionEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useSyncExternalStore:Xr,useId:Xr,useHostTransitionStatus:Xr,useFormState:Xr,useActionState:Xr,useOptimistic:Xr,useMemoCache:Xr,useCacheRefresh:Xr};Qy.useEffectEvent=Xr;var K2={readContext:ho,use:Te,useCallback:function(d,p){return X().memoizedState=[d,p===void 0?null:p],d},useContext:ho,useEffect:y1,useImperativeHandle:function(d,p,E){E=E!=null?E.concat([d]):null,K0(4194308,4,zM.bind(null,p,d),E)},useLayoutEffect:function(d,p){return K0(4194308,4,d,p)},useInsertionEffect:function(d,p){K0(4,2,d,p)},useMemo:function(d,p){var E=X();p=p===void 0?null:p;var b=d();if(ig){Ge(!0);try{d()}finally{Ge(!1)}}return E.memoizedState=[b,p],b},useReducer:function(d,p,E){var b=X();if(E!==void 0){var D=E(p);if(ig){Ge(!0);try{E(p)}finally{Ge(!1)}}}else D=p;return b.memoizedState=b.baseState=D,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:D},b.queue=d,d=d.dispatch=_s.bind(null,gn,d),[b.memoizedState,d]},useRef:function(d){var p=X();return d={current:d},p.memoizedState=d},useState:function(d){d=qi(d);var p=d.queue,E=Mb.bind(null,gn,p);return p.dispatch=E,[d.memoizedState,E]},useDebugValue:b1,useDeferredValue:function(d,p){var E=X();return kb(E,d,p)},useTransition:function(){var d=qi(!1);return d=I1.bind(null,gn,d.queue,!0,!1),X().memoizedState=d,[!1,d]},useSyncExternalStore:function(d,p,E){var b=gn,D=X();if(Un){if(E===void 0)throw Error(r(407));E=E()}else{if(E=p(),Lr===null)throw Error(r(349));(Yn&127)!==0||pr(b,p,E)}D.memoizedState=E;var N={value:E,getSnapshot:p};return D.queue=N,y1(gs.bind(null,b,N,d),[d]),b.flags|=2048,Ea(9,{destroy:void 0},io.bind(null,b,N,E,p),null),E},useId:function(){var d=X(),p=Lr.identifierPrefix;if(Un){var E=Nd,b=Ia;E=(b&~(1<<32-Ja(b)-1)).toString(32)+E,p="_"+p+"R_"+E,E=HI++,0<E&&(p+="H"+E.toString(32)),p+="_"}else E=bq++,p="_"+p+"r_"+E.toString(32)+"_";return d.memoizedState=p},useHostTransitionStatus:Pb,useFormState:Sl,useActionState:Sl,useOptimistic:function(d){var p=X();p.memoizedState=p.baseState=d;var E={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return p.queue=E,p=wh.bind(null,gn,!0,E),E.dispatch=p,[d,p]},useMemoCache:Ve,useCacheRefresh:function(){return X().memoizedState=HM.bind(null,gn)},useEffectEvent:function(d){var p=X(),E={impl:d};return p.memoizedState=E,function(){if((Gn&2)!==0)throw Error(r(440));return E.impl.apply(void 0,arguments)}}},CN={readContext:ho,use:Te,useCallback:Ob,useContext:ho,useEffect:Nb,useImperativeHandle:T1,useInsertionEffect:S1,useLayoutEffect:wb,useMemo:J0,useReducer:Ze,useRef:FA,useState:function(){return Ze(Pe)},useDebugValue:b1,useDeferredValue:function(d,p){var E=te();return Z0(E,Nr.memoizedState,d,p)},useTransition:function(){var d=Ze(Pe)[0],p=te().memoizedState;return[typeof d=="boolean"?d:xe(d),p]},useSyncExternalStore:dr,useId:jp,useHostTransitionStatus:Pb,useFormState:E1,useActionState:E1,useOptimistic:function(d,p){var E=te();return hs(E,Nr,d,p)},useMemoCache:Ve,useCacheRefresh:v1};CN.useEffectEvent=Bb;var J2={readContext:ho,use:Te,useCallback:Ob,useContext:ho,useEffect:Nb,useImperativeHandle:T1,useInsertionEffect:S1,useLayoutEffect:wb,useMemo:J0,useReducer:In,useRef:FA,useState:function(){return In(Pe)},useDebugValue:b1,useDeferredValue:function(d,p){var E=te();return Nr===null?kb(E,d,p):Z0(E,Nr.memoizedState,d,p)},useTransition:function(){var d=In(Pe)[0],p=te().memoizedState;return[typeof d=="boolean"?d:xe(d),p]},useSyncExternalStore:dr,useId:jp,useHostTransitionStatus:Pb,useFormState:Y0,useActionState:Y0,useOptimistic:function(d,p){var E=te();return Nr!==null?hs(E,Nr,d,p):(E.baseState=d,[d,E.queue.dispatch])},useMemoCache:Ve,useCacheRefresh:v1};J2.useEffectEvent=Bb;var $I={enqueueSetState:function(d,p,E){d=d._reactInternals;var b=Ka(),D=ha(b);D.payload=p,E!=null&&(D.callback=E),p=yc(d,D,b),p!==null&&(Sa(p,d,b),UA(p,d,b))},enqueueReplaceState:function(d,p,E){d=d._reactInternals;var b=Ka(),D=ha(b);D.tag=1,D.payload=p,E!=null&&(D.callback=E),p=yc(d,D,b),p!==null&&(Sa(p,d,b),UA(p,d,b))},enqueueForceUpdate:function(d,p){d=d._reactInternals;var E=Ka(),b=ha(E);b.tag=2,p!=null&&(b.callback=p),p=yc(d,b,E),p!==null&&(Sa(p,d,E),UA(p,d,E))}},qI=Error(r(461)),pi=!1,VI={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},kd=!1,Jo=!1,Fy=!1,YI=typeof WeakSet=="function"?WeakSet:Set,Yi=null,fi=null,eu=!1,Ol=null,mm=8192,Iq={getCacheForType:function(d){var p=ho(Eo),E=p.data.get(d);return E===void 0&&(E=d(),p.data.set(d,E)),E},cacheSignal:function(){return ho(Eo).controller.signal}},KI=0,JI=1,ZI=2,WI=3,XI=4;if(typeof Symbol=="function"&&Symbol.for){var Gy=Symbol.for;KI=Gy("selector.component"),JI=Gy("selector.has_pseudo_class"),ZI=Gy("selector.role"),WI=Gy("selector.test_id"),XI=Gy("selector.text")}var Cq=typeof WeakMap=="function"?WeakMap:Map,Gn=0,Lr=null,jn=null,Yn=0,Ir=0,Uu=null,Am=!1,sg=!1,vN=!1,of=0,No=0,gm=0,ag=0,RN=0,Qu=0,a_=0,jy=null,tu=null,eC=!1,zy=0,xN=0,u_=1/0,tC=null,hm=null,Cr=0,sf=null,_m=null,Pd=0,nC=0,rC=null,Z2=null,c_=0,oC=null;return wn.attemptContinuousHydration=function(d){if(d.tag===13||d.tag===31){var p=Ec(d,67108864);p!==null&&Sa(p,d,67108864),Rl(d,67108864)}},wn.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13||d.tag===31){var p=Ka();p=Qe(p);var E=Ec(d,p);E!==null&&Sa(E,d,p),Rl(d,p)}},wn.attemptSynchronousHydration=function(d){switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var p=R(d.pendingLanes);if(p!==0){for(d.pendingLanes|=2,d.entangledLanes|=2;p;){var E=1<<31-Ja(p);d.entanglements[1]|=E,p&=~E}Qs(d),(Gn&6)===0&&(u_=Sr()+500,wu(0,!1))}}break;case 31:case 13:p=Ec(d,2),p!==null&&Sa(p,d,2),om(),Rl(d,2)}},wn.batchedUpdates=function(d,p){return d(p)},wn.createComponentSelector=function(d){return{$$typeof:KI,value:d}},wn.createContainer=function(d,p,E,b,D,N,Q,K,Ae,Ne){return Sy(d,p,!1,null,E,b,N,null,Q,K,Ae,Ne)},wn.createHasPseudoClassSelector=function(d){return{$$typeof:JI,value:d}},wn.createHydrationContainer=function(d,p,E,b,D,N,Q,K,Ae,Ne,Ke,je,nt,Ut){return d=Sy(E,b,!0,d,D,N,K,Ut,Ae,Ne,Ke,je),d.context=AI(null),E=d.current,b=Ka(),b=Qe(b),D=ha(b),D.callback=p??null,yc(E,D,b),p=b,d.current.lanes=p,H(d,p),Qs(d),d},wn.createPortal=function(d,p,E){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sm,key:b==null?null:""+b,children:d,containerInfo:p,implementation:E}},wn.createRoleSelector=function(d){return{$$typeof:ZI,value:d}},wn.createTestNameSelector=function(d){return{$$typeof:WI,value:d}},wn.createTextSelector=function(d){return{$$typeof:XI,value:d}},wn.defaultOnCaughtError=function(d){console.error(d)},wn.defaultOnRecoverableError=function(d){MI(d)},wn.defaultOnUncaughtError=function(d){MI(d)},wn.deferredUpdates=function(d){var p=It.T,E=Rd();try{return xi(32),It.T=null,d()}finally{xi(E),It.T=p}},wn.discreteUpdates=function(d,p,E,b,D){var N=It.T,Q=Rd();try{return xi(2),It.T=null,d(p,E,b,D)}finally{xi(Q),It.T=N,Gn===0&&(u_=Sr()+500)}},wn.findAllNodes=fy,wn.findBoundingRects=function(d,p){if(!KA)throw Error(r(363));p=fy(d,p),d=[];for(var E=0;E<p.length;E++)d.push(Nl(p[E]));for(p=d.length-1;0<p;p--){E=d[p];for(var b=E.x,D=b+E.width,N=E.y,Q=N+E.height,K=p-1;0<=K;K--)if(p!==K){var Ae=d[K],Ne=Ae.x,Ke=Ne+Ae.width,je=Ae.y,nt=je+Ae.height;if(b>=Ne&&N>=je&&D<=Ke&&Q<=nt){d.splice(p,1);break}else if(b!==Ne||E.width!==Ae.width||nt<N||je>Q){if(!(N!==je||E.height!==Ae.height||Ke<b||Ne>D)){Ne>b&&(Ae.width+=Ne-b,Ae.x=b),Ke<D&&(Ae.width=D-Ne),d.splice(p,1);break}}else{je>N&&(Ae.height+=je-N,Ae.y=N),nt<Q&&(Ae.height=Q-je),d.splice(p,1);break}}}return d},wn.findHostInstance=Z1,wn.findHostInstanceWithNoPortals=function(d){return d=s(d),d=d!==null?l(d):null,d===null?null:Iy(d.stateNode)},wn.findHostInstanceWithWarning=function(d){return Z1(d)},wn.flushPassiveEffects=qo,wn.flushSyncFromReconciler=function(d){var p=Gn;Gn|=1;var E=It.T,b=Rd();try{if(xi(2),It.T=null,d)return d()}finally{xi(b),It.T=E,Gn=p,(Gn&6)===0&&wu(0,!1)}},wn.flushSyncWork=om,wn.focusWithin=function(d,p){if(!KA)throw Error(r(363));for(d=Qh(d),p=F1(d,p),p=Array.from(p),d=0;d<p.length;){var E=p[d++],b=E.tag;if(!Dd(E)){if((b===5||b===26||b===27)&&Ry(E.stateNode))return!0;for(E=E.child;E!==null;)p.push(E),E=E.sibling}}return!1},wn.getFindAllNodesFailureDescription=function(d,p){if(!KA)throw Error(r(363));var E=0,b=[];d=[Qh(d),0];for(var D=0;D<d.length;){var N=d[D++],Q=N.tag,K=d[D++],Ae=p[K];if((Q!==5&&Q!==26&&Q!==27||!Dd(N))&&(py(N,Ae)&&(b.push(oI(Ae)),K++,K>E&&(E=K)),K<p.length))for(N=N.child;N!==null;)d.push(N,K),N=N.sibling}if(E<p.length){for(d=[];E<p.length;E++)d.push(oI(p[E]));return`findAllNodes was able to match part of the selector:
135
135
  `+(b.join(" > ")+`
136
136
 
137
137
  No matching component was found for:
@@ -270,11 +270,11 @@ act(() => {
270
270
  });
271
271
  /* assert on the output */
272
272
 
273
- This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,_e(a))})}function WA(a){if($d===null)return a;var c=$d(a);return c===void 0?a:c.current}function DI(a){if($d===null)return a;var c=$d(a);return c===void 0?a!=null&&typeof a.render=="function"&&(c=WA(a.render),a.render!==c)?(c={$$typeof:Ts,render:c},a.displayName!==void 0&&(c.displayName=a.displayName),c):a:c.current}function hN(a,c){if($d===null)return!1;var g=a.elementType;c=c.type;var S=!1,I=typeof c=="object"&&c!==null?c.$$typeof:null;switch(a.tag){case 1:typeof c=="function"&&(S=!0);break;case 0:(typeof c=="function"||I===Wa)&&(S=!0);break;case 11:(I===Ts||I===Wa)&&(S=!0);break;case 14:case 15:(I===Wh||I===Wa)&&(S=!0);break;default:return!1}return!!(S&&(a=$d(g),a!==void 0&&a===$d(c)))}function j2(a){$d!==null&&typeof WeakSet=="function"&&(DC===null&&(DC=new WeakSet),DC.add(a))}function z2(a,c,g){do{var S=a,I=S.alternate,C=S.child,B=S.sibling,k=S.tag;S=S.type;var z=null;switch(k){case 0:case 15:case 1:z=S;break;case 11:z=S.render}if($d===null)throw Error("Expected resolveFamily to be set during hot reload.");var ee=!1;if(S=!1,z!==null&&(z=$d(z),z!==void 0&&(g.has(z)?S=!0:c.has(z)&&(k===1?S=!0:ee=!0))),DC!==null&&(DC.has(a)||I!==null&&DC.has(I))&&(S=!0),S&&(a._debugNeedsRemount=!0),(S||ee)&&(I=js(a,2),I!==null&&so(I,a,2)),C===null||S||z2(C,c,g),B===null)break;a=B}while(!0)}function yq(a,c,g,S){this.tag=a,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,qme||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function NI(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Wp(a,c){var g=a.alternate;switch(g===null?(g=l(a.tag,c,a.key,a.mode),g.elementType=a.elementType,g.type=a.type,g.stateNode=a.stateNode,g._debugOwner=a._debugOwner,g._debugStack=a._debugStack,g._debugTask=a._debugTask,g._debugHookTypes=a._debugHookTypes,g.alternate=a,a.alternate=g):(g.pendingProps=c,g.type=a.type,g.flags=0,g.subtreeFlags=0,g.deletions=null,g.actualDuration=-0,g.actualStartTime=-1.1),g.flags=a.flags&65011712,g.childLanes=a.childLanes,g.lanes=a.lanes,g.child=a.child,g.memoizedProps=a.memoizedProps,g.memoizedState=a.memoizedState,g.updateQueue=a.updateQueue,c=a.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext,_debugThenableState:c._debugThenableState},g.sibling=a.sibling,g.index=a.index,g.ref=a.ref,g.refCleanup=a.refCleanup,g.selfBaseDuration=a.selfBaseDuration,g.treeBaseDuration=a.treeBaseDuration,g._debugInfo=a._debugInfo,g._debugNeedsRemount=a._debugNeedsRemount,g.tag){case 0:case 15:g.type=WA(a.type);break;case 1:g.type=WA(a.type);break;case 11:g.type=DI(a.type)}return g}function ci(a,c){a.flags&=65011714;var g=a.alternate;return g===null?(a.childLanes=0,a.lanes=c,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null,a.selfBaseDuration=0,a.treeBaseDuration=0):(a.childLanes=g.childLanes,a.lanes=g.lanes,a.child=g.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=g.memoizedProps,a.memoizedState=g.memoizedState,a.updateQueue=g.updateQueue,a.type=g.type,c=g.dependencies,a.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext,_debugThenableState:c._debugThenableState},a.selfBaseDuration=g.selfBaseDuration,a.treeBaseDuration=g.treeBaseDuration),a}function BI(a,c,g,S,I,C){var B=0,k=a;if(typeof a=="function")NI(a)&&(B=1),k=WA(k);else if(typeof a=="string")Cr&&N?(B=ga(),B=sf(a,g,B)?26:De(a)?27:5):Cr?(B=ga(),B=sf(a,g,B)?26:5):B=N&&De(a)?27:5;else e:switch(a){case Py:return c=l(31,g,c,I),c.elementType=Py,c.lanes=C,c;case Zh:return lm(g.children,I,C,c);case PI:B=8,I|=24;break;case _N:return a=g,S=I,typeof a.id!="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof a.id),c=l(12,a,c,S|2),c.elementType=_N,c.lanes=C,c.stateNode={effectDuration:0,passiveEffectDuration:0},c;case MI:return c=l(13,g,c,I),c.elementType=MI,c.lanes=C,c;case EN:return c=l(19,g,c,I),c.elementType=EN,c.lanes=C,c;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Vo:B=10;break e;case tg:B=9;break e;case Ts:B=11,k=DI(k);break e;case Wh:B=14;break e;case Wa:B=16,k=null;break e}k="",(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),a===null?g="null":li(a)?g="array":a!==void 0&&a.$$typeof===Xp?(g="<"+(re(a.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):g=typeof a,B=S?typeof S.tag=="number"?_e(S):typeof S.name=="string"?S.name:null:null,B&&(k+=`
273
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,_e(a))})}function WA(a){if($d===null)return a;var c=$d(a);return c===void 0?a:c.current}function DI(a){if($d===null)return a;var c=$d(a);return c===void 0?a!=null&&typeof a.render=="function"&&(c=WA(a.render),a.render!==c)?(c={$$typeof:Ts,render:c},a.displayName!==void 0&&(c.displayName=a.displayName),c):a:c.current}function hN(a,c){if($d===null)return!1;var g=a.elementType;c=c.type;var S=!1,I=typeof c=="object"&&c!==null?c.$$typeof:null;switch(a.tag){case 1:typeof c=="function"&&(S=!0);break;case 0:(typeof c=="function"||I===Wa)&&(S=!0);break;case 11:(I===Ts||I===Wa)&&(S=!0);break;case 14:case 15:(I===Wh||I===Wa)&&(S=!0);break;default:return!1}return!!(S&&(a=$d(g),a!==void 0&&a===$d(c)))}function j2(a){$d!==null&&typeof WeakSet=="function"&&(DC===null&&(DC=new WeakSet),DC.add(a))}function z2(a,c,g){do{var S=a,I=S.alternate,C=S.child,B=S.sibling,k=S.tag;S=S.type;var z=null;switch(k){case 0:case 15:case 1:z=S;break;case 11:z=S.render}if($d===null)throw Error("Expected resolveFamily to be set during hot reload.");var ee=!1;if(S=!1,z!==null&&(z=$d(z),z!==void 0&&(g.has(z)?S=!0:c.has(z)&&(k===1?S=!0:ee=!0))),DC!==null&&(DC.has(a)||I!==null&&DC.has(I))&&(S=!0),S&&(a._debugNeedsRemount=!0),(S||ee)&&(I=js(a,2),I!==null&&so(I,a,2)),C===null||S||z2(C,c,g),B===null)break;a=B}while(!0)}function yq(a,c,g,S){this.tag=a,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,qme||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function NI(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Wp(a,c){var g=a.alternate;switch(g===null?(g=l(a.tag,c,a.key,a.mode),g.elementType=a.elementType,g.type=a.type,g.stateNode=a.stateNode,g._debugOwner=a._debugOwner,g._debugStack=a._debugStack,g._debugTask=a._debugTask,g._debugHookTypes=a._debugHookTypes,g.alternate=a,a.alternate=g):(g.pendingProps=c,g.type=a.type,g.flags=0,g.subtreeFlags=0,g.deletions=null,g.actualDuration=-0,g.actualStartTime=-1.1),g.flags=a.flags&65011712,g.childLanes=a.childLanes,g.lanes=a.lanes,g.child=a.child,g.memoizedProps=a.memoizedProps,g.memoizedState=a.memoizedState,g.updateQueue=a.updateQueue,c=a.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext,_debugThenableState:c._debugThenableState},g.sibling=a.sibling,g.index=a.index,g.ref=a.ref,g.refCleanup=a.refCleanup,g.selfBaseDuration=a.selfBaseDuration,g.treeBaseDuration=a.treeBaseDuration,g._debugInfo=a._debugInfo,g._debugNeedsRemount=a._debugNeedsRemount,g.tag){case 0:case 15:g.type=WA(a.type);break;case 1:g.type=WA(a.type);break;case 11:g.type=DI(a.type)}return g}function ci(a,c){a.flags&=65011714;var g=a.alternate;return g===null?(a.childLanes=0,a.lanes=c,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null,a.selfBaseDuration=0,a.treeBaseDuration=0):(a.childLanes=g.childLanes,a.lanes=g.lanes,a.child=g.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=g.memoizedProps,a.memoizedState=g.memoizedState,a.updateQueue=g.updateQueue,a.type=g.type,c=g.dependencies,a.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext,_debugThenableState:c._debugThenableState},a.selfBaseDuration=g.selfBaseDuration,a.treeBaseDuration=g.treeBaseDuration),a}function BI(a,c,g,S,I,C){var B=0,k=a;if(typeof a=="function")NI(a)&&(B=1),k=WA(k);else if(typeof a=="string")Cr&&N?(B=ga(),B=sf(a,g,B)?26:Ne(a)?27:5):Cr?(B=ga(),B=sf(a,g,B)?26:5):B=N&&Ne(a)?27:5;else e:switch(a){case Py:return c=l(31,g,c,I),c.elementType=Py,c.lanes=C,c;case Zh:return lm(g.children,I,C,c);case PI:B=8,I|=24;break;case _N:return a=g,S=I,typeof a.id!="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof a.id),c=l(12,a,c,S|2),c.elementType=_N,c.lanes=C,c.stateNode={effectDuration:0,passiveEffectDuration:0},c;case MI:return c=l(13,g,c,I),c.elementType=MI,c.lanes=C,c;case EN:return c=l(19,g,c,I),c.elementType=EN,c.lanes=C,c;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Vo:B=10;break e;case tg:B=9;break e;case Ts:B=11,k=DI(k);break e;case Wh:B=14;break e;case Wa:B=16,k=null;break e}k="",(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),a===null?g="null":li(a)?g="array":a!==void 0&&a.$$typeof===Xp?(g="<"+(re(a.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):g=typeof a,B=S?typeof S.tag=="number"?_e(S):typeof S.name=="string"?S.name:null:null,B&&(k+=`
274
274
 
275
275
  Check the render method of \``+B+"`."),B=29,g=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(g+"."+k)),k=null}return c=l(B,g,c,I),c.elementType=a,c.type=k,c.lanes=C,c._debugOwner=S,c}function wI(a,c,g){return c=BI(a.type,a.key,a.props,a._owner,c,g),c._debugOwner=a._owner,c._debugStack=a._debugStack,c._debugTask=a._debugTask,c}function lm(a,c,g,S){return a=l(7,a,S,c),a.lanes=g,a}function OI(a,c,g){return a=l(6,a,null,c),a.lanes=g,a}function XA(a){var c=l(18,null,null,qt);return c.stateNode=a,c}function wy(a,c,g){return c=l(4,a.children!==null?a.children:[],a.key,c),c.lanes=g,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function Kh(a,c,g,S,I,C,B,k,z){for(this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Bd,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lt(0),this.hiddenUpdates=Lt(null),this.identifierPrefix=S,this.onUncaughtError=I,this.onCaughtError=C,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,a=this.pendingUpdatersLaneMap=[],c=0;31>c;c++)a.push(new Set);this._debugRootType=g?"hydrateRoot()":"createRoot()"}function eg(a,c,g,S,I,C,B,k,z,ee,me,ge){return a=new Kh(a,c,g,B,z,ee,me,ge,k),c=1,C===!0&&(c|=24),C=l(3,null,null,c|2),a.current=C,C.stateNode=a,c=Ze(),_t(c),a.pooledCache=c,_t(c),C.memoizedState={element:S,isDehydrated:g,cache:c},Qb(C),a}function Ja(a){return""+a}function H2(a){return a?(a=co,a):co}function $2(a,c,g,S){return Oy(c.current,2,a,c,g,S),2}function Oy(a,c,g,S,I,C){if(nu&&typeof nu.onScheduleFiberRoot=="function")try{nu.onScheduleFiberRoot(iC,S,g)}catch(B){Em||(Em=!0,console.error("React instrumentation encountered an error: %o",B))}I=H2(I),S.context===null?S.context=I:S.pendingContext=I,Sm&&pg!==null&&!Yme&&(Yme=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
276
276
 
277
- Check the render method of %s.`,_e(pg)||"Unknown")),S=zp(c),S.payload={element:g},C=C===void 0?null:C,C!==null&&(typeof C!="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",C),S.callback=C),g=Cc(a,S,c),g!==null&&(dr(c,"root.render()",null),so(g,a,c),kh(g,a,c))}function ky(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var g=a.retryLane;a.retryLane=g!==0&&g<c?g:c}}function Jh(a,c){ky(a,c),(a=a.alternate)&&ky(a,c)}function kI(){return pg}var On={},Sq=dn(),Za=SH(),Sr=Object.assign,q2=Symbol.for("react.element"),Xp=Symbol.for("react.transitional.element"),ef=Symbol.for("react.portal"),Zh=Symbol.for("react.fragment"),PI=Symbol.for("react.strict_mode"),_N=Symbol.for("react.profiler"),tg=Symbol.for("react.consumer"),Vo=Symbol.for("react.context"),Ts=Symbol.for("react.forward_ref"),MI=Symbol.for("react.suspense"),EN=Symbol.for("react.suspense_list"),Wh=Symbol.for("react.memo"),Wa=Symbol.for("react.lazy"),Py=Symbol.for("react.activity"),V2=Symbol.for("react.memo_cache_sentinel"),ng=Symbol.iterator,Xh=Symbol.for("react.client.reference"),li=Array.isArray,le=Sq.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Bc=e.rendererVersion,wc=e.rendererPackageName,tf=e.extraDevToolsConfig,Ia=e.getPublicInstance,Nd=e.getRootHostContext,bs=e.getChildHostContext,My=e.prepareForCommit,dm=e.resetAfterCommit,LI=e.createInstance;e.cloneMutableInstance;var Di=e.appendInitialChild,ao=e.finalizeInitialChildren,Un=e.shouldSetTextContent,nf=e.createTextInstance;e.cloneMutableTextInstance;var Oc=e.scheduleTimeout,yN=e.cancelTimeout,Bd=e.noTimeout,Ca=e.isPrimaryRenderer;e.warnsIfNotActing;var uo=e.supportsMutation,wd=e.supportsPersistence,Vs=e.supportsHydration,Tq=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var Eo=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Yo=e.setCurrentUpdatePriority,Xa=e.getCurrentUpdatePriority,SN=e.resolveUpdatePriority,e_=e.trackSchedulerEvent,rg=e.resolveEventType,Bl=e.resolveEventTimeStamp,Ly=e.shouldAttemptEagerTransition,TN=e.detachDeletedInstance;e.requestPostPaintCallback;var t_=e.maySuspendCommit,n_=e.maySuspendCommitOnUpdate,UI=e.maySuspendCommitInSyncRender,pm=e.preloadInstance,r_=e.startSuspendingCommit,QI=e.suspendInstance;e.suspendOnActiveViewTransition;var FI=e.waitForCommitToBeReady,GI=e.getSuspendedCommitReason,kc=e.NotPendingTransition,Pc=e.HostTransitionContext,Uy=e.resetFormInstance,og=e.bindToConsole,Y2=e.supportsMicrotasks,Mc=e.scheduleMicrotask,wl=e.supportsTestSelectors,bN=e.findFiberRoot,fm=e.getBoundingRect,IN=e.getTextContent,Od=e.isHiddenSubtree,jI=e.matchAccessibilityRole,Lu=e.setFocusIfFocusable,Lc=e.setupIntersectionObserver,Ko=e.appendChild,rf=e.appendChildToContainer,gn=e.commitTextUpdate,Nr=e.commitMount,di=e.commitUpdate,zI=e.insertBefore,o_=e.insertInContainerBefore,ig=e.removeChild,HI=e.removeChildFromContainer,i_=e.resetTextContent,s_=e.hideInstance,bq=e.hideTextInstance,Qy=e.unhideInstance,K2=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var CN=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var J2=e.cloneInstance,$I=e.createContainerChildSet,qI=e.appendChildToContainerChildSet,pi=e.finalizeContainerChildren,VI=e.replaceContainerChildren,kd=e.cloneHiddenInstance,Jo=e.cloneHiddenTextInstance,Fy=e.isSuspenseInstancePending,YI=e.isSuspenseInstanceFallback,Yi=e.getSuspenseInstanceFallbackErrorDetails,fi=e.registerSuspenseInstanceRetry,eu=e.canHydrateFormStateMarker,Ol=e.isFormStateMarkerMatching,mm=e.getNextHydratableSibling,Iq=e.getNextHydratableSiblingAfterSingleton,KI=e.getFirstHydratableChild,JI=e.getFirstHydratableChildWithinContainer,ZI=e.getFirstHydratableChildWithinActivityInstance,WI=e.getFirstHydratableChildWithinSuspenseInstance,XI=e.getFirstHydratableChildWithinSingleton,Gy=e.canHydrateInstance,Cq=e.canHydrateTextInstance,Gn=e.canHydrateActivityInstance,Lr=e.canHydrateSuspenseInstance,jn=e.hydrateInstance,Yn=e.hydrateTextInstance,Ir=e.hydrateActivityInstance,Uu=e.hydrateSuspenseInstance,Am=e.getNextHydratableInstanceAfterActivityInstance,sg=e.getNextHydratableInstanceAfterSuspenseInstance,vN=e.commitHydratedInstance,of=e.commitHydratedContainer,No=e.commitHydratedActivityInstance,gm=e.commitHydratedSuspenseInstance,ag=e.finalizeHydratedChildren,RN=e.flushHydrationEvents;e.clearActivityBoundary;var Qu=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var a_=e.clearSuspenseBoundaryFromContainer,jy=e.hideDehydratedBoundary,tu=e.unhideDehydratedBoundary,eC=e.shouldDeleteUnhydratedTailInstances,zy=e.diffHydratedPropsForDevWarnings,xN=e.diffHydratedTextForDevWarnings,u_=e.describeHydratableInstanceForDevWarnings,tC=e.validateHydratableInstance,hm=e.validateHydratableTextInstance,Cr=e.supportsResources,sf=e.isHostHoistableType,_m=e.getHoistableRoot,Pd=e.getResource,nC=e.acquireResource,rC=e.releaseResource,Z2=e.hydrateHoistable,c_=e.mountHoistable,oC=e.unmountHoistable,d=e.createHoistableInstance,p=e.prepareToCommitHoistables,E=e.mayResourceSuspendCommit,b=e.preloadResource,D=e.suspendResource,N=e.supportsSingletons,Q=e.resolveSingletonInstance,K=e.acquireSingletonInstance,Ae=e.releaseSingletonInstance,De=e.isHostSingletonType,Ke=e.isSingletonScope,je=[],nt=[],Ut=-1,co={};Object.freeze(co);var Ni=Math.clz32?Math.clz32:Pt,ug=Math.log,ce=Math.LN2,se=256,fe=262144,Fe=4194304,Dt=Za.unstable_scheduleCallback,yo=Za.unstable_cancelCallback,$t=Za.unstable_shouldYield,mr=Za.unstable_requestPaint,Kn=Za.unstable_now,rr=Za.unstable_ImmediatePriority,af=Za.unstable_UserBlockingPriority,Hy=Za.unstable_NormalPriority,bfe=Za.unstable_IdlePriority,ltt=Za.log,dtt=Za.unstable_setDisableYieldValue,iC=null,nu=null,Em=!1,ym=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",Ife=0;if(typeof performance=="object"&&typeof performance.now=="function")var ptt=performance,Cfe=function(){return ptt.now()};else{var ftt=Date;Cfe=function(){return ftt.now()}}var Fu=typeof Object.is=="function"?Object.is:ft,vfe=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},vq=Object.prototype.hasOwnProperty,lo=typeof console<"u"&&typeof console.timeStamp=="function"&&typeof performance<"u"&&typeof performance.measure=="function",zn="Blocking",l_=!1,cg={color:"primary",properties:null,tooltipText:"",track:"Components \u269B"},d_={start:-0,end:-0,detail:{devtools:cg}},mtt=["Changed Props",""],Att=["Changed Props","This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."],DN=0,Rfe,xfe,Dfe,Nfe,Bfe,wfe,Ofe;wu.__reactDisabledLog=!0;var Rq,kfe,xq=!1,Dq=new(typeof WeakMap=="function"?WeakMap:Map),Nq=new WeakMap,sC=[],aC=0,W2=null,NN=0,Md=[],Ld=0,$y=null,lg=1,dg="",p_=Qe(null),BN=Qe(null),f_=Qe(null),X2=Qe(null),Pfe=/["'&<>\n\t]|^\s|\s$/,pg=null,Sm=!1,va=null,Bo=null,Jn=!1,Tm=!1,kl=null,m_=null,Ud=!1,Bq=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),qt=0,eL=Qe(null),wq=Qe(null),Oq=Qe(null),tL={},nL=null,uC=null,cC=!1,gtt=typeof AbortController<"u"?AbortController:function(){var a=[],c=this.signal={aborted:!1,addEventListener:function(g,S){a.push(S)}};this.abort=function(){c.aborted=!0,a.forEach(function(g){return g()})}},htt=Za.unstable_scheduleCallback,_tt=Za.unstable_NormalPriority,Zo={$$typeof:Vo,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},Ki=Za.unstable_now,rL=console.createTask?console.createTask:function(){return null},ru=-0,A_=-0,fg=-0,mg=null,Gu=-1.1,qy=-0,wo=-0,Nt=-1.1,Ft=-1.1,So=null,Wo=!1,Vy=-0,bm=-1.1,wN=null,g_=0,kq=null,Pq=null,Yy=-1.1,ON=null,lC=-1.1,oL=-1.1,Ag=-0,gg=-1.1,Qd=-1.1,Mq=0,kN=null,Mfe=null,Lfe=null,h_=-1.1,Ky=null,__=-1.1,iL=-1.1,dC=null,Ufe=0,PN=-1.1,sL=!1,aL=!1,uL=null,pC=null,Lq=!1,Uq=!1,cL=!1,Qq=!1,Jy=0,Fq={},MN=null,Gq=0,Zy=0,fC=null,Qfe=le.S;le.S=function(a,c){if(kme=Kn(),typeof c=="object"&&c!==null&&typeof c.then=="function"){if(0>gg&&0>Qd){gg=Ki();var g=Bl(),S=rg();(g!==__||S!==Ky)&&(__=-1.1),h_=g,Ky=S}zM(a,c)}Qfe!==null&&Qfe(a,c)};var Wy=Qe(null),uf={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},LN=[],UN=[],QN=[],FN=[],GN=[],jN=[],Xy=new Set;uf.recordUnsafeLifecycleWarnings=function(a,c){Xy.has(a.type)||(typeof c.componentWillMount=="function"&&c.componentWillMount.__suppressDeprecationWarning!==!0&&LN.push(a),a.mode&8&&typeof c.UNSAFE_componentWillMount=="function"&&UN.push(a),typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&QN.push(a),a.mode&8&&typeof c.UNSAFE_componentWillReceiveProps=="function"&&FN.push(a),typeof c.componentWillUpdate=="function"&&c.componentWillUpdate.__suppressDeprecationWarning!==!0&&GN.push(a),a.mode&8&&typeof c.UNSAFE_componentWillUpdate=="function"&&jN.push(a))},uf.flushPendingUnsafeLifecycleWarnings=function(){var a=new Set;0<LN.length&&(LN.forEach(function(k){a.add(_e(k)||"Component"),Xy.add(k.type)}),LN=[]);var c=new Set;0<UN.length&&(UN.forEach(function(k){c.add(_e(k)||"Component"),Xy.add(k.type)}),UN=[]);var g=new Set;0<QN.length&&(QN.forEach(function(k){g.add(_e(k)||"Component"),Xy.add(k.type)}),QN=[]);var S=new Set;0<FN.length&&(FN.forEach(function(k){S.add(_e(k)||"Component"),Xy.add(k.type)}),FN=[]);var I=new Set;0<GN.length&&(GN.forEach(function(k){I.add(_e(k)||"Component"),Xy.add(k.type)}),GN=[]);var C=new Set;if(0<jN.length&&(jN.forEach(function(k){C.add(_e(k)||"Component"),Xy.add(k.type)}),jN=[]),0<c.size){var B=x(c);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
277
+ Check the render method of %s.`,_e(pg)||"Unknown")),S=zp(c),S.payload={element:g},C=C===void 0?null:C,C!==null&&(typeof C!="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",C),S.callback=C),g=Cc(a,S,c),g!==null&&(dr(c,"root.render()",null),so(g,a,c),kh(g,a,c))}function ky(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var g=a.retryLane;a.retryLane=g!==0&&g<c?g:c}}function Jh(a,c){ky(a,c),(a=a.alternate)&&ky(a,c)}function kI(){return pg}var On={},Sq=dn(),Za=SH(),Sr=Object.assign,q2=Symbol.for("react.element"),Xp=Symbol.for("react.transitional.element"),ef=Symbol.for("react.portal"),Zh=Symbol.for("react.fragment"),PI=Symbol.for("react.strict_mode"),_N=Symbol.for("react.profiler"),tg=Symbol.for("react.consumer"),Vo=Symbol.for("react.context"),Ts=Symbol.for("react.forward_ref"),MI=Symbol.for("react.suspense"),EN=Symbol.for("react.suspense_list"),Wh=Symbol.for("react.memo"),Wa=Symbol.for("react.lazy"),Py=Symbol.for("react.activity"),V2=Symbol.for("react.memo_cache_sentinel"),ng=Symbol.iterator,Xh=Symbol.for("react.client.reference"),li=Array.isArray,le=Sq.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Bc=e.rendererVersion,wc=e.rendererPackageName,tf=e.extraDevToolsConfig,Ia=e.getPublicInstance,Nd=e.getRootHostContext,bs=e.getChildHostContext,My=e.prepareForCommit,dm=e.resetAfterCommit,LI=e.createInstance;e.cloneMutableInstance;var Di=e.appendInitialChild,ao=e.finalizeInitialChildren,Un=e.shouldSetTextContent,nf=e.createTextInstance;e.cloneMutableTextInstance;var Oc=e.scheduleTimeout,yN=e.cancelTimeout,Bd=e.noTimeout,Ca=e.isPrimaryRenderer;e.warnsIfNotActing;var uo=e.supportsMutation,wd=e.supportsPersistence,Vs=e.supportsHydration,Tq=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var Eo=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Yo=e.setCurrentUpdatePriority,Xa=e.getCurrentUpdatePriority,SN=e.resolveUpdatePriority,e_=e.trackSchedulerEvent,rg=e.resolveEventType,Bl=e.resolveEventTimeStamp,Ly=e.shouldAttemptEagerTransition,TN=e.detachDeletedInstance;e.requestPostPaintCallback;var t_=e.maySuspendCommit,n_=e.maySuspendCommitOnUpdate,UI=e.maySuspendCommitInSyncRender,pm=e.preloadInstance,r_=e.startSuspendingCommit,QI=e.suspendInstance;e.suspendOnActiveViewTransition;var FI=e.waitForCommitToBeReady,GI=e.getSuspendedCommitReason,kc=e.NotPendingTransition,Pc=e.HostTransitionContext,Uy=e.resetFormInstance,og=e.bindToConsole,Y2=e.supportsMicrotasks,Mc=e.scheduleMicrotask,wl=e.supportsTestSelectors,bN=e.findFiberRoot,fm=e.getBoundingRect,IN=e.getTextContent,Od=e.isHiddenSubtree,jI=e.matchAccessibilityRole,Lu=e.setFocusIfFocusable,Lc=e.setupIntersectionObserver,Ko=e.appendChild,rf=e.appendChildToContainer,gn=e.commitTextUpdate,Nr=e.commitMount,di=e.commitUpdate,zI=e.insertBefore,o_=e.insertInContainerBefore,ig=e.removeChild,HI=e.removeChildFromContainer,i_=e.resetTextContent,s_=e.hideInstance,bq=e.hideTextInstance,Qy=e.unhideInstance,K2=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var CN=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var J2=e.cloneInstance,$I=e.createContainerChildSet,qI=e.appendChildToContainerChildSet,pi=e.finalizeContainerChildren,VI=e.replaceContainerChildren,kd=e.cloneHiddenInstance,Jo=e.cloneHiddenTextInstance,Fy=e.isSuspenseInstancePending,YI=e.isSuspenseInstanceFallback,Yi=e.getSuspenseInstanceFallbackErrorDetails,fi=e.registerSuspenseInstanceRetry,eu=e.canHydrateFormStateMarker,Ol=e.isFormStateMarkerMatching,mm=e.getNextHydratableSibling,Iq=e.getNextHydratableSiblingAfterSingleton,KI=e.getFirstHydratableChild,JI=e.getFirstHydratableChildWithinContainer,ZI=e.getFirstHydratableChildWithinActivityInstance,WI=e.getFirstHydratableChildWithinSuspenseInstance,XI=e.getFirstHydratableChildWithinSingleton,Gy=e.canHydrateInstance,Cq=e.canHydrateTextInstance,Gn=e.canHydrateActivityInstance,Lr=e.canHydrateSuspenseInstance,jn=e.hydrateInstance,Yn=e.hydrateTextInstance,Ir=e.hydrateActivityInstance,Uu=e.hydrateSuspenseInstance,Am=e.getNextHydratableInstanceAfterActivityInstance,sg=e.getNextHydratableInstanceAfterSuspenseInstance,vN=e.commitHydratedInstance,of=e.commitHydratedContainer,No=e.commitHydratedActivityInstance,gm=e.commitHydratedSuspenseInstance,ag=e.finalizeHydratedChildren,RN=e.flushHydrationEvents;e.clearActivityBoundary;var Qu=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var a_=e.clearSuspenseBoundaryFromContainer,jy=e.hideDehydratedBoundary,tu=e.unhideDehydratedBoundary,eC=e.shouldDeleteUnhydratedTailInstances,zy=e.diffHydratedPropsForDevWarnings,xN=e.diffHydratedTextForDevWarnings,u_=e.describeHydratableInstanceForDevWarnings,tC=e.validateHydratableInstance,hm=e.validateHydratableTextInstance,Cr=e.supportsResources,sf=e.isHostHoistableType,_m=e.getHoistableRoot,Pd=e.getResource,nC=e.acquireResource,rC=e.releaseResource,Z2=e.hydrateHoistable,c_=e.mountHoistable,oC=e.unmountHoistable,d=e.createHoistableInstance,p=e.prepareToCommitHoistables,E=e.mayResourceSuspendCommit,b=e.preloadResource,D=e.suspendResource,N=e.supportsSingletons,Q=e.resolveSingletonInstance,K=e.acquireSingletonInstance,Ae=e.releaseSingletonInstance,Ne=e.isHostSingletonType,Ke=e.isSingletonScope,je=[],nt=[],Ut=-1,co={};Object.freeze(co);var Ni=Math.clz32?Math.clz32:Pt,ug=Math.log,ce=Math.LN2,se=256,fe=262144,Fe=4194304,Dt=Za.unstable_scheduleCallback,yo=Za.unstable_cancelCallback,$t=Za.unstable_shouldYield,mr=Za.unstable_requestPaint,Kn=Za.unstable_now,rr=Za.unstable_ImmediatePriority,af=Za.unstable_UserBlockingPriority,Hy=Za.unstable_NormalPriority,bfe=Za.unstable_IdlePriority,ltt=Za.log,dtt=Za.unstable_setDisableYieldValue,iC=null,nu=null,Em=!1,ym=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",Ife=0;if(typeof performance=="object"&&typeof performance.now=="function")var ptt=performance,Cfe=function(){return ptt.now()};else{var ftt=Date;Cfe=function(){return ftt.now()}}var Fu=typeof Object.is=="function"?Object.is:ft,vfe=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},vq=Object.prototype.hasOwnProperty,lo=typeof console<"u"&&typeof console.timeStamp=="function"&&typeof performance<"u"&&typeof performance.measure=="function",zn="Blocking",l_=!1,cg={color:"primary",properties:null,tooltipText:"",track:"Components \u269B"},d_={start:-0,end:-0,detail:{devtools:cg}},mtt=["Changed Props",""],Att=["Changed Props","This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."],DN=0,Rfe,xfe,Dfe,Nfe,Bfe,wfe,Ofe;wu.__reactDisabledLog=!0;var Rq,kfe,xq=!1,Dq=new(typeof WeakMap=="function"?WeakMap:Map),Nq=new WeakMap,sC=[],aC=0,W2=null,NN=0,Md=[],Ld=0,$y=null,lg=1,dg="",p_=Qe(null),BN=Qe(null),f_=Qe(null),X2=Qe(null),Pfe=/["'&<>\n\t]|^\s|\s$/,pg=null,Sm=!1,va=null,Bo=null,Jn=!1,Tm=!1,kl=null,m_=null,Ud=!1,Bq=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),qt=0,eL=Qe(null),wq=Qe(null),Oq=Qe(null),tL={},nL=null,uC=null,cC=!1,gtt=typeof AbortController<"u"?AbortController:function(){var a=[],c=this.signal={aborted:!1,addEventListener:function(g,S){a.push(S)}};this.abort=function(){c.aborted=!0,a.forEach(function(g){return g()})}},htt=Za.unstable_scheduleCallback,_tt=Za.unstable_NormalPriority,Zo={$$typeof:Vo,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},Ki=Za.unstable_now,rL=console.createTask?console.createTask:function(){return null},ru=-0,A_=-0,fg=-0,mg=null,Gu=-1.1,qy=-0,wo=-0,Nt=-1.1,Ft=-1.1,So=null,Wo=!1,Vy=-0,bm=-1.1,wN=null,g_=0,kq=null,Pq=null,Yy=-1.1,ON=null,lC=-1.1,oL=-1.1,Ag=-0,gg=-1.1,Qd=-1.1,Mq=0,kN=null,Mfe=null,Lfe=null,h_=-1.1,Ky=null,__=-1.1,iL=-1.1,dC=null,Ufe=0,PN=-1.1,sL=!1,aL=!1,uL=null,pC=null,Lq=!1,Uq=!1,cL=!1,Qq=!1,Jy=0,Fq={},MN=null,Gq=0,Zy=0,fC=null,Qfe=le.S;le.S=function(a,c){if(kme=Kn(),typeof c=="object"&&c!==null&&typeof c.then=="function"){if(0>gg&&0>Qd){gg=Ki();var g=Bl(),S=rg();(g!==__||S!==Ky)&&(__=-1.1),h_=g,Ky=S}zM(a,c)}Qfe!==null&&Qfe(a,c)};var Wy=Qe(null),uf={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},LN=[],UN=[],QN=[],FN=[],GN=[],jN=[],Xy=new Set;uf.recordUnsafeLifecycleWarnings=function(a,c){Xy.has(a.type)||(typeof c.componentWillMount=="function"&&c.componentWillMount.__suppressDeprecationWarning!==!0&&LN.push(a),a.mode&8&&typeof c.UNSAFE_componentWillMount=="function"&&UN.push(a),typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&QN.push(a),a.mode&8&&typeof c.UNSAFE_componentWillReceiveProps=="function"&&FN.push(a),typeof c.componentWillUpdate=="function"&&c.componentWillUpdate.__suppressDeprecationWarning!==!0&&GN.push(a),a.mode&8&&typeof c.UNSAFE_componentWillUpdate=="function"&&jN.push(a))},uf.flushPendingUnsafeLifecycleWarnings=function(){var a=new Set;0<LN.length&&(LN.forEach(function(k){a.add(_e(k)||"Component"),Xy.add(k.type)}),LN=[]);var c=new Set;0<UN.length&&(UN.forEach(function(k){c.add(_e(k)||"Component"),Xy.add(k.type)}),UN=[]);var g=new Set;0<QN.length&&(QN.forEach(function(k){g.add(_e(k)||"Component"),Xy.add(k.type)}),QN=[]);var S=new Set;0<FN.length&&(FN.forEach(function(k){S.add(_e(k)||"Component"),Xy.add(k.type)}),FN=[]);var I=new Set;0<GN.length&&(GN.forEach(function(k){I.add(_e(k)||"Component"),Xy.add(k.type)}),GN=[]);var C=new Set;if(0<jN.length&&(jN.forEach(function(k){C.add(_e(k)||"Component"),Xy.add(k.type)}),jN=[]),0<c.size){var B=x(c);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
278
278
 
279
279
  * Move code with side effects to componentDidMount, and set initial state in the constructor.
280
280
 
@@ -662,16 +662,16 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
662
662
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
663
663
  `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,o=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(o&&n.sep&&!n.value){let s=[];for(let u=0;u<n.sep.length;++u){let l=n.sep[u];switch(l.type){case"newline":s.push(u);break;case"space":break;case"comment":l.indent>t.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(k0(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(JZe(n.key)&&!k0(n.sep,"newline")){let s=o1(n.start),u=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:u,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(k0(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=o1(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:i,key:null,sep:[this.sourceToken]}):k0(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);o||n.value?(t.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!k0(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:i});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||k0(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:o,sep:[]}):n.sep?this.stack.push(o):Object.assign(n,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let o=E9(r),i=o1(o);KZe(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
664
664
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
665
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ZZe.Parser=kpe});var nWe=M(IM=>{"use strict";m();var WZe=Spe(),yZt=AM(),bM=_M(),SZt=Ede(),TZt=gr(),bZt=Ope(),XZe=Ppe();function eWe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new bZt.LineCounter||null,prettyErrors:t}}function IZt(e,t={}){let{lineCounter:n,prettyErrors:r}=eWe(t),o=new XZe.Parser(n?.addNewLine),i=new WZe.Composer(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(let u of s)u.errors.forEach(bM.prettifyError(e,n)),u.warnings.forEach(bM.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function tWe(e,t={}){let{lineCounter:n,prettyErrors:r}=eWe(t),o=new XZe.Parser(n?.addNewLine),i=new WZe.Composer(t),s=null;for(let u of i.compose(o.parse(e),!0,e.length))if(!s)s=u;else if(s.options.logLevel!=="silent"){s.errors.push(new bM.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(bM.prettifyError(e,n)),s.warnings.forEach(bM.prettifyError(e,n))),s}function CZt(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let o=tWe(e,n);if(!o)return null;if(o.warnings.forEach(i=>SZt.warn(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function vZt(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=n??t??{};if(!o)return}return TZt.isDocument(e)&&!r?e.toString(n):new yZt.Document(e,r,n).toString(n)}IM.parse=CZt;IM.parseAllDocuments=IZt;IM.parseDocument=tWe;IM.stringify=vZt});var oWe=M(Mr=>{"use strict";m();var RZt=Spe(),xZt=AM(),DZt=tpe(),Mpe=_M(),NZt=WP(),P0=gr(),BZt=N0(),wZt=ps(),OZt=w0(),kZt=O0(),PZt=h9(),MZt=Bpe(),LZt=Ope(),UZt=Ppe(),y9=nWe(),rWe=YP();Mr.Composer=RZt.Composer;Mr.Document=xZt.Document;Mr.Schema=DZt.Schema;Mr.YAMLError=Mpe.YAMLError;Mr.YAMLParseError=Mpe.YAMLParseError;Mr.YAMLWarning=Mpe.YAMLWarning;Mr.Alias=NZt.Alias;Mr.isAlias=P0.isAlias;Mr.isCollection=P0.isCollection;Mr.isDocument=P0.isDocument;Mr.isMap=P0.isMap;Mr.isNode=P0.isNode;Mr.isPair=P0.isPair;Mr.isScalar=P0.isScalar;Mr.isSeq=P0.isSeq;Mr.Pair=BZt.Pair;Mr.Scalar=wZt.Scalar;Mr.YAMLMap=OZt.YAMLMap;Mr.YAMLSeq=kZt.YAMLSeq;Mr.CST=PZt;Mr.Lexer=MZt.Lexer;Mr.LineCounter=LZt.LineCounter;Mr.Parser=UZt.Parser;Mr.parse=y9.parse;Mr.parseAllDocuments=y9.parseAllDocuments;Mr.parseDocument=y9.parseDocument;Mr.stringify=y9.stringify;Mr.visit=rWe.visit;Mr.visitAsync=rWe.visitAsync});m();m();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d1bffb02-af0a-490b-b8d1-ed6a20cca385",e._sentryDebugIdIdentifier="sentry-dbid-d1bffb02-af0a-490b-b8d1-ed6a20cca385")}catch{}})();m();m();m();function aAe(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 uAe=aAe();uAe.ok||(process.stderr.write(`lore: ${uAe.message}.
665
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ZZe.Parser=kpe});var nWe=M(IM=>{"use strict";m();var WZe=Spe(),yZt=AM(),bM=_M(),SZt=Ede(),TZt=gr(),bZt=Ope(),XZe=Ppe();function eWe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new bZt.LineCounter||null,prettyErrors:t}}function IZt(e,t={}){let{lineCounter:n,prettyErrors:r}=eWe(t),o=new XZe.Parser(n?.addNewLine),i=new WZe.Composer(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(let u of s)u.errors.forEach(bM.prettifyError(e,n)),u.warnings.forEach(bM.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function tWe(e,t={}){let{lineCounter:n,prettyErrors:r}=eWe(t),o=new XZe.Parser(n?.addNewLine),i=new WZe.Composer(t),s=null;for(let u of i.compose(o.parse(e),!0,e.length))if(!s)s=u;else if(s.options.logLevel!=="silent"){s.errors.push(new bM.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(bM.prettifyError(e,n)),s.warnings.forEach(bM.prettifyError(e,n))),s}function CZt(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let o=tWe(e,n);if(!o)return null;if(o.warnings.forEach(i=>SZt.warn(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function vZt(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=n??t??{};if(!o)return}return TZt.isDocument(e)&&!r?e.toString(n):new yZt.Document(e,r,n).toString(n)}IM.parse=CZt;IM.parseAllDocuments=IZt;IM.parseDocument=tWe;IM.stringify=vZt});var oWe=M(Mr=>{"use strict";m();var RZt=Spe(),xZt=AM(),DZt=tpe(),Mpe=_M(),NZt=WP(),P0=gr(),BZt=N0(),wZt=ps(),OZt=w0(),kZt=O0(),PZt=h9(),MZt=Bpe(),LZt=Ope(),UZt=Ppe(),y9=nWe(),rWe=YP();Mr.Composer=RZt.Composer;Mr.Document=xZt.Document;Mr.Schema=DZt.Schema;Mr.YAMLError=Mpe.YAMLError;Mr.YAMLParseError=Mpe.YAMLParseError;Mr.YAMLWarning=Mpe.YAMLWarning;Mr.Alias=NZt.Alias;Mr.isAlias=P0.isAlias;Mr.isCollection=P0.isCollection;Mr.isDocument=P0.isDocument;Mr.isMap=P0.isMap;Mr.isNode=P0.isNode;Mr.isPair=P0.isPair;Mr.isScalar=P0.isScalar;Mr.isSeq=P0.isSeq;Mr.Pair=BZt.Pair;Mr.Scalar=wZt.Scalar;Mr.YAMLMap=OZt.YAMLMap;Mr.YAMLSeq=kZt.YAMLSeq;Mr.CST=PZt;Mr.Lexer=MZt.Lexer;Mr.LineCounter=LZt.LineCounter;Mr.Parser=UZt.Parser;Mr.parse=y9.parse;Mr.parseAllDocuments=y9.parseAllDocuments;Mr.parseDocument=y9.parseDocument;Mr.stringify=y9.stringify;Mr.visit=rWe.visit;Mr.visitAsync=rWe.visitAsync});m();m();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0e7243ab-3847-4a34-a36c-65be751f6657",e._sentryDebugIdIdentifier="sentry-dbid-0e7243ab-3847-4a34-a36c-65be751f6657")}catch{}})();m();m();m();function aAe(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 uAe=aAe();uAe.ok||(process.stderr.write(`lore: ${uAe.message}.
666
666
  Upgrade Node (e.g. \`nvm install 20\`) and re-run.
667
- `),process.exit(1));m();WR();sc();function Dwt(){let e=process.env.SENTRY_SPOTLIGHT?.trim();return!e||e==="0"||e==="false"?!1:e==="1"||e==="true"?!0:e}var Nwt=Dwt();oee({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:to(),release:hu(),sendDefaultPii:!0,enableLogs:!0,spotlight:Nwt,tracesSampleRate:1});FQ("service_name","lore-cli");WR();uee();import{realpathSync as Ann}from"node:fs";import{fileURLToPath as gnn,pathToFileURL as att}from"node:url";m();m();Rk();Pr();on();Bn();m();function Qk(e){let t=e;return t._def??t.def??{}}function l3t(e){let t=Qk(e);return typeof t.typeName=="string"?t.typeName:typeof t.type=="string"?t.type:void 0}function il(e,t,n){let r=l3t(e);return r===t||r===n}function Pje(e){let t=Qk(e);if(t.element)return t.element;if(typeof t.type=="object"&&t.type!==null)return t.type}function d3t(e){let t=e.options;if(Array.isArray(t))return[...t];let n=Qk(e);return Array.isArray(n.values)?[...n.values]:n.entries&&typeof n.entries=="object"?Object.values(n.entries):[]}function _se(e){if(!e||!il(e,"ZodObject","object"))return;let t=e.shape;if(typeof t=="function")return t();if(t&&typeof t=="object")return t;let n=Qk(e).shape;if(typeof n=="function")return n();if(n&&typeof n=="object")return n}function Mje(e){let t=e,n=!1,r,o=e.description;for(;;){o=t.description??o;let i=Qk(t);if(il(t,"ZodOptional","optional"))n=!0,t=i.innerType;else if(il(t,"ZodNullable","nullable"))n=!0,t=i.innerType;else if(il(t,"ZodDefault","default"))r=typeof i.defaultValue=="function"?i.defaultValue():i.defaultValue,t=i.innerType;else if(il(t,"ZodEffects","effects"))t=i.schema;else if(il(t,"ZodPipeline","pipe"))t=i.in;else break}return{inner:t,optional:n,defaultValue:r,description:o}}function p3t(e,t={}){let{inner:n,optional:r,defaultValue:o,description:i}=Mje(e),s=!1,u=n;il(u,"ZodArray","array")&&(s=!0,u=Pje(u)??u);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}:il(u,"ZodEnum","enum")?{arg:{type:"enum",description:i,options:d3t(u),required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:il(u,"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 Ese(e,t={}){let n={},r={};for(let[o,i]of Object.entries(e)){let{arg:s,isArray:u}=p3t(i,t);n[o]=s,r[o]={isArray:u,leafKind:f3t(i)}}return{args:n,fields:r}}function yse(e,t={}){let n=_se(e);return n?Ese(n,t):{args:{},fields:{}}}function f3t(e){let{inner:t}=Mje(e),n=t;return il(n,"ZodArray","array")&&(n=Pje(n)??n),il(n,"ZodNumber","number")?"number":il(n,"ZodBoolean","boolean")?"boolean":il(n,"ZodEnum","enum")?"enum":il(n,"ZodString","string")?"string":"other"}function m3t(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 A3t(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 Sse(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 g3t(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 h3t(e,t){let n=t.path.map(o=>String(o)).join(".");return` ${n?`${e}.${n}`:e}: ${t.message}`}function Tse(e,t,n){if(!e)return[];let r=t??{},o=e.safeParse(r);return o.success?[]:(o.error.issues??[]).map(s=>h3t(n,s))}function _3t(e,t,n){return e.resource==="threads"&&t==="id"?g3t(n):n}function Lje(e){let t=m3t(Uz,e.path),n=_se(t.pathParams),r=e.positional??(n?Object.keys(n):[]),o=new Set(r),i=Ese(n?Object.fromEntries(r.map(h=>[h,n[h]])):{},{positional:!0}),s=yse(t.query),u=t.method==="GET"||t.method==="DELETE"?{args:{},fields:{}}:yse(t.body);for(let h of Object.keys(u.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,...u.args},f=e.description??t.summary??`${t.method} ${t.path}`;return{meta:{name:e.op,description:f},args:l,async run({args:h,data:_}){$.info("command_start",{command:`${e.resource} ${e.op}`,route:e.path.join(".")});let y=_;if(!await(y?.getAccessToken??sn)())throw new Ne("not logged in \u2014 run 'lore login' first");let v={};for(let ae of r){let re=h[ae],_e=Sse(re,i.fields[ae])??re;v[ae]=_3t(e,ae,_e)}let R={};for(let[ae,re]of Object.entries(s.fields)){let _e=Sse(h[ae],re);_e!==void 0&&(R[ae]=_e)}let x={};for(let[ae,re]of Object.entries(u.fields)){let _e=Sse(h[ae],re);_e!==void 0&&(x[ae]=_e)}let O=[...Tse(t.pathParams,v,"path"),...Tse(t.query,R,"query"),...t.method==="GET"||t.method==="DELETE"?[]:Tse(t.body,x,"body")];if(O.length>0)throw new Ne(`Invalid request for \`lore ${e.resource} ${e.op}\`:
667
+ `),process.exit(1));m();WR();sc();function Dwt(){let e=process.env.SENTRY_SPOTLIGHT?.trim();return!e||e==="0"||e==="false"?!1:e==="1"||e==="true"?!0:e}var Nwt=Dwt();oee({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:to(),release:hu(),sendDefaultPii:!0,enableLogs:!0,spotlight:Nwt,tracesSampleRate:1});FQ("service_name","lore-cli");WR();uee();import{realpathSync as Ann}from"node:fs";import{fileURLToPath as gnn,pathToFileURL as att}from"node:url";m();m();Rk();Pr();on();Bn();m();function Qk(e){let t=e;return t._def??t.def??{}}function l3t(e){let t=Qk(e);return typeof t.typeName=="string"?t.typeName:typeof t.type=="string"?t.type:void 0}function il(e,t,n){let r=l3t(e);return r===t||r===n}function Pje(e){let t=Qk(e);if(t.element)return t.element;if(typeof t.type=="object"&&t.type!==null)return t.type}function d3t(e){let t=e.options;if(Array.isArray(t))return[...t];let n=Qk(e);return Array.isArray(n.values)?[...n.values]:n.entries&&typeof n.entries=="object"?Object.values(n.entries):[]}function _se(e){if(!e||!il(e,"ZodObject","object"))return;let t=e.shape;if(typeof t=="function")return t();if(t&&typeof t=="object")return t;let n=Qk(e).shape;if(typeof n=="function")return n();if(n&&typeof n=="object")return n}function Mje(e){let t=e,n=!1,r,o=e.description;for(;;){o=t.description??o;let i=Qk(t);if(il(t,"ZodOptional","optional"))n=!0,t=i.innerType;else if(il(t,"ZodNullable","nullable"))n=!0,t=i.innerType;else if(il(t,"ZodDefault","default"))r=typeof i.defaultValue=="function"?i.defaultValue():i.defaultValue,t=i.innerType;else if(il(t,"ZodEffects","effects"))t=i.schema;else if(il(t,"ZodPipeline","pipe"))t=i.in;else break}return{inner:t,optional:n,defaultValue:r,description:o}}function p3t(e,t={}){let{inner:n,optional:r,defaultValue:o,description:i}=Mje(e),s=!1,u=n;il(u,"ZodArray","array")&&(s=!0,u=Pje(u)??u);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}:il(u,"ZodEnum","enum")?{arg:{type:"enum",description:i,options:d3t(u),required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:il(u,"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 Ese(e,t={}){let n={},r={};for(let[o,i]of Object.entries(e)){let{arg:s,isArray:u}=p3t(i,t);n[o]=s,r[o]={isArray:u,leafKind:f3t(i)}}return{args:n,fields:r}}function yse(e,t={}){let n=_se(e);return n?Ese(n,t):{args:{},fields:{}}}function f3t(e){let{inner:t}=Mje(e),n=t;return il(n,"ZodArray","array")&&(n=Pje(n)??n),il(n,"ZodNumber","number")?"number":il(n,"ZodBoolean","boolean")?"boolean":il(n,"ZodEnum","enum")?"enum":il(n,"ZodString","string")?"string":"other"}function m3t(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 A3t(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 Sse(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 g3t(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 h3t(e,t){let n=t.path.map(o=>String(o)).join(".");return` ${n?`${e}.${n}`:e}: ${t.message}`}function Tse(e,t,n){if(!e)return[];let r=t??{},o=e.safeParse(r);return o.success?[]:(o.error.issues??[]).map(s=>h3t(n,s))}function _3t(e,t,n){return e.resource==="threads"&&t==="id"?g3t(n):n}function Lje(e){let t=m3t(Uz,e.path),n=_se(t.pathParams),r=e.positional??(n?Object.keys(n):[]),o=new Set(r),i=Ese(n?Object.fromEntries(r.map(h=>[h,n[h]])):{},{positional:!0}),s=yse(t.query),u=t.method==="GET"||t.method==="DELETE"?{args:{},fields:{}}:yse(t.body);for(let h of Object.keys(u.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,...u.args},f=e.description??t.summary??`${t.method} ${t.path}`;return{meta:{name:e.op,description:f},args:l,async run({args:h,data:_}){$.info("command_start",{command:`${e.resource} ${e.op}`,route:e.path.join(".")});let y=_;if(!await(y?.getAccessToken??sn)())throw new De("not logged in \u2014 run 'lore login' first");let v={};for(let ae of r){let re=h[ae],_e=Sse(re,i.fields[ae])??re;v[ae]=_3t(e,ae,_e)}let R={};for(let[ae,re]of Object.entries(s.fields)){let _e=Sse(h[ae],re);_e!==void 0&&(R[ae]=_e)}let x={};for(let[ae,re]of Object.entries(u.fields)){let _e=Sse(h[ae],re);_e!==void 0&&(x[ae]=_e)}let O=[...Tse(t.pathParams,v,"path"),...Tse(t.query,R,"query"),...t.method==="GET"||t.method==="DELETE"?[]:Tse(t.body,x,"body")];if(O.length>0)throw new De(`Invalid request for \`lore ${e.resource} ${e.op}\`:
668
668
  ${O.join(`
669
- `)}`);let P=y?.client??Gt(),j=A3t(P,e.path),G={headers:{}};r.length>0&&(G.params=v),Object.keys(R).length>0&&(G.query=R),Object.keys(u.fields).length>0&&(G.body=x);let H=await j(G);if(H.status>=200&&H.status<300){console.log(JSON.stringify(H.body,null,2));return}let V=H.body?.message??`${e.path.join(".")} returned ${H.status}`;throw new Ne(V)}}}m();var Uje=[{path:["getThread"],resource:"threads",op:"get"},{path:["listThreads"],resource:"threads",op:"list"},{path:["askThreads"],resource:"threads",op:"ask"},{path:["forkThread"],resource:"threads",op:"fork"},{path:["projects","listProjects"],resource:"projects",op:"list"}];function Qje(e=Uje){let t=new Map;for(let r of e){let o=Lje(r),i=t.get(r.resource)??new Map;if(i.has(r.op))throw new Error(`cliRoutes has duplicate "${r.resource} ${r.op}" \u2014 operations must be unique within a resource`);i.set(r.op,o),t.set(r.resource,i)}let n={};for(let[r,o]of t)n[r]={meta:{name:r,description:`Operations on ${r}.`},subCommands:Object.fromEntries(o)};return n}await Jle();m();Bn();m();on();Bn();Mo();Fa();Th();import{createHash as qZt}from"node:crypto";import R9 from"node:fs/promises";import CWe from"node:path";import{fileURLToPath as VZt}from"node:url";m();on();Jz();import HVt from"node:fs/promises";import{setTimeout as $Vt}from"node:timers/promises";m();sc();import{execFileSync as aKe}from"node:child_process";import{createHash as LVt}from"node:crypto";import{resolve as UVt}from"node:path";var b$={dev:"http://localhost:8080","dev-shared":"https://lore.dev.tanagram.ai",prod:"https://lore.link"};function C0(e={}){let t=e.currentEnvironment??to(),n=e.discoverLocalWebUrl??QVt,r=(e.target??process.env.LORE_TARGET)?.trim();if(r&&Object.prototype.hasOwnProperty.call(b$,r))return r==="dev"?n()??b$.dev:b$[r];if(t==="dev"){let o=n();if(o)return o}return b$[t]}function QVt(){if(process.env.LORE_DISABLE_PORTLESS_DISCOVERY!=="1"&&process.env.npm_lifecycle_event!=="test")try{return aKe("portless",["get",FVt()],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim().replace(/\/$/,"")}catch{return}}function FVt(){let e=GVt();return e?`${e}.lore`:"lore"}function GVt(){let e=sKe(process.env.LORE_DEV_STACK_NAME??"");if(e)return e;let t=jVt();return[sKe(t.split(/[\\/]/).pop()||"lore"),zVt(t)].filter(Boolean).join("-").slice(0,63)}function jVt(){try{return aKe("git",["rev-parse","--show-toplevel"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return UVt(process.cwd(),"../..")}}function zVt(e){return LVt("sha1").update(e).digest("hex").slice(0,8)}function sKe(e){return e.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,63)}var qVt=1e3,Xle=120*1e3,VVt=3e4,Wle=class extends Error{constructor(t,n){super(`${t} timed out after ${n}ms`),this.name="UploadNetworkTimeoutError"}},YVt=new Set(["billing_required","paywall","plan_required","upgrade_required"]),KVt=/\b(paywall|billing(?:\s+plan)?|upgrade\s+to)\b/i;function cKe(e){return tde(e)&&typeof e.message=="string"?e.message:""}function JVt(e){return tde(e)&&typeof e.code=="string"?e.code.trim().toLowerCase():""}function ZVt(e,t){if(e===402)return!0;let n=JVt(t);if(n&&YVt.has(n))return!0;if(e===403){let r=cKe(t);if(r&&KVt.test(r))return!0}return!1}function Np(e,t,n,r={}){if(ZVt(t,n)){let o=r.billingUrl??`${C0().replace(/\/+$/,"")}/billing`;return new $x({action:e,serverMessage:cKe(n),billingUrl:o})}return new Error(r7t(e,t,n))}async function lKe(e,t,n={}){let r=t.map(i=>({md5:i.md5,harness:i.harness,filename:i.filename,repo_origin_path:i.repoOriginPath||void 0,file_type:i.fileType,harness_internal_id:i.harnessInternalId,artifact_metadata:i.artifactMetadata})),o=await ede("create upload session",n.timeoutMs,async()=>e.createUploadSession({body:{thread_files:r}}));if(o.status!==201)throw Np("create upload session",o.status,o.body);return o.body}var VP=class extends Error{status;constructor(t,n){super(`upload transcript: unexpected status ${t}: ${n}`),this.name="UploadSessionFileError",this.status=t}};async function I$(e,t,n={}){let r=await HVt.readFile(t);await Pk(async()=>{let o=await ede("upload transcript",n.timeoutMs,async i=>fetch(e,{method:"PUT",body:r,headers:{"content-length":String(r.length)},signal:i}));if(!o.ok)throw await WVt(o)},{isRetryableError:o=>Mk(o)||Lk(o),describeRetryReason:o=>`network:${Uk(o)}`,logEvent:"upload_session_file_retry",sleep:n.sleep})}async function WVt(e){let t=await e.text(),n=(XVt(t)??t7t(t)??e.statusText.trim())||"empty response body";return new VP(e.status,n)}function XVt(e){let t=e.trim();if(!t.startsWith("<"))return null;let n=uKe(t,"Code");if(!n)return null;let r=uKe(t,"Message");return`S3 ${n}${r?`: ${r}`:""}`}function uKe(e,t){let r=e.match(new RegExp(`<${t}>([\\s\\S]*?)</${t}>`,"i"))?.[1]?.trim();return r?e7t(r):null}function e7t(e){return e.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&quot;",'"').replaceAll("&apos;","'").replaceAll("&amp;","&")}function t7t(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>500?`${t.slice(0,497)}...`:t:null}async function dKe(e,t,n,r={}){let o=n.map(i=>({storage_url:n7t(i)}));return Pk(async()=>{let i=await ede("complete upload session",r.timeoutMs,async()=>e.completeUploadSession({params:{id:t},body:{thread_files:o}}));if(i.status!==200)throw Np("complete upload session",i.status,i.body);return i.body},{isRetryableError:Lk,describeRetryReason:i=>`network:${Uk(i)}`,logEvent:"complete_upload_session_retry",sleep:r.sleep})}async function VD(e,t,n={}){let r=n.timeoutMs??Xle,o=n.pollIntervalMs??qVt,i=Date.now();for(;;){if(n.signal?.aborted)throw new DOMException("The operation was aborted","AbortError");n.onPoll&&await n.onPoll();let s=await e.getThread({params:{id:t}});if(s.status!==200)throw Np(`get thread ${t}`,s.status,s.body);let u=s.body.transcript_parsing_state;if(u==="parsed"||u==="too_large_to_parse")return;if(u==="failed")throw new Error(`thread ${t} parsing failed permanently`);if(u!=="pending"&&u!=="parsing")throw new Error(`unexpected transcript parsing state for thread ${t}: ${JSON.stringify(u)}`);let l=Date.now()-i;if(l>=r)throw new Error(`timed out waiting for thread ${t} parsing after ${r}ms`);await $Vt(Math.min(o,r-l),void 0,{signal:n.signal})}}function pKe(e,t){let n=new Map;for(let r of e){let o=r.md5.trim().toLowerCase();n.set(o,[...n.get(o)??[],r])}return t.map((r,o)=>{let i=r.expected_md5?.trim();if(!i)throw new Error(`upload session response missing expected_md5 for thread_files[${o}]`);let s=i.toLowerCase(),u=n.get(s);if(!u||u.length===0)throw new Error(`upload session response returned unexpected expected_md5 ${i}`);let[l,...f]=u;if(!l)throw new Error(`upload session response returned unexpected expected_md5 ${i}`);return f.length===0?n.delete(s):n.set(s,f),l})}function n7t(e){if(!e.storage_url.trim())throw new Error("upload session response missing storage_url");return e.storage_url}async function ede(e,t,n){let r=t??VVt,o=new AbortController,i,s=new Promise((u,l)=>{i=setTimeout(()=>{o.abort(),l(new Wle(e,r))},r),i.unref?.()});try{return await Promise.race([n(o.signal),s])}finally{i&&clearTimeout(i)}}function r7t(e,t,n){return tde(n)&&typeof n.message=="string"?`${e} failed: HTTP ${t}: ${n.message}`:`${e} failed: HTTP ${t}`}function tde(e){return e!==null&&typeof e=="object"}m();l$();Bn();Fa();import o7t from"node:fs/promises";function i7t(e){return[...new Set(e)].sort((t,n)=>t.localeCompare(n))}var fKe={harness:"claudeCode",async resolveCandidateDirectories(){let e=S0();$.info("skill_project_root_resolver_started",{harness:this.harness,history_path:e});let t;try{t=await o7t.readFile(e,"utf8")}catch(r){if(r.code==="ENOENT")return $.info("skill_project_root_resolver_missing_source",{harness:this.harness,history_path:e}),[];throw r}let n=i7t(zP(t,e).map(r=>ji(r.project)).filter(r=>r.length>0));return $.info("skill_project_root_resolver_directories_found",{harness:this.harness,directory_count:n.length}),n}};m();on();import AKe from"node:fs/promises";import u7t from"node:path";m();import s7t from"node:os";import a7t from"node:path";function nde(){return a7t.join(s7t.homedir(),"Library","Application Support","Claude","local-agent-mode-sessions")}Bn();Fa();function c7t(e){return[...new Set(e)].sort((t,n)=>t.localeCompare(n))}async function l7t(e=nde()){let t=[];async function n(r){let o;try{o=await AKe.readdir(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;throw i}for(let i of o){let s=u7t.join(r,i.name);i.isDirectory()?await n(s):i.isFile()&&i.name==="spaces.json"&&t.push(s)}}return await n(e),t.sort((r,o)=>r.localeCompare(o))}function mKe(e){return e!==null&&typeof e=="object"}function d7t(e){if(!Array.isArray(e.spaces))return[];let t=[];for(let n of e.spaces)if(!(!mKe(n)||!Array.isArray(n.folders)))for(let r of n.folders){if(!mKe(r)||typeof r.path!="string")continue;let o=ji(r.path);o.length>0&&t.push(o)}return t}var gKe={harness:"cowork",async resolveCandidateDirectories(){let e=nde();$.info("skill_project_root_resolver_started",{harness:this.harness,sessions_root:e});let t=await l7t(e);$.info("skill_project_root_resolver_spaces_files_found",{harness:this.harness,spaces_file_count:t.length});let n=[];for(let o of t){let i;try{i=JSON.parse(await AKe.readFile(o,"utf8"))}catch(u){$.warn("skill_project_root_resolver_spaces_file_skipped",{harness:this.harness,spaces_file:o,error:ln(u)});continue}let s=d7t(i);$.info("skill_project_root_resolver_spaces_file_read",{harness:this.harness,spaces_file:o,folder_count:s.length}),n.push(...s)}let r=c7t(n);return $.info("skill_project_root_resolver_directories_found",{harness:this.harness,directory_count:r.length}),r}};m();var aWe=ue(oWe(),1);import Dh from"node:fs/promises";import sWe from"node:os";import ii from"node:path";var CM="SKILL.md",uWe=()=>ii.join(sWe.homedir(),".claude","skills"),cWe=()=>ii.join(sWe.homedir(),".config","agents","skills"),T9=(e=process.cwd())=>ii.join(e,".claude","skills"),b9=(e=process.cwd())=>ii.join(e,".agents","skills"),QZt=(e,t=process.cwd())=>{switch(e){case"claude_global":return uWe();case"agents_global":return cWe();case"claude_project":return T9(t);case"agents_project":return b9(t)}},I9=(e,t=[],n={})=>{let r=n.includeCwdProject===!1?t:[e,...t];return[...[...new Set(r.map(i=>ii.resolve(i)))].flatMap(i=>[{kind:"claude_project",dir:T9(i)},{kind:"agents_project",dir:b9(i)}]),{kind:"claude_global",dir:uWe()},{kind:"agents_global",dir:cWe()}]},lWe=(e=process.cwd(),t=[])=>[...new Set(I9(e,t,{includeCwdProject:!1}).map(n=>n.dir))],FZt=/^[A-Za-z0-9_][A-Za-z0-9._:-]*$/,vM=e=>{if(typeof e!="string"||e.length===0||e.length>200||e==="."||e===".."||e.includes("/")||e.includes("\\")||/[\x00-\x1f]/.test(e)||!FZt.test(e))return!1;for(let t of e.split(":"))if(t===""||t==="."||t==="..")return!1;return!0},S9=(e,t)=>{let n=ii.resolve(e),r=ii.resolve(t),o=ii.relative(n,r);if(o===""||o.startsWith("..")||ii.isAbsolute(o))throw new Error(`refused to use a skill path outside ${n}: ${r}`);return r},GZt=(e,t)=>vM(e)?I9(t).map(n=>S9(n.dir,ii.join(n.dir,e,CM))):[],Lpe=async e=>{try{return await Dh.access(e),!0}catch{return!1}},dWe=async(e,t=process.cwd())=>{for(let n of GZt(e,t))if(await Lpe(n))return fWe(n,e,t);return null},pWe=async(e,t=process.cwd())=>{let n=ii.resolve(e),r=n;try{(await Dh.stat(n)).isDirectory()&&(r=ii.join(n,CM))}catch{return null}return ii.basename(r)!==CM||!await Lpe(r)?null:fWe(r,ii.basename(ii.dirname(r)),t)},fWe=async(e,t,n)=>{let r=await Dh.readFile(e,"utf8"),o=mWe(r);return{name:o.name??t,description:o.description??null,bodyMd:r,filePath:e,rootKind:jZt(e,n)}},jZt=(e,t)=>{for(let n of I9(t)){let r=ii.relative(ii.resolve(n.dir),ii.resolve(e));if(r!==""&&!r.startsWith("..")&&!ii.isAbsolute(r))return n.kind}return"claude_global"},zZt=/^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/,iWe=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},mWe=e=>{let t=zZt.exec(e);if(!t)return{name:null,description:null};let n=t[1];if(!n)return{name:null,description:null};let r;try{r=(0,aWe.parse)(n)}catch{return{name:null,description:null}}if(!r||typeof r!="object"||Array.isArray(r))return{name:null,description:null};let o=r;return{name:iWe(o.name),description:iWe(o.description)}};var RM=(e,t,n=process.cwd())=>{if(!vM(t))throw new Error(`refusing to install skill with invalid name: ${JSON.stringify(t)}`);let r=QZt(e,n),o=S9(r,ii.join(r,t));return S9(r,ii.join(o,CM))},HZt=async(e,t)=>{let n=`${e}.tmp.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}`;try{let r=await Dh.open(n,"w");try{await r.writeFile(t,"utf8"),await r.sync()}finally{await r.close()}await Dh.rename(n,e)}catch(r){throw await Dh.unlink(n).catch(()=>{}),r}},C9=async(e,t,n,r=process.cwd())=>{let o=RM(e,t,r),i=ii.dirname(o);return await Dh.mkdir(i,{recursive:!0}),await HZt(o,n),o};var Upe=async({cwd:e=process.cwd(),projectCwds:t=[],includeCwdProject:n=!0}={})=>{let r=new Set,o=[];for(let i of I9(e,t,{includeCwdProject:n}))try{let s=await Dh.readdir(i.dir,{withFileTypes:!0});for(let u of s){if(!u.isDirectory()||!vM(u.name))continue;let l=S9(i.dir,ii.join(i.dir,u.name,CM)),f=`${i.kind}:${l}`;if(r.has(f)||!await Lpe(l))continue;r.add(f);let h=await Dh.readFile(l,"utf8"),_=mWe(h);o.push({name:_.name??u.name,description:_.description??null,bodyMd:h,filePath:l,rootKind:i.kind})}}catch{}return o.sort((i,s)=>i.rootKind.localeCompare(s.rootKind)||i.name.localeCompare(s.name)||i.filePath.localeCompare(s.filePath))};m();Mo();import PA from"node:fs/promises";import bb from"node:path";var AWe=()=>({version:2,lastEventId:null,installed:{},captured:{},published:{}});async function Ha(){try{let e=JSON.parse(await PA.readFile(UT(),"utf8"));return gWe(e)}catch{return AWe()}}function gWe(e){let t=AWe();return t.lastEventId=typeof e.lastEventId=="string"?e.lastEventId:null,t.installed=Qpe(e.installed,(n,r)=>n.skillId===r),t.captured=Qpe(e.captured,(n,r)=>n.skillId===r),t.published=Qpe(e.published,()=>!0),t}function Qpe(e,t){let n={};if(!e)return n;for(let[r,o]of Object.entries(e))r.startsWith("sk_")&&t(o,r)&&(n[r]=o);return n}async function v9(e){await _We(async()=>{let t=gWe(e);t.lastEventId=EWe(t.lastEventId,await $Zt()),await hWe(t)})}async function hWe(e){let t=UT(),n=bb.dirname(t);await PA.mkdir(n,{recursive:!0,mode:448}),await PA.chmod(n,448),await PA.writeFile(t,`${JSON.stringify(e,null,2)}
669
+ `)}`);let P=y?.client??Gt(),j=A3t(P,e.path),G={headers:{}};r.length>0&&(G.params=v),Object.keys(R).length>0&&(G.query=R),Object.keys(u.fields).length>0&&(G.body=x);let H=await j(G);if(H.status>=200&&H.status<300){console.log(JSON.stringify(H.body,null,2));return}let V=H.body?.message??`${e.path.join(".")} returned ${H.status}`;throw new De(V)}}}m();var Uje=[{path:["getThread"],resource:"threads",op:"get"},{path:["listThreads"],resource:"threads",op:"list"},{path:["askThreads"],resource:"threads",op:"ask"},{path:["forkThread"],resource:"threads",op:"fork"},{path:["projects","listProjects"],resource:"projects",op:"list"}];function Qje(e=Uje){let t=new Map;for(let r of e){let o=Lje(r),i=t.get(r.resource)??new Map;if(i.has(r.op))throw new Error(`cliRoutes has duplicate "${r.resource} ${r.op}" \u2014 operations must be unique within a resource`);i.set(r.op,o),t.set(r.resource,i)}let n={};for(let[r,o]of t)n[r]={meta:{name:r,description:`Operations on ${r}.`},subCommands:Object.fromEntries(o)};return n}await Jle();m();Bn();m();on();Bn();Mo();Fa();Th();import{createHash as qZt}from"node:crypto";import R9 from"node:fs/promises";import CWe from"node:path";import{fileURLToPath as VZt}from"node:url";m();on();Jz();import HVt from"node:fs/promises";import{setTimeout as $Vt}from"node:timers/promises";m();sc();import{execFileSync as aKe}from"node:child_process";import{createHash as LVt}from"node:crypto";import{resolve as UVt}from"node:path";var b$={dev:"http://localhost:8080","dev-shared":"https://lore.dev.tanagram.ai",prod:"https://lore.link"};function C0(e={}){let t=e.currentEnvironment??to(),n=e.discoverLocalWebUrl??QVt,r=(e.target??process.env.LORE_TARGET)?.trim();if(r&&Object.prototype.hasOwnProperty.call(b$,r))return r==="dev"?n()??b$.dev:b$[r];if(t==="dev"){let o=n();if(o)return o}return b$[t]}function QVt(){if(process.env.LORE_DISABLE_PORTLESS_DISCOVERY!=="1"&&process.env.npm_lifecycle_event!=="test")try{return aKe("portless",["get",FVt()],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim().replace(/\/$/,"")}catch{return}}function FVt(){let e=GVt();return e?`${e}.lore`:"lore"}function GVt(){let e=sKe(process.env.LORE_DEV_STACK_NAME??"");if(e)return e;let t=jVt();return[sKe(t.split(/[\\/]/).pop()||"lore"),zVt(t)].filter(Boolean).join("-").slice(0,63)}function jVt(){try{return aKe("git",["rev-parse","--show-toplevel"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return UVt(process.cwd(),"../..")}}function zVt(e){return LVt("sha1").update(e).digest("hex").slice(0,8)}function sKe(e){return e.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,63)}var qVt=1e3,Xle=120*1e3,VVt=3e4,Wle=class extends Error{constructor(t,n){super(`${t} timed out after ${n}ms`),this.name="UploadNetworkTimeoutError"}},YVt=new Set(["billing_required","paywall","plan_required","upgrade_required"]),KVt=/\b(paywall|billing(?:\s+plan)?|upgrade\s+to)\b/i;function cKe(e){return tde(e)&&typeof e.message=="string"?e.message:""}function JVt(e){return tde(e)&&typeof e.code=="string"?e.code.trim().toLowerCase():""}function ZVt(e,t){if(e===402)return!0;let n=JVt(t);if(n&&YVt.has(n))return!0;if(e===403){let r=cKe(t);if(r&&KVt.test(r))return!0}return!1}function Np(e,t,n,r={}){if(ZVt(t,n)){let o=r.billingUrl??`${C0().replace(/\/+$/,"")}/billing`;return new $x({action:e,serverMessage:cKe(n),billingUrl:o})}return new Error(r7t(e,t,n))}async function lKe(e,t,n={}){let r=t.map(i=>({md5:i.md5,harness:i.harness,filename:i.filename,repo_origin_path:i.repoOriginPath||void 0,file_type:i.fileType,harness_internal_id:i.harnessInternalId,artifact_metadata:i.artifactMetadata})),o=await ede("create upload session",n.timeoutMs,async()=>e.createUploadSession({body:{thread_files:r}}));if(o.status!==201)throw Np("create upload session",o.status,o.body);return o.body}var VP=class extends Error{status;constructor(t,n){super(`upload transcript: unexpected status ${t}: ${n}`),this.name="UploadSessionFileError",this.status=t}};async function I$(e,t,n={}){let r=await HVt.readFile(t);await Pk(async()=>{let o=await ede("upload transcript",n.timeoutMs,async i=>fetch(e,{method:"PUT",body:r,headers:{"content-length":String(r.length)},signal:i}));if(!o.ok)throw await WVt(o)},{isRetryableError:o=>Mk(o)||Lk(o),describeRetryReason:o=>`network:${Uk(o)}`,logEvent:"upload_session_file_retry",sleep:n.sleep})}async function WVt(e){let t=await e.text(),n=(XVt(t)??t7t(t)??e.statusText.trim())||"empty response body";return new VP(e.status,n)}function XVt(e){let t=e.trim();if(!t.startsWith("<"))return null;let n=uKe(t,"Code");if(!n)return null;let r=uKe(t,"Message");return`S3 ${n}${r?`: ${r}`:""}`}function uKe(e,t){let r=e.match(new RegExp(`<${t}>([\\s\\S]*?)</${t}>`,"i"))?.[1]?.trim();return r?e7t(r):null}function e7t(e){return e.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&quot;",'"').replaceAll("&apos;","'").replaceAll("&amp;","&")}function t7t(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>500?`${t.slice(0,497)}...`:t:null}async function dKe(e,t,n,r={}){let o=n.map(i=>({storage_url:n7t(i)}));return Pk(async()=>{let i=await ede("complete upload session",r.timeoutMs,async()=>e.completeUploadSession({params:{id:t},body:{thread_files:o}}));if(i.status!==200)throw Np("complete upload session",i.status,i.body);return i.body},{isRetryableError:Lk,describeRetryReason:i=>`network:${Uk(i)}`,logEvent:"complete_upload_session_retry",sleep:r.sleep})}async function VD(e,t,n={}){let r=n.timeoutMs??Xle,o=n.pollIntervalMs??qVt,i=Date.now();for(;;){if(n.signal?.aborted)throw new DOMException("The operation was aborted","AbortError");n.onPoll&&await n.onPoll();let s=await e.getThread({params:{id:t}});if(s.status!==200)throw Np(`get thread ${t}`,s.status,s.body);let u=s.body.transcript_parsing_state;if(u==="parsed"||u==="too_large_to_parse")return;if(u==="failed")throw new Error(`thread ${t} parsing failed permanently`);if(u!=="pending"&&u!=="parsing")throw new Error(`unexpected transcript parsing state for thread ${t}: ${JSON.stringify(u)}`);let l=Date.now()-i;if(l>=r)throw new Error(`timed out waiting for thread ${t} parsing after ${r}ms`);await $Vt(Math.min(o,r-l),void 0,{signal:n.signal})}}function pKe(e,t){let n=new Map;for(let r of e){let o=r.md5.trim().toLowerCase();n.set(o,[...n.get(o)??[],r])}return t.map((r,o)=>{let i=r.expected_md5?.trim();if(!i)throw new Error(`upload session response missing expected_md5 for thread_files[${o}]`);let s=i.toLowerCase(),u=n.get(s);if(!u||u.length===0)throw new Error(`upload session response returned unexpected expected_md5 ${i}`);let[l,...f]=u;if(!l)throw new Error(`upload session response returned unexpected expected_md5 ${i}`);return f.length===0?n.delete(s):n.set(s,f),l})}function n7t(e){if(!e.storage_url.trim())throw new Error("upload session response missing storage_url");return e.storage_url}async function ede(e,t,n){let r=t??VVt,o=new AbortController,i,s=new Promise((u,l)=>{i=setTimeout(()=>{o.abort(),l(new Wle(e,r))},r),i.unref?.()});try{return await Promise.race([n(o.signal),s])}finally{i&&clearTimeout(i)}}function r7t(e,t,n){return tde(n)&&typeof n.message=="string"?`${e} failed: HTTP ${t}: ${n.message}`:`${e} failed: HTTP ${t}`}function tde(e){return e!==null&&typeof e=="object"}m();l$();Bn();Fa();import o7t from"node:fs/promises";function i7t(e){return[...new Set(e)].sort((t,n)=>t.localeCompare(n))}var fKe={harness:"claudeCode",async resolveCandidateDirectories(){let e=S0();$.info("skill_project_root_resolver_started",{harness:this.harness,history_path:e});let t;try{t=await o7t.readFile(e,"utf8")}catch(r){if(r.code==="ENOENT")return $.info("skill_project_root_resolver_missing_source",{harness:this.harness,history_path:e}),[];throw r}let n=i7t(zP(t,e).map(r=>ji(r.project)).filter(r=>r.length>0));return $.info("skill_project_root_resolver_directories_found",{harness:this.harness,directory_count:n.length}),n}};m();on();import AKe from"node:fs/promises";import u7t from"node:path";m();import s7t from"node:os";import a7t from"node:path";function nde(){return a7t.join(s7t.homedir(),"Library","Application Support","Claude","local-agent-mode-sessions")}Bn();Fa();function c7t(e){return[...new Set(e)].sort((t,n)=>t.localeCompare(n))}async function l7t(e=nde()){let t=[];async function n(r){let o;try{o=await AKe.readdir(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;throw i}for(let i of o){let s=u7t.join(r,i.name);i.isDirectory()?await n(s):i.isFile()&&i.name==="spaces.json"&&t.push(s)}}return await n(e),t.sort((r,o)=>r.localeCompare(o))}function mKe(e){return e!==null&&typeof e=="object"}function d7t(e){if(!Array.isArray(e.spaces))return[];let t=[];for(let n of e.spaces)if(!(!mKe(n)||!Array.isArray(n.folders)))for(let r of n.folders){if(!mKe(r)||typeof r.path!="string")continue;let o=ji(r.path);o.length>0&&t.push(o)}return t}var gKe={harness:"cowork",async resolveCandidateDirectories(){let e=nde();$.info("skill_project_root_resolver_started",{harness:this.harness,sessions_root:e});let t=await l7t(e);$.info("skill_project_root_resolver_spaces_files_found",{harness:this.harness,spaces_file_count:t.length});let n=[];for(let o of t){let i;try{i=JSON.parse(await AKe.readFile(o,"utf8"))}catch(u){$.warn("skill_project_root_resolver_spaces_file_skipped",{harness:this.harness,spaces_file:o,error:ln(u)});continue}let s=d7t(i);$.info("skill_project_root_resolver_spaces_file_read",{harness:this.harness,spaces_file:o,folder_count:s.length}),n.push(...s)}let r=c7t(n);return $.info("skill_project_root_resolver_directories_found",{harness:this.harness,directory_count:r.length}),r}};m();var aWe=ue(oWe(),1);import Dh from"node:fs/promises";import sWe from"node:os";import ii from"node:path";var CM="SKILL.md",uWe=()=>ii.join(sWe.homedir(),".claude","skills"),cWe=()=>ii.join(sWe.homedir(),".config","agents","skills"),T9=(e=process.cwd())=>ii.join(e,".claude","skills"),b9=(e=process.cwd())=>ii.join(e,".agents","skills"),QZt=(e,t=process.cwd())=>{switch(e){case"claude_global":return uWe();case"agents_global":return cWe();case"claude_project":return T9(t);case"agents_project":return b9(t)}},I9=(e,t=[],n={})=>{let r=n.includeCwdProject===!1?t:[e,...t];return[...[...new Set(r.map(i=>ii.resolve(i)))].flatMap(i=>[{kind:"claude_project",dir:T9(i)},{kind:"agents_project",dir:b9(i)}]),{kind:"claude_global",dir:uWe()},{kind:"agents_global",dir:cWe()}]},lWe=(e=process.cwd(),t=[])=>[...new Set(I9(e,t,{includeCwdProject:!1}).map(n=>n.dir))],FZt=/^[A-Za-z0-9_][A-Za-z0-9._:-]*$/,vM=e=>{if(typeof e!="string"||e.length===0||e.length>200||e==="."||e===".."||e.includes("/")||e.includes("\\")||/[\x00-\x1f]/.test(e)||!FZt.test(e))return!1;for(let t of e.split(":"))if(t===""||t==="."||t==="..")return!1;return!0},S9=(e,t)=>{let n=ii.resolve(e),r=ii.resolve(t),o=ii.relative(n,r);if(o===""||o.startsWith("..")||ii.isAbsolute(o))throw new Error(`refused to use a skill path outside ${n}: ${r}`);return r},GZt=(e,t)=>vM(e)?I9(t).map(n=>S9(n.dir,ii.join(n.dir,e,CM))):[],Lpe=async e=>{try{return await Dh.access(e),!0}catch{return!1}},dWe=async(e,t=process.cwd())=>{for(let n of GZt(e,t))if(await Lpe(n))return fWe(n,e,t);return null},pWe=async(e,t=process.cwd())=>{let n=ii.resolve(e),r=n;try{(await Dh.stat(n)).isDirectory()&&(r=ii.join(n,CM))}catch{return null}return ii.basename(r)!==CM||!await Lpe(r)?null:fWe(r,ii.basename(ii.dirname(r)),t)},fWe=async(e,t,n)=>{let r=await Dh.readFile(e,"utf8"),o=mWe(r);return{name:o.name??t,description:o.description??null,bodyMd:r,filePath:e,rootKind:jZt(e,n)}},jZt=(e,t)=>{for(let n of I9(t)){let r=ii.relative(ii.resolve(n.dir),ii.resolve(e));if(r!==""&&!r.startsWith("..")&&!ii.isAbsolute(r))return n.kind}return"claude_global"},zZt=/^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/,iWe=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},mWe=e=>{let t=zZt.exec(e);if(!t)return{name:null,description:null};let n=t[1];if(!n)return{name:null,description:null};let r;try{r=(0,aWe.parse)(n)}catch{return{name:null,description:null}}if(!r||typeof r!="object"||Array.isArray(r))return{name:null,description:null};let o=r;return{name:iWe(o.name),description:iWe(o.description)}};var RM=(e,t,n=process.cwd())=>{if(!vM(t))throw new Error(`refusing to install skill with invalid name: ${JSON.stringify(t)}`);let r=QZt(e,n),o=S9(r,ii.join(r,t));return S9(r,ii.join(o,CM))},HZt=async(e,t)=>{let n=`${e}.tmp.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}`;try{let r=await Dh.open(n,"w");try{await r.writeFile(t,"utf8"),await r.sync()}finally{await r.close()}await Dh.rename(n,e)}catch(r){throw await Dh.unlink(n).catch(()=>{}),r}},C9=async(e,t,n,r=process.cwd())=>{let o=RM(e,t,r),i=ii.dirname(o);return await Dh.mkdir(i,{recursive:!0}),await HZt(o,n),o};var Upe=async({cwd:e=process.cwd(),projectCwds:t=[],includeCwdProject:n=!0}={})=>{let r=new Set,o=[];for(let i of I9(e,t,{includeCwdProject:n}))try{let s=await Dh.readdir(i.dir,{withFileTypes:!0});for(let u of s){if(!u.isDirectory()||!vM(u.name))continue;let l=S9(i.dir,ii.join(i.dir,u.name,CM)),f=`${i.kind}:${l}`;if(r.has(f)||!await Lpe(l))continue;r.add(f);let h=await Dh.readFile(l,"utf8"),_=mWe(h);o.push({name:_.name??u.name,description:_.description??null,bodyMd:h,filePath:l,rootKind:i.kind})}}catch{}return o.sort((i,s)=>i.rootKind.localeCompare(s.rootKind)||i.name.localeCompare(s.name)||i.filePath.localeCompare(s.filePath))};m();Mo();import PA from"node:fs/promises";import bb from"node:path";var AWe=()=>({version:2,lastEventId:null,installed:{},captured:{},published:{}});async function Ha(){try{let e=JSON.parse(await PA.readFile(UT(),"utf8"));return gWe(e)}catch{return AWe()}}function gWe(e){let t=AWe();return t.lastEventId=typeof e.lastEventId=="string"?e.lastEventId:null,t.installed=Qpe(e.installed,(n,r)=>n.skillId===r),t.captured=Qpe(e.captured,(n,r)=>n.skillId===r),t.published=Qpe(e.published,()=>!0),t}function Qpe(e,t){let n={};if(!e)return n;for(let[r,o]of Object.entries(e))r.startsWith("sk_")&&t(o,r)&&(n[r]=o);return n}async function v9(e){await _We(async()=>{let t=gWe(e);t.lastEventId=EWe(t.lastEventId,await $Zt()),await hWe(t)})}async function hWe(e){let t=UT(),n=bb.dirname(t);await PA.mkdir(n,{recursive:!0,mode:448}),await PA.chmod(n,448),await PA.writeFile(t,`${JSON.stringify(e,null,2)}
670
670
  `,{mode:384}),await PA.chmod(t,384)}async function _We(e){let t=`${UT()}.lock`;await PA.mkdir(bb.dirname(t),{recursive:!0,mode:448}),await PA.chmod(bb.dirname(t),448);for(let n=0;;n+=1)try{await PA.mkdir(t,{mode:448});break}catch(r){if(r.code!=="EEXIST"||n>=50)throw r;await new Promise(o=>setTimeout(o,10))}try{return await e()}finally{await PA.rm(t,{recursive:!0,force:!0})}}async function $Zt(){try{let e=JSON.parse(await PA.readFile(UT(),"utf8"));return typeof e.lastEventId=="string"?e.lastEventId:null}catch{return null}}function EWe(e,t){if(!e)return t;if(!t)return e;try{return BigInt(t)>BigInt(e)?t:e}catch{return e}}function yWe(e,t){let n=bb.resolve(t.filePath);return Object.values(e.captured).find(r=>r.rootKind===t.rootKind&&bb.resolve(r.filePath)===n)??null}function SWe(e,t){for(let[n,r]of Object.entries(e.captured))n!==t.skillId&&r.rootKind===t.rootKind&&bb.resolve(r.filePath)===bb.resolve(t.filePath)&&delete e.captured[n];e.captured[t.skillId]=t}async function Fpe(e){await _We(async()=>{let t=await Ha();t.lastEventId=EWe(e,t.lastEventId),await hWe(t)})}async function cl(e){let t=await Ha();t.installed[e.skillId]=e,await v9(t)}async function TWe(e){let t=await Ha(),n=t.installed[e]??null;return delete t.installed[e],await v9(t),n}async function i1(e){return(await Ha()).installed[e]??null}async function bWe(){let e=await Ha();return Object.values(e.installed)}var Vf=e=>`md5:${vWe(e)}`;var vWe=e=>qZt("md5").update(e,"utf8").digest("hex");async function YZt(e,t,n){if(e?.trim()){await I$(e,n);return}if(!t.startsWith("file:"))throw new Error("upload session response missing presigned_url");let r=VZt(t);await R9.mkdir(CWe.dirname(r),{recursive:!0,mode:448}),await R9.copyFile(n,r)}async function s1(e,t,n){let r=t.rootKind,o=Buffer.byteLength(t.bodyMd,"utf8"),i,s="create_session",u={md5:vWe(t.bodyMd),name:t.name,filename:`${t.name}/SKILL.md`,description:t.description,root_kind:r,...n.baseVersion?{base_version:n.baseVersion}:{}},l=t.skillId?.trim(),f=(()=>{if(n.syncAction==="capture")return l?{...u,skill_id:l,sync_action:"capture_update"}:{...u,sync_action:"capture"};if(!l)throw new Error(`${n.syncAction} requires an existing skill ID`);return n.syncAction==="capture_update"?{...u,skill_id:l,sync_action:"capture_update"}:n.syncAction==="owner_update"?{...u,skill_id:l,sync_action:"owner_update"}:{...u,skill_id:l,sync_action:"subscriber_update"}})();$.info("skill_upload_session_create_started",{name:t.name,file_path:t.filePath,skill_id:l,skill_id_present:!!l,root_kind:r,sync_action:f.sync_action,requested_sync_action:n.syncAction,base_version:n.baseVersion,base_version_present:n.baseVersion!==void 0,body_size_bytes:o});try{let h=await e.createUploadSession({body:{skill_files:[f]}});if(h.status!==201)throw Np("create skill upload session",h.status,h.body);i=h.body.id;let _=h.body.skill_files?.[0];if(!_)throw new Error("create upload session returned no skill_files");if(!_.storage_url?.trim())throw new Error(`upload ${t.name} skipped: upload session response missing storage_url`);if($.info("skill_upload_session_created",{upload_session_id:i,skill_file_count:h.body.skill_files?.length??0,has_presigned_url:!!_.presigned_url?.trim(),storage_scheme:IWe(_.storage_url)}),!_.presigned_url?.trim()&&!_.storage_url.startsWith("file:")){let R=_.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${t.name} skipped: ${R}`)}s="upload_file",await YZt(_.presigned_url,_.storage_url,t.filePath),$.info("skill_upload_file_uploaded",{upload_session_id:i,storage_scheme:IWe(_.storage_url),body_size_bytes:o}),s="complete_session";let y=await e.completeUploadSession({params:{id:h.body.id},body:{skill_files:[{storage_url:_.storage_url}]}});if(y.status!==200)throw Np("complete skill upload session",y.status,y.body);let T=y.body.skill_files?.[0]?.skill;if(!T)throw new Error("complete upload session returned no skill result");let v={skill_id:T.id,version:T.version??T.latest_version,latest_version:T.latest_version,visibility:T.visibility,root_kind:T.root_kind,content_hash:T.content_hash,version_status:T.version_status??"accepted"};return $.info("skill_upload_session_completed",{upload_session_id:i,skill_id:v.skill_id,version:v.version,latest_version:v.latest_version,visibility:v.visibility,root_kind:v.root_kind,version_status:v.version_status}),v}catch(h){throw $.warn("skill_upload_failed",{phase:s,name:t.name,file_path:t.filePath,sync_action:f.sync_action,requested_sync_action:n.syncAction,skill_id:l,skill_id_present:!!l,root_kind:r,upload_session_id:i,error:ln(h)}),h}}function IWe(e){let t=e.indexOf(":");return t>0?e.slice(0,t):"unknown"}var zpe=Ha,RWe=v9,xWe=async()=>{try{await R9.unlink(UT())}catch{}};async function DWe(e){let t=await zpe();return yWe(t,{filePath:e.filePath,rootKind:e.rootKind})?.skillId??null}async function a1(e,t){let n=await zpe(),r=e.rootKind,o=Vf(e.bodyMd);e.filePath&&SWe(n,{skillId:t.skillId,name:e.name,rootKind:r,filePath:e.filePath,lastPushedHash:o,lastPushedVersion:t.version}),n.published[t.skillId]={lastPublishedHash:o,lastPublishedVersion:t.version},await RWe(n)}function Gpe(e){return[...new Set(e)].sort((t,n)=>t.localeCompare(n))}function jpe(e,t){return e.length>0&&t.some(n=>e===n||e.startsWith(`${n}${CWe.sep}`))}var KZt=[fKe,gKe];async function JZt(){return(await Promise.all(KZt.map(async t=>(await t.resolveCandidateDirectories()).map(r=>({harness:t.harness,directory:r}))))).flat()}async function ZZt(e,t){if(t.include.repo.length===0||e.length===0)return[];let n=new Map;for(let r of e){let o=ji(r.directory);if(!o)continue;let i=await y0(o),s=i?await PD(o):null,u=i.length>0&&s!==null&&t.include.repo.includes(i)&&!t.exclude.repo.includes(i)&&!jpe(o,t.exclude.cwd)&&!jpe(s,t.exclude.cwd);if($.info("skill_project_root_candidate_evaluated",{harness:r.harness,directory:o,repo_origin_path:i||"<none>",git_root:s??"<none>",accepted:u,reason:u?"matched_repo_filter":i.length===0?"no_repo_origin":s===null?"no_git_root":t.include.repo.includes(i)?t.exclude.repo.includes(i)?"repo_in_exclude_filter":"cwd_in_exclude_filter":"repo_not_in_include_filter"}),u){let l=n.get(i)??new Set;l.add(o),n.set(i,l)}}return Array.from(n.entries()).flatMap(([r,o])=>{let i=Gpe(Array.from(o)),[s,...u]=i;return s?($.info("skill_project_root_repo_deduped",{repo_origin_path:r,selected_root:s,also_seen_at_count:u.length}),[{root:s,alsoSeenAt:u}]):[]}).sort((r,o)=>r.root.localeCompare(o.root))}async function NWe(){let e=await Ho(),t=e.include.cwd.map(ji).filter(i=>i.length>0&&!jpe(i,e.exclude.cwd)).map(i=>({root:i,alsoSeenAt:[]}));$.info("skill_project_root_cwd_filters_resolved",{include_cwd_count:e.include.cwd.length,resolved_cwd_root_count:t.length});let n=await JZt(),r=await ZZt(n,e);$.info("skill_project_root_repo_filters_resolved",{include_repo_count:e.include.repo.length,candidate_directory_count:n.length,resolved_repo_root_count:r.length});let o=await WZt([...t,...r]);return $.info("skill_project_roots_resolved",{root_count:o.length}),o}async function WZt(e){let t=new Map,n=new Map;for(let r of e){let o=await y0(r.root),i=o?t.get(o)??new Set:n.get(r.root)??new Set;i.add(r.root);for(let s of r.alsoSeenAt)i.add(s);o?t.set(o,i):n.set(r.root,i)}return[...Array.from(t.entries()).flatMap(([r,o])=>{let i=Gpe(Array.from(o)),[s,...u]=i;return s?($.info("skill_project_root_repo_origin_deduped",{repo_origin_path:r,selected_root:s,also_seen_at_count:u.length}),[{root:s,alsoSeenAt:u}]):[]}),...Array.from(n.entries()).flatMap(([,r])=>{let o=Gpe(Array.from(r)),[i,...s]=o;return i?[{root:i,alsoSeenAt:s}]:[]})].sort((r,o)=>r.root.localeCompare(o.root))}async function BWe(e){let t={pushed:[],unchanged:[],skipped:[]},n=await zpe(),r,o=!1;for(let[i,s]of Object.entries(n.published)){let u=n.captured[i];if(!u){t.skipped.push({name:i,reason:"no local file recorded for published skill"});continue}let l;try{l=await R9.readFile(u.filePath,"utf8")}catch(T){t.skipped.push({name:u.name,reason:`could not read local skill file: ${ln(T)}`});continue}let f=Vf(l);if(f===s.lastPublishedHash){t.unchanged.push(u.name);continue}let h=await e.getSkillDetail({params:{id:i}});if(h.status!==200){t.skipped.push({name:u.name,reason:`getSkillDetail returned ${h.status}`});continue}let _=h.body.latest_version??s.lastPublishedVersion,y=h.body.content_hash??"";if(r??=await XZt(e),!h.body.owner?.id||h.body.owner.id!==r){t.skipped.push({name:u.name,reason:"published skill is not owned by the current user"});continue}if(f===y){n.published[i]={lastPublishedHash:f,lastPublishedVersion:_},n.captured[i]={...u,lastPushedHash:f,lastPushedVersion:_},o=!0,t.unchanged.push(u.name);continue}if(s.lastPublishedVersion>0&&_>s.lastPublishedVersion){t.skipped.push({name:u.name,reason:`remote newer: local base is v${s.lastPublishedVersion}, remote is v${_}`});continue}try{let T=await s1(e,{skillId:i,name:u.name,description:null,bodyMd:l,filePath:u.filePath,rootKind:u.rootKind},{syncAction:"owner_update",...s.lastPublishedVersion>0?{baseVersion:s.lastPublishedVersion}:{}});if(T.version_status!=="accepted"){t.skipped.push({name:u.name,reason:`uploaded version was ${T.version_status}`});continue}t.pushed.push(u.name),n.published[i]={lastPublishedHash:T.content_hash,lastPublishedVersion:T.version},n.captured[i]={...u,lastPushedHash:T.content_hash,lastPushedVersion:T.version},o=!0,$.info("skill_published_local_update_uploaded",{skill_id:i,name:u.name,file_path:u.filePath,root_kind:u.rootKind,version:T.version})}catch(T){let v=ln(T);$.warn("skill_published_local_update_failed",{skill_id:i,name:u.name,file_path:u.filePath,root_kind:u.rootKind,error:v}),t.skipped.push({name:u.name,reason:v})}}if(o)try{await RWe(n)}catch(i){$.info("skill_sync_state_write_failed",{error:ln(i)})}return t}async function XZt(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}i0();var wWe={meta:{name:"logout",description:"Log out of your Lore workspace",skipAutoupdate:!0},async run(){$.info("command_start",{command:"logout"});let e=_je();if(dh(),Sje(),pje(),Aje(),await xWe(),!e){console.log(`
671
671
  Not currently logged in.
672
672
  `);return}console.log(`
673
673
  Logged out the Lore CLI.`),console.log(` The Lore plugin remains signed in; run the plugin's lore_logout to sign it out.
674
- `)}};m();jz();Pr();sc();on();Bn();Mo();i0();function eWt(e){return e==="dev"?"pnpm dev whoami":"lore whoami"}async function OWe(e){try{return await e.text()}catch(t){return`Could not read response body: ${t instanceof Error?t.message:String(t)}`}}function kWe(e,t,n){console.error(`${e}: HTTP ${t.status}`),console.error("Response:"),console.error(n.trim()||"(empty response)")}function PWe(e,t){try{return JSON.parse(e)}catch(n){console.error(`${t} returned invalid JSON.`),console.error("Response:"),console.error(e.trim()||"(empty response)"),console.error(n instanceof Error?n.message:String(n));return}}function tWt(e){return typeof e=="object"&&e!==null&&"workos_client_id"in e&&typeof e.workos_client_id=="string"&&e.workos_client_id.trim().length>0&&"workos_api_origin"in e&&typeof e.workos_api_origin=="string"&&e.workos_api_origin.trim().length>0}var MWe={meta:{name:"_refresh_auth_token",description:"Force-refresh the stored CLI auth token",hidden:!0,skipAutoupdate:!0},async run({data:e}){$.info("command_start",{command:"_refresh_auth_token"});let t=e,n=t?.fetch??globalThis.fetch,r=t?.getApiBaseUrl??cd,o=t?.getCurrentEnvironment??to,i=t?.getRefreshToken??hje,s=t?.getStateDir??Er,u=t?.setRefreshedTokens??Kz;await(t?.withTokenRefreshLock??Bk)(s(),async()=>{let f=i();f||(console.error(`No stored refresh token found. Run '${qx()}' first.`),ud());let h=await n(`${r()}/api/cli-auth/config`),_=await OWe(h);h.ok||(kWe("CLI auth config request failed",h,_),ud());let y=PWe(_,"CLI auth config request");y||ud(),tWt(y)||(console.error("CLI auth config request returned an invalid response."),console.error("Response:"),console.error(_.trim()||"(empty response)"),ud());let T=new URL("/user_management/authenticate",y.workos_api_origin).toString(),v=await n(T,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:f,client_id:y.workos_client_id})}),R=await OWe(v);v.ok||(kWe("Token refresh failed",v,R),ud());let x=PWe(R,"Token refresh request");x||ud(),(typeof x.access_token!="string"||!x.access_token.trim())&&(console.error("Token refresh succeeded with HTTP 200 but did not return an access_token."),console.error("Response:"),console.error(R.trim()||"(empty response)"),ud()),u(x.access_token,typeof x.refresh_token=="string"&&x.refresh_token.trim()?x.refresh_token:f),console.log("Token refresh succeeded."),console.log(`Run \`${eWt(o())}\` to verify.`)})}};m();Pr();on();Bn();i0();var LWe={meta:{name:"whoami",description:"Print the authenticated Lore user",hidden:!0},async run({data:e}){$.info("command_start",{command:"whoami"});let t=e,n=t?.createClient??Gt,r=t?.getAccessToken??sn,o=t?.decodeJwtClaims??kk,i=await r();if(!i){console.error(`Not authenticated. Run '${qx()}' first.`);return}try{o(i)}catch(l){throw console.error(`Stored CLI token is not a valid JWT. Run '${qx()}' again.`),new Error("whoami failed: invalid JWT",{cause:l})}let u=await n({token:i}).whoAmI({headers:{}});if(u.status===401){console.error(`Not authenticated. Run '${qx()}' first.`);return}if(u.status!==200)throw new Error(`whoami failed: HTTP ${u.status}`);console.log(JSON.stringify(u.body,null,2))}};m();Pr();on();Bn();var Hpe=["general","bug","feature_request","question"];function nWt(e){return Hpe.includes(e)}async function rWt(){if(process.stdin.isTTY)return"";let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e).toString("utf8")}var UWe={meta:{name:"feedback",description:"Send feedback to the Lore team. Reads <message> as a positional arg or from stdin. Bug-type submissions auto-file a Linear ticket."},args:{message:{type:"positional",required:!1,description:"Feedback body. If omitted, read from stdin."},type:{type:"string",description:`Feedback type. One of: ${Hpe.join(", ")}. Defaults to "general".`,default:"general"}},async run({args:e,data:t}){$.info("command_start",{command:"feedback"});let n=String(e.type??"general");if(!nWt(n))throw new Ne(`Unknown feedback type "${n}". Must be one of: ${Hpe.join(", ")}.`);let r=n,s=((typeof e.message=="string"&&e.message.length>0?e.message:"")||await rWt()).trim();if(s.length===0)throw new Ne("Feedback message is required. Pass it as a positional argument or pipe it on stdin.");let l=await(t?.client??Gt()).createFeedback({body:{type:r,message:s}});if(l.status===201){let f=r==="bug"?"Bug report":"Feedback";console.log(r==="bug"?`${f} sent. A Linear ticket will be filed and linked in #lore-feedback.`:`${f} sent.`);return}if(l.status===401)throw new Ne("Not signed in. Run `lore login` first.");if(l.status===429){let f=l.body&&typeof l.body.message=="string"?l.body.message:"Rate limit reached. Try again later.";throw new Ne(f)}throw $.error("feedback_failed",{status:l.status}),new Ne(`Could not send feedback: HTTP ${l.status}`)}};m();Pr();Bn();var QWe={meta:{name:"health",description:"Check API health"},async run({data:e}){$.info("command_start",{command:"health"});let n=await(e?.client??Gt()).health();if(n.status===200){console.log(n.body.status);return}throw $.error("health_failed",{status:n.status}),console.error(`health check failed: HTTP ${n.status}`),new Error(`health check failed: HTTP ${n.status}`)}};m();import oWt from"node:fs/promises";Mo();var FWe=100;async function iWt(e=_p(),t=FWe){let n;try{n=await oWt.readFile(e,"utf8")}catch(s){if(s.code==="ENOENT")return"";throw s}if(t<=0)return"";let r=n.split(`
674
+ `)}};m();jz();Pr();sc();on();Bn();Mo();i0();function eWt(e){return e==="dev"?"pnpm dev whoami":"lore whoami"}async function OWe(e){try{return await e.text()}catch(t){return`Could not read response body: ${t instanceof Error?t.message:String(t)}`}}function kWe(e,t,n){console.error(`${e}: HTTP ${t.status}`),console.error("Response:"),console.error(n.trim()||"(empty response)")}function PWe(e,t){try{return JSON.parse(e)}catch(n){console.error(`${t} returned invalid JSON.`),console.error("Response:"),console.error(e.trim()||"(empty response)"),console.error(n instanceof Error?n.message:String(n));return}}function tWt(e){return typeof e=="object"&&e!==null&&"workos_client_id"in e&&typeof e.workos_client_id=="string"&&e.workos_client_id.trim().length>0&&"workos_api_origin"in e&&typeof e.workos_api_origin=="string"&&e.workos_api_origin.trim().length>0}var MWe={meta:{name:"_refresh_auth_token",description:"Force-refresh the stored CLI auth token",hidden:!0,skipAutoupdate:!0},async run({data:e}){$.info("command_start",{command:"_refresh_auth_token"});let t=e,n=t?.fetch??globalThis.fetch,r=t?.getApiBaseUrl??cd,o=t?.getCurrentEnvironment??to,i=t?.getRefreshToken??hje,s=t?.getStateDir??Er,u=t?.setRefreshedTokens??Kz;await(t?.withTokenRefreshLock??Bk)(s(),async()=>{let f=i();f||(console.error(`No stored refresh token found. Run '${qx()}' first.`),ud());let h=await n(`${r()}/api/cli-auth/config`),_=await OWe(h);h.ok||(kWe("CLI auth config request failed",h,_),ud());let y=PWe(_,"CLI auth config request");y||ud(),tWt(y)||(console.error("CLI auth config request returned an invalid response."),console.error("Response:"),console.error(_.trim()||"(empty response)"),ud());let T=new URL("/user_management/authenticate",y.workos_api_origin).toString(),v=await n(T,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:f,client_id:y.workos_client_id})}),R=await OWe(v);v.ok||(kWe("Token refresh failed",v,R),ud());let x=PWe(R,"Token refresh request");x||ud(),(typeof x.access_token!="string"||!x.access_token.trim())&&(console.error("Token refresh succeeded with HTTP 200 but did not return an access_token."),console.error("Response:"),console.error(R.trim()||"(empty response)"),ud()),u(x.access_token,typeof x.refresh_token=="string"&&x.refresh_token.trim()?x.refresh_token:f),console.log("Token refresh succeeded."),console.log(`Run \`${eWt(o())}\` to verify.`)})}};m();Pr();on();Bn();i0();var LWe={meta:{name:"whoami",description:"Print the authenticated Lore user",hidden:!0},async run({data:e}){$.info("command_start",{command:"whoami"});let t=e,n=t?.createClient??Gt,r=t?.getAccessToken??sn,o=t?.decodeJwtClaims??kk,i=await r();if(!i){console.error(`Not authenticated. Run '${qx()}' first.`);return}try{o(i)}catch(l){throw console.error(`Stored CLI token is not a valid JWT. Run '${qx()}' again.`),new Error("whoami failed: invalid JWT",{cause:l})}let u=await n({token:i}).whoAmI({headers:{}});if(u.status===401){console.error(`Not authenticated. Run '${qx()}' first.`);return}if(u.status!==200)throw new Error(`whoami failed: HTTP ${u.status}`);console.log(JSON.stringify(u.body,null,2))}};m();Pr();on();Bn();var Hpe=["general","bug","feature_request","question"];function nWt(e){return Hpe.includes(e)}async function rWt(){if(process.stdin.isTTY)return"";let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e).toString("utf8")}var UWe={meta:{name:"feedback",description:"Send feedback to the Lore team. Reads <message> as a positional arg or from stdin. Bug-type submissions auto-file a Linear ticket."},args:{message:{type:"positional",required:!1,description:"Feedback body. If omitted, read from stdin."},type:{type:"string",description:`Feedback type. One of: ${Hpe.join(", ")}. Defaults to "general".`,default:"general"}},async run({args:e,data:t}){$.info("command_start",{command:"feedback"});let n=String(e.type??"general");if(!nWt(n))throw new De(`Unknown feedback type "${n}". Must be one of: ${Hpe.join(", ")}.`);let r=n,s=((typeof e.message=="string"&&e.message.length>0?e.message:"")||await rWt()).trim();if(s.length===0)throw new De("Feedback message is required. Pass it as a positional argument or pipe it on stdin.");let l=await(t?.client??Gt()).createFeedback({body:{type:r,message:s}});if(l.status===201){let f=r==="bug"?"Bug report":"Feedback";console.log(r==="bug"?`${f} sent. A Linear ticket will be filed and linked in #lore-feedback.`:`${f} sent.`);return}if(l.status===401)throw new De("Not signed in. Run `lore login` first.");if(l.status===429){let f=l.body&&typeof l.body.message=="string"?l.body.message:"Rate limit reached. Try again later.";throw new De(f)}throw $.error("feedback_failed",{status:l.status}),new De(`Could not send feedback: HTTP ${l.status}`)}};m();Pr();Bn();var QWe={meta:{name:"health",description:"Check API health"},async run({data:e}){$.info("command_start",{command:"health"});let n=await(e?.client??Gt()).health();if(n.status===200){console.log(n.body.status);return}throw $.error("health_failed",{status:n.status}),console.error(`health check failed: HTTP ${n.status}`),new Error(`health check failed: HTTP ${n.status}`)}};m();import oWt from"node:fs/promises";Mo();var FWe=100;async function iWt(e=_p(),t=FWe){let n;try{n=await oWt.readFile(e,"utf8")}catch(s){if(s.code==="ENOENT")return"";throw s}if(t<=0)return"";let r=n.split(`
675
675
  `);r.at(-1)===""&&r.pop();let i=r.slice(-t).join(`
676
676
  `);return i?`${i}
677
677
  `:""}var GWe={meta:{name:"logs",description:"Print recent log entries"},args:{lines:{type:"string",alias:"n",description:"Number of log entries to print",default:String(FWe)}},async run({args:e}){let t=Number.parseInt(e.lines,10);if(!Number.isFinite(t)||t<0)throw new Error("--lines must be a non-negative integer");let n=await iWt(_p(),t);n&&console.log(n.trimEnd())}};m();HD();var jWe={meta:{name:"postinstall:refresh-background-binary",hidden:!0,skipAutoupdate:!0},async run(){let e;try{e=await AYe()}catch(t){console.error(`background binary refresh failed: ${t instanceof Error?t.message:String(t)}`);return}if(!e.refreshed){console.log(`background binary refresh skipped: ${e.reason}`);return}console.log(`refreshed background binary at ${e.binaryPath}`)}};m();Pr();on();m();Mo();import M0 from"node:fs/promises";import $pe from"node:path";var sWt=14,aWt=1440*60*1e3;function qpe(e){return $pe.join(Fx(),`${e}.meta.json`)}function zWe(e){return $pe.join(Fx(),`${e}.jsonl`)}async function HWe(e){let t=Fx();await M0.mkdir(t,{recursive:!0,mode:448});let n=await uWt(e.id),r=n?.quarantinedAt??e.now.toISOString(),o=n?.expiresAt??new Date(e.now.getTime()+sWt*aWt).toISOString(),i={id:e.id,sourcePath:e.sourcePath,harness:e.harness,harnessInternalId:e.harnessInternalId,filename:e.filename,findings:e.findings.map(u=>({ruleId:u.ruleId,disposition:u.disposition,location:u.location})),quarantinedAt:r,expiresAt:o},s=await M0.readFile(e.tempPath);return await M0.writeFile(zWe(e.id),s,{mode:384}),await M0.writeFile(qpe(e.id),`${JSON.stringify(i,null,2)}
@@ -680,25 +680,25 @@ ${O.join(`
680
680
  `);n&&r.pop();let o=new Map;for(let i of t)o.set(i.location.line,[...o.get(i.location.line)??[],i]);for(let[i,s]of o){let u=r[i];if(u===void 0)return{ok:!1,reason:"unredactable"};let l;try{l=JSON.parse(u)}catch{return{ok:!1,reason:"unredactable"}}let f=new Map;for(let h of s)f.set(h.location.jsonPointer,[...f.get(h.location.jsonPointer)??[],h]);for(let[h,_]of f){let y=dWt(l,h);if(typeof y!="string")return{ok:!1,reason:"unredactable"};for(let x of _)if(x.start<0||x.end>y.length||x.end<=x.start)return{ok:!1,reason:"unredactable"};let T=[..._].sort((x,O)=>x.start-O.start||x.end-O.end),v=[];for(let x of T){let O=v[v.length-1];O&&x.start<=O.end?(O.end=Math.max(O.end,x.end),O.ruleIds.add(x.ruleId)):v.push({start:x.start,end:x.end,ruleIds:new Set([x.ruleId])})}let R=y;for(let x=v.length-1;x>=0;x-=1){let O=v[x],P=[...O.ruleIds].sort().join("+");R=R.slice(0,O.start)+cWt(P)+R.slice(O.end)}h===""?l=R:pWt(l,h,R)}r[i]=JSON.stringify(l)}return{ok:!0,text:r.join(`
681
681
  `)+(n?`
682
682
  `:"")}}m();m();m();var Vpe={schemaVersion:1,source:{tool:"gitleaks",ref:"v8.18.4",generatedFrom:"vendor/gitleaks/gitleaks.toml"},rules:[{id:"adafruit-api-key",description:"Identified a potential Adafruit API Key, which could lead to unauthorized access to Adafruit services and sensitive data exposure.",regex:`(?:adafruit)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9_-]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["adafruit"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"adobe-client-id",description:"Detected a pattern that resembles an Adobe OAuth Web Client ID, posing a risk of compromised Adobe integrations and data breaches.",regex:`(?:adobe)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["adobe"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"adobe-client-secret",description:"Discovered a potential Adobe Client Secret, which, if exposed, could allow unauthorized Adobe service access and data manipulation.",regex:`\\b((p8e-)[a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["p8e-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"age-secret-key",description:"Discovered a potential Age encryption tool secret key, risking data decryption and unauthorized access to sensitive information.",regex:"AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}",keywords:["age-secret-key-1"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"airtable-api-key",description:"Uncovered a possible Airtable API Key, potentially compromising database access and leading to data leakage or alteration.",regex:`(?:airtable)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{17})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["airtable"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"algolia-api-key",description:"Identified an Algolia API Key, which could result in unauthorized search operations and data exposure on Algolia-managed platforms.",regex:`(?:algolia)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["algolia"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"alibaba-access-key-id",description:"Detected an Alibaba Cloud AccessKey ID, posing a risk of unauthorized cloud resource access and potential data compromise.",regex:`\\b((LTAI)[a-z0-9]{20})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["ltai"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"alibaba-secret-key",description:"Discovered a potential Alibaba Cloud Secret Key, potentially allowing unauthorized operations and data access within Alibaba Cloud.",regex:`(?:alibaba)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{30})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["alibaba"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"asana-client-id",description:"Discovered a potential Asana Client ID, risking unauthorized access to Asana projects and sensitive task information.",regex:`(?:asana)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9]{16})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["asana"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"asana-client-secret",description:"Identified an Asana Client Secret, which could lead to compromised project management integrity and unauthorized access.",regex:`(?:asana)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["asana"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"atlassian-api-token",description:"Detected an Atlassian API token, posing a threat to project management and collaboration tool security and data confidentiality.",regex:`(?:atlassian|confluence|jira)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{24})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["atlassian","confluence","jira"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"authress-service-client-access-key",description:"Uncovered a possible Authress Service Client Access Key, which may compromise access control services and sensitive data.",regex:`\\b((?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.acc[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30,120})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sc_","ext_","scauth_","authress_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"aws-access-token",description:"Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",regex:"(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16}",keywords:["akia","asia","abia","acca"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"beamer-api-token",description:"Detected a Beamer API token, potentially compromising content management and exposing sensitive notifications and updates.",regex:`(?:beamer)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(b_[a-z0-9=_\\-]{44})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["beamer"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"bitbucket-client-id",description:"Discovered a potential Bitbucket Client ID, risking unauthorized repository access and potential codebase exposure.",regex:`(?:bitbucket)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["bitbucket"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"bitbucket-client-secret",description:"Discovered a potential Bitbucket Client Secret, posing a risk of compromised code repositories and unauthorized access.",regex:`(?:bitbucket)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["bitbucket"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"bittrex-access-key",description:"Identified a Bittrex Access Key, which could lead to unauthorized access to cryptocurrency trading accounts and financial loss.",regex:`(?:bittrex)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["bittrex"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"bittrex-secret-key",description:"Detected a Bittrex Secret Key, potentially compromising cryptocurrency transactions and financial security.",regex:`(?:bittrex)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["bittrex"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"clojars-api-token",description:"Uncovered a possible Clojars API token, risking unauthorized access to Clojure libraries and potential code manipulation.",regex:"(CLOJARS_)[a-z0-9]{60}",flags:"i",keywords:["clojars"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"cloudflare-api-key",description:"Detected a Cloudflare API Key, potentially compromising cloud application deployments and operational security.",regex:`(?:cloudflare)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9_-]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["cloudflare"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"cloudflare-global-api-key",description:"Detected a Cloudflare Global API Key, potentially compromising cloud application deployments and operational security.",regex:`(?:cloudflare)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{37})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["cloudflare"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"cloudflare-origin-ca-key",description:"Detected a Cloudflare Origin CA Key, potentially compromising cloud application deployments and operational security.",regex:`\\b(v1\\.0-[a-f0-9]{24}-[a-f0-9]{146})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,keywords:["cloudflare","v1.0-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"codecov-access-token",description:"Found a pattern resembling a Codecov Access Token, posing a risk of unauthorized access to code coverage reports and sensitive data.",regex:`(?:codecov)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["codecov"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"coinbase-access-token",description:"Detected a Coinbase Access Token, posing a risk of unauthorized access to cryptocurrency accounts and financial transactions.",regex:`(?:coinbase)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9_-]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["coinbase"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"confluent-access-token",description:"Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",regex:`(?:confluent)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{16})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["confluent"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"confluent-secret-key",description:"Found a Confluent Secret Key, potentially risking unauthorized operations and data access within Confluent services.",regex:`(?:confluent)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["confluent"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"contentful-delivery-api-token",description:"Discovered a Contentful delivery API token, posing a risk to content management systems and data integrity.",regex:`(?:contentful)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{43})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["contentful"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"databricks-api-token",description:"Uncovered a Databricks API token, which may compromise big data analytics platforms and sensitive data processing.",regex:`\\b(dapi[a-h0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["dapi"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"datadog-access-token",description:"Detected a Datadog Access Token, potentially risking monitoring and analytics data exposure and manipulation.",regex:`(?:datadog)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["datadog"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"defined-networking-api-token",description:"Identified a Defined Networking API token, which could lead to unauthorized network operations and data breaches.",regex:`(?:dnkey)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(dnkey-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["dnkey"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"digitalocean-access-token",description:"Found a DigitalOcean OAuth Access Token, risking unauthorized cloud resource access and data compromise.",regex:`\\b(doo_v1_[a-f0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["doo_v1_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"digitalocean-pat",description:"Discovered a DigitalOcean Personal Access Token, posing a threat to cloud infrastructure security and data privacy.",regex:`\\b(dop_v1_[a-f0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["dop_v1_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"digitalocean-refresh-token",description:"Uncovered a DigitalOcean OAuth Refresh Token, which could allow prolonged unauthorized access and resource manipulation.",regex:`\\b(dor_v1_[a-f0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["dor_v1_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"discord-api-token",description:"Detected a Discord API key, potentially compromising communication channels and user data privacy on Discord.",regex:`(?:discord)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["discord"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"discord-client-id",description:"Identified a Discord client ID, which may lead to unauthorized integrations and data exposure in Discord applications.",regex:`(?:discord)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9]{18})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["discord"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"discord-client-secret",description:"Discovered a potential Discord client secret, risking compromised Discord bot integrations and data leaks.",regex:`(?:discord)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["discord"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"doppler-api-token",description:"Discovered a Doppler API token, posing a risk to environment and secrets management security.",regex:"(dp\\.pt\\.)[a-z0-9]{43}",flags:"i",keywords:["doppler"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"droneci-access-token",description:"Detected a Droneci Access Token, potentially compromising continuous integration and deployment workflows.",regex:`(?:droneci)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["droneci"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"dropbox-api-token",description:"Identified a Dropbox API secret, which could lead to unauthorized file access and data breaches in Dropbox storage.",regex:`(?:dropbox)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{15})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["dropbox"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"dropbox-long-lived-api-token",description:"Found a Dropbox long-lived API token, risking prolonged unauthorized access to cloud storage and sensitive data.",regex:`(?:dropbox)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["dropbox"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"dropbox-short-lived-api-token",description:"Discovered a Dropbox short-lived API token, posing a risk of temporary but potentially harmful data access and manipulation.",regex:`(?:dropbox)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(sl\\.[a-z0-9\\-=_]{135})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["dropbox"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"duffel-api-token",description:"Uncovered a Duffel API token, which may compromise travel platform integrations and sensitive customer data.",regex:"duffel_(test|live)_[a-z0-9_\\-=]{43}",flags:"i",keywords:["duffel"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"dynatrace-api-token",description:"Detected a Dynatrace API token, potentially risking application performance monitoring and data exposure.",regex:"dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}",flags:"i",keywords:["dynatrace"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"easypost-api-token",description:"Identified an EasyPost API token, which could lead to unauthorized postal and shipment service access and data exposure.",regex:"\\bEZAK[a-z0-9]{54}",flags:"i",keywords:["ezak"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"easypost-test-api-token",description:"Detected an EasyPost test API token, risking exposure of test environments and potentially sensitive shipment data.",regex:"\\bEZTK[a-z0-9]{54}",flags:"i",keywords:["eztk"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"etsy-access-token",description:"Found an Etsy Access Token, potentially compromising Etsy shop management and customer data.",regex:`(?:etsy)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{24})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["etsy"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"facebook-access-token",description:"Discovered a Facebook Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`\\b(\\d{15,16}(\\||%)[0-9a-z\\-_]{27,40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:[],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"facebook-page-access-token",description:"Discovered a Facebook Page Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`\\b(EAA[MC][a-z0-9]{20,})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["eaam","eaac"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"facebook-secret",description:"Discovered a Facebook Application secret, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`(?:facebook)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["facebook"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"fastly-api-token",description:"Uncovered a Fastly API key, which may compromise CDN and edge cloud services, leading to content delivery and security issues.",regex:`(?:fastly)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["fastly"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"finicity-api-token",description:"Detected a Finicity API token, potentially risking financial data access and unauthorized financial operations.",regex:`(?:finicity)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["finicity"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"finicity-client-secret",description:"Identified a Finicity Client Secret, which could lead to compromised financial service integrations and data breaches.",regex:`(?:finicity)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{20})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["finicity"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"finnhub-access-token",description:"Found a Finnhub Access Token, risking unauthorized access to financial market data and analytics.",regex:`(?:finnhub)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{20})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["finnhub"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"flickr-access-token",description:"Discovered a Flickr Access Token, posing a risk of unauthorized photo management and potential data leakage.",regex:`(?:flickr)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["flickr"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"flutterwave-encryption-key",description:"Uncovered a Flutterwave Encryption Key, which may compromise payment processing and sensitive financial information.",regex:"FLWSECK_TEST-[a-h0-9]{12}",flags:"i",keywords:["flwseck_test"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"flutterwave-public-key",description:"Detected a Finicity Public Key, potentially exposing public cryptographic operations and integrations.",regex:"FLWPUBK_TEST-[a-h0-9]{32}-X",flags:"i",keywords:["flwpubk_test"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"flutterwave-secret-key",description:"Identified a Flutterwave Secret Key, risking unauthorized financial transactions and data breaches.",regex:"FLWSECK_TEST-[a-h0-9]{32}-X",flags:"i",keywords:["flwseck_test"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"frameio-api-token",description:"Found a Frame.io API token, potentially compromising video collaboration and project management.",regex:"fio-u-[a-z0-9\\-_=]{64}",flags:"i",keywords:["fio-u-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"freshbooks-access-token",description:"Discovered a Freshbooks Access Token, posing a risk to accounting software access and sensitive financial data exposure.",regex:`(?:freshbooks)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["freshbooks"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"gcp-api-key",description:"Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.",regex:`\\b(AIza[0-9A-Za-z\\\\-_]{35})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["aiza"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"generic-api-key",description:"Detected a Generic API Key, potentially exposing access to various services and sensitive operations.",regex:`(?:key|api|token|secret|client|passwd|password|auth|access)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9a-z\\-_.=]{10,150})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["key","api","token","secret","client","passwd","password","auth","access"],entropy:3.5,secretGroup:1,disposition:"redact",origin:"gitleaks"},{id:"github-app-token",description:"Identified a GitHub App Token, which may compromise GitHub application integrations and source code security.",regex:"(ghu|ghs)_[0-9a-zA-Z]{36}",keywords:["ghu_","ghs_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"github-fine-grained-pat",description:"Found a GitHub Fine-Grained Personal Access Token, risking unauthorized repository access and code manipulation.",regex:"github_pat_[0-9a-zA-Z_]{82}",keywords:["github_pat_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"github-oauth",description:"Discovered a GitHub OAuth Access Token, posing a risk of compromised GitHub account integrations and data leaks.",regex:"gho_[0-9a-zA-Z]{36}",keywords:["gho_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"github-pat",description:"Uncovered a GitHub Personal Access Token, potentially leading to unauthorized repository access and sensitive content exposure.",regex:"ghp_[0-9a-zA-Z]{36}",keywords:["ghp_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"github-refresh-token",description:"Detected a GitHub Refresh Token, which could allow prolonged unauthorized access to GitHub services.",regex:"ghr_[0-9a-zA-Z]{36}",keywords:["ghr_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"gitlab-pat",description:"Identified a GitLab Personal Access Token, risking unauthorized access to GitLab repositories and codebase exposure.",regex:"glpat-[0-9a-zA-Z\\-\\_]{20}",keywords:["glpat-"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"gitlab-ptt",description:"Found a GitLab Pipeline Trigger Token, potentially compromising continuous integration workflows and project security.",regex:"glptt-[0-9a-f]{40}",keywords:["glptt-"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"gitlab-rrt",description:"Discovered a GitLab Runner Registration Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",regex:"GR1348941[0-9a-zA-Z\\-\\_]{20}",keywords:["gr1348941"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"gitter-access-token",description:"Uncovered a Gitter Access Token, which may lead to unauthorized access to chat and communication services.",regex:`(?:gitter)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9_-]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["gitter"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"gocardless-api-token",description:"Detected a GoCardless API token, potentially risking unauthorized direct debit payment operations and financial data exposure.",regex:`(?:gocardless)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(live_[a-z0-9\\-_=]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["live_","gocardless"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"grafana-api-key",description:"Identified a Grafana API key, which could compromise monitoring dashboards and sensitive data analytics.",regex:`\\b(eyJrIjoi[A-Za-z0-9]{70,400}={0,2})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["eyjrijoi"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"grafana-cloud-api-token",description:"Found a Grafana cloud API token, risking unauthorized access to cloud-based monitoring services and data exposure.",regex:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,2})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["glc_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"grafana-service-account-token",description:"Discovered a Grafana service account token, posing a risk of compromised monitoring services and data integrity.",regex:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["glsa_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"hashicorp-tf-api-token",description:"Uncovered a HashiCorp Terraform user/org API token, which may lead to unauthorized infrastructure management and security breaches.",regex:"[a-z0-9]{14}\\.atlasv1\\.[a-z0-9\\-_=]{60,70}",flags:"i",keywords:["atlasv1"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"hashicorp-tf-password",description:"Identified a HashiCorp Terraform password field, risking unauthorized infrastructure configuration and security breaches.",regex:`(?:administrator_login_password|password)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}("[a-z0-9=_\\-]{8,20}")(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["administrator_login_password","password"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"heroku-api-key",description:"Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",regex:`(?:heroku)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["heroku"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"hubspot-api-key",description:"Found a HubSpot API Token, posing a risk to CRM data integrity and unauthorized marketing operations.",regex:`(?:hubspot)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["hubspot"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"huggingface-access-token",description:"Discovered a Hugging Face Access token, which could lead to unauthorized access to AI models and sensitive data.",regex:"(?:^|[\\\\'\"` >=:])(hf_[a-zA-Z]{34})(?:$|[\\\\'\"` <])",keywords:["hf_"],entropy:1,secretGroup:1,disposition:"quarantine",origin:"gitleaks"},{id:"huggingface-organization-api-token",description:"Uncovered a Hugging Face Organization API token, potentially compromising AI organization accounts and associated data.",regex:"(?:^|[\\\\'\"` >=:\\(,)])(api_org_[a-zA-Z]{34})(?:$|[\\\\'\"` <\\),])",keywords:["api_org_"],entropy:2,secretGroup:1,disposition:"quarantine",origin:"gitleaks"},{id:"infracost-api-token",description:"Detected an Infracost API Token, risking unauthorized access to cloud cost estimation tools and financial data.",regex:`\\b(ico-[a-zA-Z0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["ico-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"intercom-api-key",description:"Identified an Intercom API Token, which could compromise customer communication channels and data privacy.",regex:`(?:intercom)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{60})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["intercom"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"intra42-client-secret",description:"Found a Intra42 client secret, which could lead to unauthorized access to the 42School API and sensitive data.",regex:`\\b(s-s4t2(?:ud|af)-[abcdef0123456789]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["intra","s-s4t2ud-","s-s4t2af-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"jfrog-api-key",description:"Found a JFrog API Key, posing a risk of unauthorized access to software artifact repositories and build pipelines.",regex:`(?:jfrog|artifactory|bintray|xray)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{73})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["jfrog","artifactory","bintray","xray"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"jfrog-identity-token",description:"Discovered a JFrog Identity Token, potentially compromising access to JFrog services and sensitive software artifacts.",regex:`(?:jfrog|artifactory|bintray|xray)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["jfrog","artifactory","bintray","xray"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"jwt",description:"Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.",regex:`\\b(ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,keywords:["ey"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"jwt-base64",description:"Detected a Base64-encoded JSON Web Token, posing a risk of exposing encoded authentication and data exchange information.",regex:"\\bZXlK(?:(?<alg>aGJHY2lPaU)|(?<apu>aGNIVWlPaU)|(?<apv>aGNIWWlPaU)|(?<aud>aGRXUWlPaU)|(?<b64>aU5qUWlP)|(?<crit>amNtbDBJanBi)|(?<cty>amRIa2lPaU)|(?<epk>bGNHc2lPbn)|(?<enc>bGJtTWlPaU)|(?<jku>cWEzVWlPaU)|(?<jwk>cWQyc2lPb)|(?<iss>cGMzTWlPaU)|(?<iv>cGRpSTZJ)|(?<kid>cmFXUWlP)|(?<key_ops>clpYbGZiM0J6SWpwY)|(?<kty>cmRIa2lPaUp)|(?<nonce>dWIyNWpaU0k2)|(?<p2c>d01tTWlP)|(?<p2s>d01uTWlPaU)|(?<ppt>d2NIUWlPaU)|(?<sub>emRXSWlPaU)|(?<svt>emRuUWlP)|(?<tag>MFlXY2lPaU)|(?<typ>MGVYQWlPaUp)|(?<url>MWNtd2l)|(?<use>MWMyVWlPaUp)|(?<ver>MlpYSWlPaU)|(?<version>MlpYSnphVzl1SWpv)|(?<x>NElqb2)|(?<x5c>NE5XTWlP)|(?<x5t>NE5YUWlPaU)|(?<x5ts256>NE5YUWpVekkxTmlJNkl)|(?<x5u>NE5YVWlPaU)|(?<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}",keywords:["zxlk"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"kraken-access-token",description:"Identified a Kraken Access Token, potentially compromising cryptocurrency trading accounts and financial security.",regex:`(?:kraken)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9\\/=_\\+\\-]{80,90})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["kraken"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"kucoin-access-token",description:"Found a Kucoin Access Token, risking unauthorized access to cryptocurrency exchange services and transactions.",regex:`(?:kucoin)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{24})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["kucoin"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"kucoin-secret-key",description:"Discovered a Kucoin Secret Key, which could lead to compromised cryptocurrency operations and financial data breaches.",regex:`(?:kucoin)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["kucoin"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"launchdarkly-access-token",description:"Uncovered a Launchdarkly Access Token, potentially compromising feature flag management and application functionality.",regex:`(?:launchdarkly)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["launchdarkly"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"linear-api-key",description:"Detected a Linear API Token, posing a risk to project management tools and sensitive task data.",regex:"lin_api_[a-z0-9]{40}",flags:"i",keywords:["lin_api_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"linear-client-secret",description:"Identified a Linear Client Secret, which may compromise secure integrations and sensitive project management data.",regex:`(?:linear)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["linear"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"linkedin-client-id",description:"Found a LinkedIn Client ID, risking unauthorized access to LinkedIn integrations and professional data exposure.",regex:`(?:linkedin|linked-in)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{14})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["linkedin","linked-in"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"linkedin-client-secret",description:"Discovered a LinkedIn Client secret, potentially compromising LinkedIn application integrations and user data.",regex:`(?:linkedin|linked-in)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{16})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["linkedin","linked-in"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"lob-api-key",description:"Uncovered a Lob API Key, which could lead to unauthorized access to mailing and address verification services.",regex:`(?:lob)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}((live|test)_[a-f0-9]{35})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["test_","live_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"lob-pub-api-key",description:"Detected a Lob Publishable API Key, posing a risk of exposing mail and print service integrations.",regex:`(?:lob)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}((test|live)_pub_[a-f0-9]{31})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["test_pub","live_pub","_pub"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"lore-authorization-header",description:"An HTTP Authorization header carrying a Bearer/Basic/Token credential.",regex:"authorization\\s*:\\s*(?:bearer|basic|token)\\s+([a-z0-9._\\-+/=]{8,})",flags:"i",keywords:["authorization"],secretGroup:1,disposition:"redact",origin:"lore"},{id:"lore-env-secret-assignment",description:"A KEY=value assignment whose key looks secret-bearing (SECRET/TOKEN/PASSWORD/API_KEY/ACCESS_KEY).",regex:`\\b([a-z0-9_]*(?:secret|token|password|passwd|api[_-]?key|access[_-]?key)[a-z0-9_]*)\\s*[:=]\\s*['"]?([^\\s'"#]{6,})`,flags:"i",keywords:["secret","token","password","passwd","api","access"],secretGroup:2,disposition:"redact",origin:"lore"},{id:"mailchimp-api-key",description:"Identified a Mailchimp API key, potentially compromising email marketing campaigns and subscriber data.",regex:`(?:MailchimpSDK.initialize|mailchimp)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{32}-us\\d\\d)(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["mailchimp"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"mailgun-private-api-token",description:"Found a Mailgun private API token, risking unauthorized email service operations and data breaches.",regex:`(?:mailgun)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(key-[a-f0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["mailgun"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"mailgun-pub-key",description:"Discovered a Mailgun public validation key, which could expose email verification processes and associated data.",regex:`(?:mailgun)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(pubkey-[a-f0-9]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["mailgun"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"mailgun-signing-key",description:"Uncovered a Mailgun webhook signing key, potentially compromising email automation and data integrity.",regex:`(?:mailgun)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["mailgun"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"mapbox-api-token",description:"Detected a MapBox API token, posing a risk to geospatial services and sensitive location data exposure.",regex:`(?:mapbox)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["mapbox"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"mattermost-access-token",description:"Identified a Mattermost Access Token, which may compromise team communication channels and data privacy.",regex:`(?:mattermost)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{26})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["mattermost"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"messagebird-api-token",description:"Found a MessageBird API token, risking unauthorized access to communication platforms and message data.",regex:`(?:messagebird|message-bird|message_bird)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{25})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["messagebird","message-bird","message_bird"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"messagebird-client-id",description:"Discovered a MessageBird client ID, potentially compromising API integrations and sensitive communication data.",regex:`(?:messagebird|message-bird|message_bird)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["messagebird","message-bird","message_bird"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"microsoft-teams-webhook",description:"Uncovered a Microsoft Teams Webhook, which could lead to unauthorized access to team collaboration tools and data leaks.",regex:"https:\\/\\/[a-z0-9]+\\.webhook\\.office\\.com\\/webhookb2\\/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}\\/IncomingWebhook\\/[a-z0-9]{32}\\/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}",keywords:["webhook.office.com","webhookb2","incomingwebhook"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"netlify-access-token",description:"Detected a Netlify Access Token, potentially compromising web hosting services and site management.",regex:`(?:netlify)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{40,46})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["netlify"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"new-relic-browser-api-token",description:"Identified a New Relic ingest browser API token, risking unauthorized access to application performance data and analytics.",regex:`(?:new-relic|newrelic|new_relic)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(NRJS-[a-f0-9]{19})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["nrjs-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"new-relic-insert-key",description:"Discovered a New Relic insight insert key, compromising data injection into the platform.",regex:`(?:new-relic|newrelic|new_relic)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(NRII-[a-z0-9-]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["nrii-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"new-relic-user-api-id",description:"Found a New Relic user API ID, posing a risk to application monitoring services and data integrity.",regex:`(?:new-relic|newrelic|new_relic)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["new-relic","newrelic","new_relic"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"new-relic-user-api-key",description:"Discovered a New Relic user API Key, which could lead to compromised application insights and performance monitoring.",regex:`(?:new-relic|newrelic|new_relic)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(NRAK-[a-z0-9]{27})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["nrak"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"npm-access-token",description:"Uncovered an npm access token, potentially compromising package management and code repository access.",regex:`\\b(npm_[a-z0-9]{36})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["npm_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"nytimes-access-token",description:"Detected a Nytimes Access Token, risking unauthorized access to New York Times APIs and content services.",regex:`(?:nytimes|new-york-times,|newyorktimes)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{32})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["nytimes","new-york-times","newyorktimes"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"okta-access-token",description:"Identified an Okta Access Token, which may compromise identity management services and user authentication data.",regex:`(?:okta)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9=_\\-]{42})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["okta"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"openai-api-key",description:"Found an OpenAI API Key, posing a risk of unauthorized access to AI services and data manipulation.",regex:`\\b(sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["t3blbkfj"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"plaid-api-token",description:"Discovered a Plaid API Token, potentially compromising financial data aggregation and banking services.",regex:`(?:plaid)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["plaid"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"plaid-client-id",description:"Uncovered a Plaid Client ID, which could lead to unauthorized financial service integrations and data breaches.",regex:`(?:plaid)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{24})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["plaid"],entropy:3.5,secretGroup:1,disposition:"quarantine",origin:"gitleaks"},{id:"plaid-secret-key",description:"Detected a Plaid Secret key, risking unauthorized access to financial accounts and sensitive transaction data.",regex:`(?:plaid)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{30})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["plaid"],entropy:3.5,secretGroup:1,disposition:"quarantine",origin:"gitleaks"},{id:"planetscale-api-token",description:"Identified a PlanetScale API token, potentially compromising database management and operations.",regex:`\\b(pscale_tkn_[a-z0-9=\\-_\\.]{32,64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["pscale_tkn_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"planetscale-oauth-token",description:"Found a PlanetScale OAuth token, posing a risk to database access control and sensitive data integrity.",regex:`\\b(pscale_oauth_[a-z0-9=\\-_\\.]{32,64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["pscale_oauth_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"planetscale-password",description:"Discovered a PlanetScale password, which could lead to unauthorized database operations and data breaches.",regex:`\\b(pscale_pw_[a-z0-9=\\-_\\.]{32,64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["pscale_pw_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"postman-api-token",description:"Uncovered a Postman API token, potentially compromising API testing and development workflows.",regex:`\\b(PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["pmak-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"prefect-api-token",description:"Detected a Prefect API token, risking unauthorized access to workflow management and automation services.",regex:`\\b(pnu_[a-z0-9]{36})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["pnu_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"private-key",description:"Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.",regex:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\\s\\S-]*KEY( BLOCK)?----",flags:"i",keywords:["-----begin"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"pulumi-api-token",description:"Found a Pulumi API token, posing a risk to infrastructure as code services and cloud resource management.",regex:`\\b(pul-[a-f0-9]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["pul-"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"pypi-upload-token",description:"Discovered a PyPI upload token, potentially compromising Python package distribution and repository integrity.",regex:"pypi-AgEIcHlwaS5vcmc[A-Za-z0-9\\-_]{50,1000}",keywords:["pypi-ageichlwas5vcmc"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"rapidapi-access-token",description:"Uncovered a RapidAPI Access Token, which could lead to unauthorized access to various APIs and data services.",regex:`(?:rapidapi)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9_-]{50})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["rapidapi"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"readme-api-token",description:"Detected a Readme API token, risking unauthorized documentation management and content exposure.",regex:`\\b(rdme_[a-z0-9]{70})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["rdme_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"rubygems-api-token",description:"Identified a Rubygem API token, potentially compromising Ruby library distribution and package management.",regex:`\\b(rubygems_[a-f0-9]{48})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["rubygems_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"scalingo-api-token",description:"Found a Scalingo API token, posing a risk to cloud platform services and application deployment security.",regex:`\\b(tk-us-[a-zA-Z0-9-_]{48})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,keywords:["tk-us-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"sendbird-access-id",description:"Discovered a Sendbird Access ID, which could compromise chat and messaging platform integrations.",regex:`(?:sendbird)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sendbird"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"sendbird-access-token",description:"Uncovered a Sendbird Access Token, potentially risking unauthorized access to communication services and user data.",regex:`(?:sendbird)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sendbird"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"sendgrid-api-token",description:"Detected a SendGrid API token, posing a risk of unauthorized email service operations and data exposure.",regex:`\\b(SG\\.[a-z0-9=_\\-\\.]{66})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sg."],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"sendinblue-api-token",description:"Identified a Sendinblue API token, which may compromise email marketing services and subscriber data privacy.",regex:`\\b(xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["xkeysib-"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"sentry-access-token",description:"Found a Sentry Access Token, risking unauthorized access to error tracking services and sensitive application data.",regex:`(?:sentry)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sentry"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"shippo-api-token",description:"Discovered a Shippo API token, potentially compromising shipping services and customer order data.",regex:`\\b(shippo_(live|test)_[a-f0-9]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["shippo_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"shopify-access-token",description:"Uncovered a Shopify access token, which could lead to unauthorized e-commerce platform access and data breaches.",regex:"shpat_[a-fA-F0-9]{32}",keywords:["shpat_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"shopify-custom-access-token",description:"Detected a Shopify custom access token, potentially compromising custom app integrations and e-commerce data security.",regex:"shpca_[a-fA-F0-9]{32}",keywords:["shpca_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"shopify-private-app-access-token",description:"Identified a Shopify private app access token, risking unauthorized access to private app data and store operations.",regex:"shppa_[a-fA-F0-9]{32}",keywords:["shppa_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"shopify-shared-secret",description:"Found a Shopify shared secret, posing a risk to application authentication and e-commerce platform security.",regex:"shpss_[a-fA-F0-9]{32}",keywords:["shpss_"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"sidekiq-secret",description:"Discovered a Sidekiq Secret, which could lead to compromised background job processing and application data breaches.",regex:`(?:BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-f0-9]{8}:[a-f0-9]{8})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["bundle_enterprise__contribsys__com","bundle_gems__contribsys__com"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"sidekiq-sensitive-url",description:"Uncovered a Sidekiq Sensitive URL, potentially exposing internal job queues and sensitive operation details.",regex:"\\b(http(?:s??):\\/\\/)([a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)",flags:"i",keywords:["gems.contribsys.com","enterprise.contribsys.com"],secretGroup:2,disposition:"quarantine",origin:"gitleaks"},{id:"slack-app-token",description:"Detected a Slack App-level token, risking unauthorized access to Slack applications and workspace data.",regex:"(xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+)",flags:"i",keywords:["xapp"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"slack-bot-token",description:"Identified a Slack Bot token, which may compromise bot integrations and communication channel security.",regex:"(xoxb-[0-9]{10,13}\\-[0-9]{10,13}[a-zA-Z0-9-]*)",keywords:["xoxb"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"slack-config-access-token",description:"Found a Slack Configuration access token, posing a risk to workspace configuration and sensitive data access.",regex:"(xoxe.xox[bp]-\\d-[A-Z0-9]{163,166})",flags:"i",keywords:["xoxe.xoxb-","xoxe.xoxp-"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"slack-config-refresh-token",description:"Discovered a Slack Configuration refresh token, potentially allowing prolonged unauthorized access to configuration settings.",regex:"(xoxe-\\d-[A-Z0-9]{146})",flags:"i",keywords:["xoxe-"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"slack-legacy-bot-token",description:"Uncovered a Slack Legacy bot token, which could lead to compromised legacy bot operations and data exposure.",regex:"(xoxb-[0-9]{8,14}\\-[a-zA-Z0-9]{18,26})",keywords:["xoxb"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"slack-legacy-token",description:"Detected a Slack Legacy token, risking unauthorized access to older Slack integrations and user data.",regex:"(xox[os]-\\d+-\\d+-\\d+-[a-fA-F\\d]+)",keywords:["xoxo","xoxs"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"slack-legacy-workspace-token",description:"Identified a Slack Legacy Workspace token, potentially compromising access to workspace data and legacy features.",regex:"(xox[ar]-(?:\\d-)?[0-9a-zA-Z]{8,48})",keywords:["xoxa","xoxr"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"slack-user-token",description:"Found a Slack User token, posing a risk of unauthorized user impersonation and data access within Slack workspaces.",regex:"(xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34})",keywords:["xoxp-","xoxe-"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"slack-webhook-url",description:"Discovered a Slack Webhook, which could lead to unauthorized message posting and data leakage in Slack channels.",regex:"(https?:\\/\\/)?hooks.slack.com\\/(services|workflows)\\/[A-Za-z0-9+\\/]{43,46}",keywords:["hooks.slack.com"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"snyk-api-token",description:"Uncovered a Snyk API token, potentially compromising software vulnerability scanning and code security.",regex:`(?:snyk_token|snyk_key|snyk_api_token|snyk_api_key|snyk_oauth_token)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["snyk_token","snyk_key","snyk_api_token","snyk_api_key","snyk_oauth_token"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"square-access-token",description:"Detected a Square Access Token, risking unauthorized payment processing and financial transaction exposure.",regex:`\\b((EAAA|sq0atp-)[0-9A-Za-z\\-_]{22,60})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sq0atp-","eaaa"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"squarespace-access-token",description:"Identified a Squarespace Access Token, which may compromise website management and content control on Squarespace.",regex:`(?:squarespace)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["squarespace"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"stripe-access-token",description:"Found a Stripe Access Token, posing a risk to payment processing services and sensitive financial data.",regex:`\\b((sk|rk)_(test|live|prod)_[0-9a-z]{10,99})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sk_test","sk_live","sk_prod","rk_test","rk_live","rk_prod"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"sumologic-access-id",description:"Discovered a SumoLogic Access ID, potentially compromising log management services and data analytics integrity.",regex:`(?:(?:sumo)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3})(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(su[a-zA-Z0-9]{12})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sumo"],entropy:3,secretGroup:1,disposition:"quarantine",origin:"gitleaks"},{id:"sumologic-access-token",description:"Uncovered a SumoLogic Access Token, which could lead to unauthorized access to log data and analytics insights.",regex:`(?:sumo)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{64})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["sumo"],entropy:3,secretGroup:1,disposition:"quarantine",origin:"gitleaks"},{id:"telegram-bot-api-token",description:"Detected a Telegram Bot API Token, risking unauthorized bot operations and message interception on Telegram.",regex:`(?:(?:telegr)(?:[0-9a-z\\(-_\\t .\\\\]{0,40})(?:[\\s|']|[\\s|"]){0,3})(?:=|\\|\\|:|<=|=>|:|\\?=|\\()(?:'|\\"|\\s|=|\\x60){0,5}([0-9]{5,16}:A[a-z0-9_\\-]{34})(?:['|\\"|\\n|\\r|\\s|\\x60|;|\\\\]|$)`,flags:"i",keywords:["telegr"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"travisci-access-token",description:"Identified a Travis CI Access Token, potentially compromising continuous integration services and codebase security.",regex:`(?:travis)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{22})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["travis"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"twilio-api-key",description:"Found a Twilio API Key, posing a risk to communication services and sensitive customer interaction data.",regex:"SK[0-9a-fA-F]{32}",keywords:["twilio"],secretGroup:0,disposition:"redact",origin:"gitleaks"},{id:"twitch-api-token",description:"Discovered a Twitch API token, which could compromise streaming services and account integrations.",regex:`(?:twitch)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{30})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["twitch"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"twitter-access-secret",description:"Uncovered a Twitter Access Secret, potentially risking unauthorized Twitter integrations and data breaches.",regex:`(?:twitter)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{45})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["twitter"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"twitter-access-token",description:"Detected a Twitter Access Token, posing a risk of unauthorized account operations and social media data exposure.",regex:`(?:twitter)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([0-9]{15,25}-[a-zA-Z0-9]{20,40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["twitter"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"twitter-api-key",description:"Identified a Twitter API Key, which may compromise Twitter application integrations and user data security.",regex:`(?:twitter)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{25})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["twitter"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"twitter-api-secret",description:"Found a Twitter API Secret, risking the security of Twitter app integrations and sensitive data access.",regex:`(?:twitter)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{50})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["twitter"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"twitter-bearer-token",description:"Discovered a Twitter Bearer Token, potentially compromising API access and data retrieval from Twitter.",regex:`(?:twitter)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(A{22}[a-zA-Z0-9%]{80,100})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["twitter"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"typeform-api-token",description:"Uncovered a Typeform API token, which could lead to unauthorized survey management and data collection.",regex:`(?:typeform)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(tfp_[a-z0-9\\-_\\.=]{59})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["tfp_"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"vault-batch-token",description:"Detected a Vault Batch Token, risking unauthorized access to secret management services and sensitive data.",regex:`\\b(hvb\\.[a-z0-9_-]{138,212})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["hvb"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"vault-service-token",description:"Identified a Vault Service Token, potentially compromising infrastructure security and access to sensitive credentials.",regex:`\\b(hvs\\.[a-z0-9_-]{90,100})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["hvs"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"yandex-access-token",description:"Found a Yandex Access Token, posing a risk to Yandex service integrations and user data privacy.",regex:`(?:yandex)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["yandex"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"yandex-api-key",description:"Discovered a Yandex API Key, which could lead to unauthorized access to Yandex services and data manipulation.",regex:`(?:yandex)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(AQVN[A-Za-z0-9_\\-]{35,38})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["yandex"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"yandex-aws-access-token",description:"Uncovered a Yandex AWS Access Token, potentially compromising cloud resource access and data security on Yandex Cloud.",regex:`(?:yandex)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}(YC[a-zA-Z0-9_\\-]{38})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["yandex"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"},{id:"zendesk-secret-key",description:"Detected a Zendesk Secret Key, risking unauthorized access to customer support services and sensitive ticketing data.",regex:`(?:zendesk)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\\"|\\s|=|\\x60){0,5}([a-z0-9]{40})(?:['|\\"|\\n|\\r|\\s|\\x60|;]|$)`,flags:"i",keywords:["zendesk"],secretGroup:0,disposition:"quarantine",origin:"gitleaks"}]};function KWe(){let e=Vpe;return{schemaVersion:e.schemaVersion,source:e.source}}var B9=null;function w9(){return B9||(B9=Vpe.rules.map(t=>({id:t.id,keywords:t.keywords,...t.entropy!=null?{entropy:t.entropy}:{},secretGroup:t.secretGroup,disposition:t.disposition,origin:t.origin,matcher:new RegExp(t.regex,`gd${t.flags??""}`)})),B9)}function mWt(e){if(e.length===0)return 0;let t=new Map;for(let r of e)t.set(r,(t.get(r)??0)+1);let n=0;for(let r of t.values()){let o=r/e.length;n-=o*Math.log2(o)}return n}function AWt(e,t){let n=e.indices;if(t>0&&n?.[t])return n[t];if(n?.[0])return n[0];let r=e.index??0;return[r,r+e[0].length]}function JWe(e,t=w9(),n={}){let r=e.toLowerCase(),o=[];for(let i of t)if(!(!n.skipKeywordPrefilter&&i.keywords.length>0&&!i.keywords.some(s=>r.includes(s))))for(let s of e.matchAll(i.matcher)){let u=AWt(s,i.secretGroup);if(!u)continue;let[l,f]=u;f<=l||i.entropy!=null&&mWt(e.slice(l,f))<i.entropy||o.push({ruleId:i.id,disposition:i.disposition,start:l,end:f})}return o.sort((i,s)=>i.start-s.start||(i.ruleId<s.ruleId?-1:i.ruleId>s.ruleId?1:0)),o}function gWt(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function Ype(e,t,n,r,o){if(typeof e=="string"){let i=JWe(e,r,{skipKeywordPrefilter:!0});for(let s of i)o.push({location:{line:n,jsonPointer:t},start:s.start,end:s.end,ruleId:s.ruleId,disposition:s.disposition});return}if(Array.isArray(e)){e.forEach((i,s)=>Ype(i,`${t}/${s}`,n,r,o));return}if(e&&typeof e=="object")for(let[i,s]of Object.entries(e))Ype(s,`${t}/${gWt(i)}`,n,r,o)}function ZWe(e,t){let n=t??w9(),r=e.toLowerCase(),o=n.filter(l=>l.keywords.length===0||l.keywords.some(f=>r.includes(f))),i=e.split(`
683
- `);i.length>0&&i[i.length-1]===""&&i.pop();let s=[],u=[];for(let l=0;l<i.length;l+=1){let f=i[l]??"",h;try{h=JSON.parse(f)}catch{u.push(l);continue}Ype(h,"",l,o,s)}return s.sort((l,f)=>l.location.line-f.location.line||(l.location.jsonPointer<f.location.jsonPointer?-1:l.location.jsonPointer>f.location.jsonPointer?1:0)||l.start-f.start),{findings:s,unparsableLines:u}}async function WWe(e,t={}){let n=t.scan??ZWe;try{let r=await hWt.readFile(e.tempPath,"utf8"),o=n(r);if(o.unparsableLines.length>0)return{status:"quarantined",reason:"unparsable",findings:o.findings};if(o.findings.length===0)return{status:"clean",file:e};if(o.findings.some(f=>f.disposition==="quarantine"))return{status:"quarantined",reason:"risky",findings:o.findings};let i=YWe(r,o.findings);if(!i.ok)return{status:"quarantined",reason:"unredactable",findings:o.findings};let s=await N9(e.filename,i.text),u={...e,tempPath:s.tempPath,md5:s.md5},l=[...new Set(o.findings.map(f=>f.ruleId))].sort();return{status:"redacted",file:u,redactedRuleIds:l}}catch{return{status:"quarantined",reason:"scan_error",findings:[]}}}async function MA(e,t,n={}){if(t.length===0)return[];let r=n.uploadFile??((f,h)=>I$(f,h,{timeoutMs:n.networkTimeoutMs})),o=n.scrub??WWe,i=n.now??new Date,s=new Array(t.length),u=[],l=[];for(let f=0;f<t.length;f+=1){let h=t[f];if(!h)continue;let _=await o(h);if(_.status==="quarantined"){let y=await HWe({id:h.md5,tempPath:h.tempPath,sourcePath:h.sourcePath,harness:h.harness,harnessInternalId:h.harnessInternalId,filename:h.filename,findings:_.findings,now:i});s[f]={status:"quarantined",localFile:h,quarantineId:y.id,reason:_.reason,findingCount:_.findings.length};continue}_.status==="redacted"&&l.push(_.file.tempPath),u.push({file:_.file,inputIndex:f})}try{if(u.length===0)return XWe(s);let f=u.map(R=>R.file),h=await lKe(e,f,{timeoutMs:n.networkTimeoutMs}),_=h.thread_files;if(_.length!==f.length)throw new Error(`upload session returned ${_.length} files for ${f.length} local files`);let y=pKe(f,_),T=new Map;for(let R of u)T.has(R.file)||T.set(R.file,R.inputIndex);let v=[];for(let R=0;R<_.length;R+=1){let x=_[R],O=y[R];if(!x||!O)continue;let P=T.get(O);if(P===void 0)continue;if($.info("upload_session_created",{upload_session_id:h.id,thread_file_id:x.id,filename:O.filename,source_path:O.sourcePath,harness:O.harness,harness_internal_id:O.harnessInternalId,has_presigned_url:!!x.presigned_url?.trim()}),!x.presigned_url?.trim()){s[P]=x.thread?.id?.trim()?{status:"deduped",localFile:O,thread:x.thread}:{status:"no_upload",localFile:O,error:x.error};continue}v.push({uploadFileInfo:x,file:O,inputIndex:P})}for(let{uploadFileInfo:R,file:x}of v)try{await r(R.presigned_url??"",x.tempPath),$.info("upload_session_file_uploaded",{upload_session_id:h.id,thread_file_id:R.id,filename:x.filename,source_path:x.sourcePath,harness:x.harness,harness_internal_id:x.harnessInternalId})}catch(O){throw $.error("upload_session_file_upload_failed",{upload_session_id:h.id,thread_file_id:R.id,filename:x.filename,source_path:x.sourcePath,harness:x.harness,harness_internal_id:x.harnessInternalId,error:O instanceof Error?O.message:String(O)}),O}if(v.length>0){let R;try{R=await dKe(e,h.id,v.map(x=>x.uploadFileInfo),{timeoutMs:n.networkTimeoutMs})}catch(x){for(let{uploadFileInfo:O,file:P}of v)$.error("upload_session_complete_failed",{upload_session_id:h.id,thread_file_id:O.id,filename:P.filename,source_path:P.sourcePath,harness:P.harness,harness_internal_id:P.harnessInternalId,error:x instanceof Error?x.message:String(x)});throw x}if(R.thread_files.length!==v.length)throw new Error(`completed upload session returned ${R.thread_files.length} files for ${v.length} local files`);for(let x=0;x<v.length;x+=1){let O=v[x],P=R.thread_files[x];O&&($.info("upload_session_completed",{upload_session_id:h.id,thread_file_id:O.uploadFileInfo.id,filename:O.file.filename,source_path:O.file.sourcePath,harness:O.file.harness,harness_internal_id:O.file.harnessInternalId,thread_id:P?.thread?.id?.trim()||"<none>"}),s[O.inputIndex]={status:"uploaded",localFile:O.file,thread:P?.thread??null})}}return XWe(s)}finally{await Promise.all(l.map(f=>wp(f)))}}function XWe(e){return e.map((t,n)=>{if(!t)throw new Error(`upload outcome missing for thread file index ${n}`);return t})}var _Wt=new Set(["claudeCode","codex","amp","cursor","cowork","unspecified"]);async function Kpe(e){let t=await u1(),n=t.find(o=>o.id===e);if(n)return n;let r=t.filter(o=>o.id.startsWith(e));if(r.length===1)return r[0];throw r.length===0?new Ne(`no quarantined thread matches "${e}"`):new Ne(`"${e}" is ambiguous \u2014 matches ${r.length} entries; use a longer id`)}var eXe={meta:{name:"list",description:"List locally-held (quarantined) threads"},async run(){await x9(new Date);let e=await u1();if(e.length===0){console.log("No quarantined threads.");return}console.log(`${e.length} quarantined thread(s) \u2014 held locally, never uploaded:
683
+ `);i.length>0&&i[i.length-1]===""&&i.pop();let s=[],u=[];for(let l=0;l<i.length;l+=1){let f=i[l]??"",h;try{h=JSON.parse(f)}catch{u.push(l);continue}Ype(h,"",l,o,s)}return s.sort((l,f)=>l.location.line-f.location.line||(l.location.jsonPointer<f.location.jsonPointer?-1:l.location.jsonPointer>f.location.jsonPointer?1:0)||l.start-f.start),{findings:s,unparsableLines:u}}async function WWe(e,t={}){let n=t.scan??ZWe;try{let r=await hWt.readFile(e.tempPath,"utf8"),o=n(r);if(o.unparsableLines.length>0)return{status:"quarantined",reason:"unparsable",findings:o.findings};if(o.findings.length===0)return{status:"clean",file:e};if(o.findings.some(f=>f.disposition==="quarantine"))return{status:"quarantined",reason:"risky",findings:o.findings};let i=YWe(r,o.findings);if(!i.ok)return{status:"quarantined",reason:"unredactable",findings:o.findings};let s=await N9(e.filename,i.text),u={...e,tempPath:s.tempPath,md5:s.md5},l=[...new Set(o.findings.map(f=>f.ruleId))].sort();return{status:"redacted",file:u,redactedRuleIds:l}}catch{return{status:"quarantined",reason:"scan_error",findings:[]}}}async function MA(e,t,n={}){if(t.length===0)return[];let r=n.uploadFile??((f,h)=>I$(f,h,{timeoutMs:n.networkTimeoutMs})),o=n.scrub??WWe,i=n.now??new Date,s=new Array(t.length),u=[],l=[];for(let f=0;f<t.length;f+=1){let h=t[f];if(!h)continue;let _=await o(h);if(_.status==="quarantined"){let y=await HWe({id:h.md5,tempPath:h.tempPath,sourcePath:h.sourcePath,harness:h.harness,harnessInternalId:h.harnessInternalId,filename:h.filename,findings:_.findings,now:i});s[f]={status:"quarantined",localFile:h,quarantineId:y.id,reason:_.reason,findingCount:_.findings.length};continue}_.status==="redacted"&&l.push(_.file.tempPath),u.push({file:_.file,inputIndex:f})}try{if(u.length===0)return XWe(s);let f=u.map(R=>R.file),h=await lKe(e,f,{timeoutMs:n.networkTimeoutMs}),_=h.thread_files;if(_.length!==f.length)throw new Error(`upload session returned ${_.length} files for ${f.length} local files`);let y=pKe(f,_),T=new Map;for(let R of u)T.has(R.file)||T.set(R.file,R.inputIndex);let v=[];for(let R=0;R<_.length;R+=1){let x=_[R],O=y[R];if(!x||!O)continue;let P=T.get(O);if(P===void 0)continue;if($.info("upload_session_created",{upload_session_id:h.id,thread_file_id:x.id,filename:O.filename,source_path:O.sourcePath,harness:O.harness,harness_internal_id:O.harnessInternalId,has_presigned_url:!!x.presigned_url?.trim()}),!x.presigned_url?.trim()){s[P]=x.thread?.id?.trim()?{status:"deduped",localFile:O,thread:x.thread}:{status:"no_upload",localFile:O,error:x.error};continue}v.push({uploadFileInfo:x,file:O,inputIndex:P})}for(let{uploadFileInfo:R,file:x}of v)try{await r(R.presigned_url??"",x.tempPath),$.info("upload_session_file_uploaded",{upload_session_id:h.id,thread_file_id:R.id,filename:x.filename,source_path:x.sourcePath,harness:x.harness,harness_internal_id:x.harnessInternalId})}catch(O){throw $.error("upload_session_file_upload_failed",{upload_session_id:h.id,thread_file_id:R.id,filename:x.filename,source_path:x.sourcePath,harness:x.harness,harness_internal_id:x.harnessInternalId,error:O instanceof Error?O.message:String(O)}),O}if(v.length>0){let R;try{R=await dKe(e,h.id,v.map(x=>x.uploadFileInfo),{timeoutMs:n.networkTimeoutMs})}catch(x){for(let{uploadFileInfo:O,file:P}of v)$.error("upload_session_complete_failed",{upload_session_id:h.id,thread_file_id:O.id,filename:P.filename,source_path:P.sourcePath,harness:P.harness,harness_internal_id:P.harnessInternalId,error:x instanceof Error?x.message:String(x)});throw x}if(R.thread_files.length!==v.length)throw new Error(`completed upload session returned ${R.thread_files.length} files for ${v.length} local files`);for(let x=0;x<v.length;x+=1){let O=v[x],P=R.thread_files[x];O&&($.info("upload_session_completed",{upload_session_id:h.id,thread_file_id:O.uploadFileInfo.id,filename:O.file.filename,source_path:O.file.sourcePath,harness:O.file.harness,harness_internal_id:O.file.harnessInternalId,thread_id:P?.thread?.id?.trim()||"<none>"}),s[O.inputIndex]={status:"uploaded",localFile:O.file,thread:P?.thread??null})}}return XWe(s)}finally{await Promise.all(l.map(f=>wp(f)))}}function XWe(e){return e.map((t,n)=>{if(!t)throw new Error(`upload outcome missing for thread file index ${n}`);return t})}var _Wt=new Set(["claudeCode","codex","amp","cursor","cowork","unspecified"]);async function Kpe(e){let t=await u1(),n=t.find(o=>o.id===e);if(n)return n;let r=t.filter(o=>o.id.startsWith(e));if(r.length===1)return r[0];throw r.length===0?new De(`no quarantined thread matches "${e}"`):new De(`"${e}" is ambiguous \u2014 matches ${r.length} entries; use a longer id`)}var eXe={meta:{name:"list",description:"List locally-held (quarantined) threads"},async run(){await x9(new Date);let e=await u1();if(e.length===0){console.log("No quarantined threads.");return}console.log(`${e.length} quarantined thread(s) \u2014 held locally, never uploaded:
684
684
  `);for(let t of e)console.log(` ${t.id.slice(0,12)} ${t.filename} [${t.harness}] ${t.findings.length} finding(s) expires ${t.expiresAt}`);console.log(`
685
685
  Inspect: lore quarantine show <id> Discard: lore quarantine discard <id> Retry: lore quarantine release <id>`)}},EWt={meta:{name:"show",description:"Show a quarantined thread's detector findings"},args:{id:{type:"positional",required:!0,description:"Quarantine id or prefix"}},async run({args:e}){let t=await Kpe(String(e.id));console.log(`Quarantine ${t.id}`),console.log(` file: ${t.filename}`),console.log(` source: ${t.sourcePath}`),console.log(` harness: ${t.harness}`),console.log(` quarantined: ${t.quarantinedAt}`),console.log(` expires: ${t.expiresAt}`),console.log(" findings:");for(let n of t.findings)console.log(` - ${n.ruleId} (${n.disposition}) at line ${n.location.line} ${n.location.jsonPointer}`);console.log(`
686
- The held transcript is never uploaded, and secret values are never shown.`)}},yWt={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 Kpe(String(e.id));await xM(t.id),console.log(`Discarded quarantine ${t.id.slice(0,12)} (deleted locally).`)}},SWt={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 Kpe(String(e.id)),n=await Hi(t.sourcePath);if(!n.exists)throw new Ne(`source transcript no longer exists: ${t.sourcePath} \u2014 run \`lore quarantine discard ${t.id.slice(0,12)}\``);if(!await sn())throw new Ne("not logged in \u2014 run 'lore login' first");let r=_Wt.has(t.harness)?t.harness:"unspecified",o=await fd(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 MA(Gt(),[i]);if(!s||s.status==="no_upload"){console.log("Nothing to upload.");return}if(s.status==="quarantined"){s.quarantineId!==t.id&&await xM(t.id),console.log(`Still held: ${s.findingCount} finding(s) remain in the current source. Remove them, then release again.`);return}await xM(t.id),console.log(`Released ${t.id.slice(0,12)} \u2014 uploaded${s.status==="deduped"?" (already on Lore)":""} and removed from quarantine.`)}finally{await wp(o.tempPath)}}},tXe={meta:{name:"quarantine",description:"Inspect and manage transcripts the scrubber held locally (never uploaded)"},subCommands:{list:eXe,show:EWt,discard:yWt,release:SWt},run:eXe.run};m();uee();FP();on();QP();import{spawn as wWt}from"node:child_process";import{stdin as dXe,stdout as OWt}from"node:process";import{createInterface as kWt}from"node:readline/promises";m();on();Bn();Mo();s0();m();await Ao();var BM=ue(dn(),1);await pb();m();await Ao();await xA();await mb();await DA();await Ab();await gb();var Ac=ue(jt(),1),TWt={enable:"lore enable",disable:"lore disable",restart:"lore restart"},bWt={enable:"installing the launchd agent (\u2264 1 minute)\u2026",disable:"unloading the launchd agent\u2026",restart:"kickstarting the launchd agent\u2026"},IWt={enable:"Background uploads enabled",disable:"Background uploads disabled",restart:"Background uploads restarted"};function nXe(){return{phase:"starting"}}function rXe(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 L0({mode:e,state:t}){return(0,Ac.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Ac.jsx)(Ps,{title:TWt[e],subtitle:"background uploads"}),t.phase==="starting"||t.phase==="in_progress"?(0,Ac.jsx)(Qn,{title:"Working",children:(0,Ac.jsx)(ja,{label:bWt[e]})}):null,t.phase==="finished"?(0,Ac.jsx)(Ms,{kind:"success",title:IWt[e],children:CWt(e,t)}):null,t.phase==="errored"?(0,Ac.jsx)(Ms,{kind:"error",title:"Failed",children:(0,Ac.jsx)(he,{children:t.errorMessage??"Unknown error."})}):null]})}function CWt(e,t){return e==="disable"?(0,Ac.jsx)(he,{children:"The Lore launchd agent has been unloaded and its stable binary removed."}):t.result?(0,Ac.jsxs)(Ee,{flexDirection:"column",children:[(0,Ac.jsx)(an,{label:"LaunchAgent",value:t.result.plistPath}),(0,Ac.jsx)(an,{label:"Stable binary",value:t.result.binaryPath}),(0,Ac.jsx)(an,{label:"Log file",value:t.result.logFile})]}):(0,Ac.jsx)(he,{children:"The Lore launchd agent is running again. Run lore status to inspect it."})}m();await Ao();await xA();await mb();await DA();await gb();ks();var Zr=ue(jt(),1);function DM({report:e}){let t=e.healthy?"success":e.enabled?"warning":"idle";return(0,Zr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Zr.jsx)(Ps,{title:"lore status",subtitle:"background uploads"}),(0,Zr.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,Zr.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Zr.jsxs)(Qn,{title:"Health",children:[(0,Zr.jsx)(an,{label:"State",value:e.health,kind:t}),(0,Zr.jsx)(an,{label:"Enabled",value:e.enabled?"yes":"no",kind:e.enabled?"success":"idle"}),(0,Zr.jsx)(an,{label:"Loaded",value:e.loaded?"yes":"no",kind:e.loaded?"success":"idle"}),(0,Zr.jsx)(an,{label:"Running",value:e.running?"yes":"no",kind:e.running?"success":"idle"}),(0,Zr.jsx)(an,{label:"Heartbeat",value:e.status?.last_heartbeat_at?oXe(e.status.last_heartbeat_at):"never",kind:e.heartbeat_fresh?"success":"idle"}),(0,Zr.jsx)(an,{label:"Last upload",value:e.status?.last_success_at?oXe(e.status.last_success_at):"never"})]})}),(0,Zr.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Zr.jsxs)(Qn,{title:"Paths",children:[(0,Zr.jsx)(an,{label:"LaunchAgent",value:e.plist_path}),(0,Zr.jsx)(an,{label:"Stable binary",value:e.binary_path}),(0,Zr.jsx)(an,{label:"Status file",value:e.status_path}),(0,Zr.jsx)(an,{label:"Install source",value:e.install_source_path}),(0,Zr.jsx)(an,{label:"Label",value:e.label})]})})]}),e.status?.last_error?(0,Zr.jsx)(Ee,{marginTop:1,children:(0,Zr.jsx)(Ms,{kind:"error",title:"Last error",children:(0,Zr.jsx)(he,{color:Re.danger,children:e.status.last_error})})}):null,e.healthy?null:(0,Zr.jsx)(Ee,{marginTop:1,children:(0,Zr.jsx)(Ms,{kind:"warning",title:`Not healthy: ${e.health}`,children:(0,Zr.jsxs)(he,{children:["Run ",(0,Zr.jsx)(he,{bold:!0,children:"lore restart"})," to kick the agent, or ",(0,Zr.jsx)(he,{bold:!0,children:"lore logs"})," to inspect recent activity."]})})})]})}function oXe(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 NM=ue(jt(),1);function vWt({mode:e,perform:t}){let[n,r]=(0,BM.useState)(nXe),{exit:o}=ws();return(0,BM.useEffect)(()=>{let i=!1,s=u=>{i||r(l=>rXe(l,u))};return(async()=>{try{await t(s)}catch(u){s({kind:"error",message:u instanceof Error?u.message:String(u)}),setTimeout(()=>o(u instanceof Error?u:new Error(String(u))),100);return}setTimeout(()=>o(),100)})(),()=>{i=!0}},[]),(0,NM.jsx)(L0,{mode:e,state:n})}async function Jpe(e,t){await sl((0,NM.jsx)(vWt,{mode:e,perform:t})).waitUntilExit()}async function iXe(e){function t(){let{exit:r}=ws();return(0,BM.useEffect)(()=>{setTimeout(()=>r(),50)},[]),(0,NM.jsx)(DM,{report:e})}await sl((0,NM.jsx)(t,{})).waitUntilExit()}HD();m();Mo();var O9=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 sXe="(we're waiting on macOS launchd; this takes up to a minute \u2026)";function RWt(){if(!process.stdout.isTTY)return console.log(sXe),{stop(){}};let e=["|","/","-","\\"],t=0,n=()=>{process.stdout.write(`\r${e[t%e.length]} ${sXe}`),t++};n();let r=setInterval(n,100);return{stop(){clearInterval(r),process.stdout.write("\r\x1B[2K")}}}async function Zpe(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:_p()}:{kind:"restart_finished"})}async function Wpe(e,t){e({kind:"disable_started"}),await t(),e({kind:"disable_finished"})}async function Xpe(e,t){let n=t?.enableLaunchAgent??GP,r=t?.restartLaunchAgent??a$,o=t?.disableLaunchAgent??gYe,i=e==="restart"?r:n;if(e==="disable"){if(t?.progress){await Wpe(t.progress,o);return}if(vu()){await Jpe("disable",l=>Wpe(l,o));return}await Wpe(O9,o);return}if(t?.progress){await Zpe(e,t.progress,i);return}if(vu()){await Jpe(e,l=>Zpe(e,l,i));return}let s=RWt(),u=[];try{await Zpe(e,l=>u.push(l),i)}finally{s.stop()}if(e==="enable"){$.info("daemon.enable.captured",{kinds:u.map(f=>f?.kind??"unknown")});let l=xWt(u);O9({kind:"enable_finished",plistPath:l.plistPath,binaryPath:l.binaryPath,logFile:_p()})}else O9({kind:"restart_finished"})}function xWt(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 uXe={meta:{name:"enable",description:"Install and start background uploads"},async run({data:e}){await Xpe("enable",e)}},k9={meta:{name:"disable",description:"Stop and remove background uploads"},async run({data:e}){await Xpe("disable",e)}},cXe={meta:{name:"restart",description:"Restart background uploads"},async run({data:e}){await Xpe("restart",e)}};function DWt(e){let t=[];return t.push(`Lore: ${e.health}`),t.push(`Enabled: ${e.enabled}`),t.push(`Loaded: ${e.loaded}`),e.running&&t.push("Process running: true"),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(`
687
- `)}async function NWt(){await x9(new Date);let e=(await u1()).length,t=KWe(),n=t.source?`v${t.schemaVersion} (bundled, ${t.source.tool} ${t.source.ref})`:`v${t.schemaVersion} (bundled)`;return{quarantined:e,ruleset:n}}function aXe(e){return`Scrubber: ${e.quarantined===0?"no quarantined threads":`${e.quarantined} quarantined thread(s) \u2014 run \`lore quarantine\``}; ruleset ${e.ruleset}`}var lXe={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??u$)(),o=await NWt();if(e.json){if(console.log(JSON.stringify({...r,scrubber:o},null,2)),!r.healthy)throw new Ne(`Lore background uploads are not healthy: ${r.health}`);return}if(vu()){if(await iXe(r),console.log(aXe(o)),!r.healthy)throw new Ne("");return}if(console.log(DWt(r)),console.log(aXe(o)),!r.healthy)throw new Ne(`Lore background uploads are not healthy: ${r.health}`)}};var wM="@loredotlink/cli",P9={command:"npm",args:["uninstall","-g",wM]};function PWt(e){switch(e){case"yarn":return{command:"yarn",args:["global","remove",wM]};case"pnpm":return{command:"pnpm",args:["remove","-g",wM]};case"npm":case"unknown":return P9}}async function MWt(){if(!dXe.isTTY)return"";let e=kWt({input:dXe,output:OWt});try{return await e.question("Why are you uninstalling Lore? (optional) ")}finally{e.close()}}async function LWt({promptForReason:e=MWt,track:t=Ch,detectPackageManager:n=r$,runDisable:r=QWt,runPackageCommand:o=FWt,log:i=console.log}={}){let s=(await e()).trim();s&&await efe({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 efe({log:i,startMessage:"Stopping background uploads...",failureAction:"stop background uploads",manualInstruction:"You can run `lore disable` manually.",run:r});let u=await UWt(n,i),l=pXe(u.command,u.args);await efe({log:i,startMessage:`Uninstalling ${wM} with ${u.command}...`,failureAction:`uninstall ${wM}`,manualInstruction:`You can run \`${l}\` manually.`,run:()=>o(u.command,u.args)}),i("goodbye")}async function UWt(e,t){try{let{packageManager:n}=await e();return PWt(n)}catch(n){return t(`Could not detect package manager: ${ln(n)}`),t(`Falling back to \`${pXe(P9.command,P9.args)}\`.`),P9}}async function efe({log:e,startMessage:t,failureAction:n,manualInstruction:r,run:o}){e(t);try{await o()}catch(i){e(`Could not ${n}: ${ln(i)}`),e(r)}}function pXe(e,t){return[e,...t].join(" ")}async function QWt(){await lT(k9,{rawArgs:[]})}function FWt(e,t){return new Promise((n,r)=>{let o=wWt(e,t,{stdio:"inherit"});o.on("error",r),o.on("close",(i,s)=>{if(i===0){n();return}let u=s?`signal ${s}`:`exit code ${i??"unknown"}`;r(new Error(`${e} ${t.join(" ")} failed with ${u}`))})})}var fXe={meta:{name:"uninstall",description:"Uninstall Lore and remove local integrations",skipAutoupdate:!0},async run(){await LWt()}};m();FP();on();var OM="@loredotlink/cli";async function GWt({runUpdate:e=cYe,log:t=console.log}={}){t("Checking for Lore CLI updates...");let n=await e();if(jWt(n,t))throw new Ne("")}function jWt(e,t){return e?e.error?(t(`Update failed: ${e.error}`),!0):e.newVersion?(t(`Updated ${OM} 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 ${OM}\` to update manually.`),!1):e.latestVersion?(t(`A newer version of ${OM} is available (${e.latestVersion}). Run \`npm install -g ${OM}\` to update manually.`),!1):(t("No update was applied."),!1):(t(`This CLI build cannot be updated automatically. Install ${OM} with npm to update.`),!1)}var mXe={meta:{name:"update",description:"Update the Lore CLI in the foreground",skipAutoupdate:!0},async run(){await GWt()}};m();sc();var AXe={meta:{name:"version",description:"Print the Lore CLI version"},run(){console.log(hu())}};m();m();Pr();on();async function gXe(){if(!await sn())throw new Ne("not logged in \u2014 run 'lore login' first")}on();Bn();Fa();s0();await Vle();var hXe={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($.info("command_start",{command:"configure"}),await gXe(),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 Ne(`--set must be valid JSON: ${i}`)}let r;try{r=Sle(n,"from --set")}catch(o){let i=o instanceof Error?o.message:String(o);throw new Ne(i)}await pd(r),console.log(JSON.stringify(e$(r),null,2));return}if(e.json){let n=await Ho();console.log(JSON.stringify(e$(n),null,2));return}if(!vu())throw new Ne("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 y$({client:t?.client})}};FP();sc();on();Bn();m();n$();var zWt=()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||!!e.CI},_Xe="\x1B",M9=(e,t,n)=>r=>n?r:`${_Xe}[${e}m${r}${_Xe}[${t}m`,HWt=e=>({cyan:M9(36,39,e),gray:M9(90,39,e),bold:M9(1,22,e),underline:M9(4,24,e)});async function tfe(e,t={}){let n=t.noColor??zWt(),{cyan:r,gray:o,bold:i,underline:s}=HWt(n),u=await Ga(e.meta),l=u?.name??"lore",f=u?.description??"",h=await Ga(e.subCommands),_=[];for(let[R,x]of Object.entries(h??{})){let O=await Ga(x),P=await Ga(O.meta);P?.hidden||_.push({name:R,description:P?.description??"",subDef:O})}let y=[];for(let R of _){y.push([r(R.name),R.description]);let x=await Ga(R.subDef.subCommands);if(x)for(let[O,P]of Object.entries(x)){let j=await Ga(P),G=await Ga(j.meta);G?.hidden||y.push([` ${r(O)}`,G?.description??""])}}let T=y.reduce((R,[x])=>Math.max(R,x.length),0),v=[];v.push(o(`${f} (${l})`),""),v.push(`${s(i("USAGE"))} ${r(`${l} ${_.map(R=>R.name).join("|")}`)}`,""),v.push(s(i("COMMANDS")),"");for(let[R,x]of y)v.push(` ${R.padEnd(T)} ${x}`);return v.push("",`Use ${r(`${l} <command> --help`)} for more information about a command.`),v.join(`
688
- `)}m();n$();async function EXe(e,t){let n=t.filter(i=>!i.startsWith("-")),r=e,o;for(let i of n){let s=await Ga(r.subCommands);if(!s||!(i in s))break;let u=await Ga(s[i]);if(!u)break;o=r,r=u}return[r,o]}m();import $Wt from"node:os";on();Bn();Fa();LD();function qWt(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 L9(){return await Ih(),Ho()}function nfe(e){let t=ji(e);if(!t)throw new Ne("path must not be empty");return t}async function yXe(){let e=await L9();return qWt(e)}function SXe(e){return e.length>0}function VWt(e){let t=Math.max(4,...e.map(o=>o.kind.length)),n=Math.max(8,...e.map(o=>o.value.length));console.log(`${"TYPE".padEnd(t)} ${"LOCATION".padEnd(n)} WORKSPACE`);for(let o of e)console.log(`${o.kind.padEnd(t)} ${o.value.padEnd(n)} ${o.workspace}`);let r=e.find(o=>o.kind==="cwd"&&o.value===$Wt.homedir());r&&console.log(`Warning: ${r.value} is your entire home directory. Narrow capture scope with \`lore listen delete ${r.value}\` and \`lore listen create <project-path>\`.`)}var YWt={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}){$.info("command_start",{command:"listen create"});let t=await L9(),n=nfe(String(e.path));await pd({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),console.log(`uploading from ${n}`)}},KWt={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}){$.info("command_start",{command:"listen list"});let t=await yXe();if(e.json){console.log(JSON.stringify({version:1,locations:t},null,2));return}if(!SXe(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}VWt(t)}},JWt={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}){$.info("command_start",{command:"listen delete"});let t=await L9(),n=nfe(String(e.path)),r=t.include.cwd.filter(o=>o!==n);if(r.length===t.include.cwd.length)throw new Ne(`no upload directory at ${n}`);await pd({...t,include:{...t.include,cwd:r}}),console.log(`stopped uploading from ${n}`)}},ZWt={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}){$.info("command_start",{command:"listen update"});let t=nfe(String(e.path));throw(await L9()).include.cwd.includes(t)?new Ne("`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 Ne(`no upload directory at ${t}`)}},TXe={meta:{name:"listen",description:"Manage the directories Lore is allowed to auto-upload from."},subCommands:{create:YWt,list:KWt,update:ZWt,delete:JWt},async run({rawArgs:e}){let t=new Set(["create","list","update","delete"]);if(e.some(r=>t.has(r)))return;$.info("command_start",{command:"listen"});let n=await yXe();if(console.log(`lore listen \u2014 locations Lore is allowed to auto-upload from
689
- `),!SXe(n))console.log(" currently uploading from: nothing yet \u2014 opt in to your first location below.");else{console.log(" currently uploading from:");let r=Math.max(8,...n.map(o=>o.value.length));for(let o of n){let i=o.kind==="cwd"?"dir":"repo";console.log(` ${i} ${o.value.padEnd(r)} \u2192 ${o.workspace}`)}}console.log(""),console.log(" For guided, interactive setup, run `lore configure`."),console.log(" These subcommands are the low-level CRUD for scripted edits:"),console.log(""),console.log(" lore listen create <path> start uploading from a directory"),console.log(" lore listen list [--json] print the upload list"),console.log(" lore listen delete <path> stop uploading from a directory"),console.log(""),console.log(" Example: lore listen create ~/code/projectA")}};m();LD();m();on();Mo();Fa();Th();import WWt from"node:fs/promises";async function XWt(e){try{return await WWt.access(e),!0}catch(t){if(kr(t,"ENOENT"))return!1;throw t}}async function eXt({uploadFilterPath:e=MT()}={}){if(!await XWt(e))return;let t=await Ho(e),n=[],r=[];for(let o of t.include.cwd){let i=await y0(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await pd({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var bXe={id:"20260519000000-upload-filter-cwds-to-repos",run:eXt};var tXt=[j7e,bXe];async function nXt(e=tXt,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 IXe={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await nXt()}};hse();QP();m();Pr();sc();Bn();Cle();import{platform as rXt,release as oXt}from"node:os";function iXt(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function CXe(e){try{let t={command:iXt(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:hu(),nodeVersion:process.version,platform:rXt(),release:oXt()};(await V7e({error:e.error,context:t,logger:$,send:async r=>{let i=await Gt().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"&&$.info("error_report_sent")}catch(t){$.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}m();import{setTimeout as BXe}from"node:timers/promises";Pr();on();m();on();Bn();Fa();import vXe from"node:fs";import sXt from"node:fs/promises";import{watch as aXt}from"node:fs/promises";import{setTimeout as uXt}from"node:timers/promises";async function rfe(e){let t=await e.listSkillInstallationSync({});if(t.status!==200){let s=t.body?.message??`listSkillInstallationSync returned ${t.status}`;throw new Ne(s)}$.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 u=await i1(s.skill_id),l=u?.installPath??RM(s.root_kind,s.name),f=await xXe(l),h=f===null?null:Vf(f);if(f!==null&&!u){$.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 cl(_Xt(s,l)),r+=1;continue}if(u&&h!==null&&h!==u.lastInstalledHash&&h!==s.latest_content_hash&&s.latest_version!==u.lastInstalledVersion){$.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 cl({...u,lastSyncStatus:"conflict"}),r+=1;continue}if(u&&h===s.latest_content_hash){s.installed_version!==s.latest_version&&(await U9(e,s.id,s.latest_version),$.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version})),await cl({...u,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(u?.lastSyncStatus==="proposed"&&h===u.lastInstalledHash)continue;if(u?.lastInstalledVersion===s.latest_version&&f!==null){s.installed_version!==s.latest_version&&(await U9(e,s.id,s.latest_version),$.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await cl({...u,installationId:s.id}));continue}$.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 _=await hXt(e,s.skill_id,s.latest_version);if(Vf(_)!==s.latest_content_hash)throw new Ne(`downloaded SKILL.md hash did not match metadata for ${s.skill_id}`);let T=await C9(s.root_kind,s.name,_);await U9(e,s.id,s.latest_version),$.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await cl({installationId:s.id,skillId:s.skill_id,name:s.name,rootKind:s.root_kind,installPath:T,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"}),$.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:T}),n+=1}let i=await mXt(e,o);return{installedUpdated:n,localEditsUploaded:i,conflicts:r}}async function RXe(e){if(e.signal?.aborted)return;let t=e.sleep??fXt;$.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();$.info("skill_sync_pass_started",{reason:l,event_type:f?.type,event_id_present:!!f?.id});try{let _=await(e.syncPublishedLocalSkills??BWe)(e.client),y=await rfe(e.client),T={captured:_.pushed.length,installedUpdated:y.installedUpdated,localEditsUploaded:y.localEditsUploaded,conflicts:y.conflicts};$.info("skill_sync_pass_completed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,published_local_pushed:_.pushed.length,published_local_unchanged:_.unchanged.length,published_local_skipped:_.skipped.length,installed_updated:y.installedUpdated,local_edits_uploaded:y.localEditsUploaded,conflicts:y.conflicts,duration_ms:Date.now()-h}),await e.onSyncPass?.({reason:l,event:f,result:T}),f?.id&&await Fpe(f.id)}catch(_){throw $.error("skill_sync_pass_failed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,error:ln(_),duration_ms:Date.now()-h}),_}}),await n},o=async l=>{let f=l.id;f&&(n=n.then(async()=>{e.signal?.aborted||await Fpe(f)}),await n)};await r("startup");let i=(async()=>{for await(let l of e.events??dXt()){if(e.signal?.aborted)return;if(l.type==="stream.reconnected"){await r("reconnect",l);continue}if(!pXt(l)){await o(l);continue}await r(l.type==="stream.catchup_truncated"?"catchup_truncated":"event",l)}})(),s=e.watch?cXt({signal:e.signal,debounceMs:e.watchDebounceMs,sleep:t,watchRoots:e.watchRoots,watchEventSource:e.watchEventSource,runPass:()=>r("fs_event")}):Promise.resolve(),u=(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,u,s])}async function cXt(e){let t=e.debounceMs??2e3,n=await Ho(),r=n.include.cwd.length,o=(e.watchRoots??lWe(process.cwd(),n.include.cwd)).filter(_=>{try{return vXe.existsSync(_)&&vXe.statSync(_).isDirectory()}catch{return!1}});if(o.length===0)return $.info("skill_watch_no_roots",{configured_project_root_count:r}),lXt(e.signal);$.info("skill_watch_started",{watch_root_count:o.length,debounce_ms:t});let i=!1,s=!1,u,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=()=>{$.info("skill_watch_pass_scheduled",{debounce_ms:t}),u&&clearTimeout(u),u=setTimeout(()=>{u=void 0,l()},t),u.unref?.()},h=async _=>{for(;!e.signal?.aborted;)try{let y=e.watchEventSource?.(_,e.signal)??aXt(_,{signal:e.signal,recursive:!0});for await(let T of y){if(e.signal?.aborted)break;let v=T.filename?String(T.filename):null,R=!v||v.endsWith("SKILL.md");$.info("skill_watch_event",{root:_,filename:v,filename_is_skill_md:R}),R&&f()}}catch(y){if(e.signal?.aborted||y?.name==="AbortError")break;$.warn("skill_watch_retry",{root:_,retry_ms:3e4,error:ln(y)}),await e.sleep(3e4,e.signal)}};try{await Promise.all(o.map(h))}finally{for(u&&clearTimeout(u);i;)await uXt(50).catch(()=>{})}}async function lXt(e){e?.aborted||await new Promise(t=>e?.addEventListener("abort",()=>t(),{once:!0}))}async function*dXt(){}function pXt(e){return e.type.startsWith("skill.version.")||e.type==="skill.published"||e.type==="stream.catchup_truncated"}function fXt(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 mXt(e,t){let n=0,r,o=await Ha();for(let i of await bWe()){if(i.lastSyncStatus==="conflict")continue;let s=o.published[i.skillId];if(!s)continue;let u=await xXe(i.installPath);if(u===null)continue;let l=Vf(u);if(l===i.lastInstalledHash||l===s.lastPublishedHash)continue;$.info("skill_local_edit_detected",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,base_version:i.baseVersion,last_sync_status:i.lastSyncStatus});let f=t.get(i.skillId);if(f&&f.latest_version!==i.baseVersion){$.warn("skill_installation_conflict_detected",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,reason:"remote_advanced_before_upload",base_version:i.baseVersion,remote_version:f.latest_version}),await cl({...i,lastSyncStatus:"conflict"});continue}r??=await AXt(e);let h=await gXt(e,i.skillId);if(!h||h!==r){$.info("skill_local_edit_skipped_not_owner",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath});continue}let _="owner_update",y;try{y=await s1(e,{skillId:i.skillId,name:i.name,description:null,bodyMd:u,filePath:i.installPath,rootKind:i.rootKind},{syncAction:_,baseVersion:i.baseVersion})}catch(T){throw $.warn("skill_local_edit_upload_failed",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,sync_action:_,base_version:i.baseVersion,error:ln(T)}),T}$.info("skill_local_edit_uploaded",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,sync_action:_,version:y.version,version_status:y.version_status}),y.version_status==="accepted"&&(await U9(e,i.installationId,y.version),await cl({...i,baseVersion:y.version,baseContentHash:y.content_hash,lastInstalledVersion:y.version,lastInstalledHash:y.content_hash,lastSyncStatus:"current"}),await a1({name:i.name,bodyMd:u,filePath:i.installPath,rootKind:i.rootKind},{skillId:i.skillId,version:y.version})),n+=1}return n}async function U9(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 Ne(`wrote skill locally, but failed to record installed version: ${o}`)}}async function AXt(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}async function gXt(e,t){let n=await e.getSkillDetail({params:{id:t}});return n.status!==200?null:n.body.owner?.id??null}async function hXt(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 Ne(o)}return typeof r.body=="string"?r.body:String(r.body)}function _Xt(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 xXe(e){try{return await sXt.readFile(e,"utf8")}catch{return null}}m();Pr();on();Bn();import{setTimeout as EXt}from"node:timers/promises";var yXt=75e3,SXt=1e3,TXt=6e4,bXt=250,Q9=class extends Ne{constructor(t){super(`skill sync event stream returned ${t}; login is required`),this.name="SkillSyncEventStreamAuthError"}};async function*NXe(e){if(!e.userId)throw new Ne("workspace skill sync daemon needs a user subject to subscribe to");if(e.organizationIds.length===0)throw new Ne("workspace skill sync daemon needs at least one workspace to subscribe to");let t=e.reconnect??!1,n=RXt(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 IXt({...e,lastEventId:r}))i=!0,s.id&&(r=s.id),$.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,$.warn("skill_event_stream_disconnected",{saw_frame:i,will_reconnect:!0}),i&&n.reset(),$.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 Q9||!t)throw i;o=!0,$.warn("skill_event_stream_disconnected",{saw_frame:!1,will_reconnect:!0,error:ln(i)}),$.info("skill_event_stream_reconnect_scheduled",{reason:"error"}),await n.sleep(e.signal)}}async function*IXt(e){let t=e.token??await(e.getAccessToken??sn)();if(!t)throw new Ne("workspace skill sync daemon requires login \u2014 run 'lore login' first");let n=new URL("/api/events/stream",e.apiBaseUrl??cd());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),$.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 $.warn("skill_event_stream_auth_failed",{status:o.status}),new Q9(o.status);if(!o.ok)throw new Ne(`skill sync event stream returned ${o.status}`);if(!o.body)throw new Ne("skill sync event stream returned no response body");$.info("skill_event_stream_connected",{status:o.status,organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});for await(let i of CXt(o.body,{signal:e.signal,heartbeatTimeoutMs:e.heartbeatTimeoutMs??yXt}))yield{id:i.id,type:i.event??"message"}}async function*CXt(e,t={}){let n=new TextDecoder,r=e.getReader(),o="";try{for(;;){let{done:s,value:u}=await vXt(r,t.heartbeatTimeoutMs,t.signal);if(s)break;o+=n.decode(u,{stream:!0});let l=o.split(/\r?\n\r?\n/);o=l.pop()??"";for(let f of l){let h=DXe(f);h&&(yield h)}}o+=n.decode();let i=DXe(o);i&&(yield i)}finally{r.releaseLock()}}async function vXt(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 Ne("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 DXe(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}
686
+ The held transcript is never uploaded, and secret values are never shown.`)}},yWt={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 Kpe(String(e.id));await xM(t.id),console.log(`Discarded quarantine ${t.id.slice(0,12)} (deleted locally).`)}},SWt={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 Kpe(String(e.id)),n=await Hi(t.sourcePath);if(!n.exists)throw new De(`source transcript no longer exists: ${t.sourcePath} \u2014 run \`lore quarantine discard ${t.id.slice(0,12)}\``);if(!await sn())throw new De("not logged in \u2014 run 'lore login' first");let r=_Wt.has(t.harness)?t.harness:"unspecified",o=await fd(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 MA(Gt(),[i]);if(!s||s.status==="no_upload"){console.log("Nothing to upload.");return}if(s.status==="quarantined"){s.quarantineId!==t.id&&await xM(t.id),console.log(`Still held: ${s.findingCount} finding(s) remain in the current source. Remove them, then release again.`);return}await xM(t.id),console.log(`Released ${t.id.slice(0,12)} \u2014 uploaded${s.status==="deduped"?" (already on Lore)":""} and removed from quarantine.`)}finally{await wp(o.tempPath)}}},tXe={meta:{name:"quarantine",description:"Inspect and manage transcripts the scrubber held locally (never uploaded)"},subCommands:{list:eXe,show:EWt,discard:yWt,release:SWt},run:eXe.run};m();uee();FP();on();QP();import{spawn as wWt}from"node:child_process";import{stdin as dXe,stdout as OWt}from"node:process";import{createInterface as kWt}from"node:readline/promises";m();on();Bn();Mo();s0();m();await Ao();var BM=ue(dn(),1);await pb();m();await Ao();await xA();await mb();await DA();await Ab();await gb();var Ac=ue(jt(),1),TWt={enable:"lore enable",disable:"lore disable",restart:"lore restart"},bWt={enable:"installing the launchd agent (\u2264 1 minute)\u2026",disable:"unloading the launchd agent\u2026",restart:"kickstarting the launchd agent\u2026"},IWt={enable:"Background uploads enabled",disable:"Background uploads disabled",restart:"Background uploads restarted"};function nXe(){return{phase:"starting"}}function rXe(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 L0({mode:e,state:t}){return(0,Ac.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Ac.jsx)(Ps,{title:TWt[e],subtitle:"background uploads"}),t.phase==="starting"||t.phase==="in_progress"?(0,Ac.jsx)(Qn,{title:"Working",children:(0,Ac.jsx)(ja,{label:bWt[e]})}):null,t.phase==="finished"?(0,Ac.jsx)(Ms,{kind:"success",title:IWt[e],children:CWt(e,t)}):null,t.phase==="errored"?(0,Ac.jsx)(Ms,{kind:"error",title:"Failed",children:(0,Ac.jsx)(he,{children:t.errorMessage??"Unknown error."})}):null]})}function CWt(e,t){return e==="disable"?(0,Ac.jsx)(he,{children:"The Lore launchd agent has been unloaded and its stable binary removed."}):t.result?(0,Ac.jsxs)(Ee,{flexDirection:"column",children:[(0,Ac.jsx)(an,{label:"LaunchAgent",value:t.result.plistPath}),(0,Ac.jsx)(an,{label:"Stable binary",value:t.result.binaryPath}),(0,Ac.jsx)(an,{label:"Log file",value:t.result.logFile})]}):(0,Ac.jsx)(he,{children:"The Lore launchd agent is running again. Run lore status to inspect it."})}m();await Ao();await xA();await mb();await DA();await gb();ks();var Zr=ue(jt(),1);function DM({report:e}){let t=e.healthy?"success":e.enabled?"warning":"idle";return(0,Zr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Zr.jsx)(Ps,{title:"lore status",subtitle:"background uploads"}),(0,Zr.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,Zr.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Zr.jsxs)(Qn,{title:"Health",children:[(0,Zr.jsx)(an,{label:"State",value:e.health,kind:t}),(0,Zr.jsx)(an,{label:"Enabled",value:e.enabled?"yes":"no",kind:e.enabled?"success":"idle"}),(0,Zr.jsx)(an,{label:"Loaded",value:e.loaded?"yes":"no",kind:e.loaded?"success":"idle"}),(0,Zr.jsx)(an,{label:"Running",value:e.running?"yes":"no",kind:e.running?"success":"idle"}),(0,Zr.jsx)(an,{label:"Heartbeat",value:e.status?.last_heartbeat_at?oXe(e.status.last_heartbeat_at):"never",kind:e.heartbeat_fresh?"success":"idle"}),(0,Zr.jsx)(an,{label:"Last upload",value:e.status?.last_success_at?oXe(e.status.last_success_at):"never"})]})}),(0,Zr.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Zr.jsxs)(Qn,{title:"Paths",children:[(0,Zr.jsx)(an,{label:"LaunchAgent",value:e.plist_path}),(0,Zr.jsx)(an,{label:"Stable binary",value:e.binary_path}),(0,Zr.jsx)(an,{label:"Status file",value:e.status_path}),(0,Zr.jsx)(an,{label:"Install source",value:e.install_source_path}),(0,Zr.jsx)(an,{label:"Label",value:e.label})]})})]}),e.status?.last_error?(0,Zr.jsx)(Ee,{marginTop:1,children:(0,Zr.jsx)(Ms,{kind:"error",title:"Last error",children:(0,Zr.jsx)(he,{color:Re.danger,children:e.status.last_error})})}):null,e.healthy?null:(0,Zr.jsx)(Ee,{marginTop:1,children:(0,Zr.jsx)(Ms,{kind:"warning",title:`Not healthy: ${e.health}`,children:(0,Zr.jsxs)(he,{children:["Run ",(0,Zr.jsx)(he,{bold:!0,children:"lore restart"})," to kick the agent, or ",(0,Zr.jsx)(he,{bold:!0,children:"lore logs"})," to inspect recent activity."]})})})]})}function oXe(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 NM=ue(jt(),1);function vWt({mode:e,perform:t}){let[n,r]=(0,BM.useState)(nXe),{exit:o}=ws();return(0,BM.useEffect)(()=>{let i=!1,s=u=>{i||r(l=>rXe(l,u))};return(async()=>{try{await t(s)}catch(u){s({kind:"error",message:u instanceof Error?u.message:String(u)}),setTimeout(()=>o(u instanceof Error?u:new Error(String(u))),100);return}setTimeout(()=>o(),100)})(),()=>{i=!0}},[]),(0,NM.jsx)(L0,{mode:e,state:n})}async function Jpe(e,t){await sl((0,NM.jsx)(vWt,{mode:e,perform:t})).waitUntilExit()}async function iXe(e){function t(){let{exit:r}=ws();return(0,BM.useEffect)(()=>{setTimeout(()=>r(),50)},[]),(0,NM.jsx)(DM,{report:e})}await sl((0,NM.jsx)(t,{})).waitUntilExit()}HD();m();Mo();var O9=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 sXe="(we're waiting on macOS launchd; this takes up to a minute \u2026)";function RWt(){if(!process.stdout.isTTY)return console.log(sXe),{stop(){}};let e=["|","/","-","\\"],t=0,n=()=>{process.stdout.write(`\r${e[t%e.length]} ${sXe}`),t++};n();let r=setInterval(n,100);return{stop(){clearInterval(r),process.stdout.write("\r\x1B[2K")}}}async function Zpe(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:_p()}:{kind:"restart_finished"})}async function Wpe(e,t){e({kind:"disable_started"}),await t(),e({kind:"disable_finished"})}async function Xpe(e,t){let n=t?.enableLaunchAgent??GP,r=t?.restartLaunchAgent??a$,o=t?.disableLaunchAgent??gYe,i=e==="restart"?r:n;if(e==="disable"){if(t?.progress){await Wpe(t.progress,o);return}if(vu()){await Jpe("disable",l=>Wpe(l,o));return}await Wpe(O9,o);return}if(t?.progress){await Zpe(e,t.progress,i);return}if(vu()){await Jpe(e,l=>Zpe(e,l,i));return}let s=RWt(),u=[];try{await Zpe(e,l=>u.push(l),i)}finally{s.stop()}if(e==="enable"){$.info("daemon.enable.captured",{kinds:u.map(f=>f?.kind??"unknown")});let l=xWt(u);O9({kind:"enable_finished",plistPath:l.plistPath,binaryPath:l.binaryPath,logFile:_p()})}else O9({kind:"restart_finished"})}function xWt(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 uXe={meta:{name:"enable",description:"Install and start background uploads"},async run({data:e}){await Xpe("enable",e)}},k9={meta:{name:"disable",description:"Stop and remove background uploads"},async run({data:e}){await Xpe("disable",e)}},cXe={meta:{name:"restart",description:"Restart background uploads"},async run({data:e}){await Xpe("restart",e)}};function DWt(e){let t=[];return t.push(`Lore: ${e.health}`),t.push(`Enabled: ${e.enabled}`),t.push(`Loaded: ${e.loaded}`),e.running&&t.push("Process running: true"),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(`
687
+ `)}async function NWt(){await x9(new Date);let e=(await u1()).length,t=KWe(),n=t.source?`v${t.schemaVersion} (bundled, ${t.source.tool} ${t.source.ref})`:`v${t.schemaVersion} (bundled)`;return{quarantined:e,ruleset:n}}function aXe(e){return`Scrubber: ${e.quarantined===0?"no quarantined threads":`${e.quarantined} quarantined thread(s) \u2014 run \`lore quarantine\``}; ruleset ${e.ruleset}`}var lXe={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??u$)(),o=await NWt();if(e.json){if(console.log(JSON.stringify({...r,scrubber:o},null,2)),!r.healthy)throw new De(`Lore background uploads are not healthy: ${r.health}`);return}if(vu()){if(await iXe(r),console.log(aXe(o)),!r.healthy)throw new De("");return}if(console.log(DWt(r)),console.log(aXe(o)),!r.healthy)throw new De(`Lore background uploads are not healthy: ${r.health}`)}};var wM="@loredotlink/cli",P9={command:"npm",args:["uninstall","-g",wM]};function PWt(e){switch(e){case"yarn":return{command:"yarn",args:["global","remove",wM]};case"pnpm":return{command:"pnpm",args:["remove","-g",wM]};case"npm":case"unknown":return P9}}async function MWt(){if(!dXe.isTTY)return"";let e=kWt({input:dXe,output:OWt});try{return await e.question("Why are you uninstalling Lore? (optional) ")}finally{e.close()}}async function LWt({promptForReason:e=MWt,track:t=Ch,detectPackageManager:n=r$,runDisable:r=QWt,runPackageCommand:o=FWt,log:i=console.log}={}){let s=(await e()).trim();s&&await efe({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 efe({log:i,startMessage:"Stopping background uploads...",failureAction:"stop background uploads",manualInstruction:"You can run `lore disable` manually.",run:r});let u=await UWt(n,i),l=pXe(u.command,u.args);await efe({log:i,startMessage:`Uninstalling ${wM} with ${u.command}...`,failureAction:`uninstall ${wM}`,manualInstruction:`You can run \`${l}\` manually.`,run:()=>o(u.command,u.args)}),i("goodbye")}async function UWt(e,t){try{let{packageManager:n}=await e();return PWt(n)}catch(n){return t(`Could not detect package manager: ${ln(n)}`),t(`Falling back to \`${pXe(P9.command,P9.args)}\`.`),P9}}async function efe({log:e,startMessage:t,failureAction:n,manualInstruction:r,run:o}){e(t);try{await o()}catch(i){e(`Could not ${n}: ${ln(i)}`),e(r)}}function pXe(e,t){return[e,...t].join(" ")}async function QWt(){await lT(k9,{rawArgs:[]})}function FWt(e,t){return new Promise((n,r)=>{let o=wWt(e,t,{stdio:"inherit"});o.on("error",r),o.on("close",(i,s)=>{if(i===0){n();return}let u=s?`signal ${s}`:`exit code ${i??"unknown"}`;r(new Error(`${e} ${t.join(" ")} failed with ${u}`))})})}var fXe={meta:{name:"uninstall",description:"Uninstall Lore and remove local integrations",skipAutoupdate:!0},async run(){await LWt()}};m();FP();on();var OM="@loredotlink/cli";async function GWt({runUpdate:e=cYe,log:t=console.log}={}){t("Checking for Lore CLI updates...");let n=await e();if(jWt(n,t))throw new De("")}function jWt(e,t){return e?e.error?(t(`Update failed: ${e.error}`),!0):e.newVersion?(t(`Updated ${OM} 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 ${OM}\` to update manually.`),!1):e.latestVersion?(t(`A newer version of ${OM} is available (${e.latestVersion}). Run \`npm install -g ${OM}\` to update manually.`),!1):(t("No update was applied."),!1):(t(`This CLI build cannot be updated automatically. Install ${OM} with npm to update.`),!1)}var mXe={meta:{name:"update",description:"Update the Lore CLI in the foreground",skipAutoupdate:!0},async run(){await GWt()}};m();sc();var AXe={meta:{name:"version",description:"Print the Lore CLI version"},run(){console.log(hu())}};m();m();Pr();on();async function gXe(){if(!await sn())throw new De("not logged in \u2014 run 'lore login' first")}on();Bn();Fa();s0();await Vle();var hXe={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($.info("command_start",{command:"configure"}),await gXe(),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 De(`--set must be valid JSON: ${i}`)}let r;try{r=Sle(n,"from --set")}catch(o){let i=o instanceof Error?o.message:String(o);throw new De(i)}await pd(r),console.log(JSON.stringify(e$(r),null,2));return}if(e.json){let n=await Ho();console.log(JSON.stringify(e$(n),null,2));return}if(!vu())throw new De("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 y$({client:t?.client})}};FP();sc();on();Bn();m();n$();var zWt=()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||!!e.CI},_Xe="\x1B",M9=(e,t,n)=>r=>n?r:`${_Xe}[${e}m${r}${_Xe}[${t}m`,HWt=e=>({cyan:M9(36,39,e),gray:M9(90,39,e),bold:M9(1,22,e),underline:M9(4,24,e)});async function tfe(e,t={}){let n=t.noColor??zWt(),{cyan:r,gray:o,bold:i,underline:s}=HWt(n),u=await Ga(e.meta),l=u?.name??"lore",f=u?.description??"",h=await Ga(e.subCommands),_=[];for(let[R,x]of Object.entries(h??{})){let O=await Ga(x),P=await Ga(O.meta);P?.hidden||_.push({name:R,description:P?.description??"",subDef:O})}let y=[];for(let R of _){y.push([r(R.name),R.description]);let x=await Ga(R.subDef.subCommands);if(x)for(let[O,P]of Object.entries(x)){let j=await Ga(P),G=await Ga(j.meta);G?.hidden||y.push([` ${r(O)}`,G?.description??""])}}let T=y.reduce((R,[x])=>Math.max(R,x.length),0),v=[];v.push(o(`${f} (${l})`),""),v.push(`${s(i("USAGE"))} ${r(`${l} ${_.map(R=>R.name).join("|")}`)}`,""),v.push(s(i("COMMANDS")),"");for(let[R,x]of y)v.push(` ${R.padEnd(T)} ${x}`);return v.push("",`Use ${r(`${l} <command> --help`)} for more information about a command.`),v.join(`
688
+ `)}m();n$();async function EXe(e,t){let n=t.filter(i=>!i.startsWith("-")),r=e,o;for(let i of n){let s=await Ga(r.subCommands);if(!s||!(i in s))break;let u=await Ga(s[i]);if(!u)break;o=r,r=u}return[r,o]}m();import $Wt from"node:os";on();Bn();Fa();LD();function qWt(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 L9(){return await Ih(),Ho()}function nfe(e){let t=ji(e);if(!t)throw new De("path must not be empty");return t}async function yXe(){let e=await L9();return qWt(e)}function SXe(e){return e.length>0}function VWt(e){let t=Math.max(4,...e.map(o=>o.kind.length)),n=Math.max(8,...e.map(o=>o.value.length));console.log(`${"TYPE".padEnd(t)} ${"LOCATION".padEnd(n)} WORKSPACE`);for(let o of e)console.log(`${o.kind.padEnd(t)} ${o.value.padEnd(n)} ${o.workspace}`);let r=e.find(o=>o.kind==="cwd"&&o.value===$Wt.homedir());r&&console.log(`Warning: ${r.value} is your entire home directory. Narrow capture scope with \`lore listen delete ${r.value}\` and \`lore listen create <project-path>\`.`)}var YWt={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}){$.info("command_start",{command:"listen create"});let t=await L9(),n=nfe(String(e.path));await pd({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),console.log(`uploading from ${n}`)}},KWt={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}){$.info("command_start",{command:"listen list"});let t=await yXe();if(e.json){console.log(JSON.stringify({version:1,locations:t},null,2));return}if(!SXe(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}VWt(t)}},JWt={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}){$.info("command_start",{command:"listen delete"});let t=await L9(),n=nfe(String(e.path)),r=t.include.cwd.filter(o=>o!==n);if(r.length===t.include.cwd.length)throw new De(`no upload directory at ${n}`);await pd({...t,include:{...t.include,cwd:r}}),console.log(`stopped uploading from ${n}`)}},ZWt={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}){$.info("command_start",{command:"listen update"});let t=nfe(String(e.path));throw(await L9()).include.cwd.includes(t)?new De("`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 De(`no upload directory at ${t}`)}},TXe={meta:{name:"listen",description:"Manage the directories Lore is allowed to auto-upload from."},subCommands:{create:YWt,list:KWt,update:ZWt,delete:JWt},async run({rawArgs:e}){let t=new Set(["create","list","update","delete"]);if(e.some(r=>t.has(r)))return;$.info("command_start",{command:"listen"});let n=await yXe();if(console.log(`lore listen \u2014 locations Lore is allowed to auto-upload from
689
+ `),!SXe(n))console.log(" currently uploading from: nothing yet \u2014 opt in to your first location below.");else{console.log(" currently uploading from:");let r=Math.max(8,...n.map(o=>o.value.length));for(let o of n){let i=o.kind==="cwd"?"dir":"repo";console.log(` ${i} ${o.value.padEnd(r)} \u2192 ${o.workspace}`)}}console.log(""),console.log(" For guided, interactive setup, run `lore configure`."),console.log(" These subcommands are the low-level CRUD for scripted edits:"),console.log(""),console.log(" lore listen create <path> start uploading from a directory"),console.log(" lore listen list [--json] print the upload list"),console.log(" lore listen delete <path> stop uploading from a directory"),console.log(""),console.log(" Example: lore listen create ~/code/projectA")}};m();LD();m();on();Mo();Fa();Th();import WWt from"node:fs/promises";async function XWt(e){try{return await WWt.access(e),!0}catch(t){if(kr(t,"ENOENT"))return!1;throw t}}async function eXt({uploadFilterPath:e=MT()}={}){if(!await XWt(e))return;let t=await Ho(e),n=[],r=[];for(let o of t.include.cwd){let i=await y0(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await pd({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var bXe={id:"20260519000000-upload-filter-cwds-to-repos",run:eXt};var tXt=[j7e,bXe];async function nXt(e=tXt,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 IXe={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await nXt()}};hse();QP();m();Pr();sc();Bn();Cle();import{platform as rXt,release as oXt}from"node:os";function iXt(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function CXe(e){try{let t={command:iXt(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:hu(),nodeVersion:process.version,platform:rXt(),release:oXt()};(await V7e({error:e.error,context:t,logger:$,send:async r=>{let i=await Gt().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"&&$.info("error_report_sent")}catch(t){$.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}m();import{setTimeout as BXe}from"node:timers/promises";Pr();on();m();on();Bn();Fa();import vXe from"node:fs";import sXt from"node:fs/promises";import{watch as aXt}from"node:fs/promises";import{setTimeout as uXt}from"node:timers/promises";async function rfe(e){let t=await e.listSkillInstallationSync({});if(t.status!==200){let s=t.body?.message??`listSkillInstallationSync returned ${t.status}`;throw new De(s)}$.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 u=await i1(s.skill_id),l=u?.installPath??RM(s.root_kind,s.name),f=await xXe(l),h=f===null?null:Vf(f);if(f!==null&&!u){$.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 cl(_Xt(s,l)),r+=1;continue}if(u&&h!==null&&h!==u.lastInstalledHash&&h!==s.latest_content_hash&&s.latest_version!==u.lastInstalledVersion){$.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 cl({...u,lastSyncStatus:"conflict"}),r+=1;continue}if(u&&h===s.latest_content_hash){s.installed_version!==s.latest_version&&(await U9(e,s.id,s.latest_version),$.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version})),await cl({...u,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(u?.lastSyncStatus==="proposed"&&h===u.lastInstalledHash)continue;if(u?.lastInstalledVersion===s.latest_version&&f!==null){s.installed_version!==s.latest_version&&(await U9(e,s.id,s.latest_version),$.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await cl({...u,installationId:s.id}));continue}$.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 _=await hXt(e,s.skill_id,s.latest_version);if(Vf(_)!==s.latest_content_hash)throw new De(`downloaded SKILL.md hash did not match metadata for ${s.skill_id}`);let T=await C9(s.root_kind,s.name,_);await U9(e,s.id,s.latest_version),$.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await cl({installationId:s.id,skillId:s.skill_id,name:s.name,rootKind:s.root_kind,installPath:T,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"}),$.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:T}),n+=1}let i=await mXt(e,o);return{installedUpdated:n,localEditsUploaded:i,conflicts:r}}async function RXe(e){if(e.signal?.aborted)return;let t=e.sleep??fXt;$.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();$.info("skill_sync_pass_started",{reason:l,event_type:f?.type,event_id_present:!!f?.id});try{let _=await(e.syncPublishedLocalSkills??BWe)(e.client),y=await rfe(e.client),T={captured:_.pushed.length,installedUpdated:y.installedUpdated,localEditsUploaded:y.localEditsUploaded,conflicts:y.conflicts};$.info("skill_sync_pass_completed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,published_local_pushed:_.pushed.length,published_local_unchanged:_.unchanged.length,published_local_skipped:_.skipped.length,installed_updated:y.installedUpdated,local_edits_uploaded:y.localEditsUploaded,conflicts:y.conflicts,duration_ms:Date.now()-h}),await e.onSyncPass?.({reason:l,event:f,result:T}),f?.id&&await Fpe(f.id)}catch(_){throw $.error("skill_sync_pass_failed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,error:ln(_),duration_ms:Date.now()-h}),_}}),await n},o=async l=>{let f=l.id;f&&(n=n.then(async()=>{e.signal?.aborted||await Fpe(f)}),await n)};await r("startup");let i=(async()=>{for await(let l of e.events??dXt()){if(e.signal?.aborted)return;if(l.type==="stream.reconnected"){await r("reconnect",l);continue}if(!pXt(l)){await o(l);continue}await r(l.type==="stream.catchup_truncated"?"catchup_truncated":"event",l)}})(),s=e.watch?cXt({signal:e.signal,debounceMs:e.watchDebounceMs,sleep:t,watchRoots:e.watchRoots,watchEventSource:e.watchEventSource,runPass:()=>r("fs_event")}):Promise.resolve(),u=(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,u,s])}async function cXt(e){let t=e.debounceMs??2e3,n=await Ho(),r=n.include.cwd.length,o=(e.watchRoots??lWe(process.cwd(),n.include.cwd)).filter(_=>{try{return vXe.existsSync(_)&&vXe.statSync(_).isDirectory()}catch{return!1}});if(o.length===0)return $.info("skill_watch_no_roots",{configured_project_root_count:r}),lXt(e.signal);$.info("skill_watch_started",{watch_root_count:o.length,debounce_ms:t});let i=!1,s=!1,u,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=()=>{$.info("skill_watch_pass_scheduled",{debounce_ms:t}),u&&clearTimeout(u),u=setTimeout(()=>{u=void 0,l()},t),u.unref?.()},h=async _=>{for(;!e.signal?.aborted;)try{let y=e.watchEventSource?.(_,e.signal)??aXt(_,{signal:e.signal,recursive:!0});for await(let T of y){if(e.signal?.aborted)break;let v=T.filename?String(T.filename):null,R=!v||v.endsWith("SKILL.md");$.info("skill_watch_event",{root:_,filename:v,filename_is_skill_md:R}),R&&f()}}catch(y){if(e.signal?.aborted||y?.name==="AbortError")break;$.warn("skill_watch_retry",{root:_,retry_ms:3e4,error:ln(y)}),await e.sleep(3e4,e.signal)}};try{await Promise.all(o.map(h))}finally{for(u&&clearTimeout(u);i;)await uXt(50).catch(()=>{})}}async function lXt(e){e?.aborted||await new Promise(t=>e?.addEventListener("abort",()=>t(),{once:!0}))}async function*dXt(){}function pXt(e){return e.type.startsWith("skill.version.")||e.type==="skill.published"||e.type==="stream.catchup_truncated"}function fXt(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 mXt(e,t){let n=0,r,o=await Ha();for(let i of await bWe()){if(i.lastSyncStatus==="conflict")continue;let s=o.published[i.skillId];if(!s)continue;let u=await xXe(i.installPath);if(u===null)continue;let l=Vf(u);if(l===i.lastInstalledHash||l===s.lastPublishedHash)continue;$.info("skill_local_edit_detected",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,base_version:i.baseVersion,last_sync_status:i.lastSyncStatus});let f=t.get(i.skillId);if(f&&f.latest_version!==i.baseVersion){$.warn("skill_installation_conflict_detected",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,reason:"remote_advanced_before_upload",base_version:i.baseVersion,remote_version:f.latest_version}),await cl({...i,lastSyncStatus:"conflict"});continue}r??=await AXt(e);let h=await gXt(e,i.skillId);if(!h||h!==r){$.info("skill_local_edit_skipped_not_owner",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath});continue}let _="owner_update",y;try{y=await s1(e,{skillId:i.skillId,name:i.name,description:null,bodyMd:u,filePath:i.installPath,rootKind:i.rootKind},{syncAction:_,baseVersion:i.baseVersion})}catch(T){throw $.warn("skill_local_edit_upload_failed",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,sync_action:_,base_version:i.baseVersion,error:ln(T)}),T}$.info("skill_local_edit_uploaded",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,sync_action:_,version:y.version,version_status:y.version_status}),y.version_status==="accepted"&&(await U9(e,i.installationId,y.version),await cl({...i,baseVersion:y.version,baseContentHash:y.content_hash,lastInstalledVersion:y.version,lastInstalledHash:y.content_hash,lastSyncStatus:"current"}),await a1({name:i.name,bodyMd:u,filePath:i.installPath,rootKind:i.rootKind},{skillId:i.skillId,version:y.version})),n+=1}return n}async function U9(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 De(`wrote skill locally, but failed to record installed version: ${o}`)}}async function AXt(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}async function gXt(e,t){let n=await e.getSkillDetail({params:{id:t}});return n.status!==200?null:n.body.owner?.id??null}async function hXt(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 De(o)}return typeof r.body=="string"?r.body:String(r.body)}function _Xt(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 xXe(e){try{return await sXt.readFile(e,"utf8")}catch{return null}}m();Pr();on();Bn();import{setTimeout as EXt}from"node:timers/promises";var yXt=75e3,SXt=1e3,TXt=6e4,bXt=250,Q9=class extends De{constructor(t){super(`skill sync event stream returned ${t}; login is required`),this.name="SkillSyncEventStreamAuthError"}};async function*NXe(e){if(!e.userId)throw new De("workspace skill sync daemon needs a user subject to subscribe to");if(e.organizationIds.length===0)throw new De("workspace skill sync daemon needs at least one workspace to subscribe to");let t=e.reconnect??!1,n=RXt(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 IXt({...e,lastEventId:r}))i=!0,s.id&&(r=s.id),$.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,$.warn("skill_event_stream_disconnected",{saw_frame:i,will_reconnect:!0}),i&&n.reset(),$.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 Q9||!t)throw i;o=!0,$.warn("skill_event_stream_disconnected",{saw_frame:!1,will_reconnect:!0,error:ln(i)}),$.info("skill_event_stream_reconnect_scheduled",{reason:"error"}),await n.sleep(e.signal)}}async function*IXt(e){let t=e.token??await(e.getAccessToken??sn)();if(!t)throw new De("workspace skill sync daemon requires login \u2014 run 'lore login' first");let n=new URL("/api/events/stream",e.apiBaseUrl??cd());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),$.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 $.warn("skill_event_stream_auth_failed",{status:o.status}),new Q9(o.status);if(!o.ok)throw new De(`skill sync event stream returned ${o.status}`);if(!o.body)throw new De("skill sync event stream returned no response body");$.info("skill_event_stream_connected",{status:o.status,organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});for await(let i of CXt(o.body,{signal:e.signal,heartbeatTimeoutMs:e.heartbeatTimeoutMs??yXt}))yield{id:i.id,type:i.event??"message"}}async function*CXt(e,t={}){let n=new TextDecoder,r=e.getReader(),o="";try{for(;;){let{done:s,value:u}=await vXt(r,t.heartbeatTimeoutMs,t.signal);if(s)break;o+=n.decode(u,{stream:!0});let l=o.split(/\r?\n\r?\n/);o=l.pop()??"";for(let f of l){let h=DXe(f);h&&(yield h)}}o+=n.decode();let i=DXe(o);i&&(yield i)}finally{r.releaseLock()}}async function vXt(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 De("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 DXe(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}
690
690
  `)}return!t.id&&!t.event&&!t.data?null:(t.data.endsWith(`
691
- `)&&(t.data=t.data.slice(0,-1)),t)}function RXt(e={}){let t=e.initialMs??SXt,n=e.maxMs??TXt,r=e.jitterMs??bXt,o=e.random??Math.random,i=e.sleep??((u,l)=>EXt(u,void 0,{signal:l}).catch(()=>{})),s=t;return{async sleep(u){let l=Math.min(n,s)+Math.floor(o()*r);s=Math.min(n,Math.max(t,s*2)),await i(l,u)},reset(){s=t}}}var xXt=3e4,F9={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??sn,o=!!e.watch,{client:i,who:s}=await DXt({watch:o,getAccessToken:r,injectedClient:n?.client,retryDelayMs:n?.authRetryDelayMs??xXt}),u=s.body.organizations.map(T=>T.id),l=s.body.user.id,{lastEventId:f}=await Ha(),h=(n?.createEventStream??NXe)({userId:l,organizationIds:u,getAccessToken:r,reconnect:!0,...f?{lastEventId:f}:{}}),_=Number(e["poll-interval-ms"]);if(!Number.isFinite(_)||_<=0)throw new Ne("--poll-interval-ms must be a positive number");let y=Number(e["watch-debounce-ms"]);if(!Number.isFinite(y)||y<=0)throw new Ne("--watch-debounce-ms must be a positive number");await(n?.runSkillSyncDaemon??RXe)({client:i,events:h,pollIntervalMs:_,watch:o,watchDebounceMs:y,onSyncPass:({reason:T,result:v})=>{console.log(`skill sync ${T}: ${v.captured} published local update${v.captured===1?"":"s"} uploaded, ${v.installedUpdated} updated, ${v.localEditsUploaded} local edit${v.localEditsUploaded===1?"":"s"} uploaded, ${v.conflicts} conflict${v.conflicts===1?"":"s"}`)}})}};async function DXt(e){for(;;){let t=await e.getAccessToken();if(!t){if(!e.watch)throw new Ne("workspace skill sync daemon requires login \u2014 run 'lore login' first");await BXe(e.retryDelayMs);continue}let n=e.injectedClient??Gt({token:t}),r=await n.whoAmI({headers:{}});if(r.status===200)return{client:n,who:r};if(!e.watch)throw new Ne(`whoAmI returned ${r.status}`);await BXe(e.retryDelayMs)}}m();m();Pr();on();var wXe={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 sn())throw new Ne("skill approval requires login \u2014 run 'lore login' first");await NXt(Gt(),{id:e.id,version:e.version})}};async function NXt(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new Ne("--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 Ne(o)}console.log(`approved /${r.body.name} v${r.body.version} (${r.body.id})`)}m();import BXt from"node:fs/promises";import OXe from"node:path";Pr();on();Bn();var kXe={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 Ne("install needs a skill ID \u2014 e.g. `lore skills install sk_01j...`");if(!await sn())throw new Ne("workspace skill installs require login \u2014 run 'lore login' first");let n=Gt();await wXt(n,t)}};async function wXt(e,t){$.info("skill_install_started",{skill_id:t});try{let n=await OXt(e,t);$.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 PXt(n.body.body_md_url,n.body.skill.content_hash)};if(!vM(r.name))throw new Ne(`refusing to install skill with invalid name: ${JSON.stringify(r.name)}`);let o=RM(r.rootKind,r.name),i=await MXt(o),s=await i1(r.skillId),u=s?.installPath!=null&&OXe.resolve(s.installPath)===OXe.resolve(o);if(i!==null&&!u)throw $.warn("skill_install_refused_unmanaged_target",{skill_id:r.skillId,name:r.name,root_kind:r.rootKind,install_path:o}),new Ne(`refusing to overwrite ${o}; it already exists and is not managed by Lore`);let l=await C9(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 cl(h);try{await kXt(e,r.installationId,f)}catch(_){throw await cl({...h,lastSyncStatus:"error"}),$.warn("skill_install_failed",{skill_id:r.skillId,installation_id:r.installationId,phase:"update_installed_version",error:ln(_)}),_}$.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 $.warn("skill_install_failed",{skill_id:t,phase:"install",error:ln(n)}),n}}async function OXt(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 Ne(r)}return n}async function kXt(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 Ne(`installed ${t} locally, but failed to record installed version: ${o}`)}}async function PXt(e,t){let n=new URL(e,cd()),r=await sn(),o=await fetch(n,{headers:{...r?{authorization:`Bearer ${r}`}:{}}});if(!o.ok)throw new Ne(`failed to download SKILL.md from ${e}: HTTP ${o.status}`);let i=await o.text();if(Vf(i)!==t)throw new Ne("downloaded SKILL.md hash did not match the skill metadata");return i}async function MXt(e){try{return await BXt.readFile(e,"utf8")}catch{return null}}m();Pr();on();var LXt=[{visibility:"workspace",heading:"workspace skills"},{visibility:"private",heading:"private captured skills"}];function UXt(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 QXt(e){if(e.length===0)return"no skills in this workspace yet";let t=[];for(let n of LXt){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} ${UXt(o.latest_version)}`)].join(`
691
+ `)&&(t.data=t.data.slice(0,-1)),t)}function RXt(e={}){let t=e.initialMs??SXt,n=e.maxMs??TXt,r=e.jitterMs??bXt,o=e.random??Math.random,i=e.sleep??((u,l)=>EXt(u,void 0,{signal:l}).catch(()=>{})),s=t;return{async sleep(u){let l=Math.min(n,s)+Math.floor(o()*r);s=Math.min(n,Math.max(t,s*2)),await i(l,u)},reset(){s=t}}}var xXt=3e4,F9={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??sn,o=!!e.watch,{client:i,who:s}=await DXt({watch:o,getAccessToken:r,injectedClient:n?.client,retryDelayMs:n?.authRetryDelayMs??xXt}),u=s.body.organizations.map(T=>T.id),l=s.body.user.id,{lastEventId:f}=await Ha(),h=(n?.createEventStream??NXe)({userId:l,organizationIds:u,getAccessToken:r,reconnect:!0,...f?{lastEventId:f}:{}}),_=Number(e["poll-interval-ms"]);if(!Number.isFinite(_)||_<=0)throw new De("--poll-interval-ms must be a positive number");let y=Number(e["watch-debounce-ms"]);if(!Number.isFinite(y)||y<=0)throw new De("--watch-debounce-ms must be a positive number");await(n?.runSkillSyncDaemon??RXe)({client:i,events:h,pollIntervalMs:_,watch:o,watchDebounceMs:y,onSyncPass:({reason:T,result:v})=>{console.log(`skill sync ${T}: ${v.captured} published local update${v.captured===1?"":"s"} uploaded, ${v.installedUpdated} updated, ${v.localEditsUploaded} local edit${v.localEditsUploaded===1?"":"s"} uploaded, ${v.conflicts} conflict${v.conflicts===1?"":"s"}`)}})}};async function DXt(e){for(;;){let t=await e.getAccessToken();if(!t){if(!e.watch)throw new De("workspace skill sync daemon requires login \u2014 run 'lore login' first");await BXe(e.retryDelayMs);continue}let n=e.injectedClient??Gt({token:t}),r=await n.whoAmI({headers:{}});if(r.status===200)return{client:n,who:r};if(!e.watch)throw new De(`whoAmI returned ${r.status}`);await BXe(e.retryDelayMs)}}m();m();Pr();on();var wXe={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 sn())throw new De("skill approval requires login \u2014 run 'lore login' first");await NXt(Gt(),{id:e.id,version:e.version})}};async function NXt(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new De("--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 De(o)}console.log(`approved /${r.body.name} v${r.body.version} (${r.body.id})`)}m();import BXt from"node:fs/promises";import OXe from"node:path";Pr();on();Bn();var kXe={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 De("install needs a skill ID \u2014 e.g. `lore skills install sk_01j...`");if(!await sn())throw new De("workspace skill installs require login \u2014 run 'lore login' first");let n=Gt();await wXt(n,t)}};async function wXt(e,t){$.info("skill_install_started",{skill_id:t});try{let n=await OXt(e,t);$.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 PXt(n.body.body_md_url,n.body.skill.content_hash)};if(!vM(r.name))throw new De(`refusing to install skill with invalid name: ${JSON.stringify(r.name)}`);let o=RM(r.rootKind,r.name),i=await MXt(o),s=await i1(r.skillId),u=s?.installPath!=null&&OXe.resolve(s.installPath)===OXe.resolve(o);if(i!==null&&!u)throw $.warn("skill_install_refused_unmanaged_target",{skill_id:r.skillId,name:r.name,root_kind:r.rootKind,install_path:o}),new De(`refusing to overwrite ${o}; it already exists and is not managed by Lore`);let l=await C9(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 cl(h);try{await kXt(e,r.installationId,f)}catch(_){throw await cl({...h,lastSyncStatus:"error"}),$.warn("skill_install_failed",{skill_id:r.skillId,installation_id:r.installationId,phase:"update_installed_version",error:ln(_)}),_}$.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 $.warn("skill_install_failed",{skill_id:t,phase:"install",error:ln(n)}),n}}async function OXt(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 De(r)}return n}async function kXt(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 De(`installed ${t} locally, but failed to record installed version: ${o}`)}}async function PXt(e,t){let n=new URL(e,cd()),r=await sn(),o=await fetch(n,{headers:{...r?{authorization:`Bearer ${r}`}:{}}});if(!o.ok)throw new De(`failed to download SKILL.md from ${e}: HTTP ${o.status}`);let i=await o.text();if(Vf(i)!==t)throw new De("downloaded SKILL.md hash did not match the skill metadata");return i}async function MXt(e){try{return await BXt.readFile(e,"utf8")}catch{return null}}m();Pr();on();var LXt=[{visibility:"workspace",heading:"workspace skills"},{visibility:"private",heading:"private captured skills"}];function UXt(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 QXt(e){if(e.length===0)return"no skills in this workspace yet";let t=[];for(let n of LXt){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} ${UXt(o.latest_version)}`)].join(`
692
692
  `))}return t.join(`
693
693
 
694
- `)}var PXe={meta:{name:"list",description:"List skills available in your workspace."},async run({data:e}){let t=e;if(!await(t?.getAccessToken??sn)())throw new Ne("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Gt()).listSkills({});if(o.status!==200){let i=o.body?.message??`listSkills returned ${o.status}`;throw new Ne(i)}console.log(QXt(o.body.objects))}};m();Pr();on();var MXe={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 sn())throw new Ne("skill proposals require login \u2014 run 'lore login' first");await FXt(Gt(),e.id)}};async function FXt(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 Ne(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}`)}}m();import{readFile as LXe}from"node:fs/promises";Pr();on();Bn();var UXe={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 sn())throw new Ne("not logged in \u2014 run 'lore login' first");let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Ne("pass a skill name, path, or sk_* ID to publish");let n=await GXt(Gt(),t);KXt(n)}};async function GXt(e,t){let n=t.trim();if(!n)throw new Ne("pass a skill name, path, or sk_* ID to publish");let r=n.startsWith("sk_")?"skill_id":"local_name_or_path";$.info("skill_publish_started",{target_kind:r,target:n});try{if(n.startsWith("sk_"))return await QXe(e,n);let o=await dWe(n)??await pWe(n);if(!o)throw new Ne(`no SKILL.md found for ${n}`);return await jXt(e,o)}catch(o){throw $.warn("skill_publish_failed",{target_kind:r,target:n,phase:"publish",error:ln(o)}),o}}async function jXt(e,t){let n=Vf(t.bodyMd),r=await DWe(t);$.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 zXt(o)!==n){let s=await s1(e,{...t,...o?{skillId:o}:{}},{syncAction:"capture"});o=s.skill_id,$.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 QXe(e,o);return i.kind!=="conflict"&&i.kind!=="remote_newer"&&await a1(t,{skillId:o,version:i.version}),i}async function zXt(e){return(await Ha()).captured[e]?.lastPushedHash??null}async function QXe(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status===200&&n.body.visibility==="workspace")return $Xt(e,t,n.body);let r=await e.publishSkill({params:{id:t},body:{}});if(r.status!==200)throw YXt("publish skill",r.status,r.body);return await HXt(t,r.body.latest_version??0),$.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 HXt(e,t){let r=(await Ha()).captured[e];if(!r)return;let o;try{o=await LXe(r.filePath,"utf8")}catch(i){$.warn("skill_publish_record_local_failed",{skill_id:e,file_path:r.filePath,error:ln(i)});return}await a1({name:r.name,bodyMd:o,filePath:r.filePath,rootKind:r.rootKind},{skillId:e,version:t})}async function $Xt(e,t,n){let r=await Ha(),o=r.installed[t]??null,i=r.captured[t]??null,s=r.published[t]??null,u=o?.installPath??i?.filePath,l=o?.rootKind??i?.rootKind??n.root_kind,f=o?.name??i?.name??n.name;if(!u)throw new Ne(`no managed local SKILL.md found for ${t}; install or capture it first`);let h=await LXe(u,"utf8"),_=Vf(h),y=n.latest_version??0,T=n.content_hash??"",v=qXt(o,s,i);if(_===T)return $.info("skill_publish_noop",{skill_id:t,version:y,reason:"local_matches_remote"}),{kind:"unchanged",skillId:t,version:y};if(v.version>0&&y>v.version)return _===v.hash?($.info("skill_publish_noop",{skill_id:t,version:y,reason:"remote_newer_local_unchanged",local_version:v.version}),{kind:"remote_newer",skillId:t,localVersion:v.version,remoteVersion:y}):(o&&await cl({...o,lastSyncStatus:"conflict"}),$.warn("skill_publish_conflict",{skill_id:t,local_version:v.version,remote_version:y,name:f,file_path:u}),{kind:"conflict",skillId:t,localVersion:v.version,remoteVersion:y});if(_===v.hash)return $.info("skill_publish_noop",{skill_id:t,version:y,reason:"local_matches_base"}),{kind:"unchanged",skillId:t,version:y};let R=await VXt(e),x=n.owner?.id&&n.owner.id===R?"owner_update":"subscriber_update",O=await s1(e,{skillId:t,name:f,description:null,bodyMd:h,filePath:u,rootKind:l},{syncAction:x,...v.version>0?{baseVersion:v.version}:{}});return o&&await cl({...o,...O.version_status==="accepted"?{baseVersion:O.version,baseContentHash:O.content_hash,lastSyncStatus:"current"}:{lastSyncStatus:"proposed"},lastInstalledVersion:O.version,lastInstalledHash:O.content_hash}),await a1({name:f,bodyMd:h,filePath:u,rootKind:l},{skillId:O.skill_id,version:O.version}),$.info("skill_publish_update_uploaded",{skill_id:O.skill_id,name:f,file_path:u,sync_action:x,version:O.version,version_status:O.version_status}),{kind:"uploaded",skillId:O.skill_id,version:O.version,versionStatus:O.version_status==="proposed"?"proposed":"accepted"}}function qXt(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 VXt(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}function YXt(e,t,n){let r=n?.message??`${e} returned ${t}`;return new Ne(r)}function KXt(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}}m();Pr();on();var FXe={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 sn())throw new Ne("skill rejection requires login \u2014 run 'lore login' first");await JXt(Gt(),{id:e.id,version:e.version,reason:e.reason})}};async function JXt(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new Ne("--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 Ne(i)}console.log(`rejected /${o.body.name} v${o.body.version} (${o.body.id})`)}m();Rk();import ZXt from"node:os";import $a from"node:path";var GXe={meta:{name:"scan",description:"List local skills found by Lore's scanner."},async run(){await ren()}};function WXt(e){let t=$a.resolve(e),n=$a.resolve(ZXt.homedir()),r=$a.relative(n,t);return r===""?"~":!r.startsWith("..")&&!$a.isAbsolute(r)?$a.join("~",r):t}function XXt(e){return WXt($a.dirname($a.dirname(e)))}function een(e){return $a.basename($a.dirname(e))}function ten(e,t){let n=$a.resolve(e);for(let r of t){let o=$a.resolve(r),i=$a.relative(o,n);if(i!==""&&!i.startsWith("..")&&!$a.isAbsolute(i))return o}return null}function nen(e,t,n){return e==="claude_project"?t.map(r=>$a.join(T9(r),n)):e==="agents_project"?t.map(r=>$a.join(b9(r),n)):[]}async function ren(){let e=await NWe(),t=e.map(u=>u.root),n=new Map(e.map(u=>[$a.resolve(u.root),u])),r=await Upe({projectCwds:t,includeCwdProject:!1}),o={},i=new Set;for(let u of r){let l=$a.resolve(u.filePath);if(i.has(l))continue;i.add(l);let f=XXt(u.filePath),h=ten(u.filePath,t),_=h?n.get(h)?.alsoSeenAt??[]:[];o[f]??=[],o[f].push({name:u.name,description:u.description,root_kind:u.rootKind,file_path:u.filePath,also_seen_at:nen(u.rootKind,_,een(u.filePath))})}let s=QGe.parse({type:"local_skill_scanner_output",skills:o});console.log(JSON.stringify(s,null,2))}m();Pr();on();var jXe={meta:{name:"status",description:"Show local Lore-managed skill sync state."},async run(){if(!await sn())throw new Ne("skill status requires login \u2014 run 'lore login' first");await oen()}};async function oen(){let e=await Ha(),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(`
695
- `))}m();Pr();on();var zXe={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await sn())throw new Ne("workspace skill sync requires login \u2014 run 'lore login' first");let e=await rfe(Gt());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};m();import HXe from"node:fs/promises";import ien from"node:path";Pr();on();var $Xe={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 Ne("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await sn())throw new Ne("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Gt();await sen(n,t)}};async function sen(e,t){let n=await i1(t);n&&(await HXe.rm(n.installPath,{force:!0}),await HXe.rmdir(ien.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 Ne(o)}if(await TWe(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}var qXe={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:UXe,install:kXe,uninstall:$Xe,sync:zXe,daemon:F9,approve:wXe,reject:FXe,proposals:MXe,status:jXe,list:PXe,scan:GXe}};s0();m();await Ao();var Y9=ue(dn(),1);sc();await pb();m();await Ao();var $9=ue(dn(),1);await xA();m();await Ao();var c1=ue(dn(),1);ks();var md=ue(jt(),1);function l1({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[s,u]=(0,c1.useState)(VXe(e,n)),l=(0,c1.useRef)(s);return(0,c1.useEffect)(()=>{let f=VXe(e,n);l.current=f,u(f)},[e,n]),xu((f,h)=>{if(e.length!==0){if(h.upArrow||f==="k"){let _=aen(e,l.current);l.current=_,u(_);return}if(h.downArrow||f==="j"){let _=YXe(e,l.current);l.current=_,u(_);return}if(h.return||f===" "){let _=e[l.current];_&&!_.disabled&&t(_)}}},{isActive:!r}),e.length===0?(0,md.jsx)(he,{color:Re.muted,children:"no actions available"}):(0,md.jsxs)(Ee,{flexDirection:"column",children:[e.map((f,h)=>{let _=h===s,y=f.disabled?Re.muted:_?Re.primary:Re.highlight;return(0,md.jsxs)(Ee,{children:[(0,md.jsx)(Ee,{width:2,flexShrink:0,children:(0,md.jsx)(he,{color:_?Re.primary:Re.muted,children:_?"\u203A":" "})}),(0,md.jsx)(Ee,{width:i,flexShrink:0,children:(0,md.jsx)(he,{color:y,bold:_&&!f.disabled,children:f.label})}),f.description?(0,md.jsx)(Ee,{flexGrow:1,flexShrink:1,children:(0,md.jsx)(he,{color:Re.muted,children:f.description})}):null]},f.id)}),o?(0,md.jsx)(Ee,{marginTop:1,children:(0,md.jsx)(he,{color:Re.muted,children:o})}):null]})}function VXe(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?YXe(e,n-1):n}function YXe(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 aen(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 DA();await Ab();await gb();ks();m();Pr();Fa();LD();HD();async function G9(e){if(!await(e.hasAccessToken??(async()=>!!await sn()))())return{state:"logged_out"};let n=e.client??Gt();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:KXe(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 j9(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??u$;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function z9(e){if(!await(e.hasAccessToken??(async()=>!!await sn()))())return{state:"logged_out"};let n=e.client??Gt();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:KXe(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 H9(){try{await Ih();let e=await Ho();return uen(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function uen(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function KXe(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 wt=ue(jt(),1);function U0({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=ws(),[i,s]=(0,$9.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,$9.useEffect)(()=>{if(t)return;let l=!1;return(async()=>{let[f,h,_,y]=await Promise.all([G9(n),j9(n),z9(n),H9()]);l||s({identity:f,daemon:h,skills:_,uploadDirs:y})})(),()=>{l=!0}},[]),xu((l,f)=>{(l==="q"||f.ctrl&&l==="c"||f.escape)&&(r("quit"),o())});let u=men(i);return(0,wt.jsxs)(Ee,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,wt.jsx)(Ps,{title:"lore",subtitle:len(i.identity),right:`v${e}`}),(0,wt.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,wt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,wt.jsx)(Qn,{title:"Daemon",children:(0,wt.jsx)(den,{daemon:i.daemon})})}),(0,wt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,wt.jsx)(Qn,{title:"Workspace",children:(0,wt.jsx)(pen,{identity:i.identity,skills:i.skills})})})]}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsx)(Qn,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,wt.jsx)(cen,{uploadDirs:i.uploadDirs})})}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsx)(Qn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,wt.jsx)(l1,{items:u,onSelect:l=>{r(l.id),o()}})})})]})}function cen({uploadDirs:e}){return e.state==="loading"?(0,wt.jsx)(ja,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsxs)(he,{color:Re.muted,children:["Run ",(0,wt.jsx)(he,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,wt.jsxs)(Ee,{flexDirection:"column",children:[e.cwd.map(t=>(0,wt.jsx)(an,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,wt.jsx)(an,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function len(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 den({daemon:e}){if(e.state==="loading")return(0,wt.jsx)(ja,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(he,{color:Re.muted,children:"Background uploads are macOS-only today."}),(0,wt.jsxs)(he,{color:Re.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:t.health,kind:n}),(0,wt.jsx)(an,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,wt.jsx)(an,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,wt.jsx)(an,{label:"Heartbeat",value:JXe(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,wt.jsx)(an,{label:"Last upload",value:JXe(t.status?.last_success_at)}),t.status?.last_error?(0,wt.jsx)(an,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function pen({identity:e,skills:t}){return e.state==="loading"?(0,wt.jsx)(ja,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"signed out",kind:"warning"}),(0,wt.jsx)(he,{color:Re.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]}):(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"User",value:e.email,kind:"success"}),(0,wt.jsx)(an,{label:"Display name",value:e.displayName}),(0,wt.jsx)(an,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,wt.jsx)(an,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,wt.jsx)(an,{label:"Skills",value:fen(t)})]})}function fen(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 men(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 JXe(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}m();await Ao();await xA();await DA();ks();var si=ue(jt(),1),Aen=[{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 q9({cliVersion:e,onSelect:t}){let{exit:n}=ws();return xu((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,si.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,si.jsx)(Ps,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,si.jsx)(Qn,{title:"What is Lore?",children:(0,si.jsxs)(Ee,{flexDirection:"column",children:[(0,si.jsx)(he,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,si.jsxs)(Ee,{marginTop:1,flexDirection:"column",children:[(0,si.jsx)(he,{color:Re.muted,children:"You'll get:"}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,si.jsx)(Ee,{marginTop:1,children:(0,si.jsx)(Qn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,si.jsx)(l1,{items:Aen,onSelect:r=>{t(r.id),n()}})})}),(0,si.jsx)(Ee,{marginTop:1,children:(0,si.jsxs)(he,{color:Re.muted,children:["New to Lore? Run ",(0,si.jsx)(he,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var V9=ue(jt(),1),gen={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 hen({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,Y9.useState)(void 0),{exit:i}=ws();return(0,Y9.useEffect)(()=>{let s=!1;return(async()=>{let[u,l,f,h]=await Promise.all([G9(t),j9(t),z9(t),H9()]);s||o({identity:u,daemon:l,skills:f,uploadDirs:h})})(),()=>{s=!0}},[]),r?r.identity.state==="logged_out"?(0,V9.jsx)(q9,{cliVersion:e,onSelect:s=>{n(s),i()}}):(0,V9.jsx)(U0,{cliVersion:e,initialData:r,onSelect:n}):null}async function ZXe(){let e="quit";return await sl((0,V9.jsx)(hen,{cliVersion:hu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:gen[e]}}m();await pb();m();await Ao();var QM=ue(dn(),1);await xA();await DA();ks();m();await Ao();await Mle();await xA();await mb();await DA();await Qle();m();await Ao();ks();var d1=ue(jt(),1),_en="\u2588",Een="\u2591";function WXe({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,d1.jsxs)(Ee,{children:[(0,d1.jsx)(he,{color:r,children:_en.repeat(i)}),(0,d1.jsx)(he,{color:Re.muted,children:Een.repeat(s)}),n?(0,d1.jsxs)(he,{color:Re.muted,children:[" ",n]}):null]})}await Ab();await gb();await Lle();await $le();await Yle();m();await Ao();await xA();await mb();await DA();await Ab();ks();var go=ue(jt(),1),eet=[{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 kM(){return{steps:eet.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function K9(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?`${XXe(n.key)} (${t.label})`:XXe(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function XXe(e){return eet.find(t=>t.key===e)?.label??e}function Nh({title:e,subtitle:t,state:n}){return(0,go.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,go.jsx)(Ps,{title:e,subtitle:t}),(0,go.jsx)(Qn,{title:"Pipeline",children:(0,go.jsx)(Ee,{flexDirection:"column",children:n.steps.map(r=>(0,go.jsx)(yen,{step:r},r.key))})}),n.result?(0,go.jsx)(Ee,{marginTop:1,flexDirection:"column",children:(0,go.jsx)(Ms,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,go.jsxs)(Ee,{flexDirection:"column",children:[(0,go.jsx)(he,{children:n.result.url}),(0,go.jsx)(Ee,{marginTop:1,children:(0,go.jsxs)(he,{color:Re.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,go.jsx)(Ee,{marginTop:1,children:(0,go.jsx)(Ms,{kind:"error",title:"Failed",children:(0,go.jsx)(he,{children:n.errorMessage})})}):null]})}function yen({step:e}){return e.status==="active"?(0,go.jsxs)(Ee,{children:[(0,go.jsx)(ja,{}),(0,go.jsx)(he,{children:" "}),(0,go.jsx)(he,{color:Re.primary,children:e.label})]}):e.status==="done"?(0,go.jsxs)(Ee,{children:[(0,go.jsx)(he,{color:Re.success,children:"\u2713 "}),(0,go.jsx)(he,{color:Re.muted,children:e.label})]}):(0,go.jsxs)(Ee,{children:[(0,go.jsx)(he,{color:Re.muted,children:"\u25CB "}),(0,go.jsx)(he,{color:Re.muted,children:e.label})]})}ks();m();var PM=Date.parse("2026-05-16T12:00:00.000Z");function MM(e){return new Date(PM-e*6e4).toISOString()}var Yf={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"},tet=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:PM-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:PM-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:PM-180*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:PM-1560*6e4}],Sen=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],p1={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:Yf.plist,binary_path:Yf.binary,status_path:Yf.status,install_source_path:Yf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:MM(60),last_heartbeat_at:MM(1),last_success_at:MM(5),last_completed_at:MM(5),last_thread_ids:["thr_01hx_story"]}},net={...p1,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...p1.status,state:"error",last_heartbeat_at:MM(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},Ten={...p1,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},ben={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"},LM={identity:ben,daemon:{state:"ready",report:p1},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:Sen,repo:[]}},ret={...LM,uploadDirs:{state:"ready",cwd:[],repo:[]}},oet={...LM,daemon:{state:"error",message:"launchctl print failed: service not found"}},iet={...LM,daemon:{state:"unsupported",platform:"linux"}},set={identity:{state:"logged_out"},daemon:{state:"ready",report:Ten},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},aet=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var yt=ue(jt(),1),ro=()=>{};function Q0(...e){return e.reduce(S$,qP())}function UM(...e){return e.reduce(K9,kM())}var LA=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,yt.jsx)(q9,{cliVersion:"0.1.0",onSelect:ro})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,yt.jsx)(Dp,{state:qP()})},{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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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:Yf.plist,binaryPath:Yf.binary,logFile:Yf.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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(wA,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:tet,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,yt.jsx)(wA,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,yt.jsx)(wA,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:ro,onSkip:ro})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:LM,onSelect:ro})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:ret,onSelect:ro})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:oet,onSelect:ro})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:iet,onSelect:ro})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:set,onSelect:ro})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:kM()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:UM({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,yt.jsx)(Nh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:UM({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,yt.jsx)(Nh,{title:"lore share-codex",state:UM({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,yt.jsx)(Nh,{title:"lore share-cowork",state:UM({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,yt.jsx)(Nh,{title:"lore export",state:UM({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,yt.jsx)(L0,{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,yt.jsx)(L0,{mode:"enable",state:{phase:"finished",result:{plistPath:Yf.plist,binaryPath:Yf.binary,logFile:Yf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,yt.jsx)(L0,{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,yt.jsx)(L0,{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,yt.jsx)(L0,{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,yt.jsx)(DM,{report:p1})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,yt.jsx)(DM,{report:net})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,yt.jsx)(Ps,{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,yt.jsx)(Qn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,yt.jsx)(he,{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,yt.jsxs)(Qn,{title:"StatusLine",children:[(0,yt.jsx)(an,{label:"Healthy",value:"yes",kind:"success"}),(0,yt.jsx)(an,{label:"Warning",value:"needs attention",kind:"warning"}),(0,yt.jsx)(an,{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,yt.jsx)(Qn,{title:"ProgressBar",children:(0,yt.jsx)(WXe,{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,yt.jsxs)(Ee,{flexDirection:"column",children:[(0,yt.jsx)(Ms,{kind:"success",title:"Shared",children:(0,yt.jsx)(he,{children:"Copied the Lore URL to your clipboard."})}),(0,yt.jsx)(Ee,{marginTop:1,children:(0,yt.jsx)(Ms,{kind:"error",title:"Failed",children:(0,yt.jsx)(he,{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,yt.jsx)(Qn,{title:"Spinner",children:(0,yt.jsx)(ja,{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,yt.jsx)(Qn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,yt.jsx)(l1,{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:ro})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,yt.jsx)(Qn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,yt.jsx)(HP,{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:ro,onAction:ro})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,yt.jsx)(Qn,{title:"TextInput",children:(0,yt.jsx)(g$,{initialValue:"~/code",onSubmit:ro,onCancel:ro})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,yt.jsx)(Qn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,yt.jsx)(h$,{initialValue:"/Users/alex/code",loadSuggestions:async()=>aet,onSubmit:ro,onCancel:ro})})}];function uet(e){return LA.find(t=>t.id===e)}function f1(e){return e.path.slice(1).join(" / ")}var Fr=ue(jt(),1);function det({initialStoryId:e}){let t=Math.max(0,LA.findIndex(f=>f.id===e)),[n,r]=(0,QM.useState)(t),[o,i]=(0,QM.useState)("sidebar"),s=(0,QM.useRef)(o);s.current=o;let{exit:u}=ws();xu((f,h)=>{if(h.ctrl&&f==="c"){u();return}if(s.current==="sidebar"&&f==="q"){u();return}if(h.escape){if(s.current==="preview"){s.current="sidebar",i("sidebar");return}u();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(_=>cet(_-1));return}(h.downArrow||f==="j")&&r(_=>cet(_+1))}});let l=LA[n]??LA[0];return(0,Fr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Fr.jsx)(Ps,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${LA.length}`}),(0,Fr.jsx)(Ee,{marginBottom:1,children:(0,Fr.jsx)(he,{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,Fr.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,Fr.jsx)(Ee,{width:36,flexShrink:0,children:(0,Fr.jsx)(Qn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,Fr.jsx)(Ien,{stories:LA,selectedIndex:n,focused:o==="sidebar"})})}),(0,Fr.jsx)(Ee,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,Fr.jsx)(Qn,{title:l.title,focused:o==="preview",subtitle:o==="preview"?`${f1(l)} \xB7 focused`:f1(l),children:(0,Fr.jsxs)(Ee,{flexDirection:"column",children:[(0,Fr.jsx)(he,{color:Re.muted,children:l.description}),o==="sidebar"?(0,Fr.jsxs)(he,{color:Re.muted,children:["Press ",(0,Fr.jsx)(he,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,Fr.jsx)(Ee,{marginTop:1,children:l.render()})]})})})]})]})}function Ien({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,s)=>{let u=i.path.slice(1),l=Den(o,u);for(let f=l;f<u.length;f++)r.push((0,Fr.jsx)(Cen,{label:u[f]??"",level:f,marginTop:xen(u[f]??"",f,l),focused:n},`group:${u.slice(0,f+1).join("/")}`));r.push((0,Fr.jsx)(ven,{story:i,selected:s===t,focused:n},i.id)),o=u}),(0,Fr.jsx)(Ee,{flexDirection:"column",children:r})}function Cen({label:e,level:t,marginTop:n,focused:r}){return(0,Fr.jsx)(Ee,{marginLeft:pet(t),marginTop:n,children:(0,Fr.jsx)(he,{color:r?Re.primary:Re.muted,bold:r,wrap:"truncate-end",children:e})})}function ven({story:e,selected:t,focused:n}){let r=n?t?Re.accent:Re.highlight:Re.muted;return(0,Fr.jsxs)(Ee,{marginLeft:pet(e.path.slice(1).length),children:[(0,Fr.jsx)(he,{color:n&&t?Re.accent:Re.muted,children:t?"\u203A ":" "}),(0,Fr.jsx)(he,{color:r,bold:n&&t,wrap:"truncate-end",children:Ren(e)})]})}function Ren(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function pet(e){return Math.min(e,4)}function xen(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Den(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 cet(e){let t=LA.length;return(e%t+t)%t}function fet({story:e}){let{exit:t}=ws();return xu((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,Fr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Fr.jsx)(Ps,{title:e.title,subtitle:f1(e),right:"Esc to exit"}),(0,Fr.jsx)(Ee,{marginBottom:1,children:(0,Fr.jsx)(he,{color:Re.muted,children:e.description})}),e.render()]})}var ofe=ue(jt(),1),met={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){Nen();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=uet(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 sl((0,ofe.jsx)(fet,{story:n})).waitUntilExit();return}await sl((0,ofe.jsx)(det,{})).waitUntilExit()}};function Nen(){for(let e of LA)console.log(`${e.id} ${f1(e)} ${e.title}`)}m();Bn();s0();m();await Ao();var J9=ue(dn(),1);await pb();var ife=ue(jt(),1);function Ben({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,s]=(0,J9.useState)(kM),{exit:u}=ws();return(0,J9.useEffect)(()=>{let l=!1,f=h=>{l||s(_=>K9(_,h))};return(async()=>{try{let h=await n(f);if(l)return;r(h),setTimeout(()=>u(),100)}catch(h){if(f({kind:"error",message:h instanceof Error?h.message:String(h)}),l)return;o(h),setTimeout(()=>u(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{l=!0}},[]),(0,ife.jsx)(Nh,{title:e,subtitle:t,state:i})}async function m1(e){let t,n,r=!1;if(await sl((0,ife.jsx)(Ben,{title:e.title,subtitle:e.subtitle,perform:e.perform,onResolve:i=>{t=i,r=!0},onReject:i=>{n=i}})).waitUntilExit(),!r)throw n instanceof Error?n:new Error(String(n??"share flow failed"));return t}m();WR();Pr();import etn from"node:os";import Oet from"node:path";m();import{spawn as wen}from"node:child_process";import Oen from"node:os";async function Aet(e,t={}){let n=t.timeoutMs??2e3,r=ken();for(let o of r)if(await Pen(o,e,n))return!0;return!1}function ken(){switch(Oen.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 Pen(e,t,n){return new Promise(r=>{let o;try{o=wen(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,s=l=>{i||(i=!0,r(l))},u=setTimeout(()=>{o.kill("SIGKILL"),s(!1)},n);o.on("error",()=>{clearTimeout(u),s(!1)}),o.on("close",l=>{clearTimeout(u),s(l===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}on();Bn();QP();m();import dl from"node:fs/promises";import Cet from"node:os";import fs from"node:path";m();m();import Men from"node:os";import get from"node:path";function het(e){return e.replace(/[^A-Za-z0-9_-]/g,"-")}function _et(e=Men.homedir(),t=process.env.CLAUDE_CONFIG_DIR){let n=t?.trim();return n?get.join(n,"projects"):get.join(e,".claude","projects")}m();import ll from"node:fs";import Len from"node:os";import vb from"node:path";var sfe="local-agent-mode-sessions",afe=["audit.jsonl","transcript.jsonl"];function Eet(e=Len.homedir()){return vb.join(e,"Library","Application Support","Claude",sfe)}function yet(e){if(!ll.existsSync(e))return[];let t=[];for(let n of ll.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=vb.join(e,n.name);for(let o of ll.readdirSync(r,{withFileTypes:!0})){if(!o.isDirectory())continue;let i=vb.join(r,o.name);for(let s of ll.readdirSync(i,{withFileTypes:!0})){if(!s.isDirectory()||!s.name.startsWith("local_"))continue;let u=s.name.replace(/^local_/,"");if(!u)continue;let l=vb.join(i,s.name),f=W9(l),h=f?ll.statSync(f):ll.statSync(l);t.push({accountId:n.name,orgId:o.name,sessionId:u,sessionDir:i,localDir:l,mtimeMs:h.mtimeMs})}}}return t.sort((n,r)=>r.mtimeMs-n.mtimeMs),t}function Z9(e){if(!ll.existsSync(e))return null;let t=null;for(let n of ll.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory()||!n.name.startsWith("local_"))continue;let r=vb.join(e,n.name),o=W9(r),i=o!==null,s=o?ll.statSync(o).mtimeMs:ll.statSync(r).mtimeMs;(t===null||i&&!t.hasTranscript||i===t.hasTranscript&&s>t.mtimeMs)&&(t={dir:r,mtimeMs:s,hasTranscript:i})}return t?.dir??null}function W9(e){for(let t of afe){let n=vb.join(e,t);if(ll.existsSync(n)&&ll.statSync(n).isFile())return n}return null}function ufe(e,t){let n=vb.join(e,t);return ll.existsSync(n)?ll.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}on();l$();Bn();Fa();Th();m();on();import{createReadStream as Uen}from"node:fs";import Qen from"node:fs/promises";import{createInterface as Fen}from"node:readline";var Gen=50;async function Tet(e,t={}){let n=t.maxLines??Gen;try{await Qen.stat(e)}catch(o){if(kr(o,"ENOENT"))return null;throw o}let r=Uen(e,{encoding:"utf8"});return await new Promise((o,i)=>{let s=!1,u=0,l=_=>{s||(s=!0,f.close(),r.destroy(),o(_))},f=Fen({input:r,crlfDelay:Number.POSITIVE_INFINITY});f.on("line",_=>{if(s)return;let y=_.trim();if(y){u+=1;try{let T=JSON.parse(y);if(typeof T=="object"&&T!==null&&"cwd"in T&&typeof T.cwd=="string"){let v=T.cwd.trim();if(v){l(v);return}}}catch{}u>=n&&l(null)}}),f.on("close",()=>l(null));let h=_=>{if(!s){if(s=!0,kr(_,"ENOENT")){o(null);return}i(_)}};f.on("error",h),r.on("error",h)})}var jen=3600*1e3,zen=336*60*60*1e3,X9=Symbol("missingSessionID"),vet={name:"claudeCode",historyFilePath:eq,readUnuploadedEntries:Ret,collectLocalFiles:qen,buildPendingTranscriptWatches:Ven};async function Ret(e){let t=eq(),n=Date.now()-zen,r;try{r=await dl.readdir(t,{withFileTypes:!0})}catch(i){if(kr(i,"ENOENT"))return[];throw new Error(`readdir ${t}: ${String(i)}`)}let o=[];for(let i of r){if(!i.isDirectory())continue;let s=fs.join(t,i.name),u;try{u=await dl.readdir(s,{withFileTypes:!0})}catch{continue}for(let l of u){if(!l.isFile()||!l.name.endsWith(".jsonl"))continue;let f=fs.join(s,l.name),h;try{h=await dl.stat(f)}catch{continue}!h.isFile()||h.mtimeMs<n||o.push({sessionId:l.name.slice(0,-6),project:"",timestamp:h.mtimeMs,resolvedTranscriptPath:f})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}async function xet(){let e=new Map,t;try{t=await dl.readFile(S0(),"utf8")}catch{return e}for(let n of zP(t)){let r=n.sessionId?.trim(),o=n.project?.trim();r&&o&&!e.has(r)&&e.set(r,o)}return e}async function Det(e,t,n){let r=await Tet(e);return r||((await n()).get(t)??null)}async function Hen(){let e=S0(),t;try{t=await dl.readFile(e,"utf8")}catch(n){if(kr(n,"ENOENT"))return[];throw n}return zP(t,e)}async function Net(e){let t=await Hen(),n=e.sessionId.trim();if(n){for(let u=t.length-1;u>=0;u-=1){let l=t[u];if(l?.sessionId?.trim()===n)return l}let s=await $en(n);if(s){let u=e.project.trim()||process.cwd();return{sessionId:n,project:u,timestamp:s.mtimeMs,resolvedTranscriptPath:s.fullPath}}throw new Ne(`no history entry or transcript file found for session-id "${n}" \u2014 check ~/.claude/history.jsonl and ~/.claude/projects/`)}let r=fs.normalize(e.project.trim());if(!r)throw new Ne("export requires either --session-id or a project path");let o=await PD(r),i=[...t].sort((s,u)=>u.timestamp-s.timestamp);for(let s of i){if(!s.sessionId?.trim())continue;let u=fs.normalize(s.project.trim());if(!u||u===".")continue;if(u===r)return s;if(!o)continue;let l=await PD(u);if(l&&l===o)return s}throw new Ne(`no history entry found for project "${r}" \u2014 pass --session-id to pick a specific session, or cd into the repo where the Claude Code session ran`)}async function $en(e){let t=e.trim();if(!t)return null;let n=eq(),r;try{r=await dl.readdir(n,{withFileTypes:!0})}catch(o){if(kr(o,"ENOENT"))return null;throw new Error(`readdir ${n}: ${String(o)}`)}for(let o of r){if(!o.isDirectory())continue;let i=fs.join(n,o.name,`${t}.jsonl`);try{let s=await dl.stat(i);if(s.isFile())return{fullPath:i,mtimeMs:s.mtimeMs}}catch(s){if(!kr(s,"ENOENT")&&!kr(s,"ENOTDIR"))throw new Error(`stat ${i}: ${String(s)}`)}}return null}async function Bet(e){let t=await cfe(e);if(t===X9)throw new Error("history entry is missing sessionId");return t}async function qen(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=null,f=async()=>(l??=await xet(),l);try{for(let h=0;h<e.length;h+=1){let _=e[h],y=await cfe(_);if(y===X9){let V=`__missing_session__:${_.project}:${_.timestamp}:${h}`;r[h]=V,o.add(V),s.add(V);continue}if(r[h]=y.key,s.has(y.key))continue;let T=await Hi(y.fullPath);if(!T.exists){o.add(y.key),s.add(y.key);continue}if(t.isUnchanged?.(y.key,T)){o.add(y.key),s.add(y.key);continue}if(t.isThrottled?.(y.key)){i.add(y.key),s.add(y.key);continue}let v=_.project.trim()||await Det(y.fullPath,_.sessionId??"",f);if(!v){$.info("upload_filter_session_excluded",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:"<unresolved>",reason:"no_resolvable_cwd"}),o.add(y.key),s.add(y.key);continue}let R=await vp(v),x=null,O=async()=>(x!==null||(x=await dl.readFile(y.fullPath,"utf8")),x),P=await bh(t.uploadFilterConfig??vA(),{cwd:v,repoOriginPath:R,transcriptPath:y.fullPath,readTranscript:O});if(!P.shouldUpload){$.info("upload_filter_session_excluded",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:P.reason}),o.add(y.key),s.add(y.key);continue}$.info("upload_filter_session_included",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let j;try{j=await fd(y.fullPath)}catch(V){if(kr(V,"ENOENT")){o.add(y.key),s.add(y.key);continue}throw new Error(`read session transcript ${y.fullPath}: ${String(V)}`)}u.push(j.tempPath),n.push({key:y.key,filename:y.relativeFilename,sourcePath:y.fullPath,repoOriginPath:R,tempPath:j.tempPath,md5:j.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:_.sessionId?.trim()??"",watchedState:T}),s.add(y.key);let G=await dl.readFile(j.tempPath,"utf8"),H=Zen(G);for(let V of H){let ae;try{ae=await Wen(V)}catch{continue}let re=`${y.key}::plan:${ae}`;if(s.has(re))continue;let _e=await Hi(ae),Qe;try{Qe=await fd(ae)}catch(pt){if(kr(pt,"ENOENT"))continue;throw new Error(`read plan file ${ae}: ${String(pt)}`)}u.push(Qe.tempPath),n.push({key:re,filename:ae,sourcePath:ae,repoOriginPath:R,tempPath:Qe.tempPath,md5:Qe.md5,fileType:"plan",harness:"claudeCode",harnessInternalId:ae,watchedState:_e}),s.add(re)}}}catch(h){throw await Promise.all(u.map(_=>dl.rm(fs.dirname(_),{recursive:!0,force:!0}))),h}return{entries:e,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function Ven(e,t,n={}){let r=await Ret(e),o=Date.now(),i=[],s=new Set,u=null,l=async()=>(u??=await xet(),u);for(let f of r){let h=await cfe(f);if(h===X9||s.has(h.fullPath))continue;s.add(h.fullPath);let _=await Hi(h.fullPath);if(!_.exists)continue;let y=f.project.trim()||await Det(h.fullPath,f.sessionId??"",l);if(!y)continue;let T=await vp(y),v=await bh(n.uploadFilterConfig??vA(),{cwd:y,repoOriginPath:T,transcriptPath:h.fullPath,readTranscript:()=>dl.readFile(h.fullPath,"utf8")},{ignoreSkillRules:!0});if(!v.shouldUpload){$.info("upload_filter_watch_excluded",{filename:h.relativeFilename,transcript_path:h.fullPath,cwd:y,repo_origin_path:T||"<none>",reason:v.reason});continue}i.push({sessionId:f.sessionId?.trim()??"",project:y,transcriptPath:h.fullPath,expiresAt:new Date(o+jen),baseline:t.get(h.fullPath)??_})}return i.sort((f,h)=>f.transcriptPath.localeCompare(h.transcriptPath))}async function cfe(e){let t=e.sessionId?.trim();if(!t)return X9;let n=eq(),r=e.resolvedTranscriptPath?.trim();if(r){let s=fs.relative(n,r).split(fs.sep).join("/");return{fullPath:r,relativeFilename:s,key:s}}let o=await Yen(e.project),i=null;for(let s of o){let u=Ken(s),l=fs.posix.join(u,`${t}.jsonl`),f=fs.join(n,...l.split("/")),h={fullPath:f,relativeFilename:l,key:l};i??=h;try{return await dl.stat(f),h}catch(_){if(!kr(_,"ENOENT"))throw new Error(`stat session transcript ${f}: ${String(_)}`)}}if(!i)throw new Error("history entry is missing project path");return i}async function Yen(e){let t=fs.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");let n=[t],r=await PD(t);if(!r||r===t)return n;for(let o=fs.dirname(t);o!==t&&(n.push(o),o!==r);)t=o,o=fs.dirname(o);return n}function Ken(e){let t=fs.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");return het(t)}function eq(){return _et()}function Jen(){return fs.join(Cet.homedir(),".claude","plans")}function Zen(e){let t=[],n=new Set;for(let r of e.split(`
696
- `)){let o=r.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch{break}if(i.type!=="assistant")continue;let s=i.message?.content;if(Array.isArray(s))for(let u of s){if(!Iet(u)||u.type!=="tool_use"||u.name!=="ExitPlanMode"||!Iet(u.input))continue;let l=u.input.planFilePath;if(typeof l!="string")continue;let f=l.trim();!f||n.has(f)||(t.push(f),n.add(f))}}return t}async function Wen(e){let t=e.trim();if(!t)throw new Error("plan file path is empty");let n=Jen(),r=n;try{r=await dl.realpath(n)}catch{}if(t.startsWith("~/")&&(t=fs.join(Cet.homedir(),t.slice(2))),!fs.isAbsolute(t))throw new Error(`plan file path must stay under ${n}`);if(t=fs.normalize(t),!bet(t,n))throw new Error(`plan file path must stay under ${n}`);try{let o=await dl.realpath(t);if(!bet(o,r))throw new Error(`plan file path must resolve under ${n}`)}catch(o){if(!kr(o,"ENOENT"))throw o}return t}function bet(e,t){let n=fs.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${fs.sep}`)}function Iet(e){return e!==null&&typeof e=="object"}Th();m();var A1=()=>{};m();Bn();async function Xen(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw Np(`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 tq(e,t,n){try{return await Xen(e,t,n)}catch(r){return $.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}m();on();function wet(e){if(e instanceof $x)return"billing_required";if(e instanceof VP)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof Ne)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"}var ttn=new Set(["private","workspace","public"]);function ntn(e){let t=(e??"").trim();if(!t)return"";if(!ttn.has(t))throw new Ne(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function lfe(e={}){let t=e.progress??A1,n=ntn(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 u=await Net({sessionId:o,project:r});i="auth",await atn();let l=e.client??Gt();i="collecting_local_file",s=await rtn(u),t({kind:"step",step:"uploading",label:s.filename}),i="uploading";let f=await otn(l,s);if(f.quarantined)return t({kind:"step",step:"done"}),{quarantined:!0,reason:f.reason,finding_count:f.findingCount,session_id:u.sessionId?.trim()??""};let{reused:h,thread:_}=f;$.info("export_upload_single_file_result",{filename:s.filename,reused:h,response:JSON.stringify(_)});let y=_?.id?.trim();if(!y)throw Wn().setContext("upload_single_file_response",{filename:s.filename,reused:h,response:_}),new Error(`upload session response missing thread id for ${s.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await VD(l,y);let T=_?.visibility?.trim()??"",v=T;n&&n!==T&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),v=await itn(l,y,n));let R=stn(y),x,O=e.highlight?.trim();if(O){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let j=await tq(l,y,O);j&&(R=j.url,x={query:O,matched:j.matched,start_block_id:j.start_block_id,end_block_id:j.end_block_id})}let P=await Aet(R);return t({kind:"completed",url:R,reused:h,visibility:v,clipboardCopied:P,sessionId:u.sessionId?.trim()??""}),t({kind:"step",step:"done"}),Ch("lore.cli.thread_exported",{thread_id:y,harness:s.harness,visibility:v,reused:h}),{thread_id:y,url:R,session_id:u.sessionId?.trim()??"",project:u.project,reused:h,visibility:v,clipboard_copied:P,...x?{highlight:x}:{}}}catch(u){throw Ch("lore.cli.upload_failed",{error_category:wet(u),error_message:ln(u),step:i}),u}finally{s&&await wp(s.tempPath)}}async function rtn(e){let t=await Bet(e),n=await Hi(t.fullPath);if(!n.exists)throw new Ne(`session transcript not found at ${utn(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await vp(e.project),o=await fd(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 otn(e,t){let[n]=await MA(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 Ne(`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 itn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Np(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function stn(e){return`${C0().replace(/\/+$/,"")}/thread/${e}`}async function atn(){let e=await sn();if(!e)throw new Ne("not logged in \u2014 run 'lore login' first");return e}function utn(e){let t=etn.homedir();if(!t)return e;let n=Oet.relative(t,e);return!n||n.startsWith("..")?e:Oet.join("~",n)}var ket={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}){$.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(vu()&&!t?.progress){let o=await m1({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:i=>lfe({...n,progress:i})});"quarantined"in o&&o.quarantined&&console.log(`
694
+ `)}var PXe={meta:{name:"list",description:"List skills available in your workspace."},async run({data:e}){let t=e;if(!await(t?.getAccessToken??sn)())throw new De("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Gt()).listSkills({});if(o.status!==200){let i=o.body?.message??`listSkills returned ${o.status}`;throw new De(i)}console.log(QXt(o.body.objects))}};m();Pr();on();var MXe={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 sn())throw new De("skill proposals require login \u2014 run 'lore login' first");await FXt(Gt(),e.id)}};async function FXt(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 De(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}`)}}m();import{readFile as LXe}from"node:fs/promises";Pr();on();Bn();var UXe={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 sn())throw new De("not logged in \u2014 run 'lore login' first");let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new De("pass a skill name, path, or sk_* ID to publish");let n=await GXt(Gt(),t);KXt(n)}};async function GXt(e,t){let n=t.trim();if(!n)throw new De("pass a skill name, path, or sk_* ID to publish");let r=n.startsWith("sk_")?"skill_id":"local_name_or_path";$.info("skill_publish_started",{target_kind:r,target:n});try{if(n.startsWith("sk_"))return await QXe(e,n);let o=await dWe(n)??await pWe(n);if(!o)throw new De(`no SKILL.md found for ${n}`);return await jXt(e,o)}catch(o){throw $.warn("skill_publish_failed",{target_kind:r,target:n,phase:"publish",error:ln(o)}),o}}async function jXt(e,t){let n=Vf(t.bodyMd),r=await DWe(t);$.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 zXt(o)!==n){let s=await s1(e,{...t,...o?{skillId:o}:{}},{syncAction:"capture"});o=s.skill_id,$.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 QXe(e,o);return i.kind!=="conflict"&&i.kind!=="remote_newer"&&await a1(t,{skillId:o,version:i.version}),i}async function zXt(e){return(await Ha()).captured[e]?.lastPushedHash??null}async function QXe(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status===200&&n.body.visibility==="workspace")return $Xt(e,t,n.body);let r=await e.publishSkill({params:{id:t},body:{}});if(r.status!==200)throw YXt("publish skill",r.status,r.body);return await HXt(t,r.body.latest_version??0),$.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 HXt(e,t){let r=(await Ha()).captured[e];if(!r)return;let o;try{o=await LXe(r.filePath,"utf8")}catch(i){$.warn("skill_publish_record_local_failed",{skill_id:e,file_path:r.filePath,error:ln(i)});return}await a1({name:r.name,bodyMd:o,filePath:r.filePath,rootKind:r.rootKind},{skillId:e,version:t})}async function $Xt(e,t,n){let r=await Ha(),o=r.installed[t]??null,i=r.captured[t]??null,s=r.published[t]??null,u=o?.installPath??i?.filePath,l=o?.rootKind??i?.rootKind??n.root_kind,f=o?.name??i?.name??n.name;if(!u)throw new De(`no managed local SKILL.md found for ${t}; install or capture it first`);let h=await LXe(u,"utf8"),_=Vf(h),y=n.latest_version??0,T=n.content_hash??"",v=qXt(o,s,i);if(_===T)return $.info("skill_publish_noop",{skill_id:t,version:y,reason:"local_matches_remote"}),{kind:"unchanged",skillId:t,version:y};if(v.version>0&&y>v.version)return _===v.hash?($.info("skill_publish_noop",{skill_id:t,version:y,reason:"remote_newer_local_unchanged",local_version:v.version}),{kind:"remote_newer",skillId:t,localVersion:v.version,remoteVersion:y}):(o&&await cl({...o,lastSyncStatus:"conflict"}),$.warn("skill_publish_conflict",{skill_id:t,local_version:v.version,remote_version:y,name:f,file_path:u}),{kind:"conflict",skillId:t,localVersion:v.version,remoteVersion:y});if(_===v.hash)return $.info("skill_publish_noop",{skill_id:t,version:y,reason:"local_matches_base"}),{kind:"unchanged",skillId:t,version:y};let R=await VXt(e),x=n.owner?.id&&n.owner.id===R?"owner_update":"subscriber_update",O=await s1(e,{skillId:t,name:f,description:null,bodyMd:h,filePath:u,rootKind:l},{syncAction:x,...v.version>0?{baseVersion:v.version}:{}});return o&&await cl({...o,...O.version_status==="accepted"?{baseVersion:O.version,baseContentHash:O.content_hash,lastSyncStatus:"current"}:{lastSyncStatus:"proposed"},lastInstalledVersion:O.version,lastInstalledHash:O.content_hash}),await a1({name:f,bodyMd:h,filePath:u,rootKind:l},{skillId:O.skill_id,version:O.version}),$.info("skill_publish_update_uploaded",{skill_id:O.skill_id,name:f,file_path:u,sync_action:x,version:O.version,version_status:O.version_status}),{kind:"uploaded",skillId:O.skill_id,version:O.version,versionStatus:O.version_status==="proposed"?"proposed":"accepted"}}function qXt(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 VXt(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}function YXt(e,t,n){let r=n?.message??`${e} returned ${t}`;return new De(r)}function KXt(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}}m();Pr();on();var FXe={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 sn())throw new De("skill rejection requires login \u2014 run 'lore login' first");await JXt(Gt(),{id:e.id,version:e.version,reason:e.reason})}};async function JXt(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new De("--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 De(i)}console.log(`rejected /${o.body.name} v${o.body.version} (${o.body.id})`)}m();Rk();import ZXt from"node:os";import $a from"node:path";var GXe={meta:{name:"scan",description:"List local skills found by Lore's scanner."},async run(){await ren()}};function WXt(e){let t=$a.resolve(e),n=$a.resolve(ZXt.homedir()),r=$a.relative(n,t);return r===""?"~":!r.startsWith("..")&&!$a.isAbsolute(r)?$a.join("~",r):t}function XXt(e){return WXt($a.dirname($a.dirname(e)))}function een(e){return $a.basename($a.dirname(e))}function ten(e,t){let n=$a.resolve(e);for(let r of t){let o=$a.resolve(r),i=$a.relative(o,n);if(i!==""&&!i.startsWith("..")&&!$a.isAbsolute(i))return o}return null}function nen(e,t,n){return e==="claude_project"?t.map(r=>$a.join(T9(r),n)):e==="agents_project"?t.map(r=>$a.join(b9(r),n)):[]}async function ren(){let e=await NWe(),t=e.map(u=>u.root),n=new Map(e.map(u=>[$a.resolve(u.root),u])),r=await Upe({projectCwds:t,includeCwdProject:!1}),o={},i=new Set;for(let u of r){let l=$a.resolve(u.filePath);if(i.has(l))continue;i.add(l);let f=XXt(u.filePath),h=ten(u.filePath,t),_=h?n.get(h)?.alsoSeenAt??[]:[];o[f]??=[],o[f].push({name:u.name,description:u.description,root_kind:u.rootKind,file_path:u.filePath,also_seen_at:nen(u.rootKind,_,een(u.filePath))})}let s=QGe.parse({type:"local_skill_scanner_output",skills:o});console.log(JSON.stringify(s,null,2))}m();Pr();on();var jXe={meta:{name:"status",description:"Show local Lore-managed skill sync state."},async run(){if(!await sn())throw new De("skill status requires login \u2014 run 'lore login' first");await oen()}};async function oen(){let e=await Ha(),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(`
695
+ `))}m();Pr();on();var zXe={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await sn())throw new De("workspace skill sync requires login \u2014 run 'lore login' first");let e=await rfe(Gt());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};m();import HXe from"node:fs/promises";import ien from"node:path";Pr();on();var $Xe={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 De("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await sn())throw new De("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Gt();await sen(n,t)}};async function sen(e,t){let n=await i1(t);n&&(await HXe.rm(n.installPath,{force:!0}),await HXe.rmdir(ien.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 De(o)}if(await TWe(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}var qXe={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:UXe,install:kXe,uninstall:$Xe,sync:zXe,daemon:F9,approve:wXe,reject:FXe,proposals:MXe,status:jXe,list:PXe,scan:GXe}};s0();m();await Ao();var Y9=ue(dn(),1);sc();await pb();m();await Ao();var $9=ue(dn(),1);await xA();m();await Ao();var c1=ue(dn(),1);ks();var md=ue(jt(),1);function l1({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[s,u]=(0,c1.useState)(VXe(e,n)),l=(0,c1.useRef)(s);return(0,c1.useEffect)(()=>{let f=VXe(e,n);l.current=f,u(f)},[e,n]),xu((f,h)=>{if(e.length!==0){if(h.upArrow||f==="k"){let _=aen(e,l.current);l.current=_,u(_);return}if(h.downArrow||f==="j"){let _=YXe(e,l.current);l.current=_,u(_);return}if(h.return||f===" "){let _=e[l.current];_&&!_.disabled&&t(_)}}},{isActive:!r}),e.length===0?(0,md.jsx)(he,{color:Re.muted,children:"no actions available"}):(0,md.jsxs)(Ee,{flexDirection:"column",children:[e.map((f,h)=>{let _=h===s,y=f.disabled?Re.muted:_?Re.primary:Re.highlight;return(0,md.jsxs)(Ee,{children:[(0,md.jsx)(Ee,{width:2,flexShrink:0,children:(0,md.jsx)(he,{color:_?Re.primary:Re.muted,children:_?"\u203A":" "})}),(0,md.jsx)(Ee,{width:i,flexShrink:0,children:(0,md.jsx)(he,{color:y,bold:_&&!f.disabled,children:f.label})}),f.description?(0,md.jsx)(Ee,{flexGrow:1,flexShrink:1,children:(0,md.jsx)(he,{color:Re.muted,children:f.description})}):null]},f.id)}),o?(0,md.jsx)(Ee,{marginTop:1,children:(0,md.jsx)(he,{color:Re.muted,children:o})}):null]})}function VXe(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?YXe(e,n-1):n}function YXe(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 aen(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 DA();await Ab();await gb();ks();m();Pr();Fa();LD();HD();async function G9(e){if(!await(e.hasAccessToken??(async()=>!!await sn()))())return{state:"logged_out"};let n=e.client??Gt();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:KXe(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 j9(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??u$;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function z9(e){if(!await(e.hasAccessToken??(async()=>!!await sn()))())return{state:"logged_out"};let n=e.client??Gt();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:KXe(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 H9(){try{await Ih();let e=await Ho();return uen(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function uen(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function KXe(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 wt=ue(jt(),1);function U0({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=ws(),[i,s]=(0,$9.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,$9.useEffect)(()=>{if(t)return;let l=!1;return(async()=>{let[f,h,_,y]=await Promise.all([G9(n),j9(n),z9(n),H9()]);l||s({identity:f,daemon:h,skills:_,uploadDirs:y})})(),()=>{l=!0}},[]),xu((l,f)=>{(l==="q"||f.ctrl&&l==="c"||f.escape)&&(r("quit"),o())});let u=men(i);return(0,wt.jsxs)(Ee,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,wt.jsx)(Ps,{title:"lore",subtitle:len(i.identity),right:`v${e}`}),(0,wt.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,wt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,wt.jsx)(Qn,{title:"Daemon",children:(0,wt.jsx)(den,{daemon:i.daemon})})}),(0,wt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,wt.jsx)(Qn,{title:"Workspace",children:(0,wt.jsx)(pen,{identity:i.identity,skills:i.skills})})})]}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsx)(Qn,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,wt.jsx)(cen,{uploadDirs:i.uploadDirs})})}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsx)(Qn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,wt.jsx)(l1,{items:u,onSelect:l=>{r(l.id),o()}})})})]})}function cen({uploadDirs:e}){return e.state==="loading"?(0,wt.jsx)(ja,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsxs)(he,{color:Re.muted,children:["Run ",(0,wt.jsx)(he,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,wt.jsxs)(Ee,{flexDirection:"column",children:[e.cwd.map(t=>(0,wt.jsx)(an,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,wt.jsx)(an,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function len(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 den({daemon:e}){if(e.state==="loading")return(0,wt.jsx)(ja,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(he,{color:Re.muted,children:"Background uploads are macOS-only today."}),(0,wt.jsxs)(he,{color:Re.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:t.health,kind:n}),(0,wt.jsx)(an,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,wt.jsx)(an,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,wt.jsx)(an,{label:"Heartbeat",value:JXe(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,wt.jsx)(an,{label:"Last upload",value:JXe(t.status?.last_success_at)}),t.status?.last_error?(0,wt.jsx)(an,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function pen({identity:e,skills:t}){return e.state==="loading"?(0,wt.jsx)(ja,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"signed out",kind:"warning"}),(0,wt.jsx)(he,{color:Re.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]}):(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"User",value:e.email,kind:"success"}),(0,wt.jsx)(an,{label:"Display name",value:e.displayName}),(0,wt.jsx)(an,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,wt.jsx)(an,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,wt.jsx)(an,{label:"Skills",value:fen(t)})]})}function fen(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 men(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 JXe(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}m();await Ao();await xA();await DA();ks();var si=ue(jt(),1),Aen=[{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 q9({cliVersion:e,onSelect:t}){let{exit:n}=ws();return xu((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,si.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,si.jsx)(Ps,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,si.jsx)(Qn,{title:"What is Lore?",children:(0,si.jsxs)(Ee,{flexDirection:"column",children:[(0,si.jsx)(he,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,si.jsxs)(Ee,{marginTop:1,flexDirection:"column",children:[(0,si.jsx)(he,{color:Re.muted,children:"You'll get:"}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,si.jsx)(Ee,{marginTop:1,children:(0,si.jsx)(Qn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,si.jsx)(l1,{items:Aen,onSelect:r=>{t(r.id),n()}})})}),(0,si.jsx)(Ee,{marginTop:1,children:(0,si.jsxs)(he,{color:Re.muted,children:["New to Lore? Run ",(0,si.jsx)(he,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var V9=ue(jt(),1),gen={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 hen({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,Y9.useState)(void 0),{exit:i}=ws();return(0,Y9.useEffect)(()=>{let s=!1;return(async()=>{let[u,l,f,h]=await Promise.all([G9(t),j9(t),z9(t),H9()]);s||o({identity:u,daemon:l,skills:f,uploadDirs:h})})(),()=>{s=!0}},[]),r?r.identity.state==="logged_out"?(0,V9.jsx)(q9,{cliVersion:e,onSelect:s=>{n(s),i()}}):(0,V9.jsx)(U0,{cliVersion:e,initialData:r,onSelect:n}):null}async function ZXe(){let e="quit";return await sl((0,V9.jsx)(hen,{cliVersion:hu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:gen[e]}}m();await pb();m();await Ao();var QM=ue(dn(),1);await xA();await DA();ks();m();await Ao();await Mle();await xA();await mb();await DA();await Qle();m();await Ao();ks();var d1=ue(jt(),1),_en="\u2588",Een="\u2591";function WXe({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,d1.jsxs)(Ee,{children:[(0,d1.jsx)(he,{color:r,children:_en.repeat(i)}),(0,d1.jsx)(he,{color:Re.muted,children:Een.repeat(s)}),n?(0,d1.jsxs)(he,{color:Re.muted,children:[" ",n]}):null]})}await Ab();await gb();await Lle();await $le();await Yle();m();await Ao();await xA();await mb();await DA();await Ab();ks();var go=ue(jt(),1),eet=[{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 kM(){return{steps:eet.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function K9(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?`${XXe(n.key)} (${t.label})`:XXe(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function XXe(e){return eet.find(t=>t.key===e)?.label??e}function Nh({title:e,subtitle:t,state:n}){return(0,go.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,go.jsx)(Ps,{title:e,subtitle:t}),(0,go.jsx)(Qn,{title:"Pipeline",children:(0,go.jsx)(Ee,{flexDirection:"column",children:n.steps.map(r=>(0,go.jsx)(yen,{step:r},r.key))})}),n.result?(0,go.jsx)(Ee,{marginTop:1,flexDirection:"column",children:(0,go.jsx)(Ms,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,go.jsxs)(Ee,{flexDirection:"column",children:[(0,go.jsx)(he,{children:n.result.url}),(0,go.jsx)(Ee,{marginTop:1,children:(0,go.jsxs)(he,{color:Re.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,go.jsx)(Ee,{marginTop:1,children:(0,go.jsx)(Ms,{kind:"error",title:"Failed",children:(0,go.jsx)(he,{children:n.errorMessage})})}):null]})}function yen({step:e}){return e.status==="active"?(0,go.jsxs)(Ee,{children:[(0,go.jsx)(ja,{}),(0,go.jsx)(he,{children:" "}),(0,go.jsx)(he,{color:Re.primary,children:e.label})]}):e.status==="done"?(0,go.jsxs)(Ee,{children:[(0,go.jsx)(he,{color:Re.success,children:"\u2713 "}),(0,go.jsx)(he,{color:Re.muted,children:e.label})]}):(0,go.jsxs)(Ee,{children:[(0,go.jsx)(he,{color:Re.muted,children:"\u25CB "}),(0,go.jsx)(he,{color:Re.muted,children:e.label})]})}ks();m();var PM=Date.parse("2026-05-16T12:00:00.000Z");function MM(e){return new Date(PM-e*6e4).toISOString()}var Yf={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"},tet=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:PM-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:PM-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:PM-180*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:PM-1560*6e4}],Sen=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],p1={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:Yf.plist,binary_path:Yf.binary,status_path:Yf.status,install_source_path:Yf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:MM(60),last_heartbeat_at:MM(1),last_success_at:MM(5),last_completed_at:MM(5),last_thread_ids:["thr_01hx_story"]}},net={...p1,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...p1.status,state:"error",last_heartbeat_at:MM(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},Ten={...p1,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},ben={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"},LM={identity:ben,daemon:{state:"ready",report:p1},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:Sen,repo:[]}},ret={...LM,uploadDirs:{state:"ready",cwd:[],repo:[]}},oet={...LM,daemon:{state:"error",message:"launchctl print failed: service not found"}},iet={...LM,daemon:{state:"unsupported",platform:"linux"}},set={identity:{state:"logged_out"},daemon:{state:"ready",report:Ten},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},aet=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var yt=ue(jt(),1),ro=()=>{};function Q0(...e){return e.reduce(S$,qP())}function UM(...e){return e.reduce(K9,kM())}var LA=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,yt.jsx)(q9,{cliVersion:"0.1.0",onSelect:ro})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,yt.jsx)(Dp,{state:qP()})},{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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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:Yf.plist,binaryPath:Yf.binary,logFile:Yf.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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(Dp,{state:Q0({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,yt.jsx)(wA,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:tet,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,yt.jsx)(wA,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:ro,onSkip:ro})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,yt.jsx)(wA,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:ro,onSkip:ro})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:LM,onSelect:ro})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:ret,onSelect:ro})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:oet,onSelect:ro})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:iet,onSelect:ro})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:set,onSelect:ro})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:kM()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:UM({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,yt.jsx)(Nh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:UM({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,yt.jsx)(Nh,{title:"lore share-codex",state:UM({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,yt.jsx)(Nh,{title:"lore share-cowork",state:UM({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,yt.jsx)(Nh,{title:"lore export",state:UM({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,yt.jsx)(L0,{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,yt.jsx)(L0,{mode:"enable",state:{phase:"finished",result:{plistPath:Yf.plist,binaryPath:Yf.binary,logFile:Yf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,yt.jsx)(L0,{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,yt.jsx)(L0,{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,yt.jsx)(L0,{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,yt.jsx)(DM,{report:p1})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,yt.jsx)(DM,{report:net})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,yt.jsx)(Ps,{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,yt.jsx)(Qn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,yt.jsx)(he,{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,yt.jsxs)(Qn,{title:"StatusLine",children:[(0,yt.jsx)(an,{label:"Healthy",value:"yes",kind:"success"}),(0,yt.jsx)(an,{label:"Warning",value:"needs attention",kind:"warning"}),(0,yt.jsx)(an,{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,yt.jsx)(Qn,{title:"ProgressBar",children:(0,yt.jsx)(WXe,{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,yt.jsxs)(Ee,{flexDirection:"column",children:[(0,yt.jsx)(Ms,{kind:"success",title:"Shared",children:(0,yt.jsx)(he,{children:"Copied the Lore URL to your clipboard."})}),(0,yt.jsx)(Ee,{marginTop:1,children:(0,yt.jsx)(Ms,{kind:"error",title:"Failed",children:(0,yt.jsx)(he,{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,yt.jsx)(Qn,{title:"Spinner",children:(0,yt.jsx)(ja,{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,yt.jsx)(Qn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,yt.jsx)(l1,{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:ro})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,yt.jsx)(Qn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,yt.jsx)(HP,{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:ro,onAction:ro})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,yt.jsx)(Qn,{title:"TextInput",children:(0,yt.jsx)(g$,{initialValue:"~/code",onSubmit:ro,onCancel:ro})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,yt.jsx)(Qn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,yt.jsx)(h$,{initialValue:"/Users/alex/code",loadSuggestions:async()=>aet,onSubmit:ro,onCancel:ro})})}];function uet(e){return LA.find(t=>t.id===e)}function f1(e){return e.path.slice(1).join(" / ")}var Fr=ue(jt(),1);function det({initialStoryId:e}){let t=Math.max(0,LA.findIndex(f=>f.id===e)),[n,r]=(0,QM.useState)(t),[o,i]=(0,QM.useState)("sidebar"),s=(0,QM.useRef)(o);s.current=o;let{exit:u}=ws();xu((f,h)=>{if(h.ctrl&&f==="c"){u();return}if(s.current==="sidebar"&&f==="q"){u();return}if(h.escape){if(s.current==="preview"){s.current="sidebar",i("sidebar");return}u();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(_=>cet(_-1));return}(h.downArrow||f==="j")&&r(_=>cet(_+1))}});let l=LA[n]??LA[0];return(0,Fr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Fr.jsx)(Ps,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${LA.length}`}),(0,Fr.jsx)(Ee,{marginBottom:1,children:(0,Fr.jsx)(he,{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,Fr.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,Fr.jsx)(Ee,{width:36,flexShrink:0,children:(0,Fr.jsx)(Qn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,Fr.jsx)(Ien,{stories:LA,selectedIndex:n,focused:o==="sidebar"})})}),(0,Fr.jsx)(Ee,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,Fr.jsx)(Qn,{title:l.title,focused:o==="preview",subtitle:o==="preview"?`${f1(l)} \xB7 focused`:f1(l),children:(0,Fr.jsxs)(Ee,{flexDirection:"column",children:[(0,Fr.jsx)(he,{color:Re.muted,children:l.description}),o==="sidebar"?(0,Fr.jsxs)(he,{color:Re.muted,children:["Press ",(0,Fr.jsx)(he,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,Fr.jsx)(Ee,{marginTop:1,children:l.render()})]})})})]})]})}function Ien({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,s)=>{let u=i.path.slice(1),l=Den(o,u);for(let f=l;f<u.length;f++)r.push((0,Fr.jsx)(Cen,{label:u[f]??"",level:f,marginTop:xen(u[f]??"",f,l),focused:n},`group:${u.slice(0,f+1).join("/")}`));r.push((0,Fr.jsx)(ven,{story:i,selected:s===t,focused:n},i.id)),o=u}),(0,Fr.jsx)(Ee,{flexDirection:"column",children:r})}function Cen({label:e,level:t,marginTop:n,focused:r}){return(0,Fr.jsx)(Ee,{marginLeft:pet(t),marginTop:n,children:(0,Fr.jsx)(he,{color:r?Re.primary:Re.muted,bold:r,wrap:"truncate-end",children:e})})}function ven({story:e,selected:t,focused:n}){let r=n?t?Re.accent:Re.highlight:Re.muted;return(0,Fr.jsxs)(Ee,{marginLeft:pet(e.path.slice(1).length),children:[(0,Fr.jsx)(he,{color:n&&t?Re.accent:Re.muted,children:t?"\u203A ":" "}),(0,Fr.jsx)(he,{color:r,bold:n&&t,wrap:"truncate-end",children:Ren(e)})]})}function Ren(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function pet(e){return Math.min(e,4)}function xen(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Den(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 cet(e){let t=LA.length;return(e%t+t)%t}function fet({story:e}){let{exit:t}=ws();return xu((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,Fr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Fr.jsx)(Ps,{title:e.title,subtitle:f1(e),right:"Esc to exit"}),(0,Fr.jsx)(Ee,{marginBottom:1,children:(0,Fr.jsx)(he,{color:Re.muted,children:e.description})}),e.render()]})}var ofe=ue(jt(),1),met={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){Nen();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=uet(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 sl((0,ofe.jsx)(fet,{story:n})).waitUntilExit();return}await sl((0,ofe.jsx)(det,{})).waitUntilExit()}};function Nen(){for(let e of LA)console.log(`${e.id} ${f1(e)} ${e.title}`)}m();Bn();s0();m();await Ao();var J9=ue(dn(),1);await pb();var ife=ue(jt(),1);function Ben({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,s]=(0,J9.useState)(kM),{exit:u}=ws();return(0,J9.useEffect)(()=>{let l=!1,f=h=>{l||s(_=>K9(_,h))};return(async()=>{try{let h=await n(f);if(l)return;r(h),setTimeout(()=>u(),100)}catch(h){if(f({kind:"error",message:h instanceof Error?h.message:String(h)}),l)return;o(h),setTimeout(()=>u(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{l=!0}},[]),(0,ife.jsx)(Nh,{title:e,subtitle:t,state:i})}async function m1(e){let t,n,r=!1;if(await sl((0,ife.jsx)(Ben,{title:e.title,subtitle:e.subtitle,perform:e.perform,onResolve:i=>{t=i,r=!0},onReject:i=>{n=i}})).waitUntilExit(),!r)throw n instanceof Error?n:new Error(String(n??"share flow failed"));return t}m();WR();Pr();import etn from"node:os";import Oet from"node:path";m();import{spawn as wen}from"node:child_process";import Oen from"node:os";async function Aet(e,t={}){let n=t.timeoutMs??2e3,r=ken();for(let o of r)if(await Pen(o,e,n))return!0;return!1}function ken(){switch(Oen.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 Pen(e,t,n){return new Promise(r=>{let o;try{o=wen(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,s=l=>{i||(i=!0,r(l))},u=setTimeout(()=>{o.kill("SIGKILL"),s(!1)},n);o.on("error",()=>{clearTimeout(u),s(!1)}),o.on("close",l=>{clearTimeout(u),s(l===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}on();Bn();QP();m();import dl from"node:fs/promises";import Cet from"node:os";import fs from"node:path";m();m();import Men from"node:os";import get from"node:path";function het(e){return e.replace(/[^A-Za-z0-9_-]/g,"-")}function _et(e=Men.homedir(),t=process.env.CLAUDE_CONFIG_DIR){let n=t?.trim();return n?get.join(n,"projects"):get.join(e,".claude","projects")}m();import ll from"node:fs";import Len from"node:os";import vb from"node:path";var sfe="local-agent-mode-sessions",afe=["audit.jsonl","transcript.jsonl"];function Eet(e=Len.homedir()){return vb.join(e,"Library","Application Support","Claude",sfe)}function yet(e){if(!ll.existsSync(e))return[];let t=[];for(let n of ll.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=vb.join(e,n.name);for(let o of ll.readdirSync(r,{withFileTypes:!0})){if(!o.isDirectory())continue;let i=vb.join(r,o.name);for(let s of ll.readdirSync(i,{withFileTypes:!0})){if(!s.isDirectory()||!s.name.startsWith("local_"))continue;let u=s.name.replace(/^local_/,"");if(!u)continue;let l=vb.join(i,s.name),f=W9(l),h=f?ll.statSync(f):ll.statSync(l);t.push({accountId:n.name,orgId:o.name,sessionId:u,sessionDir:i,localDir:l,mtimeMs:h.mtimeMs})}}}return t.sort((n,r)=>r.mtimeMs-n.mtimeMs),t}function Z9(e){if(!ll.existsSync(e))return null;let t=null;for(let n of ll.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory()||!n.name.startsWith("local_"))continue;let r=vb.join(e,n.name),o=W9(r),i=o!==null,s=o?ll.statSync(o).mtimeMs:ll.statSync(r).mtimeMs;(t===null||i&&!t.hasTranscript||i===t.hasTranscript&&s>t.mtimeMs)&&(t={dir:r,mtimeMs:s,hasTranscript:i})}return t?.dir??null}function W9(e){for(let t of afe){let n=vb.join(e,t);if(ll.existsSync(n)&&ll.statSync(n).isFile())return n}return null}function ufe(e,t){let n=vb.join(e,t);return ll.existsSync(n)?ll.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}on();l$();Bn();Fa();Th();m();on();import{createReadStream as Uen}from"node:fs";import Qen from"node:fs/promises";import{createInterface as Fen}from"node:readline";var Gen=50;async function Tet(e,t={}){let n=t.maxLines??Gen;try{await Qen.stat(e)}catch(o){if(kr(o,"ENOENT"))return null;throw o}let r=Uen(e,{encoding:"utf8"});return await new Promise((o,i)=>{let s=!1,u=0,l=_=>{s||(s=!0,f.close(),r.destroy(),o(_))},f=Fen({input:r,crlfDelay:Number.POSITIVE_INFINITY});f.on("line",_=>{if(s)return;let y=_.trim();if(y){u+=1;try{let T=JSON.parse(y);if(typeof T=="object"&&T!==null&&"cwd"in T&&typeof T.cwd=="string"){let v=T.cwd.trim();if(v){l(v);return}}}catch{}u>=n&&l(null)}}),f.on("close",()=>l(null));let h=_=>{if(!s){if(s=!0,kr(_,"ENOENT")){o(null);return}i(_)}};f.on("error",h),r.on("error",h)})}var jen=3600*1e3,zen=336*60*60*1e3,X9=Symbol("missingSessionID"),vet={name:"claudeCode",historyFilePath:eq,readUnuploadedEntries:Ret,collectLocalFiles:qen,buildPendingTranscriptWatches:Ven};async function Ret(e){let t=eq(),n=Date.now()-zen,r;try{r=await dl.readdir(t,{withFileTypes:!0})}catch(i){if(kr(i,"ENOENT"))return[];throw new Error(`readdir ${t}: ${String(i)}`)}let o=[];for(let i of r){if(!i.isDirectory())continue;let s=fs.join(t,i.name),u;try{u=await dl.readdir(s,{withFileTypes:!0})}catch{continue}for(let l of u){if(!l.isFile()||!l.name.endsWith(".jsonl"))continue;let f=fs.join(s,l.name),h;try{h=await dl.stat(f)}catch{continue}!h.isFile()||h.mtimeMs<n||o.push({sessionId:l.name.slice(0,-6),project:"",timestamp:h.mtimeMs,resolvedTranscriptPath:f})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}async function xet(){let e=new Map,t;try{t=await dl.readFile(S0(),"utf8")}catch{return e}for(let n of zP(t)){let r=n.sessionId?.trim(),o=n.project?.trim();r&&o&&!e.has(r)&&e.set(r,o)}return e}async function Det(e,t,n){let r=await Tet(e);return r||((await n()).get(t)??null)}async function Hen(){let e=S0(),t;try{t=await dl.readFile(e,"utf8")}catch(n){if(kr(n,"ENOENT"))return[];throw n}return zP(t,e)}async function Net(e){let t=await Hen(),n=e.sessionId.trim();if(n){for(let u=t.length-1;u>=0;u-=1){let l=t[u];if(l?.sessionId?.trim()===n)return l}let s=await $en(n);if(s){let u=e.project.trim()||process.cwd();return{sessionId:n,project:u,timestamp:s.mtimeMs,resolvedTranscriptPath:s.fullPath}}throw new De(`no history entry or transcript file found for session-id "${n}" \u2014 check ~/.claude/history.jsonl and ~/.claude/projects/`)}let r=fs.normalize(e.project.trim());if(!r)throw new De("export requires either --session-id or a project path");let o=await PD(r),i=[...t].sort((s,u)=>u.timestamp-s.timestamp);for(let s of i){if(!s.sessionId?.trim())continue;let u=fs.normalize(s.project.trim());if(!u||u===".")continue;if(u===r)return s;if(!o)continue;let l=await PD(u);if(l&&l===o)return s}throw new De(`no history entry found for project "${r}" \u2014 pass --session-id to pick a specific session, or cd into the repo where the Claude Code session ran`)}async function $en(e){let t=e.trim();if(!t)return null;let n=eq(),r;try{r=await dl.readdir(n,{withFileTypes:!0})}catch(o){if(kr(o,"ENOENT"))return null;throw new Error(`readdir ${n}: ${String(o)}`)}for(let o of r){if(!o.isDirectory())continue;let i=fs.join(n,o.name,`${t}.jsonl`);try{let s=await dl.stat(i);if(s.isFile())return{fullPath:i,mtimeMs:s.mtimeMs}}catch(s){if(!kr(s,"ENOENT")&&!kr(s,"ENOTDIR"))throw new Error(`stat ${i}: ${String(s)}`)}}return null}async function Bet(e){let t=await cfe(e);if(t===X9)throw new Error("history entry is missing sessionId");return t}async function qen(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=null,f=async()=>(l??=await xet(),l);try{for(let h=0;h<e.length;h+=1){let _=e[h],y=await cfe(_);if(y===X9){let V=`__missing_session__:${_.project}:${_.timestamp}:${h}`;r[h]=V,o.add(V),s.add(V);continue}if(r[h]=y.key,s.has(y.key))continue;let T=await Hi(y.fullPath);if(!T.exists){o.add(y.key),s.add(y.key);continue}if(t.isUnchanged?.(y.key,T)){o.add(y.key),s.add(y.key);continue}if(t.isThrottled?.(y.key)){i.add(y.key),s.add(y.key);continue}let v=_.project.trim()||await Det(y.fullPath,_.sessionId??"",f);if(!v){$.info("upload_filter_session_excluded",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:"<unresolved>",reason:"no_resolvable_cwd"}),o.add(y.key),s.add(y.key);continue}let R=await vp(v),x=null,O=async()=>(x!==null||(x=await dl.readFile(y.fullPath,"utf8")),x),P=await bh(t.uploadFilterConfig??vA(),{cwd:v,repoOriginPath:R,transcriptPath:y.fullPath,readTranscript:O});if(!P.shouldUpload){$.info("upload_filter_session_excluded",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:P.reason}),o.add(y.key),s.add(y.key);continue}$.info("upload_filter_session_included",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let j;try{j=await fd(y.fullPath)}catch(V){if(kr(V,"ENOENT")){o.add(y.key),s.add(y.key);continue}throw new Error(`read session transcript ${y.fullPath}: ${String(V)}`)}u.push(j.tempPath),n.push({key:y.key,filename:y.relativeFilename,sourcePath:y.fullPath,repoOriginPath:R,tempPath:j.tempPath,md5:j.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:_.sessionId?.trim()??"",watchedState:T}),s.add(y.key);let G=await dl.readFile(j.tempPath,"utf8"),H=Zen(G);for(let V of H){let ae;try{ae=await Wen(V)}catch{continue}let re=`${y.key}::plan:${ae}`;if(s.has(re))continue;let _e=await Hi(ae),Qe;try{Qe=await fd(ae)}catch(pt){if(kr(pt,"ENOENT"))continue;throw new Error(`read plan file ${ae}: ${String(pt)}`)}u.push(Qe.tempPath),n.push({key:re,filename:ae,sourcePath:ae,repoOriginPath:R,tempPath:Qe.tempPath,md5:Qe.md5,fileType:"plan",harness:"claudeCode",harnessInternalId:ae,watchedState:_e}),s.add(re)}}}catch(h){throw await Promise.all(u.map(_=>dl.rm(fs.dirname(_),{recursive:!0,force:!0}))),h}return{entries:e,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function Ven(e,t,n={}){let r=await Ret(e),o=Date.now(),i=[],s=new Set,u=null,l=async()=>(u??=await xet(),u);for(let f of r){let h=await cfe(f);if(h===X9||s.has(h.fullPath))continue;s.add(h.fullPath);let _=await Hi(h.fullPath);if(!_.exists)continue;let y=f.project.trim()||await Det(h.fullPath,f.sessionId??"",l);if(!y)continue;let T=await vp(y),v=await bh(n.uploadFilterConfig??vA(),{cwd:y,repoOriginPath:T,transcriptPath:h.fullPath,readTranscript:()=>dl.readFile(h.fullPath,"utf8")},{ignoreSkillRules:!0});if(!v.shouldUpload){$.info("upload_filter_watch_excluded",{filename:h.relativeFilename,transcript_path:h.fullPath,cwd:y,repo_origin_path:T||"<none>",reason:v.reason});continue}i.push({sessionId:f.sessionId?.trim()??"",project:y,transcriptPath:h.fullPath,expiresAt:new Date(o+jen),baseline:t.get(h.fullPath)??_})}return i.sort((f,h)=>f.transcriptPath.localeCompare(h.transcriptPath))}async function cfe(e){let t=e.sessionId?.trim();if(!t)return X9;let n=eq(),r=e.resolvedTranscriptPath?.trim();if(r){let s=fs.relative(n,r).split(fs.sep).join("/");return{fullPath:r,relativeFilename:s,key:s}}let o=await Yen(e.project),i=null;for(let s of o){let u=Ken(s),l=fs.posix.join(u,`${t}.jsonl`),f=fs.join(n,...l.split("/")),h={fullPath:f,relativeFilename:l,key:l};i??=h;try{return await dl.stat(f),h}catch(_){if(!kr(_,"ENOENT"))throw new Error(`stat session transcript ${f}: ${String(_)}`)}}if(!i)throw new Error("history entry is missing project path");return i}async function Yen(e){let t=fs.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");let n=[t],r=await PD(t);if(!r||r===t)return n;for(let o=fs.dirname(t);o!==t&&(n.push(o),o!==r);)t=o,o=fs.dirname(o);return n}function Ken(e){let t=fs.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");return het(t)}function eq(){return _et()}function Jen(){return fs.join(Cet.homedir(),".claude","plans")}function Zen(e){let t=[],n=new Set;for(let r of e.split(`
696
+ `)){let o=r.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch{break}if(i.type!=="assistant")continue;let s=i.message?.content;if(Array.isArray(s))for(let u of s){if(!Iet(u)||u.type!=="tool_use"||u.name!=="ExitPlanMode"||!Iet(u.input))continue;let l=u.input.planFilePath;if(typeof l!="string")continue;let f=l.trim();!f||n.has(f)||(t.push(f),n.add(f))}}return t}async function Wen(e){let t=e.trim();if(!t)throw new Error("plan file path is empty");let n=Jen(),r=n;try{r=await dl.realpath(n)}catch{}if(t.startsWith("~/")&&(t=fs.join(Cet.homedir(),t.slice(2))),!fs.isAbsolute(t))throw new Error(`plan file path must stay under ${n}`);if(t=fs.normalize(t),!bet(t,n))throw new Error(`plan file path must stay under ${n}`);try{let o=await dl.realpath(t);if(!bet(o,r))throw new Error(`plan file path must resolve under ${n}`)}catch(o){if(!kr(o,"ENOENT"))throw o}return t}function bet(e,t){let n=fs.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${fs.sep}`)}function Iet(e){return e!==null&&typeof e=="object"}Th();m();var A1=()=>{};m();Bn();async function Xen(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw Np(`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 tq(e,t,n){try{return await Xen(e,t,n)}catch(r){return $.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}m();on();function wet(e){if(e instanceof $x)return"billing_required";if(e instanceof VP)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof De)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"}var ttn=new Set(["private","workspace","public"]);function ntn(e){let t=(e??"").trim();if(!t)return"";if(!ttn.has(t))throw new De(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function lfe(e={}){let t=e.progress??A1,n=ntn(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 u=await Net({sessionId:o,project:r});i="auth",await atn();let l=e.client??Gt();i="collecting_local_file",s=await rtn(u),t({kind:"step",step:"uploading",label:s.filename}),i="uploading";let f=await otn(l,s);if(f.quarantined)return t({kind:"step",step:"done"}),{quarantined:!0,reason:f.reason,finding_count:f.findingCount,session_id:u.sessionId?.trim()??""};let{reused:h,thread:_}=f;$.info("export_upload_single_file_result",{filename:s.filename,reused:h,response:JSON.stringify(_)});let y=_?.id?.trim();if(!y)throw Wn().setContext("upload_single_file_response",{filename:s.filename,reused:h,response:_}),new Error(`upload session response missing thread id for ${s.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await VD(l,y);let T=_?.visibility?.trim()??"",v=T;n&&n!==T&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),v=await itn(l,y,n));let R=stn(y),x,O=e.highlight?.trim();if(O){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let j=await tq(l,y,O);j&&(R=j.url,x={query:O,matched:j.matched,start_block_id:j.start_block_id,end_block_id:j.end_block_id})}let P=await Aet(R);return t({kind:"completed",url:R,reused:h,visibility:v,clipboardCopied:P,sessionId:u.sessionId?.trim()??""}),t({kind:"step",step:"done"}),Ch("lore.cli.thread_exported",{thread_id:y,harness:s.harness,visibility:v,reused:h}),{thread_id:y,url:R,session_id:u.sessionId?.trim()??"",project:u.project,reused:h,visibility:v,clipboard_copied:P,...x?{highlight:x}:{}}}catch(u){throw Ch("lore.cli.upload_failed",{error_category:wet(u),error_message:ln(u),step:i}),u}finally{s&&await wp(s.tempPath)}}async function rtn(e){let t=await Bet(e),n=await Hi(t.fullPath);if(!n.exists)throw new De(`session transcript not found at ${utn(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await vp(e.project),o=await fd(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 otn(e,t){let[n]=await MA(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 De(`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 itn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Np(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function stn(e){return`${C0().replace(/\/+$/,"")}/thread/${e}`}async function atn(){let e=await sn();if(!e)throw new De("not logged in \u2014 run 'lore login' first");return e}function utn(e){let t=etn.homedir();if(!t)return e;let n=Oet.relative(t,e);return!n||n.startsWith("..")?e:Oet.join("~",n)}var ket={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}){$.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(vu()&&!t?.progress){let o=await m1({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:i=>lfe({...n,progress:i})});"quarantined"in o&&o.quarantined&&console.log(`
697
697
  Held locally \u2014 not uploaded. ${o.finding_count} finding(s); reason: ${o.reason}. See \`lore quarantine\`.`);return}let r=await lfe({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};m();m();i0();Pr();sc();on();Bn();Fa();LD();var ctn=5,ltn=1e3;async function Met(e={}){(e.environment??to())!=="dev"||!await dtn({fetchFn:e.fetchFn})||await ptn({client:e.client})}async function dtn(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return $.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??ctn,o=e.retryDelayMs??ltn,i=`${cd()}/api/cli-auth/dev-token`;for(let s=1;s<=r;s+=1)try{let u=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(u.status===404){let f=await Pet(u);return dh(),$.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f,url:i}),!1}if(!u.ok){let f=await Pet(u);return dh(),$.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f}),!1}let l=await u.json();return l.access_token?(yje(l.access_token),$.info("dev_preflight_token_minted",{email:t,expiresIn:l.expires_in}),!0):(dh(),$.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(u){if(s===r)return dh(),$.warn("dev_preflight_token_unreachable",{url:i,error:ln(u)}),!1;await ftn(o)}return!1}async function ptn(e={}){await Ih();let t=await Ho();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=ji(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Gt();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){$.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){$.warn("dev_preflight_whoami_error",{error:ln(o)});return}await pd({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),$.info("dev_preflight_upload_dir_seeded",{path:n})}async function Pet(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 ftn(e){return new Promise(t=>{setTimeout(t,e)})}m();t$();Pr();Bn();Fa();import{setTimeout as Vet}from"node:timers/promises";m();on();Bn();Fa();import{createReadStream as mtn}from"node:fs";import F0 from"node:fs/promises";import Atn from"node:os";import Kf from"node:path";import{createInterface as gtn}from"node:readline";Th();var htn=3600*1e3,Uet={name:"codex",historyFilePath:dfe,readUnuploadedEntries:Qet,collectLocalFiles:Etn,buildPendingTranscriptWatches:ytn};function dfe(){return process.env.LORE_CODEX_SESSIONS_DIR??Kf.join(Atn.homedir(),".codex","sessions")}async function Qet(e){let t=dfe(),n;try{n=await F0.readdir(t,{withFileTypes:!0})}catch(o){if(kr(o,"ENOENT"))return[];throw o}let r=[];for(let o of n){if(!o.isDirectory())continue;let i=Kf.join(t,o.name),s;try{s=await F0.readdir(i,{withFileTypes:!0})}catch{continue}for(let u of s){if(!u.isDirectory())continue;let l=Kf.join(i,u.name),f;try{f=await F0.readdir(l,{withFileTypes:!0})}catch{continue}for(let h of f){if(!h.isDirectory())continue;let _=Kf.join(l,h.name),y;try{y=await F0.readdir(_,{withFileTypes:!0})}catch{continue}for(let T of y){if(!T.isFile()||!T.name.startsWith("rollout-")||!T.name.endsWith(".jsonl"))continue;let v=Kf.join(_,T.name),R;try{R=await F0.stat(v)}catch{continue}if(R.mtimeMs<=e)continue;let x=await _tn(v);x!==null&&r.push({timestamp:R.mtimeMs,sessionId:x.id,project:x.cwd,transcriptPath:v})}}}}return r.sort((o,i)=>o.timestamp-i.timestamp)}async function _tn(e){let t,n=mtn(e,{encoding:"utf8"});try{t=await new Promise((u,l)=>{let f=gtn({input:n,crlfDelay:Number.POSITIVE_INFINITY}),h=!1;f.on("line",_=>{if(h)return;let y=_.trim();y&&(h=!0,f.close(),n.destroy(),u(y))}),f.on("close",()=>{h||u("")}),f.on("error",l),n.on("error",l)})}finally{n.destroy()}if(!t)return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"empty_first_line"}),null;let r;try{r=JSON.parse(t)}catch{return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"unparseable_json"}),null}if(!Let(r))return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;if(r.type!=="session_meta")return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;let o=r.payload;if(!Let(o))return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_payload"}),null;let i=typeof o.id=="string"?o.id.trim():"",s=typeof o.cwd=="string"?o.cwd.trim():"";return!i||!s?($.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_id_or_cwd"}),null):{id:i,cwd:s}}async function Etn(e,t={}){let n=dfe(),r=[],o=new Array(e.length),i=new Set,s=new Set,u=new Set,l=[];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=Kf.relative(n,h.transcriptPath).split(Kf.sep).join("/");if(o[f]=_,u.has(_))continue;let y=await Hi(h.transcriptPath);if(!y.exists){i.add(_),u.add(_);continue}if(t.isUnchanged?.(_,y)){i.add(_),u.add(_);continue}if(t.isThrottled?.(_)){s.add(_),u.add(_);continue}let T=await vp(h.project),v=()=>F0.readFile(h.transcriptPath,"utf8"),R=await bh(t.uploadFilterConfig??vA(),{cwd:h.project,repoOriginPath:T,transcriptPath:h.transcriptPath,readTranscript:v});if(!R.shouldUpload){$.info("upload_filter_session_excluded",{filename:Kf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:R.reason}),i.add(_),u.add(_);continue}$.info("upload_filter_session_included",{filename:Kf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:"matched"});let x;try{x=await fd(h.transcriptPath)}catch(O){if(kr(O,"ENOENT")){i.add(_),u.add(_);continue}throw new Error(`read codex rollout ${h.transcriptPath}: ${String(O)}`)}l.push(x.tempPath),r.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:T,tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"codex",harnessInternalId:h.sessionId,watchedState:y}),u.add(_)}}catch(f){throw await Promise.all(l.map(h=>F0.rm(Kf.dirname(h),{recursive:!0,force:!0}))),f}return{entries:e,localFiles:r,entryFileKeys:o,skippedFileKeys:i,deferredFileKeys:s}}async function ytn(e,t,n={}){let r=await Qet(e),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await Hi(u.transcriptPath);if(!l.exists)continue;let f=await vp(u.project),h=await bh(n.uploadFilterConfig??vA(),{cwd:u.project,repoOriginPath:f,transcriptPath:u.transcriptPath,readTranscript:()=>F0.readFile(u.transcriptPath,"utf8")},{ignoreSkillRules:!0});if(!h.shouldUpload){$.info("upload_filter_watch_excluded",{filename:Kf.basename(u.transcriptPath),transcript_path:u.transcriptPath,cwd:u.project,repo_origin_path:f||"<none>",reason:h.reason});continue}i.push({sessionId:u.sessionId,project:u.project,transcriptPath:u.transcriptPath,expiresAt:new Date(o+htn),baseline:t.get(u.transcriptPath)??l})}return i}function Let(e){return e!==null&&typeof e=="object"}m();on();Bn();Fa();import ffe from"node:fs";import mfe from"node:fs/promises";import GM from"node:path";m();import Stn from"node:fs";var Ttn=Z9,pfe=W9;function Fet(e){let t=Ttn(e);if(!t)throw new Error(`Session ${e} has no local_* subdirectory \u2014 is this a Cowork session?`);let n=pfe(t);if(!n)throw new Error(`Session ${e} has no transcript file under ${t} (looked for ${afe.join(", ")})`);let r=Stn.readFileSync(n,"utf8"),o=ufe(t,"uploads"),i=ufe(t,"outputs");return{transcriptPath:n,transcript:r,uploads:o,outputs:i}}m();import FM from"node:path";var nq=Eet;function Get(e){let t=FM.resolve(e).split(FM.sep),n=t.lastIndexOf(sfe);if(n<0)return null;let r=t[n+1],o=t[n+2];if(!r||!o)return null;let i=t.slice(0,n+1).join(FM.sep),s=FM.join(i,r,o),l=t.slice(n+3).find(h=>h.startsWith("local_"))??FM.basename(Z9(s)??""),f=l.startsWith("local_")?l.replace(/^local_/,""):"";return{accountId:r,orgId:o,sessionId:f,sessionDir:s,sessionsRoot:i}}function g1(e){return yet(e)}function jet(e){return g1(e)[0]??null}Th();var btn=3600*1e3,Het={name:"cowork",historyFilePath:$et,readUnuploadedEntries:Itn,collectLocalFiles:Rtn,buildPendingTranscriptWatches:xtn};function $et(){return process.env.LORE_COWORK_SESSIONS_DIR??nq()}async function Itn(e){return qet(e,{includeWatermark:!1})}async function qet(e,t){let n=$et(),r=g1(n),o=[];for(let i of r){let s=i.localDir,u=pfe(s);if(!u)continue;let l=GM.basename(s),f=GM.join(i.sessionDir,`${l}.json`),h=Ctn(f,i.sessionDir);if(h!==null){if(t.includeWatermark){if(h.lastActivityAt<e)continue}else if(h.lastActivityAt<=e)continue;o.push({timestamp:h.lastActivityAt,sessionId:h.sessionId,accountId:i.accountId,orgId:i.orgId,project:"",userSelectedFolders:h.userSelectedFolders,transcriptPath:u})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}function Ctn(e,t){let n;try{n=ffe.readFileSync(e,"utf8")}catch{return $.warn("cowork_manifest_missing",{session_dir:t,manifest_path:e}),null}let r;try{r=JSON.parse(n)}catch{return $.warn("cowork_manifest_unparseable",{session_dir:t,manifest_path:e}),null}if(!Dtn(r))return $.warn("cowork_manifest_not_object",{session_dir:t,manifest_path:e}),null;let o=typeof r.sessionId=="string"?r.sessionId.trim():"";if(!o)return $.warn("cowork_manifest_missing_session_id",{session_dir:t,manifest_path:e}),null;let i=typeof r.lastActivityAt=="number"?r.lastActivityAt:0,s=typeof r.cwd=="string"?r.cwd.trim():"",u=Array.isArray(r.userSelectedFolders)?r.userSelectedFolders.filter(l=>typeof l=="string"&&l.trim().length>0):[];return u.length===0&&$.info("cowork_no_user_folders",{session_dir:t,manifest_path:e,cwd:s||"<none>"}),{sessionId:o,cwd:s,userSelectedFolders:u,lastActivityAt:i}}function vtn(e){return{uploads:zet(e,"uploads"),outputs:zet(e,"outputs")}}function zet(e,t){let n=GM.join(e,t);return ffe.existsSync(n)?ffe.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}async function Rtn(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=[...e];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=`${h.accountId}/${h.orgId}/${h.sessionId}/audit.jsonl`;if(r[f]=_,s.has(_))continue;let y=await Hi(h.transcriptPath);if(!y.exists){o.add(_),s.add(_);continue}if(t.isUnchanged?.(_,y)){o.add(_),s.add(_);continue}if(t.isThrottled?.(_)){i.add(_),s.add(_);continue}let T=()=>mfe.readFile(h.transcriptPath,"utf8"),v=null,R=null;for(let[j,G]of h.userSelectedFolders.entries()){let H=await vp(G),V=await bh(t.uploadFilterConfig??vA(),{cwd:G,repoOriginPath:H,transcriptPath:h.transcriptPath,readTranscript:T});if($.info("cowork_upload_filter_folder_evaluated",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,folder_index:j,folder:G,repo_origin_path:H||"<none>",should_upload:V.shouldUpload,reason:V.shouldUpload?"matched":V.reason}),V.shouldUpload){v=G,R=H;break}}if(v===null){$.info("upload_filter_session_excluded",{filename:"audit.jsonl",transcript_path:h.transcriptPath,user_selected_folders:h.userSelectedFolders,reason:h.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"}),o.add(_),s.add(_);continue}l[f]={...h,project:v},$.info("cowork_upload_filter_session_accepted",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,matched_project:v,repo_origin_path:R||"<none>",user_selected_folders:h.userSelectedFolders}),$.info("upload_filter_session_included",{filename:"audit.jsonl",transcript_path:h.transcriptPath,session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let x;try{x=await fd(h.transcriptPath)}catch(j){if(kr(j,"ENOENT")){o.add(_),s.add(_);continue}throw new Error(`read cowork audit ${h.transcriptPath}: ${String(j)}`)}u.push(x.tempPath);let O=GM.dirname(h.transcriptPath),P=vtn(O);n.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:R??"",tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"cowork",harnessInternalId:h.sessionId,watchedState:y,artifactMetadata:P}),s.add(_)}}catch(f){throw await Promise.all(u.map(h=>mfe.rm(GM.dirname(h),{recursive:!0,force:!0}))),f}return{entries:l,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function xtn(e,t,n={}){let r=await qet(e,{includeWatermark:!0}),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await Hi(u.transcriptPath);if(!l.exists)continue;let f=()=>mfe.readFile(u.transcriptPath,"utf8"),h=null,_=null;for(let[y,T]of u.userSelectedFolders.entries()){let v=await vp(T),R=await bh(n.uploadFilterConfig??vA(),{cwd:T,repoOriginPath:v,transcriptPath:u.transcriptPath,readTranscript:f},{ignoreSkillRules:!0});if($.info("cowork_upload_filter_watch_folder_evaluated",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,folder_index:y,folder:T,repo_origin_path:v||"<none>",should_upload:R.shouldUpload,reason:R.shouldUpload?"matched":R.reason}),R.shouldUpload){h=T,_=v;break}}if(h===null){$.info("upload_filter_watch_excluded",{filename:"audit.jsonl",transcript_path:u.transcriptPath,user_selected_folders:u.userSelectedFolders,reason:u.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"});continue}i.push({sessionId:u.sessionId,project:h,transcriptPath:u.transcriptPath,expiresAt:new Date(o+btn),baseline:t.get(u.transcriptPath)??l}),$.info("cowork_upload_filter_watch_accepted",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,matched_project:h,repo_origin_path:_||"<none>",user_selected_folders:u.userSelectedFolders})}return i}function Dtn(e){return e!==null&&typeof e=="object"}kle();var Ntn=1e3,Btn=250,wtn=2,Otn=5e3,gfe=[vet,Uet,Het],h1=class extends Error{constructor(){super("lore is logged out")}};function ktn(e){return e.adapters!==void 0?e.adapters:e.adapter!==void 0?[e.adapter]:gfe}async function Ket(e={}){return(await hfe(e)).threadIDs}async function hfe(e={}){G0(e.signal);let t=await d$(),n=e.recorder??new UD,r=ktn(e),o=e.client??Gt();$.info("run_upload_start",{adapters:r.map(h=>h.name),hasInjectedClient:!!e.client,hasInjectedRecorder:!!e.recorder}),await n.markRunning();let i=[],s=0,u=t,l=new Map,f=!1;try{let h=e.uploadFilterConfig??await Ho(),_=await Jet({syncState:t,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,minReuploadIntervalMs:e.minReuploadIntervalMs,now:e.now,signal:e.signal});i=_.threadIDs,s=_.deferredCount,u=_.syncState,l=_.watchBaselineOverrides,f=_.loggedOut,G0(e.signal),f||(await n.markSyncSuccess(i),i.length>0&&e.onUploadCompleted?.());let y=e.tailActiveSessions!==!1;if(!f&&y&&i.length>0){let T=await Ptn({syncState:u,baselineOverrides:l,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});i=[...i,...T.threadIDs],u=T.syncState,f=T.loggedOut,G0(e.signal)}return f?($.warn("run_upload_marking_logged_out",{threadIDs:i.length,adapters:r.map(T=>T.name)}),await n.markLoggedOut()):await n.markSuccess(i),{threadIDs:i,deferredCount:s}}catch(h){throw Zet(h)||await n.markError(h),h}}function Afe(e){if(e==="claudeCode"||e==="codex"||e==="cowork")return e;throw new Error(`runUpload: adapter.name "${e}" is not a known HarnessKey. Expected one of: claudeCode, codex, cowork. Custom adapters must use one of these names or the per-harness watermark cannot be persisted.`)}async function Jet(e){let t=[],n=0,r=e.syncState,o=new Map,i=await Qtn(e.adapters,Utn(e.adapterConcurrency,e.adapters.length),async h=>{G0(e.signal);let _=Afe(h.name),y=f$(e.syncState,_),T=e.syncState.harnesses[_]?.cursors??{};try{let v=await Mtn({...e,adapter:h,harnessKey:_,floor:y,cursors:T});return{adapter:h,harnessKey:_,uploadResult:v}}catch(v){return{adapter:h,harnessKey:_,error:v}}}),s=[],u=0,l,f;for(let h of i)if(G0(e.signal),!!h){if("error"in h){if(h.error instanceof h1){l=h.adapter.name;continue}if(Zet(h.error)){f??=h.error;continue}s.push(h.error),$.error("run_upload_adapter_failed",{adapter:h.adapter.name,error:h.error instanceof Error?h.error.message:String(h.error)});continue}u+=1,t=[...t,...h.uploadResult.threadIDs],n+=h.uploadResult.deferredCount;for(let[_,y]of h.uploadResult.cursorUpdates)r=kYe(r,h.harnessKey,_,y);r=PYe(r,h.harnessKey,Otn),r=OYe(r,h.harnessKey,h.uploadResult.newFloor);for(let[_,y]of h.uploadResult.watchBaselineOverrides)o.set(_,y);await p$(r)}if(f)throw f;if(u===0&&s.length>0)throw s.length===1?s[0]:new AggregateError(s,"all upload adapters failed");return l?($.warn("run_upload_logged_out_short_circuit",{adapter:l,threadIDs:t.length}),{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!0}):{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!1}}async function Ptn(e){let t=new Map;for(let i of e.adapters){let s=i.historyFilePath();t.set(s,await Hi(s))}let n=[];for(let i of e.adapters){let s=Afe(i.name),u=await i.buildPendingTranscriptWatches(f$(e.syncState,s),e.baselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...u]}if(await e.recorder.setPendingWatchers(n),n.length===0)return await e.recorder.setPendingWatchers([]),{threadIDs:[],syncState:e.syncState,loggedOut:!1};let r=[],o=e.syncState;try{for(;;){await Vet(Ntn,void 0,{signal:e.signal}),G0(e.signal),await e.recorder.heartbeat();let i=new Date,s=!1;for(let l of e.adapters){let f=l.historyFilePath(),h=t.get(f),_=await Hi(f);h!==void 0&&D9(h,_)&&(s=!0),t.set(f,_)}if(s||(s=await Ftn(n)),!s){let l=Gtn(n,i);if(n=l.watchers,l.changed&&await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};continue}await Vet(Btn,void 0,{signal:e.signal});let u=await Jet({syncState:o,adapters:e.adapters,client:e.client,recorder:e.recorder,uploadFilterConfig:e.uploadFilterConfig,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});if(o=u.syncState,u.loggedOut)return{threadIDs:r,syncState:o,loggedOut:!0};if(r.push(...u.threadIDs),await e.recorder.markSyncSuccess(u.threadIDs),u.threadIDs.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};for(let l of e.adapters){let f=l.historyFilePath();t.set(f,await Hi(f))}n=[];for(let l of e.adapters){let f=Afe(l.name),h=await l.buildPendingTranscriptWatches(f$(o,f),u.watchBaselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...h]}if(await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1}}}finally{await e.recorder.setPendingWatchers([])}}async function Mtn(e){let t=new Map,n=(_,y)=>{let T=e.cursors[_];return T===void 0?!1:!D9({exists:!0,size:T.sizeBytes,modTimeUnixMs:T.modTimeUnixMs},y)},r=e.minReuploadIntervalMs??0,o=e.now??Date.now,i=o(),s=_=>{if(r<=0)return!1;let y=e.cursors[_];return y===void 0?!1:i-y.lastUploadedAtMs<r};G0(e.signal);let u=await e.adapter.readUnuploadedEntries(e.floor);if($.info("run_upload_adapter_entries_read",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),u.length===0)return{threadIDs:[],cursorUpdates:t,newFloor:e.floor,watchBaselineOverrides:new Map,deferredCount:0};if(!await sn())throw $.warn("run_upload_no_access_token_for_entries",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),new h1;$.info("run_upload_access_token_available",{adapter:e.adapter.name,entryCount:u.length}),await e.recorder.markAuthenticated();let f=await e.adapter.collectLocalFiles(u,{uploadFilterConfig:e.uploadFilterConfig,isUnchanged:n,isThrottled:s}),h=f.deferredFileKeys?.size??0;try{if(f.localFiles.length===0){let O=Yet(e.floor,f.entries,f.entryFileKeys,f.skippedFileKeys);return{threadIDs:[],cursorUpdates:t,newFloor:O,watchBaselineOverrides:new Map,deferredCount:h}}let _=await MA(e.client,f.localFiles,{networkTimeoutMs:e.uploadNetworkTimeoutMs}),y=[],T=new Map,v=new Set(f.skippedFileKeys),R=O=>{t.set(O.key,{sizeBytes:O.watchedState.size,modTimeUnixMs:O.watchedState.modTimeUnixMs,md5:O.md5,lastUploadedAtMs:o()})};for(let O of _){let{localFile:P}=O;if(O.status==="quarantined"){$.info("run_upload_quarantine",{filename:P.filename,reason:O.reason,findings:O.findingCount}),v.add(P.key);continue}if(O.status!=="uploaded"){let G=(O.status==="no_upload"?O.error?.trim():"")||`upload session response missing presigned_url for ${P.filename}`;$.info("run_upload_skip",{filename:P.filename,reason:G}),v.add(P.key),R(P);continue}await e.recorder.heartbeat(),G0(e.signal);let j=O.thread?.id?.trim()??"";if(!j){if(P.fileType==="plan"){v.add(P.key),R(P);continue}throw new Error(`complete upload session response missing thread for ${P.filename}`)}y.push(j);try{await Ltn(e.client,j,e.recorder,{timeoutMs:e.parseTimeoutMs,signal:e.signal})}catch(G){if(G instanceof Error&&(G.message.includes("timed out waiting for thread")||G.message.includes("parsing failed permanently")||G.message.includes("unexpected transcript parsing state")))$.warn("parse_wait_soft_failure",{threadID:j,filename:P.filename,message:G.message});else throw G}v.add(P.key),R(P),P.sourcePath&&T.set(P.sourcePath,P.watchedState)}let x=Yet(e.floor,f.entries,f.entryFileKeys,v);return{threadIDs:y,cursorUpdates:t,newFloor:x,watchBaselineOverrides:T,deferredCount:h}}finally{await Promise.all(f.localFiles.map(_=>wp(_.tempPath)))}}async function Ltn(e,t,n,r={}){let o={...r,onPoll:()=>n.heartbeat()};await VD(e,t,o)}function G0(e){if(e?.aborted)throw new DOMException("The operation was aborted","AbortError")}function Zet(e){return e instanceof Error&&e.name==="AbortError"}function Utn(e,t){return t<=0?1:e===void 0?Math.min(wtn,t):!Number.isFinite(e)||e<1?1:Math.min(Math.floor(e),t)}async function Qtn(e,t,n){let r=new Array(e.length),o=0,i=Math.min(t,e.length),s=Array.from({length:i},async()=>{for(;;){let u=o;if(o+=1,u>=e.length)return;let l=e[u];if(l===void 0)return;r[u]=await n(l)}});return await Promise.all(s),r}function Yet(e,t,n,r){let o=Number.POSITIVE_INFINITY;for(let s=0;s<t.length;s+=1){let u=n[s];u&&r.has(u)||(o=Math.min(o,t[s]?.timestamp??o))}let i=e;for(let s=0;s<t.length;s+=1){let u=n[s];if(!u||!r.has(u))continue;let l=t[s]?.timestamp??i;l<o&&(i=Math.max(i,l))}return i}async function Ftn(e){for(let t of e){let n=await Hi(t.transcriptPath);if(D9(t.baseline,n))return!0}return!1}function Gtn(e,t){let n=e.filter(r=>t<r.expiresAt);return{watchers:n,changed:n.length!==e.length}}m();t$();on();Bn();Mo();import Rb from"node:fs";import{watch as ztn}from"node:fs/promises";import _fe from"node:path";import{setTimeout as oq}from"node:timers/promises";m();Pr();Bn();var jtn=6e4,rq=class{client;now;minIntervalMs;lastBeatAt=Number.NEGATIVE_INFINITY;constructor(t={}){this.client=t.client??Gt(),this.now=t.now??Date.now,this.minIntervalMs=t.minIntervalMs??jtn}async beat(){let t=this.now();t-this.lastBeatAt<this.minIntervalMs||(this.lastBeatAt=t,await this.post({}))}async uploadCompleted(){this.lastBeatAt=this.now(),await this.post({upload_completed:!0})}async post(t){try{await this.client.recordCliHeartbeat({body:t})}catch(n){$.warn("cli_heartbeat_failed",{error:n instanceof Error?n.message:String(n)})}}};var Htn=2e3,$tn=6e4,qtn=5e3,Vtn=Xle*3,Ytn=5e3,Ktn=5*6e4,Jtn=.2,Ztn=15e3;function Wtn(e){return Array.isArray(e)?{threadIDs:e,deferredCount:0}:e}var iq=class extends Error{constructor(t){super(t),this.name="SyncPassDeadlineError"}};function Xtn(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??gfe).map(n=>n.historyFilePath())}async function Xet(e={}){let t=e.debounceMs??Htn,n=e.pollIntervalMs,r=n??e.idlePollIntervalMs??$tn,o=n??e.activePollIntervalMs??qtn,i=e.syncDeadlineMs??Vtn,s=e.failureBackoffBaseMs??Ytn,u=e.failureBackoffMaxMs??Ktn,l=e.failureBackoffJitterRatio??Jtn,f=e.random??Math.random,h=Xtn(e),_=e.runUploadFn??hfe,y=e.uploadOptions?.minReuploadIntervalMs??e.minReuploadIntervalMs??Ztn,T=e.uploadOptions?.recorder??new UD,v=e.heartbeatReporter??new rq,R={...e.uploadOptions,recorder:T,tailActiveSessions:!1,onUploadCompleted:()=>{v.uploadCompleted()},minReuploadIntervalMs:y},x=e.signal?void 0:new AbortController,O=e.signal??x.signal,P=()=>x?.abort();x&&(process.once("SIGINT",P),process.once("SIGTERM",P));let j=await tnn(e.lockFilePath??aje());if(!j.acquired){x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P)),$.info("watch_skip_already_running",{pid:j.pid});return}let G=j.release,H=!1,V=!1,ae=0,re=r,_e=async Tt=>{if(H){V=!0;return}H=!0;try{do{if(V=!1,O.aborted)break;if(ae>0){let ye=enn({consecutiveFailures:ae,baseMs:s,maxMs:u,jitterRatio:l,random:f});if($.warn("watch_sync_backoff",{reason:Tt,consecutiveFailures:ae,backoffMs:ye}),await oq(ye,void 0,{signal:O}).catch(()=>{}),O.aborted)break}try{let ye=new AbortController,Je=()=>ye.abort();O.addEventListener("abort",Je,{once:!0});let ot=`sync pass exceeded ${i}ms deadline`,ut,Lt=new Promise((be,mt)=>{ut=setTimeout(()=>{$.error("watch_sync_stuck",{reason:Tt,syncDeadlineMs:i}),T.markStuck(ot).catch(en=>$.warn("watch_mark_stuck_failed",{error:ln(en)})),ye.abort(),mt(new iq(ot))},i),ut.unref?.()}),Gr=_({...R,signal:ye.signal});try{let{threadIDs:be,deferredCount:mt}=Wtn(await Promise.race([Gr,Lt]));ae=0,re=be.length>0||mt>0?o:r,$.info("watch_sync_complete",{reason:Tt,uploaded:be.length,deferred:mt,nextPollIntervalMs:re})}finally{ut&&clearTimeout(ut),O.removeEventListener("abort",Je),await Gr.catch(()=>{})}}catch(ye){if(O.aborted&&ye?.name==="AbortError")break;ae+=1,!(ye instanceof iq)&&ye?.name!=="AbortError"&&await T.markDegraded(ye).catch(Je=>$.warn("watch_mark_degraded_failed",{error:ln(Je)})),$.error("watch_sync_failed",{reason:Tt,consecutiveFailures:ae,error:ln(ye)})}}while(V&&!O.aborted)}finally{H=!1}},Qe,pt=Tt=>{Qe&&clearTimeout(Qe),Qe=setTimeout(()=>{Qe=void 0,_e(Tt)},t),Qe.unref?.()};$.info("watch_start",{watchPaths:h,debounceMs:t,idlePollIntervalMs:r,activePollIntervalMs:o,syncDeadlineMs:i}),v.beat(),_e("startup");let Ge=async Tt=>{for(;!O.aborted;)try{let ye=Rb.existsSync(Tt)&&Rb.statSync(Tt).isDirectory(),Je=ye?Tt:_fe.dirname(Tt),ot=ye?void 0:_fe.basename(Tt),ut=e.watchEventSource?.({watchDir:Je,watchPath:Tt,recursive:ye,signal:O})??ztn(Je,{signal:O,recursive:ye});for await(let Lt of ut){if(O.aborted)break;(ot===void 0||!Lt.filename||Lt.filename===ot)&&pt("fs-event")}}catch(ye){if(O.aborted||ye?.name==="AbortError")break;$.warn("watch_fs_retry",{path:Tt,error:ln(ye)}),await oq(r,void 0,{signal:O}).catch(()=>{})}},Pt=async()=>{for(;!O.aborted;){try{await oq(re,void 0,{signal:O})}catch{break}if(O.aborted)break;v.beat(),_e("poll")}};try{await Promise.all([...h.map(Ge),Pt()])}finally{for(Qe&&clearTimeout(Qe),x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P));H;)await oq(50).catch(()=>{});await G(),$.info("watch_stop",{})}}function enn(e){let t=e.baseMs*2**Math.max(0,e.consecutiveFailures-1),n=Math.min(e.maxMs,t),r=n*e.jitterRatio,o=r===0?0:(e.random()*2-1)*r;return Math.max(0,Math.round(n+o))}async function tnn(e){if(e===!1)return{acquired:!0,release:async()=>{}};for(await Rb.promises.mkdir(_fe.dirname(e),{recursive:!0,mode:448});;)try{let t=await Rb.promises.open(e,"wx",384);return await t.writeFile(JSON.stringify({pid:process.pid,started_at:new Date().toISOString()})),await t.close(),{acquired:!0,release:async()=>{(await Wet(e))?.pid===process.pid&&await Rb.promises.rm(e,{force:!0})}}}catch(t){if(!rnn(t))throw t;let n=await Wet(e);if(n?.pid&&nnn(n.pid))return{acquired:!1,pid:n.pid};await Rb.promises.rm(e,{force:!0})}}async function Wet(e){try{let t=JSON.parse(await Rb.promises.readFile(e,"utf8"));return typeof t.pid=="number"?{pid:t.pid}:{}}catch{return}}function nnn(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}function rnn(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}var ett={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 Met(),await Xet({uploadOptions:n});return}let r=await Ket(n);console.log(JSON.stringify(r))}};m();s0();m();Pr();import{spawn as onn}from"node:child_process";import ttt from"node:path";async function Efe(e){let t=e.progress??A1;if(!await sn())throw new h1;t({kind:"step",step:"resolving_session"});let r=ttt.resolve(e.sessionFile),o=ttt.basename(r),i=e.harnessInternalId?.trim()||unn(o)||o,s=await Hi(r);if(!s.exists)throw new Error(`session file does not exist: ${r}`);let u=await fd(r),l={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:u.tempPath,md5:u.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:s},f=e.client??Gt();try{t({kind:"step",step:"uploading",label:o});let[h]=await MA(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 V=h.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${V}`)}let _=h.status==="deduped",y=h.thread,T=y?.id?.trim();if(!T)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await VD(f,T);let v=y?.visibility?.trim()??"",R=v,x=e.visibility;x&&x!==v&&(t({kind:"step",step:"updating_visibility"}),R=await inn(f,T,x));let O=`${C0().replace(/\/+$/,"")}/thread/${T}`,P,j=e.highlight?.trim();if(j){t({kind:"step",step:"resolving_highlight"});let V=await tq(f,T,j);V&&(O=V.url,P={query:j,matched:V.matched,start_block_id:V.start_block_id,end_block_id:V.end_block_id})}let G=await cnn(O),H=ann(R)?R:"private";return t({kind:"completed",url:O,reused:_,visibility:H,clipboardCopied:G,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:T,url:O,session_id:i,project:"",reused:_,visibility:H,clipboard_copied:G,...P?{highlight:P}:{}}}finally{await wp(u.tempPath)}}async function inn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Np(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var snn=new Set(["private","workspace","public"]);function ann(e){return snn.has(e)}function unn(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 cnn(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 lnn(n,r,e))return!0;return!1}function lnn(e,t,n){return new Promise(r=>{let o;try{o=onn(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 ntt=["private","workspace","public"],rtt={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=dnn(e.visibility);if(vu()){let r=await m1({title:"lore share-codex",subtitle:"sharing this Codex session",perform:o=>Efe({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:o})});"quarantined"in r&&r.quarantined&&console.log(`
698
698
  Held locally \u2014 not uploaded. ${r.finding_count} finding(s); reason: ${r.reason}. See \`lore quarantine\`.`)}else{let r=await Efe({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}}};function dnn(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!ntt.includes(e))throw new Error(`--visibility must be one of: ${ntt.join(", ")}`);return e}}m();Pr();Bn();s0();m();async function yfe(e,t,n={}){let r=n.progress??A1,{contents:o,accountId:i,orgId:s,sessionId:u}=t;r({kind:"step",step:"resolving_session",label:u});let l=await N9("audit.jsonl",o.transcript),f={key:u,filename:"audit.jsonl",sourcePath:o.transcriptPath,repoOriginPath:"",tempPath:l.tempPath,md5:l.md5,fileType:"transcript",harness:"cowork",harnessInternalId:u,watchedState:{exists:!0,size:0,modTimeUnixMs:0},artifactMetadata:{uploads:o.uploads,outputs:o.outputs}};try{r({kind:"step",step:"uploading"});let[h]=await MA(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 _=h.thread?.id;if(!_)throw new Error(`upload session did not return a thread id: ${JSON.stringify(h)}`);return{threadId:_,duplicate:h.status==="deduped"}}finally{await wp(l.tempPath)}}var ott={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}){$.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=nq();if(e.list){let f=g1(n);if(f.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of f)console.log(fnn(h));return}let r=pnn(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
699
699
  ${n}
700
700
  Run with --list to see available sessions.`),new Error("no session resolved");let o=t?.client??Gt(),i=Fet(r.sessionDir),s=C0();if(vu()){let f=await m1({title:"lore share-cowork",subtitle:`session ${r.sessionId}`,perform:async h=>{let _=await yfe(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i},{progress:h});return _.quarantined?(h({kind:"step",step:"done"}),_):(h({kind:"completed",url:`${s.replace(/\/+$/,"")}/thread/${_.threadId}`,reused:_.duplicate,clipboardCopied:!1,sessionId:r.sessionId}),h({kind:"step",step:"done"}),_)}});f.quarantined&&console.log(`
701
701
  Held locally \u2014 not uploaded. ${f.findingCount} finding(s); reason: ${f.reason}. See \`lore quarantine\`.`);return}console.log(`Sharing cowork session ${r.sessionId} (${i.transcript.length} bytes transcript)...`);let u=await yfe(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i});if(u.quarantined){console.log(`Held locally \u2014 not uploaded. ${u.findingCount} finding(s); reason: ${u.reason}. See \`lore quarantine\`.`);return}let l=`${s.replace(/\/+$/,"")}/thread/${u.threadId}`;u.duplicate?console.log(`Already on Lore: ${l}`):console.log(`Shared: ${l}`)}};function pnn(e,t){if(t){let o=g1(e).find(i=>i.sessionId===t);return o?{accountId:o.accountId,orgId:o.orgId,sessionId:o.sessionId,sessionDir:o.sessionDir,sessionsRoot:e}:null}let n=Get(process.cwd());if(n)return n;let r=jet(e);return r?{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,sessionDir:r.sessionDir,sessionsRoot:e}:null}function fnn(e){let t=new Date(e.mtimeMs).toISOString();return`${e.sessionId} ${e.accountId} ${e.orgId} ${t}`}m();m();Pr();on();Bn();var mnn=e=>{let t=Math.max(4,...e.map(r=>r.name.length));return[`${"Name".padEnd(t)} ID`,...e.map(r=>`${r.name.padEnd(t)} ${r.id}`)].join(`
702
- `)},itt={meta:{name:"list",description:"List workspaces you belong to."},async run({data:e}){$.info("command_start",{command:"workspaces list"});let t=e;if(!await(t?.getAccessToken??sn)())throw new Ne("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Gt()).whoAmI({headers:{}});if(o.status!==200){let i=o.body?.message??`whoAmI returned ${o.status}`;throw new Ne(i)}console.log(mnn(o.body.organizations))}};var stt={meta:{name:"workspaces",description:"List workspaces from your WorkOS AuthKit account. (Workspaces are organizations in the API contract.)"},subCommands:{list:itt}};var hnn=Qje(),ctt={...hnn,health:QWe,feedback:UWe,enable:uXe,disable:k9,restart:cXe,status:lXe,login:Zle,logout:wWe,whoami:LWe,logs:GWe,quarantine:tXe,version:AXe,uninstall:fXe,update:mXe,export:ket,configure:hXe,listen:TXe,workspaces:stt,skills:qXe,"share-cowork":ott,"share-codex":rtt,"tui:stories":met,_refresh_auth_token:MWe,_run_upload:ett,_run_skill_sync:F9,"postinstall:migrate":IXe,"postinstall:refresh-background-binary":jWe};function sq(e){return e.find(t=>!t.startsWith("-"))??"lore"}var _nn={name:"cli-metrics",setup(e){e.data={...e.data,commandStartedAtMs:performance.now()}},async cleanup(e){let t=e.data?.commandStartedAtMs;if(typeof t!="number")return;let n=performance.now()-t,r=e.data?.captureCliCommandMetric??Z7e,o=await J7e(j0,e.rawArgs);await r({...o,durationMs:n})}},j0={meta:{name:"lore",description:"Lore CLI"},plugins:[_nn],subCommands:ctt};function Sfe(e){return e instanceof Error&&e.name==="CLIError"}function Enn(e){return Sfe(e)&&e.code==="E_UNKNOWN_COMMAND"}async function ynn(e){let t=jje(e);return ql({name:`lore ${sq(t)}`,op:"cli.command",parentSpan:null,forceTransaction:!0,attributes:{"cli.command":sq(t),"cli.raw_args":e.join(" "),"cli.args":t.join(" ")}},n=>Ije(n,()=>Snn(e,t)))}async function Snn(e,t){let n=Tnn(t)?uYe():void 0,r=!1;try{if(t.includes("--help")||t.includes("-h")){let[o,i]=await EXe(j0,t),s=o===j0&&i===void 0?await tfe(j0):await aee(o,i);return console.log(s),0}if(t.includes("--version")||t.includes("-v"))return console.log(hu()),0;if(!t.some(o=>!o.startsWith("-"))){if(vu({rawArgs:e})){let{rawArgs:o}=await ZXe();return o.length===0||await lT(j0,{rawArgs:[...o]}),0}return console.log(await tfe(j0)),0}return await lT(j0,{rawArgs:t}),0}catch(o){return Enn(o)?(console.error(`Unrecognized command: ${sq(t)}`),console.error(await aee(j0))):Sfe(o)?o.message.length>0&&console.error(o.message):to()==="prod"&&o instanceof Error?console.error(o.message):console.error(o,`
703
- `),Sfe(o)||(rn(o),await Promise.race([CXe({error:o,rawArgs:t}),new Promise(i=>setTimeout(i,4e3).unref())]).catch(()=>{}),await jQ(2e3).catch(()=>{}),r=!0),1}finally{await n?.(),r||await Sv(1e3).then(o=>{o||$.warn("sentry_flush_timed_out",{timeout_ms:1e3})}).catch(o=>{$.warn("sentry_flush_failed",{error:ln(o)})})}}function Tnn(e){let t=sq(e),r=ctt[t]?.meta;return!(typeof r=="object"&&r!==null&&!("then"in r)&&r.skipAutoupdate===!0)}async function bnn(e){let t=await ynn(e);t!==0&&process.exit(t)}function utt(e){try{return Ann(e)}catch{return e}}function Inn(e,t){if(!t)return!1;let n=gnn(e);return att(utt(n)).href===att(utt(t)).href}Inn(import.meta.url,process.argv[1])&&await bnn(process.argv.slice(2));var Lhr=void 0;export{Lhr as default,Inn as isCliEntrypoint,j0 as mainCommand,ynn as runCli,Tnn as shouldRunAutoUpdateForArgs};
702
+ `)},itt={meta:{name:"list",description:"List workspaces you belong to."},async run({data:e}){$.info("command_start",{command:"workspaces list"});let t=e;if(!await(t?.getAccessToken??sn)())throw new De("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Gt()).whoAmI({headers:{}});if(o.status!==200){let i=o.body?.message??`whoAmI returned ${o.status}`;throw new De(i)}console.log(mnn(o.body.organizations))}};var stt={meta:{name:"workspaces",description:"List workspaces from your WorkOS AuthKit account. (Workspaces are organizations in the API contract.)"},subCommands:{list:itt}};var hnn=Qje(),ctt={...hnn,health:QWe,feedback:UWe,enable:uXe,disable:k9,restart:cXe,status:lXe,login:Zle,logout:wWe,whoami:LWe,logs:GWe,quarantine:tXe,version:AXe,uninstall:fXe,update:mXe,export:ket,configure:hXe,listen:TXe,workspaces:stt,skills:qXe,"share-cowork":ott,"share-codex":rtt,"tui:stories":met,_refresh_auth_token:MWe,_run_upload:ett,_run_skill_sync:F9,"postinstall:migrate":IXe,"postinstall:refresh-background-binary":jWe};function sq(e){return e.find(t=>!t.startsWith("-"))??"lore"}var _nn={name:"cli-metrics",setup(e){e.data={...e.data,commandStartedAtMs:performance.now()}},async cleanup(e){let t=e.data?.commandStartedAtMs;if(typeof t!="number")return;let n=performance.now()-t,r=e.data?.captureCliCommandMetric??Z7e,o=await J7e(j0,e.rawArgs);await r({...o,durationMs:n})}},j0={meta:{name:"lore",description:"Lore CLI"},plugins:[_nn],subCommands:ctt};function Sfe(e){return e instanceof De?!0:e instanceof Error&&e.name==="CLIError"}function Enn(e){return Sfe(e)&&e.code==="E_UNKNOWN_COMMAND"}async function ynn(e){let t=jje(e);return ql({name:`lore ${sq(t)}`,op:"cli.command",parentSpan:null,forceTransaction:!0,attributes:{"cli.command":sq(t),"cli.raw_args":e.join(" "),"cli.args":t.join(" ")}},n=>Ije(n,()=>Snn(e,t)))}async function Snn(e,t){let n=Tnn(t)?uYe():void 0,r=!1;try{if(t.includes("--help")||t.includes("-h")){let[o,i]=await EXe(j0,t),s=o===j0&&i===void 0?await tfe(j0):await aee(o,i);return console.log(s),0}if(t.includes("--version")||t.includes("-v"))return console.log(hu()),0;if(!t.some(o=>!o.startsWith("-"))){if(vu({rawArgs:e})){let{rawArgs:o}=await ZXe();return o.length===0||await lT(j0,{rawArgs:[...o]}),0}return console.log(await tfe(j0)),0}return await lT(j0,{rawArgs:t}),0}catch(o){return Enn(o)?(console.error(`Unrecognized command: ${sq(t)}`),console.error(await aee(j0))):Sfe(o)?o.message.length>0&&console.error(o.message):to()==="prod"&&o instanceof Error?console.error(o.message):console.error(o,`
703
+ `),Sfe(o)||(rn(o),await Promise.race([CXe({error:o,rawArgs:t}),new Promise(i=>setTimeout(i,4e3).unref())]).catch(()=>{}),await jQ(2e3).catch(()=>{}),r=!0),1}finally{await n?.(),r||await Sv(1e3).then(o=>{o||$.warn("sentry_flush_timed_out",{timeout_ms:1e3})}).catch(o=>{$.warn("sentry_flush_failed",{error:ln(o)})})}}function Tnn(e){let t=sq(e),r=ctt[t]?.meta;return!(typeof r=="object"&&r!==null&&!("then"in r)&&r.skipAutoupdate===!0)}async function bnn(e){let t=await ynn(e);t!==0&&process.exit(t)}function utt(e){try{return Ann(e)}catch{return e}}function Inn(e,t){if(!t)return!1;let n=gnn(e);return att(utt(n)).href===att(utt(t)).href}Inn(import.meta.url,process.argv[1])&&await bnn(process.argv.slice(2));var Lhr=void 0;export{Lhr as default,Inn as isCliEntrypoint,Sfe as isCliError,Enn as isUnknownCommandError,j0 as mainCommand,ynn as runCli,Tnn as shouldRunAutoUpdateForArgs};
704
704
  //# sourceMappingURL=index.js.map