@netlify/agent-runner-cli 1.151.0 → 1.152.0-EX-2670.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'node:module'; import { fileURLToPath as __ftu } from 'node:url'; import { dirname as __dnn } from 'node:path'; const require = __cr(import.meta.url); const __filename = __ftu(import.meta.url); const __dirname = __dnn(__filename);
|
|
2
|
-
var a_e=Object.create;var FS=Object.defineProperty;var c_e=Object.getOwnPropertyDescriptor;var l_e=Object.getOwnPropertyNames;var u_e=Object.getPrototypeOf,d_e=Object.prototype.hasOwnProperty;var J=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ir=(t,e)=>{for(var r in e)FS(t,r,{get:e[r],enumerable:!0})},ZV=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l_e(e))!d_e.call(t,i)&&i!==r&&FS(t,i,{get:()=>e[i],enumerable:!(n=c_e(e,i))||n.enumerable});return t};var on=(t,e,r)=>(r=t!=null?a_e(u_e(t)):{},ZV(e||!t||!t.__esModule?FS(r,"default",{value:t,enumerable:!0}):r,t)),Ar=t=>ZV(FS({},"__esModule",{value:!0}),t);var Ns,zC=x(()=>{"use strict";Ns="1.9.1"});function f_e(t){let e=new Set([t]),r=new Set,n=t.match(JV);if(!n)return()=>!1;let i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(c){return c===t};function s(a){return r.add(a),!1}function o(a){return e.add(a),!0}return function(c){if(e.has(c))return!0;if(r.has(c))return!1;let l=c.match(JV);if(!l)return s(c);let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return u.prerelease!=null||i.major!==u.major?s(c):i.major===0?i.minor===u.minor&&i.patch<=u.patch?o(c):s(c):i.minor<=u.minor?o(c):s(c)}}var JV,XV,QV=x(()=>{"use strict";zC();JV=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;XV=f_e(Ns)});function $i(t,e,r,n=!1){var i;let s=cm[am]=(i=cm[am])!==null&&i!==void 0?i:{version:Ns};if(!n&&s[t]){let o=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return r.error(o.stack||o.message),!1}if(s.version!==Ns){let o=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${Ns}`);return r.error(o.stack||o.message),!1}return s[t]=e,r.debug(`@opentelemetry/api: Registered a global for ${t} v${Ns}.`),!0}function an(t){var e,r;let n=(e=cm[am])===null||e===void 0?void 0:e.version;if(!(!n||!XV(n)))return(r=cm[am])===null||r===void 0?void 0:r[t]}function Ui(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${Ns}.`);let r=cm[am];r&&delete r[t]}var p_e,am,cm,Nc=x(()=>{"use strict";zC();QV();p_e=Ns.split(".")[0],am=Symbol.for(`opentelemetry.js.api.${p_e}`),cm=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function lm(t,e,r){let n=an("diag");if(n)return n[t](e,...r)}var BS,eq=x(()=>{"use strict";Nc();BS=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return lm("debug",this._namespace,e)}error(...e){return lm("error",this._namespace,e)}info(...e){return lm("info",this._namespace,e)}warn(...e){return lm("warn",this._namespace,e)}verbose(...e){return lm("verbose",this._namespace,e)}}});var Ge,jS=x(()=>{"use strict";(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Ge||(Ge={}))});function tq(t,e){t<Ge.NONE?t=Ge.NONE:t>Ge.ALL&&(t=Ge.ALL),e=e||{};function r(n,i){let s=e[n];return typeof s=="function"&&t>=i?s.bind(e):function(){}}return{error:r("error",Ge.ERROR),warn:r("warn",Ge.WARN),info:r("info",Ge.INFO),debug:r("debug",Ge.DEBUG),verbose:r("verbose",Ge.VERBOSE)}}var rq=x(()=>{"use strict";jS()});var h_e,Ht,kc=x(()=>{"use strict";eq();rq();jS();Nc();h_e="diag",Ht=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(i){return function(...s){let o=an("diag");if(o)return o[i](...s)}}let r=this,n=(i,s={logLevel:Ge.INFO})=>{var o,a,c;if(i===r){let d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((o=d.stack)!==null&&o!==void 0?o:d.message),!1}typeof s=="number"&&(s={logLevel:s});let l=an("diag"),u=tq((a=s.logLevel)!==null&&a!==void 0?a:Ge.INFO,i);if(l&&!s.suppressOverrideMessage){let d=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";l.warn(`Current logger will be overwritten from ${d}`),u.warn(`Current logger will overwrite one already registered from ${d}`)}return $i("diag",u,r,!0)};r.setLogger=n,r.disable=()=>{Ui(h_e,r)},r.createComponentLogger=i=>new BS(i),r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}}});var zS,nq=x(()=>{"use strict";zS=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let r=this._entries.get(e);if(r)return Object.assign({},r)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,r){let n=new t(this._entries);return n._entries.set(e,r),n}removeEntry(e){let r=new t(this._entries);return r._entries.delete(e),r}removeEntries(...e){let r=new t(this._entries);for(let n of e)r._entries.delete(n);return r}clear(){return new t}}});var iq,sq=x(()=>{"use strict";iq=Symbol("BaggageEntryMetadata")});function oq(t={}){return new zS(new Map(Object.entries(t)))}function Nu(t){return typeof t!="string"&&(m_e.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:iq,toString(){return t}}}var m_e,GC=x(()=>{"use strict";kc();nq();sq();m_e=Ht.instance()});function mr(t){return Symbol.for(t)}var VC,GS,um=x(()=>{"use strict";VC=class t{constructor(e){let r=this;r._currentContext=e?new Map(e):new Map,r.getValue=n=>r._currentContext.get(n),r.setValue=(n,i)=>{let s=new t(r._currentContext);return s._currentContext.set(n,i),s},r.deleteValue=n=>{let i=new t(r._currentContext);return i._currentContext.delete(n),i}}},GS=new VC});var qC,HC,VS,aq=x(()=>{"use strict";qC=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],HC={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(HC[e]=console[e])}VS=class{constructor(){function e(r){return function(...n){let i=HC[r];if(typeof i!="function"&&(i=HC.log),typeof i!="function"&&console&&(i=console[r],typeof i!="function"&&(i=console.log)),typeof i=="function")return i.apply(console,n)}}for(let r=0;r<qC.length;r++)this[qC[r].n]=e(qC[r].c)}}});function Ko(){return t0}var WC,ku,YC,KC,ZC,JC,dm,XC,QC,e0,t0,g_e,__e,y_e,S_e,E_e,v_e,b_e,r0=x(()=>{"use strict";WC=class{constructor(){}createGauge(e,r){return __e}createHistogram(e,r){return y_e}createCounter(e,r){return g_e}createUpDownCounter(e,r){return S_e}createObservableGauge(e,r){return v_e}createObservableCounter(e,r){return E_e}createObservableUpDownCounter(e,r){return b_e}addBatchObservableCallback(e,r){}removeBatchObservableCallback(e){}},ku=class{},YC=class extends ku{add(e,r){}},KC=class extends ku{add(e,r){}},ZC=class extends ku{record(e,r){}},JC=class extends ku{record(e,r){}},dm=class{addCallback(e){}removeCallback(e){}},XC=class extends dm{},QC=class extends dm{},e0=class extends dm{},t0=new WC,g_e=new YC,__e=new ZC,y_e=new JC,S_e=new KC,E_e=new XC,v_e=new QC,b_e=new e0});var ks,cq=x(()=>{"use strict";(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(ks||(ks={}))});var qS,HS,n0=x(()=>{"use strict";qS={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},HS={set(t,e,r){t!=null&&(t[e]=r)}}});var WS,lq=x(()=>{"use strict";um();WS=class{active(){return GS}with(e,r,n,...i){return r.call(n,...i)}bind(e,r){return r}enable(){return this}disable(){return this}}});var i0,T_e,Fi,fm=x(()=>{"use strict";lq();Nc();kc();i0="context",T_e=new WS,Fi=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return $i(i0,e,Ht.instance())}active(){return this._getContextManager().active()}with(e,r,n,...i){return this._getContextManager().with(e,r,n,...i)}bind(e,r){return this._getContextManager().bind(e,r)}_getContextManager(){return an(i0)||T_e}disable(){this._getContextManager().disable(),Ui(i0,Ht.instance())}}});var Mt,s0=x(()=>{"use strict";(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Mt||(Mt={}))});var pm,hm,Mu,YS=x(()=>{"use strict";s0();pm="0000000000000000",hm="00000000000000000000000000000000",Mu={traceId:hm,spanId:pm,traceFlags:Mt.NONE}});var Bi,KS=x(()=>{"use strict";YS();Bi=class{constructor(e=Mu){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,r){return this}setAttributes(e){return this}addEvent(e,r){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,r){}}});function ZS(t){return t.getValue(o0)||void 0}function uq(){return ZS(Fi.getInstance().active())}function mm(t,e){return t.setValue(o0,e)}function dq(t){return t.deleteValue(o0)}function fq(t,e){return mm(t,new Bi(e))}function JS(t){var e;return(e=ZS(t))===null||e===void 0?void 0:e.spanContext()}var o0,a0=x(()=>{"use strict";um();KS();fm();o0=mr("OpenTelemetry Context Key SPAN")});function pq(t,e){if(typeof t!="string"||t.length!==e)return!1;let r=0;for(let n=0;n<t.length;n+=4)r+=(XS[t.charCodeAt(n)]|0)+(XS[t.charCodeAt(n+1)]|0)+(XS[t.charCodeAt(n+2)]|0)+(XS[t.charCodeAt(n+3)]|0);return r===e}function gm(t){return pq(t,32)&&t!==hm}function c0(t){return pq(t,16)&&t!==pm}function On(t){return gm(t.traceId)&&c0(t.spanId)}function hq(t){return new Bi(t)}var XS,QS=x(()=>{"use strict";YS();KS();XS=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 A_e(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var l0,Du,u0=x(()=>{"use strict";fm();a0();KS();QS();l0=Fi.getInstance(),Du=class{startSpan(e,r,n=l0.active()){if(!!r?.root)return new Bi;let s=n&&JS(n);return A_e(s)&&On(s)?new Bi(s):new Bi}startActiveSpan(e,r,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(s=r,a=n):(s=r,o=n,a=i);let c=o??l0.active(),l=this.startSpan(e,s,c),u=mm(c,l);return l0.with(u,a,void 0,l)}}});var x_e,Lu,d0=x(()=>{"use strict";u0();x_e=new Du,Lu=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}startSpan(e,r,n){return this._getTracer().startSpan(e,r,n)}startActiveSpan(e,r,n,i){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):x_e}}});var eE,mq=x(()=>{"use strict";u0();eE=class{getTracer(e,r,n){return new Du}}});var w_e,Mc,f0=x(()=>{"use strict";d0();mq();w_e=new eE,Mc=class{getTracer(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new Lu(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:w_e}setDelegate(e){this._delegate=e}getDelegateTracer(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)}}});var Dc,gq=x(()=>{"use strict";(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Dc||(Dc={}))});var ti,_q=x(()=>{"use strict";(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(ti||(ti={}))});var gr,yq=x(()=>{"use strict";(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(gr||(gr={}))});function Sq(t){return C_e.test(t)}function Eq(t){return P_e.test(t)&&!O_e.test(t)}var p0,R_e,I_e,C_e,P_e,O_e,vq=x(()=>{"use strict";p0="[_0-9a-z-*/]",R_e=`[a-z]${p0}{0,255}`,I_e=`[a-z0-9]${p0}{0,240}@[a-z]${p0}{0,13}`,C_e=new RegExp(`^(?:${R_e}|${I_e})$`),P_e=/^[ -~]{0,255}[!-~]$/,O_e=/,|=/});var bq,N_e,Tq,Aq,tE,xq=x(()=>{"use strict";vq();bq=32,N_e=512,Tq=",",Aq="=",tE=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,r)=>(e.push(r+Aq+this.get(r)),e),[]).join(Tq)}_parse(e){e.length>N_e||(this._internalState=e.split(Tq).reduceRight((r,n)=>{let i=n.trim(),s=i.indexOf(Aq);if(s!==-1){let o=i.slice(0,s),a=i.slice(s+1,n.length);Sq(o)&&Eq(a)&&r.set(o,a)}return r},new Map),this._internalState.size>bq&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,bq))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function wq(t){return new tE(t)}var Rq=x(()=>{"use strict";xq()});var at,Iq=x(()=>{"use strict";fm();at=Fi.getInstance()});var Q,Cq=x(()=>{"use strict";kc();Q=Ht.instance()});var h0,Pq,Oq=x(()=>{"use strict";r0();h0=class{getMeter(e,r,n){return t0}},Pq=new h0});var m0,rE,Nq=x(()=>{"use strict";Oq();Nc();kc();m0="metrics",rE=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return $i(m0,e,Ht.instance())}getMeterProvider(){return an(m0)||Pq}getMeter(e,r,n){return this.getMeterProvider().getMeter(e,r,n)}disable(){Ui(m0,Ht.instance())}}});var _m,kq=x(()=>{"use strict";Nq();_m=rE.getInstance()});var nE,Mq=x(()=>{"use strict";nE=class{inject(e,r){}extract(e,r){return e}fields(){return[]}}});function _0(t){return t.getValue(g0)||void 0}function Dq(){return _0(Fi.getInstance().active())}function Lq(t,e){return t.setValue(g0,e)}function $q(t){return t.deleteValue(g0)}var g0,Uq=x(()=>{"use strict";fm();um();g0=mr("OpenTelemetry Baggage Key")});var y0,k_e,iE,Fq=x(()=>{"use strict";Nc();Mq();n0();Uq();GC();kc();y0="propagation",k_e=new nE,iE=class t{constructor(){this.createBaggage=oq,this.getBaggage=_0,this.getActiveBaggage=Dq,this.setBaggage=Lq,this.deleteBaggage=$q}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return $i(y0,e,Ht.instance())}inject(e,r,n=HS){return this._getGlobalPropagator().inject(e,r,n)}extract(e,r,n=qS){return this._getGlobalPropagator().extract(e,r,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Ui(y0,Ht.instance())}_getGlobalPropagator(){return an(y0)||k_e}}});var xr,Bq=x(()=>{"use strict";Fq();xr=iE.getInstance()});var S0,sE,jq=x(()=>{"use strict";Nc();f0();QS();a0();kc();S0="trace",sE=class t{constructor(){this._proxyTracerProvider=new Mc,this.wrapSpanContext=hq,this.isSpanContextValid=On,this.deleteSpan=dq,this.getSpan=ZS,this.getActiveSpan=uq,this.getSpanContext=JS,this.setSpan=mm,this.setSpanContext=fq}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let r=$i(S0,this._proxyTracerProvider,Ht.instance());return r&&this._proxyTracerProvider.setDelegate(e),r}getTracerProvider(){return an(S0)||this._proxyTracerProvider}getTracer(e,r){return this.getTracerProvider().getTracer(e,r)}disable(){Ui(S0,Ht.instance()),this._proxyTracerProvider=new Mc}}});var ft,zq=x(()=>{"use strict";jq();ft=sE.getInstance()});var Zo={};ir(Zo,{DiagConsoleLogger:()=>VS,DiagLogLevel:()=>Ge,INVALID_SPANID:()=>pm,INVALID_SPAN_CONTEXT:()=>Mu,INVALID_TRACEID:()=>hm,ProxyTracer:()=>Lu,ProxyTracerProvider:()=>Mc,ROOT_CONTEXT:()=>GS,SamplingDecision:()=>Dc,SpanKind:()=>ti,SpanStatusCode:()=>gr,TraceFlags:()=>Mt,ValueType:()=>ks,baggageEntryMetadataFromString:()=>Nu,context:()=>at,createContextKey:()=>mr,createNoopMeter:()=>Ko,createTraceState:()=>wq,default:()=>M_e,defaultTextMapGetter:()=>qS,defaultTextMapSetter:()=>HS,diag:()=>Q,isSpanContextValid:()=>On,isValidSpanId:()=>c0,isValidTraceId:()=>gm,metrics:()=>_m,propagation:()=>xr,trace:()=>ft});var M_e,be=x(()=>{"use strict";GC();um();aq();jS();r0();cq();n0();d0();f0();gq();_q();yq();s0();Rq();QS();YS();Iq();Cq();kq();Bq();zq();M_e={context:at,diag:Q,metrics:_m,propagation:xr,trace:ft}});var qq=x(()=>{"use strict"});var Hq=x(()=>{"use strict";qq()});var Wq=x(()=>{"use strict"});var Yq=x(()=>{"use strict";Wq()});var E0,oE,Kq,aE,Zq,Ds,$u,Ls,$s,Jq=x(()=>{"use strict";E0="error.type",oE="exception.message",Kq="exception.stacktrace",aE="exception.type",Zq="service.name",Ds="telemetry.sdk.language",$u="nodejs",Ls="telemetry.sdk.name",$s="telemetry.sdk.version"});var Xq=x(()=>{"use strict"});var Qq=x(()=>{"use strict"});var Lc=x(()=>{"use strict";Hq();Yq();Jq();Xq();Qq()});function dE(t){return t.setValue(w0,!0)}function oH(t){return t.deleteValue(w0)}function Bu(t){return t.getValue(w0)===!0}var w0,vm=x(()=>{"use strict";be();w0=mr("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var fE,aH=x(()=>{"use strict";fE="baggage"});function cH(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function lH(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function R0(t){if(!t)return;let e=t.indexOf(";"),r=e===-1?t:t.substring(0,e),n=r.indexOf("=");if(n<=0)return;let i=r.substring(0,n).trim(),s=r.substring(n+1).trim();if(!i||!s)return;let o,a;try{o=decodeURIComponent(i),a=decodeURIComponent(s)}catch{return}let c;if(e!==-1&&e<t.length-1){let l=t.substring(e+1);c=Nu(l)}return{key:o,value:a,metadata:c}}function $c(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=R0(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var I0=x(()=>{"use strict";be()});var hE,uH=x(()=>{"use strict";be();vm();aH();I0();hE=class{inject(e,r,n){let i=xr.getBaggage(e);if(!i||Bu(e))return;let s=lH(i).filter(a=>a.length<=4096).slice(0,180),o=cH(s);o.length>0&&n.set(r,fE,o)}extract(e,r,n){let i=n.get(r,fE),s=Array.isArray(i)?i.join(","):i;if(!s)return e;let o={};return s.length===0||(s.split(",").forEach(c=>{let l=R0(c);if(l){let u={value:l.value};l.metadata&&(u.metadata=l.metadata),o[l.key]=u}}),Object.entries(o).length===0)?e:xr.setBaggage(e,xr.createBaggage(o))}fields(){return[fE]}}});var mE,dH=x(()=>{"use strict";mE=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function fH(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!j_e(r)){Q.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!C0(n)){Q.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function j_e(t){return typeof t=="string"&&t!==""}function C0(t){return t==null?!0:Array.isArray(t)?z_e(t):pH(typeof t)}function z_e(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(pH(n)){e=n;continue}return!1}return!1}}return!0}function pH(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var hH=x(()=>{"use strict";be()});function gE(){return t=>{Q.error(G_e(t))}}function G_e(t){return typeof t=="string"?t:JSON.stringify(V_e(t))}function V_e(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}var P0=x(()=>{"use strict";be()});function gH(t){mH=t}function _H(t){try{mH(t)}catch{}}var mH,yH=x(()=>{"use strict";P0();mH=gE()});import{inspect as SH}from"util";function ju(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Q.warn(`Unknown value ${SH(e)} for ${t}, expected a number, using defaults`);return}return r}function Gr(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function _E(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Q.warn(`Unknown value ${SH(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function yE(t){return Gr(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var EH=x(()=>{"use strict";be()});var SE,vH=x(()=>{"use strict";SE=globalThis});var bH,TH=x(()=>{"use strict";bH="2.7.1"});var AH,xH=x(()=>{"use strict";AH="process.runtime.name"});var EE,wH=x(()=>{"use strict";TH();Lc();xH();EE={[Ls]:"opentelemetry",[AH]:"node",[Ds]:$u,[$s]:bH}});var Jo,RH=x(()=>{"use strict";EH();vH();wH();Jo=performance});var O0=x(()=>{"use strict";RH()});function zu(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*H_e);return[r,n]}function CH(){return Jo.timeOrigin}function N0(t){let e=zu(Jo.timeOrigin),r=zu(typeof t=="number"?t:Jo.now());return k0(e,r)}function PH(t){if(TE(t))return t;if(typeof t=="number")return t<Jo.timeOrigin?N0(t):zu(t);if(t instanceof Date)return zu(t.getTime());throw TypeError("Invalid input type")}function OH(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=vE),[r,n]}function NH(t){let e=IH,r=`${"0".repeat(e)}${t[1]}Z`,n=r.substring(r.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",n)}function bE(t){return t[0]*vE+t[1]}function kH(t){return t[0]*1e3+t[1]/1e6}function MH(t){return t[0]*1e6+t[1]/1e3}function TE(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function DH(t){return TE(t)||typeof t=="number"||t instanceof Date}function k0(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=vE&&(r[1]-=vE,r[0]+=1),r}var IH,q_e,H_e,vE,LH=x(()=>{"use strict";O0();IH=9,q_e=6,H_e=Math.pow(10,q_e),vE=Math.pow(10,IH)});function $H(t){typeof t!="number"&&t.unref()}var UH=x(()=>{"use strict"});var wr,FH=x(()=>{"use strict";(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(wr||(wr={}))});var AE,BH=x(()=>{"use strict";be();AE=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let r=new Set;for(let n of this._propagators){let i=typeof n.fields=="function"?n.fields():[];for(let s of i)r.add(s)}this._fields=Array.from(r)}inject(e,r,n){for(let i of this._propagators)try{i.inject(e,r,n)}catch(s){Q.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,r,n)}catch(o){Q.warn(`Failed to extract with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}}});function D0(t){return K_e.test(t)}function L0(t){return Z_e.test(t)&&!J_e.test(t)}var M0,W_e,Y_e,K_e,Z_e,J_e,jH=x(()=>{"use strict";M0="[_0-9a-z-*/]",W_e=`[a-z]${M0}{0,255}`,Y_e=`[a-z0-9]${M0}{0,240}@[a-z]${M0}{0,13}`,K_e=new RegExp(`^(?:${W_e}|${Y_e})$`),Z_e=/^[ -~]{0,255}[!-~]$/,J_e=/,|=/});var X_e,zH,GH,VH,Gu,$0=x(()=>{"use strict";jH();X_e=32,zH=512,GH=",",VH="=",Gu=class t{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e=="string"?e:"",this._length=this._rawTraceState.length}set(e,r){if(!D0(e)||!L0(r))return this;let n=this._getState(),i=n.get(e),s=this._length;if(typeof i=="string"?s+=r.length-i.length:s+=e.length+r.length+(n.size>0?2:1),s>zH)return this;let o=new Map(n);return o.delete(e),o.set(e,r),this._fromState(o,s)}unset(e){let r=this._getState(),n=r.get(e);if(typeof n!="string")return this;let i=this._length-(e.length+n.length+1);r.size>1&&(i=i-1);let s=new Map(r);return s.delete(e),this._fromState(s,i)}get(e){return this._getState().get(e)}serialize(){let e="",r=0;for(let n of this._getState())r>0&&(e=GH+e),e=`${n[0]}${VH}${n[1]}`+e,r++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(GH),r=new Map,n=0;for(let i of e){let s=i.trim(),o=s.indexOf(VH);if(o===-1)continue;let a=s.slice(0,o),c=s.slice(o+1);if(!D0(a)||!L0(c))continue;let l=n+s.length+(r.size>0?1:0);if(!(l>zH)&&(r.set(a,c),n=l,r.size>=X_e))break}return this._length=n,this._internalState=new Map(Array.from(r.entries()).reverse()),this._internalState}_fromState(e,r){let n=Object.create(t.prototype);return n._internalState=e,n._length=r,n}}});function U0(t){let e=iye.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var bm,Tm,Q_e,eye,tye,rye,nye,iye,Us,qH=x(()=>{"use strict";be();vm();$0();bm="traceparent",Tm="tracestate",Q_e="00",eye="(?!ff)[\\da-f]{2}",tye="(?![0]{32})[\\da-f]{32}",rye="(?![0]{16})[\\da-f]{16}",nye="[\\da-f]{2}",iye=new RegExp(`^\\s?(${eye})-(${tye})-(${rye})-(${nye})(-.*)?\\s?$`);Us=class{inject(e,r,n){let i=ft.getSpanContext(e);if(!i||Bu(e)||!On(i))return;let s=`${Q_e}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||Mt.NONE).toString(16)}`;n.set(r,bm,s),i.traceState&&n.set(r,Tm,i.traceState.serialize())}extract(e,r,n){let i=n.get(r,bm);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=U0(s);if(!o)return e;o.isRemote=!0;let a=n.get(r,Tm);if(a){let c=Array.isArray(a)?a.join(","):a;o.traceState=new Gu(typeof c=="string"?c:void 0)}return ft.setSpanContext(e,o)}fields(){return[bm,Tm]}}});function HH(t,e){return t.setValue(F0,e)}function WH(t){return t.deleteValue(F0)}function YH(t){return t.getValue(F0)}var F0,xE,KH=x(()=>{"use strict";be();F0=mr("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(xE||(xE={}))});function B0(t){if(!dye(t)||fye(t)!==sye)return!1;let e=uye(t);if(e===null)return!0;let r=XH.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ZH.call(r)===lye}function dye(t){return t!=null&&typeof t=="object"}function fye(t){return t==null?t===void 0?aye:oye:Uc&&Uc in Object(t)?pye(t):hye(t)}function pye(t){let e=XH.call(t,Uc),r=t[Uc],n=!1;try{t[Uc]=void 0,n=!0}catch{}let i=QH.call(t);return n&&(e?t[Uc]=r:delete t[Uc]),i}function hye(t){return QH.call(t)}var sye,oye,aye,cye,ZH,lye,uye,JH,XH,Uc,QH,e6=x(()=>{"use strict";sye="[object Object]",oye="[object Null]",aye="[object Undefined]",cye=Function.prototype,ZH=cye.toString,lye=ZH.call(Object),uye=Object.getPrototypeOf,JH=Object.prototype,XH=JH.hasOwnProperty,Uc=Symbol?Symbol.toStringTag:void 0,QH=JH.toString});function r6(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=n6(e,t.shift(),0,r);return e}function j0(t){return RE(t)?t.slice():t}function n6(t,e,r=0,n){let i;if(!(r>mye)){if(r++,wE(t)||wE(e)||i6(e))i=j0(e);else if(RE(t)){if(i=t.slice(),RE(e))for(let s=0,o=e.length;s<o;s++)i.push(j0(e[s]));else if(Am(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];c==="__proto__"||c==="constructor"||c==="prototype"||(i[c]=j0(e[c]))}}}else if(Am(t))if(Am(e)){if(!gye(t,e))return e;i=Object.assign({},t);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let l=e[c];if(wE(l))typeof l>"u"?delete i[c]:i[c]=l;else{let u=i[c],d=l;if(t6(t,c,n)||t6(e,c,n))delete i[c];else{if(Am(u)&&Am(d)){let f=n.get(u)||[],p=n.get(d)||[];f.push({obj:t,key:c}),p.push({obj:e,key:c}),n.set(u,f),n.set(d,p)}i[c]=n6(i[c],l,r,n)}}}}else i=e;return i}}function t6(t,e,r){let n=r.get(t[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===t)return!0}return!1}function RE(t){return Array.isArray(t)}function i6(t){return typeof t=="function"}function Am(t){return!wE(t)&&!RE(t)&&!i6(t)&&typeof t=="object"}function wE(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function gye(t,e){return!(!B0(t)||!B0(e))}var mye,s6=x(()=>{"use strict";e6();mye=20});function o6(t,e){let r,n=new Promise(function(s,o){r=setTimeout(function(){o(new xm("Operation timed out."))},e)});return Promise.race([t,n]).then(i=>(clearTimeout(r),i),i=>{throw clearTimeout(r),i})}var xm,a6=x(()=>{"use strict";xm=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});function z0(t,e){return typeof e=="string"?t===e:!!t.match(e)}function c6(t,e){if(!e)return!1;for(let r of e)if(z0(t,r))return!0;return!1}var l6=x(()=>{"use strict"});var IE,u6=x(()=>{"use strict";IE=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vu,d6=x(()=>{"use strict";u6();Vu=class{_isCalled=!1;_deferred=new IE;_callback;_that;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function p6(t){if(t==null)return;let e=f6[t.toUpperCase()];return e??(Q.warn(`Unknown log level "${t}", expected one of ${Object.keys(f6)}, using default`),Ge.INFO)}var f6,h6=x(()=>{"use strict";be();f6={ALL:Ge.ALL,VERBOSE:Ge.VERBOSE,DEBUG:Ge.DEBUG,INFO:Ge.INFO,WARN:Ge.WARN,ERROR:Ge.ERROR,NONE:Ge.NONE}});function m6(t,e){return new Promise(r=>{at.with(dE(at.active()),()=>{t.export(e,r)})})}var g6=x(()=>{"use strict";be();vm()});var _6={};ir(_6,{AnchoredClock:()=>mE,BindOnceFuture:()=>Vu,CompositePropagator:()=>AE,ExportResultCode:()=>wr,RPCType:()=>xE,SDK_INFO:()=>EE,TRACE_PARENT_HEADER:()=>bm,TRACE_STATE_HEADER:()=>Tm,TimeoutError:()=>xm,TraceState:()=>Gu,W3CBaggagePropagator:()=>hE,W3CTraceContextPropagator:()=>Us,_globalThis:()=>SE,addHrTimes:()=>k0,callWithTimeout:()=>o6,deleteRPCMetadata:()=>WH,diagLogLevelFromString:()=>p6,getBooleanFromEnv:()=>_E,getNumberFromEnv:()=>ju,getRPCMetadata:()=>YH,getStringFromEnv:()=>Gr,getStringListFromEnv:()=>yE,getTimeOrigin:()=>CH,globalErrorHandler:()=>_H,hrTime:()=>N0,hrTimeDuration:()=>OH,hrTimeToMicroseconds:()=>MH,hrTimeToMilliseconds:()=>kH,hrTimeToNanoseconds:()=>bE,hrTimeToTimeStamp:()=>NH,internal:()=>_ye,isAttributeValue:()=>C0,isTimeInput:()=>DH,isTimeInputHrTime:()=>TE,isTracingSuppressed:()=>Bu,isUrlIgnored:()=>c6,loggingErrorHandler:()=>gE,merge:()=>r6,millisToHrTime:()=>zu,otperformance:()=>Jo,parseKeyPairsIntoRecord:()=>$c,parseTraceParent:()=>U0,sanitizeAttributes:()=>fH,setGlobalErrorHandler:()=>gH,setRPCMetadata:()=>HH,suppressTracing:()=>dE,timeInputToHrTime:()=>PH,unrefTimer:()=>$H,unsuppressTracing:()=>oH,urlMatches:()=>z0});var _ye,Fs=x(()=>{"use strict";uH();dH();hH();yH();P0();LH();UH();FH();I0();O0();BH();qH();KH();vm();$0();s6();a6();l6();d6();h6();g6();_ye={_export:m6}});var V0=b(CE=>{"use strict";Object.defineProperty(CE,"__esModule",{value:!0});CE.AbstractAsyncHooksContextManager=void 0;var yye=J("events"),Sye=["addListener","on","once","prependListener","prependOnceListener"],G0=class{bind(e,r){return r instanceof yye.EventEmitter?this._bindEventEmitter(e,r):typeof r=="function"?this._bindFunction(e,r):r}_bindFunction(e,r){let n=this,i=function(...s){return n.with(e,()=>r.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i}_bindEventEmitter(e,r){return this._getPatchMap(r)!==void 0||(this._createPatchMap(r),Sye.forEach(i=>{r[i]!==void 0&&(r[i]=this._patchAddListener(r,r[i],e))}),typeof r.removeListener=="function"&&(r.removeListener=this._patchRemoveListener(r,r.removeListener)),typeof r.off=="function"&&(r.off=this._patchRemoveListener(r,r.off)),typeof r.removeAllListeners=="function"&&(r.removeAllListeners=this._patchRemoveAllListeners(r,r.removeAllListeners))),r}_patchRemoveListener(e,r){let n=this;return function(i,s){let o=n._getPatchMap(e)?.[i];if(o===void 0)return r.call(this,i,s);let a=o.get(s);return r.call(this,i,a||s)}}_patchRemoveAllListeners(e,r){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),r.apply(this,arguments)}}_patchAddListener(e,r,n){let i=this;return function(s,o){if(i._wrapped)return r.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let c=a[s];c===void 0&&(c=new WeakMap,a[s]=c);let l=i.bind(n,o);c.set(o,l),i._wrapped=!0;try{return r.call(this,s,l)}finally{i._wrapped=!1}}}_createPatchMap(e){let r=Object.create(null);return e[this._kOtListeners]=r,r}_getPatchMap(e){return e[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1};CE.AbstractAsyncHooksContextManager=G0});var y6=b(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});PE.AsyncHooksContextManager=void 0;var Eye=(be(),Ar(Zo)),vye=J("async_hooks"),bye=V0(),q0=class extends bye.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super(),this._asyncHook=vye.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??Eye.ROOT_CONTEXT}with(e,r,n,...i){this._enterContext(e);try{return r.call(n,...i)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,r){if(r==="TIMERWRAP")return;let n=this._stack[this._stack.length-1];n!==void 0&&this._contexts.set(e,n)}_destroy(e){this._contexts.delete(e)}_before(e){let r=this._contexts.get(e);r!==void 0&&this._enterContext(r)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};PE.AsyncHooksContextManager=q0});var S6=b(OE=>{"use strict";Object.defineProperty(OE,"__esModule",{value:!0});OE.AsyncLocalStorageContextManager=void 0;var Tye=(be(),Ar(Zo)),Aye=J("async_hooks"),xye=V0(),H0=class extends xye.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super(),this._asyncLocalStorage=new Aye.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??Tye.ROOT_CONTEXT}with(e,r,n,...i){let s=n==null?r:r.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};OE.AsyncLocalStorageContextManager=H0});var E6=b(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.AsyncLocalStorageContextManager=qu.AsyncHooksContextManager=void 0;var wye=y6();Object.defineProperty(qu,"AsyncHooksContextManager",{enumerable:!0,get:function(){return wye.AsyncHooksContextManager}});var Rye=S6();Object.defineProperty(qu,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return Rye.AsyncLocalStorageContextManager}})});function NE(t){return t.setValue(W0,!0)}function v6(t){return t.deleteValue(W0)}function Hu(t){return t.getValue(W0)===!0}var W0,wm=x(()=>{"use strict";be();W0=mr("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var kE,b6=x(()=>{"use strict";kE="baggage"});function w6(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function R6(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function I6(t){if(!t)return;let e=t.indexOf(";"),r=e===-1?t:t.substring(0,e),n=r.indexOf("=");if(n<=0)return;let i=r.substring(0,n).trim(),s=r.substring(n+1).trim();if(!i||!s)return;let o,a;try{o=decodeURIComponent(i),a=decodeURIComponent(s)}catch{return}let c;if(e!==-1&&e<t.length-1){let l=t.substring(e+1);c=Nu(l)}return{key:o,value:a,metadata:c}}function Y0(t,e,r,n){let i=0;for(;i<t.length&&r<180;){let s=t.indexOf(",",i),o=s===-1?t.length:s,a=o-i;if(a<=4096){let c=I6(t.substring(i,o));if(c){let l=(r===0?0:1)+a;if(n+l>8192)break;e[c.key]=c.metadata?{value:c.value,metadata:c.metadata}:{value:c.value},r++,n+=l}}if(s===-1)break;i=s+1}return[r,n]}function C6(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=I6(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var K0=x(()=>{"use strict";be()});var ME,P6=x(()=>{"use strict";be();wm();b6();K0();ME=class{inject(e,r,n){let i=xr.getBaggage(e);if(!i||Hu(e))return;let s=R6(i).filter(a=>a.length<=4096).slice(0,180),o=w6(s);o.length>0&&n.set(r,kE,o)}extract(e,r,n){let i=n.get(r,kE);if(!i)return e;let s={},o=0,a=0;if(Array.isArray(i))for(let c=0;c<i.length;c++)[o,a]=Y0(i[c],s,o,a);else[o]=Y0(i,s,o,a);return o===0?e:xr.setBaggage(e,xr.createBaggage(s))}fields(){return[kE]}}});var DE,O6=x(()=>{"use strict";DE=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function N6(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!Pye(r)){Q.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!Z0(n)){Q.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function Pye(t){return typeof t=="string"&&t!==""}function Z0(t){return t==null?!0:Array.isArray(t)?Oye(t):k6(typeof t)}function Oye(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(k6(n)){e=n;continue}return!1}return!1}}return!0}function k6(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var M6=x(()=>{"use strict";be()});function LE(){return t=>{Q.error(Nye(t))}}function Nye(t){return typeof t=="string"?t:JSON.stringify(kye(t))}function kye(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}var J0=x(()=>{"use strict";be()});function L6(t){D6=t}function $6(t){try{D6(t)}catch{}}var D6,U6=x(()=>{"use strict";J0();D6=LE()});import{inspect as F6}from"util";function Rt(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Q.warn(`Unknown value ${F6(e)} for ${t}, expected a number, using defaults`);return}return r}function Fc(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function $E(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Q.warn(`Unknown value ${F6(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function UE(t){return Fc(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var B6=x(()=>{"use strict";be()});var FE,j6=x(()=>{"use strict";FE=globalThis});var z6,G6=x(()=>{"use strict";z6="2.9.0"});var V6,q6=x(()=>{"use strict";V6="process.runtime.name"});var BE,H6=x(()=>{"use strict";G6();Lc();q6();BE={[Ls]:"opentelemetry",[V6]:"node",[Ds]:$u,[$s]:z6}});var Xo,W6=x(()=>{"use strict";B6();j6();H6();Xo=performance});var X0=x(()=>{"use strict";W6()});function Wu(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Dye);return[r,n]}function K6(){return Xo.timeOrigin}function Q0(t){let e=Wu(Xo.timeOrigin),r=Wu(typeof t=="number"?t:Xo.now());return eP(e,r)}function Z6(t){if(jE(t))return t;if(typeof t=="number")return t<Xo.timeOrigin/2?Q0(t):Wu(t);if(t instanceof Date)return Wu(t.getTime());throw TypeError("Invalid input type")}function J6(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=Rm),[r,n]}function X6(t){let e=Y6,r=`${"0".repeat(e)}${t[1]}Z`,n=r.substring(r.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",n)}function Q6(t){return t[0]*Rm+t[1]}function e3(t){return t[0]*1e6+t[1]/1e3}function t3(t){return t[0]*1e3+t[1]/1e6}function r3(t){return t[0]+t[1]/Rm}function jE(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function n3(t){return jE(t)||typeof t=="number"||t instanceof Date}function eP(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=Rm&&(r[1]-=Rm,r[0]+=1),r}var Y6,Mye,Dye,Rm,i3=x(()=>{"use strict";X0();Y6=9,Mye=6,Dye=Math.pow(10,Mye),Rm=Math.pow(10,Y6)});function s3(t){typeof t!="number"&&t.unref()}var o3=x(()=>{"use strict"});var zE,a3=x(()=>{"use strict";(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(zE||(zE={}))});var GE,c3=x(()=>{"use strict";be();GE=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let r=new Set;for(let n of this._propagators){let i=typeof n.fields=="function"?n.fields():[];for(let s of i)r.add(s)}this._fields=Array.from(r)}inject(e,r,n){for(let i of this._propagators)try{i.inject(e,r,n)}catch(s){Q.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,r,n)}catch(o){Q.warn(`Failed to extract with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}}});function rP(t){return Uye.test(t)}function nP(t){return Fye.test(t)&&!Bye.test(t)}var tP,Lye,$ye,Uye,Fye,Bye,l3=x(()=>{"use strict";tP="[_0-9a-z-*/]",Lye=`[a-z]${tP}{0,255}`,$ye=`[a-z0-9]${tP}{0,240}@[a-z]${tP}{0,13}`,Uye=new RegExp(`^(?:${Lye}|${$ye})$`),Fye=/^[ -~]{0,255}[!-~]$/,Bye=/,|=/});var jye,u3,d3,f3,Yu,iP=x(()=>{"use strict";l3();jye=32,u3=512,d3=",",f3="=",Yu=class t{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e=="string"?e:"",this._length=this._rawTraceState.length}set(e,r){if(!rP(e)||!nP(r))return this;let n=this._getState(),i=n.get(e),s=this._length;if(typeof i=="string"?s+=r.length-i.length:s+=e.length+r.length+(n.size>0?2:1),s>u3)return this;let o=new Map(n);return o.delete(e),o.set(e,r),this._fromState(o,s)}unset(e){let r=this._getState(),n=r.get(e);if(typeof n!="string")return this;let i=this._length-(e.length+n.length+1);r.size>1&&(i=i-1);let s=new Map(r);return s.delete(e),this._fromState(s,i)}get(e){return this._getState().get(e)}serialize(){let e="",r=0;for(let n of this._getState())r>0&&(e=d3+e),e=`${n[0]}${f3}${n[1]}`+e,r++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(d3),r=new Map,n=0;for(let i of e){let s=i.trim(),o=s.indexOf(f3);if(o===-1)continue;let a=s.slice(0,o),c=s.slice(o+1);if(!rP(a)||!nP(c))continue;let l=n+s.length+(r.size>0?1:0);if(!(l>u3)&&(r.set(a,c),n=l,r.size>=jye))break}return this._length=n,this._internalState=new Map(Array.from(r.entries()).reverse()),this._internalState}_fromState(e,r){let n=Object.create(t.prototype);return n._internalState=e,n._length=r,n}}});function sP(t){let e=Wye.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var Im,Cm,zye,Gye,Vye,qye,Hye,Wye,VE,p3=x(()=>{"use strict";be();wm();iP();Im="traceparent",Cm="tracestate",zye="00",Gye="(?!ff)[\\da-f]{2}",Vye="(?![0]{32})[\\da-f]{32}",qye="(?![0]{16})[\\da-f]{16}",Hye="[\\da-f]{2}",Wye=new RegExp(`^\\s?(${Gye})-(${Vye})-(${qye})-(${Hye})(-.*)?\\s?$`);VE=class{inject(e,r,n){let i=ft.getSpanContext(e);if(!i||Hu(e)||!On(i))return;let s=`${zye}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||Mt.NONE).toString(16)}`;n.set(r,Im,s),i.traceState&&n.set(r,Cm,i.traceState.serialize())}extract(e,r,n){let i=n.get(r,Im);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=sP(s);if(!o)return e;o.isRemote=!0;let a=n.get(r,Cm);if(a){let c=Array.isArray(a)?a.join(","):a;o.traceState=new Yu(typeof c=="string"?c:void 0)}return ft.setSpanContext(e,o)}fields(){return[Im,Cm]}}});function h3(t,e){return t.setValue(oP,e)}function m3(t){return t.deleteValue(oP)}function g3(t){return t.getValue(oP)}var oP,qE,_3=x(()=>{"use strict";be();oP=mr("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(qE||(qE={}))});function aP(t){if(!eSe(t)||tSe(t)!==Yye)return!1;let e=Qye(t);if(e===null)return!0;let r=E3.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&y3.call(r)===Xye}function eSe(t){return t!=null&&typeof t=="object"}function tSe(t){return t==null?t===void 0?Zye:Kye:Bc&&Bc in Object(t)?rSe(t):nSe(t)}function rSe(t){let e=E3.call(t,Bc),r=t[Bc],n=!1;try{t[Bc]=void 0,n=!0}catch{}let i=v3.call(t);return n&&(e?t[Bc]=r:delete t[Bc]),i}function nSe(t){return v3.call(t)}var Yye,Kye,Zye,Jye,y3,Xye,Qye,S3,E3,Bc,v3,b3=x(()=>{"use strict";Yye="[object Object]",Kye="[object Null]",Zye="[object Undefined]",Jye=Function.prototype,y3=Jye.toString,Xye=y3.call(Object),Qye=Object.getPrototypeOf,S3=Object.prototype,E3=S3.hasOwnProperty,Bc=Symbol?Symbol.toStringTag:void 0,v3=S3.toString});function YE(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=A3(e,t.shift(),0,r);return e}function cP(t){return WE(t)?t.slice():t}function A3(t,e,r=0,n){let i;if(!(r>iSe)){if(r++,HE(t)||HE(e)||x3(e))i=cP(e);else if(WE(t)){if(i=t.slice(),WE(e))for(let s=0,o=e.length;s<o;s++)i.push(cP(e[s]));else if(Pm(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];c==="__proto__"||c==="constructor"||c==="prototype"||(i[c]=cP(e[c]))}}}else if(Pm(t))if(Pm(e)){if(!sSe(t,e))return e;i=Object.assign({},t);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let l=e[c];if(HE(l))typeof l>"u"?delete i[c]:i[c]=l;else{let u=i[c],d=l;if(T3(t,c,n)||T3(e,c,n))delete i[c];else{if(Pm(u)&&Pm(d)){let f=n.get(u)||[],p=n.get(d)||[];f.push({obj:t,key:c}),p.push({obj:e,key:c}),n.set(u,f),n.set(d,p)}i[c]=A3(i[c],l,r,n)}}}}else i=e;return i}}function T3(t,e,r){let n=r.get(t[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===t)return!0}return!1}function WE(t){return Array.isArray(t)}function x3(t){return typeof t=="function"}function Pm(t){return!HE(t)&&!WE(t)&&!x3(t)&&typeof t=="object"}function HE(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function sSe(t,e){return!(!aP(t)||!aP(e))}var iSe,w3=x(()=>{"use strict";b3();iSe=20});function R3(t,e){let r,n=new Promise(function(s,o){r=setTimeout(function(){o(new Om("Operation timed out."))},e)});return Promise.race([t,n]).then(i=>(clearTimeout(r),i),i=>{throw clearTimeout(r),i})}var Om,I3=x(()=>{"use strict";Om=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});function lP(t,e){return typeof e=="string"?t===e:!!t.match(e)}function C3(t,e){if(!e)return!1;for(let r of e)if(lP(t,r))return!0;return!1}var P3=x(()=>{"use strict"});var KE,O3=x(()=>{"use strict";KE=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var ZE,N3=x(()=>{"use strict";O3();ZE=class{_isCalled=!1;_deferred=new KE;_callback;_that;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function M3(t){if(t==null)return;let e=k3[t.toUpperCase()];return e??(Q.warn(`Unknown log level "${t}", expected one of ${Object.keys(k3)}, using default`),Ge.INFO)}var k3,D3=x(()=>{"use strict";be();k3={ALL:Ge.ALL,VERBOSE:Ge.VERBOSE,DEBUG:Ge.DEBUG,INFO:Ge.INFO,WARN:Ge.WARN,ERROR:Ge.ERROR,NONE:Ge.NONE}});function L3(t,e){return new Promise(r=>{at.with(NE(at.active()),()=>{t.export(e,r)})})}var $3=x(()=>{"use strict";be();wm()});var U3={};ir(U3,{AnchoredClock:()=>DE,BindOnceFuture:()=>ZE,CompositePropagator:()=>GE,ExportResultCode:()=>zE,RPCType:()=>qE,SDK_INFO:()=>BE,TRACE_PARENT_HEADER:()=>Im,TRACE_STATE_HEADER:()=>Cm,TimeoutError:()=>Om,TraceState:()=>Yu,W3CBaggagePropagator:()=>ME,W3CTraceContextPropagator:()=>VE,_globalThis:()=>FE,addHrTimes:()=>eP,callWithTimeout:()=>R3,deleteRPCMetadata:()=>m3,diagLogLevelFromString:()=>M3,getBooleanFromEnv:()=>$E,getNumberFromEnv:()=>Rt,getRPCMetadata:()=>g3,getStringFromEnv:()=>Fc,getStringListFromEnv:()=>UE,getTimeOrigin:()=>K6,globalErrorHandler:()=>$6,hrTime:()=>Q0,hrTimeDuration:()=>J6,hrTimeToMicroseconds:()=>e3,hrTimeToMilliseconds:()=>t3,hrTimeToNanoseconds:()=>Q6,hrTimeToSeconds:()=>r3,hrTimeToTimeStamp:()=>X6,internal:()=>oSe,isAttributeValue:()=>Z0,isTimeInput:()=>n3,isTimeInputHrTime:()=>jE,isTracingSuppressed:()=>Hu,isUrlIgnored:()=>C3,loggingErrorHandler:()=>LE,merge:()=>YE,millisToHrTime:()=>Wu,otperformance:()=>Xo,parseKeyPairsIntoRecord:()=>C6,parseTraceParent:()=>sP,sanitizeAttributes:()=>N6,setGlobalErrorHandler:()=>L6,setRPCMetadata:()=>h3,suppressTracing:()=>NE,timeInputToHrTime:()=>Z6,unrefTimer:()=>s3,unsuppressTracing:()=>v6,urlMatches:()=>lP});var oSe,Ku=x(()=>{"use strict";P6();O6();M6();U6();J0();i3();o3();a3();K0();X0();c3();p3();_3();wm();iP();w3();I3();P3();N3();D3();$3();oSe={_export:L3}});function Nm(t){return t.setValue(F3,!0)}function uP(t){return t.getValue(F3)===!0}var F3,dP=x(()=>{"use strict";be();F3=mr("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function Qo(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!aSe(r)){Q.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!JE(n)){Q.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function aSe(t){return typeof t=="string"&&t!==""}function JE(t){return t==null?!0:Array.isArray(t)?cSe(t):B3(typeof t)}function cSe(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(B3(n)){e=n;continue}return!1}return!1}}return!0}function B3(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var j3=x(()=>{"use strict";be()});function z3(){return t=>{Q.error(lSe(t))}}function lSe(t){return typeof t=="string"?t:JSON.stringify(uSe(t))}function uSe(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}var G3=x(()=>{"use strict";be()});function ji(t){try{dSe(t)}catch{}}var dSe,V3=x(()=>{"use strict";G3();dSe=z3()});var q3,H3=x(()=>{"use strict";q3="2.9.0"});var W3,Y3=x(()=>{"use strict";W3="process.runtime.name"});var jc,K3=x(()=>{"use strict";H3();Lc();Y3();jc={[Ls]:"opentelemetry",[W3]:"node",[Ds]:$u,[$s]:q3}});var zi,Z3=x(()=>{"use strict";K3();zi=performance});var fP=x(()=>{"use strict";Z3()});function ea(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*SSe);return[r,n]}function hP(t){let e=ea(zi.timeOrigin),r=ea(typeof t=="number"?t:zi.now());return tv(e,r)}function mP(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=pP),[r,n]}function XE(t){return t[0]*1e6+t[1]/1e3}function QE(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function ev(t){return QE(t)||typeof t=="number"||t instanceof Date}function tv(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=pP&&(r[1]-=pP,r[0]+=1),r}var _Se,ySe,SSe,pP,J3=x(()=>{"use strict";fP();_Se=9,ySe=6,SSe=Math.pow(10,ySe),pP=Math.pow(10,_Se)});var Nn,X3=x(()=>{"use strict";(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Nn||(Nn={}))});var rv,Q3=x(()=>{"use strict";rv=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var zc,eW=x(()=>{"use strict";Q3();zc=class{_isCalled=!1;_deferred=new rv;_callback;_that;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function tW(t,e){return new Promise(r=>{at.with(Nm(at.active()),()=>{t.export(e,r)})})}var rW=x(()=>{"use strict";be();dP()});var nW,Gi=x(()=>{"use strict";j3();V3();J3();X3();fP();dP();eW();rW();nW={_export:tW}});function iW(){if(nv===void 0)try{let t=globalThis.process.argv0;nv=t?`unknown_service:${t}`:"unknown_service"}catch{nv="unknown_service"}return nv}var nv,sW=x(()=>{"use strict"});var Zu,oW=x(()=>{"use strict";Zu=t=>t!==null&&typeof t=="object"&&typeof t.then=="function"});function cW(t,e){return gP.FromAttributeList(Object.entries(t),e)}function _P(){return cW({[Zq]:iW(),[Ds]:jc[Ds],[Ls]:jc[Ls],[$s]:jc[$s]})}function aW(t){return t.map(([e,r])=>Zu(r)?[e,r.catch(n=>{Q.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}function ESe(t){if(typeof t=="string"||t===void 0)return t;Q.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function vSe(t,e){let r=t?.schemaUrl,n=e?.schemaUrl,i=r===void 0||r==="",s=n===void 0||n==="";if(i)return n;if(s||r===n)return r;Q.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}var gP,lW=x(()=>{"use strict";be();Gi();Lc();sW();oW();gP=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let n=new t({},r);return n._rawAttributes=aW(e),n._asyncAttributesPending=e.filter(([i,s])=>Zu(s)).length>0,n}constructor(e,r){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([i,s])=>(Zu(s)&&(this._asyncAttributesPending=!0),[i,s])),this._rawAttributes=aW(this._rawAttributes),this._schemaUrl=ESe(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,n]=this._rawAttributes[e];this._rawAttributes[e]=[r,Zu(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Q.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,n]of this._rawAttributes){if(Zu(n)){Q.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(e[r]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(e==null)return this;let r=vSe(this,e),n=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],n)}}});var uW=x(()=>{"use strict";lW()});var dW,fW=x(()=>{"use strict";dW="exception"});function Xu(t){let e={};for(let[r,n]of t.getRawAttributes())typeof n?.then!="function"&&n!=null&&(e[r]??=n);return e}function Qu(t,e,r,n,i){if(typeof r=="number"&&r<0){let o=`[${t}]`;return n?.stylize?n.stylize(o,"special"):o}if(typeof i!="function"||!n)return e;let s={...n,depth:n.depth==null?n.depth:n.depth-1};return`${t} ${i(e,s)}`}var Ju,iv=x(()=>{"use strict";Ju=Symbol.for("nodejs.util.inspect.custom")});var sv,pW=x(()=>{"use strict";be();Gi();Lc();fW();iv();sv=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:gr.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=zi.now(),this._performanceOffset=r-(this._performanceStartTime+zi.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let n of e.links)this.addLink(n);this.startTime=this._getTime(e.startTime??r),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,r){if(r==null||this._isSpanEnded())return this;if(e.length===0)return Q.warn(`Invalid attribute key: ${e}`),this;if(!JE(r))return Q.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,i=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&i?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),i&&this._attributesCount++,this)}setAttributes(e){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.setAttribute(r,e[r]);return this}addEvent(e,r,n){if(this._isSpanEnded())return this;let{eventCountLimit:i}=this._spanLimits;if(i===0)return Q.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Q.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),ev(r)&&(ev(n)||(n=r),r=void 0);let s=Qo(r),{attributePerEventCountLimit:o}=this._spanLimits,a={},c=0,l=0;for(let u in s){if(!Object.prototype.hasOwnProperty.call(s,u))continue;let d=s[u];if(o!==void 0&&l>=o){c++;continue}a[u]=this._truncateToSize(d),l++}return this.events.push({name:e,attributes:a,time:this._getTime(n),droppedAttributesCount:c}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:r}=this._spanLimits;if(r===0)return this._droppedLinksCount++,this;r!==void 0&&this.links.length>=r&&(this._droppedLinksCount===0&&Q.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,i=Qo(e.attributes),s={},o=0,a=0;for(let l in i){if(!Object.prototype.hasOwnProperty.call(i,l))continue;let u=i[l];if(n!==void 0&&a>=n){o++;continue}s[l]=this._truncateToSize(u),a++}let c={context:e.context};return a>0&&(c.attributes=s),o>0&&(c.droppedAttributesCount=o),this.links.push(c),this}addLinks(e){for(let r of e)this.addLink(r);return this}setStatus(e){if(this._isSpanEnded())return this;if(e.code===gr.UNSET)return this;if(this.status.code===gr.OK)return this;let r={code:e.code};return e.code===gr.ERROR&&(typeof e.message=="string"?r.message=e.message:e.message!=null&&Q.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=r,this}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Q.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=mP(this.startTime,this.endTime),this._duration[0]<0&&(Q.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Q.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Q.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=zi.now())return hP(e+this._performanceOffset);if(typeof e=="number")return ea(e);if(e instanceof Date)return ea(e.getTime());if(QE(e))return e;if(this._startTimeProvided)return ea(Date.now());let r=zi.now()-this._performanceStartTime;return tv(this.startTime,ea(r))}isRecording(){return this._ended===!1}recordException(e,r){let n={};typeof e=="string"?n[oE]=e:e&&(e.code?n[aE]=e.code.toString():e.name&&(n[aE]=e.name),e.message&&(n[oE]=e.message),e.stack&&(n[Kq]=e.stack)),n[aE]||n[oE]?this.addEvent(dW,n,r):Q.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Q.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_truncateToSize(e){let r=this._attributeValueLengthLimit;return r<=0?(Q.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):e}[Ju](e,r,n){let i={name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:Xu(this.resource)}};return Qu("SpanImpl",i,e,r,n)}}});var sr,ed=x(()=>{"use strict";(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(sr||(sr={}))});var hW,mW,gW,yP,_W,yW,SW,EW,vW,bW,TW,km=x(()=>{"use strict";hW="otel.component.name",mW="otel.component.type",gW="otel.span.parent.origin",yP="otel.span.sampling_result",_W="otel.sdk.processor.span.processed",yW="otel.sdk.processor.span.queue.capacity",SW="otel.sdk.processor.span.queue.size",EW="otel.sdk.span.live",vW="otel.sdk.span.started",bW="batching_span_processor",TW="simple_span_processor"});function bSe(t){return t?t.isRemote?"remote":"local":"none"}function TSe(t){switch(t){case sr.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case sr.RECORD:return"RECORD_ONLY";case sr.NOT_RECORD:return"DROP"}}var ov,AW=x(()=>{"use strict";ed();km();ov=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(vW,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=e.createUpDownCounter(EW,{unit:"{span}",description:"The number of currently live spans."})}startSpan(e,r){let n=TSe(r);if(this.startedSpans.add(1,{[gW]:bSe(e),[yP]:n}),r===sr.NOT_RECORD)return()=>{};let i={[yP]:n};return this.liveSpans.add(1,i),()=>{this.liveSpans.add(-1,i)}}}});var xW,wW=x(()=>{"use strict";xW="2.9.0"});var av,RW=x(()=>{"use strict";be();Gi();pW();AW();wW();iv();av=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,r){this.instrumentationScope=e,this._sampler=r.sampler,this._spanLimits=r.spanLimits,this._resource=r.resource,this._idGenerator=r.idGenerator,this._spanProcessor=r.spanProcessor;let n=r.meterProvider.getMeter("@opentelemetry/sdk-trace",xW);this._tracerMetrics=new ov(n)}startSpan(e,r={},n=at.active()){r.root&&(n=ft.deleteSpan(n));let i=ft.getSpan(n);if(uP(n))return Q.debug("Instrumentation suppressed, returning Noop Span"),ft.wrapSpanContext(Mu);let s=i?.spanContext(),o=this._idGenerator.generateSpanId(),a,c,l;!s||!ft.isSpanContextValid(s)?c=this._idGenerator.generateTraceId():(c=s.traceId,l=s.traceState,a=s);let u=r.kind??ti.INTERNAL,d=(r.links??[]).map(A=>({context:A.context,attributes:Qo(A.attributes)})),f=Qo(r.attributes),p=this._sampler.shouldSample(n,c,e,u,f,d),h=this._tracerMetrics.startSpan(s,p.decision);l=p.traceState??l;let m=p.decision===Dc.RECORD_AND_SAMPLED?Mt.SAMPLED:Mt.NONE,E={traceId:c,spanId:o,traceFlags:m,traceState:l};if(p.decision===Dc.NOT_RECORD)return Q.debug("Recording is off, propagating context in a non-recording span"),ft.wrapSpanContext(E);let T=Qo(Object.assign(f,p.attributes));return new sv({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:E,name:e,kind:u,links:d,parentSpanContext:a,attributes:T,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:h})}startActiveSpan(e,r,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(s=r,a=n):(s=r,o=n,a=i);let c=o??at.active(),l=this.startSpan(e,s,c),u=ft.setSpan(c,l);return at.with(u,a,void 0,l)}[Ju](e,r,n){let i={instrumentationScope:this.instrumentationScope,resource:{attributes:Xu(this._resource)},spanLimits:this._spanLimits};return Qu("Tracer",i,e,r,n)}}});var cv,IW=x(()=>{"use strict";Gi();cv=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let r of this._spanProcessors)e.push(r.forceFlush());return new Promise(r=>{Promise.all(e).then(()=>{r()}).catch(n=>{ji(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(e,r){for(let n of this._spanProcessors)n.onStart(e,r)}onEnding(e){for(let r of this._spanProcessors)r.onEnding&&r.onEnding(e)}onEnd(e){for(let r of this._spanProcessors)r.onEnd(e)}shutdown(){let e=[];for(let r of this._spanProcessors)e.push(r.shutdown());return new Promise((r,n)=>{Promise.all(e).then(()=>{r()},n)})}}});var ri,SP=x(()=>{"use strict";ed();ri=class{shouldSample(){return{decision:sr.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Rr,lv=x(()=>{"use strict";ed();Rr=class{shouldSample(){return{decision:sr.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var kn,EP=x(()=>{"use strict";be();Gi();SP();lv();kn=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(ji(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Rr),this._remoteParentSampled=e.remoteParentSampled??new Rr,this._remoteParentNotSampled=e.remoteParentNotSampled??new ri,this._localParentSampled=e.localParentSampled??new Rr,this._localParentNotSampled=e.localParentNotSampled??new ri}shouldSample(e,r,n,i,s,o){let a=ft.getSpanContext(e);return!a||!On(a)?this._root.shouldSample(e,r,n,i,s,o):a.isRemote?a.traceFlags&Mt.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,r,n,i,s,o):a.traceFlags&Mt.SAMPLED?this._localParentSampled.shouldSample(e,r,n,i,s,o):this._localParentNotSampled.shouldSample(e,r,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var CW,td,vP=x(()=>{"use strict";Lc();km();CW=new Map,td=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,r,n){let i=CW.get(e)??0;if(CW.set(e,i+1),this.standardAttrs={[mW]:e,[hW]:`${e}/${i}`},this.droppedAttrs={...this.standardAttrs,[E0]:"queue_full"},this.processedSpans=r.createCounter(_W,{unit:"{span}",description:"The number of spans for which the processing has finished, either successful or failed."}),n){let{capacity:s,getQueueSize:o}=n;r.createUpDownCounter(yW,{unit:"{span}",description:"The maximum number of spans the queue of a given instance of an SDK span processor can hold."}).add(s,this.standardAttrs),this.queueSize=r.createObservableUpDownCounter(SW,{unit:"{span}",description:"The number of spans in the queue of a given instance of an SDK span processor."}),this.queueSizeCallback=c=>c.observe(o(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,r){if(!r){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[E0]:r.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}}});var uv,PW=x(()=>{"use strict";be();Gi();vP();km();uv=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new zc(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Q.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize);let r=e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):Ko();this._metrics=new td(bW,r,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,r){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Mt.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Q.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(Q.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,r)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,o=i;s<o;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,r)=>{let n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);at.with(Nm(at.active()),()=>{let i;this._finishedSpans.length<=this._maxExportBatchSize?(i=this._finishedSpans,this._finishedSpans=[]):i=this._finishedSpans.splice(0,this._maxExportBatchSize);let s=()=>this._exporter.export(i,a=>{clearTimeout(n),this._metrics.finishSpans(i.length,a.error),a.code===Nn.SUCCESS?e():r(a.error??new Error("BatchSpanProcessor: span export failed"))}),o=null;for(let a=0,c=i.length;a<c;a++){let l=i[a];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(o??=[],o.push(l.resource.waitForAsyncAttributes()))}o===null?s():Promise.all(o).then(s,a=>{ji(a),r(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,ji(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}});var Gc,OW=x(()=>{"use strict";PW();Gc=class extends uv{onShutdown(){}}});function NW(t){return function(){for(let r=0;r<t/4;r++)dv.writeUInt32BE(Math.random()*2**32>>>0,r*4);for(let r=0;r<t&&!(dv[r]>0);r++)r===t-1&&(dv[t-1]=1);return dv.toString("hex",0,t)}}var Bs,dv,kW=x(()=>{"use strict";Bs=class{generateTraceId=NW(16);generateSpanId=NW(8)},dv=Buffer.allocUnsafe(16)});var MW=x(()=>{"use strict";OW();kW()});var bP=x(()=>{"use strict";MW()});var Vc,Mm,DW=x(()=>{"use strict";be();uW();RW();IW();EP();lv();bP();iv();(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Vc||(Vc={}));Mm=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??_P();let r=e.spanProcessors??[];this._activeSpanProcessor=new cv(r),this._tracerOptions={resource:this._resource,sampler:e.sampler??new kn({root:new Rr}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Bs,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return Ko()}}}}getTracer(e,r,n){let i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new av({name:e,version:r,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(i)}forceFlush(){let e=this._forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(i=>{let s,o=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=Vc.timeout},e);n.forceFlush().then(()=>{clearTimeout(o),s!==Vc.timeout&&(s=Vc.resolved,i(s))}).catch(a=>{clearTimeout(o),s=Vc.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(s=>{let o=s.filter(a=>a!==Vc.resolved);o.length>0?i(o):n()}).catch(s=>i([s]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[Ju](e,r,n){let i=this._activeSpanProcessor._spanProcessors,s={resource:{attributes:Xu(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:i.map(o=>o.constructor?.name??"SpanProcessor")};return Qu("TracerProvider",s,e,r,n)}}});var Dm,LW=x(()=>{"use strict";Gi();Dm=class{export(e,r){return this._sendSpans(e,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:XE(e.startTime),duration:XE(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,r){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(r)return r({code:Nn.SUCCESS})}}});var Lm,$W=x(()=>{"use strict";Gi();Lm=class{_finishedSpans=[];_stopped=!1;export(e,r){if(this._stopped)return r({code:Nn.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>r({code:Nn.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var $m,UW=x(()=>{"use strict";be();Gi();vP();km();$m=class{_exporter;_metrics;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e.exporter,this._shutdownOnce=new zc(this._shutdown,this),this._pendingExports=new Set;let r=e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):Ko();this._metrics=new td(TW,r)}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,r){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Mt.SAMPLED)===0)return;let r=this._doExport(e).catch(n=>ji(n));this._pendingExports.add(r),r.finally(()=>this._pendingExports.delete(r))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let r=await nW._export(this._exporter,[e]);if(this._metrics.finishSpans(1,r.error),r.code!==Nn.SUCCESS)throw r.error??new Error(`SimpleSpanProcessor: span export failed (status ${r})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._metrics.shutdown(),this._exporter.shutdown()}}});var Um,FW=x(()=>{"use strict";Um=class{onStart(e,r){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var ta,BW=x(()=>{"use strict";be();ed();ta=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,r){return{decision:gm(r)&&this._accumulate(r)<this._upperBound?sr.RECORD_AND_SAMPLED:sr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let r=0;for(let n=0;n<32;n+=8){let i=0;for(let s=0;s<8;s++){let o=e.charCodeAt(n+s),a=o<58?o-48:o<71?o-55:o-87;i=i<<4|a}r=(r^i)>>>0}return r}}});var rd=x(()=>{"use strict";DW();bP();LW();$W();UW();FW();SP();lv();EP();BW();ed()});function zW(){return{sampler:ASe(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:Rt("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Rt("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:Rt("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Rt("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:Rt("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:Rt("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:Rt("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:Rt("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function ASe(){let t=Fc("OTEL_TRACES_SAMPLER")??Vi.ParentBasedAlwaysOn;switch(t){case Vi.AlwaysOn:return new Rr;case Vi.AlwaysOff:return new ri;case Vi.ParentBasedAlwaysOn:return new kn({root:new Rr});case Vi.ParentBasedAlwaysOff:return new kn({root:new ri});case Vi.TraceIdRatio:return new ta(jW());case Vi.ParentBasedTraceIdRatio:return new kn({root:new ta(jW())});default:return Q.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Vi.ParentBasedAlwaysOn}".`),new kn({root:new Rr})}}function jW(){let t=Rt("OTEL_TRACES_SAMPLER_ARG");return t==null?(Q.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${fv}.`),fv):t<0||t>1?(Q.error(`OTEL_TRACES_SAMPLER_ARG=${t} was given, but it is out of range ([0..1]), defaulting to ${fv}.`),fv):t}var Vi,fv,GW=x(()=>{"use strict";be();Ku();rd();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Vi||(Vi={}));fv=1});function VW(t){let e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??Rt("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??Rt("OTEL_ATTRIBUTE_COUNT_LIMIT")??xSe,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??Rt("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Rt("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??wSe,Object.assign({},t,{spanLimits:e})}var xSe,wSe,qW=x(()=>{"use strict";Ku();xSe=128,wSe=1/0});var pv,HW=x(()=>{"use strict";Ku();GW();qW();rd();pv=class extends Mm{constructor(e={}){let r=YE({},zW(),VW(e));delete r.generalLimits,super(r)}}});var hv,WW=x(()=>{"use strict";Ku();rd();hv=class extends Gc{constructor(e,r){r||(r={});let n=[["maxExportBatchSize","OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],["maxQueueSize","OTEL_BSP_MAX_QUEUE_SIZE"],["scheduledDelayMillis","OTEL_BSP_SCHEDULE_DELAY"],["exportTimeoutMillis","OTEL_BSP_EXPORT_TIMEOUT"]];for(let[i,s]of n)if(r[i]===void 0){let o=Rt(s);o!==void 0&&(r[i]=o)}super({exporter:e,...r})}}});var mv,YW=x(()=>{"use strict";rd();mv=class extends $m{constructor(e){super({exporter:e})}}});var TP={};ir(TP,{AlwaysOffSampler:()=>ri,AlwaysOnSampler:()=>Rr,BasicTracerProvider:()=>pv,BatchSpanProcessor:()=>hv,ConsoleSpanExporter:()=>Dm,InMemorySpanExporter:()=>Lm,NoopSpanProcessor:()=>Um,ParentBasedSampler:()=>kn,RandomIdGenerator:()=>Bs,SamplingDecision:()=>sr,SimpleSpanProcessor:()=>mv,TraceIdRatioBasedSampler:()=>ta});var AP=x(()=>{"use strict";HW();WW();YW();rd()});var KW=b(gv=>{"use strict";Object.defineProperty(gv,"__esModule",{value:!0});gv.NodeTracerProvider=void 0;var RSe=E6(),ISe=(AP(),Ar(TP)),Fm=(be(),Ar(Zo)),xP=(Ku(),Ar(U3));function CSe(t){if(t!==null){if(t===void 0){let e=new RSe.AsyncLocalStorageContextManager;e.enable(),Fm.context.setGlobalContextManager(e);return}t.enable(),Fm.context.setGlobalContextManager(t)}}function PSe(t){if(t!==null){if(t===void 0){Fm.propagation.setGlobalPropagator(new xP.CompositePropagator({propagators:[new xP.W3CTraceContextPropagator,new xP.W3CBaggagePropagator]}));return}Fm.propagation.setGlobalPropagator(t)}}var wP=class extends ISe.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){Fm.trace.setGlobalTracerProvider(this),CSe(e.contextManager),PSe(e.propagator)}};gv.NodeTracerProvider=wP});var RP=b(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.TraceIdRatioBasedSampler=tt.SimpleSpanProcessor=tt.SamplingDecision=tt.RandomIdGenerator=tt.ParentBasedSampler=tt.NoopSpanProcessor=tt.InMemorySpanExporter=tt.ConsoleSpanExporter=tt.BatchSpanProcessor=tt.BasicTracerProvider=tt.AlwaysOnSampler=tt.AlwaysOffSampler=tt.NodeTracerProvider=void 0;var OSe=KW();Object.defineProperty(tt,"NodeTracerProvider",{enumerable:!0,get:function(){return OSe.NodeTracerProvider}});var Mn=(AP(),Ar(TP));Object.defineProperty(tt,"AlwaysOffSampler",{enumerable:!0,get:function(){return Mn.AlwaysOffSampler}});Object.defineProperty(tt,"AlwaysOnSampler",{enumerable:!0,get:function(){return Mn.AlwaysOnSampler}});Object.defineProperty(tt,"BasicTracerProvider",{enumerable:!0,get:function(){return Mn.BasicTracerProvider}});Object.defineProperty(tt,"BatchSpanProcessor",{enumerable:!0,get:function(){return Mn.BatchSpanProcessor}});Object.defineProperty(tt,"ConsoleSpanExporter",{enumerable:!0,get:function(){return Mn.ConsoleSpanExporter}});Object.defineProperty(tt,"InMemorySpanExporter",{enumerable:!0,get:function(){return Mn.InMemorySpanExporter}});Object.defineProperty(tt,"NoopSpanProcessor",{enumerable:!0,get:function(){return Mn.NoopSpanProcessor}});Object.defineProperty(tt,"ParentBasedSampler",{enumerable:!0,get:function(){return Mn.ParentBasedSampler}});Object.defineProperty(tt,"RandomIdGenerator",{enumerable:!0,get:function(){return Mn.RandomIdGenerator}});Object.defineProperty(tt,"SamplingDecision",{enumerable:!0,get:function(){return Mn.SamplingDecision}});Object.defineProperty(tt,"SimpleSpanProcessor",{enumerable:!0,get:function(){return Mn.SimpleSpanProcessor}});Object.defineProperty(tt,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return Mn.TraceIdRatioBasedSampler}})});var vv,oY=x(()=>{"use strict";vv=class{_delegate;constructor(e){this._delegate=e}export(e,r){this._delegate.export(e,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}});var js,bv=x(()=>{"use strict";js=class extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}});function jSe(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function Tv(t){if(t!=null)return async()=>t}function Av(t,e,r){return{timeoutMillis:jSe(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function xv(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var Gm=x(()=>{"use strict"});var wv,aY=x(()=>{"use strict";(function(t){t.NONE="none",t.GZIP="gzip"})(wv||(wv={}))});function Rv(t){return new NP(t.concurrencyLimit)}var NP,kP=x(()=>{"use strict";NP=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);let r=()=>{let n=this._sendingPromises.indexOf(e);this._sendingPromises.splice(n,1)};e.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}});function zSe(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function cY(){return{handleResponse(t){t==null||!zSe(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Q.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}var lY=x(()=>{"use strict";be()});function Iv(t,e){return new MP(t.transport,t.serializer,cY(),t.promiseHandler,e.timeout)}var MP,DP=x(()=>{"use strict";Fs();bv();lY();be();MP=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,r,n,i,s){this._transport=e,this._serializer=r,this._responseHandler=n,this._promiseQueue=i,this._timeout=s,this._diagLogger=Q.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:wr.FAILED,error:new Error("Concurrent export limit reached")});return}let n=this._serializer.serializeRequest(e);if(n==null){r({code:wr.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(i=>{if(i.status==="success"){if(i.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(i.data))}catch(s){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",s,i.data)}r({code:wr.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:wr.FAILED,error:i.error});return}else i.status==="retryable"?r({code:wr.FAILED,error:i.error??new js("Export failed with retryable status")}):r({code:wr.FAILED,error:new js("Export failed with unknown error")})},i=>r({code:wr.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}});function uY(t,e,r){return Iv({transport:r,serializer:e,promiseHandler:Rv(t)},{timeout:t.timeoutMillis})}var dY=x(()=>{"use strict";kP();DP()});var Cv={};ir(Cv,{CompressionAlgorithm:()=>wv,OTLPExporterBase:()=>vv,OTLPExporterError:()=>js,createOtlpNetworkExportDelegate:()=>uY,getSharedConfigurationDefaults:()=>xv,mergeOtlpSharedConfigurationWithDefaults:()=>Av});var Pv=x(()=>{"use strict";oY();bv();Gm();aY();dY()});var fY=b(Ov=>{"use strict";Object.defineProperty(Ov,"__esModule",{value:!0});Ov.VERSION=void 0;Ov.VERSION="0.218.0"});var Be=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=Dn.DEFAULT_MAX_SEND_MESSAGE_LENGTH=Dn.Propagate=Dn.LogVerbosity=Dn.Status=void 0;var pY;(function(t){t[t.OK=0]="OK",t[t.CANCELLED=1]="CANCELLED",t[t.UNKNOWN=2]="UNKNOWN",t[t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",t[t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",t[t.NOT_FOUND=5]="NOT_FOUND",t[t.ALREADY_EXISTS=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",t[t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",t[t.ABORTED=10]="ABORTED",t[t.OUT_OF_RANGE=11]="OUT_OF_RANGE",t[t.UNIMPLEMENTED=12]="UNIMPLEMENTED",t[t.INTERNAL=13]="INTERNAL",t[t.UNAVAILABLE=14]="UNAVAILABLE",t[t.DATA_LOSS=15]="DATA_LOSS",t[t.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(pY||(Dn.Status=pY={}));var hY;(function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.ERROR=2]="ERROR",t[t.NONE=3]="NONE"})(hY||(Dn.LogVerbosity=hY={}));var mY;(function(t){t[t.DEADLINE=1]="DEADLINE",t[t.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",t[t.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",t[t.CANCELLATION=8]="CANCELLATION",t[t.DEFAULTS=65535]="DEFAULTS"})(mY||(Dn.Propagate=mY={}));Dn.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;Dn.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var LP=b(($it,GSe)=>{GSe.exports={name:"@grpc/grpc-js",version:"1.14.4",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto","copy-protos":"node ./copy-protos"},dependencies:{"@grpc/proto-loader":"^0.8.0","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/**/*.proto","proto/**/LICENSE","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var ct=b(cn=>{"use strict";var $P,UP,FP,BP;Object.defineProperty(cn,"__esModule",{value:!0});cn.log=cn.setLoggerVerbosity=cn.setLogger=cn.getLogger=void 0;cn.trace=eEe;cn.isTracerEnabled=_Y;var ra=Be(),VSe=J("process"),qSe=LP().version,HSe={error:(t,...e)=>{console.error("E "+t,...e)},info:(t,...e)=>{console.error("I "+t,...e)},debug:(t,...e)=>{console.error("D "+t,...e)}},Hc=HSe,nd=ra.LogVerbosity.ERROR,WSe=(UP=($P=process.env.GRPC_NODE_VERBOSITY)!==null&&$P!==void 0?$P:process.env.GRPC_VERBOSITY)!==null&&UP!==void 0?UP:"";switch(WSe.toUpperCase()){case"DEBUG":nd=ra.LogVerbosity.DEBUG;break;case"INFO":nd=ra.LogVerbosity.INFO;break;case"ERROR":nd=ra.LogVerbosity.ERROR;break;case"NONE":nd=ra.LogVerbosity.NONE;break;default:}var YSe=()=>Hc;cn.getLogger=YSe;var KSe=t=>{Hc=t};cn.setLogger=KSe;var ZSe=t=>{nd=t};cn.setLoggerVerbosity=ZSe;var JSe=(t,...e)=>{let r;if(t>=nd){switch(t){case ra.LogVerbosity.DEBUG:r=Hc.debug;break;case ra.LogVerbosity.INFO:r=Hc.info;break;case ra.LogVerbosity.ERROR:r=Hc.error;break}r||(r=Hc.error),r&&r.bind(Hc)(...e)}};cn.log=JSe;var XSe=(BP=(FP=process.env.GRPC_NODE_TRACE)!==null&&FP!==void 0?FP:process.env.GRPC_TRACE)!==null&&BP!==void 0?BP:"",jP=new Set,gY=new Set;for(let t of XSe.split(","))t.startsWith("-")?gY.add(t.substring(1)):jP.add(t);var QSe=jP.has("all");function eEe(t,e,r){_Y(e)&&(0,cn.log)(t,new Date().toISOString()+" | v"+qSe+" "+VSe.pid+" | "+e+" | "+r)}function _Y(t){return!gY.has(t)&&(QSe||jP.has(t))}});var kv=b(Nv=>{"use strict";Object.defineProperty(Nv,"__esModule",{value:!0});Nv.getErrorMessage=tEe;Nv.getErrorCode=rEe;function tEe(t){return t instanceof Error?t.message:String(t)}function rEe(t){return typeof t=="object"&&t!==null&&"code"in t&&typeof t.code=="number"?t.code:null}});var Wt=b(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});Dv.Metadata=void 0;var nEe=ct(),iEe=Be(),sEe=kv(),oEe=/^[:0-9a-z_.-]+$/,aEe=/^[ -~]*$/;function cEe(t){return oEe.test(t)}function lEe(t){return aEe.test(t)}function SY(t){return t.endsWith("-bin")}function uEe(t){return!t.startsWith("grpc-")}function Mv(t){return t.toLowerCase()}function yY(t,e){if(!cEe(t))throw new Error('Metadata key "'+t+'" contains illegal characters');if(e!=null)if(SY(t)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!lEe(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var zP=class t{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,r){e=Mv(e),yY(e,r),this.internalRepr.set(e,[r])}add(e,r){e=Mv(e),yY(e,r);let n=this.internalRepr.get(e);n===void 0?this.internalRepr.set(e,[r]):n.push(r)}remove(e){e=Mv(e),this.internalRepr.delete(e)}get(e){return e=Mv(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[r,n]of this.internalRepr)if(n.length>0){let i=n[0];e[r]=Buffer.isBuffer(i)?Buffer.from(i):i}return e}clone(){let e=new t(this.options),r=e.internalRepr;for(let[n,i]of this.internalRepr){let s=i.map(o=>Buffer.isBuffer(o)?Buffer.from(o):o);r.set(n,s)}return e}merge(e){for(let[r,n]of e.internalRepr){let i=(this.internalRepr.get(r)||[]).concat(n);this.internalRepr.set(r,i)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[r,n]of this.internalRepr)r.startsWith(":")||(e[r]=n.map(dEe));return e}toJSON(){let e={};for(let[r,n]of this.internalRepr)e[r]=n;return e}setOpaque(e,r){this.opaqueData.set(e,r)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(e){let r=new t;for(let n of Object.keys(e)){if(n.charAt(0)===":")continue;let i=e[n];try{SY(n)?Array.isArray(i)?i.forEach(s=>{r.add(n,Buffer.from(s,"base64"))}):i!==void 0&&(uEe(n)?i.split(",").forEach(s=>{r.add(n,Buffer.from(s.trim(),"base64"))}):r.add(n,Buffer.from(i,"base64"))):Array.isArray(i)?i.forEach(s=>{r.add(n,s)}):i!==void 0&&r.add(n,i)}catch(s){let o=`Failed to add metadata entry ${n}: ${i}. ${(0,sEe.getErrorMessage)(s)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,nEe.log)(iEe.LogVerbosity.ERROR,o)}}return r}};Dv.Metadata=zP;var dEe=t=>Buffer.isBuffer(t)?t.toString("base64"):t});var $v=b(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});Lv.CallCredentials=void 0;var HP=Wt();function fEe(t){return"getRequestHeaders"in t&&typeof t.getRequestHeaders=="function"}var id=class t{static createFromMetadataGenerator(e){return new VP(e)}static createFromGoogleCredential(e){return t.createFromMetadataGenerator((r,n)=>{let i;fEe(e)?i=e.getRequestHeaders(r.service_url):i=new Promise((s,o)=>{e.getRequestMetadata(r.service_url,(a,c)=>{if(a){o(a);return}if(!c){o(new Error("Headers not set by metadata plugin"));return}s(c)})}),i.then(s=>{let o=new HP.Metadata;for(let a of Object.keys(s))o.add(a,s[a]);n(null,o)},s=>{n(s)})})}static createEmpty(){return new qP}};Lv.CallCredentials=id;var GP=class t extends id{constructor(e){super(),this.creds=e}async generateMetadata(e){let r=new HP.Metadata,n=await Promise.all(this.creds.map(i=>i.generateMetadata(e)));for(let i of n)r.merge(i);return r}compose(e){return new t(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof t?this.creds.every((r,n)=>r._equals(e.creds[n])):!1}},VP=class t extends id{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((r,n)=>{this.metadataGenerator(e,(i,s)=>{s!==void 0?r(s):n(i)})})}compose(e){return new GP([this,e])}_equals(e){return this===e?!0:e instanceof t?this.metadataGenerator===e.metadataGenerator:!1}},qP=class t extends id{generateMetadata(e){return Promise.resolve(new HP.Metadata)}compose(e){return e}_equals(e){return e instanceof t}}});var YP=b(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.CIPHER_SUITES=void 0;Vm.getDefaultRootsData=hEe;var pEe=J("fs");Vm.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var EY=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,WP=null;function hEe(){return EY?(WP===null&&(WP=pEe.readFileSync(EY)),WP):null}});var Ir=b(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.parseUri=gEe;sd.splitHostPort=_Ee;sd.combineHostPort=yEe;sd.uriToString=SEe;var mEe=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function gEe(t){let e=mEe.exec(t);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var vY=/^\d+$/;function _Ee(t){if(t.startsWith("[")){let e=t.indexOf("]");if(e===-1)return null;let r=t.substring(1,e);if(r.indexOf(":")===-1)return null;if(t.length>e+1)if(t[e+1]===":"){let n=t.substring(e+2);return vY.test(n)?{host:r,port:+n}:null}else return null;else return{host:r}}else{let e=t.split(":");return e.length===2?vY.test(e[1])?{host:e[0],port:+e[1]}:null:{host:t}}}function yEe(t){return t.port===void 0?t.host:t.host.includes(":")?`[${t.host}]:${t.port}`:`${t.host}:${t.port}`}function SEe(t){let e="";return t.scheme!==void 0&&(e+=t.scheme+":"),t.authority!==void 0&&(e+="//"+t.authority+"/"),e+=t.path,e}});var ni=b(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;zs.registerResolver=EEe;zs.registerDefaultScheme=vEe;zs.createResolver=bEe;zs.getDefaultAuthority=TEe;zs.mapUriDefaultScheme=AEe;var ZP=Ir();zs.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var od={},KP=null;function EEe(t,e){od[t]=e}function vEe(t){KP=t}function bEe(t,e,r){if(t.scheme!==void 0&&t.scheme in od)return new od[t.scheme](t,e,r);throw new Error(`No resolver could be created for target ${(0,ZP.uriToString)(t)}`)}function TEe(t){if(t.scheme!==void 0&&t.scheme in od)return od[t.scheme].getDefaultAuthority(t);throw new Error(`Invalid target ${(0,ZP.uriToString)(t)}`)}function AEe(t){return t.scheme===void 0||!(t.scheme in od)?KP!==null?{scheme:KP,authority:void 0,path:(0,ZP.uriToString)(t)}:null:t}});var ad=b(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.ChannelCredentials=void 0;Hm.createCertificateProviderChannelCredentials=IEe;var qm=J("tls"),Bv=$v(),XP=YP(),bY=Ir(),xEe=ni(),wEe=ct(),REe=Be();function JP(t,e){if(t&&!(t instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var Wc=class{compose(e){return new tO(this,e)}static createSsl(e,r,n,i){var s;if(JP(e,"Root certificate"),JP(r,"Private key"),JP(n,"Certificate chain"),r&&!n)throw new Error("Private key must be given with accompanying certificate chain");if(!r&&n)throw new Error("Certificate chain must be given with accompanying private key");let o=(0,qm.createSecureContext)({ca:(s=e??(0,XP.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,key:r??void 0,cert:n??void 0,ciphers:XP.CIPHER_SUITES});return new Uv(o,i??{})}static createFromSecureContext(e,r){return new Uv(e,r??{})}static createInsecure(){return new QP}};Hm.ChannelCredentials=Wc;var QP=class t extends Wc{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof t}_createSecureConnector(e,r,n){return{connect(i){return Promise.resolve({socket:i,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>n??Bv.CallCredentials.createEmpty(),destroy(){}}}};function TY(t,e,r,n){var i,s;let o={secureContext:t},a=r;if("grpc.http_connect_target"in n){let d=(0,bY.parseUri)(n["grpc.http_connect_target"]);d&&(a=d)}let c=(0,xEe.getDefaultAuthority)(a),l=(0,bY.splitHostPort)(c),u=(i=l?.host)!==null&&i!==void 0?i:c;if(o.host=u,e.checkServerIdentity&&(o.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(o.rejectUnauthorized=e.rejectUnauthorized),o.ALPNProtocols=["h2"],n["grpc.ssl_target_name_override"]){let d=n["grpc.ssl_target_name_override"],f=(s=o.checkServerIdentity)!==null&&s!==void 0?s:qm.checkServerIdentity;o.checkServerIdentity=(p,h)=>f(d,h),o.servername=d}else o.servername=u;return n["grpc-node.tls_enable_trace"]&&(o.enableTrace=!0),o}var eO=class{constructor(e,r){this.connectionOptions=e,this.callCredentials=r}connect(e){let r=Object.assign({socket:e},this.connectionOptions);return new Promise((n,i)=>{let s=(0,qm.connect)(r,()=>{var o;if((!((o=this.connectionOptions.rejectUnauthorized)!==null&&o!==void 0)||o)&&!s.authorized){i(s.authorizationError);return}n({socket:s,secure:!0})});s.on("error",o=>{i(o)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Uv=class t extends Wc{constructor(e,r){super(),this.secureContext=e,this.verifyOptions=r}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof t?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,r,n){let i=TY(this.secureContext,this.verifyOptions,e,r);return new eO(i,n??Bv.CallCredentials.createEmpty())}},Fv=class t extends Wc{constructor(e,r,n){super(),this.caCertificateProvider=e,this.identityCertificateProvider=r,this.verifyOptions=n,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var r,n;return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((r=this.verifyOptions)===null||r===void 0?void 0:r.checkServerIdentity)===((n=e.verifyOptions)===null||n===void 0?void 0:n.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,r,n){return this.ref(),new t.SecureConnectorImpl(this,e,r,n??Bv.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,r;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,qm.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(r=this.latestIdentityUpdate)===null||r===void 0?void 0:r.certificate,ciphers:XP.CIPHER_SUITES})}catch(n){return(0,wEe.log)(REe.LogVerbosity.ERROR,"Failed to createSecureContext with error "+n.message),null}}};Fv.SecureConnectorImpl=class{constructor(t,e,r,n){this.parent=t,this.channelTarget=e,this.options=r,this.callCredentials=n}connect(t){return new Promise((e,r)=>{let n=this.parent.getLatestSecureContext();if(!n){r(new Error("Failed to load credentials"));return}t.closed&&r(new Error("Socket closed while loading credentials"));let i=TY(n,this.parent.verifyOptions,this.channelTarget,this.options),s=Object.assign({socket:t},i),o=()=>{r(new Error("Socket closed"))},a=l=>{r(l)},c=(0,qm.connect)(s,()=>{var l;if(c.removeListener("close",o),c.removeListener("error",a),(!((l=this.parent.verifyOptions.rejectUnauthorized)!==null&&l!==void 0)||l)&&!c.authorized){r(c.authorizationError);return}e({socket:c,secure:!0})});c.once("close",o),c.once("error",a)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function IEe(t,e,r){return new Fv(t,e,r??{})}var tO=class t extends Wc{constructor(e,r){if(super(),this.channelCredentials=e,this.callCredentials=r,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let r=this.callCredentials.compose(e);return new t(this.channelCredentials,r)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof t?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,r,n){let i=this.callCredentials.compose(n??Bv.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,i)}}});var ia=b(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.createChildChannelControlHelper=OEe;qi.registerLoadBalancerType=NEe;qi.registerDefaultLoadBalancerType=kEe;qi.createLoadBalancer=MEe;qi.isLoadBalancerNameRegistered=DEe;qi.parseLoadBalancingConfig=AY;qi.getDefaultConfig=LEe;qi.selectLbConfigFromList=$Ee;var CEe=ct(),PEe=Be();function OEe(t,e){var r,n,i,s,o,a,c,l,u,d;return{createSubchannel:(n=(r=e.createSubchannel)===null||r===void 0?void 0:r.bind(e))!==null&&n!==void 0?n:t.createSubchannel.bind(t),updateState:(s=(i=e.updateState)===null||i===void 0?void 0:i.bind(e))!==null&&s!==void 0?s:t.updateState.bind(t),requestReresolution:(a=(o=e.requestReresolution)===null||o===void 0?void 0:o.bind(e))!==null&&a!==void 0?a:t.requestReresolution.bind(t),addChannelzChild:(l=(c=e.addChannelzChild)===null||c===void 0?void 0:c.bind(e))!==null&&l!==void 0?l:t.addChannelzChild.bind(t),removeChannelzChild:(d=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&d!==void 0?d:t.removeChannelzChild.bind(t)}}var na={},Wm=null;function NEe(t,e,r){na[t]={LoadBalancer:e,LoadBalancingConfig:r}}function kEe(t){Wm=t}function MEe(t,e){let r=t.getLoadBalancerName();return r in na?new na[r].LoadBalancer(e):null}function DEe(t){return t in na}function AY(t){let e=Object.keys(t);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let r=e[0];if(r in na)try{return na[r].LoadBalancingConfig.createFromJson(t[r])}catch(n){throw new Error(`${r}: ${n.message}`)}else throw new Error(`Unrecognized load balancing config name ${r}`)}function LEe(){if(!Wm)throw new Error("No default load balancer type registered");return new na[Wm].LoadBalancingConfig}function $Ee(t,e=!1){for(let r of t)try{return AY(r)}catch(n){(0,CEe.log)(PEe.LogVerbosity.DEBUG,"Config parsing failed with error",n.message);continue}return e&&Wm?new na[Wm].LoadBalancingConfig:null}});var rO=b(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.validateRetryThrottling=xY;Ym.validateServiceConfig=wY;Ym.extractAndSelectServiceConfig=WEe;var UEe=J("os"),jv=Be(),zv=/^\d+(\.\d{1,9})?s$/,FEe="node";function BEe(t){if("service"in t&&t.service!==""){if(typeof t.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof t.service}`);if("method"in t&&t.method!==""){if(typeof t.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof t.service}`);return{service:t.service,method:t.method}}else return{service:t.service}}else{if("method"in t&&t.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function jEe(t){if(!("maxAttempts"in t)||!Number.isInteger(t.maxAttempts)||t.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in t)||typeof t.initialBackoff!="string"||!zv.test(t.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in t)||typeof t.maxBackoff!="string"||!zv.test(t.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in t)||typeof t.backoffMultiplier!="number"||t.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in t&&Array.isArray(t.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(t.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of t.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(jv.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(jv.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:t.maxAttempts,initialBackoff:t.initialBackoff,maxBackoff:t.maxBackoff,backoffMultiplier:t.backoffMultiplier,retryableStatusCodes:t.retryableStatusCodes}}function zEe(t){if(!("maxAttempts"in t)||!Number.isInteger(t.maxAttempts)||t.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in t&&(typeof t.hedgingDelay!="string"||!zv.test(t.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in t&&Array.isArray(t.nonFatalStatusCodes))for(let r of t.nonFatalStatusCodes)if(typeof r=="number"){if(!Object.values(jv.Status).includes(r))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof r=="string"){if(!Object.values(jv.Status).includes(r.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:t.maxAttempts};return t.hedgingDelay&&(e.hedgingDelay=t.hedgingDelay),t.nonFatalStatusCodes&&(e.nonFatalStatusCodes=t.nonFatalStatusCodes),e}function GEe(t){var e;let r={name:[]};if(!("name"in t)||!Array.isArray(t.name))throw new Error("Invalid method config: invalid name array");for(let n of t.name)r.name.push(BEe(n));if("waitForReady"in t){if(typeof t.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");r.waitForReady=t.waitForReady}if("timeout"in t)if(typeof t.timeout=="object"){if(!("seconds"in t.timeout)||typeof t.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in t.timeout)||typeof t.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");r.timeout=t.timeout}else if(typeof t.timeout=="string"&&zv.test(t.timeout)){let n=t.timeout.substring(0,t.timeout.length-1).split(".");r.timeout={seconds:n[0]|0,nanos:((e=n[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in t){if(typeof t.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");r.maxRequestBytes=t.maxRequestBytes}if("maxResponseBytes"in t){if(typeof t.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");r.maxResponseBytes=t.maxResponseBytes}if("retryPolicy"in t){if("hedgingPolicy"in t)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");r.retryPolicy=jEe(t.retryPolicy)}else"hedgingPolicy"in t&&(r.hedgingPolicy=zEe(t.hedgingPolicy));return r}function xY(t){if(!("maxTokens"in t)||typeof t.maxTokens!="number"||t.maxTokens<=0||t.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in t)||typeof t.tokenRatio!="number"||t.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+t.maxTokens.toFixed(3),tokenRatio:+t.tokenRatio.toFixed(3)}}function VEe(t){if(!(typeof t=="object"&&t!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof t}`);let e=Object.keys(t);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:t[e[0]]}}function wY(t){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in t)if(typeof t.loadBalancingPolicy=="string")e.loadBalancingPolicy=t.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in t)if(Array.isArray(t.loadBalancingConfig))for(let n of t.loadBalancingConfig)e.loadBalancingConfig.push(VEe(n));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in t&&Array.isArray(t.methodConfig))for(let n of t.methodConfig)e.methodConfig.push(GEe(n));"retryThrottling"in t&&(e.retryThrottling=xY(t.retryThrottling));let r=[];for(let n of e.methodConfig)for(let i of n.name){for(let s of r)if(i.service===s.service&&i.method===s.method)throw new Error(`Invalid service config: duplicate name ${i.service}/${i.method}`);r.push(i)}return e}function qEe(t){if(!("serviceConfig"in t))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:wY(t.serviceConfig)};if("clientLanguage"in t)if(Array.isArray(t.clientLanguage)){e.clientLanguage=[];for(let n of t.clientLanguage)if(typeof n=="string")e.clientLanguage.push(n);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in t)if(Array.isArray(t.clientHostname)){e.clientHostname=[];for(let n of t.clientHostname)if(typeof n=="string")e.clientHostname.push(n);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in t)if(typeof t.percentage=="number"&&0<=t.percentage&&t.percentage<=100)e.percentage=t.percentage;else throw new Error("Invalid service config choice: invalid percentage");let r=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let n in t)if(!r.includes(n))throw new Error(`Invalid service config choice: unexpected field ${n}`);return e}function HEe(t,e){if(!Array.isArray(t))throw new Error("Invalid service config list");for(let r of t){let n=qEe(r);if(!(typeof n.percentage=="number"&&e>n.percentage)){if(Array.isArray(n.clientHostname)){let i=!1;for(let s of n.clientHostname)s===UEe.hostname()&&(i=!0);if(!i)continue}if(Array.isArray(n.clientLanguage)){let i=!1;for(let s of n.clientLanguage)s===FEe&&(i=!0);if(!i)continue}return n.serviceConfig}}throw new Error("No matching service config found")}function WEe(t,e){for(let r of t)if(r.length>0&&r[0].startsWith("grpc_config=")){let n=r.join("").substring(12),i=JSON.parse(n);return HEe(i,e)}return null}});var Cr=b(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});Gv.ConnectivityState=void 0;var RY;(function(t){t[t.IDLE=0]="IDLE",t[t.CONNECTING=1]="CONNECTING",t[t.READY=2]="READY",t[t.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",t[t.SHUTDOWN=4]="SHUTDOWN"})(RY||(Gv.ConnectivityState=RY={}))});var Gs=b(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.QueuePicker=sa.UnavailablePicker=sa.PickResultType=void 0;var YEe=Wt(),KEe=Be(),Vv;(function(t){t[t.COMPLETE=0]="COMPLETE",t[t.QUEUE=1]="QUEUE",t[t.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",t[t.DROP=3]="DROP"})(Vv||(sa.PickResultType=Vv={}));var nO=class{constructor(e){this.status=Object.assign({code:KEe.Status.UNAVAILABLE,details:"No connection established",metadata:new YEe.Metadata},e)}pick(e){return{pickResultType:Vv.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};sa.UnavailablePicker=nO;var iO=class{constructor(e,r){this.loadBalancer=e,this.childPicker=r,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:Vv.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};sa.QueuePicker=iO});var cd=b(Hv=>{"use strict";Object.defineProperty(Hv,"__esModule",{value:!0});Hv.BackoffTimeout=void 0;var ZEe=Be(),JEe=ct(),XEe="backoff",QEe=1e3,eve=1.6,tve=12e4,rve=.2;function nve(t,e){return Math.random()*(e-t)+t}var qv=class t{constructor(e,r){this.callback=e,this.initialDelay=QEe,this.multiplier=eve,this.maxDelay=tve,this.jitter=rve,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=t.getNextId(),r&&(r.initialDelay&&(this.initialDelay=r.initialDelay),r.multiplier&&(this.multiplier=r.multiplier),r.jitter&&(this.jitter=r.jitter),r.maxDelay&&(this.maxDelay=r.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){JEe.trace(ZEe.LogVerbosity.DEBUG,XEe,"{"+this.id+"} "+e)}runTimer(e){var r,n;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(n=(r=this.timerId).unref)===null||n===void 0||n.call(r)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),r=e*this.jitter;this.nextDelay=e+nve(-r,r)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,r=this.startTime;r.setMilliseconds(r.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<r?this.runTimer(r.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,r;this.hasRef=!0,(r=(e=this.timerId).ref)===null||r===void 0||r.call(e)}unref(){var e,r;this.hasRef=!1,(r=(e=this.timerId).unref)===null||r===void 0||r.call(e)}getEndTime(){return this.endTime}};Hv.BackoffTimeout=qv;qv.nextId=0});var Yv=b(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});Wv.ChildLoadBalancerHandler=void 0;var ive=ia(),sve=Cr(),ove="child_load_balancer_helper",sO=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(r){this.parent=r,this.child=null}createSubchannel(r,n){return this.parent.channelControlHelper.createSubchannel(r,n)}updateState(r,n,i){var s;if(this.calledByPendingChild()){if(r===sve.ConnectivityState.CONNECTING)return;(s=this.parent.currentChild)===null||s===void 0||s.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(r,n,i)}requestReresolution(){var r;let n=(r=this.parent.pendingChild)!==null&&r!==void 0?r:this.parent.currentChild;this.child===n&&this.parent.channelControlHelper.requestReresolution()}setChild(r){this.child=r}addChannelzChild(r){this.parent.channelControlHelper.addChannelzChild(r)}removeChannelzChild(r){this.parent.channelControlHelper.removeChannelzChild(r)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,r){return e.getLoadBalancerName()!==r.getLoadBalancerName()}updateAddressList(e,r,n,i){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){let o=new this.ChildPolicyHelper(this),a=(0,ive.createLoadBalancer)(r,o);o.setChild(a),this.currentChild===null?(this.currentChild=a,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=a,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;return this.latestConfig=r,s.updateAddressList(e,r,n,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return ove}};Wv.ChildLoadBalancerHandler=sO});var PY=b(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});Kv.ResolvingLoadBalancer=void 0;var ave=ia(),cve=rO(),Vr=Cr(),IY=ni(),Km=Gs(),lve=cd(),oO=Be(),uve=Wt(),dve=ct(),fve=Be(),pve=Ir(),hve=Yv(),mve="resolving_load_balancer";function CY(t){dve.trace(fve.LogVerbosity.DEBUG,mve,t)}var gve=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function _ve(t,e,r,n){for(let i of r.name)switch(n){case"EMPTY":if(!i.service&&!i.method)return!0;break;case"SERVICE":if(i.service===t&&!i.method)return!0;break;case"SERVICE_AND_METHOD":if(i.service===t&&i.method===e)return!0}return!1}function yve(t,e,r,n){for(let i of r)if(_ve(t,e,i,n))return i;return null}function Sve(t){return{invoke(e,r){var n,i;let s=e.split("/").filter(c=>c.length>0),o=(n=s[0])!==null&&n!==void 0?n:"",a=(i=s[1])!==null&&i!==void 0?i:"";if(t&&t.methodConfig)for(let c of gve){let l=yve(o,a,t.methodConfig,c);if(l)return{methodConfig:l,pickInformation:{},status:oO.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:oO.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var aO=class{constructor(e,r,n,i,s){this.target=e,this.channelControlHelper=r,this.channelOptions=n,this.onSuccessfulResolution=i,this.onFailedResolution=s,this.latestChildState=Vr.ConnectivityState.IDLE,this.latestChildPicker=new Km.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=Vr.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,n["grpc.service_config"]?this.defaultServiceConfig=(0,cve.validateServiceConfig)(JSON.parse(n["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(Vr.ConnectivityState.IDLE,new Km.QueuePicker(this),null),this.childLoadBalancer=new hve.ChildLoadBalancerHandler({createSubchannel:r.createSubchannel.bind(r),requestReresolution:()=>{this.backoffTimeout.isRunning()?(CY("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(a,c,l)=>{this.latestChildState=a,this.latestChildPicker=c,this.latestChildErrorMessage=l,this.updateState(a,c,l)},addChannelzChild:r.addChannelzChild.bind(r),removeChannelzChild:r.removeChannelzChild.bind(r)}),this.innerResolver=(0,IY.createResolver)(e,this.handleResolverResult.bind(this),n);let o={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new lve.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},o),this.backoffTimeout.unref()}handleResolverResult(e,r,n,i){var s,o;this.backoffTimeout.stop(),this.backoffTimeout.reset();let a=!0,c=null;if(n===null?c=this.defaultServiceConfig:n.ok?c=n.value:this.previousServiceConfig!==null?c=this.previousServiceConfig:(a=!1,this.handleResolutionFailure(n.error)),c!==null){let l=(s=c?.loadBalancingConfig)!==null&&s!==void 0?s:[],u=(0,ave.selectLbConfigFromList)(l,!0);u===null?(a=!1,this.handleResolutionFailure({code:oO.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new uve.Metadata})):a=this.childLoadBalancer.updateAddressList(e,u,Object.assign(Object.assign({},this.channelOptions),r),i)}return a&&this.onSuccessfulResolution(c,(o=r[IY.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&o!==void 0?o:Sve(c)),a}updateResolution(){this.innerResolver.updateResolution(),this.currentState===Vr.ConnectivityState.IDLE&&this.updateState(Vr.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,r,n){CY((0,pve.uriToString)(this.target)+" "+Vr.ConnectivityState[this.currentState]+" -> "+Vr.ConnectivityState[e]),e===Vr.ConnectivityState.IDLE&&(r=new Km.QueuePicker(this,r)),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}handleResolutionFailure(e){this.latestChildState===Vr.ConnectivityState.IDLE&&(this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new Km.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===Vr.ConnectivityState.IDLE||this.currentState===Vr.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,r){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=Vr.ConnectivityState.IDLE,this.latestChildPicker=new Km.QueuePicker(this),this.currentState=Vr.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Kv.ResolvingLoadBalancer=aO});var OY=b(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.recognizedOptions=void 0;Zm.channelOptionsEqual=Eve;Zm.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0};function Eve(t,e){let r=Object.keys(t).sort(),n=Object.keys(e).sort();if(r.length!==n.length)return!1;for(let i=0;i<r.length;i+=1)if(r[i]!==n[i]||t[r[i]]!==e[n[i]])return!1;return!0}});var qr=b(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.EndpointMap=void 0;ii.isTcpSubchannelAddress=Xm;ii.subchannelAddressEqual=Zv;ii.subchannelAddressToString=kY;ii.stringToSubchannelAddress=bve;ii.endpointEqual=Tve;ii.endpointToString=Ave;ii.endpointHasAddress=MY;var NY=J("net");function Xm(t){return"port"in t}function Zv(t,e){return!t&&!e?!0:!t||!e?!1:Xm(t)?Xm(e)&&t.host===e.host&&t.port===e.port:!Xm(e)&&t.path===e.path}function kY(t){return Xm(t)?(0,NY.isIPv6)(t.host)?"["+t.host+"]:"+t.port:t.host+":"+t.port:t.path}var vve=443;function bve(t,e){return(0,NY.isIP)(t)?{host:t,port:e??vve}:{path:t}}function Tve(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r=0;r<t.addresses.length;r++)if(!Zv(t.addresses[r],e.addresses[r]))return!1;return!0}function Ave(t){return"["+t.addresses.map(kY).join(", ")+"]"}function MY(t,e){for(let r of t.addresses)if(Zv(r,e))return!0;return!1}function Jm(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r of t.addresses){let n=!1;for(let i of e.addresses)if(Zv(r,i)){n=!0;break}if(!n)return!1}return!0}var cO=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let r of this.map)if(MY(r.key,e))return r.value}deleteMissing(e){let r=[];for(let n of this.map){let i=!1;for(let s of e)Jm(s,n.key)&&(i=!0);i||(r.push(n.value),this.map.delete(n))}return r}get(e){for(let r of this.map)if(Jm(e,r.key))return r.value}set(e,r){for(let n of this.map)if(Jm(e,n.key)){n.value=r;return}this.map.add({key:e,value:r})}delete(e){for(let r of this.map)if(Jm(e,r.key)){this.map.delete(r);return}}has(e){for(let r of this.map)if(Jm(e,r.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};ii.EndpointMap=cO});var LY={};ir(LY,{OrderedMap:()=>Nve});function ld(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");lO(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function xve(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Yc(){throw new RangeError("Iterator access denied!")}var lO,DY,wve,Rve,Ive,Cve,Pve,Ove,Vs,Nve,$Y=x(()=>{"use strict";lO=function(t,e){return lO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},lO(t,e)};DY=(function(){function t(e,r,n){n===void 0&&(n=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=r,this.l=n}return t.prototype.v=function(){var e=this,r=e.h.h===e;if(r&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(r)return e.h;for(var n=e.h;n.t===e;)e=n,n=e.h;e=n}return e},t.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var r=e.h;r.i===e;)e=r,r=e.h;return e.i!==r?r:e}},t.prototype.T=function(){var e=this.h,r=this.i,n=r.t;return e.h===this?e.h=r:e.t===this?e.t=r:e.i=r,r.h=e,r.t=this,this.h=r,this.i=n,n&&(n.h=this),r},t.prototype.I=function(){var e=this.h,r=this.t,n=r.i;return e.h===this?e.h=r:e.t===this?e.t=r:e.i=r,r.h=e,r.i=this,this.h=r,this.t=n,n&&(n.h=this),r},t})(),wve=(function(t){ld(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.O=1,r}return e.prototype.T=function(){var r=t.prototype.T.call(this);return this.M(),r.M(),r},e.prototype.I=function(){var r=t.prototype.I.call(this);return this.M(),r.M(),r},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e})(DY),Rve=(function(){function t(e){e===void 0&&(e=0),this.iteratorType=e}return t.prototype.equals=function(e){return this.C===e.C},t})(),Ive=(function(){function t(){this._=0}return Object.defineProperty(t.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),t.prototype.size=function(){return this._},t.prototype.empty=function(){return this._===0},t})(),Cve=(function(t){ld(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Ive);Pve=(function(t){ld(e,t);function e(r,n){r===void 0&&(r=function(s,o){return s<o?-1:s>o?1:0}),n===void 0&&(n=!1);var i=t.call(this)||this;return i.N=void 0,i.g=r,i.enableIndex=n,i.S=n?wve:DY,i.A=new i.S,i}return e.prototype.m=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);if(s<0)r=r.i;else if(s>0)i=r,r=r.t;else return r}return i},e.prototype.B=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);s<=0?r=r.i:(i=r,r=r.t)}return i},e.prototype.j=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);if(s<0)i=r,r=r.i;else if(s>0)r=r.t;else return r}return i},e.prototype.k=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);s<0?(i=r,r=r.i):r=r.t}return i},e.prototype.R=function(r){for(;;){var n=r.h;if(n===this.A)return;if(r.l===1){r.l=0;return}if(r===n.t){var i=n.i;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.T():n.T();else if(i.i&&i.i.l===1){i.l=n.l,n.l=0,i.i.l=0,n===this.N?this.N=n.T():n.T();return}else i.t&&i.t.l===1?(i.l=1,i.t.l=0,i.I()):(i.l=1,r=n)}else{var i=n.t;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.I():n.I();else if(i.t&&i.t.l===1){i.l=n.l,n.l=0,i.t.l=0,n===this.N?this.N=n.I():n.I();return}else i.i&&i.i.l===1?(i.l=1,i.i.l=0,i.T()):(i.l=1,r=n)}}},e.prototype.G=function(r){if(this._===1){this.clear();return}for(var n=r;n.t||n.i;){if(n.i)for(n=n.i;n.t;)n=n.t;else n=n.t;var i=r.u;r.u=n.u,n.u=i;var s=r.o;r.o=n.o,n.o=s,r=n}this.A.t===n?this.A.t=n.h:this.A.i===n&&(this.A.i=n.h),this.R(n);var o=n.h;if(n===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.h},e.prototype.P=function(r){for(var n=typeof r=="number"?r:void 0,i=typeof r=="function"?r:void 0,s=typeof r>"u"?[]:void 0,o=0,a=this.N,c=[];c.length||a;)if(a)c.push(a),a=a.t;else{if(a=c.pop(),o===n)return a;s&&s.push(a),i&&i(a,o,this),o+=1,a=a.i}return s},e.prototype.q=function(r){for(;;){var n=r.h;if(n.l===0)return;var i=n.h;if(n===i.t){var s=i.i;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,r=i;continue}else if(r===n.i){if(r.l=0,r.t&&(r.t.h=n),r.i&&(r.i.h=i),n.i=r.t,i.t=r.i,r.t=n,r.i=i,i===this.N)this.N=r,this.A.h=r;else{var o=i.h;o.t===i?o.t=r:o.i=r}r.h=i.h,n.h=r,i.h=r,i.l=1}else{n.l=0,i===this.N?this.N=i.I():i.I(),i.l=1;return}}else{var s=i.t;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,r=i;continue}else if(r===n.t){if(r.l=0,r.t&&(r.t.h=i),r.i&&(r.i.h=n),i.i=r.t,n.t=r.i,r.t=i,r.i=n,i===this.N)this.N=r,this.A.h=r;else{var o=i.h;o.t===i?o.t=r:o.i=r}r.h=i.h,n.h=r,i.h=r,i.l=1}else{n.l=0,i===this.N?this.N=i.T():i.T(),i.l=1;return}}this.enableIndex&&(n.M(),i.M(),r.M());return}},e.prototype.D=function(r,n,i){if(this.N===void 0)return this._+=1,this.N=new this.S(r,n,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var s,o=this.A.t,a=this.g(o.u,r);if(a===0)return o.o=n,this._;if(a>0)o.t=new this.S(r,n),o.t.h=o,s=o.t,this.A.t=s;else{var c=this.A.i,l=this.g(c.u,r);if(l===0)return c.o=n,this._;if(l<0)c.i=new this.S(r,n),c.i.h=c,s=c.i,this.A.i=s;else{if(i!==void 0){var u=i.C;if(u!==this.A){var d=this.g(u.u,r);if(d===0)return u.o=n,this._;if(d>0){var f=u.v(),p=this.g(f.u,r);if(p===0)return f.o=n,this._;p<0&&(s=new this.S(r,n),f.i===void 0?(f.i=s,s.h=f):(u.t=s,s.h=u))}}}if(s===void 0)for(s=this.N;;){var h=this.g(s.u,r);if(h>0){if(s.t===void 0){s.t=new this.S(r,n),s.t.h=s,s=s.t;break}s=s.t}else if(h<0){if(s.i===void 0){s.i=new this.S(r,n),s.i.h=s,s=s.i;break}s=s.i}else return s.o=n,this._}}}if(this.enableIndex)for(var m=s.h;m!==this.A;)m.O+=1,m=m.h;return this.q(s),this._+=1,this._},e.prototype.F=function(r,n){for(;r;){var i=this.g(r.u,n);if(i<0)r=r.i;else if(i>0)r=r.t;else return r}return r||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(r,n){var i=r.C;if(i===this.A&&Yc(),this._===1)return i.u=n,!0;var s=i.p().u;if(i===this.A.t)return this.g(s,n)>0?(i.u=n,!0):!1;var o=i.v().u;return i===this.A.i?this.g(o,n)<0?(i.u=n,!0):!1:this.g(o,n)>=0||this.g(s,n)<=0?!1:(i.u=n,!0)},e.prototype.eraseElementByPos=function(r){if(r<0||r>this._-1)throw new RangeError;var n=this.P(r);return this.G(n),this._},e.prototype.eraseElementByKey=function(r){if(this._===0)return!1;var n=this.F(this.N,r);return n===this.A?!1:(this.G(n),!0)},e.prototype.eraseElementByIterator=function(r){var n=r.C;n===this.A&&Yc();var i=n.i===void 0,s=r.iteratorType===0;return s?i&&r.next():(!i||n.t===void 0)&&r.next(),this.G(n),r},e.prototype.getHeight=function(){if(this._===0)return 0;function r(n){return n?Math.max(r(n.t),r(n.i))+1:0}return r(this.N)},e})(Cve),Ove=(function(t){ld(e,t);function e(r,n,i){var s=t.call(this,i)||this;return s.C=r,s.A=n,s.iteratorType===0?(s.pre=function(){return this.C===this.A.t&&Yc(),this.C=this.C.v(),this},s.next=function(){return this.C===this.A&&Yc(),this.C=this.C.p(),this}):(s.pre=function(){return this.C===this.A.i&&Yc(),this.C=this.C.p(),this},s.next=function(){return this.C===this.A&&Yc(),this.C=this.C.v(),this}),s}return Object.defineProperty(e.prototype,"index",{get:function(){var r=this.C,n=this.A.h;if(r===this.A)return n?n.O-1:0;var i=0;for(r.t&&(i+=r.t.O);r!==n;){var s=r.h;r===s.i&&(i+=1,s.t&&(i+=s.t.O)),r=s}return i},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(Rve),Vs=(function(t){ld(e,t);function e(r,n,i,s){var o=t.call(this,r,n,s)||this;return o.container=i,o}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&Yc();var r=this;return new Proxy([],{get:function(n,i){return i==="0"?r.C.u:i==="1"?r.C.o:(n[0]=r.C.u,n[1]=r.C.o,n[i])},set:function(n,i,s){if(i!=="1")throw new TypeError("prop must be 1");return r.C.o=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Ove),Nve=(function(t){ld(e,t);function e(r,n,i){r===void 0&&(r=[]);var s=t.call(this,n,i)||this,o=s;return r.forEach((function(a){o.setElement(a[0],a[1])})),s}return e.prototype.begin=function(){return new Vs(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new Vs(this.A,this.A,this)},e.prototype.rBegin=function(){return new Vs(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new Vs(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var r=this.A.t;return[r.u,r.o]}},e.prototype.back=function(){if(this._!==0){var r=this.A.i;return[r.u,r.o]}},e.prototype.lowerBound=function(r){var n=this.m(this.N,r);return new Vs(n,this.A,this)},e.prototype.upperBound=function(r){var n=this.B(this.N,r);return new Vs(n,this.A,this)},e.prototype.reverseLowerBound=function(r){var n=this.j(this.N,r);return new Vs(n,this.A,this)},e.prototype.reverseUpperBound=function(r){var n=this.k(this.N,r);return new Vs(n,this.A,this)},e.prototype.forEach=function(r){this.P((function(n,i,s){r([n.u,n.o],i,s)}))},e.prototype.setElement=function(r,n,i){return this.D(r,n,i)},e.prototype.getElementByPos=function(r){if(r<0||r>this._-1)throw new RangeError;var n=this.P(r);return[n.u,n.o]},e.prototype.find=function(r){var n=this.F(this.N,r);return new Vs(n,this.A,this)},e.prototype.getElementByKey=function(r){var n=this.F(this.N,r);return n.o},e.prototype.union=function(r){var n=this;return r.forEach((function(i){n.setElement(i[0],i[1])})),this._},e.prototype[Symbol.iterator]=function(){var r,n,i,s;return xve(this,(function(o){switch(o.label){case 0:r=this._,n=this.P(),i=0,o.label=1;case 1:return i<r?(s=n[i],[4,[s.u,s.o]]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2]}}))},e})(Pve)});var Xv=b(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});Jv.registerAdminService=kve;Jv.addAdminServicesToServer=Mve;var UY=[];function kve(t,e){UY.push({getServiceDefinition:t,getHandlers:e})}function Mve(t){for(let{getServiceDefinition:e,getHandlers:r}of UY)t.addService(e(),r())}});var FY=b(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.ClientDuplexStreamImpl=si.ClientWritableStreamImpl=si.ClientReadableStreamImpl=si.ClientUnaryCallImpl=void 0;si.callErrorFromStatus=Lve;var Dve=J("events"),hO=J("stream"),Qm=Be();function Lve(t,e){let r=`${t.code} ${Qm.Status[t.code]}: ${t.details}`,i=`${new Error(r).stack}
|
|
2
|
+
var a_e=Object.create;var FS=Object.defineProperty;var c_e=Object.getOwnPropertyDescriptor;var l_e=Object.getOwnPropertyNames;var u_e=Object.getPrototypeOf,d_e=Object.prototype.hasOwnProperty;var J=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ir=(t,e)=>{for(var r in e)FS(t,r,{get:e[r],enumerable:!0})},ZV=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l_e(e))!d_e.call(t,i)&&i!==r&&FS(t,i,{get:()=>e[i],enumerable:!(n=c_e(e,i))||n.enumerable});return t};var on=(t,e,r)=>(r=t!=null?a_e(u_e(t)):{},ZV(e||!t||!t.__esModule?FS(r,"default",{value:t,enumerable:!0}):r,t)),Ar=t=>ZV(FS({},"__esModule",{value:!0}),t);var Ns,zC=x(()=>{"use strict";Ns="1.9.1"});function f_e(t){let e=new Set([t]),r=new Set,n=t.match(JV);if(!n)return()=>!1;let i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(c){return c===t};function s(a){return r.add(a),!1}function o(a){return e.add(a),!0}return function(c){if(e.has(c))return!0;if(r.has(c))return!1;let l=c.match(JV);if(!l)return s(c);let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return u.prerelease!=null||i.major!==u.major?s(c):i.major===0?i.minor===u.minor&&i.patch<=u.patch?o(c):s(c):i.minor<=u.minor?o(c):s(c)}}var JV,XV,QV=x(()=>{"use strict";zC();JV=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;XV=f_e(Ns)});function $i(t,e,r,n=!1){var i;let s=cm[am]=(i=cm[am])!==null&&i!==void 0?i:{version:Ns};if(!n&&s[t]){let o=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return r.error(o.stack||o.message),!1}if(s.version!==Ns){let o=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${Ns}`);return r.error(o.stack||o.message),!1}return s[t]=e,r.debug(`@opentelemetry/api: Registered a global for ${t} v${Ns}.`),!0}function an(t){var e,r;let n=(e=cm[am])===null||e===void 0?void 0:e.version;if(!(!n||!XV(n)))return(r=cm[am])===null||r===void 0?void 0:r[t]}function Ui(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${Ns}.`);let r=cm[am];r&&delete r[t]}var p_e,am,cm,Nc=x(()=>{"use strict";zC();QV();p_e=Ns.split(".")[0],am=Symbol.for(`opentelemetry.js.api.${p_e}`),cm=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function lm(t,e,r){let n=an("diag");if(n)return n[t](e,...r)}var BS,eq=x(()=>{"use strict";Nc();BS=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return lm("debug",this._namespace,e)}error(...e){return lm("error",this._namespace,e)}info(...e){return lm("info",this._namespace,e)}warn(...e){return lm("warn",this._namespace,e)}verbose(...e){return lm("verbose",this._namespace,e)}}});var Ge,jS=x(()=>{"use strict";(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Ge||(Ge={}))});function tq(t,e){t<Ge.NONE?t=Ge.NONE:t>Ge.ALL&&(t=Ge.ALL),e=e||{};function r(n,i){let s=e[n];return typeof s=="function"&&t>=i?s.bind(e):function(){}}return{error:r("error",Ge.ERROR),warn:r("warn",Ge.WARN),info:r("info",Ge.INFO),debug:r("debug",Ge.DEBUG),verbose:r("verbose",Ge.VERBOSE)}}var rq=x(()=>{"use strict";jS()});var h_e,Ht,kc=x(()=>{"use strict";eq();rq();jS();Nc();h_e="diag",Ht=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(i){return function(...s){let o=an("diag");if(o)return o[i](...s)}}let r=this,n=(i,s={logLevel:Ge.INFO})=>{var o,a,c;if(i===r){let d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((o=d.stack)!==null&&o!==void 0?o:d.message),!1}typeof s=="number"&&(s={logLevel:s});let l=an("diag"),u=tq((a=s.logLevel)!==null&&a!==void 0?a:Ge.INFO,i);if(l&&!s.suppressOverrideMessage){let d=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";l.warn(`Current logger will be overwritten from ${d}`),u.warn(`Current logger will overwrite one already registered from ${d}`)}return $i("diag",u,r,!0)};r.setLogger=n,r.disable=()=>{Ui(h_e,r)},r.createComponentLogger=i=>new BS(i),r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}}});var zS,nq=x(()=>{"use strict";zS=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let r=this._entries.get(e);if(r)return Object.assign({},r)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,r){let n=new t(this._entries);return n._entries.set(e,r),n}removeEntry(e){let r=new t(this._entries);return r._entries.delete(e),r}removeEntries(...e){let r=new t(this._entries);for(let n of e)r._entries.delete(n);return r}clear(){return new t}}});var iq,sq=x(()=>{"use strict";iq=Symbol("BaggageEntryMetadata")});function oq(t={}){return new zS(new Map(Object.entries(t)))}function Nu(t){return typeof t!="string"&&(m_e.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:iq,toString(){return t}}}var m_e,GC=x(()=>{"use strict";kc();nq();sq();m_e=Ht.instance()});function mr(t){return Symbol.for(t)}var VC,GS,um=x(()=>{"use strict";VC=class t{constructor(e){let r=this;r._currentContext=e?new Map(e):new Map,r.getValue=n=>r._currentContext.get(n),r.setValue=(n,i)=>{let s=new t(r._currentContext);return s._currentContext.set(n,i),s},r.deleteValue=n=>{let i=new t(r._currentContext);return i._currentContext.delete(n),i}}},GS=new VC});var qC,HC,VS,aq=x(()=>{"use strict";qC=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],HC={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(HC[e]=console[e])}VS=class{constructor(){function e(r){return function(...n){let i=HC[r];if(typeof i!="function"&&(i=HC.log),typeof i!="function"&&console&&(i=console[r],typeof i!="function"&&(i=console.log)),typeof i=="function")return i.apply(console,n)}}for(let r=0;r<qC.length;r++)this[qC[r].n]=e(qC[r].c)}}});function Ko(){return t0}var WC,ku,YC,KC,ZC,JC,dm,XC,QC,e0,t0,g_e,__e,y_e,S_e,E_e,v_e,b_e,r0=x(()=>{"use strict";WC=class{constructor(){}createGauge(e,r){return __e}createHistogram(e,r){return y_e}createCounter(e,r){return g_e}createUpDownCounter(e,r){return S_e}createObservableGauge(e,r){return v_e}createObservableCounter(e,r){return E_e}createObservableUpDownCounter(e,r){return b_e}addBatchObservableCallback(e,r){}removeBatchObservableCallback(e){}},ku=class{},YC=class extends ku{add(e,r){}},KC=class extends ku{add(e,r){}},ZC=class extends ku{record(e,r){}},JC=class extends ku{record(e,r){}},dm=class{addCallback(e){}removeCallback(e){}},XC=class extends dm{},QC=class extends dm{},e0=class extends dm{},t0=new WC,g_e=new YC,__e=new ZC,y_e=new JC,S_e=new KC,E_e=new XC,v_e=new QC,b_e=new e0});var ks,cq=x(()=>{"use strict";(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(ks||(ks={}))});var qS,HS,n0=x(()=>{"use strict";qS={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},HS={set(t,e,r){t!=null&&(t[e]=r)}}});var WS,lq=x(()=>{"use strict";um();WS=class{active(){return GS}with(e,r,n,...i){return r.call(n,...i)}bind(e,r){return r}enable(){return this}disable(){return this}}});var i0,T_e,Fi,fm=x(()=>{"use strict";lq();Nc();kc();i0="context",T_e=new WS,Fi=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return $i(i0,e,Ht.instance())}active(){return this._getContextManager().active()}with(e,r,n,...i){return this._getContextManager().with(e,r,n,...i)}bind(e,r){return this._getContextManager().bind(e,r)}_getContextManager(){return an(i0)||T_e}disable(){this._getContextManager().disable(),Ui(i0,Ht.instance())}}});var Mt,s0=x(()=>{"use strict";(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Mt||(Mt={}))});var pm,hm,Mu,YS=x(()=>{"use strict";s0();pm="0000000000000000",hm="00000000000000000000000000000000",Mu={traceId:hm,spanId:pm,traceFlags:Mt.NONE}});var Bi,KS=x(()=>{"use strict";YS();Bi=class{constructor(e=Mu){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,r){return this}setAttributes(e){return this}addEvent(e,r){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,r){}}});function ZS(t){return t.getValue(o0)||void 0}function uq(){return ZS(Fi.getInstance().active())}function mm(t,e){return t.setValue(o0,e)}function dq(t){return t.deleteValue(o0)}function fq(t,e){return mm(t,new Bi(e))}function JS(t){var e;return(e=ZS(t))===null||e===void 0?void 0:e.spanContext()}var o0,a0=x(()=>{"use strict";um();KS();fm();o0=mr("OpenTelemetry Context Key SPAN")});function pq(t,e){if(typeof t!="string"||t.length!==e)return!1;let r=0;for(let n=0;n<t.length;n+=4)r+=(XS[t.charCodeAt(n)]|0)+(XS[t.charCodeAt(n+1)]|0)+(XS[t.charCodeAt(n+2)]|0)+(XS[t.charCodeAt(n+3)]|0);return r===e}function gm(t){return pq(t,32)&&t!==hm}function c0(t){return pq(t,16)&&t!==pm}function On(t){return gm(t.traceId)&&c0(t.spanId)}function hq(t){return new Bi(t)}var XS,QS=x(()=>{"use strict";YS();KS();XS=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 A_e(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var l0,Du,u0=x(()=>{"use strict";fm();a0();KS();QS();l0=Fi.getInstance(),Du=class{startSpan(e,r,n=l0.active()){if(!!r?.root)return new Bi;let s=n&&JS(n);return A_e(s)&&On(s)?new Bi(s):new Bi}startActiveSpan(e,r,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(s=r,a=n):(s=r,o=n,a=i);let c=o??l0.active(),l=this.startSpan(e,s,c),u=mm(c,l);return l0.with(u,a,void 0,l)}}});var x_e,Lu,d0=x(()=>{"use strict";u0();x_e=new Du,Lu=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}startSpan(e,r,n){return this._getTracer().startSpan(e,r,n)}startActiveSpan(e,r,n,i){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):x_e}}});var eE,mq=x(()=>{"use strict";u0();eE=class{getTracer(e,r,n){return new Du}}});var w_e,Mc,f0=x(()=>{"use strict";d0();mq();w_e=new eE,Mc=class{getTracer(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new Lu(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:w_e}setDelegate(e){this._delegate=e}getDelegateTracer(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)}}});var Dc,gq=x(()=>{"use strict";(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Dc||(Dc={}))});var ti,_q=x(()=>{"use strict";(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(ti||(ti={}))});var gr,yq=x(()=>{"use strict";(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(gr||(gr={}))});function Sq(t){return C_e.test(t)}function Eq(t){return P_e.test(t)&&!O_e.test(t)}var p0,R_e,I_e,C_e,P_e,O_e,vq=x(()=>{"use strict";p0="[_0-9a-z-*/]",R_e=`[a-z]${p0}{0,255}`,I_e=`[a-z0-9]${p0}{0,240}@[a-z]${p0}{0,13}`,C_e=new RegExp(`^(?:${R_e}|${I_e})$`),P_e=/^[ -~]{0,255}[!-~]$/,O_e=/,|=/});var bq,N_e,Tq,Aq,tE,xq=x(()=>{"use strict";vq();bq=32,N_e=512,Tq=",",Aq="=",tE=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,r)=>(e.push(r+Aq+this.get(r)),e),[]).join(Tq)}_parse(e){e.length>N_e||(this._internalState=e.split(Tq).reduceRight((r,n)=>{let i=n.trim(),s=i.indexOf(Aq);if(s!==-1){let o=i.slice(0,s),a=i.slice(s+1,n.length);Sq(o)&&Eq(a)&&r.set(o,a)}return r},new Map),this._internalState.size>bq&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,bq))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function wq(t){return new tE(t)}var Rq=x(()=>{"use strict";xq()});var at,Iq=x(()=>{"use strict";fm();at=Fi.getInstance()});var Q,Cq=x(()=>{"use strict";kc();Q=Ht.instance()});var h0,Pq,Oq=x(()=>{"use strict";r0();h0=class{getMeter(e,r,n){return t0}},Pq=new h0});var m0,rE,Nq=x(()=>{"use strict";Oq();Nc();kc();m0="metrics",rE=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return $i(m0,e,Ht.instance())}getMeterProvider(){return an(m0)||Pq}getMeter(e,r,n){return this.getMeterProvider().getMeter(e,r,n)}disable(){Ui(m0,Ht.instance())}}});var _m,kq=x(()=>{"use strict";Nq();_m=rE.getInstance()});var nE,Mq=x(()=>{"use strict";nE=class{inject(e,r){}extract(e,r){return e}fields(){return[]}}});function _0(t){return t.getValue(g0)||void 0}function Dq(){return _0(Fi.getInstance().active())}function Lq(t,e){return t.setValue(g0,e)}function $q(t){return t.deleteValue(g0)}var g0,Uq=x(()=>{"use strict";fm();um();g0=mr("OpenTelemetry Baggage Key")});var y0,k_e,iE,Fq=x(()=>{"use strict";Nc();Mq();n0();Uq();GC();kc();y0="propagation",k_e=new nE,iE=class t{constructor(){this.createBaggage=oq,this.getBaggage=_0,this.getActiveBaggage=Dq,this.setBaggage=Lq,this.deleteBaggage=$q}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return $i(y0,e,Ht.instance())}inject(e,r,n=HS){return this._getGlobalPropagator().inject(e,r,n)}extract(e,r,n=qS){return this._getGlobalPropagator().extract(e,r,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Ui(y0,Ht.instance())}_getGlobalPropagator(){return an(y0)||k_e}}});var xr,Bq=x(()=>{"use strict";Fq();xr=iE.getInstance()});var S0,sE,jq=x(()=>{"use strict";Nc();f0();QS();a0();kc();S0="trace",sE=class t{constructor(){this._proxyTracerProvider=new Mc,this.wrapSpanContext=hq,this.isSpanContextValid=On,this.deleteSpan=dq,this.getSpan=ZS,this.getActiveSpan=uq,this.getSpanContext=JS,this.setSpan=mm,this.setSpanContext=fq}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let r=$i(S0,this._proxyTracerProvider,Ht.instance());return r&&this._proxyTracerProvider.setDelegate(e),r}getTracerProvider(){return an(S0)||this._proxyTracerProvider}getTracer(e,r){return this.getTracerProvider().getTracer(e,r)}disable(){Ui(S0,Ht.instance()),this._proxyTracerProvider=new Mc}}});var ft,zq=x(()=>{"use strict";jq();ft=sE.getInstance()});var Zo={};ir(Zo,{DiagConsoleLogger:()=>VS,DiagLogLevel:()=>Ge,INVALID_SPANID:()=>pm,INVALID_SPAN_CONTEXT:()=>Mu,INVALID_TRACEID:()=>hm,ProxyTracer:()=>Lu,ProxyTracerProvider:()=>Mc,ROOT_CONTEXT:()=>GS,SamplingDecision:()=>Dc,SpanKind:()=>ti,SpanStatusCode:()=>gr,TraceFlags:()=>Mt,ValueType:()=>ks,baggageEntryMetadataFromString:()=>Nu,context:()=>at,createContextKey:()=>mr,createNoopMeter:()=>Ko,createTraceState:()=>wq,default:()=>M_e,defaultTextMapGetter:()=>qS,defaultTextMapSetter:()=>HS,diag:()=>Q,isSpanContextValid:()=>On,isValidSpanId:()=>c0,isValidTraceId:()=>gm,metrics:()=>_m,propagation:()=>xr,trace:()=>ft});var M_e,be=x(()=>{"use strict";GC();um();aq();jS();r0();cq();n0();d0();f0();gq();_q();yq();s0();Rq();QS();YS();Iq();Cq();kq();Bq();zq();M_e={context:at,diag:Q,metrics:_m,propagation:xr,trace:ft}});var qq=x(()=>{"use strict"});var Hq=x(()=>{"use strict";qq()});var Wq=x(()=>{"use strict"});var Yq=x(()=>{"use strict";Wq()});var E0,oE,Kq,aE,Zq,Ds,$u,Ls,$s,Jq=x(()=>{"use strict";E0="error.type",oE="exception.message",Kq="exception.stacktrace",aE="exception.type",Zq="service.name",Ds="telemetry.sdk.language",$u="nodejs",Ls="telemetry.sdk.name",$s="telemetry.sdk.version"});var Xq=x(()=>{"use strict"});var Qq=x(()=>{"use strict"});var Lc=x(()=>{"use strict";Hq();Yq();Jq();Xq();Qq()});function dE(t){return t.setValue(w0,!0)}function o6(t){return t.deleteValue(w0)}function Bu(t){return t.getValue(w0)===!0}var w0,vm=x(()=>{"use strict";be();w0=mr("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var fE,a6=x(()=>{"use strict";fE="baggage"});function c6(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function l6(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function R0(t){if(!t)return;let e=t.indexOf(";"),r=e===-1?t:t.substring(0,e),n=r.indexOf("=");if(n<=0)return;let i=r.substring(0,n).trim(),s=r.substring(n+1).trim();if(!i||!s)return;let o,a;try{o=decodeURIComponent(i),a=decodeURIComponent(s)}catch{return}let c;if(e!==-1&&e<t.length-1){let l=t.substring(e+1);c=Nu(l)}return{key:o,value:a,metadata:c}}function $c(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=R0(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var I0=x(()=>{"use strict";be()});var hE,u6=x(()=>{"use strict";be();vm();a6();I0();hE=class{inject(e,r,n){let i=xr.getBaggage(e);if(!i||Bu(e))return;let s=l6(i).filter(a=>a.length<=4096).slice(0,180),o=c6(s);o.length>0&&n.set(r,fE,o)}extract(e,r,n){let i=n.get(r,fE),s=Array.isArray(i)?i.join(","):i;if(!s)return e;let o={};return s.length===0||(s.split(",").forEach(c=>{let l=R0(c);if(l){let u={value:l.value};l.metadata&&(u.metadata=l.metadata),o[l.key]=u}}),Object.entries(o).length===0)?e:xr.setBaggage(e,xr.createBaggage(o))}fields(){return[fE]}}});var mE,d6=x(()=>{"use strict";mE=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function f6(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!j_e(r)){Q.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!C0(n)){Q.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function j_e(t){return typeof t=="string"&&t!==""}function C0(t){return t==null?!0:Array.isArray(t)?z_e(t):p6(typeof t)}function z_e(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(p6(n)){e=n;continue}return!1}return!1}}return!0}function p6(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var h6=x(()=>{"use strict";be()});function gE(){return t=>{Q.error(G_e(t))}}function G_e(t){return typeof t=="string"?t:JSON.stringify(V_e(t))}function V_e(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}var P0=x(()=>{"use strict";be()});function g6(t){m6=t}function _6(t){try{m6(t)}catch{}}var m6,y6=x(()=>{"use strict";P0();m6=gE()});import{inspect as S6}from"util";function ju(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Q.warn(`Unknown value ${S6(e)} for ${t}, expected a number, using defaults`);return}return r}function Gr(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function _E(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Q.warn(`Unknown value ${S6(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function yE(t){return Gr(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var E6=x(()=>{"use strict";be()});var SE,v6=x(()=>{"use strict";SE=globalThis});var b6,T6=x(()=>{"use strict";b6="2.7.1"});var A6,x6=x(()=>{"use strict";A6="process.runtime.name"});var EE,w6=x(()=>{"use strict";T6();Lc();x6();EE={[Ls]:"opentelemetry",[A6]:"node",[Ds]:$u,[$s]:b6}});var Jo,R6=x(()=>{"use strict";E6();v6();w6();Jo=performance});var O0=x(()=>{"use strict";R6()});function zu(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*H_e);return[r,n]}function C6(){return Jo.timeOrigin}function N0(t){let e=zu(Jo.timeOrigin),r=zu(typeof t=="number"?t:Jo.now());return k0(e,r)}function P6(t){if(TE(t))return t;if(typeof t=="number")return t<Jo.timeOrigin?N0(t):zu(t);if(t instanceof Date)return zu(t.getTime());throw TypeError("Invalid input type")}function O6(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=vE),[r,n]}function N6(t){let e=I6,r=`${"0".repeat(e)}${t[1]}Z`,n=r.substring(r.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",n)}function bE(t){return t[0]*vE+t[1]}function k6(t){return t[0]*1e3+t[1]/1e6}function M6(t){return t[0]*1e6+t[1]/1e3}function TE(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function D6(t){return TE(t)||typeof t=="number"||t instanceof Date}function k0(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=vE&&(r[1]-=vE,r[0]+=1),r}var I6,q_e,H_e,vE,L6=x(()=>{"use strict";O0();I6=9,q_e=6,H_e=Math.pow(10,q_e),vE=Math.pow(10,I6)});function $6(t){typeof t!="number"&&t.unref()}var U6=x(()=>{"use strict"});var wr,F6=x(()=>{"use strict";(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(wr||(wr={}))});var AE,B6=x(()=>{"use strict";be();AE=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let r=new Set;for(let n of this._propagators){let i=typeof n.fields=="function"?n.fields():[];for(let s of i)r.add(s)}this._fields=Array.from(r)}inject(e,r,n){for(let i of this._propagators)try{i.inject(e,r,n)}catch(s){Q.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,r,n)}catch(o){Q.warn(`Failed to extract with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}}});function D0(t){return K_e.test(t)}function L0(t){return Z_e.test(t)&&!J_e.test(t)}var M0,W_e,Y_e,K_e,Z_e,J_e,j6=x(()=>{"use strict";M0="[_0-9a-z-*/]",W_e=`[a-z]${M0}{0,255}`,Y_e=`[a-z0-9]${M0}{0,240}@[a-z]${M0}{0,13}`,K_e=new RegExp(`^(?:${W_e}|${Y_e})$`),Z_e=/^[ -~]{0,255}[!-~]$/,J_e=/,|=/});var X_e,z6,G6,V6,Gu,$0=x(()=>{"use strict";j6();X_e=32,z6=512,G6=",",V6="=",Gu=class t{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e=="string"?e:"",this._length=this._rawTraceState.length}set(e,r){if(!D0(e)||!L0(r))return this;let n=this._getState(),i=n.get(e),s=this._length;if(typeof i=="string"?s+=r.length-i.length:s+=e.length+r.length+(n.size>0?2:1),s>z6)return this;let o=new Map(n);return o.delete(e),o.set(e,r),this._fromState(o,s)}unset(e){let r=this._getState(),n=r.get(e);if(typeof n!="string")return this;let i=this._length-(e.length+n.length+1);r.size>1&&(i=i-1);let s=new Map(r);return s.delete(e),this._fromState(s,i)}get(e){return this._getState().get(e)}serialize(){let e="",r=0;for(let n of this._getState())r>0&&(e=G6+e),e=`${n[0]}${V6}${n[1]}`+e,r++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(G6),r=new Map,n=0;for(let i of e){let s=i.trim(),o=s.indexOf(V6);if(o===-1)continue;let a=s.slice(0,o),c=s.slice(o+1);if(!D0(a)||!L0(c))continue;let l=n+s.length+(r.size>0?1:0);if(!(l>z6)&&(r.set(a,c),n=l,r.size>=X_e))break}return this._length=n,this._internalState=new Map(Array.from(r.entries()).reverse()),this._internalState}_fromState(e,r){let n=Object.create(t.prototype);return n._internalState=e,n._length=r,n}}});function U0(t){let e=iye.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var bm,Tm,Q_e,eye,tye,rye,nye,iye,Us,q6=x(()=>{"use strict";be();vm();$0();bm="traceparent",Tm="tracestate",Q_e="00",eye="(?!ff)[\\da-f]{2}",tye="(?![0]{32})[\\da-f]{32}",rye="(?![0]{16})[\\da-f]{16}",nye="[\\da-f]{2}",iye=new RegExp(`^\\s?(${eye})-(${tye})-(${rye})-(${nye})(-.*)?\\s?$`);Us=class{inject(e,r,n){let i=ft.getSpanContext(e);if(!i||Bu(e)||!On(i))return;let s=`${Q_e}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||Mt.NONE).toString(16)}`;n.set(r,bm,s),i.traceState&&n.set(r,Tm,i.traceState.serialize())}extract(e,r,n){let i=n.get(r,bm);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=U0(s);if(!o)return e;o.isRemote=!0;let a=n.get(r,Tm);if(a){let c=Array.isArray(a)?a.join(","):a;o.traceState=new Gu(typeof c=="string"?c:void 0)}return ft.setSpanContext(e,o)}fields(){return[bm,Tm]}}});function H6(t,e){return t.setValue(F0,e)}function W6(t){return t.deleteValue(F0)}function Y6(t){return t.getValue(F0)}var F0,xE,K6=x(()=>{"use strict";be();F0=mr("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(xE||(xE={}))});function B0(t){if(!dye(t)||fye(t)!==sye)return!1;let e=uye(t);if(e===null)return!0;let r=X6.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Z6.call(r)===lye}function dye(t){return t!=null&&typeof t=="object"}function fye(t){return t==null?t===void 0?aye:oye:Uc&&Uc in Object(t)?pye(t):hye(t)}function pye(t){let e=X6.call(t,Uc),r=t[Uc],n=!1;try{t[Uc]=void 0,n=!0}catch{}let i=Q6.call(t);return n&&(e?t[Uc]=r:delete t[Uc]),i}function hye(t){return Q6.call(t)}var sye,oye,aye,cye,Z6,lye,uye,J6,X6,Uc,Q6,eH=x(()=>{"use strict";sye="[object Object]",oye="[object Null]",aye="[object Undefined]",cye=Function.prototype,Z6=cye.toString,lye=Z6.call(Object),uye=Object.getPrototypeOf,J6=Object.prototype,X6=J6.hasOwnProperty,Uc=Symbol?Symbol.toStringTag:void 0,Q6=J6.toString});function rH(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=nH(e,t.shift(),0,r);return e}function j0(t){return RE(t)?t.slice():t}function nH(t,e,r=0,n){let i;if(!(r>mye)){if(r++,wE(t)||wE(e)||iH(e))i=j0(e);else if(RE(t)){if(i=t.slice(),RE(e))for(let s=0,o=e.length;s<o;s++)i.push(j0(e[s]));else if(Am(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];c==="__proto__"||c==="constructor"||c==="prototype"||(i[c]=j0(e[c]))}}}else if(Am(t))if(Am(e)){if(!gye(t,e))return e;i=Object.assign({},t);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let l=e[c];if(wE(l))typeof l>"u"?delete i[c]:i[c]=l;else{let u=i[c],d=l;if(tH(t,c,n)||tH(e,c,n))delete i[c];else{if(Am(u)&&Am(d)){let f=n.get(u)||[],p=n.get(d)||[];f.push({obj:t,key:c}),p.push({obj:e,key:c}),n.set(u,f),n.set(d,p)}i[c]=nH(i[c],l,r,n)}}}}else i=e;return i}}function tH(t,e,r){let n=r.get(t[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===t)return!0}return!1}function RE(t){return Array.isArray(t)}function iH(t){return typeof t=="function"}function Am(t){return!wE(t)&&!RE(t)&&!iH(t)&&typeof t=="object"}function wE(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function gye(t,e){return!(!B0(t)||!B0(e))}var mye,sH=x(()=>{"use strict";eH();mye=20});function oH(t,e){let r,n=new Promise(function(s,o){r=setTimeout(function(){o(new xm("Operation timed out."))},e)});return Promise.race([t,n]).then(i=>(clearTimeout(r),i),i=>{throw clearTimeout(r),i})}var xm,aH=x(()=>{"use strict";xm=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});function z0(t,e){return typeof e=="string"?t===e:!!t.match(e)}function cH(t,e){if(!e)return!1;for(let r of e)if(z0(t,r))return!0;return!1}var lH=x(()=>{"use strict"});var IE,uH=x(()=>{"use strict";IE=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vu,dH=x(()=>{"use strict";uH();Vu=class{_isCalled=!1;_deferred=new IE;_callback;_that;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function pH(t){if(t==null)return;let e=fH[t.toUpperCase()];return e??(Q.warn(`Unknown log level "${t}", expected one of ${Object.keys(fH)}, using default`),Ge.INFO)}var fH,hH=x(()=>{"use strict";be();fH={ALL:Ge.ALL,VERBOSE:Ge.VERBOSE,DEBUG:Ge.DEBUG,INFO:Ge.INFO,WARN:Ge.WARN,ERROR:Ge.ERROR,NONE:Ge.NONE}});function mH(t,e){return new Promise(r=>{at.with(dE(at.active()),()=>{t.export(e,r)})})}var gH=x(()=>{"use strict";be();vm()});var _H={};ir(_H,{AnchoredClock:()=>mE,BindOnceFuture:()=>Vu,CompositePropagator:()=>AE,ExportResultCode:()=>wr,RPCType:()=>xE,SDK_INFO:()=>EE,TRACE_PARENT_HEADER:()=>bm,TRACE_STATE_HEADER:()=>Tm,TimeoutError:()=>xm,TraceState:()=>Gu,W3CBaggagePropagator:()=>hE,W3CTraceContextPropagator:()=>Us,_globalThis:()=>SE,addHrTimes:()=>k0,callWithTimeout:()=>oH,deleteRPCMetadata:()=>W6,diagLogLevelFromString:()=>pH,getBooleanFromEnv:()=>_E,getNumberFromEnv:()=>ju,getRPCMetadata:()=>Y6,getStringFromEnv:()=>Gr,getStringListFromEnv:()=>yE,getTimeOrigin:()=>C6,globalErrorHandler:()=>_6,hrTime:()=>N0,hrTimeDuration:()=>O6,hrTimeToMicroseconds:()=>M6,hrTimeToMilliseconds:()=>k6,hrTimeToNanoseconds:()=>bE,hrTimeToTimeStamp:()=>N6,internal:()=>_ye,isAttributeValue:()=>C0,isTimeInput:()=>D6,isTimeInputHrTime:()=>TE,isTracingSuppressed:()=>Bu,isUrlIgnored:()=>cH,loggingErrorHandler:()=>gE,merge:()=>rH,millisToHrTime:()=>zu,otperformance:()=>Jo,parseKeyPairsIntoRecord:()=>$c,parseTraceParent:()=>U0,sanitizeAttributes:()=>f6,setGlobalErrorHandler:()=>g6,setRPCMetadata:()=>H6,suppressTracing:()=>dE,timeInputToHrTime:()=>P6,unrefTimer:()=>$6,unsuppressTracing:()=>o6,urlMatches:()=>z0});var _ye,Fs=x(()=>{"use strict";u6();d6();h6();y6();P0();L6();U6();F6();I0();O0();B6();q6();K6();vm();$0();sH();aH();lH();dH();hH();gH();_ye={_export:mH}});var V0=b(CE=>{"use strict";Object.defineProperty(CE,"__esModule",{value:!0});CE.AbstractAsyncHooksContextManager=void 0;var yye=J("events"),Sye=["addListener","on","once","prependListener","prependOnceListener"],G0=class{bind(e,r){return r instanceof yye.EventEmitter?this._bindEventEmitter(e,r):typeof r=="function"?this._bindFunction(e,r):r}_bindFunction(e,r){let n=this,i=function(...s){return n.with(e,()=>r.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i}_bindEventEmitter(e,r){return this._getPatchMap(r)!==void 0||(this._createPatchMap(r),Sye.forEach(i=>{r[i]!==void 0&&(r[i]=this._patchAddListener(r,r[i],e))}),typeof r.removeListener=="function"&&(r.removeListener=this._patchRemoveListener(r,r.removeListener)),typeof r.off=="function"&&(r.off=this._patchRemoveListener(r,r.off)),typeof r.removeAllListeners=="function"&&(r.removeAllListeners=this._patchRemoveAllListeners(r,r.removeAllListeners))),r}_patchRemoveListener(e,r){let n=this;return function(i,s){let o=n._getPatchMap(e)?.[i];if(o===void 0)return r.call(this,i,s);let a=o.get(s);return r.call(this,i,a||s)}}_patchRemoveAllListeners(e,r){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),r.apply(this,arguments)}}_patchAddListener(e,r,n){let i=this;return function(s,o){if(i._wrapped)return r.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let c=a[s];c===void 0&&(c=new WeakMap,a[s]=c);let l=i.bind(n,o);c.set(o,l),i._wrapped=!0;try{return r.call(this,s,l)}finally{i._wrapped=!1}}}_createPatchMap(e){let r=Object.create(null);return e[this._kOtListeners]=r,r}_getPatchMap(e){return e[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1};CE.AbstractAsyncHooksContextManager=G0});var yH=b(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});PE.AsyncHooksContextManager=void 0;var Eye=(be(),Ar(Zo)),vye=J("async_hooks"),bye=V0(),q0=class extends bye.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super(),this._asyncHook=vye.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??Eye.ROOT_CONTEXT}with(e,r,n,...i){this._enterContext(e);try{return r.call(n,...i)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,r){if(r==="TIMERWRAP")return;let n=this._stack[this._stack.length-1];n!==void 0&&this._contexts.set(e,n)}_destroy(e){this._contexts.delete(e)}_before(e){let r=this._contexts.get(e);r!==void 0&&this._enterContext(r)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};PE.AsyncHooksContextManager=q0});var SH=b(OE=>{"use strict";Object.defineProperty(OE,"__esModule",{value:!0});OE.AsyncLocalStorageContextManager=void 0;var Tye=(be(),Ar(Zo)),Aye=J("async_hooks"),xye=V0(),H0=class extends xye.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super(),this._asyncLocalStorage=new Aye.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??Tye.ROOT_CONTEXT}with(e,r,n,...i){let s=n==null?r:r.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};OE.AsyncLocalStorageContextManager=H0});var EH=b(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.AsyncLocalStorageContextManager=qu.AsyncHooksContextManager=void 0;var wye=yH();Object.defineProperty(qu,"AsyncHooksContextManager",{enumerable:!0,get:function(){return wye.AsyncHooksContextManager}});var Rye=SH();Object.defineProperty(qu,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return Rye.AsyncLocalStorageContextManager}})});function NE(t){return t.setValue(W0,!0)}function vH(t){return t.deleteValue(W0)}function Hu(t){return t.getValue(W0)===!0}var W0,wm=x(()=>{"use strict";be();W0=mr("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var kE,bH=x(()=>{"use strict";kE="baggage"});function wH(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function RH(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function IH(t){if(!t)return;let e=t.indexOf(";"),r=e===-1?t:t.substring(0,e),n=r.indexOf("=");if(n<=0)return;let i=r.substring(0,n).trim(),s=r.substring(n+1).trim();if(!i||!s)return;let o,a;try{o=decodeURIComponent(i),a=decodeURIComponent(s)}catch{return}let c;if(e!==-1&&e<t.length-1){let l=t.substring(e+1);c=Nu(l)}return{key:o,value:a,metadata:c}}function Y0(t,e,r,n){let i=0;for(;i<t.length&&r<180;){let s=t.indexOf(",",i),o=s===-1?t.length:s,a=o-i;if(a<=4096){let c=IH(t.substring(i,o));if(c){let l=(r===0?0:1)+a;if(n+l>8192)break;e[c.key]=c.metadata?{value:c.value,metadata:c.metadata}:{value:c.value},r++,n+=l}}if(s===-1)break;i=s+1}return[r,n]}function CH(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=IH(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var K0=x(()=>{"use strict";be()});var ME,PH=x(()=>{"use strict";be();wm();bH();K0();ME=class{inject(e,r,n){let i=xr.getBaggage(e);if(!i||Hu(e))return;let s=RH(i).filter(a=>a.length<=4096).slice(0,180),o=wH(s);o.length>0&&n.set(r,kE,o)}extract(e,r,n){let i=n.get(r,kE);if(!i)return e;let s={},o=0,a=0;if(Array.isArray(i))for(let c=0;c<i.length;c++)[o,a]=Y0(i[c],s,o,a);else[o]=Y0(i,s,o,a);return o===0?e:xr.setBaggage(e,xr.createBaggage(s))}fields(){return[kE]}}});var DE,OH=x(()=>{"use strict";DE=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function NH(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!Pye(r)){Q.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!Z0(n)){Q.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function Pye(t){return typeof t=="string"&&t!==""}function Z0(t){return t==null?!0:Array.isArray(t)?Oye(t):kH(typeof t)}function Oye(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(kH(n)){e=n;continue}return!1}return!1}}return!0}function kH(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var MH=x(()=>{"use strict";be()});function LE(){return t=>{Q.error(Nye(t))}}function Nye(t){return typeof t=="string"?t:JSON.stringify(kye(t))}function kye(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}var J0=x(()=>{"use strict";be()});function LH(t){DH=t}function $H(t){try{DH(t)}catch{}}var DH,UH=x(()=>{"use strict";J0();DH=LE()});import{inspect as FH}from"util";function Rt(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Q.warn(`Unknown value ${FH(e)} for ${t}, expected a number, using defaults`);return}return r}function Fc(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function $E(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Q.warn(`Unknown value ${FH(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function UE(t){return Fc(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var BH=x(()=>{"use strict";be()});var FE,jH=x(()=>{"use strict";FE=globalThis});var zH,GH=x(()=>{"use strict";zH="2.9.0"});var VH,qH=x(()=>{"use strict";VH="process.runtime.name"});var BE,HH=x(()=>{"use strict";GH();Lc();qH();BE={[Ls]:"opentelemetry",[VH]:"node",[Ds]:$u,[$s]:zH}});var Xo,WH=x(()=>{"use strict";BH();jH();HH();Xo=performance});var X0=x(()=>{"use strict";WH()});function Wu(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Dye);return[r,n]}function KH(){return Xo.timeOrigin}function Q0(t){let e=Wu(Xo.timeOrigin),r=Wu(typeof t=="number"?t:Xo.now());return eP(e,r)}function ZH(t){if(jE(t))return t;if(typeof t=="number")return t<Xo.timeOrigin/2?Q0(t):Wu(t);if(t instanceof Date)return Wu(t.getTime());throw TypeError("Invalid input type")}function JH(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=Rm),[r,n]}function XH(t){let e=YH,r=`${"0".repeat(e)}${t[1]}Z`,n=r.substring(r.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",n)}function QH(t){return t[0]*Rm+t[1]}function e3(t){return t[0]*1e6+t[1]/1e3}function t3(t){return t[0]*1e3+t[1]/1e6}function r3(t){return t[0]+t[1]/Rm}function jE(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function n3(t){return jE(t)||typeof t=="number"||t instanceof Date}function eP(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=Rm&&(r[1]-=Rm,r[0]+=1),r}var YH,Mye,Dye,Rm,i3=x(()=>{"use strict";X0();YH=9,Mye=6,Dye=Math.pow(10,Mye),Rm=Math.pow(10,YH)});function s3(t){typeof t!="number"&&t.unref()}var o3=x(()=>{"use strict"});var zE,a3=x(()=>{"use strict";(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(zE||(zE={}))});var GE,c3=x(()=>{"use strict";be();GE=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let r=new Set;for(let n of this._propagators){let i=typeof n.fields=="function"?n.fields():[];for(let s of i)r.add(s)}this._fields=Array.from(r)}inject(e,r,n){for(let i of this._propagators)try{i.inject(e,r,n)}catch(s){Q.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,r,n)}catch(o){Q.warn(`Failed to extract with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}}});function rP(t){return Uye.test(t)}function nP(t){return Fye.test(t)&&!Bye.test(t)}var tP,Lye,$ye,Uye,Fye,Bye,l3=x(()=>{"use strict";tP="[_0-9a-z-*/]",Lye=`[a-z]${tP}{0,255}`,$ye=`[a-z0-9]${tP}{0,240}@[a-z]${tP}{0,13}`,Uye=new RegExp(`^(?:${Lye}|${$ye})$`),Fye=/^[ -~]{0,255}[!-~]$/,Bye=/,|=/});var jye,u3,d3,f3,Yu,iP=x(()=>{"use strict";l3();jye=32,u3=512,d3=",",f3="=",Yu=class t{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e=="string"?e:"",this._length=this._rawTraceState.length}set(e,r){if(!rP(e)||!nP(r))return this;let n=this._getState(),i=n.get(e),s=this._length;if(typeof i=="string"?s+=r.length-i.length:s+=e.length+r.length+(n.size>0?2:1),s>u3)return this;let o=new Map(n);return o.delete(e),o.set(e,r),this._fromState(o,s)}unset(e){let r=this._getState(),n=r.get(e);if(typeof n!="string")return this;let i=this._length-(e.length+n.length+1);r.size>1&&(i=i-1);let s=new Map(r);return s.delete(e),this._fromState(s,i)}get(e){return this._getState().get(e)}serialize(){let e="",r=0;for(let n of this._getState())r>0&&(e=d3+e),e=`${n[0]}${f3}${n[1]}`+e,r++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(d3),r=new Map,n=0;for(let i of e){let s=i.trim(),o=s.indexOf(f3);if(o===-1)continue;let a=s.slice(0,o),c=s.slice(o+1);if(!rP(a)||!nP(c))continue;let l=n+s.length+(r.size>0?1:0);if(!(l>u3)&&(r.set(a,c),n=l,r.size>=jye))break}return this._length=n,this._internalState=new Map(Array.from(r.entries()).reverse()),this._internalState}_fromState(e,r){let n=Object.create(t.prototype);return n._internalState=e,n._length=r,n}}});function sP(t){let e=Wye.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var Im,Cm,zye,Gye,Vye,qye,Hye,Wye,VE,p3=x(()=>{"use strict";be();wm();iP();Im="traceparent",Cm="tracestate",zye="00",Gye="(?!ff)[\\da-f]{2}",Vye="(?![0]{32})[\\da-f]{32}",qye="(?![0]{16})[\\da-f]{16}",Hye="[\\da-f]{2}",Wye=new RegExp(`^\\s?(${Gye})-(${Vye})-(${qye})-(${Hye})(-.*)?\\s?$`);VE=class{inject(e,r,n){let i=ft.getSpanContext(e);if(!i||Hu(e)||!On(i))return;let s=`${zye}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||Mt.NONE).toString(16)}`;n.set(r,Im,s),i.traceState&&n.set(r,Cm,i.traceState.serialize())}extract(e,r,n){let i=n.get(r,Im);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=sP(s);if(!o)return e;o.isRemote=!0;let a=n.get(r,Cm);if(a){let c=Array.isArray(a)?a.join(","):a;o.traceState=new Yu(typeof c=="string"?c:void 0)}return ft.setSpanContext(e,o)}fields(){return[Im,Cm]}}});function h3(t,e){return t.setValue(oP,e)}function m3(t){return t.deleteValue(oP)}function g3(t){return t.getValue(oP)}var oP,qE,_3=x(()=>{"use strict";be();oP=mr("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(qE||(qE={}))});function aP(t){if(!eSe(t)||tSe(t)!==Yye)return!1;let e=Qye(t);if(e===null)return!0;let r=E3.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&y3.call(r)===Xye}function eSe(t){return t!=null&&typeof t=="object"}function tSe(t){return t==null?t===void 0?Zye:Kye:Bc&&Bc in Object(t)?rSe(t):nSe(t)}function rSe(t){let e=E3.call(t,Bc),r=t[Bc],n=!1;try{t[Bc]=void 0,n=!0}catch{}let i=v3.call(t);return n&&(e?t[Bc]=r:delete t[Bc]),i}function nSe(t){return v3.call(t)}var Yye,Kye,Zye,Jye,y3,Xye,Qye,S3,E3,Bc,v3,b3=x(()=>{"use strict";Yye="[object Object]",Kye="[object Null]",Zye="[object Undefined]",Jye=Function.prototype,y3=Jye.toString,Xye=y3.call(Object),Qye=Object.getPrototypeOf,S3=Object.prototype,E3=S3.hasOwnProperty,Bc=Symbol?Symbol.toStringTag:void 0,v3=S3.toString});function YE(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=A3(e,t.shift(),0,r);return e}function cP(t){return WE(t)?t.slice():t}function A3(t,e,r=0,n){let i;if(!(r>iSe)){if(r++,HE(t)||HE(e)||x3(e))i=cP(e);else if(WE(t)){if(i=t.slice(),WE(e))for(let s=0,o=e.length;s<o;s++)i.push(cP(e[s]));else if(Pm(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];c==="__proto__"||c==="constructor"||c==="prototype"||(i[c]=cP(e[c]))}}}else if(Pm(t))if(Pm(e)){if(!sSe(t,e))return e;i=Object.assign({},t);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let l=e[c];if(HE(l))typeof l>"u"?delete i[c]:i[c]=l;else{let u=i[c],d=l;if(T3(t,c,n)||T3(e,c,n))delete i[c];else{if(Pm(u)&&Pm(d)){let f=n.get(u)||[],p=n.get(d)||[];f.push({obj:t,key:c}),p.push({obj:e,key:c}),n.set(u,f),n.set(d,p)}i[c]=A3(i[c],l,r,n)}}}}else i=e;return i}}function T3(t,e,r){let n=r.get(t[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===t)return!0}return!1}function WE(t){return Array.isArray(t)}function x3(t){return typeof t=="function"}function Pm(t){return!HE(t)&&!WE(t)&&!x3(t)&&typeof t=="object"}function HE(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function sSe(t,e){return!(!aP(t)||!aP(e))}var iSe,w3=x(()=>{"use strict";b3();iSe=20});function R3(t,e){let r,n=new Promise(function(s,o){r=setTimeout(function(){o(new Om("Operation timed out."))},e)});return Promise.race([t,n]).then(i=>(clearTimeout(r),i),i=>{throw clearTimeout(r),i})}var Om,I3=x(()=>{"use strict";Om=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});function lP(t,e){return typeof e=="string"?t===e:!!t.match(e)}function C3(t,e){if(!e)return!1;for(let r of e)if(lP(t,r))return!0;return!1}var P3=x(()=>{"use strict"});var KE,O3=x(()=>{"use strict";KE=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var ZE,N3=x(()=>{"use strict";O3();ZE=class{_isCalled=!1;_deferred=new KE;_callback;_that;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function M3(t){if(t==null)return;let e=k3[t.toUpperCase()];return e??(Q.warn(`Unknown log level "${t}", expected one of ${Object.keys(k3)}, using default`),Ge.INFO)}var k3,D3=x(()=>{"use strict";be();k3={ALL:Ge.ALL,VERBOSE:Ge.VERBOSE,DEBUG:Ge.DEBUG,INFO:Ge.INFO,WARN:Ge.WARN,ERROR:Ge.ERROR,NONE:Ge.NONE}});function L3(t,e){return new Promise(r=>{at.with(NE(at.active()),()=>{t.export(e,r)})})}var $3=x(()=>{"use strict";be();wm()});var U3={};ir(U3,{AnchoredClock:()=>DE,BindOnceFuture:()=>ZE,CompositePropagator:()=>GE,ExportResultCode:()=>zE,RPCType:()=>qE,SDK_INFO:()=>BE,TRACE_PARENT_HEADER:()=>Im,TRACE_STATE_HEADER:()=>Cm,TimeoutError:()=>Om,TraceState:()=>Yu,W3CBaggagePropagator:()=>ME,W3CTraceContextPropagator:()=>VE,_globalThis:()=>FE,addHrTimes:()=>eP,callWithTimeout:()=>R3,deleteRPCMetadata:()=>m3,diagLogLevelFromString:()=>M3,getBooleanFromEnv:()=>$E,getNumberFromEnv:()=>Rt,getRPCMetadata:()=>g3,getStringFromEnv:()=>Fc,getStringListFromEnv:()=>UE,getTimeOrigin:()=>KH,globalErrorHandler:()=>$H,hrTime:()=>Q0,hrTimeDuration:()=>JH,hrTimeToMicroseconds:()=>e3,hrTimeToMilliseconds:()=>t3,hrTimeToNanoseconds:()=>QH,hrTimeToSeconds:()=>r3,hrTimeToTimeStamp:()=>XH,internal:()=>oSe,isAttributeValue:()=>Z0,isTimeInput:()=>n3,isTimeInputHrTime:()=>jE,isTracingSuppressed:()=>Hu,isUrlIgnored:()=>C3,loggingErrorHandler:()=>LE,merge:()=>YE,millisToHrTime:()=>Wu,otperformance:()=>Xo,parseKeyPairsIntoRecord:()=>CH,parseTraceParent:()=>sP,sanitizeAttributes:()=>NH,setGlobalErrorHandler:()=>LH,setRPCMetadata:()=>h3,suppressTracing:()=>NE,timeInputToHrTime:()=>ZH,unrefTimer:()=>s3,unsuppressTracing:()=>vH,urlMatches:()=>lP});var oSe,Ku=x(()=>{"use strict";PH();OH();MH();UH();J0();i3();o3();a3();K0();X0();c3();p3();_3();wm();iP();w3();I3();P3();N3();D3();$3();oSe={_export:L3}});function Nm(t){return t.setValue(F3,!0)}function uP(t){return t.getValue(F3)===!0}var F3,dP=x(()=>{"use strict";be();F3=mr("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function Qo(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!aSe(r)){Q.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!JE(n)){Q.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function aSe(t){return typeof t=="string"&&t!==""}function JE(t){return t==null?!0:Array.isArray(t)?cSe(t):B3(typeof t)}function cSe(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(B3(n)){e=n;continue}return!1}return!1}}return!0}function B3(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var j3=x(()=>{"use strict";be()});function z3(){return t=>{Q.error(lSe(t))}}function lSe(t){return typeof t=="string"?t:JSON.stringify(uSe(t))}function uSe(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}var G3=x(()=>{"use strict";be()});function ji(t){try{dSe(t)}catch{}}var dSe,V3=x(()=>{"use strict";G3();dSe=z3()});var q3,H3=x(()=>{"use strict";q3="2.9.0"});var W3,Y3=x(()=>{"use strict";W3="process.runtime.name"});var jc,K3=x(()=>{"use strict";H3();Lc();Y3();jc={[Ls]:"opentelemetry",[W3]:"node",[Ds]:$u,[$s]:q3}});var zi,Z3=x(()=>{"use strict";K3();zi=performance});var fP=x(()=>{"use strict";Z3()});function ea(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*SSe);return[r,n]}function hP(t){let e=ea(zi.timeOrigin),r=ea(typeof t=="number"?t:zi.now());return tv(e,r)}function mP(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=pP),[r,n]}function XE(t){return t[0]*1e6+t[1]/1e3}function QE(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function ev(t){return QE(t)||typeof t=="number"||t instanceof Date}function tv(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=pP&&(r[1]-=pP,r[0]+=1),r}var _Se,ySe,SSe,pP,J3=x(()=>{"use strict";fP();_Se=9,ySe=6,SSe=Math.pow(10,ySe),pP=Math.pow(10,_Se)});var Nn,X3=x(()=>{"use strict";(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Nn||(Nn={}))});var rv,Q3=x(()=>{"use strict";rv=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var zc,eW=x(()=>{"use strict";Q3();zc=class{_isCalled=!1;_deferred=new rv;_callback;_that;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function tW(t,e){return new Promise(r=>{at.with(Nm(at.active()),()=>{t.export(e,r)})})}var rW=x(()=>{"use strict";be();dP()});var nW,Gi=x(()=>{"use strict";j3();V3();J3();X3();fP();dP();eW();rW();nW={_export:tW}});function iW(){if(nv===void 0)try{let t=globalThis.process.argv0;nv=t?`unknown_service:${t}`:"unknown_service"}catch{nv="unknown_service"}return nv}var nv,sW=x(()=>{"use strict"});var Zu,oW=x(()=>{"use strict";Zu=t=>t!==null&&typeof t=="object"&&typeof t.then=="function"});function cW(t,e){return gP.FromAttributeList(Object.entries(t),e)}function _P(){return cW({[Zq]:iW(),[Ds]:jc[Ds],[Ls]:jc[Ls],[$s]:jc[$s]})}function aW(t){return t.map(([e,r])=>Zu(r)?[e,r.catch(n=>{Q.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}function ESe(t){if(typeof t=="string"||t===void 0)return t;Q.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function vSe(t,e){let r=t?.schemaUrl,n=e?.schemaUrl,i=r===void 0||r==="",s=n===void 0||n==="";if(i)return n;if(s||r===n)return r;Q.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}var gP,lW=x(()=>{"use strict";be();Gi();Lc();sW();oW();gP=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let n=new t({},r);return n._rawAttributes=aW(e),n._asyncAttributesPending=e.filter(([i,s])=>Zu(s)).length>0,n}constructor(e,r){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([i,s])=>(Zu(s)&&(this._asyncAttributesPending=!0),[i,s])),this._rawAttributes=aW(this._rawAttributes),this._schemaUrl=ESe(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,n]=this._rawAttributes[e];this._rawAttributes[e]=[r,Zu(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Q.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,n]of this._rawAttributes){if(Zu(n)){Q.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(e[r]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(e==null)return this;let r=vSe(this,e),n=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],n)}}});var uW=x(()=>{"use strict";lW()});var dW,fW=x(()=>{"use strict";dW="exception"});function Xu(t){let e={};for(let[r,n]of t.getRawAttributes())typeof n?.then!="function"&&n!=null&&(e[r]??=n);return e}function Qu(t,e,r,n,i){if(typeof r=="number"&&r<0){let o=`[${t}]`;return n?.stylize?n.stylize(o,"special"):o}if(typeof i!="function"||!n)return e;let s={...n,depth:n.depth==null?n.depth:n.depth-1};return`${t} ${i(e,s)}`}var Ju,iv=x(()=>{"use strict";Ju=Symbol.for("nodejs.util.inspect.custom")});var sv,pW=x(()=>{"use strict";be();Gi();Lc();fW();iv();sv=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:gr.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=zi.now(),this._performanceOffset=r-(this._performanceStartTime+zi.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let n of e.links)this.addLink(n);this.startTime=this._getTime(e.startTime??r),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,r){if(r==null||this._isSpanEnded())return this;if(e.length===0)return Q.warn(`Invalid attribute key: ${e}`),this;if(!JE(r))return Q.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,i=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&i?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),i&&this._attributesCount++,this)}setAttributes(e){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.setAttribute(r,e[r]);return this}addEvent(e,r,n){if(this._isSpanEnded())return this;let{eventCountLimit:i}=this._spanLimits;if(i===0)return Q.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Q.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),ev(r)&&(ev(n)||(n=r),r=void 0);let s=Qo(r),{attributePerEventCountLimit:o}=this._spanLimits,a={},c=0,l=0;for(let u in s){if(!Object.prototype.hasOwnProperty.call(s,u))continue;let d=s[u];if(o!==void 0&&l>=o){c++;continue}a[u]=this._truncateToSize(d),l++}return this.events.push({name:e,attributes:a,time:this._getTime(n),droppedAttributesCount:c}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:r}=this._spanLimits;if(r===0)return this._droppedLinksCount++,this;r!==void 0&&this.links.length>=r&&(this._droppedLinksCount===0&&Q.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,i=Qo(e.attributes),s={},o=0,a=0;for(let l in i){if(!Object.prototype.hasOwnProperty.call(i,l))continue;let u=i[l];if(n!==void 0&&a>=n){o++;continue}s[l]=this._truncateToSize(u),a++}let c={context:e.context};return a>0&&(c.attributes=s),o>0&&(c.droppedAttributesCount=o),this.links.push(c),this}addLinks(e){for(let r of e)this.addLink(r);return this}setStatus(e){if(this._isSpanEnded())return this;if(e.code===gr.UNSET)return this;if(this.status.code===gr.OK)return this;let r={code:e.code};return e.code===gr.ERROR&&(typeof e.message=="string"?r.message=e.message:e.message!=null&&Q.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=r,this}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Q.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=mP(this.startTime,this.endTime),this._duration[0]<0&&(Q.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Q.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Q.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=zi.now())return hP(e+this._performanceOffset);if(typeof e=="number")return ea(e);if(e instanceof Date)return ea(e.getTime());if(QE(e))return e;if(this._startTimeProvided)return ea(Date.now());let r=zi.now()-this._performanceStartTime;return tv(this.startTime,ea(r))}isRecording(){return this._ended===!1}recordException(e,r){let n={};typeof e=="string"?n[oE]=e:e&&(e.code?n[aE]=e.code.toString():e.name&&(n[aE]=e.name),e.message&&(n[oE]=e.message),e.stack&&(n[Kq]=e.stack)),n[aE]||n[oE]?this.addEvent(dW,n,r):Q.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Q.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_truncateToSize(e){let r=this._attributeValueLengthLimit;return r<=0?(Q.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):e}[Ju](e,r,n){let i={name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:Xu(this.resource)}};return Qu("SpanImpl",i,e,r,n)}}});var sr,ed=x(()=>{"use strict";(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(sr||(sr={}))});var hW,mW,gW,yP,_W,yW,SW,EW,vW,bW,TW,km=x(()=>{"use strict";hW="otel.component.name",mW="otel.component.type",gW="otel.span.parent.origin",yP="otel.span.sampling_result",_W="otel.sdk.processor.span.processed",yW="otel.sdk.processor.span.queue.capacity",SW="otel.sdk.processor.span.queue.size",EW="otel.sdk.span.live",vW="otel.sdk.span.started",bW="batching_span_processor",TW="simple_span_processor"});function bSe(t){return t?t.isRemote?"remote":"local":"none"}function TSe(t){switch(t){case sr.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case sr.RECORD:return"RECORD_ONLY";case sr.NOT_RECORD:return"DROP"}}var ov,AW=x(()=>{"use strict";ed();km();ov=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(vW,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=e.createUpDownCounter(EW,{unit:"{span}",description:"The number of currently live spans."})}startSpan(e,r){let n=TSe(r);if(this.startedSpans.add(1,{[gW]:bSe(e),[yP]:n}),r===sr.NOT_RECORD)return()=>{};let i={[yP]:n};return this.liveSpans.add(1,i),()=>{this.liveSpans.add(-1,i)}}}});var xW,wW=x(()=>{"use strict";xW="2.9.0"});var av,RW=x(()=>{"use strict";be();Gi();pW();AW();wW();iv();av=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,r){this.instrumentationScope=e,this._sampler=r.sampler,this._spanLimits=r.spanLimits,this._resource=r.resource,this._idGenerator=r.idGenerator,this._spanProcessor=r.spanProcessor;let n=r.meterProvider.getMeter("@opentelemetry/sdk-trace",xW);this._tracerMetrics=new ov(n)}startSpan(e,r={},n=at.active()){r.root&&(n=ft.deleteSpan(n));let i=ft.getSpan(n);if(uP(n))return Q.debug("Instrumentation suppressed, returning Noop Span"),ft.wrapSpanContext(Mu);let s=i?.spanContext(),o=this._idGenerator.generateSpanId(),a,c,l;!s||!ft.isSpanContextValid(s)?c=this._idGenerator.generateTraceId():(c=s.traceId,l=s.traceState,a=s);let u=r.kind??ti.INTERNAL,d=(r.links??[]).map(A=>({context:A.context,attributes:Qo(A.attributes)})),f=Qo(r.attributes),p=this._sampler.shouldSample(n,c,e,u,f,d),h=this._tracerMetrics.startSpan(s,p.decision);l=p.traceState??l;let m=p.decision===Dc.RECORD_AND_SAMPLED?Mt.SAMPLED:Mt.NONE,E={traceId:c,spanId:o,traceFlags:m,traceState:l};if(p.decision===Dc.NOT_RECORD)return Q.debug("Recording is off, propagating context in a non-recording span"),ft.wrapSpanContext(E);let T=Qo(Object.assign(f,p.attributes));return new sv({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:E,name:e,kind:u,links:d,parentSpanContext:a,attributes:T,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:h})}startActiveSpan(e,r,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(s=r,a=n):(s=r,o=n,a=i);let c=o??at.active(),l=this.startSpan(e,s,c),u=ft.setSpan(c,l);return at.with(u,a,void 0,l)}[Ju](e,r,n){let i={instrumentationScope:this.instrumentationScope,resource:{attributes:Xu(this._resource)},spanLimits:this._spanLimits};return Qu("Tracer",i,e,r,n)}}});var cv,IW=x(()=>{"use strict";Gi();cv=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let r of this._spanProcessors)e.push(r.forceFlush());return new Promise(r=>{Promise.all(e).then(()=>{r()}).catch(n=>{ji(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(e,r){for(let n of this._spanProcessors)n.onStart(e,r)}onEnding(e){for(let r of this._spanProcessors)r.onEnding&&r.onEnding(e)}onEnd(e){for(let r of this._spanProcessors)r.onEnd(e)}shutdown(){let e=[];for(let r of this._spanProcessors)e.push(r.shutdown());return new Promise((r,n)=>{Promise.all(e).then(()=>{r()},n)})}}});var ri,SP=x(()=>{"use strict";ed();ri=class{shouldSample(){return{decision:sr.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Rr,lv=x(()=>{"use strict";ed();Rr=class{shouldSample(){return{decision:sr.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var kn,EP=x(()=>{"use strict";be();Gi();SP();lv();kn=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(ji(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Rr),this._remoteParentSampled=e.remoteParentSampled??new Rr,this._remoteParentNotSampled=e.remoteParentNotSampled??new ri,this._localParentSampled=e.localParentSampled??new Rr,this._localParentNotSampled=e.localParentNotSampled??new ri}shouldSample(e,r,n,i,s,o){let a=ft.getSpanContext(e);return!a||!On(a)?this._root.shouldSample(e,r,n,i,s,o):a.isRemote?a.traceFlags&Mt.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,r,n,i,s,o):a.traceFlags&Mt.SAMPLED?this._localParentSampled.shouldSample(e,r,n,i,s,o):this._localParentNotSampled.shouldSample(e,r,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var CW,td,vP=x(()=>{"use strict";Lc();km();CW=new Map,td=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,r,n){let i=CW.get(e)??0;if(CW.set(e,i+1),this.standardAttrs={[mW]:e,[hW]:`${e}/${i}`},this.droppedAttrs={...this.standardAttrs,[E0]:"queue_full"},this.processedSpans=r.createCounter(_W,{unit:"{span}",description:"The number of spans for which the processing has finished, either successful or failed."}),n){let{capacity:s,getQueueSize:o}=n;r.createUpDownCounter(yW,{unit:"{span}",description:"The maximum number of spans the queue of a given instance of an SDK span processor can hold."}).add(s,this.standardAttrs),this.queueSize=r.createObservableUpDownCounter(SW,{unit:"{span}",description:"The number of spans in the queue of a given instance of an SDK span processor."}),this.queueSizeCallback=c=>c.observe(o(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,r){if(!r){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[E0]:r.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}}});var uv,PW=x(()=>{"use strict";be();Gi();vP();km();uv=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new zc(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Q.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize);let r=e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):Ko();this._metrics=new td(bW,r,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,r){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Mt.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Q.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(Q.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,r)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,o=i;s<o;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,r)=>{let n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);at.with(Nm(at.active()),()=>{let i;this._finishedSpans.length<=this._maxExportBatchSize?(i=this._finishedSpans,this._finishedSpans=[]):i=this._finishedSpans.splice(0,this._maxExportBatchSize);let s=()=>this._exporter.export(i,a=>{clearTimeout(n),this._metrics.finishSpans(i.length,a.error),a.code===Nn.SUCCESS?e():r(a.error??new Error("BatchSpanProcessor: span export failed"))}),o=null;for(let a=0,c=i.length;a<c;a++){let l=i[a];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(o??=[],o.push(l.resource.waitForAsyncAttributes()))}o===null?s():Promise.all(o).then(s,a=>{ji(a),r(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,ji(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}});var Gc,OW=x(()=>{"use strict";PW();Gc=class extends uv{onShutdown(){}}});function NW(t){return function(){for(let r=0;r<t/4;r++)dv.writeUInt32BE(Math.random()*2**32>>>0,r*4);for(let r=0;r<t&&!(dv[r]>0);r++)r===t-1&&(dv[t-1]=1);return dv.toString("hex",0,t)}}var Bs,dv,kW=x(()=>{"use strict";Bs=class{generateTraceId=NW(16);generateSpanId=NW(8)},dv=Buffer.allocUnsafe(16)});var MW=x(()=>{"use strict";OW();kW()});var bP=x(()=>{"use strict";MW()});var Vc,Mm,DW=x(()=>{"use strict";be();uW();RW();IW();EP();lv();bP();iv();(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Vc||(Vc={}));Mm=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??_P();let r=e.spanProcessors??[];this._activeSpanProcessor=new cv(r),this._tracerOptions={resource:this._resource,sampler:e.sampler??new kn({root:new Rr}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Bs,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return Ko()}}}}getTracer(e,r,n){let i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new av({name:e,version:r,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(i)}forceFlush(){let e=this._forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(i=>{let s,o=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=Vc.timeout},e);n.forceFlush().then(()=>{clearTimeout(o),s!==Vc.timeout&&(s=Vc.resolved,i(s))}).catch(a=>{clearTimeout(o),s=Vc.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(s=>{let o=s.filter(a=>a!==Vc.resolved);o.length>0?i(o):n()}).catch(s=>i([s]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[Ju](e,r,n){let i=this._activeSpanProcessor._spanProcessors,s={resource:{attributes:Xu(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:i.map(o=>o.constructor?.name??"SpanProcessor")};return Qu("TracerProvider",s,e,r,n)}}});var Dm,LW=x(()=>{"use strict";Gi();Dm=class{export(e,r){return this._sendSpans(e,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:XE(e.startTime),duration:XE(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,r){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(r)return r({code:Nn.SUCCESS})}}});var Lm,$W=x(()=>{"use strict";Gi();Lm=class{_finishedSpans=[];_stopped=!1;export(e,r){if(this._stopped)return r({code:Nn.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>r({code:Nn.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var $m,UW=x(()=>{"use strict";be();Gi();vP();km();$m=class{_exporter;_metrics;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e.exporter,this._shutdownOnce=new zc(this._shutdown,this),this._pendingExports=new Set;let r=e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):Ko();this._metrics=new td(TW,r)}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,r){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Mt.SAMPLED)===0)return;let r=this._doExport(e).catch(n=>ji(n));this._pendingExports.add(r),r.finally(()=>this._pendingExports.delete(r))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let r=await nW._export(this._exporter,[e]);if(this._metrics.finishSpans(1,r.error),r.code!==Nn.SUCCESS)throw r.error??new Error(`SimpleSpanProcessor: span export failed (status ${r})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._metrics.shutdown(),this._exporter.shutdown()}}});var Um,FW=x(()=>{"use strict";Um=class{onStart(e,r){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var ta,BW=x(()=>{"use strict";be();ed();ta=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,r){return{decision:gm(r)&&this._accumulate(r)<this._upperBound?sr.RECORD_AND_SAMPLED:sr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let r=0;for(let n=0;n<32;n+=8){let i=0;for(let s=0;s<8;s++){let o=e.charCodeAt(n+s),a=o<58?o-48:o<71?o-55:o-87;i=i<<4|a}r=(r^i)>>>0}return r}}});var rd=x(()=>{"use strict";DW();bP();LW();$W();UW();FW();SP();lv();EP();BW();ed()});function zW(){return{sampler:ASe(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:Rt("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Rt("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:Rt("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Rt("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:Rt("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:Rt("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:Rt("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:Rt("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function ASe(){let t=Fc("OTEL_TRACES_SAMPLER")??Vi.ParentBasedAlwaysOn;switch(t){case Vi.AlwaysOn:return new Rr;case Vi.AlwaysOff:return new ri;case Vi.ParentBasedAlwaysOn:return new kn({root:new Rr});case Vi.ParentBasedAlwaysOff:return new kn({root:new ri});case Vi.TraceIdRatio:return new ta(jW());case Vi.ParentBasedTraceIdRatio:return new kn({root:new ta(jW())});default:return Q.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Vi.ParentBasedAlwaysOn}".`),new kn({root:new Rr})}}function jW(){let t=Rt("OTEL_TRACES_SAMPLER_ARG");return t==null?(Q.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${fv}.`),fv):t<0||t>1?(Q.error(`OTEL_TRACES_SAMPLER_ARG=${t} was given, but it is out of range ([0..1]), defaulting to ${fv}.`),fv):t}var Vi,fv,GW=x(()=>{"use strict";be();Ku();rd();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Vi||(Vi={}));fv=1});function VW(t){let e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??Rt("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??Rt("OTEL_ATTRIBUTE_COUNT_LIMIT")??xSe,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??Rt("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Rt("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??wSe,Object.assign({},t,{spanLimits:e})}var xSe,wSe,qW=x(()=>{"use strict";Ku();xSe=128,wSe=1/0});var pv,HW=x(()=>{"use strict";Ku();GW();qW();rd();pv=class extends Mm{constructor(e={}){let r=YE({},zW(),VW(e));delete r.generalLimits,super(r)}}});var hv,WW=x(()=>{"use strict";Ku();rd();hv=class extends Gc{constructor(e,r){r||(r={});let n=[["maxExportBatchSize","OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],["maxQueueSize","OTEL_BSP_MAX_QUEUE_SIZE"],["scheduledDelayMillis","OTEL_BSP_SCHEDULE_DELAY"],["exportTimeoutMillis","OTEL_BSP_EXPORT_TIMEOUT"]];for(let[i,s]of n)if(r[i]===void 0){let o=Rt(s);o!==void 0&&(r[i]=o)}super({exporter:e,...r})}}});var mv,YW=x(()=>{"use strict";rd();mv=class extends $m{constructor(e){super({exporter:e})}}});var TP={};ir(TP,{AlwaysOffSampler:()=>ri,AlwaysOnSampler:()=>Rr,BasicTracerProvider:()=>pv,BatchSpanProcessor:()=>hv,ConsoleSpanExporter:()=>Dm,InMemorySpanExporter:()=>Lm,NoopSpanProcessor:()=>Um,ParentBasedSampler:()=>kn,RandomIdGenerator:()=>Bs,SamplingDecision:()=>sr,SimpleSpanProcessor:()=>mv,TraceIdRatioBasedSampler:()=>ta});var AP=x(()=>{"use strict";HW();WW();YW();rd()});var KW=b(gv=>{"use strict";Object.defineProperty(gv,"__esModule",{value:!0});gv.NodeTracerProvider=void 0;var RSe=EH(),ISe=(AP(),Ar(TP)),Fm=(be(),Ar(Zo)),xP=(Ku(),Ar(U3));function CSe(t){if(t!==null){if(t===void 0){let e=new RSe.AsyncLocalStorageContextManager;e.enable(),Fm.context.setGlobalContextManager(e);return}t.enable(),Fm.context.setGlobalContextManager(t)}}function PSe(t){if(t!==null){if(t===void 0){Fm.propagation.setGlobalPropagator(new xP.CompositePropagator({propagators:[new xP.W3CTraceContextPropagator,new xP.W3CBaggagePropagator]}));return}Fm.propagation.setGlobalPropagator(t)}}var wP=class extends ISe.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){Fm.trace.setGlobalTracerProvider(this),CSe(e.contextManager),PSe(e.propagator)}};gv.NodeTracerProvider=wP});var RP=b(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.TraceIdRatioBasedSampler=tt.SimpleSpanProcessor=tt.SamplingDecision=tt.RandomIdGenerator=tt.ParentBasedSampler=tt.NoopSpanProcessor=tt.InMemorySpanExporter=tt.ConsoleSpanExporter=tt.BatchSpanProcessor=tt.BasicTracerProvider=tt.AlwaysOnSampler=tt.AlwaysOffSampler=tt.NodeTracerProvider=void 0;var OSe=KW();Object.defineProperty(tt,"NodeTracerProvider",{enumerable:!0,get:function(){return OSe.NodeTracerProvider}});var Mn=(AP(),Ar(TP));Object.defineProperty(tt,"AlwaysOffSampler",{enumerable:!0,get:function(){return Mn.AlwaysOffSampler}});Object.defineProperty(tt,"AlwaysOnSampler",{enumerable:!0,get:function(){return Mn.AlwaysOnSampler}});Object.defineProperty(tt,"BasicTracerProvider",{enumerable:!0,get:function(){return Mn.BasicTracerProvider}});Object.defineProperty(tt,"BatchSpanProcessor",{enumerable:!0,get:function(){return Mn.BatchSpanProcessor}});Object.defineProperty(tt,"ConsoleSpanExporter",{enumerable:!0,get:function(){return Mn.ConsoleSpanExporter}});Object.defineProperty(tt,"InMemorySpanExporter",{enumerable:!0,get:function(){return Mn.InMemorySpanExporter}});Object.defineProperty(tt,"NoopSpanProcessor",{enumerable:!0,get:function(){return Mn.NoopSpanProcessor}});Object.defineProperty(tt,"ParentBasedSampler",{enumerable:!0,get:function(){return Mn.ParentBasedSampler}});Object.defineProperty(tt,"RandomIdGenerator",{enumerable:!0,get:function(){return Mn.RandomIdGenerator}});Object.defineProperty(tt,"SamplingDecision",{enumerable:!0,get:function(){return Mn.SamplingDecision}});Object.defineProperty(tt,"SimpleSpanProcessor",{enumerable:!0,get:function(){return Mn.SimpleSpanProcessor}});Object.defineProperty(tt,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return Mn.TraceIdRatioBasedSampler}})});var vv,oY=x(()=>{"use strict";vv=class{_delegate;constructor(e){this._delegate=e}export(e,r){this._delegate.export(e,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}});var js,bv=x(()=>{"use strict";js=class extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}});function jSe(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function Tv(t){if(t!=null)return async()=>t}function Av(t,e,r){return{timeoutMillis:jSe(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function xv(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var Gm=x(()=>{"use strict"});var wv,aY=x(()=>{"use strict";(function(t){t.NONE="none",t.GZIP="gzip"})(wv||(wv={}))});function Rv(t){return new NP(t.concurrencyLimit)}var NP,kP=x(()=>{"use strict";NP=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);let r=()=>{let n=this._sendingPromises.indexOf(e);this._sendingPromises.splice(n,1)};e.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}});function zSe(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function cY(){return{handleResponse(t){t==null||!zSe(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Q.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}var lY=x(()=>{"use strict";be()});function Iv(t,e){return new MP(t.transport,t.serializer,cY(),t.promiseHandler,e.timeout)}var MP,DP=x(()=>{"use strict";Fs();bv();lY();be();MP=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,r,n,i,s){this._transport=e,this._serializer=r,this._responseHandler=n,this._promiseQueue=i,this._timeout=s,this._diagLogger=Q.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:wr.FAILED,error:new Error("Concurrent export limit reached")});return}let n=this._serializer.serializeRequest(e);if(n==null){r({code:wr.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(i=>{if(i.status==="success"){if(i.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(i.data))}catch(s){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",s,i.data)}r({code:wr.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:wr.FAILED,error:i.error});return}else i.status==="retryable"?r({code:wr.FAILED,error:i.error??new js("Export failed with retryable status")}):r({code:wr.FAILED,error:new js("Export failed with unknown error")})},i=>r({code:wr.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}});function uY(t,e,r){return Iv({transport:r,serializer:e,promiseHandler:Rv(t)},{timeout:t.timeoutMillis})}var dY=x(()=>{"use strict";kP();DP()});var Cv={};ir(Cv,{CompressionAlgorithm:()=>wv,OTLPExporterBase:()=>vv,OTLPExporterError:()=>js,createOtlpNetworkExportDelegate:()=>uY,getSharedConfigurationDefaults:()=>xv,mergeOtlpSharedConfigurationWithDefaults:()=>Av});var Pv=x(()=>{"use strict";oY();bv();Gm();aY();dY()});var fY=b(Ov=>{"use strict";Object.defineProperty(Ov,"__esModule",{value:!0});Ov.VERSION=void 0;Ov.VERSION="0.218.0"});var Be=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=Dn.DEFAULT_MAX_SEND_MESSAGE_LENGTH=Dn.Propagate=Dn.LogVerbosity=Dn.Status=void 0;var pY;(function(t){t[t.OK=0]="OK",t[t.CANCELLED=1]="CANCELLED",t[t.UNKNOWN=2]="UNKNOWN",t[t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",t[t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",t[t.NOT_FOUND=5]="NOT_FOUND",t[t.ALREADY_EXISTS=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",t[t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",t[t.ABORTED=10]="ABORTED",t[t.OUT_OF_RANGE=11]="OUT_OF_RANGE",t[t.UNIMPLEMENTED=12]="UNIMPLEMENTED",t[t.INTERNAL=13]="INTERNAL",t[t.UNAVAILABLE=14]="UNAVAILABLE",t[t.DATA_LOSS=15]="DATA_LOSS",t[t.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(pY||(Dn.Status=pY={}));var hY;(function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.ERROR=2]="ERROR",t[t.NONE=3]="NONE"})(hY||(Dn.LogVerbosity=hY={}));var mY;(function(t){t[t.DEADLINE=1]="DEADLINE",t[t.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",t[t.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",t[t.CANCELLATION=8]="CANCELLATION",t[t.DEFAULTS=65535]="DEFAULTS"})(mY||(Dn.Propagate=mY={}));Dn.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;Dn.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var LP=b(($it,GSe)=>{GSe.exports={name:"@grpc/grpc-js",version:"1.14.4",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto","copy-protos":"node ./copy-protos"},dependencies:{"@grpc/proto-loader":"^0.8.0","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/**/*.proto","proto/**/LICENSE","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var ct=b(cn=>{"use strict";var $P,UP,FP,BP;Object.defineProperty(cn,"__esModule",{value:!0});cn.log=cn.setLoggerVerbosity=cn.setLogger=cn.getLogger=void 0;cn.trace=eEe;cn.isTracerEnabled=_Y;var ra=Be(),VSe=J("process"),qSe=LP().version,HSe={error:(t,...e)=>{console.error("E "+t,...e)},info:(t,...e)=>{console.error("I "+t,...e)},debug:(t,...e)=>{console.error("D "+t,...e)}},Hc=HSe,nd=ra.LogVerbosity.ERROR,WSe=(UP=($P=process.env.GRPC_NODE_VERBOSITY)!==null&&$P!==void 0?$P:process.env.GRPC_VERBOSITY)!==null&&UP!==void 0?UP:"";switch(WSe.toUpperCase()){case"DEBUG":nd=ra.LogVerbosity.DEBUG;break;case"INFO":nd=ra.LogVerbosity.INFO;break;case"ERROR":nd=ra.LogVerbosity.ERROR;break;case"NONE":nd=ra.LogVerbosity.NONE;break;default:}var YSe=()=>Hc;cn.getLogger=YSe;var KSe=t=>{Hc=t};cn.setLogger=KSe;var ZSe=t=>{nd=t};cn.setLoggerVerbosity=ZSe;var JSe=(t,...e)=>{let r;if(t>=nd){switch(t){case ra.LogVerbosity.DEBUG:r=Hc.debug;break;case ra.LogVerbosity.INFO:r=Hc.info;break;case ra.LogVerbosity.ERROR:r=Hc.error;break}r||(r=Hc.error),r&&r.bind(Hc)(...e)}};cn.log=JSe;var XSe=(BP=(FP=process.env.GRPC_NODE_TRACE)!==null&&FP!==void 0?FP:process.env.GRPC_TRACE)!==null&&BP!==void 0?BP:"",jP=new Set,gY=new Set;for(let t of XSe.split(","))t.startsWith("-")?gY.add(t.substring(1)):jP.add(t);var QSe=jP.has("all");function eEe(t,e,r){_Y(e)&&(0,cn.log)(t,new Date().toISOString()+" | v"+qSe+" "+VSe.pid+" | "+e+" | "+r)}function _Y(t){return!gY.has(t)&&(QSe||jP.has(t))}});var kv=b(Nv=>{"use strict";Object.defineProperty(Nv,"__esModule",{value:!0});Nv.getErrorMessage=tEe;Nv.getErrorCode=rEe;function tEe(t){return t instanceof Error?t.message:String(t)}function rEe(t){return typeof t=="object"&&t!==null&&"code"in t&&typeof t.code=="number"?t.code:null}});var Wt=b(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});Dv.Metadata=void 0;var nEe=ct(),iEe=Be(),sEe=kv(),oEe=/^[:0-9a-z_.-]+$/,aEe=/^[ -~]*$/;function cEe(t){return oEe.test(t)}function lEe(t){return aEe.test(t)}function SY(t){return t.endsWith("-bin")}function uEe(t){return!t.startsWith("grpc-")}function Mv(t){return t.toLowerCase()}function yY(t,e){if(!cEe(t))throw new Error('Metadata key "'+t+'" contains illegal characters');if(e!=null)if(SY(t)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!lEe(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var zP=class t{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,r){e=Mv(e),yY(e,r),this.internalRepr.set(e,[r])}add(e,r){e=Mv(e),yY(e,r);let n=this.internalRepr.get(e);n===void 0?this.internalRepr.set(e,[r]):n.push(r)}remove(e){e=Mv(e),this.internalRepr.delete(e)}get(e){return e=Mv(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[r,n]of this.internalRepr)if(n.length>0){let i=n[0];e[r]=Buffer.isBuffer(i)?Buffer.from(i):i}return e}clone(){let e=new t(this.options),r=e.internalRepr;for(let[n,i]of this.internalRepr){let s=i.map(o=>Buffer.isBuffer(o)?Buffer.from(o):o);r.set(n,s)}return e}merge(e){for(let[r,n]of e.internalRepr){let i=(this.internalRepr.get(r)||[]).concat(n);this.internalRepr.set(r,i)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[r,n]of this.internalRepr)r.startsWith(":")||(e[r]=n.map(dEe));return e}toJSON(){let e={};for(let[r,n]of this.internalRepr)e[r]=n;return e}setOpaque(e,r){this.opaqueData.set(e,r)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(e){let r=new t;for(let n of Object.keys(e)){if(n.charAt(0)===":")continue;let i=e[n];try{SY(n)?Array.isArray(i)?i.forEach(s=>{r.add(n,Buffer.from(s,"base64"))}):i!==void 0&&(uEe(n)?i.split(",").forEach(s=>{r.add(n,Buffer.from(s.trim(),"base64"))}):r.add(n,Buffer.from(i,"base64"))):Array.isArray(i)?i.forEach(s=>{r.add(n,s)}):i!==void 0&&r.add(n,i)}catch(s){let o=`Failed to add metadata entry ${n}: ${i}. ${(0,sEe.getErrorMessage)(s)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,nEe.log)(iEe.LogVerbosity.ERROR,o)}}return r}};Dv.Metadata=zP;var dEe=t=>Buffer.isBuffer(t)?t.toString("base64"):t});var $v=b(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});Lv.CallCredentials=void 0;var HP=Wt();function fEe(t){return"getRequestHeaders"in t&&typeof t.getRequestHeaders=="function"}var id=class t{static createFromMetadataGenerator(e){return new VP(e)}static createFromGoogleCredential(e){return t.createFromMetadataGenerator((r,n)=>{let i;fEe(e)?i=e.getRequestHeaders(r.service_url):i=new Promise((s,o)=>{e.getRequestMetadata(r.service_url,(a,c)=>{if(a){o(a);return}if(!c){o(new Error("Headers not set by metadata plugin"));return}s(c)})}),i.then(s=>{let o=new HP.Metadata;for(let a of Object.keys(s))o.add(a,s[a]);n(null,o)},s=>{n(s)})})}static createEmpty(){return new qP}};Lv.CallCredentials=id;var GP=class t extends id{constructor(e){super(),this.creds=e}async generateMetadata(e){let r=new HP.Metadata,n=await Promise.all(this.creds.map(i=>i.generateMetadata(e)));for(let i of n)r.merge(i);return r}compose(e){return new t(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof t?this.creds.every((r,n)=>r._equals(e.creds[n])):!1}},VP=class t extends id{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((r,n)=>{this.metadataGenerator(e,(i,s)=>{s!==void 0?r(s):n(i)})})}compose(e){return new GP([this,e])}_equals(e){return this===e?!0:e instanceof t?this.metadataGenerator===e.metadataGenerator:!1}},qP=class t extends id{generateMetadata(e){return Promise.resolve(new HP.Metadata)}compose(e){return e}_equals(e){return e instanceof t}}});var YP=b(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.CIPHER_SUITES=void 0;Vm.getDefaultRootsData=hEe;var pEe=J("fs");Vm.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var EY=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,WP=null;function hEe(){return EY?(WP===null&&(WP=pEe.readFileSync(EY)),WP):null}});var Ir=b(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.parseUri=gEe;sd.splitHostPort=_Ee;sd.combineHostPort=yEe;sd.uriToString=SEe;var mEe=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function gEe(t){let e=mEe.exec(t);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var vY=/^\d+$/;function _Ee(t){if(t.startsWith("[")){let e=t.indexOf("]");if(e===-1)return null;let r=t.substring(1,e);if(r.indexOf(":")===-1)return null;if(t.length>e+1)if(t[e+1]===":"){let n=t.substring(e+2);return vY.test(n)?{host:r,port:+n}:null}else return null;else return{host:r}}else{let e=t.split(":");return e.length===2?vY.test(e[1])?{host:e[0],port:+e[1]}:null:{host:t}}}function yEe(t){return t.port===void 0?t.host:t.host.includes(":")?`[${t.host}]:${t.port}`:`${t.host}:${t.port}`}function SEe(t){let e="";return t.scheme!==void 0&&(e+=t.scheme+":"),t.authority!==void 0&&(e+="//"+t.authority+"/"),e+=t.path,e}});var ni=b(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;zs.registerResolver=EEe;zs.registerDefaultScheme=vEe;zs.createResolver=bEe;zs.getDefaultAuthority=TEe;zs.mapUriDefaultScheme=AEe;var ZP=Ir();zs.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var od={},KP=null;function EEe(t,e){od[t]=e}function vEe(t){KP=t}function bEe(t,e,r){if(t.scheme!==void 0&&t.scheme in od)return new od[t.scheme](t,e,r);throw new Error(`No resolver could be created for target ${(0,ZP.uriToString)(t)}`)}function TEe(t){if(t.scheme!==void 0&&t.scheme in od)return od[t.scheme].getDefaultAuthority(t);throw new Error(`Invalid target ${(0,ZP.uriToString)(t)}`)}function AEe(t){return t.scheme===void 0||!(t.scheme in od)?KP!==null?{scheme:KP,authority:void 0,path:(0,ZP.uriToString)(t)}:null:t}});var ad=b(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.ChannelCredentials=void 0;Hm.createCertificateProviderChannelCredentials=IEe;var qm=J("tls"),Bv=$v(),XP=YP(),bY=Ir(),xEe=ni(),wEe=ct(),REe=Be();function JP(t,e){if(t&&!(t instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var Wc=class{compose(e){return new tO(this,e)}static createSsl(e,r,n,i){var s;if(JP(e,"Root certificate"),JP(r,"Private key"),JP(n,"Certificate chain"),r&&!n)throw new Error("Private key must be given with accompanying certificate chain");if(!r&&n)throw new Error("Certificate chain must be given with accompanying private key");let o=(0,qm.createSecureContext)({ca:(s=e??(0,XP.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,key:r??void 0,cert:n??void 0,ciphers:XP.CIPHER_SUITES});return new Uv(o,i??{})}static createFromSecureContext(e,r){return new Uv(e,r??{})}static createInsecure(){return new QP}};Hm.ChannelCredentials=Wc;var QP=class t extends Wc{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof t}_createSecureConnector(e,r,n){return{connect(i){return Promise.resolve({socket:i,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>n??Bv.CallCredentials.createEmpty(),destroy(){}}}};function TY(t,e,r,n){var i,s;let o={secureContext:t},a=r;if("grpc.http_connect_target"in n){let d=(0,bY.parseUri)(n["grpc.http_connect_target"]);d&&(a=d)}let c=(0,xEe.getDefaultAuthority)(a),l=(0,bY.splitHostPort)(c),u=(i=l?.host)!==null&&i!==void 0?i:c;if(o.host=u,e.checkServerIdentity&&(o.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(o.rejectUnauthorized=e.rejectUnauthorized),o.ALPNProtocols=["h2"],n["grpc.ssl_target_name_override"]){let d=n["grpc.ssl_target_name_override"],f=(s=o.checkServerIdentity)!==null&&s!==void 0?s:qm.checkServerIdentity;o.checkServerIdentity=(p,h)=>f(d,h),o.servername=d}else o.servername=u;return n["grpc-node.tls_enable_trace"]&&(o.enableTrace=!0),o}var eO=class{constructor(e,r){this.connectionOptions=e,this.callCredentials=r}connect(e){let r=Object.assign({socket:e},this.connectionOptions);return new Promise((n,i)=>{let s=(0,qm.connect)(r,()=>{var o;if((!((o=this.connectionOptions.rejectUnauthorized)!==null&&o!==void 0)||o)&&!s.authorized){i(s.authorizationError);return}n({socket:s,secure:!0})});s.on("error",o=>{i(o)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Uv=class t extends Wc{constructor(e,r){super(),this.secureContext=e,this.verifyOptions=r}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof t?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,r,n){let i=TY(this.secureContext,this.verifyOptions,e,r);return new eO(i,n??Bv.CallCredentials.createEmpty())}},Fv=class t extends Wc{constructor(e,r,n){super(),this.caCertificateProvider=e,this.identityCertificateProvider=r,this.verifyOptions=n,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var r,n;return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((r=this.verifyOptions)===null||r===void 0?void 0:r.checkServerIdentity)===((n=e.verifyOptions)===null||n===void 0?void 0:n.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,r,n){return this.ref(),new t.SecureConnectorImpl(this,e,r,n??Bv.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,r;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,qm.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(r=this.latestIdentityUpdate)===null||r===void 0?void 0:r.certificate,ciphers:XP.CIPHER_SUITES})}catch(n){return(0,wEe.log)(REe.LogVerbosity.ERROR,"Failed to createSecureContext with error "+n.message),null}}};Fv.SecureConnectorImpl=class{constructor(t,e,r,n){this.parent=t,this.channelTarget=e,this.options=r,this.callCredentials=n}connect(t){return new Promise((e,r)=>{let n=this.parent.getLatestSecureContext();if(!n){r(new Error("Failed to load credentials"));return}t.closed&&r(new Error("Socket closed while loading credentials"));let i=TY(n,this.parent.verifyOptions,this.channelTarget,this.options),s=Object.assign({socket:t},i),o=()=>{r(new Error("Socket closed"))},a=l=>{r(l)},c=(0,qm.connect)(s,()=>{var l;if(c.removeListener("close",o),c.removeListener("error",a),(!((l=this.parent.verifyOptions.rejectUnauthorized)!==null&&l!==void 0)||l)&&!c.authorized){r(c.authorizationError);return}e({socket:c,secure:!0})});c.once("close",o),c.once("error",a)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function IEe(t,e,r){return new Fv(t,e,r??{})}var tO=class t extends Wc{constructor(e,r){if(super(),this.channelCredentials=e,this.callCredentials=r,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let r=this.callCredentials.compose(e);return new t(this.channelCredentials,r)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof t?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,r,n){let i=this.callCredentials.compose(n??Bv.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,i)}}});var ia=b(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.createChildChannelControlHelper=OEe;qi.registerLoadBalancerType=NEe;qi.registerDefaultLoadBalancerType=kEe;qi.createLoadBalancer=MEe;qi.isLoadBalancerNameRegistered=DEe;qi.parseLoadBalancingConfig=AY;qi.getDefaultConfig=LEe;qi.selectLbConfigFromList=$Ee;var CEe=ct(),PEe=Be();function OEe(t,e){var r,n,i,s,o,a,c,l,u,d;return{createSubchannel:(n=(r=e.createSubchannel)===null||r===void 0?void 0:r.bind(e))!==null&&n!==void 0?n:t.createSubchannel.bind(t),updateState:(s=(i=e.updateState)===null||i===void 0?void 0:i.bind(e))!==null&&s!==void 0?s:t.updateState.bind(t),requestReresolution:(a=(o=e.requestReresolution)===null||o===void 0?void 0:o.bind(e))!==null&&a!==void 0?a:t.requestReresolution.bind(t),addChannelzChild:(l=(c=e.addChannelzChild)===null||c===void 0?void 0:c.bind(e))!==null&&l!==void 0?l:t.addChannelzChild.bind(t),removeChannelzChild:(d=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&d!==void 0?d:t.removeChannelzChild.bind(t)}}var na={},Wm=null;function NEe(t,e,r){na[t]={LoadBalancer:e,LoadBalancingConfig:r}}function kEe(t){Wm=t}function MEe(t,e){let r=t.getLoadBalancerName();return r in na?new na[r].LoadBalancer(e):null}function DEe(t){return t in na}function AY(t){let e=Object.keys(t);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let r=e[0];if(r in na)try{return na[r].LoadBalancingConfig.createFromJson(t[r])}catch(n){throw new Error(`${r}: ${n.message}`)}else throw new Error(`Unrecognized load balancing config name ${r}`)}function LEe(){if(!Wm)throw new Error("No default load balancer type registered");return new na[Wm].LoadBalancingConfig}function $Ee(t,e=!1){for(let r of t)try{return AY(r)}catch(n){(0,CEe.log)(PEe.LogVerbosity.DEBUG,"Config parsing failed with error",n.message);continue}return e&&Wm?new na[Wm].LoadBalancingConfig:null}});var rO=b(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.validateRetryThrottling=xY;Ym.validateServiceConfig=wY;Ym.extractAndSelectServiceConfig=WEe;var UEe=J("os"),jv=Be(),zv=/^\d+(\.\d{1,9})?s$/,FEe="node";function BEe(t){if("service"in t&&t.service!==""){if(typeof t.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof t.service}`);if("method"in t&&t.method!==""){if(typeof t.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof t.service}`);return{service:t.service,method:t.method}}else return{service:t.service}}else{if("method"in t&&t.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function jEe(t){if(!("maxAttempts"in t)||!Number.isInteger(t.maxAttempts)||t.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in t)||typeof t.initialBackoff!="string"||!zv.test(t.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in t)||typeof t.maxBackoff!="string"||!zv.test(t.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in t)||typeof t.backoffMultiplier!="number"||t.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in t&&Array.isArray(t.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(t.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of t.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(jv.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(jv.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:t.maxAttempts,initialBackoff:t.initialBackoff,maxBackoff:t.maxBackoff,backoffMultiplier:t.backoffMultiplier,retryableStatusCodes:t.retryableStatusCodes}}function zEe(t){if(!("maxAttempts"in t)||!Number.isInteger(t.maxAttempts)||t.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in t&&(typeof t.hedgingDelay!="string"||!zv.test(t.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in t&&Array.isArray(t.nonFatalStatusCodes))for(let r of t.nonFatalStatusCodes)if(typeof r=="number"){if(!Object.values(jv.Status).includes(r))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof r=="string"){if(!Object.values(jv.Status).includes(r.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:t.maxAttempts};return t.hedgingDelay&&(e.hedgingDelay=t.hedgingDelay),t.nonFatalStatusCodes&&(e.nonFatalStatusCodes=t.nonFatalStatusCodes),e}function GEe(t){var e;let r={name:[]};if(!("name"in t)||!Array.isArray(t.name))throw new Error("Invalid method config: invalid name array");for(let n of t.name)r.name.push(BEe(n));if("waitForReady"in t){if(typeof t.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");r.waitForReady=t.waitForReady}if("timeout"in t)if(typeof t.timeout=="object"){if(!("seconds"in t.timeout)||typeof t.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in t.timeout)||typeof t.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");r.timeout=t.timeout}else if(typeof t.timeout=="string"&&zv.test(t.timeout)){let n=t.timeout.substring(0,t.timeout.length-1).split(".");r.timeout={seconds:n[0]|0,nanos:((e=n[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in t){if(typeof t.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");r.maxRequestBytes=t.maxRequestBytes}if("maxResponseBytes"in t){if(typeof t.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");r.maxResponseBytes=t.maxResponseBytes}if("retryPolicy"in t){if("hedgingPolicy"in t)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");r.retryPolicy=jEe(t.retryPolicy)}else"hedgingPolicy"in t&&(r.hedgingPolicy=zEe(t.hedgingPolicy));return r}function xY(t){if(!("maxTokens"in t)||typeof t.maxTokens!="number"||t.maxTokens<=0||t.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in t)||typeof t.tokenRatio!="number"||t.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+t.maxTokens.toFixed(3),tokenRatio:+t.tokenRatio.toFixed(3)}}function VEe(t){if(!(typeof t=="object"&&t!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof t}`);let e=Object.keys(t);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:t[e[0]]}}function wY(t){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in t)if(typeof t.loadBalancingPolicy=="string")e.loadBalancingPolicy=t.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in t)if(Array.isArray(t.loadBalancingConfig))for(let n of t.loadBalancingConfig)e.loadBalancingConfig.push(VEe(n));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in t&&Array.isArray(t.methodConfig))for(let n of t.methodConfig)e.methodConfig.push(GEe(n));"retryThrottling"in t&&(e.retryThrottling=xY(t.retryThrottling));let r=[];for(let n of e.methodConfig)for(let i of n.name){for(let s of r)if(i.service===s.service&&i.method===s.method)throw new Error(`Invalid service config: duplicate name ${i.service}/${i.method}`);r.push(i)}return e}function qEe(t){if(!("serviceConfig"in t))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:wY(t.serviceConfig)};if("clientLanguage"in t)if(Array.isArray(t.clientLanguage)){e.clientLanguage=[];for(let n of t.clientLanguage)if(typeof n=="string")e.clientLanguage.push(n);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in t)if(Array.isArray(t.clientHostname)){e.clientHostname=[];for(let n of t.clientHostname)if(typeof n=="string")e.clientHostname.push(n);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in t)if(typeof t.percentage=="number"&&0<=t.percentage&&t.percentage<=100)e.percentage=t.percentage;else throw new Error("Invalid service config choice: invalid percentage");let r=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let n in t)if(!r.includes(n))throw new Error(`Invalid service config choice: unexpected field ${n}`);return e}function HEe(t,e){if(!Array.isArray(t))throw new Error("Invalid service config list");for(let r of t){let n=qEe(r);if(!(typeof n.percentage=="number"&&e>n.percentage)){if(Array.isArray(n.clientHostname)){let i=!1;for(let s of n.clientHostname)s===UEe.hostname()&&(i=!0);if(!i)continue}if(Array.isArray(n.clientLanguage)){let i=!1;for(let s of n.clientLanguage)s===FEe&&(i=!0);if(!i)continue}return n.serviceConfig}}throw new Error("No matching service config found")}function WEe(t,e){for(let r of t)if(r.length>0&&r[0].startsWith("grpc_config=")){let n=r.join("").substring(12),i=JSON.parse(n);return HEe(i,e)}return null}});var Cr=b(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});Gv.ConnectivityState=void 0;var RY;(function(t){t[t.IDLE=0]="IDLE",t[t.CONNECTING=1]="CONNECTING",t[t.READY=2]="READY",t[t.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",t[t.SHUTDOWN=4]="SHUTDOWN"})(RY||(Gv.ConnectivityState=RY={}))});var Gs=b(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.QueuePicker=sa.UnavailablePicker=sa.PickResultType=void 0;var YEe=Wt(),KEe=Be(),Vv;(function(t){t[t.COMPLETE=0]="COMPLETE",t[t.QUEUE=1]="QUEUE",t[t.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",t[t.DROP=3]="DROP"})(Vv||(sa.PickResultType=Vv={}));var nO=class{constructor(e){this.status=Object.assign({code:KEe.Status.UNAVAILABLE,details:"No connection established",metadata:new YEe.Metadata},e)}pick(e){return{pickResultType:Vv.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};sa.UnavailablePicker=nO;var iO=class{constructor(e,r){this.loadBalancer=e,this.childPicker=r,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:Vv.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};sa.QueuePicker=iO});var cd=b(Hv=>{"use strict";Object.defineProperty(Hv,"__esModule",{value:!0});Hv.BackoffTimeout=void 0;var ZEe=Be(),JEe=ct(),XEe="backoff",QEe=1e3,eve=1.6,tve=12e4,rve=.2;function nve(t,e){return Math.random()*(e-t)+t}var qv=class t{constructor(e,r){this.callback=e,this.initialDelay=QEe,this.multiplier=eve,this.maxDelay=tve,this.jitter=rve,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=t.getNextId(),r&&(r.initialDelay&&(this.initialDelay=r.initialDelay),r.multiplier&&(this.multiplier=r.multiplier),r.jitter&&(this.jitter=r.jitter),r.maxDelay&&(this.maxDelay=r.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){JEe.trace(ZEe.LogVerbosity.DEBUG,XEe,"{"+this.id+"} "+e)}runTimer(e){var r,n;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(n=(r=this.timerId).unref)===null||n===void 0||n.call(r)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),r=e*this.jitter;this.nextDelay=e+nve(-r,r)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,r=this.startTime;r.setMilliseconds(r.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<r?this.runTimer(r.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,r;this.hasRef=!0,(r=(e=this.timerId).ref)===null||r===void 0||r.call(e)}unref(){var e,r;this.hasRef=!1,(r=(e=this.timerId).unref)===null||r===void 0||r.call(e)}getEndTime(){return this.endTime}};Hv.BackoffTimeout=qv;qv.nextId=0});var Yv=b(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});Wv.ChildLoadBalancerHandler=void 0;var ive=ia(),sve=Cr(),ove="child_load_balancer_helper",sO=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(r){this.parent=r,this.child=null}createSubchannel(r,n){return this.parent.channelControlHelper.createSubchannel(r,n)}updateState(r,n,i){var s;if(this.calledByPendingChild()){if(r===sve.ConnectivityState.CONNECTING)return;(s=this.parent.currentChild)===null||s===void 0||s.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(r,n,i)}requestReresolution(){var r;let n=(r=this.parent.pendingChild)!==null&&r!==void 0?r:this.parent.currentChild;this.child===n&&this.parent.channelControlHelper.requestReresolution()}setChild(r){this.child=r}addChannelzChild(r){this.parent.channelControlHelper.addChannelzChild(r)}removeChannelzChild(r){this.parent.channelControlHelper.removeChannelzChild(r)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,r){return e.getLoadBalancerName()!==r.getLoadBalancerName()}updateAddressList(e,r,n,i){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){let o=new this.ChildPolicyHelper(this),a=(0,ive.createLoadBalancer)(r,o);o.setChild(a),this.currentChild===null?(this.currentChild=a,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=a,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;return this.latestConfig=r,s.updateAddressList(e,r,n,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return ove}};Wv.ChildLoadBalancerHandler=sO});var PY=b(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});Kv.ResolvingLoadBalancer=void 0;var ave=ia(),cve=rO(),Vr=Cr(),IY=ni(),Km=Gs(),lve=cd(),oO=Be(),uve=Wt(),dve=ct(),fve=Be(),pve=Ir(),hve=Yv(),mve="resolving_load_balancer";function CY(t){dve.trace(fve.LogVerbosity.DEBUG,mve,t)}var gve=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function _ve(t,e,r,n){for(let i of r.name)switch(n){case"EMPTY":if(!i.service&&!i.method)return!0;break;case"SERVICE":if(i.service===t&&!i.method)return!0;break;case"SERVICE_AND_METHOD":if(i.service===t&&i.method===e)return!0}return!1}function yve(t,e,r,n){for(let i of r)if(_ve(t,e,i,n))return i;return null}function Sve(t){return{invoke(e,r){var n,i;let s=e.split("/").filter(c=>c.length>0),o=(n=s[0])!==null&&n!==void 0?n:"",a=(i=s[1])!==null&&i!==void 0?i:"";if(t&&t.methodConfig)for(let c of gve){let l=yve(o,a,t.methodConfig,c);if(l)return{methodConfig:l,pickInformation:{},status:oO.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:oO.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var aO=class{constructor(e,r,n,i,s){this.target=e,this.channelControlHelper=r,this.channelOptions=n,this.onSuccessfulResolution=i,this.onFailedResolution=s,this.latestChildState=Vr.ConnectivityState.IDLE,this.latestChildPicker=new Km.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=Vr.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,n["grpc.service_config"]?this.defaultServiceConfig=(0,cve.validateServiceConfig)(JSON.parse(n["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(Vr.ConnectivityState.IDLE,new Km.QueuePicker(this),null),this.childLoadBalancer=new hve.ChildLoadBalancerHandler({createSubchannel:r.createSubchannel.bind(r),requestReresolution:()=>{this.backoffTimeout.isRunning()?(CY("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(a,c,l)=>{this.latestChildState=a,this.latestChildPicker=c,this.latestChildErrorMessage=l,this.updateState(a,c,l)},addChannelzChild:r.addChannelzChild.bind(r),removeChannelzChild:r.removeChannelzChild.bind(r)}),this.innerResolver=(0,IY.createResolver)(e,this.handleResolverResult.bind(this),n);let o={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new lve.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},o),this.backoffTimeout.unref()}handleResolverResult(e,r,n,i){var s,o;this.backoffTimeout.stop(),this.backoffTimeout.reset();let a=!0,c=null;if(n===null?c=this.defaultServiceConfig:n.ok?c=n.value:this.previousServiceConfig!==null?c=this.previousServiceConfig:(a=!1,this.handleResolutionFailure(n.error)),c!==null){let l=(s=c?.loadBalancingConfig)!==null&&s!==void 0?s:[],u=(0,ave.selectLbConfigFromList)(l,!0);u===null?(a=!1,this.handleResolutionFailure({code:oO.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new uve.Metadata})):a=this.childLoadBalancer.updateAddressList(e,u,Object.assign(Object.assign({},this.channelOptions),r),i)}return a&&this.onSuccessfulResolution(c,(o=r[IY.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&o!==void 0?o:Sve(c)),a}updateResolution(){this.innerResolver.updateResolution(),this.currentState===Vr.ConnectivityState.IDLE&&this.updateState(Vr.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,r,n){CY((0,pve.uriToString)(this.target)+" "+Vr.ConnectivityState[this.currentState]+" -> "+Vr.ConnectivityState[e]),e===Vr.ConnectivityState.IDLE&&(r=new Km.QueuePicker(this,r)),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}handleResolutionFailure(e){this.latestChildState===Vr.ConnectivityState.IDLE&&(this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new Km.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===Vr.ConnectivityState.IDLE||this.currentState===Vr.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,r){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=Vr.ConnectivityState.IDLE,this.latestChildPicker=new Km.QueuePicker(this),this.currentState=Vr.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Kv.ResolvingLoadBalancer=aO});var OY=b(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.recognizedOptions=void 0;Zm.channelOptionsEqual=Eve;Zm.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0};function Eve(t,e){let r=Object.keys(t).sort(),n=Object.keys(e).sort();if(r.length!==n.length)return!1;for(let i=0;i<r.length;i+=1)if(r[i]!==n[i]||t[r[i]]!==e[n[i]])return!1;return!0}});var qr=b(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.EndpointMap=void 0;ii.isTcpSubchannelAddress=Xm;ii.subchannelAddressEqual=Zv;ii.subchannelAddressToString=kY;ii.stringToSubchannelAddress=bve;ii.endpointEqual=Tve;ii.endpointToString=Ave;ii.endpointHasAddress=MY;var NY=J("net");function Xm(t){return"port"in t}function Zv(t,e){return!t&&!e?!0:!t||!e?!1:Xm(t)?Xm(e)&&t.host===e.host&&t.port===e.port:!Xm(e)&&t.path===e.path}function kY(t){return Xm(t)?(0,NY.isIPv6)(t.host)?"["+t.host+"]:"+t.port:t.host+":"+t.port:t.path}var vve=443;function bve(t,e){return(0,NY.isIP)(t)?{host:t,port:e??vve}:{path:t}}function Tve(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r=0;r<t.addresses.length;r++)if(!Zv(t.addresses[r],e.addresses[r]))return!1;return!0}function Ave(t){return"["+t.addresses.map(kY).join(", ")+"]"}function MY(t,e){for(let r of t.addresses)if(Zv(r,e))return!0;return!1}function Jm(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r of t.addresses){let n=!1;for(let i of e.addresses)if(Zv(r,i)){n=!0;break}if(!n)return!1}return!0}var cO=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let r of this.map)if(MY(r.key,e))return r.value}deleteMissing(e){let r=[];for(let n of this.map){let i=!1;for(let s of e)Jm(s,n.key)&&(i=!0);i||(r.push(n.value),this.map.delete(n))}return r}get(e){for(let r of this.map)if(Jm(e,r.key))return r.value}set(e,r){for(let n of this.map)if(Jm(e,n.key)){n.value=r;return}this.map.add({key:e,value:r})}delete(e){for(let r of this.map)if(Jm(e,r.key)){this.map.delete(r);return}}has(e){for(let r of this.map)if(Jm(e,r.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};ii.EndpointMap=cO});var LY={};ir(LY,{OrderedMap:()=>Nve});function ld(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");lO(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function xve(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Yc(){throw new RangeError("Iterator access denied!")}var lO,DY,wve,Rve,Ive,Cve,Pve,Ove,Vs,Nve,$Y=x(()=>{"use strict";lO=function(t,e){return lO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},lO(t,e)};DY=(function(){function t(e,r,n){n===void 0&&(n=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=r,this.l=n}return t.prototype.v=function(){var e=this,r=e.h.h===e;if(r&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(r)return e.h;for(var n=e.h;n.t===e;)e=n,n=e.h;e=n}return e},t.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var r=e.h;r.i===e;)e=r,r=e.h;return e.i!==r?r:e}},t.prototype.T=function(){var e=this.h,r=this.i,n=r.t;return e.h===this?e.h=r:e.t===this?e.t=r:e.i=r,r.h=e,r.t=this,this.h=r,this.i=n,n&&(n.h=this),r},t.prototype.I=function(){var e=this.h,r=this.t,n=r.i;return e.h===this?e.h=r:e.t===this?e.t=r:e.i=r,r.h=e,r.i=this,this.h=r,this.t=n,n&&(n.h=this),r},t})(),wve=(function(t){ld(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.O=1,r}return e.prototype.T=function(){var r=t.prototype.T.call(this);return this.M(),r.M(),r},e.prototype.I=function(){var r=t.prototype.I.call(this);return this.M(),r.M(),r},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e})(DY),Rve=(function(){function t(e){e===void 0&&(e=0),this.iteratorType=e}return t.prototype.equals=function(e){return this.C===e.C},t})(),Ive=(function(){function t(){this._=0}return Object.defineProperty(t.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),t.prototype.size=function(){return this._},t.prototype.empty=function(){return this._===0},t})(),Cve=(function(t){ld(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Ive);Pve=(function(t){ld(e,t);function e(r,n){r===void 0&&(r=function(s,o){return s<o?-1:s>o?1:0}),n===void 0&&(n=!1);var i=t.call(this)||this;return i.N=void 0,i.g=r,i.enableIndex=n,i.S=n?wve:DY,i.A=new i.S,i}return e.prototype.m=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);if(s<0)r=r.i;else if(s>0)i=r,r=r.t;else return r}return i},e.prototype.B=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);s<=0?r=r.i:(i=r,r=r.t)}return i},e.prototype.j=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);if(s<0)i=r,r=r.i;else if(s>0)r=r.t;else return r}return i},e.prototype.k=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);s<0?(i=r,r=r.i):r=r.t}return i},e.prototype.R=function(r){for(;;){var n=r.h;if(n===this.A)return;if(r.l===1){r.l=0;return}if(r===n.t){var i=n.i;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.T():n.T();else if(i.i&&i.i.l===1){i.l=n.l,n.l=0,i.i.l=0,n===this.N?this.N=n.T():n.T();return}else i.t&&i.t.l===1?(i.l=1,i.t.l=0,i.I()):(i.l=1,r=n)}else{var i=n.t;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.I():n.I();else if(i.t&&i.t.l===1){i.l=n.l,n.l=0,i.t.l=0,n===this.N?this.N=n.I():n.I();return}else i.i&&i.i.l===1?(i.l=1,i.i.l=0,i.T()):(i.l=1,r=n)}}},e.prototype.G=function(r){if(this._===1){this.clear();return}for(var n=r;n.t||n.i;){if(n.i)for(n=n.i;n.t;)n=n.t;else n=n.t;var i=r.u;r.u=n.u,n.u=i;var s=r.o;r.o=n.o,n.o=s,r=n}this.A.t===n?this.A.t=n.h:this.A.i===n&&(this.A.i=n.h),this.R(n);var o=n.h;if(n===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.h},e.prototype.P=function(r){for(var n=typeof r=="number"?r:void 0,i=typeof r=="function"?r:void 0,s=typeof r>"u"?[]:void 0,o=0,a=this.N,c=[];c.length||a;)if(a)c.push(a),a=a.t;else{if(a=c.pop(),o===n)return a;s&&s.push(a),i&&i(a,o,this),o+=1,a=a.i}return s},e.prototype.q=function(r){for(;;){var n=r.h;if(n.l===0)return;var i=n.h;if(n===i.t){var s=i.i;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,r=i;continue}else if(r===n.i){if(r.l=0,r.t&&(r.t.h=n),r.i&&(r.i.h=i),n.i=r.t,i.t=r.i,r.t=n,r.i=i,i===this.N)this.N=r,this.A.h=r;else{var o=i.h;o.t===i?o.t=r:o.i=r}r.h=i.h,n.h=r,i.h=r,i.l=1}else{n.l=0,i===this.N?this.N=i.I():i.I(),i.l=1;return}}else{var s=i.t;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,r=i;continue}else if(r===n.t){if(r.l=0,r.t&&(r.t.h=i),r.i&&(r.i.h=n),i.i=r.t,n.t=r.i,r.t=i,r.i=n,i===this.N)this.N=r,this.A.h=r;else{var o=i.h;o.t===i?o.t=r:o.i=r}r.h=i.h,n.h=r,i.h=r,i.l=1}else{n.l=0,i===this.N?this.N=i.T():i.T(),i.l=1;return}}this.enableIndex&&(n.M(),i.M(),r.M());return}},e.prototype.D=function(r,n,i){if(this.N===void 0)return this._+=1,this.N=new this.S(r,n,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var s,o=this.A.t,a=this.g(o.u,r);if(a===0)return o.o=n,this._;if(a>0)o.t=new this.S(r,n),o.t.h=o,s=o.t,this.A.t=s;else{var c=this.A.i,l=this.g(c.u,r);if(l===0)return c.o=n,this._;if(l<0)c.i=new this.S(r,n),c.i.h=c,s=c.i,this.A.i=s;else{if(i!==void 0){var u=i.C;if(u!==this.A){var d=this.g(u.u,r);if(d===0)return u.o=n,this._;if(d>0){var f=u.v(),p=this.g(f.u,r);if(p===0)return f.o=n,this._;p<0&&(s=new this.S(r,n),f.i===void 0?(f.i=s,s.h=f):(u.t=s,s.h=u))}}}if(s===void 0)for(s=this.N;;){var h=this.g(s.u,r);if(h>0){if(s.t===void 0){s.t=new this.S(r,n),s.t.h=s,s=s.t;break}s=s.t}else if(h<0){if(s.i===void 0){s.i=new this.S(r,n),s.i.h=s,s=s.i;break}s=s.i}else return s.o=n,this._}}}if(this.enableIndex)for(var m=s.h;m!==this.A;)m.O+=1,m=m.h;return this.q(s),this._+=1,this._},e.prototype.F=function(r,n){for(;r;){var i=this.g(r.u,n);if(i<0)r=r.i;else if(i>0)r=r.t;else return r}return r||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(r,n){var i=r.C;if(i===this.A&&Yc(),this._===1)return i.u=n,!0;var s=i.p().u;if(i===this.A.t)return this.g(s,n)>0?(i.u=n,!0):!1;var o=i.v().u;return i===this.A.i?this.g(o,n)<0?(i.u=n,!0):!1:this.g(o,n)>=0||this.g(s,n)<=0?!1:(i.u=n,!0)},e.prototype.eraseElementByPos=function(r){if(r<0||r>this._-1)throw new RangeError;var n=this.P(r);return this.G(n),this._},e.prototype.eraseElementByKey=function(r){if(this._===0)return!1;var n=this.F(this.N,r);return n===this.A?!1:(this.G(n),!0)},e.prototype.eraseElementByIterator=function(r){var n=r.C;n===this.A&&Yc();var i=n.i===void 0,s=r.iteratorType===0;return s?i&&r.next():(!i||n.t===void 0)&&r.next(),this.G(n),r},e.prototype.getHeight=function(){if(this._===0)return 0;function r(n){return n?Math.max(r(n.t),r(n.i))+1:0}return r(this.N)},e})(Cve),Ove=(function(t){ld(e,t);function e(r,n,i){var s=t.call(this,i)||this;return s.C=r,s.A=n,s.iteratorType===0?(s.pre=function(){return this.C===this.A.t&&Yc(),this.C=this.C.v(),this},s.next=function(){return this.C===this.A&&Yc(),this.C=this.C.p(),this}):(s.pre=function(){return this.C===this.A.i&&Yc(),this.C=this.C.p(),this},s.next=function(){return this.C===this.A&&Yc(),this.C=this.C.v(),this}),s}return Object.defineProperty(e.prototype,"index",{get:function(){var r=this.C,n=this.A.h;if(r===this.A)return n?n.O-1:0;var i=0;for(r.t&&(i+=r.t.O);r!==n;){var s=r.h;r===s.i&&(i+=1,s.t&&(i+=s.t.O)),r=s}return i},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(Rve),Vs=(function(t){ld(e,t);function e(r,n,i,s){var o=t.call(this,r,n,s)||this;return o.container=i,o}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&Yc();var r=this;return new Proxy([],{get:function(n,i){return i==="0"?r.C.u:i==="1"?r.C.o:(n[0]=r.C.u,n[1]=r.C.o,n[i])},set:function(n,i,s){if(i!=="1")throw new TypeError("prop must be 1");return r.C.o=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Ove),Nve=(function(t){ld(e,t);function e(r,n,i){r===void 0&&(r=[]);var s=t.call(this,n,i)||this,o=s;return r.forEach((function(a){o.setElement(a[0],a[1])})),s}return e.prototype.begin=function(){return new Vs(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new Vs(this.A,this.A,this)},e.prototype.rBegin=function(){return new Vs(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new Vs(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var r=this.A.t;return[r.u,r.o]}},e.prototype.back=function(){if(this._!==0){var r=this.A.i;return[r.u,r.o]}},e.prototype.lowerBound=function(r){var n=this.m(this.N,r);return new Vs(n,this.A,this)},e.prototype.upperBound=function(r){var n=this.B(this.N,r);return new Vs(n,this.A,this)},e.prototype.reverseLowerBound=function(r){var n=this.j(this.N,r);return new Vs(n,this.A,this)},e.prototype.reverseUpperBound=function(r){var n=this.k(this.N,r);return new Vs(n,this.A,this)},e.prototype.forEach=function(r){this.P((function(n,i,s){r([n.u,n.o],i,s)}))},e.prototype.setElement=function(r,n,i){return this.D(r,n,i)},e.prototype.getElementByPos=function(r){if(r<0||r>this._-1)throw new RangeError;var n=this.P(r);return[n.u,n.o]},e.prototype.find=function(r){var n=this.F(this.N,r);return new Vs(n,this.A,this)},e.prototype.getElementByKey=function(r){var n=this.F(this.N,r);return n.o},e.prototype.union=function(r){var n=this;return r.forEach((function(i){n.setElement(i[0],i[1])})),this._},e.prototype[Symbol.iterator]=function(){var r,n,i,s;return xve(this,(function(o){switch(o.label){case 0:r=this._,n=this.P(),i=0,o.label=1;case 1:return i<r?(s=n[i],[4,[s.u,s.o]]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2]}}))},e})(Pve)});var Xv=b(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});Jv.registerAdminService=kve;Jv.addAdminServicesToServer=Mve;var UY=[];function kve(t,e){UY.push({getServiceDefinition:t,getHandlers:e})}function Mve(t){for(let{getServiceDefinition:e,getHandlers:r}of UY)t.addService(e(),r())}});var FY=b(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.ClientDuplexStreamImpl=si.ClientWritableStreamImpl=si.ClientReadableStreamImpl=si.ClientUnaryCallImpl=void 0;si.callErrorFromStatus=Lve;var Dve=J("events"),hO=J("stream"),Qm=Be();function Lve(t,e){let r=`${t.code} ${Qm.Status[t.code]}: ${t.details}`,i=`${new Error(r).stack}
|
|
3
3
|
for call at
|
|
4
4
|
${e}`;return Object.assign(new Error(r),t,{stack:i})}var uO=class extends Dve.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Qm.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}};si.ClientUnaryCallImpl=uO;var dO=class extends hO.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Qm.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_read(e){var r;(r=this.call)===null||r===void 0||r.startRead()}};si.ClientReadableStreamImpl=dO;var fO=class extends hO.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Qm.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_write(e,r,n){var i;let s={callback:n},o=Number(r);Number.isNaN(o)||(s.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(s,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};si.ClientWritableStreamImpl=fO;var pO=class extends hO.Duplex{constructor(e,r){super({objectMode:!0}),this.serialize=e,this.deserialize=r}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Qm.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_read(e){var r;(r=this.call)===null||r===void 0||r.startRead()}_write(e,r,n){var i;let s={callback:n},o=Number(r);Number.isNaN(o)||(s.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(s,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};si.ClientDuplexStreamImpl=pO});var Zc=b(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.InterceptingListenerImpl=void 0;Kc.statusOrFromValue=Uve;Kc.statusOrFromError=Fve;Kc.isInterceptingListener=Bve;var $ve=Wt();function Uve(t){return{ok:!0,value:t}}function Fve(t){var e;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:(e=t.metadata)!==null&&e!==void 0?e:new $ve.Metadata})}}function Bve(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var mO=class{constructor(e,r){this.listener=e,this.nextListener=r,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextListener.onReceiveStatus(r)})}};Kc.InterceptingListenerImpl=mO});var bO=b(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.InterceptingCall=oi.RequesterBuilder=oi.ListenerBuilder=oi.InterceptorConfigurationError=void 0;oi.getInterceptingCall=Vve;var jve=Wt(),BY=Zc(),jY=Be(),zY=kv(),tg=class t extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,t)}};oi.InterceptorConfigurationError=tg;var _O=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};oi.ListenerBuilder=_O;var yO=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};oi.RequesterBuilder=yO;var gO={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveStatus:(t,e)=>{e(t)}},eg={start:(t,e,r)=>{r(t,e)},sendMessage:(t,e)=>{e(t)},halfClose:t=>{t()},cancel:t=>{t()}},SO=class{constructor(e,r){var n,i,s,o;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,r?this.requester={start:(n=r.start)!==null&&n!==void 0?n:eg.start,sendMessage:(i=r.sendMessage)!==null&&i!==void 0?i:eg.sendMessage,halfClose:(s=r.halfClose)!==null&&s!==void 0?s:eg.halfClose,cancel:(o=r.cancel)!==null&&o!==void 0?o:eg.cancel}:this.requester=eg}cancelWithStatus(e,r){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,r)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,r){var n,i,s,o,a,c;let l={onReceiveMetadata:(i=(n=r?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(r))!==null&&i!==void 0?i:(u=>{}),onReceiveMessage:(o=(s=r?.onReceiveMessage)===null||s===void 0?void 0:s.bind(r))!==null&&o!==void 0?o:(u=>{}),onReceiveStatus:(c=(a=r?.onReceiveStatus)===null||a===void 0?void 0:a.bind(r))!==null&&c!==void 0?c:(u=>{})};this.processingMetadata=!0,this.requester.start(e,l,(u,d)=>{var f,p,h;this.processingMetadata=!1;let m;if((0,BY.isInterceptingListener)(d))m=d;else{let E={onReceiveMetadata:(f=d.onReceiveMetadata)!==null&&f!==void 0?f:gO.onReceiveMetadata,onReceiveMessage:(p=d.onReceiveMessage)!==null&&p!==void 0?p:gO.onReceiveMessage,onReceiveStatus:(h=d.onReceiveStatus)!==null&&h!==void 0?h:gO.onReceiveStatus};m=new BY.InterceptingListenerImpl(E,l)}this.nextCall.start(u,m),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,r){this.processingMessage=!0,this.requester.sendMessage(r,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=r):(this.nextCall.sendMessageWithContext(e,n),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};oi.InterceptingCall=SO;function zve(t,e,r){var n,i;let s=(n=r.deadline)!==null&&n!==void 0?n:1/0,o=r.host,a=(i=r.parent)!==null&&i!==void 0?i:null,c=r.propagate_flags,l=r.credentials,u=t.createCall(e,s,o,a,c);return l&&u.setCredentials(l),u}var Qv=class{constructor(e,r){this.call=e,this.methodDefinition=r}cancelWithStatus(e,r){this.call.cancelWithStatus(e,r)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,r){let n;try{n=this.methodDefinition.requestSerialize(r)}catch(i){this.call.cancelWithStatus(jY.Status.INTERNAL,`Request message serialization failure: ${(0,zY.getErrorMessage)(i)}`);return}this.call.sendMessageWithContext(e,n)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,r){let n=null;this.call.start(e,{onReceiveMetadata:i=>{var s;(s=r?.onReceiveMetadata)===null||s===void 0||s.call(r,i)},onReceiveMessage:i=>{var s;let o;try{o=this.methodDefinition.responseDeserialize(i)}catch(a){n={code:jY.Status.INTERNAL,details:`Response message parsing error: ${(0,zY.getErrorMessage)(a)}`,metadata:new jve.Metadata},this.call.cancelWithStatus(n.code,n.details);return}(s=r?.onReceiveMessage)===null||s===void 0||s.call(r,o)},onReceiveStatus:i=>{var s,o;n?(s=r?.onReceiveStatus)===null||s===void 0||s.call(r,n):(o=r?.onReceiveStatus)===null||o===void 0||o.call(r,i)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},EO=class extends Qv{constructor(e,r){super(e,r)}start(e,r){var n,i;let s=!1,o={onReceiveMetadata:(i=(n=r?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(r))!==null&&i!==void 0?i:(a=>{}),onReceiveMessage:a=>{var c;s=!0,(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,a)},onReceiveStatus:a=>{var c,l;s||(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,null),(l=r?.onReceiveStatus)===null||l===void 0||l.call(r,a)}};super.start(e,o),this.call.startRead()}},vO=class extends Qv{};function Gve(t,e,r){let n=zve(t,r.path,e);return r.responseStream?new vO(n,r):new EO(n,r)}function Vve(t,e,r,n){if(t.clientInterceptors.length>0&&t.clientInterceptorProviders.length>0)throw new tg("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(t.callInterceptors.length>0&&t.callInterceptorProviders.length>0)throw new tg("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];t.callInterceptors.length>0||t.callInterceptorProviders.length>0?i=[].concat(t.callInterceptors,t.callInterceptorProviders.map(a=>a(e))).filter(a=>a):i=[].concat(t.clientInterceptors,t.clientInterceptorProviders.map(a=>a(e))).filter(a=>a);let s=Object.assign({},r,{method_definition:e});return i.reduceRight((a,c)=>l=>c(l,a),a=>Gve(n,a,e))(s)}});var xO=b(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});tb.Client=void 0;var Hi=FY(),qve=wO(),Hve=Cr(),oa=Be(),ud=Wt(),eb=bO(),ai=Symbol(),dd=Symbol(),fd=Symbol(),qs=Symbol();function TO(t){return typeof t=="function"}function pd(t){var e;return((e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
5
5
|
`).slice(1).join(`
|
|
@@ -19,9 +19,9 @@ ${e}`;return Object.assign(new Error(r),t,{stack:i})}var uO=class extends Dve.Ev
|
|
|
19
19
|
`;this.trace(`Received server trailers:
|
|
20
20
|
`+r);let n;try{n=eo.Metadata.fromHttp2Headers(e)}catch{n=new eo.Metadata}let i=n.getMap(),s;if(typeof i["grpc-status"]=="string"){let o=Number(i["grpc-status"]);this.trace("received status code "+o+" from server"),n.remove("grpc-status");let a="";if(typeof i["grpc-message"]=="string"){try{a=decodeURI(i["grpc-message"])}catch{a=i["grpc-message"]}n.remove("grpc-message"),this.trace('received status details string "'+a+'" from server')}s={code:o,details:a,metadata:n}}else this.httpStatusCode?(s=fk(this.httpStatusCode),s.metadata=n):s={code:nt.Status.UNKNOWN,details:"No status information received",metadata:n};this.endCall(s)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let r;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===nt.Status.OK?r=Qs.constants.NGHTTP2_NO_ERROR:r=Qs.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+r),this.http2Stream.close(r)}}cancelWithStatus(e,r){this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),this.endCall({code:e,details:r,metadata:new eo.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}getAuthContext(){return this.transport.getAuthContext()}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==nt.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length);let n=i=>{process.nextTick(()=>{var s;let o=nt.Status.UNAVAILABLE;i?.code==="ERR_STREAM_WRITE_AFTER_END"&&(o=nt.Status.INTERNAL),i&&this.cancelWithStatus(o,`Write error: ${i.message}`),(s=e.callback)===null||s===void 0||s.call(e)})};this.trace("sending data chunk of length "+r.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(r,n)}catch(i){this.endCall({code:nt.Status.UNAVAILABLE,details:`Write failed with error ${i.message}`,metadata:new eo.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};Xb.Http2SubchannelCall=pk});var o5=b(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});tT.Http2SubchannelConnector=void 0;var ll=J("http2"),iwe=J("tls"),Qb=ha(),xg=Be(),swe=lk(),kd=ct(),owe=ni(),eT=qr(),hk=Ir(),awe=J("net"),cwe=s5(),lwe=Fb(),mk="transport",uwe="transport_flowctrl",dwe=LP().version,{HTTP2_HEADER_AUTHORITY:fwe,HTTP2_HEADER_CONTENT_TYPE:pwe,HTTP2_HEADER_METHOD:hwe,HTTP2_HEADER_PATH:mwe,HTTP2_HEADER_TE:gwe,HTTP2_HEADER_USER_AGENT:_we}=ll.constants,ywe=2e4,Swe=Buffer.from("too_many_pings","ascii"),gk=class{constructor(e,r,n,i){this.session=e,this.options=n,this.remoteName=i,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,eT.subchannelAddressToString)(r),n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new Qb.ChannelzCallTrackerStub):this.streamTracker=new Qb.ChannelzCallTracker,this.channelzRef=(0,Qb.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[n["grpc.primary_user_agent"],`grpc-node-js/${dwe}`,n["grpc.secondary_user_agent"]].filter(s=>s).join(" "),"grpc.keepalive_time_ms"in n?this.keepaliveTimeMs=n["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in n?this.keepaliveTimeoutMs=n["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=ywe,"grpc.keepalive_permit_without_calls"in n?this.keepaliveWithoutCalls=n["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(s,o,a)=>{let c=!1;s===ll.constants.NGHTTP2_ENHANCE_YOUR_CALM&&a&&a.equals(Swe)&&(c=!0),this.trace("connection closed by GOAWAY with code "+s+" and data "+a?.toString()),this.reportDisconnectToOwner(c)}),e.once("error",s=>{this.trace("connection closed with error "+s.message),this.handleDisconnect()}),e.socket.once("close",s=>{this.trace("connection closed. hadError="+s),this.handleDisconnect()}),kd.isTracerEnabled(mk)&&(e.on("remoteSettings",s=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))}),e.on("localSettings",s=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof iwe.TLSSocket?this.authContext={transportSecurityType:"ssl",sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){var e,r,n;let i=this.session.socket,s=i.remoteAddress?(0,eT.stringToSubchannelAddress)(i.remoteAddress,i.remotePort):null,o=i.localAddress?(0,eT.stringToSubchannelAddress)(i.localAddress,i.localPort):null,a;if(this.session.encrypted){let l=i,u=l.getCipher(),d=l.getCertificate(),f=l.getPeerCertificate();a={cipherSuiteStandardName:(e=u.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:d&&"raw"in d?d.raw:null,remoteCertificate:f&&"raw"in f?f.raw:null}}else a=null;return{remoteAddress:s,localAddress:o,security:a,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(r=this.session.state.localWindowSize)!==null&&r!==void 0?r:null,remoteFlowControlWindow:(n=this.session.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(e){kd.trace(xg.LogVerbosity.DEBUG,mk,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){kd.trace(xg.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){kd.trace(xg.LogVerbosity.DEBUG,uwe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){kd.trace(xg.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(r=>r(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,r;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(r=(e=this.keepaliveTimer).unref)===null||r===void 0||r.call(e);let n="";try{this.session.ping((s,o,a)=>{this.clearKeepaliveTimeout(),s?(this.keepaliveTrace("Ping failed with error "+s.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(n="Ping returned false")}catch(i){n=(i instanceof Error?i.message:"")||"Unknown error"}n&&(this.keepaliveTrace("Ping send failed: "+n),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,r;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(r=(e=this.keepaliveTimer).unref)===null||r===void 0||r.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,r,n,i,s){let o=e.toHttp2Headers();o[fwe]=r,o[_we]=this.userAgent,o[pwe]="application/grpc",o[hwe]="POST",o[mwe]=n,o[gwe]="trailers";let a;try{a=this.session.request(o)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let c,l;return this.channelzEnabled?(this.streamTracker.addCallStarted(),c={addMessageSent:()=>{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=s.addMessageSent)===null||u===void 0||u.call(s)},addMessageReceived:()=>{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=s.addMessageReceived)===null||u===void 0||u.call(s)},onCallEnd:u=>{var d;(d=s.onCallEnd)===null||d===void 0||d.call(s,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(d=s.onStreamEnd)===null||d===void 0||d.call(s,u)}}):c={addMessageSent:()=>{var u;(u=s.addMessageSent)===null||u===void 0||u.call(s)},addMessageReceived:()=>{var u;(u=s.addMessageReceived)===null||u===void 0||u.call(s)},onCallEnd:u=>{var d;(d=s.onCallEnd)===null||d===void 0||d.call(s,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;(d=s.onStreamEnd)===null||d===void 0||d.call(s,u)}},l=new cwe.Http2SubchannelCall(a,c,i,this,(0,lwe.getNextCallNumber)()),this.addActiveCall(l),l}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,Qb.unregisterChannelzRef)(this.channelzRef)}},_k=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){kd.trace(xg.LogVerbosity.DEBUG,mk,(0,hk.uriToString)(this.channelTarget)+" "+e)}createSession(e,r,n){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((i,s)=>{var o,a,c,l,u,d,f,p;let h=null,m=this.channelTarget;if("grpc.http_connect_target"in n){let j=(0,hk.parseUri)(n["grpc.http_connect_target"]);j&&(m=j,h=(0,hk.uriToString)(j))}let E=e.secure?"https":"http",T=(0,owe.getDefaultAuthority)(m),v=()=>{var j;(j=this.session)===null||j===void 0||j.destroy(),this.session=null,setImmediate(()=>{O||(O=!0,s(`${I.trim()} (${new Date().toISOString()})`))})},A=j=>{var _;(_=this.session)===null||_===void 0||_.destroy(),I=j.message,this.trace("connection failed with error "+I),O||(O=!0,s(`${I} (${new Date().toISOString()})`))},S={createConnection:(j,_)=>e.socket,settings:{initialWindowSize:(l=(o=n["grpc-node.flow_control_window"])!==null&&o!==void 0?o:(c=(a=ll.getDefaultSettings)===null||a===void 0?void 0:a.call(ll))===null||c===void 0?void 0:c.initialWindowSize)!==null&&l!==void 0?l:65535},maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER,maxSessionMemory:(u=n["grpc-node.max_session_memory"])!==null&&u!==void 0?u:Number.MAX_SAFE_INTEGER},R=ll.connect(`${E}://${T}`,S),P=(p=(f=(d=ll.getDefaultSettings)===null||d===void 0?void 0:d.call(ll))===null||f===void 0?void 0:f.initialWindowSize)!==null&&p!==void 0?p:65535,L=n["grpc-node.flow_control_window"];this.session=R;let I="Failed to connect",O=!1;R.unref(),R.once("remoteSettings",()=>{var j;if(L&&L>P)try{R.setLocalWindowSize(L)}catch{let se=L-((j=R.state.localWindowSize)!==null&&j!==void 0?j:P);se>0&&R.incrementWindowSize(se)}R.removeAllListeners(),e.socket.removeListener("close",v),e.socket.removeListener("error",A),i(new gk(R,r,n,h)),this.session=null}),R.once("close",v),R.once("error",A),e.socket.once("close",v),e.socket.once("error",A)})}tcpConnect(e,r){return(0,swe.getProxiedConnection)(e,r).then(n=>n||new Promise((i,s)=>{let o=()=>{s(new Error("Socket closed"))},a=l=>{s(l)},c=awe.connect(e,()=>{c.removeListener("close",o),c.removeListener("error",a),i(c)});c.once("close",o),c.once("error",a)}))}async connect(e,r,n){if(this.isShutdown)return Promise.reject();let i=null,s=null,o=(0,eT.subchannelAddressToString)(e);try{return this.trace(o+" Waiting for secureConnector to be ready"),await r.waitForReady(),this.trace(o+" secureConnector is ready"),i=await this.tcpConnect(e,n),i.setNoDelay(),this.trace(o+" Established TCP connection"),s=await r.connect(i),this.trace(o+" Established secure connection"),this.createSession(s,e,n)}catch(a){throw i?.destroy(),s?.socket.destroy(),a}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};tT.Http2SubchannelConnector=_k});var a5=b(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.SubchannelPool=void 0;Rg.getSubchannelPool=Rwe;var Ewe=OY(),vwe=ZZ(),bwe=qr(),Twe=Ir(),Awe=o5(),xwe=1e4,wg=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let r in this.pool){let i=this.pool[r].filter(s=>!s.subchannel.unrefIfOneRef());i.length>0&&(e=!1),this.pool[r]=i}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,r;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},xwe),(r=(e=this.cleanupTimer).unref)===null||r===void 0||r.call(e))}getOrCreateSubchannel(e,r,n,i){this.ensureCleanupTask();let s=(0,Twe.uriToString)(e);if(s in this.pool){let a=this.pool[s];for(let c of a)if((0,bwe.subchannelAddressEqual)(r,c.subchannelAddress)&&(0,Ewe.channelOptionsEqual)(n,c.channelArguments)&&i._equals(c.channelCredentials))return c.subchannel}let o=new vwe.Subchannel(e,r,n,i,new Awe.Http2SubchannelConnector(e));return s in this.pool||(this.pool[s]=[]),this.pool[s].push({subchannelAddress:r,channelArguments:n,channelCredentials:i,subchannel:o}),o.ref(),o}};Rg.SubchannelPool=wg;var wwe=new wg;function Rwe(t){return t?wwe:new wg}});var u5=b(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});iT.LoadBalancingCall=void 0;var c5=Cr(),rT=Be(),l5=Id(),nT=Wt(),Ig=Gs(),Iwe=Ir(),Cwe=ct(),yk=Sg(),Pwe=J("http2"),Owe="load_balancing_call",Sk=class{constructor(e,r,n,i,s,o,a){var c,l;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=s,this.deadline=o,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split("/"),d="";u.length>=2&&(d=u[1]);let f=(l=(c=(0,Iwe.splitHostPort)(this.host))===null||c===void 0?void 0:c.host)!==null&&l!==void 0?l:"localhost";this.serviceUrl=`https://${f}/${d}`,this.startTime=new Date}getDeadlineInfo(){var e,r;let n=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&n.push("wait_for_ready"),n.push(`LB pick: ${(0,l5.formatDateDifference)(this.startTime,this.childStartTime)}`)),n.push(...this.child.getDeadlineInfo()),n):(!((r=this.metadata)===null||r===void 0)&&r.getOptions().waitForReady&&n.push("wait_for_ready"),n.push("Waiting for LB pick"),n)}trace(e){Cwe.trace(rT.LogVerbosity.DEBUG,Owe,"["+this.callNumber+"] "+e)}outputStatus(e,r){var n,i;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let s=Object.assign(Object.assign({},e),{progress:r});(n=this.listener)===null||n===void 0||n.onReceiveStatus(s),(i=this.onCallEnded)===null||i===void 0||i.call(this,s.code,s.details,s.metadata)}}doPick(){var e,r;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let n=this.metadata.clone(),i=this.channel.doPick(n,this.callConfig.pickInformation),s=i.subchannel?"("+i.subchannel.getChannelzRef().id+") "+i.subchannel.getAddress():""+i.subchannel;switch(this.trace("Pick result: "+Ig.PickResultType[i.pickResultType]+" subchannel: "+s+" status: "+((e=i.status)===null||e===void 0?void 0:e.code)+" "+((r=i.status)===null||r===void 0?void 0:r.details)),i.pickResultType){case Ig.PickResultType.COMPLETE:this.credentials.compose(i.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(l=>{var u;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(n.merge(l),n.get("authorization").length>1&&this.outputStatus({code:rT.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new nT.Metadata},"PROCESSED"),i.subchannel.getConnectivityState()!==c5.ConnectivityState.READY){this.trace("Picked subchannel "+s+" has state "+c5.ConnectivityState[i.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&n.set("grpc-timeout",(0,l5.getDeadlineTimeoutString)(this.deadline));try{this.child=i.subchannel.getRealSubchannel().createCall(n,this.host,this.methodName,{onReceiveMetadata:d=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(d)},onReceiveMessage:d=>{this.trace("Received message"),this.listener.onReceiveMessage(d)},onReceiveStatus:d=>{this.trace("Received status"),d.rstCode===Pwe.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(d,"REFUSED"):this.outputStatus(d,"PROCESSED")}}),this.childStartTime=new Date}catch(d){this.trace("Failed to start call on picked subchannel "+s+" with error "+d.message),this.outputStatus({code:rT.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+d.message,metadata:new nT.Metadata},"NOT_STARTED");return}(u=i.onCallStarted)===null||u===void 0||u.call(i),this.onCallEnded=i.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},l=>{let{code:u,details:d}=(0,yk.restrictControlPlaneStatusCode)(typeof l.code=="number"?l.code:rT.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${l.message}`);this.outputStatus({code:u,details:d,metadata:new nT.Metadata},"PROCESSED")});break;case Ig.PickResultType.DROP:let{code:a,details:c}=(0,yk.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:a,details:c,metadata:i.status.metadata},"DROP")});break;case Ig.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:l,details:u}=(0,yk.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:l,details:u,metadata:i.status.metadata},"PROCESSED")})}break;case Ig.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,r){var n;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new nT.Metadata},"PROCESSED")}getPeer(){var e,r;return(r=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.channel.getTarget()}start(e,r){this.trace("start called"),this.listener=r,this.metadata=e,this.doPick()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length),this.child?this.child.sendMessageWithContext(e,r):this.pendingMessage={context:e,message:r}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}};iT.LoadBalancingCall=Sk});var f5=b(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});sT.ResolvingCall=void 0;var Nwe=$v(),ul=Be(),dl=Id(),d5=Wt(),kwe=ct(),Mwe=Sg(),Dwe="resolving_call",Ek=class{constructor(e,r,n,i,s){this.channel=e,this.method=r,this.filterStackFactory=i,this.callNumber=s,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=Nwe.CallCredentials.createEmpty(),this.deadline=n.deadline,this.host=n.host,n.parentCall&&(n.flags&ul.Propagate.CANCELLATION&&n.parentCall.on("cancelled",()=>{this.cancelWithStatus(ul.Status.CANCELLED,"Cancelled by parent call")}),n.flags&ul.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+n.parentCall.getDeadline()),this.deadline=(0,dl.minDeadline)(this.deadline,n.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){kwe.trace(ul.LogVerbosity.DEBUG,Dwe,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,dl.deadlineToString)(this.deadline));let e=(0,dl.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let r=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(ul.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let n=[],i=new Date;n.push(`Deadline exceeded after ${(0,dl.formatDateDifference)(this.deadlineStartTime,i)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&n.push(`name resolution: ${(0,dl.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&n.push(`metadata filters: ${(0,dl.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):n.push("waiting for metadata filters")):n.push("waiting for name resolution"),this.child&&n.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(ul.Status.DEADLINE_EXCEEDED,n.join(","))};e<=0?process.nextTick(r):this.deadlineTimer=setTimeout(r,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let r=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+r.code+' details="'+r.details+'"'),this.statusWatchers.forEach(n=>n(r)),process.nextTick(()=>{var n;(n=this.listener)===null||n===void 0||n.onReceiveStatus(r)})}}sendMessageOnChild(e,r){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let n=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags})).then(i=>{this.writeFilterPending=!1,n.sendMessageWithContext(e,i.message),this.pendingHalfClose&&n.halfClose()},i=>{this.cancelWithStatus(i.code,i.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let r=e.config;if(r.status!==ul.Status.OK){let{code:n,details:i}=(0,Mwe.restrictControlPlaneStatusCode)(r.status,"Failed to route call to method "+this.method);this.outputStatus({code:n,details:i,metadata:new d5.Metadata});return}if(r.methodConfig.timeout){let n=new Date;n.setSeconds(n.getSeconds()+r.methodConfig.timeout.seconds),n.setMilliseconds(n.getMilliseconds()+r.methodConfig.timeout.nanos/1e6),this.deadline=(0,dl.minDeadline)(this.deadline,n),this.runDeadlineTimer()}this.filterStackFactory.push(r.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(n=>{this.child=this.channel.createRetryingCall(r,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(n,{onReceiveMetadata:i=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(i))},onReceiveMessage:i=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(i).then(s=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(s),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},s=>{this.cancelWithStatus(s.code,s.details)})},onReceiveStatus:i=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=i:this.outputStatus(i)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},n=>{this.outputStatus(n)})}reportResolverError(e){var r;!((r=this.metadata)===null||r===void 0)&&r.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,r){var n;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new d5.Metadata})}getPeer(){var e,r;return(r=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.channel.getTarget()}start(e,r){this.trace("start called"),this.metadata=e.clone(),this.listener=r,this.getConfig()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length),this.child?this.sendMessageOnChild(e,r):this.pendingMessage={context:e,message:r}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}};sT.ResolvingCall=Ek});var p5=b(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.RetryingCall=_a.MessageBufferTracker=_a.RetryThrottler=void 0;var oT=Be(),Lwe=Id(),$we=Wt(),Uwe=ct(),Fwe="retrying_call",bk=class{constructor(e,r,n){this.maxTokens=e,this.tokenRatio=r,n?this.tokens=n.tokens*(e/n.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};_a.RetryThrottler=bk;var Tk=class{constructor(e,r){this.totalLimit=e,this.limitPerCall=r,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,r){var n;let i=(n=this.allocatedPerCall.get(r))!==null&&n!==void 0?n:0;return this.limitPerCall-i<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(r,i+e),this.totalAllocated+=e,!0)}free(e,r){var n;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let i=(n=this.allocatedPerCall.get(r))!==null&&n!==void 0?n:0;if(i<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > allocated for call ${i}`);this.allocatedPerCall.set(r,i-e)}freeAll(e){var r;let n=(r=this.allocatedPerCall.get(e))!==null&&r!==void 0?r:0;if(this.totalAllocated<n)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${n} > total allocated ${this.totalAllocated}`);this.totalAllocated-=n,this.allocatedPerCall.delete(e)}};_a.MessageBufferTracker=Tk;var vk="grpc-previous-rpc-attempts",Bwe=5,Ak=class{constructor(e,r,n,i,s,o,a,c,l){var u;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=s,this.deadline=o,this.callNumber=a,this.bufferTracker=c,this.retryThrottler=l,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let d=(u=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&u!==void 0?u:Bwe;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(r.methodConfig.retryPolicy){this.state="RETRY";let f=r.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(f.initialBackoff.substring(0,f.initialBackoff.length-1)),this.maxAttempts=Math.min(f.maxAttempts,d)}else r.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(r.methodConfig.hedgingPolicy.maxAttempts,d)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],r=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),r.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,Lwe.formatDateDifference)(this.startTime,r.startTime)}`),e.push(...r.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){Uwe.trace(oT.LogVerbosity.DEBUG,Fwe,"["+this.callNumber+"] "+e)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var r;(r=this.listener)===null||r===void 0||r.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,r){this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),this.reportStatus({code:e,details:r,metadata:new $we.Metadata});for(let{call:n}of this.underlyingCalls)n.cancelWithStatus(e,r)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var r;return(r=this.writeBuffer[e-this.writeBufferOffset])!==null&&r!==void 0?r:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e;this.underlyingCalls[this.committedCallIndex].state==="COMPLETED"?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let r=this.writeBufferOffset;r<e;r++){let n=this.getBufferEntry(r);n.allocated&&this.bufferTracker.free(n.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var r,n;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(n=(r=this.callConfig).onCommitted)===null||n===void 0||n.call(r),this.committedCallIndex=e;for(let i=0;i<this.underlyingCalls.length;i++)i!==e&&this.underlyingCalls[i].state!=="COMPLETED"&&(this.underlyingCalls[i].state="COMPLETED",this.underlyingCalls[i].call.cancelWithStatus(oT.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,r=-1;for(let[n,i]of this.underlyingCalls.entries())i.state==="ACTIVE"&&i.nextMessageToSend>e&&(e=i.nextMessageToSend,r=n);r===-1?this.state="TRANSPARENT_ONLY":this.commitCall(r)}isStatusCodeInList(e,r){return e.some(n=>{var i;return n===r||n.toString().toLowerCase()===((i=oT.Status[r])===null||i===void 0?void 0:i.toLowerCase())})}getNextRetryJitter(){return Math.random()*(1.2-.8)+.8}getNextRetryBackoffMs(){var e;let r=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!r)return 0;let i=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,s=Number(r.maxBackoff.substring(0,r.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*r.backoffMultiplier,s),i}maybeRetryCall(e,r){if(this.state!=="RETRY"){r(!1);return}if(this.attempts>=this.maxAttempts){r(!1);return}let n;if(e===null)n=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",r(!1);return}else n=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var i,s;if(this.state!=="RETRY"){r(!1);return}!((s=(i=this.retryThrottler)===null||i===void 0?void 0:i.canRetryCall())!==null&&s!==void 0)||s?(r(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),r(!1))},n)}countActiveCalls(){let e=0;for(let r of this.underlyingCalls)r?.state==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,r,n){var i,s,o;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(r),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((i=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&i!==void 0?i:[],e.code)){(s=this.retryThrottler)===null||s===void 0||s.addCallFailed();let a;if(n===null)a=0;else if(n<0){this.state="TRANSPARENT_ONLY",this.commitCall(r),this.reportStatus(e);return}else a=n;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(r),this.reportStatus(e))},a)}else this.commitCall(r),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((o=this.retryThrottler)===null||o===void 0||o.addCallFailed(),this.maybeRetryCall(n,a=>{a||(this.commitCall(r),this.reportStatus(e))})):(this.commitCall(r),this.reportStatus(e));break}}getPushback(e){let r=e.get("grpc-retry-pushback-ms");if(r.length===0)return null;try{return parseInt(r[0])}catch{return-1}}handleChildStatus(e,r){var n;if(this.underlyingCalls[r].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[r].call.getCallNumber()+"] in state "+this.underlyingCalls[r].state),this.underlyingCalls[r].state="COMPLETED",e.code===oT.Status.OK){(n=this.retryThrottler)===null||n===void 0||n.addCallSucceeded(),this.commitCall(r),this.reportStatus(e);return}if(this.state==="NO_RETRY"){this.commitCall(r),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let i=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,r,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(r),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,r,i);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,r,n;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let i=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let s=(e=i.hedgingDelay)!==null&&e!==void 0?e:"0s",o=Number(s.substring(0,s.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},o*1e3),(n=(r=this.hedgingTimer).unref)===null||n===void 0||n.call(r)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);let r=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let n=this.attempts-1,i=this.initialMetadata.clone();n>0&&i.set(vk,`${n}`);let s=!1;e.start(i,{onReceiveMetadata:o=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(r),s=!0,n>0&&o.set(vk,`${n}`),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMetadata(o)},onReceiveMessage:o=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(r),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMessage(o)},onReceiveStatus:o=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!s&&n>0&&o.metadata.set(vk,`${n}`),this.handleChildStatus(o,r)}}),this.sendNextChildMessage(r),this.readStarted&&e.startRead()}start(e,r){this.trace("start called"),this.listener=r,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e,r){var n,i;(i=(n=this.getBufferEntry(r)).callback)===null||i===void 0||i.call(n),this.clearSentMessages();let s=this.underlyingCalls[e];s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let r=this.underlyingCalls[e];if(r.state==="COMPLETED")return;let n=r.nextMessageToSend;if(this.getBufferEntry(n)){let i=this.getBufferEntry(n);switch(i.entryType){case"MESSAGE":r.call.sendMessageWithContext({callback:o=>{this.handleChildWriteCompleted(e,n)}},i.message.message),this.getBufferEntry(n+1).entryType==="HALF_CLOSE"&&(this.trace("Sending halfClose immediately after message to child ["+r.call.getCallNumber()+"] - optimizing for unary/final message"),r.nextMessageToSend+=1,r.call.halfClose());break;case"HALF_CLOSE":r.nextMessageToSend+=1,r.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length);let n={message:r,flags:e.flags},i=this.getNextBufferIndex(),s={entryType:"MESSAGE",message:n,allocated:this.bufferTracker.allocate(r.length,this.callNumber)};if(this.writeBuffer.push(s),s.allocated){process.nextTick(()=>{var o;(o=e.callback)===null||o===void 0||o.call(e)});for(let[o,a]of this.underlyingCalls.entries())a.state==="ACTIVE"&&a.nextMessageToSend===i&&a.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(o,i)}},r)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let o=this.underlyingCalls[this.committedCallIndex];s.callback=e.callback,o.state==="ACTIVE"&&o.nextMessageToSend===i&&o.call.sendMessageWithContext({callback:a=>{this.handleChildWriteCompleted(this.committedCallIndex,i)}},r)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let r of this.underlyingCalls)r?.state==="ACTIVE"&&(r.nextMessageToSend===e||r.nextMessageToSend===e-1)&&(this.trace("Sending halfClose immediately to child ["+r.call.getCallNumber()+"] - all messages already sent"),r.nextMessageToSend+=1,r.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getAuthContext():null}};_a.RetryingCall=Ak});var Cg=b(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});aT.BaseSubchannelWrapper=void 0;var xk=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,e.addHealthStateWatcher(r=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref(),this.refcount+=1}unref(){this.child.unref(),this.refcount-=1,this.refcount===0&&this.destroy()}destroy(){for(let e of this.dataWatchers)e.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}addDataWatcher(e){e.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}};aT.BaseSubchannelWrapper=xk});var kk=b(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.InternalChannel=fl.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var jwe=ad(),zwe=PY(),Gwe=a5(),Ik=Gs(),Vwe=Wt(),ya=Be(),qwe=qb(),Hwe=ZN(),h5=ni(),cT=ct(),Wwe=lk(),lT=Ir(),Bn=Cr(),Pg=ha(),Ywe=u5(),Kwe=Id(),Zwe=f5(),wk=Fb(),Jwe=Sg(),Rk=p5(),Xwe=Cg(),Qwe=2147483647,eRe=1e3,tRe=1800*1e3,uT=new Map,rRe=1<<24,nRe=1<<20,Ck=class extends Xwe.BaseSubchannelWrapper{constructor(e,r){super(e),this.channel=r,this.refCount=0,this.subchannelStateListener=(n,i,s,o)=>{r.throttleKeepalive(o)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},Pk=class{pick(e){return{pickResultType:Ik.PickResultType.DROP,status:{code:ya.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new Vwe.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};fl.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var Ok=class{constructor(e){this.target=e,this.trace=new Pg.ChannelzTrace,this.callTracker=new Pg.ChannelzCallTracker,this.childrenTracker=new Pg.ChannelzChildrenTracker,this.state=Bn.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},Nk=class{constructor(e,r,n){var i,s,o,a,c,l;if(this.credentials=r,this.options=n,this.connectivityState=Bn.ConnectivityState.IDLE,this.currentPicker=new Ik.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof jwe.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new Ok(e);let u=(0,lT.parseUri)(e);if(u===null)throw new Error(`Could not parse target name "${e}"`);let d=(0,h5.mapUriDefaultScheme)(u);if(d===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,Pg.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,h5.getDefaultAuthority)(d);let f=(0,Wwe.mapProxyName)(d,n);this.target=f.target,this.options=Object.assign({},this.options,f.extraOptions),this.subchannelPool=(0,Gwe.getSubchannelPool)(((i=this.options["grpc.use_local_subchannel_pool"])!==null&&i!==void 0?i:0)===0),this.retryBufferTracker=new Rk.MessageBufferTracker((s=this.options["grpc.retry_buffer_size"])!==null&&s!==void 0?s:rRe,(o=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&o!==void 0?o:nRe),this.keepaliveTime=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:-1,this.idleTimeoutMs=Math.max((c=this.options["grpc.client_idle_timeout_ms"])!==null&&c!==void 0?c:tRe,eRe);let p={createSubchannel:(m,E)=>{let T={};for(let[S,R]of Object.entries(E))S.startsWith(fl.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(T[S]=R);let v=this.subchannelPool.getOrCreateSubchannel(this.target,m,T,this.credentials);return v.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",v.getChannelzRef()),new Ck(v,this)},updateState:(m,E)=>{this.currentPicker=E;let T=this.pickQueue.slice();this.pickQueue=[],T.length>0&&this.callRefTimerUnref();for(let v of T)v.doPick();this.updateState(m)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:m=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(m)},removeChannelzChild:m=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(m)}};this.resolvingLoadBalancer=new zwe.ResolvingLoadBalancer(this.target,p,this.options,(m,E)=>{var T;m.retryThrottling?uT.set(this.getTarget(),new Rk.RetryThrottler(m.retryThrottling.maxTokens,m.retryThrottling.tokenRatio,uT.get(this.getTarget()))):uT.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(T=this.configSelector)===null||T===void 0||T.unref(),this.configSelector=E,this.currentResolutionError=null,process.nextTick(()=>{let v=this.configSelectionQueue;this.configSelectionQueue=[],v.length>0&&this.callRefTimerUnref();for(let A of v)A.getConfig()})},m=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+m.code+' and details "'+m.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,Jwe.restrictControlPlaneStatusCode)(m.code,m.details)),{metadata:m.metadata}));let E=this.configSelectionQueue;this.configSelectionQueue=[],E.length>0&&this.callRefTimerUnref();for(let T of E)T.reportResolverError(m)}),this.filterStackFactory=new qwe.FilterStackFactory([new Hwe.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(n,void 0,2));let h=new Error;(0,cT.isTracerEnabled)("channel_stacktrace")&&(0,cT.trace)(ya.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
|
|
21
21
|
`+((l=h.stack)===null||l===void 0?void 0:l.substring(h.stack.indexOf(`
|
|
22
|
-
`)+1))),this.lastActivityTimestamp=new Date}trace(e,r){(0,cT.trace)(r??ya.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,lT.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},Qwe)),!((r=(e=this.callRefTimer).hasRef)===null||r===void 0)&&r.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(i=(n=this.callRefTimer).ref)===null||i===void 0||i.call(n))}callRefTimerUnref(){var e,r,n;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(r=this.callRefTimer)===null||r===void 0?void 0:r.unref)===null||n===void 0||n.call(r))}removeConnectivityStateWatcher(e){let r=this.connectivityStateWatchers.findIndex(n=>n===e);r>=0&&this.connectivityStateWatchers.splice(r,1)}updateState(e){(0,cT.trace)(ya.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,lT.uriToString)(this.target)+" "+Bn.ConnectivityState[this.connectivityState]+" -> "+Bn.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Bn.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let r=this.connectivityStateWatchers.slice();for(let n of r)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==Bn.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let r of this.wrappedSubchannels)r.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,r){return this.currentPicker.pick({metadata:e,extraPickInfo:r})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,r){return this.connectivityState!==Bn.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,r,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(Bn.ConnectivityState.IDLE),this.currentPicker=new Ik.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var r,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let s=new Date().valueOf()-this.lastActivityTimestamp.valueOf();s>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-s)},e),(n=(r=this.idleTimer).unref)===null||n===void 0||n.call(r)}maybeStartIdleTimer(){this.connectivityState!==Bn.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===ya.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,n,i,s){let o=(0,wk.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+o+'] method="'+r+'"'),new Ywe.LoadBalancingCall(this,e,r,n,i,s,o)}createRetryingCall(e,r,n,i,s){let o=(0,wk.getNextCallNumber)();return this.trace("createRetryingCall ["+o+'] method="'+r+'"'),new Rk.RetryingCall(this,e,r,n,i,s,o,this.retryBufferTracker,uT.get(this.getTarget()))}createResolvingCall(e,r,n,i,s){let o=(0,wk.getNextCallNumber)();this.trace("createResolvingCall ["+o+'] method="'+e+'", deadline='+(0,Kwe.deadlineToString)(r));let a={deadline:r,flags:s??ya.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new Zwe.ResolvingCall(this,e,a,this.filterStackFactory.clone(),o);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Bn.ConnectivityState.SHUTDOWN),this.currentPicker=new Pk;for(let r of this.configSelectionQueue)r.cancelWithStatus(ya.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(ya.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,Pg.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,lT.uriToString)(this.target)}getConnectivityState(e){let r=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),r}watchConnectivityState(e,r,n){if(this.connectivityState===Bn.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(r!==1/0){let o=r instanceof Date?r:new Date(r),a=new Date;if(r===-1/0||o<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(s),n(new Error("Deadline passed without connectivity state change"))},o.getTime()-a.getTime())}let s={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(s)}getChannelzRef(){return this.channelzRef}createCall(e,r,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Bn.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,n,i,s)}getOptions(){return this.options}};fl.InternalChannel=Nk});var wO=b(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});dT.ChannelImplementation=void 0;var iRe=ad(),sRe=kk(),Mk=class{constructor(e,r,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof iRe.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new sRe.InternalChannel(e,r,n)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,r,n){this.internalChannel.watchConnectivityState(e,r,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,r,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,r,n,i,s)}};dT.ChannelImplementation=Mk});var g5=b(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.ServerDuplexStreamImpl=gi.ServerWritableStreamImpl=gi.ServerReadableStreamImpl=gi.ServerUnaryCallImpl=void 0;gi.serverErrorToStatus=jk;var oRe=J("events"),Fk=J("stream"),Bk=Be(),m5=Wt();function jk(t,e){var r;let n={code:Bk.Status.UNKNOWN,details:"message"in t?t.message:"Unknown Error",metadata:(r=e??t.metadata)!==null&&r!==void 0?r:null};return"code"in t&&typeof t.code=="number"&&Number.isInteger(t.code)&&(n.code=t.code,"details"in t&&typeof t.details=="string"&&(n.details=t.details)),n}var Dk=class extends oRe.EventEmitter{constructor(e,r,n,i){super(),this.path=e,this.call=r,this.metadata=n,this.request=i,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};gi.ServerUnaryCallImpl=Dk;var Lk=class extends Fk.Readable{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};gi.ServerReadableStreamImpl=Lk;var $k=class extends Fk.Writable{constructor(e,r,n,i){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.request=i,this.pendingStatus={code:Bk.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new m5.Metadata,this.on("error",s=>{this.pendingStatus=jk(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};gi.ServerWritableStreamImpl=$k;var Uk=class extends Fk.Duplex{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.pendingStatus={code:Bk.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new m5.Metadata,this.on("error",i=>{this.pendingStatus=jk(i),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};gi.ServerDuplexStreamImpl=Uk});var fT=b(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.ServerCredentials=void 0;Md.createCertificateProviderServerCredentials=aRe;Md.createServerCredentialsWithInterceptors=cRe;var zk=YP(),pl=class{constructor(e,r){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=r??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let r of this.watchers)r(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new Gk}static createSsl(e,r,n=!1){var i;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(r))throw new TypeError("keyCertPairs must be an array");if(typeof n!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let s=[],o=[];for(let a=0;a<r.length;a++){let c=r[a];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${a}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${a}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${a}].cert_chain must be a Buffer`);s.push(c.cert_chain),o.push(c.private_key)}return new Vk({requestCert:n,ciphers:zk.CIPHER_SUITES},{ca:(i=e??(0,zk.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:s,key:o})}};Md.ServerCredentials=pl;var Gk=class t extends pl{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},Vk=class t extends pl{constructor(e,r){super(e,r),this.options=Object.assign(Object.assign({},e),r)}_equals(e){if(this===e)return!0;if(!(e instanceof t))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let r=0;r<this.options.cert.length;r++){let n=this.options.cert[r],i=e.options.cert[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let r=0;r<this.options.key.length;r++){let n=this.options.key[r],i=e.options.key[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},qk=class t extends pl{constructor(e,r,n){super({requestCert:r!==null,rejectUnauthorized:n,ciphers:zk.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=r,this.requireClientCertificate=n,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var r;this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var r;super._removeWatcher(e),this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function aRe(t,e,r){return new qk(t,e,r)}var Hk=class t extends pl{constructor(e,r){super({}),this.childCredentials=e,this.interceptors=r}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof t)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r]!==e.interceptors[r])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function cRe(t,e){return new Hk(t,e)}});var Og=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.durationMessageToDuration=lRe;to.msToDuration=uRe;to.durationToMs=dRe;to.isDuration=fRe;to.isDurationMessage=pRe;to.parseDuration=mRe;to.durationToString=gRe;function lRe(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function uRe(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function dRe(t){return t.seconds*1e3+t.nanos/1e6|0}function fRe(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function pRe(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var hRe=/^(\d+)(?:\.(\d+))?s$/;function mRe(t){let e=t.match(hRe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function gRe(t){if(t.nanos===0)return`${t.seconds}s`;let e;return t.nanos%1e6===0?e=1e6:t.nanos%1e3===0?e=1e3:e=1,`${t.seconds}.${t.nanos/e}s`}});var hT=b(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.OrcaOobMetricsSubchannelWrapper=fn.GRPC_METRICS_HEADER=fn.ServerMetricRecorder=fn.PerRequestMetricRecorder=void 0;fn.createOrcaClient=E5;fn.createMetricsReader=TRe;var _Re=nb(),Wk=Og(),yRe=ad(),SRe=Cg(),_5=Be(),ERe=cd(),vRe=Cr(),y5=null;function pT(){if(y5)return y5;let t=MN().loadSync,e=t("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,_Re.loadPackageDefinition)(e)}var Yk=class{constructor(){this.message={}}recordRequestCostMetric(e,r){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=r}recordUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}recordNamedMetric(e,r){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=r}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return pT().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};fn.PerRequestMetricRecorder=Yk;var bRe=3e4,Kk=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,Wk.durationToMs)((0,Wk.durationMessageToDuration)(e.request.report_interval)):bRe,n=setInterval(()=>{e.write(this.message)},r);e.on("cancelled",()=>{clearInterval(n)})}}}putUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var r;(r=this.message.utilization)===null||r===void 0||delete r[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let r=pT().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};fn.ServerMetricRecorder=Kk;function E5(t){let e=pT().xds.service.orca.v3.OpenRcaService;return new e("unused",yRe.ChannelCredentials.createInsecure(),{channelOverride:t})}fn.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var S5="grpc_orca_load_report";function TRe(t,e){return(r,n,i)=>{let s=i.getOpaque(S5);if(s)t(s);else{let o=i.get(fn.GRPC_METRICS_HEADER);o.length>0&&(s=pT().xds.data.orca.v3.OrcaLoadReport.deserialize(o[0]),t(s),i.setOpaque(S5,s))}e&&e(r,n,i)}}var v5="orca_oob_metrics",Zk=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(v5,ARe);this.dataProducer=r,r.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)===null||e===void 0||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},Jk=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new ERe.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=E5(r),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var r;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(v5),(r=this.metricsCall)===null||r===void 0||r.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==vRe.ConnectivityState.READY)return;let r=Math.min(...Array.from(this.dataWatchers).map(n=>n.getInterval()));if(!this.metricsCall||r!==this.currentInterval){(e=this.metricsCall)===null||e===void 0||e.cancel(),this.currentInterval=r;let n=this.client.streamCoreMetrics({report_interval:(0,Wk.msToDuration)(r)});this.metricsCall=n,n.on("data",i=>{this.dataWatchers.forEach(s=>{s.onMetricsUpdate(i)})}),n.on("error",i=>{if(this.metricsCall=null,i.code===_5.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}i.code!==_5.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},Xk=class extends SRe.BaseSubchannelWrapper{constructor(e,r,n){super(e),this.addDataWatcher(new Zk(r,n))}getWrappedSubchannel(){return this.child}};fn.OrcaOobMetricsSubchannelWrapper=Xk;function ARe(t){return new Jk(t)}});var sM=b(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.BaseServerInterceptingCall=jn.ServerInterceptingCall=jn.ResponderBuilder=jn.ServerListenerBuilder=void 0;jn.isInterceptingServerListener=RRe;jn.getServerInterceptingCall=NRe;var _T=Wt(),Or=Be(),Dd=J("http2"),b5=kv(),T5=J("zlib"),xRe=dk(),I5=ct(),wRe=J("tls"),A5=hT(),C5="server_call";function hl(t){I5.trace(Or.LogVerbosity.DEBUG,C5,t)}var eM=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};jn.ServerListenerBuilder=eM;function RRe(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var tM=class{constructor(e,r){this.listener=e,this.nextListener=r,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},rM=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};jn.ResponderBuilder=rM;var mT={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},gT={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},nM=class{constructor(e,r){var n,i,s,o;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(n=r?.start)!==null&&n!==void 0?n:gT.start,sendMetadata:(i=r?.sendMetadata)!==null&&i!==void 0?i:gT.sendMetadata,sendMessage:(s=r?.sendMessage)!==null&&s!==void 0?s:gT.sendMessage,sendStatus:(o=r?.sendStatus)!==null&&o!==void 0?o:gT.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(r=>{var n,i,s,o;let a={onReceiveMetadata:(n=r?.onReceiveMetadata)!==null&&n!==void 0?n:mT.onReceiveMetadata,onReceiveMessage:(i=r?.onReceiveMessage)!==null&&i!==void 0?i:mT.onReceiveMessage,onReceiveHalfClose:(s=r?.onReceiveHalfClose)!==null&&s!==void 0?s:mT.onReceiveHalfClose,onCancel:(o=r?.onCancel)!==null&&o!==void 0?o:mT.onCancel},c=new tM(a,e);this.nextCall.start(c)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,r=>{this.processingMetadata=!1,this.nextCall.sendMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,r){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new _T.Metadata),this.responder.sendMessage(e,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=n,this.pendingMessageCallback=r):this.nextCall.sendMessage(n,r)})}sendStatus(e){this.responder.sendStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextCall.sendStatus(r)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}};jn.ServerInterceptingCall=nM;var P5="grpc-accept-encoding",iM="grpc-encoding",x5="grpc-message",w5="grpc-status",Qk="grpc-timeout",IRe=/(\d{1,8})\s*([HMSmun])/,CRe={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},PRe={[P5]:"identity,deflate,gzip",[iM]:"identity"},R5={[Dd.constants.HTTP2_HEADER_STATUS]:Dd.constants.HTTP_STATUS_OK,[Dd.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},ORe={waitForTrailers:!0},yT=class{constructor(e,r,n,i,s){var o,a;this.stream=e,this.callEventTracker=n,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=Or.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=Or.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new A5.PerRequestMetricRecorder,this.stream.once("close",()=>{var f;hl("Request to method "+((f=this.handler)===null||f===void 0?void 0:f.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:Or.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",f=>{this.handleDataFrame(f)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in s&&(this.maxSendMessageSize=s["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in s&&(this.maxReceiveMessageSize=s["grpc.max_receive_message_length"]),this.host=(o=r[":authority"])!==null&&o!==void 0?o:r.host,this.decoder=new xRe.StreamDecoder(this.maxReceiveMessageSize);let c=_T.Metadata.fromHttp2Headers(r);I5.isTracerEnabled(C5)&&hl("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let l=c.get(Qk);l.length>0&&this.handleTimeoutHeader(l[0]);let u=c.get(iM);u.length>0&&(this.incomingEncoding=u[0]),c.remove(Qk),c.remove(iM),c.remove(P5),c.remove(Dd.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove(Dd.constants.HTTP2_HEADER_TE),c.remove(Dd.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=c;let d=(a=e.session)===null||a===void 0?void 0:a.socket;this.connectionInfo={localAddress:d?.localAddress,localPort:d?.localPort,remoteAddress:d?.remoteAddress,remotePort:d?.remotePort},this.shouldSendMetrics=!!s["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(IRe);if(r===null){let s={code:Or.Status.INTERNAL,details:`Invalid ${Qk} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(s)});return}let n=+r[1]*CRe[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let s={code:Or.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(s)},n)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new _T.Metadata)}serializeMessage(e){let r=this.handler.serialize(e),n=r.byteLength,i=Buffer.allocUnsafe(n+5);return i.writeUInt8(0,0),i.writeUInt32BE(n,1),r.copy(i,5),i}decompressMessage(e,r){let n=e.subarray(5);if(r==="identity")return n;if(r==="deflate"||r==="gzip"){let i;return r==="deflate"?i=T5.createInflate():i=T5.createGunzip(),new Promise((s,o)=>{let a=0,c=[];i.on("error",l=>{o({code:Or.Status.INTERNAL,details:"Failed to decompress message"})}),i.on("data",l=>{c.push(l),a+=l.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(i.destroy(),o({code:Or.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{s(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:Or.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${r}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let n=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",i;try{i=await this.decompressMessage(e.compressedMessage,n)}catch(s){this.sendStatus(s);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(s){this.sendStatus({code:Or.Status.INTERNAL,details:`Error deserializing request: ${s.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var r;if(this.checkCancelled())return;hl("Request to "+this.handler.path+" received data frame of size "+e.length);let n;try{n=this.decoder.write(e)}catch(i){this.sendStatus({code:Or.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let s={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(s),this.decompressAndMaybePush(s),(r=this.callEventTracker)===null||r===void 0||r.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){hl("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let r=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},R5),PRe),r);this.stream.respond(n,ORe)}sendMessage(e,r){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:Or.Status.INTERNAL,details:`Error serializing response: ${(0,b5.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:Or.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),hl("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var s;if(i){this.sendStatus({code:Or.Status.INTERNAL,details:`Error writing message: ${(0,b5.getErrorMessage)(i)}`,metadata:null});return}(s=this.callEventTracker)===null||s===void 0||s.addMessageSent(),r()})}sendStatus(e){var r,n,i;if(this.checkCancelled())return;hl("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+Or.Status[e.code]+" details: "+e.details);let s=(i=(n=e.metadata)===null||n===void 0?void 0:n.clone())!==null&&i!==void 0?i:new _T.Metadata;if(this.shouldSendMetrics&&s.set(A5.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let o=Object.assign({[w5]:e.code,[x5]:encodeURI(e.details)},s.toHttp2Headers());this.stream.sendTrailers(o),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let o=Object.assign(Object.assign({[w5]:e.code,[x5]:encodeURI(e.details)},R5),s.toHttp2Headers());this.stream.respond(o,{endStream:!0}),this.notifyOnCancel()}}startRead(){hl("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let r=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return r?.remoteAddress?r.remotePort?`${r.remoteAddress}:${r.remotePort}`:r.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var e;if(((e=this.stream.session)===null||e===void 0?void 0:e.socket)instanceof wRe.TLSSocket){let r=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:r.raw?r:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};jn.BaseServerInterceptingCall=yT;function NRe(t,e,r,n,i,s){let o={path:i.path,requestStream:i.type==="clientStream"||i.type==="bidi",responseStream:i.type==="serverStream"||i.type==="bidi",requestDeserialize:i.deserialize,responseSerialize:i.serialize},a=new yT(e,r,n,i,s);return t.reduce((c,l)=>l(o,c),a)}});var $5=b(Ea=>{"use strict";var kRe=Ea&&Ea.__runInitializers||function(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0},MRe=Ea&&Ea.__esDecorate||function(t,e,r,n,i,s){function o(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,p=r.length-1;p>=0;p--){var h={};for(var m in n)h[m]=m==="access"?{}:n[m];for(var m in n.access)h.access[m]=n.access[m];h.addInitializer=function(T){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(T||null))};var E=(0,r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],h);if(a==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(d=o(E.get))&&(u.get=d),(d=o(E.set))&&(u.set=d),(d=o(E.init))&&i.unshift(d)}else(d=o(E))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.Server=void 0;var Wr=J("http2"),DRe=J("util"),It=Be(),Ud=g5(),oM=fT(),O5=ni(),$d=ct(),Sa=qr(),_i=Ir(),Bt=ha(),N5=sM(),Ld=~(1<<31),aM=~(1<<31),LRe=2e4,k5=~(1<<31),{HTTP2_HEADER_PATH:M5}=Wr.constants,$Re="server",D5=Buffer.from("max_age");function L5(t){$d.trace(It.LogVerbosity.DEBUG,"server_call",t)}function URe(){}function FRe(t){return function(e,r){return DRe.deprecate(e,t)}}function cM(t){return{code:It.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function BRe(t,e){let r=cM(e);switch(t){case"unary":return(n,i)=>{i(r,null)};case"clientStream":return(n,i)=>{i(r,null)};case"serverStream":return n=>{n.emit("error",r)};case"bidi":return n=>{n.emit("error",r)};default:throw new Error(`Invalid handlerType ${t}`)}}var jRe=(()=>{var t;let e=[],r;return t=class{constructor(i){var s,o,a,c,l,u;this.boundPorts=(kRe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=i??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Bt.ChannelzTraceStub,this.callTracker=new Bt.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Bt.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Bt.ChannelzChildrenTrackerStub):(this.channelzTrace=new Bt.ChannelzTrace,this.callTracker=new Bt.ChannelzCallTracker,this.listenerChildrenTracker=new Bt.ChannelzChildrenTracker,this.sessionChildrenTracker=new Bt.ChannelzChildrenTracker),this.channelzRef=(0,Bt.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(s=this.options["grpc.max_connection_age_ms"])!==null&&s!==void 0?s:Ld,this.maxConnectionAgeGraceMs=(o=this.options["grpc.max_connection_age_grace_ms"])!==null&&o!==void 0?o:Ld,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:aM,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:LRe,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:k5,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(i){var s,o,a;let c=this.sessions.get(i),l=i.socket,u=l.remoteAddress?(0,Sa.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Sa.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let h=l,m=h.getCipher(),E=h.getCertificate(),T=h.getPeerCertificate();f={cipherSuiteStandardName:(s=m.standardName)!==null&&s!==void 0?s:null,cipherSuiteOtherName:m.standardName?null:m.name,localCertificate:E&&"raw"in E?E.raw:null,remoteCertificate:T&&"raw"in T?T.raw:null}}else f=null;return{remoteAddress:u,localAddress:d,security:f,remoteName:null,streamsStarted:c.streamTracker.callsStarted,streamsSucceeded:c.streamTracker.callsSucceeded,streamsFailed:c.streamTracker.callsFailed,messagesSent:c.messagesSent,messagesReceived:c.messagesReceived,keepAlivesSent:c.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:c.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:c.lastMessageSentTimestamp,lastMessageReceivedTimestamp:c.lastMessageReceivedTimestamp,localFlowControlWindow:(o=i.state.localWindowSize)!==null&&o!==void 0?o:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){$d.trace(It.LogVerbosity.DEBUG,$Re,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){$d.trace(It.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,s){if(i===null||typeof i!="object"||s===null||typeof s!="object")throw new Error("addService() requires two objects as arguments");let o=Object.keys(i);if(o.length===0)throw new Error("Cannot add an empty service to a server");o.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let u=s[a],d;if(u===void 0&&typeof c.originalName=="string"&&(u=s[c.originalName]),u!==void 0?d=u.bind(s):d=BRe(l,a),this.register(c.path,d,c.responseSerialize,c.requestDeserialize,l)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(i){if(i===null||typeof i!="object")throw new Error("removeService() requires object as argument");Object.keys(i).forEach(o=>{let a=i[o];this.unregister(a.path)})}bind(i,s){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,Bt.registerChannelzSocket)((0,Sa.subchannelAddressToString)(i),()=>({localAddress:i,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(i){(0,Bt.unregisterChannelzRef)(i)}createHttp2Server(i){let s;if(i._isSecure()){let o=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),o),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),s=Wr.createSecureServer(c),s.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),s.on("secureConnection",d=>{d.on("error",f=>{this.trace("An incoming TLS connection closed with error: "+f.message)})});let u=d=>{if(d){let f=s;try{f.setSecureContext(d)}catch(p){$d.log(It.LogVerbosity.ERROR,"Failed to set secure context with error "+p.message),d=null}}l=d!==null,this.trace("Post-update credentials valid: "+l)};i._addWatcher(u),s.on("close",()=>{i._removeWatcher(u)})}else s=Wr.createServer(this.commonServerOptions);return s.setTimeout(0,URe),this._setupHandlers(s,i._getInterceptors()),s}bindOneAddress(i,s){this.trace("Attempting to bind "+(0,Sa.subchannelAddressToString)(i));let o=this.createHttp2Server(s.credentials);return new Promise((a,c)=>{let l=u=>{this.trace("Failed to bind "+(0,Sa.subchannelAddressToString)(i)+" with error "+u.message),a({port:"port"in i?i.port:1,error:u.message})};o.once("error",l),o.listen(i,()=>{let u=o.address(),d;typeof u=="string"?d={path:u}:d={host:u.address,port:u.port};let f=this.experimentalRegisterListenerToChannelz(d);this.listenerChildrenTracker.refChild(f),this.http2Servers.set(o,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),s.listeningServers.add(o),this.trace("Successfully bound "+(0,Sa.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),o.removeListener("error",l)})})}async bindManyPorts(i,s){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Sa.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let o=await this.bindOneAddress(i[0],s);if(o.error){let a=await this.bindManyPorts(i.slice(1),s);return Object.assign(Object.assign({},a),{errors:[o.error,...a.errors]})}else{let a=i.slice(1).map(u=>(0,Sa.isTcpSubchannelAddress)(u)?{host:u.host,port:o.port}:u),c=await Promise.all(a.map(u=>this.bindOneAddress(u,s))),l=[o,...c];return{count:l.filter(u=>u.error===void 0).length,port:o.port,errors:l.filter(u=>u.error).map(u=>u.error)}}}else{let o=await Promise.all(i.map(a=>this.bindOneAddress(a,s)));return{count:o.filter(a=>a.error===void 0).length,port:o[0].port,errors:o.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,s){let o=await this.bindManyPorts(i,s);if(o.count>0)return o.count<i.length&&$d.log(It.LogVerbosity.INFO,`WARNING Only ${o.count} addresses added out of total ${i.length} resolved`),o.port;{let a=`No address added out of total ${i.length} resolved`;throw $d.log(It.LogVerbosity.ERROR,a),new Error(`${a} errors: [${o.errors.join(",")}]`)}}resolvePort(i){return new Promise((s,o)=>{let a=!1,c=(u,d,f,p)=>{if(a)return!0;if(a=!0,!u.ok)return o(new Error(u.error.details)),!0;let h=[].concat(...u.value.map(m=>m.addresses));return h.length===0?(o(new Error(`No addresses resolved for port ${i}`)),!0):(s(h),!0)};(0,O5.createResolver)(i,c,this.options).updateResolution()})}async bindPort(i,s){let o=await this.resolvePort(i);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(o,s);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let s=(0,_i.parseUri)(i);if(s===null)throw new Error(`Could not parse port "${i}"`);let o=(0,O5.mapUriDefaultScheme)(s);if(o===null)throw new Error(`Could not get a default scheme for port "${i}"`);return o}bindAsync(i,s,o){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(s===null||!(s instanceof oM.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof o!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,p)=>{process.nextTick(()=>o(f,p))},l=this.boundPorts.get((0,_i.uriToString)(a));if(l){if(!s._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>o(null,f),f=>o(f,0)):c(null,l.portNumber);return}l={mapKey:(0,_i.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:s,listeningServers:new Set};let u=(0,_i.splitHostPort)(a.path),d=this.bindPort(a,l);l.completionPromise=d,u?.port===0?d.then(f=>{let p={scheme:a.scheme,authority:a.authority,path:(0,_i.combineHostPort)({host:u.host,port:f})};l.mapKey=(0,_i.uriToString)(p),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),o(null,f)},f=>{o(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,o(null,f)},f=>{o(f,0)}))}registerInjectorToChannelz(){return(0,Bt.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(i,s,o=!1){if(i===null||!(i instanceof oM.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(s);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:s,sessions:c,ownsChannelzRef:o}),{injectConnection:l=>{a.emit("connection",l)},drain:l=>{var u,d;for(let f of c)this.closeSession(f);(d=(u=setTimeout(()=>{for(let f of c)f.destroy(Wr.constants.NGHTTP2_CANCEL)},l)).unref)===null||d===void 0||d.call(u)},destroy:()=>{this.closeServer(a);for(let l of c)this.closeSession(l)}}}createConnectionInjector(i){if(i===null||!(i instanceof oM.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let s=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,s,!0)}closeServer(i,s){this.trace("Closing server with address "+JSON.stringify(i.address()));let o=this.http2Servers.get(i);i.close(()=>{o&&o.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(o.channelzRef),(0,Bt.unregisterChannelzRef)(o.channelzRef)),this.http2Servers.delete(i),s?.()})}closeSession(i,s){var o;this.trace("Closing session initiated by "+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,Bt.unregisterChannelzRef)(a.ref)),s?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let s of i.listeningServers){let o=this.http2Servers.get(s);if(this.closeServer(s,()=>{i.listeningServers.delete(s)}),o)for(let a of o.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let s=this.normalizePort(i),o=(0,_i.splitHostPort)(s.path);if(o?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,_i.uriToString)(s));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,_i.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,s){var o,a;this.trace("drain port="+i+" graceTimeMs="+s);let c=this.normalizePort(i),l=(0,_i.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,_i.uriToString)(c));if(!u)return;let d=new Set;for(let f of u.listeningServers){let p=this.http2Servers.get(f);if(p)for(let h of p.sessions)d.add(h),this.closeSession(h,()=>{d.delete(h)})}(a=(o=setTimeout(()=>{for(let f of d)f.destroy(Wr.constants.NGHTTP2_CANCEL)},s)).unref)===null||a===void 0||a.call(o)}forceShutdown(){for(let i of this.boundPorts.values())i.cancelled=!0;this.boundPorts.clear();for(let i of this.http2Servers.keys())this.closeServer(i);this.sessions.forEach((i,s)=>{this.closeSession(s),s.destroy(Wr.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Bt.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,s,o,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:s,serialize:o,deserialize:a,type:c,path:i}),!0)}unregister(i){return this.handlers.delete(i)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(i=>!i.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(i){var s;let o=l=>{(0,Bt.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&o()}this.shutdown=!0;for(let[l,u]of this.http2Servers.entries()){a++;let d=u.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(l,()=>{this.trace("Server "+d+" finished closing"),c()});for(let f of u.sessions.keys()){a++;let p=(s=f.socket)===null||s===void 0?void 0:s.remoteAddress;this.trace("Waiting for session "+p+" to close"),this.closeSession(f,()=>{this.trace("Session "+p+" finished closing"),c()})}}a===0&&o()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,s){let o=s[Wr.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof o!="string"||!o.startsWith("application/grpc")?(i.respond({[Wr.constants.HTTP2_HEADER_STATUS]:Wr.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){L5("Received call to method "+i+" at address "+this.serverAddressString);let s=this.handlers.get(i);return s===void 0?(L5("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):s}_respondWithError(i,s,o=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:It.Status.INTERNAL,"grpc-message":i.details,[Wr.constants.HTTP2_HEADER_STATUS]:Wr.constants.HTTP_STATUS_OK,[Wr.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());s.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),o?.streamTracker.addCallFailed()}_channelzHandler(i,s,o){s.once("error",f=>{}),this.onStreamOpened(s);let a=this.sessions.get(s.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(s,o)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=o[M5],l=this._retrieveHandler(c);if(!l){this._respondWithError(cM(c),s,a);return}let u={addMessageSent:()=>{a&&(a.messagesSent+=1,a.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{a&&(a.messagesReceived+=1,a.lastMessageReceivedTimestamp=new Date)},onCallEnd:f=>{f.code===It.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,N5.getServerInterceptingCall)([...i,...this.interceptors],s,o,u,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:It.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,s,o){if(s.once("error",u=>{}),this.onStreamOpened(s),this._verifyContentType(s,o)!==!0)return;let a=o[M5],c=this._retrieveHandler(a);if(!c){this._respondWithError(cM(a),s,null);return}let l=(0,N5.getServerInterceptingCall)([...i,...this.interceptors],s,o,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:It.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,s){let{type:o}=s;if(o==="unary")zRe(i,s);else if(o==="clientStream")GRe(i,s);else if(o==="serverStream")VRe(i,s);else if(o==="bidi")qRe(i,s);else return!1;return!0}_setupHandlers(i,s){if(i===null)return;let o=i.address(),a="null";o&&(typeof o=="string"?a=o:a=o.address+":"+o.port),this.serverAddressString=a;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,l=this.channelzEnabled?this._channelzSessionHandler(i):this._sessionHandler(i);i.on("stream",c.bind(this,s)),i.on("session",l)}_sessionHandler(i){return s=>{var o,a;(o=this.http2Servers.get(i))===null||o===void 0||o.sessions.add(s);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==Ld){let T=this.maxConnectionAgeMs/10,v=Math.random()*T*2-T;c=setTimeout(()=>{var A,S;d=!0,this.trace("Connection dropped by max connection age: "+((A=s.socket)===null||A===void 0?void 0:A.remoteAddress));try{s.goaway(Wr.constants.NGHTTP2_NO_ERROR,~(1<<31),D5)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==Ld&&(l=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(S=l.unref)===null||S===void 0||S.call(l))},this.maxConnectionAgeMs+v),(a=c.unref)===null||a===void 0||a.call(c)}let p=()=>{u&&(clearTimeout(u),u=null)},h=()=>!s.destroyed&&this.keepaliveTimeMs<aM&&this.keepaliveTimeMs>0,m,E=()=>{var T;h()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{p(),m()},this.keepaliveTimeMs),(T=u.unref)===null||T===void 0||T.call(u))};m=()=>{var T;if(!h())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let v="";try{s.ping((S,R,P)=>{p(),S?(this.keepaliveTrace("Ping failed with error: "+S.message),d=!0,s.destroy()):(this.keepaliveTrace("Received ping response"),E())})||(v="Ping returned false")}catch(A){v=(A instanceof Error?A.message:"")||"Unknown error"}if(v){this.keepaliveTrace("Ping send failed: "+v),this.trace("Connection dropped due to ping send error: "+v),d=!0,s.destroy();return}u=setTimeout(()=>{p(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,s.destroy()},this.keepaliveTimeoutMs),(T=u.unref)===null||T===void 0||T.call(u)},E(),s.on("close",()=>{var T,v;d||this.trace(`Connection dropped by client ${(T=s.socket)===null||T===void 0?void 0:T.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),p(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(s)),(v=this.http2Servers.get(i))===null||v===void 0||v.sessions.delete(s)})}}_channelzSessionHandler(i){return s=>{var o,a,c,l;let u=(0,Bt.registerChannelzSocket)((a=(o=s.socket)===null||o===void 0?void 0:o.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,s),this.channelzEnabled),d={ref:u,streamTracker:new Bt.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(s),this.sessions.set(s,d);let f=`${s.socket.remoteAddress}:${s.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+f),this.trace("Connection established by client "+f),this.sessionChildrenTracker.refChild(u);let p=null,h=null,m=null,E=!1,T=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==Ld){let P=this.maxConnectionAgeMs/10,L=Math.random()*P*2-P;p=setTimeout(()=>{var I;E=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{s.goaway(Wr.constants.NGHTTP2_NO_ERROR,~(1<<31),D5)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==Ld&&(h=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(I=h.unref)===null||I===void 0||I.call(h))},this.maxConnectionAgeMs+L),(l=p.unref)===null||l===void 0||l.call(p)}let v=()=>{m&&(clearTimeout(m),m=null)},A=()=>!s.destroyed&&this.keepaliveTimeMs<aM&&this.keepaliveTimeMs>0,S,R=()=>{var P;A()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),m=setTimeout(()=>{v(),S()},this.keepaliveTimeMs),(P=m.unref)===null||P===void 0||P.call(m))};S=()=>{var P;if(!A())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let L="";try{s.ping((O,j,_)=>{v(),O?(this.keepaliveTrace("Ping failed with error: "+O.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+O.message+" return in "+j),E=!0,s.destroy()):(this.keepaliveTrace("Received ping response"),R())})||(L="Ping returned false")}catch(I){L=(I instanceof Error?I.message:"")||"Unknown error"}if(L){this.keepaliveTrace("Ping send failed: "+L),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+L),E=!0,s.destroy();return}d.keepAlivesSent+=1,m=setTimeout(()=>{v(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+f),E=!0,s.destroy()},this.keepaliveTimeoutMs),(P=m.unref)===null||P===void 0||P.call(m)},R(),s.on("close",()=>{var P;E||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(u),(0,Bt.unregisterChannelzRef)(u),p&&clearTimeout(p),h&&clearTimeout(h),v(),T!==null&&(clearTimeout(T.timeout),this.sessionIdleTimeouts.delete(s)),(P=this.http2Servers.get(i))===null||P===void 0||P.sessions.delete(s),this.sessions.delete(s)})}}enableIdleTimeout(i){var s,o;if(this.sessionIdleTimeout>=k5)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(o=(s=a.timeout).unref)===null||o===void 0||o.call(s),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,s){let{socket:o}=s,a=i.sessionIdleTimeouts.get(s);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+o?.remoteAddress+":"+o?.remotePort+" last idle at "+a.lastIdle),i.closeSession(s)):a.timeout.refresh())}onStreamOpened(i){let s=i.session,o=this.sessionIdleTimeouts.get(s);o&&(o.activeStreams+=1,i.once("close",o.onClose))}onStreamClose(i){var s,o;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress)+":"+((o=i.socket)===null||o===void 0?void 0:o.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[FRe("Calling start() is no longer necessary. It can be safely omitted.")],MRe(t,null,r,{kind:"method",name:"start",static:!1,private:!1,access:{has:i=>"start"in i,get:i=>i.start},metadata:n},null,e),n&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),t})();Ea.Server=jRe;async function zRe(t,e){let r;function n(o,a,c,l){if(o){t.sendStatus((0,Ud.serverErrorToStatus)(o,c));return}t.sendMessage(a,()=>{t.sendStatus({code:It.Status.OK,details:"OK",metadata:c??null})})}let i,s=null;t.start({onReceiveMetadata(o){i=o,t.startRead()},onReceiveMessage(o){if(s){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=o,t.startRead()},onReceiveHalfClose(){if(!s){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Ud.ServerWritableStreamImpl(e.path,t,i,s);try{e.func(r,n)}catch(o){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function GRe(t,e){let r;function n(i,s,o,a){if(i){t.sendStatus((0,Ud.serverErrorToStatus)(i,o));return}t.sendMessage(s,()=>{t.sendStatus({code:It.Status.OK,details:"OK",metadata:o??null})})}t.start({onReceiveMetadata(i){r=new Ud.ServerDuplexStreamImpl(e.path,t,i);try{e.func(r,n)}catch(s){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(i){r.push(i)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function VRe(t,e){let r,n,i=null;t.start({onReceiveMetadata(s){n=s,t.startRead()},onReceiveMessage(s){if(i){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=s,t.startRead()},onReceiveHalfClose(){if(!i){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Ud.ServerWritableStreamImpl(e.path,t,n,i);try{e.func(r)}catch(s){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function qRe(t,e){let r;t.start({onReceiveMetadata(n){r=new Ud.ServerDuplexStreamImpl(e.path,t,n);try{e.func(r)}catch(i){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onReceiveMessage(n){r.push(n)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}});var U5=b(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});ST.StatusBuilder=void 0;var lM=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};ST.StatusBuilder=lM});var Dg=b(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.LeafLoadBalancer=ss.PickFirstLoadBalancer=ss.PickFirstLoadBalancingConfig=void 0;ss.shuffled=z5;ss.setup=QRe;var uM=ia(),Ct=Cr(),va=Gs(),F5=qr(),HRe=ct(),WRe=Be(),B5=qr(),j5=J("net"),YRe=Zc(),KRe="pick_first";function Ng(t){HRe.trace(WRe.LogVerbosity.DEBUG,KRe,t)}var kg="pick_first",ZRe=250,Fd=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return kg}toJsonObject(){return{[kg]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new t(e.shuffleAddressList===!0)}};ss.PickFirstLoadBalancingConfig=Fd;var dM=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:va.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function z5(t){let e=t.slice();for(let r=e.length-1;r>1;r--){let n=Math.floor(Math.random()*(r+1)),i=e[r];e[r]=e[n],e[n]=i}return e}function JRe(t){if(t.length===0)return[];let e=[],r=[],n=[],i=(0,B5.isTcpSubchannelAddress)(t[0])&&(0,j5.isIPv6)(t[0].host);for(let a of t)(0,B5.isTcpSubchannelAddress)(a)&&(0,j5.isIPv6)(a.host)?r.push(a):n.push(a);let s=i?r:n,o=i?n:r;for(let a=0;a<Math.max(s.length,o.length);a++)a<s.length&&e.push(s[a]),a<o.length&&e.push(o[a]);return e}var G5="grpc-node.internal.pick-first.report_health_status",Mg=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Ct.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,n,i,s,o)=>{this.onSubchannelStateUpdate(r,n,i,o)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let r=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker({details:r}),r)}else this.updateState(Ct.ConnectivityState.READY,new dM(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(Ct.ConnectivityState.IDLE,new va.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker({details:r}),r)}else this.updateState(Ct.ConnectivityState.CONNECTING,new va.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,r,n,i){var s;if(!((s=this.currentPick)===null||s===void 0)&&s.realSubchannelEquals(e)){n!==Ct.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[o,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===Ct.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===Ct.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),o===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(o+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[r,n]of this.children.entries())if(r>=e){let i=n.subchannel.getConnectivityState();if(i===Ct.ConnectivityState.IDLE||i===Ct.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===Ct.ConnectivityState.IDLE&&(Ng("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var i;(i=this.children[e])===null||i===void 0||i.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},ZRe),(n=(r=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(r)}pickSubchannel(e){Ng("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,r,n){Ng(Ct.ConnectivityState[this.currentState]+" -> "+Ct.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,r){Ng("connectToAddressList(["+e.map(i=>(0,F5.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,r),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===Ct.ConnectivityState.READY){this.pickSubchannel(i);return}for(let{subchannel:i}of n)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:i}of this.children)i.addConnectivityStateListener(this.subchannelStateListener);for(let i of this.children)i.subchannel.getConnectivityState()===Ct.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,n,i){if(!(r instanceof Fd))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker(e.error),e.error.details),!0;let s=e.value;this.reportHealthStatus=n[G5],r.getShuffleAddressList()&&(s=z5(s));let o=[].concat(...s.map(c=>c.addresses));Ng("updateAddressList(["+o.map(c=>(0,F5.subchannelAddressToString)(c))+"])");let a=JRe(o);return this.latestAddressList=a,this.latestOptions=n,this.connectToAddressList(a,n),this.latestResolutionNote=i,o.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===Ct.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return kg}};ss.PickFirstLoadBalancer=Mg;var XRe=new Fd(!1),fM=class{constructor(e,r,n,i){this.endpoint=e,this.options=n,this.resolutionNote=i,this.latestState=Ct.ConnectivityState.IDLE;let s=(0,uM.createChildChannelControlHelper)(r,{updateState:(o,a,c)=>{this.latestState=o,this.latestPicker=a,r.updateState(o,a,c)}});this.pickFirstBalancer=new Mg(s),this.latestPicker=new va.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,YRe.statusOrFromValue)([this.endpoint]),XRe,Object.assign(Object.assign({},this.options),{[G5]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==Ct.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};ss.LeafLoadBalancer=fM;function QRe(){(0,uM.registerLoadBalancerType)(kg,Mg,Fd),(0,uM.registerDefaultLoadBalancerType)(kg)}});var V5=b(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});vT.FileWatcherCertificateProvider=void 0;var eIe=J("fs"),tIe=ct(),rIe=Be(),nIe=J("util"),iIe="certificate_provider";function ET(t){tIe.trace(rIe.LogVerbosity.DEBUG,iIe,t)}var pM=(0,nIe.promisify)(eIe.readFile),hM=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");ET("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?pM(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?pM(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?pM(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,n])=>{if(this.refreshTimer){ET("File watcher read certificates certificate "+e.status+", privateKey "+r.status+", CA certificate "+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&r.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:r.value}:this.latestIdentityUpdate=null,n.status==="fulfilled"?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let i of this.identityListeners)i(this.latestIdentityUpdate);for(let i of this.caListeners)i(this.latestCaUpdate)}}),ET("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),ET("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};vT.FileWatcherCertificateProvider=hM});var _M=b(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=ye.createCertificateProviderChannelCredentials=ye.FileWatcherCertificateProvider=ye.createCertificateProviderServerCredentials=ye.createServerCredentialsWithInterceptors=ye.BaseSubchannelWrapper=ye.registerAdminService=ye.FilterStackFactory=ye.BaseFilter=ye.statusOrFromError=ye.statusOrFromValue=ye.PickResultType=ye.QueuePicker=ye.UnavailablePicker=ye.ChildLoadBalancerHandler=ye.EndpointMap=ye.endpointHasAddress=ye.endpointToString=ye.subchannelAddressToString=ye.LeafLoadBalancer=ye.isLoadBalancerNameRegistered=ye.parseLoadBalancingConfig=ye.selectLbConfigFromList=ye.registerLoadBalancerType=ye.createChildChannelControlHelper=ye.BackoffTimeout=ye.parseDuration=ye.durationToMs=ye.splitHostPort=ye.uriToString=ye.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=ye.createResolver=ye.registerResolver=ye.log=ye.trace=void 0;var q5=ct();Object.defineProperty(ye,"trace",{enumerable:!0,get:function(){return q5.trace}});Object.defineProperty(ye,"log",{enumerable:!0,get:function(){return q5.log}});var mM=ni();Object.defineProperty(ye,"registerResolver",{enumerable:!0,get:function(){return mM.registerResolver}});Object.defineProperty(ye,"createResolver",{enumerable:!0,get:function(){return mM.createResolver}});Object.defineProperty(ye,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return mM.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var H5=Ir();Object.defineProperty(ye,"uriToString",{enumerable:!0,get:function(){return H5.uriToString}});Object.defineProperty(ye,"splitHostPort",{enumerable:!0,get:function(){return H5.splitHostPort}});var W5=Og();Object.defineProperty(ye,"durationToMs",{enumerable:!0,get:function(){return W5.durationToMs}});Object.defineProperty(ye,"parseDuration",{enumerable:!0,get:function(){return W5.parseDuration}});var sIe=cd();Object.defineProperty(ye,"BackoffTimeout",{enumerable:!0,get:function(){return sIe.BackoffTimeout}});var Lg=ia();Object.defineProperty(ye,"createChildChannelControlHelper",{enumerable:!0,get:function(){return Lg.createChildChannelControlHelper}});Object.defineProperty(ye,"registerLoadBalancerType",{enumerable:!0,get:function(){return Lg.registerLoadBalancerType}});Object.defineProperty(ye,"selectLbConfigFromList",{enumerable:!0,get:function(){return Lg.selectLbConfigFromList}});Object.defineProperty(ye,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return Lg.parseLoadBalancingConfig}});Object.defineProperty(ye,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return Lg.isLoadBalancerNameRegistered}});var oIe=Dg();Object.defineProperty(ye,"LeafLoadBalancer",{enumerable:!0,get:function(){return oIe.LeafLoadBalancer}});var bT=qr();Object.defineProperty(ye,"subchannelAddressToString",{enumerable:!0,get:function(){return bT.subchannelAddressToString}});Object.defineProperty(ye,"endpointToString",{enumerable:!0,get:function(){return bT.endpointToString}});Object.defineProperty(ye,"endpointHasAddress",{enumerable:!0,get:function(){return bT.endpointHasAddress}});Object.defineProperty(ye,"EndpointMap",{enumerable:!0,get:function(){return bT.EndpointMap}});var aIe=Yv();Object.defineProperty(ye,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return aIe.ChildLoadBalancerHandler}});var gM=Gs();Object.defineProperty(ye,"UnavailablePicker",{enumerable:!0,get:function(){return gM.UnavailablePicker}});Object.defineProperty(ye,"QueuePicker",{enumerable:!0,get:function(){return gM.QueuePicker}});Object.defineProperty(ye,"PickResultType",{enumerable:!0,get:function(){return gM.PickResultType}});var Y5=Zc();Object.defineProperty(ye,"statusOrFromValue",{enumerable:!0,get:function(){return Y5.statusOrFromValue}});Object.defineProperty(ye,"statusOrFromError",{enumerable:!0,get:function(){return Y5.statusOrFromError}});var cIe=qN();Object.defineProperty(ye,"BaseFilter",{enumerable:!0,get:function(){return cIe.BaseFilter}});var lIe=qb();Object.defineProperty(ye,"FilterStackFactory",{enumerable:!0,get:function(){return lIe.FilterStackFactory}});var uIe=Xv();Object.defineProperty(ye,"registerAdminService",{enumerable:!0,get:function(){return uIe.registerAdminService}});var dIe=Cg();Object.defineProperty(ye,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return dIe.BaseSubchannelWrapper}});var K5=fT();Object.defineProperty(ye,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return K5.createServerCredentialsWithInterceptors}});Object.defineProperty(ye,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return K5.createCertificateProviderServerCredentials}});var fIe=V5();Object.defineProperty(ye,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return fIe.FileWatcherCertificateProvider}});var pIe=ad();Object.defineProperty(ye,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return pIe.createCertificateProviderChannelCredentials}});var hIe=kk();Object.defineProperty(ye,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return hIe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var Z5=b(SM=>{"use strict";Object.defineProperty(SM,"__esModule",{value:!0});SM.setup=_Ie;var mIe=ni(),gIe=Zc(),yM=class{constructor(e,r,n){this.listener=r,this.hasReturnedResult=!1,this.endpoints=[];let i;e.authority===""?i="/"+e.path:i=e.path,this.endpoints=[{addresses:[{path:i}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,gIe.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function _Ie(){(0,mIe.registerResolver)("unix",yM)}});var r9=b(TM=>{"use strict";Object.defineProperty(TM,"__esModule",{value:!0});TM.setup=bIe;var J5=J("net"),X5=Zc(),TT=Be(),EM=Wt(),Q5=ni(),yIe=qr(),e9=Ir(),SIe=ct(),EIe="ip_resolver";function t9(t){SIe.trace(TT.LogVerbosity.DEBUG,EIe,t)}var vM="ipv4",bM="ipv6",vIe=443,AT=class{constructor(e,r,n){var i;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,t9("Resolver constructed for target "+(0,e9.uriToString)(e));let s=[];if(!(e.scheme===vM||e.scheme===bM)){this.error={code:TT.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new EM.Metadata};return}let o=e.path.split(",");for(let a of o){let c=(0,e9.splitHostPort)(a);if(c===null){this.error={code:TT.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new EM.Metadata};return}if(e.scheme===vM&&!(0,J5.isIPv4)(c.host)||e.scheme===bM&&!(0,J5.isIPv6)(c.host)){this.error={code:TT.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new EM.Metadata};return}s.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:vIe})}this.endpoints=s.map(a=>({addresses:[a]})),t9("Parsed "+e.scheme+" address list "+s.map(yIe.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,X5.statusOrFromError)(this.error),{},null,""):this.listener((0,X5.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function bIe(){(0,Q5.registerResolver)(vM,AT),(0,Q5.registerResolver)(bM,AT)}});var o9=b(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.RoundRobinLoadBalancer=void 0;Ug.setup=IIe;var s9=ia(),cr=Cr(),$g=Gs(),TIe=ct(),AIe=Be(),n9=qr(),xIe=Dg(),wIe="round_robin";function i9(t){TIe.trace(AIe.LogVerbosity.DEBUG,wIe,t)}var xT="round_robin",wT=class t{getLoadBalancerName(){return xT}constructor(){}toJsonObject(){return{[xT]:{}}}static createFromJson(e){return new t}},AM=class{constructor(e,r=0){this.children=e,this.nextIndex=r}pick(e){let r=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,r.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function RIe(t,e){return[...t.slice(e),...t.slice(0,e)]}var RT=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=cr.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,s9.createChildChannelControlHelper)(e,{updateState:(r,n,i)=>{this.currentState===cr.ConnectivityState.READY&&r!==cr.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),i&&(this.lastError=i),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(r=>r.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(cr.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===cr.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(i=>(0,n9.endpointEqual)(i.getEndpoint(),n)),r<0&&(r=0)}this.updateState(cr.ConnectivityState.READY,new AM(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),r),null)}else if(this.countChildrenWithState(cr.ConnectivityState.CONNECTING)>0)this.updateState(cr.ConnectivityState.CONNECTING,new $g.QueuePicker(this),null);else if(this.countChildrenWithState(cr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(cr.ConnectivityState.TRANSIENT_FAILURE,new $g.UnavailablePicker({details:e}),e)}else this.updateState(cr.ConnectivityState.IDLE,new $g.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===cr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){i9(cr.ConnectivityState[this.currentState]+" -> "+cr.ConnectivityState[e]),e===cr.ConnectivityState.READY?this.currentReadyPicker=r:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,r,n,i){if(!(r instanceof wT))return!1;if(!e.ok)return this.children.length===0&&this.updateState(cr.ConnectivityState.TRANSIENT_FAILURE,new $g.UnavailablePicker(e.error),e.error.details),!0;let s=Math.random()*e.value.length|0,o=RIe(e.value,s);if(this.resetSubchannelList(),o.length===0){let a=`No addresses resolved. Resolution note: ${i}`;this.updateState(cr.ConnectivityState.TRANSIENT_FAILURE,new $g.UnavailablePicker({details:a}),a)}i9("Connect to endpoint list "+o.map(n9.endpointToString)),this.updatesPaused=!0,this.children=o.map(a=>new xIe.LeafLoadBalancer(a,this.childChannelControlHelper,n,i));for(let a of this.children)a.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return xT}};Ug.RoundRobinLoadBalancer=RT;function IIe(){(0,s9.registerLoadBalancerType)(xT,RT,wT)}});var l9=b(gl=>{"use strict";var xM;Object.defineProperty(gl,"__esModule",{value:!0});gl.OutlierDetectionLoadBalancer=gl.OutlierDetectionLoadBalancingConfig=void 0;gl.setup=FIe;var CIe=Cr(),a9=Be(),ml=Og(),c9=_M(),PIe=ia(),OIe=Yv(),NIe=Gs(),wM=qr(),kIe=Cg(),MIe=ct(),DIe="outlier_detection";function Jt(t){MIe.trace(a9.LogVerbosity.DEBUG,DIe,t)}var NM="outlier_detection",LIe=((xM=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&xM!==void 0?xM:"true")==="true",$Ie={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},UIe={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Bd(t,e,r,n){if(e in t&&t[e]!==void 0&&typeof t[e]!==r){let i=n?`${n}.${e}`:e;throw new Error(`outlier detection config ${i} parse error: expected ${r}, got ${typeof t[e]}`)}}function RM(t,e,r){let n=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,ml.isDuration)(t[e]))throw new Error(`outlier detection config ${n} parse error: expected Duration, got ${typeof t[e]}`);if(!(t[e].seconds>=0&&t[e].seconds<=315576e6&&t[e].nanos>=0&&t[e].nanos<=999999999))throw new Error(`outlier detection config ${n} parse error: values out of range for non-negative Duaration`)}}function IT(t,e,r){let n=r?`${r}.${e}`:e;if(Bd(t,e,"number",r),e in t&&t[e]!==void 0&&!(t[e]>=0&&t[e]<=100))throw new Error(`outlier detection config ${n} parse error: value out of range for percentage (0-100)`)}var Fg=class t{constructor(e,r,n,i,s,o,a){if(this.childPolicy=a,a.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=r??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=i??10,this.successRateEjection=s?Object.assign(Object.assign({},$Ie),s):null,this.failurePercentageEjection=o?Object.assign(Object.assign({},UIe),o):null}getLoadBalancerName(){return NM}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,ml.msToDuration)(this.intervalMs),base_ejection_time:(0,ml.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,ml.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(r=this.failurePercentageEjection)!==null&&r!==void 0?r:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var r;if(RM(e,"interval"),RM(e,"base_ejection_time"),RM(e,"max_ejection_time"),IT(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Bd(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),IT(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Bd(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Bd(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");IT(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),IT(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Bd(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Bd(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let n=(0,PIe.selectLbConfigFromList)(e.child_policy);if(!n)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new t(e.interval?(0,ml.durationToMs)(e.interval):null,e.base_ejection_time?(0,ml.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,ml.durationToMs)(e.max_ejection_time):null,(r=e.max_ejection_percent)!==null&&r!==void 0?r:null,e.success_rate_ejection,e.failure_percentage_ejection,n)}};gl.OutlierDetectionLoadBalancingConfig=Fg;var CM=class extends kIe.BaseSubchannelWrapper{constructor(e,r){super(e),this.mapEntry=r,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function IM(){return{success:0,failure:0}}var PM=class{constructor(){this.activeBucket=IM(),this.inactiveBucket=IM()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=IM()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},OM=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===NIe.PickResultType.COMPLETE){let n=r.subchannel,i=n.getMapEntry();if(i){let s=r.onCallEnded;return this.countCalls&&(s=(o,a,c)=>{var l;o===a9.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(l=r.onCallEnded)===null||l===void 0||l.call(r,o,a,c)}),Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel(),onCallEnded:s})}else return Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel()})}else return r}},CT=class{constructor(e){this.entryMap=new wM.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new OIe.ChildLoadBalancerHandler((0,c9.createChildChannelControlHelper)(e,{createSubchannel:(r,n)=>{let i=e.createSubchannel(r,n),s=this.entryMap.getForSubchannelAddress(r),o=new CM(i,s);return s?.currentEjectionTimestamp!==null&&o.eject(),s?.subchannelWrappers.push(o),o},updateState:(r,n,i)=>{r===CIe.ConnectivityState.READY?e.updateState(r,new OM(n,this.isCountingEnabled()),i):e.updateState(r,n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let r of this.entryMap.values())r.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getSuccessRateEjectionConfig();if(!r)return;Jt("Running success rate check");let n=r.request_volume,i=0,s=[];for(let[d,f]of this.entryMap.entries()){let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();Jt("Stats for "+(0,wM.endpointToString)(d)+": successes="+p+" failures="+h+" targetRequestVolume="+n),p+h>=n&&(i+=1,s.push(p/(p+h)))}if(Jt("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+s+"]"),i<r.minimum_hosts)return;let o=s.reduce((d,f)=>d+f)/s.length,a=0;for(let d of s){let f=d-o;a+=f*f}let c=a/s.length,l=Math.sqrt(c),u=o-l*(r.stdev_factor/1e3);Jt("stdev="+l+" ejectionThreshold="+u);for(let[d,f]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();if(p+h<n)continue;let m=p/(p+h);if(Jt("Checking candidate "+d+" successRate="+m),m<u){let E=Math.random()*100;Jt("Candidate "+d+" randomNumber="+E+" enforcement_percentage="+r.enforcement_percentage),E<r.enforcement_percentage&&(Jt("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;Jt("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let n=0;for(let i of this.entryMap.values()){let s=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();s+o>=r.request_volume&&(n+=1)}if(!(n<r.minimum_hosts))for(let[i,s]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let o=s.counter.getLastSuccesses(),a=s.counter.getLastFailures();if(Jt("Candidate successes="+o+" failures="+a),o+a<r.request_volume)continue;if(a*100/(a+o)>r.threshold){let l=Math.random()*100;Jt("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+r.enforcement_percentage),l<r.enforcement_percentage&&(Jt("Ejecting candidate "+i),this.eject(s,e))}}}eject(e,r){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let n of e.subchannelWrappers)n.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let r of e.subchannelWrappers)r.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var r,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(r=this.ejectionTimer).unref)===null||n===void 0||n.call(r)}runChecks(){let e=new Date;if(Jt("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[r,n]of this.entryMap.entries())if(n.currentEjectionTimestamp===null)n.ejectionTimeMultiplier>0&&(n.ejectionTimeMultiplier-=1);else{let i=this.latestConfig.getBaseEjectionTimeMs(),s=this.latestConfig.getMaxEjectionTimeMs(),o=new Date(n.currentEjectionTimestamp.getTime());o.setMilliseconds(o.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,s))),o<new Date&&(Jt("Unejecting "+r),this.uneject(n))}}}updateAddressList(e,r,n,i){if(!(r instanceof Fg))return!1;if(Jt("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let o of e.value)this.entryMap.has(o)||(Jt("Adding map entry for "+(0,wM.endpointToString)(o)),this.entryMap.set(o,{counter:new PM,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let s=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,n,i),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){Jt("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let o=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(o)}else Jt("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{Jt("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let o of this.entryMap.values())this.uneject(o),o.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return NM}};gl.OutlierDetectionLoadBalancer=CT;function FIe(){LIe&&(0,c9.registerLoadBalancerType)(NM,CT,Fg)}});var u9=b(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});OT.PriorityQueue=void 0;var jd=0,kM=t=>Math.floor(t/2),PT=t=>t*2+1,Bg=t=>t*2+2,MM=class{constructor(e=(r,n)=>r>n){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[jd]}push(...e){return e.forEach(r=>{this.heap.push(r),this.siftUp()}),this.size()}pop(){let e=this.peek(),r=this.size()-1;return r>jd&&this.swap(jd,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[jd]=e,this.siftDown(),r}greater(e,r){return this.comparator(this.heap[e],this.heap[r])}swap(e,r){[this.heap[e],this.heap[r]]=[this.heap[r],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>jd&&this.greater(e,kM(e));)this.swap(e,kM(e)),e=kM(e)}siftDown(){let e=jd;for(;PT(e)<this.size()&&this.greater(PT(e),e)||Bg(e)<this.size()&&this.greater(Bg(e),e);){let r=Bg(e)<this.size()&&this.greater(Bg(e),PT(e))?Bg(e):PT(e);this.swap(e,r),e=r}}};OT.PriorityQueue=MM});var m9=b(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.WeightedRoundRobinLoadBalancingConfig=void 0;zg.setup=ZIe;var Xt=Cr(),BIe=Be(),pn=Og(),p9=ia(),jIe=Dg(),zIe=ct(),h9=hT(),zd=Gs(),GIe=u9(),d9=qr(),VIe="weighted_round_robin";function DM(t){zIe.trace(BIe.LogVerbosity.DEBUG,VIe,t)}var UM="weighted_round_robin",qIe=1e4,HIe=1e4,WIe=3*6e4,YIe=1e3,KIe=1;function f9(t,e,r){if(e in t&&t[e]!==void 0&&typeof t[e]!==r)throw new Error(`weighted round robin config ${e} parse error: expected ${r}, got ${typeof t[e]}`)}function NT(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,pn.isDuration)(t[e]))r=t[e];else if((0,pn.isDurationMessage)(t[e]))r=(0,pn.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let n=(0,pn.parseDuration)(t[e]);if(!n)throw new Error(`weighted round robin config ${e}: failed to parse duration string ${t[e]}`);r=n}else throw new Error(`weighted round robin config ${e}: expected duration, got ${typeof t[e]}`);return(0,pn.durationToMs)(r)}return null}var jg=class t{constructor(e,r,n,i,s,o){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??qIe,this.blackoutPeriodMs=n??HIe,this.weightExpirationPeriodMs=i??WIe,this.weightUpdatePeriodMs=Math.max(s??YIe,100),this.errorUtilizationPenalty=o??KIe}getLoadBalancerName(){return UM}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,pn.durationToString)((0,pn.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,pn.durationToString)((0,pn.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,pn.durationToString)((0,pn.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,pn.durationToString)((0,pn.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if(f9(e,"enable_oob_load_report","boolean"),f9(e,"error_utilization_penalty","number"),e.error_utilization_penalty<0)throw new Error("weighted round robin config error_utilization_penalty < 0");return new t(e.enable_oob_load_report,NT(e,"oob_load_reporting_period"),NT(e,"blackout_period"),NT(e,"weight_expiration_period"),NT(e,"weight_update_period"),e.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}};zg.WeightedRoundRobinLoadBalancingConfig=jg;var LM=class{constructor(e,r){this.metricsHandler=r,this.queue=new GIe.PriorityQueue((s,o)=>s.deadline<o.deadline);let n=e.filter(s=>s.weight>0),i;if(n.length<2)i=1;else{let s=0;for(let{weight:o}of n)s+=o;i=s/n.length}for(let s of e){let o=s.weight>0?1/s.weight:i;this.queue.push({endpointName:s.endpointName,picker:s.picker,period:o,deadline:Math.random()*o})}}pick(e){let r=this.queue.pop();this.queue.push(Object.assign(Object.assign({},r),{deadline:r.deadline+r.period}));let n=r.picker.pick(e);if(n.pickResultType===zd.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,h9.createMetricsReader)(i=>this.metricsHandler(i,r.endpointName),n.onCallEnded)});{let i=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:i.getWrappedSubchannel()})}}else return n}},$M=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=Xt.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let r=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(r+=1);return r}updateWeight(e,r){var n,i;let s=r.rps_fractional,o=r.application_utilization;o>0&&s>0&&(o+=r.eps/s*((i=(n=this.latestConfig)===null||n===void 0?void 0:n.getErrorUtilizationPenalty())!==null&&i!==void 0?i:0));let a=o===0?0:s/o;if(a===0)return;let c=new Date;e.nonEmptySince===null&&(e.nonEmptySince=c),e.lastUpdated=c,e.weight=a}getWeight(e){if(!this.latestConfig)return 0;let r=new Date().getTime();if(r-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||r-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(Xt.ConnectivityState.READY)>0){let e=[];for(let[n,i]of this.children)i.child.getConnectivityState()===Xt.ConnectivityState.READY&&e.push({endpointName:n,picker:i.child.getPicker(),weight:this.getWeight(i)});DM("Created picker with weights: "+e.map(n=>n.endpointName+":"+n.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(n,i)=>{let s=this.children.get(i);s&&this.updateWeight(s,n)},this.updateState(Xt.ConnectivityState.READY,new LM(e,r),null)}else if(this.countChildrenWithState(Xt.ConnectivityState.CONNECTING)>0)this.updateState(Xt.ConnectivityState.CONNECTING,new zd.QueuePicker(this),null);else if(this.countChildrenWithState(Xt.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Xt.ConnectivityState.TRANSIENT_FAILURE,new zd.UnavailablePicker({details:e}),e)}else this.updateState(Xt.ConnectivityState.IDLE,new zd.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===Xt.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){DM(Xt.ConnectivityState[this.currentState]+" -> "+Xt.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}updateAddressList(e,r,n,i){var s,o;if(!(r instanceof jg))return!1;if(!e.ok)return this.children.size===0&&this.updateState(Xt.ConnectivityState.TRANSIENT_FAILURE,new zd.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let l=`No addresses resolved. Resolution note: ${i}`;return this.updateState(Xt.ConnectivityState.TRANSIENT_FAILURE,new zd.UnavailablePicker({details:l}),l),!1}DM("Connect to endpoint list "+e.value.map(d9.endpointToString));let a=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let l of e.value){let u=(0,d9.endpointToString)(l);c.add(u);let d=this.children.get(u);d||(d={child:new jIe.LeafLoadBalancer(l,(0,p9.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(f,p,h)=>{this.currentState===Xt.ConnectivityState.READY&&f!==Xt.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),f===Xt.ConnectivityState.READY&&(d.nonEmptySince=null),h&&(this.lastError=h),this.calculateAndUpdateState()},createSubchannel:(f,p)=>{let h=this.channelControlHelper.createSubchannel(f,p);return d?.oobMetricsListener?new h9.OrcaOobMetricsSubchannelWrapper(h,d.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):h}}),n,i),lastUpdated:a,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(u,d)),r.getEnableOobLoadReport()?d.oobMetricsListener=f=>{this.updateWeight(d,f)}:d.oobMetricsListener=null}for(let[l,u]of this.children)c.has(l)?u.child.startConnecting():(u.child.destroy(),this.children.delete(l));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(o=(s=setInterval(()=>{this.currentState===Xt.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||o===void 0?void 0:o.call(s),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return UM}};function ZIe(){(0,p9.registerLoadBalancerType)(UM,$M,jg)}});var Gg=b(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.experimental=he.ServerMetricRecorder=he.ServerInterceptingCall=he.ResponderBuilder=he.ServerListenerBuilder=he.addAdminServicesToServer=he.getChannelzHandlers=he.getChannelzServiceDefinition=he.InterceptorConfigurationError=he.InterceptingCall=he.RequesterBuilder=he.ListenerBuilder=he.StatusBuilder=he.getClientChannel=he.ServerCredentials=he.Server=he.setLogVerbosity=he.setLogger=he.load=he.loadObject=he.CallCredentials=he.ChannelCredentials=he.waitForClientReady=he.closeClient=he.Channel=he.makeGenericClientConstructor=he.makeClientConstructor=he.loadPackageDefinition=he.Client=he.compressionAlgorithms=he.propagate=he.connectivityState=he.status=he.logVerbosity=he.Metadata=he.credentials=void 0;var kT=$v();Object.defineProperty(he,"CallCredentials",{enumerable:!0,get:function(){return kT.CallCredentials}});var JIe=wO();Object.defineProperty(he,"Channel",{enumerable:!0,get:function(){return JIe.ChannelImplementation}});var XIe=GN();Object.defineProperty(he,"compressionAlgorithms",{enumerable:!0,get:function(){return XIe.CompressionAlgorithms}});var QIe=Cr();Object.defineProperty(he,"connectivityState",{enumerable:!0,get:function(){return QIe.ConnectivityState}});var MT=ad();Object.defineProperty(he,"ChannelCredentials",{enumerable:!0,get:function(){return MT.ChannelCredentials}});var g9=xO();Object.defineProperty(he,"Client",{enumerable:!0,get:function(){return g9.Client}});var FM=Be();Object.defineProperty(he,"logVerbosity",{enumerable:!0,get:function(){return FM.LogVerbosity}});Object.defineProperty(he,"status",{enumerable:!0,get:function(){return FM.Status}});Object.defineProperty(he,"propagate",{enumerable:!0,get:function(){return FM.Propagate}});var _9=ct(),BM=nb();Object.defineProperty(he,"loadPackageDefinition",{enumerable:!0,get:function(){return BM.loadPackageDefinition}});Object.defineProperty(he,"makeClientConstructor",{enumerable:!0,get:function(){return BM.makeClientConstructor}});Object.defineProperty(he,"makeGenericClientConstructor",{enumerable:!0,get:function(){return BM.makeClientConstructor}});var eCe=Wt();Object.defineProperty(he,"Metadata",{enumerable:!0,get:function(){return eCe.Metadata}});var tCe=$5();Object.defineProperty(he,"Server",{enumerable:!0,get:function(){return tCe.Server}});var rCe=fT();Object.defineProperty(he,"ServerCredentials",{enumerable:!0,get:function(){return rCe.ServerCredentials}});var nCe=U5();Object.defineProperty(he,"StatusBuilder",{enumerable:!0,get:function(){return nCe.StatusBuilder}});he.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),combineCallCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),createInsecure:MT.ChannelCredentials.createInsecure,createSsl:MT.ChannelCredentials.createSsl,createFromSecureContext:MT.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:kT.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:kT.CallCredentials.createFromGoogleCredential,createEmpty:kT.CallCredentials.createEmpty};var iCe=t=>t.close();he.closeClient=iCe;var sCe=(t,e,r)=>t.waitForReady(e,r);he.waitForClientReady=sCe;var oCe=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};he.loadObject=oCe;var aCe=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};he.load=aCe;var cCe=t=>{_9.setLogger(t)};he.setLogger=cCe;var lCe=t=>{_9.setLoggerVerbosity(t)};he.setLogVerbosity=lCe;var uCe=t=>g9.Client.prototype.getChannel.call(t);he.getClientChannel=uCe;var DT=bO();Object.defineProperty(he,"ListenerBuilder",{enumerable:!0,get:function(){return DT.ListenerBuilder}});Object.defineProperty(he,"RequesterBuilder",{enumerable:!0,get:function(){return DT.RequesterBuilder}});Object.defineProperty(he,"InterceptingCall",{enumerable:!0,get:function(){return DT.InterceptingCall}});Object.defineProperty(he,"InterceptorConfigurationError",{enumerable:!0,get:function(){return DT.InterceptorConfigurationError}});var y9=ha();Object.defineProperty(he,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return y9.getChannelzServiceDefinition}});Object.defineProperty(he,"getChannelzHandlers",{enumerable:!0,get:function(){return y9.getChannelzHandlers}});var dCe=Xv();Object.defineProperty(he,"addAdminServicesToServer",{enumerable:!0,get:function(){return dCe.addAdminServicesToServer}});var jM=sM();Object.defineProperty(he,"ServerListenerBuilder",{enumerable:!0,get:function(){return jM.ServerListenerBuilder}});Object.defineProperty(he,"ResponderBuilder",{enumerable:!0,get:function(){return jM.ResponderBuilder}});Object.defineProperty(he,"ServerInterceptingCall",{enumerable:!0,get:function(){return jM.ServerInterceptingCall}});var fCe=hT();Object.defineProperty(he,"ServerMetricRecorder",{enumerable:!0,get:function(){return fCe.ServerMetricRecorder}});var pCe=_M();he.experimental=pCe;var hCe=ck(),mCe=Z5(),gCe=r9(),_Ce=Dg(),yCe=o9(),SCe=l9(),ECe=m9(),vCe=ha();hCe.setup(),mCe.setup(),gCe.setup(),_Ce.setup(),yCe.setup(),SCe.setup(),ECe.setup(),vCe.setup()});var S9=b(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});LT.createServiceClientConstructor=void 0;var bCe=Gg();function TCe(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:n=>n,requestDeserialize:n=>n,responseSerialize:n=>n,responseDeserialize:n=>n}};return bCe.makeGenericClientConstructor(r,e)}LT.createServiceClientConstructor=TCe});var Vg=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.createOtlpGrpcExporterTransport=zn.GrpcExporterTransport=zn.createEmptyMetadata=zn.createSslCredentials=zn.createInsecureCredentials=void 0;var ACe=fY(),E9=`OTel-OTLP-Exporter-JavaScript/${ACe.VERSION}`;function xCe(t){return t?`${t} ${E9}`:E9}var wCe=0,RCe=2;function ICe(t){return t==="gzip"?RCe:wCe}function CCe(){let{credentials:t}=Gg();return t.createInsecure()}zn.createInsecureCredentials=CCe;function PCe(t,e,r){let{credentials:n}=Gg();return n.createSsl(t,e,r)}zn.createSslCredentials=PCe;function OCe(){let{Metadata:t}=Gg();return new t}zn.createEmptyMetadata=OCe;var $T=class{_client;_metadata;_parameters;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,r){let n=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:i}=S9();try{this._metadata=this._parameters.metadata()}catch(o){return Promise.resolve({status:"failure",error:o})}let s=i(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new s(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":ICe(this._parameters.compression),"grpc.primary_user_agent":xCe(this._parameters.userAgent)})}catch(o){return Promise.resolve({status:"failure",error:o})}}return new Promise(i=>{let s=Date.now()+r;if(this._metadata==null)return i({error:new Error("metadata was null"),status:"failure"});this._client.export(n,this._metadata,{deadline:s},(o,a)=>{i(o?{status:"failure",error:o}:{data:a,status:"success"})})})}};zn.GrpcExporterTransport=$T;function NCe(t){return new $T(t)}zn.createOtlpGrpcExporterTransport=NCe});var x9=b(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.getOtlpGrpcDefaultConfiguration=ba.mergeOtlpGrpcConfigurationWithDefaults=ba.validateAndNormalizeUrl=void 0;var T9=(Pv(),Ar(Cv)),qg=Vg(),kCe=J("url"),v9=(be(),Ar(Zo));function A9(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new kCe.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&v9.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),r.protocol!==""&&!r.protocol?.match(/^(http)s?:$/)&&v9.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}ba.validateAndNormalizeUrl=A9;function b9(t,e){for(let[r,n]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,n)}function MCe(t,e,r){let n=t.url??e.url??r.url;return{...(0,T9.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let i=r.metadata();return b9(i,t.metadata?.().clone()??(0,qg.createEmptyMetadata)()),b9(i,e.metadata?.()??(0,qg.createEmptyMetadata)()),i},url:A9(n),credentials:t.credentials??e.credentials?.(n)??r.credentials(n),userAgent:t.userAgent}}ba.mergeOtlpGrpcConfigurationWithDefaults=MCe;function DCe(){return{...(0,T9.getSharedConfigurationDefaults)(),metadata:()=>(0,qg.createEmptyMetadata)(),url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,qg.createInsecureCredentials)():()=>(0,qg.createSslCredentials)()}}ba.getOtlpGrpcDefaultConfiguration=DCe});function w9(t){let e={};return Object.entries(t??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Q.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}var R9=x(()=>{"use strict";be()});function LCe(t,e,r){return async()=>{let n={...await r()},i={};return e!=null&&Object.assign(i,await e()),t!=null&&Object.assign(i,w9(await t())),Object.assign(i,n)}}function $Ce(t){if(t!=null)try{let e=globalThis.location?.href;return new URL(t,e).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function I9(t,e,r){return{...Av(t,e,r),headers:LCe(t.headers,e.headers,r.headers),url:$Ce(t.url)??e.url??r.url}}function C9(t,e){return{...xv(),headers:async()=>t,url:"http://localhost:4318/"+e}}var P9=x(()=>{"use strict";Gm();R9()});function _l(t){return async e=>{let r=e==="http:",n=r?import("http"):import("https"),{Agent:i}=await n;if(r){let{ca:s,cert:o,key:a,...c}=t;return new i(c)}return new i(t)}}function O9(t,e,r){return{...I9(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory,userAgent:t.userAgent}}function N9(t,e){return{...C9(t,e),agentFactory:_l({keepAlive:!0})}}var UT=x(()=>{"use strict";P9()});function zM(t){return t===429||t===502||t===503||t===504}function GM(t){if(t==null)return;let e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let r=new Date(t).getTime()-Date.now();return r>=0?r:0}var k9=x(()=>{"use strict"});var M9,D9=x(()=>{"use strict";M9="0.218.0"});import*as U9 from"zlib";import{Readable as UCe}from"stream";function F9(t,e,r,n,i,s,o,a){return new Promise(c=>{let l=new URL(e);i?r["User-Agent"]=`${i} ${L9}`:r["User-Agent"]=L9;let d=t(l,{method:"POST",headers:r,agent:s},f=>{let p=[],h=0;f.on("data",m=>{if(h+=m.length,h>$9){let E=new Error(`OTLP export response body exceeded size limit of ${$9} bytes`);c({status:"failure",error:E}),f.destroy();return}p.push(m)}),f.on("end",()=>{if(f.statusCode&&f.statusCode<=299)c({status:"success",data:Buffer.concat(p)});else if(f.statusCode&&zM(f.statusCode))c({status:"retryable",retryInMillis:GM(f.headers["retry-after"])});else{let m=new js(f.statusMessage,f.statusCode,Buffer.concat(p).toString());c({status:"failure",error:m})}}),f.on("error",m=>{f.statusCode&&f.statusCode<=299?c({status:"success"}):f.statusCode&&zM(f.statusCode)?c({status:"retryable",error:m,retryInMillis:GM(f.headers["retry-after"])}):c({status:"failure",error:m})})});d.setTimeout(a,()=>{d.destroy(),c({status:"retryable",error:new Error("Request timed out")})}),d.on("error",f=>{jCe(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),FCe(d,n,o,f=>{c({status:"failure",error:f})})})}function FCe(t,e,r,n){let i=BCe(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),i=i.on("error",n).pipe(U9.createGzip()).on("error",n)),i.pipe(t).on("error",n)}function BCe(t){let e=new UCe;return e.push(t),e.push(null),e}function jCe(t){let e=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in t&&typeof t.code=="string"?e.has(t.code):!1}var L9,$9,B9=x(()=>{"use strict";k9();bv();D9();L9=`OTel-OTLP-Exporter-JavaScript/${M9}`,$9=4*1024*1024});async function zCe(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function j9(t){return new VM(t)}var VM,z9=x(()=>{"use strict";B9();VM=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,r){let{agent:n,request:i}=await this._loadUtils(),s=await this._parameters.headers();return F9(i,this._parameters.url,s,this._parameters.compression,this._parameters.userAgent,n,e,r)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let r=new URL(this._parameters.url).protocol,[n,i]=await Promise.all([this._parameters.agentFactory(r),zCe(r)]);e=this._utils={agent:n,request:i}}return e}}});function HCe(){return Math.random()*(2*G9)-G9}function V9(t){return new HM(t.transport)}var qM,GCe,VCe,qCe,G9,HM,q9=x(()=>{"use strict";be();qM=5,GCe=1e3,VCe=5e3,qCe=1.5,G9=.2;HM=class{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,s)=>{setTimeout(()=>{this._transport.send(e,r).then(i,s)},n)})}async send(e,r){let n=qM,i=GCe,s=Date.now()+r,o=await this._transport.send(e,r);for(;o.status==="retryable"&&n>0;){n--;let a=Math.max(Math.min(i*(1+HCe()),VCe),0);i=i*qCe;let c=o.retryInMillis??a,l=s-Date.now();if(c>l)return Q.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),o;Q.verbose(`Scheduling export retry in ${Math.round(c)}ms`),o=await this.retry(e,l,c)}return o.status==="success"?Q.verbose(`Export succeeded after ${qM-n} retry attempts.`):o.status==="retryable"?Q.info(`Export failed after maximum retry attempts (${qM}).`):Q.info(`Export failed with non-retryable error: ${o.error}`),o}shutdown(){return this._transport.shutdown()}}});function H9(t,e){return Iv({transport:V9({transport:j9(t)}),serializer:e,promiseHandler:Rv(t)},{timeout:t.timeoutMillis})}var W9=x(()=>{"use strict";DP();z9();kP();q9()});function Y9(t){let e=ju(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;Q.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function WCe(t){let e=Y9(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=Y9("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function K9(t){let e=Gr(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;Q.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function YCe(t){let e=K9(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=K9("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function FT(t){return{timeoutMillis:WCe(t),compression:YCe(t)}}var WM=x(()=>{"use strict";Fs();be()});import*as Z9 from"fs";import*as J9 from"path";function KCe(t){let e=Gr(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=Gr("OTEL_EXPORTER_OTLP_HEADERS"),n=$c(e),i=$c(r);if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return Object.assign({},$c(r),$c(e))}function ZCe(t){try{return new URL(t).toString()}catch{Q.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function JCe(t,e){try{new URL(t)}catch{Q.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith("/")||(t=t+"/"),t+=e;try{new URL(t)}catch{Q.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function XCe(t){let e=Gr("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return JCe(e,t)}function QCe(t){let e=Gr(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return ZCe(e)}function YM(t,e,r){let n=Gr(t),i=Gr(e),s=n??i;if(s!=null)try{return Z9.readFileSync(J9.resolve(process.cwd(),s))}catch{Q.warn(r);return}else return}function e0e(t){return YM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function t0e(t){return YM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function r0e(t){return YM(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function X9(t,e){return{...FT(t),url:QCe(t)??XCe(e),headers:Tv(KCe(t)),agentFactory:_l({keepAlive:!0,ca:r0e(t),cert:e0e(t),key:t0e(t)})}}var Q9=x(()=>{"use strict";Fs();be();WM();Gm();UT()});function eJ(t){return typeof t.headers=="function"?t.headers:Tv(t.headers)}var tJ=x(()=>{"use strict";Gm()});function n0e(t){if(typeof t.httpAgentOptions=="function")return t.httpAgentOptions;let e=t.httpAgentOptions;if(t.keepAlive!=null&&(e={keepAlive:t.keepAlive,...e}),e!=null)return _l(e)}function rJ(t,e,r,n){return t.metadata&&Q.warn("Metadata cannot be set when using http"),O9({url:t.url,headers:eJ(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:n0e(t),userAgent:t.userAgent},X9(e,r),N9(n,r))}var nJ=x(()=>{"use strict";be();UT();KM();Q9();tJ()});var iJ={};ir(iJ,{convertLegacyHttpOptions:()=>rJ,createOtlpHttpExportDelegate:()=>H9,getSharedConfigurationFromEnvironment:()=>FT,httpAgentFactoryFromOptions:()=>_l});var KM=x(()=>{"use strict";UT();W9();WM();nJ()});var lJ=b(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0});BT.getOtlpGrpcConfigurationFromEnv=void 0;var sJ=(Fs(),Ar(_6)),Hg=Vg(),i0e=(KM(),Ar(iJ)),s0e=J("fs"),o0e=J("path"),aJ=(be(),Ar(Zo));function ZM(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function a0e(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),n=(0,sJ.parseKeyPairsIntoRecord)(e),i=(0,sJ.parseKeyPairsIntoRecord)(r);if(Object.keys(n).length===0&&Object.keys(i).length===0)return;let s=Object.assign({},i,n),o=(0,Hg.createEmptyMetadata)();for(let[a,c]of Object.entries(s))o.set(a,c);return o}function c0e(t){let e=a0e(t);if(e!=null)return()=>e}function l0e(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return ZM(e,r)}function u0e(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return ZM(e,r)==="true"}function JM(t,e,r){let n=process.env[t]?.trim(),i=process.env[e]?.trim(),s=ZM(n,i);if(s!=null)try{return s0e.readFileSync(o0e.resolve(process.cwd(),s))}catch{aJ.diag.warn(r);return}else return}function d0e(t){return JM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function f0e(t){return JM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function oJ(t){return JM(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function cJ(t){let e=f0e(t),r=d0e(t),n=oJ(t),i=e!=null&&r!=null;return n!=null&&!i?(aJ.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,Hg.createSslCredentials)(oJ(t))):(0,Hg.createSslCredentials)(n,e,r)}function p0e(t){return u0e(t)?(0,Hg.createInsecureCredentials)():cJ(t)}function h0e(t){return{...(0,i0e.getSharedConfigurationFromEnvironment)(t),metadata:c0e(t),url:l0e(t),credentials:e=>e.startsWith("http://")?()=>(0,Hg.createInsecureCredentials)():e.startsWith("https://")?()=>cJ(t):()=>p0e(t)}}BT.getOtlpGrpcConfigurationFromEnv=h0e});var dJ=b(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});jT.convertLegacyOtlpGrpcOptions=void 0;var uJ=x9(),m0e=Vg(),g0e=lJ();function _0e(t,e){let r=t.credentials;return(0,uJ.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,m0e.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0,userAgent:t.userAgent},(0,g0e.getOtlpGrpcConfigurationFromEnv)(e),(0,uJ.getOtlpGrpcDefaultConfiguration)())}jT.convertLegacyOtlpGrpcOptions=_0e});var fJ=b(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});zT.createOtlpGrpcExportDelegate=void 0;var y0e=(Pv(),Ar(Cv)),S0e=Vg();function E0e(t,e,r,n){return(0,y0e.createOtlpNetworkExportDelegate)(t,e,(0,S0e.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,userAgent:t.userAgent,grpcName:r,grpcPath:n}))}zT.createOtlpGrpcExportDelegate=E0e});var pJ=b(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.createOtlpGrpcExportDelegate=Gd.convertLegacyOtlpGrpcOptions=void 0;var v0e=dJ();Object.defineProperty(Gd,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return v0e.convertLegacyOtlpGrpcOptions}});var b0e=fJ();Object.defineProperty(Gd,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return b0e.createOtlpGrpcExportDelegate}})});function ro(t){return t<0?10:t<128?1:t<16384?2:t<2097152?3:t<268435456?4:t<34359738368?5:t<4398046511104?6:t<562949953421312?7:t<72057594037927940?8:9}var XM=x(()=>{"use strict"});var T0e,Wg,Ta,GT=x(()=>{"use strict";be();XM();T0e="ProtobufWriter: estimated size was too small, growing buffer.",Wg=1,Ta=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(e){let r=this.pos+e;if(r<=this._buffer.length)return;Q.debug(T0e);let n=this._buffer.length*2;for(;n<r;)n*=2;let i=new Uint8Array(n);i.set(this._buffer),this._buffer=i,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(Wg),this.pos+=Wg,e}finishLengthDelimited(e,r){let n=r>>>0,i=ro(n);if(i>Wg){let o=i-Wg;this._ensureCapacity(o),this._buffer.copyWithin(e+i,e+Wg,this.pos),this.pos+=o}let s=e;n<128?this._buffer[s]=n:n<16384?(this._buffer[s++]=n&127|128,this._buffer[s]=n>>>7):n<2097152?(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s]=n>>>14):n<268435456?(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s++]=n>>>14&127|128,this._buffer[s]=n>>>21):(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s++]=n>>>14&127|128,this._buffer[s++]=n>>>21&127|128,this._buffer[s]=n>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}this.writeFixed64(r,n)}writeVarint(e){if(this._ensureCapacity(ro(e)),e>=0&&e<=4294967295){let r=e>>>0;for(;r>127;)this._buffer[this.pos++]=r&127|128,r>>>=7;this._buffer[this.pos++]=r}else{let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}for(;n>0||r>127;)this._buffer[this.pos++]=r&127|128,r=(r>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=r&127}}writeFixed32(e){this._ensureCapacity(4);let r=e>>>0;this._buffer[this.pos++]=r&255,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255}writeFixed64(e,r){this._ensureCapacity(8);let n=e>>>0,i=r>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=i&255,this._buffer[this.pos++]=i>>>8&255,this._buffer[this.pos++]=i>>>16&255,this._buffer[this.pos++]=i>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let r=!0,n=e.length;for(let i=0;i<n;i++)if(e.charCodeAt(i)>127){r=!1;break}if(r){this.writeVarint(n),this._ensureCapacity(n);for(let i=0;i<n;i++)this._buffer[this.pos++]=e.charCodeAt(i)}else{let i=this._textEncoder.encode(e);this.writeBytes(i)}}}});function hJ(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function no(t){let e=new Uint8Array(t.length/2),r=0;for(let n=0;n<t.length;n+=2){let i=hJ(t.charCodeAt(n)),s=hJ(t.charCodeAt(n+1));e[r++]=i<<4|s}return e}var QM=x(()=>{"use strict"});var Yg,mJ=x(()=>{"use strict";(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Yg||(Yg={}))});var Kg,gJ,eD=x(()=>{"use strict";Kg=class{emit(e){}enabled(){return!1}},gJ=new Kg});function _J(t,e,r){return n=>n===t?e:r}var Zg,Vd,tD,yJ=x(()=>{"use strict";Zg=Symbol.for("io.opentelemetry.js.api.logs"),Vd=globalThis;tD=1});var rD,VT,nD=x(()=>{"use strict";eD();rD=class{getLogger(e,r,n){return new Kg}},VT=new rD});var qT,SJ=x(()=>{"use strict";eD();qT=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):gJ}}});var Jg,EJ=x(()=>{"use strict";nD();SJ();Jg=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new qT(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:VT}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}}});var HT,vJ=x(()=>{"use strict";yJ();nD();EJ();HT=class t{constructor(){this._proxyLoggerProvider=new Jg}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Vd[Zg]?this.getLoggerProvider():(Vd[Zg]=_J(tD,e,VT),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Vd[Zg])===null||e===void 0?void 0:e.call(Vd,tD))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Vd[Zg],this._proxyLoggerProvider=new Jg}}});var hct,bJ=x(()=>{"use strict";mJ();vJ();hct=HT.getInstance()});function Yr(t,e){let r=e[0],n=e[1],i=1e9,s=r&65535,o=r/65536>>>0,a=s*i,c=o*i,l=a>>>0,u=Math.floor(a/4294967296),d=(c&65535)*65536>>>0,f=c/65536>>>0,p=l+d+n,h=p>>>0,m=Math.floor(p/4294967296),E=u+f+m>>>0;t.writeFixed64(h,E)}function yi(t,e,r){for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=e[n];t.writeTag(r,2);let s=t.startLengthDelimited(),o=t.pos;A0e(t,n,i),t.finishLengthDelimited(s,t.pos-o)}}function A0e(t,e,r){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),i=t.pos;Xg(t,r),t.finishLengthDelimited(n,t.pos-i)}function Xg(t,e){let r=typeof e;if(r==="string")t.writeTag(1,2),t.writeString(e);else if(r==="boolean")t.writeTag(2,0),t.writeVarint(e?1:0);else if(r==="number"){let n=e;Number.isInteger(n)&&n>=x0e&&n<w0e?(t.writeTag(3,0),t.writeVarint(n)):(t.writeTag(4,1),t.writeDouble(n))}else if(e instanceof Uint8Array)t.writeTag(7,2),t.writeBytes(e);else if(Array.isArray(e)){t.writeTag(5,2);let n=t.startLengthDelimited(),i=t.pos;for(let s of e){t.writeTag(1,2);let o=t.startLengthDelimited(),a=t.pos;Xg(t,s),t.finishLengthDelimited(o,t.pos-a)}t.finishLengthDelimited(n,t.pos-i)}else if(r==="object"&&e!=null){t.writeTag(6,2);let n=t.startLengthDelimited(),i=t.pos,s=e;for(let o in s){if(!Object.prototype.hasOwnProperty.call(s,o))continue;let a=s[o];t.writeTag(1,2);let c=t.startLengthDelimited(),l=t.pos;t.writeTag(1,2),t.writeString(o),t.writeTag(2,2);let u=t.startLengthDelimited(),d=t.pos;Xg(t,a),t.finishLengthDelimited(u,t.pos-d),t.finishLengthDelimited(c,t.pos-l)}t.finishLengthDelimited(n,t.pos-i)}}function qd(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;t.writeTag(1,2),t.writeString(e.name),e.version&&(t.writeTag(2,2),t.writeString(e.version)),t.finishLengthDelimited(n,t.pos-i)}function Hd(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;e.attributes&&yi(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-i)}var x0e,w0e,WT=x(()=>{"use strict";x0e=-(2**63),w0e=2**63});function R0e(t){let e=t.length,r=0;for(let n=0;n<e;n++){let i=t.charCodeAt(n);i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4)}return r}var Aa,YT=x(()=>{"use strict";XM();Aa=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,r){this.pos+=ro(r)}writeVarint(e){this.pos+=ro(e)}writeSint32(e){this.pos+=ro((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,r){this.pos+=8}writeBytes(e){this.pos+=ro(e.length),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this.pos+=8}writeString(e){let r=R0e(e);this.pos+=ro(r),this.pos+=r}}});function I0e(t,e){let r=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),Yr(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==Yg.UNSPECIFIED&&(t.writeTag(2,0),t.writeVarint(e.severityNumber)),e.severityText&&(t.writeTag(3,2),t.writeString(e.severityText)),e.body!==void 0){t.writeTag(5,2);let i=t.startLengthDelimited(),s=t.pos;Xg(t,e.body),t.finishLengthDelimited(i,t.pos-s)}e.attributes&&yi(t,e.attributes,6),t.writeTag(7,0),t.writeVarint(e.droppedAttributesCount),e.spanContext?.traceFlags&&(t.writeTag(8,5),t.writeFixed32(e.spanContext.traceFlags)),e.spanContext?.traceId&&(t.writeTag(9,2),t.writeBytes(no(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(no(e.spanContext.spanId))),t.writeTag(11,1),Yr(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(r,t.pos-n)}function C0e(t,e,r){let n=t.startLengthDelimited(),i=t.pos;qd(t,e,1);for(let s of r)t.writeTag(2,2),I0e(t,s);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function TJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hd(t,e,1);for(let s of r.values()){t.writeTag(2,2);let o=s[0].instrumentationScope;C0e(t,o,s)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function P0e(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,s=e.get(n);s||(s=new Map,e.set(n,s));let o=s.get(i);o||(o=[],s.set(i,o)),o.push(r)}return e}function AJ(t){let e=P0e(t),r=new Aa;for(let[i,s]of e)r.writeTag(1,2),TJ(r,i,s);let n=new Ta(r.pos);for(let[i,s]of e)n.writeTag(1,2),TJ(n,i,s);return n.finish()}var xJ=x(()=>{"use strict";GT();QM();bJ();WT();YT()});var Si,KT=x(()=>{"use strict";Si=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,r=0,n=!1;for(;this.pos<this._buf.length;){let i=this._buf[this.pos++];if(e+=(i&127)*Math.pow(2,r),r+=7,(i&128)===0){n=!0;break}}if(!n)throw new Error("Truncated buffer: unexpected end of data while reading varint");return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw new Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let r=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,r}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:r}=this.readTag();if(r===4)break;this.skip(r)}break;case 4:break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${e}, cannot safely skip`)}}}});function O0e(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedLogRecords=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function wJ(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=O0e(e.readBytes()):e.skip(i)}return r}var RJ=x(()=>{"use strict";KT()});var iD,IJ=x(()=>{"use strict";xJ();RJ();iD={serializeRequest:t=>AJ(t),deserializeResponse:t=>wJ(t)}});var CJ=x(()=>{"use strict";IJ()});var io,PJ=x(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(io||(io={}))});var sD,hn,OJ=x(()=>{"use strict";(function(t){t.COUNTER="COUNTER",t.GAUGE="GAUGE",t.HISTOGRAM="HISTOGRAM",t.UP_DOWN_COUNTER="UP_DOWN_COUNTER",t.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",t.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",t.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(sD||(sD={}));(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(hn||(hn={}))});var oD=x(()=>{"use strict";PJ();OJ()});function MJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;t.writeTag(2,1),Yr(t,e.startTime),t.writeTag(3,1),Yr(t,e.endTime),r===ks.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&yi(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-i)}function N0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;if(t.writeTag(2,1),Yr(t,e.startTime),t.writeTag(3,1),Yr(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.buckets.counts.length>0){t.writeTag(6,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of i.buckets.counts)t.writeFixed64(a>>>0,a/4294967296>>>0);t.finishLengthDelimited(s,t.pos-o)}if(i.buckets.boundaries.length>0){t.writeTag(7,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of i.buckets.boundaries)t.writeDouble(a);t.finishLengthDelimited(s,t.pos-o)}e.attributes&&yi(t,e.attributes,9),i.min!==void 0&&(t.writeTag(11,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(12,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function NJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;if(e!==0&&(t.writeTag(1,0),t.writeSint32(e)),r.length>0){t.writeTag(2,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of r)t.writeVarint(a);t.finishLengthDelimited(s,t.pos-o)}t.finishLengthDelimited(n,t.pos-i)}function k0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;e.attributes&&yi(t,e.attributes,1),t.writeTag(2,1),Yr(t,e.startTime),t.writeTag(3,1),Yr(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.scale!==0&&(t.writeTag(6,0),t.writeSint32(i.scale)),t.writeTag(7,1),t.writeFixed64(i.zeroCount>>>0,i.zeroCount/4294967296>>>0),t.writeTag(8,2),NJ(t,i.positive.offset,i.positive.bucketCounts),t.writeTag(9,2),NJ(t,i.negative.offset,i.negative.bucketCounts),i.min!==void 0&&(t.writeTag(12,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(13,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function M0e(t,e){let r=t.startLengthDelimited(),n=t.pos;switch(t.writeTag(1,2),t.writeString(e.descriptor.name),e.descriptor.description&&(t.writeTag(2,2),t.writeString(e.descriptor.description)),e.descriptor.unit&&(t.writeTag(3,2),t.writeString(e.descriptor.unit)),e.dataPointType){case hn.GAUGE:t.writeTag(5,2),D0e(t,e);break;case hn.SUM:t.writeTag(7,2),L0e(t,e);break;case hn.HISTOGRAM:t.writeTag(9,2),$0e(t,e);break;case hn.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),U0e(t,e);break;default:{let i=e}}t.finishLengthDelimited(r,t.pos-n)}function D0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let i of e.dataPoints)t.writeTag(1,2),MJ(t,i,e.descriptor.valueType);t.finishLengthDelimited(r,t.pos-n)}function L0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),MJ(t,s,e.descriptor.valueType);let i=aD(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),e.isMonotonic&&(t.writeTag(3,0),t.writeVarint(1)),t.finishLengthDelimited(r,t.pos-n)}function $0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),N0e(t,s);let i=aD(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function U0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),k0e(t,s);let i=aD(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function F0e(t,e){let r=t.startLengthDelimited(),n=t.pos;qd(t,e.scope,1);for(let i of e.metrics)t.writeTag(2,2),M0e(t,i);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function kJ(t,e){let r=t.startLengthDelimited(),n=t.pos;Hd(t,e.resource,1);for(let i of e.scopeMetrics)t.writeTag(2,2),F0e(t,i);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function aD(t){switch(t){case io.DELTA:return 1;case io.CUMULATIVE:return 2;default:return 0}}function DJ(t){let e=new Aa;e.writeTag(1,2),kJ(e,t);let r=new Ta(e.pos);return r.writeTag(1,2),kJ(r,t),r.finish()}var LJ=x(()=>{"use strict";be();oD();WT();YT();GT()});function B0e(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedDataPoints=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function $J(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=B0e(e.readBytes()):e.skip(i)}return r}var UJ=x(()=>{"use strict";KT()});var cD,FJ=x(()=>{"use strict";LJ();UJ();cD={serializeRequest:t=>DJ(t),deserializeResponse:t=>$J(t)}});var BJ=x(()=>{"use strict";FJ()});function zJ(t,e){let r=t&255|j0e;return e&&(r|=z0e),r}function G0e(t,e){let r=t.startLengthDelimited(),n=t.pos;e.message&&(t.writeTag(2,2),t.writeString(e.message)),t.writeTag(3,0),t.writeVarint(e.code),t.finishLengthDelimited(r,t.pos-n)}function V0e(t,e){let r=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),Yr(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&yi(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(r,t.pos-n)}function q0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.context;t.writeTag(1,2),t.writeBytes(no(i.traceId)),t.writeTag(2,2),t.writeBytes(no(i.spanId));let s=i.traceState?.serialize();s&&(t.writeTag(3,2),t.writeString(s)),e.attributes&&yi(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let o=zJ(i.traceFlags,i.isRemote);o&&(t.writeTag(6,5),t.writeFixed32(o)),t.finishLengthDelimited(r,t.pos-n)}function H0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.spanContext();t.writeTag(1,2),t.writeBytes(no(i.traceId)),t.writeTag(2,2),t.writeBytes(no(i.spanId));let s=i.traceState?.serialize();s&&(t.writeTag(3,2),t.writeString(s)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(no(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let o=e.kind==null?0:e.kind+1;o!==0&&(t.writeTag(6,0),t.writeVarint(o)),t.writeTag(7,1),Yr(t,e.startTime),t.writeTag(8,1),Yr(t,e.endTime),e.attributes&&yi(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),V0e(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),q0e(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),G0e(t,e.status);let a=zJ(i.traceFlags,e.parentSpanContext?.isRemote);a&&(t.writeTag(16,5),t.writeFixed32(a)),t.finishLengthDelimited(r,t.pos-n)}function W0e(t,e,r){let n=t.startLengthDelimited(),i=t.pos;qd(t,e,1);for(let s of r)t.writeTag(2,2),H0e(t,s);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function jJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hd(t,e,1);for(let s of r.values()){t.writeTag(2,2);let o=s[0].instrumentationScope;W0e(t,o,s)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Y0e(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,s=e.get(n);s||(s=new Map,e.set(n,s));let o=s.get(i);o||(o=[],s.set(i,o)),o.push(r)}return e}function GJ(t){let e=Y0e(t),r=new Aa;for(let[i,s]of e)r.writeTag(1,2),jJ(r,i,s);let n=new Ta(r.pos);for(let[i,s]of e)n.writeTag(1,2),jJ(n,i,s);return n.finish()}var j0e,z0e,VJ=x(()=>{"use strict";GT();QM();WT();YT();j0e=256,z0e=512});function K0e(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedSpans=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function qJ(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=K0e(e.readBytes()):e.skip(i)}return r}var HJ=x(()=>{"use strict";KT()});var lD,WJ=x(()=>{"use strict";VJ();HJ();lD={serializeRequest:t=>GJ(t),deserializeResponse:t=>qJ(t)}});var YJ=x(()=>{"use strict";WJ()});function Wd(t,e){let r={attributes:so(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Yd(t){return{name:t.name,version:t.version}}function so(t,e){return Object.keys(t).map(r=>uD(r,t[r],e))}function uD(t,e,r){return{key:t,value:Qg(e,r)}}function Qg(t,e){let r=typeof t;if(r==="string")return{stringValue:t};if(r==="number")return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if(r==="boolean")return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:e.encodeUint8Array(t)};if(Array.isArray(t)){let n=new Array(t.length);for(let i=0;i<t.length;i++)n[i]=Qg(t[i],e);return{arrayValue:{values:n}}}if(r==="object"&&t!=null){let n=Object.keys(t),i=new Array(n.length);for(let s=0;s<n.length;s++)i[s]={key:n[s],value:Qg(t[n[s]],e)};return{kvlistValue:{values:i}}}return{}}var ZT=x(()=>{"use strict"});function KJ(t,e){return{resourceLogs:J0e(t,e)}}function Z0e(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:s="",schemaUrl:o=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${s}:${o}`,l=a.get(c);l||(l=[],a.set(c,l)),l.push(r)}return e}function J0e(t,e){let r=Z0e(t);return Array.from(r,([n,i])=>{let s=Wd(n,e);return{resource:s,scopeLogs:Array.from(i,([,o])=>({scope:Yd(o[0].instrumentationScope),logRecords:o.map(a=>X0e(a,e)),schemaUrl:o[0].instrumentationScope.schemaUrl})),schemaUrl:s.schemaUrl}})}function X0e(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Qg(t.body,e),eventName:t.eventName,attributes:Q0e(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function Q0e(t,e){return Object.keys(t).map(r=>uD(r,t[r],e))}var ZJ=x(()=>{"use strict";ZT()});function ePe(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function tPe(t){return ePe(t).toString()}function JJ(t){return t}var rPe,Kd,JT=x(()=>{"use strict";Fs();rPe=typeof BigInt<"u"?tPe:bE;Kd={encodeHrTime:rPe,encodeSpanContext:JJ,encodeOptionalSpanContext:JJ,encodeUint8Array:t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64");let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=String.fromCharCode(t[r]);return btoa(e.join(""))}}});var dD,XJ=x(()=>{"use strict";ZJ();JT();be();dD={serializeRequest:t=>{let e=KJ(t,Kd);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return Q.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}}});var QJ=x(()=>{"use strict";XJ()});var e_,eX=x(()=>{"use strict";(function(t){t[t.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",t[t.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",t[t.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(e_||(e_={}))});function nPe(t,e){let r=Wd(t.resource,e);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:iPe(t.scopeMetrics,e)}}function iPe(t,e){return Array.from(t.map(r=>({scope:Yd(r.scope),metrics:r.metrics.map(n=>sPe(n,e)),schemaUrl:r.scope.schemaUrl})))}function sPe(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=lPe(t.aggregationTemporality);switch(t.dataPointType){case hn.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:tX(t,e)};break;case hn.GAUGE:r.gauge={dataPoints:tX(t,e)};break;case hn.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:aPe(t,e)};break;case hn.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:cPe(t,e)};break}return r}function oPe(t,e,r){let n={attributes:so(t.attributes,r),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case ks.INT:n.asInt=t.value;break;case ks.DOUBLE:n.asDouble=t.value;break}return n}function tX(t,e){return t.dataPoints.map(r=>oPe(r,t.descriptor.valueType,e))}function aPe(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:so(r.attributes,e),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function cPe(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:so(r.attributes,e),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function lPe(t){switch(t){case io.DELTA:return e_.AGGREGATION_TEMPORALITY_DELTA;case io.CUMULATIVE:return e_.AGGREGATION_TEMPORALITY_CUMULATIVE}}function rX(t,e){return{resourceMetrics:t.map(r=>nPe(r,e))}}var nX=x(()=>{"use strict";be();oD();eX();ZT()});var fD,iX=x(()=>{"use strict";nX();JT();be();fD={serializeRequest:t=>{let e=rX([t],Kd);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return Q.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}}});var sX=x(()=>{"use strict";iX()});function oX(t,e){let r=t&255|uPe;return e&&(r|=dPe),r}function fPe(t,e){let r=t.spanContext(),n=t.status,i=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:i,traceState:r.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:so(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(s=>hPe(s,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(s=>pPe(s,e)),droppedLinksCount:t.droppedLinksCount,flags:oX(r.traceFlags,t.parentSpanContext?.isRemote)}}function pPe(t,e){return{attributes:t.attributes?so(t.attributes,e):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0,flags:oX(t.context.traceFlags,t.context.isRemote)}}function hPe(t,e){return{attributes:t.attributes?so(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function aX(t,e){return{resourceSpans:gPe(t,e)}}function mPe(t){let e=new Map;for(let r of t){let n=e.get(r.resource);n||(n=new Map,e.set(r.resource,n));let i=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(r)}return e}function gPe(t,e){let r=mPe(t),n=[],i=r.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,c=[],l=a.values(),u=l.next();for(;!u.done;){let p=u.value;if(p.length>0){let h=p.map(m=>fPe(m,e));c.push({scope:Yd(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=l.next()}let d=Wd(o,e),f={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};n.push(f),s=i.next()}return n}var uPe,dPe,cX=x(()=>{"use strict";ZT();uPe=256,dPe=512});var pD,lX=x(()=>{"use strict";cX();JT();be();pD={serializeRequest:t=>{let e=aX(t,Kd);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return Q.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}}});var uX=x(()=>{"use strict";lX()});var dX={};ir(dX,{JsonLogsSerializer:()=>dD,JsonMetricsSerializer:()=>fD,JsonTraceSerializer:()=>pD,ProtobufLogsSerializer:()=>iD,ProtobufMetricsSerializer:()=>cD,ProtobufTraceSerializer:()=>lD});var fX=x(()=>{"use strict";CJ();BJ();YJ();QJ();sX();uX()});var hX=b(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});XT.OTLPTraceExporter=void 0;var pX=pJ(),_Pe=(fX(),Ar(dX)),yPe=(Pv(),Ar(Cv)),hD=class extends yPe.OTLPExporterBase{constructor(e={}){super((0,pX.createOtlpGrpcExportDelegate)((0,pX.convertLegacyOtlpGrpcOptions)(e,"TRACES"),_Pe.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};XT.OTLPTraceExporter=hD});var mX=b(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});QT.OTLPTraceExporter=void 0;var SPe=hX();Object.defineProperty(QT,"OTLPTraceExporter",{enumerable:!0,get:function(){return SPe.OTLPTraceExporter}})});var OQ=b((kft,PQ)=>{"use strict";PQ.exports=CQ;CQ.sync=ENe;var RQ=J("fs");function SNe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function IQ(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:SNe(e,r)}function CQ(t,e,r){RQ.stat(t,function(n,i){r(n,n?!1:IQ(i,t,e))})}function ENe(t,e){return IQ(RQ.statSync(t),t,e)}});var LQ=b((Mft,DQ)=>{"use strict";DQ.exports=kQ;kQ.sync=vNe;var NQ=J("fs");function kQ(t,e,r){NQ.stat(t,function(n,i){r(n,n?!1:MQ(i,e))})}function vNe(t,e){return MQ(NQ.statSync(t),e)}function MQ(t,e){return t.isFile()&&bNe(t,e)}function bNe(t,e){var r=t.mode,n=t.uid,i=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===o||r&a&&n===s||r&u&&s===0;return d}});var UQ=b((Lft,$Q)=>{"use strict";var Dft=J("fs"),bA;process.platform==="win32"||global.TESTING_WINDOWS?bA=OQ():bA=LQ();$Q.exports=$D;$D.sync=TNe;function $D(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){$D(t,e||{},function(s,o){s?i(s):n(o)})})}bA(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function TNe(t,e){try{return bA.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var qQ=b(($ft,VQ)=>{"use strict";var tf=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",FQ=J("path"),ANe=tf?";":":",BQ=UQ(),jQ=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),zQ=(t,e)=>{let r=e.colon||ANe,n=t.match(/\//)||tf&&t.match(/\\/)?[""]:[...tf?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=tf?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=tf?i.split(r):[""];return tf&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:i}},GQ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:s}=zQ(t,e),o=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&o.length?u(o):d(jQ(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,h=FQ.join(p,t),m=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+h:h;u(c(m,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let h=i[d];BQ(l+h,{pathExt:s},(m,E)=>{if(!m&&E)if(e.all)o.push(l+h);else return f(l+h);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},xNe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=zQ(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=FQ.join(c,t),u=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let f=u+n[d];try{if(BQ.sync(f,{pathExt:i}))if(e.all)s.push(f);else return f}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw jQ(t)};VQ.exports=GQ;GQ.sync=xNe});var WQ=b((Uft,UD)=>{"use strict";var HQ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};UD.exports=HQ;UD.exports.default=HQ});var JQ=b((Fft,ZQ)=>{"use strict";var YQ=J("path"),wNe=qQ(),RNe=WQ();function KQ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=wNe.sync(t.command,{path:r[RNe({env:r})],pathExt:e?YQ.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return o&&(o=YQ.resolve(i?t.options.cwd:"",o)),o}function INe(t){return KQ(t)||KQ(t,!0)}ZQ.exports=INe});var XQ=b((Bft,BD)=>{"use strict";var FD=/([()\][%!^"`<>&|;, *?])/g;function CNe(t){return t=t.replace(FD,"^$1"),t}function PNe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(FD,"^$1"),e&&(t=t.replace(FD,"^$1")),t}BD.exports.command=CNe;BD.exports.argument=PNe});var e7=b((jft,QQ)=>{"use strict";QQ.exports=/^#!(.*)/});var r7=b((zft,t7)=>{"use strict";var ONe=e7();t7.exports=(t="")=>{let e=t.match(ONe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var i7=b((Gft,n7)=>{"use strict";var jD=J("fs"),NNe=r7();function kNe(t){let r=Buffer.alloc(150),n;try{n=jD.openSync(t,"r"),jD.readSync(n,r,0,150,0),jD.closeSync(n)}catch{}return NNe(r.toString())}n7.exports=kNe});var c7=b((Vft,a7)=>{"use strict";var MNe=J("path"),s7=JQ(),o7=XQ(),DNe=i7(),LNe=process.platform==="win32",$Ne=/\.(?:com|exe)$/i,UNe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function FNe(t){t.file=s7(t);let e=t.file&&DNe(t.file);return e?(t.args.unshift(t.file),t.command=e,s7(t)):t.file}function BNe(t){if(!LNe)return t;let e=FNe(t),r=!$Ne.test(e);if(t.options.forceShell||r){let n=UNe.test(e);t.command=MNe.normalize(t.command),t.command=o7.command(t.command),t.args=t.args.map(s=>o7.argument(s,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function jNe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:BNe(n)}a7.exports=jNe});var d7=b((qft,u7)=>{"use strict";var zD=process.platform==="win32";function GD(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function zNe(t,e){if(!zD)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let s=l7(i,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function l7(t,e){return zD&&t===1&&!e.file?GD(e.original,"spawn"):null}function GNe(t,e){return zD&&t===1&&!e.file?GD(e.original,"spawnSync"):null}u7.exports={hookChildProcess:zNe,verifyENOENT:l7,verifyENOENTSync:GNe,notFoundError:GD}});var h7=b((Hft,rf)=>{"use strict";var f7=J("child_process"),VD=c7(),qD=d7();function p7(t,e,r){let n=VD(t,e,r),i=f7.spawn(n.command,n.args,n.options);return qD.hookChildProcess(i,n),i}function VNe(t,e,r){let n=VD(t,e,r),i=f7.spawnSync(n.command,n.args,n.options);return i.error=i.error||qD.verifyENOENTSync(i.status,n),i}rf.exports=p7;rf.exports.spawn=p7;rf.exports.sync=VNe;rf.exports._parse=VD;rf.exports._enoent=qD});var Fle=b((ZFt,Ule)=>{"use strict";var Sc=J("constants"),_4e=process.cwd,xI=null,y4e=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xI||(xI=_4e.call(process)),xI};try{process.cwd()}catch{}typeof process.chdir=="function"&&(cz=process.chdir,process.chdir=function(t){xI=null,cz.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,cz));var cz;Ule.exports=S4e;function S4e(t){Sc.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,d,f){f&&process.nextTick(f)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,d,f,p){p&&process.nextTick(p)},t.lchownSync=function(){}),y4e==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(f,p,h){var m=Date.now(),E=0;u(f,p,function T(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(p,function(A,S){A&&A.code==="ENOENT"?u(f,p,T):h(v)})},E),E<100&&(E+=10);return}h&&h(v)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function d(f,p,h,m,E,T){var v;if(T&&typeof T=="function"){var A=0;v=function(S,R,P){if(S&&S.code==="EAGAIN"&&A<10)return A++,u.call(t,f,p,h,m,E,v);T.apply(this,arguments)}}return u.call(t,f,p,h,m,E,v)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(d,f,p,h,m){for(var E=0;;)try{return u.call(t,d,f,p,h,m)}catch(T){if(T.code==="EAGAIN"&&E<10){E++;continue}throw T}}})(t.readSync);function e(u){u.lchmod=function(d,f,p){u.open(d,Sc.O_WRONLY|Sc.O_SYMLINK,f,function(h,m){if(h){p&&p(h);return}u.fchmod(m,f,function(E){u.close(m,function(T){p&&p(E||T)})})})},u.lchmodSync=function(d,f){var p=u.openSync(d,Sc.O_WRONLY|Sc.O_SYMLINK,f),h=!0,m;try{m=u.fchmodSync(p,f),h=!1}finally{if(h)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function r(u){Sc.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,f,p,h){u.open(d,Sc.O_SYMLINK,function(m,E){if(m){h&&h(m);return}u.futimes(E,f,p,function(T){u.close(E,function(v){h&&h(T||v)})})})},u.lutimesSync=function(d,f,p){var h=u.openSync(d,Sc.O_SYMLINK),m,E=!0;try{m=u.futimesSync(h,f,p),E=!1}finally{if(E)try{u.closeSync(h)}catch{}else u.closeSync(h)}return m}):u.futimes&&(u.lutimes=function(d,f,p,h){h&&process.nextTick(h)},u.lutimesSync=function(){})}function n(u){return u&&function(d,f,p){return u.call(t,d,f,function(h){l(h)&&(h=null),p&&p.apply(this,arguments)})}}function i(u){return u&&function(d,f){try{return u.call(t,d,f)}catch(p){if(!l(p))throw p}}}function s(u){return u&&function(d,f,p,h){return u.call(t,d,f,p,function(m){l(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(u){return u&&function(d,f,p){try{return u.call(t,d,f,p)}catch(h){if(!l(h))throw h}}}function a(u){return u&&function(d,f,p){typeof f=="function"&&(p=f,f=null);function h(m,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),p&&p.apply(this,arguments)}return f?u.call(t,d,f,h):u.call(t,d,h)}}function c(u){return u&&function(d,f){var p=f?u.call(t,d,f):u.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var zle=b((JFt,jle)=>{"use strict";var Ble=J("stream").Stream;jle.exports=E4e;function E4e(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Ble.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){s.emit("error",u),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Ble.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var c=s[o];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Vle=b((XFt,Gle)=>{"use strict";Gle.exports=b4e;var v4e=Object.getPrototypeOf||function(t){return t.__proto__};function b4e(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:v4e(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Yle=b((QFt,dz)=>{"use strict";var vt=J("fs"),T4e=Fle(),A4e=zle(),x4e=Vle(),wI=J("util"),hr,II;typeof Symbol=="function"&&typeof Symbol.for=="function"?(hr=Symbol.for("graceful-fs.queue"),II=Symbol.for("graceful-fs.previous")):(hr="___graceful-fs.queue",II="___graceful-fs.previous");function w4e(){}function Wle(t,e){Object.defineProperty(t,hr,{get:function(){return e}})}var vu=w4e;wI.debuglog?vu=wI.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(vu=function(){var t=wI.format.apply(wI,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
22
|
+
`)+1))),this.lastActivityTimestamp=new Date}trace(e,r){(0,cT.trace)(r??ya.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,lT.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},Qwe)),!((r=(e=this.callRefTimer).hasRef)===null||r===void 0)&&r.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(i=(n=this.callRefTimer).ref)===null||i===void 0||i.call(n))}callRefTimerUnref(){var e,r,n;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(r=this.callRefTimer)===null||r===void 0?void 0:r.unref)===null||n===void 0||n.call(r))}removeConnectivityStateWatcher(e){let r=this.connectivityStateWatchers.findIndex(n=>n===e);r>=0&&this.connectivityStateWatchers.splice(r,1)}updateState(e){(0,cT.trace)(ya.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,lT.uriToString)(this.target)+" "+Bn.ConnectivityState[this.connectivityState]+" -> "+Bn.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Bn.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let r=this.connectivityStateWatchers.slice();for(let n of r)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==Bn.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let r of this.wrappedSubchannels)r.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,r){return this.currentPicker.pick({metadata:e,extraPickInfo:r})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,r){return this.connectivityState!==Bn.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,r,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(Bn.ConnectivityState.IDLE),this.currentPicker=new Ik.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var r,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let s=new Date().valueOf()-this.lastActivityTimestamp.valueOf();s>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-s)},e),(n=(r=this.idleTimer).unref)===null||n===void 0||n.call(r)}maybeStartIdleTimer(){this.connectivityState!==Bn.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===ya.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,n,i,s){let o=(0,wk.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+o+'] method="'+r+'"'),new Ywe.LoadBalancingCall(this,e,r,n,i,s,o)}createRetryingCall(e,r,n,i,s){let o=(0,wk.getNextCallNumber)();return this.trace("createRetryingCall ["+o+'] method="'+r+'"'),new Rk.RetryingCall(this,e,r,n,i,s,o,this.retryBufferTracker,uT.get(this.getTarget()))}createResolvingCall(e,r,n,i,s){let o=(0,wk.getNextCallNumber)();this.trace("createResolvingCall ["+o+'] method="'+e+'", deadline='+(0,Kwe.deadlineToString)(r));let a={deadline:r,flags:s??ya.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new Zwe.ResolvingCall(this,e,a,this.filterStackFactory.clone(),o);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Bn.ConnectivityState.SHUTDOWN),this.currentPicker=new Pk;for(let r of this.configSelectionQueue)r.cancelWithStatus(ya.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(ya.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,Pg.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,lT.uriToString)(this.target)}getConnectivityState(e){let r=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),r}watchConnectivityState(e,r,n){if(this.connectivityState===Bn.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(r!==1/0){let o=r instanceof Date?r:new Date(r),a=new Date;if(r===-1/0||o<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(s),n(new Error("Deadline passed without connectivity state change"))},o.getTime()-a.getTime())}let s={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(s)}getChannelzRef(){return this.channelzRef}createCall(e,r,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Bn.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,n,i,s)}getOptions(){return this.options}};fl.InternalChannel=Nk});var wO=b(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});dT.ChannelImplementation=void 0;var iRe=ad(),sRe=kk(),Mk=class{constructor(e,r,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof iRe.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new sRe.InternalChannel(e,r,n)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,r,n){this.internalChannel.watchConnectivityState(e,r,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,r,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,r,n,i,s)}};dT.ChannelImplementation=Mk});var g5=b(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.ServerDuplexStreamImpl=gi.ServerWritableStreamImpl=gi.ServerReadableStreamImpl=gi.ServerUnaryCallImpl=void 0;gi.serverErrorToStatus=jk;var oRe=J("events"),Fk=J("stream"),Bk=Be(),m5=Wt();function jk(t,e){var r;let n={code:Bk.Status.UNKNOWN,details:"message"in t?t.message:"Unknown Error",metadata:(r=e??t.metadata)!==null&&r!==void 0?r:null};return"code"in t&&typeof t.code=="number"&&Number.isInteger(t.code)&&(n.code=t.code,"details"in t&&typeof t.details=="string"&&(n.details=t.details)),n}var Dk=class extends oRe.EventEmitter{constructor(e,r,n,i){super(),this.path=e,this.call=r,this.metadata=n,this.request=i,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};gi.ServerUnaryCallImpl=Dk;var Lk=class extends Fk.Readable{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};gi.ServerReadableStreamImpl=Lk;var $k=class extends Fk.Writable{constructor(e,r,n,i){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.request=i,this.pendingStatus={code:Bk.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new m5.Metadata,this.on("error",s=>{this.pendingStatus=jk(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};gi.ServerWritableStreamImpl=$k;var Uk=class extends Fk.Duplex{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.pendingStatus={code:Bk.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new m5.Metadata,this.on("error",i=>{this.pendingStatus=jk(i),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};gi.ServerDuplexStreamImpl=Uk});var fT=b(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.ServerCredentials=void 0;Md.createCertificateProviderServerCredentials=aRe;Md.createServerCredentialsWithInterceptors=cRe;var zk=YP(),pl=class{constructor(e,r){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=r??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let r of this.watchers)r(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new Gk}static createSsl(e,r,n=!1){var i;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(r))throw new TypeError("keyCertPairs must be an array");if(typeof n!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let s=[],o=[];for(let a=0;a<r.length;a++){let c=r[a];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${a}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${a}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${a}].cert_chain must be a Buffer`);s.push(c.cert_chain),o.push(c.private_key)}return new Vk({requestCert:n,ciphers:zk.CIPHER_SUITES},{ca:(i=e??(0,zk.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:s,key:o})}};Md.ServerCredentials=pl;var Gk=class t extends pl{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},Vk=class t extends pl{constructor(e,r){super(e,r),this.options=Object.assign(Object.assign({},e),r)}_equals(e){if(this===e)return!0;if(!(e instanceof t))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let r=0;r<this.options.cert.length;r++){let n=this.options.cert[r],i=e.options.cert[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let r=0;r<this.options.key.length;r++){let n=this.options.key[r],i=e.options.key[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},qk=class t extends pl{constructor(e,r,n){super({requestCert:r!==null,rejectUnauthorized:n,ciphers:zk.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=r,this.requireClientCertificate=n,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var r;this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var r;super._removeWatcher(e),this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function aRe(t,e,r){return new qk(t,e,r)}var Hk=class t extends pl{constructor(e,r){super({}),this.childCredentials=e,this.interceptors=r}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof t)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r]!==e.interceptors[r])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function cRe(t,e){return new Hk(t,e)}});var Og=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.durationMessageToDuration=lRe;to.msToDuration=uRe;to.durationToMs=dRe;to.isDuration=fRe;to.isDurationMessage=pRe;to.parseDuration=mRe;to.durationToString=gRe;function lRe(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function uRe(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function dRe(t){return t.seconds*1e3+t.nanos/1e6|0}function fRe(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function pRe(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var hRe=/^(\d+)(?:\.(\d+))?s$/;function mRe(t){let e=t.match(hRe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function gRe(t){if(t.nanos===0)return`${t.seconds}s`;let e;return t.nanos%1e6===0?e=1e6:t.nanos%1e3===0?e=1e3:e=1,`${t.seconds}.${t.nanos/e}s`}});var hT=b(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.OrcaOobMetricsSubchannelWrapper=fn.GRPC_METRICS_HEADER=fn.ServerMetricRecorder=fn.PerRequestMetricRecorder=void 0;fn.createOrcaClient=E5;fn.createMetricsReader=TRe;var _Re=nb(),Wk=Og(),yRe=ad(),SRe=Cg(),_5=Be(),ERe=cd(),vRe=Cr(),y5=null;function pT(){if(y5)return y5;let t=MN().loadSync,e=t("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,_Re.loadPackageDefinition)(e)}var Yk=class{constructor(){this.message={}}recordRequestCostMetric(e,r){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=r}recordUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}recordNamedMetric(e,r){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=r}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return pT().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};fn.PerRequestMetricRecorder=Yk;var bRe=3e4,Kk=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,Wk.durationToMs)((0,Wk.durationMessageToDuration)(e.request.report_interval)):bRe,n=setInterval(()=>{e.write(this.message)},r);e.on("cancelled",()=>{clearInterval(n)})}}}putUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var r;(r=this.message.utilization)===null||r===void 0||delete r[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let r=pT().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};fn.ServerMetricRecorder=Kk;function E5(t){let e=pT().xds.service.orca.v3.OpenRcaService;return new e("unused",yRe.ChannelCredentials.createInsecure(),{channelOverride:t})}fn.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var S5="grpc_orca_load_report";function TRe(t,e){return(r,n,i)=>{let s=i.getOpaque(S5);if(s)t(s);else{let o=i.get(fn.GRPC_METRICS_HEADER);o.length>0&&(s=pT().xds.data.orca.v3.OrcaLoadReport.deserialize(o[0]),t(s),i.setOpaque(S5,s))}e&&e(r,n,i)}}var v5="orca_oob_metrics",Zk=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(v5,ARe);this.dataProducer=r,r.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)===null||e===void 0||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},Jk=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new ERe.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=E5(r),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var r;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(v5),(r=this.metricsCall)===null||r===void 0||r.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==vRe.ConnectivityState.READY)return;let r=Math.min(...Array.from(this.dataWatchers).map(n=>n.getInterval()));if(!this.metricsCall||r!==this.currentInterval){(e=this.metricsCall)===null||e===void 0||e.cancel(),this.currentInterval=r;let n=this.client.streamCoreMetrics({report_interval:(0,Wk.msToDuration)(r)});this.metricsCall=n,n.on("data",i=>{this.dataWatchers.forEach(s=>{s.onMetricsUpdate(i)})}),n.on("error",i=>{if(this.metricsCall=null,i.code===_5.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}i.code!==_5.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},Xk=class extends SRe.BaseSubchannelWrapper{constructor(e,r,n){super(e),this.addDataWatcher(new Zk(r,n))}getWrappedSubchannel(){return this.child}};fn.OrcaOobMetricsSubchannelWrapper=Xk;function ARe(t){return new Jk(t)}});var sM=b(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.BaseServerInterceptingCall=jn.ServerInterceptingCall=jn.ResponderBuilder=jn.ServerListenerBuilder=void 0;jn.isInterceptingServerListener=RRe;jn.getServerInterceptingCall=NRe;var _T=Wt(),Or=Be(),Dd=J("http2"),b5=kv(),T5=J("zlib"),xRe=dk(),I5=ct(),wRe=J("tls"),A5=hT(),C5="server_call";function hl(t){I5.trace(Or.LogVerbosity.DEBUG,C5,t)}var eM=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};jn.ServerListenerBuilder=eM;function RRe(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var tM=class{constructor(e,r){this.listener=e,this.nextListener=r,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},rM=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};jn.ResponderBuilder=rM;var mT={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},gT={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},nM=class{constructor(e,r){var n,i,s,o;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(n=r?.start)!==null&&n!==void 0?n:gT.start,sendMetadata:(i=r?.sendMetadata)!==null&&i!==void 0?i:gT.sendMetadata,sendMessage:(s=r?.sendMessage)!==null&&s!==void 0?s:gT.sendMessage,sendStatus:(o=r?.sendStatus)!==null&&o!==void 0?o:gT.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(r=>{var n,i,s,o;let a={onReceiveMetadata:(n=r?.onReceiveMetadata)!==null&&n!==void 0?n:mT.onReceiveMetadata,onReceiveMessage:(i=r?.onReceiveMessage)!==null&&i!==void 0?i:mT.onReceiveMessage,onReceiveHalfClose:(s=r?.onReceiveHalfClose)!==null&&s!==void 0?s:mT.onReceiveHalfClose,onCancel:(o=r?.onCancel)!==null&&o!==void 0?o:mT.onCancel},c=new tM(a,e);this.nextCall.start(c)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,r=>{this.processingMetadata=!1,this.nextCall.sendMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,r){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new _T.Metadata),this.responder.sendMessage(e,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=n,this.pendingMessageCallback=r):this.nextCall.sendMessage(n,r)})}sendStatus(e){this.responder.sendStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextCall.sendStatus(r)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}};jn.ServerInterceptingCall=nM;var P5="grpc-accept-encoding",iM="grpc-encoding",x5="grpc-message",w5="grpc-status",Qk="grpc-timeout",IRe=/(\d{1,8})\s*([HMSmun])/,CRe={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},PRe={[P5]:"identity,deflate,gzip",[iM]:"identity"},R5={[Dd.constants.HTTP2_HEADER_STATUS]:Dd.constants.HTTP_STATUS_OK,[Dd.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},ORe={waitForTrailers:!0},yT=class{constructor(e,r,n,i,s){var o,a;this.stream=e,this.callEventTracker=n,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=Or.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=Or.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new A5.PerRequestMetricRecorder,this.stream.once("close",()=>{var f;hl("Request to method "+((f=this.handler)===null||f===void 0?void 0:f.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:Or.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",f=>{this.handleDataFrame(f)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in s&&(this.maxSendMessageSize=s["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in s&&(this.maxReceiveMessageSize=s["grpc.max_receive_message_length"]),this.host=(o=r[":authority"])!==null&&o!==void 0?o:r.host,this.decoder=new xRe.StreamDecoder(this.maxReceiveMessageSize);let c=_T.Metadata.fromHttp2Headers(r);I5.isTracerEnabled(C5)&&hl("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let l=c.get(Qk);l.length>0&&this.handleTimeoutHeader(l[0]);let u=c.get(iM);u.length>0&&(this.incomingEncoding=u[0]),c.remove(Qk),c.remove(iM),c.remove(P5),c.remove(Dd.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove(Dd.constants.HTTP2_HEADER_TE),c.remove(Dd.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=c;let d=(a=e.session)===null||a===void 0?void 0:a.socket;this.connectionInfo={localAddress:d?.localAddress,localPort:d?.localPort,remoteAddress:d?.remoteAddress,remotePort:d?.remotePort},this.shouldSendMetrics=!!s["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(IRe);if(r===null){let s={code:Or.Status.INTERNAL,details:`Invalid ${Qk} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(s)});return}let n=+r[1]*CRe[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let s={code:Or.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(s)},n)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new _T.Metadata)}serializeMessage(e){let r=this.handler.serialize(e),n=r.byteLength,i=Buffer.allocUnsafe(n+5);return i.writeUInt8(0,0),i.writeUInt32BE(n,1),r.copy(i,5),i}decompressMessage(e,r){let n=e.subarray(5);if(r==="identity")return n;if(r==="deflate"||r==="gzip"){let i;return r==="deflate"?i=T5.createInflate():i=T5.createGunzip(),new Promise((s,o)=>{let a=0,c=[];i.on("error",l=>{o({code:Or.Status.INTERNAL,details:"Failed to decompress message"})}),i.on("data",l=>{c.push(l),a+=l.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(i.destroy(),o({code:Or.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{s(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:Or.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${r}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let n=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",i;try{i=await this.decompressMessage(e.compressedMessage,n)}catch(s){this.sendStatus(s);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(s){this.sendStatus({code:Or.Status.INTERNAL,details:`Error deserializing request: ${s.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var r;if(this.checkCancelled())return;hl("Request to "+this.handler.path+" received data frame of size "+e.length);let n;try{n=this.decoder.write(e)}catch(i){this.sendStatus({code:Or.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let s={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(s),this.decompressAndMaybePush(s),(r=this.callEventTracker)===null||r===void 0||r.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){hl("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let r=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},R5),PRe),r);this.stream.respond(n,ORe)}sendMessage(e,r){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:Or.Status.INTERNAL,details:`Error serializing response: ${(0,b5.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:Or.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),hl("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var s;if(i){this.sendStatus({code:Or.Status.INTERNAL,details:`Error writing message: ${(0,b5.getErrorMessage)(i)}`,metadata:null});return}(s=this.callEventTracker)===null||s===void 0||s.addMessageSent(),r()})}sendStatus(e){var r,n,i;if(this.checkCancelled())return;hl("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+Or.Status[e.code]+" details: "+e.details);let s=(i=(n=e.metadata)===null||n===void 0?void 0:n.clone())!==null&&i!==void 0?i:new _T.Metadata;if(this.shouldSendMetrics&&s.set(A5.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let o=Object.assign({[w5]:e.code,[x5]:encodeURI(e.details)},s.toHttp2Headers());this.stream.sendTrailers(o),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let o=Object.assign(Object.assign({[w5]:e.code,[x5]:encodeURI(e.details)},R5),s.toHttp2Headers());this.stream.respond(o,{endStream:!0}),this.notifyOnCancel()}}startRead(){hl("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let r=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return r?.remoteAddress?r.remotePort?`${r.remoteAddress}:${r.remotePort}`:r.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var e;if(((e=this.stream.session)===null||e===void 0?void 0:e.socket)instanceof wRe.TLSSocket){let r=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:r.raw?r:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};jn.BaseServerInterceptingCall=yT;function NRe(t,e,r,n,i,s){let o={path:i.path,requestStream:i.type==="clientStream"||i.type==="bidi",responseStream:i.type==="serverStream"||i.type==="bidi",requestDeserialize:i.deserialize,responseSerialize:i.serialize},a=new yT(e,r,n,i,s);return t.reduce((c,l)=>l(o,c),a)}});var $5=b(Ea=>{"use strict";var kRe=Ea&&Ea.__runInitializers||function(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0},MRe=Ea&&Ea.__esDecorate||function(t,e,r,n,i,s){function o(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,p=r.length-1;p>=0;p--){var h={};for(var m in n)h[m]=m==="access"?{}:n[m];for(var m in n.access)h.access[m]=n.access[m];h.addInitializer=function(T){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(T||null))};var E=(0,r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],h);if(a==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(d=o(E.get))&&(u.get=d),(d=o(E.set))&&(u.set=d),(d=o(E.init))&&i.unshift(d)}else(d=o(E))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.Server=void 0;var Wr=J("http2"),DRe=J("util"),It=Be(),Ud=g5(),oM=fT(),O5=ni(),$d=ct(),Sa=qr(),_i=Ir(),Bt=ha(),N5=sM(),Ld=~(1<<31),aM=~(1<<31),LRe=2e4,k5=~(1<<31),{HTTP2_HEADER_PATH:M5}=Wr.constants,$Re="server",D5=Buffer.from("max_age");function L5(t){$d.trace(It.LogVerbosity.DEBUG,"server_call",t)}function URe(){}function FRe(t){return function(e,r){return DRe.deprecate(e,t)}}function cM(t){return{code:It.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function BRe(t,e){let r=cM(e);switch(t){case"unary":return(n,i)=>{i(r,null)};case"clientStream":return(n,i)=>{i(r,null)};case"serverStream":return n=>{n.emit("error",r)};case"bidi":return n=>{n.emit("error",r)};default:throw new Error(`Invalid handlerType ${t}`)}}var jRe=(()=>{var t;let e=[],r;return t=class{constructor(i){var s,o,a,c,l,u;this.boundPorts=(kRe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=i??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Bt.ChannelzTraceStub,this.callTracker=new Bt.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Bt.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Bt.ChannelzChildrenTrackerStub):(this.channelzTrace=new Bt.ChannelzTrace,this.callTracker=new Bt.ChannelzCallTracker,this.listenerChildrenTracker=new Bt.ChannelzChildrenTracker,this.sessionChildrenTracker=new Bt.ChannelzChildrenTracker),this.channelzRef=(0,Bt.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(s=this.options["grpc.max_connection_age_ms"])!==null&&s!==void 0?s:Ld,this.maxConnectionAgeGraceMs=(o=this.options["grpc.max_connection_age_grace_ms"])!==null&&o!==void 0?o:Ld,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:aM,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:LRe,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:k5,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(i){var s,o,a;let c=this.sessions.get(i),l=i.socket,u=l.remoteAddress?(0,Sa.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Sa.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let h=l,m=h.getCipher(),E=h.getCertificate(),T=h.getPeerCertificate();f={cipherSuiteStandardName:(s=m.standardName)!==null&&s!==void 0?s:null,cipherSuiteOtherName:m.standardName?null:m.name,localCertificate:E&&"raw"in E?E.raw:null,remoteCertificate:T&&"raw"in T?T.raw:null}}else f=null;return{remoteAddress:u,localAddress:d,security:f,remoteName:null,streamsStarted:c.streamTracker.callsStarted,streamsSucceeded:c.streamTracker.callsSucceeded,streamsFailed:c.streamTracker.callsFailed,messagesSent:c.messagesSent,messagesReceived:c.messagesReceived,keepAlivesSent:c.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:c.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:c.lastMessageSentTimestamp,lastMessageReceivedTimestamp:c.lastMessageReceivedTimestamp,localFlowControlWindow:(o=i.state.localWindowSize)!==null&&o!==void 0?o:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){$d.trace(It.LogVerbosity.DEBUG,$Re,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){$d.trace(It.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,s){if(i===null||typeof i!="object"||s===null||typeof s!="object")throw new Error("addService() requires two objects as arguments");let o=Object.keys(i);if(o.length===0)throw new Error("Cannot add an empty service to a server");o.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let u=s[a],d;if(u===void 0&&typeof c.originalName=="string"&&(u=s[c.originalName]),u!==void 0?d=u.bind(s):d=BRe(l,a),this.register(c.path,d,c.responseSerialize,c.requestDeserialize,l)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(i){if(i===null||typeof i!="object")throw new Error("removeService() requires object as argument");Object.keys(i).forEach(o=>{let a=i[o];this.unregister(a.path)})}bind(i,s){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,Bt.registerChannelzSocket)((0,Sa.subchannelAddressToString)(i),()=>({localAddress:i,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(i){(0,Bt.unregisterChannelzRef)(i)}createHttp2Server(i){let s;if(i._isSecure()){let o=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),o),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),s=Wr.createSecureServer(c),s.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),s.on("secureConnection",d=>{d.on("error",f=>{this.trace("An incoming TLS connection closed with error: "+f.message)})});let u=d=>{if(d){let f=s;try{f.setSecureContext(d)}catch(p){$d.log(It.LogVerbosity.ERROR,"Failed to set secure context with error "+p.message),d=null}}l=d!==null,this.trace("Post-update credentials valid: "+l)};i._addWatcher(u),s.on("close",()=>{i._removeWatcher(u)})}else s=Wr.createServer(this.commonServerOptions);return s.setTimeout(0,URe),this._setupHandlers(s,i._getInterceptors()),s}bindOneAddress(i,s){this.trace("Attempting to bind "+(0,Sa.subchannelAddressToString)(i));let o=this.createHttp2Server(s.credentials);return new Promise((a,c)=>{let l=u=>{this.trace("Failed to bind "+(0,Sa.subchannelAddressToString)(i)+" with error "+u.message),a({port:"port"in i?i.port:1,error:u.message})};o.once("error",l),o.listen(i,()=>{let u=o.address(),d;typeof u=="string"?d={path:u}:d={host:u.address,port:u.port};let f=this.experimentalRegisterListenerToChannelz(d);this.listenerChildrenTracker.refChild(f),this.http2Servers.set(o,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),s.listeningServers.add(o),this.trace("Successfully bound "+(0,Sa.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),o.removeListener("error",l)})})}async bindManyPorts(i,s){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Sa.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let o=await this.bindOneAddress(i[0],s);if(o.error){let a=await this.bindManyPorts(i.slice(1),s);return Object.assign(Object.assign({},a),{errors:[o.error,...a.errors]})}else{let a=i.slice(1).map(u=>(0,Sa.isTcpSubchannelAddress)(u)?{host:u.host,port:o.port}:u),c=await Promise.all(a.map(u=>this.bindOneAddress(u,s))),l=[o,...c];return{count:l.filter(u=>u.error===void 0).length,port:o.port,errors:l.filter(u=>u.error).map(u=>u.error)}}}else{let o=await Promise.all(i.map(a=>this.bindOneAddress(a,s)));return{count:o.filter(a=>a.error===void 0).length,port:o[0].port,errors:o.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,s){let o=await this.bindManyPorts(i,s);if(o.count>0)return o.count<i.length&&$d.log(It.LogVerbosity.INFO,`WARNING Only ${o.count} addresses added out of total ${i.length} resolved`),o.port;{let a=`No address added out of total ${i.length} resolved`;throw $d.log(It.LogVerbosity.ERROR,a),new Error(`${a} errors: [${o.errors.join(",")}]`)}}resolvePort(i){return new Promise((s,o)=>{let a=!1,c=(u,d,f,p)=>{if(a)return!0;if(a=!0,!u.ok)return o(new Error(u.error.details)),!0;let h=[].concat(...u.value.map(m=>m.addresses));return h.length===0?(o(new Error(`No addresses resolved for port ${i}`)),!0):(s(h),!0)};(0,O5.createResolver)(i,c,this.options).updateResolution()})}async bindPort(i,s){let o=await this.resolvePort(i);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(o,s);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let s=(0,_i.parseUri)(i);if(s===null)throw new Error(`Could not parse port "${i}"`);let o=(0,O5.mapUriDefaultScheme)(s);if(o===null)throw new Error(`Could not get a default scheme for port "${i}"`);return o}bindAsync(i,s,o){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(s===null||!(s instanceof oM.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof o!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,p)=>{process.nextTick(()=>o(f,p))},l=this.boundPorts.get((0,_i.uriToString)(a));if(l){if(!s._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>o(null,f),f=>o(f,0)):c(null,l.portNumber);return}l={mapKey:(0,_i.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:s,listeningServers:new Set};let u=(0,_i.splitHostPort)(a.path),d=this.bindPort(a,l);l.completionPromise=d,u?.port===0?d.then(f=>{let p={scheme:a.scheme,authority:a.authority,path:(0,_i.combineHostPort)({host:u.host,port:f})};l.mapKey=(0,_i.uriToString)(p),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),o(null,f)},f=>{o(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,o(null,f)},f=>{o(f,0)}))}registerInjectorToChannelz(){return(0,Bt.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(i,s,o=!1){if(i===null||!(i instanceof oM.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(s);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:s,sessions:c,ownsChannelzRef:o}),{injectConnection:l=>{a.emit("connection",l)},drain:l=>{var u,d;for(let f of c)this.closeSession(f);(d=(u=setTimeout(()=>{for(let f of c)f.destroy(Wr.constants.NGHTTP2_CANCEL)},l)).unref)===null||d===void 0||d.call(u)},destroy:()=>{this.closeServer(a);for(let l of c)this.closeSession(l)}}}createConnectionInjector(i){if(i===null||!(i instanceof oM.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let s=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,s,!0)}closeServer(i,s){this.trace("Closing server with address "+JSON.stringify(i.address()));let o=this.http2Servers.get(i);i.close(()=>{o&&o.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(o.channelzRef),(0,Bt.unregisterChannelzRef)(o.channelzRef)),this.http2Servers.delete(i),s?.()})}closeSession(i,s){var o;this.trace("Closing session initiated by "+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,Bt.unregisterChannelzRef)(a.ref)),s?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let s of i.listeningServers){let o=this.http2Servers.get(s);if(this.closeServer(s,()=>{i.listeningServers.delete(s)}),o)for(let a of o.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let s=this.normalizePort(i),o=(0,_i.splitHostPort)(s.path);if(o?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,_i.uriToString)(s));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,_i.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,s){var o,a;this.trace("drain port="+i+" graceTimeMs="+s);let c=this.normalizePort(i),l=(0,_i.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,_i.uriToString)(c));if(!u)return;let d=new Set;for(let f of u.listeningServers){let p=this.http2Servers.get(f);if(p)for(let h of p.sessions)d.add(h),this.closeSession(h,()=>{d.delete(h)})}(a=(o=setTimeout(()=>{for(let f of d)f.destroy(Wr.constants.NGHTTP2_CANCEL)},s)).unref)===null||a===void 0||a.call(o)}forceShutdown(){for(let i of this.boundPorts.values())i.cancelled=!0;this.boundPorts.clear();for(let i of this.http2Servers.keys())this.closeServer(i);this.sessions.forEach((i,s)=>{this.closeSession(s),s.destroy(Wr.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Bt.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,s,o,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:s,serialize:o,deserialize:a,type:c,path:i}),!0)}unregister(i){return this.handlers.delete(i)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(i=>!i.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(i){var s;let o=l=>{(0,Bt.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&o()}this.shutdown=!0;for(let[l,u]of this.http2Servers.entries()){a++;let d=u.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(l,()=>{this.trace("Server "+d+" finished closing"),c()});for(let f of u.sessions.keys()){a++;let p=(s=f.socket)===null||s===void 0?void 0:s.remoteAddress;this.trace("Waiting for session "+p+" to close"),this.closeSession(f,()=>{this.trace("Session "+p+" finished closing"),c()})}}a===0&&o()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,s){let o=s[Wr.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof o!="string"||!o.startsWith("application/grpc")?(i.respond({[Wr.constants.HTTP2_HEADER_STATUS]:Wr.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){L5("Received call to method "+i+" at address "+this.serverAddressString);let s=this.handlers.get(i);return s===void 0?(L5("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):s}_respondWithError(i,s,o=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:It.Status.INTERNAL,"grpc-message":i.details,[Wr.constants.HTTP2_HEADER_STATUS]:Wr.constants.HTTP_STATUS_OK,[Wr.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());s.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),o?.streamTracker.addCallFailed()}_channelzHandler(i,s,o){s.once("error",f=>{}),this.onStreamOpened(s);let a=this.sessions.get(s.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(s,o)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=o[M5],l=this._retrieveHandler(c);if(!l){this._respondWithError(cM(c),s,a);return}let u={addMessageSent:()=>{a&&(a.messagesSent+=1,a.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{a&&(a.messagesReceived+=1,a.lastMessageReceivedTimestamp=new Date)},onCallEnd:f=>{f.code===It.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,N5.getServerInterceptingCall)([...i,...this.interceptors],s,o,u,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:It.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,s,o){if(s.once("error",u=>{}),this.onStreamOpened(s),this._verifyContentType(s,o)!==!0)return;let a=o[M5],c=this._retrieveHandler(a);if(!c){this._respondWithError(cM(a),s,null);return}let l=(0,N5.getServerInterceptingCall)([...i,...this.interceptors],s,o,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:It.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,s){let{type:o}=s;if(o==="unary")zRe(i,s);else if(o==="clientStream")GRe(i,s);else if(o==="serverStream")VRe(i,s);else if(o==="bidi")qRe(i,s);else return!1;return!0}_setupHandlers(i,s){if(i===null)return;let o=i.address(),a="null";o&&(typeof o=="string"?a=o:a=o.address+":"+o.port),this.serverAddressString=a;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,l=this.channelzEnabled?this._channelzSessionHandler(i):this._sessionHandler(i);i.on("stream",c.bind(this,s)),i.on("session",l)}_sessionHandler(i){return s=>{var o,a;(o=this.http2Servers.get(i))===null||o===void 0||o.sessions.add(s);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==Ld){let T=this.maxConnectionAgeMs/10,v=Math.random()*T*2-T;c=setTimeout(()=>{var A,S;d=!0,this.trace("Connection dropped by max connection age: "+((A=s.socket)===null||A===void 0?void 0:A.remoteAddress));try{s.goaway(Wr.constants.NGHTTP2_NO_ERROR,~(1<<31),D5)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==Ld&&(l=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(S=l.unref)===null||S===void 0||S.call(l))},this.maxConnectionAgeMs+v),(a=c.unref)===null||a===void 0||a.call(c)}let p=()=>{u&&(clearTimeout(u),u=null)},h=()=>!s.destroyed&&this.keepaliveTimeMs<aM&&this.keepaliveTimeMs>0,m,E=()=>{var T;h()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{p(),m()},this.keepaliveTimeMs),(T=u.unref)===null||T===void 0||T.call(u))};m=()=>{var T;if(!h())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let v="";try{s.ping((S,R,P)=>{p(),S?(this.keepaliveTrace("Ping failed with error: "+S.message),d=!0,s.destroy()):(this.keepaliveTrace("Received ping response"),E())})||(v="Ping returned false")}catch(A){v=(A instanceof Error?A.message:"")||"Unknown error"}if(v){this.keepaliveTrace("Ping send failed: "+v),this.trace("Connection dropped due to ping send error: "+v),d=!0,s.destroy();return}u=setTimeout(()=>{p(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,s.destroy()},this.keepaliveTimeoutMs),(T=u.unref)===null||T===void 0||T.call(u)},E(),s.on("close",()=>{var T,v;d||this.trace(`Connection dropped by client ${(T=s.socket)===null||T===void 0?void 0:T.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),p(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(s)),(v=this.http2Servers.get(i))===null||v===void 0||v.sessions.delete(s)})}}_channelzSessionHandler(i){return s=>{var o,a,c,l;let u=(0,Bt.registerChannelzSocket)((a=(o=s.socket)===null||o===void 0?void 0:o.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,s),this.channelzEnabled),d={ref:u,streamTracker:new Bt.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(s),this.sessions.set(s,d);let f=`${s.socket.remoteAddress}:${s.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+f),this.trace("Connection established by client "+f),this.sessionChildrenTracker.refChild(u);let p=null,h=null,m=null,E=!1,T=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==Ld){let P=this.maxConnectionAgeMs/10,L=Math.random()*P*2-P;p=setTimeout(()=>{var I;E=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{s.goaway(Wr.constants.NGHTTP2_NO_ERROR,~(1<<31),D5)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==Ld&&(h=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(I=h.unref)===null||I===void 0||I.call(h))},this.maxConnectionAgeMs+L),(l=p.unref)===null||l===void 0||l.call(p)}let v=()=>{m&&(clearTimeout(m),m=null)},A=()=>!s.destroyed&&this.keepaliveTimeMs<aM&&this.keepaliveTimeMs>0,S,R=()=>{var P;A()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),m=setTimeout(()=>{v(),S()},this.keepaliveTimeMs),(P=m.unref)===null||P===void 0||P.call(m))};S=()=>{var P;if(!A())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let L="";try{s.ping((O,j,_)=>{v(),O?(this.keepaliveTrace("Ping failed with error: "+O.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+O.message+" return in "+j),E=!0,s.destroy()):(this.keepaliveTrace("Received ping response"),R())})||(L="Ping returned false")}catch(I){L=(I instanceof Error?I.message:"")||"Unknown error"}if(L){this.keepaliveTrace("Ping send failed: "+L),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+L),E=!0,s.destroy();return}d.keepAlivesSent+=1,m=setTimeout(()=>{v(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+f),E=!0,s.destroy()},this.keepaliveTimeoutMs),(P=m.unref)===null||P===void 0||P.call(m)},R(),s.on("close",()=>{var P;E||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(u),(0,Bt.unregisterChannelzRef)(u),p&&clearTimeout(p),h&&clearTimeout(h),v(),T!==null&&(clearTimeout(T.timeout),this.sessionIdleTimeouts.delete(s)),(P=this.http2Servers.get(i))===null||P===void 0||P.sessions.delete(s),this.sessions.delete(s)})}}enableIdleTimeout(i){var s,o;if(this.sessionIdleTimeout>=k5)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(o=(s=a.timeout).unref)===null||o===void 0||o.call(s),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,s){let{socket:o}=s,a=i.sessionIdleTimeouts.get(s);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+o?.remoteAddress+":"+o?.remotePort+" last idle at "+a.lastIdle),i.closeSession(s)):a.timeout.refresh())}onStreamOpened(i){let s=i.session,o=this.sessionIdleTimeouts.get(s);o&&(o.activeStreams+=1,i.once("close",o.onClose))}onStreamClose(i){var s,o;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress)+":"+((o=i.socket)===null||o===void 0?void 0:o.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[FRe("Calling start() is no longer necessary. It can be safely omitted.")],MRe(t,null,r,{kind:"method",name:"start",static:!1,private:!1,access:{has:i=>"start"in i,get:i=>i.start},metadata:n},null,e),n&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),t})();Ea.Server=jRe;async function zRe(t,e){let r;function n(o,a,c,l){if(o){t.sendStatus((0,Ud.serverErrorToStatus)(o,c));return}t.sendMessage(a,()=>{t.sendStatus({code:It.Status.OK,details:"OK",metadata:c??null})})}let i,s=null;t.start({onReceiveMetadata(o){i=o,t.startRead()},onReceiveMessage(o){if(s){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=o,t.startRead()},onReceiveHalfClose(){if(!s){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Ud.ServerWritableStreamImpl(e.path,t,i,s);try{e.func(r,n)}catch(o){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function GRe(t,e){let r;function n(i,s,o,a){if(i){t.sendStatus((0,Ud.serverErrorToStatus)(i,o));return}t.sendMessage(s,()=>{t.sendStatus({code:It.Status.OK,details:"OK",metadata:o??null})})}t.start({onReceiveMetadata(i){r=new Ud.ServerDuplexStreamImpl(e.path,t,i);try{e.func(r,n)}catch(s){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(i){r.push(i)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function VRe(t,e){let r,n,i=null;t.start({onReceiveMetadata(s){n=s,t.startRead()},onReceiveMessage(s){if(i){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=s,t.startRead()},onReceiveHalfClose(){if(!i){t.sendStatus({code:It.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Ud.ServerWritableStreamImpl(e.path,t,n,i);try{e.func(r)}catch(s){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function qRe(t,e){let r;t.start({onReceiveMetadata(n){r=new Ud.ServerDuplexStreamImpl(e.path,t,n);try{e.func(r)}catch(i){t.sendStatus({code:It.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onReceiveMessage(n){r.push(n)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}});var U5=b(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});ST.StatusBuilder=void 0;var lM=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};ST.StatusBuilder=lM});var Dg=b(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.LeafLoadBalancer=ss.PickFirstLoadBalancer=ss.PickFirstLoadBalancingConfig=void 0;ss.shuffled=z5;ss.setup=QRe;var uM=ia(),Ct=Cr(),va=Gs(),F5=qr(),HRe=ct(),WRe=Be(),B5=qr(),j5=J("net"),YRe=Zc(),KRe="pick_first";function Ng(t){HRe.trace(WRe.LogVerbosity.DEBUG,KRe,t)}var kg="pick_first",ZRe=250,Fd=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return kg}toJsonObject(){return{[kg]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new t(e.shuffleAddressList===!0)}};ss.PickFirstLoadBalancingConfig=Fd;var dM=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:va.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function z5(t){let e=t.slice();for(let r=e.length-1;r>1;r--){let n=Math.floor(Math.random()*(r+1)),i=e[r];e[r]=e[n],e[n]=i}return e}function JRe(t){if(t.length===0)return[];let e=[],r=[],n=[],i=(0,B5.isTcpSubchannelAddress)(t[0])&&(0,j5.isIPv6)(t[0].host);for(let a of t)(0,B5.isTcpSubchannelAddress)(a)&&(0,j5.isIPv6)(a.host)?r.push(a):n.push(a);let s=i?r:n,o=i?n:r;for(let a=0;a<Math.max(s.length,o.length);a++)a<s.length&&e.push(s[a]),a<o.length&&e.push(o[a]);return e}var G5="grpc-node.internal.pick-first.report_health_status",Mg=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Ct.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,n,i,s,o)=>{this.onSubchannelStateUpdate(r,n,i,o)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let r=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker({details:r}),r)}else this.updateState(Ct.ConnectivityState.READY,new dM(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(Ct.ConnectivityState.IDLE,new va.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker({details:r}),r)}else this.updateState(Ct.ConnectivityState.CONNECTING,new va.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,r,n,i){var s;if(!((s=this.currentPick)===null||s===void 0)&&s.realSubchannelEquals(e)){n!==Ct.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[o,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===Ct.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===Ct.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),o===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(o+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[r,n]of this.children.entries())if(r>=e){let i=n.subchannel.getConnectivityState();if(i===Ct.ConnectivityState.IDLE||i===Ct.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===Ct.ConnectivityState.IDLE&&(Ng("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var i;(i=this.children[e])===null||i===void 0||i.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},ZRe),(n=(r=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(r)}pickSubchannel(e){Ng("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,r,n){Ng(Ct.ConnectivityState[this.currentState]+" -> "+Ct.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,r){Ng("connectToAddressList(["+e.map(i=>(0,F5.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,r),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===Ct.ConnectivityState.READY){this.pickSubchannel(i);return}for(let{subchannel:i}of n)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:i}of this.children)i.addConnectivityStateListener(this.subchannelStateListener);for(let i of this.children)i.subchannel.getConnectivityState()===Ct.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,n,i){if(!(r instanceof Fd))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(Ct.ConnectivityState.TRANSIENT_FAILURE,new va.UnavailablePicker(e.error),e.error.details),!0;let s=e.value;this.reportHealthStatus=n[G5],r.getShuffleAddressList()&&(s=z5(s));let o=[].concat(...s.map(c=>c.addresses));Ng("updateAddressList(["+o.map(c=>(0,F5.subchannelAddressToString)(c))+"])");let a=JRe(o);return this.latestAddressList=a,this.latestOptions=n,this.connectToAddressList(a,n),this.latestResolutionNote=i,o.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===Ct.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return kg}};ss.PickFirstLoadBalancer=Mg;var XRe=new Fd(!1),fM=class{constructor(e,r,n,i){this.endpoint=e,this.options=n,this.resolutionNote=i,this.latestState=Ct.ConnectivityState.IDLE;let s=(0,uM.createChildChannelControlHelper)(r,{updateState:(o,a,c)=>{this.latestState=o,this.latestPicker=a,r.updateState(o,a,c)}});this.pickFirstBalancer=new Mg(s),this.latestPicker=new va.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,YRe.statusOrFromValue)([this.endpoint]),XRe,Object.assign(Object.assign({},this.options),{[G5]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==Ct.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};ss.LeafLoadBalancer=fM;function QRe(){(0,uM.registerLoadBalancerType)(kg,Mg,Fd),(0,uM.registerDefaultLoadBalancerType)(kg)}});var V5=b(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});vT.FileWatcherCertificateProvider=void 0;var eIe=J("fs"),tIe=ct(),rIe=Be(),nIe=J("util"),iIe="certificate_provider";function ET(t){tIe.trace(rIe.LogVerbosity.DEBUG,iIe,t)}var pM=(0,nIe.promisify)(eIe.readFile),hM=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");ET("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?pM(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?pM(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?pM(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,n])=>{if(this.refreshTimer){ET("File watcher read certificates certificate "+e.status+", privateKey "+r.status+", CA certificate "+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&r.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:r.value}:this.latestIdentityUpdate=null,n.status==="fulfilled"?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let i of this.identityListeners)i(this.latestIdentityUpdate);for(let i of this.caListeners)i(this.latestCaUpdate)}}),ET("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),ET("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};vT.FileWatcherCertificateProvider=hM});var _M=b(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=ye.createCertificateProviderChannelCredentials=ye.FileWatcherCertificateProvider=ye.createCertificateProviderServerCredentials=ye.createServerCredentialsWithInterceptors=ye.BaseSubchannelWrapper=ye.registerAdminService=ye.FilterStackFactory=ye.BaseFilter=ye.statusOrFromError=ye.statusOrFromValue=ye.PickResultType=ye.QueuePicker=ye.UnavailablePicker=ye.ChildLoadBalancerHandler=ye.EndpointMap=ye.endpointHasAddress=ye.endpointToString=ye.subchannelAddressToString=ye.LeafLoadBalancer=ye.isLoadBalancerNameRegistered=ye.parseLoadBalancingConfig=ye.selectLbConfigFromList=ye.registerLoadBalancerType=ye.createChildChannelControlHelper=ye.BackoffTimeout=ye.parseDuration=ye.durationToMs=ye.splitHostPort=ye.uriToString=ye.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=ye.createResolver=ye.registerResolver=ye.log=ye.trace=void 0;var q5=ct();Object.defineProperty(ye,"trace",{enumerable:!0,get:function(){return q5.trace}});Object.defineProperty(ye,"log",{enumerable:!0,get:function(){return q5.log}});var mM=ni();Object.defineProperty(ye,"registerResolver",{enumerable:!0,get:function(){return mM.registerResolver}});Object.defineProperty(ye,"createResolver",{enumerable:!0,get:function(){return mM.createResolver}});Object.defineProperty(ye,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return mM.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var H5=Ir();Object.defineProperty(ye,"uriToString",{enumerable:!0,get:function(){return H5.uriToString}});Object.defineProperty(ye,"splitHostPort",{enumerable:!0,get:function(){return H5.splitHostPort}});var W5=Og();Object.defineProperty(ye,"durationToMs",{enumerable:!0,get:function(){return W5.durationToMs}});Object.defineProperty(ye,"parseDuration",{enumerable:!0,get:function(){return W5.parseDuration}});var sIe=cd();Object.defineProperty(ye,"BackoffTimeout",{enumerable:!0,get:function(){return sIe.BackoffTimeout}});var Lg=ia();Object.defineProperty(ye,"createChildChannelControlHelper",{enumerable:!0,get:function(){return Lg.createChildChannelControlHelper}});Object.defineProperty(ye,"registerLoadBalancerType",{enumerable:!0,get:function(){return Lg.registerLoadBalancerType}});Object.defineProperty(ye,"selectLbConfigFromList",{enumerable:!0,get:function(){return Lg.selectLbConfigFromList}});Object.defineProperty(ye,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return Lg.parseLoadBalancingConfig}});Object.defineProperty(ye,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return Lg.isLoadBalancerNameRegistered}});var oIe=Dg();Object.defineProperty(ye,"LeafLoadBalancer",{enumerable:!0,get:function(){return oIe.LeafLoadBalancer}});var bT=qr();Object.defineProperty(ye,"subchannelAddressToString",{enumerable:!0,get:function(){return bT.subchannelAddressToString}});Object.defineProperty(ye,"endpointToString",{enumerable:!0,get:function(){return bT.endpointToString}});Object.defineProperty(ye,"endpointHasAddress",{enumerable:!0,get:function(){return bT.endpointHasAddress}});Object.defineProperty(ye,"EndpointMap",{enumerable:!0,get:function(){return bT.EndpointMap}});var aIe=Yv();Object.defineProperty(ye,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return aIe.ChildLoadBalancerHandler}});var gM=Gs();Object.defineProperty(ye,"UnavailablePicker",{enumerable:!0,get:function(){return gM.UnavailablePicker}});Object.defineProperty(ye,"QueuePicker",{enumerable:!0,get:function(){return gM.QueuePicker}});Object.defineProperty(ye,"PickResultType",{enumerable:!0,get:function(){return gM.PickResultType}});var Y5=Zc();Object.defineProperty(ye,"statusOrFromValue",{enumerable:!0,get:function(){return Y5.statusOrFromValue}});Object.defineProperty(ye,"statusOrFromError",{enumerable:!0,get:function(){return Y5.statusOrFromError}});var cIe=qN();Object.defineProperty(ye,"BaseFilter",{enumerable:!0,get:function(){return cIe.BaseFilter}});var lIe=qb();Object.defineProperty(ye,"FilterStackFactory",{enumerable:!0,get:function(){return lIe.FilterStackFactory}});var uIe=Xv();Object.defineProperty(ye,"registerAdminService",{enumerable:!0,get:function(){return uIe.registerAdminService}});var dIe=Cg();Object.defineProperty(ye,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return dIe.BaseSubchannelWrapper}});var K5=fT();Object.defineProperty(ye,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return K5.createServerCredentialsWithInterceptors}});Object.defineProperty(ye,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return K5.createCertificateProviderServerCredentials}});var fIe=V5();Object.defineProperty(ye,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return fIe.FileWatcherCertificateProvider}});var pIe=ad();Object.defineProperty(ye,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return pIe.createCertificateProviderChannelCredentials}});var hIe=kk();Object.defineProperty(ye,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return hIe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var Z5=b(SM=>{"use strict";Object.defineProperty(SM,"__esModule",{value:!0});SM.setup=_Ie;var mIe=ni(),gIe=Zc(),yM=class{constructor(e,r,n){this.listener=r,this.hasReturnedResult=!1,this.endpoints=[];let i;e.authority===""?i="/"+e.path:i=e.path,this.endpoints=[{addresses:[{path:i}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,gIe.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function _Ie(){(0,mIe.registerResolver)("unix",yM)}});var r9=b(TM=>{"use strict";Object.defineProperty(TM,"__esModule",{value:!0});TM.setup=bIe;var J5=J("net"),X5=Zc(),TT=Be(),EM=Wt(),Q5=ni(),yIe=qr(),e9=Ir(),SIe=ct(),EIe="ip_resolver";function t9(t){SIe.trace(TT.LogVerbosity.DEBUG,EIe,t)}var vM="ipv4",bM="ipv6",vIe=443,AT=class{constructor(e,r,n){var i;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,t9("Resolver constructed for target "+(0,e9.uriToString)(e));let s=[];if(!(e.scheme===vM||e.scheme===bM)){this.error={code:TT.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new EM.Metadata};return}let o=e.path.split(",");for(let a of o){let c=(0,e9.splitHostPort)(a);if(c===null){this.error={code:TT.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new EM.Metadata};return}if(e.scheme===vM&&!(0,J5.isIPv4)(c.host)||e.scheme===bM&&!(0,J5.isIPv6)(c.host)){this.error={code:TT.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new EM.Metadata};return}s.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:vIe})}this.endpoints=s.map(a=>({addresses:[a]})),t9("Parsed "+e.scheme+" address list "+s.map(yIe.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,X5.statusOrFromError)(this.error),{},null,""):this.listener((0,X5.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function bIe(){(0,Q5.registerResolver)(vM,AT),(0,Q5.registerResolver)(bM,AT)}});var o9=b(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.RoundRobinLoadBalancer=void 0;Ug.setup=IIe;var s9=ia(),cr=Cr(),$g=Gs(),TIe=ct(),AIe=Be(),n9=qr(),xIe=Dg(),wIe="round_robin";function i9(t){TIe.trace(AIe.LogVerbosity.DEBUG,wIe,t)}var xT="round_robin",wT=class t{getLoadBalancerName(){return xT}constructor(){}toJsonObject(){return{[xT]:{}}}static createFromJson(e){return new t}},AM=class{constructor(e,r=0){this.children=e,this.nextIndex=r}pick(e){let r=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,r.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function RIe(t,e){return[...t.slice(e),...t.slice(0,e)]}var RT=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=cr.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,s9.createChildChannelControlHelper)(e,{updateState:(r,n,i)=>{this.currentState===cr.ConnectivityState.READY&&r!==cr.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),i&&(this.lastError=i),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(r=>r.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(cr.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===cr.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(i=>(0,n9.endpointEqual)(i.getEndpoint(),n)),r<0&&(r=0)}this.updateState(cr.ConnectivityState.READY,new AM(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),r),null)}else if(this.countChildrenWithState(cr.ConnectivityState.CONNECTING)>0)this.updateState(cr.ConnectivityState.CONNECTING,new $g.QueuePicker(this),null);else if(this.countChildrenWithState(cr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(cr.ConnectivityState.TRANSIENT_FAILURE,new $g.UnavailablePicker({details:e}),e)}else this.updateState(cr.ConnectivityState.IDLE,new $g.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===cr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){i9(cr.ConnectivityState[this.currentState]+" -> "+cr.ConnectivityState[e]),e===cr.ConnectivityState.READY?this.currentReadyPicker=r:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,r,n,i){if(!(r instanceof wT))return!1;if(!e.ok)return this.children.length===0&&this.updateState(cr.ConnectivityState.TRANSIENT_FAILURE,new $g.UnavailablePicker(e.error),e.error.details),!0;let s=Math.random()*e.value.length|0,o=RIe(e.value,s);if(this.resetSubchannelList(),o.length===0){let a=`No addresses resolved. Resolution note: ${i}`;this.updateState(cr.ConnectivityState.TRANSIENT_FAILURE,new $g.UnavailablePicker({details:a}),a)}i9("Connect to endpoint list "+o.map(n9.endpointToString)),this.updatesPaused=!0,this.children=o.map(a=>new xIe.LeafLoadBalancer(a,this.childChannelControlHelper,n,i));for(let a of this.children)a.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return xT}};Ug.RoundRobinLoadBalancer=RT;function IIe(){(0,s9.registerLoadBalancerType)(xT,RT,wT)}});var l9=b(gl=>{"use strict";var xM;Object.defineProperty(gl,"__esModule",{value:!0});gl.OutlierDetectionLoadBalancer=gl.OutlierDetectionLoadBalancingConfig=void 0;gl.setup=FIe;var CIe=Cr(),a9=Be(),ml=Og(),c9=_M(),PIe=ia(),OIe=Yv(),NIe=Gs(),wM=qr(),kIe=Cg(),MIe=ct(),DIe="outlier_detection";function Jt(t){MIe.trace(a9.LogVerbosity.DEBUG,DIe,t)}var NM="outlier_detection",LIe=((xM=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&xM!==void 0?xM:"true")==="true",$Ie={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},UIe={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Bd(t,e,r,n){if(e in t&&t[e]!==void 0&&typeof t[e]!==r){let i=n?`${n}.${e}`:e;throw new Error(`outlier detection config ${i} parse error: expected ${r}, got ${typeof t[e]}`)}}function RM(t,e,r){let n=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,ml.isDuration)(t[e]))throw new Error(`outlier detection config ${n} parse error: expected Duration, got ${typeof t[e]}`);if(!(t[e].seconds>=0&&t[e].seconds<=315576e6&&t[e].nanos>=0&&t[e].nanos<=999999999))throw new Error(`outlier detection config ${n} parse error: values out of range for non-negative Duaration`)}}function IT(t,e,r){let n=r?`${r}.${e}`:e;if(Bd(t,e,"number",r),e in t&&t[e]!==void 0&&!(t[e]>=0&&t[e]<=100))throw new Error(`outlier detection config ${n} parse error: value out of range for percentage (0-100)`)}var Fg=class t{constructor(e,r,n,i,s,o,a){if(this.childPolicy=a,a.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=r??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=i??10,this.successRateEjection=s?Object.assign(Object.assign({},$Ie),s):null,this.failurePercentageEjection=o?Object.assign(Object.assign({},UIe),o):null}getLoadBalancerName(){return NM}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,ml.msToDuration)(this.intervalMs),base_ejection_time:(0,ml.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,ml.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(r=this.failurePercentageEjection)!==null&&r!==void 0?r:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var r;if(RM(e,"interval"),RM(e,"base_ejection_time"),RM(e,"max_ejection_time"),IT(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Bd(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),IT(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Bd(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Bd(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");IT(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),IT(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Bd(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Bd(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let n=(0,PIe.selectLbConfigFromList)(e.child_policy);if(!n)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new t(e.interval?(0,ml.durationToMs)(e.interval):null,e.base_ejection_time?(0,ml.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,ml.durationToMs)(e.max_ejection_time):null,(r=e.max_ejection_percent)!==null&&r!==void 0?r:null,e.success_rate_ejection,e.failure_percentage_ejection,n)}};gl.OutlierDetectionLoadBalancingConfig=Fg;var CM=class extends kIe.BaseSubchannelWrapper{constructor(e,r){super(e),this.mapEntry=r,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function IM(){return{success:0,failure:0}}var PM=class{constructor(){this.activeBucket=IM(),this.inactiveBucket=IM()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=IM()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},OM=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===NIe.PickResultType.COMPLETE){let n=r.subchannel,i=n.getMapEntry();if(i){let s=r.onCallEnded;return this.countCalls&&(s=(o,a,c)=>{var l;o===a9.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(l=r.onCallEnded)===null||l===void 0||l.call(r,o,a,c)}),Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel(),onCallEnded:s})}else return Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel()})}else return r}},CT=class{constructor(e){this.entryMap=new wM.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new OIe.ChildLoadBalancerHandler((0,c9.createChildChannelControlHelper)(e,{createSubchannel:(r,n)=>{let i=e.createSubchannel(r,n),s=this.entryMap.getForSubchannelAddress(r),o=new CM(i,s);return s?.currentEjectionTimestamp!==null&&o.eject(),s?.subchannelWrappers.push(o),o},updateState:(r,n,i)=>{r===CIe.ConnectivityState.READY?e.updateState(r,new OM(n,this.isCountingEnabled()),i):e.updateState(r,n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let r of this.entryMap.values())r.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getSuccessRateEjectionConfig();if(!r)return;Jt("Running success rate check");let n=r.request_volume,i=0,s=[];for(let[d,f]of this.entryMap.entries()){let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();Jt("Stats for "+(0,wM.endpointToString)(d)+": successes="+p+" failures="+h+" targetRequestVolume="+n),p+h>=n&&(i+=1,s.push(p/(p+h)))}if(Jt("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+s+"]"),i<r.minimum_hosts)return;let o=s.reduce((d,f)=>d+f)/s.length,a=0;for(let d of s){let f=d-o;a+=f*f}let c=a/s.length,l=Math.sqrt(c),u=o-l*(r.stdev_factor/1e3);Jt("stdev="+l+" ejectionThreshold="+u);for(let[d,f]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();if(p+h<n)continue;let m=p/(p+h);if(Jt("Checking candidate "+d+" successRate="+m),m<u){let E=Math.random()*100;Jt("Candidate "+d+" randomNumber="+E+" enforcement_percentage="+r.enforcement_percentage),E<r.enforcement_percentage&&(Jt("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;Jt("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let n=0;for(let i of this.entryMap.values()){let s=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();s+o>=r.request_volume&&(n+=1)}if(!(n<r.minimum_hosts))for(let[i,s]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let o=s.counter.getLastSuccesses(),a=s.counter.getLastFailures();if(Jt("Candidate successes="+o+" failures="+a),o+a<r.request_volume)continue;if(a*100/(a+o)>r.threshold){let l=Math.random()*100;Jt("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+r.enforcement_percentage),l<r.enforcement_percentage&&(Jt("Ejecting candidate "+i),this.eject(s,e))}}}eject(e,r){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let n of e.subchannelWrappers)n.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let r of e.subchannelWrappers)r.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var r,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(r=this.ejectionTimer).unref)===null||n===void 0||n.call(r)}runChecks(){let e=new Date;if(Jt("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[r,n]of this.entryMap.entries())if(n.currentEjectionTimestamp===null)n.ejectionTimeMultiplier>0&&(n.ejectionTimeMultiplier-=1);else{let i=this.latestConfig.getBaseEjectionTimeMs(),s=this.latestConfig.getMaxEjectionTimeMs(),o=new Date(n.currentEjectionTimestamp.getTime());o.setMilliseconds(o.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,s))),o<new Date&&(Jt("Unejecting "+r),this.uneject(n))}}}updateAddressList(e,r,n,i){if(!(r instanceof Fg))return!1;if(Jt("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let o of e.value)this.entryMap.has(o)||(Jt("Adding map entry for "+(0,wM.endpointToString)(o)),this.entryMap.set(o,{counter:new PM,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let s=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,n,i),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){Jt("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let o=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(o)}else Jt("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{Jt("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let o of this.entryMap.values())this.uneject(o),o.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return NM}};gl.OutlierDetectionLoadBalancer=CT;function FIe(){LIe&&(0,c9.registerLoadBalancerType)(NM,CT,Fg)}});var u9=b(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});OT.PriorityQueue=void 0;var jd=0,kM=t=>Math.floor(t/2),PT=t=>t*2+1,Bg=t=>t*2+2,MM=class{constructor(e=(r,n)=>r>n){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[jd]}push(...e){return e.forEach(r=>{this.heap.push(r),this.siftUp()}),this.size()}pop(){let e=this.peek(),r=this.size()-1;return r>jd&&this.swap(jd,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[jd]=e,this.siftDown(),r}greater(e,r){return this.comparator(this.heap[e],this.heap[r])}swap(e,r){[this.heap[e],this.heap[r]]=[this.heap[r],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>jd&&this.greater(e,kM(e));)this.swap(e,kM(e)),e=kM(e)}siftDown(){let e=jd;for(;PT(e)<this.size()&&this.greater(PT(e),e)||Bg(e)<this.size()&&this.greater(Bg(e),e);){let r=Bg(e)<this.size()&&this.greater(Bg(e),PT(e))?Bg(e):PT(e);this.swap(e,r),e=r}}};OT.PriorityQueue=MM});var m9=b(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.WeightedRoundRobinLoadBalancingConfig=void 0;zg.setup=ZIe;var Xt=Cr(),BIe=Be(),pn=Og(),p9=ia(),jIe=Dg(),zIe=ct(),h9=hT(),zd=Gs(),GIe=u9(),d9=qr(),VIe="weighted_round_robin";function DM(t){zIe.trace(BIe.LogVerbosity.DEBUG,VIe,t)}var UM="weighted_round_robin",qIe=1e4,HIe=1e4,WIe=3*6e4,YIe=1e3,KIe=1;function f9(t,e,r){if(e in t&&t[e]!==void 0&&typeof t[e]!==r)throw new Error(`weighted round robin config ${e} parse error: expected ${r}, got ${typeof t[e]}`)}function NT(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,pn.isDuration)(t[e]))r=t[e];else if((0,pn.isDurationMessage)(t[e]))r=(0,pn.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let n=(0,pn.parseDuration)(t[e]);if(!n)throw new Error(`weighted round robin config ${e}: failed to parse duration string ${t[e]}`);r=n}else throw new Error(`weighted round robin config ${e}: expected duration, got ${typeof t[e]}`);return(0,pn.durationToMs)(r)}return null}var jg=class t{constructor(e,r,n,i,s,o){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??qIe,this.blackoutPeriodMs=n??HIe,this.weightExpirationPeriodMs=i??WIe,this.weightUpdatePeriodMs=Math.max(s??YIe,100),this.errorUtilizationPenalty=o??KIe}getLoadBalancerName(){return UM}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,pn.durationToString)((0,pn.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,pn.durationToString)((0,pn.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,pn.durationToString)((0,pn.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,pn.durationToString)((0,pn.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if(f9(e,"enable_oob_load_report","boolean"),f9(e,"error_utilization_penalty","number"),e.error_utilization_penalty<0)throw new Error("weighted round robin config error_utilization_penalty < 0");return new t(e.enable_oob_load_report,NT(e,"oob_load_reporting_period"),NT(e,"blackout_period"),NT(e,"weight_expiration_period"),NT(e,"weight_update_period"),e.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}};zg.WeightedRoundRobinLoadBalancingConfig=jg;var LM=class{constructor(e,r){this.metricsHandler=r,this.queue=new GIe.PriorityQueue((s,o)=>s.deadline<o.deadline);let n=e.filter(s=>s.weight>0),i;if(n.length<2)i=1;else{let s=0;for(let{weight:o}of n)s+=o;i=s/n.length}for(let s of e){let o=s.weight>0?1/s.weight:i;this.queue.push({endpointName:s.endpointName,picker:s.picker,period:o,deadline:Math.random()*o})}}pick(e){let r=this.queue.pop();this.queue.push(Object.assign(Object.assign({},r),{deadline:r.deadline+r.period}));let n=r.picker.pick(e);if(n.pickResultType===zd.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,h9.createMetricsReader)(i=>this.metricsHandler(i,r.endpointName),n.onCallEnded)});{let i=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:i.getWrappedSubchannel()})}}else return n}},$M=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=Xt.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let r=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(r+=1);return r}updateWeight(e,r){var n,i;let s=r.rps_fractional,o=r.application_utilization;o>0&&s>0&&(o+=r.eps/s*((i=(n=this.latestConfig)===null||n===void 0?void 0:n.getErrorUtilizationPenalty())!==null&&i!==void 0?i:0));let a=o===0?0:s/o;if(a===0)return;let c=new Date;e.nonEmptySince===null&&(e.nonEmptySince=c),e.lastUpdated=c,e.weight=a}getWeight(e){if(!this.latestConfig)return 0;let r=new Date().getTime();if(r-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||r-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(Xt.ConnectivityState.READY)>0){let e=[];for(let[n,i]of this.children)i.child.getConnectivityState()===Xt.ConnectivityState.READY&&e.push({endpointName:n,picker:i.child.getPicker(),weight:this.getWeight(i)});DM("Created picker with weights: "+e.map(n=>n.endpointName+":"+n.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(n,i)=>{let s=this.children.get(i);s&&this.updateWeight(s,n)},this.updateState(Xt.ConnectivityState.READY,new LM(e,r),null)}else if(this.countChildrenWithState(Xt.ConnectivityState.CONNECTING)>0)this.updateState(Xt.ConnectivityState.CONNECTING,new zd.QueuePicker(this),null);else if(this.countChildrenWithState(Xt.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Xt.ConnectivityState.TRANSIENT_FAILURE,new zd.UnavailablePicker({details:e}),e)}else this.updateState(Xt.ConnectivityState.IDLE,new zd.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===Xt.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){DM(Xt.ConnectivityState[this.currentState]+" -> "+Xt.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}updateAddressList(e,r,n,i){var s,o;if(!(r instanceof jg))return!1;if(!e.ok)return this.children.size===0&&this.updateState(Xt.ConnectivityState.TRANSIENT_FAILURE,new zd.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let l=`No addresses resolved. Resolution note: ${i}`;return this.updateState(Xt.ConnectivityState.TRANSIENT_FAILURE,new zd.UnavailablePicker({details:l}),l),!1}DM("Connect to endpoint list "+e.value.map(d9.endpointToString));let a=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let l of e.value){let u=(0,d9.endpointToString)(l);c.add(u);let d=this.children.get(u);d||(d={child:new jIe.LeafLoadBalancer(l,(0,p9.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(f,p,h)=>{this.currentState===Xt.ConnectivityState.READY&&f!==Xt.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),f===Xt.ConnectivityState.READY&&(d.nonEmptySince=null),h&&(this.lastError=h),this.calculateAndUpdateState()},createSubchannel:(f,p)=>{let h=this.channelControlHelper.createSubchannel(f,p);return d?.oobMetricsListener?new h9.OrcaOobMetricsSubchannelWrapper(h,d.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):h}}),n,i),lastUpdated:a,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(u,d)),r.getEnableOobLoadReport()?d.oobMetricsListener=f=>{this.updateWeight(d,f)}:d.oobMetricsListener=null}for(let[l,u]of this.children)c.has(l)?u.child.startConnecting():(u.child.destroy(),this.children.delete(l));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(o=(s=setInterval(()=>{this.currentState===Xt.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||o===void 0?void 0:o.call(s),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return UM}};function ZIe(){(0,p9.registerLoadBalancerType)(UM,$M,jg)}});var Gg=b(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.experimental=he.ServerMetricRecorder=he.ServerInterceptingCall=he.ResponderBuilder=he.ServerListenerBuilder=he.addAdminServicesToServer=he.getChannelzHandlers=he.getChannelzServiceDefinition=he.InterceptorConfigurationError=he.InterceptingCall=he.RequesterBuilder=he.ListenerBuilder=he.StatusBuilder=he.getClientChannel=he.ServerCredentials=he.Server=he.setLogVerbosity=he.setLogger=he.load=he.loadObject=he.CallCredentials=he.ChannelCredentials=he.waitForClientReady=he.closeClient=he.Channel=he.makeGenericClientConstructor=he.makeClientConstructor=he.loadPackageDefinition=he.Client=he.compressionAlgorithms=he.propagate=he.connectivityState=he.status=he.logVerbosity=he.Metadata=he.credentials=void 0;var kT=$v();Object.defineProperty(he,"CallCredentials",{enumerable:!0,get:function(){return kT.CallCredentials}});var JIe=wO();Object.defineProperty(he,"Channel",{enumerable:!0,get:function(){return JIe.ChannelImplementation}});var XIe=GN();Object.defineProperty(he,"compressionAlgorithms",{enumerable:!0,get:function(){return XIe.CompressionAlgorithms}});var QIe=Cr();Object.defineProperty(he,"connectivityState",{enumerable:!0,get:function(){return QIe.ConnectivityState}});var MT=ad();Object.defineProperty(he,"ChannelCredentials",{enumerable:!0,get:function(){return MT.ChannelCredentials}});var g9=xO();Object.defineProperty(he,"Client",{enumerable:!0,get:function(){return g9.Client}});var FM=Be();Object.defineProperty(he,"logVerbosity",{enumerable:!0,get:function(){return FM.LogVerbosity}});Object.defineProperty(he,"status",{enumerable:!0,get:function(){return FM.Status}});Object.defineProperty(he,"propagate",{enumerable:!0,get:function(){return FM.Propagate}});var _9=ct(),BM=nb();Object.defineProperty(he,"loadPackageDefinition",{enumerable:!0,get:function(){return BM.loadPackageDefinition}});Object.defineProperty(he,"makeClientConstructor",{enumerable:!0,get:function(){return BM.makeClientConstructor}});Object.defineProperty(he,"makeGenericClientConstructor",{enumerable:!0,get:function(){return BM.makeClientConstructor}});var eCe=Wt();Object.defineProperty(he,"Metadata",{enumerable:!0,get:function(){return eCe.Metadata}});var tCe=$5();Object.defineProperty(he,"Server",{enumerable:!0,get:function(){return tCe.Server}});var rCe=fT();Object.defineProperty(he,"ServerCredentials",{enumerable:!0,get:function(){return rCe.ServerCredentials}});var nCe=U5();Object.defineProperty(he,"StatusBuilder",{enumerable:!0,get:function(){return nCe.StatusBuilder}});he.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),combineCallCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),createInsecure:MT.ChannelCredentials.createInsecure,createSsl:MT.ChannelCredentials.createSsl,createFromSecureContext:MT.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:kT.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:kT.CallCredentials.createFromGoogleCredential,createEmpty:kT.CallCredentials.createEmpty};var iCe=t=>t.close();he.closeClient=iCe;var sCe=(t,e,r)=>t.waitForReady(e,r);he.waitForClientReady=sCe;var oCe=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};he.loadObject=oCe;var aCe=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};he.load=aCe;var cCe=t=>{_9.setLogger(t)};he.setLogger=cCe;var lCe=t=>{_9.setLoggerVerbosity(t)};he.setLogVerbosity=lCe;var uCe=t=>g9.Client.prototype.getChannel.call(t);he.getClientChannel=uCe;var DT=bO();Object.defineProperty(he,"ListenerBuilder",{enumerable:!0,get:function(){return DT.ListenerBuilder}});Object.defineProperty(he,"RequesterBuilder",{enumerable:!0,get:function(){return DT.RequesterBuilder}});Object.defineProperty(he,"InterceptingCall",{enumerable:!0,get:function(){return DT.InterceptingCall}});Object.defineProperty(he,"InterceptorConfigurationError",{enumerable:!0,get:function(){return DT.InterceptorConfigurationError}});var y9=ha();Object.defineProperty(he,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return y9.getChannelzServiceDefinition}});Object.defineProperty(he,"getChannelzHandlers",{enumerable:!0,get:function(){return y9.getChannelzHandlers}});var dCe=Xv();Object.defineProperty(he,"addAdminServicesToServer",{enumerable:!0,get:function(){return dCe.addAdminServicesToServer}});var jM=sM();Object.defineProperty(he,"ServerListenerBuilder",{enumerable:!0,get:function(){return jM.ServerListenerBuilder}});Object.defineProperty(he,"ResponderBuilder",{enumerable:!0,get:function(){return jM.ResponderBuilder}});Object.defineProperty(he,"ServerInterceptingCall",{enumerable:!0,get:function(){return jM.ServerInterceptingCall}});var fCe=hT();Object.defineProperty(he,"ServerMetricRecorder",{enumerable:!0,get:function(){return fCe.ServerMetricRecorder}});var pCe=_M();he.experimental=pCe;var hCe=ck(),mCe=Z5(),gCe=r9(),_Ce=Dg(),yCe=o9(),SCe=l9(),ECe=m9(),vCe=ha();hCe.setup(),mCe.setup(),gCe.setup(),_Ce.setup(),yCe.setup(),SCe.setup(),ECe.setup(),vCe.setup()});var S9=b(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});LT.createServiceClientConstructor=void 0;var bCe=Gg();function TCe(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:n=>n,requestDeserialize:n=>n,responseSerialize:n=>n,responseDeserialize:n=>n}};return bCe.makeGenericClientConstructor(r,e)}LT.createServiceClientConstructor=TCe});var Vg=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.createOtlpGrpcExporterTransport=zn.GrpcExporterTransport=zn.createEmptyMetadata=zn.createSslCredentials=zn.createInsecureCredentials=void 0;var ACe=fY(),E9=`OTel-OTLP-Exporter-JavaScript/${ACe.VERSION}`;function xCe(t){return t?`${t} ${E9}`:E9}var wCe=0,RCe=2;function ICe(t){return t==="gzip"?RCe:wCe}function CCe(){let{credentials:t}=Gg();return t.createInsecure()}zn.createInsecureCredentials=CCe;function PCe(t,e,r){let{credentials:n}=Gg();return n.createSsl(t,e,r)}zn.createSslCredentials=PCe;function OCe(){let{Metadata:t}=Gg();return new t}zn.createEmptyMetadata=OCe;var $T=class{_client;_metadata;_parameters;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,r){let n=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:i}=S9();try{this._metadata=this._parameters.metadata()}catch(o){return Promise.resolve({status:"failure",error:o})}let s=i(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new s(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":ICe(this._parameters.compression),"grpc.primary_user_agent":xCe(this._parameters.userAgent)})}catch(o){return Promise.resolve({status:"failure",error:o})}}return new Promise(i=>{let s=Date.now()+r;if(this._metadata==null)return i({error:new Error("metadata was null"),status:"failure"});this._client.export(n,this._metadata,{deadline:s},(o,a)=>{i(o?{status:"failure",error:o}:{data:a,status:"success"})})})}};zn.GrpcExporterTransport=$T;function NCe(t){return new $T(t)}zn.createOtlpGrpcExporterTransport=NCe});var x9=b(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.getOtlpGrpcDefaultConfiguration=ba.mergeOtlpGrpcConfigurationWithDefaults=ba.validateAndNormalizeUrl=void 0;var T9=(Pv(),Ar(Cv)),qg=Vg(),kCe=J("url"),v9=(be(),Ar(Zo));function A9(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new kCe.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&v9.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),r.protocol!==""&&!r.protocol?.match(/^(http)s?:$/)&&v9.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}ba.validateAndNormalizeUrl=A9;function b9(t,e){for(let[r,n]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,n)}function MCe(t,e,r){let n=t.url??e.url??r.url;return{...(0,T9.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let i=r.metadata();return b9(i,t.metadata?.().clone()??(0,qg.createEmptyMetadata)()),b9(i,e.metadata?.()??(0,qg.createEmptyMetadata)()),i},url:A9(n),credentials:t.credentials??e.credentials?.(n)??r.credentials(n),userAgent:t.userAgent}}ba.mergeOtlpGrpcConfigurationWithDefaults=MCe;function DCe(){return{...(0,T9.getSharedConfigurationDefaults)(),metadata:()=>(0,qg.createEmptyMetadata)(),url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,qg.createInsecureCredentials)():()=>(0,qg.createSslCredentials)()}}ba.getOtlpGrpcDefaultConfiguration=DCe});function w9(t){let e={};return Object.entries(t??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Q.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}var R9=x(()=>{"use strict";be()});function LCe(t,e,r){return async()=>{let n={...await r()},i={};return e!=null&&Object.assign(i,await e()),t!=null&&Object.assign(i,w9(await t())),Object.assign(i,n)}}function $Ce(t){if(t!=null)try{let e=globalThis.location?.href;return new URL(t,e).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function I9(t,e,r){return{...Av(t,e,r),headers:LCe(t.headers,e.headers,r.headers),url:$Ce(t.url)??e.url??r.url}}function C9(t,e){return{...xv(),headers:async()=>t,url:"http://localhost:4318/"+e}}var P9=x(()=>{"use strict";Gm();R9()});function _l(t){return async e=>{let r=e==="http:",n=r?import("http"):import("https"),{Agent:i}=await n;if(r){let{ca:s,cert:o,key:a,...c}=t;return new i(c)}return new i(t)}}function O9(t,e,r){return{...I9(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory,userAgent:t.userAgent}}function N9(t,e){return{...C9(t,e),agentFactory:_l({keepAlive:!0})}}var UT=x(()=>{"use strict";P9()});function zM(t){return t===429||t===502||t===503||t===504}function GM(t){if(t==null)return;let e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let r=new Date(t).getTime()-Date.now();return r>=0?r:0}var k9=x(()=>{"use strict"});var M9,D9=x(()=>{"use strict";M9="0.218.0"});import*as U9 from"zlib";import{Readable as UCe}from"stream";function F9(t,e,r,n,i,s,o,a){return new Promise(c=>{let l=new URL(e);i?r["User-Agent"]=`${i} ${L9}`:r["User-Agent"]=L9;let d=t(l,{method:"POST",headers:r,agent:s},f=>{let p=[],h=0;f.on("data",m=>{if(h+=m.length,h>$9){let E=new Error(`OTLP export response body exceeded size limit of ${$9} bytes`);c({status:"failure",error:E}),f.destroy();return}p.push(m)}),f.on("end",()=>{if(f.statusCode&&f.statusCode<=299)c({status:"success",data:Buffer.concat(p)});else if(f.statusCode&&zM(f.statusCode))c({status:"retryable",retryInMillis:GM(f.headers["retry-after"])});else{let m=new js(f.statusMessage,f.statusCode,Buffer.concat(p).toString());c({status:"failure",error:m})}}),f.on("error",m=>{f.statusCode&&f.statusCode<=299?c({status:"success"}):f.statusCode&&zM(f.statusCode)?c({status:"retryable",error:m,retryInMillis:GM(f.headers["retry-after"])}):c({status:"failure",error:m})})});d.setTimeout(a,()=>{d.destroy(),c({status:"retryable",error:new Error("Request timed out")})}),d.on("error",f=>{jCe(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),FCe(d,n,o,f=>{c({status:"failure",error:f})})})}function FCe(t,e,r,n){let i=BCe(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),i=i.on("error",n).pipe(U9.createGzip()).on("error",n)),i.pipe(t).on("error",n)}function BCe(t){let e=new UCe;return e.push(t),e.push(null),e}function jCe(t){let e=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in t&&typeof t.code=="string"?e.has(t.code):!1}var L9,$9,B9=x(()=>{"use strict";k9();bv();D9();L9=`OTel-OTLP-Exporter-JavaScript/${M9}`,$9=4*1024*1024});async function zCe(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function j9(t){return new VM(t)}var VM,z9=x(()=>{"use strict";B9();VM=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,r){let{agent:n,request:i}=await this._loadUtils(),s=await this._parameters.headers();return F9(i,this._parameters.url,s,this._parameters.compression,this._parameters.userAgent,n,e,r)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let r=new URL(this._parameters.url).protocol,[n,i]=await Promise.all([this._parameters.agentFactory(r),zCe(r)]);e=this._utils={agent:n,request:i}}return e}}});function HCe(){return Math.random()*(2*G9)-G9}function V9(t){return new HM(t.transport)}var qM,GCe,VCe,qCe,G9,HM,q9=x(()=>{"use strict";be();qM=5,GCe=1e3,VCe=5e3,qCe=1.5,G9=.2;HM=class{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,s)=>{setTimeout(()=>{this._transport.send(e,r).then(i,s)},n)})}async send(e,r){let n=qM,i=GCe,s=Date.now()+r,o=await this._transport.send(e,r);for(;o.status==="retryable"&&n>0;){n--;let a=Math.max(Math.min(i*(1+HCe()),VCe),0);i=i*qCe;let c=o.retryInMillis??a,l=s-Date.now();if(c>l)return Q.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),o;Q.verbose(`Scheduling export retry in ${Math.round(c)}ms`),o=await this.retry(e,l,c)}return o.status==="success"?Q.verbose(`Export succeeded after ${qM-n} retry attempts.`):o.status==="retryable"?Q.info(`Export failed after maximum retry attempts (${qM}).`):Q.info(`Export failed with non-retryable error: ${o.error}`),o}shutdown(){return this._transport.shutdown()}}});function H9(t,e){return Iv({transport:V9({transport:j9(t)}),serializer:e,promiseHandler:Rv(t)},{timeout:t.timeoutMillis})}var W9=x(()=>{"use strict";DP();z9();kP();q9()});function Y9(t){let e=ju(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;Q.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function WCe(t){let e=Y9(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=Y9("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function K9(t){let e=Gr(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;Q.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function YCe(t){let e=K9(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=K9("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function FT(t){return{timeoutMillis:WCe(t),compression:YCe(t)}}var WM=x(()=>{"use strict";Fs();be()});import*as Z9 from"fs";import*as J9 from"path";function KCe(t){let e=Gr(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=Gr("OTEL_EXPORTER_OTLP_HEADERS"),n=$c(e),i=$c(r);if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return Object.assign({},$c(r),$c(e))}function ZCe(t){try{return new URL(t).toString()}catch{Q.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function JCe(t,e){try{new URL(t)}catch{Q.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith("/")||(t=t+"/"),t+=e;try{new URL(t)}catch{Q.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function XCe(t){let e=Gr("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return JCe(e,t)}function QCe(t){let e=Gr(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return ZCe(e)}function YM(t,e,r){let n=Gr(t),i=Gr(e),s=n??i;if(s!=null)try{return Z9.readFileSync(J9.resolve(process.cwd(),s))}catch{Q.warn(r);return}else return}function e0e(t){return YM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function t0e(t){return YM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function r0e(t){return YM(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function X9(t,e){return{...FT(t),url:QCe(t)??XCe(e),headers:Tv(KCe(t)),agentFactory:_l({keepAlive:!0,ca:r0e(t),cert:e0e(t),key:t0e(t)})}}var Q9=x(()=>{"use strict";Fs();be();WM();Gm();UT()});function eJ(t){return typeof t.headers=="function"?t.headers:Tv(t.headers)}var tJ=x(()=>{"use strict";Gm()});function n0e(t){if(typeof t.httpAgentOptions=="function")return t.httpAgentOptions;let e=t.httpAgentOptions;if(t.keepAlive!=null&&(e={keepAlive:t.keepAlive,...e}),e!=null)return _l(e)}function rJ(t,e,r,n){return t.metadata&&Q.warn("Metadata cannot be set when using http"),O9({url:t.url,headers:eJ(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:n0e(t),userAgent:t.userAgent},X9(e,r),N9(n,r))}var nJ=x(()=>{"use strict";be();UT();KM();Q9();tJ()});var iJ={};ir(iJ,{convertLegacyHttpOptions:()=>rJ,createOtlpHttpExportDelegate:()=>H9,getSharedConfigurationFromEnvironment:()=>FT,httpAgentFactoryFromOptions:()=>_l});var KM=x(()=>{"use strict";UT();W9();WM();nJ()});var lJ=b(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0});BT.getOtlpGrpcConfigurationFromEnv=void 0;var sJ=(Fs(),Ar(_H)),Hg=Vg(),i0e=(KM(),Ar(iJ)),s0e=J("fs"),o0e=J("path"),aJ=(be(),Ar(Zo));function ZM(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function a0e(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),n=(0,sJ.parseKeyPairsIntoRecord)(e),i=(0,sJ.parseKeyPairsIntoRecord)(r);if(Object.keys(n).length===0&&Object.keys(i).length===0)return;let s=Object.assign({},i,n),o=(0,Hg.createEmptyMetadata)();for(let[a,c]of Object.entries(s))o.set(a,c);return o}function c0e(t){let e=a0e(t);if(e!=null)return()=>e}function l0e(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return ZM(e,r)}function u0e(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return ZM(e,r)==="true"}function JM(t,e,r){let n=process.env[t]?.trim(),i=process.env[e]?.trim(),s=ZM(n,i);if(s!=null)try{return s0e.readFileSync(o0e.resolve(process.cwd(),s))}catch{aJ.diag.warn(r);return}else return}function d0e(t){return JM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function f0e(t){return JM(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function oJ(t){return JM(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function cJ(t){let e=f0e(t),r=d0e(t),n=oJ(t),i=e!=null&&r!=null;return n!=null&&!i?(aJ.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,Hg.createSslCredentials)(oJ(t))):(0,Hg.createSslCredentials)(n,e,r)}function p0e(t){return u0e(t)?(0,Hg.createInsecureCredentials)():cJ(t)}function h0e(t){return{...(0,i0e.getSharedConfigurationFromEnvironment)(t),metadata:c0e(t),url:l0e(t),credentials:e=>e.startsWith("http://")?()=>(0,Hg.createInsecureCredentials)():e.startsWith("https://")?()=>cJ(t):()=>p0e(t)}}BT.getOtlpGrpcConfigurationFromEnv=h0e});var dJ=b(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});jT.convertLegacyOtlpGrpcOptions=void 0;var uJ=x9(),m0e=Vg(),g0e=lJ();function _0e(t,e){let r=t.credentials;return(0,uJ.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,m0e.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0,userAgent:t.userAgent},(0,g0e.getOtlpGrpcConfigurationFromEnv)(e),(0,uJ.getOtlpGrpcDefaultConfiguration)())}jT.convertLegacyOtlpGrpcOptions=_0e});var fJ=b(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});zT.createOtlpGrpcExportDelegate=void 0;var y0e=(Pv(),Ar(Cv)),S0e=Vg();function E0e(t,e,r,n){return(0,y0e.createOtlpNetworkExportDelegate)(t,e,(0,S0e.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,userAgent:t.userAgent,grpcName:r,grpcPath:n}))}zT.createOtlpGrpcExportDelegate=E0e});var pJ=b(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.createOtlpGrpcExportDelegate=Gd.convertLegacyOtlpGrpcOptions=void 0;var v0e=dJ();Object.defineProperty(Gd,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return v0e.convertLegacyOtlpGrpcOptions}});var b0e=fJ();Object.defineProperty(Gd,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return b0e.createOtlpGrpcExportDelegate}})});function ro(t){return t<0?10:t<128?1:t<16384?2:t<2097152?3:t<268435456?4:t<34359738368?5:t<4398046511104?6:t<562949953421312?7:t<72057594037927940?8:9}var XM=x(()=>{"use strict"});var T0e,Wg,Ta,GT=x(()=>{"use strict";be();XM();T0e="ProtobufWriter: estimated size was too small, growing buffer.",Wg=1,Ta=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(e){let r=this.pos+e;if(r<=this._buffer.length)return;Q.debug(T0e);let n=this._buffer.length*2;for(;n<r;)n*=2;let i=new Uint8Array(n);i.set(this._buffer),this._buffer=i,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(Wg),this.pos+=Wg,e}finishLengthDelimited(e,r){let n=r>>>0,i=ro(n);if(i>Wg){let o=i-Wg;this._ensureCapacity(o),this._buffer.copyWithin(e+i,e+Wg,this.pos),this.pos+=o}let s=e;n<128?this._buffer[s]=n:n<16384?(this._buffer[s++]=n&127|128,this._buffer[s]=n>>>7):n<2097152?(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s]=n>>>14):n<268435456?(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s++]=n>>>14&127|128,this._buffer[s]=n>>>21):(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s++]=n>>>14&127|128,this._buffer[s++]=n>>>21&127|128,this._buffer[s]=n>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}this.writeFixed64(r,n)}writeVarint(e){if(this._ensureCapacity(ro(e)),e>=0&&e<=4294967295){let r=e>>>0;for(;r>127;)this._buffer[this.pos++]=r&127|128,r>>>=7;this._buffer[this.pos++]=r}else{let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}for(;n>0||r>127;)this._buffer[this.pos++]=r&127|128,r=(r>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=r&127}}writeFixed32(e){this._ensureCapacity(4);let r=e>>>0;this._buffer[this.pos++]=r&255,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255}writeFixed64(e,r){this._ensureCapacity(8);let n=e>>>0,i=r>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=i&255,this._buffer[this.pos++]=i>>>8&255,this._buffer[this.pos++]=i>>>16&255,this._buffer[this.pos++]=i>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let r=!0,n=e.length;for(let i=0;i<n;i++)if(e.charCodeAt(i)>127){r=!1;break}if(r){this.writeVarint(n),this._ensureCapacity(n);for(let i=0;i<n;i++)this._buffer[this.pos++]=e.charCodeAt(i)}else{let i=this._textEncoder.encode(e);this.writeBytes(i)}}}});function hJ(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function no(t){let e=new Uint8Array(t.length/2),r=0;for(let n=0;n<t.length;n+=2){let i=hJ(t.charCodeAt(n)),s=hJ(t.charCodeAt(n+1));e[r++]=i<<4|s}return e}var QM=x(()=>{"use strict"});var Yg,mJ=x(()=>{"use strict";(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Yg||(Yg={}))});var Kg,gJ,eD=x(()=>{"use strict";Kg=class{emit(e){}enabled(){return!1}},gJ=new Kg});function _J(t,e,r){return n=>n===t?e:r}var Zg,Vd,tD,yJ=x(()=>{"use strict";Zg=Symbol.for("io.opentelemetry.js.api.logs"),Vd=globalThis;tD=1});var rD,VT,nD=x(()=>{"use strict";eD();rD=class{getLogger(e,r,n){return new Kg}},VT=new rD});var qT,SJ=x(()=>{"use strict";eD();qT=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):gJ}}});var Jg,EJ=x(()=>{"use strict";nD();SJ();Jg=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new qT(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:VT}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}}});var HT,vJ=x(()=>{"use strict";yJ();nD();EJ();HT=class t{constructor(){this._proxyLoggerProvider=new Jg}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Vd[Zg]?this.getLoggerProvider():(Vd[Zg]=_J(tD,e,VT),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Vd[Zg])===null||e===void 0?void 0:e.call(Vd,tD))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Vd[Zg],this._proxyLoggerProvider=new Jg}}});var hct,bJ=x(()=>{"use strict";mJ();vJ();hct=HT.getInstance()});function Yr(t,e){let r=e[0],n=e[1],i=1e9,s=r&65535,o=r/65536>>>0,a=s*i,c=o*i,l=a>>>0,u=Math.floor(a/4294967296),d=(c&65535)*65536>>>0,f=c/65536>>>0,p=l+d+n,h=p>>>0,m=Math.floor(p/4294967296),E=u+f+m>>>0;t.writeFixed64(h,E)}function yi(t,e,r){for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=e[n];t.writeTag(r,2);let s=t.startLengthDelimited(),o=t.pos;A0e(t,n,i),t.finishLengthDelimited(s,t.pos-o)}}function A0e(t,e,r){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),i=t.pos;Xg(t,r),t.finishLengthDelimited(n,t.pos-i)}function Xg(t,e){let r=typeof e;if(r==="string")t.writeTag(1,2),t.writeString(e);else if(r==="boolean")t.writeTag(2,0),t.writeVarint(e?1:0);else if(r==="number"){let n=e;Number.isInteger(n)&&n>=x0e&&n<w0e?(t.writeTag(3,0),t.writeVarint(n)):(t.writeTag(4,1),t.writeDouble(n))}else if(e instanceof Uint8Array)t.writeTag(7,2),t.writeBytes(e);else if(Array.isArray(e)){t.writeTag(5,2);let n=t.startLengthDelimited(),i=t.pos;for(let s of e){t.writeTag(1,2);let o=t.startLengthDelimited(),a=t.pos;Xg(t,s),t.finishLengthDelimited(o,t.pos-a)}t.finishLengthDelimited(n,t.pos-i)}else if(r==="object"&&e!=null){t.writeTag(6,2);let n=t.startLengthDelimited(),i=t.pos,s=e;for(let o in s){if(!Object.prototype.hasOwnProperty.call(s,o))continue;let a=s[o];t.writeTag(1,2);let c=t.startLengthDelimited(),l=t.pos;t.writeTag(1,2),t.writeString(o),t.writeTag(2,2);let u=t.startLengthDelimited(),d=t.pos;Xg(t,a),t.finishLengthDelimited(u,t.pos-d),t.finishLengthDelimited(c,t.pos-l)}t.finishLengthDelimited(n,t.pos-i)}}function qd(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;t.writeTag(1,2),t.writeString(e.name),e.version&&(t.writeTag(2,2),t.writeString(e.version)),t.finishLengthDelimited(n,t.pos-i)}function Hd(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;e.attributes&&yi(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-i)}var x0e,w0e,WT=x(()=>{"use strict";x0e=-(2**63),w0e=2**63});function R0e(t){let e=t.length,r=0;for(let n=0;n<e;n++){let i=t.charCodeAt(n);i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4)}return r}var Aa,YT=x(()=>{"use strict";XM();Aa=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,r){this.pos+=ro(r)}writeVarint(e){this.pos+=ro(e)}writeSint32(e){this.pos+=ro((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,r){this.pos+=8}writeBytes(e){this.pos+=ro(e.length),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this.pos+=8}writeString(e){let r=R0e(e);this.pos+=ro(r),this.pos+=r}}});function I0e(t,e){let r=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),Yr(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==Yg.UNSPECIFIED&&(t.writeTag(2,0),t.writeVarint(e.severityNumber)),e.severityText&&(t.writeTag(3,2),t.writeString(e.severityText)),e.body!==void 0){t.writeTag(5,2);let i=t.startLengthDelimited(),s=t.pos;Xg(t,e.body),t.finishLengthDelimited(i,t.pos-s)}e.attributes&&yi(t,e.attributes,6),t.writeTag(7,0),t.writeVarint(e.droppedAttributesCount),e.spanContext?.traceFlags&&(t.writeTag(8,5),t.writeFixed32(e.spanContext.traceFlags)),e.spanContext?.traceId&&(t.writeTag(9,2),t.writeBytes(no(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(no(e.spanContext.spanId))),t.writeTag(11,1),Yr(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(r,t.pos-n)}function C0e(t,e,r){let n=t.startLengthDelimited(),i=t.pos;qd(t,e,1);for(let s of r)t.writeTag(2,2),I0e(t,s);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function TJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hd(t,e,1);for(let s of r.values()){t.writeTag(2,2);let o=s[0].instrumentationScope;C0e(t,o,s)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function P0e(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,s=e.get(n);s||(s=new Map,e.set(n,s));let o=s.get(i);o||(o=[],s.set(i,o)),o.push(r)}return e}function AJ(t){let e=P0e(t),r=new Aa;for(let[i,s]of e)r.writeTag(1,2),TJ(r,i,s);let n=new Ta(r.pos);for(let[i,s]of e)n.writeTag(1,2),TJ(n,i,s);return n.finish()}var xJ=x(()=>{"use strict";GT();QM();bJ();WT();YT()});var Si,KT=x(()=>{"use strict";Si=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,r=0,n=!1;for(;this.pos<this._buf.length;){let i=this._buf[this.pos++];if(e+=(i&127)*Math.pow(2,r),r+=7,(i&128)===0){n=!0;break}}if(!n)throw new Error("Truncated buffer: unexpected end of data while reading varint");return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw new Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let r=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,r}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:r}=this.readTag();if(r===4)break;this.skip(r)}break;case 4:break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${e}, cannot safely skip`)}}}});function O0e(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedLogRecords=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function wJ(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=O0e(e.readBytes()):e.skip(i)}return r}var RJ=x(()=>{"use strict";KT()});var iD,IJ=x(()=>{"use strict";xJ();RJ();iD={serializeRequest:t=>AJ(t),deserializeResponse:t=>wJ(t)}});var CJ=x(()=>{"use strict";IJ()});var io,PJ=x(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(io||(io={}))});var sD,hn,OJ=x(()=>{"use strict";(function(t){t.COUNTER="COUNTER",t.GAUGE="GAUGE",t.HISTOGRAM="HISTOGRAM",t.UP_DOWN_COUNTER="UP_DOWN_COUNTER",t.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",t.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",t.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(sD||(sD={}));(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(hn||(hn={}))});var oD=x(()=>{"use strict";PJ();OJ()});function MJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;t.writeTag(2,1),Yr(t,e.startTime),t.writeTag(3,1),Yr(t,e.endTime),r===ks.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&yi(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-i)}function N0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;if(t.writeTag(2,1),Yr(t,e.startTime),t.writeTag(3,1),Yr(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.buckets.counts.length>0){t.writeTag(6,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of i.buckets.counts)t.writeFixed64(a>>>0,a/4294967296>>>0);t.finishLengthDelimited(s,t.pos-o)}if(i.buckets.boundaries.length>0){t.writeTag(7,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of i.buckets.boundaries)t.writeDouble(a);t.finishLengthDelimited(s,t.pos-o)}e.attributes&&yi(t,e.attributes,9),i.min!==void 0&&(t.writeTag(11,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(12,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function NJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;if(e!==0&&(t.writeTag(1,0),t.writeSint32(e)),r.length>0){t.writeTag(2,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of r)t.writeVarint(a);t.finishLengthDelimited(s,t.pos-o)}t.finishLengthDelimited(n,t.pos-i)}function k0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;e.attributes&&yi(t,e.attributes,1),t.writeTag(2,1),Yr(t,e.startTime),t.writeTag(3,1),Yr(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.scale!==0&&(t.writeTag(6,0),t.writeSint32(i.scale)),t.writeTag(7,1),t.writeFixed64(i.zeroCount>>>0,i.zeroCount/4294967296>>>0),t.writeTag(8,2),NJ(t,i.positive.offset,i.positive.bucketCounts),t.writeTag(9,2),NJ(t,i.negative.offset,i.negative.bucketCounts),i.min!==void 0&&(t.writeTag(12,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(13,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function M0e(t,e){let r=t.startLengthDelimited(),n=t.pos;switch(t.writeTag(1,2),t.writeString(e.descriptor.name),e.descriptor.description&&(t.writeTag(2,2),t.writeString(e.descriptor.description)),e.descriptor.unit&&(t.writeTag(3,2),t.writeString(e.descriptor.unit)),e.dataPointType){case hn.GAUGE:t.writeTag(5,2),D0e(t,e);break;case hn.SUM:t.writeTag(7,2),L0e(t,e);break;case hn.HISTOGRAM:t.writeTag(9,2),$0e(t,e);break;case hn.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),U0e(t,e);break;default:{let i=e}}t.finishLengthDelimited(r,t.pos-n)}function D0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let i of e.dataPoints)t.writeTag(1,2),MJ(t,i,e.descriptor.valueType);t.finishLengthDelimited(r,t.pos-n)}function L0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),MJ(t,s,e.descriptor.valueType);let i=aD(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),e.isMonotonic&&(t.writeTag(3,0),t.writeVarint(1)),t.finishLengthDelimited(r,t.pos-n)}function $0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),N0e(t,s);let i=aD(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function U0e(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),k0e(t,s);let i=aD(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function F0e(t,e){let r=t.startLengthDelimited(),n=t.pos;qd(t,e.scope,1);for(let i of e.metrics)t.writeTag(2,2),M0e(t,i);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function kJ(t,e){let r=t.startLengthDelimited(),n=t.pos;Hd(t,e.resource,1);for(let i of e.scopeMetrics)t.writeTag(2,2),F0e(t,i);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function aD(t){switch(t){case io.DELTA:return 1;case io.CUMULATIVE:return 2;default:return 0}}function DJ(t){let e=new Aa;e.writeTag(1,2),kJ(e,t);let r=new Ta(e.pos);return r.writeTag(1,2),kJ(r,t),r.finish()}var LJ=x(()=>{"use strict";be();oD();WT();YT();GT()});function B0e(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedDataPoints=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function $J(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=B0e(e.readBytes()):e.skip(i)}return r}var UJ=x(()=>{"use strict";KT()});var cD,FJ=x(()=>{"use strict";LJ();UJ();cD={serializeRequest:t=>DJ(t),deserializeResponse:t=>$J(t)}});var BJ=x(()=>{"use strict";FJ()});function zJ(t,e){let r=t&255|j0e;return e&&(r|=z0e),r}function G0e(t,e){let r=t.startLengthDelimited(),n=t.pos;e.message&&(t.writeTag(2,2),t.writeString(e.message)),t.writeTag(3,0),t.writeVarint(e.code),t.finishLengthDelimited(r,t.pos-n)}function V0e(t,e){let r=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),Yr(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&yi(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(r,t.pos-n)}function q0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.context;t.writeTag(1,2),t.writeBytes(no(i.traceId)),t.writeTag(2,2),t.writeBytes(no(i.spanId));let s=i.traceState?.serialize();s&&(t.writeTag(3,2),t.writeString(s)),e.attributes&&yi(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let o=zJ(i.traceFlags,i.isRemote);o&&(t.writeTag(6,5),t.writeFixed32(o)),t.finishLengthDelimited(r,t.pos-n)}function H0e(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.spanContext();t.writeTag(1,2),t.writeBytes(no(i.traceId)),t.writeTag(2,2),t.writeBytes(no(i.spanId));let s=i.traceState?.serialize();s&&(t.writeTag(3,2),t.writeString(s)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(no(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let o=e.kind==null?0:e.kind+1;o!==0&&(t.writeTag(6,0),t.writeVarint(o)),t.writeTag(7,1),Yr(t,e.startTime),t.writeTag(8,1),Yr(t,e.endTime),e.attributes&&yi(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),V0e(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),q0e(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),G0e(t,e.status);let a=zJ(i.traceFlags,e.parentSpanContext?.isRemote);a&&(t.writeTag(16,5),t.writeFixed32(a)),t.finishLengthDelimited(r,t.pos-n)}function W0e(t,e,r){let n=t.startLengthDelimited(),i=t.pos;qd(t,e,1);for(let s of r)t.writeTag(2,2),H0e(t,s);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function jJ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hd(t,e,1);for(let s of r.values()){t.writeTag(2,2);let o=s[0].instrumentationScope;W0e(t,o,s)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Y0e(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,s=e.get(n);s||(s=new Map,e.set(n,s));let o=s.get(i);o||(o=[],s.set(i,o)),o.push(r)}return e}function GJ(t){let e=Y0e(t),r=new Aa;for(let[i,s]of e)r.writeTag(1,2),jJ(r,i,s);let n=new Ta(r.pos);for(let[i,s]of e)n.writeTag(1,2),jJ(n,i,s);return n.finish()}var j0e,z0e,VJ=x(()=>{"use strict";GT();QM();WT();YT();j0e=256,z0e=512});function K0e(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedSpans=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function qJ(t){let e=new Si(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=K0e(e.readBytes()):e.skip(i)}return r}var HJ=x(()=>{"use strict";KT()});var lD,WJ=x(()=>{"use strict";VJ();HJ();lD={serializeRequest:t=>GJ(t),deserializeResponse:t=>qJ(t)}});var YJ=x(()=>{"use strict";WJ()});function Wd(t,e){let r={attributes:so(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Yd(t){return{name:t.name,version:t.version}}function so(t,e){return Object.keys(t).map(r=>uD(r,t[r],e))}function uD(t,e,r){return{key:t,value:Qg(e,r)}}function Qg(t,e){let r=typeof t;if(r==="string")return{stringValue:t};if(r==="number")return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if(r==="boolean")return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:e.encodeUint8Array(t)};if(Array.isArray(t)){let n=new Array(t.length);for(let i=0;i<t.length;i++)n[i]=Qg(t[i],e);return{arrayValue:{values:n}}}if(r==="object"&&t!=null){let n=Object.keys(t),i=new Array(n.length);for(let s=0;s<n.length;s++)i[s]={key:n[s],value:Qg(t[n[s]],e)};return{kvlistValue:{values:i}}}return{}}var ZT=x(()=>{"use strict"});function KJ(t,e){return{resourceLogs:J0e(t,e)}}function Z0e(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:s="",schemaUrl:o=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${s}:${o}`,l=a.get(c);l||(l=[],a.set(c,l)),l.push(r)}return e}function J0e(t,e){let r=Z0e(t);return Array.from(r,([n,i])=>{let s=Wd(n,e);return{resource:s,scopeLogs:Array.from(i,([,o])=>({scope:Yd(o[0].instrumentationScope),logRecords:o.map(a=>X0e(a,e)),schemaUrl:o[0].instrumentationScope.schemaUrl})),schemaUrl:s.schemaUrl}})}function X0e(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Qg(t.body,e),eventName:t.eventName,attributes:Q0e(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function Q0e(t,e){return Object.keys(t).map(r=>uD(r,t[r],e))}var ZJ=x(()=>{"use strict";ZT()});function ePe(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function tPe(t){return ePe(t).toString()}function JJ(t){return t}var rPe,Kd,JT=x(()=>{"use strict";Fs();rPe=typeof BigInt<"u"?tPe:bE;Kd={encodeHrTime:rPe,encodeSpanContext:JJ,encodeOptionalSpanContext:JJ,encodeUint8Array:t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64");let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=String.fromCharCode(t[r]);return btoa(e.join(""))}}});var dD,XJ=x(()=>{"use strict";ZJ();JT();be();dD={serializeRequest:t=>{let e=KJ(t,Kd);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return Q.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}}});var QJ=x(()=>{"use strict";XJ()});var e_,eX=x(()=>{"use strict";(function(t){t[t.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",t[t.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",t[t.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(e_||(e_={}))});function nPe(t,e){let r=Wd(t.resource,e);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:iPe(t.scopeMetrics,e)}}function iPe(t,e){return Array.from(t.map(r=>({scope:Yd(r.scope),metrics:r.metrics.map(n=>sPe(n,e)),schemaUrl:r.scope.schemaUrl})))}function sPe(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=lPe(t.aggregationTemporality);switch(t.dataPointType){case hn.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:tX(t,e)};break;case hn.GAUGE:r.gauge={dataPoints:tX(t,e)};break;case hn.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:aPe(t,e)};break;case hn.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:cPe(t,e)};break}return r}function oPe(t,e,r){let n={attributes:so(t.attributes,r),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case ks.INT:n.asInt=t.value;break;case ks.DOUBLE:n.asDouble=t.value;break}return n}function tX(t,e){return t.dataPoints.map(r=>oPe(r,t.descriptor.valueType,e))}function aPe(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:so(r.attributes,e),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function cPe(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:so(r.attributes,e),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function lPe(t){switch(t){case io.DELTA:return e_.AGGREGATION_TEMPORALITY_DELTA;case io.CUMULATIVE:return e_.AGGREGATION_TEMPORALITY_CUMULATIVE}}function rX(t,e){return{resourceMetrics:t.map(r=>nPe(r,e))}}var nX=x(()=>{"use strict";be();oD();eX();ZT()});var fD,iX=x(()=>{"use strict";nX();JT();be();fD={serializeRequest:t=>{let e=rX([t],Kd);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return Q.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}}});var sX=x(()=>{"use strict";iX()});function oX(t,e){let r=t&255|uPe;return e&&(r|=dPe),r}function fPe(t,e){let r=t.spanContext(),n=t.status,i=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:i,traceState:r.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:so(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(s=>hPe(s,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(s=>pPe(s,e)),droppedLinksCount:t.droppedLinksCount,flags:oX(r.traceFlags,t.parentSpanContext?.isRemote)}}function pPe(t,e){return{attributes:t.attributes?so(t.attributes,e):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0,flags:oX(t.context.traceFlags,t.context.isRemote)}}function hPe(t,e){return{attributes:t.attributes?so(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function aX(t,e){return{resourceSpans:gPe(t,e)}}function mPe(t){let e=new Map;for(let r of t){let n=e.get(r.resource);n||(n=new Map,e.set(r.resource,n));let i=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(r)}return e}function gPe(t,e){let r=mPe(t),n=[],i=r.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,c=[],l=a.values(),u=l.next();for(;!u.done;){let p=u.value;if(p.length>0){let h=p.map(m=>fPe(m,e));c.push({scope:Yd(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=l.next()}let d=Wd(o,e),f={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};n.push(f),s=i.next()}return n}var uPe,dPe,cX=x(()=>{"use strict";ZT();uPe=256,dPe=512});var pD,lX=x(()=>{"use strict";cX();JT();be();pD={serializeRequest:t=>{let e=aX(t,Kd);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return Q.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}}});var uX=x(()=>{"use strict";lX()});var dX={};ir(dX,{JsonLogsSerializer:()=>dD,JsonMetricsSerializer:()=>fD,JsonTraceSerializer:()=>pD,ProtobufLogsSerializer:()=>iD,ProtobufMetricsSerializer:()=>cD,ProtobufTraceSerializer:()=>lD});var fX=x(()=>{"use strict";CJ();BJ();YJ();QJ();sX();uX()});var hX=b(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});XT.OTLPTraceExporter=void 0;var pX=pJ(),_Pe=(fX(),Ar(dX)),yPe=(Pv(),Ar(Cv)),hD=class extends yPe.OTLPExporterBase{constructor(e={}){super((0,pX.createOtlpGrpcExportDelegate)((0,pX.convertLegacyOtlpGrpcOptions)(e,"TRACES"),_Pe.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};XT.OTLPTraceExporter=hD});var mX=b(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});QT.OTLPTraceExporter=void 0;var SPe=hX();Object.defineProperty(QT,"OTLPTraceExporter",{enumerable:!0,get:function(){return SPe.OTLPTraceExporter}})});var OQ=b((kft,PQ)=>{"use strict";PQ.exports=CQ;CQ.sync=ENe;var RQ=J("fs");function SNe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function IQ(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:SNe(e,r)}function CQ(t,e,r){RQ.stat(t,function(n,i){r(n,n?!1:IQ(i,t,e))})}function ENe(t,e){return IQ(RQ.statSync(t),t,e)}});var LQ=b((Mft,DQ)=>{"use strict";DQ.exports=kQ;kQ.sync=vNe;var NQ=J("fs");function kQ(t,e,r){NQ.stat(t,function(n,i){r(n,n?!1:MQ(i,e))})}function vNe(t,e){return MQ(NQ.statSync(t),e)}function MQ(t,e){return t.isFile()&&bNe(t,e)}function bNe(t,e){var r=t.mode,n=t.uid,i=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===o||r&a&&n===s||r&u&&s===0;return d}});var UQ=b((Lft,$Q)=>{"use strict";var Dft=J("fs"),bA;process.platform==="win32"||global.TESTING_WINDOWS?bA=OQ():bA=LQ();$Q.exports=$D;$D.sync=TNe;function $D(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){$D(t,e||{},function(s,o){s?i(s):n(o)})})}bA(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function TNe(t,e){try{return bA.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var qQ=b(($ft,VQ)=>{"use strict";var tf=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",FQ=J("path"),ANe=tf?";":":",BQ=UQ(),jQ=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),zQ=(t,e)=>{let r=e.colon||ANe,n=t.match(/\//)||tf&&t.match(/\\/)?[""]:[...tf?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=tf?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=tf?i.split(r):[""];return tf&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:i}},GQ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:s}=zQ(t,e),o=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&o.length?u(o):d(jQ(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,h=FQ.join(p,t),m=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+h:h;u(c(m,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let h=i[d];BQ(l+h,{pathExt:s},(m,E)=>{if(!m&&E)if(e.all)o.push(l+h);else return f(l+h);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},xNe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=zQ(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=FQ.join(c,t),u=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let f=u+n[d];try{if(BQ.sync(f,{pathExt:i}))if(e.all)s.push(f);else return f}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw jQ(t)};VQ.exports=GQ;GQ.sync=xNe});var WQ=b((Uft,UD)=>{"use strict";var HQ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};UD.exports=HQ;UD.exports.default=HQ});var JQ=b((Fft,ZQ)=>{"use strict";var YQ=J("path"),wNe=qQ(),RNe=WQ();function KQ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=wNe.sync(t.command,{path:r[RNe({env:r})],pathExt:e?YQ.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return o&&(o=YQ.resolve(i?t.options.cwd:"",o)),o}function INe(t){return KQ(t)||KQ(t,!0)}ZQ.exports=INe});var XQ=b((Bft,BD)=>{"use strict";var FD=/([()\][%!^"`<>&|;, *?])/g;function CNe(t){return t=t.replace(FD,"^$1"),t}function PNe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(FD,"^$1"),e&&(t=t.replace(FD,"^$1")),t}BD.exports.command=CNe;BD.exports.argument=PNe});var e7=b((jft,QQ)=>{"use strict";QQ.exports=/^#!(.*)/});var r7=b((zft,t7)=>{"use strict";var ONe=e7();t7.exports=(t="")=>{let e=t.match(ONe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var i7=b((Gft,n7)=>{"use strict";var jD=J("fs"),NNe=r7();function kNe(t){let r=Buffer.alloc(150),n;try{n=jD.openSync(t,"r"),jD.readSync(n,r,0,150,0),jD.closeSync(n)}catch{}return NNe(r.toString())}n7.exports=kNe});var c7=b((Vft,a7)=>{"use strict";var MNe=J("path"),s7=JQ(),o7=XQ(),DNe=i7(),LNe=process.platform==="win32",$Ne=/\.(?:com|exe)$/i,UNe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function FNe(t){t.file=s7(t);let e=t.file&&DNe(t.file);return e?(t.args.unshift(t.file),t.command=e,s7(t)):t.file}function BNe(t){if(!LNe)return t;let e=FNe(t),r=!$Ne.test(e);if(t.options.forceShell||r){let n=UNe.test(e);t.command=MNe.normalize(t.command),t.command=o7.command(t.command),t.args=t.args.map(s=>o7.argument(s,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function jNe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:BNe(n)}a7.exports=jNe});var d7=b((qft,u7)=>{"use strict";var zD=process.platform==="win32";function GD(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function zNe(t,e){if(!zD)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let s=l7(i,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function l7(t,e){return zD&&t===1&&!e.file?GD(e.original,"spawn"):null}function GNe(t,e){return zD&&t===1&&!e.file?GD(e.original,"spawnSync"):null}u7.exports={hookChildProcess:zNe,verifyENOENT:l7,verifyENOENTSync:GNe,notFoundError:GD}});var h7=b((Hft,rf)=>{"use strict";var f7=J("child_process"),VD=c7(),qD=d7();function p7(t,e,r){let n=VD(t,e,r),i=f7.spawn(n.command,n.args,n.options);return qD.hookChildProcess(i,n),i}function VNe(t,e,r){let n=VD(t,e,r),i=f7.spawnSync(n.command,n.args,n.options);return i.error=i.error||qD.verifyENOENTSync(i.status,n),i}rf.exports=p7;rf.exports.spawn=p7;rf.exports.sync=VNe;rf.exports._parse=VD;rf.exports._enoent=qD});var Fle=b((ZFt,Ule)=>{"use strict";var Sc=J("constants"),_4e=process.cwd,xI=null,y4e=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xI||(xI=_4e.call(process)),xI};try{process.cwd()}catch{}typeof process.chdir=="function"&&(cz=process.chdir,process.chdir=function(t){xI=null,cz.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,cz));var cz;Ule.exports=S4e;function S4e(t){Sc.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,d,f){f&&process.nextTick(f)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,d,f,p){p&&process.nextTick(p)},t.lchownSync=function(){}),y4e==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(f,p,h){var m=Date.now(),E=0;u(f,p,function T(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(p,function(A,S){A&&A.code==="ENOENT"?u(f,p,T):h(v)})},E),E<100&&(E+=10);return}h&&h(v)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function d(f,p,h,m,E,T){var v;if(T&&typeof T=="function"){var A=0;v=function(S,R,P){if(S&&S.code==="EAGAIN"&&A<10)return A++,u.call(t,f,p,h,m,E,v);T.apply(this,arguments)}}return u.call(t,f,p,h,m,E,v)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(d,f,p,h,m){for(var E=0;;)try{return u.call(t,d,f,p,h,m)}catch(T){if(T.code==="EAGAIN"&&E<10){E++;continue}throw T}}})(t.readSync);function e(u){u.lchmod=function(d,f,p){u.open(d,Sc.O_WRONLY|Sc.O_SYMLINK,f,function(h,m){if(h){p&&p(h);return}u.fchmod(m,f,function(E){u.close(m,function(T){p&&p(E||T)})})})},u.lchmodSync=function(d,f){var p=u.openSync(d,Sc.O_WRONLY|Sc.O_SYMLINK,f),h=!0,m;try{m=u.fchmodSync(p,f),h=!1}finally{if(h)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function r(u){Sc.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,f,p,h){u.open(d,Sc.O_SYMLINK,function(m,E){if(m){h&&h(m);return}u.futimes(E,f,p,function(T){u.close(E,function(v){h&&h(T||v)})})})},u.lutimesSync=function(d,f,p){var h=u.openSync(d,Sc.O_SYMLINK),m,E=!0;try{m=u.futimesSync(h,f,p),E=!1}finally{if(E)try{u.closeSync(h)}catch{}else u.closeSync(h)}return m}):u.futimes&&(u.lutimes=function(d,f,p,h){h&&process.nextTick(h)},u.lutimesSync=function(){})}function n(u){return u&&function(d,f,p){return u.call(t,d,f,function(h){l(h)&&(h=null),p&&p.apply(this,arguments)})}}function i(u){return u&&function(d,f){try{return u.call(t,d,f)}catch(p){if(!l(p))throw p}}}function s(u){return u&&function(d,f,p,h){return u.call(t,d,f,p,function(m){l(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(u){return u&&function(d,f,p){try{return u.call(t,d,f,p)}catch(h){if(!l(h))throw h}}}function a(u){return u&&function(d,f,p){typeof f=="function"&&(p=f,f=null);function h(m,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),p&&p.apply(this,arguments)}return f?u.call(t,d,f,h):u.call(t,d,h)}}function c(u){return u&&function(d,f){var p=f?u.call(t,d,f):u.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var zle=b((JFt,jle)=>{"use strict";var Ble=J("stream").Stream;jle.exports=E4e;function E4e(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Ble.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){s.emit("error",u),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Ble.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var c=s[o];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Vle=b((XFt,Gle)=>{"use strict";Gle.exports=b4e;var v4e=Object.getPrototypeOf||function(t){return t.__proto__};function b4e(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:v4e(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Yle=b((QFt,dz)=>{"use strict";var vt=J("fs"),T4e=Fle(),A4e=zle(),x4e=Vle(),wI=J("util"),hr,II;typeof Symbol=="function"&&typeof Symbol.for=="function"?(hr=Symbol.for("graceful-fs.queue"),II=Symbol.for("graceful-fs.previous")):(hr="___graceful-fs.queue",II="___graceful-fs.previous");function w4e(){}function Wle(t,e){Object.defineProperty(t,hr,{get:function(){return e}})}var vu=w4e;wI.debuglog?vu=wI.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(vu=function(){var t=wI.format.apply(wI,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
23
23
|
GFS4: `),console.error(t)});vt[hr]||(qle=global[hr]||[],Wle(vt,qle),vt.close=(function(t){function e(r,n){return t.call(vt,r,function(i){i||Hle(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,II,{value:t}),e})(vt.close),vt.closeSync=(function(t){function e(r){t.apply(vt,arguments),Hle()}return Object.defineProperty(e,II,{value:t}),e})(vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){vu(vt[hr]),J("assert").equal(vt[hr].length,0)}));var qle;global[hr]||Wle(global,vt[hr]);dz.exports=lz(x4e(vt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!vt.__patched&&(dz.exports=lz(vt),vt.__patched=!0);function lz(t){T4e(t),t.gracefulify=lz,t.createReadStream=R,t.createWriteStream=P;var e=t.readFile;t.readFile=r;function r(O,j,_){return typeof j=="function"&&(_=j,j=null),se(O,j,_);function se(C,g,y,w){return e(C,g,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Ch([se,[C,g,y],X,w||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(O,j,_,se){return typeof _=="function"&&(se=_,_=null),C(O,j,_,se);function C(g,y,w,X,q){return n(g,y,w,function(ae){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?Ch([C,[g,y,w,X],ae,q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(O,j,_,se){return typeof _=="function"&&(se=_,_=null),C(O,j,_,se);function C(g,y,w,X,q){return s(g,y,w,function(ae){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?Ch([C,[g,y,w,X],ae,q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=c);function c(O,j,_,se){return typeof _=="function"&&(se=_,_=0),C(O,j,_,se);function C(g,y,w,X,q){return a(g,y,w,function(ae){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?Ch([C,[g,y,w,X],ae,q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var u=/^v[0-5]\./;function d(O,j,_){typeof j=="function"&&(_=j,j=null);var se=u.test(process.version)?function(y,w,X,q){return l(y,C(y,w,X,q))}:function(y,w,X,q){return l(y,w,C(y,w,X,q))};return se(O,j,_);function C(g,y,w,X){return function(q,ae){q&&(q.code==="EMFILE"||q.code==="ENFILE")?Ch([se,[g,y,w],q,X||Date.now(),Date.now()]):(ae&&ae.sort&&ae.sort(),typeof w=="function"&&w.call(this,q,ae))}}}if(process.version.substr(0,4)==="v0.8"){var f=A4e(t);T=f.ReadStream,A=f.WriteStream}var p=t.ReadStream;p&&(T.prototype=Object.create(p.prototype),T.prototype.open=v);var h=t.WriteStream;h&&(A.prototype=Object.create(h.prototype),A.prototype.open=S),Object.defineProperty(t,"ReadStream",{get:function(){return T},set:function(O){T=O},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return A},set:function(O){A=O},enumerable:!0,configurable:!0});var m=T;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(O){m=O},enumerable:!0,configurable:!0});var E=A;Object.defineProperty(t,"FileWriteStream",{get:function(){return E},set:function(O){E=O},enumerable:!0,configurable:!0});function T(O,j){return this instanceof T?(p.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function v(){var O=this;I(O.path,O.flags,O.mode,function(j,_){j?(O.autoClose&&O.destroy(),O.emit("error",j)):(O.fd=_,O.emit("open",_),O.read())})}function A(O,j){return this instanceof A?(h.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function S(){var O=this;I(O.path,O.flags,O.mode,function(j,_){j?(O.destroy(),O.emit("error",j)):(O.fd=_,O.emit("open",_))})}function R(O,j){return new t.ReadStream(O,j)}function P(O,j){return new t.WriteStream(O,j)}var L=t.open;t.open=I;function I(O,j,_,se){return typeof _=="function"&&(se=_,_=null),C(O,j,_,se);function C(g,y,w,X,q){return L(g,y,w,function(ae,Re){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?Ch([C,[g,y,w,X],ae,q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments)})}}return t}function Ch(t){vu("ENQUEUE",t[0].name,t[1]),vt[hr].push(t),uz()}var RI;function Hle(){for(var t=Date.now(),e=0;e<vt[hr].length;++e)vt[hr][e].length>2&&(vt[hr][e][3]=t,vt[hr][e][4]=t);uz()}function uz(){if(clearTimeout(RI),RI=void 0,vt[hr].length!==0){var t=vt[hr].shift(),e=t[0],r=t[1],n=t[2],i=t[3],s=t[4];if(i===void 0)vu("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){vu("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n)}else{var a=Date.now()-s,c=Math.max(s-i,1),l=Math.min(c*1.2,100);a>=l?(vu("RETRY",e.name,r),e.apply(null,r.concat([i]))):vt[hr].push(t)}RI===void 0&&(RI=setTimeout(uz,0))}}});var cue=b(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.splitWhen=Ph.flatten=void 0;function H4e(t){return t.reduce((e,r)=>[].concat(e,r),[])}Ph.flatten=H4e;function W4e(t,e){let r=[[]],n=0;for(let i of t)e(i)?(n++,r[n]=[]):r[n].push(i);return r}Ph.splitWhen=W4e});var lue=b(PI=>{"use strict";Object.defineProperty(PI,"__esModule",{value:!0});PI.isEnoentCodeError=void 0;function Y4e(t){return t.code==="ENOENT"}PI.isEnoentCodeError=Y4e});var uue=b(OI=>{"use strict";Object.defineProperty(OI,"__esModule",{value:!0});OI.createDirentFromStats=void 0;var Ez=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function K4e(t,e){return new Ez(t,e)}OI.createDirentFromStats=K4e});var hue=b(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.convertPosixPathToPattern=Ut.convertWindowsPathToPattern=Ut.convertPathToPattern=Ut.escapePosixPath=Ut.escapeWindowsPath=Ut.escape=Ut.removeLeadingDotSegment=Ut.makeAbsolute=Ut.unixify=void 0;var Z4e=J("os"),J4e=J("path"),due=Z4e.platform()==="win32",X4e=2,Q4e=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,eVe=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,tVe=/^\\\\([.?])/,rVe=/\\(?![!()+@[\]{}])/g;function nVe(t){return t.replace(/\\/g,"/")}Ut.unixify=nVe;function iVe(t,e){return J4e.resolve(t,e)}Ut.makeAbsolute=iVe;function sVe(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(X4e)}return t}Ut.removeLeadingDotSegment=sVe;Ut.escape=due?vz:bz;function vz(t){return t.replace(eVe,"\\$2")}Ut.escapeWindowsPath=vz;function bz(t){return t.replace(Q4e,"\\$2")}Ut.escapePosixPath=bz;Ut.convertPathToPattern=due?fue:pue;function fue(t){return vz(t).replace(tVe,"//$1").replace(rVe,"/")}Ut.convertWindowsPathToPattern=fue;function pue(t){return bz(t)}Ut.convertPosixPathToPattern=pue});var gue=b((wBt,mue)=>{"use strict";mue.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var Sue=b((RBt,yue)=>{"use strict";var oVe=gue(),_ue={"{":"}","(":")","[":"]"},aVe=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,i=-2,s=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||i!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(i=t.indexOf("}",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(s=t.indexOf(")",r),s>r&&(o=t.indexOf("\\",r),o===-1||o>s))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=_ue[a];if(c){var l=t.indexOf(c,e);l!==-1&&(e=l+1)}if(t[e]==="!")return!0}else e++}return!1},cVe=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=_ue[r];if(n){var i=t.indexOf(n,e);i!==-1&&(e=i+1)}if(t[e]==="!")return!0}else e++}return!1};yue.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(oVe(e))return!0;var n=aVe;return r&&r.strict===!1&&(n=cVe),n(e)}});var vue=b((IBt,Eue)=>{"use strict";var lVe=Sue(),uVe=J("path").posix.dirname,dVe=J("os").platform()==="win32",Tz="/",fVe=/\\/g,pVe=/[\{\[].*[\}\]]$/,hVe=/(^|[^\\])([\{\[]|\([^\)]+$)/,mVe=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Eue.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&dVe&&e.indexOf(Tz)<0&&(e=e.replace(fVe,Tz)),pVe.test(e)&&(e+=Tz),e+="a";do e=uVe(e);while(lVe(e)||hVe.test(e));return e.replace(mVe,"$1")}});var NI=b(Jn=>{"use strict";Jn.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Jn.find=(t,e)=>t.nodes.find(r=>r.type===e);Jn.exceedsLimit=(t,e,r=1,n)=>n===!1||!Jn.isInteger(t)||!Jn.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;Jn.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Jn.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;Jn.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Jn.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Jn.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);Jn.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){r(s);continue}s!==void 0&&e.push(s)}return e};return r(t),e}});var kI=b((PBt,Tue)=>{"use strict";var bue=NI();Tue.exports=(t,e={})=>{let r=(n,i={})=>{let s=e.escapeInvalid&&bue.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&bue.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(t)}});var xue=b((OBt,Aue)=>{"use strict";Aue.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var Mue=b((NBt,kue)=>{"use strict";var wue=xue(),Tu=(t,e,r)=>{if(wue(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(wue(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=t+":"+e+"="+i+s+o+a;if(Tu.cache.hasOwnProperty(c))return Tu.cache[c].result;let l=Math.min(t,e),u=Math.max(t,e);if(Math.abs(l-u)===1){let m=t+"|"+e;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let d=Nue(t)||Nue(e),f={min:t,max:e,a:l,b:u},p=[],h=[];if(d&&(f.isPadded=d,f.maxLen=String(f.max).length),l<0){let m=u<0?Math.abs(u):1;h=Rue(m,Math.abs(l),f,n),l=f.a=0}return u>=0&&(p=Rue(l,u,f,n)),f.negatives=h,f.positives=p,f.result=gVe(h,p,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&p.length+h.length>1&&(f.result=`(?:${f.result})`),Tu.cache[c]=f,f.result};function gVe(t,e,r){let n=Az(t,e,"-",!1,r)||[],i=Az(e,t,"",!1,r)||[],s=Az(t,e,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}function _Ve(t,e){let r=1,n=1,i=Cue(t,r),s=new Set([e]);for(;t<=i&&i<=e;)s.add(i),r+=1,i=Cue(t,r);for(i=Pue(e+1,n)-1;t<i&&i<=e;)s.add(i),n+=1,i=Pue(e+1,n)-1;return s=[...s],s.sort(EVe),s}function yVe(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=SVe(t,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,l]=n[a];c===l?s+=c:c!=="0"||l!=="9"?s+=vVe(c,l,r):o++}return o&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function Rue(t,e,r,n){let i=_Ve(t,e),s=[],o=t,a;for(let c=0;c<i.length;c++){let l=i[c],u=yVe(String(o),String(l),n),d="";if(!r.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+Oue(a.count),o=l+1;continue}r.isPadded&&(d=bVe(l,r,n)),u.string=d+u.pattern+Oue(u.count),s.push(u),o=l+1,a=u}return s}function Az(t,e,r,n,i){let s=[];for(let o of t){let{string:a}=o;!n&&!Iue(e,"string",a)&&s.push(r+a),n&&Iue(e,"string",a)&&s.push(r+a)}return s}function SVe(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function EVe(t,e){return t>e?1:e>t?-1:0}function Iue(t,e,r){return t.some(n=>n[e]===r)}function Cue(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Pue(t,e){return t-t%Math.pow(10,e)}function Oue(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function vVe(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function Nue(t){return/^-?(0+)\d/.test(t)}function bVe(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Tu.cache={};Tu.clearCache=()=>Tu.cache={};kue.exports=Tu});var Rz=b((kBt,jue)=>{"use strict";var TVe=J("util"),Lue=Mue(),Due=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),AVe=t=>e=>t===!0?Number(e):String(e),xz=t=>typeof t=="number"||typeof t=="string"&&t!=="",pS=t=>Number.isInteger(+t),wz=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},xVe=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,wVe=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},DI=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},RVe=(t,e,r)=>{t.negatives.sort((a,c)=>a<c?-1:a>c?1:0),t.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",s="",o;return t.positives.length&&(i=t.positives.map(a=>DI(String(a),r)).join("|")),t.negatives.length&&(s=`-(${n}${t.negatives.map(a=>DI(String(a),r)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},$ue=(t,e,r,n)=>{if(r)return Lue(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},Uue=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return Lue(t,e,r)},Fue=(...t)=>new RangeError("Invalid range arguments: "+TVe.inspect(...t)),Bue=(t,e,r)=>{if(r.strictRanges===!0)throw Fue([t,e]);return[]},IVe=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},CVe=(t,e,r=1,n={})=>{let i=Number(t),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw Fue([t,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(t),c=String(e),l=String(r);r=Math.max(Math.abs(r),1);let u=wz(a)||wz(c)||wz(l),d=u?Math.max(a.length,c.length,l.length):0,f=u===!1&&xVe(t,e,n)===!1,p=n.transform||AVe(f);if(n.toRegex&&r===1)return $ue(DI(t,d),DI(e,d),!0,n);let h={negatives:[],positives:[]},m=v=>h[v<0?"negatives":"positives"].push(Math.abs(v)),E=[],T=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?m(i):E.push(wVe(p(i,T),d,f)),i=o?i-r:i+r,T++;return n.toRegex===!0?r>1?RVe(h,n,d):Uue(E,null,{wrap:!1,...n}):E},PVe=(t,e,r=1,n={})=>{if(!pS(t)&&t.length>1||!pS(e)&&e.length>1)return Bue(t,e,n);let i=n.transform||(f=>String.fromCharCode(f)),s=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(n.toRegex&&r===1)return $ue(c,l,!1,n);let u=[],d=0;for(;a?s>=o:s<=o;)u.push(i(s,d)),s=a?s-r:s+r,d++;return n.toRegex===!0?Uue(u,null,{wrap:!1,options:n}):u},MI=(t,e,r,n={})=>{if(e==null&&xz(t))return[t];if(!xz(t)||!xz(e))return Bue(t,e,n);if(typeof r=="function")return MI(t,e,1,{transform:r});if(Due(r))return MI(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,pS(r)?pS(t)&&pS(e)?CVe(t,e,r,i):PVe(t,e,Math.max(Math.abs(r),1),i):r!=null&&!Due(r)?IVe(r,i):MI(t,e,1,r)};jue.exports=MI});var Vue=b((MBt,Gue)=>{"use strict";var OVe=Rz(),zue=NI(),NVe=(t,e={})=>{let r=(n,i={})=>{let s=zue.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=zue.reduce(n.nodes),d=OVe(...u,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return u.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let u of n.nodes)l+=r(u,n);return l};return r(t)};Gue.exports=NVe});var Wue=b((DBt,Hue)=>{"use strict";var kVe=Rz(),que=kI(),Oh=NI(),Au=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Oh.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let s of i)n.push(Au(s,e,r));else for(let s of e)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Au(i,s,r):i+s);return Oh.flatten(n)},MVe=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Au(a.pop(),que(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Au(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let d=Oh.reduce(i.nodes);if(Oh.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=kVe(...d,e);f.length===0&&(f=que(i,e)),a.push(Au(a.pop(),f)),i.nodes=[];return}let c=Oh.encloseBrace(i),l=i.queue,u=i;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let d=0;d<i.nodes.length;d++){let f=i.nodes[d];if(f.type==="comma"&&i.type==="brace"){d===1&&l.push(""),l.push("");continue}if(f.type==="close"){a.push(Au(a.pop(),l,c));continue}if(f.value&&f.type!=="open"){l.push(Au(l.pop(),f.value));continue}f.nodes&&n(f,i)}return l};return Oh.flatten(n(t))};Hue.exports=MVe});var Kue=b((LBt,Yue)=>{"use strict";Yue.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
24
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var ede=b(($Bt,Que)=>{"use strict";var DVe=kI(),{MAX_LENGTH:Zue,CHAR_BACKSLASH:Iz,CHAR_BACKTICK:LVe,CHAR_COMMA:$Ve,CHAR_DOT:UVe,CHAR_LEFT_PARENTHESES:FVe,CHAR_RIGHT_PARENTHESES:BVe,CHAR_LEFT_CURLY_BRACE:jVe,CHAR_RIGHT_CURLY_BRACE:zVe,CHAR_LEFT_SQUARE_BRACKET:Jue,CHAR_RIGHT_SQUARE_BRACKET:Xue,CHAR_DOUBLE_QUOTE:GVe,CHAR_SINGLE_QUOTE:VVe,CHAR_NO_BREAK_SPACE:qVe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:HVe}=Kue(),WVe=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Zue,r.maxLength):Zue;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},s=[i],o=i,a=i,c=0,l=t.length,u=0,d=0,f,p=()=>t[u++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=a,a=m,m};for(h({type:"bos"});u<l;)if(o=s[s.length-1],f=p(),!(f===HVe||f===qVe)){if(f===Iz){h({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===Xue){h({type:"text",value:"\\"+f});continue}if(f===Jue){c++;let m;for(;u<l&&(m=p());){if(f+=m,m===Jue){c++;continue}if(m===Iz){f+=p();continue}if(m===Xue&&(c--,c===0))break}h({type:"text",value:f});continue}if(f===FVe){o=h({type:"paren",nodes:[]}),s.push(o),h({type:"text",value:f});continue}if(f===BVe){if(o.type!=="paren"){h({type:"text",value:f});continue}o=s.pop(),h({type:"text",value:f}),o=s[s.length-1];continue}if(f===GVe||f===VVe||f===LVe){let m=f,E;for(e.keepQuotes!==!0&&(f="");u<l&&(E=p());){if(E===Iz){f+=E+p();continue}if(E===m){e.keepQuotes===!0&&(f+=E);break}f+=E}h({type:"text",value:f});continue}if(f===jVe){d++;let E={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};o=h(E),s.push(o),h({type:"open",value:f});continue}if(f===zVe){if(o.type!=="brace"){h({type:"text",value:f});continue}let m="close";o=s.pop(),o.close=!0,h({type:m,value:f}),d--,o=s[s.length-1];continue}if(f===$Ve&&d>0){if(o.ranges>0){o.ranges=0;let m=o.nodes.shift();o.nodes=[m,{type:"text",value:DVe(o)}]}h({type:"comma",value:f}),o.commas++;continue}if(f===UVe&&d>0&&o.commas===0){let m=o.nodes;if(d===0||m.length===0){h({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){m.pop();let E=m[m.length-1];E.value+=a.value+f,a=E,o.ranges--;continue}h({type:"dot",value:f});continue}h({type:"text",value:f})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(T=>{T.nodes||(T.type==="open"&&(T.isOpen=!0),T.type==="close"&&(T.isClose=!0),T.nodes||(T.type="text"),T.invalid=!0)});let m=s[s.length-1],E=m.nodes.indexOf(o);m.nodes.splice(E,1,...o.nodes)}while(s.length>0);return h({type:"eos"}),i};Que.exports=WVe});var nde=b((UBt,rde)=>{"use strict";var tde=kI(),YVe=Vue(),KVe=Wue(),ZVe=ede(),wn=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=wn.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(wn.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};wn.parse=(t,e={})=>ZVe(t,e);wn.stringify=(t,e={})=>tde(typeof t=="string"?wn.parse(t,e):t,e);wn.compile=(t,e={})=>(typeof t=="string"&&(t=wn.parse(t,e)),YVe(t,e));wn.expand=(t,e={})=>{typeof t=="string"&&(t=wn.parse(t,e));let r=KVe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};wn.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?wn.compile(t,e):wn.expand(t,e);rde.exports=wn});var hS=b((FBt,cde)=>{"use strict";var JVe=J("path"),Is="\\\\/",ide=`[^${Is}]`,XVe=0,Go="\\.",QVe="\\+",eqe="\\?",LI="\\/",tqe="(?=.)",sde="[^/]",Cz=`(?:${LI}|$)`,ode=`(?:^|${LI})`,Pz=`${Go}{1,2}${Cz}`,rqe=`(?!${Go})`,nqe=`(?!${ode}${Pz})`,iqe=`(?!${Go}{0,1}${Cz})`,sqe=`(?!${Pz})`,oqe=`[^.${LI}]`,aqe=`${sde}*?`,ade={DOT_LITERAL:Go,PLUS_LITERAL:QVe,QMARK_LITERAL:eqe,SLASH_LITERAL:LI,ONE_CHAR:tqe,QMARK:sde,END_ANCHOR:Cz,DOTS_SLASH:Pz,NO_DOT:rqe,NO_DOTS:nqe,NO_DOT_SLASH:iqe,NO_DOTS_SLASH:sqe,QMARK_NO_DOT:oqe,STAR:aqe,START_ANCHOR:ode},cqe={...ade,SLASH_LITERAL:`[${Is}]`,QMARK:ide,STAR:`${ide}*?`,DOTS_SLASH:`${Go}{1,2}(?:[${Is}]|$)`,NO_DOT:`(?!${Go})`,NO_DOTS:`(?!(?:^|[${Is}])${Go}{1,2}(?:[${Is}]|$))`,NO_DOT_SLASH:`(?!${Go}{0,1}(?:[${Is}]|$))`,NO_DOTS_SLASH:`(?!${Go}{1,2}(?:[${Is}]|$))`,QMARK_NO_DOT:`[^.${Is}]`,START_ANCHOR:`(?:^|[${Is}])`,END_ANCHOR:`(?:[${Is}]|$)`},lqe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};cde.exports={DEFAULT_MAX_EXTGLOB_RECURSION:XVe,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:lqe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:JVe.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?cqe:ade}}});var mS=b(rn=>{"use strict";var uqe=J("path"),dqe=process.platform==="win32",{REGEX_BACKSLASH:fqe,REGEX_REMOVE_BACKSLASH:pqe,REGEX_SPECIAL_CHARS:hqe,REGEX_SPECIAL_CHARS_GLOBAL:mqe}=hS();rn.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);rn.hasRegexChars=t=>hqe.test(t);rn.isRegexChar=t=>t.length===1&&rn.hasRegexChars(t);rn.escapeRegex=t=>t.replace(mqe,"\\$1");rn.toPosixSlashes=t=>t.replace(fqe,"/");rn.removeBackslashes=t=>t.replace(pqe,e=>e==="\\"?"":e);rn.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};rn.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:dqe===!0||uqe.sep==="\\";rn.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?rn.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};rn.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};rn.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${t})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var gde=b((jBt,mde)=>{"use strict";var lde=mS(),{CHAR_ASTERISK:Oz,CHAR_AT:gqe,CHAR_BACKWARD_SLASH:gS,CHAR_COMMA:_qe,CHAR_DOT:Nz,CHAR_EXCLAMATION_MARK:kz,CHAR_FORWARD_SLASH:hde,CHAR_LEFT_CURLY_BRACE:Mz,CHAR_LEFT_PARENTHESES:Dz,CHAR_LEFT_SQUARE_BRACKET:yqe,CHAR_PLUS:Sqe,CHAR_QUESTION_MARK:ude,CHAR_RIGHT_CURLY_BRACE:Eqe,CHAR_RIGHT_PARENTHESES:dde,CHAR_RIGHT_SQUARE_BRACKET:vqe}=hS(),fde=t=>t===hde||t===gS,pde=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},bqe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,h=!1,m=!1,E=!1,T=!1,v=!1,A=!1,S=!1,R=!1,P=0,L,I,O={value:"",depth:0,isGlob:!1},j=()=>l>=n,_=()=>c.charCodeAt(l+1),se=()=>(L=I,c.charCodeAt(++l));for(;l<n;){I=se();let X;if(I===gS){v=O.backslashes=!0,I=se(),I===Mz&&(T=!0);continue}if(T===!0||I===Mz){for(P++;j()!==!0&&(I=se());){if(I===gS){v=O.backslashes=!0,se();continue}if(I===Mz){P++;continue}if(T!==!0&&I===Nz&&(I=se())===Nz){if(f=O.isBrace=!0,h=O.isGlob=!0,R=!0,i===!0)continue;break}if(T!==!0&&I===_qe){if(f=O.isBrace=!0,h=O.isGlob=!0,R=!0,i===!0)continue;break}if(I===Eqe&&(P--,P===0)){T=!1,f=O.isBrace=!0,R=!0;break}}if(i===!0)continue;break}if(I===hde){if(s.push(l),o.push(O),O={value:"",depth:0,isGlob:!1},R===!0)continue;if(L===Nz&&l===u+1){u+=2;continue}d=l+1;continue}if(r.noext!==!0&&(I===Sqe||I===gqe||I===Oz||I===ude||I===kz)===!0&&_()===Dz){if(h=O.isGlob=!0,m=O.isExtglob=!0,R=!0,I===kz&&l===u&&(S=!0),i===!0){for(;j()!==!0&&(I=se());){if(I===gS){v=O.backslashes=!0,I=se();continue}if(I===dde){h=O.isGlob=!0,R=!0;break}}continue}break}if(I===Oz){if(L===Oz&&(E=O.isGlobstar=!0),h=O.isGlob=!0,R=!0,i===!0)continue;break}if(I===ude){if(h=O.isGlob=!0,R=!0,i===!0)continue;break}if(I===yqe){for(;j()!==!0&&(X=se());){if(X===gS){v=O.backslashes=!0,se();continue}if(X===vqe){p=O.isBracket=!0,h=O.isGlob=!0,R=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&I===kz&&l===u){A=O.negated=!0,u++;continue}if(r.noparen!==!0&&I===Dz){if(h=O.isGlob=!0,i===!0){for(;j()!==!0&&(I=se());){if(I===Dz){v=O.backslashes=!0,I=se();continue}if(I===dde){R=!0;break}}continue}break}if(h===!0){if(R=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,h=!1);let C=c,g="",y="";u>0&&(g=c.slice(0,u),c=c.slice(u),d-=u),C&&h===!0&&d>0?(C=c.slice(0,d),y=c.slice(d)):h===!0?(C="",y=c):C=c,C&&C!==""&&C!=="/"&&C!==c&&fde(C.charCodeAt(C.length-1))&&(C=C.slice(0,-1)),r.unescape===!0&&(y&&(y=lde.removeBackslashes(y)),C&&v===!0&&(C=lde.removeBackslashes(C)));let w={prefix:g,input:t,start:u,base:C,glob:y,isBrace:f,isBracket:p,isGlob:h,isExtglob:m,isGlobstar:E,negated:A,negatedExtglob:S};if(r.tokens===!0&&(w.maxDepth=0,fde(I)||o.push(O),w.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let q=0;q<s.length;q++){let ae=X?X+1:u,Re=s[q],xe=t.slice(ae,Re);r.tokens&&(q===0&&u!==0?(o[q].isPrefix=!0,o[q].value=g):o[q].value=xe,pde(o[q]),w.maxDepth+=o[q].depth),(q!==0||xe!=="")&&a.push(xe),X=Re}if(X&&X+1<t.length){let q=t.slice(X+1);a.push(q),r.tokens&&(o[o.length-1].value=q,pde(o[o.length-1]),w.maxDepth+=o[o.length-1].depth)}w.slashes=s,w.parts=a}return w};mde.exports=bqe});var vde=b((zBt,Ede)=>{"use strict";var _S=hS(),Er=mS(),{MAX_LENGTH:$I,POSIX_REGEX_SOURCE:Tqe,REGEX_NON_SPECIAL_CHARS:Aqe,REGEX_SPECIAL_CHARS_BACKREF:xqe,REPLACEMENTS:_de}=_S,wqe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Er.escapeRegex(i)).join("..")}return r},Nh=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,yde=t=>{let e=[],r=0,n=0,i=0,s="",o=!1;for(let a of t){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},Rqe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Sde=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Rqe(e))return e.replace(/\\(.)/g,"$1")},Iqe=t=>{let e=t.map(Sde).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let i=e[r],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},Lz=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,s=!1;for(let o=1;o<t.length;o++){let a=t[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},Cqe=t=>{let e=0,r=[];for(;e<t.length;){let i=Lz(t.slice(e),!1);if(!i||i.type!=="*")return;let s=yde(i.body).map(a=>a.trim());if(s.length!==1)return;let o=Sde(s[0]);if(!o||o.length!==1)return;r.push(o),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Er.escapeRegex(r[0]):`[${r.map(i=>Er.escapeRegex(i)).join("")}]`}*`},Pqe=t=>{let e=0,r=t.trim(),n=Lz(r);for(;n;)e++,r=n.body.trim(),n=Lz(r);return e},Oqe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_S.DEFAULT_MAX_EXTGLOB_RECURSION,n=yde(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||Iqe(n)))return{risky:!0};for(let i of n){let s=Cqe(i);if(s)return{risky:!0,safeOutput:s};if(Pqe(i)>r)return{risky:!0}}return{risky:!1}},$z=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=_de[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min($I,r.maxLength):$I,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",c=Er.isWindows(e),l=_S.globChars(c),u=_S.extglobChars(l),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:E,NO_DOT_SLASH:T,NO_DOTS_SLASH:v,QMARK:A,QMARK_NO_DOT:S,STAR:R,START_ANCHOR:P}=l,L=z=>`(${a}(?:(?!${P}${z.dot?m:d}).)*?)`,I=r.dot?"":E,O=r.dot?A:S,j=r.bash===!0?L(r):R;r.capture&&(j=`(${j})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Er.removePrefix(t,_),i=t.length;let se=[],C=[],g=[],y=s,w,X=()=>_.index===i-1,q=_.peek=(z=1)=>t[_.index+z],ae=_.advance=()=>t[++_.index]||"",Re=()=>t.slice(_.index+1),xe=(z="",Ee=0)=>{_.consumed+=z,_.index+=Ee},$e=z=>{_.output+=z.output!=null?z.output:z.value,xe(z.value)},oe=()=>{let z=1;for(;q()==="!"&&(q(2)!=="("||q(3)==="?");)ae(),_.start++,z++;return z%2===0?!1:(_.negated=!0,_.start++,!0)},le=z=>{_[z]++,g.push(z)},Ae=z=>{_[z]--,g.pop()},_e=z=>{if(y.type==="globstar"){let Ee=_.braces>0&&(z.type==="comma"||z.type==="brace"),W=z.extglob===!0||se.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!Ee&&!W&&(_.output=_.output.slice(0,-y.output.length),y.type="star",y.value="*",y.output=j,_.output+=y.output)}if(se.length&&z.type!=="paren"&&(se[se.length-1].inner+=z.value),(z.value||z.output)&&$e(z),y&&y.type==="text"&&z.type==="text"){y.value+=z.value,y.output=(y.output||"")+z.value;return}z.prev=y,o.push(z),y=z},Ie=(z,Ee)=>{let W={...u[Ee],conditions:1,inner:""};W.prev=y,W.parens=_.parens,W.output=_.output,W.startIndex=_.index,W.tokensIndex=o.length;let k=(r.capture?"(":"")+W.open;le("parens"),_e({type:z,value:Ee,output:_.output?"":h}),_e({type:"paren",extglob:!0,value:ae(),output:k}),se.push(W)},De=z=>{let Ee=t.slice(z.startIndex,_.index+1),W=t.slice(z.startIndex+2,_.index),k=Oqe(W,r);if((z.type==="plus"||z.type==="star")&&k.risky){let F=k.safeOutput?(z.output?"":h)+(r.capture?`(${k.safeOutput})`:k.safeOutput):void 0,V=o[z.tokensIndex];V.type="text",V.value=Ee,V.output=F||Er.escapeRegex(Ee);for(let K=z.tokensIndex+1;K<o.length;K++)o[K].value="",o[K].output="",delete o[K].suffix;_.output=z.output+V.output,_.backtrack=!0,_e({type:"paren",extglob:!0,value:w,output:""}),Ae("parens");return}let $=z.close+(r.capture?")":""),U;if(z.type==="negate"){let F=j;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(F=L(r)),(F!==j||X()||/^\)+$/.test(Re()))&&($=z.close=`)$))${F}`),z.inner.includes("*")&&(U=Re())&&/^\.[^\\/.]+$/.test(U)){let V=$z(U,{...e,fastpaths:!1}).output;$=z.close=`)${V})${F})`}z.prev.type==="bos"&&(_.negatedExtglob=!0)}_e({type:"paren",extglob:!0,value:w,output:$}),Ae("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,Ee=t.replace(xqe,(W,k,$,U,F,V)=>U==="\\"?(z=!0,W):U==="?"?k?k+U+(F?A.repeat(F.length):""):V===0?O+(F?A.repeat(F.length):""):A.repeat($.length):U==="."?d.repeat($.length):U==="*"?k?k+U+(F?j:""):j:k?W:`\\${W}`);return z===!0&&(r.unescape===!0?Ee=Ee.replace(/\\/g,""):Ee=Ee.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),Ee===t&&r.contains===!0?(_.output=t,_):(_.output=Er.wrapOutput(Ee,_,e),_)}for(;!X();){if(w=ae(),w==="\0")continue;if(w==="\\"){let W=q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){w+="\\",_e({type:"text",value:w});continue}let k=/^\\+/.exec(Re()),$=0;if(k&&k[0].length>2&&($=k[0].length,_.index+=$,$%2!==0&&(w+="\\")),r.unescape===!0?w=ae():w+=ae(),_.brackets===0){_e({type:"text",value:w});continue}}if(_.brackets>0&&(w!=="]"||y.value==="["||y.value==="[^")){if(r.posix!==!1&&w===":"){let W=y.value.slice(1);if(W.includes("[")&&(y.posix=!0,W.includes(":"))){let k=y.value.lastIndexOf("["),$=y.value.slice(0,k),U=y.value.slice(k+2),F=Tqe[U];if(F){y.value=$+F,_.backtrack=!0,ae(),!s.output&&o.indexOf(y)===1&&(s.output=h);continue}}}(w==="["&&q()!==":"||w==="-"&&q()==="]")&&(w=`\\${w}`),w==="]"&&(y.value==="["||y.value==="[^")&&(w=`\\${w}`),r.posix===!0&&w==="!"&&y.value==="["&&(w="^"),y.value+=w,$e({value:w});continue}if(_.quotes===1&&w!=='"'){w=Er.escapeRegex(w),y.value+=w,$e({value:w});continue}if(w==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&_e({type:"text",value:w});continue}if(w==="("){le("parens"),_e({type:"paren",value:w});continue}if(w===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Nh("opening","("));let W=se[se.length-1];if(W&&_.parens===W.parens+1){De(se.pop());continue}_e({type:"paren",value:w,output:_.parens?")":"\\)"}),Ae("parens");continue}if(w==="["){if(r.nobracket===!0||!Re().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Nh("closing","]"));w=`\\${w}`}else le("brackets");_e({type:"bracket",value:w});continue}if(w==="]"){if(r.nobracket===!0||y&&y.type==="bracket"&&y.value.length===1){_e({type:"text",value:w,output:`\\${w}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Nh("opening","["));_e({type:"text",value:w,output:`\\${w}`});continue}Ae("brackets");let W=y.value.slice(1);if(y.posix!==!0&&W[0]==="^"&&!W.includes("/")&&(w=`/${w}`),y.value+=w,$e({value:w}),r.literalBrackets===!1||Er.hasRegexChars(W))continue;let k=Er.escapeRegex(y.value);if(_.output=_.output.slice(0,-y.value.length),r.literalBrackets===!0){_.output+=k,y.value=k;continue}y.value=`(${a}${k}|${y.value})`,_.output+=y.value;continue}if(w==="{"&&r.nobrace!==!0){le("braces");let W={type:"brace",value:w,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};C.push(W),_e(W);continue}if(w==="}"){let W=C[C.length-1];if(r.nobrace===!0||!W){_e({type:"text",value:w,output:w});continue}let k=")";if(W.dots===!0){let $=o.slice(),U=[];for(let F=$.length-1;F>=0&&(o.pop(),$[F].type!=="brace");F--)$[F].type!=="dots"&&U.unshift($[F].value);k=wqe(U,r),_.backtrack=!0}if(W.comma!==!0&&W.dots!==!0){let $=_.output.slice(0,W.outputIndex),U=_.tokens.slice(W.tokensIndex);W.value=W.output="\\{",w=k="\\}",_.output=$;for(let F of U)_.output+=F.output||F.value}_e({type:"brace",value:w,output:k}),Ae("braces"),C.pop();continue}if(w==="|"){se.length>0&&se[se.length-1].conditions++,_e({type:"text",value:w});continue}if(w===","){let W=w,k=C[C.length-1];k&&g[g.length-1]==="braces"&&(k.comma=!0,W="|"),_e({type:"comma",value:w,output:W});continue}if(w==="/"){if(y.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",o.pop(),y=s;continue}_e({type:"slash",value:w,output:p});continue}if(w==="."){if(_.braces>0&&y.type==="dot"){y.value==="."&&(y.output=d);let W=C[C.length-1];y.type="dots",y.output+=w,y.value+=w,W.dots=!0;continue}if(_.braces+_.parens===0&&y.type!=="bos"&&y.type!=="slash"){_e({type:"text",value:w,output:d});continue}_e({type:"dot",value:w,output:d});continue}if(w==="?"){if(!(y&&y.value==="(")&&r.noextglob!==!0&&q()==="("&&q(2)!=="?"){Ie("qmark",w);continue}if(y&&y.type==="paren"){let k=q(),$=w;if(k==="<"&&!Er.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(y.value==="("&&!/[!=<:]/.test(k)||k==="<"&&!/<([!=]|\w+>)/.test(Re()))&&($=`\\${w}`),_e({type:"text",value:w,output:$});continue}if(r.dot!==!0&&(y.type==="slash"||y.type==="bos")){_e({type:"qmark",value:w,output:S});continue}_e({type:"qmark",value:w,output:A});continue}if(w==="!"){if(r.noextglob!==!0&&q()==="("&&(q(2)!=="?"||!/[!=<:]/.test(q(3)))){Ie("negate",w);continue}if(r.nonegate!==!0&&_.index===0){oe();continue}}if(w==="+"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){Ie("plus",w);continue}if(y&&y.value==="("||r.regex===!1){_e({type:"plus",value:w,output:f});continue}if(y&&(y.type==="bracket"||y.type==="paren"||y.type==="brace")||_.parens>0){_e({type:"plus",value:w});continue}_e({type:"plus",value:f});continue}if(w==="@"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){_e({type:"at",extglob:!0,value:w,output:""});continue}_e({type:"text",value:w});continue}if(w!=="*"){(w==="$"||w==="^")&&(w=`\\${w}`);let W=Aqe.exec(Re());W&&(w+=W[0],_.index+=W[0].length),_e({type:"text",value:w});continue}if(y&&(y.type==="globstar"||y.star===!0)){y.type="star",y.star=!0,y.value+=w,y.output=j,_.backtrack=!0,_.globstar=!0,xe(w);continue}let z=Re();if(r.noextglob!==!0&&/^\([^?]/.test(z)){Ie("star",w);continue}if(y.type==="star"){if(r.noglobstar===!0){xe(w);continue}let W=y.prev,k=W.prev,$=W.type==="slash"||W.type==="bos",U=k&&(k.type==="star"||k.type==="globstar");if(r.bash===!0&&(!$||z[0]&&z[0]!=="/")){_e({type:"star",value:w,output:""});continue}let F=_.braces>0&&(W.type==="comma"||W.type==="brace"),V=se.length&&(W.type==="pipe"||W.type==="paren");if(!$&&W.type!=="paren"&&!F&&!V){_e({type:"star",value:w,output:""});continue}for(;z.slice(0,3)==="/**";){let K=t[_.index+4];if(K&&K!=="/")break;z=z.slice(3),xe("/**",3)}if(W.type==="bos"&&X()){y.type="globstar",y.value+=w,y.output=L(r),_.output=y.output,_.globstar=!0,xe(w);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!U&&X()){_.output=_.output.slice(0,-(W.output+y.output).length),W.output=`(?:${W.output}`,y.type="globstar",y.output=L(r)+(r.strictSlashes?")":"|$)"),y.value+=w,_.globstar=!0,_.output+=W.output+y.output,xe(w);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&z[0]==="/"){let K=z[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(W.output+y.output).length),W.output=`(?:${W.output}`,y.type="globstar",y.output=`${L(r)}${p}|${p}${K})`,y.value+=w,_.output+=W.output+y.output,_.globstar=!0,xe(w+ae()),_e({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&z[0]==="/"){y.type="globstar",y.value+=w,y.output=`(?:^|${p}|${L(r)}${p})`,_.output=y.output,_.globstar=!0,xe(w+ae()),_e({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-y.output.length),y.type="globstar",y.output=L(r),y.value+=w,_.output+=y.output,_.globstar=!0,xe(w);continue}let Ee={type:"star",value:w,output:j};if(r.bash===!0){Ee.output=".*?",(y.type==="bos"||y.type==="slash")&&(Ee.output=I+Ee.output),_e(Ee);continue}if(y&&(y.type==="bracket"||y.type==="paren")&&r.regex===!0){Ee.output=w,_e(Ee);continue}(_.index===_.start||y.type==="slash"||y.type==="dot")&&(y.type==="dot"?(_.output+=T,y.output+=T):r.dot===!0?(_.output+=v,y.output+=v):(_.output+=I,y.output+=I),q()!=="*"&&(_.output+=h,y.output+=h)),_e(Ee)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nh("closing","]"));_.output=Er.escapeLast(_.output,"["),Ae("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nh("closing",")"));_.output=Er.escapeLast(_.output,"("),Ae("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nh("closing","}"));_.output=Er.escapeLast(_.output,"{"),Ae("braces")}if(r.strictSlashes!==!0&&(y.type==="star"||y.type==="bracket")&&_e({type:"maybe_slash",value:"",output:`${p}?`}),_.backtrack===!0){_.output="";for(let z of _.tokens)_.output+=z.output!=null?z.output:z.value,z.suffix&&(_.output+=z.suffix)}return _};$z.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min($I,r.maxLength):$I,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=_de[t]||t;let s=Er.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:h}=_S.globChars(s),m=r.dot?d:u,E=r.dot?f:u,T=r.capture?"":"?:",v={negated:!1,prefix:""},A=r.bash===!0?".*?":p;r.capture&&(A=`(${A})`);let S=I=>I.noglobstar===!0?A:`(${T}(?:(?!${h}${I.dot?l:o}).)*?)`,R=I=>{switch(I){case"*":return`${m}${c}${A}`;case".*":return`${o}${c}${A}`;case"*.*":return`${m}${A}${o}${c}${A}`;case"*/*":return`${m}${A}${a}${c}${E}${A}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${a})?${E}${c}${A}`;case"**/*.*":return`(?:${m}${S(r)}${a})?${E}${A}${o}${c}${A}`;case"**/.*":return`(?:${m}${S(r)}${a})?${o}${c}${A}`;default:{let O=/^(.*?)\.(\w+)$/.exec(I);if(!O)return;let j=R(O[1]);return j?j+o+O[2]:void 0}}},P=Er.removePrefix(t,v),L=R(P);return L&&r.strictSlashes!==!0&&(L+=`${a}?`),L};Ede.exports=$z});var Tde=b((GBt,bde)=>{"use strict";var Nqe=J("path"),kqe=gde(),Uz=vde(),Fz=mS(),Mqe=hS(),Dqe=t=>t&&typeof t=="object"&&!Array.isArray(t),kt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>kt(f,e,r));return f=>{for(let p of u){let h=p(f);if(h)return h}return!1}}let n=Dqe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Fz.isWindows(e),o=n?kt.compileRe(t,e):kt.makeRe(t,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=kt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:h}=kt.test(u,o,e,{glob:t,posix:s}),m={glob:t,state:a,regex:o,posix:s,input:u,output:h,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(m),f===!1?(m.isMatch=!1,d?m:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,d?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),d?m:!0)};return r&&(l.state=a),l};kt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?Fz.toPosixSlashes:null),a=t===n,c=a&&o?o(t):t;return a===!1&&(c=o?o(t):t,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=kt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};kt.matchBase=(t,e,r,n=Fz.isWindows(r))=>(e instanceof RegExp?e:kt.makeRe(e,r)).test(Nqe.basename(t));kt.isMatch=(t,e,r)=>kt(e,r)(t);kt.parse=(t,e)=>Array.isArray(t)?t.map(r=>kt.parse(r,e)):Uz(t,{...e,fastpaths:!1});kt.scan=(t,e)=>kqe(t,e);kt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=kt.toRegex(a,e);return n===!0&&(c.state=t),c};kt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=Uz.fastpaths(t,e)),i.output||(i=Uz(t,e)),kt.compileRe(i,e,r,n)};kt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};kt.constants=Mqe;bde.exports=kt});var xde=b((VBt,Ade)=>{"use strict";Ade.exports=Tde()});var jz=b((qBt,Pde)=>{"use strict";var Rde=J("util"),Ide=nde(),Cs=xde(),Bz=mS(),wde=t=>t===""||t==="./",Cde=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},_t=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,s=new Set,o=0,a=u=>{s.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<e.length;u++){let d=Cs(String(e[u]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&o++;for(let p of t){let h=d(p,!0);(f?!h.isMatch:h.isMatch)&&(f?n.add(h.output):(n.delete(h.output),i.add(h.output)))}}let l=(o===e.length?[...s]:[...i]).filter(u=>!n.has(u));if(r&&l.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(u=>u.replace(/\\/g,"")):e}return l};_t.match=_t;_t.matcher=(t,e)=>Cs(t,e);_t.isMatch=(t,e,r)=>Cs(e,r)(t);_t.any=_t.isMatch;_t.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(_t(t,e,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};_t.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rde.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>_t.contains(t,n,r));if(typeof e=="string"){if(wde(t)||wde(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return _t.isMatch(t,e,{...r,contains:!0})};_t.matchKeys=(t,e,r)=>{if(!Bz.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=_t(Object.keys(t),e,r),i={};for(let s of n)i[s]=t[s];return i};_t.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=Cs(String(i),r);if(n.some(o=>s(o)))return!0}return!1};_t.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=Cs(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};_t.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rde.inspect(t)}"`);return[].concat(e).every(n=>Cs(n,r)(t))};_t.capture=(t,e,r)=>{let n=Bz.isWindows(r),s=Cs.makeRe(String(t),{...r,capture:!0}).exec(n?Bz.toPosixSlashes(e):e);if(s)return s.slice(1).map(o=>o===void 0?"":o)};_t.makeRe=(...t)=>Cs.makeRe(...t);_t.scan=(...t)=>Cs.scan(...t);_t.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of Ide(String(n),e))r.push(Cs.parse(i,e));return r};_t.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Cde(t)?[t]:Ide(t,e)};_t.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return _t.braces(t,{...e,expand:!0})};_t.hasBraces=Cde;Pde.exports=_t});var Bde=b(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.isAbsolute=Ce.partitionAbsoluteAndRelative=Ce.removeDuplicateSlashes=Ce.matchAny=Ce.convertPatternsToRe=Ce.makeRe=Ce.getPatternParts=Ce.expandBraceExpansion=Ce.expandPatternsWithBraceExpansion=Ce.isAffectDepthOfReadingPattern=Ce.endsWithSlashGlobStar=Ce.hasGlobStar=Ce.getBaseDirectory=Ce.isPatternRelatedToParentDirectory=Ce.getPatternsOutsideCurrentDirectory=Ce.getPatternsInsideCurrentDirectory=Ce.getPositivePatterns=Ce.getNegativePatterns=Ce.isPositivePattern=Ce.isNegativePattern=Ce.convertToNegativePattern=Ce.convertToPositivePattern=Ce.isDynamicPattern=Ce.isStaticPattern=void 0;var Ode=J("path"),Lqe=vue(),zz=jz(),Nde="**",$qe="\\",Uqe=/[*?]|^!/,Fqe=/\[[^[]*]/,Bqe=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,jqe=/[!*+?@]\([^(]*\)/,zqe=/,|\.\./,Gqe=/(?!^)\/{2,}/g;function kde(t,e={}){return!Mde(t,e)}Ce.isStaticPattern=kde;function Mde(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes($qe)||Uqe.test(t)||Fqe.test(t)||Bqe.test(t)||e.extglob!==!1&&jqe.test(t)||e.braceExpansion!==!1&&Vqe(t))}Ce.isDynamicPattern=Mde;function Vqe(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return zqe.test(n)}function qqe(t){return UI(t)?t.slice(1):t}Ce.convertToPositivePattern=qqe;function Hqe(t){return"!"+t}Ce.convertToNegativePattern=Hqe;function UI(t){return t.startsWith("!")&&t[1]!=="("}Ce.isNegativePattern=UI;function Dde(t){return!UI(t)}Ce.isPositivePattern=Dde;function Wqe(t){return t.filter(UI)}Ce.getNegativePatterns=Wqe;function Yqe(t){return t.filter(Dde)}Ce.getPositivePatterns=Yqe;function Kqe(t){return t.filter(e=>!Gz(e))}Ce.getPatternsInsideCurrentDirectory=Kqe;function Zqe(t){return t.filter(Gz)}Ce.getPatternsOutsideCurrentDirectory=Zqe;function Gz(t){return t.startsWith("..")||t.startsWith("./..")}Ce.isPatternRelatedToParentDirectory=Gz;function Jqe(t){return Lqe(t,{flipBackslashes:!1})}Ce.getBaseDirectory=Jqe;function Xqe(t){return t.includes(Nde)}Ce.hasGlobStar=Xqe;function Lde(t){return t.endsWith("/"+Nde)}Ce.endsWithSlashGlobStar=Lde;function Qqe(t){let e=Ode.basename(t);return Lde(t)||kde(e)}Ce.isAffectDepthOfReadingPattern=Qqe;function eHe(t){return t.reduce((e,r)=>e.concat($de(r)),[])}Ce.expandPatternsWithBraceExpansion=eHe;function $de(t){let e=zz.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}Ce.expandBraceExpansion=$de;function tHe(t,e){let{parts:r}=zz.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}Ce.getPatternParts=tHe;function Ude(t,e){return zz.makeRe(t,e)}Ce.makeRe=Ude;function rHe(t,e){return t.map(r=>Ude(r,e))}Ce.convertPatternsToRe=rHe;function nHe(t,e){return e.some(r=>r.test(t))}Ce.matchAny=nHe;function iHe(t){return t.replace(Gqe,"/")}Ce.removeDuplicateSlashes=iHe;function sHe(t){let e=[],r=[];for(let n of t)Fde(n)?e.push(n):r.push(n);return[e,r]}Ce.partitionAbsoluteAndRelative=sHe;function Fde(t){return Ode.isAbsolute(t)}Ce.isAbsolute=Fde});var Vde=b((WBt,Gde)=>{"use strict";var oHe=J("stream"),jde=oHe.PassThrough,aHe=Array.prototype.slice;Gde.exports=cHe;function cHe(){let t=[],e=aHe.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,s=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=jde(n);function a(){for(let u=0,d=arguments.length;u<d;u++)t.push(zde(arguments[u],n));return c(),this}function c(){if(r)return;r=!0;let u=t.shift();if(!u){process.nextTick(l);return}Array.isArray(u)||(u=[u]);let d=u.length+1;function f(){--d>0||(r=!1,c())}function p(h){function m(){h.removeListener("merge2UnpipeEnd",m),h.removeListener("end",m),s&&h.removeListener("error",E),f()}function E(T){o.emit("error",T)}if(h._readableState.endEmitted)return f();h.on("merge2UnpipeEnd",m),h.on("end",m),s&&h.on("error",E),h.pipe(o,{end:!1}),h.resume()}for(let h=0;h<u.length;h++)p(u[h]);f()}function l(){r=!1,o.emit("queueDrain"),i&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function zde(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=zde(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(jde(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var Hde=b(FI=>{"use strict";Object.defineProperty(FI,"__esModule",{value:!0});FI.merge=void 0;var lHe=Vde();function uHe(t){let e=lHe(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>qde(t)),e.once("end",()=>qde(t)),e}FI.merge=uHe;function qde(t){t.forEach(e=>e.emit("close"))}});var Wde=b(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.isEmpty=kh.isString=void 0;function dHe(t){return typeof t=="string"}kh.isString=dHe;function fHe(t){return t===""}kh.isEmpty=fHe});var Vo=b(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.string=vr.stream=vr.pattern=vr.path=vr.fs=vr.errno=vr.array=void 0;var pHe=cue();vr.array=pHe;var hHe=lue();vr.errno=hHe;var mHe=uue();vr.fs=mHe;var gHe=hue();vr.path=gHe;var _He=Bde();vr.pattern=_He;var yHe=Hde();vr.stream=yHe;var SHe=Wde();vr.string=SHe});var Jde=b(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.convertPatternGroupToTask=br.convertPatternGroupsToTasks=br.groupPatternsByBaseDirectory=br.getNegativePatternsAsPositive=br.getPositivePatterns=br.convertPatternsToTasks=br.generate=void 0;var Mi=Vo();function EHe(t,e){let r=Yde(t,e),n=Yde(e.ignore,e),i=Kde(r),s=Zde(r,n),o=i.filter(u=>Mi.pattern.isStaticPattern(u,e)),a=i.filter(u=>Mi.pattern.isDynamicPattern(u,e)),c=Vz(o,s,!1),l=Vz(a,s,!0);return c.concat(l)}br.generate=EHe;function Yde(t,e){let r=t;return e.braceExpansion&&(r=Mi.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Mi.pattern.removeDuplicateSlashes(n))}function Vz(t,e,r){let n=[],i=Mi.pattern.getPatternsOutsideCurrentDirectory(t),s=Mi.pattern.getPatternsInsideCurrentDirectory(t),o=qz(i),a=qz(s);return n.push(...Hz(o,e,r)),"."in a?n.push(Wz(".",s,e,r)):n.push(...Hz(a,e,r)),n}br.convertPatternsToTasks=Vz;function Kde(t){return Mi.pattern.getPositivePatterns(t)}br.getPositivePatterns=Kde;function Zde(t,e){return Mi.pattern.getNegativePatterns(t).concat(e).map(Mi.pattern.convertToPositivePattern)}br.getNegativePatternsAsPositive=Zde;function qz(t){let e={};return t.reduce((r,n)=>{let i=Mi.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}br.groupPatternsByBaseDirectory=qz;function Hz(t,e,r){return Object.keys(t).map(n=>Wz(n,t[n],e,r))}br.convertPatternGroupsToTasks=Hz;function Wz(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Mi.pattern.convertToNegativePattern))}}br.convertPatternGroupToTask=Wz});var Qde=b(BI=>{"use strict";Object.defineProperty(BI,"__esModule",{value:!0});BI.read=void 0;function vHe(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){Xde(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){Yz(r,i);return}e.fs.stat(t,(s,o)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){Xde(r,s);return}Yz(r,i);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),Yz(r,o)})})}BI.read=vHe;function Xde(t,e){t(e)}function Yz(t,e){t(null,e)}});var efe=b(jI=>{"use strict";Object.defineProperty(jI,"__esModule",{value:!0});jI.read=void 0;function bHe(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}jI.read=bHe});var tfe=b(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.createFileSystemAdapter=Ec.FILE_SYSTEM_ADAPTER=void 0;var zI=J("fs");Ec.FILE_SYSTEM_ADAPTER={lstat:zI.lstat,stat:zI.stat,lstatSync:zI.lstatSync,statSync:zI.statSync};function THe(t){return t===void 0?Ec.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ec.FILE_SYSTEM_ADAPTER),t)}Ec.createFileSystemAdapter=THe});var rfe=b(Zz=>{"use strict";Object.defineProperty(Zz,"__esModule",{value:!0});var AHe=tfe(),Kz=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=AHe.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};Zz.default=Kz});var xu=b(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.statSync=vc.stat=vc.Settings=void 0;var nfe=Qde(),xHe=efe(),Jz=rfe();vc.Settings=Jz.default;function wHe(t,e,r){if(typeof e=="function"){nfe.read(t,Xz(),e);return}nfe.read(t,Xz(e),r)}vc.stat=wHe;function RHe(t,e){let r=Xz(e);return xHe.read(t,r)}vc.statSync=RHe;function Xz(t={}){return t instanceof Jz.default?t:new Jz.default(t)}});var ofe=b((njt,sfe)=>{"use strict";var ife;sfe.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(ife||(ife=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var cfe=b((ijt,afe)=>{"use strict";afe.exports=CHe;var IHe=ofe();function CHe(t,e){let r,n,i,s=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function o(c){function l(){e&&e(c,r),e=null}s?IHe(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&o(l)}n?i?i.forEach(function(c){t[c](function(l,u){a(c,l,u)})}):t.forEach(function(c,l){c(function(u,d){a(l,u,d)})}):o(null),s=!1}});var Qz=b(VI=>{"use strict";Object.defineProperty(VI,"__esModule",{value:!0});VI.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var GI=process.versions.node.split(".");if(GI[0]===void 0||GI[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var lfe=Number.parseInt(GI[0],10),PHe=Number.parseInt(GI[1],10),ufe=10,OHe=10,NHe=lfe>ufe,kHe=lfe===ufe&&PHe>=OHe;VI.IS_SUPPORT_READDIR_WITH_FILE_TYPES=NHe||kHe});var dfe=b(qI=>{"use strict";Object.defineProperty(qI,"__esModule",{value:!0});qI.createDirentFromStats=void 0;var eG=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function MHe(t,e){return new eG(t,e)}qI.createDirentFromStats=MHe});var tG=b(HI=>{"use strict";Object.defineProperty(HI,"__esModule",{value:!0});HI.fs=void 0;var DHe=dfe();HI.fs=DHe});var rG=b(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.joinPathSegments=void 0;function LHe(t,e,r){return t.endsWith(r)?t+e:t+r+e}WI.joinPathSegments=LHe});var _fe=b(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.readdir=bc.readdirWithFileTypes=bc.read=void 0;var $He=xu(),ffe=cfe(),UHe=Qz(),pfe=tG(),hfe=rG();function FHe(t,e,r){if(!e.stats&&UHe.IS_SUPPORT_READDIR_WITH_FILE_TYPES){mfe(t,e,r);return}gfe(t,e,r)}bc.read=FHe;function mfe(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){YI(r,n);return}let s=i.map(a=>({dirent:a,name:a.name,path:hfe.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){nG(r,s);return}let o=s.map(a=>BHe(a,e));ffe(o,(a,c)=>{if(a!==null){YI(r,a);return}nG(r,c)})})}bc.readdirWithFileTypes=mfe;function BHe(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,i)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=pfe.fs.createDirentFromStats(t.name,i),r(null,t)})}}function gfe(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){YI(r,n);return}let s=i.map(o=>{let a=hfe.joinPathSegments(t,o,e.pathSegmentSeparator);return c=>{$He.stat(a,e.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let d={name:o,path:a,dirent:pfe.fs.createDirentFromStats(o,u)};e.stats&&(d.stats=u),c(null,d)})}});ffe(s,(o,a)=>{if(o!==null){YI(r,o);return}nG(r,a)})})}bc.readdir=gfe;function YI(t,e){t(e)}function nG(t,e){t(null,e)}});var bfe=b(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.readdir=Tc.readdirWithFileTypes=Tc.read=void 0;var jHe=xu(),zHe=Qz(),yfe=tG(),Sfe=rG();function GHe(t,e){return!e.stats&&zHe.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Efe(t,e):vfe(t,e)}Tc.read=GHe;function Efe(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:Sfe.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let s=e.fs.statSync(i.path);i.dirent=yfe.fs.createDirentFromStats(i.name,s)}catch(s){if(e.throwErrorOnBrokenSymbolicLink)throw s}return i})}Tc.readdirWithFileTypes=Efe;function vfe(t,e){return e.fs.readdirSync(t).map(n=>{let i=Sfe.joinPathSegments(t,n,e.pathSegmentSeparator),s=jHe.statSync(i,e.fsStatSettings),o={name:n,path:i,dirent:yfe.fs.createDirentFromStats(n,s)};return e.stats&&(o.stats=s),o})}Tc.readdir=vfe});var Tfe=b(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.createFileSystemAdapter=Ac.FILE_SYSTEM_ADAPTER=void 0;var Mh=J("fs");Ac.FILE_SYSTEM_ADAPTER={lstat:Mh.lstat,stat:Mh.stat,lstatSync:Mh.lstatSync,statSync:Mh.statSync,readdir:Mh.readdir,readdirSync:Mh.readdirSync};function VHe(t){return t===void 0?Ac.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ac.FILE_SYSTEM_ADAPTER),t)}Ac.createFileSystemAdapter=VHe});var Afe=b(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});var qHe=J("path"),HHe=xu(),WHe=Tfe(),iG=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=WHe.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,qHe.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new HHe.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};sG.default=iG});var KI=b(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.Settings=xc.scandirSync=xc.scandir=void 0;var xfe=_fe(),YHe=bfe(),oG=Afe();xc.Settings=oG.default;function KHe(t,e,r){if(typeof e=="function"){xfe.read(t,aG(),e);return}xfe.read(t,aG(e),r)}xc.scandir=KHe;function ZHe(t,e){let r=aG(e);return YHe.read(t,r)}xc.scandirSync=ZHe;function aG(t={}){return t instanceof oG.default?t:new oG.default(t)}});var Rfe=b((hjt,wfe)=>{"use strict";function JHe(t){var e=new t,r=e;function n(){var s=e;return s.next?e=s.next:(e=new t,r=e),s.next=null,s}function i(s){r.next=s,r=s}return{get:n,release:i}}wfe.exports=JHe});var Cfe=b((mjt,cG)=>{"use strict";var XHe=Rfe();function Ife(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=XHe(QHe),i=null,s=null,o=0,a=null,c={push:m,drain:nn,saturated:nn,pause:u,paused:!1,get concurrency(){return r},set concurrency(P){if(!(P>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=P,!c.paused)for(;i&&o<r;)o++,T()},running:l,resume:p,idle:h,length:d,getQueue:f,unshift:E,empty:nn,kill:v,killAndDrain:A,error:R,abort:S};return c;function l(){return o}function u(){c.paused=!0}function d(){for(var P=i,L=0;P;)P=P.next,L++;return L}function f(){for(var P=i,L=[];P;)L.push(P.value),P=P.next;return L}function p(){if(c.paused){if(c.paused=!1,i===null){o++,T();return}for(;i&&o<r;)o++,T()}}function h(){return o===0&&c.length()===0}function m(P,L){var I=n.get();I.context=t,I.release=T,I.value=P,I.callback=L||nn,I.errorHandler=a,o>=r||c.paused?s?(s.next=I,s=I):(i=I,s=I,c.saturated()):(o++,e.call(t,I.value,I.worked))}function E(P,L){var I=n.get();I.context=t,I.release=T,I.value=P,I.callback=L||nn,I.errorHandler=a,o>=r||c.paused?i?(I.next=i,i=I):(i=I,s=I,c.saturated()):(o++,e.call(t,I.value,I.worked))}function T(P){P&&n.release(P);var L=i;L&&o<=r?c.paused?o--:(s===i&&(s=null),i=L.next,L.next=null,e.call(t,L.value,L.worked),s===null&&c.empty()):--o===0&&c.drain()}function v(){i=null,s=null,c.drain=nn}function A(){i=null,s=null,c.drain(),c.drain=nn}function S(){var P=i;for(i=null,s=null;P;){var L=P.next,I=P.callback,O=P.errorHandler,j=P.value,_=P.context;P.value=null,P.callback=nn,P.errorHandler=null,O&&O(new Error("abort"),j),I.call(_,new Error("abort")),P.release(P),P=L}c.drain=nn}function R(P){a=P}}function nn(){}function QHe(){this.value=null,this.callback=nn,this.next=null,this.release=nn,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,s=t.errorHandler,o=t.value;t.value=null,t.callback=nn,t.errorHandler&&s(r,o),i.call(t.context,r,n),t.release(t)}}function e6e(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(u,d){e.call(this,u).then(function(f){d(null,f)},d)}var i=Ife(t,n,r),s=i.push,o=i.unshift;return i.push=a,i.unshift=c,i.drained=l,i;function a(u){var d=new Promise(function(f,p){s(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(nn),d}function c(u){var d=new Promise(function(f,p){o(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(nn),d}function l(){var u=new Promise(function(d){process.nextTick(function(){if(i.idle())d();else{var f=i.drain;i.drain=function(){typeof f=="function"&&f(),d(),i.drain=f}}})});return u}}cG.exports=Ife;cG.exports.promise=e6e});var ZI=b(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.joinPathSegments=Ps.replacePathSegmentSeparator=Ps.isAppliedFilter=Ps.isFatalError=void 0;function t6e(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Ps.isFatalError=t6e;function r6e(t,e){return t===null||t(e)}Ps.isAppliedFilter=r6e;function n6e(t,e){return t.split(/[/\\]/).join(e)}Ps.replacePathSegmentSeparator=n6e;function i6e(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Ps.joinPathSegments=i6e});var dG=b(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});var s6e=ZI(),lG=class{constructor(e,r){this._root=e,this._settings=r,this._root=s6e.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};uG.default=lG});var hG=b(pG=>{"use strict";Object.defineProperty(pG,"__esModule",{value:!0});var o6e=J("events"),a6e=KI(),c6e=Cfe(),JI=ZI(),l6e=dG(),fG=class extends l6e.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=a6e.scandir,this._emitter=new o6e.EventEmitter,this._queue=c6e(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,i=>{i!==null&&this._handleError(i)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,i)=>{if(n!==null){r(n,void 0);return}for(let s of i)this._handleEntry(s,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!JI.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=JI.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),JI.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&JI.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};pG.default=fG});var Pfe=b(gG=>{"use strict";Object.defineProperty(gG,"__esModule",{value:!0});var u6e=hG(),mG=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new u6e.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{d6e(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{f6e(e,this._storage)}),this._reader.read()}};gG.default=mG;function d6e(t,e){t(e)}function f6e(t,e){t(null,e)}});var Ofe=b(yG=>{"use strict";Object.defineProperty(yG,"__esModule",{value:!0});var p6e=J("stream"),h6e=hG(),_G=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new h6e.default(this._root,this._settings),this._stream=new p6e.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};yG.default=_G});var Nfe=b(EG=>{"use strict";Object.defineProperty(EG,"__esModule",{value:!0});var m6e=KI(),XI=ZI(),g6e=dG(),SG=class extends g6e.default{constructor(){super(...arguments),this._scandir=m6e.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let i of n)this._handleEntry(i,r)}catch(n){this._handleError(n)}}_handleError(e){if(XI.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=XI.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),XI.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&XI.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};EG.default=SG});var kfe=b(bG=>{"use strict";Object.defineProperty(bG,"__esModule",{value:!0});var _6e=Nfe(),vG=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new _6e.default(this._root,this._settings)}read(){return this._reader.read()}};bG.default=vG});var Mfe=b(AG=>{"use strict";Object.defineProperty(AG,"__esModule",{value:!0});var y6e=J("path"),S6e=KI(),TG=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,y6e.sep),this.fsScandirSettings=new S6e.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};AG.default=TG});var eC=b(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.Settings=Os.walkStream=Os.walkSync=Os.walk=void 0;var Dfe=Pfe(),E6e=Ofe(),v6e=kfe(),xG=Mfe();Os.Settings=xG.default;function b6e(t,e,r){if(typeof e=="function"){new Dfe.default(t,QI()).read(e);return}new Dfe.default(t,QI(e)).read(r)}Os.walk=b6e;function T6e(t,e){let r=QI(e);return new v6e.default(t,r).read()}Os.walkSync=T6e;function A6e(t,e){let r=QI(e);return new E6e.default(t,r).read()}Os.walkStream=A6e;function QI(t={}){return t instanceof xG.default?t:new xG.default(t)}});var tC=b(RG=>{"use strict";Object.defineProperty(RG,"__esModule",{value:!0});var x6e=J("path"),w6e=xu(),Lfe=Vo(),wG=class{constructor(e){this._settings=e,this._fsStatSettings=new w6e.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return x6e.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:Lfe.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!Lfe.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};RG.default=wG});var PG=b(CG=>{"use strict";Object.defineProperty(CG,"__esModule",{value:!0});var R6e=J("stream"),I6e=xu(),C6e=eC(),P6e=tC(),IG=class extends P6e.default{constructor(){super(...arguments),this._walkStream=C6e.walkStream,this._stat=I6e.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new R6e.PassThrough({objectMode:!0});i._write=(s,o,a)=>this._getEntry(n[s],e[s],r).then(c=>{c!==null&&r.entryFilter(c)&&i.push(c),s===n.length-1&&i.end(),a()}).catch(a);for(let s=0;s<n.length;s++)i.write(s);return i}_getEntry(e,r,n){return this._getStat(e).then(i=>this._makeEntry(i,r)).catch(i=>{if(n.errorFilter(i))return null;throw i})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(i,s)=>i===null?r(s):n(i))})}};CG.default=IG});var $fe=b(NG=>{"use strict";Object.defineProperty(NG,"__esModule",{value:!0});var O6e=eC(),N6e=tC(),k6e=PG(),OG=class extends N6e.default{constructor(){super(...arguments),this._walkAsync=O6e.walk,this._readerStream=new k6e.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(s,o)=>{s===null?n(o):i(s)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((s,o)=>{i.once("error",o),i.on("data",a=>n.push(a)),i.once("end",()=>s(n))})}};NG.default=OG});var Ufe=b(MG=>{"use strict";Object.defineProperty(MG,"__esModule",{value:!0});var yS=Vo(),kG=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return yS.pattern.getPatternParts(e,this._micromatchOptions).map(n=>yS.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:yS.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return yS.array.splitWhen(e,r=>r.dynamic&&yS.pattern.hasGlobStar(r.pattern))}};MG.default=kG});var Ffe=b(LG=>{"use strict";Object.defineProperty(LG,"__esModule",{value:!0});var M6e=Ufe(),DG=class extends M6e.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(s=>!s.complete||s.segments.length>n);for(let s of i){let o=s.sections[0];if(!s.complete&&n>o.length||r.every((c,l)=>{let u=s.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};LG.default=DG});var Bfe=b(UG=>{"use strict";Object.defineProperty(UG,"__esModule",{value:!0});var rC=Vo(),D6e=Ffe(),$G=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),s=this._getNegativePatternsRe(n);return o=>this._filter(e,o,i,s)}_getMatcher(e){return new D6e.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(rC.pattern.isAffectDepthOfReadingPattern);return rC.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let s=rC.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(s,n)?!1:this._isSkippedByNegativePatterns(s,i)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let i=e.split("/").length;return n-i}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!rC.pattern.matchAny(e,r)}};UG.default=$G});var jfe=b(BG=>{"use strict";Object.defineProperty(BG,"__esModule",{value:!0});var wc=Vo(),FG=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=wc.pattern.partitionAbsoluteAndRelative(r),s={positive:{all:wc.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:wc.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:wc.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,s)}_filter(e,r){let n=wc.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(n),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let i=wc.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=wc.pattern.matchAny(e,r);return!i&&n?wc.pattern.matchAny(e+"/",r):i}};BG.default=FG});var zfe=b(zG=>{"use strict";Object.defineProperty(zG,"__esModule",{value:!0});var L6e=Vo(),jG=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return L6e.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};zG.default=jG});var Vfe=b(VG=>{"use strict";Object.defineProperty(VG,"__esModule",{value:!0});var Gfe=Vo(),GG=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=Gfe.path.makeAbsolute(this._settings.cwd,r),r=Gfe.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};VG.default=GG});var nC=b(HG=>{"use strict";Object.defineProperty(HG,"__esModule",{value:!0});var $6e=J("path"),U6e=Bfe(),F6e=jfe(),B6e=zfe(),j6e=Vfe(),qG=class{constructor(e){this._settings=e,this.errorFilter=new B6e.default(this._settings),this.entryFilter=new F6e.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new U6e.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new j6e.default(this._settings)}_getRootDirectory(e){return $6e.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};HG.default=qG});var qfe=b(YG=>{"use strict";Object.defineProperty(YG,"__esModule",{value:!0});var z6e=$fe(),G6e=nC(),WG=class extends G6e.default{constructor(){super(...arguments),this._reader=new z6e.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(s=>n.transform(s))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};YG.default=WG});var Hfe=b(ZG=>{"use strict";Object.defineProperty(ZG,"__esModule",{value:!0});var V6e=J("stream"),q6e=PG(),H6e=nC(),KG=class extends H6e.default{constructor(){super(...arguments),this._reader=new q6e.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),s=new V6e.Readable({objectMode:!0,read:()=>{}});return i.once("error",o=>s.emit("error",o)).on("data",o=>s.emit("data",n.transform(o))).once("end",()=>s.emit("end")),s.once("close",()=>i.destroy()),s}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};ZG.default=KG});var Wfe=b(XG=>{"use strict";Object.defineProperty(XG,"__esModule",{value:!0});var W6e=xu(),Y6e=eC(),K6e=tC(),JG=class extends K6e.default{constructor(){super(...arguments),this._walkSync=Y6e.walkSync,this._statSync=W6e.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let s=this._getFullEntryPath(i),o=this._getEntry(s,i,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let i=this._getStat(e);return this._makeEntry(i,r)}catch(i){if(n.errorFilter(i))return null;throw i}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};XG.default=JG});var Yfe=b(e4=>{"use strict";Object.defineProperty(e4,"__esModule",{value:!0});var Z6e=Wfe(),J6e=nC(),QG=class extends J6e.default{constructor(){super(...arguments),this._reader=new Z6e.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};e4.default=QG});var Kfe=b(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var Dh=J("fs"),X6e=J("os"),Q6e=Math.max(X6e.cpus().length,1);Lh.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:Dh.lstat,lstatSync:Dh.lstatSync,stat:Dh.stat,statSync:Dh.statSync,readdir:Dh.readdir,readdirSync:Dh.readdirSync};var t4=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,Q6e),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},Lh.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};Lh.default=t4});var SS=b((Bjt,Jfe)=>{"use strict";var Zfe=Jde(),e3e=qfe(),t3e=Hfe(),r3e=Yfe(),r4=Kfe(),Xn=Vo();async function n4(t,e){Di(t);let r=i4(t,e3e.default,e),n=await Promise.all(r);return Xn.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(l,u){Di(l);let d=i4(l,r3e.default,u);return Xn.array.flatten(d)}t.sync=e;function r(l,u){Di(l);let d=i4(l,t3e.default,u);return Xn.stream.merge(d)}t.stream=r;function n(l,u){Di(l);let d=[].concat(l),f=new r4.default(u);return Zfe.generate(d,f)}t.generateTasks=n;function i(l,u){Di(l);let d=new r4.default(u);return Xn.pattern.isDynamicPattern(l,d)}t.isDynamicPattern=i;function s(l){return Di(l),Xn.path.escape(l)}t.escapePath=s;function o(l){return Di(l),Xn.path.convertPathToPattern(l)}t.convertPathToPattern=o;let a;(function(l){function u(f){return Di(f),Xn.path.escapePosixPath(f)}l.escapePath=u;function d(f){return Di(f),Xn.path.convertPosixPathToPattern(f)}l.convertPathToPattern=d})(a=t.posix||(t.posix={}));let c;(function(l){function u(f){return Di(f),Xn.path.escapeWindowsPath(f)}l.escapePath=u;function d(f){return Di(f),Xn.path.convertWindowsPathToPattern(f)}l.convertPathToPattern=d})(c=t.win32||(t.win32={}))})(n4||(n4={}));function i4(t,e,r){let n=[].concat(t),i=new r4.default(r),s=Zfe.generate(n,i),o=new e(i);return s.map(o.read,o)}function Di(t){if(![].concat(t).every(n=>Xn.string.isString(n)&&!Xn.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Jfe.exports=n4});var p4=b((Yjt,oC)=>{"use strict";function rpe(t){return Array.isArray(t)?t:[t]}var s3e=void 0,c4="",epe=" ",a4="\\",o3e=/^\s+$/,a3e=/(?:[^\\]|^)\\$/,c3e=/^\\!/,l3e=/^\\#/,u3e=/\r?\n/g,d3e=/^\.{0,2}\/|^\.{1,2}$/,f3e=/\/$/,$h="/",npe="node-ignore";typeof Symbol<"u"&&(npe=Symbol.for("node-ignore"));var ipe=npe,Uh=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),p3e=/([0-z])-([0-z])/g,spe=()=>!1,h3e=t=>t.replace(p3e,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:c4),m3e=t=>{let{length:e}=t;return t.slice(0,e-e%2)},g3e=[[/^\uFEFF/,()=>c4],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?epe:c4)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+epe}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>a4],[/\\\\/g,()=>a4],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===a4?`\\[${r}${m3e(n)}${i}`:i==="]"&&n.length%2===0?`[${h3e(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],_3e=/(^|\\\/)?\\\*$/,ES="regex",iC="checkRegex",tpe="_",y3e={[ES](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[iC](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},S3e=t=>g3e.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),sC=t=>typeof t=="string",E3e=t=>t&&sC(t)&&!o3e.test(t)&&!a3e.test(t)&&t.indexOf("#")!==0,v3e=t=>t.split(u3e).filter(Boolean),l4=class{constructor(e,r,n,i,s,o){this.pattern=e,this.mark=r,this.negative=s,Uh(this,"body",n),Uh(this,"ignoreCase",i),Uh(this,"regexPrefix",o)}get regex(){let e=tpe+ES;return this[e]?this[e]:this._make(ES,e)}get checkRegex(){let e=tpe+iC;return this[e]?this[e]:this._make(iC,e)}_make(e,r){let n=this.regexPrefix.replace(_3e,y3e[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Uh(this,r,i)}},b3e=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(c3e,"!").replace(l3e,"#");let s=S3e(i);return new l4(t,e,i,r,n,s)},u4=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[ipe]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(sC(e)&&(e={pattern:e}),E3e(e.pattern)){let r=b3e(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,rpe(sC(e)?v3e(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,s=!1,o;this._rules.forEach(c=>{let{negative:l}=c;s===l&&i!==s||l&&!i&&!s&&!r||!c[n].test(e)||(i=!l,s=l,o=l?s3e:c)});let a={ignored:i,unignored:s};return o&&(a.rule=o),a}},T3e=(t,e)=>{throw new e(t)},qo=(t,e,r)=>sC(t)?t?qo.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),ope=t=>d3e.test(t);qo.isNotRelative=ope;qo.convert=t=>t;var d4=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){Uh(this,ipe,!0),this._rules=new u4(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let s=e&&qo.convert(e);return qo(s,e,this._strictPathCheck?T3e:spe),this._t(s,r,n,i)}checkIgnore(e){if(!f3e.test(e))return this.test(e);let r=e.split($h).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join($h)+$h,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,iC)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split($h).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,ES);let s=this._t(i.join($h)+$h,r,n,i);return r[e]=s.ignored?s:this._rules.test(e,n,ES)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return rpe(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},f4=t=>new d4(t),A3e=t=>qo(t&&qo.convert(t),t,spe),ape=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");qo.convert=t;let e=/^[a-z]:\//i;qo.isNotRelative=r=>e.test(r)||ope(r)};typeof process<"u"&&process.platform==="win32"&&ape();oC.exports=f4;f4.default=f4;oC.exports.isPathValid=A3e;Uh(oC.exports,Symbol.for("setupWindows"),ape)});var H4=b(rme=>{"use strict";rme.parse=function(t,e){return new q4(t,e).parse()};var q4=class t{constructor(e,r){this.source=e,this.transform=r||WYe,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e==="\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var r;(this.recorded.length>0||e)&&(r=this.recorded.join(""),r==="NULL"&&!e&&(r=null),r!==null&&(r=this.transform(r)),this.entries.push(r),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var r,n,i;for(this.consumeDimensions();!this.isEof();)if(r=this.nextCharacter(),r.value==="{"&&!i)this.dimension++,this.dimension>1&&(n=new t(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);else if(r.value==="}"&&!i){if(this.dimension--,!this.dimension&&(this.newEntry(),e))return this.entries}else r.value==='"'&&!r.escaped?(i&&this.newEntry(!0),i=!i):r.value===","&&!i?this.newEntry():this.record(r.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this.entries}};function WYe(t){return t}});var W4=b((Z4t,nme)=>{"use strict";var YYe=H4();nme.exports={create:function(t,e){return{parse:function(){return YYe.parse(t,e)}}}}});var ome=b((J4t,sme)=>{"use strict";var KYe=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,ZYe=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,JYe=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,XYe=/^-?infinity$/;sme.exports=function(e){if(XYe.test(e))return Number(e.replace("i","I"));var r=KYe.exec(e);if(!r)return QYe(e)||null;var n=!!r[8],i=parseInt(r[1],10);n&&(i=ime(i));var s=parseInt(r[2],10)-1,o=r[3],a=parseInt(r[4],10),c=parseInt(r[5],10),l=parseInt(r[6],10),u=r[7];u=u?1e3*parseFloat(u):0;var d,f=eKe(e);return f!=null?(d=new Date(Date.UTC(i,s,o,a,c,l,u)),Y4(i)&&d.setUTCFullYear(i),f!==0&&d.setTime(d.getTime()-f)):(d=new Date(i,s,o,a,c,l,u),Y4(i)&&d.setFullYear(i)),d};function QYe(t){var e=ZYe.exec(t);if(e){var r=parseInt(e[1],10),n=!!e[4];n&&(r=ime(r));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(r,i,s);return Y4(r)&&o.setFullYear(r),o}}function eKe(t){if(t.endsWith("+00"))return 0;var e=JYe.exec(t.split(" ")[1]);if(e){var r=e[1];if(r==="Z")return 0;var n=r==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt(e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}function ime(t){return-(t-1)}function Y4(t){return t>=0&&t<100}});var cme=b((X4t,ame)=>{"use strict";ame.exports=rKe;var tKe=Object.prototype.hasOwnProperty;function rKe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)tKe.call(r,n)&&(t[n]=r[n])}return t}});var dme=b((Q4t,ume)=>{"use strict";var nKe=cme();ume.exports=Zh;function Zh(t){if(!(this instanceof Zh))return new Zh(t);nKe(this,mKe(t))}var iKe=["seconds","minutes","hours","days","months","years"];Zh.prototype.toPostgres=function(){var t=iKe.filter(this.hasOwnProperty,this);return this.milliseconds&&t.indexOf("seconds")<0&&t.push("seconds"),t.length===0?"0":t.map(function(e){var r=this[e]||0;return e==="seconds"&&this.milliseconds&&(r=(r+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),r+" "+e},this).join(" ")};var sKe={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},oKe=["years","months","days"],aKe=["hours","minutes","seconds"];Zh.prototype.toISOString=Zh.prototype.toISO=function(){var t=oKe.map(r,this).join(""),e=aKe.map(r,this).join("");return"P"+t+"T"+e;function r(n){var i=this[n]||0;return n==="seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),i+sKe[n]}};var K4="([+-]?\\d+)",cKe=K4+"\\s+years?",lKe=K4+"\\s+mons?",uKe=K4+"\\s+days?",dKe="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",fKe=new RegExp([cKe,lKe,uKe,dKe].map(function(t){return"("+t+")?"}).join("\\s*")),lme={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},pKe=["hours","minutes","seconds","milliseconds"];function hKe(t){var e=t+"000000".slice(t.length);return parseInt(e,10)/1e3}function mKe(t){if(!t)return{};var e=fKe.exec(t),r=e[8]==="-";return Object.keys(lme).reduce(function(n,i){var s=lme[i],o=e[s];return!o||(o=i==="milliseconds"?hKe(o):parseInt(o,10),!o)||(r&&~pKe.indexOf(i)&&(o*=-1),n[i]=o),n},{})}});var hme=b((eVt,pme)=>{"use strict";var fme=Buffer.from||Buffer;pme.exports=function(e){if(/^\\x/.test(e))return fme(e.substr(2),"hex");for(var r="",n=0;n<e.length;)if(e[n]!=="\\")r+=e[n],++n;else if(/[0-7]{3}/.test(e.substr(n+1,3)))r+=String.fromCharCode(parseInt(e.substr(n+1,3),8)),n+=4;else{for(var i=1;n+i<e.length&&e[n+i]==="\\";)i++;for(var s=0;s<Math.floor(i/2);++s)r+="\\";n+=Math.floor(i/2)*2}return fme(r,"binary")}});var vme=b((tVt,Eme)=>{"use strict";var IS=H4(),CS=W4(),vC=ome(),gme=dme(),_me=hme();function bC(t){return function(r){return r===null?r:t(r)}}function yme(t){return t===null?t:t==="TRUE"||t==="t"||t==="true"||t==="y"||t==="yes"||t==="on"||t==="1"}function gKe(t){return t?IS.parse(t,yme):null}function _Ke(t){return parseInt(t,10)}function Z4(t){return t?IS.parse(t,bC(_Ke)):null}function yKe(t){return t?IS.parse(t,bC(function(e){return Sme(e).trim()})):null}var SKe=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=eV(r)),r});return e.parse()},J4=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=parseFloat(r)),r});return e.parse()},Qn=function(t){if(!t)return null;var e=CS.create(t);return e.parse()},X4=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=vC(r)),r});return e.parse()},EKe=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=gme(r)),r});return e.parse()},vKe=function(t){return t?IS.parse(t,bC(_me)):null},Q4=function(t){return parseInt(t,10)},Sme=function(t){var e=String(t);return/^\d+$/.test(e)?e:t},mme=function(t){return t?IS.parse(t,bC(JSON.parse)):null},eV=function(t){return t[0]!=="("?null:(t=t.substring(1,t.length-1).split(","),{x:parseFloat(t[0]),y:parseFloat(t[1])})},bKe=function(t){if(t[0]!=="<"&&t[1]!=="(")return null;for(var e="(",r="",n=!1,i=2;i<t.length-1;i++){if(n||(e+=t[i]),t[i]===")"){n=!0;continue}else if(!n)continue;t[i]!==","&&(r+=t[i])}var s=eV(e);return s.radius=parseFloat(r),s},TKe=function(t){t(20,Sme),t(21,Q4),t(23,Q4),t(26,Q4),t(700,parseFloat),t(701,parseFloat),t(16,yme),t(1082,vC),t(1114,vC),t(1184,vC),t(600,eV),t(651,Qn),t(718,bKe),t(1e3,gKe),t(1001,vKe),t(1005,Z4),t(1007,Z4),t(1028,Z4),t(1016,yKe),t(1017,SKe),t(1021,J4),t(1022,J4),t(1231,J4),t(1014,Qn),t(1015,Qn),t(1008,Qn),t(1009,Qn),t(1040,Qn),t(1041,Qn),t(1115,X4),t(1182,X4),t(1185,X4),t(1186,gme),t(1187,EKe),t(17,_me),t(114,JSON.parse.bind(JSON)),t(3802,JSON.parse.bind(JSON)),t(199,mme),t(3807,mme),t(3907,Qn),t(2951,Qn),t(791,Qn),t(1183,Qn),t(1270,Qn)};Eme.exports={init:TKe}});var Tme=b((rVt,bme)=>{"use strict";var sn=1e6;function AKe(t){var e=t.readInt32BE(0),r=t.readUInt32BE(4),n="";e<0&&(e=~e+(r===0),r=~r+1>>>0,n="-");var i="",s,o,a,c,l,u;{if(s=e%sn,e=e/sn>>>0,o=4294967296*s+r,r=o/sn>>>0,a=""+(o-sn*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(s=e%sn,e=e/sn>>>0,o=4294967296*s+r,r=o/sn>>>0,a=""+(o-sn*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(s=e%sn,e=e/sn>>>0,o=4294967296*s+r,r=o/sn>>>0,a=""+(o-sn*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}return s=e%sn,o=4294967296*s+r,a=""+o%sn,n+a+i}bme.exports=AKe});var Ime=b((nVt,Rme)=>{"use strict";var xKe=Tme(),bt=function(t,e,r,n,i){r=r||0,n=n||!1,i=i||function(p,h,m){return p*Math.pow(2,m)+h};var s=r>>3,o=function(p){return n?~p&255:p},a=255,c=8-r%8;e<c&&(a=255<<8-e&255,c=e),r&&(a=a>>r%8);var l=0;r%8+e>=8&&(l=i(0,o(t[s])&a,c));for(var u=e+r>>3,d=s+1;d<u;d++)l=i(l,o(t[d]),8);var f=(e+r)%8;return f>0&&(l=i(l,o(t[u])>>8-f,f)),l},wme=function(t,e,r){var n=Math.pow(2,r-1)-1,i=bt(t,1),s=bt(t,r,1);if(s===0)return 0;var o=1,a=function(l,u,d){l===0&&(l=1);for(var f=1;f<=d;f++)o/=2,(u&1<<d-f)>0&&(l+=o);return l},c=bt(t,e,r+1,!1,a);return s==Math.pow(2,r+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*c},wKe=function(t){return bt(t,1)==1?-1*(bt(t,15,1,!0)+1):bt(t,15,1)},Ame=function(t){return bt(t,1)==1?-1*(bt(t,31,1,!0)+1):bt(t,31,1)},RKe=function(t){return wme(t,23,8)},IKe=function(t){return wme(t,52,11)},CKe=function(t){var e=bt(t,16,32);if(e==49152)return NaN;for(var r=Math.pow(1e4,bt(t,16,16)),n=0,i=[],s=bt(t,16),o=0;o<s;o++)n+=bt(t,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,bt(t,16,48));return(e===0?1:-1)*Math.round(n*a)/a},xme=function(t,e){var r=bt(e,1),n=bt(e,63,1),i=new Date((r===0?1:-1)*n/1e3+9466848e5);return t||i.setTime(i.getTime()+i.getTimezoneOffset()*6e4),i.usec=n%1e3,i.getMicroSeconds=function(){return this.usec},i.setMicroSeconds=function(s){this.usec=s},i.getUTCMicroSeconds=function(){return this.usec},i},PS=function(t){for(var e=bt(t,32),r=bt(t,32,32),n=bt(t,32,64),i=96,s=[],o=0;o<e;o++)s[o]=bt(t,32,i),i+=32,i+=32;var a=function(l){var u=bt(t,32,i);if(i+=32,u==4294967295)return null;var d;if(l==23||l==20)return d=bt(t,u*8,i),i+=u*8,d;if(l==25)return d=t.toString(this.encoding,i>>3,(i+=u<<3)>>3),d;console.log("ERROR: ElementType not implemented: "+l)},c=function(l,u){var d=[],f;if(l.length>1){var p=l.shift();for(f=0;f<p;f++)d[f]=c(l,u);l.unshift(p)}else for(f=0;f<l[0];f++)d[f]=a(u);return d};return c(s,n)},PKe=function(t){return t.toString("utf8")},OKe=function(t){return t===null?null:bt(t,8)>0},NKe=function(t){t(20,xKe),t(21,wKe),t(23,Ame),t(26,Ame),t(1700,CKe),t(700,RKe),t(701,IKe),t(16,OKe),t(1114,xme.bind(null,!1)),t(1184,xme.bind(null,!0)),t(1e3,PS),t(1007,PS),t(1016,PS),t(1008,PS),t(1009,PS),t(25,PKe)};Rme.exports={init:NKe}});var Pme=b((iVt,Cme)=>{"use strict";Cme.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var kS=b(NS=>{"use strict";var kKe=vme(),MKe=Ime(),DKe=W4(),LKe=Pme();NS.getTypeParser=$Ke;NS.setTypeParser=UKe;NS.arrayParser=DKe;NS.builtins=LKe;var OS={text:{},binary:{}};function Ome(t){return String(t)}function $Ke(t,e){return e=e||"text",OS[e]&&OS[e][t]||Ome}function UKe(t,e,r){typeof e=="function"&&(r=e,e="text"),OS[e][t]=r}kKe.init(function(t,e){OS.text[t]=e});MKe.init(function(t,e){OS.binary[t]=e})});var MS=b((oVt,tV)=>{"use strict";var Nme;try{Nme=process.platform==="win32"?process.env.USERNAME:process.env.USER}catch{}tV.exports={host:"localhost",user:Nme,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var Jh=kS(),FKe=Jh.getTypeParser(20,"text"),BKe=Jh.getTypeParser(1016,"text");tV.exports.__defineSetter__("parseInt8",function(t){Jh.setTypeParser(20,"text",t?Jh.getTypeParser(23,"text"):FKe),Jh.setTypeParser(1016,"text",t?Jh.getTypeParser(1007,"text"):BKe)})});var Xh=b((aVt,Mme)=>{"use strict";var jKe=MS(),{isDate:zKe}=J("util/types");function GKe(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function kme(t){let e="{";for(let r=0;r<t.length;r++){r>0&&(e+=",");let n=t[r];n==null?e+="NULL":Array.isArray(n)?e+=kme(n):ArrayBuffer.isView(n)?(n instanceof Buffer||(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),e+="\\\\x"+n.toString("hex")):e+=GKe(TC(n))}return e+="}",e}var TC=function(t,e){return t==null?null:typeof t=="object"?t instanceof Buffer?t:ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):zKe(t)?jKe.parseInputDatesAsUTC?HKe(t):qKe(t):Array.isArray(t)?kme(t):VKe(t,e):t.toString()};function VKe(t,e){if(t&&typeof t.toPostgres=="function"){if(e=e||[],e.indexOf(t)!==-1)throw new Error('circular reference detected while preparing "'+t+'" for query');return e.push(t),TC(t.toPostgres(TC),e)}return JSON.stringify(t)}function qKe(t){let e=-t.getTimezoneOffset(),r=t.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);let i=String(r).padStart(4,"0")+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0")+"T"+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")+"."+String(t.getMilliseconds()).padStart(3,"0");return e<0?(i+="-",e*=-1):i+="+",i+=String(Math.floor(e/60)).padStart(2,"0")+":"+String(e%60).padStart(2,"0"),n&&(i+=" BC"),i}function HKe(t){let e=t.getUTCFullYear(),r=e<1;r&&(e=Math.abs(e)+1);let n=String(e).padStart(4,"0")+"-"+String(t.getUTCMonth()+1).padStart(2,"0")+"-"+String(t.getUTCDate()).padStart(2,"0")+"T"+String(t.getUTCHours()).padStart(2,"0")+":"+String(t.getUTCMinutes()).padStart(2,"0")+":"+String(t.getUTCSeconds()).padStart(2,"0")+"."+String(t.getUTCMilliseconds()).padStart(3,"0");return n+="+00:00",r&&(n+=" BC"),n}function WKe(t,e,r){return t=typeof t=="string"?{text:t}:t,e&&(typeof e=="function"?t.callback=e:t.values=e),r&&(t.callback=r),t}var YKe=function(t){return'"'+t.replace(/"/g,'""')+'"'},KKe=function(t){let e=!1,r="'";if(t==null||typeof t!="string")return"''";for(let n=0;n<t.length;n++){let i=t[n];i==="'"?r+=i+i:i==="\\"?(r+=i+i,e=!0):r+=i}return r+="'",e===!0&&(r=" E"+r),r};Mme.exports={prepareValue:function(e){return TC(e)},normalizeQueryConfig:WKe,escapeIdentifier:YKe,escapeLiteral:KKe}});var iV=b((cVt,$me)=>{"use strict";var Dme=J("crypto");$me.exports={postgresMd5PasswordHash:JKe,randomBytes:ZKe,deriveKey:t8e,sha256:XKe,hashByName:QKe,hmacSha256:e8e,md5:rV};var Lme=Dme.webcrypto||globalThis.crypto,Iu=Lme.subtle,nV=new TextEncoder;function ZKe(t){return Lme.getRandomValues(Buffer.alloc(t))}async function rV(t){try{return Dme.createHash("md5").update(t,"utf-8").digest("hex")}catch{let r=typeof t=="string"?nV.encode(t):t,n=await Iu.digest("MD5",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}}async function JKe(t,e,r){let n=await rV(e+t);return"md5"+await rV(Buffer.concat([Buffer.from(n),r]))}async function XKe(t){return await Iu.digest("SHA-256",t)}async function QKe(t,e){return await Iu.digest(t,e)}async function e8e(t,e){let r=await Iu.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await Iu.sign("HMAC",r,nV.encode(e))}async function t8e(t,e,r){let n=await Iu.importKey("raw",nV.encode(t),"PBKDF2",!1,["deriveBits"]),i={name:"PBKDF2",hash:"SHA-256",salt:e,iterations:r};return await Iu.deriveBits(i,n,256,["deriveBits"])}});var Bme=b((lVt,Fme)=>{"use strict";function Cu(t,e){return new Error("SASL channel binding: "+t+" when parsing public certificate "+e.toString("base64"))}function sV(t,e){let r=t[e++];if(r<128)return{length:r,index:e};let n=r&127;if(n>4)throw Cu("bad length",t);r=0;for(let i=0;i<n;i++)r=r<<8|t[e++];return{length:r,index:e}}function Ume(t,e){if(t[e++]!==6)throw Cu("non-OID data",t);let{length:r,index:n}=sV(t,e);e=n;let i=e+r,s=t[e++],o=(s/40>>0)+"."+s%40;for(;e<i;){let a=0;for(;e<i;){let c=t[e++];if(a=a<<7|c&127,c<128)break}o+="."+a}return{oid:o,index:e}}function DS(t,e){if(t[e++]!==48)throw Cu("non-sequence data",t);return sV(t,e)}function r8e(t,e){e===void 0&&(e=0),e=DS(t,e).index;let{length:r,index:n}=DS(t,e);e=n+r,e=DS(t,e).index;let{oid:i,index:s}=Ume(t,e);switch(i){case"1.2.840.113549.1.1.4":return"MD5";case"1.2.840.113549.1.1.5":return"SHA-1";case"1.2.840.113549.1.1.11":return"SHA-256";case"1.2.840.113549.1.1.12":return"SHA-384";case"1.2.840.113549.1.1.13":return"SHA-512";case"1.2.840.113549.1.1.14":return"SHA-224";case"1.2.840.113549.1.1.15":return"SHA512-224";case"1.2.840.113549.1.1.16":return"SHA512-256";case"1.2.840.10045.4.1":return"SHA-1";case"1.2.840.10045.4.3.1":return"SHA-224";case"1.2.840.10045.4.3.2":return"SHA-256";case"1.2.840.10045.4.3.3":return"SHA-384";case"1.2.840.10045.4.3.4":return"SHA-512";case"1.2.840.113549.1.1.10":{if(e=s,e=DS(t,e).index,t[e++]!==160)throw Cu("non-tag data",t);e=sV(t,e).index,e=DS(t,e).index;let{oid:o}=Ume(t,e);switch(o){case"1.2.840.113549.2.5":return"MD5";case"1.3.14.3.2.26":return"SHA-1";case"2.16.840.1.101.3.4.2.1":return"SHA-256";case"2.16.840.1.101.3.4.2.2":return"SHA-384";case"2.16.840.1.101.3.4.2.3":return"SHA-512"}throw Cu("unknown hash OID "+o,t)}case"1.3.101.110":case"1.3.101.112":return"SHA-512";case"1.3.101.111":case"1.3.101.113":throw Cu("Ed448 certificate channel binding is not currently supported by Postgres")}throw Cu("unknown OID "+i,t)}Fme.exports={signatureAlgorithmHashFromCertificate:r8e}});var Vme=b((uVt,Gme)=>{"use strict";var Cc=iV(),{signatureAlgorithmHashFromCertificate:n8e}=Bme();function i8e(t){let e=/[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g,r=/[\u00AD\u034F\u1806\u180B\u180C\u180D\u200C\u200D\u2060\uFE00-\uFE0F\uFEFF]/g;return t.replace(e," ").replace(r,"").normalize("NFKC")}var oV=1e5;function s8e(t,e,r=oV){let n=["SCRAM-SHA-256"];e&&n.unshift("SCRAM-SHA-256-PLUS");let i=n.find(a=>t.includes(a));if(!i)throw new Error("SASL: Only mechanism(s) "+n.join(" and ")+" are supported");if(i==="SCRAM-SHA-256-PLUS"&&typeof e.getPeerCertificate!="function")throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");let s=Cc.randomBytes(18).toString("base64");return{mechanism:i,clientNonce:s,response:(i==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":e?"y":"n")+",,n=*,r="+s,message:"SASLInitialResponse",scramMaxIterations:r}}async function o8e(t,e,r,n){if(t.message!=="SASLInitialResponse")throw new Error("SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(e==="")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof r!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let i=l8e(r);if(i.nonce.startsWith(t.clientNonce)){if(i.nonce.length===t.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");let s=typeof t.scramMaxIterations=="number"?t.scramMaxIterations:oV;if(s!==0&&i.iteration>s)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count "+i.iteration+" exceeds scramMaxIterations of "+s);let o="n=*,r="+t.clientNonce,a="r="+i.nonce+",s="+i.salt+",i="+i.iteration,c=n?"eSws":"biws";if(t.mechanism==="SCRAM-SHA-256-PLUS"){let A=n.getPeerCertificate().raw,S=n8e(A);(S==="MD5"||S==="SHA-1")&&(S="SHA-256");let R=await Cc.hashByName(S,A);c=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(R)]).toString("base64")}let l="c="+c+",r="+i.nonce,u=o+","+a+","+l,d=Buffer.from(i.salt,"base64"),f=await Cc.deriveKey(i8e(e),d,i.iteration),p=await Cc.hmacSha256(f,"Client Key"),h=await Cc.sha256(p),m=await Cc.hmacSha256(h,u),E=d8e(Buffer.from(p),Buffer.from(m)).toString("base64"),T=await Cc.hmacSha256(f,"Server Key"),v=await Cc.hmacSha256(T,u);t.message="SASLResponse",t.serverSignature=Buffer.from(v).toString("base64"),t.response=l+",p="+E}function a8e(t,e){if(t.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=u8e(e);if(r!==t.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function c8e(t){if(typeof t!="string")throw new TypeError("SASL: text must be a string");return t.split("").map((e,r)=>t.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function jme(t){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(t)}function zme(t){if(typeof t!="string")throw new TypeError("SASL: attribute pairs text must be a string");return new Map(t.split(",").map(e=>{if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let r=e[0],n=e.substring(2);return[r,n]}))}function l8e(t){let e=zme(t),r=e.get("r");if(r){if(!c8e(r))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!jme(n))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");let s=parseInt(i,10);return{nonce:r,salt:n,iteration:s}}function u8e(t){let e=zme(t),r=e.get("e"),n=e.get("v");if(r)throw new Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server returned error: "${r}"`);if(n){if(!jme(n))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:n}}function d8e(t,e){if(!Buffer.isBuffer(t))throw new TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(e))throw new TypeError("second argument must be a Buffer");if(t.length!==e.length)throw new Error("Buffer lengths must match");if(t.length===0)throw new Error("Buffers cannot be empty");return Buffer.from(t.map((r,n)=>t[n]^e[n]))}Gme.exports={startSession:s8e,continueSession:o8e,finalizeSession:a8e,DEFAULT_MAX_SCRAM_ITERATIONS:oV}});var xC=b((dVt,qme)=>{"use strict";var f8e=kS();function AC(t){this._types=t||f8e,this.text={},this.binary={}}AC.prototype.getOverrides=function(t){switch(t){case"text":return this.text;case"binary":return this.binary;default:return{}}};AC.prototype.setTypeParser=function(t,e,r){typeof e=="function"&&(r=e,e="text"),this.getOverrides(e)[t]=r};AC.prototype.getTypeParser=function(t,e){return e=e||"text",this.getOverrides(e)[t]||this._types.getTypeParser(t,e)};qme.exports=AC});var Yme=b((fVt,Wme)=>{"use strict";function Qh(t,e={}){if(t.charAt(0)==="/"){let c=t.split(" ");return{host:c[0],database:c[1]}}let r=Object.create(null),n,i=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(t)&&(t=encodeURI(t).replace(/%25(\d\d)/g,"%$1"));try{try{n=new URL(t,"postgres://base")}catch{n=new URL(t.replace("@/","@___DUMMY___/"),"postgres://base"),i=!0}}catch(c){throw c.input&&(c.input="*****REDACTED*****"),c}for(let c of n.searchParams.entries())r[c[0]]=c[1];if(r.user=r.user||decodeURIComponent(n.username),r.password=r.password||decodeURIComponent(n.password),n.protocol=="socket:")return r.host=decodeURI(n.pathname),r.database=n.searchParams.get("db"),r.client_encoding=n.searchParams.get("encoding"),r;let s=i?"":n.hostname;r.host?s&&/^%2f/i.test(s)&&(n.pathname=s+n.pathname):r.host=decodeURIComponent(s),r.port||(r.port=n.port);let o=n.pathname.slice(1)||null;r.database=o?decodeURI(o):null,(r.ssl==="true"||r.ssl==="1")&&(r.ssl=!0),r.ssl==="0"&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});let a=r.sslcert||r.sslkey||r.sslrootcert?J("fs"):null;if(r.sslcert&&(r.ssl.cert=a.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=a.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=a.readFileSync(r.sslrootcert).toString()),e.useLibpqCompat&&r.uselibpqcompat)throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");if(r.uselibpqcompat==="true"||e.useLibpqCompat)switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":{r.ssl.rejectUnauthorized=!1;break}case"require":{r.sslrootcert?r.ssl.checkServerIdentity=function(){}:r.ssl.rejectUnauthorized=!1;break}case"verify-ca":{if(!r.ssl.ca)throw new Error("SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.");r.ssl.checkServerIdentity=function(){};break}case"verify-full":break}else switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":{r.sslmode!=="verify-full"&&aV(r.sslmode);break}case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}function p8e(t){return Object.entries(t).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),Object.create(null))}function Hme(t){return Object.entries(t).reduce((r,[n,i])=>{if(n==="ssl"){let s=i;typeof s=="boolean"&&(r[n]=s),typeof s=="object"&&(r[n]=p8e(s))}else if(i!=null)if(n==="port"){if(i!==""){let s=parseInt(i,10);if(isNaN(s))throw new Error(`Invalid ${n}: ${i}`);r[n]=s}}else r[n]=i;return r},Object.create(null))}function h8e(t){return Hme(Qh(t))}function aV(t){!aV.warned&&typeof process<"u"&&process.emitWarning&&(aV.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
24
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var ede=b(($Bt,Que)=>{"use strict";var DVe=kI(),{MAX_LENGTH:Zue,CHAR_BACKSLASH:Iz,CHAR_BACKTICK:LVe,CHAR_COMMA:$Ve,CHAR_DOT:UVe,CHAR_LEFT_PARENTHESES:FVe,CHAR_RIGHT_PARENTHESES:BVe,CHAR_LEFT_CURLY_BRACE:jVe,CHAR_RIGHT_CURLY_BRACE:zVe,CHAR_LEFT_SQUARE_BRACKET:Jue,CHAR_RIGHT_SQUARE_BRACKET:Xue,CHAR_DOUBLE_QUOTE:GVe,CHAR_SINGLE_QUOTE:VVe,CHAR_NO_BREAK_SPACE:qVe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:HVe}=Kue(),WVe=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Zue,r.maxLength):Zue;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},s=[i],o=i,a=i,c=0,l=t.length,u=0,d=0,f,p=()=>t[u++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=a,a=m,m};for(h({type:"bos"});u<l;)if(o=s[s.length-1],f=p(),!(f===HVe||f===qVe)){if(f===Iz){h({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===Xue){h({type:"text",value:"\\"+f});continue}if(f===Jue){c++;let m;for(;u<l&&(m=p());){if(f+=m,m===Jue){c++;continue}if(m===Iz){f+=p();continue}if(m===Xue&&(c--,c===0))break}h({type:"text",value:f});continue}if(f===FVe){o=h({type:"paren",nodes:[]}),s.push(o),h({type:"text",value:f});continue}if(f===BVe){if(o.type!=="paren"){h({type:"text",value:f});continue}o=s.pop(),h({type:"text",value:f}),o=s[s.length-1];continue}if(f===GVe||f===VVe||f===LVe){let m=f,E;for(e.keepQuotes!==!0&&(f="");u<l&&(E=p());){if(E===Iz){f+=E+p();continue}if(E===m){e.keepQuotes===!0&&(f+=E);break}f+=E}h({type:"text",value:f});continue}if(f===jVe){d++;let E={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};o=h(E),s.push(o),h({type:"open",value:f});continue}if(f===zVe){if(o.type!=="brace"){h({type:"text",value:f});continue}let m="close";o=s.pop(),o.close=!0,h({type:m,value:f}),d--,o=s[s.length-1];continue}if(f===$Ve&&d>0){if(o.ranges>0){o.ranges=0;let m=o.nodes.shift();o.nodes=[m,{type:"text",value:DVe(o)}]}h({type:"comma",value:f}),o.commas++;continue}if(f===UVe&&d>0&&o.commas===0){let m=o.nodes;if(d===0||m.length===0){h({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){m.pop();let E=m[m.length-1];E.value+=a.value+f,a=E,o.ranges--;continue}h({type:"dot",value:f});continue}h({type:"text",value:f})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(T=>{T.nodes||(T.type==="open"&&(T.isOpen=!0),T.type==="close"&&(T.isClose=!0),T.nodes||(T.type="text"),T.invalid=!0)});let m=s[s.length-1],E=m.nodes.indexOf(o);m.nodes.splice(E,1,...o.nodes)}while(s.length>0);return h({type:"eos"}),i};Que.exports=WVe});var nde=b((UBt,rde)=>{"use strict";var tde=kI(),YVe=Vue(),KVe=Wue(),ZVe=ede(),wn=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=wn.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(wn.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};wn.parse=(t,e={})=>ZVe(t,e);wn.stringify=(t,e={})=>tde(typeof t=="string"?wn.parse(t,e):t,e);wn.compile=(t,e={})=>(typeof t=="string"&&(t=wn.parse(t,e)),YVe(t,e));wn.expand=(t,e={})=>{typeof t=="string"&&(t=wn.parse(t,e));let r=KVe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};wn.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?wn.compile(t,e):wn.expand(t,e);rde.exports=wn});var hS=b((FBt,cde)=>{"use strict";var JVe=J("path"),Is="\\\\/",ide=`[^${Is}]`,XVe=0,Go="\\.",QVe="\\+",eqe="\\?",LI="\\/",tqe="(?=.)",sde="[^/]",Cz=`(?:${LI}|$)`,ode=`(?:^|${LI})`,Pz=`${Go}{1,2}${Cz}`,rqe=`(?!${Go})`,nqe=`(?!${ode}${Pz})`,iqe=`(?!${Go}{0,1}${Cz})`,sqe=`(?!${Pz})`,oqe=`[^.${LI}]`,aqe=`${sde}*?`,ade={DOT_LITERAL:Go,PLUS_LITERAL:QVe,QMARK_LITERAL:eqe,SLASH_LITERAL:LI,ONE_CHAR:tqe,QMARK:sde,END_ANCHOR:Cz,DOTS_SLASH:Pz,NO_DOT:rqe,NO_DOTS:nqe,NO_DOT_SLASH:iqe,NO_DOTS_SLASH:sqe,QMARK_NO_DOT:oqe,STAR:aqe,START_ANCHOR:ode},cqe={...ade,SLASH_LITERAL:`[${Is}]`,QMARK:ide,STAR:`${ide}*?`,DOTS_SLASH:`${Go}{1,2}(?:[${Is}]|$)`,NO_DOT:`(?!${Go})`,NO_DOTS:`(?!(?:^|[${Is}])${Go}{1,2}(?:[${Is}]|$))`,NO_DOT_SLASH:`(?!${Go}{0,1}(?:[${Is}]|$))`,NO_DOTS_SLASH:`(?!${Go}{1,2}(?:[${Is}]|$))`,QMARK_NO_DOT:`[^.${Is}]`,START_ANCHOR:`(?:^|[${Is}])`,END_ANCHOR:`(?:[${Is}]|$)`},lqe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};cde.exports={DEFAULT_MAX_EXTGLOB_RECURSION:XVe,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:lqe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:JVe.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?cqe:ade}}});var mS=b(rn=>{"use strict";var uqe=J("path"),dqe=process.platform==="win32",{REGEX_BACKSLASH:fqe,REGEX_REMOVE_BACKSLASH:pqe,REGEX_SPECIAL_CHARS:hqe,REGEX_SPECIAL_CHARS_GLOBAL:mqe}=hS();rn.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);rn.hasRegexChars=t=>hqe.test(t);rn.isRegexChar=t=>t.length===1&&rn.hasRegexChars(t);rn.escapeRegex=t=>t.replace(mqe,"\\$1");rn.toPosixSlashes=t=>t.replace(fqe,"/");rn.removeBackslashes=t=>t.replace(pqe,e=>e==="\\"?"":e);rn.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};rn.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:dqe===!0||uqe.sep==="\\";rn.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?rn.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};rn.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};rn.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${t})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var gde=b((jBt,mde)=>{"use strict";var lde=mS(),{CHAR_ASTERISK:Oz,CHAR_AT:gqe,CHAR_BACKWARD_SLASH:gS,CHAR_COMMA:_qe,CHAR_DOT:Nz,CHAR_EXCLAMATION_MARK:kz,CHAR_FORWARD_SLASH:hde,CHAR_LEFT_CURLY_BRACE:Mz,CHAR_LEFT_PARENTHESES:Dz,CHAR_LEFT_SQUARE_BRACKET:yqe,CHAR_PLUS:Sqe,CHAR_QUESTION_MARK:ude,CHAR_RIGHT_CURLY_BRACE:Eqe,CHAR_RIGHT_PARENTHESES:dde,CHAR_RIGHT_SQUARE_BRACKET:vqe}=hS(),fde=t=>t===hde||t===gS,pde=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},bqe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,h=!1,m=!1,E=!1,T=!1,v=!1,A=!1,S=!1,R=!1,P=0,L,I,O={value:"",depth:0,isGlob:!1},j=()=>l>=n,_=()=>c.charCodeAt(l+1),se=()=>(L=I,c.charCodeAt(++l));for(;l<n;){I=se();let X;if(I===gS){v=O.backslashes=!0,I=se(),I===Mz&&(T=!0);continue}if(T===!0||I===Mz){for(P++;j()!==!0&&(I=se());){if(I===gS){v=O.backslashes=!0,se();continue}if(I===Mz){P++;continue}if(T!==!0&&I===Nz&&(I=se())===Nz){if(f=O.isBrace=!0,h=O.isGlob=!0,R=!0,i===!0)continue;break}if(T!==!0&&I===_qe){if(f=O.isBrace=!0,h=O.isGlob=!0,R=!0,i===!0)continue;break}if(I===Eqe&&(P--,P===0)){T=!1,f=O.isBrace=!0,R=!0;break}}if(i===!0)continue;break}if(I===hde){if(s.push(l),o.push(O),O={value:"",depth:0,isGlob:!1},R===!0)continue;if(L===Nz&&l===u+1){u+=2;continue}d=l+1;continue}if(r.noext!==!0&&(I===Sqe||I===gqe||I===Oz||I===ude||I===kz)===!0&&_()===Dz){if(h=O.isGlob=!0,m=O.isExtglob=!0,R=!0,I===kz&&l===u&&(S=!0),i===!0){for(;j()!==!0&&(I=se());){if(I===gS){v=O.backslashes=!0,I=se();continue}if(I===dde){h=O.isGlob=!0,R=!0;break}}continue}break}if(I===Oz){if(L===Oz&&(E=O.isGlobstar=!0),h=O.isGlob=!0,R=!0,i===!0)continue;break}if(I===ude){if(h=O.isGlob=!0,R=!0,i===!0)continue;break}if(I===yqe){for(;j()!==!0&&(X=se());){if(X===gS){v=O.backslashes=!0,se();continue}if(X===vqe){p=O.isBracket=!0,h=O.isGlob=!0,R=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&I===kz&&l===u){A=O.negated=!0,u++;continue}if(r.noparen!==!0&&I===Dz){if(h=O.isGlob=!0,i===!0){for(;j()!==!0&&(I=se());){if(I===Dz){v=O.backslashes=!0,I=se();continue}if(I===dde){R=!0;break}}continue}break}if(h===!0){if(R=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,h=!1);let C=c,g="",y="";u>0&&(g=c.slice(0,u),c=c.slice(u),d-=u),C&&h===!0&&d>0?(C=c.slice(0,d),y=c.slice(d)):h===!0?(C="",y=c):C=c,C&&C!==""&&C!=="/"&&C!==c&&fde(C.charCodeAt(C.length-1))&&(C=C.slice(0,-1)),r.unescape===!0&&(y&&(y=lde.removeBackslashes(y)),C&&v===!0&&(C=lde.removeBackslashes(C)));let w={prefix:g,input:t,start:u,base:C,glob:y,isBrace:f,isBracket:p,isGlob:h,isExtglob:m,isGlobstar:E,negated:A,negatedExtglob:S};if(r.tokens===!0&&(w.maxDepth=0,fde(I)||o.push(O),w.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let q=0;q<s.length;q++){let ae=X?X+1:u,Re=s[q],xe=t.slice(ae,Re);r.tokens&&(q===0&&u!==0?(o[q].isPrefix=!0,o[q].value=g):o[q].value=xe,pde(o[q]),w.maxDepth+=o[q].depth),(q!==0||xe!=="")&&a.push(xe),X=Re}if(X&&X+1<t.length){let q=t.slice(X+1);a.push(q),r.tokens&&(o[o.length-1].value=q,pde(o[o.length-1]),w.maxDepth+=o[o.length-1].depth)}w.slashes=s,w.parts=a}return w};mde.exports=bqe});var vde=b((zBt,Ede)=>{"use strict";var _S=hS(),Er=mS(),{MAX_LENGTH:$I,POSIX_REGEX_SOURCE:Tqe,REGEX_NON_SPECIAL_CHARS:Aqe,REGEX_SPECIAL_CHARS_BACKREF:xqe,REPLACEMENTS:_de}=_S,wqe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Er.escapeRegex(i)).join("..")}return r},Nh=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,yde=t=>{let e=[],r=0,n=0,i=0,s="",o=!1;for(let a of t){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},Rqe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Sde=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Rqe(e))return e.replace(/\\(.)/g,"$1")},Iqe=t=>{let e=t.map(Sde).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let i=e[r],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},Lz=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,s=!1;for(let o=1;o<t.length;o++){let a=t[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},Cqe=t=>{let e=0,r=[];for(;e<t.length;){let i=Lz(t.slice(e),!1);if(!i||i.type!=="*")return;let s=yde(i.body).map(a=>a.trim());if(s.length!==1)return;let o=Sde(s[0]);if(!o||o.length!==1)return;r.push(o),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Er.escapeRegex(r[0]):`[${r.map(i=>Er.escapeRegex(i)).join("")}]`}*`},Pqe=t=>{let e=0,r=t.trim(),n=Lz(r);for(;n;)e++,r=n.body.trim(),n=Lz(r);return e},Oqe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_S.DEFAULT_MAX_EXTGLOB_RECURSION,n=yde(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||Iqe(n)))return{risky:!0};for(let i of n){let s=Cqe(i);if(s)return{risky:!0,safeOutput:s};if(Pqe(i)>r)return{risky:!0}}return{risky:!1}},$z=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=_de[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min($I,r.maxLength):$I,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",c=Er.isWindows(e),l=_S.globChars(c),u=_S.extglobChars(l),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:E,NO_DOT_SLASH:T,NO_DOTS_SLASH:v,QMARK:A,QMARK_NO_DOT:S,STAR:R,START_ANCHOR:P}=l,L=z=>`(${a}(?:(?!${P}${z.dot?m:d}).)*?)`,I=r.dot?"":E,O=r.dot?A:S,j=r.bash===!0?L(r):R;r.capture&&(j=`(${j})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Er.removePrefix(t,_),i=t.length;let se=[],C=[],g=[],y=s,w,X=()=>_.index===i-1,q=_.peek=(z=1)=>t[_.index+z],ae=_.advance=()=>t[++_.index]||"",Re=()=>t.slice(_.index+1),xe=(z="",Ee=0)=>{_.consumed+=z,_.index+=Ee},$e=z=>{_.output+=z.output!=null?z.output:z.value,xe(z.value)},oe=()=>{let z=1;for(;q()==="!"&&(q(2)!=="("||q(3)==="?");)ae(),_.start++,z++;return z%2===0?!1:(_.negated=!0,_.start++,!0)},le=z=>{_[z]++,g.push(z)},Ae=z=>{_[z]--,g.pop()},_e=z=>{if(y.type==="globstar"){let Ee=_.braces>0&&(z.type==="comma"||z.type==="brace"),W=z.extglob===!0||se.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!Ee&&!W&&(_.output=_.output.slice(0,-y.output.length),y.type="star",y.value="*",y.output=j,_.output+=y.output)}if(se.length&&z.type!=="paren"&&(se[se.length-1].inner+=z.value),(z.value||z.output)&&$e(z),y&&y.type==="text"&&z.type==="text"){y.value+=z.value,y.output=(y.output||"")+z.value;return}z.prev=y,o.push(z),y=z},Ie=(z,Ee)=>{let W={...u[Ee],conditions:1,inner:""};W.prev=y,W.parens=_.parens,W.output=_.output,W.startIndex=_.index,W.tokensIndex=o.length;let k=(r.capture?"(":"")+W.open;le("parens"),_e({type:z,value:Ee,output:_.output?"":h}),_e({type:"paren",extglob:!0,value:ae(),output:k}),se.push(W)},De=z=>{let Ee=t.slice(z.startIndex,_.index+1),W=t.slice(z.startIndex+2,_.index),k=Oqe(W,r);if((z.type==="plus"||z.type==="star")&&k.risky){let F=k.safeOutput?(z.output?"":h)+(r.capture?`(${k.safeOutput})`:k.safeOutput):void 0,V=o[z.tokensIndex];V.type="text",V.value=Ee,V.output=F||Er.escapeRegex(Ee);for(let K=z.tokensIndex+1;K<o.length;K++)o[K].value="",o[K].output="",delete o[K].suffix;_.output=z.output+V.output,_.backtrack=!0,_e({type:"paren",extglob:!0,value:w,output:""}),Ae("parens");return}let $=z.close+(r.capture?")":""),U;if(z.type==="negate"){let F=j;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(F=L(r)),(F!==j||X()||/^\)+$/.test(Re()))&&($=z.close=`)$))${F}`),z.inner.includes("*")&&(U=Re())&&/^\.[^\\/.]+$/.test(U)){let V=$z(U,{...e,fastpaths:!1}).output;$=z.close=`)${V})${F})`}z.prev.type==="bos"&&(_.negatedExtglob=!0)}_e({type:"paren",extglob:!0,value:w,output:$}),Ae("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,Ee=t.replace(xqe,(W,k,$,U,F,V)=>U==="\\"?(z=!0,W):U==="?"?k?k+U+(F?A.repeat(F.length):""):V===0?O+(F?A.repeat(F.length):""):A.repeat($.length):U==="."?d.repeat($.length):U==="*"?k?k+U+(F?j:""):j:k?W:`\\${W}`);return z===!0&&(r.unescape===!0?Ee=Ee.replace(/\\/g,""):Ee=Ee.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),Ee===t&&r.contains===!0?(_.output=t,_):(_.output=Er.wrapOutput(Ee,_,e),_)}for(;!X();){if(w=ae(),w==="\0")continue;if(w==="\\"){let W=q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){w+="\\",_e({type:"text",value:w});continue}let k=/^\\+/.exec(Re()),$=0;if(k&&k[0].length>2&&($=k[0].length,_.index+=$,$%2!==0&&(w+="\\")),r.unescape===!0?w=ae():w+=ae(),_.brackets===0){_e({type:"text",value:w});continue}}if(_.brackets>0&&(w!=="]"||y.value==="["||y.value==="[^")){if(r.posix!==!1&&w===":"){let W=y.value.slice(1);if(W.includes("[")&&(y.posix=!0,W.includes(":"))){let k=y.value.lastIndexOf("["),$=y.value.slice(0,k),U=y.value.slice(k+2),F=Tqe[U];if(F){y.value=$+F,_.backtrack=!0,ae(),!s.output&&o.indexOf(y)===1&&(s.output=h);continue}}}(w==="["&&q()!==":"||w==="-"&&q()==="]")&&(w=`\\${w}`),w==="]"&&(y.value==="["||y.value==="[^")&&(w=`\\${w}`),r.posix===!0&&w==="!"&&y.value==="["&&(w="^"),y.value+=w,$e({value:w});continue}if(_.quotes===1&&w!=='"'){w=Er.escapeRegex(w),y.value+=w,$e({value:w});continue}if(w==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&_e({type:"text",value:w});continue}if(w==="("){le("parens"),_e({type:"paren",value:w});continue}if(w===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Nh("opening","("));let W=se[se.length-1];if(W&&_.parens===W.parens+1){De(se.pop());continue}_e({type:"paren",value:w,output:_.parens?")":"\\)"}),Ae("parens");continue}if(w==="["){if(r.nobracket===!0||!Re().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Nh("closing","]"));w=`\\${w}`}else le("brackets");_e({type:"bracket",value:w});continue}if(w==="]"){if(r.nobracket===!0||y&&y.type==="bracket"&&y.value.length===1){_e({type:"text",value:w,output:`\\${w}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Nh("opening","["));_e({type:"text",value:w,output:`\\${w}`});continue}Ae("brackets");let W=y.value.slice(1);if(y.posix!==!0&&W[0]==="^"&&!W.includes("/")&&(w=`/${w}`),y.value+=w,$e({value:w}),r.literalBrackets===!1||Er.hasRegexChars(W))continue;let k=Er.escapeRegex(y.value);if(_.output=_.output.slice(0,-y.value.length),r.literalBrackets===!0){_.output+=k,y.value=k;continue}y.value=`(${a}${k}|${y.value})`,_.output+=y.value;continue}if(w==="{"&&r.nobrace!==!0){le("braces");let W={type:"brace",value:w,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};C.push(W),_e(W);continue}if(w==="}"){let W=C[C.length-1];if(r.nobrace===!0||!W){_e({type:"text",value:w,output:w});continue}let k=")";if(W.dots===!0){let $=o.slice(),U=[];for(let F=$.length-1;F>=0&&(o.pop(),$[F].type!=="brace");F--)$[F].type!=="dots"&&U.unshift($[F].value);k=wqe(U,r),_.backtrack=!0}if(W.comma!==!0&&W.dots!==!0){let $=_.output.slice(0,W.outputIndex),U=_.tokens.slice(W.tokensIndex);W.value=W.output="\\{",w=k="\\}",_.output=$;for(let F of U)_.output+=F.output||F.value}_e({type:"brace",value:w,output:k}),Ae("braces"),C.pop();continue}if(w==="|"){se.length>0&&se[se.length-1].conditions++,_e({type:"text",value:w});continue}if(w===","){let W=w,k=C[C.length-1];k&&g[g.length-1]==="braces"&&(k.comma=!0,W="|"),_e({type:"comma",value:w,output:W});continue}if(w==="/"){if(y.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",o.pop(),y=s;continue}_e({type:"slash",value:w,output:p});continue}if(w==="."){if(_.braces>0&&y.type==="dot"){y.value==="."&&(y.output=d);let W=C[C.length-1];y.type="dots",y.output+=w,y.value+=w,W.dots=!0;continue}if(_.braces+_.parens===0&&y.type!=="bos"&&y.type!=="slash"){_e({type:"text",value:w,output:d});continue}_e({type:"dot",value:w,output:d});continue}if(w==="?"){if(!(y&&y.value==="(")&&r.noextglob!==!0&&q()==="("&&q(2)!=="?"){Ie("qmark",w);continue}if(y&&y.type==="paren"){let k=q(),$=w;if(k==="<"&&!Er.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(y.value==="("&&!/[!=<:]/.test(k)||k==="<"&&!/<([!=]|\w+>)/.test(Re()))&&($=`\\${w}`),_e({type:"text",value:w,output:$});continue}if(r.dot!==!0&&(y.type==="slash"||y.type==="bos")){_e({type:"qmark",value:w,output:S});continue}_e({type:"qmark",value:w,output:A});continue}if(w==="!"){if(r.noextglob!==!0&&q()==="("&&(q(2)!=="?"||!/[!=<:]/.test(q(3)))){Ie("negate",w);continue}if(r.nonegate!==!0&&_.index===0){oe();continue}}if(w==="+"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){Ie("plus",w);continue}if(y&&y.value==="("||r.regex===!1){_e({type:"plus",value:w,output:f});continue}if(y&&(y.type==="bracket"||y.type==="paren"||y.type==="brace")||_.parens>0){_e({type:"plus",value:w});continue}_e({type:"plus",value:f});continue}if(w==="@"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){_e({type:"at",extglob:!0,value:w,output:""});continue}_e({type:"text",value:w});continue}if(w!=="*"){(w==="$"||w==="^")&&(w=`\\${w}`);let W=Aqe.exec(Re());W&&(w+=W[0],_.index+=W[0].length),_e({type:"text",value:w});continue}if(y&&(y.type==="globstar"||y.star===!0)){y.type="star",y.star=!0,y.value+=w,y.output=j,_.backtrack=!0,_.globstar=!0,xe(w);continue}let z=Re();if(r.noextglob!==!0&&/^\([^?]/.test(z)){Ie("star",w);continue}if(y.type==="star"){if(r.noglobstar===!0){xe(w);continue}let W=y.prev,k=W.prev,$=W.type==="slash"||W.type==="bos",U=k&&(k.type==="star"||k.type==="globstar");if(r.bash===!0&&(!$||z[0]&&z[0]!=="/")){_e({type:"star",value:w,output:""});continue}let F=_.braces>0&&(W.type==="comma"||W.type==="brace"),V=se.length&&(W.type==="pipe"||W.type==="paren");if(!$&&W.type!=="paren"&&!F&&!V){_e({type:"star",value:w,output:""});continue}for(;z.slice(0,3)==="/**";){let K=t[_.index+4];if(K&&K!=="/")break;z=z.slice(3),xe("/**",3)}if(W.type==="bos"&&X()){y.type="globstar",y.value+=w,y.output=L(r),_.output=y.output,_.globstar=!0,xe(w);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!U&&X()){_.output=_.output.slice(0,-(W.output+y.output).length),W.output=`(?:${W.output}`,y.type="globstar",y.output=L(r)+(r.strictSlashes?")":"|$)"),y.value+=w,_.globstar=!0,_.output+=W.output+y.output,xe(w);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&z[0]==="/"){let K=z[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(W.output+y.output).length),W.output=`(?:${W.output}`,y.type="globstar",y.output=`${L(r)}${p}|${p}${K})`,y.value+=w,_.output+=W.output+y.output,_.globstar=!0,xe(w+ae()),_e({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&z[0]==="/"){y.type="globstar",y.value+=w,y.output=`(?:^|${p}|${L(r)}${p})`,_.output=y.output,_.globstar=!0,xe(w+ae()),_e({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-y.output.length),y.type="globstar",y.output=L(r),y.value+=w,_.output+=y.output,_.globstar=!0,xe(w);continue}let Ee={type:"star",value:w,output:j};if(r.bash===!0){Ee.output=".*?",(y.type==="bos"||y.type==="slash")&&(Ee.output=I+Ee.output),_e(Ee);continue}if(y&&(y.type==="bracket"||y.type==="paren")&&r.regex===!0){Ee.output=w,_e(Ee);continue}(_.index===_.start||y.type==="slash"||y.type==="dot")&&(y.type==="dot"?(_.output+=T,y.output+=T):r.dot===!0?(_.output+=v,y.output+=v):(_.output+=I,y.output+=I),q()!=="*"&&(_.output+=h,y.output+=h)),_e(Ee)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nh("closing","]"));_.output=Er.escapeLast(_.output,"["),Ae("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nh("closing",")"));_.output=Er.escapeLast(_.output,"("),Ae("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nh("closing","}"));_.output=Er.escapeLast(_.output,"{"),Ae("braces")}if(r.strictSlashes!==!0&&(y.type==="star"||y.type==="bracket")&&_e({type:"maybe_slash",value:"",output:`${p}?`}),_.backtrack===!0){_.output="";for(let z of _.tokens)_.output+=z.output!=null?z.output:z.value,z.suffix&&(_.output+=z.suffix)}return _};$z.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min($I,r.maxLength):$I,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=_de[t]||t;let s=Er.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:h}=_S.globChars(s),m=r.dot?d:u,E=r.dot?f:u,T=r.capture?"":"?:",v={negated:!1,prefix:""},A=r.bash===!0?".*?":p;r.capture&&(A=`(${A})`);let S=I=>I.noglobstar===!0?A:`(${T}(?:(?!${h}${I.dot?l:o}).)*?)`,R=I=>{switch(I){case"*":return`${m}${c}${A}`;case".*":return`${o}${c}${A}`;case"*.*":return`${m}${A}${o}${c}${A}`;case"*/*":return`${m}${A}${a}${c}${E}${A}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${a})?${E}${c}${A}`;case"**/*.*":return`(?:${m}${S(r)}${a})?${E}${A}${o}${c}${A}`;case"**/.*":return`(?:${m}${S(r)}${a})?${o}${c}${A}`;default:{let O=/^(.*?)\.(\w+)$/.exec(I);if(!O)return;let j=R(O[1]);return j?j+o+O[2]:void 0}}},P=Er.removePrefix(t,v),L=R(P);return L&&r.strictSlashes!==!0&&(L+=`${a}?`),L};Ede.exports=$z});var Tde=b((GBt,bde)=>{"use strict";var Nqe=J("path"),kqe=gde(),Uz=vde(),Fz=mS(),Mqe=hS(),Dqe=t=>t&&typeof t=="object"&&!Array.isArray(t),kt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>kt(f,e,r));return f=>{for(let p of u){let h=p(f);if(h)return h}return!1}}let n=Dqe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Fz.isWindows(e),o=n?kt.compileRe(t,e):kt.makeRe(t,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=kt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:h}=kt.test(u,o,e,{glob:t,posix:s}),m={glob:t,state:a,regex:o,posix:s,input:u,output:h,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(m),f===!1?(m.isMatch=!1,d?m:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,d?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),d?m:!0)};return r&&(l.state=a),l};kt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?Fz.toPosixSlashes:null),a=t===n,c=a&&o?o(t):t;return a===!1&&(c=o?o(t):t,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=kt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};kt.matchBase=(t,e,r,n=Fz.isWindows(r))=>(e instanceof RegExp?e:kt.makeRe(e,r)).test(Nqe.basename(t));kt.isMatch=(t,e,r)=>kt(e,r)(t);kt.parse=(t,e)=>Array.isArray(t)?t.map(r=>kt.parse(r,e)):Uz(t,{...e,fastpaths:!1});kt.scan=(t,e)=>kqe(t,e);kt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=kt.toRegex(a,e);return n===!0&&(c.state=t),c};kt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=Uz.fastpaths(t,e)),i.output||(i=Uz(t,e)),kt.compileRe(i,e,r,n)};kt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};kt.constants=Mqe;bde.exports=kt});var xde=b((VBt,Ade)=>{"use strict";Ade.exports=Tde()});var jz=b((qBt,Pde)=>{"use strict";var Rde=J("util"),Ide=nde(),Cs=xde(),Bz=mS(),wde=t=>t===""||t==="./",Cde=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},_t=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,s=new Set,o=0,a=u=>{s.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<e.length;u++){let d=Cs(String(e[u]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&o++;for(let p of t){let h=d(p,!0);(f?!h.isMatch:h.isMatch)&&(f?n.add(h.output):(n.delete(h.output),i.add(h.output)))}}let l=(o===e.length?[...s]:[...i]).filter(u=>!n.has(u));if(r&&l.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(u=>u.replace(/\\/g,"")):e}return l};_t.match=_t;_t.matcher=(t,e)=>Cs(t,e);_t.isMatch=(t,e,r)=>Cs(e,r)(t);_t.any=_t.isMatch;_t.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(_t(t,e,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};_t.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rde.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>_t.contains(t,n,r));if(typeof e=="string"){if(wde(t)||wde(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return _t.isMatch(t,e,{...r,contains:!0})};_t.matchKeys=(t,e,r)=>{if(!Bz.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=_t(Object.keys(t),e,r),i={};for(let s of n)i[s]=t[s];return i};_t.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=Cs(String(i),r);if(n.some(o=>s(o)))return!0}return!1};_t.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=Cs(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};_t.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rde.inspect(t)}"`);return[].concat(e).every(n=>Cs(n,r)(t))};_t.capture=(t,e,r)=>{let n=Bz.isWindows(r),s=Cs.makeRe(String(t),{...r,capture:!0}).exec(n?Bz.toPosixSlashes(e):e);if(s)return s.slice(1).map(o=>o===void 0?"":o)};_t.makeRe=(...t)=>Cs.makeRe(...t);_t.scan=(...t)=>Cs.scan(...t);_t.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of Ide(String(n),e))r.push(Cs.parse(i,e));return r};_t.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Cde(t)?[t]:Ide(t,e)};_t.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return _t.braces(t,{...e,expand:!0})};_t.hasBraces=Cde;Pde.exports=_t});var Bde=b(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.isAbsolute=Ce.partitionAbsoluteAndRelative=Ce.removeDuplicateSlashes=Ce.matchAny=Ce.convertPatternsToRe=Ce.makeRe=Ce.getPatternParts=Ce.expandBraceExpansion=Ce.expandPatternsWithBraceExpansion=Ce.isAffectDepthOfReadingPattern=Ce.endsWithSlashGlobStar=Ce.hasGlobStar=Ce.getBaseDirectory=Ce.isPatternRelatedToParentDirectory=Ce.getPatternsOutsideCurrentDirectory=Ce.getPatternsInsideCurrentDirectory=Ce.getPositivePatterns=Ce.getNegativePatterns=Ce.isPositivePattern=Ce.isNegativePattern=Ce.convertToNegativePattern=Ce.convertToPositivePattern=Ce.isDynamicPattern=Ce.isStaticPattern=void 0;var Ode=J("path"),Lqe=vue(),zz=jz(),Nde="**",$qe="\\",Uqe=/[*?]|^!/,Fqe=/\[[^[]*]/,Bqe=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,jqe=/[!*+?@]\([^(]*\)/,zqe=/,|\.\./,Gqe=/(?!^)\/{2,}/g;function kde(t,e={}){return!Mde(t,e)}Ce.isStaticPattern=kde;function Mde(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes($qe)||Uqe.test(t)||Fqe.test(t)||Bqe.test(t)||e.extglob!==!1&&jqe.test(t)||e.braceExpansion!==!1&&Vqe(t))}Ce.isDynamicPattern=Mde;function Vqe(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return zqe.test(n)}function qqe(t){return UI(t)?t.slice(1):t}Ce.convertToPositivePattern=qqe;function Hqe(t){return"!"+t}Ce.convertToNegativePattern=Hqe;function UI(t){return t.startsWith("!")&&t[1]!=="("}Ce.isNegativePattern=UI;function Dde(t){return!UI(t)}Ce.isPositivePattern=Dde;function Wqe(t){return t.filter(UI)}Ce.getNegativePatterns=Wqe;function Yqe(t){return t.filter(Dde)}Ce.getPositivePatterns=Yqe;function Kqe(t){return t.filter(e=>!Gz(e))}Ce.getPatternsInsideCurrentDirectory=Kqe;function Zqe(t){return t.filter(Gz)}Ce.getPatternsOutsideCurrentDirectory=Zqe;function Gz(t){return t.startsWith("..")||t.startsWith("./..")}Ce.isPatternRelatedToParentDirectory=Gz;function Jqe(t){return Lqe(t,{flipBackslashes:!1})}Ce.getBaseDirectory=Jqe;function Xqe(t){return t.includes(Nde)}Ce.hasGlobStar=Xqe;function Lde(t){return t.endsWith("/"+Nde)}Ce.endsWithSlashGlobStar=Lde;function Qqe(t){let e=Ode.basename(t);return Lde(t)||kde(e)}Ce.isAffectDepthOfReadingPattern=Qqe;function e6e(t){return t.reduce((e,r)=>e.concat($de(r)),[])}Ce.expandPatternsWithBraceExpansion=e6e;function $de(t){let e=zz.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}Ce.expandBraceExpansion=$de;function t6e(t,e){let{parts:r}=zz.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}Ce.getPatternParts=t6e;function Ude(t,e){return zz.makeRe(t,e)}Ce.makeRe=Ude;function r6e(t,e){return t.map(r=>Ude(r,e))}Ce.convertPatternsToRe=r6e;function n6e(t,e){return e.some(r=>r.test(t))}Ce.matchAny=n6e;function i6e(t){return t.replace(Gqe,"/")}Ce.removeDuplicateSlashes=i6e;function s6e(t){let e=[],r=[];for(let n of t)Fde(n)?e.push(n):r.push(n);return[e,r]}Ce.partitionAbsoluteAndRelative=s6e;function Fde(t){return Ode.isAbsolute(t)}Ce.isAbsolute=Fde});var Vde=b((WBt,Gde)=>{"use strict";var o6e=J("stream"),jde=o6e.PassThrough,a6e=Array.prototype.slice;Gde.exports=c6e;function c6e(){let t=[],e=a6e.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,s=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=jde(n);function a(){for(let u=0,d=arguments.length;u<d;u++)t.push(zde(arguments[u],n));return c(),this}function c(){if(r)return;r=!0;let u=t.shift();if(!u){process.nextTick(l);return}Array.isArray(u)||(u=[u]);let d=u.length+1;function f(){--d>0||(r=!1,c())}function p(h){function m(){h.removeListener("merge2UnpipeEnd",m),h.removeListener("end",m),s&&h.removeListener("error",E),f()}function E(T){o.emit("error",T)}if(h._readableState.endEmitted)return f();h.on("merge2UnpipeEnd",m),h.on("end",m),s&&h.on("error",E),h.pipe(o,{end:!1}),h.resume()}for(let h=0;h<u.length;h++)p(u[h]);f()}function l(){r=!1,o.emit("queueDrain"),i&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function zde(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=zde(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(jde(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var Hde=b(FI=>{"use strict";Object.defineProperty(FI,"__esModule",{value:!0});FI.merge=void 0;var l6e=Vde();function u6e(t){let e=l6e(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>qde(t)),e.once("end",()=>qde(t)),e}FI.merge=u6e;function qde(t){t.forEach(e=>e.emit("close"))}});var Wde=b(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.isEmpty=kh.isString=void 0;function d6e(t){return typeof t=="string"}kh.isString=d6e;function f6e(t){return t===""}kh.isEmpty=f6e});var Vo=b(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.string=vr.stream=vr.pattern=vr.path=vr.fs=vr.errno=vr.array=void 0;var p6e=cue();vr.array=p6e;var h6e=lue();vr.errno=h6e;var m6e=uue();vr.fs=m6e;var g6e=hue();vr.path=g6e;var _6e=Bde();vr.pattern=_6e;var y6e=Hde();vr.stream=y6e;var S6e=Wde();vr.string=S6e});var Jde=b(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.convertPatternGroupToTask=br.convertPatternGroupsToTasks=br.groupPatternsByBaseDirectory=br.getNegativePatternsAsPositive=br.getPositivePatterns=br.convertPatternsToTasks=br.generate=void 0;var Mi=Vo();function E6e(t,e){let r=Yde(t,e),n=Yde(e.ignore,e),i=Kde(r),s=Zde(r,n),o=i.filter(u=>Mi.pattern.isStaticPattern(u,e)),a=i.filter(u=>Mi.pattern.isDynamicPattern(u,e)),c=Vz(o,s,!1),l=Vz(a,s,!0);return c.concat(l)}br.generate=E6e;function Yde(t,e){let r=t;return e.braceExpansion&&(r=Mi.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Mi.pattern.removeDuplicateSlashes(n))}function Vz(t,e,r){let n=[],i=Mi.pattern.getPatternsOutsideCurrentDirectory(t),s=Mi.pattern.getPatternsInsideCurrentDirectory(t),o=qz(i),a=qz(s);return n.push(...Hz(o,e,r)),"."in a?n.push(Wz(".",s,e,r)):n.push(...Hz(a,e,r)),n}br.convertPatternsToTasks=Vz;function Kde(t){return Mi.pattern.getPositivePatterns(t)}br.getPositivePatterns=Kde;function Zde(t,e){return Mi.pattern.getNegativePatterns(t).concat(e).map(Mi.pattern.convertToPositivePattern)}br.getNegativePatternsAsPositive=Zde;function qz(t){let e={};return t.reduce((r,n)=>{let i=Mi.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}br.groupPatternsByBaseDirectory=qz;function Hz(t,e,r){return Object.keys(t).map(n=>Wz(n,t[n],e,r))}br.convertPatternGroupsToTasks=Hz;function Wz(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Mi.pattern.convertToNegativePattern))}}br.convertPatternGroupToTask=Wz});var Qde=b(BI=>{"use strict";Object.defineProperty(BI,"__esModule",{value:!0});BI.read=void 0;function v6e(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){Xde(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){Yz(r,i);return}e.fs.stat(t,(s,o)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){Xde(r,s);return}Yz(r,i);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),Yz(r,o)})})}BI.read=v6e;function Xde(t,e){t(e)}function Yz(t,e){t(null,e)}});var efe=b(jI=>{"use strict";Object.defineProperty(jI,"__esModule",{value:!0});jI.read=void 0;function b6e(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}jI.read=b6e});var tfe=b(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.createFileSystemAdapter=Ec.FILE_SYSTEM_ADAPTER=void 0;var zI=J("fs");Ec.FILE_SYSTEM_ADAPTER={lstat:zI.lstat,stat:zI.stat,lstatSync:zI.lstatSync,statSync:zI.statSync};function T6e(t){return t===void 0?Ec.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ec.FILE_SYSTEM_ADAPTER),t)}Ec.createFileSystemAdapter=T6e});var rfe=b(Zz=>{"use strict";Object.defineProperty(Zz,"__esModule",{value:!0});var A6e=tfe(),Kz=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=A6e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};Zz.default=Kz});var xu=b(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.statSync=vc.stat=vc.Settings=void 0;var nfe=Qde(),x6e=efe(),Jz=rfe();vc.Settings=Jz.default;function w6e(t,e,r){if(typeof e=="function"){nfe.read(t,Xz(),e);return}nfe.read(t,Xz(e),r)}vc.stat=w6e;function R6e(t,e){let r=Xz(e);return x6e.read(t,r)}vc.statSync=R6e;function Xz(t={}){return t instanceof Jz.default?t:new Jz.default(t)}});var ofe=b((njt,sfe)=>{"use strict";var ife;sfe.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(ife||(ife=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var cfe=b((ijt,afe)=>{"use strict";afe.exports=C6e;var I6e=ofe();function C6e(t,e){let r,n,i,s=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function o(c){function l(){e&&e(c,r),e=null}s?I6e(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&o(l)}n?i?i.forEach(function(c){t[c](function(l,u){a(c,l,u)})}):t.forEach(function(c,l){c(function(u,d){a(l,u,d)})}):o(null),s=!1}});var Qz=b(VI=>{"use strict";Object.defineProperty(VI,"__esModule",{value:!0});VI.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var GI=process.versions.node.split(".");if(GI[0]===void 0||GI[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var lfe=Number.parseInt(GI[0],10),P6e=Number.parseInt(GI[1],10),ufe=10,O6e=10,N6e=lfe>ufe,k6e=lfe===ufe&&P6e>=O6e;VI.IS_SUPPORT_READDIR_WITH_FILE_TYPES=N6e||k6e});var dfe=b(qI=>{"use strict";Object.defineProperty(qI,"__esModule",{value:!0});qI.createDirentFromStats=void 0;var eG=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function M6e(t,e){return new eG(t,e)}qI.createDirentFromStats=M6e});var tG=b(HI=>{"use strict";Object.defineProperty(HI,"__esModule",{value:!0});HI.fs=void 0;var D6e=dfe();HI.fs=D6e});var rG=b(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.joinPathSegments=void 0;function L6e(t,e,r){return t.endsWith(r)?t+e:t+r+e}WI.joinPathSegments=L6e});var _fe=b(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.readdir=bc.readdirWithFileTypes=bc.read=void 0;var $6e=xu(),ffe=cfe(),U6e=Qz(),pfe=tG(),hfe=rG();function F6e(t,e,r){if(!e.stats&&U6e.IS_SUPPORT_READDIR_WITH_FILE_TYPES){mfe(t,e,r);return}gfe(t,e,r)}bc.read=F6e;function mfe(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){YI(r,n);return}let s=i.map(a=>({dirent:a,name:a.name,path:hfe.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){nG(r,s);return}let o=s.map(a=>B6e(a,e));ffe(o,(a,c)=>{if(a!==null){YI(r,a);return}nG(r,c)})})}bc.readdirWithFileTypes=mfe;function B6e(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,i)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=pfe.fs.createDirentFromStats(t.name,i),r(null,t)})}}function gfe(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){YI(r,n);return}let s=i.map(o=>{let a=hfe.joinPathSegments(t,o,e.pathSegmentSeparator);return c=>{$6e.stat(a,e.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let d={name:o,path:a,dirent:pfe.fs.createDirentFromStats(o,u)};e.stats&&(d.stats=u),c(null,d)})}});ffe(s,(o,a)=>{if(o!==null){YI(r,o);return}nG(r,a)})})}bc.readdir=gfe;function YI(t,e){t(e)}function nG(t,e){t(null,e)}});var bfe=b(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.readdir=Tc.readdirWithFileTypes=Tc.read=void 0;var j6e=xu(),z6e=Qz(),yfe=tG(),Sfe=rG();function G6e(t,e){return!e.stats&&z6e.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Efe(t,e):vfe(t,e)}Tc.read=G6e;function Efe(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:Sfe.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let s=e.fs.statSync(i.path);i.dirent=yfe.fs.createDirentFromStats(i.name,s)}catch(s){if(e.throwErrorOnBrokenSymbolicLink)throw s}return i})}Tc.readdirWithFileTypes=Efe;function vfe(t,e){return e.fs.readdirSync(t).map(n=>{let i=Sfe.joinPathSegments(t,n,e.pathSegmentSeparator),s=j6e.statSync(i,e.fsStatSettings),o={name:n,path:i,dirent:yfe.fs.createDirentFromStats(n,s)};return e.stats&&(o.stats=s),o})}Tc.readdir=vfe});var Tfe=b(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.createFileSystemAdapter=Ac.FILE_SYSTEM_ADAPTER=void 0;var Mh=J("fs");Ac.FILE_SYSTEM_ADAPTER={lstat:Mh.lstat,stat:Mh.stat,lstatSync:Mh.lstatSync,statSync:Mh.statSync,readdir:Mh.readdir,readdirSync:Mh.readdirSync};function V6e(t){return t===void 0?Ac.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ac.FILE_SYSTEM_ADAPTER),t)}Ac.createFileSystemAdapter=V6e});var Afe=b(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});var q6e=J("path"),H6e=xu(),W6e=Tfe(),iG=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=W6e.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,q6e.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new H6e.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};sG.default=iG});var KI=b(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.Settings=xc.scandirSync=xc.scandir=void 0;var xfe=_fe(),Y6e=bfe(),oG=Afe();xc.Settings=oG.default;function K6e(t,e,r){if(typeof e=="function"){xfe.read(t,aG(),e);return}xfe.read(t,aG(e),r)}xc.scandir=K6e;function Z6e(t,e){let r=aG(e);return Y6e.read(t,r)}xc.scandirSync=Z6e;function aG(t={}){return t instanceof oG.default?t:new oG.default(t)}});var Rfe=b((hjt,wfe)=>{"use strict";function J6e(t){var e=new t,r=e;function n(){var s=e;return s.next?e=s.next:(e=new t,r=e),s.next=null,s}function i(s){r.next=s,r=s}return{get:n,release:i}}wfe.exports=J6e});var Cfe=b((mjt,cG)=>{"use strict";var X6e=Rfe();function Ife(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=X6e(Q6e),i=null,s=null,o=0,a=null,c={push:m,drain:nn,saturated:nn,pause:u,paused:!1,get concurrency(){return r},set concurrency(P){if(!(P>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=P,!c.paused)for(;i&&o<r;)o++,T()},running:l,resume:p,idle:h,length:d,getQueue:f,unshift:E,empty:nn,kill:v,killAndDrain:A,error:R,abort:S};return c;function l(){return o}function u(){c.paused=!0}function d(){for(var P=i,L=0;P;)P=P.next,L++;return L}function f(){for(var P=i,L=[];P;)L.push(P.value),P=P.next;return L}function p(){if(c.paused){if(c.paused=!1,i===null){o++,T();return}for(;i&&o<r;)o++,T()}}function h(){return o===0&&c.length()===0}function m(P,L){var I=n.get();I.context=t,I.release=T,I.value=P,I.callback=L||nn,I.errorHandler=a,o>=r||c.paused?s?(s.next=I,s=I):(i=I,s=I,c.saturated()):(o++,e.call(t,I.value,I.worked))}function E(P,L){var I=n.get();I.context=t,I.release=T,I.value=P,I.callback=L||nn,I.errorHandler=a,o>=r||c.paused?i?(I.next=i,i=I):(i=I,s=I,c.saturated()):(o++,e.call(t,I.value,I.worked))}function T(P){P&&n.release(P);var L=i;L&&o<=r?c.paused?o--:(s===i&&(s=null),i=L.next,L.next=null,e.call(t,L.value,L.worked),s===null&&c.empty()):--o===0&&c.drain()}function v(){i=null,s=null,c.drain=nn}function A(){i=null,s=null,c.drain(),c.drain=nn}function S(){var P=i;for(i=null,s=null;P;){var L=P.next,I=P.callback,O=P.errorHandler,j=P.value,_=P.context;P.value=null,P.callback=nn,P.errorHandler=null,O&&O(new Error("abort"),j),I.call(_,new Error("abort")),P.release(P),P=L}c.drain=nn}function R(P){a=P}}function nn(){}function Q6e(){this.value=null,this.callback=nn,this.next=null,this.release=nn,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,s=t.errorHandler,o=t.value;t.value=null,t.callback=nn,t.errorHandler&&s(r,o),i.call(t.context,r,n),t.release(t)}}function eHe(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(u,d){e.call(this,u).then(function(f){d(null,f)},d)}var i=Ife(t,n,r),s=i.push,o=i.unshift;return i.push=a,i.unshift=c,i.drained=l,i;function a(u){var d=new Promise(function(f,p){s(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(nn),d}function c(u){var d=new Promise(function(f,p){o(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(nn),d}function l(){var u=new Promise(function(d){process.nextTick(function(){if(i.idle())d();else{var f=i.drain;i.drain=function(){typeof f=="function"&&f(),d(),i.drain=f}}})});return u}}cG.exports=Ife;cG.exports.promise=eHe});var ZI=b(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.joinPathSegments=Ps.replacePathSegmentSeparator=Ps.isAppliedFilter=Ps.isFatalError=void 0;function tHe(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Ps.isFatalError=tHe;function rHe(t,e){return t===null||t(e)}Ps.isAppliedFilter=rHe;function nHe(t,e){return t.split(/[/\\]/).join(e)}Ps.replacePathSegmentSeparator=nHe;function iHe(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Ps.joinPathSegments=iHe});var dG=b(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});var sHe=ZI(),lG=class{constructor(e,r){this._root=e,this._settings=r,this._root=sHe.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};uG.default=lG});var hG=b(pG=>{"use strict";Object.defineProperty(pG,"__esModule",{value:!0});var oHe=J("events"),aHe=KI(),cHe=Cfe(),JI=ZI(),lHe=dG(),fG=class extends lHe.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=aHe.scandir,this._emitter=new oHe.EventEmitter,this._queue=cHe(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,i=>{i!==null&&this._handleError(i)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,i)=>{if(n!==null){r(n,void 0);return}for(let s of i)this._handleEntry(s,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!JI.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=JI.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),JI.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&JI.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};pG.default=fG});var Pfe=b(gG=>{"use strict";Object.defineProperty(gG,"__esModule",{value:!0});var uHe=hG(),mG=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new uHe.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{dHe(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{fHe(e,this._storage)}),this._reader.read()}};gG.default=mG;function dHe(t,e){t(e)}function fHe(t,e){t(null,e)}});var Ofe=b(yG=>{"use strict";Object.defineProperty(yG,"__esModule",{value:!0});var pHe=J("stream"),hHe=hG(),_G=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new hHe.default(this._root,this._settings),this._stream=new pHe.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};yG.default=_G});var Nfe=b(EG=>{"use strict";Object.defineProperty(EG,"__esModule",{value:!0});var mHe=KI(),XI=ZI(),gHe=dG(),SG=class extends gHe.default{constructor(){super(...arguments),this._scandir=mHe.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let i of n)this._handleEntry(i,r)}catch(n){this._handleError(n)}}_handleError(e){if(XI.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=XI.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),XI.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&XI.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};EG.default=SG});var kfe=b(bG=>{"use strict";Object.defineProperty(bG,"__esModule",{value:!0});var _He=Nfe(),vG=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new _He.default(this._root,this._settings)}read(){return this._reader.read()}};bG.default=vG});var Mfe=b(AG=>{"use strict";Object.defineProperty(AG,"__esModule",{value:!0});var yHe=J("path"),SHe=KI(),TG=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,yHe.sep),this.fsScandirSettings=new SHe.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};AG.default=TG});var eC=b(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.Settings=Os.walkStream=Os.walkSync=Os.walk=void 0;var Dfe=Pfe(),EHe=Ofe(),vHe=kfe(),xG=Mfe();Os.Settings=xG.default;function bHe(t,e,r){if(typeof e=="function"){new Dfe.default(t,QI()).read(e);return}new Dfe.default(t,QI(e)).read(r)}Os.walk=bHe;function THe(t,e){let r=QI(e);return new vHe.default(t,r).read()}Os.walkSync=THe;function AHe(t,e){let r=QI(e);return new EHe.default(t,r).read()}Os.walkStream=AHe;function QI(t={}){return t instanceof xG.default?t:new xG.default(t)}});var tC=b(RG=>{"use strict";Object.defineProperty(RG,"__esModule",{value:!0});var xHe=J("path"),wHe=xu(),Lfe=Vo(),wG=class{constructor(e){this._settings=e,this._fsStatSettings=new wHe.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return xHe.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:Lfe.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!Lfe.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};RG.default=wG});var PG=b(CG=>{"use strict";Object.defineProperty(CG,"__esModule",{value:!0});var RHe=J("stream"),IHe=xu(),CHe=eC(),PHe=tC(),IG=class extends PHe.default{constructor(){super(...arguments),this._walkStream=CHe.walkStream,this._stat=IHe.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new RHe.PassThrough({objectMode:!0});i._write=(s,o,a)=>this._getEntry(n[s],e[s],r).then(c=>{c!==null&&r.entryFilter(c)&&i.push(c),s===n.length-1&&i.end(),a()}).catch(a);for(let s=0;s<n.length;s++)i.write(s);return i}_getEntry(e,r,n){return this._getStat(e).then(i=>this._makeEntry(i,r)).catch(i=>{if(n.errorFilter(i))return null;throw i})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(i,s)=>i===null?r(s):n(i))})}};CG.default=IG});var $fe=b(NG=>{"use strict";Object.defineProperty(NG,"__esModule",{value:!0});var OHe=eC(),NHe=tC(),kHe=PG(),OG=class extends NHe.default{constructor(){super(...arguments),this._walkAsync=OHe.walk,this._readerStream=new kHe.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(s,o)=>{s===null?n(o):i(s)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((s,o)=>{i.once("error",o),i.on("data",a=>n.push(a)),i.once("end",()=>s(n))})}};NG.default=OG});var Ufe=b(MG=>{"use strict";Object.defineProperty(MG,"__esModule",{value:!0});var yS=Vo(),kG=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return yS.pattern.getPatternParts(e,this._micromatchOptions).map(n=>yS.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:yS.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return yS.array.splitWhen(e,r=>r.dynamic&&yS.pattern.hasGlobStar(r.pattern))}};MG.default=kG});var Ffe=b(LG=>{"use strict";Object.defineProperty(LG,"__esModule",{value:!0});var MHe=Ufe(),DG=class extends MHe.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(s=>!s.complete||s.segments.length>n);for(let s of i){let o=s.sections[0];if(!s.complete&&n>o.length||r.every((c,l)=>{let u=s.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};LG.default=DG});var Bfe=b(UG=>{"use strict";Object.defineProperty(UG,"__esModule",{value:!0});var rC=Vo(),DHe=Ffe(),$G=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),s=this._getNegativePatternsRe(n);return o=>this._filter(e,o,i,s)}_getMatcher(e){return new DHe.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(rC.pattern.isAffectDepthOfReadingPattern);return rC.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let s=rC.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(s,n)?!1:this._isSkippedByNegativePatterns(s,i)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let i=e.split("/").length;return n-i}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!rC.pattern.matchAny(e,r)}};UG.default=$G});var jfe=b(BG=>{"use strict";Object.defineProperty(BG,"__esModule",{value:!0});var wc=Vo(),FG=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=wc.pattern.partitionAbsoluteAndRelative(r),s={positive:{all:wc.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:wc.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:wc.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,s)}_filter(e,r){let n=wc.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(n),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let i=wc.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=wc.pattern.matchAny(e,r);return!i&&n?wc.pattern.matchAny(e+"/",r):i}};BG.default=FG});var zfe=b(zG=>{"use strict";Object.defineProperty(zG,"__esModule",{value:!0});var LHe=Vo(),jG=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return LHe.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};zG.default=jG});var Vfe=b(VG=>{"use strict";Object.defineProperty(VG,"__esModule",{value:!0});var Gfe=Vo(),GG=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=Gfe.path.makeAbsolute(this._settings.cwd,r),r=Gfe.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};VG.default=GG});var nC=b(HG=>{"use strict";Object.defineProperty(HG,"__esModule",{value:!0});var $He=J("path"),UHe=Bfe(),FHe=jfe(),BHe=zfe(),jHe=Vfe(),qG=class{constructor(e){this._settings=e,this.errorFilter=new BHe.default(this._settings),this.entryFilter=new FHe.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new UHe.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new jHe.default(this._settings)}_getRootDirectory(e){return $He.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};HG.default=qG});var qfe=b(YG=>{"use strict";Object.defineProperty(YG,"__esModule",{value:!0});var zHe=$fe(),GHe=nC(),WG=class extends GHe.default{constructor(){super(...arguments),this._reader=new zHe.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(s=>n.transform(s))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};YG.default=WG});var Hfe=b(ZG=>{"use strict";Object.defineProperty(ZG,"__esModule",{value:!0});var VHe=J("stream"),qHe=PG(),HHe=nC(),KG=class extends HHe.default{constructor(){super(...arguments),this._reader=new qHe.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),s=new VHe.Readable({objectMode:!0,read:()=>{}});return i.once("error",o=>s.emit("error",o)).on("data",o=>s.emit("data",n.transform(o))).once("end",()=>s.emit("end")),s.once("close",()=>i.destroy()),s}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};ZG.default=KG});var Wfe=b(XG=>{"use strict";Object.defineProperty(XG,"__esModule",{value:!0});var WHe=xu(),YHe=eC(),KHe=tC(),JG=class extends KHe.default{constructor(){super(...arguments),this._walkSync=YHe.walkSync,this._statSync=WHe.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let s=this._getFullEntryPath(i),o=this._getEntry(s,i,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let i=this._getStat(e);return this._makeEntry(i,r)}catch(i){if(n.errorFilter(i))return null;throw i}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};XG.default=JG});var Yfe=b(e4=>{"use strict";Object.defineProperty(e4,"__esModule",{value:!0});var ZHe=Wfe(),JHe=nC(),QG=class extends JHe.default{constructor(){super(...arguments),this._reader=new ZHe.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};e4.default=QG});var Kfe=b(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var Dh=J("fs"),XHe=J("os"),QHe=Math.max(XHe.cpus().length,1);Lh.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:Dh.lstat,lstatSync:Dh.lstatSync,stat:Dh.stat,statSync:Dh.statSync,readdir:Dh.readdir,readdirSync:Dh.readdirSync};var t4=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,QHe),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},Lh.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};Lh.default=t4});var SS=b((Bjt,Jfe)=>{"use strict";var Zfe=Jde(),e3e=qfe(),t3e=Hfe(),r3e=Yfe(),r4=Kfe(),Xn=Vo();async function n4(t,e){Di(t);let r=i4(t,e3e.default,e),n=await Promise.all(r);return Xn.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(l,u){Di(l);let d=i4(l,r3e.default,u);return Xn.array.flatten(d)}t.sync=e;function r(l,u){Di(l);let d=i4(l,t3e.default,u);return Xn.stream.merge(d)}t.stream=r;function n(l,u){Di(l);let d=[].concat(l),f=new r4.default(u);return Zfe.generate(d,f)}t.generateTasks=n;function i(l,u){Di(l);let d=new r4.default(u);return Xn.pattern.isDynamicPattern(l,d)}t.isDynamicPattern=i;function s(l){return Di(l),Xn.path.escape(l)}t.escapePath=s;function o(l){return Di(l),Xn.path.convertPathToPattern(l)}t.convertPathToPattern=o;let a;(function(l){function u(f){return Di(f),Xn.path.escapePosixPath(f)}l.escapePath=u;function d(f){return Di(f),Xn.path.convertPosixPathToPattern(f)}l.convertPathToPattern=d})(a=t.posix||(t.posix={}));let c;(function(l){function u(f){return Di(f),Xn.path.escapeWindowsPath(f)}l.escapePath=u;function d(f){return Di(f),Xn.path.convertWindowsPathToPattern(f)}l.convertPathToPattern=d})(c=t.win32||(t.win32={}))})(n4||(n4={}));function i4(t,e,r){let n=[].concat(t),i=new r4.default(r),s=Zfe.generate(n,i),o=new e(i);return s.map(o.read,o)}function Di(t){if(![].concat(t).every(n=>Xn.string.isString(n)&&!Xn.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Jfe.exports=n4});var p4=b((Yjt,oC)=>{"use strict";function rpe(t){return Array.isArray(t)?t:[t]}var s3e=void 0,c4="",epe=" ",a4="\\",o3e=/^\s+$/,a3e=/(?:[^\\]|^)\\$/,c3e=/^\\!/,l3e=/^\\#/,u3e=/\r?\n/g,d3e=/^\.{0,2}\/|^\.{1,2}$/,f3e=/\/$/,$h="/",npe="node-ignore";typeof Symbol<"u"&&(npe=Symbol.for("node-ignore"));var ipe=npe,Uh=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),p3e=/([0-z])-([0-z])/g,spe=()=>!1,h3e=t=>t.replace(p3e,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:c4),m3e=t=>{let{length:e}=t;return t.slice(0,e-e%2)},g3e=[[/^\uFEFF/,()=>c4],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?epe:c4)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+epe}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>a4],[/\\\\/g,()=>a4],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===a4?`\\[${r}${m3e(n)}${i}`:i==="]"&&n.length%2===0?`[${h3e(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],_3e=/(^|\\\/)?\\\*$/,ES="regex",iC="checkRegex",tpe="_",y3e={[ES](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[iC](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},S3e=t=>g3e.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),sC=t=>typeof t=="string",E3e=t=>t&&sC(t)&&!o3e.test(t)&&!a3e.test(t)&&t.indexOf("#")!==0,v3e=t=>t.split(u3e).filter(Boolean),l4=class{constructor(e,r,n,i,s,o){this.pattern=e,this.mark=r,this.negative=s,Uh(this,"body",n),Uh(this,"ignoreCase",i),Uh(this,"regexPrefix",o)}get regex(){let e=tpe+ES;return this[e]?this[e]:this._make(ES,e)}get checkRegex(){let e=tpe+iC;return this[e]?this[e]:this._make(iC,e)}_make(e,r){let n=this.regexPrefix.replace(_3e,y3e[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Uh(this,r,i)}},b3e=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(c3e,"!").replace(l3e,"#");let s=S3e(i);return new l4(t,e,i,r,n,s)},u4=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[ipe]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(sC(e)&&(e={pattern:e}),E3e(e.pattern)){let r=b3e(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,rpe(sC(e)?v3e(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,s=!1,o;this._rules.forEach(c=>{let{negative:l}=c;s===l&&i!==s||l&&!i&&!s&&!r||!c[n].test(e)||(i=!l,s=l,o=l?s3e:c)});let a={ignored:i,unignored:s};return o&&(a.rule=o),a}},T3e=(t,e)=>{throw new e(t)},qo=(t,e,r)=>sC(t)?t?qo.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),ope=t=>d3e.test(t);qo.isNotRelative=ope;qo.convert=t=>t;var d4=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){Uh(this,ipe,!0),this._rules=new u4(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let s=e&&qo.convert(e);return qo(s,e,this._strictPathCheck?T3e:spe),this._t(s,r,n,i)}checkIgnore(e){if(!f3e.test(e))return this.test(e);let r=e.split($h).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join($h)+$h,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,iC)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split($h).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,ES);let s=this._t(i.join($h)+$h,r,n,i);return r[e]=s.ignored?s:this._rules.test(e,n,ES)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return rpe(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},f4=t=>new d4(t),A3e=t=>qo(t&&qo.convert(t),t,spe),ape=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");qo.convert=t;let e=/^[a-z]:\//i;qo.isNotRelative=r=>e.test(r)||ope(r)};typeof process<"u"&&process.platform==="win32"&&ape();oC.exports=f4;f4.default=f4;oC.exports.isPathValid=A3e;Uh(oC.exports,Symbol.for("setupWindows"),ape)});var H4=b(rme=>{"use strict";rme.parse=function(t,e){return new q4(t,e).parse()};var q4=class t{constructor(e,r){this.source=e,this.transform=r||WYe,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e==="\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var r;(this.recorded.length>0||e)&&(r=this.recorded.join(""),r==="NULL"&&!e&&(r=null),r!==null&&(r=this.transform(r)),this.entries.push(r),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var r,n,i;for(this.consumeDimensions();!this.isEof();)if(r=this.nextCharacter(),r.value==="{"&&!i)this.dimension++,this.dimension>1&&(n=new t(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);else if(r.value==="}"&&!i){if(this.dimension--,!this.dimension&&(this.newEntry(),e))return this.entries}else r.value==='"'&&!r.escaped?(i&&this.newEntry(!0),i=!i):r.value===","&&!i?this.newEntry():this.record(r.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this.entries}};function WYe(t){return t}});var W4=b((Z4t,nme)=>{"use strict";var YYe=H4();nme.exports={create:function(t,e){return{parse:function(){return YYe.parse(t,e)}}}}});var ome=b((J4t,sme)=>{"use strict";var KYe=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,ZYe=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,JYe=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,XYe=/^-?infinity$/;sme.exports=function(e){if(XYe.test(e))return Number(e.replace("i","I"));var r=KYe.exec(e);if(!r)return QYe(e)||null;var n=!!r[8],i=parseInt(r[1],10);n&&(i=ime(i));var s=parseInt(r[2],10)-1,o=r[3],a=parseInt(r[4],10),c=parseInt(r[5],10),l=parseInt(r[6],10),u=r[7];u=u?1e3*parseFloat(u):0;var d,f=eKe(e);return f!=null?(d=new Date(Date.UTC(i,s,o,a,c,l,u)),Y4(i)&&d.setUTCFullYear(i),f!==0&&d.setTime(d.getTime()-f)):(d=new Date(i,s,o,a,c,l,u),Y4(i)&&d.setFullYear(i)),d};function QYe(t){var e=ZYe.exec(t);if(e){var r=parseInt(e[1],10),n=!!e[4];n&&(r=ime(r));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(r,i,s);return Y4(r)&&o.setFullYear(r),o}}function eKe(t){if(t.endsWith("+00"))return 0;var e=JYe.exec(t.split(" ")[1]);if(e){var r=e[1];if(r==="Z")return 0;var n=r==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt(e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}function ime(t){return-(t-1)}function Y4(t){return t>=0&&t<100}});var cme=b((X4t,ame)=>{"use strict";ame.exports=rKe;var tKe=Object.prototype.hasOwnProperty;function rKe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)tKe.call(r,n)&&(t[n]=r[n])}return t}});var dme=b((Q4t,ume)=>{"use strict";var nKe=cme();ume.exports=Zh;function Zh(t){if(!(this instanceof Zh))return new Zh(t);nKe(this,mKe(t))}var iKe=["seconds","minutes","hours","days","months","years"];Zh.prototype.toPostgres=function(){var t=iKe.filter(this.hasOwnProperty,this);return this.milliseconds&&t.indexOf("seconds")<0&&t.push("seconds"),t.length===0?"0":t.map(function(e){var r=this[e]||0;return e==="seconds"&&this.milliseconds&&(r=(r+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),r+" "+e},this).join(" ")};var sKe={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},oKe=["years","months","days"],aKe=["hours","minutes","seconds"];Zh.prototype.toISOString=Zh.prototype.toISO=function(){var t=oKe.map(r,this).join(""),e=aKe.map(r,this).join("");return"P"+t+"T"+e;function r(n){var i=this[n]||0;return n==="seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),i+sKe[n]}};var K4="([+-]?\\d+)",cKe=K4+"\\s+years?",lKe=K4+"\\s+mons?",uKe=K4+"\\s+days?",dKe="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",fKe=new RegExp([cKe,lKe,uKe,dKe].map(function(t){return"("+t+")?"}).join("\\s*")),lme={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},pKe=["hours","minutes","seconds","milliseconds"];function hKe(t){var e=t+"000000".slice(t.length);return parseInt(e,10)/1e3}function mKe(t){if(!t)return{};var e=fKe.exec(t),r=e[8]==="-";return Object.keys(lme).reduce(function(n,i){var s=lme[i],o=e[s];return!o||(o=i==="milliseconds"?hKe(o):parseInt(o,10),!o)||(r&&~pKe.indexOf(i)&&(o*=-1),n[i]=o),n},{})}});var hme=b((eVt,pme)=>{"use strict";var fme=Buffer.from||Buffer;pme.exports=function(e){if(/^\\x/.test(e))return fme(e.substr(2),"hex");for(var r="",n=0;n<e.length;)if(e[n]!=="\\")r+=e[n],++n;else if(/[0-7]{3}/.test(e.substr(n+1,3)))r+=String.fromCharCode(parseInt(e.substr(n+1,3),8)),n+=4;else{for(var i=1;n+i<e.length&&e[n+i]==="\\";)i++;for(var s=0;s<Math.floor(i/2);++s)r+="\\";n+=Math.floor(i/2)*2}return fme(r,"binary")}});var vme=b((tVt,Eme)=>{"use strict";var IS=H4(),CS=W4(),vC=ome(),gme=dme(),_me=hme();function bC(t){return function(r){return r===null?r:t(r)}}function yme(t){return t===null?t:t==="TRUE"||t==="t"||t==="true"||t==="y"||t==="yes"||t==="on"||t==="1"}function gKe(t){return t?IS.parse(t,yme):null}function _Ke(t){return parseInt(t,10)}function Z4(t){return t?IS.parse(t,bC(_Ke)):null}function yKe(t){return t?IS.parse(t,bC(function(e){return Sme(e).trim()})):null}var SKe=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=eV(r)),r});return e.parse()},J4=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=parseFloat(r)),r});return e.parse()},Qn=function(t){if(!t)return null;var e=CS.create(t);return e.parse()},X4=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=vC(r)),r});return e.parse()},EKe=function(t){if(!t)return null;var e=CS.create(t,function(r){return r!==null&&(r=gme(r)),r});return e.parse()},vKe=function(t){return t?IS.parse(t,bC(_me)):null},Q4=function(t){return parseInt(t,10)},Sme=function(t){var e=String(t);return/^\d+$/.test(e)?e:t},mme=function(t){return t?IS.parse(t,bC(JSON.parse)):null},eV=function(t){return t[0]!=="("?null:(t=t.substring(1,t.length-1).split(","),{x:parseFloat(t[0]),y:parseFloat(t[1])})},bKe=function(t){if(t[0]!=="<"&&t[1]!=="(")return null;for(var e="(",r="",n=!1,i=2;i<t.length-1;i++){if(n||(e+=t[i]),t[i]===")"){n=!0;continue}else if(!n)continue;t[i]!==","&&(r+=t[i])}var s=eV(e);return s.radius=parseFloat(r),s},TKe=function(t){t(20,Sme),t(21,Q4),t(23,Q4),t(26,Q4),t(700,parseFloat),t(701,parseFloat),t(16,yme),t(1082,vC),t(1114,vC),t(1184,vC),t(600,eV),t(651,Qn),t(718,bKe),t(1e3,gKe),t(1001,vKe),t(1005,Z4),t(1007,Z4),t(1028,Z4),t(1016,yKe),t(1017,SKe),t(1021,J4),t(1022,J4),t(1231,J4),t(1014,Qn),t(1015,Qn),t(1008,Qn),t(1009,Qn),t(1040,Qn),t(1041,Qn),t(1115,X4),t(1182,X4),t(1185,X4),t(1186,gme),t(1187,EKe),t(17,_me),t(114,JSON.parse.bind(JSON)),t(3802,JSON.parse.bind(JSON)),t(199,mme),t(3807,mme),t(3907,Qn),t(2951,Qn),t(791,Qn),t(1183,Qn),t(1270,Qn)};Eme.exports={init:TKe}});var Tme=b((rVt,bme)=>{"use strict";var sn=1e6;function AKe(t){var e=t.readInt32BE(0),r=t.readUInt32BE(4),n="";e<0&&(e=~e+(r===0),r=~r+1>>>0,n="-");var i="",s,o,a,c,l,u;{if(s=e%sn,e=e/sn>>>0,o=4294967296*s+r,r=o/sn>>>0,a=""+(o-sn*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(s=e%sn,e=e/sn>>>0,o=4294967296*s+r,r=o/sn>>>0,a=""+(o-sn*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(s=e%sn,e=e/sn>>>0,o=4294967296*s+r,r=o/sn>>>0,a=""+(o-sn*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}return s=e%sn,o=4294967296*s+r,a=""+o%sn,n+a+i}bme.exports=AKe});var Ime=b((nVt,Rme)=>{"use strict";var xKe=Tme(),bt=function(t,e,r,n,i){r=r||0,n=n||!1,i=i||function(p,h,m){return p*Math.pow(2,m)+h};var s=r>>3,o=function(p){return n?~p&255:p},a=255,c=8-r%8;e<c&&(a=255<<8-e&255,c=e),r&&(a=a>>r%8);var l=0;r%8+e>=8&&(l=i(0,o(t[s])&a,c));for(var u=e+r>>3,d=s+1;d<u;d++)l=i(l,o(t[d]),8);var f=(e+r)%8;return f>0&&(l=i(l,o(t[u])>>8-f,f)),l},wme=function(t,e,r){var n=Math.pow(2,r-1)-1,i=bt(t,1),s=bt(t,r,1);if(s===0)return 0;var o=1,a=function(l,u,d){l===0&&(l=1);for(var f=1;f<=d;f++)o/=2,(u&1<<d-f)>0&&(l+=o);return l},c=bt(t,e,r+1,!1,a);return s==Math.pow(2,r+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*c},wKe=function(t){return bt(t,1)==1?-1*(bt(t,15,1,!0)+1):bt(t,15,1)},Ame=function(t){return bt(t,1)==1?-1*(bt(t,31,1,!0)+1):bt(t,31,1)},RKe=function(t){return wme(t,23,8)},IKe=function(t){return wme(t,52,11)},CKe=function(t){var e=bt(t,16,32);if(e==49152)return NaN;for(var r=Math.pow(1e4,bt(t,16,16)),n=0,i=[],s=bt(t,16),o=0;o<s;o++)n+=bt(t,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,bt(t,16,48));return(e===0?1:-1)*Math.round(n*a)/a},xme=function(t,e){var r=bt(e,1),n=bt(e,63,1),i=new Date((r===0?1:-1)*n/1e3+9466848e5);return t||i.setTime(i.getTime()+i.getTimezoneOffset()*6e4),i.usec=n%1e3,i.getMicroSeconds=function(){return this.usec},i.setMicroSeconds=function(s){this.usec=s},i.getUTCMicroSeconds=function(){return this.usec},i},PS=function(t){for(var e=bt(t,32),r=bt(t,32,32),n=bt(t,32,64),i=96,s=[],o=0;o<e;o++)s[o]=bt(t,32,i),i+=32,i+=32;var a=function(l){var u=bt(t,32,i);if(i+=32,u==4294967295)return null;var d;if(l==23||l==20)return d=bt(t,u*8,i),i+=u*8,d;if(l==25)return d=t.toString(this.encoding,i>>3,(i+=u<<3)>>3),d;console.log("ERROR: ElementType not implemented: "+l)},c=function(l,u){var d=[],f;if(l.length>1){var p=l.shift();for(f=0;f<p;f++)d[f]=c(l,u);l.unshift(p)}else for(f=0;f<l[0];f++)d[f]=a(u);return d};return c(s,n)},PKe=function(t){return t.toString("utf8")},OKe=function(t){return t===null?null:bt(t,8)>0},NKe=function(t){t(20,xKe),t(21,wKe),t(23,Ame),t(26,Ame),t(1700,CKe),t(700,RKe),t(701,IKe),t(16,OKe),t(1114,xme.bind(null,!1)),t(1184,xme.bind(null,!0)),t(1e3,PS),t(1007,PS),t(1016,PS),t(1008,PS),t(1009,PS),t(25,PKe)};Rme.exports={init:NKe}});var Pme=b((iVt,Cme)=>{"use strict";Cme.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var kS=b(NS=>{"use strict";var kKe=vme(),MKe=Ime(),DKe=W4(),LKe=Pme();NS.getTypeParser=$Ke;NS.setTypeParser=UKe;NS.arrayParser=DKe;NS.builtins=LKe;var OS={text:{},binary:{}};function Ome(t){return String(t)}function $Ke(t,e){return e=e||"text",OS[e]&&OS[e][t]||Ome}function UKe(t,e,r){typeof e=="function"&&(r=e,e="text"),OS[e][t]=r}kKe.init(function(t,e){OS.text[t]=e});MKe.init(function(t,e){OS.binary[t]=e})});var MS=b((oVt,tV)=>{"use strict";var Nme;try{Nme=process.platform==="win32"?process.env.USERNAME:process.env.USER}catch{}tV.exports={host:"localhost",user:Nme,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var Jh=kS(),FKe=Jh.getTypeParser(20,"text"),BKe=Jh.getTypeParser(1016,"text");tV.exports.__defineSetter__("parseInt8",function(t){Jh.setTypeParser(20,"text",t?Jh.getTypeParser(23,"text"):FKe),Jh.setTypeParser(1016,"text",t?Jh.getTypeParser(1007,"text"):BKe)})});var Xh=b((aVt,Mme)=>{"use strict";var jKe=MS(),{isDate:zKe}=J("util/types");function GKe(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function kme(t){let e="{";for(let r=0;r<t.length;r++){r>0&&(e+=",");let n=t[r];n==null?e+="NULL":Array.isArray(n)?e+=kme(n):ArrayBuffer.isView(n)?(n instanceof Buffer||(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),e+="\\\\x"+n.toString("hex")):e+=GKe(TC(n))}return e+="}",e}var TC=function(t,e){return t==null?null:typeof t=="object"?t instanceof Buffer?t:ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):zKe(t)?jKe.parseInputDatesAsUTC?HKe(t):qKe(t):Array.isArray(t)?kme(t):VKe(t,e):t.toString()};function VKe(t,e){if(t&&typeof t.toPostgres=="function"){if(e=e||[],e.indexOf(t)!==-1)throw new Error('circular reference detected while preparing "'+t+'" for query');return e.push(t),TC(t.toPostgres(TC),e)}return JSON.stringify(t)}function qKe(t){let e=-t.getTimezoneOffset(),r=t.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);let i=String(r).padStart(4,"0")+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0")+"T"+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")+"."+String(t.getMilliseconds()).padStart(3,"0");return e<0?(i+="-",e*=-1):i+="+",i+=String(Math.floor(e/60)).padStart(2,"0")+":"+String(e%60).padStart(2,"0"),n&&(i+=" BC"),i}function HKe(t){let e=t.getUTCFullYear(),r=e<1;r&&(e=Math.abs(e)+1);let n=String(e).padStart(4,"0")+"-"+String(t.getUTCMonth()+1).padStart(2,"0")+"-"+String(t.getUTCDate()).padStart(2,"0")+"T"+String(t.getUTCHours()).padStart(2,"0")+":"+String(t.getUTCMinutes()).padStart(2,"0")+":"+String(t.getUTCSeconds()).padStart(2,"0")+"."+String(t.getUTCMilliseconds()).padStart(3,"0");return n+="+00:00",r&&(n+=" BC"),n}function WKe(t,e,r){return t=typeof t=="string"?{text:t}:t,e&&(typeof e=="function"?t.callback=e:t.values=e),r&&(t.callback=r),t}var YKe=function(t){return'"'+t.replace(/"/g,'""')+'"'},KKe=function(t){let e=!1,r="'";if(t==null||typeof t!="string")return"''";for(let n=0;n<t.length;n++){let i=t[n];i==="'"?r+=i+i:i==="\\"?(r+=i+i,e=!0):r+=i}return r+="'",e===!0&&(r=" E"+r),r};Mme.exports={prepareValue:function(e){return TC(e)},normalizeQueryConfig:WKe,escapeIdentifier:YKe,escapeLiteral:KKe}});var iV=b((cVt,$me)=>{"use strict";var Dme=J("crypto");$me.exports={postgresMd5PasswordHash:JKe,randomBytes:ZKe,deriveKey:t8e,sha256:XKe,hashByName:QKe,hmacSha256:e8e,md5:rV};var Lme=Dme.webcrypto||globalThis.crypto,Iu=Lme.subtle,nV=new TextEncoder;function ZKe(t){return Lme.getRandomValues(Buffer.alloc(t))}async function rV(t){try{return Dme.createHash("md5").update(t,"utf-8").digest("hex")}catch{let r=typeof t=="string"?nV.encode(t):t,n=await Iu.digest("MD5",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}}async function JKe(t,e,r){let n=await rV(e+t);return"md5"+await rV(Buffer.concat([Buffer.from(n),r]))}async function XKe(t){return await Iu.digest("SHA-256",t)}async function QKe(t,e){return await Iu.digest(t,e)}async function e8e(t,e){let r=await Iu.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await Iu.sign("HMAC",r,nV.encode(e))}async function t8e(t,e,r){let n=await Iu.importKey("raw",nV.encode(t),"PBKDF2",!1,["deriveBits"]),i={name:"PBKDF2",hash:"SHA-256",salt:e,iterations:r};return await Iu.deriveBits(i,n,256,["deriveBits"])}});var Bme=b((lVt,Fme)=>{"use strict";function Cu(t,e){return new Error("SASL channel binding: "+t+" when parsing public certificate "+e.toString("base64"))}function sV(t,e){let r=t[e++];if(r<128)return{length:r,index:e};let n=r&127;if(n>4)throw Cu("bad length",t);r=0;for(let i=0;i<n;i++)r=r<<8|t[e++];return{length:r,index:e}}function Ume(t,e){if(t[e++]!==6)throw Cu("non-OID data",t);let{length:r,index:n}=sV(t,e);e=n;let i=e+r,s=t[e++],o=(s/40>>0)+"."+s%40;for(;e<i;){let a=0;for(;e<i;){let c=t[e++];if(a=a<<7|c&127,c<128)break}o+="."+a}return{oid:o,index:e}}function DS(t,e){if(t[e++]!==48)throw Cu("non-sequence data",t);return sV(t,e)}function r8e(t,e){e===void 0&&(e=0),e=DS(t,e).index;let{length:r,index:n}=DS(t,e);e=n+r,e=DS(t,e).index;let{oid:i,index:s}=Ume(t,e);switch(i){case"1.2.840.113549.1.1.4":return"MD5";case"1.2.840.113549.1.1.5":return"SHA-1";case"1.2.840.113549.1.1.11":return"SHA-256";case"1.2.840.113549.1.1.12":return"SHA-384";case"1.2.840.113549.1.1.13":return"SHA-512";case"1.2.840.113549.1.1.14":return"SHA-224";case"1.2.840.113549.1.1.15":return"SHA512-224";case"1.2.840.113549.1.1.16":return"SHA512-256";case"1.2.840.10045.4.1":return"SHA-1";case"1.2.840.10045.4.3.1":return"SHA-224";case"1.2.840.10045.4.3.2":return"SHA-256";case"1.2.840.10045.4.3.3":return"SHA-384";case"1.2.840.10045.4.3.4":return"SHA-512";case"1.2.840.113549.1.1.10":{if(e=s,e=DS(t,e).index,t[e++]!==160)throw Cu("non-tag data",t);e=sV(t,e).index,e=DS(t,e).index;let{oid:o}=Ume(t,e);switch(o){case"1.2.840.113549.2.5":return"MD5";case"1.3.14.3.2.26":return"SHA-1";case"2.16.840.1.101.3.4.2.1":return"SHA-256";case"2.16.840.1.101.3.4.2.2":return"SHA-384";case"2.16.840.1.101.3.4.2.3":return"SHA-512"}throw Cu("unknown hash OID "+o,t)}case"1.3.101.110":case"1.3.101.112":return"SHA-512";case"1.3.101.111":case"1.3.101.113":throw Cu("Ed448 certificate channel binding is not currently supported by Postgres")}throw Cu("unknown OID "+i,t)}Fme.exports={signatureAlgorithmHashFromCertificate:r8e}});var Vme=b((uVt,Gme)=>{"use strict";var Cc=iV(),{signatureAlgorithmHashFromCertificate:n8e}=Bme();function i8e(t){let e=/[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g,r=/[\u00AD\u034F\u1806\u180B\u180C\u180D\u200C\u200D\u2060\uFE00-\uFE0F\uFEFF]/g;return t.replace(e," ").replace(r,"").normalize("NFKC")}var oV=1e5;function s8e(t,e,r=oV){let n=["SCRAM-SHA-256"];e&&n.unshift("SCRAM-SHA-256-PLUS");let i=n.find(a=>t.includes(a));if(!i)throw new Error("SASL: Only mechanism(s) "+n.join(" and ")+" are supported");if(i==="SCRAM-SHA-256-PLUS"&&typeof e.getPeerCertificate!="function")throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");let s=Cc.randomBytes(18).toString("base64");return{mechanism:i,clientNonce:s,response:(i==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":e?"y":"n")+",,n=*,r="+s,message:"SASLInitialResponse",scramMaxIterations:r}}async function o8e(t,e,r,n){if(t.message!=="SASLInitialResponse")throw new Error("SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(e==="")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof r!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let i=l8e(r);if(i.nonce.startsWith(t.clientNonce)){if(i.nonce.length===t.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");let s=typeof t.scramMaxIterations=="number"?t.scramMaxIterations:oV;if(s!==0&&i.iteration>s)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count "+i.iteration+" exceeds scramMaxIterations of "+s);let o="n=*,r="+t.clientNonce,a="r="+i.nonce+",s="+i.salt+",i="+i.iteration,c=n?"eSws":"biws";if(t.mechanism==="SCRAM-SHA-256-PLUS"){let A=n.getPeerCertificate().raw,S=n8e(A);(S==="MD5"||S==="SHA-1")&&(S="SHA-256");let R=await Cc.hashByName(S,A);c=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(R)]).toString("base64")}let l="c="+c+",r="+i.nonce,u=o+","+a+","+l,d=Buffer.from(i.salt,"base64"),f=await Cc.deriveKey(i8e(e),d,i.iteration),p=await Cc.hmacSha256(f,"Client Key"),h=await Cc.sha256(p),m=await Cc.hmacSha256(h,u),E=d8e(Buffer.from(p),Buffer.from(m)).toString("base64"),T=await Cc.hmacSha256(f,"Server Key"),v=await Cc.hmacSha256(T,u);t.message="SASLResponse",t.serverSignature=Buffer.from(v).toString("base64"),t.response=l+",p="+E}function a8e(t,e){if(t.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=u8e(e);if(r!==t.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function c8e(t){if(typeof t!="string")throw new TypeError("SASL: text must be a string");return t.split("").map((e,r)=>t.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function jme(t){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(t)}function zme(t){if(typeof t!="string")throw new TypeError("SASL: attribute pairs text must be a string");return new Map(t.split(",").map(e=>{if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let r=e[0],n=e.substring(2);return[r,n]}))}function l8e(t){let e=zme(t),r=e.get("r");if(r){if(!c8e(r))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!jme(n))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");let s=parseInt(i,10);return{nonce:r,salt:n,iteration:s}}function u8e(t){let e=zme(t),r=e.get("e"),n=e.get("v");if(r)throw new Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server returned error: "${r}"`);if(n){if(!jme(n))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:n}}function d8e(t,e){if(!Buffer.isBuffer(t))throw new TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(e))throw new TypeError("second argument must be a Buffer");if(t.length!==e.length)throw new Error("Buffer lengths must match");if(t.length===0)throw new Error("Buffers cannot be empty");return Buffer.from(t.map((r,n)=>t[n]^e[n]))}Gme.exports={startSession:s8e,continueSession:o8e,finalizeSession:a8e,DEFAULT_MAX_SCRAM_ITERATIONS:oV}});var xC=b((dVt,qme)=>{"use strict";var f8e=kS();function AC(t){this._types=t||f8e,this.text={},this.binary={}}AC.prototype.getOverrides=function(t){switch(t){case"text":return this.text;case"binary":return this.binary;default:return{}}};AC.prototype.setTypeParser=function(t,e,r){typeof e=="function"&&(r=e,e="text"),this.getOverrides(e)[t]=r};AC.prototype.getTypeParser=function(t,e){return e=e||"text",this.getOverrides(e)[t]||this._types.getTypeParser(t,e)};qme.exports=AC});var Yme=b((fVt,Wme)=>{"use strict";function Qh(t,e={}){if(t.charAt(0)==="/"){let c=t.split(" ");return{host:c[0],database:c[1]}}let r=Object.create(null),n,i=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(t)&&(t=encodeURI(t).replace(/%25(\d\d)/g,"%$1"));try{try{n=new URL(t,"postgres://base")}catch{n=new URL(t.replace("@/","@___DUMMY___/"),"postgres://base"),i=!0}}catch(c){throw c.input&&(c.input="*****REDACTED*****"),c}for(let c of n.searchParams.entries())r[c[0]]=c[1];if(r.user=r.user||decodeURIComponent(n.username),r.password=r.password||decodeURIComponent(n.password),n.protocol=="socket:")return r.host=decodeURI(n.pathname),r.database=n.searchParams.get("db"),r.client_encoding=n.searchParams.get("encoding"),r;let s=i?"":n.hostname;r.host?s&&/^%2f/i.test(s)&&(n.pathname=s+n.pathname):r.host=decodeURIComponent(s),r.port||(r.port=n.port);let o=n.pathname.slice(1)||null;r.database=o?decodeURI(o):null,(r.ssl==="true"||r.ssl==="1")&&(r.ssl=!0),r.ssl==="0"&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});let a=r.sslcert||r.sslkey||r.sslrootcert?J("fs"):null;if(r.sslcert&&(r.ssl.cert=a.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=a.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=a.readFileSync(r.sslrootcert).toString()),e.useLibpqCompat&&r.uselibpqcompat)throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");if(r.uselibpqcompat==="true"||e.useLibpqCompat)switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":{r.ssl.rejectUnauthorized=!1;break}case"require":{r.sslrootcert?r.ssl.checkServerIdentity=function(){}:r.ssl.rejectUnauthorized=!1;break}case"verify-ca":{if(!r.ssl.ca)throw new Error("SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.");r.ssl.checkServerIdentity=function(){};break}case"verify-full":break}else switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":{r.sslmode!=="verify-full"&&aV(r.sslmode);break}case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}function p8e(t){return Object.entries(t).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),Object.create(null))}function Hme(t){return Object.entries(t).reduce((r,[n,i])=>{if(n==="ssl"){let s=i;typeof s=="boolean"&&(r[n]=s),typeof s=="object"&&(r[n]=p8e(s))}else if(i!=null)if(n==="port"){if(i!==""){let s=parseInt(i,10);if(isNaN(s))throw new Error(`Invalid ${n}: ${i}`);r[n]=s}}else r[n]=i;return r},Object.create(null))}function h8e(t){return Hme(Qh(t))}function aV(t){!aV.warned&&typeof process<"u"&&process.emitWarning&&(aV.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
25
25
|
In the next major version (pg-connection-string v3.0.0 and pg v9.0.0), these modes will adopt standard libpq semantics, which have weaker security guarantees.
|
|
26
26
|
|
|
27
27
|
To prepare for this change:
|
|
@@ -29,7 +29,7 @@ To prepare for this change:
|
|
|
29
29
|
- If you want libpq compatibility now, use 'uselibpqcompat=true&sslmode=${t}'
|
|
30
30
|
|
|
31
31
|
See https://www.postgresql.org/docs/current/libpq-ssl.html for libpq SSL mode definitions.`))}Wme.exports=Qh;Qh.parse=Qh;Qh.toClientConfig=Hme;Qh.parseIntoClientConfig=h8e});var lV=b((pVt,Jme)=>{"use strict";var m8e=J("dns"),Zme=MS(),Kme=Yme().parse,zr=function(t,e,r){return e[t]?e[t]:(r===void 0?r=process.env["PG"+t.toUpperCase()]:r===!1||(r=process.env[r]),r||Zme[t])},g8e=function(){switch(process.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return Zme.ssl},em=function(t){return"'"+(""+t).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},ei=function(t,e,r){let n=e[r];n!=null&&t.push(r+"="+em(n))},cV=class{constructor(e){e=typeof e=="string"?Kme(e):e||{},e.connectionString&&(e=Object.assign({},e,Kme(e.connectionString))),this.user=zr("user",e),this.database=zr("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(zr("port",e),10),this.host=zr("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:zr("password",e)}),this.binary=zr("binary",e),this.options=zr("options",e),this.ssl=typeof e.ssl>"u"?g8e():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=zr("client_encoding",e),this.replication=zr("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=zr("application_name",e,"PGAPPNAME"),this.fallback_application_name=zr("fallback_application_name",e,!1),this.statement_timeout=zr("statement_timeout",e,!1),this.lock_timeout=zr("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=zr("idle_in_transaction_session_timeout",e,!1),this.query_timeout=zr("query_timeout",e,!1),e.connectionTimeoutMillis===void 0?this.connect_timeout=process.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){let r=[];ei(r,this,"user"),ei(r,this,"password"),ei(r,this,"port"),ei(r,this,"application_name"),ei(r,this,"fallback_application_name"),ei(r,this,"connect_timeout"),ei(r,this,"options");let n=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ei(r,n,"sslmode"),ei(r,n,"sslca"),ei(r,n,"sslkey"),ei(r,n,"sslcert"),ei(r,n,"sslrootcert"),this.database&&r.push("dbname="+em(this.database)),this.replication&&r.push("replication="+em(this.replication)),this.host&&r.push("host="+em(this.host)),this.isDomainSocket)return e(null,r.join(" "));this.client_encoding&&r.push("client_encoding="+em(this.client_encoding)),m8e.lookup(this.host,function(i,s){return i?e(i,null):(r.push("hostaddr="+em(s)),e(null,r.join(" ")))})}};Jme.exports=cV});var dV=b((hVt,Qme)=>{"use strict";var _8e=kS(),Xme=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,uV=class{constructor(e,r){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=r,this.RowCtor=null,this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray),this._prebuiltEmptyResultObject=null}addCommandComplete(e){let r;e.text?r=Xme.exec(e.text):r=Xme.exec(e.command),r&&(this.command=r[1],r[3]?(this.oid=parseInt(r[2],10),this.rowCount=parseInt(r[3],10)):r[2]&&(this.rowCount=parseInt(r[2],10)))}_parseRowAsArray(e){let r=new Array(e.length);for(let n=0,i=e.length;n<i;n++){let s=e[n];s!==null?r[n]=this._parsers[n](s):r[n]=null}return r}parseRow(e){let r={...this._prebuiltEmptyResultObject};for(let n=0,i=e.length;n<i;n++){let s=e[n],o=this.fields[n].name;if(s!==null){let a=this.fields[n].format==="binary"?Buffer.from(s):s;r[o]=this._parsers[n](a)}else r[o]=null}return r}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=new Array(e.length));let r=Object.create(null);for(let n=0;n<e.length;n++){let i=e[n];r[i.name]=null,this._types?this._parsers[n]=this._types.getTypeParser(i.dataTypeID,i.format||"text"):this._parsers[n]=_8e.getTypeParser(i.dataTypeID,i.format||"text")}this._prebuiltEmptyResultObject={...r}}};Qme.exports=uV});var nge=b((mVt,rge)=>{"use strict";var{EventEmitter:y8e}=J("events"),ege=dV(),tge=Xh(),fV=class extends y8e{constructor(e,r,n){super(),e=tge.normalizeQueryConfig(e,r,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.queryMode=e.queryMode,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,process.domain&&e.callback&&(this.callback=process.domain.bind(e.callback)),this._result=new ege(this._rowMode,this.types),this._results=this._result,this._canceledDueToError=!1}requiresPreparation(){return this.queryMode==="extended"||this.name||this.rows?!0:!this.text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new ege(this._rowMode,this._result._types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(e){let r;if(!this._canceledDueToError){try{r=this._result.parseRow(e.fields)}catch(n){this._canceledDueToError=n;return}this.emit("row",r,this._result),this._accumulateRows&&this._result.addRow(r)}}handleCommandComplete(e,r){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&r.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,r){if(this._canceledDueToError&&(e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(r){process.nextTick(()=>{throw r})}this.emit("end",this._results)}submit(e){if(typeof this.text!="string"&&typeof this.name!="string")return new Error("A query must have either text or a name. Supplying neither is unsupported.");let r=e.parsedStatements[this.name];if(this.text&&r&&this.text!==r)return new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);if(this.values&&!Array.isArray(this.values))return new Error("Query values must be an array");if(this.requiresPreparation()){e.stream.cork&&e.stream.cork();try{this.prepare(e)}finally{e.stream.uncork&&e.stream.uncork()}}else e.query(this.text);return null}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,r){e.execute({portal:this.portal,rows:r}),r?e.flush():e.sync()}prepare(e){this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:tge.prepareValue})}catch(r){this.handleError(r,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail("No source stream defined")}handleCopyData(e,r){}};rge.exports=fV});var RV=b(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.NoticeMessage=ke.DataRowMessage=ke.CommandCompleteMessage=ke.ReadyForQueryMessage=ke.NotificationResponseMessage=ke.BackendKeyDataMessage=ke.AuthenticationMD5Password=ke.ParameterStatusMessage=ke.ParameterDescriptionMessage=ke.RowDescriptionMessage=ke.Field=ke.CopyResponse=ke.CopyDataMessage=ke.DatabaseError=ke.copyDone=ke.emptyQuery=ke.replicationStart=ke.portalSuspended=ke.noData=ke.closeComplete=ke.bindComplete=ke.parseComplete=void 0;ke.parseComplete={name:"parseComplete",length:5};ke.bindComplete={name:"bindComplete",length:5};ke.closeComplete={name:"closeComplete",length:5};ke.noData={name:"noData",length:5};ke.portalSuspended={name:"portalSuspended",length:5};ke.replicationStart={name:"replicationStart",length:4};ke.emptyQuery={name:"emptyQuery",length:4};ke.copyDone={name:"copyDone",length:4};var pV=class extends Error{constructor(e,r,n){super(e),this.length=r,this.name=n}};ke.DatabaseError=pV;var hV=class{constructor(e,r){this.length=e,this.chunk=r,this.name="copyData"}};ke.CopyDataMessage=hV;var mV=class{constructor(e,r,n,i){this.length=e,this.name=r,this.binary=n,this.columnTypes=new Array(i)}};ke.CopyResponse=mV;var gV=class{constructor(e,r,n,i,s,o,a){this.name=e,this.tableID=r,this.columnID=n,this.dataTypeID=i,this.dataTypeSize=s,this.dataTypeModifier=o,this.format=a}};ke.Field=gV;var _V=class{constructor(e,r){this.length=e,this.fieldCount=r,this.name="rowDescription",this.fields=new Array(this.fieldCount)}};ke.RowDescriptionMessage=_V;var yV=class{constructor(e,r){this.length=e,this.parameterCount=r,this.name="parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};ke.ParameterDescriptionMessage=yV;var SV=class{constructor(e,r,n){this.length=e,this.parameterName=r,this.parameterValue=n,this.name="parameterStatus"}};ke.ParameterStatusMessage=SV;var EV=class{constructor(e,r){this.length=e,this.salt=r,this.name="authenticationMD5Password"}};ke.AuthenticationMD5Password=EV;var vV=class{constructor(e,r,n){this.length=e,this.processID=r,this.secretKey=n,this.name="backendKeyData"}};ke.BackendKeyDataMessage=vV;var bV=class{constructor(e,r,n,i){this.length=e,this.processId=r,this.channel=n,this.payload=i,this.name="notification"}};ke.NotificationResponseMessage=bV;var TV=class{constructor(e,r){this.length=e,this.status=r,this.name="readyForQuery"}};ke.ReadyForQueryMessage=TV;var AV=class{constructor(e,r){this.length=e,this.text=r,this.name="commandComplete"}};ke.CommandCompleteMessage=AV;var xV=class{constructor(e,r){this.length=e,this.fields=r,this.name="dataRow",this.fieldCount=r.length}};ke.DataRowMessage=xV;var wV=class{constructor(e,r){this.length=e,this.message=r,this.name="notice"}};ke.NoticeMessage=wV});var ige=b(wC=>{"use strict";Object.defineProperty(wC,"__esModule",{value:!0});wC.Writer=void 0;var IV=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let n=this.buffer,i=n.length+(n.length>>1)+e;this.buffer=Buffer.allocUnsafe(i),n.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(!e)this.ensure(1);else{let r=Buffer.byteLength(e);this.ensure(r+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=r}return this.buffer[this.offset++]=0,this}addString(e=""){let r=Buffer.byteLength(e);return this.ensure(r),this.buffer.write(e,this.offset),this.offset+=r,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let r=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(r,this.headerPosition+1)}return this.buffer.slice(e?0:5,this.offset)}flush(e){let r=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(this.size),r}};wC.Writer=IV});var oge=b(IC=>{"use strict";Object.defineProperty(IC,"__esModule",{value:!0});IC.serialize=void 0;var CV=ige(),yt=new CV.Writer,S8e=t=>{yt.addInt16(3).addInt16(0);for(let n of Object.keys(t))yt.addCString(n).addCString(t[n]);yt.addCString("client_encoding").addCString("UTF8");let e=yt.addCString("").flush(),r=e.length+4;return new CV.Writer().addInt32(r).add(e).flush()},E8e=()=>{let t=Buffer.allocUnsafe(8);return t.writeInt32BE(8,0),t.writeInt32BE(80877103,4),t},v8e=t=>yt.addCString(t).flush(112),b8e=function(t,e){return yt.addCString(t).addInt32(Buffer.byteLength(e)).addString(e),yt.flush(112)},T8e=function(t){return yt.addString(t).flush(112)},A8e=t=>yt.addCString(t).flush(81),sge=[],x8e=t=>{let e=t.name||"";e.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",e,e.length),console.error("This can cause conflicts and silent errors executing queries"));let r=t.types||sge,n=r.length,i=yt.addCString(e).addCString(t.text).addInt16(n);for(let s=0;s<n;s++)i.addInt32(r[s]);return yt.flush(80)},tm=new CV.Writer,w8e=function(t,e){for(let r=0;r<t.length;r++){let n=e?e(t[r],r):t[r];n==null?(yt.addInt16(0),tm.addInt32(-1)):n instanceof Buffer?(yt.addInt16(1),tm.addInt32(n.length),tm.add(n)):(yt.addInt16(0),tm.addInt32(Buffer.byteLength(n)),tm.addString(n))}},R8e=(t={})=>{let e=t.portal||"",r=t.statement||"",n=t.binary||!1,i=t.values||sge,s=i.length;return yt.addCString(e).addCString(r),yt.addInt16(s),w8e(i,t.valueMapper),yt.addInt16(s),yt.add(tm.flush()),yt.addInt16(1),yt.addInt16(n?1:0),yt.flush(66)},I8e=Buffer.from([69,0,0,0,9,0,0,0,0,0]),C8e=t=>{if(!t||!t.portal&&!t.rows)return I8e;let e=t.portal||"",r=t.rows||0,n=Buffer.byteLength(e),i=4+n+1+4,s=Buffer.allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(r,s.length-4),s},P8e=(t,e)=>{let r=Buffer.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(t,8),r.writeInt32BE(e,12),r},PV=(t,e)=>{let n=4+Buffer.byteLength(e)+1,i=Buffer.allocUnsafe(1+n);return i[0]=t,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},O8e=yt.addCString("P").flush(68),N8e=yt.addCString("S").flush(68),k8e=t=>t.name?PV(68,`${t.type}${t.name||""}`):t.type==="P"?O8e:N8e,M8e=t=>{let e=`${t.type}${t.name||""}`;return PV(67,e)},D8e=t=>yt.add(t).flush(100),L8e=t=>PV(102,t),RC=t=>Buffer.from([t,0,0,0,4]),$8e=RC(72),U8e=RC(83),F8e=RC(88),B8e=RC(99),j8e={startup:S8e,password:v8e,requestSsl:E8e,sendSASLInitialResponseMessage:b8e,sendSCRAMClientFinalMessage:T8e,query:A8e,parse:x8e,bind:R8e,execute:C8e,describe:k8e,close:M8e,flush:()=>$8e,sync:()=>U8e,end:()=>F8e,copyData:D8e,copyDone:()=>B8e,copyFail:L8e,cancel:P8e};IC.serialize=j8e});var age=b(CC=>{"use strict";Object.defineProperty(CC,"__esModule",{value:!0});CC.BufferReader=void 0;var OV=class{constructor(e=0){this.offset=e,this.buffer=Buffer.allocUnsafe(0),this.encoding="utf-8"}setBuffer(e,r){this.offset=e,this.buffer=r}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let r=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,r}cstring(){let e=this.offset,r=e;for(;this.buffer[r++]!==0;);return this.offset=r,this.buffer.toString(this.encoding,e,r-1)}bytes(e){let r=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,r}};CC.BufferReader=OV});var dge=b(PC=>{"use strict";Object.defineProperty(PC,"__esModule",{value:!0});PC.Parser=void 0;var Tt=RV(),z8e=age(),kV=1,G8e=4,cge=kV+G8e,Cn=-1,NV=Buffer.allocUnsafe(0),MV=class{constructor(e){if(this.buffer=NV,this.bufferLength=0,this.bufferOffset=0,this.reader=new z8e.BufferReader,e?.mode==="binary")throw new Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,r){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+cge<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE(i+kV),a=kV+o;if(a+i<=n){let c=this.handlePacket(i+cge,s,o,this.buffer);r(c),i+=a}else break}i===n?(this.buffer=NV,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let r=this.bufferLength+e.byteLength;if(r+this.bufferOffset>this.buffer.byteLength){let i;if(r<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)i=this.buffer;else{let s=this.buffer.byteLength*2;for(;r>=s;)s*=2;i=Buffer.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=r}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,r,n,i){let{reader:s}=this;s.setBuffer(e,i);let o;switch(r){case 50:o=Tt.bindComplete;break;case 49:o=Tt.parseComplete;break;case 51:o=Tt.closeComplete;break;case 110:o=Tt.noData;break;case 115:o=Tt.portalSuspended;break;case 99:o=Tt.copyDone;break;case 87:o=Tt.replicationStart;break;case 73:o=Tt.emptyQuery;break;case 68:o=Q8e(s);break;case 67:o=q8e(s);break;case 90:o=V8e(s);break;case 65:o=K8e(s);break;case 82:o=rZe(s,n);break;case 83:o=eZe(s);break;case 75:o=tZe(s);break;case 69:o=lge(s,"error");break;case 78:o=lge(s,"notice");break;case 84:o=Z8e(s);break;case 116:o=X8e(s);break;case 71:o=W8e(s);break;case 72:o=Y8e(s);break;case 100:o=H8e(s,n);break;default:return new Tt.DatabaseError("received invalid response: "+r.toString(16),n,"error")}return s.setBuffer(0,NV),o.length=n,o}};PC.Parser=MV;var V8e=t=>{let e=t.string(1);return new Tt.ReadyForQueryMessage(Cn,e)},q8e=t=>{let e=t.cstring();return new Tt.CommandCompleteMessage(Cn,e)},H8e=(t,e)=>{let r=t.bytes(e-4);return new Tt.CopyDataMessage(Cn,r)},W8e=t=>uge(t,"copyInResponse"),Y8e=t=>uge(t,"copyOutResponse"),uge=(t,e)=>{let r=t.byte()!==0,n=t.int16(),i=new Tt.CopyResponse(Cn,e,r,n);for(let s=0;s<n;s++)i.columnTypes[s]=t.int16();return i},K8e=t=>{let e=t.int32(),r=t.cstring(),n=t.cstring();return new Tt.NotificationResponseMessage(Cn,e,r,n)},Z8e=t=>{let e=t.int16(),r=new Tt.RowDescriptionMessage(Cn,e);for(let n=0;n<e;n++)r.fields[n]=J8e(t);return r},J8e=t=>{let e=t.cstring(),r=t.uint32(),n=t.int16(),i=t.uint32(),s=t.int16(),o=t.int32(),a=t.int16()===0?"text":"binary";return new Tt.Field(e,r,n,i,s,o,a)},X8e=t=>{let e=t.int16(),r=new Tt.ParameterDescriptionMessage(Cn,e);for(let n=0;n<e;n++)r.dataTypeIDs[n]=t.int32();return r},Q8e=t=>{let e=t.int16(),r=new Array(e);for(let n=0;n<e;n++){let i=t.int32();r[n]=i===-1?null:t.string(i)}return new Tt.DataRowMessage(Cn,r)},eZe=t=>{let e=t.cstring(),r=t.cstring();return new Tt.ParameterStatusMessage(Cn,e,r)},tZe=t=>{let e=t.int32(),r=t.int32();return new Tt.BackendKeyDataMessage(Cn,e,r)},rZe=(t,e)=>{let r=t.int32(),n={name:"authenticationOk",length:e};switch(r){case 0:break;case 3:n.length===8&&(n.name="authenticationCleartextPassword");break;case 5:if(n.length===12){n.name="authenticationMD5Password";let i=t.bytes(4);return new Tt.AuthenticationMD5Password(Cn,i)}break;case 10:{n.name="authenticationSASL",n.mechanisms=[];let i;do i=t.cstring(),i&&n.mechanisms.push(i);while(i)}break;case 11:n.name="authenticationSASLContinue",n.data=t.string(e-8);break;case 12:n.name="authenticationSASLFinal",n.data=t.string(e-8);break;default:throw new Error("Unknown authenticationOk message type "+r)}return n},lge=(t,e)=>{let r={},n=t.string(1);for(;n!=="\0";)r[n]=t.cstring(),n=t.string(1);let i=r.M,s=e==="notice"?new Tt.NoticeMessage(Cn,i):new Tt.DatabaseError(i,Cn,e);return s.severity=r.S,s.code=r.C,s.detail=r.D,s.hint=r.H,s.position=r.P,s.internalPosition=r.p,s.internalQuery=r.q,s.where=r.W,s.schema=r.s,s.table=r.t,s.column=r.c,s.dataType=r.d,s.constraint=r.n,s.file=r.F,s.line=r.L,s.routine=r.R,s}});var DV=b(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.DatabaseError=Pc.serialize=Pc.parse=void 0;var nZe=RV();Object.defineProperty(Pc,"DatabaseError",{enumerable:!0,get:function(){return nZe.DatabaseError}});var iZe=oge();Object.defineProperty(Pc,"serialize",{enumerable:!0,get:function(){return iZe.serialize}});var sZe=dge();function oZe(t,e){let r=new sZe.Parser;return t.on("data",n=>r.parse(n,e)),new Promise(n=>t.on("end",()=>n()))}Pc.parse=oZe});var fge=b(LV=>{"use strict";Object.defineProperty(LV,"__esModule",{value:!0});LV.default={}});var hge=b((TVt,pge)=>{"use strict";var{getStream:aZe,getSecureStream:cZe}=fZe();pge.exports={getStream:aZe,getSecureStream:cZe};function lZe(){function t(r){let n=J("net");return new n.Socket}function e(r){return J("tls").connect(r)}return{getStream:t,getSecureStream:e}}function uZe(){function t(r){let{CloudflareSocket:n}=fge();return new n(r)}function e(r){return r.socket.startTls(r),r.socket}return{getStream:t,getSecureStream:e}}function dZe(){if(typeof navigator=="object"&&navigator!==null&&typeof navigator.userAgent=="string")return navigator.userAgent==="Cloudflare-Workers";if(typeof Response=="function"){let t=new Response(null,{cf:{thing:!0}});if(typeof t.cf=="object"&&t.cf!==null&&t.cf.thing)return!0}return!1}function fZe(){return dZe()?uZe():lZe()}});var UV=b((AVt,mge)=>{"use strict";var pZe=J("events").EventEmitter,{parse:hZe,serialize:nr}=DV(),{getStream:mZe,getSecureStream:gZe}=hge(),_Ze=nr.flush(),yZe=nr.sync(),SZe=nr.end(),$V=class extends pZe{constructor(e){super(),e=e||{},this.stream=e.stream||mZe(e.ssl),typeof this.stream=="function"&&(this.stream=this.stream(e)),this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;let r=this;this.on("newListener",function(n){n==="message"&&(r._emitMessage=!0)})}connect(e,r){let n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,r),this.stream.once("connect",function(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=function(s){n._ending&&(s.code==="ECONNRESET"||s.code==="EPIPE")||n.emit("error",s)};if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(s){switch(s.toString("utf8")){case"S":break;case"N":return n.stream.end(),n.emit("error",new Error("The server does not support SSL connections"));default:return n.stream.end(),n.emit("error",new Error("There was an error establishing an SSL connection"))}let a={socket:n.stream};n.ssl!==!0&&(Object.assign(a,n.ssl),"key"in n.ssl&&(a.key=n.ssl.key));let c=J("net");c.isIP&&c.isIP(r)===0&&(a.servername=r);try{n.stream=gZe(a)}catch(l){return n.emit("error",l)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){hZe(e,r=>{let n=r.name==="error"?"errorMessage":r.name;this._emitMessage&&this.emit("message",r),this.emit(n,r)})}requestSsl(){this.stream.write(nr.requestSsl())}startup(e){this.stream.write(nr.startup(e))}cancel(e,r){this._send(nr.cancel(e,r))}password(e){this._send(nr.password(e))}sendSASLInitialResponseMessage(e,r){this._send(nr.sendSASLInitialResponseMessage(e,r))}sendSCRAMClientFinalMessage(e){this._send(nr.sendSCRAMClientFinalMessage(e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(nr.query(e))}parse(e){this._send(nr.parse(e))}bind(e){this._send(nr.bind(e))}execute(e){this._send(nr.execute(e))}flush(){this.stream.writable&&this.stream.write(_Ze)}sync(){this._ending=!0,this._send(yZe)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this.stream.write(SZe,()=>{this.stream.end()})}close(e){this._send(nr.close(e))}describe(e){this._send(nr.describe(e))}sendCopyFromChunk(e){this._send(nr.copyData(e))}endCopyFrom(){this._send(nr.copyDone())}sendCopyFail(e){this._send(nr.copyFail(e))}};mge.exports=$V});var Sge=b((xVt,yge)=>{"use strict";var{Transform:EZe}=J("stream"),{StringDecoder:vZe}=J("string_decoder"),Oc=Symbol("last"),OC=Symbol("decoder");function bZe(t,e,r){let n;if(this.overflow){if(n=this[OC].write(t).split(this.matcher),n.length===1)return r();n.shift(),this.overflow=!1}else this[Oc]+=this[OC].write(t),n=this[Oc].split(this.matcher);this[Oc]=n.pop();for(let i=0;i<n.length;i++)try{_ge(this,this.mapper(n[i]))}catch(s){return r(s)}if(this.overflow=this[Oc].length>this.maxLength,this.overflow&&!this.skipOverflow){r(new Error("maximum buffer reached"));return}r()}function TZe(t){if(this[Oc]+=this[OC].end(),this[Oc])try{_ge(this,this.mapper(this[Oc]))}catch(e){return t(e)}t()}function _ge(t,e){e!==void 0&&t.push(e)}function gge(t){return t}function AZe(t,e,r){switch(t=t||/\r?\n/,e=e||gge,r=r||{},arguments.length){case 1:typeof t=="function"?(e=t,t=/\r?\n/):typeof t=="object"&&!(t instanceof RegExp)&&!t[Symbol.split]&&(r=t,t=/\r?\n/);break;case 2:typeof t=="function"?(r=e,e=t,t=/\r?\n/):typeof e=="object"&&(r=e,e=gge)}r=Object.assign({},r),r.autoDestroy=!0,r.transform=bZe,r.flush=TZe,r.readableObjectMode=!0;let n=new EZe(r);return n[Oc]="",n[OC]=new vZe("utf8"),n.matcher=t,n.mapper=e,n.maxLength=r.maxLength,n.skipOverflow=r.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){this._writableState.errorEmitted=!1,s(i)},n}yge.exports=AZe});var bge=b((wVt,Yo)=>{"use strict";var Ege=J("path"),xZe=J("stream").Stream,wZe=Sge(),vge=J("util"),RZe=5432,NC=process.platform==="win32",LS=process.stderr,IZe=56,CZe=7,PZe=61440,OZe=32768;function NZe(t){return(t&PZe)==OZe}var rm=["host","port","database","user","password"],FV=rm.length,kZe=rm[FV-1];function BV(){var t=LS instanceof xZe&&LS.writable===!0;if(t){var e=Array.prototype.slice.call(arguments).concat(`
|
|
32
|
-
`);LS.write(vge.format.apply(vge,e))}}Object.defineProperty(Yo.exports,"isWin",{get:function(){return NC},set:function(t){NC=t}});Yo.exports.warnTo=function(t){var e=LS;return LS=t,e};Yo.exports.getFileName=function(t){var e=t||process.env,r=e.PGPASSFILE||(NC?Ege.join(e.APPDATA||"./","postgresql","pgpass.conf"):Ege.join(e.HOME||"./",".pgpass"));return r};Yo.exports.usePgPass=function(t,e){return Object.prototype.hasOwnProperty.call(process.env,"PGPASSWORD")?!1:NC?!0:(e=e||"<unkn>",NZe(t.mode)?t.mode&(IZe|CZe)?(BV('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',e),!1):!0:(BV('WARNING: password file "%s" is not a plain file',e),!1))};var MZe=Yo.exports.match=function(t,e){return rm.slice(0,-1).reduce(function(r,n,i){return i==1&&Number(t[n]||RZe)===Number(e[n])?r&&!0:r&&(e[n]==="*"||e[n]===t[n])},!0)};Yo.exports.getPassword=function(t,e,r){var n,i=e.pipe(wZe());function s(c){var l=DZe(c);l&&LZe(l)&&MZe(t,l)&&(n=l[kZe],i.end())}var o=function(){e.destroy(),r(n)},a=function(c){e.destroy(),BV("WARNING: error on reading file: %s",c),r(void 0)};e.on("error",a),i.on("data",s).on("end",o).on("error",a)};var DZe=Yo.exports.parseLine=function(t){if(t.length<11||t.match(/^\s+#/))return null;for(var e="",r="",n=0,i=0,s=0,o={},a=!1,c=function(u,d,f){var p=t.substring(d,f);Object.hasOwnProperty.call(process.env,"PGPASS_NO_DEESCAPE")||(p=p.replace(/\\([:\\])/g,"$1")),o[rm[u]]=p},l=0;l<t.length-1;l+=1){if(e=t.charAt(l+1),r=t.charAt(l),a=n==FV-1,a){c(n,i);break}l>=0&&e==":"&&r!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o).length===FV?o:null,o},LZe=Yo.exports.isValidEntry=function(t){for(var e={0:function(o){return o.length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&&Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length>0},4:function(o){return o.length>0}},r=0;r<rm.length;r+=1){var n=e[r],i=t[rm[r]]||"",s=n(i);if(!s)return!1}return!0}});var Age=b((IVt,jV)=>{"use strict";var RVt=J("path"),Tge=J("fs"),kC=bge();jV.exports=function(t,e){var r=kC.getFileName();Tge.stat(r,function(n,i){if(n||!kC.usePgPass(i,r))return e(void 0);var s=Tge.createReadStream(r);kC.getPassword(t,s,e)})};jV.exports.warnTo=kC.warnTo});var Cge=b((CVt,Ige)=>{"use strict";var $Ze=J("events").EventEmitter,xge=Xh(),$S=J("util"),MC=Vme(),UZe=xC(),FZe=lV(),Rge=nge(),BZe=MS(),jZe=UV(),zZe=iV(),wge=$S.deprecate(()=>{},"Client.activeQuery is deprecated and will be removed in pg@9.0"),GZe=$S.deprecate(()=>{},"Client.queryQueue is deprecated and will be removed in pg@9.0."),VZe=$S.deprecate(()=>{},"pgpass support is deprecated and will be removed in pg@9.0. You can provide an async function as the password property to the Client/Pool constructor that returns a password instead. Within this function you can call the pgpass module in your own code."),qZe=$S.deprecate(()=>{},"Passing a custom Promise implementation to the Client/Pool constructor is deprecated and will be removed in pg@9.0."),HZe=$S.deprecate(()=>{},"Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.");function WZe(t,e){if(typeof t=="number")return Number.isFinite(t)?t:e;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:e}return e}var DC=class extends $Ze{constructor(e){super(),this.connectionParameters=new FZe(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;let r=e||{};r.Promise&&qZe(),this._Promise=r.Promise||global.Promise,this._types=new UZe(r.types),this._ending=!1,this._ended=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this._activeQuery=null,this._txStatus=null,this.enableChannelBinding=!!r.enableChannelBinding,this.scramMaxIterations=WZe(r.scramMaxIterations,MC.DEFAULT_MAX_SCRAM_ITERATIONS),this.connection=r.connection||new jZe({stream:r.stream,ssl:this.connectionParameters.ssl,keepAlive:r.keepAlive||!1,keepAliveInitialDelayMillis:r.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this._queryQueue=[],this.binary=r.binary||BZe.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=r.connectionTimeoutMillis||0}get activeQuery(){return wge(),this._activeQuery}set activeQuery(e){wge(),this._activeQuery=e}_getActiveQuery(){return this._activeQuery}_errorAllQueries(e){let r=i=>{process.nextTick(()=>{i.handleError(e,this.connection)})},n=this._getActiveQuery();n&&(r(n),this._activeQuery=null),this._queryQueue.forEach(r),this._queryQueue.length=0}_connect(e){let r=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let i=new Error("Client has already been connected. You cannot reuse a client.");process.nextTick(()=>{e(i)});return}this._connecting=!0,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{n._ending=!0,n.stream.destroy(new Error("timeout expired"))},this._connectionTimeoutMillis),this.connectionTimeoutHandle.unref&&this.connectionTimeoutHandle.unref()),this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.s.PGSQL."+this.port):n.connect(this.port,this.host),n.on("connect",function(){r.ssl?n.requestSsl():n.startup(r.getStartupConf())}),n.on("sslconnect",function(){n.startup(r.getStartupConf())}),this._attachListeners(n),n.once("end",()=>{let i=this._ending?new Error("Connection terminated"):new Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this._ended=!0,this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(i):this._handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),process.nextTick(()=>{this.emit("end")})})}connect(e){if(e){this._connect(e);return}return new this._Promise((r,n)=>{this._connect(i=>{i?n(i):r(this)})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_getPassword(e){let r=this.connection;if(typeof this.password=="function")this._Promise.resolve().then(()=>this.password(this.connectionParameters)).then(n=>{if(n!==void 0){if(typeof n!="string"){r.emit("error",new TypeError("Password must be a string"));return}this.connectionParameters.password=this.password=n}else this.connectionParameters.password=this.password=null;e()}).catch(n=>{r.emit("error",n)});else if(this.password!==null)e();else try{Age()(this.connectionParameters,i=>{i!==void 0&&(VZe(),this.connectionParameters.password=this.password=i),e()})}catch(n){this.emit("error",n)}}_handleAuthCleartextPassword(e){this._getPassword(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._getPassword(async()=>{try{let r=await zZe.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(r)}catch(r){this.emit("error",r)}})}_handleAuthSASL(e){this._getPassword(()=>{try{this.saslSession=MC.startSession(e.mechanisms,this.enableChannelBinding&&this.connection.stream,this.scramMaxIterations),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(r){this.connection.emit("error",r)}})}async _handleAuthSASLContinue(e){try{await MC.continueSession(this.saslSession,this.password,e.data,this.enableChannelBinding&&this.connection.stream),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(r){this.connection.emit("error",r)}}_handleAuthSASLFinal(e){try{MC.finalizeSession(this.saslSession,e.data),this.saslSession=null}catch(r){this.connection.emit("error",r)}}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let r=this._getActiveQuery();this._activeQuery=null,this._txStatus=e?.status??null,this.readyForQuery=!0,r&&r.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let r=this._getActiveQuery();if(!r){this._handleErrorEvent(e);return}this._activeQuery=null,r.handleError(e,this.connection)}_handleRowDescription(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected rowDescription message from backend.");this._handleErrorEvent(n);return}r.handleRowDescription(e)}_handleDataRow(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected dataRow message from backend.");this._handleErrorEvent(n);return}r.handleDataRow(e)}_handlePortalSuspended(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected portalSuspended message from backend.");this._handleErrorEvent(n);return}r.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected emptyQuery message from backend.");this._handleErrorEvent(n);return}r.handleEmptyQuery(this.connection)}_handleCommandComplete(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected commandComplete message from backend.");this._handleErrorEvent(n);return}r.handleCommandComplete(e,this.connection)}_handleParseComplete(){let e=this._getActiveQuery();if(e==null){let r=new Error("Received unexpected parseComplete message from backend.");this._handleErrorEvent(r);return}e.name&&(this.connection.parsedStatements[e.name]=e.text)}_handleCopyInResponse(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected copyInResponse message from backend.");this._handleErrorEvent(n);return}r.handleCopyInResponse(this.connection)}_handleCopyData(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected copyData message from backend.");this._handleErrorEvent(n);return}r.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){let e=this.connectionParameters,r={user:e.user,database:e.database},n=e.application_name||e.fallback_application_name;return n&&(r.application_name=n),e.replication&&(r.replication=""+e.replication),e.statement_timeout&&(r.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(r.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(r.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(r.options=e.options),r}cancel(e,r){if(e.activeQuery===r){let n=this.connection;this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.s.PGSQL."+this.port):n.connect(this.port,this.host),n.on("connect",function(){n.cancel(e.processID,e.secretKey)})}else e._queryQueue.indexOf(r)!==-1&&e._queryQueue.splice(e._queryQueue.indexOf(r),1)}setTypeParser(e,r,n){return this._types.setTypeParser(e,r,n)}getTypeParser(e,r){return this._types.getTypeParser(e,r)}escapeIdentifier(e){return xge.escapeIdentifier(e)}escapeLiteral(e){return xge.escapeLiteral(e)}_pulseQueryQueue(){if(this.readyForQuery===!0){this._activeQuery=this._queryQueue.shift();let e=this._getActiveQuery();if(e){this.readyForQuery=!1,this.hasExecuted=!0;let r=e.submit(this.connection);r&&process.nextTick(()=>{e.handleError(r,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this._activeQuery=null,this.emit("drain"))}}query(e,r,n){let i,s;if(e==null)throw new TypeError("Client was passed a null or undefined query");if(typeof e.submit=="function")s=i=e,i.callback||(typeof r=="function"?i.callback=r:n&&(i.callback=n));else if(i=new Rge(e,r,n),!i.callback)s=new this._Promise((a,c)=>{i.callback=(l,u)=>l?c(l):a(u)}).catch(a=>{throw Error.captureStackTrace(a),a});else if(typeof i.callback!="function")throw new TypeError("callback is not a function");let o=e.query_timeout||this.connectionParameters.query_timeout;if(o){let a=i.callback||(()=>{}),c=setTimeout(()=>{let l=new Error("Query read timeout");process.nextTick(()=>{i.handleError(l,this.connection)}),a(l),i.callback=()=>{};let u=this._queryQueue.indexOf(i);u>-1&&this._queryQueue.splice(u,1),this._pulseQueryQueue()},o);i.callback=(l,u)=>{clearTimeout(c),a(l,u)}}return this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(process.nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"),this.connection)}),s):(this._queryQueue.length>0&&HZe(),this._queryQueue.push(i),this._pulseQueryQueue(),s):(process.nextTick(()=>{i.handleError(new Error("Client has encountered a connection error and is not queryable"),this.connection)}),s)}ref(){this.connection.ref()}unref(){this.connection.unref()}getTransactionStatus(){return this._txStatus}end(e){if(this._ending=!0,!this.connection._connecting||this._ended)if(e){e();return}else return this._Promise.resolve();if(this._getActiveQuery()||!this._queryable?this.connection.stream.destroy():this.connection.end(),e)this.connection.once("end",e);else return new this._Promise(r=>{this.connection.once("end",r)})}get queryQueue(){return GZe(),this._queryQueue}};DC.Query=Rge;Ige.exports=DC});var Nge=b((PVt,Oge)=>{"use strict";var YZe=J("events").EventEmitter,zV=function(){},Pge=(t,e)=>{let r=t.findIndex(e);return r===-1?void 0:t.splice(r,1)[0]},GV=class{constructor(e,r,n){this.client=e,this.idleListener=r,this.timeoutId=n}},nm=class{constructor(e){this.callback=e}};function KZe(){throw new Error("Release called on client which has already been released to the pool.")}function LC(t,e){if(e)return{callback:e,result:void 0};let r,n,i=function(o,a){o?r(o):n(a)},s=new t(function(o,a){n=o,r=a}).catch(o=>{throw Error.captureStackTrace(o),o});return{callback:i,result:s}}function ZZe(t,e){return function r(n){n.client=e,e.removeListener("error",r),e.on("error",()=>{t.log("additional client error after disconnection due to error",n)}),t._remove(e),t.emit("error",n,e)}}var VV=class extends YZe{constructor(e,r){super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||r||qV().Client,this.Promise=this.options.Promise||global.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_promiseTry(e){let r=this.Promise;return typeof r.try=="function"?r.try(e):new r(n=>n(e()))}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended){this.log("pulse queue ended");return}if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(r=>{this._remove(r.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let r=this._idle.pop();clearTimeout(r.timeoutId);let n=r.client;n.ref&&n.ref();let i=r.idleListener;return this._acquireClient(n,e,i,!1)}if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e,r){let n=Pge(this._idle,s=>s.client===e);n!==void 0&&clearTimeout(n.timeoutId),this._clients=this._clients.filter(s=>s!==e);let i=this;e.end(()=>{i.emit("remove",e),typeof r=="function"&&r()})}connect(e){if(this.ending){let i=new Error("Cannot use a pool after calling end on the pool");return e?e(i):this.Promise.reject(i)}let r=LC(this.Promise,e),n=r.result;if(this._isFull()||this._idle.length){if(this._idle.length&&process.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new nm(r.callback)),n;let i=(a,c,l)=>{clearTimeout(o),r.callback(a,c,l)},s=new nm(i),o=setTimeout(()=>{Pge(this._pendingQueue,a=>a.callback===i),s.timedOut=!0,r.callback(new Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return o.unref&&o.unref(),this._pendingQueue.push(s),n}return this.newClient(new nm(r.callback)),n}newClient(e){let r=new this.Client(this.options);this._clients.push(r);let n=ZZe(this,r);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{r.connection?(this.log("ending client due to timeout"),s=!0,r.connection.stream.destroy()):r.isConnected()||(this.log("ending client due to timeout"),s=!0,r.end())},this.options.connectionTimeoutMillis)),this.log("connecting new client"),r.connect(o=>{if(i&&clearTimeout(i),r.on("error",n),o)this.log("client failed to connect",o),this._clients=this._clients.filter(a=>a!==r),s&&(o=new Error("Connection terminated due to connection timeout",{cause:o})),this._pulseQueue(),e.timedOut||e.callback(o,void 0,zV);else{if(this.log("new client connected"),this.options.onConnect){this._promiseTry(()=>this.options.onConnect(r)).then(()=>{this._afterConnect(r,e,n)},a=>{this._clients=this._clients.filter(c=>c!==r),r.end(()=>{this._pulseQueue(),e.timedOut||e.callback(a,void 0,zV)})});return}return this._afterConnect(r,e,n)}})}_afterConnect(e,r,n){if(this.options.maxLifetimeSeconds!==0){let i=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(e),this._idle.findIndex(o=>o.client===e)!==-1&&this._acquireClient(e,new nm((o,a,c)=>c()),n,!1)},this.options.maxLifetimeSeconds*1e3);i.unref(),e.once("end",()=>clearTimeout(i))}return this._acquireClient(e,r,n,!0)}_acquireClient(e,r,n,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n),e.removeListener("error",n),r.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e.release(s),r.callback(s,void 0,zV);r.callback(void 0,e,e.release)}):r.callback(void 0,e,e.release)}_releaseOnce(e,r){let n=!1;return i=>{n&&KZe(),n=!0,this._release(e,r,i)}}_release(e,r,n){if(e.on("error",r),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses)return e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(e,this._pulseQueue.bind(this));if(this._expired.has(e))return this.log("remove expired client"),this._expired.delete(e),this._remove(e,this._pulseQueue.bind(this));let s;this.options.idleTimeoutMillis&&this._isAboveMin()&&(s=setTimeout(()=>{this._isAboveMin()&&(this.log("remove idle client"),this._remove(e,this._pulseQueue.bind(this)))},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new GV(e,r,s)),this._pulseQueue()}query(e,r,n){if(typeof e=="function"){let s=LC(this.Promise,e);return setImmediate(function(){return s.callback(new Error("Passing a function as the first parameter to pool.query is not supported"))}),s.result}typeof r=="function"&&(n=r,r=void 0);let i=LC(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s)return n(s);let a=!1,c=l=>{a||(a=!0,o.release(l),n(l))};o.once("error",c),this.log("dispatching query");try{o.query(e,r,(l,u)=>{if(this.log("query dispatched"),o.removeListener("error",c),!a)return a=!0,o.release(l),l?n(l):n(void 0,u)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than once");return e?e(n):this.Promise.reject(n)}this.ending=!0;let r=LC(this.Promise,e);return this._endCallback=r.callback,this._pulseQueue(),r.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,r)=>e+(this._expired.has(r)?1:0),0)}get totalCount(){return this._clients.length}};Oge.exports=VV});var Dge=b((OVt,Mge)=>{"use strict";var kge=J("events").EventEmitter,JZe=J("util"),HV=Xh(),im=Mge.exports=function(t,e,r){kge.call(this),t=HV.normalizeQueryConfig(t,e,r),this.text=t.text,this.values=t.values,this.name=t.name,this.queryMode=t.queryMode,this.callback=t.callback,this.state="new",this._arrayMode=t.rowMode==="array",this._emitRowEvents=!1,this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};JZe.inherits(im,kge);var XZe={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};im.prototype.handleError=function(t){let e=this.native.pq.resultErrorFields();if(e)for(let r in e){let n=XZe[r]||r;t[n]=e[r]}this.callback?this.callback(t):this.emit("error",t),this.state="error"};im.prototype.then=function(t,e){return this._getPromise().then(t,e)};im.prototype.catch=function(t){return this._getPromise().catch(t)};im.prototype._getPromise=function(){return this._promise?this._promise:(this._promise=new Promise(function(t,e){this._once("end",t),this._once("error",e)}.bind(this)),this._promise)};im.prototype.submit=function(t){this.state="running";let e=this;this.native=t.native,t.native.arrayMode=this._arrayMode;let r=function(n,i,s){if(t.native.arrayMode=!1,setImmediate(function(){e.emit("_done")}),n)return e.handleError(n);e._emitRowEvents&&(s.length>1?i.forEach((o,a)=>{o.forEach(c=>{e.emit("row",c,s[a])})}):i.forEach(function(o){e.emit("row",o,s)})),e.state="end",e.emit("end",s),e.callback&&e.callback(null,s)};if(process.domain&&(r=process.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));let n=(this.values||[]).map(HV.prepareValue);if(t.namedQueries[this.name]){if(this.text&&t.namedQueries[this.name]!==this.text){let i=new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return r(i)}return t.native.execute(this.name,n,r)}return t.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(t.namedQueries[e.name]=e.text,e.native.execute(e.name,n,r))})}else if(this.values){if(!Array.isArray(this.values)){let i=new Error("Query values must be an array");return r(i)}let n=this.values.map(HV.prepareValue);t.native.query(this.text,n,r)}else this.queryMode==="extended"?t.native.query(this.text,[],r):t.native.query(this.text,r)}});var Bge=b((NVt,Fge)=>{"use strict";var QZe=J("util"),Lge;try{Lge=J("pg-native")}catch(t){throw t}var e5e=xC(),$ge=J("events").EventEmitter,t5e=J("util"),r5e=lV(),Uge=Dge(),n5e=QZe.deprecate(()=>{},"Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead."),Tr=Fge.exports=function(t){$ge.call(this),t=t||{},this._Promise=t.Promise||global.Promise,this._types=new e5e(t.types),this.native=new Lge({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;let e=this.connectionParameters=new r5e(t);t.nativeConnectionString&&(e.nativeConnectionString=t.nativeConnectionString),this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};Tr.Query=Uge;t5e.inherits(Tr,$ge);Tr.prototype._errorAllQueries=function(t){let e=r=>{process.nextTick(()=>{r.native=this.native,r.handleError(t)})};this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(e),this._queryQueue.length=0};Tr.prototype._connect=function(t){let e=this;if(this._connecting){process.nextTick(()=>t(new Error("Client has already been connected. You cannot reuse a client.")));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(e.connectionParameters.nativeConnectionString&&(n=e.connectionParameters.nativeConnectionString),r)return t(r);e.native.connect(n,function(i){if(i)return e.native.end(),t(i);e._connected=!0,e.native.on("error",function(s){e._queryable=!1,e._errorAllQueries(s),e.emit("error",s)}),e.native.on("notification",function(s){e.emit("notification",{channel:s.relname,payload:s.extra})}),e.emit("connect"),e._pulseQueryQueue(!0),t(null,this)})})};Tr.prototype.connect=function(t){if(t){this._connect(t);return}return new this._Promise((e,r)=>{this._connect(n=>{n?r(n):e(this)})})};Tr.prototype.query=function(t,e,r){let n,i,s,o,a;if(t==null)throw new TypeError("Client was passed a null or undefined query");if(typeof t.submit=="function")s=t.query_timeout||this.connectionParameters.query_timeout,i=n=t,typeof e=="function"&&(t.callback=e);else if(s=t.query_timeout||this.connectionParameters.query_timeout,n=new Uge(t,e,r),!n.callback){let c,l;i=new this._Promise((u,d)=>{c=u,l=d}).catch(u=>{throw Error.captureStackTrace(u),u}),n.callback=(u,d)=>u?l(u):c(d)}return s&&(a=n.callback||(()=>{}),o=setTimeout(()=>{let c=new Error("Query read timeout");process.nextTick(()=>{n.handleError(c,this.connection)}),a(c),n.callback=()=>{};let l=this._queryQueue.indexOf(n);l>-1&&this._queryQueue.splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{clearTimeout(o),a(c,l)}),this._queryable?this._ending?(n.native=this.native,process.nextTick(()=>{n.handleError(new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.length>0&&n5e(),this._queryQueue.push(n),this._pulseQueryQueue(),i):(n.native=this.native,process.nextTick(()=>{n.handleError(new Error("Client has encountered a connection error and is not queryable"))}),i)};Tr.prototype.end=function(t){let e=this;this._ending=!0,this._connecting&&!this._connected&&this.once("connect",()=>{this.end(()=>{})});let r;return t||(r=new this._Promise(function(n,i){t=s=>s?i(s):n()})),this.native.end(function(){e._connected=!1,e._errorAllQueries(new Error("Connection terminated")),process.nextTick(()=>{e.emit("end"),t&&t()})}),r};Tr.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};Tr.prototype._pulseQueryQueue=function(t){if(!this._connected||this._hasActiveQuery())return;let e=this._queryQueue.shift();if(!e){t||this.emit("drain");return}this._activeQuery=e,e.submit(this);let r=this;e.once("_done",function(){r._pulseQueryQueue()})};Tr.prototype.cancel=function(t){this._activeQuery===t?this.native.cancel(function(){}):this._queryQueue.indexOf(t)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(t),1)};Tr.prototype.ref=function(){};Tr.prototype.unref=function(){};Tr.prototype.setTypeParser=function(t,e,r){return this._types.setTypeParser(t,e,r)};Tr.prototype.getTypeParser=function(t,e){return this._types.getTypeParser(t,e)};Tr.prototype.isConnected=function(){return this._connected};Tr.prototype.getTransactionStatus=function(){return this.native.getTransactionStatus()}});var WV=b((kVt,jge)=>{"use strict";jge.exports=Bge()});var qV=b((DVt,$C)=>{"use strict";var i5e=Cge(),s5e=MS(),o5e=UV(),a5e=dV(),c5e=Xh(),l5e=Nge(),u5e=xC(),{DatabaseError:d5e}=DV(),{escapeIdentifier:f5e,escapeLiteral:p5e}=Xh(),h5e=t=>class extends l5e{constructor(r){super(r,t)}},zge=function(t){this.defaults=s5e,this.Client=t,this.Query=this.Client.Query,this.Pool=h5e(this.Client),this._pools=[],this.Connection=o5e,this.types=kS(),this.DatabaseError=d5e,this.TypeOverrides=u5e,this.escapeIdentifier=f5e,this.escapeLiteral=p5e,this.Result=a5e,this.utils=c5e},Gge=i5e,Vge=!1;try{Vge=!!process.env.NODE_PG_FORCE_NATIVE}catch{}Vge&&(Gge=WV());$C.exports=new zge(Gge);Object.defineProperty($C.exports,"native",{configurable:!0,enumerable:!1,get(){let t=null;try{t=new zge(WV())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty($C.exports,"native",{value:t}),t}})});import{readFileSync as N5e}from"fs";import k5e from"path";import{createRequire as M5e}from"module";import{setTimeout as CPe}from"timers/promises";be();import kSe from"process";be();var D_e=(t,e)=>{e.recordException(t),e.setStatus({code:gr.ERROR})};var Ms=class{constructor(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}withActiveSpan(e,r,n,i){let{opts:s,ctx:o,fn:a}=Gq(r,n,i);return this._tracer.startActiveSpan(e,s,o,c=>Vq(c,s,a))}withSpan(e,r,n,i){let{opts:s,ctx:o,fn:a}=Gq(r,n,i),c=this._tracer.startSpan(e,s,o);return Vq(c,s,a)}};function Gq(t,e,r){let n,i,s;return!e&&!r?s=t:r?(n=t,i=e,s=r):(n=t,s=e),n=n??{},i=i??at.active(),{opts:n,ctx:i,fn:s}}function Vq(t,e,r){var n;let i=(n=e.onException)!==null&&n!==void 0?n:D_e,s=o=>{throw i(o,t),t.end(),o};try{let o=r(t);return typeof o?.then=="function"?o.then(a=>(t.end(),a),s):(t.end(),o)}catch(o){throw s(o)}}be();var Uu=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";var v0=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let n=new t({},r);return n._rawAttributes=eH(e),n._asyncAttributesPending=e.filter(([i,s])=>Uu(s)).length>0,n}constructor(e,r){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([i,s])=>(Uu(s)&&(this._asyncAttributesPending=!0),[i,s])),this._rawAttributes=eH(this._rawAttributes),this._schemaUrl=L_e(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,n]=this._rawAttributes[e];this._rawAttributes[e]=[r,Uu(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Q.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,n]of this._rawAttributes){if(Uu(n)){Q.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(e[r]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(e==null)return this;let r=$_e(this,e),n=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],n)}};function b0(t,e){return v0.FromAttributeList(Object.entries(t),e)}function eH(t){return t.map(([e,r])=>Uu(r)?[e,r.catch(n=>{Q.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}function L_e(t){if(typeof t=="string"||t===void 0)return t;Q.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function $_e(t,e){let r=t?.schemaUrl,n=e?.schemaUrl,i=r===void 0||r==="",s=n===void 0||n==="";if(i)return n;if(s||r===n)return r;Q.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}be();var ym=class{emit(e){}enabled(){return!1}},tH=new ym;var Sm=Symbol.for("io.opentelemetry.js.api.logs"),Fu=globalThis;function rH(t,e,r){return n=>n===t?e:r}var T0=1;var A0=class{getLogger(e,r,n){return new ym}},cE=new A0;var lE=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):tH}};var Em=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new lE(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:cE}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}};var uE=class t{constructor(){this._proxyLoggerProvider=new Em}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Fu[Sm]?this.getLoggerProvider():(Fu[Sm]=rH(T0,e,cE),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Fu[Sm])===null||e===void 0?void 0:e.call(Fu,T0))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Fu[Sm],this._proxyLoggerProvider=new Em}};var nH=uE.getInstance();function iH(t,e,r,n){for(let i=0,s=t.length;i<s;i++){let o=t[i];e&&o.setTracerProvider(e),r&&o.setMeterProvider(r),n&&o.setLoggerProvider&&o.setLoggerProvider(n),o.getConfig().enabled||o.enable()}}function sH(t){t.forEach(e=>e.disable())}function x0(t){let e=t.tracerProvider||ft.getTracerProvider(),r=t.meterProvider||_m.getMeterProvider(),n=t.loggerProvider||nH.getLoggerProvider(),i=t.instrumentations?.flat()??[];return iH(i,e,r,n),()=>{sH(i)}}Fs();var Sv=on(RP(),1);be();Fs();var QW=t=>{throw TypeError(t)},OP=(t,e,r)=>e.has(t)||QW("Cannot "+r),yv=(t,e,r)=>(OP(t,e,"read from private field"),r?r.call(t):e.get(t)),IP=(t,e,r)=>e.has(t)?QW("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ZW=(t,e,r,n)=>(OP(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),NSe=(t,e,r)=>(OP(t,e,"access private method"),r),JW="__netlify__getTracer",MSe="__netlify__shutdownTracers",DSe="__nfOTLPTrace",Bm,jm,PP,eY,LSe=class{constructor(){IP(this,PP),IP(this,Bm),IP(this,jm),ZW(this,Bm,new Vu(NSe(this,PP,eY),this)),ZW(this,jm,Q.createComponentLogger({namespace:"netlify-span-exporter"}))}export(t,e){if(yv(this,jm).debug(`export ${t.length.toString()} spans`),yv(this,Bm).isCalled){e({code:wr.FAILED,error:new Error("Exporter has been shutdown")});return}console.log(DSe,JSON.stringify($Se(t))),e({code:wr.SUCCESS})}shutdown(){return yv(this,Bm).call()}};Bm=new WeakMap;jm=new WeakMap;PP=new WeakSet;eY=function(){return yv(this,jm).debug("Shutting down"),Promise.resolve()};function $Se(t){return{resourceSpans:t.map(e=>{let r=e.spanContext();return{resource:{attributes:_v(e.resource.attributes),droppedAttributesCount:e.droppedAttributesCount},scopeSpans:[{scope:{name:e.instrumentationScope.name,version:e.instrumentationScope.version},spans:[{traceId:r.traceId,spanId:r.spanId,parentSpanId:e.parentSpanContext?.spanId,name:e.name,kind:e.kind||ti.SERVER,startTimeUnixNano:CP(e.startTime),endTimeUnixNano:CP(e.endTime),attributes:_v(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(n=>({name:n.name,timeUnixNano:CP(n.time),attributes:_v(n.attributes??{}),droppedAttributesCount:n.droppedAttributesCount??0})),droppedEventsCount:e.droppedEventsCount,status:{code:e.status.code,message:e.status.message},links:e.links.map(n=>({spanId:n.context.spanId,traceId:n.context.traceId,attributes:_v(n.attributes??{}),droppedAttributesCount:n.droppedAttributesCount??0})),droppedLinksCount:e.droppedLinksCount}]}]}})}}function _v(t){return Object.keys(t).map(e=>tY(e,t[e]))}function tY(t,e){return{key:t,value:rY(e)}}function rY(t){let e=typeof t;return e==="string"?{stringValue:t}:e==="number"?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:e==="boolean"?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(rY)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>tY(r,n))}}:{}}function CP(t){let e=BigInt(1e9);return(BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))).toString()}var XW={name:"@netlify/otel",version:"6.0.4",type:"module",engines:{node:"^18.14.0 || >=20.6.1"},main:"./dist/main.cjs",module:"./dist/main.js",types:"./dist/main.d.ts",exports:{".":{require:{types:"./dist/main.d.cts",default:"./dist/main.cjs"},import:{types:"./dist/main.d.ts",default:"./dist/main.js"},default:{types:"./dist/main.d.ts",default:"./dist/main.js"}},"./package.json":"./package.json","./bootstrap":{require:{types:"./dist/bootstrap/main.d.cts",default:"./dist/bootstrap/main.cjs"},import:{types:"./dist/bootstrap/main.d.ts",default:"./dist/bootstrap/main.js"},default:{types:"./dist/bootstrap/main.d.ts",default:"./dist/bootstrap/main.js"}},"./exporter-netlify":{require:{types:"./dist/exporters/netlify.d.cts",default:"./dist/exporters/netlify.cjs"},import:{types:"./dist/exporters/netlify.d.ts",default:"./dist/exporters/netlify.js"},default:{types:"./dist/exporters/netlify.d.ts",default:"./dist/exporters/netlify.js"}},"./instrumentation-fetch":{require:{types:"./dist/instrumentations/fetch.d.cts",default:"./dist/instrumentations/fetch.cjs"},import:{types:"./dist/instrumentations/fetch.d.ts",default:"./dist/instrumentations/fetch.js"},default:{types:"./dist/instrumentations/fetch.d.ts",default:"./dist/instrumentations/fetch.js"}},"./instrumentation-http":{require:{types:"./dist/instrumentations/http.d.cts",default:"./dist/instrumentations/http.cjs"},import:{types:"./dist/instrumentations/http.d.ts",default:"./dist/instrumentations/http.js"},default:{types:"./dist/instrumentations/http.d.ts",default:"./dist/instrumentations/http.js"}},"./opentelemetry":{require:{types:"./dist/opentelemetry.d.cts",default:"./dist/opentelemetry.cjs"},import:{types:"./dist/opentelemetry.d.ts",default:"./dist/opentelemetry.js"},default:{types:"./dist/opentelemetry.d.ts",default:"./dist/opentelemetry.js"}}},files:["dist/**/*"],scripts:{build:"tsup-node",dev:"tsup-node --watch",prepack:"npm run build",test:"run-s build test:ci","test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"vitest","test:dev:vitest:watch":"vitest watch","test:ci:vitest":"vitest run",publint:"npx -y publint --strict"},keywords:["netlify","cdn"],license:"MIT",repository:{type:"git",url:"https://github.com/netlify/primitives.git",directory:"packages/otel"},bugs:{url:"https://github.com/netlify/primitives/issues"},author:"Netlify Inc.",devDependencies:{"@netlify/dev-utils":"^4.4.7",msw:"^2.10.5","npm-run-all2":"^7.0.2",tsup:"^8.0.0",vitest:"^3.0.0"},dependencies:{"@opentelemetry/api":"1.9.1","@opentelemetry/core":"2.7.1","@opentelemetry/instrumentation":"^0.220.0","@opentelemetry/resources":"2.9.0","@opentelemetry/sdk-trace-node":"2.9.0"}},nY=t=>{if(Object.prototype.hasOwnProperty.call(globalThis,JW))return;let e=kSe.version.slice(1),r=b0({"service.name":t.serviceName,"service.version":t.serviceVersion,"process.runtime.name":"nodejs","process.runtime.version":e,"deployment.environment":t.deploymentEnvironment,"http.url":t.siteUrl,"netlify.site.id":t.siteId,"netlify.site.name":t.siteName}),n=t.spanProcessors??[USe()],i=new Sv.NodeTracerProvider({resource:r,spanProcessors:n});i.register({propagator:new Us});let s=t.instrumentations??[];x0({instrumentations:s,tracerProvider:i}),Object.defineProperty(globalThis,JW,{enumerable:!1,configurable:!0,writable:!1,value:function(a,c){return a?new Ms(ft.getTracer(a,c)):new Ms(ft.getTracer(XW.name,XW.version))}}),Object.defineProperty(globalThis,MSe,{enumerable:!1,configurable:!0,writable:!1,value:async()=>await i.shutdown()})},USe=()=>new Sv.SimpleSpanProcessor(new LSe);be();Fs();var zm=on(RP(),1);be();import*as Ev from"diagnostics_channel";var iY=class{constructor(t={}){this.instrumentationName="@netlify/otel/instrumentation-fetch",this.instrumentationVersion="1.0.0",this._recordFromReq=new WeakMap,this.config=t,this._channelSubs=[]}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(t){this.provider=t}getTracerProvider(){return this.provider}annotateFromRequest(t,e){let r=this.config.getRequestAttributes?.(e)??{},n=new URL(e.path,e.origin);t.setAttributes({...r,"http.request.method":e.method,"url.full":n.href,"url.host":n.host,"url.scheme":n.protocol.slice(0,-1),"server.address":n.hostname,"server.port":n.port,...this.prepareHeaders("request",e.headers)})}annotateFromResponse(t,e){let r=this.config.getResponseAttributes?.(e)??{};t.setAttributes({...r,"http.response.status_code":e.statusCode,...this.prepareHeaders("response",e.headers)}),t.setStatus({code:e.statusCode>=400?gr.ERROR:gr.UNSET})}prepareHeaders(t,e){if(!Array.isArray(e))return{};if(this.config.skipHeaders===!0)return{};let r=["*","/.*/"],n=this.config.skipHeaders??[],i=this.config.redactHeaders??[],s=n.some(a=>r.includes(a.toString())),o={};if(s)return o;for(let a=0;a+1<e.length;a=a+2){let c=e[a],l=e[a+1];if(typeof c!="string"&&!Buffer.isBuffer(c)||typeof l!="string"&&!Buffer.isBuffer(l))continue;let u=c.toString().toLowerCase();if(n.some(f=>typeof f=="string"?f==u:f.test(u)))continue;let d=`http.${t}.header.${u}`;i===!0||i.some(f=>typeof f=="string"?f==u:f.test(u))?o[d]="REDACTED":o[d]=l.toString()}return o}getRequestMethod(t){return["HEAD","GET","POST","PUT","PATCH","DELETE"].includes(t.toUpperCase())?t.toUpperCase():"_OTHER"}getTracer(){if(!this.provider)return;let t=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return t instanceof Ms?t:new Ms(t)}enable(){this._channelSubs.length>0||(this.subscribe("undici:request:create",this.onRequestCreate.bind(this)),this.subscribe("undici:request:headers",this.onRequestHeaders.bind(this)),this.subscribe("undici:request:trailers",this.onRequestEnd.bind(this)),this.subscribe("undici:request:error",this.onRequestError.bind(this)))}subscribe(t,e){Ev.subscribe(t,e);let r=()=>Ev.unsubscribe(t,e);this._channelSubs.push({name:t,unsubscribe:r})}disable(){this._channelSubs.forEach(t=>{t.unsubscribe()}),this._channelSubs.length=0}onRequestCreate({request:t}){try{let e=this.getTracer(),r=new URL(t.path,t.origin);if(!e||t.method==="CONNECT"||this.config.skipURLs?.some(i=>typeof i=="string"?r.href.startsWith(i):i.test(r.href)))return;let n=e.startSpan(this.getRequestMethod(t.method),{kind:ti.CLIENT},at.active());this.annotateFromRequest(n,t),this._recordFromReq.set(t,n)}catch{}}onRequestHeaders({request:t,response:e}){try{let r=this._recordFromReq.get(t);if(!r)return;this.annotateFromResponse(r,e)}catch{}}onRequestError({request:t,error:e}){try{let r=this._recordFromReq.get(t);if(!r)return;r.recordException(e),r.setStatus({code:gr.ERROR,message:e.message}),r.end(),this._recordFromReq.delete(t)}catch{}}onRequestEnd({request:t}){try{let e=this._recordFromReq.get(t);if(!e)return;e.end(),this._recordFromReq.delete(t)}catch{}}};var FSe="__netlify__getTracer",BSe="__netlify__shutdownTracers",Ve=(t,e)=>globalThis[FSe]?.(t,e),sY=async()=>globalThis[BSe]?.();function qc(t,e,r,n,i){let s=typeof n=="function"?n:typeof r=="function"?r:i;if(!s)throw new Error("function to execute with active span is missing");return t?t.withActiveSpan(e,r,n,s):s()}var SX=on(mX(),1);import EPe from"process";var vPe="NETLIFY_FF_",Ei=t=>t==="true"||t==="1",We=()=>{let t={};for(let[e,r]of Object.entries(EPe.env))e.startsWith(vPe)&&r!==void 0&&(t[e]=r);return{byokEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_BYOK_ENABLED),idleTimeoutEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_IDLE_TIMEOUT),fetchAssetsEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_FETCH_ASSETS),coldResumeFromS3Enabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_COLD_RESUME_FROM_S3),creditWrapUpEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_CREDIT_WRAPUP),warmNativeResumeEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_WARM_NATIVE_RESUME),aiFnV1GuardrailEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_AI_FN_V1_GUARDRAIL),questionsEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_QUESTIONS_ENABLED),captureLlmContentEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_CAPTURE_LLM_CONTENT),skillVariations:Object.entries(t).filter(([e,r])=>e.startsWith("NETLIFY_FF_AGENT_RUNNER_SKILL_")&&Ei(r)).map(([e])=>e.replace("NETLIFY_FF_AGENT_RUNNER_SKILL_","").toLowerCase()),modelVersionOverrides:{codex:t.NETLIFY_FF_AGENT_RUNNER_CODEX_VERSION,claude:t.NETLIFY_FF_AGENT_RUNNER_CLAUDE_VERSION,gemini:t.NETLIFY_FF_AGENT_RUNNER_GEMINI_VERSION,opencode:t.NETLIFY_FF_AGENT_RUNNER_OPENCODE_VERSION},opencodeEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_OPENCODE_ENABLED),opencodeDefaultModel:t.NETLIFY_FF_AGENT_RUNNER_OPENCODE_DEFAULT_MODEL||void 0,raw:t}};import bPe from"process";var gX;var t_=()=>gX?`-[session:${gX}]`:"";function me(t){let e=bPe.env.LOG!=="0";return{log:(...r)=>{e&&console.log(`[AR]-[${t}]${t_()}`,...r)},error:(...r)=>{e&&console.error(`[AR]-[ERROR]-[${t}]${t_()}`,...r)},warn:(...r)=>{e&&console.warn(`[AR]-[WARN]-[${t}]${t_()}`,...r)},info:(...r)=>{e&&console.info(`[AR]-[${t}]${t_()}`,...r)},debug:(...r)=>{e&&console.debug(`[AR]-[DEBUG]-[${t}]${t_()}`,...r)}}}import{Transform as TPe}from"stream";var APe=["NETLIFY_AI_GATEWAY_KEY"];function xPe(){let t=(process.env.NETLIFY_SENSITIVE_ENV_KEYS||"").split(",").map(e=>e.trim()).filter(Boolean);return[...new Set([...t,...APe])]}function wPe(t){let e=t.toLowerCase();return e==="true"||e==="false"?!0:t.trim().length<4}function RPe(){let e=xPe().map(r=>process.env[r]).filter(r=>!(!r||wPe(r)));return[...new Set(e)].sort((r,n)=>n.length-r.length)}function Gn(t){if(typeof t!="string")return t;let e=RPe();if(e.length===0)return t;let r=t;return e.forEach(n=>{let i=new RegExp(IPe(n),"g");r=r.replace(i,"******")}),r}function IPe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var r_=class extends TPe{constructor(e={}){super({...e,objectMode:!1})}_transform(e,r,n){let i=e.toString(),s=Gn(i);n(null,s)}},eA=Symbol("maskedWrite");function _X(){if(process.env.NETLIFY_MASK_LOGS!=="false"){if(!process.stdout.write[eA]){let e=process.stdout.write.bind(process.stdout),r=function(n,i,s){let o=typeof n=="string"?Gn(n):n;return typeof i=="function"?e(o,i):e(o,i,s)};r[eA]=!0,process.stdout.write=r}if(!process.stderr.write[eA]){let e=process.stderr.write.bind(process.stderr),r=function(n,i,s){let o=typeof n=="string"?Gn(n):n;return typeof i=="function"?e(o,i):e(o,i,s)};r[eA]=!0,process.stderr.write=r}}}var tA=me("tracing"),yX=8e3,PPe=5e3,EX=async(t=PPe)=>{try{await Promise.race([sY(),CPe(t)])}catch(e){tA.warn("Failed to flush tracers on shutdown",e)}},vX=async(t,e,r)=>{if(!Ve()){let n=[new zm.SimpleSpanProcessor(new mD),new zm.SimpleSpanProcessor(new SX.OTLPTraceExporter({url:r.exporterUrl}))];await nY({serviceName:"@netlify/agent-runner-cli",serviceVersion:t,deploymentEnvironment:"production",siteUrl:"",siteId:process.env.SITE_ID??"",siteName:e,spanProcessors:n,instrumentations:[new iY({skipHeaders:!0})]})}return r.traceparent?(xr.setGlobalPropagator(new Us),xr.extract(at.active(),{traceparent:r.traceparent,isRemote:!0})):at.active()};function ht(t,e,r){return tA.log(`\u23F3 TRACE: ${e} starting...`),qc(t,e,r)}var mD=class{export(e,r){for(let n of e)this.logSpan(n);r({code:1})}async shutdown(){}forceFlush(){return Promise.resolve()}logSpan(e){let r=(e.endTime[0]-e.startTime[0])*1e3+(e.endTime[1]-e.startTime[1])/1e6,n=e.attributes,i=[];for(let[a,c]of Object.entries(n))a.includes("duration")&&typeof c=="number"?i.push(`${a}=${c.toFixed(2)}ms`):i.push(`${a}=${c}`);let s=e.status?.code===2?"\u274C":"\u2705",o=i.length>0?` [${i.join(", ")}]`:"";tA.log(`${s} TRACE: ${e.name} completed in ${r.toFixed(2)}ms${o}`),e.status?.code===2&&e.status.message&&tA.log(` \u274C Error: ${e.status.message}`)}};function gD(){return We().captureLlmContentEnabled}function bX(t){return t.includes("claude")?"anthropic":t.includes("codex")?"openai":t.includes("gemini")?"google":t.includes("opencode")?"opencode":t}function rA(t,e,r){let n={role:t,parts:[{type:"text",content:Gn(e)}]};return r&&(n.finish_reason=r),JSON.stringify([n])}function TX(t,e,r,n){if(!t.length)return;let i=Ve();if(!i)return;let s=gD(),o=Math.max(1,(n-r)/t.length);t.forEach((a,c)=>{let l=Math.min(n,r+c*o),u=Math.min(n,l+o),d=a.title||a.type||`step-${a.id??c}`,f=a.type==="tool_use"||a.type==="tool_result",p=a.message?a.message.length>yX?`${a.message.slice(0,yX)}\u2026`:a.message:void 0;i.startSpan(d,{startTime:l,attributes:{"gen_ai.capability.name":e,"gen_ai.step.name":d,"gen_ai.operation.name":f?"execute_tool":"chat",...f?{"gen_ai.tool.name":d}:{},"spark.step.id":a.id??-1,...a.type?{"spark.step.type":a.type}:{},...a.category?{"spark.step.category":a.category}:{},...a.groupId?{"spark.step.group_id":a.groupId}:{},...a.parentGroupId?{"spark.step.parent_group_id":a.parentGroupId}:{},...s&&p?f?{"gen_ai.tool.call.result":Gn(p)}:{"gen_ai.output.messages":rA("assistant",p)}:{}}}).end(u)})}var OPe=["error","failed","exception","fatal","panic","abort","crash"];function AX(t){let e=t.split(`
|
|
32
|
+
`);LS.write(vge.format.apply(vge,e))}}Object.defineProperty(Yo.exports,"isWin",{get:function(){return NC},set:function(t){NC=t}});Yo.exports.warnTo=function(t){var e=LS;return LS=t,e};Yo.exports.getFileName=function(t){var e=t||process.env,r=e.PGPASSFILE||(NC?Ege.join(e.APPDATA||"./","postgresql","pgpass.conf"):Ege.join(e.HOME||"./",".pgpass"));return r};Yo.exports.usePgPass=function(t,e){return Object.prototype.hasOwnProperty.call(process.env,"PGPASSWORD")?!1:NC?!0:(e=e||"<unkn>",NZe(t.mode)?t.mode&(IZe|CZe)?(BV('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',e),!1):!0:(BV('WARNING: password file "%s" is not a plain file',e),!1))};var MZe=Yo.exports.match=function(t,e){return rm.slice(0,-1).reduce(function(r,n,i){return i==1&&Number(t[n]||RZe)===Number(e[n])?r&&!0:r&&(e[n]==="*"||e[n]===t[n])},!0)};Yo.exports.getPassword=function(t,e,r){var n,i=e.pipe(wZe());function s(c){var l=DZe(c);l&&LZe(l)&&MZe(t,l)&&(n=l[kZe],i.end())}var o=function(){e.destroy(),r(n)},a=function(c){e.destroy(),BV("WARNING: error on reading file: %s",c),r(void 0)};e.on("error",a),i.on("data",s).on("end",o).on("error",a)};var DZe=Yo.exports.parseLine=function(t){if(t.length<11||t.match(/^\s+#/))return null;for(var e="",r="",n=0,i=0,s=0,o={},a=!1,c=function(u,d,f){var p=t.substring(d,f);Object.hasOwnProperty.call(process.env,"PGPASS_NO_DEESCAPE")||(p=p.replace(/\\([:\\])/g,"$1")),o[rm[u]]=p},l=0;l<t.length-1;l+=1){if(e=t.charAt(l+1),r=t.charAt(l),a=n==FV-1,a){c(n,i);break}l>=0&&e==":"&&r!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o).length===FV?o:null,o},LZe=Yo.exports.isValidEntry=function(t){for(var e={0:function(o){return o.length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&&Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length>0},4:function(o){return o.length>0}},r=0;r<rm.length;r+=1){var n=e[r],i=t[rm[r]]||"",s=n(i);if(!s)return!1}return!0}});var Age=b((IVt,jV)=>{"use strict";var RVt=J("path"),Tge=J("fs"),kC=bge();jV.exports=function(t,e){var r=kC.getFileName();Tge.stat(r,function(n,i){if(n||!kC.usePgPass(i,r))return e(void 0);var s=Tge.createReadStream(r);kC.getPassword(t,s,e)})};jV.exports.warnTo=kC.warnTo});var Cge=b((CVt,Ige)=>{"use strict";var $Ze=J("events").EventEmitter,xge=Xh(),$S=J("util"),MC=Vme(),UZe=xC(),FZe=lV(),Rge=nge(),BZe=MS(),jZe=UV(),zZe=iV(),wge=$S.deprecate(()=>{},"Client.activeQuery is deprecated and will be removed in pg@9.0"),GZe=$S.deprecate(()=>{},"Client.queryQueue is deprecated and will be removed in pg@9.0."),VZe=$S.deprecate(()=>{},"pgpass support is deprecated and will be removed in pg@9.0. You can provide an async function as the password property to the Client/Pool constructor that returns a password instead. Within this function you can call the pgpass module in your own code."),qZe=$S.deprecate(()=>{},"Passing a custom Promise implementation to the Client/Pool constructor is deprecated and will be removed in pg@9.0."),HZe=$S.deprecate(()=>{},"Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.");function WZe(t,e){if(typeof t=="number")return Number.isFinite(t)?t:e;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:e}return e}var DC=class extends $Ze{constructor(e){super(),this.connectionParameters=new FZe(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;let r=e||{};r.Promise&&qZe(),this._Promise=r.Promise||global.Promise,this._types=new UZe(r.types),this._ending=!1,this._ended=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this._activeQuery=null,this._txStatus=null,this.enableChannelBinding=!!r.enableChannelBinding,this.scramMaxIterations=WZe(r.scramMaxIterations,MC.DEFAULT_MAX_SCRAM_ITERATIONS),this.connection=r.connection||new jZe({stream:r.stream,ssl:this.connectionParameters.ssl,keepAlive:r.keepAlive||!1,keepAliveInitialDelayMillis:r.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this._queryQueue=[],this.binary=r.binary||BZe.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=r.connectionTimeoutMillis||0}get activeQuery(){return wge(),this._activeQuery}set activeQuery(e){wge(),this._activeQuery=e}_getActiveQuery(){return this._activeQuery}_errorAllQueries(e){let r=i=>{process.nextTick(()=>{i.handleError(e,this.connection)})},n=this._getActiveQuery();n&&(r(n),this._activeQuery=null),this._queryQueue.forEach(r),this._queryQueue.length=0}_connect(e){let r=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let i=new Error("Client has already been connected. You cannot reuse a client.");process.nextTick(()=>{e(i)});return}this._connecting=!0,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{n._ending=!0,n.stream.destroy(new Error("timeout expired"))},this._connectionTimeoutMillis),this.connectionTimeoutHandle.unref&&this.connectionTimeoutHandle.unref()),this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.s.PGSQL."+this.port):n.connect(this.port,this.host),n.on("connect",function(){r.ssl?n.requestSsl():n.startup(r.getStartupConf())}),n.on("sslconnect",function(){n.startup(r.getStartupConf())}),this._attachListeners(n),n.once("end",()=>{let i=this._ending?new Error("Connection terminated"):new Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this._ended=!0,this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(i):this._handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),process.nextTick(()=>{this.emit("end")})})}connect(e){if(e){this._connect(e);return}return new this._Promise((r,n)=>{this._connect(i=>{i?n(i):r(this)})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_getPassword(e){let r=this.connection;if(typeof this.password=="function")this._Promise.resolve().then(()=>this.password(this.connectionParameters)).then(n=>{if(n!==void 0){if(typeof n!="string"){r.emit("error",new TypeError("Password must be a string"));return}this.connectionParameters.password=this.password=n}else this.connectionParameters.password=this.password=null;e()}).catch(n=>{r.emit("error",n)});else if(this.password!==null)e();else try{Age()(this.connectionParameters,i=>{i!==void 0&&(VZe(),this.connectionParameters.password=this.password=i),e()})}catch(n){this.emit("error",n)}}_handleAuthCleartextPassword(e){this._getPassword(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._getPassword(async()=>{try{let r=await zZe.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(r)}catch(r){this.emit("error",r)}})}_handleAuthSASL(e){this._getPassword(()=>{try{this.saslSession=MC.startSession(e.mechanisms,this.enableChannelBinding&&this.connection.stream,this.scramMaxIterations),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(r){this.connection.emit("error",r)}})}async _handleAuthSASLContinue(e){try{await MC.continueSession(this.saslSession,this.password,e.data,this.enableChannelBinding&&this.connection.stream),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(r){this.connection.emit("error",r)}}_handleAuthSASLFinal(e){try{MC.finalizeSession(this.saslSession,e.data),this.saslSession=null}catch(r){this.connection.emit("error",r)}}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let r=this._getActiveQuery();this._activeQuery=null,this._txStatus=e?.status??null,this.readyForQuery=!0,r&&r.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let r=this._getActiveQuery();if(!r){this._handleErrorEvent(e);return}this._activeQuery=null,r.handleError(e,this.connection)}_handleRowDescription(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected rowDescription message from backend.");this._handleErrorEvent(n);return}r.handleRowDescription(e)}_handleDataRow(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected dataRow message from backend.");this._handleErrorEvent(n);return}r.handleDataRow(e)}_handlePortalSuspended(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected portalSuspended message from backend.");this._handleErrorEvent(n);return}r.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected emptyQuery message from backend.");this._handleErrorEvent(n);return}r.handleEmptyQuery(this.connection)}_handleCommandComplete(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected commandComplete message from backend.");this._handleErrorEvent(n);return}r.handleCommandComplete(e,this.connection)}_handleParseComplete(){let e=this._getActiveQuery();if(e==null){let r=new Error("Received unexpected parseComplete message from backend.");this._handleErrorEvent(r);return}e.name&&(this.connection.parsedStatements[e.name]=e.text)}_handleCopyInResponse(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected copyInResponse message from backend.");this._handleErrorEvent(n);return}r.handleCopyInResponse(this.connection)}_handleCopyData(e){let r=this._getActiveQuery();if(r==null){let n=new Error("Received unexpected copyData message from backend.");this._handleErrorEvent(n);return}r.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){let e=this.connectionParameters,r={user:e.user,database:e.database},n=e.application_name||e.fallback_application_name;return n&&(r.application_name=n),e.replication&&(r.replication=""+e.replication),e.statement_timeout&&(r.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(r.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(r.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(r.options=e.options),r}cancel(e,r){if(e.activeQuery===r){let n=this.connection;this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.s.PGSQL."+this.port):n.connect(this.port,this.host),n.on("connect",function(){n.cancel(e.processID,e.secretKey)})}else e._queryQueue.indexOf(r)!==-1&&e._queryQueue.splice(e._queryQueue.indexOf(r),1)}setTypeParser(e,r,n){return this._types.setTypeParser(e,r,n)}getTypeParser(e,r){return this._types.getTypeParser(e,r)}escapeIdentifier(e){return xge.escapeIdentifier(e)}escapeLiteral(e){return xge.escapeLiteral(e)}_pulseQueryQueue(){if(this.readyForQuery===!0){this._activeQuery=this._queryQueue.shift();let e=this._getActiveQuery();if(e){this.readyForQuery=!1,this.hasExecuted=!0;let r=e.submit(this.connection);r&&process.nextTick(()=>{e.handleError(r,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this._activeQuery=null,this.emit("drain"))}}query(e,r,n){let i,s;if(e==null)throw new TypeError("Client was passed a null or undefined query");if(typeof e.submit=="function")s=i=e,i.callback||(typeof r=="function"?i.callback=r:n&&(i.callback=n));else if(i=new Rge(e,r,n),!i.callback)s=new this._Promise((a,c)=>{i.callback=(l,u)=>l?c(l):a(u)}).catch(a=>{throw Error.captureStackTrace(a),a});else if(typeof i.callback!="function")throw new TypeError("callback is not a function");let o=e.query_timeout||this.connectionParameters.query_timeout;if(o){let a=i.callback||(()=>{}),c=setTimeout(()=>{let l=new Error("Query read timeout");process.nextTick(()=>{i.handleError(l,this.connection)}),a(l),i.callback=()=>{};let u=this._queryQueue.indexOf(i);u>-1&&this._queryQueue.splice(u,1),this._pulseQueryQueue()},o);i.callback=(l,u)=>{clearTimeout(c),a(l,u)}}return this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(process.nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"),this.connection)}),s):(this._queryQueue.length>0&&HZe(),this._queryQueue.push(i),this._pulseQueryQueue(),s):(process.nextTick(()=>{i.handleError(new Error("Client has encountered a connection error and is not queryable"),this.connection)}),s)}ref(){this.connection.ref()}unref(){this.connection.unref()}getTransactionStatus(){return this._txStatus}end(e){if(this._ending=!0,!this.connection._connecting||this._ended)if(e){e();return}else return this._Promise.resolve();if(this._getActiveQuery()||!this._queryable?this.connection.stream.destroy():this.connection.end(),e)this.connection.once("end",e);else return new this._Promise(r=>{this.connection.once("end",r)})}get queryQueue(){return GZe(),this._queryQueue}};DC.Query=Rge;Ige.exports=DC});var Nge=b((PVt,Oge)=>{"use strict";var YZe=J("events").EventEmitter,zV=function(){},Pge=(t,e)=>{let r=t.findIndex(e);return r===-1?void 0:t.splice(r,1)[0]},GV=class{constructor(e,r,n){this.client=e,this.idleListener=r,this.timeoutId=n}},nm=class{constructor(e){this.callback=e}};function KZe(){throw new Error("Release called on client which has already been released to the pool.")}function LC(t,e){if(e)return{callback:e,result:void 0};let r,n,i=function(o,a){o?r(o):n(a)},s=new t(function(o,a){n=o,r=a}).catch(o=>{throw Error.captureStackTrace(o),o});return{callback:i,result:s}}function ZZe(t,e){return function r(n){n.client=e,e.removeListener("error",r),e.on("error",()=>{t.log("additional client error after disconnection due to error",n)}),t._remove(e),t.emit("error",n,e)}}var VV=class extends YZe{constructor(e,r){super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||r||qV().Client,this.Promise=this.options.Promise||global.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_promiseTry(e){let r=this.Promise;return typeof r.try=="function"?r.try(e):new r(n=>n(e()))}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended){this.log("pulse queue ended");return}if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(r=>{this._remove(r.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let r=this._idle.pop();clearTimeout(r.timeoutId);let n=r.client;n.ref&&n.ref();let i=r.idleListener;return this._acquireClient(n,e,i,!1)}if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e,r){let n=Pge(this._idle,s=>s.client===e);n!==void 0&&clearTimeout(n.timeoutId),this._clients=this._clients.filter(s=>s!==e);let i=this;e.end(()=>{i.emit("remove",e),typeof r=="function"&&r()})}connect(e){if(this.ending){let i=new Error("Cannot use a pool after calling end on the pool");return e?e(i):this.Promise.reject(i)}let r=LC(this.Promise,e),n=r.result;if(this._isFull()||this._idle.length){if(this._idle.length&&process.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new nm(r.callback)),n;let i=(a,c,l)=>{clearTimeout(o),r.callback(a,c,l)},s=new nm(i),o=setTimeout(()=>{Pge(this._pendingQueue,a=>a.callback===i),s.timedOut=!0,r.callback(new Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return o.unref&&o.unref(),this._pendingQueue.push(s),n}return this.newClient(new nm(r.callback)),n}newClient(e){let r=new this.Client(this.options);this._clients.push(r);let n=ZZe(this,r);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{r.connection?(this.log("ending client due to timeout"),s=!0,r.connection.stream.destroy()):r.isConnected()||(this.log("ending client due to timeout"),s=!0,r.end())},this.options.connectionTimeoutMillis)),this.log("connecting new client"),r.connect(o=>{if(i&&clearTimeout(i),r.on("error",n),o)this.log("client failed to connect",o),this._clients=this._clients.filter(a=>a!==r),s&&(o=new Error("Connection terminated due to connection timeout",{cause:o})),this._pulseQueue(),e.timedOut||e.callback(o,void 0,zV);else{if(this.log("new client connected"),this.options.onConnect){this._promiseTry(()=>this.options.onConnect(r)).then(()=>{this._afterConnect(r,e,n)},a=>{this._clients=this._clients.filter(c=>c!==r),r.end(()=>{this._pulseQueue(),e.timedOut||e.callback(a,void 0,zV)})});return}return this._afterConnect(r,e,n)}})}_afterConnect(e,r,n){if(this.options.maxLifetimeSeconds!==0){let i=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(e),this._idle.findIndex(o=>o.client===e)!==-1&&this._acquireClient(e,new nm((o,a,c)=>c()),n,!1)},this.options.maxLifetimeSeconds*1e3);i.unref(),e.once("end",()=>clearTimeout(i))}return this._acquireClient(e,r,n,!0)}_acquireClient(e,r,n,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n),e.removeListener("error",n),r.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e.release(s),r.callback(s,void 0,zV);r.callback(void 0,e,e.release)}):r.callback(void 0,e,e.release)}_releaseOnce(e,r){let n=!1;return i=>{n&&KZe(),n=!0,this._release(e,r,i)}}_release(e,r,n){if(e.on("error",r),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses)return e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(e,this._pulseQueue.bind(this));if(this._expired.has(e))return this.log("remove expired client"),this._expired.delete(e),this._remove(e,this._pulseQueue.bind(this));let s;this.options.idleTimeoutMillis&&this._isAboveMin()&&(s=setTimeout(()=>{this._isAboveMin()&&(this.log("remove idle client"),this._remove(e,this._pulseQueue.bind(this)))},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new GV(e,r,s)),this._pulseQueue()}query(e,r,n){if(typeof e=="function"){let s=LC(this.Promise,e);return setImmediate(function(){return s.callback(new Error("Passing a function as the first parameter to pool.query is not supported"))}),s.result}typeof r=="function"&&(n=r,r=void 0);let i=LC(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s)return n(s);let a=!1,c=l=>{a||(a=!0,o.release(l),n(l))};o.once("error",c),this.log("dispatching query");try{o.query(e,r,(l,u)=>{if(this.log("query dispatched"),o.removeListener("error",c),!a)return a=!0,o.release(l),l?n(l):n(void 0,u)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than once");return e?e(n):this.Promise.reject(n)}this.ending=!0;let r=LC(this.Promise,e);return this._endCallback=r.callback,this._pulseQueue(),r.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,r)=>e+(this._expired.has(r)?1:0),0)}get totalCount(){return this._clients.length}};Oge.exports=VV});var Dge=b((OVt,Mge)=>{"use strict";var kge=J("events").EventEmitter,JZe=J("util"),HV=Xh(),im=Mge.exports=function(t,e,r){kge.call(this),t=HV.normalizeQueryConfig(t,e,r),this.text=t.text,this.values=t.values,this.name=t.name,this.queryMode=t.queryMode,this.callback=t.callback,this.state="new",this._arrayMode=t.rowMode==="array",this._emitRowEvents=!1,this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};JZe.inherits(im,kge);var XZe={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};im.prototype.handleError=function(t){let e=this.native.pq.resultErrorFields();if(e)for(let r in e){let n=XZe[r]||r;t[n]=e[r]}this.callback?this.callback(t):this.emit("error",t),this.state="error"};im.prototype.then=function(t,e){return this._getPromise().then(t,e)};im.prototype.catch=function(t){return this._getPromise().catch(t)};im.prototype._getPromise=function(){return this._promise?this._promise:(this._promise=new Promise(function(t,e){this._once("end",t),this._once("error",e)}.bind(this)),this._promise)};im.prototype.submit=function(t){this.state="running";let e=this;this.native=t.native,t.native.arrayMode=this._arrayMode;let r=function(n,i,s){if(t.native.arrayMode=!1,setImmediate(function(){e.emit("_done")}),n)return e.handleError(n);e._emitRowEvents&&(s.length>1?i.forEach((o,a)=>{o.forEach(c=>{e.emit("row",c,s[a])})}):i.forEach(function(o){e.emit("row",o,s)})),e.state="end",e.emit("end",s),e.callback&&e.callback(null,s)};if(process.domain&&(r=process.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));let n=(this.values||[]).map(HV.prepareValue);if(t.namedQueries[this.name]){if(this.text&&t.namedQueries[this.name]!==this.text){let i=new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return r(i)}return t.native.execute(this.name,n,r)}return t.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(t.namedQueries[e.name]=e.text,e.native.execute(e.name,n,r))})}else if(this.values){if(!Array.isArray(this.values)){let i=new Error("Query values must be an array");return r(i)}let n=this.values.map(HV.prepareValue);t.native.query(this.text,n,r)}else this.queryMode==="extended"?t.native.query(this.text,[],r):t.native.query(this.text,r)}});var Bge=b((NVt,Fge)=>{"use strict";var QZe=J("util"),Lge;try{Lge=J("pg-native")}catch(t){throw t}var e5e=xC(),$ge=J("events").EventEmitter,t5e=J("util"),r5e=lV(),Uge=Dge(),n5e=QZe.deprecate(()=>{},"Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead."),Tr=Fge.exports=function(t){$ge.call(this),t=t||{},this._Promise=t.Promise||global.Promise,this._types=new e5e(t.types),this.native=new Lge({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;let e=this.connectionParameters=new r5e(t);t.nativeConnectionString&&(e.nativeConnectionString=t.nativeConnectionString),this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};Tr.Query=Uge;t5e.inherits(Tr,$ge);Tr.prototype._errorAllQueries=function(t){let e=r=>{process.nextTick(()=>{r.native=this.native,r.handleError(t)})};this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(e),this._queryQueue.length=0};Tr.prototype._connect=function(t){let e=this;if(this._connecting){process.nextTick(()=>t(new Error("Client has already been connected. You cannot reuse a client.")));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(e.connectionParameters.nativeConnectionString&&(n=e.connectionParameters.nativeConnectionString),r)return t(r);e.native.connect(n,function(i){if(i)return e.native.end(),t(i);e._connected=!0,e.native.on("error",function(s){e._queryable=!1,e._errorAllQueries(s),e.emit("error",s)}),e.native.on("notification",function(s){e.emit("notification",{channel:s.relname,payload:s.extra})}),e.emit("connect"),e._pulseQueryQueue(!0),t(null,this)})})};Tr.prototype.connect=function(t){if(t){this._connect(t);return}return new this._Promise((e,r)=>{this._connect(n=>{n?r(n):e(this)})})};Tr.prototype.query=function(t,e,r){let n,i,s,o,a;if(t==null)throw new TypeError("Client was passed a null or undefined query");if(typeof t.submit=="function")s=t.query_timeout||this.connectionParameters.query_timeout,i=n=t,typeof e=="function"&&(t.callback=e);else if(s=t.query_timeout||this.connectionParameters.query_timeout,n=new Uge(t,e,r),!n.callback){let c,l;i=new this._Promise((u,d)=>{c=u,l=d}).catch(u=>{throw Error.captureStackTrace(u),u}),n.callback=(u,d)=>u?l(u):c(d)}return s&&(a=n.callback||(()=>{}),o=setTimeout(()=>{let c=new Error("Query read timeout");process.nextTick(()=>{n.handleError(c,this.connection)}),a(c),n.callback=()=>{};let l=this._queryQueue.indexOf(n);l>-1&&this._queryQueue.splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{clearTimeout(o),a(c,l)}),this._queryable?this._ending?(n.native=this.native,process.nextTick(()=>{n.handleError(new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.length>0&&n5e(),this._queryQueue.push(n),this._pulseQueryQueue(),i):(n.native=this.native,process.nextTick(()=>{n.handleError(new Error("Client has encountered a connection error and is not queryable"))}),i)};Tr.prototype.end=function(t){let e=this;this._ending=!0,this._connecting&&!this._connected&&this.once("connect",()=>{this.end(()=>{})});let r;return t||(r=new this._Promise(function(n,i){t=s=>s?i(s):n()})),this.native.end(function(){e._connected=!1,e._errorAllQueries(new Error("Connection terminated")),process.nextTick(()=>{e.emit("end"),t&&t()})}),r};Tr.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};Tr.prototype._pulseQueryQueue=function(t){if(!this._connected||this._hasActiveQuery())return;let e=this._queryQueue.shift();if(!e){t||this.emit("drain");return}this._activeQuery=e,e.submit(this);let r=this;e.once("_done",function(){r._pulseQueryQueue()})};Tr.prototype.cancel=function(t){this._activeQuery===t?this.native.cancel(function(){}):this._queryQueue.indexOf(t)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(t),1)};Tr.prototype.ref=function(){};Tr.prototype.unref=function(){};Tr.prototype.setTypeParser=function(t,e,r){return this._types.setTypeParser(t,e,r)};Tr.prototype.getTypeParser=function(t,e){return this._types.getTypeParser(t,e)};Tr.prototype.isConnected=function(){return this._connected};Tr.prototype.getTransactionStatus=function(){return this.native.getTransactionStatus()}});var WV=b((kVt,jge)=>{"use strict";jge.exports=Bge()});var qV=b((DVt,$C)=>{"use strict";var i5e=Cge(),s5e=MS(),o5e=UV(),a5e=dV(),c5e=Xh(),l5e=Nge(),u5e=xC(),{DatabaseError:d5e}=DV(),{escapeIdentifier:f5e,escapeLiteral:p5e}=Xh(),h5e=t=>class extends l5e{constructor(r){super(r,t)}},zge=function(t){this.defaults=s5e,this.Client=t,this.Query=this.Client.Query,this.Pool=h5e(this.Client),this._pools=[],this.Connection=o5e,this.types=kS(),this.DatabaseError=d5e,this.TypeOverrides=u5e,this.escapeIdentifier=f5e,this.escapeLiteral=p5e,this.Result=a5e,this.utils=c5e},Gge=i5e,Vge=!1;try{Vge=!!process.env.NODE_PG_FORCE_NATIVE}catch{}Vge&&(Gge=WV());$C.exports=new zge(Gge);Object.defineProperty($C.exports,"native",{configurable:!0,enumerable:!1,get(){let t=null;try{t=new zge(WV())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty($C.exports,"native",{value:t}),t}})});import{readFileSync as N5e}from"fs";import k5e from"path";import{createRequire as M5e}from"module";import{setTimeout as CPe}from"timers/promises";be();import kSe from"process";be();var D_e=(t,e)=>{e.recordException(t),e.setStatus({code:gr.ERROR})};var Ms=class{constructor(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}withActiveSpan(e,r,n,i){let{opts:s,ctx:o,fn:a}=Gq(r,n,i);return this._tracer.startActiveSpan(e,s,o,c=>Vq(c,s,a))}withSpan(e,r,n,i){let{opts:s,ctx:o,fn:a}=Gq(r,n,i),c=this._tracer.startSpan(e,s,o);return Vq(c,s,a)}};function Gq(t,e,r){let n,i,s;return!e&&!r?s=t:r?(n=t,i=e,s=r):(n=t,s=e),n=n??{},i=i??at.active(),{opts:n,ctx:i,fn:s}}function Vq(t,e,r){var n;let i=(n=e.onException)!==null&&n!==void 0?n:D_e,s=o=>{throw i(o,t),t.end(),o};try{let o=r(t);return typeof o?.then=="function"?o.then(a=>(t.end(),a),s):(t.end(),o)}catch(o){throw s(o)}}be();var Uu=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";var v0=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let n=new t({},r);return n._rawAttributes=e6(e),n._asyncAttributesPending=e.filter(([i,s])=>Uu(s)).length>0,n}constructor(e,r){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([i,s])=>(Uu(s)&&(this._asyncAttributesPending=!0),[i,s])),this._rawAttributes=e6(this._rawAttributes),this._schemaUrl=L_e(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,n]=this._rawAttributes[e];this._rawAttributes[e]=[r,Uu(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Q.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,n]of this._rawAttributes){if(Uu(n)){Q.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(e[r]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(e==null)return this;let r=$_e(this,e),n=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],n)}};function b0(t,e){return v0.FromAttributeList(Object.entries(t),e)}function e6(t){return t.map(([e,r])=>Uu(r)?[e,r.catch(n=>{Q.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}function L_e(t){if(typeof t=="string"||t===void 0)return t;Q.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function $_e(t,e){let r=t?.schemaUrl,n=e?.schemaUrl,i=r===void 0||r==="",s=n===void 0||n==="";if(i)return n;if(s||r===n)return r;Q.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}be();var ym=class{emit(e){}enabled(){return!1}},t6=new ym;var Sm=Symbol.for("io.opentelemetry.js.api.logs"),Fu=globalThis;function r6(t,e,r){return n=>n===t?e:r}var T0=1;var A0=class{getLogger(e,r,n){return new ym}},cE=new A0;var lE=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):t6}};var Em=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new lE(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:cE}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}};var uE=class t{constructor(){this._proxyLoggerProvider=new Em}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Fu[Sm]?this.getLoggerProvider():(Fu[Sm]=r6(T0,e,cE),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Fu[Sm])===null||e===void 0?void 0:e.call(Fu,T0))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Fu[Sm],this._proxyLoggerProvider=new Em}};var n6=uE.getInstance();function i6(t,e,r,n){for(let i=0,s=t.length;i<s;i++){let o=t[i];e&&o.setTracerProvider(e),r&&o.setMeterProvider(r),n&&o.setLoggerProvider&&o.setLoggerProvider(n),o.getConfig().enabled||o.enable()}}function s6(t){t.forEach(e=>e.disable())}function x0(t){let e=t.tracerProvider||ft.getTracerProvider(),r=t.meterProvider||_m.getMeterProvider(),n=t.loggerProvider||n6.getLoggerProvider(),i=t.instrumentations?.flat()??[];return i6(i,e,r,n),()=>{s6(i)}}Fs();var Sv=on(RP(),1);be();Fs();var QW=t=>{throw TypeError(t)},OP=(t,e,r)=>e.has(t)||QW("Cannot "+r),yv=(t,e,r)=>(OP(t,e,"read from private field"),r?r.call(t):e.get(t)),IP=(t,e,r)=>e.has(t)?QW("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ZW=(t,e,r,n)=>(OP(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),NSe=(t,e,r)=>(OP(t,e,"access private method"),r),JW="__netlify__getTracer",MSe="__netlify__shutdownTracers",DSe="__nfOTLPTrace",Bm,jm,PP,eY,LSe=class{constructor(){IP(this,PP),IP(this,Bm),IP(this,jm),ZW(this,Bm,new Vu(NSe(this,PP,eY),this)),ZW(this,jm,Q.createComponentLogger({namespace:"netlify-span-exporter"}))}export(t,e){if(yv(this,jm).debug(`export ${t.length.toString()} spans`),yv(this,Bm).isCalled){e({code:wr.FAILED,error:new Error("Exporter has been shutdown")});return}console.log(DSe,JSON.stringify($Se(t))),e({code:wr.SUCCESS})}shutdown(){return yv(this,Bm).call()}};Bm=new WeakMap;jm=new WeakMap;PP=new WeakSet;eY=function(){return yv(this,jm).debug("Shutting down"),Promise.resolve()};function $Se(t){return{resourceSpans:t.map(e=>{let r=e.spanContext();return{resource:{attributes:_v(e.resource.attributes),droppedAttributesCount:e.droppedAttributesCount},scopeSpans:[{scope:{name:e.instrumentationScope.name,version:e.instrumentationScope.version},spans:[{traceId:r.traceId,spanId:r.spanId,parentSpanId:e.parentSpanContext?.spanId,name:e.name,kind:e.kind||ti.SERVER,startTimeUnixNano:CP(e.startTime),endTimeUnixNano:CP(e.endTime),attributes:_v(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(n=>({name:n.name,timeUnixNano:CP(n.time),attributes:_v(n.attributes??{}),droppedAttributesCount:n.droppedAttributesCount??0})),droppedEventsCount:e.droppedEventsCount,status:{code:e.status.code,message:e.status.message},links:e.links.map(n=>({spanId:n.context.spanId,traceId:n.context.traceId,attributes:_v(n.attributes??{}),droppedAttributesCount:n.droppedAttributesCount??0})),droppedLinksCount:e.droppedLinksCount}]}]}})}}function _v(t){return Object.keys(t).map(e=>tY(e,t[e]))}function tY(t,e){return{key:t,value:rY(e)}}function rY(t){let e=typeof t;return e==="string"?{stringValue:t}:e==="number"?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:e==="boolean"?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(rY)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>tY(r,n))}}:{}}function CP(t){let e=BigInt(1e9);return(BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))).toString()}var XW={name:"@netlify/otel",version:"6.0.4",type:"module",engines:{node:"^18.14.0 || >=20.6.1"},main:"./dist/main.cjs",module:"./dist/main.js",types:"./dist/main.d.ts",exports:{".":{require:{types:"./dist/main.d.cts",default:"./dist/main.cjs"},import:{types:"./dist/main.d.ts",default:"./dist/main.js"},default:{types:"./dist/main.d.ts",default:"./dist/main.js"}},"./package.json":"./package.json","./bootstrap":{require:{types:"./dist/bootstrap/main.d.cts",default:"./dist/bootstrap/main.cjs"},import:{types:"./dist/bootstrap/main.d.ts",default:"./dist/bootstrap/main.js"},default:{types:"./dist/bootstrap/main.d.ts",default:"./dist/bootstrap/main.js"}},"./exporter-netlify":{require:{types:"./dist/exporters/netlify.d.cts",default:"./dist/exporters/netlify.cjs"},import:{types:"./dist/exporters/netlify.d.ts",default:"./dist/exporters/netlify.js"},default:{types:"./dist/exporters/netlify.d.ts",default:"./dist/exporters/netlify.js"}},"./instrumentation-fetch":{require:{types:"./dist/instrumentations/fetch.d.cts",default:"./dist/instrumentations/fetch.cjs"},import:{types:"./dist/instrumentations/fetch.d.ts",default:"./dist/instrumentations/fetch.js"},default:{types:"./dist/instrumentations/fetch.d.ts",default:"./dist/instrumentations/fetch.js"}},"./instrumentation-http":{require:{types:"./dist/instrumentations/http.d.cts",default:"./dist/instrumentations/http.cjs"},import:{types:"./dist/instrumentations/http.d.ts",default:"./dist/instrumentations/http.js"},default:{types:"./dist/instrumentations/http.d.ts",default:"./dist/instrumentations/http.js"}},"./opentelemetry":{require:{types:"./dist/opentelemetry.d.cts",default:"./dist/opentelemetry.cjs"},import:{types:"./dist/opentelemetry.d.ts",default:"./dist/opentelemetry.js"},default:{types:"./dist/opentelemetry.d.ts",default:"./dist/opentelemetry.js"}}},files:["dist/**/*"],scripts:{build:"tsup-node",dev:"tsup-node --watch",prepack:"npm run build",test:"run-s build test:ci","test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"vitest","test:dev:vitest:watch":"vitest watch","test:ci:vitest":"vitest run",publint:"npx -y publint --strict"},keywords:["netlify","cdn"],license:"MIT",repository:{type:"git",url:"https://github.com/netlify/primitives.git",directory:"packages/otel"},bugs:{url:"https://github.com/netlify/primitives/issues"},author:"Netlify Inc.",devDependencies:{"@netlify/dev-utils":"^4.4.7",msw:"^2.10.5","npm-run-all2":"^7.0.2",tsup:"^8.0.0",vitest:"^3.0.0"},dependencies:{"@opentelemetry/api":"1.9.1","@opentelemetry/core":"2.7.1","@opentelemetry/instrumentation":"^0.220.0","@opentelemetry/resources":"2.9.0","@opentelemetry/sdk-trace-node":"2.9.0"}},nY=t=>{if(Object.prototype.hasOwnProperty.call(globalThis,JW))return;let e=kSe.version.slice(1),r=b0({"service.name":t.serviceName,"service.version":t.serviceVersion,"process.runtime.name":"nodejs","process.runtime.version":e,"deployment.environment":t.deploymentEnvironment,"http.url":t.siteUrl,"netlify.site.id":t.siteId,"netlify.site.name":t.siteName}),n=t.spanProcessors??[USe()],i=new Sv.NodeTracerProvider({resource:r,spanProcessors:n});i.register({propagator:new Us});let s=t.instrumentations??[];x0({instrumentations:s,tracerProvider:i}),Object.defineProperty(globalThis,JW,{enumerable:!1,configurable:!0,writable:!1,value:function(a,c){return a?new Ms(ft.getTracer(a,c)):new Ms(ft.getTracer(XW.name,XW.version))}}),Object.defineProperty(globalThis,MSe,{enumerable:!1,configurable:!0,writable:!1,value:async()=>await i.shutdown()})},USe=()=>new Sv.SimpleSpanProcessor(new LSe);be();Fs();var zm=on(RP(),1);be();import*as Ev from"diagnostics_channel";var iY=class{constructor(t={}){this.instrumentationName="@netlify/otel/instrumentation-fetch",this.instrumentationVersion="1.0.0",this._recordFromReq=new WeakMap,this.config=t,this._channelSubs=[]}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(t){this.provider=t}getTracerProvider(){return this.provider}annotateFromRequest(t,e){let r=this.config.getRequestAttributes?.(e)??{},n=new URL(e.path,e.origin);t.setAttributes({...r,"http.request.method":e.method,"url.full":n.href,"url.host":n.host,"url.scheme":n.protocol.slice(0,-1),"server.address":n.hostname,"server.port":n.port,...this.prepareHeaders("request",e.headers)})}annotateFromResponse(t,e){let r=this.config.getResponseAttributes?.(e)??{};t.setAttributes({...r,"http.response.status_code":e.statusCode,...this.prepareHeaders("response",e.headers)}),t.setStatus({code:e.statusCode>=400?gr.ERROR:gr.UNSET})}prepareHeaders(t,e){if(!Array.isArray(e))return{};if(this.config.skipHeaders===!0)return{};let r=["*","/.*/"],n=this.config.skipHeaders??[],i=this.config.redactHeaders??[],s=n.some(a=>r.includes(a.toString())),o={};if(s)return o;for(let a=0;a+1<e.length;a=a+2){let c=e[a],l=e[a+1];if(typeof c!="string"&&!Buffer.isBuffer(c)||typeof l!="string"&&!Buffer.isBuffer(l))continue;let u=c.toString().toLowerCase();if(n.some(f=>typeof f=="string"?f==u:f.test(u)))continue;let d=`http.${t}.header.${u}`;i===!0||i.some(f=>typeof f=="string"?f==u:f.test(u))?o[d]="REDACTED":o[d]=l.toString()}return o}getRequestMethod(t){return["HEAD","GET","POST","PUT","PATCH","DELETE"].includes(t.toUpperCase())?t.toUpperCase():"_OTHER"}getTracer(){if(!this.provider)return;let t=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return t instanceof Ms?t:new Ms(t)}enable(){this._channelSubs.length>0||(this.subscribe("undici:request:create",this.onRequestCreate.bind(this)),this.subscribe("undici:request:headers",this.onRequestHeaders.bind(this)),this.subscribe("undici:request:trailers",this.onRequestEnd.bind(this)),this.subscribe("undici:request:error",this.onRequestError.bind(this)))}subscribe(t,e){Ev.subscribe(t,e);let r=()=>Ev.unsubscribe(t,e);this._channelSubs.push({name:t,unsubscribe:r})}disable(){this._channelSubs.forEach(t=>{t.unsubscribe()}),this._channelSubs.length=0}onRequestCreate({request:t}){try{let e=this.getTracer(),r=new URL(t.path,t.origin);if(!e||t.method==="CONNECT"||this.config.skipURLs?.some(i=>typeof i=="string"?r.href.startsWith(i):i.test(r.href)))return;let n=e.startSpan(this.getRequestMethod(t.method),{kind:ti.CLIENT},at.active());this.annotateFromRequest(n,t),this._recordFromReq.set(t,n)}catch{}}onRequestHeaders({request:t,response:e}){try{let r=this._recordFromReq.get(t);if(!r)return;this.annotateFromResponse(r,e)}catch{}}onRequestError({request:t,error:e}){try{let r=this._recordFromReq.get(t);if(!r)return;r.recordException(e),r.setStatus({code:gr.ERROR,message:e.message}),r.end(),this._recordFromReq.delete(t)}catch{}}onRequestEnd({request:t}){try{let e=this._recordFromReq.get(t);if(!e)return;e.end(),this._recordFromReq.delete(t)}catch{}}};var FSe="__netlify__getTracer",BSe="__netlify__shutdownTracers",Ve=(t,e)=>globalThis[FSe]?.(t,e),sY=async()=>globalThis[BSe]?.();function qc(t,e,r,n,i){let s=typeof n=="function"?n:typeof r=="function"?r:i;if(!s)throw new Error("function to execute with active span is missing");return t?t.withActiveSpan(e,r,n,s):s()}var SX=on(mX(),1);import EPe from"process";var vPe="NETLIFY_FF_",Ei=t=>t==="true"||t==="1",We=()=>{let t={};for(let[e,r]of Object.entries(EPe.env))e.startsWith(vPe)&&r!==void 0&&(t[e]=r);return{byokEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_BYOK_ENABLED),idleTimeoutEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_IDLE_TIMEOUT),fetchAssetsEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_FETCH_ASSETS),coldResumeFromS3Enabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_COLD_RESUME_FROM_S3),creditWrapUpEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_CREDIT_WRAPUP),warmNativeResumeEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_WARM_NATIVE_RESUME),aiFnV1GuardrailEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_AI_FN_V1_GUARDRAIL),questionsEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_QUESTIONS_ENABLED),captureLlmContentEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_CAPTURE_LLM_CONTENT),skillVariations:Object.entries(t).filter(([e,r])=>e.startsWith("NETLIFY_FF_AGENT_RUNNER_SKILL_")&&Ei(r)).map(([e])=>e.replace("NETLIFY_FF_AGENT_RUNNER_SKILL_","").toLowerCase()),modelVersionOverrides:{codex:t.NETLIFY_FF_AGENT_RUNNER_CODEX_VERSION,claude:t.NETLIFY_FF_AGENT_RUNNER_CLAUDE_VERSION,gemini:t.NETLIFY_FF_AGENT_RUNNER_GEMINI_VERSION,opencode:t.NETLIFY_FF_AGENT_RUNNER_OPENCODE_VERSION},opencodeEnabled:Ei(t.NETLIFY_FF_AGENT_RUNNER_OPENCODE_ENABLED),opencodeDefaultModel:t.NETLIFY_FF_AGENT_RUNNER_OPENCODE_DEFAULT_MODEL||void 0,raw:t}};import bPe from"process";var gX;var t_=()=>gX?`-[session:${gX}]`:"";function me(t){let e=bPe.env.LOG!=="0";return{log:(...r)=>{e&&console.log(`[AR]-[${t}]${t_()}`,...r)},error:(...r)=>{e&&console.error(`[AR]-[ERROR]-[${t}]${t_()}`,...r)},warn:(...r)=>{e&&console.warn(`[AR]-[WARN]-[${t}]${t_()}`,...r)},info:(...r)=>{e&&console.info(`[AR]-[${t}]${t_()}`,...r)},debug:(...r)=>{e&&console.debug(`[AR]-[DEBUG]-[${t}]${t_()}`,...r)}}}import{Transform as TPe}from"stream";var APe=["NETLIFY_AI_GATEWAY_KEY"];function xPe(){let t=(process.env.NETLIFY_SENSITIVE_ENV_KEYS||"").split(",").map(e=>e.trim()).filter(Boolean);return[...new Set([...t,...APe])]}function wPe(t){let e=t.toLowerCase();return e==="true"||e==="false"?!0:t.trim().length<4}function RPe(){let e=xPe().map(r=>process.env[r]).filter(r=>!(!r||wPe(r)));return[...new Set(e)].sort((r,n)=>n.length-r.length)}function Gn(t){if(typeof t!="string")return t;let e=RPe();if(e.length===0)return t;let r=t;return e.forEach(n=>{let i=new RegExp(IPe(n),"g");r=r.replace(i,"******")}),r}function IPe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var r_=class extends TPe{constructor(e={}){super({...e,objectMode:!1})}_transform(e,r,n){let i=e.toString(),s=Gn(i);n(null,s)}},eA=Symbol("maskedWrite");function _X(){if(process.env.NETLIFY_MASK_LOGS!=="false"){if(!process.stdout.write[eA]){let e=process.stdout.write.bind(process.stdout),r=function(n,i,s){let o=typeof n=="string"?Gn(n):n;return typeof i=="function"?e(o,i):e(o,i,s)};r[eA]=!0,process.stdout.write=r}if(!process.stderr.write[eA]){let e=process.stderr.write.bind(process.stderr),r=function(n,i,s){let o=typeof n=="string"?Gn(n):n;return typeof i=="function"?e(o,i):e(o,i,s)};r[eA]=!0,process.stderr.write=r}}}var tA=me("tracing"),yX=8e3,PPe=5e3,EX=async(t=PPe)=>{try{await Promise.race([sY(),CPe(t)])}catch(e){tA.warn("Failed to flush tracers on shutdown",e)}},vX=async(t,e,r)=>{if(!Ve()){let n=[new zm.SimpleSpanProcessor(new mD),new zm.SimpleSpanProcessor(new SX.OTLPTraceExporter({url:r.exporterUrl}))];await nY({serviceName:"@netlify/agent-runner-cli",serviceVersion:t,deploymentEnvironment:"production",siteUrl:"",siteId:process.env.SITE_ID??"",siteName:e,spanProcessors:n,instrumentations:[new iY({skipHeaders:!0})]})}return r.traceparent?(xr.setGlobalPropagator(new Us),xr.extract(at.active(),{traceparent:r.traceparent,isRemote:!0})):at.active()};function ht(t,e,r){return tA.log(`\u23F3 TRACE: ${e} starting...`),qc(t,e,r)}var mD=class{export(e,r){for(let n of e)this.logSpan(n);r({code:1})}async shutdown(){}forceFlush(){return Promise.resolve()}logSpan(e){let r=(e.endTime[0]-e.startTime[0])*1e3+(e.endTime[1]-e.startTime[1])/1e6,n=e.attributes,i=[];for(let[a,c]of Object.entries(n))a.includes("duration")&&typeof c=="number"?i.push(`${a}=${c.toFixed(2)}ms`):i.push(`${a}=${c}`);let s=e.status?.code===2?"\u274C":"\u2705",o=i.length>0?` [${i.join(", ")}]`:"";tA.log(`${s} TRACE: ${e.name} completed in ${r.toFixed(2)}ms${o}`),e.status?.code===2&&e.status.message&&tA.log(` \u274C Error: ${e.status.message}`)}};function gD(){return We().captureLlmContentEnabled}function bX(t){return t.includes("claude")?"anthropic":t.includes("codex")?"openai":t.includes("gemini")?"google":t.includes("opencode")?"opencode":t}function rA(t,e,r){let n={role:t,parts:[{type:"text",content:Gn(e)}]};return r&&(n.finish_reason=r),JSON.stringify([n])}function TX(t,e,r,n){if(!t.length)return;let i=Ve();if(!i)return;let s=gD(),o=Math.max(1,(n-r)/t.length);t.forEach((a,c)=>{let l=Math.min(n,r+c*o),u=Math.min(n,l+o),d=a.title||a.type||`step-${a.id??c}`,f=a.type==="tool_use"||a.type==="tool_result",p=a.message?a.message.length>yX?`${a.message.slice(0,yX)}\u2026`:a.message:void 0;i.startSpan(d,{startTime:l,attributes:{"gen_ai.capability.name":e,"gen_ai.step.name":d,"gen_ai.operation.name":f?"execute_tool":"chat",...f?{"gen_ai.tool.name":d}:{},"spark.step.id":a.id??-1,...a.type?{"spark.step.type":a.type}:{},...a.category?{"spark.step.category":a.category}:{},...a.groupId?{"spark.step.group_id":a.groupId}:{},...a.parentGroupId?{"spark.step.parent_group_id":a.parentGroupId}:{},...s&&p?f?{"gen_ai.tool.call.result":Gn(p)}:{"gen_ai.output.messages":rA("assistant",p)}:{}}}).end(u)})}var OPe=["error","failed","exception","fatal","panic","abort","crash"];function AX(t){let e=t.split(`
|
|
33
33
|
`),r=[],n=-1,i=0;for(;i<e.length;){let a=e[i].slice(0,500).toLowerCase();if(OPe.some(l=>a.includes(l))){let l=Math.max(0,i-10,n+1),u=Math.min(e.length-1,i+20),d=[];for(let f=l;f<=u;f++)d.push(e[f]);r.push(d.join(`
|
|
34
34
|
`)),n=u,i=u+1}else i++}if(r.length===0)return t;let s=r.map((o,a)=>`<extracted_error_chunk order="${a+1}">
|
|
35
35
|
${o}
|
|
@@ -98,7 +98,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
|
98
98
|
`,LF:`
|
|
99
99
|
`,concatBytes:SL},nLe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},iLe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:nLe};import{Buffer as sLe}from"buffer";var Cte=(t,e)=>t?void 0:oLe.bind(void 0,e),oLe=function*(t,e){if(typeof e!="string"&&!jt(e)&&!sLe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},Pte=(t,e)=>t?aLe.bind(void 0,e):cLe.bind(void 0,e),aLe=function*(t,e){Ote(t,e),yield e},cLe=function*(t,e){if(Ote(t,e),typeof e!="string"&&!jt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},Ote=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
100
100
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
101
|
-
if (condition) { yield value; }`)};import{Buffer as lLe}from"buffer";import{StringDecoder as uLe}from"string_decoder";var rx=(t,e,r)=>{if(r)return;if(t)return{transform:dLe.bind(void 0,new TextEncoder)};let n=new uLe(e);return{transform:fLe.bind(void 0,n),final:pLe.bind(void 0,n)}},dLe=function*(t,e){lLe.isBuffer(e)?yield uo(e):typeof e=="string"?yield t.encode(e):yield e},fLe=function*(t,e){yield jt(e)?t.write(e):e},pLe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as Nte}from"util";var vL=Nte(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),nx=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=mLe}=e[r];for await(let i of n(t))yield*nx(i,e,r+1)},kte=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*hLe(r,Number(e),t)},hLe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*nx(n,r,e+1)},Mte=Nte(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),mLe=function*(t){yield t};var bL=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},Dte=(t,e)=>[...e.flatMap(r=>[...Al(r,t,0)]),...b_(t)],Al=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=_Le}=e[r];for(let i of n(t))yield*Al(i,e,r+1)},b_=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*gLe(r,Number(e),t)},gLe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Al(n,r,e+1)},_Le=function*(t){yield t};var TL=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:s},{encoding:o})=>{let a={},c=$te(t,o,s),l=Tl(e),u=Tl(r),d=l?vL.bind(void 0,nx,a):bL.bind(void 0,Al),f=l||u?vL.bind(void 0,kte,a):bL.bind(void 0,b_),p=l||u?Mte.bind(void 0,a):void 0;return{stream:new yLe({writableObjectMode:n,writableHighWaterMark:Lte(n),readableObjectMode:i,readableHighWaterMark:Lte(i),transform(m,E,T){d([m,c,0],this,T)},flush(m){f([c],this,m)},destroy:p})}},ix=(t,e,r,n)=>{let i=e.filter(({type:o})=>o==="generator"),s=n?i.reverse():i;for(let{value:o,optionName:a}of s){let c=$te(o,r,a);t=Dte(c,t)}return t},$te=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:s},o,a)=>{let c={};return[{transform:Cte(n,a)},rx(r,o,n),tx(r,s,n,c),{transform:t,final:e},{transform:Pte(i,a)},Ite({binary:r,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)};var Ute=(t,e)=>{for(let r of SLe(t))ELe(t,r,e)},SLe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ELe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Ca[a]} with synchronous methods.`)}let o=i.map(({contents:a})=>a).map(a=>vLe(a,n));r.input=f_(o)},vLe=(t,e)=>{let r=ix(t,e,"utf8",!0);return bLe(r),f_(r)},bLe=t=>{let e=t.find(r=>typeof r!="string"&&!jt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as wLe,appendFileSync as RLe}from"fs";var sx=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&ef(r,n)&&!mn.has(e)&&TLe(n)&&(t.some(({type:i,value:s})=>i==="native"&&ALe.has(s))||t.every(({type:i})=>qn.has(i))),TLe=t=>t===1||t===2,ALe=new Set(["pipe","overlapped"]),Fte=async(t,e,r,n)=>{for await(let i of t)xLe(e)||jte(i,r,n)},Bte=(t,e,r)=>{for(let n of t)jte(n,e,r)},xLe=t=>t._readableState.pipes.length>0,jte=(t,e,r)=>{let n=SA(t);as({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var zte=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let s={},o=new Set([]);return{output:e.map((c,l)=>ILe({result:c,fileDescriptors:t,fdNumber:l,state:s,outputFiles:o,isMaxBuffer:n,verboseInfo:i},r)),...s}},ILe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=Gee(t,s,d),p=uo(f),{stdioItems:h,objectMode:m}=e[r],E=CLe([p],h,c,n),{serializedResult:T,finalResult:v=T}=PLe({chunks:E,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});OLe({serializedResult:T,fdNumber:r,state:n,verboseInfo:o,encoding:c,stdioItems:h,objectMode:m});let A=a[r]?v:void 0;try{return n.error===void 0&&NLe(T,h,i),A}catch(S){return n.error=S,A}},CLe=(t,e,r,n)=>{try{return ix(t,e,r,!1)}catch(i){return n.error=i,t}},PLe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:f_(t)};let o=nQ(t,r);return n[s]?{serializedResult:o,finalResult:EL(o,!i[s],e)}:{serializedResult:o}},OLe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:s,objectMode:o})=>{if(!sx({stdioItems:s,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=EL(t,!1,o);try{Bte(a,e,n)}catch(c){r.error??=c}},NLe=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:s})=>QA.has(s))){let s=typeof n=="string"?n:n.toString();i||r.has(s)?RLe(n,t):(r.add(s),wLe(n,t))}};var Gte=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ho(e,r,"all")]:Array.isArray(e)?[ho(t,r,"all"),...e]:jt(t)&&jt(e)?CD([t,e]):`${t}${e}`};import{once as AL}from"events";var Vte=async(t,e)=>{let[r,n]=await kLe(t);return e.isForcefullyTerminated??=!1,[r,n]},kLe=async t=>{let[e,r]=await Promise.allSettled([AL(t,"spawn"),AL(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?qte(t):r.value},qte=async t=>{try{return await AL(t,"exit")}catch{return qte(t)}},Hte=async t=>{let[e,r]=await t;if(!MLe(e,r)&&xL(e,r))throw new Ai;return[e,r]},MLe=(t,e)=>t===void 0&&e===void 0,xL=(t,e)=>t!==0||e!==null;var Wte=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let s=DLe(t,e,r),o=s?.code==="ETIMEDOUT",a=zee(s,n,i);return{resultError:s,exitCode:e,signal:r,timedOut:o,isMaxBuffer:a}},DLe=(t,e,r)=>t!==void 0?t:xL(e,r)?new Ai:void 0;var Yte=(t,e,r)=>{let{file:n,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=$Le(t,e,r),d=BLe({file:n,commandArguments:i,options:l,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:a});return df(d,c,l)},$Le=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=vA(t,e,r),a=ULe(r),{file:c,commandArguments:l,options:u}=jA(t,e,a);FLe(u);let d=Ate(u,o);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:u,fileDescriptors:d}},ULe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,FLe=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&ox("ipcInput"),t&&ox("ipc: true"),r&&ox("detached: true"),n&&ox("cancelSignal")},ox=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},BLe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{let c=jLe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Wte(c,r),{output:h,error:m=l}=zte({fileDescriptors:o,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:s}),E=h.map((v,A)=>ho(v,r,A)),T=ho(Gte(h,r),r,"all");return GLe({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:E,all:T,options:r,command:n,escapedCommand:i,startTime:a})},jLe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{Ute(s,r);let a=zLe(r);return LLe(...zA(t,e,a))}catch(a){return uf({error:a,command:n,escapedCommand:i,fileDescriptors:s,options:r,startTime:o,isSync:!0})}},zLe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:KA(e)}),GLe=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:s,all:o,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?ZA({command:c,escapedCommand:l,stdio:s,all:o,ipcOutput:[],options:a,startTime:u}):v_({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:o,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as P1e}from"events";import{spawn as O1e}from"child_process";import Qte from"process";import{once as wL,on as VLe}from"events";var Kte=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:s}={})=>(nf({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:DA(t)}),qLe({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:i})),qLe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{OA(e,i);let s=Ia(t,e,r),o=new AbortController;try{return await Promise.race([HLe(s,n,o),WLe(s,r,o),YLe(s,r,o)])}catch(a){throw sf(t),a}finally{o.abort(),NA(e,i)}},HLe=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await wL(t,"message",{signal:r});return n}for await(let[n]of VLe(t,"message",{signal:r}))if(e(n))return n},WLe=async(t,e,{signal:r})=>{await wL(t,"disconnect",{signal:r}),D7(e)},YLe=async(t,e,{signal:r})=>{let[n]=await wL(t,"strict:error",{signal:r});throw IA(n,e)};import{once as Jte,on as KLe}from"events";var Xte=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>RL({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),RL=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:s})=>{nf({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:DA(t)}),OA(e,s);let o=Ia(t,e,r),a=new AbortController,c={};return ZLe(t,o,a),JLe({ipcEmitter:o,isSubprocess:r,controller:a,state:c}),XLe({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:s})},ZLe=async(t,e,r)=>{try{await Jte(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},JLe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await Jte(t,"strict:error",{signal:r.signal});n.error=IA(i,e),r.abort()}catch{}},XLe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(let[c]of KLe(r,"message",{signal:s.signal}))Zte(o),yield c}catch{Zte(o)}finally{s.abort(),NA(e,a),n||sf(t),i&&await t}},Zte=({error:t})=>{if(t)throw t};var ere=(t,{ipc:e})=>{Object.assign(t,rre(t,!1,e))},tre=()=>{let t=Qte,e=!0,r=Qte.channel!==void 0;return{...rre(t,e,r),getCancelSignal:cee.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},rre=(t,e,r)=>({sendMessage:FA.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Kte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Xte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as QLe}from"child_process";import{PassThrough as e$e,Readable as t$e,Writable as r$e,Duplex as n$e}from"stream";var nre=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,verboseInfo:o})=>{_L(n);let a=new QLe;i$e(a,n),Object.assign(a,{readable:s$e,writable:o$e,duplex:a$e});let c=uf({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,isSync:!1}),l=c$e(c,o,i);return{subprocess:a,promise:l}},i$e=(t,e)=>{let r=T_(),n=T_(),i=T_(),s=Array.from({length:e.length-3},T_),o=T_(),a=[r,n,i,...s];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:o,stdio:a})},T_=()=>{let t=new e$e;return t.end(),t},s$e=()=>new t$e({read(){}}),o$e=()=>new r$e({write(){}}),a$e=()=>new n$e({read(){},write(){}}),c$e=async(t,e,r)=>df(t,e,r);import{createReadStream as ire,createWriteStream as sre}from"fs";import{Buffer as l$e}from"buffer";import{Readable as A_,Writable as u$e,Duplex as d$e}from"stream";var are=(t,e)=>ex(f$e,t,e,!1),x_=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Ca[t]}.`)},ore={fileNumber:x_,generator:TL,asyncGenerator:TL,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:d$e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},f$e={input:{...ore,fileUrl:({value:t})=>({stream:ire(t)}),filePath:({value:{file:t}})=>({stream:ire(t)}),webStream:({value:t})=>({stream:A_.fromWeb(t)}),iterable:({value:t})=>({stream:A_.from(t)}),asyncIterable:({value:t})=>({stream:A_.from(t)}),string:({value:t})=>({stream:A_.from(t)}),uint8Array:({value:t})=>({stream:A_.from(l$e.from(t))})},output:{...ore,fileUrl:({value:t})=>({stream:sre(t)}),filePath:({value:{file:t,append:e}})=>({stream:sre(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:u$e.fromWeb(t)}),iterable:x_,asyncIterable:x_,string:x_,uint8Array:x_}};import{on as p$e,once as cre}from"events";import{PassThrough as h$e,getDefaultHighWaterMark as m$e}from"stream";import{finished as dre}from"stream/promises";function xl(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)CL(i);let e=t.some(({readableObjectMode:i})=>i),r=g$e(t,e),n=new IL({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var g$e=(t,e)=>{if(t.length===0)return m$e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},IL=class extends h$e{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(CL(e),this.#e.has(e))return;this.#e.add(e),this.#n??=_$e(this,this.#e,this.#s);let r=E$e({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#s});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(CL(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},_$e=async(t,e,r)=>{ax(t,lre);let n=new AbortController;try{await Promise.race([y$e(t,n),S$e(t,e,r,n)])}finally{n.abort(),ax(t,-lre)}},y$e=async(t,{signal:e})=>{try{await dre(t,{signal:e,cleanup:!0})}catch(r){throw fre(t,r),r}},S$e=async(t,e,r,{signal:n})=>{for await(let[i]of p$e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},CL=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},E$e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:s,unpipeEvent:o})=>{ax(t,ure);let a=new AbortController;try{await Promise.race([v$e(s,e,a),b$e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),T$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),ax(t,-ure)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?PL(t):A$e(t))},v$e=async(t,e,{signal:r})=>{try{await t,r.aborted||PL(e)}catch(n){r.aborted||fre(e,n)}},b$e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:s}})=>{try{await dre(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(o){if(s.aborted||!r.has(e))return;pre(o)?i.add(e):hre(t,o)}},T$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:s}})=>{if(await cre(t,i,{signal:s}),!t.readable)return cre(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},A$e=t=>{t.writable&&t.end()},fre=(t,e)=>{pre(e)?PL(t):hre(t,e)},pre=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PL=t=>{(t.readable||t.writable)&&t.destroy()},hre=(t,e)=>{t.destroyed||(t.once("error",x$e),t.destroy(e))},x$e=()=>{},ax=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},lre=2,ure=1;import{finished as mre}from"stream/promises";var pf=(t,e)=>{t.pipe(e),w$e(t,e),R$e(t,e)},w$e=async(t,e)=>{if(!(Ti(t)||Ti(e))){try{await mre(t,{cleanup:!0,readable:!0,writable:!1})}catch{}OL(e)}},OL=t=>{t.writable&&t.end()},R$e=async(t,e)=>{if(!(Ti(t)||Ti(e))){try{await mre(e,{cleanup:!0,readable:!1,writable:!0})}catch{}NL(t)}},NL=t=>{t.readable&&t.destroy()};var gre=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:c})=>qn.has(c)))I$e(t,a,o,i);for(let{stream:a}of s.filter(({type:c})=>!qn.has(c)))P$e({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,s]of n.entries()){let o=s.length===1?s[0]:xl(s);pf(o,i)}},I$e=(t,e,r,n)=>{r==="output"?pf(t.stdio[n],e):pf(e,t.stdio[n]);let i=C$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},C$e=["stdin","stdout","stderr"],P$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:s})=>{if(e===void 0)return;O$e(e,s);let[o,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(o)??[];i.set(o,[...c,a])},O$e=(t,{signal:e})=>{Ti(t)&&vl(t,N$e,e)},N$e=2;import{addAbortListener as D$e}from"events";var wl=[];wl.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&wl.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&wl.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var cx=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",kL=Symbol.for("signal-exit emitter"),ML=globalThis,k$e=Object.defineProperty.bind(Object),DL=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(ML[kL])return ML[kL];k$e(ML,kL,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},lx=class{},M$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),LL=class extends lx{onExit(){return()=>{}}load(){}unload(){}},$L=class extends lx{#e=UL.platform==="win32"?"SIGINT":"SIGHUP";#r=new DL;#t;#n;#s;#i={};#o=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of wl)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),n.length===i){this.unload();let o=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;o||e.kill(e.pid,a)}};this.#s=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!cx(this.#t))return()=>{};this.#o===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#r.count+=1;for(let e of wl)try{let r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#c(e,...r),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#o&&(this.#o=!1,wl.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#s,this.#r.count-=1)}#a(e){return cx(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#s.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&cx(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let i=n.call(this.#t,e,...r);return this.#r.emit("exit",this.#t.exitCode,null),i}else return n.call(this.#t,e,...r)}},UL=globalThis.process,{onExit:_re,load:eSt,unload:tSt}=M$e(cx(UL)?new $L(UL):new LL);var yre=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=_re(()=>{t.kill()});D$e(n,()=>{i()})};var Ere=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let s=EA(),{destination:o,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=L$e(r,n,i),{sourceStream:d,sourceError:f}=U$e(t,l),{options:p,fileDescriptors:h}=ls.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:s}},L$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=$$e(t,e,...r),a=PA(n,s);return{destination:n,destinationStream:a,from:i,unpipeSignal:o}}catch(n){return{destinationError:n}}},$$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Sre,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||RD(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,s,o]=uA(r,...n);return{destination:e(Sre)(i,s,o),pipeOptions:o}}if(ls.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Sre=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),U$e=(t,e)=>{try{return{sourceStream:of(t,e)}}catch(r){return{sourceError:r}}};var bre=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:s,startTime:o})=>{let a=F$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw FL({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},F$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return NL(t),n;if(e!==void 0)return OL(r),e},FL=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>uf({error:t,command:vre,escapedCommand:vre,fileDescriptors:e,options:r,startTime:n,isSync:!1}),vre="source.pipe(destination)";var Tre=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(n)||o.pipedFrom.push(n),i==="rejected")throw o;if(e==="rejected")throw n;return o};import{finished as B$e}from"stream/promises";var Are=(t,e,r)=>{let n=ux.has(e)?z$e(t,e):j$e(t,e);return vl(t,V$e,r.signal),vl(e,q$e,r.signal),G$e(e),n},j$e=(t,e)=>{let r=xl([t]);return pf(r,e),ux.set(e,r),r},z$e=(t,e)=>{let r=ux.get(e);return r.add(t),r},G$e=async t=>{try{await B$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ux.delete(t)},ux=new WeakMap,V$e=2,q$e=1;import{aborted as H$e}from"util";var xre=(t,e)=>t===void 0?[]:[W$e(t,e)],W$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:s})=>{await H$e(t,e),await r.remove(e);let o=new Error("Pipe canceled by `unpipeSignal` option.");throw FL({error:o,fileDescriptors:n,sourceOptions:i,startTime:s})};var dx=(t,...e)=>{if(Ot(e[0]))return dx.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Ere(t,...e),i=Y$e({...n,destination:r});return i.pipe=dx.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},Y$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=K$e(t,i);bre({sourceStream:e,sourceError:n,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=Are(e,s,d);return await Promise.race([Tre(u),...xre(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},K$e=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as r1e}from"timers/promises";import{on as Z$e}from"events";import{getDefaultHighWaterMark as J$e}from"stream";var fx=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:s})=>{let o=new AbortController;return X$e(e,o),Rre({stream:t,controller:o,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},X$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},BL=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:s})=>{let o=new AbortController;Q$e(e,o,t);let a=t.readableObjectMode&&!s;return Rre({stream:t,controller:o,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},Q$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Rre=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})=>{let a=Z$e(t,"data",{signal:e.signal,highWaterMark:wre,highWatermark:wre});return e1e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})},jL=J$e(!0),wre=jL,e1e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o}){let a=t1e({binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(let[c]of t)yield*Al(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*b_(a)}},t1e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[rx(t,r,!e),tx(t,i,!n,{})].filter(Boolean);var Ire=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=n1e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([i1e(t),d]);return}let f=yL(c,r),p=BL({stream:t,onStreamEnd:e,lines:o,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([s1e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:s,lines:o}),d]);return h},n1e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!sx({stdioItems:o[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=BL({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await Fte(a,t,r,s)},i1e=async t=>{await r1e(),t.readableFlowing===null&&t.resume()},s1e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await HA(r,{maxBuffer:s}):i==="buffer"?new Uint8Array(await WA(r,{maxBuffer:s})):await lf(r,{maxBuffer:s})}catch(a){return Cre(Fee({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:n}))}},zL=async t=>{try{return await t}catch(e){return Cre(e)}},Cre=({bufferedData:t})=>tQ(t)?new Uint8Array(t):t;import{finished as o1e}from"stream/promises";var w_=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let s=a1e(t,r),o=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],o1e(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||u1e(a,e,r,n)}finally{o.abort()}},a1e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&c1e(t,r,n),n},c1e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{l1e(e,r),n.call(t,...i)}},l1e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},u1e=(t,e,r,n)=>{if(!d1e(t,e,r,n))throw t},d1e=(t,e,r,n=!0)=>r.propagating?Pre(t)||px(t):(r.propagating=!0,GL(r,e)===n?Pre(t):px(t)),GL=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",px=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Pre=t=>t?.code==="EPIPE";var Ore=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,l)=>VL({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),VL=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=w_(t,e,l);if(GL(l,e)){await u;return}let[d]=await Promise.all([Ire({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var Nre=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?xl([t,e].filter(Boolean)):void 0,kre=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>VL({...f1e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:p1e(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),f1e=({stdout:t,stderr:e,all:r},[,n,i])=>{let s=n||i;return s?n?i?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},p1e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as h1e}from"events";var Mre=t=>ef(t,"ipc"),Dre=(t,e)=>{let r=SA(t);as({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Lre=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:s})=>{if(!n)return i;let o=Mre(s),a=fo(e,"ipc"),c=fo(r,"ipc");for await(let l of RL({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Bee(t,i,c),i.push(l)),o&&Dre(l,s);return i},$re=async(t,e)=>(await Promise.allSettled([t]),e);var Ure=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:E,controller:T})=>{let v=Vte(t,f),A={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:v,propagating:!1},S=Ore({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:A}),R=kre({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:A}),P=[],L=Lre({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:P,verboseInfo:p}),I=m1e(m,t,A),O=g1e(h,A);try{return await Promise.race([Promise.all([{},Hte(v),Promise.all(S),R,L,yee(t,d),...I,...O]),E,_1e(t,T),...pee(t,s,f,T),...M7({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:T}),...dee({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:T})])}catch(j){return f.terminationReason??="other",Promise.all([{error:j},v,Promise.all(S.map(_=>zL(_))),zL(R),$re(L,P),Promise.allSettled(I),Promise.allSettled(O)])}},m1e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:w_(n,i,r)),g1e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:s=i})=>wi(s,{checkOpen:!1})&&!Ti(s)).map(({type:i,value:s,stream:o=s})=>w_(o,n,e,{isSameDirection:qn.has(i),stopOnExit:i==="native"}))),_1e=async(t,{signal:e})=>{let[r]=await h1e(t,"error",{signal:e});throw r};var Fre=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),R_=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),s=cs();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},hf=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as y1e}from"stream";import{callbackify as S1e}from"util";import{finished as Bre}from"stream/promises";var qL=async t=>{if(t!==void 0)try{await HL(t)}catch{}},jre=async t=>{if(t!==void 0)try{await WL(t)}catch{}},HL=async t=>{await Bre(t,{cleanup:!0,readable:!1,writable:!0})},WL=async t=>{await Bre(t,{cleanup:!0,readable:!0,writable:!1})},hx=async(t,e)=>{if(await t,e)throw e},mx=(t,e,r)=>{r&&!px(r)?t.destroy(r):e&&t.destroy()};var zre=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:s=!0}={})=>{let o=i||mn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=YL(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=KL(a,o),{read:f,onStdoutDataDone:p}=ZL({subprocessStdout:a,subprocess:t,binary:o,encoding:r,preserveNewlines:s}),h=new y1e({read:f,destroy:S1e(XL.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return JL({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},YL=(t,e,r)=>{let n=of(t,e),i=R_(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},KL=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:jL},ZL=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let s=cs(),o=fx({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){E1e(this,o,s)},onStdoutDataDone:s}},E1e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},JL=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await WL(t),await n,await qL(i),await e,r.readable&&r.push(null)}catch(s){await qL(i),Gre(r,s)}},XL=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await hf(r,e)&&(Gre(t,n),await hx(e,n))},Gre=(t,e)=>{mx(t,t.readable,e)};import{Writable as v1e}from"stream";import{callbackify as Vre}from"util";var qre=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}=QL(t,r,e),o=new v1e({...e$(n,t,i),destroy:Vre(r$.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return t$(n,o),o},QL=(t,e,r)=>{let n=PA(t,e),i=R_(r,n,"writableFinal"),s=R_(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}},e$=(t,e,r)=>({write:b1e.bind(void 0,t),final:Vre(T1e.bind(void 0,t,e,r))}),b1e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},T1e=async(t,e,r)=>{await hf(r,e)&&(t.writable&&t.end(),await e)},t$=async(t,e,r)=>{try{await HL(t),e.writable&&e.end()}catch(n){await jre(r),Hre(e,n)}},r$=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await hf(r,e),await hf(n,e)&&(Hre(t,i),await hx(e,i))},Hre=(t,e)=>{mx(t,t.writable,e)};import{Duplex as A1e}from"stream";import{callbackify as x1e}from"util";var Wre=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{let a=s||mn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=YL(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=QL(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=KL(c,a),{read:E,onStdoutDataDone:T}=ZL({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:o}),v=new A1e({read:E,...e$(u,t,d),destroy:x1e(w1e.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return JL({subprocessStdout:c,onStdoutDataDone:T,readable:v,subprocess:t,subprocessStdin:u}),t$(u,v,c),v},w1e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([XL({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},o),r$({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:s},o)])};var n$=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let s=n||mn.has(e),o=of(t,r),a=fx({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return R1e(a,o,t)},R1e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Yre=(t,{encoding:e})=>{let r=Fre();t.readable=zre.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=qre.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Wre.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=n$.bind(void 0,t,e),t[Symbol.asyncIterator]=n$.bind(void 0,t,e,{})};var Kre=(t,e)=>{for(let[r,n]of C1e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},I1e=(async()=>{})().constructor.prototype,C1e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(I1e,t)]);var Zre=(t,e,r,n)=>{let{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=N1e(t,e,r),{subprocess:f,promise:p}=M1e({file:i,commandArguments:s,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=dx.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),Kre(f,p),ls.set(f,{options:u,fileDescriptors:d}),f},N1e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=vA(t,e,r),{file:a,commandArguments:c,options:l}=jA(t,e,r),u=k1e(l),d=are(u,o);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:u,fileDescriptors:d}},k1e=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},M1e=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=O1e(...zA(t,e,r))}catch(h){return nre({error:h,command:s,escapedCommand:o,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;P1e(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];gre(c,a,l),yre(c,r,l);let d={},f=cs();c.kill=N7.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=Nre(c,r),Yre(c,r),ere(c,r);let p=D1e({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:s,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},D1e=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,E]=await Ure({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:s,onInternalError:l,controller:u});u.abort(),l.resolve();let T=h.map((S,R)=>ho(S,e,R)),v=ho(m,e,"all"),A=L1e({errorInfo:d,exitCode:f,signal:p,stdio:T,all:v,ipcOutput:E,context:c,options:e,command:o,escapedCommand:a,startTime:r});return df(A,n,e)},L1e=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,context:o,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?v_({error:t.error,command:c,escapedCommand:l,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof us,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,options:a,startTime:u,isSync:!1}):ZA({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:s,options:a,startTime:u});var gx=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,$1e(n,t[n],i)]));return{...t,...r}},$1e=(t,e,r)=>U1e.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,U1e=new Set(["env",...kD]);var Pa=(t,e,r,n)=>{let i=(o,a,c)=>Pa(o,a,r,c),s=(...o)=>F1e({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...o);return n!==void 0&&n(s,i,e),s},F1e=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},s,...o)=>{if(Ot(s))return i(t,gx(r,s),n);let{file:a,commandArguments:c,options:l,isSync:u}=B1e({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:r});return u?Yte(a,c,l):Zre(a,c,l,i)},B1e=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let s=aQ(e)?cQ(e,r):[e,...r],[o,a,c]=uA(...s),l=gx(gx(n,i),c),{file:u=o,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:o,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var Jre=({file:t,commandArguments:e})=>Qre(t,e),Xre=({file:t,commandArguments:e})=>({...Qre(t,e),isSync:!0}),Qre=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=j1e(t);return{file:r,commandArguments:n}},j1e=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(z1e)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},z1e=/ +/g;var ene=(t,e,r)=>{t.sync=e(G1e,r),t.s=t.sync},tne=({options:t})=>rne(t),G1e=({options:t})=>({...rne(t),isSync:!0}),rne=t=>({options:{...V1e(t),...t}}),V1e=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},nne={preferLocal:!0};var ine=Pa(()=>({})),Vvt=Pa(()=>({isSync:!0})),sne=Pa(Jre),qvt=Pa(Xre),Hvt=Pa(mee),Wvt=Pa(tne,{},nne,ene),{sendMessage:Yvt,getOneMessage:Kvt,getEachMessage:Zvt,getCancelSignal:Jvt}=tre();var one=!1,ane=()=>{one=!0},fs=()=>one;var I_=null,cne=t=>(I_&&I_.destroy(),I_=new mo({totalAllowedTime:t}),I_),lne=()=>I_;var mo=class{constructor({totalAllowedTime:e}){this.withStageTimer=async(e,r,n,{interruptible:i=!0}={})=>{if(this.isTimeExpired())throw new Error(`${e} stage did not complete in the allowed time. Time has already expired.`);if(i&&fs())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let s=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),o=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{o=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await nA({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{de.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),s(),o&&clearTimeout(o)}};this.startTime=Date.now(),this.totalAllowedTime=e,this.globalTimeoutId=null,this.subscribers=[],this.hasTimedOut=!1,this.setupGlobalTimeout()}getElapsedTime(){return Date.now()-this.startTime}getRemainingTime(){let e=this.getElapsedTime(),r=this.totalAllowedTime-e;return Math.max(0,r)}isTimeExpired(){return this.getRemainingTime()===0||this.hasTimedOut}setupGlobalTimeout(){this.globalTimeoutId&&clearTimeout(this.globalTimeoutId),this.globalTimeoutId=setTimeout(()=>{this.notifyTimeUp()},this.totalAllowedTime)}notifyTimeUp(){this.hasTimedOut=!0;for(let e=this.subscribers.length-1;e>=0;e--)try{this.subscribers[e]()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}}onTimesUp(e){if(this.subscribers.push(e),this.hasTimedOut)try{e()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}return()=>{let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}}off(e){let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}clearSubscribers(){this.subscribers.length=0}getSubscriberCount(){return this.subscribers.length}destroy(){this.globalTimeoutId&&(clearTimeout(this.globalTimeoutId),this.globalTimeoutId=null),this.clearSubscribers()}static{this.timeUnits={seconds:e=>e*1e3,minutes:e=>e*60*1e3,hours:e=>e*60*60*1e3}}};var une={name:"@netlify/agent-runner-cli",type:"module",version:"1.151.0",description:"CLI tool for running Netlify agents",main:"./dist/index.js",types:"./dist/index.d.ts",exports:"./dist/index.js",bin:{"agent-runner-cli":"./dist/bin.js","agent-runner-cli-local":"./dist/bin-local.js"},files:["dist/**/*.js","dist/**/*.d.ts","dist/skills/**","patches","scripts"],scripts:{build:"tsup",dev:"tsup --watch",prepare:"husky install node_modules/@netlify/eslint-config-node/.husky/",prepublishOnly:"npm ci && npm test",prepack:"npm run build",test:"run-s build format test:dev",format:"run-s build format:check-fix:*","format:ci":"run-s build format:check:*","format:check-fix:lint":"run-e format:check:lint format:fix:lint","format:check:lint":'eslint --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:fix:lint":'eslint --fix --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:check-fix:prettier":"run-e format:check:prettier format:fix:prettier","format:check:prettier":'prettier --check --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"format:fix:prettier":'prettier --write --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"LOG=0 vitest --exclude '**/integration/**'","test:ci:vitest":"LOG=0 vitest run --coverage --exclude '**/integration/**'","test:smoke":"node scripts/smoke-dist.js","test:integration":"vitest run test/integration/","test:integration:codex":"vitest run test/integration/codex.test.ts","test:integration:claude":"vitest run test/integration/claude.test.ts","test:integration:gemini":"vitest run test/integration/gemini.test.ts","test:integration:skill-invocation":"vitest run test/integration/skill-invocation.test.ts","check:types":"tsc --noEmit",postinstall:"node scripts/postinstall.js"},keywords:[],license:"MIT",repository:"netlify/agent-runner-cli",bugs:{url:"https://github.com/netlify/agent-runner-cli/issues"},author:"Netlify Inc.",directories:{test:"test"},devDependencies:{"@commitlint/cli":"^20.0.0","@commitlint/config-conventional":"^20.0.0","@eslint/compat":"^2.0.0","@eslint/js":"^10.0.1","@netlify/axis":"^1.17.2","@netlify/eslint-config-node":"^7.0.1","@types/node":"^24.5.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@vitest/coverage-v8":"^4.1.5","@vitest/eslint-plugin":"^1.6.6",eslint:"^10.5.0","eslint-config-prettier":"^10.1.8","eslint-plugin-n":"^17.0.0",husky:"^9.0.0",jiti:"^2.7.0","patch-package":"^8.0.0",tsup:"^8.5.0",typescript:"^5.0.0","typescript-eslint":"^8.44.0",vitest:"^4.0.16"},dependencies:{"@anthropic-ai/claude-code":"^2.1.219","@anthropic-ai/sdk":"0.91.1","@google/gemini-cli":"0.42.0","@modelcontextprotocol/sdk":"^1.29.0","@netlify/cache-utils":"^6.0.5","@netlify/database-proxy":"^0.1.5","@netlify/otel":"^6.0.4","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.128.0","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.8.5",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var Y1e=H1e(import.meta.url),K1e=go.dirname(Y1e),Z1e=W1e(import.meta.url),mf=me("shell"),i$=new Set,dne={preferLocal:!0},Mr=(t,e,r)=>{let[n,i]=J1e(e,r),s={...dne,...i},o=ine(t,n,s);pne(o,s),gne(o);let a=r?.idleTimeout;return a&&a>0&&mne(o,a),o},fne=(t,e)=>{let r={...dne,...e},n=sne(t,r);return pne(n,r),gne(n),e?.idleTimeout&&e.idleTimeout>0&&mne(n,e.idleTimeout),n},J1e=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},pne=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0)return;if(_o.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new r_).pipe(_o.stdout),t.stderr?.pipe(new r_).pipe(_o.stderr);return}t.stdout?.pipe(_o.stdout),t.stderr?.pipe(_o.stderr)},s$=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(_o.kill(-t.pid,e),mf.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return mf.error("Error killing process:",r),!1}},hne=t=>s$(t,"SIGKILL"),mne=(t,e)=>{let r=null,n=()=>{mf.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),s$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(mf.log(`Force killing idle process ${t.pid}`),hne(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let s=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",s),t.on("error",s)},gne=t=>{i$.add(t);let e=lne();if(e){let r=e.onTimesUp(()=>{mf.log(`Global timer expired, killing process ${t.pid}`),s$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(mf.log(`Force killing process ${t.pid} after timeout`),hne(t))},5e3)});t.on("exit",()=>{i$.delete(t),r()}),t.on("error",()=>{i$.delete(t),r()})}};function ps(t,e){if(!_o.env.NETLIFY_LOCAL_MODE)try{let i=Z1e.resolve(une.name),s=go.dirname(i);for(;s!==go.dirname(s);){let o=go.dirname(s);if(go.basename(o)==="node_modules"){let a=go.join(o,".bin",e);if(_x.existsSync(a))return a;break}s=o}}catch(i){console.error("Could not resolve package.json",i)}if(_o.env.NODE_PATH){let i=go.join(_o.env.NODE_PATH,".bin",e);if(_x.existsSync(i))return i}let r=go.join(t,"node_modules",".bin",e);if(_x.existsSync(r))return r;let n=go.join(K1e,"..","node_modules",".bin",e);if(_x.existsSync(n))return n}var X1e=me("utils"),Q1e=t=>new Promise(e=>{setTimeout(e,t)});var o$=t=>{try{return new URL(t).hostname||null}catch{return null}},yx=(t,e=3e3)=>{let r=!1,n=null,i=[],s=null,o=(...a)=>{if(r)return n=a,new Promise(u=>{i.push(u)});r=!0;let c,l=new Promise(u=>{c=u});return s=(async()=>{await Promise.resolve();let u=await t(...a);for(c(u);;){if(await Q1e(e),!n)return r=!1,s=null,u;let d=n,f=i;n=null,i=[],u=await t(...d),f.forEach(p=>{p(u)})}})(),l};return o.flush=async()=>{if((r||n)&&s)return await s,o.flush()},o.cancel=()=>{n=null,i.forEach(a=>a(void 0)),i=[]},o},Oa=(t,e,r=!1)=>{let n=null,i=null,s=null,o=function(...a){i=a,s=this;let c=r&&!n;clearTimeout(n),n=setTimeout(()=>{n=null,r||(t.apply(s,i),i=null,s=null)},e),c&&(t.apply(s,i),i=null,s=null)};return o.cancel=()=>{clearTimeout(n),n=null,i=null,s=null},o.flush=()=>{if(n){clearTimeout(n);let a=i,c=s;n=null,i=null,s=null,t.apply(c,a)}},o},_ne=(t,e=!0,r)=>{if(t)try{return JSON.parse(t)}catch(n){e&&(r?.error?r.error("Could not parse JSON",n):X1e.error("Could not parse JSON",n))}},eUe=t=>t.charAt(0).toUpperCase()+t.slice(1),hs=t=>t.split("-").map(e=>e.length===2?e.toUpperCase():eUe(e)).join(" ");function yo(t,e){e&&t.log(`Skill invoked: ${e}`)}var Sx=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),yne=(t,e,r=!1)=>{if(r)return;let n=60,i=55,s=".netlify.app",o="agent-",a=6;if(!e)return`${o}${t.slice(0,a)}`;let c=`--${e}${s}`;if(c.length>i)return"";let l=n-c.length;if(l<=0)return"";if(l>=o.length+a){let u=Math.min(l-o.length,t.length);return`${o}${t.slice(0,u)}`}return t.slice(0,l)};var a$=t=>{let e=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(!e)return{command:t};let r=t.indexOf(e[0]),n=t.slice(r+e[0].length).trim();return{command:t.slice(0,r).trim(),heredocContent:n||void 0}},tUe=1e4,c$=(t,e=tUe)=>{if(!t||typeof t!="string"||t.length<=e)return t;let n=t.startsWith("```")?"\n... [truncated]\n```":"... [truncated]";return t.slice(0,e)+n};import{createHash as rUe}from"crypto";import{createReadStream as nUe}from"fs";import Ex from"fs/promises";import Tne from"os";import vx from"path";var Sne=me("repo"),Ane="runner-diffs-",xne=t=>`${Ane}${t}-`,wne=async t=>{let e=Tne.tmpdir(),r;try{r=await Ex.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(Ane)&&!n.startsWith(xne(t))).map(n=>Ex.rm(vx.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Zr=(t,e={})=>Mr("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),bx=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{Sne.info("Getting runner diffs");let n=await sUe(r),{hasChanges:i}=n,{status:s}=n;if(!i)return{hasChanges:!1};if(!e){let h=aUe(s);await cUe(h,r)}Sne.info("Changes after processing"),await u$(r);let o=await f$(s,r);if(await l$(o,r),i=await oUe(r),!i)return{hasChanges:!1,ignored:o};await Zr(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await Ex.mkdtemp(vx.join(Tne.tmpdir(),xne(t.sessionId))),c=async({from:h,to:m,fileName:E,binary:T})=>{let v=vx.join(a,E);await Zr([...T?["diff",h,m,"--binary"]:["diff",h,m],`--output=${v}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:S}=await Ex.stat(v);return{path:v,size:S}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await bne(r),{hasChanges:!1,ignored:o};let u=await c({from:t.runSha,to:"HEAD",fileName:"session-binary.patch",binary:!0}),d,f;if(t.sha){d=await c({from:t.sha,to:"HEAD",fileName:"cumulative.patch"});let h=await c({from:t.sha,to:"HEAD",fileName:"cumulative-binary.patch",binary:!0});await vne(d,h)||(f=h)}await bne(r),de.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:o};return await vne(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Ene=async t=>{let e=rUe("sha256");for await(let r of nUe(t))e.update(r);return e.digest("hex")},vne=async(t,e)=>t.size===e.size&&await Ene(t.path)===await Ene(e.path),bne=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Zr(["reset","--soft","HEAD~1"],{cwd:t})},l$=async(t=[],e=process.cwd())=>{await Zr(["add",".",...t],{cwd:e})},u$=async(t=process.cwd())=>{let e=await Zr(["status","-s"],{cwd:t});return String(e.stdout??"")},Rne=/.. (.+)?\.log$/,iUe=[Rne],sUe=async(t=process.cwd())=>{let e=await u$(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
|
|
101
|
+
if (condition) { yield value; }`)};import{Buffer as lLe}from"buffer";import{StringDecoder as uLe}from"string_decoder";var rx=(t,e,r)=>{if(r)return;if(t)return{transform:dLe.bind(void 0,new TextEncoder)};let n=new uLe(e);return{transform:fLe.bind(void 0,n),final:pLe.bind(void 0,n)}},dLe=function*(t,e){lLe.isBuffer(e)?yield uo(e):typeof e=="string"?yield t.encode(e):yield e},fLe=function*(t,e){yield jt(e)?t.write(e):e},pLe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as Nte}from"util";var vL=Nte(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),nx=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=mLe}=e[r];for await(let i of n(t))yield*nx(i,e,r+1)},kte=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*hLe(r,Number(e),t)},hLe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*nx(n,r,e+1)},Mte=Nte(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),mLe=function*(t){yield t};var bL=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},Dte=(t,e)=>[...e.flatMap(r=>[...Al(r,t,0)]),...b_(t)],Al=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=_Le}=e[r];for(let i of n(t))yield*Al(i,e,r+1)},b_=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*gLe(r,Number(e),t)},gLe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Al(n,r,e+1)},_Le=function*(t){yield t};var TL=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:s},{encoding:o})=>{let a={},c=$te(t,o,s),l=Tl(e),u=Tl(r),d=l?vL.bind(void 0,nx,a):bL.bind(void 0,Al),f=l||u?vL.bind(void 0,kte,a):bL.bind(void 0,b_),p=l||u?Mte.bind(void 0,a):void 0;return{stream:new yLe({writableObjectMode:n,writableHighWaterMark:Lte(n),readableObjectMode:i,readableHighWaterMark:Lte(i),transform(m,E,T){d([m,c,0],this,T)},flush(m){f([c],this,m)},destroy:p})}},ix=(t,e,r,n)=>{let i=e.filter(({type:o})=>o==="generator"),s=n?i.reverse():i;for(let{value:o,optionName:a}of s){let c=$te(o,r,a);t=Dte(c,t)}return t},$te=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:s},o,a)=>{let c={};return[{transform:Cte(n,a)},rx(r,o,n),tx(r,s,n,c),{transform:t,final:e},{transform:Pte(i,a)},Ite({binary:r,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)};var Ute=(t,e)=>{for(let r of SLe(t))ELe(t,r,e)},SLe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ELe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Ca[a]} with synchronous methods.`)}let o=i.map(({contents:a})=>a).map(a=>vLe(a,n));r.input=f_(o)},vLe=(t,e)=>{let r=ix(t,e,"utf8",!0);return bLe(r),f_(r)},bLe=t=>{let e=t.find(r=>typeof r!="string"&&!jt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as wLe,appendFileSync as RLe}from"fs";var sx=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&ef(r,n)&&!mn.has(e)&&TLe(n)&&(t.some(({type:i,value:s})=>i==="native"&&ALe.has(s))||t.every(({type:i})=>qn.has(i))),TLe=t=>t===1||t===2,ALe=new Set(["pipe","overlapped"]),Fte=async(t,e,r,n)=>{for await(let i of t)xLe(e)||jte(i,r,n)},Bte=(t,e,r)=>{for(let n of t)jte(n,e,r)},xLe=t=>t._readableState.pipes.length>0,jte=(t,e,r)=>{let n=SA(t);as({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var zte=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let s={},o=new Set([]);return{output:e.map((c,l)=>ILe({result:c,fileDescriptors:t,fdNumber:l,state:s,outputFiles:o,isMaxBuffer:n,verboseInfo:i},r)),...s}},ILe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=Gee(t,s,d),p=uo(f),{stdioItems:h,objectMode:m}=e[r],E=CLe([p],h,c,n),{serializedResult:T,finalResult:v=T}=PLe({chunks:E,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});OLe({serializedResult:T,fdNumber:r,state:n,verboseInfo:o,encoding:c,stdioItems:h,objectMode:m});let A=a[r]?v:void 0;try{return n.error===void 0&&NLe(T,h,i),A}catch(S){return n.error=S,A}},CLe=(t,e,r,n)=>{try{return ix(t,e,r,!1)}catch(i){return n.error=i,t}},PLe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:f_(t)};let o=nQ(t,r);return n[s]?{serializedResult:o,finalResult:EL(o,!i[s],e)}:{serializedResult:o}},OLe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:s,objectMode:o})=>{if(!sx({stdioItems:s,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=EL(t,!1,o);try{Bte(a,e,n)}catch(c){r.error??=c}},NLe=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:s})=>QA.has(s))){let s=typeof n=="string"?n:n.toString();i||r.has(s)?RLe(n,t):(r.add(s),wLe(n,t))}};var Gte=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ho(e,r,"all")]:Array.isArray(e)?[ho(t,r,"all"),...e]:jt(t)&&jt(e)?CD([t,e]):`${t}${e}`};import{once as AL}from"events";var Vte=async(t,e)=>{let[r,n]=await kLe(t);return e.isForcefullyTerminated??=!1,[r,n]},kLe=async t=>{let[e,r]=await Promise.allSettled([AL(t,"spawn"),AL(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?qte(t):r.value},qte=async t=>{try{return await AL(t,"exit")}catch{return qte(t)}},Hte=async t=>{let[e,r]=await t;if(!MLe(e,r)&&xL(e,r))throw new Ai;return[e,r]},MLe=(t,e)=>t===void 0&&e===void 0,xL=(t,e)=>t!==0||e!==null;var Wte=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let s=DLe(t,e,r),o=s?.code==="ETIMEDOUT",a=zee(s,n,i);return{resultError:s,exitCode:e,signal:r,timedOut:o,isMaxBuffer:a}},DLe=(t,e,r)=>t!==void 0?t:xL(e,r)?new Ai:void 0;var Yte=(t,e,r)=>{let{file:n,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=$Le(t,e,r),d=BLe({file:n,commandArguments:i,options:l,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:a});return df(d,c,l)},$Le=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=vA(t,e,r),a=ULe(r),{file:c,commandArguments:l,options:u}=jA(t,e,a);FLe(u);let d=Ate(u,o);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:u,fileDescriptors:d}},ULe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,FLe=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&ox("ipcInput"),t&&ox("ipc: true"),r&&ox("detached: true"),n&&ox("cancelSignal")},ox=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},BLe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{let c=jLe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Wte(c,r),{output:h,error:m=l}=zte({fileDescriptors:o,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:s}),E=h.map((v,A)=>ho(v,r,A)),T=ho(Gte(h,r),r,"all");return GLe({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:E,all:T,options:r,command:n,escapedCommand:i,startTime:a})},jLe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{Ute(s,r);let a=zLe(r);return LLe(...zA(t,e,a))}catch(a){return uf({error:a,command:n,escapedCommand:i,fileDescriptors:s,options:r,startTime:o,isSync:!0})}},zLe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:KA(e)}),GLe=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:s,all:o,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?ZA({command:c,escapedCommand:l,stdio:s,all:o,ipcOutput:[],options:a,startTime:u}):v_({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:o,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as P1e}from"events";import{spawn as O1e}from"child_process";import Qte from"process";import{once as wL,on as VLe}from"events";var Kte=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:s}={})=>(nf({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:DA(t)}),qLe({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:i})),qLe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{OA(e,i);let s=Ia(t,e,r),o=new AbortController;try{return await Promise.race([HLe(s,n,o),WLe(s,r,o),YLe(s,r,o)])}catch(a){throw sf(t),a}finally{o.abort(),NA(e,i)}},HLe=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await wL(t,"message",{signal:r});return n}for await(let[n]of VLe(t,"message",{signal:r}))if(e(n))return n},WLe=async(t,e,{signal:r})=>{await wL(t,"disconnect",{signal:r}),D7(e)},YLe=async(t,e,{signal:r})=>{let[n]=await wL(t,"strict:error",{signal:r});throw IA(n,e)};import{once as Jte,on as KLe}from"events";var Xte=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>RL({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),RL=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:s})=>{nf({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:DA(t)}),OA(e,s);let o=Ia(t,e,r),a=new AbortController,c={};return ZLe(t,o,a),JLe({ipcEmitter:o,isSubprocess:r,controller:a,state:c}),XLe({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:s})},ZLe=async(t,e,r)=>{try{await Jte(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},JLe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await Jte(t,"strict:error",{signal:r.signal});n.error=IA(i,e),r.abort()}catch{}},XLe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(let[c]of KLe(r,"message",{signal:s.signal}))Zte(o),yield c}catch{Zte(o)}finally{s.abort(),NA(e,a),n||sf(t),i&&await t}},Zte=({error:t})=>{if(t)throw t};var ere=(t,{ipc:e})=>{Object.assign(t,rre(t,!1,e))},tre=()=>{let t=Qte,e=!0,r=Qte.channel!==void 0;return{...rre(t,e,r),getCancelSignal:cee.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},rre=(t,e,r)=>({sendMessage:FA.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Kte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Xte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as QLe}from"child_process";import{PassThrough as e$e,Readable as t$e,Writable as r$e,Duplex as n$e}from"stream";var nre=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,verboseInfo:o})=>{_L(n);let a=new QLe;i$e(a,n),Object.assign(a,{readable:s$e,writable:o$e,duplex:a$e});let c=uf({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,isSync:!1}),l=c$e(c,o,i);return{subprocess:a,promise:l}},i$e=(t,e)=>{let r=T_(),n=T_(),i=T_(),s=Array.from({length:e.length-3},T_),o=T_(),a=[r,n,i,...s];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:o,stdio:a})},T_=()=>{let t=new e$e;return t.end(),t},s$e=()=>new t$e({read(){}}),o$e=()=>new r$e({write(){}}),a$e=()=>new n$e({read(){},write(){}}),c$e=async(t,e,r)=>df(t,e,r);import{createReadStream as ire,createWriteStream as sre}from"fs";import{Buffer as l$e}from"buffer";import{Readable as A_,Writable as u$e,Duplex as d$e}from"stream";var are=(t,e)=>ex(f$e,t,e,!1),x_=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Ca[t]}.`)},ore={fileNumber:x_,generator:TL,asyncGenerator:TL,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:d$e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},f$e={input:{...ore,fileUrl:({value:t})=>({stream:ire(t)}),filePath:({value:{file:t}})=>({stream:ire(t)}),webStream:({value:t})=>({stream:A_.fromWeb(t)}),iterable:({value:t})=>({stream:A_.from(t)}),asyncIterable:({value:t})=>({stream:A_.from(t)}),string:({value:t})=>({stream:A_.from(t)}),uint8Array:({value:t})=>({stream:A_.from(l$e.from(t))})},output:{...ore,fileUrl:({value:t})=>({stream:sre(t)}),filePath:({value:{file:t,append:e}})=>({stream:sre(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:u$e.fromWeb(t)}),iterable:x_,asyncIterable:x_,string:x_,uint8Array:x_}};import{on as p$e,once as cre}from"events";import{PassThrough as h$e,getDefaultHighWaterMark as m$e}from"stream";import{finished as dre}from"stream/promises";function xl(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)CL(i);let e=t.some(({readableObjectMode:i})=>i),r=g$e(t,e),n=new IL({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var g$e=(t,e)=>{if(t.length===0)return m$e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},IL=class extends h$e{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(CL(e),this.#e.has(e))return;this.#e.add(e),this.#n??=_$e(this,this.#e,this.#s);let r=E$e({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#s});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(CL(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},_$e=async(t,e,r)=>{ax(t,lre);let n=new AbortController;try{await Promise.race([y$e(t,n),S$e(t,e,r,n)])}finally{n.abort(),ax(t,-lre)}},y$e=async(t,{signal:e})=>{try{await dre(t,{signal:e,cleanup:!0})}catch(r){throw fre(t,r),r}},S$e=async(t,e,r,{signal:n})=>{for await(let[i]of p$e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},CL=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},E$e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:s,unpipeEvent:o})=>{ax(t,ure);let a=new AbortController;try{await Promise.race([v$e(s,e,a),b$e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),T$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),ax(t,-ure)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?PL(t):A$e(t))},v$e=async(t,e,{signal:r})=>{try{await t,r.aborted||PL(e)}catch(n){r.aborted||fre(e,n)}},b$e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:s}})=>{try{await dre(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(o){if(s.aborted||!r.has(e))return;pre(o)?i.add(e):hre(t,o)}},T$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:s}})=>{if(await cre(t,i,{signal:s}),!t.readable)return cre(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},A$e=t=>{t.writable&&t.end()},fre=(t,e)=>{pre(e)?PL(t):hre(t,e)},pre=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PL=t=>{(t.readable||t.writable)&&t.destroy()},hre=(t,e)=>{t.destroyed||(t.once("error",x$e),t.destroy(e))},x$e=()=>{},ax=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},lre=2,ure=1;import{finished as mre}from"stream/promises";var pf=(t,e)=>{t.pipe(e),w$e(t,e),R$e(t,e)},w$e=async(t,e)=>{if(!(Ti(t)||Ti(e))){try{await mre(t,{cleanup:!0,readable:!0,writable:!1})}catch{}OL(e)}},OL=t=>{t.writable&&t.end()},R$e=async(t,e)=>{if(!(Ti(t)||Ti(e))){try{await mre(e,{cleanup:!0,readable:!1,writable:!0})}catch{}NL(t)}},NL=t=>{t.readable&&t.destroy()};var gre=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:c})=>qn.has(c)))I$e(t,a,o,i);for(let{stream:a}of s.filter(({type:c})=>!qn.has(c)))P$e({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,s]of n.entries()){let o=s.length===1?s[0]:xl(s);pf(o,i)}},I$e=(t,e,r,n)=>{r==="output"?pf(t.stdio[n],e):pf(e,t.stdio[n]);let i=C$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},C$e=["stdin","stdout","stderr"],P$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:s})=>{if(e===void 0)return;O$e(e,s);let[o,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(o)??[];i.set(o,[...c,a])},O$e=(t,{signal:e})=>{Ti(t)&&vl(t,N$e,e)},N$e=2;import{addAbortListener as D$e}from"events";var wl=[];wl.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&wl.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&wl.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var cx=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",kL=Symbol.for("signal-exit emitter"),ML=globalThis,k$e=Object.defineProperty.bind(Object),DL=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(ML[kL])return ML[kL];k$e(ML,kL,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},lx=class{},M$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),LL=class extends lx{onExit(){return()=>{}}load(){}unload(){}},$L=class extends lx{#e=UL.platform==="win32"?"SIGINT":"SIGHUP";#r=new DL;#t;#n;#s;#i={};#o=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of wl)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),n.length===i){this.unload();let o=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;o||e.kill(e.pid,a)}};this.#s=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!cx(this.#t))return()=>{};this.#o===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#r.count+=1;for(let e of wl)try{let r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#c(e,...r),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#o&&(this.#o=!1,wl.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#s,this.#r.count-=1)}#a(e){return cx(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#s.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&cx(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let i=n.call(this.#t,e,...r);return this.#r.emit("exit",this.#t.exitCode,null),i}else return n.call(this.#t,e,...r)}},UL=globalThis.process,{onExit:_re,load:eSt,unload:tSt}=M$e(cx(UL)?new $L(UL):new LL);var yre=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=_re(()=>{t.kill()});D$e(n,()=>{i()})};var Ere=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let s=EA(),{destination:o,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=L$e(r,n,i),{sourceStream:d,sourceError:f}=U$e(t,l),{options:p,fileDescriptors:h}=ls.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:s}},L$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=$$e(t,e,...r),a=PA(n,s);return{destination:n,destinationStream:a,from:i,unpipeSignal:o}}catch(n){return{destinationError:n}}},$$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Sre,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||RD(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,s,o]=uA(r,...n);return{destination:e(Sre)(i,s,o),pipeOptions:o}}if(ls.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Sre=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),U$e=(t,e)=>{try{return{sourceStream:of(t,e)}}catch(r){return{sourceError:r}}};var bre=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:s,startTime:o})=>{let a=F$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw FL({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},F$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return NL(t),n;if(e!==void 0)return OL(r),e},FL=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>uf({error:t,command:vre,escapedCommand:vre,fileDescriptors:e,options:r,startTime:n,isSync:!1}),vre="source.pipe(destination)";var Tre=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(n)||o.pipedFrom.push(n),i==="rejected")throw o;if(e==="rejected")throw n;return o};import{finished as B$e}from"stream/promises";var Are=(t,e,r)=>{let n=ux.has(e)?z$e(t,e):j$e(t,e);return vl(t,V$e,r.signal),vl(e,q$e,r.signal),G$e(e),n},j$e=(t,e)=>{let r=xl([t]);return pf(r,e),ux.set(e,r),r},z$e=(t,e)=>{let r=ux.get(e);return r.add(t),r},G$e=async t=>{try{await B$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ux.delete(t)},ux=new WeakMap,V$e=2,q$e=1;import{aborted as H$e}from"util";var xre=(t,e)=>t===void 0?[]:[W$e(t,e)],W$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:s})=>{await H$e(t,e),await r.remove(e);let o=new Error("Pipe canceled by `unpipeSignal` option.");throw FL({error:o,fileDescriptors:n,sourceOptions:i,startTime:s})};var dx=(t,...e)=>{if(Ot(e[0]))return dx.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Ere(t,...e),i=Y$e({...n,destination:r});return i.pipe=dx.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},Y$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=K$e(t,i);bre({sourceStream:e,sourceError:n,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=Are(e,s,d);return await Promise.race([Tre(u),...xre(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},K$e=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as r1e}from"timers/promises";import{on as Z$e}from"events";import{getDefaultHighWaterMark as J$e}from"stream";var fx=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:s})=>{let o=new AbortController;return X$e(e,o),Rre({stream:t,controller:o,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},X$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},BL=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:s})=>{let o=new AbortController;Q$e(e,o,t);let a=t.readableObjectMode&&!s;return Rre({stream:t,controller:o,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},Q$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Rre=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})=>{let a=Z$e(t,"data",{signal:e.signal,highWaterMark:wre,highWatermark:wre});return e1e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})},jL=J$e(!0),wre=jL,e1e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o}){let a=t1e({binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(let[c]of t)yield*Al(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*b_(a)}},t1e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[rx(t,r,!e),tx(t,i,!n,{})].filter(Boolean);var Ire=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=n1e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([i1e(t),d]);return}let f=yL(c,r),p=BL({stream:t,onStreamEnd:e,lines:o,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([s1e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:s,lines:o}),d]);return h},n1e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!sx({stdioItems:o[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=BL({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await Fte(a,t,r,s)},i1e=async t=>{await r1e(),t.readableFlowing===null&&t.resume()},s1e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await HA(r,{maxBuffer:s}):i==="buffer"?new Uint8Array(await WA(r,{maxBuffer:s})):await lf(r,{maxBuffer:s})}catch(a){return Cre(Fee({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:n}))}},zL=async t=>{try{return await t}catch(e){return Cre(e)}},Cre=({bufferedData:t})=>tQ(t)?new Uint8Array(t):t;import{finished as o1e}from"stream/promises";var w_=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let s=a1e(t,r),o=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],o1e(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||u1e(a,e,r,n)}finally{o.abort()}},a1e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&c1e(t,r,n),n},c1e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{l1e(e,r),n.call(t,...i)}},l1e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},u1e=(t,e,r,n)=>{if(!d1e(t,e,r,n))throw t},d1e=(t,e,r,n=!0)=>r.propagating?Pre(t)||px(t):(r.propagating=!0,GL(r,e)===n?Pre(t):px(t)),GL=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",px=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Pre=t=>t?.code==="EPIPE";var Ore=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,l)=>VL({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),VL=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=w_(t,e,l);if(GL(l,e)){await u;return}let[d]=await Promise.all([Ire({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var Nre=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?xl([t,e].filter(Boolean)):void 0,kre=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>VL({...f1e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:p1e(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),f1e=({stdout:t,stderr:e,all:r},[,n,i])=>{let s=n||i;return s?n?i?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},p1e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as h1e}from"events";var Mre=t=>ef(t,"ipc"),Dre=(t,e)=>{let r=SA(t);as({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Lre=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:s})=>{if(!n)return i;let o=Mre(s),a=fo(e,"ipc"),c=fo(r,"ipc");for await(let l of RL({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Bee(t,i,c),i.push(l)),o&&Dre(l,s);return i},$re=async(t,e)=>(await Promise.allSettled([t]),e);var Ure=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:E,controller:T})=>{let v=Vte(t,f),A={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:v,propagating:!1},S=Ore({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:A}),R=kre({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:A}),P=[],L=Lre({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:P,verboseInfo:p}),I=m1e(m,t,A),O=g1e(h,A);try{return await Promise.race([Promise.all([{},Hte(v),Promise.all(S),R,L,yee(t,d),...I,...O]),E,_1e(t,T),...pee(t,s,f,T),...M7({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:T}),...dee({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:T})])}catch(j){return f.terminationReason??="other",Promise.all([{error:j},v,Promise.all(S.map(_=>zL(_))),zL(R),$re(L,P),Promise.allSettled(I),Promise.allSettled(O)])}},m1e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:w_(n,i,r)),g1e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:s=i})=>wi(s,{checkOpen:!1})&&!Ti(s)).map(({type:i,value:s,stream:o=s})=>w_(o,n,e,{isSameDirection:qn.has(i),stopOnExit:i==="native"}))),_1e=async(t,{signal:e})=>{let[r]=await h1e(t,"error",{signal:e});throw r};var Fre=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),R_=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),s=cs();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},hf=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as y1e}from"stream";import{callbackify as S1e}from"util";import{finished as Bre}from"stream/promises";var qL=async t=>{if(t!==void 0)try{await HL(t)}catch{}},jre=async t=>{if(t!==void 0)try{await WL(t)}catch{}},HL=async t=>{await Bre(t,{cleanup:!0,readable:!1,writable:!0})},WL=async t=>{await Bre(t,{cleanup:!0,readable:!0,writable:!1})},hx=async(t,e)=>{if(await t,e)throw e},mx=(t,e,r)=>{r&&!px(r)?t.destroy(r):e&&t.destroy()};var zre=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:s=!0}={})=>{let o=i||mn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=YL(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=KL(a,o),{read:f,onStdoutDataDone:p}=ZL({subprocessStdout:a,subprocess:t,binary:o,encoding:r,preserveNewlines:s}),h=new y1e({read:f,destroy:S1e(XL.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return JL({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},YL=(t,e,r)=>{let n=of(t,e),i=R_(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},KL=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:jL},ZL=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let s=cs(),o=fx({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){E1e(this,o,s)},onStdoutDataDone:s}},E1e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},JL=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await WL(t),await n,await qL(i),await e,r.readable&&r.push(null)}catch(s){await qL(i),Gre(r,s)}},XL=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await hf(r,e)&&(Gre(t,n),await hx(e,n))},Gre=(t,e)=>{mx(t,t.readable,e)};import{Writable as v1e}from"stream";import{callbackify as Vre}from"util";var qre=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}=QL(t,r,e),o=new v1e({...e$(n,t,i),destroy:Vre(r$.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return t$(n,o),o},QL=(t,e,r)=>{let n=PA(t,e),i=R_(r,n,"writableFinal"),s=R_(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}},e$=(t,e,r)=>({write:b1e.bind(void 0,t),final:Vre(T1e.bind(void 0,t,e,r))}),b1e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},T1e=async(t,e,r)=>{await hf(r,e)&&(t.writable&&t.end(),await e)},t$=async(t,e,r)=>{try{await HL(t),e.writable&&e.end()}catch(n){await jre(r),Hre(e,n)}},r$=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await hf(r,e),await hf(n,e)&&(Hre(t,i),await hx(e,i))},Hre=(t,e)=>{mx(t,t.writable,e)};import{Duplex as A1e}from"stream";import{callbackify as x1e}from"util";var Wre=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{let a=s||mn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=YL(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=QL(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=KL(c,a),{read:E,onStdoutDataDone:T}=ZL({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:o}),v=new A1e({read:E,...e$(u,t,d),destroy:x1e(w1e.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return JL({subprocessStdout:c,onStdoutDataDone:T,readable:v,subprocess:t,subprocessStdin:u}),t$(u,v,c),v},w1e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([XL({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},o),r$({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:s},o)])};var n$=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let s=n||mn.has(e),o=of(t,r),a=fx({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return R1e(a,o,t)},R1e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Yre=(t,{encoding:e})=>{let r=Fre();t.readable=zre.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=qre.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Wre.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=n$.bind(void 0,t,e),t[Symbol.asyncIterator]=n$.bind(void 0,t,e,{})};var Kre=(t,e)=>{for(let[r,n]of C1e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},I1e=(async()=>{})().constructor.prototype,C1e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(I1e,t)]);var Zre=(t,e,r,n)=>{let{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=N1e(t,e,r),{subprocess:f,promise:p}=M1e({file:i,commandArguments:s,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=dx.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),Kre(f,p),ls.set(f,{options:u,fileDescriptors:d}),f},N1e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=vA(t,e,r),{file:a,commandArguments:c,options:l}=jA(t,e,r),u=k1e(l),d=are(u,o);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:u,fileDescriptors:d}},k1e=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},M1e=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=O1e(...zA(t,e,r))}catch(h){return nre({error:h,command:s,escapedCommand:o,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;P1e(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];gre(c,a,l),yre(c,r,l);let d={},f=cs();c.kill=N7.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=Nre(c,r),Yre(c,r),ere(c,r);let p=D1e({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:s,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},D1e=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,E]=await Ure({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:s,onInternalError:l,controller:u});u.abort(),l.resolve();let T=h.map((S,R)=>ho(S,e,R)),v=ho(m,e,"all"),A=L1e({errorInfo:d,exitCode:f,signal:p,stdio:T,all:v,ipcOutput:E,context:c,options:e,command:o,escapedCommand:a,startTime:r});return df(A,n,e)},L1e=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,context:o,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?v_({error:t.error,command:c,escapedCommand:l,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof us,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,options:a,startTime:u,isSync:!1}):ZA({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:s,options:a,startTime:u});var gx=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,$1e(n,t[n],i)]));return{...t,...r}},$1e=(t,e,r)=>U1e.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,U1e=new Set(["env",...kD]);var Pa=(t,e,r,n)=>{let i=(o,a,c)=>Pa(o,a,r,c),s=(...o)=>F1e({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...o);return n!==void 0&&n(s,i,e),s},F1e=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},s,...o)=>{if(Ot(s))return i(t,gx(r,s),n);let{file:a,commandArguments:c,options:l,isSync:u}=B1e({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:r});return u?Yte(a,c,l):Zre(a,c,l,i)},B1e=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let s=aQ(e)?cQ(e,r):[e,...r],[o,a,c]=uA(...s),l=gx(gx(n,i),c),{file:u=o,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:o,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var Jre=({file:t,commandArguments:e})=>Qre(t,e),Xre=({file:t,commandArguments:e})=>({...Qre(t,e),isSync:!0}),Qre=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=j1e(t);return{file:r,commandArguments:n}},j1e=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(z1e)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},z1e=/ +/g;var ene=(t,e,r)=>{t.sync=e(G1e,r),t.s=t.sync},tne=({options:t})=>rne(t),G1e=({options:t})=>({...rne(t),isSync:!0}),rne=t=>({options:{...V1e(t),...t}}),V1e=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},nne={preferLocal:!0};var ine=Pa(()=>({})),Vvt=Pa(()=>({isSync:!0})),sne=Pa(Jre),qvt=Pa(Xre),Hvt=Pa(mee),Wvt=Pa(tne,{},nne,ene),{sendMessage:Yvt,getOneMessage:Kvt,getEachMessage:Zvt,getCancelSignal:Jvt}=tre();var one=!1,ane=()=>{one=!0},fs=()=>one;var I_=null,cne=t=>(I_&&I_.destroy(),I_=new mo({totalAllowedTime:t}),I_),lne=()=>I_;var mo=class{constructor({totalAllowedTime:e}){this.withStageTimer=async(e,r,n,{interruptible:i=!0}={})=>{if(this.isTimeExpired())throw new Error(`${e} stage did not complete in the allowed time. Time has already expired.`);if(i&&fs())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let s=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),o=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{o=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await nA({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{de.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),s(),o&&clearTimeout(o)}};this.startTime=Date.now(),this.totalAllowedTime=e,this.globalTimeoutId=null,this.subscribers=[],this.hasTimedOut=!1,this.setupGlobalTimeout()}getElapsedTime(){return Date.now()-this.startTime}getRemainingTime(){let e=this.getElapsedTime(),r=this.totalAllowedTime-e;return Math.max(0,r)}isTimeExpired(){return this.getRemainingTime()===0||this.hasTimedOut}setupGlobalTimeout(){this.globalTimeoutId&&clearTimeout(this.globalTimeoutId),this.globalTimeoutId=setTimeout(()=>{this.notifyTimeUp()},this.totalAllowedTime)}notifyTimeUp(){this.hasTimedOut=!0;for(let e=this.subscribers.length-1;e>=0;e--)try{this.subscribers[e]()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}}onTimesUp(e){if(this.subscribers.push(e),this.hasTimedOut)try{e()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}return()=>{let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}}off(e){let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}clearSubscribers(){this.subscribers.length=0}getSubscriberCount(){return this.subscribers.length}destroy(){this.globalTimeoutId&&(clearTimeout(this.globalTimeoutId),this.globalTimeoutId=null),this.clearSubscribers()}static{this.timeUnits={seconds:e=>e*1e3,minutes:e=>e*60*1e3,hours:e=>e*60*60*1e3}}};var une={name:"@netlify/agent-runner-cli",type:"module",version:"1.152.0-EX-2670.0",description:"CLI tool for running Netlify agents",main:"./dist/index.js",types:"./dist/index.d.ts",exports:"./dist/index.js",bin:{"agent-runner-cli":"./dist/bin.js","agent-runner-cli-local":"./dist/bin-local.js"},files:["dist/**/*.js","dist/**/*.d.ts","dist/skills/**","patches","scripts"],scripts:{build:"tsup",dev:"tsup --watch",prepare:"husky install node_modules/@netlify/eslint-config-node/.husky/",prepublishOnly:"npm ci && npm test",prepack:"npm run build",test:"run-s build format test:dev",format:"run-s build format:check-fix:*","format:ci":"run-s build format:check:*","format:check-fix:lint":"run-e format:check:lint format:fix:lint","format:check:lint":'eslint --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:fix:lint":'eslint --fix --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:check-fix:prettier":"run-e format:check:prettier format:fix:prettier","format:check:prettier":'prettier --check --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"format:fix:prettier":'prettier --write --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"LOG=0 vitest --exclude '**/integration/**'","test:ci:vitest":"LOG=0 vitest run --coverage --exclude '**/integration/**'","test:smoke":"node scripts/smoke-dist.js","test:integration":"vitest run test/integration/","test:integration:codex":"vitest run test/integration/codex.test.ts","test:integration:claude":"vitest run test/integration/claude.test.ts","test:integration:gemini":"vitest run test/integration/gemini.test.ts","test:integration:skill-invocation":"vitest run test/integration/skill-invocation.test.ts","check:types":"tsc --noEmit",postinstall:"node scripts/postinstall.js"},keywords:[],license:"MIT",repository:"netlify/agent-runner-cli",bugs:{url:"https://github.com/netlify/agent-runner-cli/issues"},author:"Netlify Inc.",directories:{test:"test"},devDependencies:{"@commitlint/cli":"^20.0.0","@commitlint/config-conventional":"^20.0.0","@eslint/compat":"^2.0.0","@eslint/js":"^10.0.1","@netlify/axis":"^1.17.2","@netlify/eslint-config-node":"^7.0.1","@types/node":"^24.5.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@vitest/coverage-v8":"^4.1.5","@vitest/eslint-plugin":"^1.6.6",eslint:"^10.5.0","eslint-config-prettier":"^10.1.8","eslint-plugin-n":"^17.0.0",husky:"^9.0.0",jiti:"^2.7.0","patch-package":"^8.0.0",tsup:"^8.5.0",typescript:"^5.0.0","typescript-eslint":"^8.44.0",vitest:"^4.0.16"},dependencies:{"@anthropic-ai/claude-code":"^2.1.219","@anthropic-ai/sdk":"0.91.1","@google/gemini-cli":"0.42.0","@modelcontextprotocol/sdk":"^1.29.0","@netlify/cache-utils":"^6.0.5","@netlify/database-proxy":"^0.1.5","@netlify/otel":"^6.0.4","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.128.0","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.8.5",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var Y1e=H1e(import.meta.url),K1e=go.dirname(Y1e),Z1e=W1e(import.meta.url),mf=me("shell"),i$=new Set,dne={preferLocal:!0},Mr=(t,e,r)=>{let[n,i]=J1e(e,r),s={...dne,...i},o=ine(t,n,s);pne(o,s),gne(o);let a=r?.idleTimeout;return a&&a>0&&mne(o,a),o},fne=(t,e)=>{let r={...dne,...e},n=sne(t,r);return pne(n,r),gne(n),e?.idleTimeout&&e.idleTimeout>0&&mne(n,e.idleTimeout),n},J1e=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},pne=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0)return;if(_o.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new r_).pipe(_o.stdout),t.stderr?.pipe(new r_).pipe(_o.stderr);return}t.stdout?.pipe(_o.stdout),t.stderr?.pipe(_o.stderr)},s$=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(_o.kill(-t.pid,e),mf.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return mf.error("Error killing process:",r),!1}},hne=t=>s$(t,"SIGKILL"),mne=(t,e)=>{let r=null,n=()=>{mf.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),s$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(mf.log(`Force killing idle process ${t.pid}`),hne(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let s=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",s),t.on("error",s)},gne=t=>{i$.add(t);let e=lne();if(e){let r=e.onTimesUp(()=>{mf.log(`Global timer expired, killing process ${t.pid}`),s$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(mf.log(`Force killing process ${t.pid} after timeout`),hne(t))},5e3)});t.on("exit",()=>{i$.delete(t),r()}),t.on("error",()=>{i$.delete(t),r()})}};function ps(t,e){if(!_o.env.NETLIFY_LOCAL_MODE)try{let i=Z1e.resolve(une.name),s=go.dirname(i);for(;s!==go.dirname(s);){let o=go.dirname(s);if(go.basename(o)==="node_modules"){let a=go.join(o,".bin",e);if(_x.existsSync(a))return a;break}s=o}}catch(i){console.error("Could not resolve package.json",i)}if(_o.env.NODE_PATH){let i=go.join(_o.env.NODE_PATH,".bin",e);if(_x.existsSync(i))return i}let r=go.join(t,"node_modules",".bin",e);if(_x.existsSync(r))return r;let n=go.join(K1e,"..","node_modules",".bin",e);if(_x.existsSync(n))return n}var X1e=me("utils"),Q1e=t=>new Promise(e=>{setTimeout(e,t)});var o$=t=>{try{return new URL(t).hostname||null}catch{return null}},yx=(t,e=3e3)=>{let r=!1,n=null,i=[],s=null,o=(...a)=>{if(r)return n=a,new Promise(u=>{i.push(u)});r=!0;let c,l=new Promise(u=>{c=u});return s=(async()=>{await Promise.resolve();let u=await t(...a);for(c(u);;){if(await Q1e(e),!n)return r=!1,s=null,u;let d=n,f=i;n=null,i=[],u=await t(...d),f.forEach(p=>{p(u)})}})(),l};return o.flush=async()=>{if((r||n)&&s)return await s,o.flush()},o.cancel=()=>{n=null,i.forEach(a=>a(void 0)),i=[]},o},Oa=(t,e,r=!1)=>{let n=null,i=null,s=null,o=function(...a){i=a,s=this;let c=r&&!n;clearTimeout(n),n=setTimeout(()=>{n=null,r||(t.apply(s,i),i=null,s=null)},e),c&&(t.apply(s,i),i=null,s=null)};return o.cancel=()=>{clearTimeout(n),n=null,i=null,s=null},o.flush=()=>{if(n){clearTimeout(n);let a=i,c=s;n=null,i=null,s=null,t.apply(c,a)}},o},_ne=(t,e=!0,r)=>{if(t)try{return JSON.parse(t)}catch(n){e&&(r?.error?r.error("Could not parse JSON",n):X1e.error("Could not parse JSON",n))}},eUe=t=>t.charAt(0).toUpperCase()+t.slice(1),hs=t=>t.split("-").map(e=>e.length===2?e.toUpperCase():eUe(e)).join(" ");function yo(t,e){e&&t.log(`Skill invoked: ${e}`)}var Sx=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),yne=(t,e,r=!1)=>{if(r)return;let n=60,i=55,s=".netlify.app",o="agent-",a=6;if(!e)return`${o}${t.slice(0,a)}`;let c=`--${e}${s}`;if(c.length>i)return"";let l=n-c.length;if(l<=0)return"";if(l>=o.length+a){let u=Math.min(l-o.length,t.length);return`${o}${t.slice(0,u)}`}return t.slice(0,l)};var a$=t=>{let e=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(!e)return{command:t};let r=t.indexOf(e[0]),n=t.slice(r+e[0].length).trim();return{command:t.slice(0,r).trim(),heredocContent:n||void 0}},tUe=1e4,c$=(t,e=tUe)=>{if(!t||typeof t!="string"||t.length<=e)return t;let n=t.startsWith("```")?"\n... [truncated]\n```":"... [truncated]";return t.slice(0,e)+n};import{createHash as rUe}from"crypto";import{createReadStream as nUe}from"fs";import Ex from"fs/promises";import Tne from"os";import vx from"path";var Sne=me("repo"),Ane="runner-diffs-",xne=t=>`${Ane}${t}-`,wne=async t=>{let e=Tne.tmpdir(),r;try{r=await Ex.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(Ane)&&!n.startsWith(xne(t))).map(n=>Ex.rm(vx.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Zr=(t,e={})=>Mr("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),bx=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{Sne.info("Getting runner diffs");let n=await sUe(r),{hasChanges:i}=n,{status:s}=n;if(!i)return{hasChanges:!1};if(!e){let h=aUe(s);await cUe(h,r)}Sne.info("Changes after processing"),await u$(r);let o=await f$(s,r);if(await l$(o,r),i=await oUe(r),!i)return{hasChanges:!1,ignored:o};await Zr(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await Ex.mkdtemp(vx.join(Tne.tmpdir(),xne(t.sessionId))),c=async({from:h,to:m,fileName:E,binary:T})=>{let v=vx.join(a,E);await Zr([...T?["diff",h,m,"--binary"]:["diff",h,m],`--output=${v}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:S}=await Ex.stat(v);return{path:v,size:S}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await bne(r),{hasChanges:!1,ignored:o};let u=await c({from:t.runSha,to:"HEAD",fileName:"session-binary.patch",binary:!0}),d,f;if(t.sha){d=await c({from:t.sha,to:"HEAD",fileName:"cumulative.patch"});let h=await c({from:t.sha,to:"HEAD",fileName:"cumulative-binary.patch",binary:!0});await vne(d,h)||(f=h)}await bne(r),de.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:o};return await vne(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Ene=async t=>{let e=rUe("sha256");for await(let r of nUe(t))e.update(r);return e.digest("hex")},vne=async(t,e)=>t.size===e.size&&await Ene(t.path)===await Ene(e.path),bne=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Zr(["reset","--soft","HEAD~1"],{cwd:t})},l$=async(t=[],e=process.cwd())=>{await Zr(["add",".",...t],{cwd:e})},u$=async(t=process.cwd())=>{let e=await Zr(["status","-s"],{cwd:t});return String(e.stdout??"")},Rne=/.. (.+)?\.log$/,iUe=[Rne],sUe=async(t=process.cwd())=>{let e=await u$(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
|
|
102
102
|
`).filter(i=>iUe.some(o=>o instanceof RegExp?o.test(i):i===o)?!1:i[1]?.trim()!=="")).length!==0,status:e}},oUe=async(t=process.cwd())=>{try{return await Zr(["diff","--staged","--quiet"],{cwd:t}),!1}catch{return!0}},d$=async(t=process.cwd())=>{let{stdout:e}=await Zr(["rev-parse","HEAD"],{cwd:t});return String(e??"").trim()},Ine=async(t=process.cwd())=>{let{stdout:e}=await Zr(["rev-list","--max-parents=0","HEAD"],{cwd:t});return String(e??"").trim()},f$=async(t,e=process.cwd())=>{t||=await u$(e);let r=[".netlify","node_modules","dist",".next","out",".nuxt",".output",".cache",".turbo",".parcel-cache","coverage",".nyc_output","storybook-static","public/build","CLAUDE.local.md"],n=[];return t.split(`
|
|
103
103
|
`).forEach(i=>{r.forEach(o=>{let a=i===`?? ${o}`,c=i.startsWith(`?? ${o}/`)||i.startsWith(`?? ${o}${vx.sep}`);(a||c)&&n.push(`:!${o}`)});let s=i.match(Rne)?.[1];s&&n.push(`:!${s}.log`)}),n},Cne=async(t=process.cwd())=>{await Zr(["reset","--hard","HEAD"],{cwd:t})},Pne=async(t=process.cwd())=>{let e=await Zr(["clean","-fd","-e",".netlify"],{stdio:["ignore","pipe","pipe"],cwd:t});return String(e.stdout??"").split(`
|
|
104
104
|
`).filter(r=>r.startsWith("Removing ")).map(r=>r.slice(9))},aUe=t=>{let e=t.split(`
|
|
@@ -206,7 +206,7 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
|
206
206
|
|
|
207
207
|
`)}p.write("payload.value = newResult;"),p.write("return payload;");let v=p.compile();return(A,S)=>v(f,A,S)},s,o=Bl,a=!Fl.jitless,l=a&&e1.value,u=e.catchall,d;t._zod.parse=(f,p)=>{d??(d=n.value);let h=f.value;return o(h)?a&&l&&p?.async===!1&&p.jitless!==!0?(s||(s=i(e.shape)),f=s(f,p),u?rse([],h,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),f)}});function Bie(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!Va(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(o=>Lr(o,n,xt())))}),e)}var py=N("$ZodUnion",(t,e)=>{Oe.init(t,e),je(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),je(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),je(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),je(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>ry(i.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,o=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(a=>Bie(a,n,t,i)):Bie(o,n,t,i)}});function jie(t,e,r,n){let i=t.filter(s=>s.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(o=>Lr(o,n,xt())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var VU=N("$ZodXor",(t,e)=>{py.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,o=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},i);c instanceof Promise?(o.push(c),s=!0):o.push(c)}return s?Promise.all(o).then(a=>jie(a,n,t,i)):jie(o,n,t,i)}}),qU=N("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,py.init(t,e);let r=t._zod.parse;je(t._zod,"propValues",()=>{let i={};for(let s of e.options){let o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(o)){i[a]||(i[a]=new Set);for(let l of c)i[a].add(l)}}return i});let n=Zf(()=>{let i=e.options,s=new Map;for(let o of i){let a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,o)}}return s});t._zod.parse=(i,s)=>{let o=i.value;if(!Bl(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),i;let a=n.value.get(o?.[e.discriminator]);return a?a._zod.run(i,s):e.unionFallback||s.direction==="backward"?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:o,path:[e.discriminator],inst:t}),i)}}),HU=N("$ZodIntersection",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value,s=e.left._zod.run({value:i,issues:[]},n),o=e.right._zod.run({value:i,issues:[]},n);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,l])=>zie(r,c,l)):zie(r,s,o)}});function sU(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Ga(t)&&Ga(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),i={...t,...e};for(let s of n){let o=sU(t[s],e[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let i=t[n],s=e[n],o=sU(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function zie(t,e,r){let n=new Map,i;for(let a of e.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(a);let s=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&i&&t.issues.push({...i,keys:s}),Va(t))return t;let o=sU(e.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}var Tw=N("$ZodTuple",(t,e)=>{Oe.init(t,e);let r=e.items;t._zod.parse=(n,i)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let o=[],a=Gie(r,"optin"),c=Gie(r,"optout");if(!e.rest){if(s.length<a)return n.issues.push({code:"too_small",minimum:a,inclusive:!0,input:s,inst:t,origin:"array"}),n;s.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:t,origin:"array"})}let l=new Array(r.length);for(let u=0;u<r.length;u++){let d=r[u]._zod.run({value:s[u],issues:[]},i);d instanceof Promise?o.push(d.then(f=>{l[u]=f})):l[u]=d}if(e.rest){let u=r.length-1,d=s.slice(r.length);for(let f of d){u++;let p=e.rest._zod.run({value:f,issues:[]},i);p instanceof Promise?o.push(p.then(h=>Vie(h,n,u))):Vie(p,n,u)}}return o.length?Promise.all(o).then(()=>qie(l,n,r,s,c)):qie(l,n,r,s,c)}});function Gie(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function Vie(t,e,r){t.issues.length&&e.issues.push(...Xr(r,t.issues)),e.value[r]=t.value}function qie(t,e,r,n,i){for(let s=0;s<r.length;s++){let o=t[s],a=s<n.length;if(o.issues.length){if(!a&&s>=i){e.value.length=s;break}e.issues.push(...Xr(s,o.issues))}e.value[s]=o.value}for(let s=e.value.length-1;s>=n.length&&(r[s]._zod.optout==="optional"&&e.value[s]===void 0);s--)e.value.length=s;return e}var WU=N("$ZodRecord",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Ga(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],o=e.keyType._zod.values;if(o){r.value={};let a=new Set;for(let l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Lr(p,n,xt())),input:l,path:[l],inst:t});continue}let d=u.value,f=e.valueType._zod.run({value:i[l],issues:[]},n);f instanceof Promise?s.push(f.then(p=>{p.issues.length&&r.issues.push(...Xr(l,p.issues)),r.value[d]=p.value})):(f.issues.length&&r.issues.push(...Xr(l,f.issues)),r.value[d]=f.value)}let c;for(let l in i)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&hw.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Lr(d,n,xt())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:i[a],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...Xr(a,d.issues)),r.value[c.value]=d.value})):(u.issues.length&&r.issues.push(...Xr(a,u.issues)),r.value[c.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),YU=N("$ZodMap",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:t}),r;let s=[];r.value=new Map;for(let[o,a]of i){let c=e.keyType._zod.run({value:o,issues:[]},n),l=e.valueType._zod.run({value:a,issues:[]},n);c instanceof Promise||l instanceof Promise?s.push(Promise.all([c,l]).then(([u,d])=>{Hie(u,d,r,o,i,t,n)})):Hie(c,l,r,o,i,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Hie(t,e,r,n,i,s,o){t.issues.length&&(ny.has(typeof n)?r.issues.push(...Xr(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:s,issues:t.issues.map(a=>Lr(a,o,xt()))})),e.issues.length&&(ny.has(typeof n)?r.issues.push(...Xr(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:s,key:n,issues:e.issues.map(a=>Lr(a,o,xt()))})),r.value.set(t.value,e.value)}var KU=N("$ZodSet",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let o of i){let a=e.valueType._zod.run({value:o,issues:[]},n);a instanceof Promise?s.push(a.then(c=>Wie(c,r))):Wie(a,r)}return s.length?Promise.all(s).then(()=>r):r}});function Wie(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var ZU=N("$ZodEnum",(t,e)=>{Oe.init(t,e);let r=ty(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>ny.has(typeof i)).map(i=>typeof i=="string"?Kn(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:r,input:o,inst:t}),i}}),JU=N("$ZodLiteral",(t,e)=>{if(Oe.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Kn(n):n?Kn(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}}),XU=N("$ZodFile",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),QU=N("$ZodTransform",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ba(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(r.value=o,r.fallback=!0,r));if(i instanceof Promise)throw new Ri;return r.value=i,r.fallback=!0,r}});function Yie(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Aw=N("$ZodOptional",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",je(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),je(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ry(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Yie(o,i)):Yie(s,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),eF=N("$ZodExactOptional",(t,e)=>{Aw.init(t,e),je(t._zod,"values",()=>e.innerType._zod.values),je(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),tF=N("$ZodNullable",(t,e)=>{Oe.init(t,e),je(t._zod,"optin",()=>e.innerType._zod.optin),je(t._zod,"optout",()=>e.innerType._zod.optout),je(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ry(r.source)}|null)$`):void 0}),je(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),rF=N("$ZodDefault",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",je(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Kie(s,e)):Kie(i,e)}});function Kie(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var nF=N("$ZodPrefault",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",je(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),iF=N("$ZodNonOptional",(t,e)=>{Oe.init(t,e),je(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Zie(s,t)):Zie(i,t)}});function Zie(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var sF=N("$ZodSuccess",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ba("ZodSuccess");let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>(r.value=s.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),oF=N("$ZodCatch",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",je(t._zod,"optout",()=>e.innerType._zod.optout),je(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(o=>Lr(o,n,xt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(s=>Lr(s,n,xt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),aF=N("$ZodNaN",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),xw=N("$ZodPipe",(t,e)=>{Oe.init(t,e),je(t._zod,"values",()=>e.in._zod.values),je(t._zod,"optin",()=>e.in._zod.optin),je(t._zod,"optout",()=>e.out._zod.optout),je(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(o=>_w(o,e.in,n)):_w(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>_w(s,e.out,n)):_w(i,e.out,n)}});function _w(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var hy=N("$ZodCodec",(t,e)=>{Oe.init(t,e),je(t._zod,"values",()=>e.in._zod.values),je(t._zod,"optin",()=>e.in._zod.optin),je(t._zod,"optout",()=>e.out._zod.optout),je(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let s=e.in._zod.run(r,n);return s instanceof Promise?s.then(o=>yw(o,e,n)):yw(s,e,n)}else{let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(o=>yw(o,e,n)):yw(s,e,n)}}});function yw(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let i=e.transform(t.value,t);return i instanceof Promise?i.then(s=>Sw(t,s,e.out,r)):Sw(t,i,e.out,r)}else{let i=e.reverseTransform(t.value,t);return i instanceof Promise?i.then(s=>Sw(t,s,e.in,r)):Sw(t,i,e.in,r)}}function Sw(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}var cF=N("$ZodPreprocess",(t,e)=>{xw.init(t,e)}),lF=N("$ZodReadonly",(t,e)=>{Oe.init(t,e),je(t._zod,"propValues",()=>e.innerType._zod.propValues),je(t._zod,"values",()=>e.innerType._zod.values),je(t._zod,"optin",()=>e.innerType?._zod?.optin),je(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(Jie):Jie(i)}});function Jie(t){return t.value=Object.freeze(t.value),t}var uF=N("$ZodTemplateLiteral",(t,e)=>{Oe.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let s=i.startsWith("^")?1:0,o=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(s,o))}else if(n===null||r1.has(typeof n))r.push(Kn(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),dF=N("$ZodFunction",(t,e)=>(Oe.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=t._def.input?nw(t._def.input,n):n,s=Reflect.apply(r,this,i);return t._def.output?nw(t._def.output,s):s}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await iw(t._def.input,n):n,s=await Reflect.apply(r,this,i);return t._def.output?await iw(t._def.output,s):s}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Tw({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),fF=N("$ZodPromise",(t,e)=>{Oe.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),pF=N("$ZodLazy",(t,e)=>{Oe.init(t,e),je(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),je(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),je(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),je(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),je(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),hF=N("$ZodCustom",(t,e)=>{ut.init(t,e),Oe.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>Xie(s,r,n,t));Xie(i,r,n,t)}});function Xie(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Jf(i))}}var gy={};ir(gy,{ar:()=>ise,az:()=>sse,be:()=>ase,bg:()=>cse,ca:()=>lse,cs:()=>use,da:()=>dse,de:()=>fse,el:()=>pse,en:()=>ww,eo:()=>hse,es:()=>mse,fa:()=>gse,fi:()=>_se,fr:()=>yse,frCA:()=>Sse,he:()=>Ese,hr:()=>vse,hu:()=>bse,hy:()=>Ase,id:()=>xse,is:()=>wse,it:()=>Rse,ja:()=>Ise,ka:()=>Cse,kh:()=>Pse,km:()=>Rw,ko:()=>Ose,lt:()=>kse,mk:()=>Mse,ms:()=>Dse,nl:()=>Lse,no:()=>$se,ota:()=>Use,pl:()=>Bse,ps:()=>Fse,pt:()=>jse,ro:()=>zse,ru:()=>Vse,sl:()=>qse,sv:()=>Hse,ta:()=>Wse,th:()=>Yse,tr:()=>Kse,ua:()=>Zse,uk:()=>Iw,ur:()=>Jse,uz:()=>Xse,vi:()=>Qse,yo:()=>roe,zhCN:()=>eoe,zhTW:()=>toe});var EBe=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${s}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${ee(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${i.minimum.toString()} ${o.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${r[s.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${B(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function ise(){return{localeError:EBe()}}var vBe=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${s}, daxil olan ${a}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${ee(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${s}${i.maximum.toString()} ${o.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${s}${i.minimum.toString()} ${o.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[s.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${B(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function sse(){return{localeError:vBe()}}function ose(t,e,r,n){let i=Math.abs(t),s=i%10,o=i%100;return o>=11&&o<=19?n:s===1?e:s>=2&&s<=4?r:n}var bBe=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${s}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${ee(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);if(o){let a=Number(i.maximum),c=ose(a,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${i.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);if(o){let a=Number(i.minimum),c=ose(a,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${i.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[s.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${B(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function ase(){return{localeError:bBe()}}var TBe=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${ee(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${i.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${s.prefix}"`;if(s.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${s.suffix}"`;if(s.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${s.includes}"`;if(s.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${s.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return s.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),s.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${r[s.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${B(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function cse(){return{localeError:TBe()}}var ABe=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${s}, s'ha rebut ${a}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${ee(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${B(i.values," o ")}`;case"too_big":{let s=i.inclusive?"com a m\xE0xim":"menys de",o=e(i.origin);return o?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${s} ${i.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${s} ${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?"com a m\xEDnim":"m\xE9s de",o=e(i.origin);return o?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${s} ${i.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${s} ${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${r[s.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function lse(){return{localeError:ABe()}}var xBe=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(i){return t[i]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${s}, obdr\u017Eeno ${a}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${ee(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${s}${i.maximum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${s}${i.minimum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${r[s.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${B(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function use(){return{localeError:xBe()}}var wBe=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${a}`:`Ugyldigt input: forventede ${s}, fik ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${ee(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin),a=n[i.origin]??i.origin;return o?`For stor: forventede ${a??"value"} ${o.verb} ${s} ${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${s} ${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin),a=n[i.origin]??i.origin;return o?`For lille: forventede ${a} ${o.verb} ${s} ${i.minimum.toString()} ${o.unit}`:`For lille: forventede ${a} havde ${s} ${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${B(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}};function dse(){return{localeError:wBe()}}var RBe=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(i){return t[i]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${s}, erhalten ${a}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${ee(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${s}${i.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${s}${i.maximum.toString()} ist`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Zu klein: erwartet, dass ${i.origin} ${s}${i.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${s}${i.minimum.toString()} ist`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${r[s.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${B(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function fse(){return{localeError:RBe()}}var IBe=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(i){return t[i]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return typeof i.expected=="string"&&/^[A-Z]/.test(i.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${i.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${s}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return i.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${ee(i.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${i.maximum.toString()} ${o.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${i.minimum.toString()} ${o.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${s.prefix}"`:s.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${s.suffix}"`:s.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${s.includes}"`:s.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${s.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[s.format]??i.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${i.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${i.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${i.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${B(i.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${i.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${i.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function pse(){return{localeError:IBe()}}var CBe=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${ee(i.values[0])}`:`Invalid option: expected one of ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(o=>`'${o}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function ww(){return{localeError:CBe()}}var PBe=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return t[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${s}, ricevi\u011Dis ${a}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${ee(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${s}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${s}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${s.prefix}"`:s.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${s.suffix}"`:s.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${s.includes}"`:s.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${s.pattern}`:`Nevalida ${r[s.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function hse(){return{localeError:PBe()}}var OBe=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${s}, recibido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${ee(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin),a=n[i.origin]??i.origin;return o?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${s}${i.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin),a=n[i.origin]??i.origin;return o?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${s}${i.minimum.toString()} ${o.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${r[s.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function mse(){return{localeError:OBe()}}var NBe=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${s} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${ee(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${B(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${s}${i.minimum.toString()} ${o.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${s}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[s.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${B(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function gse(){return{localeError:NBe()}}var kBe=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(i){return t[i]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${s}, oli ${a}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${ee(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Liian suuri: ${o.subject} t\xE4ytyy olla ${s}${i.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Liian pieni: ${o.subject} t\xE4ytyy olla ${s}${i.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${r[s.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${B(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function _se(){return{localeError:kBe()}}var MBe=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${s} attendu, ${a} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${ee(i.values[0])} attendu`:`Option invalide : une valeur parmi ${B(i.values,"|")} attendue`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Trop grand : ${n[i.origin]??"valeur"} doit ${o.verb} ${s}${i.maximum.toString()} ${o.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[i.origin]??"valeur"} doit \xEAtre ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Trop petit : ${n[i.origin]??"valeur"} doit ${o.verb} ${s}${i.minimum.toString()} ${o.unit}`:`Trop petit : ${n[i.origin]??"valeur"} doit \xEAtre ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${r[s.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${B(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function yse(){return{localeError:MBe()}}var DBe=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${s}, re\xE7u ${a}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${ee(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"\u2264":"<",o=e(i.origin);return o?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${s}${i.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?"\u2265":">",o=e(i.origin);return o?`Trop petit : attendu que ${i.origin} ait ${s}${i.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${i.origin} soit ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${r[s.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${B(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function Sse(){return{localeError:DBe()}}var LBe=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?t[l]:void 0,n=l=>{let u=r(l);return u?u.label:l??t.unknown.label},i=l=>`\u05D4${n(l)}`,s=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",o=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??n(u),f=te(l.input),p=c[f]??t[f]?.label??f;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${ee(l.values[0])}`;let u=l.values.map(p=>ee(p));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=o(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",m=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?"<=":"<",p=s(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()}`}case"too_small":{let u=o(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let E=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${E}`}let m=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?">=":">",p=s(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],f=d?.label??u.format,h=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${h}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${B(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Ese(){return{localeError:LBe()}}var $Be=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(i){return t[i]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${i.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${s}, a primljeno je ${a}`}case"invalid_value":return i.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${ee(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin),a=n[i.origin]??i.origin;return o?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${s}${i.maximum.toString()} ${o.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin),a=n[i.origin]??i.origin;return o?`Premalo: o\u010Dekivano da ${a} ima ${s}${i.minimum.toString()} ${o.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${s.prefix}"`:s.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${s.suffix}"`:s.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${s.includes}"`:s.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${s.pattern}`:`Neispravna ${r[s.format]??i.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${B(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[i.origin]??i.origin}`;default:return"Neispravan unos"}}};function vse(){return{localeError:$Be()}}var UBe=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return t[i]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${s}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${ee(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${i.maximum.toString()} ${o.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${s}${i.minimum.toString()} ${o.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[s.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function bse(){return{localeError:UBe()}}function Tse(t,e,r){return Math.abs(t)===1?e:r}function np(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var FBe=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(i){return t[i]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${s}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${ee(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);if(o){let a=Number(i.maximum),c=Tse(a,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${np(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${i.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${np(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);if(o){let a=Number(i.minimum),c=Tse(a,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${np(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${i.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${np(i.origin)} \u056C\u056B\u0576\u056B ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${s.prefix}"-\u0578\u057E`:s.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${s.suffix}"-\u0578\u057E`:s.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${s.includes}"`:s.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${s.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[s.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${B(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${np(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${np(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Ase(){return{localeError:FBe()}}var BBe=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${s}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${ee(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${s}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: diharapkan ${i.origin} memiliki ${s}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${r[s.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function xse(){return{localeError:BBe()}}var jBe=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return t[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${s}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${ee(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${s}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${s}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${s.prefix}"`:s.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${s.suffix}"`:s.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${s.includes}"`:s.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${s.pattern}`:`Rangt ${r[s.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${B(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function wse(){return{localeError:jBe()}}var zBe=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return t[i]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${a}`:`Input non valido: atteso ${s}, ricevuto ${a}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${ee(i.values[0])}`:`Opzione non valida: atteso uno tra ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Troppo grande: ${i.origin??"valore"} deve avere ${s}${i.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Troppo piccolo: ${i.origin} deve avere ${s}${i.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${i.origin} deve essere ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Input non valido: ${r[s.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${B(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function Rse(){return{localeError:zBe()}}var GBe=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(i){return t[i]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${s}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${ee(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${B(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",o=e(i.origin);return o?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",o=e(i.origin);return o?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[s.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${B(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Ise(){return{localeError:GBe()}}var VBe=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return t[i]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${s}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${ee(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${B(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${s}${i.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${o.verb} ${s}${i.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.prefix}"-\u10D8\u10D7`:s.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.suffix}"-\u10D8\u10D7`:s.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${s.includes}"-\u10E1`:s.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${s.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[s.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${B(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Cse(){return{localeError:VBe()}}var qBe=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(i){return t[i]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${s} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${ee(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${i.maximum.toString()} ${o.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${s} ${i.minimum.toString()} ${o.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${s} ${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[s.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${B(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Rw(){return{localeError:qBe()}}function Pse(){return Rw()}var HBe=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${s}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${ee(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${B(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",o=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${c} ${s}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${s}${o}`}case"too_small":{let s=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",o=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${c} ${s}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${s}${o}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[s.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${B(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Ose(){return{localeError:HBe()}}var my=t=>t.charAt(0).toUpperCase()+t.slice(1);function Nse(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}var WBe=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,s,o,a){let c=t[i]??null;return c===null?c:{unit:c.unit[s],verb:c.verb[a][o?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${s}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${ee(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${B(i.values,"|")} pasirinkim\u0173`;case"too_big":{let s=n[i.origin]??i.origin,o=e(i.origin,Nse(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${my(s??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${my(s??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let s=n[i.origin]??i.origin,o=e(i.origin,Nse(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${my(s??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${my(s??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${s.prefix}"`:s.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${s.suffix}"`:s.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${s.includes}"`:s.format==="regex"?`Eilut\u0117 privalo atitikti ${s.pattern}`:`Neteisingas ${r[s.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${B(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let s=n[i.origin]??i.origin;return`${my(s??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function kse(){return{localeError:WBe()}}var YBe=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(i){return t[i]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${s}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${ee(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${i.minimum.toString()} ${o.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${B(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Mse(){return{localeError:YBe()}}var KBe=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${a}`:`Input tidak sah: dijangka ${s}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${ee(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: dijangka ${i.origin??"nilai"} ${o.verb} ${s}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: dijangka ${i.origin} ${o.verb} ${s}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${r[s.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${B(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function Dse(){return{localeError:KBe()}}var ZBe=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(i){return t[i]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${s}, ontving ${a}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${ee(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin),a=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return o?`Te ${a}: verwacht dat ${i.origin??"waarde"} ${s}${i.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${a}: verwacht dat ${i.origin??"waarde"} ${s}${i.maximum.toString()} is`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin),a=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return o?`Te ${a}: verwacht dat ${i.origin} ${s}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${a}: verwacht dat ${i.origin} ${s}${i.minimum.toString()} is`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${r[s.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function Lse(){return{localeError:ZBe()}}var JBe=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${a}`:`Ugyldig input: forventet ${s}, fikk ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${ee(i.values[0])}`:`Ugyldig valg: forventet en av ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${s}${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`For lite(n): forventet ${i.origin} til \xE5 ha ${s}${i.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${B(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function $se(){return{localeError:JBe()}}var XBe=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${s}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${ee(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${s}${i.maximum.toString()} ${o.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${s}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${s}${i.minimum.toString()} ${o.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${s}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=i;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[s.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Use(){return{localeError:XBe()}}var QBe=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${s} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${ee(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${B(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${s}${i.minimum.toString()} ${o.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${s}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[s.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${B(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Fse(){return{localeError:QBe()}}var eje=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(i){return t[i]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${s}, otrzymano ${a}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${ee(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${i.maximum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${i.minimum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[s.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Bse(){return{localeError:eje()}}var tje=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return t[i]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${s}, recebido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${ee(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${s}${i.maximum.toString()} ${o.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Muito pequeno: esperado que ${i.origin} tivesse ${s}${i.minimum.toString()} ${o.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${r[s.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${B(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};function jse(){return{localeError:tje()}}var rje=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(i){return t[i]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return`Intrare invalid\u0103: a\u0219teptat ${s}, primit ${a}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${ee(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} ${o.verb} ${s}${i.maximum.toString()} ${o.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} s\u0103 fie ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Prea mic: a\u0219teptat ca ${i.origin} ${o.verb} ${s}${i.minimum.toString()} ${o.unit}`:`Prea mic: a\u0219teptat ca ${i.origin} s\u0103 fie ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${s.prefix}"`:s.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${s.suffix}"`:s.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${s.includes}"`:s.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${s.pattern}`:`Format invalid: ${r[s.format]??i.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${B(i.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${i.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${i.origin}`;default:return"Intrare invalid\u0103"}}};function zse(){return{localeError:rje()}}function Gse(t,e,r,n){let i=Math.abs(t),s=i%10,o=i%100;return o>=11&&o<=19?n:s===1?e:s>=2&&s<=4?r:n}var nje=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${ee(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);if(o){let a=Number(i.maximum),c=Gse(a,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${i.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);if(o){let a=Number(i.minimum),c=Gse(a,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${i.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[s.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${B(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Vse(){return{localeError:nje()}}var ije=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return t[i]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${s}, prejeto ${a}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${ee(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${s}${i.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${s}${i.minimum.toString()} ${o.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${r[s.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${B(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function qse(){return{localeError:ije()}}var sje=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(i){return t[i]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${s}, fick ${a}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${ee(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${s}${i.maximum.toString()} ${o.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${s}${i.minimum.toString()} ${o.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${r[s.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${B(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Hse(){return{localeError:sje()}}var oje=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(i){return t[i]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${ee(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${B(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${i.maximum.toString()} ${o.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${s}${i.minimum.toString()} ${o.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${s}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[s.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${B(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Wse(){return{localeError:oje()}}var aje=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(i){return t[i]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${s} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${ee(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${i.maximum.toString()} ${o.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${i.minimum.toString()} ${o.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[s.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${B(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Yse(){return{localeError:aje()}}var cje=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${s}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${ee(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${s}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${s}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Ge\xE7ersiz metin: "${s.prefix}" ile ba\u015Flamal\u0131`:s.format==="ends_with"?`Ge\xE7ersiz metin: "${s.suffix}" ile bitmeli`:s.format==="includes"?`Ge\xE7ersiz metin: "${s.includes}" i\xE7ermeli`:s.format==="regex"?`Ge\xE7ersiz metin: ${s.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[s.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${B(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Kse(){return{localeError:cje()}}var lje=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${s}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${ee(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${o.verb} ${s}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${o.verb} ${s}${i.minimum.toString()} ${o.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[s.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${B(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Iw(){return{localeError:lje()}}function Zse(){return Iw()}var uje=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(i){return t[i]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${s} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${ee(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${B(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${s}${i.minimum.toString()} ${o.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${s}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[s.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${B(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Jse(){return{localeError:uje()}}var dje=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(i){return t[i]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${s}, qabul qilingan ${a}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${ee(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Juda katta: kutilgan ${i.origin??"qiymat"} ${s}${i.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Juda kichik: kutilgan ${i.origin} ${s}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${i.origin} ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${s.prefix}" bilan boshlanishi kerak`:s.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${s.suffix}" bilan tugashi kerak`:s.format==="includes"?`Noto\u2018g\u2018ri satr: "${s.includes}" ni o\u2018z ichiga olishi kerak`:s.format==="regex"?`Noto\u2018g\u2018ri satr: ${s.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[s.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${B(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Xse(){return{localeError:dje()}}var fje=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(i){return t[i]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${s}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${ee(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o.verb} ${s}${i.maximum.toString()} ${o.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o.verb} ${s}${i.minimum.toString()} ${o.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${r[s.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${B(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Qse(){return{localeError:fje()}}var pje=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(i){return t[i]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${s}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${ee(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${s}${i.maximum.toString()} ${o.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${s}${i.minimum.toString()} ${o.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${r[s.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${B(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function eoe(){return{localeError:pje()}}var hje=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(i){return t[i]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${s}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${ee(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${s}${i.maximum.toString()} ${o.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${s}${i.maximum.toString()}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${s}${i.minimum.toString()} ${o.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${r[s.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${B(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function toe(){return{localeError:hje()}}var mje=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(i){return t[i]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let s=n[i.expected]??i.expected,o=te(i.input),a=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${s}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${ee(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${B(i.values,"|")}`;case"too_big":{let s=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${o.verb} ${s}${i.maximum} ${o.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${i.maximum}`}case"too_small":{let s=i.inclusive?">=":">",o=e(i.origin);return o?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${o.verb} ${s}${i.minimum} ${o.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${i.minimum}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${s.prefix}"`:s.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${s.suffix}"`:s.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${s.includes}"`:s.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${s.pattern}`:`A\u1E63\xEC\u1E63e: ${r[s.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${B(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function roe(){return{localeError:mje()}}var noe,mF=Symbol("ZodOutput"),gF=Symbol("ZodInput"),Cw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Pw(){return new Cw}(noe=globalThis).__zod_globalRegistry??(noe.__zod_globalRegistry=Pw());var fr=globalThis.__zod_globalRegistry;function _F(t,e){return new t({type:"string",...ie(e)})}function yF(t,e){return new t({type:"string",coerce:!0,...ie(e)})}function Ow(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...ie(e)})}function _y(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...ie(e)})}function Nw(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(e)})}function kw(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(e)})}function Mw(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(e)})}function Dw(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(e)})}function yy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ie(e)})}function Lw(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(e)})}function $w(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(e)})}function Uw(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(e)})}function Fw(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(e)})}function Bw(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(e)})}function jw(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...ie(e)})}function zw(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(e)})}function Gw(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(e)})}function Vw(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(e)})}function SF(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...ie(e)})}function qw(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(e)})}function Hw(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(e)})}function Ww(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...ie(e)})}function Yw(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(e)})}function Kw(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...ie(e)})}function Zw(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(e)})}var EF={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function vF(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(e)})}function bF(t,e){return new t({type:"string",format:"date",check:"string_format",...ie(e)})}function TF(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...ie(e)})}function AF(t,e){return new t({type:"string",format:"duration",check:"string_format",...ie(e)})}function xF(t,e){return new t({type:"number",checks:[],...ie(e)})}function wF(t,e){return new t({type:"number",coerce:!0,checks:[],...ie(e)})}function RF(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(e)})}function IF(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...ie(e)})}function CF(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...ie(e)})}function PF(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...ie(e)})}function OF(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...ie(e)})}function NF(t,e){return new t({type:"boolean",...ie(e)})}function kF(t,e){return new t({type:"boolean",coerce:!0,...ie(e)})}function MF(t,e){return new t({type:"bigint",...ie(e)})}function DF(t,e){return new t({type:"bigint",coerce:!0,...ie(e)})}function LF(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ie(e)})}function $F(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ie(e)})}function UF(t,e){return new t({type:"symbol",...ie(e)})}function FF(t,e){return new t({type:"undefined",...ie(e)})}function BF(t,e){return new t({type:"null",...ie(e)})}function jF(t){return new t({type:"any"})}function zF(t){return new t({type:"unknown"})}function GF(t,e){return new t({type:"never",...ie(e)})}function VF(t,e){return new t({type:"void",...ie(e)})}function qF(t,e){return new t({type:"date",...ie(e)})}function HF(t,e){return new t({type:"date",coerce:!0,...ie(e)})}function WF(t,e){return new t({type:"nan",...ie(e)})}function gs(t,e){return new mw({check:"less_than",...ie(e),value:t,inclusive:!1})}function En(t,e){return new mw({check:"less_than",...ie(e),value:t,inclusive:!0})}function _s(t,e){return new gw({check:"greater_than",...ie(e),value:t,inclusive:!1})}function $r(t,e){return new gw({check:"greater_than",...ie(e),value:t,inclusive:!0})}function Jw(t){return _s(0,t)}function Xw(t){return gs(0,t)}function Qw(t){return En(0,t)}function eR(t){return $r(0,t)}function qa(t,e){return new B1({check:"multiple_of",...ie(e),value:t})}function Ha(t,e){return new G1({check:"max_size",...ie(e),maximum:t})}function ys(t,e){return new V1({check:"min_size",...ie(e),minimum:t})}function Gl(t,e){return new q1({check:"size_equals",...ie(e),size:t})}function Vl(t,e){return new H1({check:"max_length",...ie(e),maximum:t})}function Io(t,e){return new W1({check:"min_length",...ie(e),minimum:t})}function ql(t,e){return new Y1({check:"length_equals",...ie(e),length:t})}function ip(t,e){return new K1({check:"string_format",format:"regex",...ie(e),pattern:t})}function sp(t){return new Z1({check:"string_format",format:"lowercase",...ie(t)})}function op(t){return new J1({check:"string_format",format:"uppercase",...ie(t)})}function ap(t,e){return new X1({check:"string_format",format:"includes",...ie(e),includes:t})}function cp(t,e){return new Q1({check:"string_format",format:"starts_with",...ie(e),prefix:t})}function lp(t,e){return new eU({check:"string_format",format:"ends_with",...ie(e),suffix:t})}function tR(t,e,r){return new tU({check:"property",property:t,schema:e,...ie(r)})}function up(t,e){return new rU({check:"mime_type",mime:t,...ie(e)})}function Ii(t){return new nU({check:"overwrite",tx:t})}function dp(t){return Ii(e=>e.normalize(t))}function fp(){return Ii(t=>t.trim())}function pp(){return Ii(t=>t.toLowerCase())}function hp(){return Ii(t=>t.toUpperCase())}function mp(){return Ii(t=>Q$(t))}function YF(t,e,r){return new t({type:"array",element:e,...ie(r)})}function _je(t,e,r){return new t({type:"union",options:e,...ie(r)})}function yje(t,e,r){return new t({type:"union",options:e,inclusive:!1,...ie(r)})}function Sje(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...ie(n)})}function Eje(t,e,r){return new t({type:"intersection",left:e,right:r})}function vje(t,e,r,n){let i=r instanceof Oe,s=i?n:r,o=i?r:null;return new t({type:"tuple",items:e,rest:o,...ie(s)})}function bje(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...ie(n)})}function Tje(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...ie(n)})}function Aje(t,e,r){return new t({type:"set",valueType:e,...ie(r)})}function xje(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new t({type:"enum",entries:n,...ie(r)})}function wje(t,e,r){return new t({type:"enum",entries:e,...ie(r)})}function Rje(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...ie(r)})}function KF(t,e){return new t({type:"file",...ie(e)})}function Ije(t,e){return new t({type:"transform",transform:e})}function Cje(t,e){return new t({type:"optional",innerType:e})}function Pje(t,e){return new t({type:"nullable",innerType:e})}function Oje(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():t1(r)}})}function Nje(t,e,r){return new t({type:"nonoptional",innerType:e,...ie(r)})}function kje(t,e){return new t({type:"success",innerType:e})}function Mje(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function Dje(t,e,r){return new t({type:"pipe",in:e,out:r})}function Lje(t,e){return new t({type:"readonly",innerType:e})}function $je(t,e,r){return new t({type:"template_literal",parts:e,...ie(r)})}function Uje(t,e){return new t({type:"lazy",getter:e})}function Fje(t,e){return new t({type:"promise",innerType:e})}function ZF(t,e,r){let n=ie(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function JF(t,e,r){return new t({type:"custom",check:"custom",fn:e,...ie(r)})}function XF(t,e){let r=ioe(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(Jf(i,n.value,r._zod.def));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Jf(s))}},t(n.value,n)),e);return r}function ioe(t,e){let r=new ut({check:"custom",...ie(e)});return r._zod.check=t,r}function QF(t){let e=new ut({check:"describe"});return e._zod.onattach=[r=>{let n=fr.get(r)??{};fr.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function eB(t){let e=new ut({check:"meta"});return e._zod.onattach=[r=>{let n=fr.get(r)??{};fr.add(r,{...n,...t})}],e._zod.check=()=>{},e}function tB(t,e){let r=ie(e),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(p=>typeof p=="string"?p.toLowerCase():p),i=i.map(p=>typeof p=="string"?p.toLowerCase():p));let s=new Set(n),o=new Set(i),a=t.Codec??hy,c=t.Boolean??fy,l=t.String??zl,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new a({type:"pipe",in:u,out:d,transform:((p,h)=>{let m=p;return r.case!=="sensitive"&&(m=m.toLowerCase()),s.has(m)?!0:o.has(m)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...o],input:h.value,inst:f,continue:!1}),{})}),reverseTransform:((p,h)=>p===!0?n[0]||"true":i[0]||"false"),error:r.error});return f}function gp(t,e,r,n={}){let i=ie(n),s={...ie(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...i};return r instanceof RegExp&&(s.pattern=r),new t(s)}function Wa(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??fr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Xe(t,e,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,o);let a=t._zod.toJSONSchema?.();if(a)o.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,u);else{let f=o.schema,p=e.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(t,e,f,u)}let d=t._zod.parent;d&&(o.ref||(o.ref=d),Xe(d,e,u),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(o.schema,c),e.io==="input"&&Ur(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function Ya(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let o of t.seen.entries()){let a=t.metadataRegistry.get(o[0])?.id;if(a){let c=n.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,o[0])}}let i=o=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(o[0])?.id,f=t.external.uri??(h=>h);if(d)return{ref:f(d)};let p=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=p,{defId:p,ref:`${f("__shared")}#/${a}/${p}`}}if(o[1]===r)return{ref:"#"};let l=`#/${a}/`,u=o[1].schema.id??`__schema${t.counter++}`;return{defId:u,ref:l+u}},s=o=>{if(o[1].schema.$ref)return;let a=o[1],{ref:c,defId:l}=i(o);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(t.cycles==="throw")for(let o of t.seen.entries()){let a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
208
208
|
|
|
209
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let a=o[1];if(e===o[0]){s(o);continue}if(t.external){let l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){s(o);continue}}if(t.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&t.reused==="ref"){s(o);continue}}}function Ka(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),h=p.schema;if(h.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,u),a._zod.parent===d)for(let E in l)E==="$ref"||E==="allOf"||E in u||delete l[E];if(h.$ref&&p.def)for(let E in l)E==="$ref"||E==="allOf"||E in p.def&&JSON.stringify(l[E])===JSON.stringify(p.def[E])&&delete l[E]}let f=a._zod.parent;if(f&&f!==d){n(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let h in l)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(l[h])===JSON.stringify(p.def[h])&&delete l[h]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(a)}Object.assign(i,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&i.id===s&&delete i.id;let o=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:_p(e,"input",t.processors),output:_p(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ur(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ur(n.element,r);if(n.type==="set")return Ur(n.valueType,r);if(n.type==="lazy")return Ur(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ur(n.innerType,r);if(n.type==="intersection")return Ur(n.left,r)||Ur(n.right,r);if(n.type==="record"||n.type==="map")return Ur(n.keyType,r)||Ur(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ur(n.in,r)||Ur(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Ur(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Ur(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Ur(i,r))return!0;return!!(n.rest&&Ur(n.rest,r))}return!1}var rB=(t,e={})=>r=>{let n=Wa({...r,processors:e});return Xe(t,n),Ya(n,t),Ka(n,t)},_p=(t,e,r={})=>n=>{let{libraryOptions:i,target:s}=n??{},o=Wa({...i??{},target:s,io:e,processors:r});return Xe(t,o),Ya(o,t),Ka(o,t)};var Bje={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nB=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:s,maximum:o,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),a&&(i.format=Bje[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},iB=(t,e,r,n)=>{let i=r,{minimum:s,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(o??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},sB=(t,e,r,n)=>{r.type="boolean"},oB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},aB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},cB=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},lB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},uB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},dB=(t,e,r,n)=>{r.not={}},fB=(t,e,r,n)=>{},pB=(t,e,r,n)=>{},hB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},mB=(t,e,r,n)=>{let i=t._zod.def,s=ty(i.entries);s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),r.enum=s},gB=(t,e,r,n)=>{let i=t._zod.def,s=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){let o=s[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),s.every(o=>typeof o=="boolean")&&(r.type="boolean"),s.every(o=>o===null)&&(r.type="null"),r.enum=s},_B=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},yB=(t,e,r,n)=>{let i=r,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=s.source},SB=(t,e,r,n)=>{let i=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:c}=t._zod.bag;o!==void 0&&(s.minLength=o),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(i,s)):(Object.assign(i,s),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,s)},EB=(t,e,r,n)=>{r.type="boolean"},vB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},TB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},AB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},xB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},wB=(t,e,r,n)=>{let i=r,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Xe(s.element,e,{...n,path:[...n.path,"items"]})},RB=(t,e,r,n)=>{let i=r,s=t._zod.def;i.type="object",i.properties={};let o=s.shape;for(let l in o)i.properties[l]=Xe(o[l],e,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{let u=s.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Xe(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},nR=(t,e,r,n)=>{let i=t._zod.def,s=i.inclusive===!1,o=i.options.map((a,c)=>Xe(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=o:r.anyOf=o},IB=(t,e,r,n)=>{let i=t._zod.def,s=Xe(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=Xe(i.right,e,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];r.allOf=c},CB=(t,e,r,n)=>{let i=r,s=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((f,p)=>Xe(f,e,{...n,path:[...n.path,o,p]})),l=s.rest?Xe(s.rest,e,{...n,path:[...n.path,a,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},PB=(t,e,r,n)=>{let i=r,s=t._zod.def;i.type="object";let o=s.keyType,c=o._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let u=Xe(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Xe(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Xe(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=o._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},OB=(t,e,r,n)=>{let i=t._zod.def,s=Xe(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},NB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType},kB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},MB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},DB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},LB=(t,e,r,n)=>{let i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?i.out:i.in:i.out;Xe(o,e,n);let a=e.seen.get(t);a.ref=o},$B=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},UB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType},iR=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType},FB=(t,e,r,n)=>{let i=t._zod.innerType;Xe(i,e,n);let s=e.seen.get(t);s.ref=i},rR={string:nB,number:iB,boolean:sB,bigint:oB,symbol:aB,null:cB,undefined:lB,void:uB,never:dB,any:fB,unknown:pB,date:hB,enum:mB,literal:gB,nan:_B,template_literal:yB,file:SB,success:EB,custom:vB,function:bB,transform:TB,map:AB,set:xB,array:wB,object:RB,union:nR,intersection:IB,tuple:CB,record:PB,nullable:OB,nonoptional:NB,default:kB,prefault:MB,catch:DB,pipe:LB,readonly:$B,promise:UB,optional:iR,lazy:FB};function sR(t,e){if("_idmap"in t){let n=t,i=Wa({...e,processors:rR}),s={};for(let c of n._idmap.entries()){let[l,u]=c;Xe(u,i)}let o={},a={registry:n,uri:e?.uri,defs:s};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;Ya(i,u),o[l]=Ka(i,u)}if(Object.keys(s).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:s}}return{schemas:o}}let r=Wa({...e,processors:rR});return Xe(t,r),Ya(r,t),Ka(r,t)}var oR=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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Wa({processors:rR,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Xe(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Ya(this.ctx,e);let n=Ka(this.ctx,e),{"~standard":i,...s}=n;return s}};var soe={};var Sy={};ir(Sy,{ZodAny:()=>lj,ZodArray:()=>pj,ZodBase64:()=>RR,ZodBase64URL:()=>IR,ZodBigInt:()=>xp,ZodBigIntFormat:()=>OR,ZodBoolean:()=>Ap,ZodCIDRv4:()=>xR,ZodCIDRv6:()=>wR,ZodCUID:()=>yR,ZodCUID2:()=>SR,ZodCatch:()=>Dj,ZodCodec:()=>Oy,ZodCustom:()=>Ny,ZodCustomStringFormat:()=>bp,ZodDate:()=>wy,ZodDefault:()=>Cj,ZodDiscriminatedUnion:()=>mj,ZodE164:()=>CR,ZodEmail:()=>mR,ZodEmoji:()=>gR,ZodEnum:()=>Ep,ZodExactOptional:()=>wj,ZodFile:()=>Aj,ZodFunction:()=>qj,ZodGUID:()=>vy,ZodIPv4:()=>TR,ZodIPv6:()=>AR,ZodIntersection:()=>gj,ZodJWT:()=>PR,ZodKSUID:()=>bR,ZodLazy:()=>zj,ZodLiteral:()=>Tj,ZodMAC:()=>rj,ZodMap:()=>vj,ZodNaN:()=>$j,ZodNanoID:()=>_R,ZodNever:()=>dj,ZodNonOptional:()=>$R,ZodNull:()=>aj,ZodNullable:()=>Ij,ZodNumber:()=>Tp,ZodNumberFormat:()=>Wl,ZodObject:()=>Iy,ZodOptional:()=>LR,ZodPipe:()=>Py,ZodPrefault:()=>Oj,ZodPreprocess:()=>Uj,ZodPromise:()=>Vj,ZodReadonly:()=>Fj,ZodRecord:()=>Sp,ZodSet:()=>bj,ZodString:()=>vp,ZodStringFormat:()=>st,ZodSuccess:()=>Mj,ZodSymbol:()=>sj,ZodTemplateLiteral:()=>jj,ZodTransform:()=>xj,ZodTuple:()=>yj,ZodType:()=>Le,ZodULID:()=>ER,ZodURL:()=>xy,ZodUUID:()=>Ss,ZodUndefined:()=>oj,ZodUnion:()=>Cy,ZodUnknown:()=>uj,ZodVoid:()=>fj,ZodXID:()=>vR,ZodXor:()=>hj,_ZodString:()=>hR,_default:()=>Pj,_function:()=>hae,any:()=>qoe,array:()=>Ry,base64:()=>Ioe,base64url:()=>Coe,bigint:()=>Boe,boolean:()=>ij,catch:()=>Lj,check:()=>mae,cidrv4:()=>woe,cidrv6:()=>Roe,codec:()=>uae,cuid:()=>yoe,cuid2:()=>Soe,custom:()=>gae,date:()=>Woe,describe:()=>_ae,discriminatedUnion:()=>Qoe,e164:()=>Poe,email:()=>coe,emoji:()=>goe,enum:()=>MR,exactOptional:()=>Rj,file:()=>oae,float32:()=>Loe,float64:()=>$oe,function:()=>hae,guid:()=>loe,hash:()=>Doe,hex:()=>Moe,hostname:()=>koe,httpUrl:()=>moe,instanceof:()=>Sae,int:()=>fR,int32:()=>Uoe,int64:()=>joe,intersection:()=>_j,invertCodec:()=>dae,ipv4:()=>Toe,ipv6:()=>xoe,json:()=>vae,jwt:()=>Ooe,keyof:()=>Yoe,ksuid:()=>boe,lazy:()=>Gj,literal:()=>sae,looseObject:()=>Joe,looseRecord:()=>tae,mac:()=>Aoe,map:()=>rae,meta:()=>yae,nan:()=>lae,nanoid:()=>_oe,nativeEnum:()=>iae,never:()=>NR,nonoptional:()=>kj,null:()=>cj,nullable:()=>Ty,nullish:()=>aae,number:()=>nj,object:()=>Koe,optional:()=>by,partialRecord:()=>eae,pipe:()=>pR,prefault:()=>Nj,preprocess:()=>bae,promise:()=>pae,readonly:()=>Bj,record:()=>Ej,refine:()=>Hj,set:()=>nae,strictObject:()=>Zoe,string:()=>Ey,stringFormat:()=>Noe,stringbool:()=>Eae,success:()=>cae,superRefine:()=>Wj,symbol:()=>Goe,templateLiteral:()=>fae,transform:()=>DR,tuple:()=>Sj,uint32:()=>Foe,uint64:()=>zoe,ulid:()=>Eoe,undefined:()=>Voe,union:()=>kR,unknown:()=>Hl,url:()=>hoe,uuid:()=>uoe,uuidv4:()=>doe,uuidv6:()=>foe,uuidv7:()=>poe,void:()=>Hoe,xid:()=>voe,xor:()=>Xoe});var aR={};ir(aR,{endsWith:()=>lp,gt:()=>_s,gte:()=>$r,includes:()=>ap,length:()=>ql,lowercase:()=>sp,lt:()=>gs,lte:()=>En,maxLength:()=>Vl,maxSize:()=>Ha,mime:()=>up,minLength:()=>Io,minSize:()=>ys,multipleOf:()=>qa,negative:()=>Xw,nonnegative:()=>eR,nonpositive:()=>Qw,normalize:()=>dp,overwrite:()=>Ii,positive:()=>Jw,property:()=>tR,regex:()=>ip,size:()=>Gl,slugify:()=>mp,startsWith:()=>cp,toLowerCase:()=>pp,toUpperCase:()=>hp,trim:()=>fp,uppercase:()=>op});var yp={};ir(yp,{ZodISODate:()=>lR,ZodISODateTime:()=>cR,ZodISODuration:()=>dR,ZodISOTime:()=>uR,date:()=>jB,datetime:()=>BB,duration:()=>GB,time:()=>zB});var cR=N("ZodISODateTime",(t,e)=>{_U.init(t,e),st.init(t,e)});function BB(t){return vF(cR,t)}var lR=N("ZodISODate",(t,e)=>{yU.init(t,e),st.init(t,e)});function jB(t){return bF(lR,t)}var uR=N("ZodISOTime",(t,e)=>{SU.init(t,e),st.init(t,e)});function zB(t){return TF(uR,t)}var dR=N("ZodISODuration",(t,e)=>{EU.init(t,e),st.init(t,e)});function GB(t){return AF(dR,t)}var ooe=(t,e)=>{oy.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>cy(t,r)},flatten:{value:r=>ay(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Kf,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Kf,2)}},isEmpty:{get(){return t.issues.length===0}}})},zje=N("ZodError",ooe),en=N("ZodError",ooe,{Parent:Error});var VB=Xf(en),qB=Qf(en),HB=ep(en),WB=tp(en),YB=sw(en),KB=ow(en),ZB=aw(en),JB=cw(en),XB=lw(en),QB=uw(en),ej=dw(en),tj=fw(en);var aoe=new WeakMap;function Ay(t,e,r){let n=Object.getPrototypeOf(t),i=aoe.get(n);if(i||(i=new Set,aoe.set(n,i)),!i.has(e)){i.add(e);for(let s in r){let o=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let a=o.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var Le=N("ZodType",(t,e)=>(Oe.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:_p(t,"input"),output:_p(t,"output")}}),t.toJSONSchema=rB(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>VB(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>HB(t,r,n),t.parseAsync=async(r,n)=>qB(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>WB(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>YB(t,r,n),t.decode=(r,n)=>KB(t,r,n),t.encodeAsync=async(r,n)=>ZB(t,r,n),t.decodeAsync=async(r,n)=>JB(t,r,n),t.safeEncode=(r,n)=>XB(t,r,n),t.safeDecode=(r,n)=>QB(t,r,n),t.safeEncodeAsync=async(r,n)=>ej(t,r,n),t.safeDecodeAsync=async(r,n)=>tj(t,r,n),Ay(t,"ZodType",{check(...r){let n=this.def;return this.clone(re.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Dr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Hj(r,n))},superRefine(r,n){return this.check(Wj(r,n))},overwrite(r){return this.check(Ii(r))},optional(){return by(this)},exactOptional(){return Rj(this)},nullable(){return Ty(this)},nullish(){return by(Ty(this))},nonoptional(r){return kj(this,r)},array(){return Ry(this)},or(r){return kR([this,r])},and(r){return _j(this,r)},transform(r){return pR(this,DR(r))},default(r){return Pj(this,r)},prefault(r){return Nj(this,r)},catch(r){return Lj(this,r)},pipe(r){return pR(this,r)},readonly(){return Bj(this)},describe(r){let n=this.clone();return fr.add(n,{description:r}),n},meta(...r){if(r.length===0)return fr.get(this);let n=this.clone();return fr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return fr.get(t)?.description},configurable:!0}),t)),hR=N("_ZodString",(t,e)=>{zl.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>nB(t,n,i,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Ay(t,"_ZodString",{regex(...n){return this.check(ip(...n))},includes(...n){return this.check(ap(...n))},startsWith(...n){return this.check(cp(...n))},endsWith(...n){return this.check(lp(...n))},min(...n){return this.check(Io(...n))},max(...n){return this.check(Vl(...n))},length(...n){return this.check(ql(...n))},nonempty(...n){return this.check(Io(1,...n))},lowercase(n){return this.check(sp(n))},uppercase(n){return this.check(op(n))},trim(){return this.check(fp())},normalize(...n){return this.check(dp(...n))},toLowerCase(){return this.check(pp())},toUpperCase(){return this.check(hp())},slugify(){return this.check(mp())}})}),vp=N("ZodString",(t,e)=>{zl.init(t,e),hR.init(t,e),t.email=r=>t.check(Ow(mR,r)),t.url=r=>t.check(yy(xy,r)),t.jwt=r=>t.check(Zw(PR,r)),t.emoji=r=>t.check(Lw(gR,r)),t.guid=r=>t.check(_y(vy,r)),t.uuid=r=>t.check(Nw(Ss,r)),t.uuidv4=r=>t.check(kw(Ss,r)),t.uuidv6=r=>t.check(Mw(Ss,r)),t.uuidv7=r=>t.check(Dw(Ss,r)),t.nanoid=r=>t.check($w(_R,r)),t.guid=r=>t.check(_y(vy,r)),t.cuid=r=>t.check(Uw(yR,r)),t.cuid2=r=>t.check(Fw(SR,r)),t.ulid=r=>t.check(Bw(ER,r)),t.base64=r=>t.check(Ww(RR,r)),t.base64url=r=>t.check(Yw(IR,r)),t.xid=r=>t.check(jw(vR,r)),t.ksuid=r=>t.check(zw(bR,r)),t.ipv4=r=>t.check(Gw(TR,r)),t.ipv6=r=>t.check(Vw(AR,r)),t.cidrv4=r=>t.check(qw(xR,r)),t.cidrv6=r=>t.check(Hw(wR,r)),t.e164=r=>t.check(Kw(CR,r)),t.datetime=r=>t.check(BB(r)),t.date=r=>t.check(jB(r)),t.time=r=>t.check(zB(r)),t.duration=r=>t.check(GB(r))});function Ey(t){return _F(vp,t)}var st=N("ZodStringFormat",(t,e)=>{it.init(t,e),hR.init(t,e)}),mR=N("ZodEmail",(t,e)=>{cU.init(t,e),st.init(t,e)});function coe(t){return Ow(mR,t)}var vy=N("ZodGUID",(t,e)=>{oU.init(t,e),st.init(t,e)});function loe(t){return _y(vy,t)}var Ss=N("ZodUUID",(t,e)=>{aU.init(t,e),st.init(t,e)});function uoe(t){return Nw(Ss,t)}function doe(t){return kw(Ss,t)}function foe(t){return Mw(Ss,t)}function poe(t){return Dw(Ss,t)}var xy=N("ZodURL",(t,e)=>{lU.init(t,e),st.init(t,e)});function hoe(t){return yy(xy,t)}function moe(t){return yy(xy,{protocol:Sn.httpProtocol,hostname:Sn.domain,...re.normalizeParams(t)})}var gR=N("ZodEmoji",(t,e)=>{uU.init(t,e),st.init(t,e)});function goe(t){return Lw(gR,t)}var _R=N("ZodNanoID",(t,e)=>{dU.init(t,e),st.init(t,e)});function _oe(t){return $w(_R,t)}var yR=N("ZodCUID",(t,e)=>{fU.init(t,e),st.init(t,e)});function yoe(t){return Uw(yR,t)}var SR=N("ZodCUID2",(t,e)=>{pU.init(t,e),st.init(t,e)});function Soe(t){return Fw(SR,t)}var ER=N("ZodULID",(t,e)=>{hU.init(t,e),st.init(t,e)});function Eoe(t){return Bw(ER,t)}var vR=N("ZodXID",(t,e)=>{mU.init(t,e),st.init(t,e)});function voe(t){return jw(vR,t)}var bR=N("ZodKSUID",(t,e)=>{gU.init(t,e),st.init(t,e)});function boe(t){return zw(bR,t)}var TR=N("ZodIPv4",(t,e)=>{vU.init(t,e),st.init(t,e)});function Toe(t){return Gw(TR,t)}var rj=N("ZodMAC",(t,e)=>{TU.init(t,e),st.init(t,e)});function Aoe(t){return SF(rj,t)}var AR=N("ZodIPv6",(t,e)=>{bU.init(t,e),st.init(t,e)});function xoe(t){return Vw(AR,t)}var xR=N("ZodCIDRv4",(t,e)=>{AU.init(t,e),st.init(t,e)});function woe(t){return qw(xR,t)}var wR=N("ZodCIDRv6",(t,e)=>{xU.init(t,e),st.init(t,e)});function Roe(t){return Hw(wR,t)}var RR=N("ZodBase64",(t,e)=>{RU.init(t,e),st.init(t,e)});function Ioe(t){return Ww(RR,t)}var IR=N("ZodBase64URL",(t,e)=>{IU.init(t,e),st.init(t,e)});function Coe(t){return Yw(IR,t)}var CR=N("ZodE164",(t,e)=>{CU.init(t,e),st.init(t,e)});function Poe(t){return Kw(CR,t)}var PR=N("ZodJWT",(t,e)=>{PU.init(t,e),st.init(t,e)});function Ooe(t){return Zw(PR,t)}var bp=N("ZodCustomStringFormat",(t,e)=>{OU.init(t,e),st.init(t,e)});function Noe(t,e,r={}){return gp(bp,t,e,r)}function koe(t){return gp(bp,"hostname",Sn.hostname,t)}function Moe(t){return gp(bp,"hex",Sn.hex,t)}function Doe(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Sn[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return gp(bp,n,i,e)}var Tp=N("ZodNumber",(t,e)=>{vw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>iB(t,n,i,s),Ay(t,"ZodNumber",{gt(n,i){return this.check(_s(n,i))},gte(n,i){return this.check($r(n,i))},min(n,i){return this.check($r(n,i))},lt(n,i){return this.check(gs(n,i))},lte(n,i){return this.check(En(n,i))},max(n,i){return this.check(En(n,i))},int(n){return this.check(fR(n))},safe(n){return this.check(fR(n))},positive(n){return this.check(_s(0,n))},nonnegative(n){return this.check($r(0,n))},negative(n){return this.check(gs(0,n))},nonpositive(n){return this.check(En(0,n))},multipleOf(n,i){return this.check(qa(n,i))},step(n,i){return this.check(qa(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function nj(t){return xF(Tp,t)}var Wl=N("ZodNumberFormat",(t,e)=>{NU.init(t,e),Tp.init(t,e)});function fR(t){return RF(Wl,t)}function Loe(t){return IF(Wl,t)}function $oe(t){return CF(Wl,t)}function Uoe(t){return PF(Wl,t)}function Foe(t){return OF(Wl,t)}var Ap=N("ZodBoolean",(t,e)=>{fy.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sB(t,r,n,i)});function ij(t){return NF(Ap,t)}var xp=N("ZodBigInt",(t,e)=>{bw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>oB(t,n,i,s),t.gte=(n,i)=>t.check($r(n,i)),t.min=(n,i)=>t.check($r(n,i)),t.gt=(n,i)=>t.check(_s(n,i)),t.gte=(n,i)=>t.check($r(n,i)),t.min=(n,i)=>t.check($r(n,i)),t.lt=(n,i)=>t.check(gs(n,i)),t.lte=(n,i)=>t.check(En(n,i)),t.max=(n,i)=>t.check(En(n,i)),t.positive=n=>t.check(_s(BigInt(0),n)),t.negative=n=>t.check(gs(BigInt(0),n)),t.nonpositive=n=>t.check(En(BigInt(0),n)),t.nonnegative=n=>t.check($r(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(qa(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Boe(t){return MF(xp,t)}var OR=N("ZodBigIntFormat",(t,e)=>{kU.init(t,e),xp.init(t,e)});function joe(t){return LF(OR,t)}function zoe(t){return $F(OR,t)}var sj=N("ZodSymbol",(t,e)=>{MU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aB(t,r,n,i)});function Goe(t){return UF(sj,t)}var oj=N("ZodUndefined",(t,e)=>{DU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lB(t,r,n,i)});function Voe(t){return FF(oj,t)}var aj=N("ZodNull",(t,e)=>{LU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cB(t,r,n,i)});function cj(t){return BF(aj,t)}var lj=N("ZodAny",(t,e)=>{$U.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fB(t,r,n,i)});function qoe(){return jF(lj)}var uj=N("ZodUnknown",(t,e)=>{UU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pB(t,r,n,i)});function Hl(){return zF(uj)}var dj=N("ZodNever",(t,e)=>{FU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dB(t,r,n,i)});function NR(t){return GF(dj,t)}var fj=N("ZodVoid",(t,e)=>{BU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uB(t,r,n,i)});function Hoe(t){return VF(fj,t)}var wy=N("ZodDate",(t,e)=>{jU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>hB(t,n,i,s),t.min=(n,i)=>t.check($r(n,i)),t.max=(n,i)=>t.check(En(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function Woe(t){return qF(wy,t)}var pj=N("ZodArray",(t,e)=>{zU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wB(t,r,n,i),t.element=e.element,Ay(t,"ZodArray",{min(r,n){return this.check(Io(r,n))},nonempty(r){return this.check(Io(1,r))},max(r,n){return this.check(Vl(r,n))},length(r,n){return this.check(ql(r,n))},unwrap(){return this.element}})});function Ry(t,e){return YF(pj,t,e)}function Yoe(t){let e=t._zod.def.shape;return MR(Object.keys(e))}var Iy=N("ZodObject",(t,e)=>{GU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RB(t,r,n,i),re.defineLazy(t,"shape",()=>e.shape),Ay(t,"ZodObject",{keyof(){return MR(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Hl()})},loose(){return this.clone({...this._zod.def,catchall:Hl()})},strict(){return this.clone({...this._zod.def,catchall:NR()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return re.extend(this,r)},safeExtend(r){return re.safeExtend(this,r)},merge(r){return re.merge(this,r)},pick(r){return re.pick(this,r)},omit(r){return re.omit(this,r)},partial(...r){return re.partial(LR,this,r[0])},required(...r){return re.required($R,this,r[0])}})});function Koe(t,e){let r={type:"object",shape:t??{},...re.normalizeParams(e)};return new Iy(r)}function Zoe(t,e){return new Iy({type:"object",shape:t,catchall:NR(),...re.normalizeParams(e)})}function Joe(t,e){return new Iy({type:"object",shape:t,catchall:Hl(),...re.normalizeParams(e)})}var Cy=N("ZodUnion",(t,e)=>{py.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nR(t,r,n,i),t.options=e.options});function kR(t,e){return new Cy({type:"union",options:t,...re.normalizeParams(e)})}var hj=N("ZodXor",(t,e)=>{Cy.init(t,e),VU.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nR(t,r,n,i),t.options=e.options});function Xoe(t,e){return new hj({type:"union",options:t,inclusive:!1,...re.normalizeParams(e)})}var mj=N("ZodDiscriminatedUnion",(t,e)=>{Cy.init(t,e),qU.init(t,e)});function Qoe(t,e,r){return new mj({type:"union",options:e,discriminator:t,...re.normalizeParams(r)})}var gj=N("ZodIntersection",(t,e)=>{HU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>IB(t,r,n,i)});function _j(t,e){return new gj({type:"intersection",left:t,right:e})}var yj=N("ZodTuple",(t,e)=>{Tw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CB(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Sj(t,e,r){let n=e instanceof Oe,i=n?r:e,s=n?e:null;return new yj({type:"tuple",items:t,rest:s,...re.normalizeParams(i)})}var Sp=N("ZodRecord",(t,e)=>{WU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PB(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function Ej(t,e,r){return!e||!e._zod?new Sp({type:"record",keyType:Ey(),valueType:t,...re.normalizeParams(e)}):new Sp({type:"record",keyType:t,valueType:e,...re.normalizeParams(r)})}function eae(t,e,r){let n=Dr(t);return n._zod.values=void 0,new Sp({type:"record",keyType:n,valueType:e,...re.normalizeParams(r)})}function tae(t,e,r){return new Sp({type:"record",keyType:t,valueType:e,mode:"loose",...re.normalizeParams(r)})}var vj=N("ZodMap",(t,e)=>{YU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AB(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(ys(...r)),t.nonempty=r=>t.check(ys(1,r)),t.max=(...r)=>t.check(Ha(...r)),t.size=(...r)=>t.check(Gl(...r))});function rae(t,e,r){return new vj({type:"map",keyType:t,valueType:e,...re.normalizeParams(r)})}var bj=N("ZodSet",(t,e)=>{KU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xB(t,r,n,i),t.min=(...r)=>t.check(ys(...r)),t.nonempty=r=>t.check(ys(1,r)),t.max=(...r)=>t.check(Ha(...r)),t.size=(...r)=>t.check(Gl(...r))});function nae(t,e){return new bj({type:"set",valueType:t,...re.normalizeParams(e)})}var Ep=N("ZodEnum",(t,e)=>{ZU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>mB(t,n,i,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let s={};for(let o of n)if(r.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Ep({...e,checks:[],...re.normalizeParams(i),entries:s})},t.exclude=(n,i)=>{let s={...e.entries};for(let o of n)if(r.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new Ep({...e,checks:[],...re.normalizeParams(i),entries:s})}});function MR(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Ep({type:"enum",entries:r,...re.normalizeParams(e)})}function iae(t,e){return new Ep({type:"enum",entries:t,...re.normalizeParams(e)})}var Tj=N("ZodLiteral",(t,e)=>{JU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gB(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function sae(t,e){return new Tj({type:"literal",values:Array.isArray(t)?t:[t],...re.normalizeParams(e)})}var Aj=N("ZodFile",(t,e)=>{XU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SB(t,r,n,i),t.min=(r,n)=>t.check(ys(r,n)),t.max=(r,n)=>t.check(Ha(r,n)),t.mime=(r,n)=>t.check(up(Array.isArray(r)?r:[r],n))});function oae(t){return KF(Aj,t)}var xj=N("ZodTransform",(t,e)=>{QU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TB(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ba(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(re.issue(s,r.value,e));else{let o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(re.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function DR(t){return new xj({type:"transform",transform:t})}var LR=N("ZodOptional",(t,e)=>{Aw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iR(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function by(t){return new LR({type:"optional",innerType:t})}var wj=N("ZodExactOptional",(t,e)=>{eF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iR(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Rj(t){return new wj({type:"optional",innerType:t})}var Ij=N("ZodNullable",(t,e)=>{tF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Ty(t){return new Ij({type:"nullable",innerType:t})}function aae(t){return by(Ty(t))}var Cj=N("ZodDefault",(t,e)=>{rF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Pj(t,e){return new Cj({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():re.shallowClone(e)}})}var Oj=N("ZodPrefault",(t,e)=>{nF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Nj(t,e){return new Oj({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():re.shallowClone(e)}})}var $R=N("ZodNonOptional",(t,e)=>{iF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>NB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function kj(t,e){return new $R({type:"nonoptional",innerType:t,...re.normalizeParams(e)})}var Mj=N("ZodSuccess",(t,e)=>{sF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function cae(t){return new Mj({type:"success",innerType:t})}var Dj=N("ZodCatch",(t,e)=>{oF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Lj(t,e){return new Dj({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var $j=N("ZodNaN",(t,e)=>{aF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_B(t,r,n,i)});function lae(t){return WF($j,t)}var Py=N("ZodPipe",(t,e)=>{xw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>LB(t,r,n,i),t.in=e.in,t.out=e.out});function pR(t,e){return new Py({type:"pipe",in:t,out:e})}var Oy=N("ZodCodec",(t,e)=>{Py.init(t,e),hy.init(t,e)});function uae(t,e,r){return new Oy({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function dae(t){let e=t._zod.def;return new Oy({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var Uj=N("ZodPreprocess",(t,e)=>{Py.init(t,e),cF.init(t,e)}),Fj=N("ZodReadonly",(t,e)=>{lF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$B(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Bj(t){return new Fj({type:"readonly",innerType:t})}var jj=N("ZodTemplateLiteral",(t,e)=>{uF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yB(t,r,n,i)});function fae(t,e){return new jj({type:"template_literal",parts:t,...re.normalizeParams(e)})}var zj=N("ZodLazy",(t,e)=>{pF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FB(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function Gj(t){return new zj({type:"lazy",getter:t})}var Vj=N("ZodPromise",(t,e)=>{fF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>UB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function pae(t){return new Vj({type:"promise",innerType:t})}var qj=N("ZodFunction",(t,e)=>{dF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bB(t,r,n,i)});function hae(t){return new qj({type:"function",input:Array.isArray(t?.input)?Sj(t?.input):t?.input??Ry(Hl()),output:t?.output??Hl()})}var Ny=N("ZodCustom",(t,e)=>{hF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vB(t,r,n,i)});function mae(t){let e=new ut({check:"custom"});return e._zod.check=t,e}function gae(t,e){return ZF(Ny,t??(()=>!0),e)}function Hj(t,e={}){return JF(Ny,t,e)}function Wj(t,e){return XF(t,e)}var _ae=QF,yae=eB;function Sae(t,e={}){let r=new Ny({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...re.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Eae=(...t)=>tB({Codec:Oy,Boolean:Ap,String:vp},...t);function vae(t){let e=Gj(()=>kR([Ey(t),nj(),ij(),cj(),Ry(e),Ej(Ey(),e)]));return e}function bae(t,e){return new Uj({type:"pipe",in:DR(t),out:e})}var Vje={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"};function qje(t){xt({customError:t})}function Hje(){return xt().customError}var Yj;Yj||(Yj={});var pe={...Sy,...aR,iso:yp},Wje=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"]);function Yje(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function Kje(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function Tae(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return pe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return pe.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let s=Kje(i,e),o=_r(s,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return pe.null();if(i.length===0)return pe.never();if(i.length===1)return pe.literal(i[0]);if(i.every(o=>typeof o=="string"))return pe.enum(i);let s=i.map(o=>pe.literal(o));return s.length<2?s[0]:pe.union([s[0],s[1],...s.slice(2)])}if(t.const!==void 0)return pe.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(s=>{let o={...t,type:s};return Tae(o,e)});return i.length===0?pe.never():i.length===1?i[0]:pe.union(i)}if(!r)return pe.any();let n;switch(r){case"string":{let i=pe.string();if(t.format){let s=t.format;s==="email"?i=i.check(pe.email()):s==="uri"||s==="uri-reference"?i=i.check(pe.url()):s==="uuid"||s==="guid"?i=i.check(pe.uuid()):s==="date-time"?i=i.check(pe.iso.datetime()):s==="date"?i=i.check(pe.iso.date()):s==="time"?i=i.check(pe.iso.time()):s==="duration"?i=i.check(pe.iso.duration()):s==="ipv4"?i=i.check(pe.ipv4()):s==="ipv6"?i=i.check(pe.ipv6()):s==="mac"?i=i.check(pe.mac()):s==="cidr"?i=i.check(pe.cidrv4()):s==="cidr-v6"?i=i.check(pe.cidrv6()):s==="base64"?i=i.check(pe.base64()):s==="base64url"?i=i.check(pe.base64url()):s==="e164"?i=i.check(pe.e164()):s==="jwt"?i=i.check(pe.jwt()):s==="emoji"?i=i.check(pe.emoji()):s==="nanoid"?i=i.check(pe.nanoid()):s==="cuid"?i=i.check(pe.cuid()):s==="cuid2"?i=i.check(pe.cuid2()):s==="ulid"?i=i.check(pe.ulid()):s==="xid"?i=i.check(pe.xid()):s==="ksuid"&&(i=i.check(pe.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?pe.number().int():pe.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=pe.boolean();break}case"null":{n=pe.null();break}case"object":{let i={},s=t.properties||{},o=new Set(t.required||[]);for(let[c,l]of Object.entries(s)){let u=_r(l,e);i[c]=o.has(c)?u:u.optional()}if(t.propertyNames){let c=_r(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?_r(t.additionalProperties,e):pe.any();if(Object.keys(i).length===0){n=pe.record(c,l);break}let u=pe.object(i).passthrough(),d=pe.looseRecord(c,l);n=pe.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=_r(c[f],e),h=pe.string().regex(new RegExp(f));u.push(pe.looseRecord(h,p))}let d=[];if(Object.keys(i).length>0&&d.push(pe.object(i).passthrough()),d.push(...u),d.length===0)n=pe.object({}).passthrough();else if(d.length===1)n=d[0];else{let f=pe.intersection(d[0],d[1]);for(let p=2;p<d.length;p++)f=pe.intersection(f,d[p]);n=f}break}let a=pe.object(i);t.additionalProperties===!1?n=a.strict():typeof t.additionalProperties=="object"?n=a.catchall(_r(t.additionalProperties,e)):n=a.passthrough();break}case"array":{let i=t.prefixItems,s=t.items;if(i&&Array.isArray(i)){let o=i.map(c=>_r(c,e)),a=s&&typeof s=="object"&&!Array.isArray(s)?_r(s,e):void 0;a?n=pe.tuple(o).rest(a):n=pe.tuple(o),typeof t.minItems=="number"&&(n=n.check(pe.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(pe.maxLength(t.maxItems)))}else if(Array.isArray(s)){let o=s.map(c=>_r(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?_r(t.additionalItems,e):void 0;a?n=pe.tuple(o).rest(a):n=pe.tuple(o),typeof t.minItems=="number"&&(n=n.check(pe.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(pe.maxLength(t.maxItems)))}else if(s!==void 0){let o=_r(s,e),a=pe.array(o);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),n=a}else n=pe.array(pe.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function _r(t,e){if(typeof t=="boolean")return t?pe.any():pe.never();let r=Tae(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>_r(l,e)),c=pe.union(a);r=n?pe.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>_r(l,e)),c=pe.xor(a);r=n?pe.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:pe.any();else{let a=n?r:_r(t.allOf[0],e),c=n?0:1;for(let l=c;l<t.allOf.length;l++)a=pe.intersection(a,_r(t.allOf[l],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=pe.nullable(r)),t.readOnly===!0&&(r=pe.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let i={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of s)a in t&&(i[a]=t[a]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let a of o)a in t&&(i[a]=t[a]);for(let a of Object.keys(t))Wje.has(a)||(i[a]=t[a]);return Object.keys(i).length>0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function Aae(t,e){if(typeof t=="boolean")return t?pe.any():pe.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=Yje(r,e?.defaultTarget),i=r.$defs||r.definitions||{},s={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??fr};return _r(r,s)}var Kj={};ir(Kj,{bigint:()=>Qje,boolean:()=>Xje,date:()=>e2e,number:()=>Jje,string:()=>Zje});function Zje(t){return yF(vp,t)}function Jje(t){return wF(Tp,t)}function Xje(t){return kF(Ap,t)}function Qje(t){return DF(xp,t)}function e2e(t){return HF(wy,t)}xt(ww());var t2e={questions:vn.array(vn.object({question:vn.string(),header:vn.string().optional().describe('Very short topic label rendered as a tag above the question, max ~12 characters (e.g. "Framework")'),multiSelect:vn.boolean().optional(),options:vn.array(vn.object({label:vn.string(),description:vn.string().optional()})).optional()})).min(1).max(3)},wp=vn.object(t2e);import Zj from"path";import r2e from"fs/promises";var Jj=me("agent-output-utils");async function Za({initialResult:t,agentName:e,hasError:r}){let n="",i=Zj.join(process.cwd(),lr,co);try{let s=await r2e.readFile(i,"utf-8");s&&(n=s,Jj.log(`Pulled result from ${Zj.relative(process.cwd(),i)}`))}catch{Jj.log(`No results file found at ${Zj.relative(process.cwd(),i)}`)}return n||(!t&&!r?`${e} has finished working on task.`:t||void 0)}var n2e=[/^API Error:\s*\d{3}/i,/^\d{3}\s*status code/i,/^API request failed:\s*\d{3}/i,/^API Error: The socket connection was closed/i,/^overloaded_error/i];function UR(t){let e=t.trim();return n2e.some(r=>r.test(e))?"Encountered a temporary issue \u2014 the agent will attempt to continue.":t}var xae=256*1024,wae=t=>`
|
|
209
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let a=o[1];if(e===o[0]){s(o);continue}if(t.external){let l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){s(o);continue}}if(t.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&t.reused==="ref"){s(o);continue}}}function Ka(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),h=p.schema;if(h.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,u),a._zod.parent===d)for(let E in l)E==="$ref"||E==="allOf"||E in u||delete l[E];if(h.$ref&&p.def)for(let E in l)E==="$ref"||E==="allOf"||E in p.def&&JSON.stringify(l[E])===JSON.stringify(p.def[E])&&delete l[E]}let f=a._zod.parent;if(f&&f!==d){n(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let h in l)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(l[h])===JSON.stringify(p.def[h])&&delete l[h]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(a)}Object.assign(i,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&i.id===s&&delete i.id;let o=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:_p(e,"input",t.processors),output:_p(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ur(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ur(n.element,r);if(n.type==="set")return Ur(n.valueType,r);if(n.type==="lazy")return Ur(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ur(n.innerType,r);if(n.type==="intersection")return Ur(n.left,r)||Ur(n.right,r);if(n.type==="record"||n.type==="map")return Ur(n.keyType,r)||Ur(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ur(n.in,r)||Ur(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Ur(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Ur(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Ur(i,r))return!0;return!!(n.rest&&Ur(n.rest,r))}return!1}var rB=(t,e={})=>r=>{let n=Wa({...r,processors:e});return Xe(t,n),Ya(n,t),Ka(n,t)},_p=(t,e,r={})=>n=>{let{libraryOptions:i,target:s}=n??{},o=Wa({...i??{},target:s,io:e,processors:r});return Xe(t,o),Ya(o,t),Ka(o,t)};var Bje={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nB=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:s,maximum:o,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),a&&(i.format=Bje[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},iB=(t,e,r,n)=>{let i=r,{minimum:s,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(o??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},sB=(t,e,r,n)=>{r.type="boolean"},oB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},aB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},cB=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},lB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},uB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},dB=(t,e,r,n)=>{r.not={}},fB=(t,e,r,n)=>{},pB=(t,e,r,n)=>{},hB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},mB=(t,e,r,n)=>{let i=t._zod.def,s=ty(i.entries);s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),r.enum=s},gB=(t,e,r,n)=>{let i=t._zod.def,s=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){let o=s[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),s.every(o=>typeof o=="boolean")&&(r.type="boolean"),s.every(o=>o===null)&&(r.type="null"),r.enum=s},_B=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},yB=(t,e,r,n)=>{let i=r,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=s.source},SB=(t,e,r,n)=>{let i=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:c}=t._zod.bag;o!==void 0&&(s.minLength=o),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(i,s)):(Object.assign(i,s),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,s)},EB=(t,e,r,n)=>{r.type="boolean"},vB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},TB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},AB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},xB=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},wB=(t,e,r,n)=>{let i=r,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Xe(s.element,e,{...n,path:[...n.path,"items"]})},RB=(t,e,r,n)=>{let i=r,s=t._zod.def;i.type="object",i.properties={};let o=s.shape;for(let l in o)i.properties[l]=Xe(o[l],e,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{let u=s.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Xe(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},nR=(t,e,r,n)=>{let i=t._zod.def,s=i.inclusive===!1,o=i.options.map((a,c)=>Xe(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=o:r.anyOf=o},IB=(t,e,r,n)=>{let i=t._zod.def,s=Xe(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=Xe(i.right,e,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];r.allOf=c},CB=(t,e,r,n)=>{let i=r,s=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((f,p)=>Xe(f,e,{...n,path:[...n.path,o,p]})),l=s.rest?Xe(s.rest,e,{...n,path:[...n.path,a,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},PB=(t,e,r,n)=>{let i=r,s=t._zod.def;i.type="object";let o=s.keyType,c=o._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let u=Xe(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Xe(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Xe(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=o._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},OB=(t,e,r,n)=>{let i=t._zod.def,s=Xe(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},NB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType},kB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},MB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},DB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},LB=(t,e,r,n)=>{let i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?i.out:i.in:i.out;Xe(o,e,n);let a=e.seen.get(t);a.ref=o},$B=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},UB=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType},iR=(t,e,r,n)=>{let i=t._zod.def;Xe(i.innerType,e,n);let s=e.seen.get(t);s.ref=i.innerType},FB=(t,e,r,n)=>{let i=t._zod.innerType;Xe(i,e,n);let s=e.seen.get(t);s.ref=i},rR={string:nB,number:iB,boolean:sB,bigint:oB,symbol:aB,null:cB,undefined:lB,void:uB,never:dB,any:fB,unknown:pB,date:hB,enum:mB,literal:gB,nan:_B,template_literal:yB,file:SB,success:EB,custom:vB,function:bB,transform:TB,map:AB,set:xB,array:wB,object:RB,union:nR,intersection:IB,tuple:CB,record:PB,nullable:OB,nonoptional:NB,default:kB,prefault:MB,catch:DB,pipe:LB,readonly:$B,promise:UB,optional:iR,lazy:FB};function sR(t,e){if("_idmap"in t){let n=t,i=Wa({...e,processors:rR}),s={};for(let c of n._idmap.entries()){let[l,u]=c;Xe(u,i)}let o={},a={registry:n,uri:e?.uri,defs:s};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;Ya(i,u),o[l]=Ka(i,u)}if(Object.keys(s).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:s}}return{schemas:o}}let r=Wa({...e,processors:rR});return Xe(t,r),Ya(r,t),Ka(r,t)}var oR=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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Wa({processors:rR,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Xe(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Ya(this.ctx,e);let n=Ka(this.ctx,e),{"~standard":i,...s}=n;return s}};var soe={};var Sy={};ir(Sy,{ZodAny:()=>lj,ZodArray:()=>pj,ZodBase64:()=>RR,ZodBase64URL:()=>IR,ZodBigInt:()=>xp,ZodBigIntFormat:()=>OR,ZodBoolean:()=>Ap,ZodCIDRv4:()=>xR,ZodCIDRv6:()=>wR,ZodCUID:()=>yR,ZodCUID2:()=>SR,ZodCatch:()=>Dj,ZodCodec:()=>Oy,ZodCustom:()=>Ny,ZodCustomStringFormat:()=>bp,ZodDate:()=>wy,ZodDefault:()=>Cj,ZodDiscriminatedUnion:()=>mj,ZodE164:()=>CR,ZodEmail:()=>mR,ZodEmoji:()=>gR,ZodEnum:()=>Ep,ZodExactOptional:()=>wj,ZodFile:()=>Aj,ZodFunction:()=>qj,ZodGUID:()=>vy,ZodIPv4:()=>TR,ZodIPv6:()=>AR,ZodIntersection:()=>gj,ZodJWT:()=>PR,ZodKSUID:()=>bR,ZodLazy:()=>zj,ZodLiteral:()=>Tj,ZodMAC:()=>rj,ZodMap:()=>vj,ZodNaN:()=>$j,ZodNanoID:()=>_R,ZodNever:()=>dj,ZodNonOptional:()=>$R,ZodNull:()=>aj,ZodNullable:()=>Ij,ZodNumber:()=>Tp,ZodNumberFormat:()=>Wl,ZodObject:()=>Iy,ZodOptional:()=>LR,ZodPipe:()=>Py,ZodPrefault:()=>Oj,ZodPreprocess:()=>Uj,ZodPromise:()=>Vj,ZodReadonly:()=>Fj,ZodRecord:()=>Sp,ZodSet:()=>bj,ZodString:()=>vp,ZodStringFormat:()=>st,ZodSuccess:()=>Mj,ZodSymbol:()=>sj,ZodTemplateLiteral:()=>jj,ZodTransform:()=>xj,ZodTuple:()=>yj,ZodType:()=>Le,ZodULID:()=>ER,ZodURL:()=>xy,ZodUUID:()=>Ss,ZodUndefined:()=>oj,ZodUnion:()=>Cy,ZodUnknown:()=>uj,ZodVoid:()=>fj,ZodXID:()=>vR,ZodXor:()=>hj,_ZodString:()=>hR,_default:()=>Pj,_function:()=>hae,any:()=>qoe,array:()=>Ry,base64:()=>Ioe,base64url:()=>Coe,bigint:()=>Boe,boolean:()=>ij,catch:()=>Lj,check:()=>mae,cidrv4:()=>woe,cidrv6:()=>Roe,codec:()=>uae,cuid:()=>yoe,cuid2:()=>Soe,custom:()=>gae,date:()=>Woe,describe:()=>_ae,discriminatedUnion:()=>Qoe,e164:()=>Poe,email:()=>coe,emoji:()=>goe,enum:()=>MR,exactOptional:()=>Rj,file:()=>oae,float32:()=>Loe,float64:()=>$oe,function:()=>hae,guid:()=>loe,hash:()=>Doe,hex:()=>Moe,hostname:()=>koe,httpUrl:()=>moe,instanceof:()=>Sae,int:()=>fR,int32:()=>Uoe,int64:()=>joe,intersection:()=>_j,invertCodec:()=>dae,ipv4:()=>Toe,ipv6:()=>xoe,json:()=>vae,jwt:()=>Ooe,keyof:()=>Yoe,ksuid:()=>boe,lazy:()=>Gj,literal:()=>sae,looseObject:()=>Joe,looseRecord:()=>tae,mac:()=>Aoe,map:()=>rae,meta:()=>yae,nan:()=>lae,nanoid:()=>_oe,nativeEnum:()=>iae,never:()=>NR,nonoptional:()=>kj,null:()=>cj,nullable:()=>Ty,nullish:()=>aae,number:()=>nj,object:()=>Koe,optional:()=>by,partialRecord:()=>eae,pipe:()=>pR,prefault:()=>Nj,preprocess:()=>bae,promise:()=>pae,readonly:()=>Bj,record:()=>Ej,refine:()=>Hj,set:()=>nae,strictObject:()=>Zoe,string:()=>Ey,stringFormat:()=>Noe,stringbool:()=>Eae,success:()=>cae,superRefine:()=>Wj,symbol:()=>Goe,templateLiteral:()=>fae,transform:()=>DR,tuple:()=>Sj,uint32:()=>Foe,uint64:()=>zoe,ulid:()=>Eoe,undefined:()=>Voe,union:()=>kR,unknown:()=>Hl,url:()=>hoe,uuid:()=>uoe,uuidv4:()=>doe,uuidv6:()=>foe,uuidv7:()=>poe,void:()=>Hoe,xid:()=>voe,xor:()=>Xoe});var aR={};ir(aR,{endsWith:()=>lp,gt:()=>_s,gte:()=>$r,includes:()=>ap,length:()=>ql,lowercase:()=>sp,lt:()=>gs,lte:()=>En,maxLength:()=>Vl,maxSize:()=>Ha,mime:()=>up,minLength:()=>Io,minSize:()=>ys,multipleOf:()=>qa,negative:()=>Xw,nonnegative:()=>eR,nonpositive:()=>Qw,normalize:()=>dp,overwrite:()=>Ii,positive:()=>Jw,property:()=>tR,regex:()=>ip,size:()=>Gl,slugify:()=>mp,startsWith:()=>cp,toLowerCase:()=>pp,toUpperCase:()=>hp,trim:()=>fp,uppercase:()=>op});var yp={};ir(yp,{ZodISODate:()=>lR,ZodISODateTime:()=>cR,ZodISODuration:()=>dR,ZodISOTime:()=>uR,date:()=>jB,datetime:()=>BB,duration:()=>GB,time:()=>zB});var cR=N("ZodISODateTime",(t,e)=>{_U.init(t,e),st.init(t,e)});function BB(t){return vF(cR,t)}var lR=N("ZodISODate",(t,e)=>{yU.init(t,e),st.init(t,e)});function jB(t){return bF(lR,t)}var uR=N("ZodISOTime",(t,e)=>{SU.init(t,e),st.init(t,e)});function zB(t){return TF(uR,t)}var dR=N("ZodISODuration",(t,e)=>{EU.init(t,e),st.init(t,e)});function GB(t){return AF(dR,t)}var ooe=(t,e)=>{oy.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>cy(t,r)},flatten:{value:r=>ay(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Kf,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Kf,2)}},isEmpty:{get(){return t.issues.length===0}}})},zje=N("ZodError",ooe),en=N("ZodError",ooe,{Parent:Error});var VB=Xf(en),qB=Qf(en),HB=ep(en),WB=tp(en),YB=sw(en),KB=ow(en),ZB=aw(en),JB=cw(en),XB=lw(en),QB=uw(en),ej=dw(en),tj=fw(en);var aoe=new WeakMap;function Ay(t,e,r){let n=Object.getPrototypeOf(t),i=aoe.get(n);if(i||(i=new Set,aoe.set(n,i)),!i.has(e)){i.add(e);for(let s in r){let o=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let a=o.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var Le=N("ZodType",(t,e)=>(Oe.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:_p(t,"input"),output:_p(t,"output")}}),t.toJSONSchema=rB(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>VB(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>HB(t,r,n),t.parseAsync=async(r,n)=>qB(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>WB(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>YB(t,r,n),t.decode=(r,n)=>KB(t,r,n),t.encodeAsync=async(r,n)=>ZB(t,r,n),t.decodeAsync=async(r,n)=>JB(t,r,n),t.safeEncode=(r,n)=>XB(t,r,n),t.safeDecode=(r,n)=>QB(t,r,n),t.safeEncodeAsync=async(r,n)=>ej(t,r,n),t.safeDecodeAsync=async(r,n)=>tj(t,r,n),Ay(t,"ZodType",{check(...r){let n=this.def;return this.clone(re.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Dr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Hj(r,n))},superRefine(r,n){return this.check(Wj(r,n))},overwrite(r){return this.check(Ii(r))},optional(){return by(this)},exactOptional(){return Rj(this)},nullable(){return Ty(this)},nullish(){return by(Ty(this))},nonoptional(r){return kj(this,r)},array(){return Ry(this)},or(r){return kR([this,r])},and(r){return _j(this,r)},transform(r){return pR(this,DR(r))},default(r){return Pj(this,r)},prefault(r){return Nj(this,r)},catch(r){return Lj(this,r)},pipe(r){return pR(this,r)},readonly(){return Bj(this)},describe(r){let n=this.clone();return fr.add(n,{description:r}),n},meta(...r){if(r.length===0)return fr.get(this);let n=this.clone();return fr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return fr.get(t)?.description},configurable:!0}),t)),hR=N("_ZodString",(t,e)=>{zl.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>nB(t,n,i,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Ay(t,"_ZodString",{regex(...n){return this.check(ip(...n))},includes(...n){return this.check(ap(...n))},startsWith(...n){return this.check(cp(...n))},endsWith(...n){return this.check(lp(...n))},min(...n){return this.check(Io(...n))},max(...n){return this.check(Vl(...n))},length(...n){return this.check(ql(...n))},nonempty(...n){return this.check(Io(1,...n))},lowercase(n){return this.check(sp(n))},uppercase(n){return this.check(op(n))},trim(){return this.check(fp())},normalize(...n){return this.check(dp(...n))},toLowerCase(){return this.check(pp())},toUpperCase(){return this.check(hp())},slugify(){return this.check(mp())}})}),vp=N("ZodString",(t,e)=>{zl.init(t,e),hR.init(t,e),t.email=r=>t.check(Ow(mR,r)),t.url=r=>t.check(yy(xy,r)),t.jwt=r=>t.check(Zw(PR,r)),t.emoji=r=>t.check(Lw(gR,r)),t.guid=r=>t.check(_y(vy,r)),t.uuid=r=>t.check(Nw(Ss,r)),t.uuidv4=r=>t.check(kw(Ss,r)),t.uuidv6=r=>t.check(Mw(Ss,r)),t.uuidv7=r=>t.check(Dw(Ss,r)),t.nanoid=r=>t.check($w(_R,r)),t.guid=r=>t.check(_y(vy,r)),t.cuid=r=>t.check(Uw(yR,r)),t.cuid2=r=>t.check(Fw(SR,r)),t.ulid=r=>t.check(Bw(ER,r)),t.base64=r=>t.check(Ww(RR,r)),t.base64url=r=>t.check(Yw(IR,r)),t.xid=r=>t.check(jw(vR,r)),t.ksuid=r=>t.check(zw(bR,r)),t.ipv4=r=>t.check(Gw(TR,r)),t.ipv6=r=>t.check(Vw(AR,r)),t.cidrv4=r=>t.check(qw(xR,r)),t.cidrv6=r=>t.check(Hw(wR,r)),t.e164=r=>t.check(Kw(CR,r)),t.datetime=r=>t.check(BB(r)),t.date=r=>t.check(jB(r)),t.time=r=>t.check(zB(r)),t.duration=r=>t.check(GB(r))});function Ey(t){return _F(vp,t)}var st=N("ZodStringFormat",(t,e)=>{it.init(t,e),hR.init(t,e)}),mR=N("ZodEmail",(t,e)=>{cU.init(t,e),st.init(t,e)});function coe(t){return Ow(mR,t)}var vy=N("ZodGUID",(t,e)=>{oU.init(t,e),st.init(t,e)});function loe(t){return _y(vy,t)}var Ss=N("ZodUUID",(t,e)=>{aU.init(t,e),st.init(t,e)});function uoe(t){return Nw(Ss,t)}function doe(t){return kw(Ss,t)}function foe(t){return Mw(Ss,t)}function poe(t){return Dw(Ss,t)}var xy=N("ZodURL",(t,e)=>{lU.init(t,e),st.init(t,e)});function hoe(t){return yy(xy,t)}function moe(t){return yy(xy,{protocol:Sn.httpProtocol,hostname:Sn.domain,...re.normalizeParams(t)})}var gR=N("ZodEmoji",(t,e)=>{uU.init(t,e),st.init(t,e)});function goe(t){return Lw(gR,t)}var _R=N("ZodNanoID",(t,e)=>{dU.init(t,e),st.init(t,e)});function _oe(t){return $w(_R,t)}var yR=N("ZodCUID",(t,e)=>{fU.init(t,e),st.init(t,e)});function yoe(t){return Uw(yR,t)}var SR=N("ZodCUID2",(t,e)=>{pU.init(t,e),st.init(t,e)});function Soe(t){return Fw(SR,t)}var ER=N("ZodULID",(t,e)=>{hU.init(t,e),st.init(t,e)});function Eoe(t){return Bw(ER,t)}var vR=N("ZodXID",(t,e)=>{mU.init(t,e),st.init(t,e)});function voe(t){return jw(vR,t)}var bR=N("ZodKSUID",(t,e)=>{gU.init(t,e),st.init(t,e)});function boe(t){return zw(bR,t)}var TR=N("ZodIPv4",(t,e)=>{vU.init(t,e),st.init(t,e)});function Toe(t){return Gw(TR,t)}var rj=N("ZodMAC",(t,e)=>{TU.init(t,e),st.init(t,e)});function Aoe(t){return SF(rj,t)}var AR=N("ZodIPv6",(t,e)=>{bU.init(t,e),st.init(t,e)});function xoe(t){return Vw(AR,t)}var xR=N("ZodCIDRv4",(t,e)=>{AU.init(t,e),st.init(t,e)});function woe(t){return qw(xR,t)}var wR=N("ZodCIDRv6",(t,e)=>{xU.init(t,e),st.init(t,e)});function Roe(t){return Hw(wR,t)}var RR=N("ZodBase64",(t,e)=>{RU.init(t,e),st.init(t,e)});function Ioe(t){return Ww(RR,t)}var IR=N("ZodBase64URL",(t,e)=>{IU.init(t,e),st.init(t,e)});function Coe(t){return Yw(IR,t)}var CR=N("ZodE164",(t,e)=>{CU.init(t,e),st.init(t,e)});function Poe(t){return Kw(CR,t)}var PR=N("ZodJWT",(t,e)=>{PU.init(t,e),st.init(t,e)});function Ooe(t){return Zw(PR,t)}var bp=N("ZodCustomStringFormat",(t,e)=>{OU.init(t,e),st.init(t,e)});function Noe(t,e,r={}){return gp(bp,t,e,r)}function koe(t){return gp(bp,"hostname",Sn.hostname,t)}function Moe(t){return gp(bp,"hex",Sn.hex,t)}function Doe(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Sn[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return gp(bp,n,i,e)}var Tp=N("ZodNumber",(t,e)=>{vw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>iB(t,n,i,s),Ay(t,"ZodNumber",{gt(n,i){return this.check(_s(n,i))},gte(n,i){return this.check($r(n,i))},min(n,i){return this.check($r(n,i))},lt(n,i){return this.check(gs(n,i))},lte(n,i){return this.check(En(n,i))},max(n,i){return this.check(En(n,i))},int(n){return this.check(fR(n))},safe(n){return this.check(fR(n))},positive(n){return this.check(_s(0,n))},nonnegative(n){return this.check($r(0,n))},negative(n){return this.check(gs(0,n))},nonpositive(n){return this.check(En(0,n))},multipleOf(n,i){return this.check(qa(n,i))},step(n,i){return this.check(qa(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function nj(t){return xF(Tp,t)}var Wl=N("ZodNumberFormat",(t,e)=>{NU.init(t,e),Tp.init(t,e)});function fR(t){return RF(Wl,t)}function Loe(t){return IF(Wl,t)}function $oe(t){return CF(Wl,t)}function Uoe(t){return PF(Wl,t)}function Foe(t){return OF(Wl,t)}var Ap=N("ZodBoolean",(t,e)=>{fy.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sB(t,r,n,i)});function ij(t){return NF(Ap,t)}var xp=N("ZodBigInt",(t,e)=>{bw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>oB(t,n,i,s),t.gte=(n,i)=>t.check($r(n,i)),t.min=(n,i)=>t.check($r(n,i)),t.gt=(n,i)=>t.check(_s(n,i)),t.gte=(n,i)=>t.check($r(n,i)),t.min=(n,i)=>t.check($r(n,i)),t.lt=(n,i)=>t.check(gs(n,i)),t.lte=(n,i)=>t.check(En(n,i)),t.max=(n,i)=>t.check(En(n,i)),t.positive=n=>t.check(_s(BigInt(0),n)),t.negative=n=>t.check(gs(BigInt(0),n)),t.nonpositive=n=>t.check(En(BigInt(0),n)),t.nonnegative=n=>t.check($r(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(qa(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Boe(t){return MF(xp,t)}var OR=N("ZodBigIntFormat",(t,e)=>{kU.init(t,e),xp.init(t,e)});function joe(t){return LF(OR,t)}function zoe(t){return $F(OR,t)}var sj=N("ZodSymbol",(t,e)=>{MU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aB(t,r,n,i)});function Goe(t){return UF(sj,t)}var oj=N("ZodUndefined",(t,e)=>{DU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lB(t,r,n,i)});function Voe(t){return FF(oj,t)}var aj=N("ZodNull",(t,e)=>{LU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cB(t,r,n,i)});function cj(t){return BF(aj,t)}var lj=N("ZodAny",(t,e)=>{$U.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fB(t,r,n,i)});function qoe(){return jF(lj)}var uj=N("ZodUnknown",(t,e)=>{UU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pB(t,r,n,i)});function Hl(){return zF(uj)}var dj=N("ZodNever",(t,e)=>{FU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dB(t,r,n,i)});function NR(t){return GF(dj,t)}var fj=N("ZodVoid",(t,e)=>{BU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uB(t,r,n,i)});function Hoe(t){return VF(fj,t)}var wy=N("ZodDate",(t,e)=>{jU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>hB(t,n,i,s),t.min=(n,i)=>t.check($r(n,i)),t.max=(n,i)=>t.check(En(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function Woe(t){return qF(wy,t)}var pj=N("ZodArray",(t,e)=>{zU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wB(t,r,n,i),t.element=e.element,Ay(t,"ZodArray",{min(r,n){return this.check(Io(r,n))},nonempty(r){return this.check(Io(1,r))},max(r,n){return this.check(Vl(r,n))},length(r,n){return this.check(ql(r,n))},unwrap(){return this.element}})});function Ry(t,e){return YF(pj,t,e)}function Yoe(t){let e=t._zod.def.shape;return MR(Object.keys(e))}var Iy=N("ZodObject",(t,e)=>{GU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RB(t,r,n,i),re.defineLazy(t,"shape",()=>e.shape),Ay(t,"ZodObject",{keyof(){return MR(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Hl()})},loose(){return this.clone({...this._zod.def,catchall:Hl()})},strict(){return this.clone({...this._zod.def,catchall:NR()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return re.extend(this,r)},safeExtend(r){return re.safeExtend(this,r)},merge(r){return re.merge(this,r)},pick(r){return re.pick(this,r)},omit(r){return re.omit(this,r)},partial(...r){return re.partial(LR,this,r[0])},required(...r){return re.required($R,this,r[0])}})});function Koe(t,e){let r={type:"object",shape:t??{},...re.normalizeParams(e)};return new Iy(r)}function Zoe(t,e){return new Iy({type:"object",shape:t,catchall:NR(),...re.normalizeParams(e)})}function Joe(t,e){return new Iy({type:"object",shape:t,catchall:Hl(),...re.normalizeParams(e)})}var Cy=N("ZodUnion",(t,e)=>{py.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nR(t,r,n,i),t.options=e.options});function kR(t,e){return new Cy({type:"union",options:t,...re.normalizeParams(e)})}var hj=N("ZodXor",(t,e)=>{Cy.init(t,e),VU.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nR(t,r,n,i),t.options=e.options});function Xoe(t,e){return new hj({type:"union",options:t,inclusive:!1,...re.normalizeParams(e)})}var mj=N("ZodDiscriminatedUnion",(t,e)=>{Cy.init(t,e),qU.init(t,e)});function Qoe(t,e,r){return new mj({type:"union",options:e,discriminator:t,...re.normalizeParams(r)})}var gj=N("ZodIntersection",(t,e)=>{HU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>IB(t,r,n,i)});function _j(t,e){return new gj({type:"intersection",left:t,right:e})}var yj=N("ZodTuple",(t,e)=>{Tw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CB(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Sj(t,e,r){let n=e instanceof Oe,i=n?r:e,s=n?e:null;return new yj({type:"tuple",items:t,rest:s,...re.normalizeParams(i)})}var Sp=N("ZodRecord",(t,e)=>{WU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PB(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function Ej(t,e,r){return!e||!e._zod?new Sp({type:"record",keyType:Ey(),valueType:t,...re.normalizeParams(e)}):new Sp({type:"record",keyType:t,valueType:e,...re.normalizeParams(r)})}function eae(t,e,r){let n=Dr(t);return n._zod.values=void 0,new Sp({type:"record",keyType:n,valueType:e,...re.normalizeParams(r)})}function tae(t,e,r){return new Sp({type:"record",keyType:t,valueType:e,mode:"loose",...re.normalizeParams(r)})}var vj=N("ZodMap",(t,e)=>{YU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AB(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(ys(...r)),t.nonempty=r=>t.check(ys(1,r)),t.max=(...r)=>t.check(Ha(...r)),t.size=(...r)=>t.check(Gl(...r))});function rae(t,e,r){return new vj({type:"map",keyType:t,valueType:e,...re.normalizeParams(r)})}var bj=N("ZodSet",(t,e)=>{KU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xB(t,r,n,i),t.min=(...r)=>t.check(ys(...r)),t.nonempty=r=>t.check(ys(1,r)),t.max=(...r)=>t.check(Ha(...r)),t.size=(...r)=>t.check(Gl(...r))});function nae(t,e){return new bj({type:"set",valueType:t,...re.normalizeParams(e)})}var Ep=N("ZodEnum",(t,e)=>{ZU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,s)=>mB(t,n,i,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let s={};for(let o of n)if(r.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Ep({...e,checks:[],...re.normalizeParams(i),entries:s})},t.exclude=(n,i)=>{let s={...e.entries};for(let o of n)if(r.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new Ep({...e,checks:[],...re.normalizeParams(i),entries:s})}});function MR(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Ep({type:"enum",entries:r,...re.normalizeParams(e)})}function iae(t,e){return new Ep({type:"enum",entries:t,...re.normalizeParams(e)})}var Tj=N("ZodLiteral",(t,e)=>{JU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gB(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function sae(t,e){return new Tj({type:"literal",values:Array.isArray(t)?t:[t],...re.normalizeParams(e)})}var Aj=N("ZodFile",(t,e)=>{XU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SB(t,r,n,i),t.min=(r,n)=>t.check(ys(r,n)),t.max=(r,n)=>t.check(Ha(r,n)),t.mime=(r,n)=>t.check(up(Array.isArray(r)?r:[r],n))});function oae(t){return KF(Aj,t)}var xj=N("ZodTransform",(t,e)=>{QU.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TB(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ba(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(re.issue(s,r.value,e));else{let o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(re.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function DR(t){return new xj({type:"transform",transform:t})}var LR=N("ZodOptional",(t,e)=>{Aw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iR(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function by(t){return new LR({type:"optional",innerType:t})}var wj=N("ZodExactOptional",(t,e)=>{eF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iR(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Rj(t){return new wj({type:"optional",innerType:t})}var Ij=N("ZodNullable",(t,e)=>{tF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Ty(t){return new Ij({type:"nullable",innerType:t})}function aae(t){return by(Ty(t))}var Cj=N("ZodDefault",(t,e)=>{rF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Pj(t,e){return new Cj({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():re.shallowClone(e)}})}var Oj=N("ZodPrefault",(t,e)=>{nF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Nj(t,e){return new Oj({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():re.shallowClone(e)}})}var $R=N("ZodNonOptional",(t,e)=>{iF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>NB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function kj(t,e){return new $R({type:"nonoptional",innerType:t,...re.normalizeParams(e)})}var Mj=N("ZodSuccess",(t,e)=>{sF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function cae(t){return new Mj({type:"success",innerType:t})}var Dj=N("ZodCatch",(t,e)=>{oF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Lj(t,e){return new Dj({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var $j=N("ZodNaN",(t,e)=>{aF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_B(t,r,n,i)});function lae(t){return WF($j,t)}var Py=N("ZodPipe",(t,e)=>{xw.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>LB(t,r,n,i),t.in=e.in,t.out=e.out});function pR(t,e){return new Py({type:"pipe",in:t,out:e})}var Oy=N("ZodCodec",(t,e)=>{Py.init(t,e),hy.init(t,e)});function uae(t,e,r){return new Oy({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function dae(t){let e=t._zod.def;return new Oy({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var Uj=N("ZodPreprocess",(t,e)=>{Py.init(t,e),cF.init(t,e)}),Fj=N("ZodReadonly",(t,e)=>{lF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$B(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Bj(t){return new Fj({type:"readonly",innerType:t})}var jj=N("ZodTemplateLiteral",(t,e)=>{uF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yB(t,r,n,i)});function fae(t,e){return new jj({type:"template_literal",parts:t,...re.normalizeParams(e)})}var zj=N("ZodLazy",(t,e)=>{pF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FB(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function Gj(t){return new zj({type:"lazy",getter:t})}var Vj=N("ZodPromise",(t,e)=>{fF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>UB(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function pae(t){return new Vj({type:"promise",innerType:t})}var qj=N("ZodFunction",(t,e)=>{dF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bB(t,r,n,i)});function hae(t){return new qj({type:"function",input:Array.isArray(t?.input)?Sj(t?.input):t?.input??Ry(Hl()),output:t?.output??Hl()})}var Ny=N("ZodCustom",(t,e)=>{hF.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vB(t,r,n,i)});function mae(t){let e=new ut({check:"custom"});return e._zod.check=t,e}function gae(t,e){return ZF(Ny,t??(()=>!0),e)}function Hj(t,e={}){return JF(Ny,t,e)}function Wj(t,e){return XF(t,e)}var _ae=QF,yae=eB;function Sae(t,e={}){let r=new Ny({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...re.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Eae=(...t)=>tB({Codec:Oy,Boolean:Ap,String:vp},...t);function vae(t){let e=Gj(()=>kR([Ey(t),nj(),ij(),cj(),Ry(e),Ej(Ey(),e)]));return e}function bae(t,e){return new Uj({type:"pipe",in:DR(t),out:e})}var Vje={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"};function qje(t){xt({customError:t})}function Hje(){return xt().customError}var Yj;Yj||(Yj={});var pe={...Sy,...aR,iso:yp},Wje=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"]);function Yje(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function Kje(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function Tae(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return pe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return pe.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let s=Kje(i,e),o=_r(s,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return pe.null();if(i.length===0)return pe.never();if(i.length===1)return pe.literal(i[0]);if(i.every(o=>typeof o=="string"))return pe.enum(i);let s=i.map(o=>pe.literal(o));return s.length<2?s[0]:pe.union([s[0],s[1],...s.slice(2)])}if(t.const!==void 0)return pe.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(s=>{let o={...t,type:s};return Tae(o,e)});return i.length===0?pe.never():i.length===1?i[0]:pe.union(i)}if(!r)return pe.any();let n;switch(r){case"string":{let i=pe.string();if(t.format){let s=t.format;s==="email"?i=i.check(pe.email()):s==="uri"||s==="uri-reference"?i=i.check(pe.url()):s==="uuid"||s==="guid"?i=i.check(pe.uuid()):s==="date-time"?i=i.check(pe.iso.datetime()):s==="date"?i=i.check(pe.iso.date()):s==="time"?i=i.check(pe.iso.time()):s==="duration"?i=i.check(pe.iso.duration()):s==="ipv4"?i=i.check(pe.ipv4()):s==="ipv6"?i=i.check(pe.ipv6()):s==="mac"?i=i.check(pe.mac()):s==="cidr"?i=i.check(pe.cidrv4()):s==="cidr-v6"?i=i.check(pe.cidrv6()):s==="base64"?i=i.check(pe.base64()):s==="base64url"?i=i.check(pe.base64url()):s==="e164"?i=i.check(pe.e164()):s==="jwt"?i=i.check(pe.jwt()):s==="emoji"?i=i.check(pe.emoji()):s==="nanoid"?i=i.check(pe.nanoid()):s==="cuid"?i=i.check(pe.cuid()):s==="cuid2"?i=i.check(pe.cuid2()):s==="ulid"?i=i.check(pe.ulid()):s==="xid"?i=i.check(pe.xid()):s==="ksuid"&&(i=i.check(pe.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?pe.number().int():pe.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=pe.boolean();break}case"null":{n=pe.null();break}case"object":{let i={},s=t.properties||{},o=new Set(t.required||[]);for(let[c,l]of Object.entries(s)){let u=_r(l,e);i[c]=o.has(c)?u:u.optional()}if(t.propertyNames){let c=_r(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?_r(t.additionalProperties,e):pe.any();if(Object.keys(i).length===0){n=pe.record(c,l);break}let u=pe.object(i).passthrough(),d=pe.looseRecord(c,l);n=pe.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=_r(c[f],e),h=pe.string().regex(new RegExp(f));u.push(pe.looseRecord(h,p))}let d=[];if(Object.keys(i).length>0&&d.push(pe.object(i).passthrough()),d.push(...u),d.length===0)n=pe.object({}).passthrough();else if(d.length===1)n=d[0];else{let f=pe.intersection(d[0],d[1]);for(let p=2;p<d.length;p++)f=pe.intersection(f,d[p]);n=f}break}let a=pe.object(i);t.additionalProperties===!1?n=a.strict():typeof t.additionalProperties=="object"?n=a.catchall(_r(t.additionalProperties,e)):n=a.passthrough();break}case"array":{let i=t.prefixItems,s=t.items;if(i&&Array.isArray(i)){let o=i.map(c=>_r(c,e)),a=s&&typeof s=="object"&&!Array.isArray(s)?_r(s,e):void 0;a?n=pe.tuple(o).rest(a):n=pe.tuple(o),typeof t.minItems=="number"&&(n=n.check(pe.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(pe.maxLength(t.maxItems)))}else if(Array.isArray(s)){let o=s.map(c=>_r(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?_r(t.additionalItems,e):void 0;a?n=pe.tuple(o).rest(a):n=pe.tuple(o),typeof t.minItems=="number"&&(n=n.check(pe.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(pe.maxLength(t.maxItems)))}else if(s!==void 0){let o=_r(s,e),a=pe.array(o);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),n=a}else n=pe.array(pe.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function _r(t,e){if(typeof t=="boolean")return t?pe.any():pe.never();let r=Tae(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>_r(l,e)),c=pe.union(a);r=n?pe.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>_r(l,e)),c=pe.xor(a);r=n?pe.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:pe.any();else{let a=n?r:_r(t.allOf[0],e),c=n?0:1;for(let l=c;l<t.allOf.length;l++)a=pe.intersection(a,_r(t.allOf[l],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=pe.nullable(r)),t.readOnly===!0&&(r=pe.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let i={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of s)a in t&&(i[a]=t[a]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let a of o)a in t&&(i[a]=t[a]);for(let a of Object.keys(t))Wje.has(a)||(i[a]=t[a]);return Object.keys(i).length>0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function Aae(t,e){if(typeof t=="boolean")return t?pe.any():pe.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=Yje(r,e?.defaultTarget),i=r.$defs||r.definitions||{},s={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??fr};return _r(r,s)}var Kj={};ir(Kj,{bigint:()=>Qje,boolean:()=>Xje,date:()=>e2e,number:()=>Jje,string:()=>Zje});function Zje(t){return yF(vp,t)}function Jje(t){return wF(Tp,t)}function Xje(t){return kF(Ap,t)}function Qje(t){return DF(xp,t)}function e2e(t){return HF(wy,t)}xt(ww());var t2e={questions:vn.array(vn.object({question:vn.string().describe("The question as the user reads it"),header:vn.string().optional().describe('Very short topic label rendered as a tag above the question, max ~12 characters (e.g. "Framework")'),multiSelect:vn.boolean().optional().describe("True when several options can apply at once. Leave off for mutually exclusive choices."),options:vn.array(vn.object({label:vn.string(),description:vn.string().optional()})).min(2).max(3).optional().describe('Two or three predefined answers. Omit entirely to ask an open question the user answers in their own words. The UI adds its own "Other" choice and a free-text field for extra context, so never add an option like "Other" or "None of these" yourself.')})).min(1).max(3).describe("One to three questions, all asked in a single call")},wp=vn.object(t2e);import Zj from"path";import r2e from"fs/promises";var Jj=me("agent-output-utils");async function Za({initialResult:t,agentName:e,hasError:r}){let n="",i=Zj.join(process.cwd(),lr,co);try{let s=await r2e.readFile(i,"utf-8");s&&(n=s,Jj.log(`Pulled result from ${Zj.relative(process.cwd(),i)}`))}catch{Jj.log(`No results file found at ${Zj.relative(process.cwd(),i)}`)}return n||(!t&&!r?`${e} has finished working on task.`:t||void 0)}var n2e=[/^API Error:\s*\d{3}/i,/^\d{3}\s*status code/i,/^API request failed:\s*\d{3}/i,/^API Error: The socket connection was closed/i,/^overloaded_error/i];function UR(t){let e=t.trim();return n2e.some(r=>r.test(e))?"Encountered a temporary issue \u2014 the agent will attempt to continue.":t}var xae=256*1024,wae=t=>`
|
|
210
210
|
\u2026 [truncated ${t} characters]`;function Rae(t){if(t.length<=xae)return t;let e=wae(t.length).length,r=t.slice(0,xae-e);return`${r}${wae(t.length-r.length)}`}function Ja({error:t,agentName:e}){let r=t&&typeof t=="object"?JSON.stringify(t):t,n=r?.replace(/\s+/g," ").trim().toLowerCase()||"",i="";return n?.includes("ai gateway is not available for your account")||n?.includes("ai gateway is not enabled for your account")?i="AI Gateway is currently not available on your account. Please confirm your account meets the criteria for using Agent Runners and AI Gateway and that your account has remaining AI Gateway inference credits available. Reach out to Netlify support if this is unexpected.":n?.includes("error when talking to gemini api")?i="Gemini's API is currently having issues. Please try again or use a different available agent while Google resolves the issue.":(n?.includes("connection closed prematurely")||n?.includes("499")&&e.toLowerCase().includes("gemini"))&&(i=`The ${e} models were currently overloaded. Please try again or use a different available agent.`),n?.includes("request timed out")&&(i=`The ${e} API request's have timed out. Please try again or use a different available agent.`),(n?.includes("network error")||n?.includes("socket connection was closed"))&&(i=`The ${e} agent is having network issues. Please try again or use a different available agent.`),n?.includes("503")&&!n?.includes("usage exceeded")&&(i=`The ${e} API is currently experiencing high load. Retrying automatically...`),(n?.includes("529")||n?.includes("overloaded_error"))&&(i=`The ${e} API is currently overloaded. Retrying automatically...`),n?.includes("at capacity")&&(i=`The ${e} model is currently at capacity. Retrying automatically...`),(n?.includes("there's an issue with the selected model")||n?.includes("is not available for")&&n?.includes("provider"))&&(i=`The ${e} model is temporarily unavailable. Please try again later or use a different available agent.`),i&&Jj.log(`Providing updated error messsage: ${i}, replacing original error: ${r}`),i||r||void 0}function Xa(t){if(!t)return!1;let r=(t&&typeof t=="object"?JSON.stringify(t):t)?.replace(/\s+/g," ").trim().toLowerCase()||"";return r?.includes("error when talking to gemini api")||r?.includes("499")||r?.includes("connection closed prematurely")||r?.includes("socket connection was closed")||r?.includes("request timed out")||r?.includes("network error")?!0:r?.includes("usage exceeded")?!1:!!(r?.includes("503")||r?.includes("529")||r?.includes("overloaded_error")||r?.includes("at capacity"))}function Qa(t){if(!t)return!1;let e=t.replace(/\s+/g," ").trim().toLowerCase();return!!(e.includes("there's an issue with the selected model")||e.includes("is not available for")&&e.includes("provider"))}import FR from"process";import{fileURLToPath as c2e}from"url";import{createRequire as l2e}from"module";import BR from"path";import{readdir as i2e,rm as s2e}from"fs/promises";import{join as o2e}from"path";async function Iae(t,e=[]){let n=(await i2e(t)).filter(i=>!e.includes(i));await Promise.all(n.map(i=>s2e(o2e(t,i),{recursive:!0,force:!0})))}var a2e=700,Cae=t=>t.mode==="create"&&(t.accountType===c_||t.enforcedAICreditsRemaining!=null&&t.enforcedAICreditsRemaining<=a2e);var u2e=BR.dirname(c2e(import.meta.url)),Pae=l2e(import.meta.url),d2e=BR.resolve(u2e,"scripts/scaffold.js"),f2e="scripts/scaffold.js",p2e=/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\S+/g,Xj=t=>{if(t.length>=2){let e=t[0],r=t[t.length-1];if(e==='"'&&r==='"'||e==="'"&&r==="'")return t.slice(1,-1)}return t},h2e=t=>/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(t),m2e=t=>{let e=Xj(t);return e==="node"||e.endsWith("/node")},Po=t=>{if(typeof t!="string")return!1;let e=t.match(p2e)||[];if(e.length<2)return!1;let r=0;for(;r<e.length&&h2e(Xj(e[r]));)r+=1;if(r>=e.length||!m2e(e[r]))return!1;let n=e[r+1];return n?Xj(n).includes(f2e):!1},Rp=me("create_stage"),Oae="Do not run local validation or dev-server commands to check your work \u2014 specifically `tsc`, `npx tsc`, `vite build`, `vite dev`, or any equivalent build/start/test command. The build pipeline installs and validates the project automatically after your edits. Verify your changes by reading the files you edited.",g2e=`${Oae}
|
|
211
211
|
|
|
212
212
|
Commands that generate or modify project files are fine to run when the task requires them \u2014 for example \`drizzle-kit generate\` to write a database migration after a schema change, or other code-generation utilities documented in the skills.`,_2e=`${Oae}
|