@netlify/agent-runner-cli 1.172.0-model-default-effort.0 → 1.172.1-model-default-effort.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/bin-local.js +27 -27
- package/dist/bin.js +33 -33
- package/dist/index.js +27 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var E0e=Object.create;var fT=Object.defineProperty;var v0e=Object.getOwnProperty
|
|
|
3
3
|
for call at
|
|
4
4
|
${e}`;return Object.assign(new Error(r),t,{stack:i})}var U$=class extends aNe.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(by.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}};ho.ClientUnaryCallImpl=U$;var F$=class extends B$.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(by.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()}};ho.ClientReadableStreamImpl=F$;var z$=class extends B$.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(by.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 o={callback:n},s=Number(r);Number.isNaN(s)||(o.flags=s),(i=this.call)===null||i===void 0||i.sendMessageWithContext(o,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};ho.ClientWritableStreamImpl=z$;var j$=class extends B$.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(by.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 o={callback:n},s=Number(r);Number.isNaN(s)||(o.flags=s),(i=this.call)===null||i===void 0||i.sendMessageWithContext(o,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};ho.ClientDuplexStreamImpl=j$});var $u=y(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.InterceptingListenerImpl=void 0;Mu.statusOrFromValue=uNe;Mu.statusOrFromError=dNe;Mu.isInterceptingListener=fNe;var lNe=Ar();function uNe(t){return{ok:!0,value:t}}function dNe(t){var e;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:(e=t.metadata)!==null&&e!==void 0?e:new lNe.Metadata})}}function fNe(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var q$=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)})}};Mu.InterceptingListenerImpl=q$});var Z$=y(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.InterceptingCall=mo.RequesterBuilder=mo.ListenerBuilder=mo.InterceptorConfigurationError=void 0;mo.getInterceptingCall=gNe;var pNe=Ar(),VX=$u(),GX=Xe(),HX=fx(),wy=class t extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,t)}};mo.InterceptorConfigurationError=wy;var G$=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}}};mo.ListenerBuilder=G$;var H$=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}}};mo.RequesterBuilder=H$;var V$={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveStatus:(t,e)=>{e(t)}},Ty={start:(t,e,r)=>{r(t,e)},sendMessage:(t,e)=>{e(t)},halfClose:t=>{t()},cancel:t=>{t()}},W$=class{constructor(e,r){var n,i,o,s;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:Ty.start,sendMessage:(i=r.sendMessage)!==null&&i!==void 0?i:Ty.sendMessage,halfClose:(o=r.halfClose)!==null&&o!==void 0?o:Ty.halfClose,cancel:(s=r.cancel)!==null&&s!==void 0?s:Ty.cancel}:this.requester=Ty}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,o,s,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:(s=(o=r?.onReceiveMessage)===null||o===void 0?void 0:o.bind(r))!==null&&s!==void 0?s:(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,VX.isInterceptingListener)(d))m=d;else{let g={onReceiveMetadata:(f=d.onReceiveMetadata)!==null&&f!==void 0?f:V$.onReceiveMetadata,onReceiveMessage:(p=d.onReceiveMessage)!==null&&p!==void 0?p:V$.onReceiveMessage,onReceiveStatus:(h=d.onReceiveStatus)!==null&&h!==void 0?h:V$.onReceiveStatus};m=new VX.InterceptingListenerImpl(g,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()}};mo.InterceptingCall=W$;function hNe(t,e,r){var n,i;let o=(n=r.deadline)!==null&&n!==void 0?n:1/0,s=r.host,a=(i=r.parent)!==null&&i!==void 0?i:null,c=r.propagate_flags,l=r.credentials,u=t.createCall(e,o,s,a,c);return l&&u.setCredentials(l),u}var Nx=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(GX.Status.INTERNAL,`Request message serialization failure: ${(0,HX.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 o;(o=r?.onReceiveMetadata)===null||o===void 0||o.call(r,i)},onReceiveMessage:i=>{var o;let s;try{s=this.methodDefinition.responseDeserialize(i)}catch(a){n={code:GX.Status.INTERNAL,details:`Response message parsing error: ${(0,HX.getErrorMessage)(a)}`,metadata:new pNe.Metadata},this.call.cancelWithStatus(n.code,n.details);return}(o=r?.onReceiveMessage)===null||o===void 0||o.call(r,s)},onReceiveStatus:i=>{var o,s;n?(o=r?.onReceiveStatus)===null||o===void 0||o.call(r,n):(s=r?.onReceiveStatus)===null||s===void 0||s.call(r,i)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},Y$=class extends Nx{constructor(e,r){super(e,r)}start(e,r){var n,i;let o=!1,s={onReceiveMetadata:(i=(n=r?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(r))!==null&&i!==void 0?i:(a=>{}),onReceiveMessage:a=>{var c;o=!0,(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,a)},onReceiveStatus:a=>{var c,l;o||(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,s),this.call.startRead()}},K$=class extends Nx{};function mNe(t,e,r){let n=hNe(t,r.path,e);return r.responseStream?new K$(n,r):new Y$(n,r)}function gNe(t,e,r,n){if(t.clientInterceptors.length>0&&t.clientInterceptorProviders.length>0)throw new wy("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 wy("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 o=Object.assign({},r,{method_definition:e});return i.reduceRight((a,c)=>l=>c(l,a),a=>mNe(n,a,e))(o)}});var Q$=y(Mx=>{"use strict";Object.defineProperty(Mx,"__esModule",{value:!0});Mx.Client=void 0;var as=qX(),_Ne=eD(),yNe=An(),Nc=Xe(),up=Ar(),kx=Z$(),go=Symbol(),dp=Symbol(),fp=Symbol(),ha=Symbol();function J$(t){return typeof t=="function"}function pp(t){var e;return((e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
5
5
|
`).slice(1).join(`
|
|
6
|
-
`))||"no stack trace available"}var X$=class{constructor(e,r,n={}){var i,o;if(n=Object.assign({},n),this[dp]=(i=n.interceptors)!==null&&i!==void 0?i:[],delete n.interceptors,this[fp]=(o=n.interceptor_providers)!==null&&o!==void 0?o:[],delete n.interceptor_providers,this[dp].length>0&&this[fp].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[ha]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[go]=n.channelOverride;else if(n.channelFactoryOverride){let s=n.channelFactoryOverride;delete n.channelFactoryOverride,this[go]=s(e,r,n)}else this[go]=new _Ne.ChannelImplementation(e,r,n)}close(){this[go].close()}getChannel(){return this[go]}waitForReady(e,r){let n=i=>{if(i){r(new Error("Failed to connect before the deadline"));return}let o;try{o=this[go].getConnectivityState(!0)}catch{r(new Error("The channel has been closed"));return}if(o===yNe.ConnectivityState.READY)r();else try{this[go].watchConnectivityState(o,e,n)}catch{r(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,r,n){if(J$(e))return{metadata:new up.Metadata,options:{},callback:e};if(J$(r))return e instanceof up.Metadata?{metadata:e,options:{},callback:r}:{metadata:new up.Metadata,options:e,callback:r};if(!(e instanceof up.Metadata&&r instanceof Object&&J$(n)))throw new Error("Incorrect arguments passed");return{metadata:e,options:r,callback:n}}makeUnaryRequest(e,r,n,i,o,s,a){var c,l;let u=this.checkOptionalUnaryResponseArguments(o,s,a),d={path:e,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:n},f={argument:i,metadata:u.metadata,call:new as.ClientUnaryCallImpl,channel:this[go],methodDefinition:d,callOptions:u.options,callback:u.callback};this[ha]&&(f=this[ha](f));let p=f.call,h={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(c=f.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},m=(0,kx.getInterceptingCall)(h,f.methodDefinition,f.callOptions,f.channel);p.call=m;let g=null,_=!1,v=new Error;return m.start(f.metadata,{onReceiveMetadata:T=>{p.emit("metadata",T)},onReceiveMessage(T){g!==null&&m.cancelWithStatus(Nc.Status.UNIMPLEMENTED,"Too many responses received"),g=T},onReceiveStatus(T){if(!_){if(_=!0,T.code===Nc.Status.OK)if(g===null){let b=pp(v);f.callback((0,as.callErrorFromStatus)({code:Nc.Status.UNIMPLEMENTED,details:"No message received",metadata:T.metadata},b))}else f.callback(null,g);else{let b=pp(v);f.callback((0,as.callErrorFromStatus)(T,b))}v=null,p.emit("status",T)}}}),m.sendMessage(i),m.halfClose(),p}makeClientStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkOptionalUnaryResponseArguments(i,o,s),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:n},d={metadata:l.metadata,call:new as.ClientWritableStreamImpl(r),channel:this[go],methodDefinition:u,callOptions:l.options,callback:l.callback};this[ha]&&(d=this[ha](d));let f=d.call,p={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,kx.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=null,g=!1,_=new Error;return h.start(d.metadata,{onReceiveMetadata:v=>{f.emit("metadata",v)},onReceiveMessage(v){m!==null&&h.cancelWithStatus(Nc.Status.UNIMPLEMENTED,"Too many responses received"),m=v,h.startRead()},onReceiveStatus(v){if(!g){if(g=!0,v.code===Nc.Status.OK)if(m===null){let T=pp(_);d.callback((0,as.callErrorFromStatus)({code:Nc.Status.UNIMPLEMENTED,details:"No message received",metadata:v.metadata},T))}else d.callback(null,m);else{let T=pp(_);d.callback((0,as.callErrorFromStatus)(v,T))}_=null,f.emit("status",v)}}}),f}checkMetadataAndOptions(e,r){let n,i;return e instanceof up.Metadata?(n=e,r?i=r:i={}):(e?i=e:i={},n=new up.Metadata),{metadata:n,options:i}}makeServerStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkMetadataAndOptions(o,s),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:n},d={argument:i,metadata:l.metadata,call:new as.ClientReadableStreamImpl(n),channel:this[go],methodDefinition:u,callOptions:l.options};this[ha]&&(d=this[ha](d));let f=d.call,p={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,kx.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=!1,g=new Error;return h.start(d.metadata,{onReceiveMetadata(_){f.emit("metadata",_)},onReceiveMessage(_){f.push(_)},onReceiveStatus(_){if(!m){if(m=!0,f.push(null),_.code!==Nc.Status.OK){let v=pp(g);f.emit("error",(0,as.callErrorFromStatus)(_,v))}g=null,f.emit("status",_)}}}),h.sendMessage(i),h.halfClose(),f}makeBidiStreamRequest(e,r,n,i,o){var s,a;let c=this.checkMetadataAndOptions(i,o),l={path:e,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:n},u={metadata:c.metadata,call:new as.ClientDuplexStreamImpl(r,n),channel:this[go],methodDefinition:l,callOptions:c.options};this[ha]&&(u=this[ha](u));let d=u.call,f={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(s=u.callOptions.interceptors)!==null&&s!==void 0?s:[],callInterceptorProviders:(a=u.callOptions.interceptor_providers)!==null&&a!==void 0?a:[]},p=(0,kx.getInterceptingCall)(f,u.methodDefinition,u.callOptions,u.channel);d.call=p;let h=!1,m=new Error;return p.start(u.metadata,{onReceiveMetadata(g){d.emit("metadata",g)},onReceiveMessage(g){d.push(g)},onReceiveStatus(g){if(!h){if(h=!0,d.push(null),g.code!==Nc.Status.OK){let _=pp(m);d.emit("error",(0,as.callErrorFromStatus)(g,_))}m=null,d.emit("status",g)}}}),d}};Mx.Client=X$});var Dx=y($x=>{"use strict";Object.defineProperty($x,"__esModule",{value:!0});$x.makeClientConstructor=WX;$x.loadPackageDefinition=bNe;var xy=Q$(),SNe={unary:xy.Client.prototype.makeUnaryRequest,server_stream:xy.Client.prototype.makeServerStreamRequest,client_stream:xy.Client.prototype.makeClientStreamRequest,bidi:xy.Client.prototype.makeBidiStreamRequest};function tD(t){return["__proto__","prototype","constructor"].includes(t)}function WX(t,e,r){r||(r={});class n extends xy.Client{}return Object.keys(t).forEach(i=>{if(tD(i))return;let o=t[i],s;if(typeof i=="string"&&i.charAt(0)==="$")throw new Error("Method names cannot start with $");o.requestStream?o.responseStream?s="bidi":s="client_stream":o.responseStream?s="server_stream":s="unary";let a=o.requestSerialize,c=o.responseDeserialize,l=ENe(SNe[s],o.path,a,c);n.prototype[i]=l,Object.assign(n.prototype[i],o),o.originalName&&!tD(o.originalName)&&(n.prototype[o.originalName]=n.prototype[i])}),n.service=t,n.serviceName=e,n}function ENe(t,e,r,n){return function(...i){return t.call(this,e,r,n,...i)}}function vNe(t){return"format"in t}function bNe(t){let e={};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r],i=r.split(".");if(i.some(a=>tD(a)))continue;let o=i[i.length-1],s=e;for(let a of i.slice(0,-1))s[a]||(s[a]={}),s=s[a];vNe(n)?s[o]=n:s[o]=WX(n,o,{})}return e}});var yQ=y((yAt,_Q)=>{"use strict";var TNe=1/0,wNe="[object Symbol]",xNe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ANe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ux="\\ud800-\\udfff",tQ="\\u0300-\\u036f\\ufe20-\\ufe23",rQ="\\u20d0-\\u20f0",nQ="\\u2700-\\u27bf",iQ="a-z\\xdf-\\xf6\\xf8-\\xff",RNe="\\xac\\xb1\\xd7\\xf7",CNe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",INe="\\u2000-\\u206f",PNe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",oQ="A-Z\\xc0-\\xd6\\xd8-\\xde",sQ="\\ufe0e\\ufe0f",aQ=RNe+CNe+INe+PNe,nD="['\u2019]",ONe="["+Ux+"]",YX="["+aQ+"]",Lx="["+tQ+rQ+"]",cQ="\\d+",NNe="["+nQ+"]",lQ="["+iQ+"]",uQ="[^"+Ux+aQ+cQ+nQ+iQ+oQ+"]",rD="\\ud83c[\\udffb-\\udfff]",kNe="(?:"+Lx+"|"+rD+")",dQ="[^"+Ux+"]",iD="(?:\\ud83c[\\udde6-\\uddff]){2}",oD="[\\ud800-\\udbff][\\udc00-\\udfff]",hp="["+oQ+"]",fQ="\\u200d",KX="(?:"+lQ+"|"+uQ+")",MNe="(?:"+hp+"|"+uQ+")",ZX="(?:"+nD+"(?:d|ll|m|re|s|t|ve))?",JX="(?:"+nD+"(?:D|LL|M|RE|S|T|VE))?",pQ=kNe+"?",hQ="["+sQ+"]?",$Ne="(?:"+fQ+"(?:"+[dQ,iD,oD].join("|")+")"+hQ+pQ+")*",mQ=hQ+pQ+$Ne,DNe="(?:"+[NNe,iD,oD].join("|")+")"+mQ,LNe="(?:"+[dQ+Lx+"?",Lx,iD,oD,ONe].join("|")+")",UNe=RegExp(nD,"g"),FNe=RegExp(Lx,"g"),zNe=RegExp(rD+"(?="+rD+")|"+LNe+mQ,"g"),jNe=RegExp([hp+"?"+lQ+"+"+ZX+"(?="+[YX,hp,"$"].join("|")+")",MNe+"+"+JX+"(?="+[YX,hp+KX,"$"].join("|")+")",hp+"?"+KX+"+"+ZX,hp+"+"+JX,cQ,DNe].join("|"),"g"),BNe=RegExp("["+fQ+Ux+tQ+rQ+sQ+"]"),qNe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,VNe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},GNe=typeof global=="object"&&global&&global.Object===Object&&global,HNe=typeof self=="object"&&self&&self.Object===Object&&self,WNe=GNe||HNe||Function("return this")();function YNe(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function KNe(t){return t.split("")}function ZNe(t){return t.match(xNe)||[]}function JNe(t){return function(e){return t?.[e]}}var XNe=JNe(VNe);function gQ(t){return BNe.test(t)}function QNe(t){return qNe.test(t)}function eke(t){return gQ(t)?tke(t):KNe(t)}function tke(t){return t.match(zNe)||[]}function rke(t){return t.match(jNe)||[]}var nke=Object.prototype,ike=nke.toString,XX=WNe.Symbol,QX=XX?XX.prototype:void 0,eQ=QX?QX.toString:void 0;function oke(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function ske(t){if(typeof t=="string")return t;if(dke(t))return eQ?eQ.call(t):"";var e=t+"";return e=="0"&&1/t==-TNe?"-0":e}function ake(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:oke(t,e,r)}function cke(t){return function(e){e=Fx(e);var r=gQ(e)?eke(e):void 0,n=r?r[0]:e.charAt(0),i=r?ake(r,1).join(""):e.slice(1);return n[t]()+i}}function lke(t){return function(e){return YNe(gke(hke(e).replace(UNe,"")),t,"")}}function uke(t){return!!t&&typeof t=="object"}function dke(t){return typeof t=="symbol"||uke(t)&&ike.call(t)==wNe}function Fx(t){return t==null?"":ske(t)}var fke=lke(function(t,e,r){return e=e.toLowerCase(),t+(r?pke(e):e)});function pke(t){return mke(Fx(t).toLowerCase())}function hke(t){return t=Fx(t),t&&t.replace(ANe,XNe).replace(FNe,"")}var mke=cke("toUpperCase");function gke(t,e,r){return t=Fx(t),e=r?void 0:e,e===void 0?QNe(t)?rke(t):ZNe(t):t.match(e)||[]}_Q.exports=fke});var sD=y((SAt,SQ)=>{"use strict";SQ.exports=_ke;function _ke(t,e){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(a,c){r[n]=function(u){if(o)if(o=!1,u)c(u);else{for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f++]=arguments[f];a.apply(null,d)}};try{t.apply(e||null,r)}catch(l){o&&(o=!1,c(l))}})}});var TQ=y(bQ=>{"use strict";var zx=bQ;zx.length=function(e){var r=e.length;if(!r)return 0;for(var n=0;--r%4>1&&e.charAt(r)==="=";)++n;return Math.ceil(e.length*3)/4-n};var mp=new Array(64),vQ=new Array(123);for(_o=0;_o<64;)vQ[mp[_o]=_o<26?_o+65:_o<52?_o+71:_o<62?_o-4:_o-59|43]=_o++;var _o;zx.encode=function(e,r,n){for(var i=null,o=[],s=0,a=0,c;r<n;){var l=e[r++];switch(a){case 0:o[s++]=mp[l>>2],c=(l&3)<<4,a=1;break;case 1:o[s++]=mp[c|l>>4],c=(l&15)<<2,a=2;break;case 2:o[s++]=mp[c|l>>6],o[s++]=mp[l&63],a=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=mp[c],o[s++]=61,a===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var EQ="invalid encoding";zx.decode=function(e,r,n){for(var i=n,o=0,s,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&o>1)break;if((c=vQ[c])===void 0)throw Error(EQ);switch(o){case 0:s=c,o=1;break;case 1:r[n++]=s<<2|(c&48)>>4,s=c,o=2;break;case 2:r[n++]=(s&15)<<4|(c&60)>>2,s=c,o=3;break;case 3:r[n++]=(s&3)<<6|c,o=0;break}}if(o===1)throw Error(EQ);return n-i};zx.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var xQ=y((vAt,wQ)=>{"use strict";wQ.exports=jx;function jx(){this._listeners=Object.create(null)}jx.prototype.on=function(e,r,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:n||this}),this};jx.prototype.off=function(e,r){if(e===void 0)this._listeners=Object.create(null);else if(r===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var i=0;i<n.length;)n[i].fn===r?n.splice(i,1):++i}return this};jx.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<r.length;)r[i].fn.apply(r[i++].ctx,n)}return this}});var NQ=y((bAt,OQ)=>{"use strict";OQ.exports=AQ(AQ);function AQ(t){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=r[3]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3]}function o(c,l,u){e[0]=c,l[u]=r[3],l[u+1]=r[2],l[u+2]=r[1],l[u+3]=r[0]}t.writeFloatLE=n?i:o,t.writeFloatBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],e[0]}function a(c,l){return r[3]=c[l],r[2]=c[l+1],r[1]=c[l+2],r[0]=c[l+3],e[0]}t.readFloatLE=n?s:a,t.readFloatBE=n?a:s})():(function(){function e(n,i,o,s){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var c=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-c)*8388608)&8388607;n((a<<31|c+127<<23|l)>>>0,o,s)}}t.writeFloatLE=e.bind(null,RQ),t.writeFloatBE=e.bind(null,CQ);function r(n,i,o){var s=n(i,o),a=(s>>31)*2+1,c=s>>>23&255,l=s&8388607;return c===255?l?NaN:a*(1/0):c===0?a*1401298464324817e-60*l:a*Math.pow(2,c-150)*(l+8388608)}t.readFloatLE=r.bind(null,IQ),t.readFloatBE=r.bind(null,PQ)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=r[7]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3],l[u+4]=r[4],l[u+5]=r[5],l[u+6]=r[6],l[u+7]=r[7]}function o(c,l,u){e[0]=c,l[u]=r[7],l[u+1]=r[6],l[u+2]=r[5],l[u+3]=r[4],l[u+4]=r[3],l[u+5]=r[2],l[u+6]=r[1],l[u+7]=r[0]}t.writeDoubleLE=n?i:o,t.writeDoubleBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],r[4]=c[l+4],r[5]=c[l+5],r[6]=c[l+6],r[7]=c[l+7],e[0]}function a(c,l){return r[7]=c[l],r[6]=c[l+1],r[5]=c[l+2],r[4]=c[l+3],r[3]=c[l+4],r[2]=c[l+5],r[1]=c[l+6],r[0]=c[l+7],e[0]}t.readDoubleLE=n?s:a,t.readDoubleBE=n?a:s})():(function(){function e(n,i,o,s,a,c){var l=s<0?1:0;if(l&&(s=-s),s===0)n(0,a,c+i),n(1/s>0?0:2147483648,a,c+o);else if(isNaN(s))n(0,a,c+i),n(2146959360,a,c+o);else if(s>17976931348623157e292)n(0,a,c+i),n((l<<31|2146435072)>>>0,a,c+o);else{var u;if(s<22250738585072014e-324)u=s/5e-324,n(u>>>0,a,c+i),n((l<<31|u/4294967296)>>>0,a,c+o);else{var d=Math.floor(Math.log(s)/Math.LN2);d===1024&&(d=1023),u=s*Math.pow(2,-d),n(u*4503599627370496>>>0,a,c+i),n((l<<31|d+1023<<20|u*1048576&1048575)>>>0,a,c+o)}}}t.writeDoubleLE=e.bind(null,RQ,0,4),t.writeDoubleBE=e.bind(null,CQ,4,0);function r(n,i,o,s,a){var c=n(s,a+i),l=n(s,a+o),u=(l>>31)*2+1,d=l>>>20&2047,f=4294967296*(l&1048575)+c;return d===2047?f?NaN:u*(1/0):d===0?u*5e-324*f:u*Math.pow(2,d-1075)*(f+4503599627370496)}t.readDoubleLE=r.bind(null,IQ,0,4),t.readDoubleBE=r.bind(null,PQ,4,0)})(),t}function RQ(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function CQ(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function IQ(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function PQ(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var MQ=y((TAt,kQ)=>{"use strict";kQ.exports=yke;function yke(t){try{if(typeof Z!="function")return null;var e=Z(t);return e&&(e.length||Object.keys(e).length)?e:null}catch{return null}}});var DQ=y($Q=>{"use strict";var cD=$Q,aD="\uFFFD";cD.length=function(e){for(var r=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?r+=1:n<2048?r+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,r+=4):r+=3;return r};cD.read=function(e,r,n){if(n-r<1)return"";for(var i="",o=r;o<n;){var s=e[o++];if(s<=127)i+=String.fromCharCode(s);else if(s>=192&&s<224){var a=(s&31)<<6|e[o++]&63;i+=a>=128?String.fromCharCode(a):aD}else if(s>=224&&s<240){var c=(s&15)<<12|(e[o++]&63)<<6|e[o++]&63;i+=c>=2048?String.fromCharCode(c):aD}else if(s>=240){var l=(s&7)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63;l<65536||l>1114111?i+=aD:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i};cD.write=function(e,r,n){for(var i=n,o,s,a=0;a<e.length;++a)o=e.charCodeAt(a),o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++a,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128);return n-i}});var UQ=y((AAt,LQ)=>{"use strict";LQ.exports=Ske;function Ske(t,e,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(c){if(c<1||c>i)return t(c);s+c>n&&(o=t(n),s=0);var l=e.call(o,s,s+=c);return s&7&&(s=(s|7)+1),l}}});var zQ=y((RAt,FQ)=>{"use strict";FQ.exports=Rr;var Ay=yo();function Rr(t,e){this.lo=t>>>0,this.hi=e>>>0}var Du=Rr.zero=new Rr(0,0);Du.toNumber=function(){return 0};Du.zzEncode=Du.zzDecode=function(){return this};Du.length=function(){return 1};var Eke=Rr.zeroHash="\0\0\0\0\0\0\0\0";Rr.fromNumber=function(e){if(e===0)return Du;var r=e<0;r&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new Rr(n,i)};Rr.from=function(e){if(typeof e=="number")return Rr.fromNumber(e);if(Ay.isString(e))if(Ay.Long)e=Ay.Long.fromString(e);else return Rr.fromNumber(parseInt(e,10));return e.low||e.high?new Rr(e.low>>>0,e.high>>>0):Du};Rr.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,n=~this.hi>>>0;return r||(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296};Rr.prototype.toLong=function(e){return Ay.Long?new Ay.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var kc=String.prototype.charCodeAt;Rr.fromHash=function(e){return e===Eke?Du:new Rr((kc.call(e,0)|kc.call(e,1)<<8|kc.call(e,2)<<16|kc.call(e,3)<<24)>>>0,(kc.call(e,4)|kc.call(e,5)<<8|kc.call(e,6)<<16|kc.call(e,7)<<24)>>>0)};Rr.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Rr.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};Rr.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};Rr.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}});var uD=y((Ry,lD)=>{"use strict";(function(t,e){function r(n){return n.default||n}typeof define=="function"&&define.amd?define([],function(){var n={};return e(n),r(n)}):typeof Ry=="object"?(e(Ry),typeof lD=="object"&&(lD.exports=r(Ry))):(function(){var n={};e(n),t.Long=r(n)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:Ry,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(M,S,w){this.low=M|0,this.high=S|0,this.unsigned=!!w}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n(M){return(M&&M.__isLong__)===!0}function i(M){var S=Math.clz32(M&-M);return M?31-S:S}r.isLong=n;var o={},s={};function a(M,S){var w,O,Y;return S?(M>>>=0,(Y=0<=M&&M<256)&&(O=s[M],O)?O:(w=l(M,0,!0),Y&&(s[M]=w),w)):(M|=0,(Y=-128<=M&&M<128)&&(O=o[M],O)?O:(w=l(M,M<0?-1:0,!1),Y&&(o[M]=w),w))}r.fromInt=a;function c(M,S){if(isNaN(M))return S?b:T;if(S){if(M<0)return b;if(M>=g)return D}else{if(M<=-_)return F;if(M+1>=_)return N}return M<0?c(-M,S).neg():l(M%m|0,M/m|0,S)}r.fromNumber=c;function l(M,S,w){return new r(M,S,w)}r.fromBits=l;var u=Math.pow;function d(M,S,w){if(M.length===0)throw Error("empty string");if(typeof S=="number"?(w=S,S=!1):S=!!S,M==="NaN"||M==="Infinity"||M==="+Infinity"||M==="-Infinity")return S?b:T;if(w=w||10,w<2||36<w)throw RangeError("radix");var O;if((O=M.indexOf("-"))>0)throw Error("interior hyphen");if(O===0)return d(M.substring(1),S,w).neg();for(var Y=c(u(w,8)),H=T,he=0;he<M.length;he+=8){var je=Math.min(8,M.length-he),Ie=parseInt(M.substring(he,he+je),w);if(je<8){var $e=c(u(w,je));H=H.mul($e).add(c(Ie))}else H=H.mul(Y),H=H.add(c(Ie))}return H.unsigned=S,H}r.fromString=d;function f(M,S){return typeof M=="number"?c(M,S):typeof M=="string"?d(M,S):l(M.low,M.high,typeof S=="boolean"?S:M.unsigned)}r.fromValue=f;var p=65536,h=1<<24,m=p*p,g=m*m,_=g/2,v=a(h),T=a(0);r.ZERO=T;var b=a(0,!0);r.UZERO=b;var A=a(1);r.ONE=A;var k=a(1,!0);r.UONE=k;var P=a(-1);r.NEG_ONE=P;var N=l(-1,2147483647,!1);r.MAX_VALUE=N;var D=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=D;var F=l(0,-2147483648,!1);r.MIN_VALUE=F;var E=r.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},E.toString=function(S){if(S=S||10,S<2||36<S)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(F)){var w=c(S),O=this.div(w),Y=O.mul(w).sub(this);return O.toString(S)+Y.toInt().toString(S)}else return"-"+this.neg().toString(S);for(var H=c(u(S,6),this.unsigned),he=this,je="";;){var Ie=he.div(H),$e=he.sub(Ie.mul(H)).toInt()>>>0,Oe=$e.toString(S);if(he=Ie,he.isZero())return Oe+je;for(;Oe.length<6;)Oe="0"+Oe;je=""+Oe+je}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(F)?64:this.neg().getNumBitsAbs();for(var S=this.high!=0?this.high:this.low,w=31;w>0&&(S&1<<w)==0;w--);return this.high!=0?w+33:w+1},E.isSafeInteger=function(){var S=this.high>>21;return S?this.unsigned?!1:S===-1&&!(this.low===0&&this.high===-2097152):!0},E.isZero=function(){return this.high===0&&this.low===0},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return(this.low&1)===1},E.isEven=function(){return(this.low&1)===0},E.equals=function(S){return n(S)||(S=f(S)),this.unsigned!==S.unsigned&&this.high>>>31===1&&S.high>>>31===1?!1:this.high===S.high&&this.low===S.low},E.eq=E.equals,E.notEquals=function(S){return!this.eq(S)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(S){return this.comp(S)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(S){return this.comp(S)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(S){return this.comp(S)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(S){return this.comp(S)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(S){if(n(S)||(S=f(S)),this.eq(S))return 0;var w=this.isNegative(),O=S.isNegative();return w&&!O?-1:!w&&O?1:this.unsigned?S.high>>>0>this.high>>>0||S.high===this.high&&S.low>>>0>this.low>>>0?-1:1:this.sub(S).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(F)?F:this.not().add(A)},E.neg=E.negate,E.add=function(S){n(S)||(S=f(S));var w=this.high>>>16,O=this.high&65535,Y=this.low>>>16,H=this.low&65535,he=S.high>>>16,je=S.high&65535,Ie=S.low>>>16,$e=S.low&65535,Oe=0,Je=0,Ne=0,ce=0;return ce+=H+$e,Ne+=ce>>>16,ce&=65535,Ne+=Y+Ie,Je+=Ne>>>16,Ne&=65535,Je+=O+je,Oe+=Je>>>16,Je&=65535,Oe+=w+he,Oe&=65535,l(Ne<<16|ce,Oe<<16|Je,this.unsigned)},E.subtract=function(S){return n(S)||(S=f(S)),this.add(S.neg())},E.sub=E.subtract,E.multiply=function(S){if(this.isZero())return this;if(n(S)||(S=f(S)),e){var w=e.mul(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(S.isZero())return this.unsigned?b:T;if(this.eq(F))return S.isOdd()?F:T;if(S.eq(F))return this.isOdd()?F:T;if(this.isNegative())return S.isNegative()?this.neg().mul(S.neg()):this.neg().mul(S).neg();if(S.isNegative())return this.mul(S.neg()).neg();if(this.lt(v)&&S.lt(v))return c(this.toNumber()*S.toNumber(),this.unsigned);var O=this.high>>>16,Y=this.high&65535,H=this.low>>>16,he=this.low&65535,je=S.high>>>16,Ie=S.high&65535,$e=S.low>>>16,Oe=S.low&65535,Je=0,Ne=0,ce=0,me=0;return me+=he*Oe,ce+=me>>>16,me&=65535,ce+=H*Oe,Ne+=ce>>>16,ce&=65535,ce+=he*$e,Ne+=ce>>>16,ce&=65535,Ne+=Y*Oe,Je+=Ne>>>16,Ne&=65535,Ne+=H*$e,Je+=Ne>>>16,Ne&=65535,Ne+=he*Ie,Je+=Ne>>>16,Ne&=65535,Je+=O*Oe+Y*$e+H*Ie+he*je,Je&=65535,l(ce<<16|me,Je<<16|Ne,this.unsigned)},E.mul=E.multiply,E.divide=function(S){if(n(S)||(S=f(S)),S.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&S.low===-1&&S.high===-1)return this;var w=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?b:T;var O,Y,H;if(this.unsigned){if(S.unsigned||(S=S.toUnsigned()),S.gt(this))return b;if(S.gt(this.shru(1)))return k;H=b}else{if(this.eq(F)){if(S.eq(A)||S.eq(P))return F;if(S.eq(F))return A;var he=this.shr(1);return O=he.div(S).shl(1),O.eq(T)?S.isNegative()?A:P:(Y=this.sub(S.mul(O)),H=O.add(Y.div(S)),H)}else if(S.eq(F))return this.unsigned?b:T;if(this.isNegative())return S.isNegative()?this.neg().div(S.neg()):this.neg().div(S).neg();if(S.isNegative())return this.div(S.neg()).neg();H=T}for(Y=this;Y.gte(S);){O=Math.max(1,Math.floor(Y.toNumber()/S.toNumber()));for(var je=Math.ceil(Math.log(O)/Math.LN2),Ie=je<=48?1:u(2,je-48),$e=c(O),Oe=$e.mul(S);Oe.isNegative()||Oe.gt(Y);)O-=Ie,$e=c(O,this.unsigned),Oe=$e.mul(S);$e.isZero()&&($e=A),H=H.add($e),Y=Y.sub(Oe)}return H},E.div=E.divide,E.modulo=function(S){if(n(S)||(S=f(S)),e){var w=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}return this.sub(this.div(S).mul(S))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return l(~this.low,~this.high,this.unsigned)},E.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},E.clz=E.countLeadingZeros,E.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},E.ctz=E.countTrailingZeros,E.and=function(S){return n(S)||(S=f(S)),l(this.low&S.low,this.high&S.high,this.unsigned)},E.or=function(S){return n(S)||(S=f(S)),l(this.low|S.low,this.high|S.high,this.unsigned)},E.xor=function(S){return n(S)||(S=f(S)),l(this.low^S.low,this.high^S.high,this.unsigned)},E.shiftLeft=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low<<S,this.high<<S|this.low>>>32-S,this.unsigned):l(0,this.low<<S-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>S,this.unsigned):l(this.high>>S-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>>S,this.unsigned):S===32?l(this.high,0,this.unsigned):l(this.high>>>S-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.rotateLeft=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.low<<S|this.high>>>w,this.high<<S|this.low>>>w,this.unsigned)):(S-=32,w=32-S,l(this.high<<S|this.low>>>w,this.low<<S|this.high>>>w,this.unsigned))},E.rotl=E.rotateLeft,E.rotateRight=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.high<<w|this.low>>>S,this.low<<w|this.high>>>S,this.unsigned)):(S-=32,w=32-S,l(this.low<<w|this.high>>>S,this.high<<w|this.low>>>S,this.unsigned))},E.rotr=E.rotateRight,E.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},E.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var S=this.high,w=this.low;return[w&255,w>>>8&255,w>>>16&255,w>>>24,S&255,S>>>8&255,S>>>16&255,S>>>24]},E.toBytesBE=function(){var S=this.high,w=this.low;return[S>>>24,S>>>16&255,S>>>8&255,S&255,w>>>24,w>>>16&255,w>>>8&255,w&255]},r.fromBytes=function(S,w,O){return O?r.fromBytesLE(S,w):r.fromBytesBE(S,w)},r.fromBytesLE=function(S,w){return new r(S[0]|S[1]<<8|S[2]<<16|S[3]<<24,S[4]|S[5]<<8|S[6]<<16|S[7]<<24,w)},r.fromBytesBE=function(S,w){return new r(S[4]<<24|S[5]<<16|S[6]<<8|S[7],S[0]<<24|S[1]<<16|S[2]<<8|S[3],w)},typeof BigInt=="function"&&(r.fromBigInt=function(S,w){var O=Number(BigInt.asIntN(32,S)),Y=Number(BigInt.asIntN(32,S>>BigInt(32)));return l(O,Y,w)},r.fromValue=function(S,w){return typeof S=="bigint"?r.fromBigInt(S,w):f(S,w)},E.toBigInt=function(){var S=BigInt(this.low>>>0),w=BigInt(this.unsigned?this.high>>>0:this.high);return w<<BigInt(32)|S});var oe=t.default=r})});var yo=y(dD=>{"use strict";var xe=dD;xe.asPromise=sD();xe.base64=TQ();xe.EventEmitter=xQ();xe.float=NQ();xe.inquire=MQ();xe.utf8=DQ();xe.pool=UQ();xe.LongBits=zQ();function jQ(t){return t==="__proto__"||t==="prototype"||t==="constructor"}xe.isUnsafeProperty=jQ;xe.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);xe.global=xe.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||dD;xe.emptyArray=Object.freeze?Object.freeze([]):[];xe.emptyObject=Object.freeze?Object.freeze({}):{};xe.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};xe.isString=function(e){return typeof e=="string"||e instanceof String};xe.isObject=function(e){return e&&typeof e=="object"};xe.isset=xe.isSet=function(e,r){var n=e[r];return n!=null&&e.hasOwnProperty(r)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};xe.Buffer=(function(){try{var t=xe.global.Buffer;return t.prototype.utf8Write?t:null}catch{return null}})();xe._Buffer_from=null;xe._Buffer_allocUnsafe=null;xe.newBuffer=function(e){return typeof e=="number"?xe.Buffer?xe._Buffer_allocUnsafe(e):new xe.Array(e):xe.Buffer?xe._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};xe.Array=typeof Uint8Array<"u"?Uint8Array:Array;xe.Long=xe.global.dcodeIO&&xe.global.dcodeIO.Long||xe.global.Long||(function(){try{var t=uD();return t&&t.isLong?t:null}catch{return null}})();xe.key2Re=/^true|false|0|1$/;xe.key32Re=/^-?(?:0|[1-9][0-9]*)$/;xe.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;xe.longToHash=function(e){return e?xe.LongBits.from(e).toHash():xe.LongBits.zeroHash};xe.longFromHash=function(e,r){var n=xe.LongBits.fromHash(e);return xe.Long?xe.Long.fromBits(n.lo,n.hi,r):n.toNumber(!!r)};function BQ(t){var e=typeof arguments[arguments.length-1]=="boolean",r=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var n=1;n<r;++n){var i=arguments[n];if(i)for(var o=Object.keys(i),s=0;s<o.length;++s)!jQ(o[s])&&(t[o[s]]===void 0||!e)&&(t[o[s]]=i[o[s]])}return t}xe.merge=BQ;xe.nestingLimit=32;xe.recursionLimit=100;xe.makeProp=function(e,r){Object.defineProperty(e,r,{enumerable:!0,configurable:!0,writable:!0})};xe.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function qQ(t){function e(r,n){if(!(this instanceof e))return new e(r,n);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&BQ(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}xe.newError=qQ;xe.ProtocolError=qQ("ProtocolError");xe.oneOfGetter=function(e){for(var r={},n=0;n<e.length;++n)r[e[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(r[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};xe.oneOfSetter=function(e){return function(r){for(var n=0;n<e.length;++n)e[n]!==r&&delete this[e[n]]}};xe.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};xe._configure=function(){var t=xe.Buffer;if(!t){xe._Buffer_from=xe._Buffer_allocUnsafe=null;return}xe._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,n){return new t(r,n)},xe._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var qx=y((IAt,WQ)=>{"use strict";WQ.exports=ft;var Ui=yo(),fD,Bx=Ui.LongBits,VQ=Ui.base64,GQ=Ui.utf8;function Cy(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function hD(){}function vke(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function ft(){this.len=0,this.head=new Cy(hD,0,0),this.tail=this.head,this.states=null}var HQ=function(){return Ui.Buffer?function(){return(ft.create=function(){return new fD})()}:function(){return new ft}};ft.create=HQ();ft.alloc=function(e){return new Ui.Array(e)};Ui.Array!==Array&&(ft.alloc=Ui.pool(ft.alloc,Ui.Array.prototype.subarray));ft.prototype._push=function(e,r,n){return this.tail=this.tail.next=new Cy(e,r,n),this.len+=r,this};function mD(t,e,r){e[r]=t&255}function bke(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function gD(t,e){this.len=t,this.next=void 0,this.val=e}gD.prototype=Object.create(Cy.prototype);gD.prototype.fn=bke;ft.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new gD((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};ft.prototype.int32=function(e){return(e|=0)<0?this._push(_D,10,Bx.fromNumber(e)):this.uint32(e)};ft.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function _D(t,e,r){for(var n=t.lo,i=t.hi;i;)e[r++]=n&127|128,n=(n>>>7|i<<25)>>>0,i>>>=7;for(;n>127;)e[r++]=n&127|128,n=n>>>7;e[r++]=n}ft.prototype.uint64=function(e){var r=Bx.from(e);return this._push(_D,r.length(),r)};ft.prototype.int64=ft.prototype.uint64;ft.prototype.sint64=function(e){var r=Bx.from(e).zzEncode();return this._push(_D,r.length(),r)};ft.prototype.bool=function(e){return this._push(mD,1,e?1:0)};function pD(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}ft.prototype.fixed32=function(e){return this._push(pD,4,e>>>0)};ft.prototype.sfixed32=ft.prototype.fixed32;ft.prototype.fixed64=function(e){var r=Bx.from(e);return this._push(pD,4,r.lo)._push(pD,4,r.hi)};ft.prototype.sfixed64=ft.prototype.fixed64;ft.prototype.float=function(e){return this._push(Ui.float.writeFloatLE,4,e)};ft.prototype.double=function(e){return this._push(Ui.float.writeDoubleLE,8,e)};var Tke=Ui.Array.prototype.set?function(e,r,n){r.set(e,n)}:function(e,r,n){for(var i=0;i<e.length;++i)r[n+i]=e[i]};ft.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(mD,1,0);if(Ui.isString(e)){var n=ft.alloc(r=VQ.length(e));VQ.decode(e,n,0),e=n}return this.uint32(r)._push(Tke,r,e)};ft.prototype.string=function(e){var r=GQ.length(e);return r?this.uint32(r)._push(GQ.write,r,e):this._push(mD,1,0)};ft.prototype.fork=function(){return this.states=new vke(this),this.head=this.tail=new Cy(hD,0,0),this.len=0,this};ft.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Cy(hD,0,0),this.len=0),this};ft.prototype.ldelim=function(){var e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=r,this.len+=n),this};ft.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r};ft._configure=function(t){fD=t,ft.create=HQ(),fD._configure()}});var ZQ=y((PAt,KQ)=>{"use strict";KQ.exports=cs;var YQ=qx();(cs.prototype=Object.create(YQ.prototype)).constructor=cs;var Mc=yo();function cs(){YQ.call(this)}cs._configure=function(){cs.alloc=Mc._Buffer_allocUnsafe,cs.writeBytesBuffer=Mc.Buffer&&Mc.Buffer.prototype instanceof Uint8Array&&Mc.Buffer.prototype.set.name==="set"?function(e,r,n){r.set(e,n)}:function(e,r,n){if(e.copy)e.copy(r,n,0,e.length);else for(var i=0;i<e.length;)r[n++]=e[i++]}};cs.prototype.bytes=function(e){Mc.isString(e)&&(e=Mc._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(cs.writeBytesBuffer,r,e),this};function wke(t,e,r){t.length<40?Mc.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}cs.prototype.string=function(e){var r=Mc.Buffer.byteLength(e);return this.uint32(r),r&&this._push(wke,r,e),this};cs._configure()});var Gx=y((OAt,t7)=>{"use strict";t7.exports=Wt;var Fi=yo(),SD,QQ=Fi.LongBits,xke=Fi.utf8;function So(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Wt(t){this.buf=t,this.pos=0,this.len=t.length}var JQ=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Wt(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Wt(e);throw Error("illegal buffer")},e7=function(){return Fi.Buffer?function(r){return(Wt.create=function(i){return Fi.Buffer.isBuffer(i)?new SD(i):JQ(i)})(r)}:JQ};Wt.create=e7();Wt.prototype._slice=Fi.Array.prototype.subarray||Fi.Array.prototype.slice;Wt.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,So(this,10);return e}})();Wt.prototype.int32=function(){return this.uint32()|0};Wt.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function yD(){var t=new QQ(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw So(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw So(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}Wt.prototype.bool=function(){return this.uint32()!==0};function Vx(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Wt.prototype.fixed32=function(){if(this.pos+4>this.len)throw So(this,4);return Vx(this.buf,this.pos+=4)};Wt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw So(this,4);return Vx(this.buf,this.pos+=4)|0};function XQ(){if(this.pos+8>this.len)throw So(this,8);return new QQ(Vx(this.buf,this.pos+=4),Vx(this.buf,this.pos+=4))}Wt.prototype.float=function(){if(this.pos+4>this.len)throw So(this,4);var e=Fi.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Wt.prototype.double=function(){if(this.pos+8>this.len)throw So(this,4);var e=Fi.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Wt.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw So(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=Fi.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)};Wt.prototype.string=function(){var e=this.bytes();return xke.read(e,0,e.length)};Wt.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw So(this,e);this.pos+=e}else do if(this.pos>=this.len)throw So(this);while(this.buf[this.pos++]&128);return this};Wt.recursionLimit=Fi.recursionLimit;Wt.prototype.skipType=function(t,e){if(e===void 0&&(e=0),e>Wt.recursionLimit)throw Error("maximum nesting depth exceeded");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t,e+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Wt._configure=function(t){SD=t,Wt.create=e7(),SD._configure();var e=Fi.Long?"toLong":"toNumber";Fi.merge(Wt.prototype,{int64:function(){return yD.call(this)[e](!1)},uint64:function(){return yD.call(this)[e](!0)},sint64:function(){return yD.call(this).zzDecode()[e](!1)},fixed64:function(){return XQ.call(this)[e](!0)},sfixed64:function(){return XQ.call(this)[e](!1)}})}});var o7=y((NAt,i7)=>{"use strict";i7.exports=Lu;var n7=Gx();(Lu.prototype=Object.create(n7.prototype)).constructor=Lu;var r7=yo();function Lu(t){n7.call(this,t)}Lu._configure=function(){r7.Buffer&&(Lu.prototype._slice=r7.Buffer.prototype.slice)};Lu.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Lu._configure()});var a7=y((kAt,s7)=>{"use strict";s7.exports=Iy;var ED=yo();(Iy.prototype=Object.create(ED.EventEmitter.prototype)).constructor=Iy;function Iy(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");ED.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!r}Iy.prototype.rpcCall=function t(e,r,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return ED.asPromise(t,s,e,r,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(e,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(c,l){if(c)return s.emit("error",c,e),o(c);if(l===null){s.end(!0);return}if(!(l instanceof n))try{l=n[s.responseDelimited?"decodeDelimited":"decode"](l)}catch(u){return s.emit("error",u,e),o(u)}return s.emit("data",l,e),o(null,l)})}catch(a){s.emit("error",a,e),setTimeout(function(){o(a)},0);return}};Iy.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var vD=y(c7=>{"use strict";var Ake=c7;Ake.Service=a7()});var bD=y(($At,l7)=>{"use strict";l7.exports={}});var f7=y(d7=>{"use strict";var qn=d7;qn.build="minimal";qn.Writer=qx();qn.BufferWriter=ZQ();qn.Reader=Gx();qn.BufferReader=o7();qn.util=yo();qn.rpc=vD();qn.roots=bD();qn.configure=u7;function u7(){qn.util._configure(),qn.Writer._configure(qn.BufferWriter),qn.Reader._configure(qn.BufferReader)}u7()});var h7=y((LAt,p7)=>{"use strict";p7.exports=TD;var Rke=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;function TD(t,e){typeof t=="string"&&(e=t,t=void 0);var r=[];function n(o){if(typeof o!="string"){var s=i();if(TD.verbose&&console.log("codegen: "+s),s="return "+s,o){for(var a=Object.keys(o),c=new Array(a.length+1),l=new Array(a.length),u=0;u<a.length;)c[u]=a[u],l[u]=o[a[u++]];return c[u]=s,Function.apply(null,c).apply(null,l)}return Function(s)()}for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f]=arguments[++f];if(f=0,o=o.replace(/%([%dfijs])/g,function(h,m){var g=d[f++];switch(m){case"d":case"f":return String(Number(g));case"i":return String(Math.floor(g));case"j":return JSON.stringify(g);case"s":return String(g)}return"%"}),f!==d.length)throw Error("parameter count mismatch");return r.push(o),n}function i(o){return"function "+Cke(o||e)+"("+(t&&t.join(",")||"")+`){
|
|
6
|
+
`))||"no stack trace available"}var X$=class{constructor(e,r,n={}){var i,o;if(n=Object.assign({},n),this[dp]=(i=n.interceptors)!==null&&i!==void 0?i:[],delete n.interceptors,this[fp]=(o=n.interceptor_providers)!==null&&o!==void 0?o:[],delete n.interceptor_providers,this[dp].length>0&&this[fp].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[ha]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[go]=n.channelOverride;else if(n.channelFactoryOverride){let s=n.channelFactoryOverride;delete n.channelFactoryOverride,this[go]=s(e,r,n)}else this[go]=new _Ne.ChannelImplementation(e,r,n)}close(){this[go].close()}getChannel(){return this[go]}waitForReady(e,r){let n=i=>{if(i){r(new Error("Failed to connect before the deadline"));return}let o;try{o=this[go].getConnectivityState(!0)}catch{r(new Error("The channel has been closed"));return}if(o===yNe.ConnectivityState.READY)r();else try{this[go].watchConnectivityState(o,e,n)}catch{r(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,r,n){if(J$(e))return{metadata:new up.Metadata,options:{},callback:e};if(J$(r))return e instanceof up.Metadata?{metadata:e,options:{},callback:r}:{metadata:new up.Metadata,options:e,callback:r};if(!(e instanceof up.Metadata&&r instanceof Object&&J$(n)))throw new Error("Incorrect arguments passed");return{metadata:e,options:r,callback:n}}makeUnaryRequest(e,r,n,i,o,s,a){var c,l;let u=this.checkOptionalUnaryResponseArguments(o,s,a),d={path:e,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:n},f={argument:i,metadata:u.metadata,call:new as.ClientUnaryCallImpl,channel:this[go],methodDefinition:d,callOptions:u.options,callback:u.callback};this[ha]&&(f=this[ha](f));let p=f.call,h={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(c=f.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},m=(0,kx.getInterceptingCall)(h,f.methodDefinition,f.callOptions,f.channel);p.call=m;let g=null,_=!1,v=new Error;return m.start(f.metadata,{onReceiveMetadata:T=>{p.emit("metadata",T)},onReceiveMessage(T){g!==null&&m.cancelWithStatus(Nc.Status.UNIMPLEMENTED,"Too many responses received"),g=T},onReceiveStatus(T){if(!_){if(_=!0,T.code===Nc.Status.OK)if(g===null){let b=pp(v);f.callback((0,as.callErrorFromStatus)({code:Nc.Status.UNIMPLEMENTED,details:"No message received",metadata:T.metadata},b))}else f.callback(null,g);else{let b=pp(v);f.callback((0,as.callErrorFromStatus)(T,b))}v=null,p.emit("status",T)}}}),m.sendMessage(i),m.halfClose(),p}makeClientStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkOptionalUnaryResponseArguments(i,o,s),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:n},d={metadata:l.metadata,call:new as.ClientWritableStreamImpl(r),channel:this[go],methodDefinition:u,callOptions:l.options,callback:l.callback};this[ha]&&(d=this[ha](d));let f=d.call,p={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,kx.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=null,g=!1,_=new Error;return h.start(d.metadata,{onReceiveMetadata:v=>{f.emit("metadata",v)},onReceiveMessage(v){m!==null&&h.cancelWithStatus(Nc.Status.UNIMPLEMENTED,"Too many responses received"),m=v,h.startRead()},onReceiveStatus(v){if(!g){if(g=!0,v.code===Nc.Status.OK)if(m===null){let T=pp(_);d.callback((0,as.callErrorFromStatus)({code:Nc.Status.UNIMPLEMENTED,details:"No message received",metadata:v.metadata},T))}else d.callback(null,m);else{let T=pp(_);d.callback((0,as.callErrorFromStatus)(v,T))}_=null,f.emit("status",v)}}}),f}checkMetadataAndOptions(e,r){let n,i;return e instanceof up.Metadata?(n=e,r?i=r:i={}):(e?i=e:i={},n=new up.Metadata),{metadata:n,options:i}}makeServerStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkMetadataAndOptions(o,s),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:n},d={argument:i,metadata:l.metadata,call:new as.ClientReadableStreamImpl(n),channel:this[go],methodDefinition:u,callOptions:l.options};this[ha]&&(d=this[ha](d));let f=d.call,p={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,kx.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=!1,g=new Error;return h.start(d.metadata,{onReceiveMetadata(_){f.emit("metadata",_)},onReceiveMessage(_){f.push(_)},onReceiveStatus(_){if(!m){if(m=!0,f.push(null),_.code!==Nc.Status.OK){let v=pp(g);f.emit("error",(0,as.callErrorFromStatus)(_,v))}g=null,f.emit("status",_)}}}),h.sendMessage(i),h.halfClose(),f}makeBidiStreamRequest(e,r,n,i,o){var s,a;let c=this.checkMetadataAndOptions(i,o),l={path:e,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:n},u={metadata:c.metadata,call:new as.ClientDuplexStreamImpl(r,n),channel:this[go],methodDefinition:l,callOptions:c.options};this[ha]&&(u=this[ha](u));let d=u.call,f={clientInterceptors:this[dp],clientInterceptorProviders:this[fp],callInterceptors:(s=u.callOptions.interceptors)!==null&&s!==void 0?s:[],callInterceptorProviders:(a=u.callOptions.interceptor_providers)!==null&&a!==void 0?a:[]},p=(0,kx.getInterceptingCall)(f,u.methodDefinition,u.callOptions,u.channel);d.call=p;let h=!1,m=new Error;return p.start(u.metadata,{onReceiveMetadata(g){d.emit("metadata",g)},onReceiveMessage(g){d.push(g)},onReceiveStatus(g){if(!h){if(h=!0,d.push(null),g.code!==Nc.Status.OK){let _=pp(m);d.emit("error",(0,as.callErrorFromStatus)(g,_))}m=null,d.emit("status",g)}}}),d}};Mx.Client=X$});var Dx=y($x=>{"use strict";Object.defineProperty($x,"__esModule",{value:!0});$x.makeClientConstructor=WX;$x.loadPackageDefinition=bNe;var xy=Q$(),SNe={unary:xy.Client.prototype.makeUnaryRequest,server_stream:xy.Client.prototype.makeServerStreamRequest,client_stream:xy.Client.prototype.makeClientStreamRequest,bidi:xy.Client.prototype.makeBidiStreamRequest};function tD(t){return["__proto__","prototype","constructor"].includes(t)}function WX(t,e,r){r||(r={});class n extends xy.Client{}return Object.keys(t).forEach(i=>{if(tD(i))return;let o=t[i],s;if(typeof i=="string"&&i.charAt(0)==="$")throw new Error("Method names cannot start with $");o.requestStream?o.responseStream?s="bidi":s="client_stream":o.responseStream?s="server_stream":s="unary";let a=o.requestSerialize,c=o.responseDeserialize,l=ENe(SNe[s],o.path,a,c);n.prototype[i]=l,Object.assign(n.prototype[i],o),o.originalName&&!tD(o.originalName)&&(n.prototype[o.originalName]=n.prototype[i])}),n.service=t,n.serviceName=e,n}function ENe(t,e,r,n){return function(...i){return t.call(this,e,r,n,...i)}}function vNe(t){return"format"in t}function bNe(t){let e={};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r],i=r.split(".");if(i.some(a=>tD(a)))continue;let o=i[i.length-1],s=e;for(let a of i.slice(0,-1))s[a]||(s[a]={}),s=s[a];vNe(n)?s[o]=n:s[o]=WX(n,o,{})}return e}});var yQ=y((yAt,_Q)=>{"use strict";var TNe=1/0,wNe="[object Symbol]",xNe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ANe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ux="\\ud800-\\udfff",tQ="\\u0300-\\u036f\\ufe20-\\ufe23",rQ="\\u20d0-\\u20f0",nQ="\\u2700-\\u27bf",iQ="a-z\\xdf-\\xf6\\xf8-\\xff",RNe="\\xac\\xb1\\xd7\\xf7",CNe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",INe="\\u2000-\\u206f",PNe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",oQ="A-Z\\xc0-\\xd6\\xd8-\\xde",sQ="\\ufe0e\\ufe0f",aQ=RNe+CNe+INe+PNe,nD="['\u2019]",ONe="["+Ux+"]",YX="["+aQ+"]",Lx="["+tQ+rQ+"]",cQ="\\d+",NNe="["+nQ+"]",lQ="["+iQ+"]",uQ="[^"+Ux+aQ+cQ+nQ+iQ+oQ+"]",rD="\\ud83c[\\udffb-\\udfff]",kNe="(?:"+Lx+"|"+rD+")",dQ="[^"+Ux+"]",iD="(?:\\ud83c[\\udde6-\\uddff]){2}",oD="[\\ud800-\\udbff][\\udc00-\\udfff]",hp="["+oQ+"]",fQ="\\u200d",KX="(?:"+lQ+"|"+uQ+")",MNe="(?:"+hp+"|"+uQ+")",ZX="(?:"+nD+"(?:d|ll|m|re|s|t|ve))?",JX="(?:"+nD+"(?:D|LL|M|RE|S|T|VE))?",pQ=kNe+"?",hQ="["+sQ+"]?",$Ne="(?:"+fQ+"(?:"+[dQ,iD,oD].join("|")+")"+hQ+pQ+")*",mQ=hQ+pQ+$Ne,DNe="(?:"+[NNe,iD,oD].join("|")+")"+mQ,LNe="(?:"+[dQ+Lx+"?",Lx,iD,oD,ONe].join("|")+")",UNe=RegExp(nD,"g"),FNe=RegExp(Lx,"g"),zNe=RegExp(rD+"(?="+rD+")|"+LNe+mQ,"g"),jNe=RegExp([hp+"?"+lQ+"+"+ZX+"(?="+[YX,hp,"$"].join("|")+")",MNe+"+"+JX+"(?="+[YX,hp+KX,"$"].join("|")+")",hp+"?"+KX+"+"+ZX,hp+"+"+JX,cQ,DNe].join("|"),"g"),BNe=RegExp("["+fQ+Ux+tQ+rQ+sQ+"]"),qNe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,VNe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},GNe=typeof global=="object"&&global&&global.Object===Object&&global,HNe=typeof self=="object"&&self&&self.Object===Object&&self,WNe=GNe||HNe||Function("return this")();function YNe(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function KNe(t){return t.split("")}function ZNe(t){return t.match(xNe)||[]}function JNe(t){return function(e){return t?.[e]}}var XNe=JNe(VNe);function gQ(t){return BNe.test(t)}function QNe(t){return qNe.test(t)}function eke(t){return gQ(t)?tke(t):KNe(t)}function tke(t){return t.match(zNe)||[]}function rke(t){return t.match(jNe)||[]}var nke=Object.prototype,ike=nke.toString,XX=WNe.Symbol,QX=XX?XX.prototype:void 0,eQ=QX?QX.toString:void 0;function oke(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function ske(t){if(typeof t=="string")return t;if(dke(t))return eQ?eQ.call(t):"";var e=t+"";return e=="0"&&1/t==-TNe?"-0":e}function ake(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:oke(t,e,r)}function cke(t){return function(e){e=Fx(e);var r=gQ(e)?eke(e):void 0,n=r?r[0]:e.charAt(0),i=r?ake(r,1).join(""):e.slice(1);return n[t]()+i}}function lke(t){return function(e){return YNe(gke(hke(e).replace(UNe,"")),t,"")}}function uke(t){return!!t&&typeof t=="object"}function dke(t){return typeof t=="symbol"||uke(t)&&ike.call(t)==wNe}function Fx(t){return t==null?"":ske(t)}var fke=lke(function(t,e,r){return e=e.toLowerCase(),t+(r?pke(e):e)});function pke(t){return mke(Fx(t).toLowerCase())}function hke(t){return t=Fx(t),t&&t.replace(ANe,XNe).replace(FNe,"")}var mke=cke("toUpperCase");function gke(t,e,r){return t=Fx(t),e=r?void 0:e,e===void 0?QNe(t)?rke(t):ZNe(t):t.match(e)||[]}_Q.exports=fke});var sD=y((SAt,SQ)=>{"use strict";SQ.exports=_ke;function _ke(t,e){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(a,c){r[n]=function(u){if(o)if(o=!1,u)c(u);else{for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f++]=arguments[f];a.apply(null,d)}};try{t.apply(e||null,r)}catch(l){o&&(o=!1,c(l))}})}});var TQ=y(bQ=>{"use strict";var zx=bQ;zx.length=function(e){var r=e.length;if(!r)return 0;for(var n=0;--r%4>1&&e.charAt(r)==="=";)++n;return Math.ceil(e.length*3)/4-n};var mp=new Array(64),vQ=new Array(123);for(_o=0;_o<64;)vQ[mp[_o]=_o<26?_o+65:_o<52?_o+71:_o<62?_o-4:_o-59|43]=_o++;var _o;zx.encode=function(e,r,n){for(var i=null,o=[],s=0,a=0,c;r<n;){var l=e[r++];switch(a){case 0:o[s++]=mp[l>>2],c=(l&3)<<4,a=1;break;case 1:o[s++]=mp[c|l>>4],c=(l&15)<<2,a=2;break;case 2:o[s++]=mp[c|l>>6],o[s++]=mp[l&63],a=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=mp[c],o[s++]=61,a===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var EQ="invalid encoding";zx.decode=function(e,r,n){for(var i=n,o=0,s,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&o>1)break;if((c=vQ[c])===void 0)throw Error(EQ);switch(o){case 0:s=c,o=1;break;case 1:r[n++]=s<<2|(c&48)>>4,s=c,o=2;break;case 2:r[n++]=(s&15)<<4|(c&60)>>2,s=c,o=3;break;case 3:r[n++]=(s&3)<<6|c,o=0;break}}if(o===1)throw Error(EQ);return n-i};zx.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var xQ=y((vAt,wQ)=>{"use strict";wQ.exports=jx;function jx(){this._listeners=Object.create(null)}jx.prototype.on=function(e,r,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:n||this}),this};jx.prototype.off=function(e,r){if(e===void 0)this._listeners=Object.create(null);else if(r===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var i=0;i<n.length;)n[i].fn===r?n.splice(i,1):++i}return this};jx.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<r.length;)r[i].fn.apply(r[i++].ctx,n)}return this}});var NQ=y((bAt,OQ)=>{"use strict";OQ.exports=AQ(AQ);function AQ(t){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=r[3]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3]}function o(c,l,u){e[0]=c,l[u]=r[3],l[u+1]=r[2],l[u+2]=r[1],l[u+3]=r[0]}t.writeFloatLE=n?i:o,t.writeFloatBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],e[0]}function a(c,l){return r[3]=c[l],r[2]=c[l+1],r[1]=c[l+2],r[0]=c[l+3],e[0]}t.readFloatLE=n?s:a,t.readFloatBE=n?a:s})():(function(){function e(n,i,o,s){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var c=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-c)*8388608)&8388607;n((a<<31|c+127<<23|l)>>>0,o,s)}}t.writeFloatLE=e.bind(null,RQ),t.writeFloatBE=e.bind(null,CQ);function r(n,i,o){var s=n(i,o),a=(s>>31)*2+1,c=s>>>23&255,l=s&8388607;return c===255?l?NaN:a*(1/0):c===0?a*1401298464324817e-60*l:a*Math.pow(2,c-150)*(l+8388608)}t.readFloatLE=r.bind(null,IQ),t.readFloatBE=r.bind(null,PQ)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=r[7]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3],l[u+4]=r[4],l[u+5]=r[5],l[u+6]=r[6],l[u+7]=r[7]}function o(c,l,u){e[0]=c,l[u]=r[7],l[u+1]=r[6],l[u+2]=r[5],l[u+3]=r[4],l[u+4]=r[3],l[u+5]=r[2],l[u+6]=r[1],l[u+7]=r[0]}t.writeDoubleLE=n?i:o,t.writeDoubleBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],r[4]=c[l+4],r[5]=c[l+5],r[6]=c[l+6],r[7]=c[l+7],e[0]}function a(c,l){return r[7]=c[l],r[6]=c[l+1],r[5]=c[l+2],r[4]=c[l+3],r[3]=c[l+4],r[2]=c[l+5],r[1]=c[l+6],r[0]=c[l+7],e[0]}t.readDoubleLE=n?s:a,t.readDoubleBE=n?a:s})():(function(){function e(n,i,o,s,a,c){var l=s<0?1:0;if(l&&(s=-s),s===0)n(0,a,c+i),n(1/s>0?0:2147483648,a,c+o);else if(isNaN(s))n(0,a,c+i),n(2146959360,a,c+o);else if(s>17976931348623157e292)n(0,a,c+i),n((l<<31|2146435072)>>>0,a,c+o);else{var u;if(s<22250738585072014e-324)u=s/5e-324,n(u>>>0,a,c+i),n((l<<31|u/4294967296)>>>0,a,c+o);else{var d=Math.floor(Math.log(s)/Math.LN2);d===1024&&(d=1023),u=s*Math.pow(2,-d),n(u*4503599627370496>>>0,a,c+i),n((l<<31|d+1023<<20|u*1048576&1048575)>>>0,a,c+o)}}}t.writeDoubleLE=e.bind(null,RQ,0,4),t.writeDoubleBE=e.bind(null,CQ,4,0);function r(n,i,o,s,a){var c=n(s,a+i),l=n(s,a+o),u=(l>>31)*2+1,d=l>>>20&2047,f=4294967296*(l&1048575)+c;return d===2047?f?NaN:u*(1/0):d===0?u*5e-324*f:u*Math.pow(2,d-1075)*(f+4503599627370496)}t.readDoubleLE=r.bind(null,IQ,0,4),t.readDoubleBE=r.bind(null,PQ,4,0)})(),t}function RQ(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function CQ(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function IQ(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function PQ(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var MQ=y((TAt,kQ)=>{"use strict";kQ.exports=yke;function yke(t){try{if(typeof Z!="function")return null;var e=Z(t);return e&&(e.length||Object.keys(e).length)?e:null}catch{return null}}});var DQ=y($Q=>{"use strict";var cD=$Q,aD="\uFFFD";cD.length=function(e){for(var r=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?r+=1:n<2048?r+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,r+=4):r+=3;return r};cD.read=function(e,r,n){if(n-r<1)return"";for(var i="",o=r;o<n;){var s=e[o++];if(s<=127)i+=String.fromCharCode(s);else if(s>=192&&s<224){var a=(s&31)<<6|e[o++]&63;i+=a>=128?String.fromCharCode(a):aD}else if(s>=224&&s<240){var c=(s&15)<<12|(e[o++]&63)<<6|e[o++]&63;i+=c>=2048?String.fromCharCode(c):aD}else if(s>=240){var l=(s&7)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63;l<65536||l>1114111?i+=aD:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i};cD.write=function(e,r,n){for(var i=n,o,s,a=0;a<e.length;++a)o=e.charCodeAt(a),o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++a,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128);return n-i}});var UQ=y((AAt,LQ)=>{"use strict";LQ.exports=Ske;function Ske(t,e,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(c){if(c<1||c>i)return t(c);s+c>n&&(o=t(n),s=0);var l=e.call(o,s,s+=c);return s&7&&(s=(s|7)+1),l}}});var zQ=y((RAt,FQ)=>{"use strict";FQ.exports=Rr;var Ay=yo();function Rr(t,e){this.lo=t>>>0,this.hi=e>>>0}var Du=Rr.zero=new Rr(0,0);Du.toNumber=function(){return 0};Du.zzEncode=Du.zzDecode=function(){return this};Du.length=function(){return 1};var Eke=Rr.zeroHash="\0\0\0\0\0\0\0\0";Rr.fromNumber=function(e){if(e===0)return Du;var r=e<0;r&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new Rr(n,i)};Rr.from=function(e){if(typeof e=="number")return Rr.fromNumber(e);if(Ay.isString(e))if(Ay.Long)e=Ay.Long.fromString(e);else return Rr.fromNumber(parseInt(e,10));return e.low||e.high?new Rr(e.low>>>0,e.high>>>0):Du};Rr.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,n=~this.hi>>>0;return r||(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296};Rr.prototype.toLong=function(e){return Ay.Long?new Ay.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var kc=String.prototype.charCodeAt;Rr.fromHash=function(e){return e===Eke?Du:new Rr((kc.call(e,0)|kc.call(e,1)<<8|kc.call(e,2)<<16|kc.call(e,3)<<24)>>>0,(kc.call(e,4)|kc.call(e,5)<<8|kc.call(e,6)<<16|kc.call(e,7)<<24)>>>0)};Rr.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Rr.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};Rr.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};Rr.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}});var uD=y((Ry,lD)=>{"use strict";(function(t,e){function r(n){return n.default||n}typeof define=="function"&&define.amd?define([],function(){var n={};return e(n),r(n)}):typeof Ry=="object"?(e(Ry),typeof lD=="object"&&(lD.exports=r(Ry))):(function(){var n={};e(n),t.Long=r(n)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:Ry,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(M,S,w){this.low=M|0,this.high=S|0,this.unsigned=!!w}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n(M){return(M&&M.__isLong__)===!0}function i(M){var S=Math.clz32(M&-M);return M?31-S:S}r.isLong=n;var o={},s={};function a(M,S){var w,O,Y;return S?(M>>>=0,(Y=0<=M&&M<256)&&(O=s[M],O)?O:(w=l(M,0,!0),Y&&(s[M]=w),w)):(M|=0,(Y=-128<=M&&M<128)&&(O=o[M],O)?O:(w=l(M,M<0?-1:0,!1),Y&&(o[M]=w),w))}r.fromInt=a;function c(M,S){if(isNaN(M))return S?b:T;if(S){if(M<0)return b;if(M>=g)return D}else{if(M<=-_)return F;if(M+1>=_)return N}return M<0?c(-M,S).neg():l(M%m|0,M/m|0,S)}r.fromNumber=c;function l(M,S,w){return new r(M,S,w)}r.fromBits=l;var u=Math.pow;function d(M,S,w){if(M.length===0)throw Error("empty string");if(typeof S=="number"?(w=S,S=!1):S=!!S,M==="NaN"||M==="Infinity"||M==="+Infinity"||M==="-Infinity")return S?b:T;if(w=w||10,w<2||36<w)throw RangeError("radix");var O;if((O=M.indexOf("-"))>0)throw Error("interior hyphen");if(O===0)return d(M.substring(1),S,w).neg();for(var Y=c(u(w,8)),H=T,he=0;he<M.length;he+=8){var je=Math.min(8,M.length-he),Ie=parseInt(M.substring(he,he+je),w);if(je<8){var $e=c(u(w,je));H=H.mul($e).add(c(Ie))}else H=H.mul(Y),H=H.add(c(Ie))}return H.unsigned=S,H}r.fromString=d;function f(M,S){return typeof M=="number"?c(M,S):typeof M=="string"?d(M,S):l(M.low,M.high,typeof S=="boolean"?S:M.unsigned)}r.fromValue=f;var p=65536,h=1<<24,m=p*p,g=m*m,_=g/2,v=a(h),T=a(0);r.ZERO=T;var b=a(0,!0);r.UZERO=b;var A=a(1);r.ONE=A;var k=a(1,!0);r.UONE=k;var P=a(-1);r.NEG_ONE=P;var N=l(-1,2147483647,!1);r.MAX_VALUE=N;var D=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=D;var F=l(0,-2147483648,!1);r.MIN_VALUE=F;var E=r.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},E.toString=function(S){if(S=S||10,S<2||36<S)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(F)){var w=c(S),O=this.div(w),Y=O.mul(w).sub(this);return O.toString(S)+Y.toInt().toString(S)}else return"-"+this.neg().toString(S);for(var H=c(u(S,6),this.unsigned),he=this,je="";;){var Ie=he.div(H),$e=he.sub(Ie.mul(H)).toInt()>>>0,Pe=$e.toString(S);if(he=Ie,he.isZero())return Pe+je;for(;Pe.length<6;)Pe="0"+Pe;je=""+Pe+je}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(F)?64:this.neg().getNumBitsAbs();for(var S=this.high!=0?this.high:this.low,w=31;w>0&&(S&1<<w)==0;w--);return this.high!=0?w+33:w+1},E.isSafeInteger=function(){var S=this.high>>21;return S?this.unsigned?!1:S===-1&&!(this.low===0&&this.high===-2097152):!0},E.isZero=function(){return this.high===0&&this.low===0},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return(this.low&1)===1},E.isEven=function(){return(this.low&1)===0},E.equals=function(S){return n(S)||(S=f(S)),this.unsigned!==S.unsigned&&this.high>>>31===1&&S.high>>>31===1?!1:this.high===S.high&&this.low===S.low},E.eq=E.equals,E.notEquals=function(S){return!this.eq(S)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(S){return this.comp(S)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(S){return this.comp(S)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(S){return this.comp(S)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(S){return this.comp(S)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(S){if(n(S)||(S=f(S)),this.eq(S))return 0;var w=this.isNegative(),O=S.isNegative();return w&&!O?-1:!w&&O?1:this.unsigned?S.high>>>0>this.high>>>0||S.high===this.high&&S.low>>>0>this.low>>>0?-1:1:this.sub(S).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(F)?F:this.not().add(A)},E.neg=E.negate,E.add=function(S){n(S)||(S=f(S));var w=this.high>>>16,O=this.high&65535,Y=this.low>>>16,H=this.low&65535,he=S.high>>>16,je=S.high&65535,Ie=S.low>>>16,$e=S.low&65535,Pe=0,He=0,Ne=0,ce=0;return ce+=H+$e,Ne+=ce>>>16,ce&=65535,Ne+=Y+Ie,He+=Ne>>>16,Ne&=65535,He+=O+je,Pe+=He>>>16,He&=65535,Pe+=w+he,Pe&=65535,l(Ne<<16|ce,Pe<<16|He,this.unsigned)},E.subtract=function(S){return n(S)||(S=f(S)),this.add(S.neg())},E.sub=E.subtract,E.multiply=function(S){if(this.isZero())return this;if(n(S)||(S=f(S)),e){var w=e.mul(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(S.isZero())return this.unsigned?b:T;if(this.eq(F))return S.isOdd()?F:T;if(S.eq(F))return this.isOdd()?F:T;if(this.isNegative())return S.isNegative()?this.neg().mul(S.neg()):this.neg().mul(S).neg();if(S.isNegative())return this.mul(S.neg()).neg();if(this.lt(v)&&S.lt(v))return c(this.toNumber()*S.toNumber(),this.unsigned);var O=this.high>>>16,Y=this.high&65535,H=this.low>>>16,he=this.low&65535,je=S.high>>>16,Ie=S.high&65535,$e=S.low>>>16,Pe=S.low&65535,He=0,Ne=0,ce=0,me=0;return me+=he*Pe,ce+=me>>>16,me&=65535,ce+=H*Pe,Ne+=ce>>>16,ce&=65535,ce+=he*$e,Ne+=ce>>>16,ce&=65535,Ne+=Y*Pe,He+=Ne>>>16,Ne&=65535,Ne+=H*$e,He+=Ne>>>16,Ne&=65535,Ne+=he*Ie,He+=Ne>>>16,Ne&=65535,He+=O*Pe+Y*$e+H*Ie+he*je,He&=65535,l(ce<<16|me,He<<16|Ne,this.unsigned)},E.mul=E.multiply,E.divide=function(S){if(n(S)||(S=f(S)),S.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&S.low===-1&&S.high===-1)return this;var w=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?b:T;var O,Y,H;if(this.unsigned){if(S.unsigned||(S=S.toUnsigned()),S.gt(this))return b;if(S.gt(this.shru(1)))return k;H=b}else{if(this.eq(F)){if(S.eq(A)||S.eq(P))return F;if(S.eq(F))return A;var he=this.shr(1);return O=he.div(S).shl(1),O.eq(T)?S.isNegative()?A:P:(Y=this.sub(S.mul(O)),H=O.add(Y.div(S)),H)}else if(S.eq(F))return this.unsigned?b:T;if(this.isNegative())return S.isNegative()?this.neg().div(S.neg()):this.neg().div(S).neg();if(S.isNegative())return this.div(S.neg()).neg();H=T}for(Y=this;Y.gte(S);){O=Math.max(1,Math.floor(Y.toNumber()/S.toNumber()));for(var je=Math.ceil(Math.log(O)/Math.LN2),Ie=je<=48?1:u(2,je-48),$e=c(O),Pe=$e.mul(S);Pe.isNegative()||Pe.gt(Y);)O-=Ie,$e=c(O,this.unsigned),Pe=$e.mul(S);$e.isZero()&&($e=A),H=H.add($e),Y=Y.sub(Pe)}return H},E.div=E.divide,E.modulo=function(S){if(n(S)||(S=f(S)),e){var w=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}return this.sub(this.div(S).mul(S))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return l(~this.low,~this.high,this.unsigned)},E.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},E.clz=E.countLeadingZeros,E.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},E.ctz=E.countTrailingZeros,E.and=function(S){return n(S)||(S=f(S)),l(this.low&S.low,this.high&S.high,this.unsigned)},E.or=function(S){return n(S)||(S=f(S)),l(this.low|S.low,this.high|S.high,this.unsigned)},E.xor=function(S){return n(S)||(S=f(S)),l(this.low^S.low,this.high^S.high,this.unsigned)},E.shiftLeft=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low<<S,this.high<<S|this.low>>>32-S,this.unsigned):l(0,this.low<<S-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>S,this.unsigned):l(this.high>>S-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>>S,this.unsigned):S===32?l(this.high,0,this.unsigned):l(this.high>>>S-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.rotateLeft=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.low<<S|this.high>>>w,this.high<<S|this.low>>>w,this.unsigned)):(S-=32,w=32-S,l(this.high<<S|this.low>>>w,this.low<<S|this.high>>>w,this.unsigned))},E.rotl=E.rotateLeft,E.rotateRight=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.high<<w|this.low>>>S,this.low<<w|this.high>>>S,this.unsigned)):(S-=32,w=32-S,l(this.low<<w|this.high>>>S,this.high<<w|this.low>>>S,this.unsigned))},E.rotr=E.rotateRight,E.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},E.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var S=this.high,w=this.low;return[w&255,w>>>8&255,w>>>16&255,w>>>24,S&255,S>>>8&255,S>>>16&255,S>>>24]},E.toBytesBE=function(){var S=this.high,w=this.low;return[S>>>24,S>>>16&255,S>>>8&255,S&255,w>>>24,w>>>16&255,w>>>8&255,w&255]},r.fromBytes=function(S,w,O){return O?r.fromBytesLE(S,w):r.fromBytesBE(S,w)},r.fromBytesLE=function(S,w){return new r(S[0]|S[1]<<8|S[2]<<16|S[3]<<24,S[4]|S[5]<<8|S[6]<<16|S[7]<<24,w)},r.fromBytesBE=function(S,w){return new r(S[4]<<24|S[5]<<16|S[6]<<8|S[7],S[0]<<24|S[1]<<16|S[2]<<8|S[3],w)},typeof BigInt=="function"&&(r.fromBigInt=function(S,w){var O=Number(BigInt.asIntN(32,S)),Y=Number(BigInt.asIntN(32,S>>BigInt(32)));return l(O,Y,w)},r.fromValue=function(S,w){return typeof S=="bigint"?r.fromBigInt(S,w):f(S,w)},E.toBigInt=function(){var S=BigInt(this.low>>>0),w=BigInt(this.unsigned?this.high>>>0:this.high);return w<<BigInt(32)|S});var oe=t.default=r})});var yo=y(dD=>{"use strict";var xe=dD;xe.asPromise=sD();xe.base64=TQ();xe.EventEmitter=xQ();xe.float=NQ();xe.inquire=MQ();xe.utf8=DQ();xe.pool=UQ();xe.LongBits=zQ();function jQ(t){return t==="__proto__"||t==="prototype"||t==="constructor"}xe.isUnsafeProperty=jQ;xe.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);xe.global=xe.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||dD;xe.emptyArray=Object.freeze?Object.freeze([]):[];xe.emptyObject=Object.freeze?Object.freeze({}):{};xe.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};xe.isString=function(e){return typeof e=="string"||e instanceof String};xe.isObject=function(e){return e&&typeof e=="object"};xe.isset=xe.isSet=function(e,r){var n=e[r];return n!=null&&e.hasOwnProperty(r)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};xe.Buffer=(function(){try{var t=xe.global.Buffer;return t.prototype.utf8Write?t:null}catch{return null}})();xe._Buffer_from=null;xe._Buffer_allocUnsafe=null;xe.newBuffer=function(e){return typeof e=="number"?xe.Buffer?xe._Buffer_allocUnsafe(e):new xe.Array(e):xe.Buffer?xe._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};xe.Array=typeof Uint8Array<"u"?Uint8Array:Array;xe.Long=xe.global.dcodeIO&&xe.global.dcodeIO.Long||xe.global.Long||(function(){try{var t=uD();return t&&t.isLong?t:null}catch{return null}})();xe.key2Re=/^true|false|0|1$/;xe.key32Re=/^-?(?:0|[1-9][0-9]*)$/;xe.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;xe.longToHash=function(e){return e?xe.LongBits.from(e).toHash():xe.LongBits.zeroHash};xe.longFromHash=function(e,r){var n=xe.LongBits.fromHash(e);return xe.Long?xe.Long.fromBits(n.lo,n.hi,r):n.toNumber(!!r)};function BQ(t){var e=typeof arguments[arguments.length-1]=="boolean",r=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var n=1;n<r;++n){var i=arguments[n];if(i)for(var o=Object.keys(i),s=0;s<o.length;++s)!jQ(o[s])&&(t[o[s]]===void 0||!e)&&(t[o[s]]=i[o[s]])}return t}xe.merge=BQ;xe.nestingLimit=32;xe.recursionLimit=100;xe.makeProp=function(e,r){Object.defineProperty(e,r,{enumerable:!0,configurable:!0,writable:!0})};xe.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function qQ(t){function e(r,n){if(!(this instanceof e))return new e(r,n);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&BQ(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}xe.newError=qQ;xe.ProtocolError=qQ("ProtocolError");xe.oneOfGetter=function(e){for(var r={},n=0;n<e.length;++n)r[e[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(r[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};xe.oneOfSetter=function(e){return function(r){for(var n=0;n<e.length;++n)e[n]!==r&&delete this[e[n]]}};xe.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};xe._configure=function(){var t=xe.Buffer;if(!t){xe._Buffer_from=xe._Buffer_allocUnsafe=null;return}xe._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,n){return new t(r,n)},xe._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var qx=y((IAt,WQ)=>{"use strict";WQ.exports=ft;var Ui=yo(),fD,Bx=Ui.LongBits,VQ=Ui.base64,GQ=Ui.utf8;function Cy(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function hD(){}function vke(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function ft(){this.len=0,this.head=new Cy(hD,0,0),this.tail=this.head,this.states=null}var HQ=function(){return Ui.Buffer?function(){return(ft.create=function(){return new fD})()}:function(){return new ft}};ft.create=HQ();ft.alloc=function(e){return new Ui.Array(e)};Ui.Array!==Array&&(ft.alloc=Ui.pool(ft.alloc,Ui.Array.prototype.subarray));ft.prototype._push=function(e,r,n){return this.tail=this.tail.next=new Cy(e,r,n),this.len+=r,this};function mD(t,e,r){e[r]=t&255}function bke(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function gD(t,e){this.len=t,this.next=void 0,this.val=e}gD.prototype=Object.create(Cy.prototype);gD.prototype.fn=bke;ft.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new gD((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};ft.prototype.int32=function(e){return(e|=0)<0?this._push(_D,10,Bx.fromNumber(e)):this.uint32(e)};ft.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function _D(t,e,r){for(var n=t.lo,i=t.hi;i;)e[r++]=n&127|128,n=(n>>>7|i<<25)>>>0,i>>>=7;for(;n>127;)e[r++]=n&127|128,n=n>>>7;e[r++]=n}ft.prototype.uint64=function(e){var r=Bx.from(e);return this._push(_D,r.length(),r)};ft.prototype.int64=ft.prototype.uint64;ft.prototype.sint64=function(e){var r=Bx.from(e).zzEncode();return this._push(_D,r.length(),r)};ft.prototype.bool=function(e){return this._push(mD,1,e?1:0)};function pD(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}ft.prototype.fixed32=function(e){return this._push(pD,4,e>>>0)};ft.prototype.sfixed32=ft.prototype.fixed32;ft.prototype.fixed64=function(e){var r=Bx.from(e);return this._push(pD,4,r.lo)._push(pD,4,r.hi)};ft.prototype.sfixed64=ft.prototype.fixed64;ft.prototype.float=function(e){return this._push(Ui.float.writeFloatLE,4,e)};ft.prototype.double=function(e){return this._push(Ui.float.writeDoubleLE,8,e)};var Tke=Ui.Array.prototype.set?function(e,r,n){r.set(e,n)}:function(e,r,n){for(var i=0;i<e.length;++i)r[n+i]=e[i]};ft.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(mD,1,0);if(Ui.isString(e)){var n=ft.alloc(r=VQ.length(e));VQ.decode(e,n,0),e=n}return this.uint32(r)._push(Tke,r,e)};ft.prototype.string=function(e){var r=GQ.length(e);return r?this.uint32(r)._push(GQ.write,r,e):this._push(mD,1,0)};ft.prototype.fork=function(){return this.states=new vke(this),this.head=this.tail=new Cy(hD,0,0),this.len=0,this};ft.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Cy(hD,0,0),this.len=0),this};ft.prototype.ldelim=function(){var e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=r,this.len+=n),this};ft.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r};ft._configure=function(t){fD=t,ft.create=HQ(),fD._configure()}});var ZQ=y((PAt,KQ)=>{"use strict";KQ.exports=cs;var YQ=qx();(cs.prototype=Object.create(YQ.prototype)).constructor=cs;var Mc=yo();function cs(){YQ.call(this)}cs._configure=function(){cs.alloc=Mc._Buffer_allocUnsafe,cs.writeBytesBuffer=Mc.Buffer&&Mc.Buffer.prototype instanceof Uint8Array&&Mc.Buffer.prototype.set.name==="set"?function(e,r,n){r.set(e,n)}:function(e,r,n){if(e.copy)e.copy(r,n,0,e.length);else for(var i=0;i<e.length;)r[n++]=e[i++]}};cs.prototype.bytes=function(e){Mc.isString(e)&&(e=Mc._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(cs.writeBytesBuffer,r,e),this};function wke(t,e,r){t.length<40?Mc.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}cs.prototype.string=function(e){var r=Mc.Buffer.byteLength(e);return this.uint32(r),r&&this._push(wke,r,e),this};cs._configure()});var Gx=y((OAt,t7)=>{"use strict";t7.exports=Wt;var Fi=yo(),SD,QQ=Fi.LongBits,xke=Fi.utf8;function So(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Wt(t){this.buf=t,this.pos=0,this.len=t.length}var JQ=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Wt(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Wt(e);throw Error("illegal buffer")},e7=function(){return Fi.Buffer?function(r){return(Wt.create=function(i){return Fi.Buffer.isBuffer(i)?new SD(i):JQ(i)})(r)}:JQ};Wt.create=e7();Wt.prototype._slice=Fi.Array.prototype.subarray||Fi.Array.prototype.slice;Wt.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,So(this,10);return e}})();Wt.prototype.int32=function(){return this.uint32()|0};Wt.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function yD(){var t=new QQ(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw So(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw So(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}Wt.prototype.bool=function(){return this.uint32()!==0};function Vx(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Wt.prototype.fixed32=function(){if(this.pos+4>this.len)throw So(this,4);return Vx(this.buf,this.pos+=4)};Wt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw So(this,4);return Vx(this.buf,this.pos+=4)|0};function XQ(){if(this.pos+8>this.len)throw So(this,8);return new QQ(Vx(this.buf,this.pos+=4),Vx(this.buf,this.pos+=4))}Wt.prototype.float=function(){if(this.pos+4>this.len)throw So(this,4);var e=Fi.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Wt.prototype.double=function(){if(this.pos+8>this.len)throw So(this,4);var e=Fi.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Wt.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw So(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=Fi.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)};Wt.prototype.string=function(){var e=this.bytes();return xke.read(e,0,e.length)};Wt.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw So(this,e);this.pos+=e}else do if(this.pos>=this.len)throw So(this);while(this.buf[this.pos++]&128);return this};Wt.recursionLimit=Fi.recursionLimit;Wt.prototype.skipType=function(t,e){if(e===void 0&&(e=0),e>Wt.recursionLimit)throw Error("maximum nesting depth exceeded");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t,e+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Wt._configure=function(t){SD=t,Wt.create=e7(),SD._configure();var e=Fi.Long?"toLong":"toNumber";Fi.merge(Wt.prototype,{int64:function(){return yD.call(this)[e](!1)},uint64:function(){return yD.call(this)[e](!0)},sint64:function(){return yD.call(this).zzDecode()[e](!1)},fixed64:function(){return XQ.call(this)[e](!0)},sfixed64:function(){return XQ.call(this)[e](!1)}})}});var o7=y((NAt,i7)=>{"use strict";i7.exports=Lu;var n7=Gx();(Lu.prototype=Object.create(n7.prototype)).constructor=Lu;var r7=yo();function Lu(t){n7.call(this,t)}Lu._configure=function(){r7.Buffer&&(Lu.prototype._slice=r7.Buffer.prototype.slice)};Lu.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Lu._configure()});var a7=y((kAt,s7)=>{"use strict";s7.exports=Iy;var ED=yo();(Iy.prototype=Object.create(ED.EventEmitter.prototype)).constructor=Iy;function Iy(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");ED.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!r}Iy.prototype.rpcCall=function t(e,r,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return ED.asPromise(t,s,e,r,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(e,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(c,l){if(c)return s.emit("error",c,e),o(c);if(l===null){s.end(!0);return}if(!(l instanceof n))try{l=n[s.responseDelimited?"decodeDelimited":"decode"](l)}catch(u){return s.emit("error",u,e),o(u)}return s.emit("data",l,e),o(null,l)})}catch(a){s.emit("error",a,e),setTimeout(function(){o(a)},0);return}};Iy.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var vD=y(c7=>{"use strict";var Ake=c7;Ake.Service=a7()});var bD=y(($At,l7)=>{"use strict";l7.exports={}});var f7=y(d7=>{"use strict";var qn=d7;qn.build="minimal";qn.Writer=qx();qn.BufferWriter=ZQ();qn.Reader=Gx();qn.BufferReader=o7();qn.util=yo();qn.rpc=vD();qn.roots=bD();qn.configure=u7;function u7(){qn.util._configure(),qn.Writer._configure(qn.BufferWriter),qn.Reader._configure(qn.BufferReader)}u7()});var h7=y((LAt,p7)=>{"use strict";p7.exports=TD;var Rke=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;function TD(t,e){typeof t=="string"&&(e=t,t=void 0);var r=[];function n(o){if(typeof o!="string"){var s=i();if(TD.verbose&&console.log("codegen: "+s),s="return "+s,o){for(var a=Object.keys(o),c=new Array(a.length+1),l=new Array(a.length),u=0;u<a.length;)c[u]=a[u],l[u]=o[a[u++]];return c[u]=s,Function.apply(null,c).apply(null,l)}return Function(s)()}for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f]=arguments[++f];if(f=0,o=o.replace(/%([%dfijs])/g,function(h,m){var g=d[f++];switch(m){case"d":case"f":return String(Number(g));case"i":return String(Math.floor(g));case"j":return JSON.stringify(g);case"s":return String(g)}return"%"}),f!==d.length)throw Error("parameter count mismatch");return r.push(o),n}function i(o){return"function "+Cke(o||e)+"("+(t&&t.join(",")||"")+`){
|
|
7
7
|
`+r.join(`
|
|
8
8
|
`)+`
|
|
9
9
|
}`}return n.toString=i,n}TD.verbose=!1;function Cke(t){return!t||(t=String(t).replace(/[^\w$]/g,""),!t)?"":(/^\d/.test(t)&&(t="_"+t),Rke.test(t)?t+"_":t)}});var g7=y((UAt,m7)=>{"use strict";var gp=null;try{gp=Z("fs"),(!gp||!gp.readFile||!gp.readFileSync)&&(gp=null)}catch{}m7.exports=gp});var y7=y((FAt,_7)=>{"use strict";_7.exports=Py;var Ike=sD(),wD=g7();function Py(t,e,r){return typeof e=="function"?(r=e,e={}):e||(e={}),r?!e.xhr&&wD&&wD.readFile?wD.readFile(t,function(i,o){return i&&typeof XMLHttpRequest<"u"?Py.xhr(t,e,r):i?r(i):r(null,e.binary?o:o.toString("utf8"))}):Py.xhr(t,e,r):Ike(Py,this,t,e)}Py.xhr=function(e,r,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4){if(i.status!==0&&i.status!==200)return n(Error("status "+i.status));if(r.binary){var s=i.response;if(!s){s=[];for(var a=0;a<i.responseText.length;++a)s.push(i.responseText.charCodeAt(a)&255)}return n(null,typeof Uint8Array<"u"?new Uint8Array(s):s)}return n(null,i.responseText)}},r.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",e),i.send()}});var v7=y(E7=>{"use strict";var AD=E7,S7=AD.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},xD=AD.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var r=e.split("/"),n=S7(e),i="";n&&(i=r.shift()+"/");for(var o=0;o<r.length;)r[o]===".."?o>0&&r[o-1]!==".."?r.splice(--o,2):n?r.splice(o,1):++o:r[o]==="."?r.splice(o,1):++o;return i+r.join("/")};AD.resolve=function(e,r,n){return n||(r=xD(r)),S7(r)?r:(n||(e=xD(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?xD(e+"/"+r):r)}});var T7=y(b7=>{"use strict";var RD=b7;RD.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;RD.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;RD.reservedRe=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/});var x7=y((BAt,w7)=>{"use strict";var _p=null;try{_p=Z("fs"),(!_p||!_p.readFile||!_p.readFileSync)&&(_p=null)}catch{}w7.exports=_p});var Sp=y((qAt,C7)=>{"use strict";C7.exports=at;var Hx=Dc();((at.prototype=Object.create(Hx.prototype)).constructor=at).className="Namespace";var CD=$c(),Fu=Cr(),Pke=ju(),Uu,yp,zu;at.fromJSON=function(e,r,n){return n=Fu.checkDepth(n),new at(e,r.options).addJSON(r.nested,n)};function A7(t,e){if(t&&t.length){for(var r={},n=0;n<t.length;++n)r[t[n].name]=t[n].toJSON(e);return r}}at.arrayToJSON=A7;at.isReservedId=function(e,r){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!="string"&&e[n][0]<=r&&e[n][1]>r)return!0}return!1};at.isReservedName=function(e,r){if(e){for(var n=0;n<e.length;++n)if(e[n]===r)return!0}return!1};function at(t,e){Hx.call(this,t,e),this.nested=void 0,this._nestedArray=null,this._lookupCache=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function R7(t){t._nestedArray=null,t._lookupCache=Object.create(null);for(var e=t;e=e.parent;)e._lookupCache=Object.create(null);return t}Object.defineProperty(at.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=Fu.toArray(this.nested))}});at.prototype.toJSON=function(e){return Fu.toObject(["options",this.options,"nested",A7(this.nestedArray,e)])};at.prototype.addJSON=function(e,r){r=Fu.checkDepth(r);var n=this;if(e)for(var i=Object.keys(e),o=0,s;o<i.length;++o)s=e[i[o]],n.add((s.fields!==void 0?Uu.fromJSON:s.values!==void 0?zu.fromJSON:s.methods!==void 0?yp.fromJSON:s.id!==void 0?CD.fromJSON:at.fromJSON)(i[o],s,r+1));return this};at.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};at.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&this.nested[e]instanceof zu)return this.nested[e].values;throw Error("no such enum: "+e)};at.prototype.add=function(e){if(!(e instanceof CD&&e.extend!==void 0||e instanceof Uu||e instanceof Pke||e instanceof zu||e instanceof yp||e instanceof at))throw TypeError("object must be a valid nested object");if(e.name==="__proto__")return this;if(!this.nested)this.nested={};else{var r=this.get(e.name);if(r)if(r instanceof at&&e instanceof at&&!(r instanceof Uu||r instanceof yp)){for(var n=r.nestedArray,i=0;i<n.length;++i)e.add(n[i]);this.remove(r),this.nested||(this.nested={}),e.setOptions(r.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof Uu||this instanceof yp||this instanceof zu||this instanceof CD||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var o=this;o=o.parent;)o._needsRecursiveFeatureResolution=!0,o._needsRecursiveResolve=!0;return e.onAdd(this),R7(this)};at.prototype.remove=function(e){if(!(e instanceof Hx))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),R7(this)};at.prototype.define=function(e,r){if(Fu.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");if(e.length>Fu.recursionLimit)throw Error("max depth exceeded");for(var n=this;e.length>0;){var i=e.shift();if(n.nested&&n.nested[i]){if(n=n.nested[i],!(n instanceof at))throw Error("path conflicts with non-namespace objects")}else n.add(n=new at(i))}return r&&n.addJSON(r),n};at.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,r=0;for(this.resolve();r<e.length;)e[r]instanceof at?e[r++].resolveAll():e[r++].resolve();return this._needsRecursiveResolve=!1,this};at.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,Hx.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};at.prototype.lookup=function(e,r,n){if(typeof r=="boolean"?(n=r,r=void 0):r&&!Array.isArray(r)&&(r=[r]),Fu.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var i=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),r);var o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+i];if(o&&(!r||r.indexOf(o.constructor)>-1)||(o=this._lookupImpl(e,i),o&&(!r||r.indexOf(o.constructor)>-1)))return o;if(n)return null;for(var s=this;s.parent;){if(o=s.parent._lookupImpl(e,i),o&&(!r||r.indexOf(o.constructor)>-1))return o;s=s.parent}return null};at.prototype._lookupImpl=function(e,r){if(Object.prototype.hasOwnProperty.call(this._lookupCache,r))return this._lookupCache[r];var n=this.get(e[0]),i=null;if(n)e.length===1?i=n:n instanceof at&&(e=e.slice(1),i=n._lookupImpl(e,e.join(".")));else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof at&&(n=this._nestedArray[o]._lookupImpl(e,r))){i=n;break}return this._lookupCache[r]=i,i};at.prototype.lookupType=function(e){var r=this.lookup(e,[Uu]);if(!r)throw Error("no such type: "+e);return r};at.prototype.lookupEnum=function(e){var r=this.lookup(e,[zu]);if(!r)throw Error("no such Enum '"+e+"' in "+this);return r};at.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[Uu,zu]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r};at.prototype.lookupService=function(e){var r=this.lookup(e,[yp]);if(!r)throw Error("no such Service '"+e+"' in "+this);return r};at._configure=function(t,e,r){Uu=t,yp=e,zu=r}});var Wx=y((VAt,I7)=>{"use strict";I7.exports=ma;var ID=$c();((ma.prototype=Object.create(ID.prototype)).constructor=ma).className="MapField";var Oke=Bu(),Oy=Cr();function ma(t,e,r,n,i,o){if(ID.call(this,t,e,n,void 0,void 0,i,o),!Oy.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}ma.fromJSON=function(e,r){return new ma(e,r.id,r.keyType,r.type,r.options,r.comment)};ma.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Oy.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",r?this.comment:void 0])};ma.prototype.resolve=function(){if(this.resolved)return this;if(Oke.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return ID.prototype.resolve.call(this)};ma.d=function(e,r,n){return typeof n=="function"?n=Oy.decorateType(n).name:n&&typeof n=="object"&&(n=Oy.decorateEnum(n).name),function(o,s){Oy.decorateType(o.constructor).add(new ma(s,e,r,n))}}});var Yx=y((GAt,P7)=>{"use strict";P7.exports=qu;var PD=Dc();((qu.prototype=Object.create(PD.prototype)).constructor=qu).className="Method";var Ep=Cr();function qu(t,e,r,n,i,o,s,a,c){if(Ep.isObject(i)?(s=i,i=o=void 0):Ep.isObject(o)&&(s=o,o=void 0),!(e===void 0||Ep.isString(e)))throw TypeError("type must be a string");if(!Ep.isString(r))throw TypeError("requestType must be a string");if(!Ep.isString(n))throw TypeError("responseType must be a string");PD.call(this,t,s),this.type=e||"rpc",this.requestType=r,this.requestStream=i?!0:void 0,this.responseType=n,this.responseStream=o?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=c}qu.fromJSON=function(e,r){return new qu(e,r.type,r.requestType,r.responseType,r.requestStream,r.responseStream,r.options,r.comment,r.parsedOptions)};qu.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Ep.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])};qu.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),PD.prototype.resolve.call(this))}});var Kx=y((HAt,N7)=>{"use strict";N7.exports=di;var ga=Sp();((di.prototype=Object.create(ga.prototype)).constructor=di).className="Service";var OD=Yx(),vp=Cr(),Nke=vD(),kke=vp.patterns.reservedRe;function di(t,e){ga.call(this,t,e),this.methods={},this._methodsArray=null}di.fromJSON=function(e,r,n){n=vp.checkDepth(n);var i=new di(e,r.options);if(r.methods)for(var o=Object.keys(r.methods),s=0;s<o.length;++s)i.add(OD.fromJSON(o[s],r.methods[o[s]]));return r.nested&&i.addJSON(r.nested,n),r.edition&&(i._edition=r.edition),i.comment=r.comment,i._defaultEdition="proto3",i};di.prototype.toJSON=function(e){var r=ga.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return vp.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"methods",ga.arrayToJSON(this.methodsArray,e)||{},"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])};Object.defineProperty(di.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=vp.toArray(this.methods))}});function O7(t){return t._methodsArray=null,t}di.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:ga.prototype.get.call(this,e)};di.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;ga.prototype.resolve.call(this);for(var e=this.methodsArray,r=0;r<e.length;++r)e[r].resolve();return this};di.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,ga.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};di.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof OD?e.name==="__proto__"?this:(this.methods[e.name]=e,e.parent=this,O7(this)):ga.prototype.add.call(this,e)};di.prototype.remove=function(e){if(e instanceof OD){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,O7(this)}return ga.prototype.remove.call(this,e)};di.prototype.create=function(e,r,n){for(var i=new Nke.Service(e,r,n),o=0,s;o<this.methodsArray.length;++o){var a=vp.lcFirst((s=this._methodsArray[o]).resolve().name).replace(/[^$\w_]/g,"");i[a]=vp.codegen(["r","c"],kke.test(a)?a+"_":a)("return this.rpcCall(m,q,s,r,c)")({m:s,q:s.resolvedRequestType.ctor,s:s.resolvedResponseType.ctor})}return i}});var Zx=y((WAt,k7)=>{"use strict";k7.exports=ls;var Mke=yo();function ls(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r){var n=e[r];n!=="__proto__"&&(this[n]=t[n])}}ls.create=function(e){return this.$type.create(e)};ls.encode=function(e,r){return this.$type.encode(e,r)};ls.encodeDelimited=function(e,r){return this.$type.encodeDelimited(e,r)};ls.decode=function(e){return this.$type.decode(e)};ls.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};ls.verify=function(e){return this.$type.verify(e)};ls.fromObject=function(e){return this.$type.fromObject(e)};ls.toObject=function(e,r){return this.$type.toObject(e,r)};ls.prototype.toJSON=function(){return this.$type.toObject(this,Mke.toJSONOptions)}});var ND=y((YAt,$7)=>{"use strict";$7.exports=Lke;var $ke=Eo(),_a=Bu(),M7=Cr();function Dke(t){return"missing required '"+t.name+"'"}function Lke(t){for(var e=M7.codegen(["r","l","e","n"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(n===undefined)n=0")("if(n>Reader.recursionLimit)")('throw Error("maximum nesting depth exceeded")')("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(a){return a.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),r=0;r<t.fieldsArray.length;++r){var n=t._fieldsArray[r].resolve(),i=n.resolvedType instanceof $ke?"int32":n.type,o="m"+M7.safeProp(n.name);e("case %i: {",n.id),n.map?(e("if(%s===util.emptyObject)",o)("%s={}",o)("var c2 = r.uint32()+r.pos"),_a.defaults[n.keyType]!==void 0?e("k=%j",_a.defaults[n.keyType]):e("k=null"),_a.defaults[i]!==void 0?e("value=%j",_a.defaults[i]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",n.keyType)("case 2:"),_a.basic[i]===void 0?e("value=types[%i].decode(r,r.uint32(),undefined,n+1)",r):e("value=r.%s()",i),e("break")("default:")("r.skipType(tag2&7,n)")("break")("}")("}"),_a.long[n.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',o):(n.keyType==="string"&&e('if(k==="__proto__")')("util.makeProp(%s,k)",o),e("%s[k]=value",o))):n.repeated?(e("if(!(%s&&%s.length))",o,o)("%s=[]",o),_a.packed[i]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",o,i)("}else"),_a.basic[i]===void 0?e(n.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))":"%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))",o,r):e("%s.push(r.%s())",o,i)):_a.basic[i]===void 0?e(n.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)":"%s=types[%i].decode(r,r.uint32(),undefined,n+1)",o,r):e("%s=r.%s()",o,i),e("break")("}")}for(e("default:")("r.skipType(t&7,n)")("break")("}")("}"),r=0;r<t._fieldsArray.length;++r){var s=t._fieldsArray[r];s.required&&e("if(!m.hasOwnProperty(%j))",s.name)("throw util.ProtocolError(%j,{instance:m})",Dke(s))}return e("return m")}});var $D=y((KAt,D7)=>{"use strict";D7.exports=zke;var Uke=Eo(),kD=Cr();function zi(t,e){return t.name+": "+e+(t.repeated&&e!=="array"?"[]":t.map&&e!=="object"?"{k:"+t.keyType+"}":"")+" expected"}function MD(t,e,r,n){if(e.resolvedType)if(e.resolvedType instanceof Uke){t("switch(%s){",n)("default:")("return%j",zi(e,"enum value"));for(var i=Object.keys(e.resolvedType.values),o=0;o<i.length;++o)t("case %i:",e.resolvedType.values[i[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s,n+1);",r,n)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",n)("return%j",zi(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",zi(e,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',n)("return%j",zi(e,"number"));break;case"bool":t('if(typeof %s!=="boolean")',n)("return%j",zi(e,"boolean"));break;case"string":t("if(!util.isString(%s))",n)("return%j",zi(e,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",zi(e,"buffer"));break}return t}function Fke(t,e,r){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",r)("return%j",zi(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",r)("return%j",zi(e,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",r)("return%j",zi(e,"boolean key"));break}return t}function zke(t){var e=kD.codegen(["m","n"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected")("if(n===undefined)n=0")("if(n>util.recursionLimit)")("return%j","maximum nesting depth exceeded"),r=t.oneofsArray,n={};r.length&&e("var p={}");for(var i=0;i<t.fieldsArray.length;++i){var o=t._fieldsArray[i].resolve(),s="m"+kD.safeProp(o.name);if(o.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",s,o.name),o.map)e("if(!util.isObject(%s))",s)("return%j",zi(o,"object"))("var k=Object.keys(%s)",s)("for(var i=0;i<k.length;++i){"),Fke(e,o,"k[i]"),MD(e,o,i,s+"[k[i]]")("}");else if(o.repeated)e("if(!Array.isArray(%s))",s)("return%j",zi(o,"array"))("for(var i=0;i<%s.length;++i){",s),MD(e,o,i,s+"[i]")("}");else{if(o.partOf){var a=kD.safeProp(o.partOf.name);n[o.partOf.name]===1&&e("if(p%s===1)",a)("return%j",o.partOf.name+": multiple values"),n[o.partOf.name]=1,e("p%s=1",a)}MD(e,o,i,s)}o.optional&&e("}")}return e("return null")}});var UD=y(U7=>{"use strict";var L7=U7,Ny=Eo(),us=Cr();function DD(t,e,r,n){var i=!1;if(e.resolvedType)if(e.resolvedType instanceof Ny){t("switch(d%s){",n);for(var o=e.resolvedType.values,s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]===e.typeDefault&&!i&&(t("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),e.repeated||t("break"),i=!0),t("case%j:",s[a])("case %i:",o[s[a]])("m%s=%j",n,o[s[a]])("break");t("}")}else t('if(typeof d%s!=="object")',n)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s,n+1)",n,r,n);else{var c=!1;switch(e.type){case"double":case"float":t("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",n,n);break;case"uint64":case"fixed64":c=!0;case"int64":case"sint64":case"sfixed64":t("if(util.Long)")("m%s=util.Long.fromValue(d%s,%j)",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":t('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":t("m%s=String(d%s)",n,n);break;case"bool":t("m%s=Boolean(d%s)",n,n);break}}return t}L7.fromObject=function(e){var r=e.fieldsArray,n=us.codegen(["d","n"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d")("if(n===undefined)n=0")("if(n>util.recursionLimit)")('throw Error("maximum nesting depth exceeded")');if(!r.length)return n("return new this.ctor");n("var m=new this.ctor");for(var i=0;i<r.length;++i){var o=r[i].resolve(),s=us.safeProp(o.name);o.map?(n("if(d%s){",s)('if(typeof d%s!=="object")',s)("throw TypeError(%j)",o.fullName+": object expected")("m%s={}",s)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",s),n('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[i])",s),DD(n,o,i,s+"[ks[i]]")("}")("}")):o.repeated?(n("if(d%s){",s)("if(!Array.isArray(d%s))",s)("throw TypeError(%j)",o.fullName+": array expected")("m%s=[]",s)("for(var i=0;i<d%s.length;++i){",s),DD(n,o,i,s+"[i]")("}")("}")):(o.resolvedType instanceof Ny||n("if(d%s!=null){",s),DD(n,o,i,s),o.resolvedType instanceof Ny||n("}"))}return n("return m")};function LD(t,e,r,n){if(e.resolvedType)e.resolvedType instanceof Ny?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):t("d%s=types[%i].toObject(m%s,o,q+1)",n,r,n);else{var i=!1;switch(e.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":case"fixed64":i=!0;case"int64":case"sint64":case"sfixed64":t('if(typeof BigInt!=="undefined"&&o.longs===BigInt)')('d%s=typeof m%s==="number"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()',n,n,n,n,n,i)('else if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:t("d%s=m%s",n,n);break}}return t}L7.toObject=function(e){var r=e.fieldsArray.slice().sort(us.compareFieldsById);if(!r.length)return us.codegen()("return {}");for(var n=us.codegen(["m","o","q"],e.name+"$toObject")("if(!o)")("o={}")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")')("var d={}"),i=[],o=[],s=[],a=0;a<r.length;++a)r[a].partOf||(r[a].resolve().repeated?i:r[a].map?o:s).push(r[a]);if(i.length){for(n("if(o.arrays||o.defaults){"),a=0;a<i.length;++a)n("d%s=[]",us.safeProp(i[a].name));n("}")}if(o.length){for(n("if(o.objects||o.defaults){"),a=0;a<o.length;++a)n("d%s={}",us.safeProp(o[a].name));n("}")}if(s.length){for(n("if(o.defaults){"),a=0;a<s.length;++a){var c=s[a],l=us.safeProp(c.name);if(c.resolvedType instanceof Ny)n("d%s=o.enums===String?%j:%j",l,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)('d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!=="undefined"&&o.longs===BigInt?n.toBigInt():n',l)("}else")('d%s=o.longs===String?%j:typeof BigInt!=="undefined"&&o.longs===BigInt?BigInt(%j):%i',l,c.typeDefault.toString(),c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var u=Array.prototype.slice.call(c.typeDefault);n("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%j",l,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else n("d%s=%j",l,c.typeDefault)}n("}")}var d=!1;for(a=0;a<r.length;++a){var c=r[a],f=e._fieldsArray.indexOf(c),l=us.safeProp(c.name);c.map?(d||(d=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),n('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",l),LD(n,c,f,l+"[ks2[j]]")("}")):c.repeated?(n("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),LD(n,c,f,l+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",l,c.name),LD(n,c,f,l),c.partOf&&n("if(o.oneofs)")("d%s=%j",us.safeProp(c.partOf.name),c.name)),n("}")}return n("return d")}});var FD=y(F7=>{"use strict";var jke=F7,Bke=Zx(),qke=yo();jke[".google.protobuf.Any"]={fromObject:function(t,e){if(t&&t["@type"]){var r=t["@type"].substring(t["@type"].lastIndexOf("/")+1),n=this.lookup(r);if(n){var i=t["@type"].charAt(0)==="."?t["@type"].slice(1):t["@type"];return i.indexOf("/")===-1&&(i="/"+i),this.create({type_url:i,value:n.encode(n.fromObject(t,e===void 0?1:e+1)).finish()})}}return this.fromObject(t,e)},toObject:function(t,e,r){if(r===void 0&&(r=0),r>qke.recursionLimit)throw Error("max depth exceeded");var n="type.googleapis.com/",i="",o="";if(e&&e.json&&t.type_url&&t.value){o=t.type_url.substring(t.type_url.lastIndexOf("/")+1),i=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var s=this.lookup(o);s&&(t=s.decode(t.value,void 0,void 0,r+1))}if(!(t instanceof this.ctor)&&t instanceof Bke){var a=t.$type.toObject(t,e,r+1),c=t.$type.fullName[0]==="."?t.$type.fullName.slice(1):t.$type.fullName;return i===""&&(i=n),o=i+c,a["@type"]=o,a}return this.toObject(t,e,r)}}});var Qx=y((XAt,j7)=>{"use strict";j7.exports=kt;var ji=Sp();((kt.prototype=Object.create(ji.prototype)).constructor=kt).className="Type";var Vke=Eo(),BD=ju(),Jx=$c(),Gke=Wx(),Hke=Kx(),zD=Zx(),jD=Gx(),Wke=qx(),Br=Cr(),Yke=qD(),Kke=ND(),Zke=$D(),z7=UD(),Jke=FD();function kt(t,e){t=t.replace(/\W/g,""),ji.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(kt.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var t=Object.keys(this.fields),e=0;e<t.length;++e){var r=this.fields[t[e]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=Br.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=Br.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=kt.generateConstructor(this)())},set:function(t){var e=t.prototype;e instanceof zD||((t.prototype=new zD).constructor=t,Br.merge(t.prototype,e)),t.$type=t.prototype.$type=this,Br.merge(t,zD,!0),this._ctor=t;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:Br.oneOfGetter(this._oneofsArray[r].oneof),set:Br.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(t.prototype,n)}}});kt.generateConstructor=function(e){for(var r=Br.codegen(["p"],e.name),n=0,i;n<e.fieldsArray.length;++n)(i=e._fieldsArray[n]).map?r("this%s={}",Br.safeProp(i.name)):i.repeated&&r("this%s=[]",Br.safeProp(i.name));return r('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")};function Xx(t){return t._fieldsById=t._fieldsArray=t._oneofsArray=null,delete t.encode,delete t.decode,delete t.verify,t}kt.fromJSON=function(e,r,n){if(n===void 0&&(n=0),n>Br.nestingLimit)throw Error("max depth exceeded");var i=new kt(e,r.options);i.extensions=r.extensions,i.reserved=r.reserved;for(var o=Object.keys(r.fields),s=0;s<o.length;++s)i.add((typeof r.fields[o[s]].keyType<"u"?Gke.fromJSON:Jx.fromJSON)(o[s],r.fields[o[s]]));if(r.oneofs)for(o=Object.keys(r.oneofs),s=0;s<o.length;++s)i.add(BD.fromJSON(o[s],r.oneofs[o[s]]));if(r.nested)for(o=Object.keys(r.nested),s=0;s<o.length;++s){var a=r.nested[o[s]];i.add((a.id!==void 0?Jx.fromJSON:a.fields!==void 0?kt.fromJSON:a.values!==void 0?Vke.fromJSON:a.methods!==void 0?Hke.fromJSON:ji.fromJSON)(o[s],a,n+1))}return r.extensions&&r.extensions.length&&(i.extensions=r.extensions),r.reserved&&r.reserved.length&&(i.reserved=r.reserved),r.group&&(i.group=!0),r.comment&&(i.comment=r.comment),r.edition&&(i._edition=r.edition),i._defaultEdition="proto3",i};kt.prototype.toJSON=function(e){var r=ji.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return Br.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",ji.arrayToJSON(this.oneofsArray,e),"fields",ji.arrayToJSON(this.fieldsArray.filter(function(i){return!i.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])};kt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;ji.prototype.resolveAll.call(this);var e=this.oneofsArray;for(n=0;n<e.length;)e[n++].resolve();for(var r=this.fieldsArray,n=0;n<r.length;)r[n++].resolve();return this};kt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,ji.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(r=>{r._resolveFeatures(e)}),this.fieldsArray.forEach(r=>{r._resolveFeatures(e)}),this):this};kt.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};kt.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof Jx&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.name==="__proto__"?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),Xx(this))}return e instanceof BD?e.name==="__proto__"?this:(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),Xx(this)):ji.prototype.add.call(this,e)};kt.prototype.remove=function(e){if(e instanceof Jx&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),Xx(this)}if(e instanceof BD){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),Xx(this)}return ji.prototype.remove.call(this,e)};kt.prototype.isReservedId=function(e){return ji.isReservedId(this.reserved,e)};kt.prototype.isReservedName=function(e){return ji.isReservedName(this.reserved,e)};kt.prototype.create=function(e){return new this.ctor(e)};kt.prototype.setup=function(){for(var e=this.fullName,r=[],n=0;n<this.fieldsArray.length;++n)r.push(this._fieldsArray[n].resolve().resolvedType);this.encode=Yke(this)({Writer:Wke,types:r,util:Br}),this.decode=Kke(this)({Reader:jD,types:r,util:Br}),this.verify=Zke(this)({types:r,util:Br}),this.fromObject=z7.fromObject(this)({types:r,util:Br}),this.toObject=z7.toObject(this)({types:r,util:Br});var i=Jke[e];if(i){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(o),o.toObject=this.toObject,this.toObject=i.toObject.bind(o)}return this};kt.prototype.encode=function(e,r){return this.setup().encode.apply(this,arguments)};kt.prototype.encodeDelimited=function(e,r){return this.encode(e,r&&r.len?r.fork():r).ldelim()};kt.prototype.decode=function(e,r,n,i){return this.setup().decode(e,r,n,i)};kt.prototype.decodeDelimited=function(e){return e instanceof jD||(e=jD.create(e)),this.decode(e,e.uint32())};kt.prototype.verify=function(e,r){return this.setup().verify(e,r)};kt.prototype.fromObject=function(e,r){return this.setup().fromObject(e,r)};kt.prototype.toObject=function(e,r){return this.setup().toObject.apply(this,arguments)};kt.d=function(e){return function(n){Br.decorateType(n,e)}}});var nA=y((QAt,V7)=>{"use strict";V7.exports=fi;var rA=Sp();((fi.prototype=Object.create(rA.prototype)).constructor=fi).className="Root";var eA=$c(),VD=Eo(),Xke=ju(),ds=Cr(),GD,HD,ky;function fi(t){rA.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}fi.fromJSON=function(e,r,n){return n=ds.checkDepth(n),r||(r=new fi),e.options&&r.setOptions(e.options),r.addJSON(e.nested,n).resolveAll()};fi.prototype.resolvePath=ds.path.resolve;fi.prototype.fetch=ds.fetch;function q7(){}fi.prototype.load=function t(e,r,n){typeof r=="function"&&(n=r,r=void 0);var i=this;if(!n)return ds.asPromise(t,i,e,r);var o=n===q7;function s(p,h){if(n){if(o)throw p;h&&h.resolveAll();var m=n;n=null,m(p,h)}}function a(p){var h=p.lastIndexOf("google/protobuf/");if(h>-1){var m=p.substring(h);if(m in ky)return m}return null}function c(p,h,m){m===void 0&&(m=0);try{if(m>ds.recursionLimit)throw Error("max depth exceeded");if(ds.isString(h)&&h.charAt(0)==="{"&&(h=JSON.parse(h)),!ds.isString(h))i.setOptions(h.options).addJSON(h.nested);else{HD.filename=p;var g=HD(h,i,r),_,v=0;if(g.imports)for(;v<g.imports.length;++v)(_=a(g.imports[v])||i.resolvePath(p,g.imports[v]))&&l(_,!1,m+1);if(g.weakImports)for(v=0;v<g.weakImports.length;++v)(_=a(g.weakImports[v])||i.resolvePath(p,g.weakImports[v]))&&l(_,!0,m+1)}}catch(T){s(T)}!o&&!u&&s(null,i)}function l(p,h,m){if(m===void 0&&(m=0),p=a(p)||p,!(i.files.indexOf(p)>-1)){if(i.files.push(p),p in ky){o?c(p,ky[p],m):(++u,setTimeout(function(){--u,c(p,ky[p],m)}));return}if(o){var g;try{g=ds.fs.readFileSync(p).toString("utf8")}catch(_){h||s(_);return}c(p,g,m)}else++u,i.fetch(p,function(_,v){if(--u,!!n){if(_){h?u||s(null,i):s(_);return}c(p,v,m)}})}}var u=0;ds.isString(e)&&(e=[e]);for(var d=0,f;d<e.length;++d)(f=i.resolvePath("",e[d]))&&l(f);return o?(i.resolveAll(),i):(u||s(null,i),i)};fi.prototype.loadSync=function(e,r){if(!ds.isNode)throw Error("not supported");return this.load(e,r,q7)};fi.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return rA.prototype.resolveAll.call(this)};var tA=/^[A-Z]/;function B7(t,e){var r=e.parent.lookup(e.extend);if(r){var n=new eA(e.fullName,e.id,e.type,e.rule,void 0,e.options);return r.get(n.name)||(n.declaringField=e,e.extensionField=n,r.add(n)),!0}return!1}fi.prototype._handleAdd=function(e){if(e instanceof eA)e.extend!==void 0&&!e.extensionField&&(B7(this,e)||this.deferred.push(e));else if(e instanceof VD)tA.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof Xke)){if(e instanceof GD)for(var r=0;r<this.deferred.length;)B7(this,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);tA.test(e.name)&&(e.parent[e.name]=e)}(e instanceof GD||e instanceof VD||e instanceof eA)&&(this._fullyQualifiedObjects[e.fullName]=e)};fi.prototype._handleRemove=function(e){if(e instanceof eA){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var r=this.deferred.indexOf(e);r>-1&&this.deferred.splice(r,1)}}else if(e instanceof VD)tA.test(e.name)&&delete e.parent[e.name];else if(e instanceof rA){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);tA.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};fi._configure=function(t,e,r){GD=t,HD=e,ky=r}});var Cr=y((eRt,W7)=>{"use strict";var zt=W7.exports=yo(),G7=bD(),WD,YD;zt.codegen=h7();zt.fetch=y7();zt.path=v7();zt.patterns=T7();var H7=zt.patterns.reservedRe;zt.fs=x7();zt.checkDepth=function(e){if(e===void 0&&(e=0),e>zt.recursionLimit)throw Error("max depth exceeded");return e};zt.toArray=function(e){if(e){for(var r=Object.keys(e),n=new Array(r.length),i=0;i<r.length;)n[i]=e[r[i++]];return n}return[]};zt.toObject=function(e){for(var r={},n=0;n<e.length;){var i=e[n++],o=e[n++];o!==void 0&&(r[i]=o)}return r};zt.isReserved=function(e){return H7.test(e)};zt.safeProp=function(e){return!/^[$\w_]+$/.test(e)||H7.test(e)?"["+JSON.stringify(e)+"]":"."+e};zt.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Qke=/_([a-z])/g;zt.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Qke,function(r,n){return n.toUpperCase()})};zt.compareFieldsById=function(e,r){return e.id-r.id};zt.decorateType=function(e,r){if(e.$type)return r&&e.$type.name!==r&&(zt.decorateRoot.remove(e.$type),e.$type.name=r,zt.decorateRoot.add(e.$type)),e.$type;WD||(WD=Qx());var n=new WD(r||e.name);return zt.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var eMe=0;zt.decorateEnum=function(e){if(e.$type)return e.$type;YD||(YD=Eo());var r=new YD("Enum"+eMe++,e);return zt.decorateRoot.add(r),Object.defineProperty(e,"$type",{value:r,enumerable:!1}),r};zt.setProperty=function(e,r,n,i){function o(s,a,c){var l=a.shift();if(zt.isUnsafeProperty(l))return s;if(a.length>0)s[l]=o(s[l]||{},a,c);else{var u=s[l];if(u&&i)return s;u&&(c=[].concat(u).concat(c)),s[l]=c}return s}if(typeof e!="object")throw TypeError("dst must be an object");if(!r)throw TypeError("path must be specified");if(r=r.split("."),r.length>zt.recursionLimit)throw Error("max depth exceeded");return o(e,r,n)};Object.defineProperty(zt,"decorateRoot",{get:function(){return G7.decorated||(G7.decorated=new(nA()))}})});var Bu=y(Y7=>{"use strict";var My=Y7,tMe=Cr(),rMe=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function $y(t,e){var r=0,n=Object.create(null);for(e|=0;r<t.length;)n[rMe[r+e]]=t[r++];return n}My.basic=$y([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);My.defaults=$y([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",tMe.emptyArray,null]);My.long=$y([0,0,0,1,1],7);My.mapKey=$y([0,0,0,5,5,0,0,0,1,1,0,2],2);My.packed=$y([1,5,0,0,0,5,5,0,0,0,1,1,0])});var $c=y((rRt,Z7)=>{"use strict";Z7.exports=Ir;var Ly=Dc();((Ir.prototype=Object.create(Ly.prototype)).constructor=Ir).className="Field";var K7=Eo(),KD=Bu(),dr=Cr(),Dy,nMe=/^required|optional|repeated$/;Ir.fromJSON=function(e,r){var n=new Ir(e,r.id,r.type,r.rule,r.extend,r.options,r.comment);return r.edition&&(n._edition=r.edition),n._defaultEdition="proto3",n};function Ir(t,e,r,n,i,o,s){if(dr.isObject(n)?(s=i,o=n,n=i=void 0):dr.isObject(i)&&(s=o,o=i,i=void 0),Ly.call(this,t,o),!dr.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!dr.isString(r))throw TypeError("type must be a string");if(n!==void 0&&!nMe.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(i!==void 0&&!dr.isString(i))throw TypeError("extend must be a string");n==="proto3_optional"&&(n="optional"),this.rule=n&&n!=="optional"?n:void 0,this.type=r,this.id=e,this.extend=i||void 0,this.repeated=n==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=dr.Long?KD.long[r]!==void 0:!1,this.bytes=r==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=s}Object.defineProperty(Ir.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(Ir.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(Ir.prototype,"delimited",{get:function(){return this.resolvedType instanceof Dy&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(Ir.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(Ir.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});Ir.prototype.setOption=function(e,r,n){return Ly.prototype.setOption.call(this,e,r,n)};Ir.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return dr.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",r?this.comment:void 0])};Ir.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=KD.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof Dy?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof K7&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof K7)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=dr.Long.fromNumber(this.typeDefault,this.type==="uint64"||this.type==="fixed64"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;dr.base64.test(this.typeDefault)?dr.base64.decode(this.typeDefault,e=dr.newBuffer(dr.base64.length(this.typeDefault)),0):dr.utf8.write(this.typeDefault,e=dr.newBuffer(dr.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=dr.emptyObject:this.repeated?this.defaultValue=dr.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof Dy&&(this.parent.ctor.prototype[this.name]=this.defaultValue),Ly.prototype.resolve.call(this)};Ir.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var r={};if(this.rule==="required"&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&KD.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof Dy&&n.group&&(r.message_encoding="DELIMITED")}return this.getOption("packed")===!0?r.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(r.repeated_field_encoding="EXPANDED"),r};Ir.prototype._resolveFeatures=function(e){return Ly.prototype._resolveFeatures.call(this,this._edition||e)};Ir.d=function(e,r,n,i){return typeof r=="function"?r=dr.decorateType(r).name:r&&typeof r=="object"&&(r=dr.decorateEnum(r).name),function(s,a){dr.decorateType(s.constructor).add(new Ir(a,e,r,n,{default:i}))}};Ir._configure=function(e){Dy=e}});var ju=y((nRt,Q7)=>{"use strict";Q7.exports=pi;var oA=Dc();((pi.prototype=Object.create(oA.prototype)).constructor=pi).className="OneOf";var J7=$c(),iA=Cr();function pi(t,e,r,n){if(Array.isArray(e)||(r=e,e=void 0),oA.call(this,t,r),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=n}pi.fromJSON=function(e,r){return new pi(e,r.oneof,r.options,r.comment)};pi.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return iA.toObject(["options",this.options,"oneof",this.oneof,"comment",r?this.comment:void 0])};function X7(t){if(t.parent)for(var e=0;e<t.fieldsArray.length;++e)t.fieldsArray[e].parent||t.parent.add(t.fieldsArray[e])}pi.prototype.add=function(e){if(!(e instanceof J7))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,X7(this),this};pi.prototype.remove=function(e){if(!(e instanceof J7))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),r=this.oneof.indexOf(e.name),r>-1&&this.oneof.splice(r,1),e.partOf=null,this};pi.prototype.onAdd=function(e){oA.prototype.onAdd.call(this,e);for(var r=this,n=0;n<this.oneof.length;++n){var i=e.get(this.oneof[n]);i&&!i.partOf&&(i.partOf=r,r.fieldsArray.push(i))}X7(this)};pi.prototype.onRemove=function(e){for(var r=0,n;r<this.fieldsArray.length;++r)(n=this.fieldsArray[r]).parent&&n.parent.remove(n);oA.prototype.onRemove.call(this,e)};Object.defineProperty(pi.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var t=this.fieldsArray[0];return t.options!=null&&t.options.proto3_optional===!0}});pi.d=function(){for(var e=new Array(arguments.length),r=0;r<arguments.length;)e[r]=arguments[r++];return function(i,o){iA.decorateType(i.constructor).add(new pi(o,e)),Object.defineProperty(i,o,{get:iA.oneOfGetter(e),set:iA.oneOfSetter(e)})}}});var Dc=y((iRt,eee)=>{"use strict";eee.exports=qr;qr.className="ReflectionObject";var iMe=ju(),vo=Cr(),sA,oMe={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},sMe={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},aMe={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function qr(t,e){if(!vo.isString(t))throw TypeError("name must be a string");if(e&&!vo.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=t,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(qr.prototype,{root:{get:function(){for(var t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],e=this.parent;e;)t.unshift(e.name),e=e.parent;return t.join(".")}}});qr.prototype.toJSON=function(){throw Error()};qr.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof sA&&r._handleAdd(this)};qr.prototype.onRemove=function(e){var r=e.root;r instanceof sA&&r._handleRemove(this),this.parent=null,this.resolved=!1};qr.prototype.resolve=function(){return this.resolved?this:(this.root instanceof sA&&(this.resolved=!0),this)};qr.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};qr.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var r={};if(!e)throw new Error("Unknown edition for "+this.fullName);var n=vo.merge({},this.options&&this.options.features,this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")r=Object.assign({},sMe);else if(e==="proto3")r=Object.assign({},aMe);else if(e==="2023")r=Object.assign({},oMe);else throw new Error("Unknown edition: "+e);this._features=vo.merge(r,n),this._featuresResolved=!0;return}if(this.partOf instanceof iMe){var i=vo.merge({},this.partOf._features);this._features=vo.merge(i,n)}else if(!this.declaringField)if(this.parent){var o=vo.merge({},this.parent._features);this._features=vo.merge(o,n)}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};qr.prototype._inferLegacyProtoFeatures=function(){return{}};qr.prototype.getOption=function(e){if(this.options)return this.options[e]};qr.prototype.setOption=function(e,r,n){return e==="__proto__"?this:(this.options||(this.options={}),/^features\./.test(e)?vo.setProperty(this.options,e,r,n):(!n||this.options[e]===void 0)&&(this.getOption(e)!==r&&(this.resolved=!1),this.options[e]=r),this)};qr.prototype.setParsedOption=function(e,r,n){if(e==="__proto__")return this;this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var o=i.find(function(c){return Object.prototype.hasOwnProperty.call(c,e)});if(o){var s=o[e];vo.setProperty(s,n,r)}else o={},o[e]=vo.setProperty({},n,r),i.push(o)}else{var a={};a[e]=r,i.push(a)}return this};qr.prototype.setOptions=function(e,r){if(e)for(var n=Object.keys(e),i=0;i<n.length;++i)this.setOption(n[i],e[n[i]],r);return this};qr.prototype.toString=function(){var e=this.constructor.className,r=this.fullName;return r.length?e+" "+r:e};qr.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};qr._configure=function(t){sA=t}});var Eo=y((oRt,ree)=>{"use strict";ree.exports=bo;var ZD=Dc();((bo.prototype=Object.create(ZD.prototype)).constructor=bo).className="Enum";var tee=Sp(),bp=Cr();function bo(t,e,r,n,i,o){if(ZD.call(this,t,r),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.valuesOptions=o,this._valuesFeatures={},this.reserved=void 0,e)for(var s=Object.keys(e),a=0;a<s.length;++a)s[a]!=="__proto__"&&typeof e[s[a]]=="number"&&(this.valuesById[this.values[s[a]]=e[s[a]]]=s[a])}bo.prototype._resolveFeatures=function(e){return e=this._edition||e,ZD.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(r=>{var n=bp.merge({},this._features);this._valuesFeatures[r]=bp.merge(n,this.valuesOptions&&this.valuesOptions[r]&&this.valuesOptions[r].features||{})}),this};bo.fromJSON=function(e,r){var n=new bo(e,r.values,r.options,r.comment,r.comments);return n.reserved=r.reserved,r.edition&&(n._edition=r.edition),n._defaultEdition="proto3",n};bo.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return bp.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",r?this.comment:void 0,"comments",r?this.comments:void 0])};bo.prototype.add=function(e,r,n,i){if(!bp.isString(e))throw TypeError("name must be a string");if(!bp.isInteger(r))throw TypeError("id must be an integer");if(e==="__proto__")return this;if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(r))throw Error("id "+r+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[r]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+r+" in "+this);this.values[e]=r}else this.valuesById[this.values[e]=r]=e;return i&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=i||null),this.comments[e]=n||null,this};bo.prototype.remove=function(e){if(!bp.isString(e))throw TypeError("name must be a string");var r=this.values[e];if(r==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[r],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};bo.prototype.isReservedId=function(e){return tee.isReservedId(this.reserved,e)};bo.prototype.isReservedName=function(e){return tee.isReservedName(this.reserved,e)}});var qD=y((sRt,iee)=>{"use strict";iee.exports=lMe;var cMe=Eo(),JD=Bu(),XD=Cr();function nee(t,e,r,n){return e.delimited?t("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)",r,n,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()",r,n,(e.id<<3|2)>>>0)}function lMe(t){for(var e=XD.codegen(["m","w","q"],t.name+"$encode")("if(!w)")("w=Writer.create()")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")'),r,n,i=t.fieldsArray.slice().sort(XD.compareFieldsById),r=0;r<i.length;++r){var o=i[r].resolve(),s=t._fieldsArray.indexOf(o),a=o.resolvedType instanceof cMe?"int32":o.type,c=JD.basic[a];n="m"+XD.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|JD.mapKey[o.keyType],o.keyType),c===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()",s,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,a,n),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",n,n),o.packed&&JD.packed[a]!==void 0?e("w.uint32(%i).fork()",(o.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),c===void 0?nee(e,o,s,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|c)>>>0,a,n)),e("}")):(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,o.name),c===void 0?nee(e,o,s,n):e("w.uint32(%i).%s(%s)",(o.id<<3|c)>>>0,a,n))}return e("return w")}});var see=y((aRt,oee)=>{"use strict";var ct=oee.exports=f7();ct.build="light";function uMe(t,e,r){return typeof e=="function"?(r=e,e=new ct.Root):e||(e=new ct.Root),e.load(t,r)}ct.load=uMe;function dMe(t,e){return e||(e=new ct.Root),e.loadSync(t)}ct.loadSync=dMe;ct.encoder=qD();ct.decoder=ND();ct.verifier=$D();ct.converter=UD();ct.ReflectionObject=Dc();ct.Namespace=Sp();ct.Root=nA();ct.Enum=Eo();ct.Type=Qx();ct.Field=$c();ct.OneOf=ju();ct.MapField=Wx();ct.Service=Kx();ct.Method=Yx();ct.Message=Zx();ct.wrappers=FD();ct.types=Bu();ct.util=Cr();ct.ReflectionObject._configure(ct.Root);ct.Namespace._configure(ct.Type,ct.Service,ct.Enum);ct.Root._configure(ct.Type);ct.Field._configure(ct.Type)});var eL=y((cRt,lee)=>{"use strict";lee.exports=cee;var QD=/[\s{}=;:[\],'"()<>]/g,fMe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,pMe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,hMe=/^ *[*/]+ */,mMe=/^\s*\*?\/*/,gMe=/\n/g,_Me=/\s/,yMe=/\\(.?)/g,SMe={0:"\0",r:"\r",n:`
|
|
@@ -13,22 +13,22 @@ ${e}`;return Object.assign(new Error(r),t,{stack:i})}var U$=class extends aNe.Ev
|
|
|
13
13
|
`;)A++;return A}function m(){if(a.length>0)return a.shift();if(c)return u();var b,A,k,P,N,D=r===0;do{if(r===n)return null;for(b=!1;_Me.test(k=d(r));)if(k===`
|
|
14
14
|
`&&(D=!0,++i),++r===n)return null;if(d(r)==="/"){if(++r===n)throw l("comment");if(d(r)==="/")if(e){if(P=r,N=!1,p(r-1)){N=!0;do if(r=h(r),r===n||(r++,!D))break;while(p(r))}else r=Math.min(n,h(r)+1);N&&(f(P,r,D),D=!0),i++,b=!0}else{for(N=d(P=r+1)==="/";d(++r)!==`
|
|
15
15
|
`;)if(r===n)return null;++r,N&&(f(P,r-1,D),D=!0),++i,b=!0}else if((k=d(r))==="*"){P=r+1,N=e||d(P)==="*";do{if(k===`
|
|
16
|
-
`&&++i,++r===n)throw l("comment");A=k,k=d(r)}while(A!=="*"||k!=="/");++r,N&&(f(P,r-2,D),D=!0),b=!0}else return"/"}}while(b);var F=r;QD.lastIndex=0;var E=QD.test(d(F++));if(!E)for(;F<n&&!QD.test(d(F));)++F;var oe=t.substring(r,r=F);return(oe==='"'||oe==="'")&&(c=oe),oe}function g(b){a.push(b)}function _(){if(!a.length){var b=m();if(b===null)return null;g(b)}return a[0]}function v(b,A){var k=_(),P=k===b;if(P)return m(),!0;if(!A)throw l("token '"+k+"', '"+b+"' expected");return!1}function T(b){var A=null,k;return b===void 0?(k=s[i-1],delete s[i-1],k&&(e||k.type==="*"||k.lineEmpty)&&(A=k.leading?k.text:null)):(o<b&&_(),k=s[b],delete s[b],k&&!k.lineEmpty&&(e||k.type==="/")&&(A=k.leading?null:k.text)),A}return Object.defineProperty({next:m,peek:_,push:g,skip:v,cmnt:T},"line",{get:function(){return i}})}});var mee=y((lRt,hee)=>{"use strict";hee.exports=Sa;Sa.filename=null;Sa.defaults={keepCase:!1};var EMe=eL(),uee=nA(),dee=Qx(),fee=$c(),vMe=Wx(),pee=ju(),bMe=Eo(),TMe=Kx(),wMe=Yx(),xMe=Dc(),AMe=Bu(),ya=Cr(),RMe=/^[1-9][0-9]*$/,CMe=/^-?[1-9][0-9]*$/,IMe=/^0[x][0-9a-fA-F]+$/,PMe=/^-?0[x][0-9a-fA-F]+$/,OMe=/^0[0-7]+$/,NMe=/^-?0[0-7]+$/,kMe=ya.patterns.numberRe,fs=/^[a-zA-Z_][a-zA-Z_0-9]*$/,ps=ya.patterns.typeRefRe;function Sa(t,e,r){e instanceof uee||(r=e,e=new uee),r||(r=Sa.defaults);var n=r.preferTrailingComment||!1,i=EMe(t,r.alternateCommentMode||!1),o=i.next,s=i.push,a=i.peek,c=i.skip,l=i.cmnt,u=!0,d,f,p,h="proto2",m=e,g=[],_={},v=r.keepCase?function(x){return x}:ya.camelCase;function T(){g.forEach(x=>{x._edition=h,Object.keys(_).forEach(C=>{x.getOption(C)===void 0&&x.setOption(C,_[C],!0)})})}function b(x,C,j){var B=Sa.filename;return j||(Sa.filename=null),Error("illegal "+(C||"token")+" '"+x+"' ("+(B?B+", ":"")+"line "+i.line+")")}function A(){var x=[],C;do{if((C=o())!=='"'&&C!=="'")throw b(C);x.push(o()),c(C),C=a()}while(C==='"'||C==="'");return x.join("")}function k(x){var C=o();switch(C){case"'":case'"':return s(C),A();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return N(C,!0)}catch{if(x&&ps.test(C))return C;throw b(C,"value")}}function P(x,C){var j,B;do if(C&&((j=a())==='"'||j==="'")){var te=A();if(x.push(te),h>=2023)throw b(te,"id")}else try{x.push([B=D(o()),c("to",!0)?D(o()):B])}catch(Ee){if(C&&ps.test(j)&&h>=2023)x.push(j);else throw Ee}while(c(",",!0));var ie={options:void 0};ie.setOption=function(Ee,yt){this.options===void 0&&(this.options={}),this.options[Ee]=yt},w(ie,function(yt){if(yt==="option")Oe(ie,yt),c(";");else throw b(yt)},function(){me(ie)})}function N(x,C){var j=1;switch(x.charAt(0)==="-"&&(j=-1,x=x.substring(1)),x){case"inf":case"INF":case"Inf":return j*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(RMe.test(x))return j*parseInt(x,10);if(IMe.test(x))return j*parseInt(x,16);if(OMe.test(x))return j*parseInt(x,8);if(kMe.test(x))return j*parseFloat(x);throw b(x,"number",C)}function D(x,C){switch(x){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!C&&x.charAt(0)==="-")throw b(x,"id");if(CMe.test(x))return parseInt(x,10);if(PMe.test(x))return parseInt(x,16);if(NMe.test(x))return parseInt(x,8);throw b(x,"id")}function F(){if(d!==void 0)throw b("package");if(d=o(),!ps.test(d))throw b(d,"name");m=m.define(d),c(";")}function E(){var x=a(),C;switch(x){case"weak":C=p||(p=[]),o();break;case"public":o();default:C=f||(f=[]);break}x=A(),c(";"),C.push(x)}function oe(){if(c("="),h=A(),h<2023)throw b(h,"syntax");c(";")}function M(){if(c("="),h=A(),!["2023"].includes(h))throw b(h,"edition");c(";")}function S(x,C,j){switch(j===void 0&&(j=0),C){case"option":return Oe(x,C),c(";"),!0;case"message":return O(x,C,j+1),!0;case"enum":return Ie(x,C),!0;case"service":return nt(x,C,j+1),!0;case"extend":return qe(x,C,j),!0}return!1}function w(x,C,j){var B=i.line;if(x&&(typeof x.comment!="string"&&(x.comment=l()),x.filename=Sa.filename),c("{",!0)){for(var te;(te=o())!=="}";)C(te);c(";",!0)}else j&&j(),c(";"),x&&(typeof x.comment!="string"||n)&&(x.comment=l(B)||x.comment)}function O(x,C,j){if(j===void 0&&(j=0),j>ya.nestingLimit)throw Error("max depth exceeded");if(!fs.test(C=o()))throw b(C,"type name");var B=new dee(C);w(B,function(ie){if(!S(B,ie,j))switch(ie){case"map":he(B,ie);break;case"required":if(h!=="proto2")throw b(ie);case"repeated":Y(B,ie,void 0,j+1);break;case"optional":if(h==="proto3")Y(B,"proto3_optional",void 0,j+1);else{if(h!=="proto2")throw b(ie);Y(B,"optional",void 0,j+1)}break;case"oneof":je(B,ie,j+1);break;case"extensions":P(B.extensions||(B.extensions=[]));break;case"reserved":P(B.reserved||(B.reserved=[]),!0);break;default:if(h==="proto2"||!ps.test(ie))throw b(ie);s(ie),Y(B,"optional",void 0,j+1);break}}),x.add(B),x===m&&g.push(B)}function Y(x,C,j,B){var te=o();if(te==="group"){H(x,C,B);return}for(;te.endsWith(".")||a().startsWith(".");)te+=o();if(!ps.test(te))throw b(te,"type");var ie=o();if(!fs.test(ie))throw b(ie,"name");ie=v(ie),c("=");var Ee=new fee(ie,D(o()),te,C,j);if(w(Ee,function(St){if(St==="option")Oe(Ee,St),c(";");else throw b(St)},function(){me(Ee)}),C==="proto3_optional"){var yt=new pee("_"+ie);Ee.setOption("proto3_optional",!0),yt.add(Ee),x.add(yt)}else x.add(Ee);x===m&&g.push(Ee)}function H(x,C,j){if(j===void 0&&(j=0),j>ya.nestingLimit)throw Error("max depth exceeded");if(h>=2023)throw b("group");var B=o();if(!fs.test(B))throw b(B,"name");var te=ya.lcFirst(B);B===te&&(B=ya.ucFirst(B)),c("=");var ie=D(o()),Ee=new dee(B);Ee.group=!0;var yt=new fee(te,ie,B,C);yt.filename=Sa.filename,w(Ee,function(St){switch(St){case"option":Oe(Ee,St),c(";");break;case"required":case"repeated":Y(Ee,St,void 0,j+1);break;case"optional":h==="proto3"?Y(Ee,"proto3_optional",void 0,j+1):Y(Ee,"optional",void 0,j+1);break;case"message":O(Ee,St,j+1);break;case"enum":Ie(Ee,St);break;case"reserved":P(Ee.reserved||(Ee.reserved=[]),!0);break;default:throw b(St)}}),x.add(Ee).add(yt)}function he(x){c("<");var C=o();if(AMe.mapKey[C]===void 0)throw b(C,"type");c(",");var j=o();if(!ps.test(j))throw b(j,"type");c(">");var B=o();if(!fs.test(B))throw b(B,"name");c("=");var te=new vMe(v(B),D(o()),C,j);w(te,function(Ee){if(Ee==="option")Oe(te,Ee),c(";");else throw b(Ee)},function(){me(te)}),x.add(te)}function je(x,C,j){if(!fs.test(C=o()))throw b(C,"name");var B=new pee(v(C));w(B,function(ie){ie==="option"?(Oe(B,ie),c(";")):(s(ie),Y(B,"optional",void 0,j))}),x.add(B)}function Ie(x,C){if(!fs.test(C=o()))throw b(C,"name");var j=new bMe(C);w(j,function(te){switch(te){case"option":Oe(j,te),c(";");break;case"reserved":P(j.reserved||(j.reserved=[]),!0),j.reserved===void 0&&(j.reserved=[]);break;default:$e(j,te)}}),x.add(j),x===m&&g.push(j)}function $e(x,C){if(!fs.test(C))throw b(C,"name");c("=");var j=D(o(),!0),B={options:void 0};B.getOption=function(te){return this.options[te]},B.setOption=function(te,ie){xMe.prototype.setOption.call(B,te,ie)},B.setParsedOption=function(){},w(B,function(ie){if(ie==="option")Oe(B,ie),c(";");else throw b(ie)},function(){me(B)}),x.add(C,j,B.comment,B.parsedOptions||B.options)}function Oe(x,C){var j,B,te=!0;for(C==="option"&&(C=o());C!=="=";){if(C==="("){var ie=o();c(")"),C="("+ie+")"}if(te){if(te=!1,C.includes(".")&&!C.includes("(")){var Ee=C.split(".");j=Ee[0]+".",C=Ee[1];continue}j=C}else B=B?B+=C:C;C=o()}var yt=B?j.concat(B):j,lr=Je(x,yt);B=B&&B[0]==="."?B.slice(1):B,j=j&&j[j.length-1]==="."?j.slice(0,-1):j,ce(x,j,lr,B)}function Je(x,C,j){if(j===void 0&&(j=0),j>ya.recursionLimit)throw Error("max depth exceeded");if(c("{",!0)){for(var B={};!c("}",!0);){if(!fs.test(z=o()))throw b(z,"name");if(z===null)throw b(z,"end of input");var te,ie=z;if(c(":",!0),a()==="{")te=Je(x,C+"."+z,j+1);else if(a()==="["){te=[];var Ee;if(c("[",!0)){do Ee=k(!0),te.push(Ee);while(c(",",!0));c("]"),typeof Ee<"u"&&Ne(x,C+"."+z,Ee)}}else te=k(!0),Ne(x,C+"."+z,te);var yt=B[ie];yt&&(te=[].concat(yt).concat(te)),ie!=="__proto__"&&(B[ie]=te),c(",",!0),c(";",!0)}return B}var lr=k(!0);return Ne(x,C,lr),lr}function Ne(x,C,j){if(m===x&&/^features\./.test(C)){_[C]=j;return}x.setOption&&x.setOption(C,j)}function ce(x,C,j,B){x.setParsedOption&&x.setParsedOption(C,j,B)}function me(x){if(c("[",!0)){do Oe(x,"option");while(c(",",!0));c("]")}return x}function nt(x,C,j){if(j===void 0&&(j=0),j>ya.recursionLimit)throw Error("max depth exceeded");if(!fs.test(C=o()))throw b(C,"service name");var B=new TMe(C);w(B,function(ie){if(!S(B,ie,j))if(ie==="rpc")re(B,ie);else throw b(ie)}),x.add(B),x===m&&g.push(B)}function re(x,C){var j=l(),B=C;if(!fs.test(C=o()))throw b(C,"name");var te=C,ie,Ee,yt,lr;if(c("("),c("stream",!0)&&(Ee=!0),!ps.test(C=o())||(ie=C,c(")"),c("returns"),c("("),c("stream",!0)&&(lr=!0),!ps.test(C=o())))throw b(C);yt=C,c(")");var St=new wMe(te,B,ie,yt,Ee,lr);St.comment=j,w(St,function(He){if(He==="option")Oe(St,He),c(";");else throw b(He)}),x.add(St)}function qe(x,C,j){if(!ps.test(C=o()))throw b(C,"reference");var B=C;w(null,function(ie){switch(ie){case"required":case"repeated":Y(x,ie,B,j+1);break;case"optional":h==="proto3"?Y(x,"proto3_optional",B,j+1):Y(x,"optional",B,j+1);break;default:if(h==="proto2"||!ps.test(ie))throw b(ie);s(ie),Y(x,"optional",B,j+1);break}})}for(var z;(z=o())!==null;)switch(z){case"package":if(!u)throw b(z);F();break;case"import":if(!u)throw b(z);E();break;case"syntax":if(!u)throw b(z);oe();break;case"edition":if(!u)throw b(z);M();break;case"option":Oe(m,z),c(";",!0);break;default:if(S(m,z,0)){u=!1;continue}throw b(z)}return T(),Sa.filename=null,{package:d,imports:f,weakImports:p,root:e}}});var yee=y((uRt,_ee)=>{"use strict";_ee.exports=To;var MMe=/\/|\./;function To(t,e){MMe.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),To[t]=e}To("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var gee;To("duration",{Duration:gee={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});To("timestamp",{Timestamp:gee});To("empty",{Empty:{fields:{}}});To("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});To("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});To("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});To.get=function(e){return To[e]||null}});var Eee=y((dRt,See)=>{"use strict";var Lc=See.exports=see();Lc.build="full";Lc.tokenize=eL();Lc.parse=mee();Lc.common=yee();Lc.Root._configure(Lc.Type,Lc.parse,Lc.common)});var aA=y((fRt,vee)=>{"use strict";vee.exports=Eee()});var tL=y((pRt,$Me)=>{$Me.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var Iee=y((Ke,Cee)=>{"use strict";var Rn=aA();Cee.exports=Ke=Rn.descriptor=Rn.Root.fromJSON(tL()).lookup(".google.protobuf");var bee=Rn.Namespace,Uy=Rn.Root,Ea=Rn.Enum,wo=Rn.Type,Uc=Rn.Field,DMe=Rn.MapField,cA=Rn.OneOf,Fy=Rn.Service,lA=Rn.Method,Tee=Rn.util.patterns,LMe=Tee.numberRe,uA=Tee.typeRefRe;Uy.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ke.FileDescriptorSet.decode(e));var r=new Uy;if(e.file)for(var n,i,o=0,s;o<e.file.length;++o){i=r,(n=e.file[o]).package&&n.package.length&&(i=r.define(n.package));var a=HMe(n);if(n.name&&n.name.length&&r.files.push(i.filename=n.name),n.messageType)for(s=0;s<n.messageType.length;++s)i.add(wo.fromDescriptor(n.messageType[s],a));if(n.enumType)for(s=0;s<n.enumType.length;++s)i.add(Ea.fromDescriptor(n.enumType[s],a));if(n.extension)for(s=0;s<n.extension.length;++s)i.add(Uc.fromDescriptor(n.extension[s],a));if(n.service)for(s=0;s<n.service.length;++s)i.add(Fy.fromDescriptor(n.service[s],a));var c=Tp(n.options,Ke.FileOptions);if(c){var l=Object.keys(c);for(s=0;s<l.length;++s)i.setOption(l[s],c[l[s]])}}return r.resolveAll()};Uy.prototype.toDescriptor=function(e){var r=Ke.FileDescriptorSet.create();return wee(this,r.file,e),r};function wee(t,e,r){var n=Ke.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});WMe(r,n),t instanceof Uy||(n.package=t.fullName.substring(1));for(var i=0,o;i<t.nestedArray.length;++i)(o=t._nestedArray[i])instanceof wo?n.messageType.push(o.toDescriptor(r)):o instanceof Ea?n.enumType.push(o.toDescriptor()):o instanceof Uc?n.extension.push(o.toDescriptor(r)):o instanceof Fy?n.service.push(o.toDescriptor()):o instanceof bee&&wee(o,e,r);n.options=wp(t.options,Ke.FileOptions),n.messageType.length+n.enumType.length+n.extension.length+n.service.length&&e.push(n)}var UMe=0;wo.fromDescriptor=function(e,r,n,i){if(i===void 0&&(i=0),i>Rn.util.nestingLimit)throw Error("max depth exceeded");typeof e.length=="number"&&(e=Ke.DescriptorProto.decode(e));var o=new wo(e.name.length?e.name:"Type"+UMe++,Tp(e.options,Ke.MessageOptions)),s;if(n||(o._edition=r),e.oneofDecl)for(s=0;s<e.oneofDecl.length;++s)o.add(cA.fromDescriptor(e.oneofDecl[s]));if(e.field)for(s=0;s<e.field.length;++s){var a=Uc.fromDescriptor(e.field[s],r,!0);o.add(a),e.field[s].hasOwnProperty("oneofIndex")&&o.oneofsArray[e.field[s].oneofIndex].add(a)}if(e.extension)for(s=0;s<e.extension.length;++s)o.add(Uc.fromDescriptor(e.extension[s],r,!0));if(e.nestedType)for(s=0;s<e.nestedType.length;++s)o.add(wo.fromDescriptor(e.nestedType[s],r,!0,i+1)),e.nestedType[s].options&&e.nestedType[s].options.mapEntry&&o.setOption("map_entry",!0);if(e.enumType)for(s=0;s<e.enumType.length;++s)o.add(Ea.fromDescriptor(e.enumType[s],r,!0));if(e.extensionRange&&e.extensionRange.length)for(o.extensions=[],s=0;s<e.extensionRange.length;++s)o.extensions.push([e.extensionRange[s].start,e.extensionRange[s].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(o.reserved=[],e.reservedRange)for(s=0;s<e.reservedRange.length;++s)o.reserved.push([e.reservedRange[s].start,e.reservedRange[s].end]);if(e.reservedName)for(s=0;s<e.reservedName.length;++s)o.reserved.push(e.reservedName[s])}return o};wo.prototype.toDescriptor=function(e){var r=Ke.DescriptorProto.create({name:this.name}),n;for(n=0;n<this.fieldsArray.length;++n){var i;if(r.field.push(i=this._fieldsArray[n].toDescriptor(e)),this._fieldsArray[n]instanceof DMe){var o=rL(this._fieldsArray[n].keyType,this._fieldsArray[n].resolvedKeyType,!1),s=rL(this._fieldsArray[n].type,this._fieldsArray[n].resolvedType,!1),a=s===11||s===14?this._fieldsArray[n].resolvedType&&Ree(this.parent,this._fieldsArray[n].resolvedType)||this._fieldsArray[n].type:void 0;r.nestedType.push(Ke.DescriptorProto.create({name:i.typeName,field:[Ke.FieldDescriptorProto.create({name:"key",number:1,label:1,type:o}),Ke.FieldDescriptorProto.create({name:"value",number:2,label:1,type:s,typeName:a})],options:Ke.MessageOptions.create({mapEntry:!0})}))}}for(n=0;n<this.oneofsArray.length;++n)r.oneofDecl.push(this._oneofsArray[n].toDescriptor());for(n=0;n<this.nestedArray.length;++n)this._nestedArray[n]instanceof Uc?r.field.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof wo?r.nestedType.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof Ea&&r.enumType.push(this._nestedArray[n].toDescriptor());if(this.extensions)for(n=0;n<this.extensions.length;++n)r.extensionRange.push(Ke.DescriptorProto.ExtensionRange.create({start:this.extensions[n][0],end:this.extensions[n][1]}));if(this.reserved)for(n=0;n<this.reserved.length;++n)typeof this.reserved[n]=="string"?r.reservedName.push(this.reserved[n]):r.reservedRange.push(Ke.DescriptorProto.ReservedRange.create({start:this.reserved[n][0],end:this.reserved[n][1]}));return r.options=wp(this.options,Ke.MessageOptions),r};Uc.fromDescriptor=function(e,r,n){if(typeof e.length=="number"&&(e=Ke.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var i=e.typeName,o;if(i!=null&&i!==""){if(typeof i!="string"||!uA.test(i))throw Error("illegal type name: "+i);o=i}else o=qMe(e.type);var s;switch(e.label){case 1:s=void 0;break;case 2:s="required";break;case 3:s="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;if(a!=null&&a!==""){if(typeof a!="string"||!uA.test(a))throw Error("illegal type name: "+a)}else a=void 0;var c=new Uc(e.name.length?e.name:"field"+e.number,e.number,o,s,a);if(n||(c._edition=r),c.options=Tp(e.options,Ke.FieldOptions),e.proto3_optional&&(c.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var u=LMe.exec(l);u&&(l=parseInt(l));break}c.setOption("default",l)}return VMe(e.type)&&(r==="proto3"?e.options&&!e.options.packed&&c.setOption("packed",!1):(!r||r==="proto2")&&e.options&&e.options.packed&&c.setOption("packed",!0)),c};Uc.prototype.toDescriptor=function(e){var r=Ke.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=Rn.util.ucFirst(this.name),r.label=3;else{switch(r.type=rL(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?Ree(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?r.label=3:this.required&&e==="proto2"?r.label=2:r.label=1}if(r.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&this.parent instanceof wo&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(r.options=wp(this.options,Ke.FieldOptions),this.options.default!=null&&(r.defaultValue=String(this.options.default)),this.options.proto3_optional&&(r.proto3_optional=!0)),e==="proto3"?this.packed||((r.options||(r.options=Ke.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((r.options||(r.options=Ke.FieldOptions.create())).packed=!0),r};var FMe=0;Ea.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ke.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var o=0;o<e.value.length;++o){var s=e.value[o].name,a=e.value[o].number||0;i[s&&s.length?s:"NAME"+a]=a}var c=new Ea(e.name&&e.name.length?e.name:"Enum"+FMe++,i,Tp(e.options,Ke.EnumOptions));return n||(c._edition=r),c};Ea.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(Ke.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return Ke.EnumDescriptorProto.create({name:this.name,value:e,options:wp(this.options,Ke.EnumOptions)})};var zMe=0;cA.fromDescriptor=function(e){return typeof e.length=="number"&&(e=Ke.OneofDescriptorProto.decode(e)),new cA(e.name&&e.name.length?e.name:"oneof"+zMe++)};cA.prototype.toDescriptor=function(){return Ke.OneofDescriptorProto.create({name:this.name})};var jMe=0;Fy.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ke.ServiceDescriptorProto.decode(e));var i=new Fy(e.name&&e.name.length?e.name:"Service"+jMe++,Tp(e.options,Ke.ServiceOptions));if(n||(i._edition=r),e.method)for(var o=0;o<e.method.length;++o)i.add(lA.fromDescriptor(e.method[o]));return i};Fy.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return Ke.ServiceDescriptorProto.create({name:this.name,method:e,options:wp(this.options,Ke.ServiceOptions)})};var BMe=0;lA.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ke.MethodDescriptorProto.decode(e));var r=e.inputType,n=e.outputType;if(r!=null&&r!==""&&(typeof r!="string"||!uA.test(r)))throw Error("illegal type name: "+r);if(n!=null&&n!==""&&(typeof n!="string"||!uA.test(n)))throw Error("illegal type name: "+n);return new lA(e.name&&e.name.length?e.name:"Method"+BMe++,"rpc",r,n,!!e.clientStreaming,!!e.serverStreaming,Tp(e.options,Ke.MethodOptions))};lA.prototype.toDescriptor=function(){return Ke.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:wp(this.options,Ke.MethodOptions)})};function qMe(t){switch(t){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+t)}function VMe(t){switch(t){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function rL(t,e,r){switch(t){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof Ea)return 14;if(e instanceof wo)return r?10:11;throw Error("illegal type: "+t)}function xee(t,e){for(var r={},n=0,i,o;n<e.fieldsArray.length;++n)if((o=(i=e._fieldsArray[n]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(t,o)){var s=GMe(o);i.resolvedType instanceof wo?r[s]=xee(t[o],i.resolvedType):i.resolvedType instanceof Ea?r[s]=i.resolvedType.valuesById[t[o]]:r[s]=t[o]}return r}function Tp(t,e){if(t)return xee(e.toObject(t),e)}function Aee(t,e){for(var r={},n=Object.keys(t),i=0;i<n.length;++i){var o=n[i],s=Rn.util.camelCase(o);if(Object.prototype.hasOwnProperty.call(e.fields,s)){var a=e.fields[s];a.resolvedType instanceof wo?r[s]=Aee(t[o],a.resolvedType):r[s]=t[o],a.repeated&&!Array.isArray(r[s])&&(r[s]=[r[s]])}}return r}function wp(t,e){if(t)return e.fromObject(Aee(t,e))}function Ree(t,e){var r=t.fullName.split("."),n=e.fullName.split("."),i=0,o=0,s=n.length-1;if(!(t instanceof Uy)&&e instanceof bee)for(;i<r.length&&o<s&&r[i]===n[o];){var a=e.lookup(r[i++],!0);if(a!==null&&a!==e)break;++o}else for(;i<r.length&&o<s&&r[i]===n[o];++i,++o);return n.slice(o).join(".")}function GMe(t){return t.substring(0,1)+t.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,r){return"_"+r.toLowerCase()})}function HMe(t){if(t.syntax==="editions"){if(t.edition===Ke.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+t.edition)}return t.syntax==="proto3"?"proto3":"proto2"}function WMe(t,e){if(t)if(t==="proto2"||t==="proto3")e.syntax=t;else if(e.syntax="editions",t==="2023")e.edition=Ke.Edition.EDITION_2023;else throw new Error("Unsupported edition "+t)}});var Pee=y((hRt,YMe)=>{YMe.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Oee=y((mRt,KMe)=>{KMe.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Nee=y((gRt,ZMe)=>{ZMe.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Dee=y(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.addCommonProtos=Fc.loadProtosWithOptionsSync=Fc.loadProtosWithOptions=void 0;var kee=Z("fs"),Mee=Z("path"),xp=aA();function $ee(t,e){let r=t.resolvePath;t.resolvePath=(n,i)=>{if(Mee.isAbsolute(i))return i;for(let o of e){let s=Mee.join(o,i);try{return kee.accessSync(s,kee.constants.R_OK),s}catch{continue}}return process.emitWarning(`${i} not found in any of the include paths ${e}`),r(n,i)}}async function JMe(t,e){let r=new xp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));$ee(r,e.includeDirs)}let n=await r.load(t,e);return n.resolveAll(),n}Fc.loadProtosWithOptions=JMe;function XMe(t,e){let r=new xp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");$ee(r,e.includeDirs)}let n=r.loadSync(t,e);return n.resolveAll(),n}Fc.loadProtosWithOptionsSync=XMe;function QMe(){let t=Pee(),e=tL(),r=Oee(),n=Nee();xp.common("api",t.nested.google.nested.protobuf.nested),xp.common("descriptor",e.nested.google.nested.protobuf.nested),xp.common("source_context",r.nested.google.nested.protobuf.nested),xp.common("type",n.nested.google.nested.protobuf.nested)}Fc.addCommonProtos=QMe});var cL=y(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.loadFileDescriptorSetFromObject=gr.loadFileDescriptorSetFromBuffer=gr.fromJSON=gr.loadSync=gr.load=gr.IdempotencyLevel=gr.isAnyExtension=gr.Long=void 0;var e$e=yQ(),hs=aA(),sL=Iee(),aL=Dee(),t$e=uD();gr.Long=t$e;function r$e(t){return"@type"in t&&typeof t["@type"]=="string"}gr.isAnyExtension=r$e;var Lee;(function(t){t.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",t.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",t.IDEMPOTENT="IDEMPOTENT"})(Lee=gr.IdempotencyLevel||(gr.IdempotencyLevel={}));var Uee={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function n$e(t,e){return t===""?e:t+"."+e}function i$e(t){return t instanceof hs.Service||t instanceof hs.Type||t instanceof hs.Enum}function o$e(t){return t instanceof hs.Namespace||t instanceof hs.Root}function Fee(t,e){let r=n$e(e,t.name);return i$e(t)?[[r,t]]:o$e(t)&&typeof t.nested<"u"?Object.keys(t.nested).map(n=>Fee(t.nested[n],r)).reduce((n,i)=>n.concat(i),[]):[]}function nL(t,e){return function(n){return t.toObject(t.decode(n),e)}}function iL(t){return function(r){if(Array.isArray(r))throw new Error(`Failed to serialize message: expected object with ${t.name} structure, got array instead`);let n=t.fromObject(r);return t.encode(n).finish()}}function s$e(t){return(t||[]).reduce((e,r)=>{for(let[n,i]of Object.entries(r))n==="uninterpreted_option"?e.uninterpreted_option.push(r.uninterpreted_option):e[n]=i;return e},{deprecated:!1,idempotency_level:Lee.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function a$e(t,e,r,n){let i=t.resolvedRequestType,o=t.resolvedResponseType;return{path:"/"+e+"/"+t.name,requestStream:!!t.requestStream,responseStream:!!t.responseStream,requestSerialize:iL(i),requestDeserialize:nL(i,r),responseSerialize:iL(o),responseDeserialize:nL(o,r),originalName:e$e(t.name),requestType:oL(i,r,n),responseType:oL(o,r,n),options:s$e(t.parsedOptions)}}function c$e(t,e,r,n){let i={};for(let o of t.methodsArray)i[o.name]=a$e(o,e,r,n);return i}function oL(t,e,r){let n=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:n.$type.toObject(n,Uee),fileDescriptorProtos:r,serialize:iL(t),deserialize:nL(t,e)}}function l$e(t,e){let r=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:r.$type.toObject(r,Uee),fileDescriptorProtos:e}}function u$e(t,e,r,n){if(t instanceof hs.Service)return c$e(t,e,r,n);if(t instanceof hs.Type)return oL(t,r,n);if(t instanceof hs.Enum)return l$e(t,n);throw new Error("Type mismatch in reflection object handling")}function dA(t,e){let r={};t.resolveAll();let i=t.toDescriptor("proto3").file.map(o=>Buffer.from(sL.FileDescriptorProto.encode(o).finish()));for(let[o,s]of Fee(t,""))r[o]=u$e(s,o,e,i);return r}function zee(t,e){e=e||{};let r=hs.Root.fromDescriptor(t);return r.resolveAll(),dA(r,e)}function d$e(t,e){return(0,aL.loadProtosWithOptions)(t,e).then(r=>dA(r,e))}gr.load=d$e;function f$e(t,e){let r=(0,aL.loadProtosWithOptionsSync)(t,e);return dA(r,e)}gr.loadSync=f$e;function p$e(t,e){e=e||{};let r=hs.Root.fromJSON(t);return r.resolveAll(),dA(r,e)}gr.fromJSON=p$e;function h$e(t,e){let r=sL.FileDescriptorSet.decode(t);return zee(r,e)}gr.loadFileDescriptorSetFromBuffer=h$e;function m$e(t,e){let r=sL.FileDescriptorSet.fromObject(t);return zee(r,e)}gr.loadFileDescriptorSetFromObject=m$e;(0,aL.addCommonProtos)()});var zc=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.registerChannelzSocket=Ut.registerChannelzServer=Ut.registerChannelzSubchannel=Ut.registerChannelzChannel=Ut.ChannelzCallTrackerStub=Ut.ChannelzCallTracker=Ut.ChannelzChildrenTrackerStub=Ut.ChannelzChildrenTracker=Ut.ChannelzTrace=Ut.ChannelzTraceStub=void 0;Ut.unregisterChannelzRef=E$e;Ut.getChannelzHandlers=Yee;Ut.getChannelzServiceDefinition=Kee;Ut.setup=O$e;var pA=Z("net"),Vu=(jX(),bn(zX)),zy=An(),jy=Xe(),g$e=Bn(),_$e=Ox(),y$e=Dx();function lL(t){return{channel_id:t.id,name:t.name}}function hL(t){return{subchannel_id:t.id,name:t.name}}function S$e(t){return{server_id:t.id}}function gA(t){return{socket_id:t.id,name:t.name}}var jee=32,mL=100,uL=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:ms(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ut.ChannelzTraceStub=uL;var dL=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,r,n){let i=new Date;this.events.push({description:r,severity:e,timestamp:i,childChannel:n?.kind==="channel"?n:void 0,childSubchannel:n?.kind==="subchannel"?n:void 0}),this.events.length>=jee*2&&(this.events=this.events.slice(jee)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:ms(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:ms(e.timestamp),channel_ref:e.childChannel?lL(e.childChannel):null,subchannel_ref:e.childSubchannel?hL(e.childSubchannel):null}))}}};Ut.ChannelzTrace=dL;var hA=class{constructor(){this.channelChildren=new Vu.OrderedMap,this.subchannelChildren=new Vu.OrderedMap,this.socketChildren=new Vu.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let r=this.trackerMap[e.kind],n=r.find(e.id);n.equals(r.end())?r.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let r=this.trackerMap[e.kind],n=r.getElementByKey(e.id);n!==void 0&&(n.count-=1,n.count===0&&r.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ut.ChannelzChildrenTracker=hA;var fL=class extends hA{refChild(){}unrefChild(){}};Ut.ChannelzChildrenTrackerStub=fL;var mA=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ut.ChannelzCallTracker=mA;var pL=class extends mA{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ut.ChannelzCallTrackerStub=pL;var va={channel:new Vu.OrderedMap,subchannel:new Vu.OrderedMap,server:new Vu.OrderedMap,socket:new Vu.OrderedMap},_A=t=>{let e=1;function r(){return e++}let n=va[t];return(i,o,s)=>{let a=r(),c={id:a,name:i,kind:t};return s&&n.setElement(a,{ref:c,getInfo:o}),c}};Ut.registerChannelzChannel=_A("channel");Ut.registerChannelzSubchannel=_A("subchannel");Ut.registerChannelzServer=_A("server");Ut.registerChannelzSocket=_A("socket");function E$e(t){va[t.kind].eraseElementByKey(t.id)}function v$e(t){let e=Number.parseInt(t,16);return[e/256|0,e%256]}function Bee(t){if(t==="")return[];let e=t.split(":").map(n=>v$e(n));return[].concat(...e)}function b$e(t){return(0,pA.isIPv6)(t)&&t.toLowerCase().startsWith("::ffff:")&&(0,pA.isIPv4)(t.substring(7))}function qee(t){return Buffer.from(Uint8Array.from(t.split(".").map(e=>Number.parseInt(e))))}function T$e(t){if((0,pA.isIPv4)(t))return qee(t);if(b$e(t))return qee(t.substring(7));if((0,pA.isIPv6)(t)){let e,r,n=t.indexOf("::");n===-1?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+2));let i=Buffer.from(Bee(e)),o=Buffer.from(Bee(r)),s=Buffer.alloc(16-i.length-o.length,0);return Buffer.concat([i,s,o])}else return null}function Gee(t){switch(t){case zy.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case zy.ConnectivityState.IDLE:return{state:"IDLE"};case zy.ConnectivityState.READY:return{state:"READY"};case zy.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case zy.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function ms(t){if(!t)return null;let e=t.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function Hee(t){let e=t.getInfo(),r=[],n=[];return e.children.channels.forEach(i=>{r.push(lL(i[1].ref))}),e.children.subchannels.forEach(i=>{n.push(hL(i[1].ref))}),{ref:lL(t.ref),data:{target:e.target,state:Gee(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:ms(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:r,subchannel_ref:n}}function w$e(t,e){let r=parseInt(t.request.channel_id,10),n=va.channel.getElementByKey(r);if(n===void 0){e({code:jy.Status.NOT_FOUND,details:"No channel data found for id "+r});return}e(null,{channel:Hee(n)})}function x$e(t,e){let r=parseInt(t.request.max_results,10)||mL,n=[],i=parseInt(t.request.start_channel_id,10),o=va.channel,s;for(s=o.lowerBound(i);!s.equals(o.end())&&n.length<r;s=s.next())n.push(Hee(s.pointer[1]));e(null,{channel:n,end:s.equals(o.end())})}function Wee(t){let e=t.getInfo(),r=[];return e.listenerChildren.sockets.forEach(n=>{r.push(gA(n[1].ref))}),{ref:S$e(t.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:ms(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:r}}function A$e(t,e){let r=parseInt(t.request.server_id,10),i=va.server.getElementByKey(r);if(i===void 0){e({code:jy.Status.NOT_FOUND,details:"No server data found for id "+r});return}e(null,{server:Wee(i)})}function R$e(t,e){let r=parseInt(t.request.max_results,10)||mL,n=parseInt(t.request.start_server_id,10),i=va.server,o=[],s;for(s=i.lowerBound(n);!s.equals(i.end())&&o.length<r;s=s.next())o.push(Wee(s.pointer[1]));e(null,{server:o,end:s.equals(i.end())})}function C$e(t,e){let r=parseInt(t.request.subchannel_id,10),n=va.subchannel.getElementByKey(r);if(n===void 0){e({code:jy.Status.NOT_FOUND,details:"No subchannel data found for id "+r});return}let i=n.getInfo(),o=[];i.children.sockets.forEach(a=>{o.push(gA(a[1].ref))});let s={ref:hL(n.ref),data:{target:i.target,state:Gee(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:ms(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:o};e(null,{subchannel:s})}function Vee(t){var e;return(0,g$e.isTcpSubchannelAddress)(t)?{address:"tcpip_address",tcpip_address:{ip_address:(e=T$e(t.host))!==null&&e!==void 0?e:void 0,port:t.port}}:{address:"uds_address",uds_address:{filename:t.path}}}function I$e(t,e){var r,n,i,o,s;let a=parseInt(t.request.socket_id,10),c=va.socket.getElementByKey(a);if(c===void 0){e({code:jy.Status.NOT_FOUND,details:"No socket data found for id "+a});return}let l=c.getInfo(),u=l.security?{model:"tls",tls:{cipher_suite:l.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(r=l.security.cipherSuiteStandardName)!==null&&r!==void 0?r:void 0,other_name:(n=l.security.cipherSuiteOtherName)!==null&&n!==void 0?n:void 0,local_certificate:(i=l.security.localCertificate)!==null&&i!==void 0?i:void 0,remote_certificate:(o=l.security.remoteCertificate)!==null&&o!==void 0?o:void 0}}:null,d={ref:gA(c.ref),local:l.localAddress?Vee(l.localAddress):null,remote:l.remoteAddress?Vee(l.remoteAddress):null,remote_name:(s=l.remoteName)!==null&&s!==void 0?s:void 0,security:u,data:{keep_alives_sent:l.keepAlivesSent,streams_started:l.streamsStarted,streams_succeeded:l.streamsSucceeded,streams_failed:l.streamsFailed,last_local_stream_created_timestamp:ms(l.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:ms(l.lastRemoteStreamCreatedTimestamp),messages_received:l.messagesReceived,messages_sent:l.messagesSent,last_message_received_timestamp:ms(l.lastMessageReceivedTimestamp),last_message_sent_timestamp:ms(l.lastMessageSentTimestamp),local_flow_control_window:l.localFlowControlWindow?{value:l.localFlowControlWindow}:null,remote_flow_control_window:l.remoteFlowControlWindow?{value:l.remoteFlowControlWindow}:null}};e(null,{socket:d})}function P$e(t,e){let r=parseInt(t.request.server_id,10),n=va.server.getElementByKey(r);if(n===void 0){e({code:jy.Status.NOT_FOUND,details:"No server data found for id "+r});return}let i=parseInt(t.request.start_socket_id,10),o=parseInt(t.request.max_results,10)||mL,a=n.getInfo().sessionChildren.sockets,c=[],l;for(l=a.lowerBound(i);!l.equals(a.end())&&c.length<o;l=l.next())c.push(gA(l.pointer[1].ref));e(null,{socket_ref:c,end:l.equals(a.end())})}function Yee(){return{GetChannel:w$e,GetTopChannels:x$e,GetServer:A$e,GetServers:R$e,GetSubchannel:C$e,GetSocket:I$e,GetServerSockets:P$e}}var fA=null;function Kee(){if(fA)return fA;let t=cL().loadSync,e=t("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return fA=(0,y$e.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,fA}function O$e(){(0,_$e.registerAdminService)(Kee,Yee)}});var yA=y(gL=>{"use strict";Object.defineProperty(gL,"__esModule",{value:!0});gL.getNextCallNumber=k$e;var N$e=0;function k$e(){return N$e++}});var _L=y(SA=>{"use strict";Object.defineProperty(SA,"__esModule",{value:!0});SA.CompressionAlgorithms=void 0;var Zee;(function(t){t[t.identity=0]="identity",t[t.deflate=1]="deflate",t[t.gzip=2]="gzip"})(Zee||(SA.CompressionAlgorithms=Zee={}))});var SL=y(EA=>{"use strict";Object.defineProperty(EA,"__esModule",{value:!0});EA.BaseFilter=void 0;var yL=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};EA.BaseFilter=yL});var wL=y(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.CompressionFilterFactory=Rp.CompressionFilter=void 0;var vA=Z("zlib"),Xee=_L(),jc=Xe(),M$e=SL(),$$e=Nt(),D$e=t=>typeof t=="number"&&typeof Xee.CompressionAlgorithms[t]=="string",Ap=class{async writeMessage(e,r){let n=e;r&&(n=await this.compressMessage(n));let i=Buffer.allocUnsafe(n.length+5);return i.writeUInt8(r?1:0,0),i.writeUInt32BE(n.length,1),n.copy(i,5),i}async readMessage(e){let r=e.readUInt8(0)===1,n=e.slice(5);return r&&(n=await this.decompressMessage(n)),n}},Gu=class extends Ap{async compressMessage(e){return e}async writeMessage(e,r){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},EL=class extends Ap{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{vA.deflate(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=vA.createInflate();s.on("error",a=>{n({code:jc.Status.INTERNAL,details:"Failed to decompress deflate-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:jc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},vL=class extends Ap{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{vA.gzip(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=vA.createGunzip();s.on("error",a=>{n({code:jc.Status.INTERNAL,details:"Failed to decompress gzip-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:jc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},bL=class extends Ap{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Jee(t,e){switch(t){case"identity":return new Gu;case"deflate":return new EL(e);case"gzip":return new vL(e);default:return new bL(t)}}var bA=class extends M$e.BaseFilter{constructor(e,r){var n,i,o;super(),this.sharedFilterConfig=r,this.sendCompression=new Gu,this.receiveCompression=new Gu,this.currentCompressionAlgorithm="identity";let s=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(n=e["grpc.max_receive_message_length"])!==null&&n!==void 0?n:jc.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(i=e["grpc.max_send_message_length"])!==null&&i!==void 0?i:jc.DEFAULT_MAX_SEND_MESSAGE_LENGTH,s!==void 0)if(D$e(s)){let a=Xee.CompressionAlgorithms[s],c=(o=r.serverSupportedEncodingHeader)===null||o===void 0?void 0:o.split(",");(!c||c.includes(a))&&(this.currentCompressionAlgorithm=a,this.sendCompression=Jee(this.currentCompressionAlgorithm,-1))}else $$e.log(jc.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${s}`)}async sendMetadata(e){let r=await e;return r.set("grpc-accept-encoding","identity,deflate,gzip"),r.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?r.remove("grpc-encoding"):r.set("grpc-encoding",this.currentCompressionAlgorithm),r}receiveMetadata(e){let r=e.get("grpc-encoding");if(r.length>0){let i=r[0];typeof i=="string"&&(this.receiveCompression=Jee(i,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let n=e.get("grpc-accept-encoding")[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new Gu,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var r;let n=await e;if(this.maxSendMessageLength!==-1&&n.message.length>this.maxSendMessageLength)throw{code:jc.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return this.sendCompression instanceof Gu?i=!1:i=(((r=n.flags)!==null&&r!==void 0?r:0)&2)===0,{message:await this.sendCompression.writeMessage(n.message,i),flags:n.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};Rp.CompressionFilter=bA;var TL=class{constructor(e,r){this.options=r,this.sharedFilterConfig={}}createFilter(){return new bA(this.options,this.sharedFilterConfig)}};Rp.CompressionFilterFactory=TL});var By=y(xL=>{"use strict";Object.defineProperty(xL,"__esModule",{value:!0});xL.restrictControlPlaneStatusCode=U$e;var gs=Xe(),L$e=[gs.Status.OK,gs.Status.INVALID_ARGUMENT,gs.Status.NOT_FOUND,gs.Status.ALREADY_EXISTS,gs.Status.FAILED_PRECONDITION,gs.Status.ABORTED,gs.Status.OUT_OF_RANGE,gs.Status.DATA_LOSS];function U$e(t,e){return L$e.includes(t)?{code:gs.Status.INTERNAL,details:`Invalid status from control plane: ${t} ${gs.Status[t]} ${e}`}:{code:t,details:e}}});var Cp=y(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.minDeadline=F$e;Hu.getDeadlineTimeoutString=j$e;Hu.getRelativeTimeout=q$e;Hu.deadlineToString=V$e;Hu.formatDateDifference=G$e;function F$e(...t){let e=1/0;for(let r of t){let n=r instanceof Date?r.getTime():r;n<e&&(e=n)}return e}var z$e=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function j$e(t){let e=new Date().getTime();t instanceof Date&&(t=t.getTime());let r=Math.max(t-e,0);for(let[n,i]of z$e){let o=r/i;if(o<1e8)return String(Math.ceil(o))+n}throw new Error("Deadline is too far in the future")}var B$e=2147483647;function q$e(t){let e=t instanceof Date?t.getTime():t,r=new Date().getTime(),n=e-r;return n<0?0:n>B$e?1/0:n}function V$e(t){if(t instanceof Date)return t.toISOString();{let e=new Date(t);return Number.isNaN(e.getTime())?""+t:e.toISOString()}}function G$e(t,e){return((e.getTime()-t.getTime())/1e3).toFixed(3)+"s"}});var wA=y(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.FilterStackFactory=Ip.FilterStack=void 0;var TA=class{constructor(e){this.filters=e}sendMetadata(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMetadata(r);return r}receiveMetadata(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMetadata(r);return r}sendMessage(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMessage(r);return r}receiveMessage(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMessage(r);return r}receiveTrailers(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveTrailers(r);return r}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ip.FilterStack=TA;var AL=class t{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new t([...this.factories])}createFilter(){return new TA(this.factories.map(e=>e.createFilter()))}};Ip.FilterStackFactory=AL});var Qee=y(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.SingleSubchannelChannel=void 0;var H$e=yA(),qy=zc(),W$e=wL(),Y$e=An(),Vy=Xe(),K$e=By(),Z$e=Cp(),J$e=wA(),RL=Ar(),X$e=fo(),xA=xn(),CL=class{constructor(e,r,n,i,o){var s,a;this.subchannel=e,this.method=r,this.options=i,this.callNumber=o,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let c=this.method.split("/"),l="";c.length>=2&&(l=c[1]);let u=(a=(s=(0,xA.splitHostPort)(this.options.host))===null||s===void 0?void 0:s.host)!==null&&a!==void 0?a:"localhost";this.serviceUrl=`https://${u}/${l}`;let d=(0,Z$e.getRelativeTimeout)(i.deadline);d!==1/0&&(d<=0?this.cancelWithStatus(Vy.Status.DEADLINE_EXCEEDED,"Deadline exceeded"):setTimeout(()=>{this.cancelWithStatus(Vy.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},d)),this.filterStack=n.createFilter()}cancelWithStatus(e,r){this.childCall?this.childCall.cancelWithStatus(e,r):this.pendingStatus={code:e,details:r,metadata:new RL.Metadata}}getPeer(){var e,r;return(r=(e=this.childCall)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.subchannel.getAddress()}async start(e,r){if(this.pendingStatus){r.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==Y$e.ConnectivityState.READY){r.onReceiveStatus({code:Vy.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new RL.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),i;try{i=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(s){let a=s,{code:c,details:l}=(0,K$e.restrictControlPlaneStatusCode)(typeof a.code=="number"?a.code:Vy.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${a.message}`);r.onReceiveStatus({code:c,details:l,metadata:new RL.Metadata});return}i.merge(n);let o={onReceiveMetadata:async s=>{r.onReceiveMetadata(await this.filterStack.receiveMetadata(s))},onReceiveMessage:async s=>{this.readFilterPending=!0;let a=await this.filterStack.receiveMessage(s);this.readFilterPending=!1,r.onReceiveMessage(a),this.pendingStatus&&r.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async s=>{let a=await this.filterStack.receiveTrailers(s);this.readFilterPending?this.pendingStatus=a:r.onReceiveStatus(a)}};this.childCall=this.subchannel.createCall(i,this.options.host,this.method,o),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,r){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw new Error("Method not implemented.")}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}},IL=class{constructor(e,r,n){this.subchannel=e,this.target=r,this.channelzEnabled=!1,this.channelzTrace=new qy.ChannelzTrace,this.callTracker=new qy.ChannelzCallTracker,this.childrenTracker=new qy.ChannelzChildrenTracker,this.channelzEnabled=n["grpc.enable_channelz"]!==0,this.channelzRef=(0,qy.registerChannelzChannel)((0,xA.uriToString)(r),()=>({target:`${(0,xA.uriToString)(r)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new J$e.FilterStackFactory([new W$e.CompressionFilterFactory(this,n)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,qy.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,xA.uriToString)(this.target)}getConnectivityState(e){throw new Error("Method not implemented.")}watchConnectivityState(e,r,n){throw new Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(e,r){let n={deadline:r,host:(0,X$e.getDefaultAuthority)(this.target),flags:Vy.Propagate.DEFAULTS,parentCall:null};return new CL(this.subchannel,e,this.filterStackFactory,n,(0,H$e.getNextCallNumber)())}};AA.SingleSubchannelChannel=IL});var ete=y(CA=>{"use strict";Object.defineProperty(CA,"__esModule",{value:!0});CA.Subchannel=void 0;var wt=An(),Q$e=cp(),PL=Nt(),RA=Xe(),eDe=xn(),tDe=Bn(),_s=zc(),rDe=Qee(),nDe="subchannel",iDe=~(1<<31),OL=class{constructor(e,r,n,i,o){var s;this.channelTarget=e,this.subchannelAddress=r,this.options=n,this.connector=o,this.connectivityState=wt.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let a={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Q$e.BackoffTimeout(()=>{this.handleBackoffTimer()},a),this.backoffTimeout.unref(),this.subchannelAddressString=(0,tDe.subchannelAddressToString)(r),this.keepaliveTime=(s=n["grpc.keepalive_time_ms"])!==null&&s!==void 0?s:-1,n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new _s.ChannelzTraceStub,this.callTracker=new _s.ChannelzCallTrackerStub,this.childrenTracker=new _s.ChannelzChildrenTrackerStub,this.streamTracker=new _s.ChannelzCallTrackerStub):(this.channelzTrace=new _s.ChannelzTrace,this.callTracker=new _s.ChannelzCallTracker,this.childrenTracker=new _s.ChannelzChildrenTracker,this.streamTracker=new _s.ChannelzCallTracker),this.channelzRef=(0,_s.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(n,void 0,2)),this.secureConnector=i._createSecureConnector(e,n)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){PL.trace(RA.LogVerbosity.DEBUG,nDe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){PL.trace(RA.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING):this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let r=Math.min(this.keepaliveTime,iDe);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":r})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.READY)?(this.transport=r,this.channelzEnabled&&this.childrenTracker.refChild(r.getChannelzRef()),r.addDisconnectListener(n=>{this.transitionToState([wt.ConnectivityState.READY],wt.ConnectivityState.IDLE),n&&this.keepaliveTime>0&&(this.keepaliveTime*=2,PL.log(RA.LogVerbosity.ERROR,`Connection to ${(0,eDe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):r.shutdown()},r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.TRANSIENT_FAILURE,`${r}`)})}transitionToState(e,r,n){var i,o;if(e.indexOf(this.connectivityState)===-1)return!1;n?this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]+' with error "'+n+'"'):this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+wt.ConnectivityState[r]);let s=this.connectivityState;switch(this.connectivityState=r,r){case wt.ConnectivityState.READY:this.stopBackoff();break;case wt.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case wt.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)===null||i===void 0||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case wt.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(o=this.transport)===null||o===void 0||o.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${r}`)}for(let a of this.stateListeners)a(this,s,r,this.keepaliveTime,n);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,_s.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.CONNECTING,wt.ConnectivityState.READY],wt.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,r,n,i){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let o;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),o={onCallEnd:s=>{s.code===RA.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):o={},this.transport.createCall(e,r,n,i,o)}startConnecting(){process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.IDLE],wt.ConnectivityState.CONNECTING)||this.connectivityState===wt.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||(this.subchannelChannel=new rDe.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw new Error("Not implemented")}getOrCreateDataProducer(e,r){let n=this.dataProducers.get(e);if(n)return n;let i=r(this);return this.dataProducers.set(e,i),i}removeDataProducer(e){this.dataProducers.delete(e)}};CA.Subchannel=OL});var tte=y(IA=>{"use strict";var NL;Object.defineProperty(IA,"__esModule",{value:!0});IA.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;IA.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((NL=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&NL!==void 0?NL:"false")==="true"});var DL=y(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.DEFAULT_PORT=void 0;Wu.setup=fDe;var rte=fo(),kL=Z("dns"),oDe=P$(),ML=Xe(),Pp=$u(),sDe=Ar(),aDe=Nt(),cDe=Xe(),Bc=xn(),nte=Z("net"),lDe=cp(),ite=tte(),uDe="dns_resolver";function ys(t){aDe.trace(cDe.LogVerbosity.DEBUG,uDe,t)}Wu.DEFAULT_PORT=443;var dDe=3e4,$L=class{constructor(e,r,n){var i,o,s;this.target=e,this.listener=r,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new kL.promises.Resolver,ys("Resolver constructed for target "+(0,Bc.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let a=(0,Bc.splitHostPort)(e.path);a===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,nte.isIPv4)(a.host)||(0,nte.isIPv6)(a.host)?(this.ipResult=[{addresses:[{host:a.host,port:(i=a.port)!==null&&i!==void 0?i:Wu.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=a.host,this.port=(o=a.port)!==null&&o!==void 0?o:Wu.DEFAULT_PORT),this.percentage=Math.random()*100,n["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:ML.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,Bc.uriToString)(this.target)}`,metadata:new sDe.Metadata};let c={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoff=new lDe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(s=n["grpc.dns_min_time_between_resolutions_ms"])!==null&&s!==void 0?s:dDe,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(ys("Returning IP address for target "+(0,Bc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,Pp.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)ys("Failed to parse DNS address "+(0,Bc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,Pp.statusOrFromError)({code:ML.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,Bc.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;ys("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(r=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,Pp.statusOrFromValue)(r.map(o=>({addresses:[o]})));let n="["+r.map(o=>o.host+":"+o.port).join(",")+"]";ys("Resolved addresses for target "+(0,Bc.uriToString)(this.target)+": "+n);let i=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(i)},r=>{this.pendingLookupPromise!==null&&(ys("Resolution error for target "+(0,Bc.uriToString)(this.target)+": "+r.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,Pp.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,""))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(r=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let n;try{n=(0,oDe.extractAndSelectServiceConfig)(r,this.percentage),n?this.latestServiceConfigResult=(0,Pp.statusOrFromValue)(n):this.latestServiceConfigResult=null}catch(i){this.latestServiceConfigResult=(0,Pp.statusOrFromError)({code:ML.Status.UNAVAILABLE,details:`Parsing service config failed with error ${i.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},r=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(ite.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){ys("Using alternative DNS resolver.");let n=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(n.every(i=>i.status==="rejected"))throw new Error(n[0].reason);return n.reduce((i,o)=>o.status==="fulfilled"?[...i,...o.value]:i,[]).map(i=>({host:i,port:+this.port}))}return(await kL.promises.lookup(e,{all:!0})).map(n=>({host:n.address,port:+this.port}))}async resolveTxt(e){return ite.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(ys("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):kL.promises.resolveTxt(e)}startNextResolutionTimer(){var e,r;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(r=(e=this.nextResolutionTimer).unref)===null||r===void 0||r.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?ys('resolution update delayed by "min time between resolutions" rate limit'):ys("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function fDe(){(0,rte.registerResolver)("dns",$L),(0,rte.registerDefaultScheme)("dns")}});var LL=y(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});Wy.parseCIDR=ate;Wy.mapProxyName=bDe;Wy.getProxiedConnection=TDe;var Gy=Nt(),Op=Xe(),ste=Z("net"),pDe=Z("http"),hDe=Nt(),ote=Bn(),Hy=xn(),mDe=Z("url"),gDe=DL(),_De="proxy";function Np(t){hDe.trace(Op.LogVerbosity.DEBUG,_De,t)}function yDe(){let t="",e="";if(process.env.grpc_proxy)e="grpc_proxy",t=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",t=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",t=process.env.http_proxy;else return{};let r;try{r=new mDe.URL(t)}catch{return(0,Gy.log)(Op.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(r.protocol!=="http:")return(0,Gy.log)(Op.LogVerbosity.ERROR,`"${r.protocol}" scheme not supported in proxy URI`),{};let n=null;r.username&&(r.password?((0,Gy.log)(Op.LogVerbosity.INFO,"userinfo found in proxy URI"),n=decodeURIComponent(`${r.username}:${r.password}`)):n=r.username);let i=r.hostname,o=r.port;o===""&&(o="80");let s={address:`${i}:${o}`};return n&&(s.creds=n),Np("Proxy server "+s.address+" set by environment variable "+e),s}function SDe(){let t=process.env.no_grpc_proxy,e="no_grpc_proxy";return t||(t=process.env.no_proxy,e="no_proxy"),t?(Np("No proxy server list set by environment variable "+e),t.split(",")):[]}function ate(t){let e=t.split("/");if(e.length!==2)return null;let r=parseInt(e[1],10);return!(0,ste.isIPv4)(e[0])||Number.isNaN(r)||r<0||r>32?null:{ip:cte(e[0]),prefixLength:r}}function cte(t){return t.split(".").reduce((e,r)=>(e<<8)+parseInt(r,10),0)}function EDe(t,e){let r=t.ip,n=-1<<32-t.prefixLength;return(cte(e)&n)===(r&n)}function vDe(t){for(let e of SDe()){let r=ate(e);if((0,ste.isIPv4)(t)&&r&&EDe(r,t))return!0;if(t.endsWith(e))return!0}return!1}function bDe(t,e){var r;let n={target:t,extraOptions:{}};if(((r=e["grpc.enable_http_proxy"])!==null&&r!==void 0?r:1)===0||t.scheme==="unix")return n;let i=yDe();if(!i.address)return n;let o=(0,Hy.splitHostPort)(t.path);if(!o)return n;let s=o.host;if(vDe(s))return Np("Not using proxy for target in no_proxy list: "+(0,Hy.uriToString)(t)),n;let a={"grpc.http_connect_target":(0,Hy.uriToString)(t)};return i.creds&&(a["grpc.http_connect_creds"]=i.creds),{target:{scheme:"dns",path:i.address},extraOptions:a}}function TDe(t,e){var r;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let n=e["grpc.http_connect_target"],i=(0,Hy.parseUri)(n);if(i===null)return Promise.resolve(null);let o=(0,Hy.splitHostPort)(i.path);if(o===null)return Promise.resolve(null);let s=`${o.host}:${(r=o.port)!==null&&r!==void 0?r:gDe.DEFAULT_PORT}`,a={method:"CONNECT",path:s},c={Host:s};(0,ote.isTcpSubchannelAddress)(t)?(a.host=t.host,a.port=t.port):a.socketPath=t.path,"grpc.http_connect_creds"in e&&(c["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),a.headers=c;let l=(0,ote.subchannelAddressToString)(t);return Np("Using proxy "+l+" to connect to "+a.path),new Promise((u,d)=>{let f=pDe.request(a);f.once("connect",(p,h,m)=>{f.removeAllListeners(),h.removeAllListeners(),p.statusCode===200?(Np("Successfully connected to "+a.path+" through proxy "+l),m.length>0&&h.unshift(m),Np("Successfully established a plaintext connection to "+a.path+" through proxy "+l),u(h)):((0,Gy.log)(Op.LogVerbosity.ERROR,"Failed to connect to "+a.path+" through proxy "+l+" with status "+p.statusCode),d())}),f.once("error",p=>{f.removeAllListeners(),(0,Gy.log)(Op.LogVerbosity.ERROR,"Failed to connect to proxy "+l+" with error "+p.message),d()}),f.end()})}});var FL=y(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.StreamDecoder=void 0;var Ss;(function(t){t[t.NO_DATA=0]="NO_DATA",t[t.READING_SIZE=1]="READING_SIZE",t[t.READING_MESSAGE=2]="READING_MESSAGE"})(Ss||(Ss={}));var UL=class{constructor(e){this.maxReadMessageLength=e,this.readState=Ss.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let r=0,n,i=[];for(;r<e.length;)switch(this.readState){case Ss.NO_DATA:this.readCompressFlag=e.slice(r,r+1),r+=1,this.readState=Ss.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case Ss.READING_SIZE:if(n=Math.min(e.length-r,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,r,r+n),this.readSizeRemaining-=n,r+=n,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=Ss.READING_MESSAGE;else{let o=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=Ss.NO_DATA,i.push(o)}}break;case Ss.READING_MESSAGE:if(n=Math.min(e.length-r,this.readMessageRemaining),this.readPartialMessage.push(e.slice(r,r+n)),this.readMessageRemaining-=n,r+=n,this.readMessageRemaining===0){let o=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),s=Buffer.concat(o,this.readMessageSize+5);this.readState=Ss.NO_DATA,i.push(s)}break;default:throw new Error("Unexpected read state")}return i}};PA.StreamDecoder=UL});var lte=y(OA=>{"use strict";Object.defineProperty(OA,"__esModule",{value:!0});OA.Http2SubchannelCall=void 0;var ba=Z("http2"),wDe=Z("os"),xt=Xe(),Ta=Ar(),xDe=FL(),ADe=Nt(),RDe=Xe(),CDe="subchannel_call";function IDe(t){for(let[e,r]of Object.entries(wDe.constants.errno))if(r===t)return e;return"Unknown system error "+t}function zL(t){let e=`Received HTTP status code ${t}`,r;switch(t){case 400:r=xt.Status.INTERNAL;break;case 401:r=xt.Status.UNAUTHENTICATED;break;case 403:r=xt.Status.PERMISSION_DENIED;break;case 404:r=xt.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:r=xt.Status.UNAVAILABLE;break;default:r=xt.Status.UNKNOWN}return{code:r,details:e,metadata:new Ta.Metadata}}var jL=class{constructor(e,r,n,i,o){var s;this.http2Stream=e,this.callEventTracker=r,this.listener=n,this.transport=i,this.callId=o,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let a=(s=i.getOptions()["grpc.max_receive_message_length"])!==null&&s!==void 0?s:xt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new xDe.StreamDecoder(a),e.on("response",(c,l)=>{let u="";for(let d of Object.keys(c))u+=" "+d+": "+c[d]+`
|
|
16
|
+
`&&++i,++r===n)throw l("comment");A=k,k=d(r)}while(A!=="*"||k!=="/");++r,N&&(f(P,r-2,D),D=!0),b=!0}else return"/"}}while(b);var F=r;QD.lastIndex=0;var E=QD.test(d(F++));if(!E)for(;F<n&&!QD.test(d(F));)++F;var oe=t.substring(r,r=F);return(oe==='"'||oe==="'")&&(c=oe),oe}function g(b){a.push(b)}function _(){if(!a.length){var b=m();if(b===null)return null;g(b)}return a[0]}function v(b,A){var k=_(),P=k===b;if(P)return m(),!0;if(!A)throw l("token '"+k+"', '"+b+"' expected");return!1}function T(b){var A=null,k;return b===void 0?(k=s[i-1],delete s[i-1],k&&(e||k.type==="*"||k.lineEmpty)&&(A=k.leading?k.text:null)):(o<b&&_(),k=s[b],delete s[b],k&&!k.lineEmpty&&(e||k.type==="/")&&(A=k.leading?null:k.text)),A}return Object.defineProperty({next:m,peek:_,push:g,skip:v,cmnt:T},"line",{get:function(){return i}})}});var mee=y((lRt,hee)=>{"use strict";hee.exports=Sa;Sa.filename=null;Sa.defaults={keepCase:!1};var EMe=eL(),uee=nA(),dee=Qx(),fee=$c(),vMe=Wx(),pee=ju(),bMe=Eo(),TMe=Kx(),wMe=Yx(),xMe=Dc(),AMe=Bu(),ya=Cr(),RMe=/^[1-9][0-9]*$/,CMe=/^-?[1-9][0-9]*$/,IMe=/^0[x][0-9a-fA-F]+$/,PMe=/^-?0[x][0-9a-fA-F]+$/,OMe=/^0[0-7]+$/,NMe=/^-?0[0-7]+$/,kMe=ya.patterns.numberRe,fs=/^[a-zA-Z_][a-zA-Z_0-9]*$/,ps=ya.patterns.typeRefRe;function Sa(t,e,r){e instanceof uee||(r=e,e=new uee),r||(r=Sa.defaults);var n=r.preferTrailingComment||!1,i=EMe(t,r.alternateCommentMode||!1),o=i.next,s=i.push,a=i.peek,c=i.skip,l=i.cmnt,u=!0,d,f,p,h="proto2",m=e,g=[],_={},v=r.keepCase?function(x){return x}:ya.camelCase;function T(){g.forEach(x=>{x._edition=h,Object.keys(_).forEach(C=>{x.getOption(C)===void 0&&x.setOption(C,_[C],!0)})})}function b(x,C,j){var B=Sa.filename;return j||(Sa.filename=null),Error("illegal "+(C||"token")+" '"+x+"' ("+(B?B+", ":"")+"line "+i.line+")")}function A(){var x=[],C;do{if((C=o())!=='"'&&C!=="'")throw b(C);x.push(o()),c(C),C=a()}while(C==='"'||C==="'");return x.join("")}function k(x){var C=o();switch(C){case"'":case'"':return s(C),A();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return N(C,!0)}catch{if(x&&ps.test(C))return C;throw b(C,"value")}}function P(x,C){var j,B;do if(C&&((j=a())==='"'||j==="'")){var te=A();if(x.push(te),h>=2023)throw b(te,"id")}else try{x.push([B=D(o()),c("to",!0)?D(o()):B])}catch(Ee){if(C&&ps.test(j)&&h>=2023)x.push(j);else throw Ee}while(c(",",!0));var ie={options:void 0};ie.setOption=function(Ee,yt){this.options===void 0&&(this.options={}),this.options[Ee]=yt},w(ie,function(yt){if(yt==="option")Pe(ie,yt),c(";");else throw b(yt)},function(){me(ie)})}function N(x,C){var j=1;switch(x.charAt(0)==="-"&&(j=-1,x=x.substring(1)),x){case"inf":case"INF":case"Inf":return j*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(RMe.test(x))return j*parseInt(x,10);if(IMe.test(x))return j*parseInt(x,16);if(OMe.test(x))return j*parseInt(x,8);if(kMe.test(x))return j*parseFloat(x);throw b(x,"number",C)}function D(x,C){switch(x){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!C&&x.charAt(0)==="-")throw b(x,"id");if(CMe.test(x))return parseInt(x,10);if(PMe.test(x))return parseInt(x,16);if(NMe.test(x))return parseInt(x,8);throw b(x,"id")}function F(){if(d!==void 0)throw b("package");if(d=o(),!ps.test(d))throw b(d,"name");m=m.define(d),c(";")}function E(){var x=a(),C;switch(x){case"weak":C=p||(p=[]),o();break;case"public":o();default:C=f||(f=[]);break}x=A(),c(";"),C.push(x)}function oe(){if(c("="),h=A(),h<2023)throw b(h,"syntax");c(";")}function M(){if(c("="),h=A(),!["2023"].includes(h))throw b(h,"edition");c(";")}function S(x,C,j){switch(j===void 0&&(j=0),C){case"option":return Pe(x,C),c(";"),!0;case"message":return O(x,C,j+1),!0;case"enum":return Ie(x,C),!0;case"service":return nt(x,C,j+1),!0;case"extend":return qe(x,C,j),!0}return!1}function w(x,C,j){var B=i.line;if(x&&(typeof x.comment!="string"&&(x.comment=l()),x.filename=Sa.filename),c("{",!0)){for(var te;(te=o())!=="}";)C(te);c(";",!0)}else j&&j(),c(";"),x&&(typeof x.comment!="string"||n)&&(x.comment=l(B)||x.comment)}function O(x,C,j){if(j===void 0&&(j=0),j>ya.nestingLimit)throw Error("max depth exceeded");if(!fs.test(C=o()))throw b(C,"type name");var B=new dee(C);w(B,function(ie){if(!S(B,ie,j))switch(ie){case"map":he(B,ie);break;case"required":if(h!=="proto2")throw b(ie);case"repeated":Y(B,ie,void 0,j+1);break;case"optional":if(h==="proto3")Y(B,"proto3_optional",void 0,j+1);else{if(h!=="proto2")throw b(ie);Y(B,"optional",void 0,j+1)}break;case"oneof":je(B,ie,j+1);break;case"extensions":P(B.extensions||(B.extensions=[]));break;case"reserved":P(B.reserved||(B.reserved=[]),!0);break;default:if(h==="proto2"||!ps.test(ie))throw b(ie);s(ie),Y(B,"optional",void 0,j+1);break}}),x.add(B),x===m&&g.push(B)}function Y(x,C,j,B){var te=o();if(te==="group"){H(x,C,B);return}for(;te.endsWith(".")||a().startsWith(".");)te+=o();if(!ps.test(te))throw b(te,"type");var ie=o();if(!fs.test(ie))throw b(ie,"name");ie=v(ie),c("=");var Ee=new fee(ie,D(o()),te,C,j);if(w(Ee,function(St){if(St==="option")Pe(Ee,St),c(";");else throw b(St)},function(){me(Ee)}),C==="proto3_optional"){var yt=new pee("_"+ie);Ee.setOption("proto3_optional",!0),yt.add(Ee),x.add(yt)}else x.add(Ee);x===m&&g.push(Ee)}function H(x,C,j){if(j===void 0&&(j=0),j>ya.nestingLimit)throw Error("max depth exceeded");if(h>=2023)throw b("group");var B=o();if(!fs.test(B))throw b(B,"name");var te=ya.lcFirst(B);B===te&&(B=ya.ucFirst(B)),c("=");var ie=D(o()),Ee=new dee(B);Ee.group=!0;var yt=new fee(te,ie,B,C);yt.filename=Sa.filename,w(Ee,function(St){switch(St){case"option":Pe(Ee,St),c(";");break;case"required":case"repeated":Y(Ee,St,void 0,j+1);break;case"optional":h==="proto3"?Y(Ee,"proto3_optional",void 0,j+1):Y(Ee,"optional",void 0,j+1);break;case"message":O(Ee,St,j+1);break;case"enum":Ie(Ee,St);break;case"reserved":P(Ee.reserved||(Ee.reserved=[]),!0);break;default:throw b(St)}}),x.add(Ee).add(yt)}function he(x){c("<");var C=o();if(AMe.mapKey[C]===void 0)throw b(C,"type");c(",");var j=o();if(!ps.test(j))throw b(j,"type");c(">");var B=o();if(!fs.test(B))throw b(B,"name");c("=");var te=new vMe(v(B),D(o()),C,j);w(te,function(Ee){if(Ee==="option")Pe(te,Ee),c(";");else throw b(Ee)},function(){me(te)}),x.add(te)}function je(x,C,j){if(!fs.test(C=o()))throw b(C,"name");var B=new pee(v(C));w(B,function(ie){ie==="option"?(Pe(B,ie),c(";")):(s(ie),Y(B,"optional",void 0,j))}),x.add(B)}function Ie(x,C){if(!fs.test(C=o()))throw b(C,"name");var j=new bMe(C);w(j,function(te){switch(te){case"option":Pe(j,te),c(";");break;case"reserved":P(j.reserved||(j.reserved=[]),!0),j.reserved===void 0&&(j.reserved=[]);break;default:$e(j,te)}}),x.add(j),x===m&&g.push(j)}function $e(x,C){if(!fs.test(C))throw b(C,"name");c("=");var j=D(o(),!0),B={options:void 0};B.getOption=function(te){return this.options[te]},B.setOption=function(te,ie){xMe.prototype.setOption.call(B,te,ie)},B.setParsedOption=function(){},w(B,function(ie){if(ie==="option")Pe(B,ie),c(";");else throw b(ie)},function(){me(B)}),x.add(C,j,B.comment,B.parsedOptions||B.options)}function Pe(x,C){var j,B,te=!0;for(C==="option"&&(C=o());C!=="=";){if(C==="("){var ie=o();c(")"),C="("+ie+")"}if(te){if(te=!1,C.includes(".")&&!C.includes("(")){var Ee=C.split(".");j=Ee[0]+".",C=Ee[1];continue}j=C}else B=B?B+=C:C;C=o()}var yt=B?j.concat(B):j,lr=He(x,yt);B=B&&B[0]==="."?B.slice(1):B,j=j&&j[j.length-1]==="."?j.slice(0,-1):j,ce(x,j,lr,B)}function He(x,C,j){if(j===void 0&&(j=0),j>ya.recursionLimit)throw Error("max depth exceeded");if(c("{",!0)){for(var B={};!c("}",!0);){if(!fs.test(z=o()))throw b(z,"name");if(z===null)throw b(z,"end of input");var te,ie=z;if(c(":",!0),a()==="{")te=He(x,C+"."+z,j+1);else if(a()==="["){te=[];var Ee;if(c("[",!0)){do Ee=k(!0),te.push(Ee);while(c(",",!0));c("]"),typeof Ee<"u"&&Ne(x,C+"."+z,Ee)}}else te=k(!0),Ne(x,C+"."+z,te);var yt=B[ie];yt&&(te=[].concat(yt).concat(te)),ie!=="__proto__"&&(B[ie]=te),c(",",!0),c(";",!0)}return B}var lr=k(!0);return Ne(x,C,lr),lr}function Ne(x,C,j){if(m===x&&/^features\./.test(C)){_[C]=j;return}x.setOption&&x.setOption(C,j)}function ce(x,C,j,B){x.setParsedOption&&x.setParsedOption(C,j,B)}function me(x){if(c("[",!0)){do Pe(x,"option");while(c(",",!0));c("]")}return x}function nt(x,C,j){if(j===void 0&&(j=0),j>ya.recursionLimit)throw Error("max depth exceeded");if(!fs.test(C=o()))throw b(C,"service name");var B=new TMe(C);w(B,function(ie){if(!S(B,ie,j))if(ie==="rpc")re(B,ie);else throw b(ie)}),x.add(B),x===m&&g.push(B)}function re(x,C){var j=l(),B=C;if(!fs.test(C=o()))throw b(C,"name");var te=C,ie,Ee,yt,lr;if(c("("),c("stream",!0)&&(Ee=!0),!ps.test(C=o())||(ie=C,c(")"),c("returns"),c("("),c("stream",!0)&&(lr=!0),!ps.test(C=o())))throw b(C);yt=C,c(")");var St=new wMe(te,B,ie,yt,Ee,lr);St.comment=j,w(St,function(We){if(We==="option")Pe(St,We),c(";");else throw b(We)}),x.add(St)}function qe(x,C,j){if(!ps.test(C=o()))throw b(C,"reference");var B=C;w(null,function(ie){switch(ie){case"required":case"repeated":Y(x,ie,B,j+1);break;case"optional":h==="proto3"?Y(x,"proto3_optional",B,j+1):Y(x,"optional",B,j+1);break;default:if(h==="proto2"||!ps.test(ie))throw b(ie);s(ie),Y(x,"optional",B,j+1);break}})}for(var z;(z=o())!==null;)switch(z){case"package":if(!u)throw b(z);F();break;case"import":if(!u)throw b(z);E();break;case"syntax":if(!u)throw b(z);oe();break;case"edition":if(!u)throw b(z);M();break;case"option":Pe(m,z),c(";",!0);break;default:if(S(m,z,0)){u=!1;continue}throw b(z)}return T(),Sa.filename=null,{package:d,imports:f,weakImports:p,root:e}}});var yee=y((uRt,_ee)=>{"use strict";_ee.exports=To;var MMe=/\/|\./;function To(t,e){MMe.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),To[t]=e}To("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var gee;To("duration",{Duration:gee={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});To("timestamp",{Timestamp:gee});To("empty",{Empty:{fields:{}}});To("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});To("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});To("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});To.get=function(e){return To[e]||null}});var Eee=y((dRt,See)=>{"use strict";var Lc=See.exports=see();Lc.build="full";Lc.tokenize=eL();Lc.parse=mee();Lc.common=yee();Lc.Root._configure(Lc.Type,Lc.parse,Lc.common)});var aA=y((fRt,vee)=>{"use strict";vee.exports=Eee()});var tL=y((pRt,$Me)=>{$Me.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var Iee=y((Ze,Cee)=>{"use strict";var Rn=aA();Cee.exports=Ze=Rn.descriptor=Rn.Root.fromJSON(tL()).lookup(".google.protobuf");var bee=Rn.Namespace,Uy=Rn.Root,Ea=Rn.Enum,wo=Rn.Type,Uc=Rn.Field,DMe=Rn.MapField,cA=Rn.OneOf,Fy=Rn.Service,lA=Rn.Method,Tee=Rn.util.patterns,LMe=Tee.numberRe,uA=Tee.typeRefRe;Uy.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ze.FileDescriptorSet.decode(e));var r=new Uy;if(e.file)for(var n,i,o=0,s;o<e.file.length;++o){i=r,(n=e.file[o]).package&&n.package.length&&(i=r.define(n.package));var a=HMe(n);if(n.name&&n.name.length&&r.files.push(i.filename=n.name),n.messageType)for(s=0;s<n.messageType.length;++s)i.add(wo.fromDescriptor(n.messageType[s],a));if(n.enumType)for(s=0;s<n.enumType.length;++s)i.add(Ea.fromDescriptor(n.enumType[s],a));if(n.extension)for(s=0;s<n.extension.length;++s)i.add(Uc.fromDescriptor(n.extension[s],a));if(n.service)for(s=0;s<n.service.length;++s)i.add(Fy.fromDescriptor(n.service[s],a));var c=Tp(n.options,Ze.FileOptions);if(c){var l=Object.keys(c);for(s=0;s<l.length;++s)i.setOption(l[s],c[l[s]])}}return r.resolveAll()};Uy.prototype.toDescriptor=function(e){var r=Ze.FileDescriptorSet.create();return wee(this,r.file,e),r};function wee(t,e,r){var n=Ze.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});WMe(r,n),t instanceof Uy||(n.package=t.fullName.substring(1));for(var i=0,o;i<t.nestedArray.length;++i)(o=t._nestedArray[i])instanceof wo?n.messageType.push(o.toDescriptor(r)):o instanceof Ea?n.enumType.push(o.toDescriptor()):o instanceof Uc?n.extension.push(o.toDescriptor(r)):o instanceof Fy?n.service.push(o.toDescriptor()):o instanceof bee&&wee(o,e,r);n.options=wp(t.options,Ze.FileOptions),n.messageType.length+n.enumType.length+n.extension.length+n.service.length&&e.push(n)}var UMe=0;wo.fromDescriptor=function(e,r,n,i){if(i===void 0&&(i=0),i>Rn.util.nestingLimit)throw Error("max depth exceeded");typeof e.length=="number"&&(e=Ze.DescriptorProto.decode(e));var o=new wo(e.name.length?e.name:"Type"+UMe++,Tp(e.options,Ze.MessageOptions)),s;if(n||(o._edition=r),e.oneofDecl)for(s=0;s<e.oneofDecl.length;++s)o.add(cA.fromDescriptor(e.oneofDecl[s]));if(e.field)for(s=0;s<e.field.length;++s){var a=Uc.fromDescriptor(e.field[s],r,!0);o.add(a),e.field[s].hasOwnProperty("oneofIndex")&&o.oneofsArray[e.field[s].oneofIndex].add(a)}if(e.extension)for(s=0;s<e.extension.length;++s)o.add(Uc.fromDescriptor(e.extension[s],r,!0));if(e.nestedType)for(s=0;s<e.nestedType.length;++s)o.add(wo.fromDescriptor(e.nestedType[s],r,!0,i+1)),e.nestedType[s].options&&e.nestedType[s].options.mapEntry&&o.setOption("map_entry",!0);if(e.enumType)for(s=0;s<e.enumType.length;++s)o.add(Ea.fromDescriptor(e.enumType[s],r,!0));if(e.extensionRange&&e.extensionRange.length)for(o.extensions=[],s=0;s<e.extensionRange.length;++s)o.extensions.push([e.extensionRange[s].start,e.extensionRange[s].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(o.reserved=[],e.reservedRange)for(s=0;s<e.reservedRange.length;++s)o.reserved.push([e.reservedRange[s].start,e.reservedRange[s].end]);if(e.reservedName)for(s=0;s<e.reservedName.length;++s)o.reserved.push(e.reservedName[s])}return o};wo.prototype.toDescriptor=function(e){var r=Ze.DescriptorProto.create({name:this.name}),n;for(n=0;n<this.fieldsArray.length;++n){var i;if(r.field.push(i=this._fieldsArray[n].toDescriptor(e)),this._fieldsArray[n]instanceof DMe){var o=rL(this._fieldsArray[n].keyType,this._fieldsArray[n].resolvedKeyType,!1),s=rL(this._fieldsArray[n].type,this._fieldsArray[n].resolvedType,!1),a=s===11||s===14?this._fieldsArray[n].resolvedType&&Ree(this.parent,this._fieldsArray[n].resolvedType)||this._fieldsArray[n].type:void 0;r.nestedType.push(Ze.DescriptorProto.create({name:i.typeName,field:[Ze.FieldDescriptorProto.create({name:"key",number:1,label:1,type:o}),Ze.FieldDescriptorProto.create({name:"value",number:2,label:1,type:s,typeName:a})],options:Ze.MessageOptions.create({mapEntry:!0})}))}}for(n=0;n<this.oneofsArray.length;++n)r.oneofDecl.push(this._oneofsArray[n].toDescriptor());for(n=0;n<this.nestedArray.length;++n)this._nestedArray[n]instanceof Uc?r.field.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof wo?r.nestedType.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof Ea&&r.enumType.push(this._nestedArray[n].toDescriptor());if(this.extensions)for(n=0;n<this.extensions.length;++n)r.extensionRange.push(Ze.DescriptorProto.ExtensionRange.create({start:this.extensions[n][0],end:this.extensions[n][1]}));if(this.reserved)for(n=0;n<this.reserved.length;++n)typeof this.reserved[n]=="string"?r.reservedName.push(this.reserved[n]):r.reservedRange.push(Ze.DescriptorProto.ReservedRange.create({start:this.reserved[n][0],end:this.reserved[n][1]}));return r.options=wp(this.options,Ze.MessageOptions),r};Uc.fromDescriptor=function(e,r,n){if(typeof e.length=="number"&&(e=Ze.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var i=e.typeName,o;if(i!=null&&i!==""){if(typeof i!="string"||!uA.test(i))throw Error("illegal type name: "+i);o=i}else o=qMe(e.type);var s;switch(e.label){case 1:s=void 0;break;case 2:s="required";break;case 3:s="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;if(a!=null&&a!==""){if(typeof a!="string"||!uA.test(a))throw Error("illegal type name: "+a)}else a=void 0;var c=new Uc(e.name.length?e.name:"field"+e.number,e.number,o,s,a);if(n||(c._edition=r),c.options=Tp(e.options,Ze.FieldOptions),e.proto3_optional&&(c.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var u=LMe.exec(l);u&&(l=parseInt(l));break}c.setOption("default",l)}return VMe(e.type)&&(r==="proto3"?e.options&&!e.options.packed&&c.setOption("packed",!1):(!r||r==="proto2")&&e.options&&e.options.packed&&c.setOption("packed",!0)),c};Uc.prototype.toDescriptor=function(e){var r=Ze.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=Rn.util.ucFirst(this.name),r.label=3;else{switch(r.type=rL(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?Ree(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?r.label=3:this.required&&e==="proto2"?r.label=2:r.label=1}if(r.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&this.parent instanceof wo&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(r.options=wp(this.options,Ze.FieldOptions),this.options.default!=null&&(r.defaultValue=String(this.options.default)),this.options.proto3_optional&&(r.proto3_optional=!0)),e==="proto3"?this.packed||((r.options||(r.options=Ze.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((r.options||(r.options=Ze.FieldOptions.create())).packed=!0),r};var FMe=0;Ea.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ze.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var o=0;o<e.value.length;++o){var s=e.value[o].name,a=e.value[o].number||0;i[s&&s.length?s:"NAME"+a]=a}var c=new Ea(e.name&&e.name.length?e.name:"Enum"+FMe++,i,Tp(e.options,Ze.EnumOptions));return n||(c._edition=r),c};Ea.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(Ze.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return Ze.EnumDescriptorProto.create({name:this.name,value:e,options:wp(this.options,Ze.EnumOptions)})};var zMe=0;cA.fromDescriptor=function(e){return typeof e.length=="number"&&(e=Ze.OneofDescriptorProto.decode(e)),new cA(e.name&&e.name.length?e.name:"oneof"+zMe++)};cA.prototype.toDescriptor=function(){return Ze.OneofDescriptorProto.create({name:this.name})};var jMe=0;Fy.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ze.ServiceDescriptorProto.decode(e));var i=new Fy(e.name&&e.name.length?e.name:"Service"+jMe++,Tp(e.options,Ze.ServiceOptions));if(n||(i._edition=r),e.method)for(var o=0;o<e.method.length;++o)i.add(lA.fromDescriptor(e.method[o]));return i};Fy.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return Ze.ServiceDescriptorProto.create({name:this.name,method:e,options:wp(this.options,Ze.ServiceOptions)})};var BMe=0;lA.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ze.MethodDescriptorProto.decode(e));var r=e.inputType,n=e.outputType;if(r!=null&&r!==""&&(typeof r!="string"||!uA.test(r)))throw Error("illegal type name: "+r);if(n!=null&&n!==""&&(typeof n!="string"||!uA.test(n)))throw Error("illegal type name: "+n);return new lA(e.name&&e.name.length?e.name:"Method"+BMe++,"rpc",r,n,!!e.clientStreaming,!!e.serverStreaming,Tp(e.options,Ze.MethodOptions))};lA.prototype.toDescriptor=function(){return Ze.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:wp(this.options,Ze.MethodOptions)})};function qMe(t){switch(t){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+t)}function VMe(t){switch(t){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function rL(t,e,r){switch(t){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof Ea)return 14;if(e instanceof wo)return r?10:11;throw Error("illegal type: "+t)}function xee(t,e){for(var r={},n=0,i,o;n<e.fieldsArray.length;++n)if((o=(i=e._fieldsArray[n]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(t,o)){var s=GMe(o);i.resolvedType instanceof wo?r[s]=xee(t[o],i.resolvedType):i.resolvedType instanceof Ea?r[s]=i.resolvedType.valuesById[t[o]]:r[s]=t[o]}return r}function Tp(t,e){if(t)return xee(e.toObject(t),e)}function Aee(t,e){for(var r={},n=Object.keys(t),i=0;i<n.length;++i){var o=n[i],s=Rn.util.camelCase(o);if(Object.prototype.hasOwnProperty.call(e.fields,s)){var a=e.fields[s];a.resolvedType instanceof wo?r[s]=Aee(t[o],a.resolvedType):r[s]=t[o],a.repeated&&!Array.isArray(r[s])&&(r[s]=[r[s]])}}return r}function wp(t,e){if(t)return e.fromObject(Aee(t,e))}function Ree(t,e){var r=t.fullName.split("."),n=e.fullName.split("."),i=0,o=0,s=n.length-1;if(!(t instanceof Uy)&&e instanceof bee)for(;i<r.length&&o<s&&r[i]===n[o];){var a=e.lookup(r[i++],!0);if(a!==null&&a!==e)break;++o}else for(;i<r.length&&o<s&&r[i]===n[o];++i,++o);return n.slice(o).join(".")}function GMe(t){return t.substring(0,1)+t.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,r){return"_"+r.toLowerCase()})}function HMe(t){if(t.syntax==="editions"){if(t.edition===Ze.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+t.edition)}return t.syntax==="proto3"?"proto3":"proto2"}function WMe(t,e){if(t)if(t==="proto2"||t==="proto3")e.syntax=t;else if(e.syntax="editions",t==="2023")e.edition=Ze.Edition.EDITION_2023;else throw new Error("Unsupported edition "+t)}});var Pee=y((hRt,YMe)=>{YMe.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Oee=y((mRt,KMe)=>{KMe.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Nee=y((gRt,ZMe)=>{ZMe.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Dee=y(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.addCommonProtos=Fc.loadProtosWithOptionsSync=Fc.loadProtosWithOptions=void 0;var kee=Z("fs"),Mee=Z("path"),xp=aA();function $ee(t,e){let r=t.resolvePath;t.resolvePath=(n,i)=>{if(Mee.isAbsolute(i))return i;for(let o of e){let s=Mee.join(o,i);try{return kee.accessSync(s,kee.constants.R_OK),s}catch{continue}}return process.emitWarning(`${i} not found in any of the include paths ${e}`),r(n,i)}}async function JMe(t,e){let r=new xp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));$ee(r,e.includeDirs)}let n=await r.load(t,e);return n.resolveAll(),n}Fc.loadProtosWithOptions=JMe;function XMe(t,e){let r=new xp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");$ee(r,e.includeDirs)}let n=r.loadSync(t,e);return n.resolveAll(),n}Fc.loadProtosWithOptionsSync=XMe;function QMe(){let t=Pee(),e=tL(),r=Oee(),n=Nee();xp.common("api",t.nested.google.nested.protobuf.nested),xp.common("descriptor",e.nested.google.nested.protobuf.nested),xp.common("source_context",r.nested.google.nested.protobuf.nested),xp.common("type",n.nested.google.nested.protobuf.nested)}Fc.addCommonProtos=QMe});var cL=y(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.loadFileDescriptorSetFromObject=gr.loadFileDescriptorSetFromBuffer=gr.fromJSON=gr.loadSync=gr.load=gr.IdempotencyLevel=gr.isAnyExtension=gr.Long=void 0;var e$e=yQ(),hs=aA(),sL=Iee(),aL=Dee(),t$e=uD();gr.Long=t$e;function r$e(t){return"@type"in t&&typeof t["@type"]=="string"}gr.isAnyExtension=r$e;var Lee;(function(t){t.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",t.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",t.IDEMPOTENT="IDEMPOTENT"})(Lee=gr.IdempotencyLevel||(gr.IdempotencyLevel={}));var Uee={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function n$e(t,e){return t===""?e:t+"."+e}function i$e(t){return t instanceof hs.Service||t instanceof hs.Type||t instanceof hs.Enum}function o$e(t){return t instanceof hs.Namespace||t instanceof hs.Root}function Fee(t,e){let r=n$e(e,t.name);return i$e(t)?[[r,t]]:o$e(t)&&typeof t.nested<"u"?Object.keys(t.nested).map(n=>Fee(t.nested[n],r)).reduce((n,i)=>n.concat(i),[]):[]}function nL(t,e){return function(n){return t.toObject(t.decode(n),e)}}function iL(t){return function(r){if(Array.isArray(r))throw new Error(`Failed to serialize message: expected object with ${t.name} structure, got array instead`);let n=t.fromObject(r);return t.encode(n).finish()}}function s$e(t){return(t||[]).reduce((e,r)=>{for(let[n,i]of Object.entries(r))n==="uninterpreted_option"?e.uninterpreted_option.push(r.uninterpreted_option):e[n]=i;return e},{deprecated:!1,idempotency_level:Lee.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function a$e(t,e,r,n){let i=t.resolvedRequestType,o=t.resolvedResponseType;return{path:"/"+e+"/"+t.name,requestStream:!!t.requestStream,responseStream:!!t.responseStream,requestSerialize:iL(i),requestDeserialize:nL(i,r),responseSerialize:iL(o),responseDeserialize:nL(o,r),originalName:e$e(t.name),requestType:oL(i,r,n),responseType:oL(o,r,n),options:s$e(t.parsedOptions)}}function c$e(t,e,r,n){let i={};for(let o of t.methodsArray)i[o.name]=a$e(o,e,r,n);return i}function oL(t,e,r){let n=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:n.$type.toObject(n,Uee),fileDescriptorProtos:r,serialize:iL(t),deserialize:nL(t,e)}}function l$e(t,e){let r=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:r.$type.toObject(r,Uee),fileDescriptorProtos:e}}function u$e(t,e,r,n){if(t instanceof hs.Service)return c$e(t,e,r,n);if(t instanceof hs.Type)return oL(t,r,n);if(t instanceof hs.Enum)return l$e(t,n);throw new Error("Type mismatch in reflection object handling")}function dA(t,e){let r={};t.resolveAll();let i=t.toDescriptor("proto3").file.map(o=>Buffer.from(sL.FileDescriptorProto.encode(o).finish()));for(let[o,s]of Fee(t,""))r[o]=u$e(s,o,e,i);return r}function zee(t,e){e=e||{};let r=hs.Root.fromDescriptor(t);return r.resolveAll(),dA(r,e)}function d$e(t,e){return(0,aL.loadProtosWithOptions)(t,e).then(r=>dA(r,e))}gr.load=d$e;function f$e(t,e){let r=(0,aL.loadProtosWithOptionsSync)(t,e);return dA(r,e)}gr.loadSync=f$e;function p$e(t,e){e=e||{};let r=hs.Root.fromJSON(t);return r.resolveAll(),dA(r,e)}gr.fromJSON=p$e;function h$e(t,e){let r=sL.FileDescriptorSet.decode(t);return zee(r,e)}gr.loadFileDescriptorSetFromBuffer=h$e;function m$e(t,e){let r=sL.FileDescriptorSet.fromObject(t);return zee(r,e)}gr.loadFileDescriptorSetFromObject=m$e;(0,aL.addCommonProtos)()});var zc=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.registerChannelzSocket=Ut.registerChannelzServer=Ut.registerChannelzSubchannel=Ut.registerChannelzChannel=Ut.ChannelzCallTrackerStub=Ut.ChannelzCallTracker=Ut.ChannelzChildrenTrackerStub=Ut.ChannelzChildrenTracker=Ut.ChannelzTrace=Ut.ChannelzTraceStub=void 0;Ut.unregisterChannelzRef=E$e;Ut.getChannelzHandlers=Yee;Ut.getChannelzServiceDefinition=Kee;Ut.setup=O$e;var pA=Z("net"),Vu=(jX(),bn(zX)),zy=An(),jy=Xe(),g$e=Bn(),_$e=Ox(),y$e=Dx();function lL(t){return{channel_id:t.id,name:t.name}}function hL(t){return{subchannel_id:t.id,name:t.name}}function S$e(t){return{server_id:t.id}}function gA(t){return{socket_id:t.id,name:t.name}}var jee=32,mL=100,uL=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:ms(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ut.ChannelzTraceStub=uL;var dL=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,r,n){let i=new Date;this.events.push({description:r,severity:e,timestamp:i,childChannel:n?.kind==="channel"?n:void 0,childSubchannel:n?.kind==="subchannel"?n:void 0}),this.events.length>=jee*2&&(this.events=this.events.slice(jee)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:ms(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:ms(e.timestamp),channel_ref:e.childChannel?lL(e.childChannel):null,subchannel_ref:e.childSubchannel?hL(e.childSubchannel):null}))}}};Ut.ChannelzTrace=dL;var hA=class{constructor(){this.channelChildren=new Vu.OrderedMap,this.subchannelChildren=new Vu.OrderedMap,this.socketChildren=new Vu.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let r=this.trackerMap[e.kind],n=r.find(e.id);n.equals(r.end())?r.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let r=this.trackerMap[e.kind],n=r.getElementByKey(e.id);n!==void 0&&(n.count-=1,n.count===0&&r.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ut.ChannelzChildrenTracker=hA;var fL=class extends hA{refChild(){}unrefChild(){}};Ut.ChannelzChildrenTrackerStub=fL;var mA=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ut.ChannelzCallTracker=mA;var pL=class extends mA{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ut.ChannelzCallTrackerStub=pL;var va={channel:new Vu.OrderedMap,subchannel:new Vu.OrderedMap,server:new Vu.OrderedMap,socket:new Vu.OrderedMap},_A=t=>{let e=1;function r(){return e++}let n=va[t];return(i,o,s)=>{let a=r(),c={id:a,name:i,kind:t};return s&&n.setElement(a,{ref:c,getInfo:o}),c}};Ut.registerChannelzChannel=_A("channel");Ut.registerChannelzSubchannel=_A("subchannel");Ut.registerChannelzServer=_A("server");Ut.registerChannelzSocket=_A("socket");function E$e(t){va[t.kind].eraseElementByKey(t.id)}function v$e(t){let e=Number.parseInt(t,16);return[e/256|0,e%256]}function Bee(t){if(t==="")return[];let e=t.split(":").map(n=>v$e(n));return[].concat(...e)}function b$e(t){return(0,pA.isIPv6)(t)&&t.toLowerCase().startsWith("::ffff:")&&(0,pA.isIPv4)(t.substring(7))}function qee(t){return Buffer.from(Uint8Array.from(t.split(".").map(e=>Number.parseInt(e))))}function T$e(t){if((0,pA.isIPv4)(t))return qee(t);if(b$e(t))return qee(t.substring(7));if((0,pA.isIPv6)(t)){let e,r,n=t.indexOf("::");n===-1?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+2));let i=Buffer.from(Bee(e)),o=Buffer.from(Bee(r)),s=Buffer.alloc(16-i.length-o.length,0);return Buffer.concat([i,s,o])}else return null}function Gee(t){switch(t){case zy.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case zy.ConnectivityState.IDLE:return{state:"IDLE"};case zy.ConnectivityState.READY:return{state:"READY"};case zy.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case zy.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function ms(t){if(!t)return null;let e=t.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function Hee(t){let e=t.getInfo(),r=[],n=[];return e.children.channels.forEach(i=>{r.push(lL(i[1].ref))}),e.children.subchannels.forEach(i=>{n.push(hL(i[1].ref))}),{ref:lL(t.ref),data:{target:e.target,state:Gee(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:ms(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:r,subchannel_ref:n}}function w$e(t,e){let r=parseInt(t.request.channel_id,10),n=va.channel.getElementByKey(r);if(n===void 0){e({code:jy.Status.NOT_FOUND,details:"No channel data found for id "+r});return}e(null,{channel:Hee(n)})}function x$e(t,e){let r=parseInt(t.request.max_results,10)||mL,n=[],i=parseInt(t.request.start_channel_id,10),o=va.channel,s;for(s=o.lowerBound(i);!s.equals(o.end())&&n.length<r;s=s.next())n.push(Hee(s.pointer[1]));e(null,{channel:n,end:s.equals(o.end())})}function Wee(t){let e=t.getInfo(),r=[];return e.listenerChildren.sockets.forEach(n=>{r.push(gA(n[1].ref))}),{ref:S$e(t.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:ms(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:r}}function A$e(t,e){let r=parseInt(t.request.server_id,10),i=va.server.getElementByKey(r);if(i===void 0){e({code:jy.Status.NOT_FOUND,details:"No server data found for id "+r});return}e(null,{server:Wee(i)})}function R$e(t,e){let r=parseInt(t.request.max_results,10)||mL,n=parseInt(t.request.start_server_id,10),i=va.server,o=[],s;for(s=i.lowerBound(n);!s.equals(i.end())&&o.length<r;s=s.next())o.push(Wee(s.pointer[1]));e(null,{server:o,end:s.equals(i.end())})}function C$e(t,e){let r=parseInt(t.request.subchannel_id,10),n=va.subchannel.getElementByKey(r);if(n===void 0){e({code:jy.Status.NOT_FOUND,details:"No subchannel data found for id "+r});return}let i=n.getInfo(),o=[];i.children.sockets.forEach(a=>{o.push(gA(a[1].ref))});let s={ref:hL(n.ref),data:{target:i.target,state:Gee(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:ms(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:o};e(null,{subchannel:s})}function Vee(t){var e;return(0,g$e.isTcpSubchannelAddress)(t)?{address:"tcpip_address",tcpip_address:{ip_address:(e=T$e(t.host))!==null&&e!==void 0?e:void 0,port:t.port}}:{address:"uds_address",uds_address:{filename:t.path}}}function I$e(t,e){var r,n,i,o,s;let a=parseInt(t.request.socket_id,10),c=va.socket.getElementByKey(a);if(c===void 0){e({code:jy.Status.NOT_FOUND,details:"No socket data found for id "+a});return}let l=c.getInfo(),u=l.security?{model:"tls",tls:{cipher_suite:l.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(r=l.security.cipherSuiteStandardName)!==null&&r!==void 0?r:void 0,other_name:(n=l.security.cipherSuiteOtherName)!==null&&n!==void 0?n:void 0,local_certificate:(i=l.security.localCertificate)!==null&&i!==void 0?i:void 0,remote_certificate:(o=l.security.remoteCertificate)!==null&&o!==void 0?o:void 0}}:null,d={ref:gA(c.ref),local:l.localAddress?Vee(l.localAddress):null,remote:l.remoteAddress?Vee(l.remoteAddress):null,remote_name:(s=l.remoteName)!==null&&s!==void 0?s:void 0,security:u,data:{keep_alives_sent:l.keepAlivesSent,streams_started:l.streamsStarted,streams_succeeded:l.streamsSucceeded,streams_failed:l.streamsFailed,last_local_stream_created_timestamp:ms(l.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:ms(l.lastRemoteStreamCreatedTimestamp),messages_received:l.messagesReceived,messages_sent:l.messagesSent,last_message_received_timestamp:ms(l.lastMessageReceivedTimestamp),last_message_sent_timestamp:ms(l.lastMessageSentTimestamp),local_flow_control_window:l.localFlowControlWindow?{value:l.localFlowControlWindow}:null,remote_flow_control_window:l.remoteFlowControlWindow?{value:l.remoteFlowControlWindow}:null}};e(null,{socket:d})}function P$e(t,e){let r=parseInt(t.request.server_id,10),n=va.server.getElementByKey(r);if(n===void 0){e({code:jy.Status.NOT_FOUND,details:"No server data found for id "+r});return}let i=parseInt(t.request.start_socket_id,10),o=parseInt(t.request.max_results,10)||mL,a=n.getInfo().sessionChildren.sockets,c=[],l;for(l=a.lowerBound(i);!l.equals(a.end())&&c.length<o;l=l.next())c.push(gA(l.pointer[1].ref));e(null,{socket_ref:c,end:l.equals(a.end())})}function Yee(){return{GetChannel:w$e,GetTopChannels:x$e,GetServer:A$e,GetServers:R$e,GetSubchannel:C$e,GetSocket:I$e,GetServerSockets:P$e}}var fA=null;function Kee(){if(fA)return fA;let t=cL().loadSync,e=t("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return fA=(0,y$e.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,fA}function O$e(){(0,_$e.registerAdminService)(Kee,Yee)}});var yA=y(gL=>{"use strict";Object.defineProperty(gL,"__esModule",{value:!0});gL.getNextCallNumber=k$e;var N$e=0;function k$e(){return N$e++}});var _L=y(SA=>{"use strict";Object.defineProperty(SA,"__esModule",{value:!0});SA.CompressionAlgorithms=void 0;var Zee;(function(t){t[t.identity=0]="identity",t[t.deflate=1]="deflate",t[t.gzip=2]="gzip"})(Zee||(SA.CompressionAlgorithms=Zee={}))});var SL=y(EA=>{"use strict";Object.defineProperty(EA,"__esModule",{value:!0});EA.BaseFilter=void 0;var yL=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};EA.BaseFilter=yL});var wL=y(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.CompressionFilterFactory=Rp.CompressionFilter=void 0;var vA=Z("zlib"),Xee=_L(),jc=Xe(),M$e=SL(),$$e=Nt(),D$e=t=>typeof t=="number"&&typeof Xee.CompressionAlgorithms[t]=="string",Ap=class{async writeMessage(e,r){let n=e;r&&(n=await this.compressMessage(n));let i=Buffer.allocUnsafe(n.length+5);return i.writeUInt8(r?1:0,0),i.writeUInt32BE(n.length,1),n.copy(i,5),i}async readMessage(e){let r=e.readUInt8(0)===1,n=e.slice(5);return r&&(n=await this.decompressMessage(n)),n}},Gu=class extends Ap{async compressMessage(e){return e}async writeMessage(e,r){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},EL=class extends Ap{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{vA.deflate(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=vA.createInflate();s.on("error",a=>{n({code:jc.Status.INTERNAL,details:"Failed to decompress deflate-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:jc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},vL=class extends Ap{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{vA.gzip(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=vA.createGunzip();s.on("error",a=>{n({code:jc.Status.INTERNAL,details:"Failed to decompress gzip-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:jc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},bL=class extends Ap{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Jee(t,e){switch(t){case"identity":return new Gu;case"deflate":return new EL(e);case"gzip":return new vL(e);default:return new bL(t)}}var bA=class extends M$e.BaseFilter{constructor(e,r){var n,i,o;super(),this.sharedFilterConfig=r,this.sendCompression=new Gu,this.receiveCompression=new Gu,this.currentCompressionAlgorithm="identity";let s=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(n=e["grpc.max_receive_message_length"])!==null&&n!==void 0?n:jc.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(i=e["grpc.max_send_message_length"])!==null&&i!==void 0?i:jc.DEFAULT_MAX_SEND_MESSAGE_LENGTH,s!==void 0)if(D$e(s)){let a=Xee.CompressionAlgorithms[s],c=(o=r.serverSupportedEncodingHeader)===null||o===void 0?void 0:o.split(",");(!c||c.includes(a))&&(this.currentCompressionAlgorithm=a,this.sendCompression=Jee(this.currentCompressionAlgorithm,-1))}else $$e.log(jc.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${s}`)}async sendMetadata(e){let r=await e;return r.set("grpc-accept-encoding","identity,deflate,gzip"),r.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?r.remove("grpc-encoding"):r.set("grpc-encoding",this.currentCompressionAlgorithm),r}receiveMetadata(e){let r=e.get("grpc-encoding");if(r.length>0){let i=r[0];typeof i=="string"&&(this.receiveCompression=Jee(i,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let n=e.get("grpc-accept-encoding")[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new Gu,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var r;let n=await e;if(this.maxSendMessageLength!==-1&&n.message.length>this.maxSendMessageLength)throw{code:jc.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return this.sendCompression instanceof Gu?i=!1:i=(((r=n.flags)!==null&&r!==void 0?r:0)&2)===0,{message:await this.sendCompression.writeMessage(n.message,i),flags:n.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};Rp.CompressionFilter=bA;var TL=class{constructor(e,r){this.options=r,this.sharedFilterConfig={}}createFilter(){return new bA(this.options,this.sharedFilterConfig)}};Rp.CompressionFilterFactory=TL});var By=y(xL=>{"use strict";Object.defineProperty(xL,"__esModule",{value:!0});xL.restrictControlPlaneStatusCode=U$e;var gs=Xe(),L$e=[gs.Status.OK,gs.Status.INVALID_ARGUMENT,gs.Status.NOT_FOUND,gs.Status.ALREADY_EXISTS,gs.Status.FAILED_PRECONDITION,gs.Status.ABORTED,gs.Status.OUT_OF_RANGE,gs.Status.DATA_LOSS];function U$e(t,e){return L$e.includes(t)?{code:gs.Status.INTERNAL,details:`Invalid status from control plane: ${t} ${gs.Status[t]} ${e}`}:{code:t,details:e}}});var Cp=y(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.minDeadline=F$e;Hu.getDeadlineTimeoutString=j$e;Hu.getRelativeTimeout=q$e;Hu.deadlineToString=V$e;Hu.formatDateDifference=G$e;function F$e(...t){let e=1/0;for(let r of t){let n=r instanceof Date?r.getTime():r;n<e&&(e=n)}return e}var z$e=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function j$e(t){let e=new Date().getTime();t instanceof Date&&(t=t.getTime());let r=Math.max(t-e,0);for(let[n,i]of z$e){let o=r/i;if(o<1e8)return String(Math.ceil(o))+n}throw new Error("Deadline is too far in the future")}var B$e=2147483647;function q$e(t){let e=t instanceof Date?t.getTime():t,r=new Date().getTime(),n=e-r;return n<0?0:n>B$e?1/0:n}function V$e(t){if(t instanceof Date)return t.toISOString();{let e=new Date(t);return Number.isNaN(e.getTime())?""+t:e.toISOString()}}function G$e(t,e){return((e.getTime()-t.getTime())/1e3).toFixed(3)+"s"}});var wA=y(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.FilterStackFactory=Ip.FilterStack=void 0;var TA=class{constructor(e){this.filters=e}sendMetadata(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMetadata(r);return r}receiveMetadata(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMetadata(r);return r}sendMessage(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMessage(r);return r}receiveMessage(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMessage(r);return r}receiveTrailers(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveTrailers(r);return r}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ip.FilterStack=TA;var AL=class t{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new t([...this.factories])}createFilter(){return new TA(this.factories.map(e=>e.createFilter()))}};Ip.FilterStackFactory=AL});var Qee=y(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.SingleSubchannelChannel=void 0;var H$e=yA(),qy=zc(),W$e=wL(),Y$e=An(),Vy=Xe(),K$e=By(),Z$e=Cp(),J$e=wA(),RL=Ar(),X$e=fo(),xA=xn(),CL=class{constructor(e,r,n,i,o){var s,a;this.subchannel=e,this.method=r,this.options=i,this.callNumber=o,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let c=this.method.split("/"),l="";c.length>=2&&(l=c[1]);let u=(a=(s=(0,xA.splitHostPort)(this.options.host))===null||s===void 0?void 0:s.host)!==null&&a!==void 0?a:"localhost";this.serviceUrl=`https://${u}/${l}`;let d=(0,Z$e.getRelativeTimeout)(i.deadline);d!==1/0&&(d<=0?this.cancelWithStatus(Vy.Status.DEADLINE_EXCEEDED,"Deadline exceeded"):setTimeout(()=>{this.cancelWithStatus(Vy.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},d)),this.filterStack=n.createFilter()}cancelWithStatus(e,r){this.childCall?this.childCall.cancelWithStatus(e,r):this.pendingStatus={code:e,details:r,metadata:new RL.Metadata}}getPeer(){var e,r;return(r=(e=this.childCall)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.subchannel.getAddress()}async start(e,r){if(this.pendingStatus){r.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==Y$e.ConnectivityState.READY){r.onReceiveStatus({code:Vy.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new RL.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),i;try{i=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(s){let a=s,{code:c,details:l}=(0,K$e.restrictControlPlaneStatusCode)(typeof a.code=="number"?a.code:Vy.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${a.message}`);r.onReceiveStatus({code:c,details:l,metadata:new RL.Metadata});return}i.merge(n);let o={onReceiveMetadata:async s=>{r.onReceiveMetadata(await this.filterStack.receiveMetadata(s))},onReceiveMessage:async s=>{this.readFilterPending=!0;let a=await this.filterStack.receiveMessage(s);this.readFilterPending=!1,r.onReceiveMessage(a),this.pendingStatus&&r.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async s=>{let a=await this.filterStack.receiveTrailers(s);this.readFilterPending?this.pendingStatus=a:r.onReceiveStatus(a)}};this.childCall=this.subchannel.createCall(i,this.options.host,this.method,o),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,r){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw new Error("Method not implemented.")}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}},IL=class{constructor(e,r,n){this.subchannel=e,this.target=r,this.channelzEnabled=!1,this.channelzTrace=new qy.ChannelzTrace,this.callTracker=new qy.ChannelzCallTracker,this.childrenTracker=new qy.ChannelzChildrenTracker,this.channelzEnabled=n["grpc.enable_channelz"]!==0,this.channelzRef=(0,qy.registerChannelzChannel)((0,xA.uriToString)(r),()=>({target:`${(0,xA.uriToString)(r)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new J$e.FilterStackFactory([new W$e.CompressionFilterFactory(this,n)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,qy.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,xA.uriToString)(this.target)}getConnectivityState(e){throw new Error("Method not implemented.")}watchConnectivityState(e,r,n){throw new Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(e,r){let n={deadline:r,host:(0,X$e.getDefaultAuthority)(this.target),flags:Vy.Propagate.DEFAULTS,parentCall:null};return new CL(this.subchannel,e,this.filterStackFactory,n,(0,H$e.getNextCallNumber)())}};AA.SingleSubchannelChannel=IL});var ete=y(CA=>{"use strict";Object.defineProperty(CA,"__esModule",{value:!0});CA.Subchannel=void 0;var wt=An(),Q$e=cp(),PL=Nt(),RA=Xe(),eDe=xn(),tDe=Bn(),_s=zc(),rDe=Qee(),nDe="subchannel",iDe=~(1<<31),OL=class{constructor(e,r,n,i,o){var s;this.channelTarget=e,this.subchannelAddress=r,this.options=n,this.connector=o,this.connectivityState=wt.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let a={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Q$e.BackoffTimeout(()=>{this.handleBackoffTimer()},a),this.backoffTimeout.unref(),this.subchannelAddressString=(0,tDe.subchannelAddressToString)(r),this.keepaliveTime=(s=n["grpc.keepalive_time_ms"])!==null&&s!==void 0?s:-1,n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new _s.ChannelzTraceStub,this.callTracker=new _s.ChannelzCallTrackerStub,this.childrenTracker=new _s.ChannelzChildrenTrackerStub,this.streamTracker=new _s.ChannelzCallTrackerStub):(this.channelzTrace=new _s.ChannelzTrace,this.callTracker=new _s.ChannelzCallTracker,this.childrenTracker=new _s.ChannelzChildrenTracker,this.streamTracker=new _s.ChannelzCallTracker),this.channelzRef=(0,_s.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(n,void 0,2)),this.secureConnector=i._createSecureConnector(e,n)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){PL.trace(RA.LogVerbosity.DEBUG,nDe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){PL.trace(RA.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING):this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let r=Math.min(this.keepaliveTime,iDe);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":r})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.READY)?(this.transport=r,this.channelzEnabled&&this.childrenTracker.refChild(r.getChannelzRef()),r.addDisconnectListener(n=>{this.transitionToState([wt.ConnectivityState.READY],wt.ConnectivityState.IDLE),n&&this.keepaliveTime>0&&(this.keepaliveTime*=2,PL.log(RA.LogVerbosity.ERROR,`Connection to ${(0,eDe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):r.shutdown()},r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.TRANSIENT_FAILURE,`${r}`)})}transitionToState(e,r,n){var i,o;if(e.indexOf(this.connectivityState)===-1)return!1;n?this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]+' with error "'+n+'"'):this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+wt.ConnectivityState[r]);let s=this.connectivityState;switch(this.connectivityState=r,r){case wt.ConnectivityState.READY:this.stopBackoff();break;case wt.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case wt.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)===null||i===void 0||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case wt.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(o=this.transport)===null||o===void 0||o.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${r}`)}for(let a of this.stateListeners)a(this,s,r,this.keepaliveTime,n);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,_s.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.CONNECTING,wt.ConnectivityState.READY],wt.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,r,n,i){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let o;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),o={onCallEnd:s=>{s.code===RA.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):o={},this.transport.createCall(e,r,n,i,o)}startConnecting(){process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.IDLE],wt.ConnectivityState.CONNECTING)||this.connectivityState===wt.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||(this.subchannelChannel=new rDe.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw new Error("Not implemented")}getOrCreateDataProducer(e,r){let n=this.dataProducers.get(e);if(n)return n;let i=r(this);return this.dataProducers.set(e,i),i}removeDataProducer(e){this.dataProducers.delete(e)}};CA.Subchannel=OL});var tte=y(IA=>{"use strict";var NL;Object.defineProperty(IA,"__esModule",{value:!0});IA.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;IA.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((NL=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&NL!==void 0?NL:"false")==="true"});var DL=y(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.DEFAULT_PORT=void 0;Wu.setup=fDe;var rte=fo(),kL=Z("dns"),oDe=P$(),ML=Xe(),Pp=$u(),sDe=Ar(),aDe=Nt(),cDe=Xe(),Bc=xn(),nte=Z("net"),lDe=cp(),ite=tte(),uDe="dns_resolver";function ys(t){aDe.trace(cDe.LogVerbosity.DEBUG,uDe,t)}Wu.DEFAULT_PORT=443;var dDe=3e4,$L=class{constructor(e,r,n){var i,o,s;this.target=e,this.listener=r,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new kL.promises.Resolver,ys("Resolver constructed for target "+(0,Bc.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let a=(0,Bc.splitHostPort)(e.path);a===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,nte.isIPv4)(a.host)||(0,nte.isIPv6)(a.host)?(this.ipResult=[{addresses:[{host:a.host,port:(i=a.port)!==null&&i!==void 0?i:Wu.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=a.host,this.port=(o=a.port)!==null&&o!==void 0?o:Wu.DEFAULT_PORT),this.percentage=Math.random()*100,n["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:ML.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,Bc.uriToString)(this.target)}`,metadata:new sDe.Metadata};let c={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoff=new lDe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(s=n["grpc.dns_min_time_between_resolutions_ms"])!==null&&s!==void 0?s:dDe,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(ys("Returning IP address for target "+(0,Bc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,Pp.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)ys("Failed to parse DNS address "+(0,Bc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,Pp.statusOrFromError)({code:ML.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,Bc.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;ys("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(r=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,Pp.statusOrFromValue)(r.map(o=>({addresses:[o]})));let n="["+r.map(o=>o.host+":"+o.port).join(",")+"]";ys("Resolved addresses for target "+(0,Bc.uriToString)(this.target)+": "+n);let i=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(i)},r=>{this.pendingLookupPromise!==null&&(ys("Resolution error for target "+(0,Bc.uriToString)(this.target)+": "+r.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,Pp.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,""))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(r=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let n;try{n=(0,oDe.extractAndSelectServiceConfig)(r,this.percentage),n?this.latestServiceConfigResult=(0,Pp.statusOrFromValue)(n):this.latestServiceConfigResult=null}catch(i){this.latestServiceConfigResult=(0,Pp.statusOrFromError)({code:ML.Status.UNAVAILABLE,details:`Parsing service config failed with error ${i.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},r=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(ite.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){ys("Using alternative DNS resolver.");let n=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(n.every(i=>i.status==="rejected"))throw new Error(n[0].reason);return n.reduce((i,o)=>o.status==="fulfilled"?[...i,...o.value]:i,[]).map(i=>({host:i,port:+this.port}))}return(await kL.promises.lookup(e,{all:!0})).map(n=>({host:n.address,port:+this.port}))}async resolveTxt(e){return ite.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(ys("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):kL.promises.resolveTxt(e)}startNextResolutionTimer(){var e,r;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(r=(e=this.nextResolutionTimer).unref)===null||r===void 0||r.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?ys('resolution update delayed by "min time between resolutions" rate limit'):ys("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function fDe(){(0,rte.registerResolver)("dns",$L),(0,rte.registerDefaultScheme)("dns")}});var LL=y(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});Wy.parseCIDR=ate;Wy.mapProxyName=bDe;Wy.getProxiedConnection=TDe;var Gy=Nt(),Op=Xe(),ste=Z("net"),pDe=Z("http"),hDe=Nt(),ote=Bn(),Hy=xn(),mDe=Z("url"),gDe=DL(),_De="proxy";function Np(t){hDe.trace(Op.LogVerbosity.DEBUG,_De,t)}function yDe(){let t="",e="";if(process.env.grpc_proxy)e="grpc_proxy",t=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",t=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",t=process.env.http_proxy;else return{};let r;try{r=new mDe.URL(t)}catch{return(0,Gy.log)(Op.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(r.protocol!=="http:")return(0,Gy.log)(Op.LogVerbosity.ERROR,`"${r.protocol}" scheme not supported in proxy URI`),{};let n=null;r.username&&(r.password?((0,Gy.log)(Op.LogVerbosity.INFO,"userinfo found in proxy URI"),n=decodeURIComponent(`${r.username}:${r.password}`)):n=r.username);let i=r.hostname,o=r.port;o===""&&(o="80");let s={address:`${i}:${o}`};return n&&(s.creds=n),Np("Proxy server "+s.address+" set by environment variable "+e),s}function SDe(){let t=process.env.no_grpc_proxy,e="no_grpc_proxy";return t||(t=process.env.no_proxy,e="no_proxy"),t?(Np("No proxy server list set by environment variable "+e),t.split(",")):[]}function ate(t){let e=t.split("/");if(e.length!==2)return null;let r=parseInt(e[1],10);return!(0,ste.isIPv4)(e[0])||Number.isNaN(r)||r<0||r>32?null:{ip:cte(e[0]),prefixLength:r}}function cte(t){return t.split(".").reduce((e,r)=>(e<<8)+parseInt(r,10),0)}function EDe(t,e){let r=t.ip,n=-1<<32-t.prefixLength;return(cte(e)&n)===(r&n)}function vDe(t){for(let e of SDe()){let r=ate(e);if((0,ste.isIPv4)(t)&&r&&EDe(r,t))return!0;if(t.endsWith(e))return!0}return!1}function bDe(t,e){var r;let n={target:t,extraOptions:{}};if(((r=e["grpc.enable_http_proxy"])!==null&&r!==void 0?r:1)===0||t.scheme==="unix")return n;let i=yDe();if(!i.address)return n;let o=(0,Hy.splitHostPort)(t.path);if(!o)return n;let s=o.host;if(vDe(s))return Np("Not using proxy for target in no_proxy list: "+(0,Hy.uriToString)(t)),n;let a={"grpc.http_connect_target":(0,Hy.uriToString)(t)};return i.creds&&(a["grpc.http_connect_creds"]=i.creds),{target:{scheme:"dns",path:i.address},extraOptions:a}}function TDe(t,e){var r;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let n=e["grpc.http_connect_target"],i=(0,Hy.parseUri)(n);if(i===null)return Promise.resolve(null);let o=(0,Hy.splitHostPort)(i.path);if(o===null)return Promise.resolve(null);let s=`${o.host}:${(r=o.port)!==null&&r!==void 0?r:gDe.DEFAULT_PORT}`,a={method:"CONNECT",path:s},c={Host:s};(0,ote.isTcpSubchannelAddress)(t)?(a.host=t.host,a.port=t.port):a.socketPath=t.path,"grpc.http_connect_creds"in e&&(c["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),a.headers=c;let l=(0,ote.subchannelAddressToString)(t);return Np("Using proxy "+l+" to connect to "+a.path),new Promise((u,d)=>{let f=pDe.request(a);f.once("connect",(p,h,m)=>{f.removeAllListeners(),h.removeAllListeners(),p.statusCode===200?(Np("Successfully connected to "+a.path+" through proxy "+l),m.length>0&&h.unshift(m),Np("Successfully established a plaintext connection to "+a.path+" through proxy "+l),u(h)):((0,Gy.log)(Op.LogVerbosity.ERROR,"Failed to connect to "+a.path+" through proxy "+l+" with status "+p.statusCode),d())}),f.once("error",p=>{f.removeAllListeners(),(0,Gy.log)(Op.LogVerbosity.ERROR,"Failed to connect to proxy "+l+" with error "+p.message),d()}),f.end()})}});var FL=y(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.StreamDecoder=void 0;var Ss;(function(t){t[t.NO_DATA=0]="NO_DATA",t[t.READING_SIZE=1]="READING_SIZE",t[t.READING_MESSAGE=2]="READING_MESSAGE"})(Ss||(Ss={}));var UL=class{constructor(e){this.maxReadMessageLength=e,this.readState=Ss.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let r=0,n,i=[];for(;r<e.length;)switch(this.readState){case Ss.NO_DATA:this.readCompressFlag=e.slice(r,r+1),r+=1,this.readState=Ss.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case Ss.READING_SIZE:if(n=Math.min(e.length-r,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,r,r+n),this.readSizeRemaining-=n,r+=n,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=Ss.READING_MESSAGE;else{let o=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=Ss.NO_DATA,i.push(o)}}break;case Ss.READING_MESSAGE:if(n=Math.min(e.length-r,this.readMessageRemaining),this.readPartialMessage.push(e.slice(r,r+n)),this.readMessageRemaining-=n,r+=n,this.readMessageRemaining===0){let o=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),s=Buffer.concat(o,this.readMessageSize+5);this.readState=Ss.NO_DATA,i.push(s)}break;default:throw new Error("Unexpected read state")}return i}};PA.StreamDecoder=UL});var lte=y(OA=>{"use strict";Object.defineProperty(OA,"__esModule",{value:!0});OA.Http2SubchannelCall=void 0;var ba=Z("http2"),wDe=Z("os"),xt=Xe(),Ta=Ar(),xDe=FL(),ADe=Nt(),RDe=Xe(),CDe="subchannel_call";function IDe(t){for(let[e,r]of Object.entries(wDe.constants.errno))if(r===t)return e;return"Unknown system error "+t}function zL(t){let e=`Received HTTP status code ${t}`,r;switch(t){case 400:r=xt.Status.INTERNAL;break;case 401:r=xt.Status.UNAUTHENTICATED;break;case 403:r=xt.Status.PERMISSION_DENIED;break;case 404:r=xt.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:r=xt.Status.UNAVAILABLE;break;default:r=xt.Status.UNKNOWN}return{code:r,details:e,metadata:new Ta.Metadata}}var jL=class{constructor(e,r,n,i,o){var s;this.http2Stream=e,this.callEventTracker=r,this.listener=n,this.transport=i,this.callId=o,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let a=(s=i.getOptions()["grpc.max_receive_message_length"])!==null&&s!==void 0?s:xt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new xDe.StreamDecoder(a),e.on("response",(c,l)=>{let u="";for(let d of Object.keys(c))u+=" "+d+": "+c[d]+`
|
|
17
17
|
`;if(this.trace(`Received server headers:
|
|
18
18
|
`+u),this.httpStatusCode=c[":status"],l&ba.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(c);else{let d;try{d=Ta.Metadata.fromHttp2Headers(c)}catch(f){this.endCall({code:xt.Status.UNKNOWN,details:f.message,metadata:new Ta.Metadata});return}this.listener.onReceiveMetadata(d)}}),e.on("trailers",c=>{this.handleTrailers(c)}),e.on("data",c=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+c.length);let l;try{l=this.decoder.write(c)}catch(u){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let d=zL(this.httpStatusCode);this.cancelWithStatus(d.code,d.details)}else this.cancelWithStatus(xt.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of l)this.trace("parsed message of length "+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var c;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((c=this.finalStatus)===null||c===void 0?void 0:c.code)===xt.Status.OK)return;let l,u="";switch(e.rstCode){case ba.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let d=zL(this.httpStatusCode);l=d.code,u=d.details}else l=xt.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case ba.constants.NGHTTP2_REFUSED_STREAM:l=xt.Status.UNAVAILABLE,u="Stream refused by server";break;case ba.constants.NGHTTP2_CANCEL:this.connectionDropped?(l=xt.Status.UNAVAILABLE,u="Connection dropped"):(l=xt.Status.CANCELLED,u="Call cancelled");break;case ba.constants.NGHTTP2_ENHANCE_YOUR_CALM:l=xt.Status.RESOURCE_EXHAUSTED,u="Bandwidth exhausted or memory limit exceeded";break;case ba.constants.NGHTTP2_INADEQUATE_SECURITY:l=xt.Status.PERMISSION_DENIED,u="Protocol not secure enough";break;case ba.constants.NGHTTP2_INTERNAL_ERROR:l=xt.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(l=xt.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:l=xt.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:l,details:u,metadata:new Ta.Metadata,rstCode:e.rstCode})})}),e.on("error",c=>{c.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+c.message+" code="+c.code+" errno="+IDe(c.errno)+" syscall="+c.syscall),this.internalError=c),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:xt.Status.UNAVAILABLE,details:"Connection dropped",metadata:new Ta.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){ADe.trace(RDe.LogVerbosity.DEBUG,CDe,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===xt.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==xt.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let r="";for(let s of Object.keys(e))r+=" "+s+": "+e[s]+`
|
|
19
19
|
`;this.trace(`Received server trailers:
|
|
20
20
|
`+r);let n;try{n=Ta.Metadata.fromHttp2Headers(e)}catch{n=new Ta.Metadata}let i=n.getMap(),o;if(typeof i["grpc-status"]=="string"){let s=Number(i["grpc-status"]);this.trace("received status code "+s+" 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')}o={code:s,details:a,metadata:n}}else this.httpStatusCode?(o=zL(this.httpStatusCode),o.metadata=n):o={code:xt.Status.UNKNOWN,details:"No status information received",metadata:n};this.endCall(o)}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)===xt.Status.OK?r=ba.constants.NGHTTP2_NO_ERROR:r=ba.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 Ta.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!==xt.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 o;let s=xt.Status.UNAVAILABLE;i?.code==="ERR_STREAM_WRITE_AFTER_END"&&(s=xt.Status.INTERNAL),i&&this.cancelWithStatus(s,`Write error: ${i.message}`),(o=e.callback)===null||o===void 0||o.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:xt.Status.UNAVAILABLE,details:`Write failed with error ${i.message}`,metadata:new Ta.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};OA.Http2SubchannelCall=jL});var ute=y(MA=>{"use strict";Object.defineProperty(MA,"__esModule",{value:!0});MA.Http2SubchannelConnector=void 0;var Yu=Z("http2"),PDe=Z("tls"),NA=zc(),Yy=Xe(),ODe=LL(),kp=Nt(),NDe=fo(),kA=Bn(),BL=xn(),kDe=Z("net"),MDe=lte(),$De=yA(),qL="transport",DDe="transport_flowctrl",LDe=u$().version,{HTTP2_HEADER_AUTHORITY:UDe,HTTP2_HEADER_CONTENT_TYPE:FDe,HTTP2_HEADER_METHOD:zDe,HTTP2_HEADER_PATH:jDe,HTTP2_HEADER_TE:BDe,HTTP2_HEADER_USER_AGENT:qDe}=Yu.constants,VDe=2e4,GDe=Buffer.from("too_many_pings","ascii"),VL=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,kA.subchannelAddressToString)(r),n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new NA.ChannelzCallTrackerStub):this.streamTracker=new NA.ChannelzCallTracker,this.channelzRef=(0,NA.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[n["grpc.primary_user_agent"],`grpc-node-js/${LDe}`,n["grpc.secondary_user_agent"]].filter(o=>o).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=VDe,"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",(o,s,a)=>{let c=!1;o===Yu.constants.NGHTTP2_ENHANCE_YOUR_CALM&&a&&a.equals(GDe)&&(c=!0),this.trace("connection closed by GOAWAY with code "+o+" and data "+a?.toString()),this.reportDisconnectToOwner(c)}),e.once("error",o=>{this.trace("connection closed with error "+o.message),this.handleDisconnect()}),e.socket.once("close",o=>{this.trace("connection closed. hadError="+o),this.handleDisconnect()}),kp.isTracerEnabled(qL)&&(e.on("remoteSettings",o=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(o))}),e.on("localSettings",o=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(o))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof PDe.TLSSocket?this.authContext={transportSecurityType:"ssl",sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){var e,r,n;let i=this.session.socket,o=i.remoteAddress?(0,kA.stringToSubchannelAddress)(i.remoteAddress,i.remotePort):null,s=i.localAddress?(0,kA.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:o,localAddress:s,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){kp.trace(Yy.LogVerbosity.DEBUG,qL,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){kp.trace(Yy.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){kp.trace(Yy.LogVerbosity.DEBUG,DDe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){kp.trace(Yy.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((o,s,a)=>{this.clearKeepaliveTimeout(),o?(this.keepaliveTrace("Ping failed with error "+o.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,o){let s=e.toHttp2Headers();s[UDe]=r,s[qDe]=this.userAgent,s[FDe]="application/grpc",s[zDe]="POST",s[jDe]=n,s[BDe]="trailers";let a;try{a=this.session.request(s)}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=o.addMessageSent)===null||u===void 0||u.call(o)},addMessageReceived:()=>{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=o.addMessageReceived)===null||u===void 0||u.call(o)},onCallEnd:u=>{var d;(d=o.onCallEnd)===null||d===void 0||d.call(o,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(d=o.onStreamEnd)===null||d===void 0||d.call(o,u)}}):c={addMessageSent:()=>{var u;(u=o.addMessageSent)===null||u===void 0||u.call(o)},addMessageReceived:()=>{var u;(u=o.addMessageReceived)===null||u===void 0||u.call(o)},onCallEnd:u=>{var d;(d=o.onCallEnd)===null||d===void 0||d.call(o,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;(d=o.onStreamEnd)===null||d===void 0||d.call(o,u)}},l=new MDe.Http2SubchannelCall(a,c,i,this,(0,$De.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,NA.unregisterChannelzRef)(this.channelzRef)}},GL=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){kp.trace(Yy.LogVerbosity.DEBUG,qL,(0,BL.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,o)=>{var s,a,c,l,u,d,f,p;let h=null,m=this.channelTarget;if("grpc.http_connect_target"in n){let F=(0,BL.parseUri)(n["grpc.http_connect_target"]);F&&(m=F,h=(0,BL.uriToString)(F))}let g=e.secure?"https":"http",_=(0,NDe.getDefaultAuthority)(m),v=()=>{var F;(F=this.session)===null||F===void 0||F.destroy(),this.session=null,setImmediate(()=>{D||(D=!0,o(`${N.trim()} (${new Date().toISOString()})`))})},T=F=>{var E;(E=this.session)===null||E===void 0||E.destroy(),N=F.message,this.trace("connection failed with error "+N),D||(D=!0,o(`${N} (${new Date().toISOString()})`))},b={createConnection:(F,E)=>e.socket,settings:{initialWindowSize:(l=(s=n["grpc-node.flow_control_window"])!==null&&s!==void 0?s:(c=(a=Yu.getDefaultSettings)===null||a===void 0?void 0:a.call(Yu))===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},A=Yu.connect(`${g}://${_}`,b),k=(p=(f=(d=Yu.getDefaultSettings)===null||d===void 0?void 0:d.call(Yu))===null||f===void 0?void 0:f.initialWindowSize)!==null&&p!==void 0?p:65535,P=n["grpc-node.flow_control_window"];this.session=A;let N="Failed to connect",D=!1;A.unref(),A.once("remoteSettings",()=>{var F;if(P&&P>k)try{A.setLocalWindowSize(P)}catch{let oe=P-((F=A.state.localWindowSize)!==null&&F!==void 0?F:k);oe>0&&A.incrementWindowSize(oe)}A.removeAllListeners(),e.socket.removeListener("close",v),e.socket.removeListener("error",T),i(new VL(A,r,n,h)),this.session=null}),A.once("close",v),A.once("error",T),e.socket.once("close",v),e.socket.once("error",T)})}tcpConnect(e,r){return(0,ODe.getProxiedConnection)(e,r).then(n=>n||new Promise((i,o)=>{let s=()=>{o(new Error("Socket closed"))},a=l=>{o(l)},c=kDe.connect(e,()=>{c.removeListener("close",s),c.removeListener("error",a),i(c)});c.once("close",s),c.once("error",a)}))}async connect(e,r,n){if(this.isShutdown)return Promise.reject();let i=null,o=null,s=(0,kA.subchannelAddressToString)(e);try{return this.trace(s+" Waiting for secureConnector to be ready"),await r.waitForReady(),this.trace(s+" secureConnector is ready"),i=await this.tcpConnect(e,n),i.setNoDelay(),this.trace(s+" Established TCP connection"),o=await r.connect(i),this.trace(s+" Established secure connection"),this.createSession(o,e,n)}catch(a){throw i?.destroy(),o?.socket.destroy(),a}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};MA.Http2SubchannelConnector=GL});var dte=y(Zy=>{"use strict";Object.defineProperty(Zy,"__esModule",{value:!0});Zy.SubchannelPool=void 0;Zy.getSubchannelPool=QDe;var HDe=$X(),WDe=ete(),YDe=Bn(),KDe=xn(),ZDe=ute(),JDe=1e4,Ky=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(o=>!o.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()},JDe),(r=(e=this.cleanupTimer).unref)===null||r===void 0||r.call(e))}getOrCreateSubchannel(e,r,n,i){this.ensureCleanupTask();let o=(0,KDe.uriToString)(e);if(o in this.pool){let a=this.pool[o];for(let c of a)if((0,YDe.subchannelAddressEqual)(r,c.subchannelAddress)&&(0,HDe.channelOptionsEqual)(n,c.channelArguments)&&i._equals(c.channelCredentials))return c.subchannel}let s=new WDe.Subchannel(e,r,n,i,new ZDe.Http2SubchannelConnector(e));return o in this.pool||(this.pool[o]=[]),this.pool[o].push({subchannelAddress:r,channelArguments:n,channelCredentials:i,subchannel:s}),s.ref(),s}};Zy.SubchannelPool=Ky;var XDe=new Ky;function QDe(t){return t?XDe:new Ky}});var hte=y(LA=>{"use strict";Object.defineProperty(LA,"__esModule",{value:!0});LA.LoadBalancingCall=void 0;var fte=An(),$A=Xe(),pte=Cp(),DA=Ar(),Jy=fa(),eLe=xn(),tLe=Nt(),HL=By(),rLe=Z("http2"),nLe="load_balancing_call",WL=class{constructor(e,r,n,i,o,s,a){var c,l;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=o,this.deadline=s,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,eLe.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,pte.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){tLe.trace($A.LogVerbosity.DEBUG,nLe,"["+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 o=Object.assign(Object.assign({},e),{progress:r});(n=this.listener)===null||n===void 0||n.onReceiveStatus(o),(i=this.onCallEnded)===null||i===void 0||i.call(this,o.code,o.details,o.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),o=i.subchannel?"("+i.subchannel.getChannelzRef().id+") "+i.subchannel.getAddress():""+i.subchannel;switch(this.trace("Pick result: "+Jy.PickResultType[i.pickResultType]+" subchannel: "+o+" 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 Jy.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:$A.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new DA.Metadata},"PROCESSED"),i.subchannel.getConnectivityState()!==fte.ConnectivityState.READY){this.trace("Picked subchannel "+o+" has state "+fte.ConnectivityState[i.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&n.set("grpc-timeout",(0,pte.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===rLe.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 "+o+" with error "+d.message),this.outputStatus({code:$A.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+d.message,metadata:new DA.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,HL.restrictControlPlaneStatusCode)(typeof l.code=="number"?l.code:$A.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${l.message}`);this.outputStatus({code:u,details:d,metadata:new DA.Metadata},"PROCESSED")});break;case Jy.PickResultType.DROP:let{code:a,details:c}=(0,HL.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:a,details:c,metadata:i.status.metadata},"DROP")});break;case Jy.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:l,details:u}=(0,HL.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:l,details:u,metadata:i.status.metadata},"PROCESSED")})}break;case Jy.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 DA.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}};LA.LoadBalancingCall=WL});var gte=y(UA=>{"use strict";Object.defineProperty(UA,"__esModule",{value:!0});UA.ResolvingCall=void 0;var iLe=gx(),Ku=Xe(),Zu=Cp(),mte=Ar(),oLe=Nt(),sLe=By(),aLe="resolving_call",YL=class{constructor(e,r,n,i,o){this.channel=e,this.method=r,this.filterStackFactory=i,this.callNumber=o,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=iLe.CallCredentials.createEmpty(),this.deadline=n.deadline,this.host=n.host,n.parentCall&&(n.flags&Ku.Propagate.CANCELLATION&&n.parentCall.on("cancelled",()=>{this.cancelWithStatus(Ku.Status.CANCELLED,"Cancelled by parent call")}),n.flags&Ku.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+n.parentCall.getDeadline()),this.deadline=(0,Zu.minDeadline)(this.deadline,n.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){oLe.trace(Ku.LogVerbosity.DEBUG,aLe,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,Zu.deadlineToString)(this.deadline));let e=(0,Zu.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let r=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(Ku.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let n=[],i=new Date;n.push(`Deadline exceeded after ${(0,Zu.formatDateDifference)(this.deadlineStartTime,i)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&n.push(`name resolution: ${(0,Zu.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&n.push(`metadata filters: ${(0,Zu.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(Ku.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!==Ku.Status.OK){let{code:n,details:i}=(0,sLe.restrictControlPlaneStatusCode)(r.status,"Failed to route call to method "+this.method);this.outputStatus({code:n,details:i,metadata:new mte.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,Zu.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(o=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(o),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},o=>{this.cancelWithStatus(o.code,o.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 mte.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}};UA.ResolvingCall=YL});var _te=y(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.RetryingCall=qc.MessageBufferTracker=qc.RetryThrottler=void 0;var FA=Xe(),cLe=Cp(),lLe=Ar(),uLe=Nt(),dLe="retrying_call",ZL=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}};qc.RetryThrottler=ZL;var JL=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)}};qc.MessageBufferTracker=JL;var KL="grpc-previous-rpc-attempts",fLe=5,XL=class{constructor(e,r,n,i,o,s,a,c,l){var u;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=o,this.deadline=s,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:fLe;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,cLe.formatDateDifference)(this.startTime,r.startTime)}`),e.push(...r.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){uLe.trace(FA.LogVerbosity.DEBUG,dLe,"["+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 lLe.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(FA.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=FA.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,o=Number(r.maxBackoff.substring(0,r.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*r.backoffMultiplier,o),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,o;if(this.state!=="RETRY"){r(!1);return}!((o=(i=this.retryThrottler)===null||i===void 0?void 0:i.canRetryCall())!==null&&o!==void 0)||o?(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,o,s;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)){(o=this.retryThrottler)===null||o===void 0||o.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)?((s=this.retryThrottler)===null||s===void 0||s.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===FA.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 o=(e=i.hedgingDelay)!==null&&e!==void 0?e:"0s",s=Number(o.substring(0,o.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},s*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(KL,`${n}`);let o=!1;e.start(i,{onReceiveMetadata:s=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(r),o=!0,n>0&&s.set(KL,`${n}`),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMetadata(s)},onReceiveMessage:s=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(r),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMessage(s)},onReceiveStatus:s=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!o&&n>0&&s.metadata.set(KL,`${n}`),this.handleChildStatus(s,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 o=this.underlyingCalls[e];o.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:s=>{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(),o={entryType:"MESSAGE",message:n,allocated:this.bufferTracker.allocate(r.length,this.callNumber)};if(this.writeBuffer.push(o),o.allocated){process.nextTick(()=>{var s;(s=e.callback)===null||s===void 0||s.call(e)});for(let[s,a]of this.underlyingCalls.entries())a.state==="ACTIVE"&&a.nextMessageToSend===i&&a.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(s,i)}},r)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let s=this.underlyingCalls[this.committedCallIndex];o.callback=e.callback,s.state==="ACTIVE"&&s.nextMessageToSend===i&&s.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}};qc.RetryingCall=XL});var Xy=y(zA=>{"use strict";Object.defineProperty(zA,"__esModule",{value:!0});zA.BaseSubchannelWrapper=void 0;var QL=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()}};zA.BaseSubchannelWrapper=QL});var a1=y(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.InternalChannel=Ju.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var pLe=ap(),hLe=MX(),mLe=dte(),r1=fa(),gLe=Ar(),Vc=Xe(),_Le=wA(),yLe=wL(),yte=fo(),jA=Nt(),SLe=LL(),BA=xn(),Bi=An(),Qy=zc(),ELe=hte(),vLe=Cp(),bLe=gte(),e1=yA(),TLe=By(),t1=_te(),wLe=Xy(),xLe=2147483647,ALe=1e3,RLe=1800*1e3,qA=new Map,CLe=1<<24,ILe=1<<20,n1=class extends wLe.BaseSubchannelWrapper{constructor(e,r){super(e),this.channel=r,this.refCount=0,this.subchannelStateListener=(n,i,o,s)=>{r.throttleKeepalive(s)}}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))}},i1=class{pick(e){return{pickResultType:r1.PickResultType.DROP,status:{code:Vc.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new gLe.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};Ju.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var o1=class{constructor(e){this.target=e,this.trace=new Qy.ChannelzTrace,this.callTracker=new Qy.ChannelzCallTracker,this.childrenTracker=new Qy.ChannelzChildrenTracker,this.state=Bi.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},s1=class{constructor(e,r,n){var i,o,s,a,c,l;if(this.credentials=r,this.options=n,this.connectivityState=Bi.ConnectivityState.IDLE,this.currentPicker=new r1.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 pLe.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 o1(e);let u=(0,BA.parseUri)(e);if(u===null)throw new Error(`Could not parse target name "${e}"`);let d=(0,yte.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,Qy.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,yte.getDefaultAuthority)(d);let f=(0,SLe.mapProxyName)(d,n);this.target=f.target,this.options=Object.assign({},this.options,f.extraOptions),this.subchannelPool=(0,mLe.getSubchannelPool)(((i=this.options["grpc.use_local_subchannel_pool"])!==null&&i!==void 0?i:0)===0),this.retryBufferTracker=new t1.MessageBufferTracker((o=this.options["grpc.retry_buffer_size"])!==null&&o!==void 0?o:CLe,(s=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&s!==void 0?s:ILe),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:RLe,ALe);let p={createSubchannel:(m,g)=>{let _={};for(let[b,A]of Object.entries(g))b.startsWith(Ju.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(_[b]=A);let v=this.subchannelPool.getOrCreateSubchannel(this.target,m,_,this.credentials);return v.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",v.getChannelzRef()),new n1(v,this)},updateState:(m,g)=>{this.currentPicker=g;let _=this.pickQueue.slice();this.pickQueue=[],_.length>0&&this.callRefTimerUnref();for(let v of _)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 hLe.ResolvingLoadBalancer(this.target,p,this.options,(m,g)=>{var _;m.retryThrottling?qA.set(this.getTarget(),new t1.RetryThrottler(m.retryThrottling.maxTokens,m.retryThrottling.tokenRatio,qA.get(this.getTarget()))):qA.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(_=this.configSelector)===null||_===void 0||_.unref(),this.configSelector=g,this.currentResolutionError=null,process.nextTick(()=>{let v=this.configSelectionQueue;this.configSelectionQueue=[],v.length>0&&this.callRefTimerUnref();for(let T of v)T.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,TLe.restrictControlPlaneStatusCode)(m.code,m.details)),{metadata:m.metadata}));let g=this.configSelectionQueue;this.configSelectionQueue=[],g.length>0&&this.callRefTimerUnref();for(let _ of g)_.reportResolverError(m)}),this.filterStackFactory=new _Le.FilterStackFactory([new yLe.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(n,void 0,2));let h=new Error;(0,jA.isTracerEnabled)("channel_stacktrace")&&(0,jA.trace)(Vc.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,jA.trace)(r??Vc.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,BA.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},xLe)),!((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,jA.trace)(Vc.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,BA.uriToString)(this.target)+" "+Bi.ConnectivityState[this.connectivityState]+" -> "+Bi.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Bi.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!==Bi.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!==Bi.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(Bi.ConnectivityState.IDLE),this.currentPicker=new r1.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 o=new Date().valueOf()-this.lastActivityTimestamp.valueOf();o>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-o)},e),(n=(r=this.idleTimer).unref)===null||n===void 0||n.call(r)}maybeStartIdleTimer(){this.connectivityState!==Bi.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===Vc.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,n,i,o){let s=(0,e1.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+s+'] method="'+r+'"'),new ELe.LoadBalancingCall(this,e,r,n,i,o,s)}createRetryingCall(e,r,n,i,o){let s=(0,e1.getNextCallNumber)();return this.trace("createRetryingCall ["+s+'] method="'+r+'"'),new t1.RetryingCall(this,e,r,n,i,o,s,this.retryBufferTracker,qA.get(this.getTarget()))}createResolvingCall(e,r,n,i,o){let s=(0,e1.getNextCallNumber)();this.trace("createResolvingCall ["+s+'] method="'+e+'", deadline='+(0,vLe.deadlineToString)(r));let a={deadline:r,flags:o??Vc.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new bLe.ResolvingCall(this,e,a,this.filterStackFactory.clone(),s);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Bi.ConnectivityState.SHUTDOWN),this.currentPicker=new i1;for(let r of this.configSelectionQueue)r.cancelWithStatus(Vc.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(Vc.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,Qy.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,BA.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===Bi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(r!==1/0){let s=r instanceof Date?r:new Date(r),a=new Date;if(r===-1/0||s<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(o),n(new Error("Deadline passed without connectivity state change"))},s.getTime()-a.getTime())}let o={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(o)}getChannelzRef(){return this.channelzRef}createCall(e,r,n,i,o){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===Bi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,n,i,o)}getOptions(){return this.options}};Ju.InternalChannel=s1});var eD=y(VA=>{"use strict";Object.defineProperty(VA,"__esModule",{value:!0});VA.ChannelImplementation=void 0;var PLe=ap(),OLe=a1(),c1=class{constructor(e,r,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof PLe.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 OLe.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,o){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,o)}};VA.ChannelImplementation=c1});var Ete=y(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.ServerDuplexStreamImpl=xo.ServerWritableStreamImpl=xo.ServerReadableStreamImpl=xo.ServerUnaryCallImpl=void 0;xo.serverErrorToStatus=m1;var NLe=Z("events"),p1=Z("stream"),h1=Xe(),Ste=Ar();function m1(t,e){var r;let n={code:h1.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 l1=class extends NLe.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()}};xo.ServerUnaryCallImpl=l1;var u1=class extends p1.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()}};xo.ServerReadableStreamImpl=u1;var d1=class extends p1.Writable{constructor(e,r,n,i){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.request=i,this.pendingStatus={code:h1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ste.Metadata,this.on("error",o=>{this.pendingStatus=m1(o),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()}};xo.ServerWritableStreamImpl=d1;var f1=class extends p1.Duplex{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.pendingStatus={code:h1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ste.Metadata,this.on("error",i=>{this.pendingStatus=m1(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()}};xo.ServerDuplexStreamImpl=f1});var GA=y(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.ServerCredentials=void 0;Mp.createCertificateProviderServerCredentials=kLe;Mp.createServerCredentialsWithInterceptors=MLe;var g1=b$(),Xu=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 _1}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 o=[],s=[];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`);o.push(c.cert_chain),s.push(c.private_key)}return new y1({requestCert:n,ciphers:g1.CIPHER_SUITES},{ca:(i=e??(0,g1.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:o,key:s})}};Mp.ServerCredentials=Xu;var _1=class t extends Xu{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},y1=class t extends Xu{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}},S1=class t extends Xu{constructor(e,r,n){super({requestCert:r!==null,rejectUnauthorized:n,ciphers:g1.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 kLe(t,e,r){return new S1(t,e,r)}var E1=class t extends Xu{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 MLe(t,e){return new E1(t,e)}});var eS=y(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.durationMessageToDuration=$Le;wa.msToDuration=DLe;wa.durationToMs=LLe;wa.isDuration=ULe;wa.isDurationMessage=FLe;wa.parseDuration=jLe;wa.durationToString=BLe;function $Le(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function DLe(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function LLe(t){return t.seconds*1e3+t.nanos/1e6|0}function ULe(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function FLe(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var zLe=/^(\d+)(?:\.(\d+))?s$/;function jLe(t){let e=t.match(zLe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function BLe(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 WA=y(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.OrcaOobMetricsSubchannelWrapper=hi.GRPC_METRICS_HEADER=hi.ServerMetricRecorder=hi.PerRequestMetricRecorder=void 0;hi.createOrcaClient=wte;hi.createMetricsReader=KLe;var qLe=Dx(),v1=eS(),VLe=ap(),GLe=Xy(),vte=Xe(),HLe=cp(),WLe=An(),bte=null;function HA(){if(bte)return bte;let t=cL().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,qLe.loadPackageDefinition)(e)}var b1=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 HA().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};hi.PerRequestMetricRecorder=b1;var YLe=3e4,T1=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,v1.durationToMs)((0,v1.durationMessageToDuration)(e.request.report_interval)):YLe,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=HA().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};hi.ServerMetricRecorder=T1;function wte(t){let e=HA().xds.service.orca.v3.OpenRcaService;return new e("unused",VLe.ChannelCredentials.createInsecure(),{channelOverride:t})}hi.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var Tte="grpc_orca_load_report";function KLe(t,e){return(r,n,i)=>{let o=i.getOpaque(Tte);if(o)t(o);else{let s=i.get(hi.GRPC_METRICS_HEADER);s.length>0&&(o=HA().xds.data.orca.v3.OrcaLoadReport.deserialize(s[0]),t(o),i.setOpaque(Tte,o))}e&&e(r,n,i)}}var xte="orca_oob_metrics",w1=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(xte,ZLe);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)}},x1=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new HLe.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=wte(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(xte),(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()!==WLe.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,v1.msToDuration)(r)});this.metricsCall=n,n.on("data",i=>{this.dataWatchers.forEach(o=>{o.onMetricsUpdate(i)})}),n.on("error",i=>{if(this.metricsCall=null,i.code===vte.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}i.code!==vte.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},A1=class extends GLe.BaseSubchannelWrapper{constructor(e,r,n){super(e),this.addDataWatcher(new w1(r,n))}getWrappedSubchannel(){return this.child}};hi.OrcaOobMetricsSubchannelWrapper=A1;function ZLe(t){return new x1(t)}});var k1=y(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.BaseServerInterceptingCall=qi.ServerInterceptingCall=qi.ResponderBuilder=qi.ServerListenerBuilder=void 0;qi.isInterceptingServerListener=QLe;qi.getServerInterceptingCall=i1e;var ZA=Ar(),Cn=Xe(),$p=Z("http2"),Ate=fx(),Rte=Z("zlib"),JLe=FL(),Nte=Nt(),XLe=Z("tls"),Cte=WA(),kte="server_call";function Qu(t){Nte.trace(Cn.LogVerbosity.DEBUG,kte,t)}var C1=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}}};qi.ServerListenerBuilder=C1;function QLe(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var I1=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()}},P1=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}}};qi.ResponderBuilder=P1;var YA={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},KA={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},O1=class{constructor(e,r){var n,i,o,s;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:KA.start,sendMetadata:(i=r?.sendMetadata)!==null&&i!==void 0?i:KA.sendMetadata,sendMessage:(o=r?.sendMessage)!==null&&o!==void 0?o:KA.sendMessage,sendStatus:(s=r?.sendStatus)!==null&&s!==void 0?s:KA.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,o,s;let a={onReceiveMetadata:(n=r?.onReceiveMetadata)!==null&&n!==void 0?n:YA.onReceiveMetadata,onReceiveMessage:(i=r?.onReceiveMessage)!==null&&i!==void 0?i:YA.onReceiveMessage,onReceiveHalfClose:(o=r?.onReceiveHalfClose)!==null&&o!==void 0?o:YA.onReceiveHalfClose,onCancel:(s=r?.onCancel)!==null&&s!==void 0?s:YA.onCancel},c=new I1(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 ZA.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()}};qi.ServerInterceptingCall=O1;var Mte="grpc-accept-encoding",N1="grpc-encoding",Ite="grpc-message",Pte="grpc-status",R1="grpc-timeout",e1e=/(\d{1,8})\s*([HMSmun])/,t1e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},r1e={[Mte]:"identity,deflate,gzip",[N1]:"identity"},Ote={[$p.constants.HTTP2_HEADER_STATUS]:$p.constants.HTTP_STATUS_OK,[$p.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},n1e={waitForTrailers:!0},JA=class{constructor(e,r,n,i,o){var s,a;this.stream=e,this.callEventTracker=n,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=Cn.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=Cn.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 Cte.PerRequestMetricRecorder,this.stream.once("close",()=>{var f;Qu("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:Cn.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 o&&(this.maxSendMessageSize=o["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in o&&(this.maxReceiveMessageSize=o["grpc.max_receive_message_length"]),this.host=(s=r[":authority"])!==null&&s!==void 0?s:r.host,this.decoder=new JLe.StreamDecoder(this.maxReceiveMessageSize);let c=ZA.Metadata.fromHttp2Headers(r);Nte.isTracerEnabled(kte)&&Qu("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let l=c.get(R1);l.length>0&&this.handleTimeoutHeader(l[0]);let u=c.get(N1);u.length>0&&(this.incomingEncoding=u[0]),c.remove(R1),c.remove(N1),c.remove(Mte),c.remove($p.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove($p.constants.HTTP2_HEADER_TE),c.remove($p.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=!!o["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(e1e);if(r===null){let o={code:Cn.Status.INTERNAL,details:`Invalid ${R1} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(o)});return}let n=+r[1]*t1e[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let o={code:Cn.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(o)},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 ZA.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=Rte.createInflate():i=Rte.createGunzip(),new Promise((o,s)=>{let a=0,c=[];i.on("error",l=>{s({code:Cn.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(),s({code:Cn.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{o(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:Cn.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(o){this.sendStatus(o);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(o){this.sendStatus({code:Cn.Status.INTERNAL,details:`Error deserializing request: ${o.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;Qu("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:Cn.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let o={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(o),this.decompressAndMaybePush(o),(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){Qu("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({},Ote),r1e),r);this.stream.respond(n,n1e)}sendMessage(e,r){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:Cn.Status.INTERNAL,details:`Error serializing response: ${(0,Ate.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:Cn.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Qu("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var o;if(i){this.sendStatus({code:Cn.Status.INTERNAL,details:`Error writing message: ${(0,Ate.getErrorMessage)(i)}`,metadata:null});return}(o=this.callEventTracker)===null||o===void 0||o.addMessageSent(),r()})}sendStatus(e){var r,n,i;if(this.checkCancelled())return;Qu("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+Cn.Status[e.code]+" details: "+e.details);let o=(i=(n=e.metadata)===null||n===void 0?void 0:n.clone())!==null&&i!==void 0?i:new ZA.Metadata;if(this.shouldSendMetrics&&o.set(Cte.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 s=Object.assign({[Pte]:e.code,[Ite]:encodeURI(e.details)},o.toHttp2Headers());this.stream.sendTrailers(s),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Pte]:e.code,[Ite]:encodeURI(e.details)},Ote),o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Qu("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 XLe.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}};qi.BaseServerInterceptingCall=JA;function i1e(t,e,r,n,i,o){let s={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 JA(e,r,n,i,o);return t.reduce((c,l)=>l(s,c),a)}});var jte=y(Hc=>{"use strict";var o1e=Hc&&Hc.__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},s1e=Hc&&Hc.__esDecorate||function(t,e,r,n,i,o){function s(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}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(_){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(_||null))};var g=(0,r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],h);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(d=s(g.get))&&(u.get=d),(d=s(g.set))&&(u.set=d),(d=s(g.init))&&i.unshift(d)}else(d=s(g))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Server=void 0;var Vn=Z("http2"),a1e=Z("util"),rr=Xe(),Up=Ete(),M1=GA(),$te=fo(),Lp=Nt(),Gc=Bn(),Ao=xn(),_r=zc(),Dte=k1(),Dp=~(1<<31),$1=~(1<<31),c1e=2e4,Lte=~(1<<31),{HTTP2_HEADER_PATH:Ute}=Vn.constants,l1e="server",Fte=Buffer.from("max_age");function zte(t){Lp.trace(rr.LogVerbosity.DEBUG,"server_call",t)}function u1e(){}function d1e(t){return function(e,r){return a1e.deprecate(e,t)}}function D1(t){return{code:rr.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function f1e(t,e){let r=D1(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 p1e=(()=>{var t;let e=[],r;return t=class{constructor(i){var o,s,a,c,l,u;this.boundPorts=(o1e(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 _r.ChannelzTraceStub,this.callTracker=new _r.ChannelzCallTrackerStub,this.listenerChildrenTracker=new _r.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new _r.ChannelzChildrenTrackerStub):(this.channelzTrace=new _r.ChannelzTrace,this.callTracker=new _r.ChannelzCallTracker,this.listenerChildrenTracker=new _r.ChannelzChildrenTracker,this.sessionChildrenTracker=new _r.ChannelzChildrenTracker),this.channelzRef=(0,_r.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(o=this.options["grpc.max_connection_age_ms"])!==null&&o!==void 0?o:Dp,this.maxConnectionAgeGraceMs=(s=this.options["grpc.max_connection_age_grace_ms"])!==null&&s!==void 0?s:Dp,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:$1,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:c1e,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:Lte,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 o,s,a;let c=this.sessions.get(i),l=i.socket,u=l.remoteAddress?(0,Gc.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Gc.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let h=l,m=h.getCipher(),g=h.getCertificate(),_=h.getPeerCertificate();f={cipherSuiteStandardName:(o=m.standardName)!==null&&o!==void 0?o:null,cipherSuiteOtherName:m.standardName?null:m.name,localCertificate:g&&"raw"in g?g.raw:null,remoteCertificate:_&&"raw"in _?_.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:(s=i.state.localWindowSize)!==null&&s!==void 0?s:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){Lp.trace(rr.LogVerbosity.DEBUG,l1e,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){Lp.trace(rr.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,o){if(i===null||typeof i!="object"||o===null||typeof o!="object")throw new Error("addService() requires two objects as arguments");let s=Object.keys(i);if(s.length===0)throw new Error("Cannot add an empty service to a server");s.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let u=o[a],d;if(u===void 0&&typeof c.originalName=="string"&&(u=o[c.originalName]),u!==void 0?d=u.bind(o):d=f1e(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(s=>{let a=i[s];this.unregister(a.path)})}bind(i,o){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,_r.registerChannelzSocket)((0,Gc.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,_r.unregisterChannelzRef)(i)}createHttp2Server(i){let o;if(i._isSecure()){let s=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),s),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),o=Vn.createSecureServer(c),o.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),o.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=o;try{f.setSecureContext(d)}catch(p){Lp.log(rr.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),o.on("close",()=>{i._removeWatcher(u)})}else o=Vn.createServer(this.commonServerOptions);return o.setTimeout(0,u1e),this._setupHandlers(o,i._getInterceptors()),o}bindOneAddress(i,o){this.trace("Attempting to bind "+(0,Gc.subchannelAddressToString)(i));let s=this.createHttp2Server(o.credentials);return new Promise((a,c)=>{let l=u=>{this.trace("Failed to bind "+(0,Gc.subchannelAddressToString)(i)+" with error "+u.message),a({port:"port"in i?i.port:1,error:u.message})};s.once("error",l),s.listen(i,()=>{let u=s.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(s,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),o.listeningServers.add(s),this.trace("Successfully bound "+(0,Gc.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),s.removeListener("error",l)})})}async bindManyPorts(i,o){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Gc.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let s=await this.bindOneAddress(i[0],o);if(s.error){let a=await this.bindManyPorts(i.slice(1),o);return Object.assign(Object.assign({},a),{errors:[s.error,...a.errors]})}else{let a=i.slice(1).map(u=>(0,Gc.isTcpSubchannelAddress)(u)?{host:u.host,port:s.port}:u),c=await Promise.all(a.map(u=>this.bindOneAddress(u,o))),l=[s,...c];return{count:l.filter(u=>u.error===void 0).length,port:s.port,errors:l.filter(u=>u.error).map(u=>u.error)}}}else{let s=await Promise.all(i.map(a=>this.bindOneAddress(a,o)));return{count:s.filter(a=>a.error===void 0).length,port:s[0].port,errors:s.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,o){let s=await this.bindManyPorts(i,o);if(s.count>0)return s.count<i.length&&Lp.log(rr.LogVerbosity.INFO,`WARNING Only ${s.count} addresses added out of total ${i.length} resolved`),s.port;{let a=`No address added out of total ${i.length} resolved`;throw Lp.log(rr.LogVerbosity.ERROR,a),new Error(`${a} errors: [${s.errors.join(",")}]`)}}resolvePort(i){return new Promise((o,s)=>{let a=!1,c=(u,d,f,p)=>{if(a)return!0;if(a=!0,!u.ok)return s(new Error(u.error.details)),!0;let h=[].concat(...u.value.map(m=>m.addresses));return h.length===0?(s(new Error(`No addresses resolved for port ${i}`)),!0):(o(h),!0)};(0,$te.createResolver)(i,c,this.options).updateResolution()})}async bindPort(i,o){let s=await this.resolvePort(i);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(s,o);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let o=(0,Ao.parseUri)(i);if(o===null)throw new Error(`Could not parse port "${i}"`);let s=(0,$te.mapUriDefaultScheme)(o);if(s===null)throw new Error(`Could not get a default scheme for port "${i}"`);return s}bindAsync(i,o,s){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(o===null||!(o instanceof M1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof s!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,p)=>{process.nextTick(()=>s(f,p))},l=this.boundPorts.get((0,Ao.uriToString)(a));if(l){if(!o._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>s(null,f),f=>s(f,0)):c(null,l.portNumber);return}l={mapKey:(0,Ao.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:o,listeningServers:new Set};let u=(0,Ao.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,Ao.combineHostPort)({host:u.host,port:f})};l.mapKey=(0,Ao.uriToString)(p),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),s(null,f)},f=>{s(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,s(null,f)},f=>{s(f,0)}))}registerInjectorToChannelz(){return(0,_r.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,o,s=!1){if(i===null||!(i instanceof M1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(o);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:o,sessions:c,ownsChannelzRef:s}),{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(Vn.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 M1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let o=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,o,!0)}closeServer(i,o){this.trace("Closing server with address "+JSON.stringify(i.address()));let s=this.http2Servers.get(i);i.close(()=>{s&&s.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(s.channelzRef),(0,_r.unregisterChannelzRef)(s.channelzRef)),this.http2Servers.delete(i),o?.()})}closeSession(i,o){var s;this.trace("Closing session initiated by "+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,_r.unregisterChannelzRef)(a.ref)),o?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let o of i.listeningServers){let s=this.http2Servers.get(o);if(this.closeServer(o,()=>{i.listeningServers.delete(o)}),s)for(let a of s.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let o=this.normalizePort(i),s=(0,Ao.splitHostPort)(o.path);if(s?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,Ao.uriToString)(o));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,Ao.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,o){var s,a;this.trace("drain port="+i+" graceTimeMs="+o);let c=this.normalizePort(i),l=(0,Ao.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Ao.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=(s=setTimeout(()=>{for(let f of d)f.destroy(Vn.constants.NGHTTP2_CANCEL)},o)).unref)===null||a===void 0||a.call(s)}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,o)=>{this.closeSession(o),o.destroy(Vn.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,_r.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,o,s,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:o,serialize:s,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 o;let s=l=>{(0,_r.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&s()}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=(o=f.socket)===null||o===void 0?void 0:o.remoteAddress;this.trace("Waiting for session "+p+" to close"),this.closeSession(f,()=>{this.trace("Session "+p+" finished closing"),c()})}}a===0&&s()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,o){let s=o[Vn.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof s!="string"||!s.startsWith("application/grpc")?(i.respond({[Vn.constants.HTTP2_HEADER_STATUS]:Vn.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){zte("Received call to method "+i+" at address "+this.serverAddressString);let o=this.handlers.get(i);return o===void 0?(zte("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):o}_respondWithError(i,o,s=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:rr.Status.INTERNAL,"grpc-message":i.details,[Vn.constants.HTTP2_HEADER_STATUS]:Vn.constants.HTTP_STATUS_OK,[Vn.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());o.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),s?.streamTracker.addCallFailed()}_channelzHandler(i,o,s){o.once("error",f=>{}),this.onStreamOpened(o);let a=this.sessions.get(o.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(o,s)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=s[Ute],l=this._retrieveHandler(c);if(!l){this._respondWithError(D1(c),o,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===rr.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,Dte.getServerInterceptingCall)([...i,...this.interceptors],o,s,u,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,o,s){if(o.once("error",u=>{}),this.onStreamOpened(o),this._verifyContentType(o,s)!==!0)return;let a=s[Ute],c=this._retrieveHandler(a);if(!c){this._respondWithError(D1(a),o,null);return}let l=(0,Dte.getServerInterceptingCall)([...i,...this.interceptors],o,s,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,o){let{type:s}=o;if(s==="unary")h1e(i,o);else if(s==="clientStream")m1e(i,o);else if(s==="serverStream")g1e(i,o);else if(s==="bidi")_1e(i,o);else return!1;return!0}_setupHandlers(i,o){if(i===null)return;let s=i.address(),a="null";s&&(typeof s=="string"?a=s:a=s.address+":"+s.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,o)),i.on("session",l)}_sessionHandler(i){return o=>{var s,a;(s=this.http2Servers.get(i))===null||s===void 0||s.sessions.add(o);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==Dp){let _=this.maxConnectionAgeMs/10,v=Math.random()*_*2-_;c=setTimeout(()=>{var T,b;d=!0,this.trace("Connection dropped by max connection age: "+((T=o.socket)===null||T===void 0?void 0:T.remoteAddress));try{o.goaway(Vn.constants.NGHTTP2_NO_ERROR,~(1<<31),Fte)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==Dp&&(l=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(b=l.unref)===null||b===void 0||b.call(l))},this.maxConnectionAgeMs+v),(a=c.unref)===null||a===void 0||a.call(c)}let p=()=>{u&&(clearTimeout(u),u=null)},h=()=>!o.destroyed&&this.keepaliveTimeMs<$1&&this.keepaliveTimeMs>0,m,g=()=>{var _;h()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{p(),m()},this.keepaliveTimeMs),(_=u.unref)===null||_===void 0||_.call(u))};m=()=>{var _;if(!h())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let v="";try{o.ping((b,A,k)=>{p(),b?(this.keepaliveTrace("Ping failed with error: "+b.message),d=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),g())})||(v="Ping returned false")}catch(T){v=(T instanceof Error?T.message:"")||"Unknown error"}if(v){this.keepaliveTrace("Ping send failed: "+v),this.trace("Connection dropped due to ping send error: "+v),d=!0,o.destroy();return}u=setTimeout(()=>{p(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,o.destroy()},this.keepaliveTimeoutMs),(_=u.unref)===null||_===void 0||_.call(u)},g(),o.on("close",()=>{var _,v;d||this.trace(`Connection dropped by client ${(_=o.socket)===null||_===void 0?void 0:_.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),p(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(o)),(v=this.http2Servers.get(i))===null||v===void 0||v.sessions.delete(o)})}}_channelzSessionHandler(i){return o=>{var s,a,c,l;let u=(0,_r.registerChannelzSocket)((a=(s=o.socket)===null||s===void 0?void 0:s.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,o),this.channelzEnabled),d={ref:u,streamTracker:new _r.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(o),this.sessions.set(o,d);let f=`${o.socket.remoteAddress}:${o.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,g=!1,_=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==Dp){let k=this.maxConnectionAgeMs/10,P=Math.random()*k*2-k;p=setTimeout(()=>{var N;g=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{o.goaway(Vn.constants.NGHTTP2_NO_ERROR,~(1<<31),Fte)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==Dp&&(h=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(N=h.unref)===null||N===void 0||N.call(h))},this.maxConnectionAgeMs+P),(l=p.unref)===null||l===void 0||l.call(p)}let v=()=>{m&&(clearTimeout(m),m=null)},T=()=>!o.destroyed&&this.keepaliveTimeMs<$1&&this.keepaliveTimeMs>0,b,A=()=>{var k;T()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),m=setTimeout(()=>{v(),b()},this.keepaliveTimeMs),(k=m.unref)===null||k===void 0||k.call(m))};b=()=>{var k;if(!T())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let P="";try{o.ping((D,F,E)=>{v(),D?(this.keepaliveTrace("Ping failed with error: "+D.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+D.message+" return in "+F),g=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),A())})||(P="Ping returned false")}catch(N){P=(N instanceof Error?N.message:"")||"Unknown error"}if(P){this.keepaliveTrace("Ping send failed: "+P),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+P),g=!0,o.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),g=!0,o.destroy()},this.keepaliveTimeoutMs),(k=m.unref)===null||k===void 0||k.call(m)},A(),o.on("close",()=>{var k;g||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(u),(0,_r.unregisterChannelzRef)(u),p&&clearTimeout(p),h&&clearTimeout(h),v(),_!==null&&(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(o)),(k=this.http2Servers.get(i))===null||k===void 0||k.sessions.delete(o),this.sessions.delete(o)})}}enableIdleTimeout(i){var o,s;if(this.sessionIdleTimeout>=Lte)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(s=(o=a.timeout).unref)===null||s===void 0||s.call(o),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,o){let{socket:s}=o,a=i.sessionIdleTimeouts.get(o);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+s?.remoteAddress+":"+s?.remotePort+" last idle at "+a.lastIdle),i.closeSession(o)):a.timeout.refresh())}onStreamOpened(i){let o=i.session,s=this.sessionIdleTimeouts.get(o);s&&(s.activeStreams+=1,i.once("close",s.onClose))}onStreamClose(i){var o,s;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress)+":"+((s=i.socket)===null||s===void 0?void 0:s.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[d1e("Calling start() is no longer necessary. It can be safely omitted.")],s1e(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})();Hc.Server=p1e;async function h1e(t,e){let r;function n(s,a,c,l){if(s){t.sendStatus((0,Up.serverErrorToStatus)(s,c));return}t.sendMessage(a,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:c??null})})}let i,o=null;t.start({onReceiveMetadata(s){i=s,t.startRead()},onReceiveMessage(s){if(o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}o=s,t.startRead()},onReceiveHalfClose(){if(!o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Up.ServerWritableStreamImpl(e.path,t,i,o);try{e.func(r,n)}catch(s){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function m1e(t,e){let r;function n(i,o,s,a){if(i){t.sendStatus((0,Up.serverErrorToStatus)(i,s));return}t.sendMessage(o,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:s??null})})}t.start({onReceiveMetadata(i){r=new Up.ServerDuplexStreamImpl(e.path,t,i);try{e.func(r,n)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onReceiveMessage(i){r.push(i)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function g1e(t,e){let r,n,i=null;t.start({onReceiveMetadata(o){n=o,t.startRead()},onReceiveMessage(o){if(i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=o,t.startRead()},onReceiveHalfClose(){if(!i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Up.ServerWritableStreamImpl(e.path,t,n,i);try{e.func(r)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function _1e(t,e){let r;t.start({onReceiveMetadata(n){r=new Up.ServerDuplexStreamImpl(e.path,t,n);try{e.func(r)}catch(i){t.sendStatus({code:rr.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 Bte=y(XA=>{"use strict";Object.defineProperty(XA,"__esModule",{value:!0});XA.StatusBuilder=void 0;var L1=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}};XA.StatusBuilder=L1});var iS=y(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.LeafLoadBalancer=Es.PickFirstLoadBalancer=Es.PickFirstLoadBalancingConfig=void 0;Es.shuffled=Hte;Es.setup=x1e;var U1=Pc(),nr=An(),Wc=fa(),qte=Bn(),y1e=Nt(),S1e=Xe(),Vte=Bn(),Gte=Z("net"),E1e=$u(),v1e="pick_first";function tS(t){y1e.trace(S1e.LogVerbosity.DEBUG,v1e,t)}var rS="pick_first",b1e=250,Fp=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return rS}toJsonObject(){return{[rS]:{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)}};Es.PickFirstLoadBalancingConfig=Fp;var F1=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Wc.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function Hte(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 T1e(t){if(t.length===0)return[];let e=[],r=[],n=[],i=(0,Vte.isTcpSubchannelAddress)(t[0])&&(0,Gte.isIPv6)(t[0].host);for(let a of t)(0,Vte.isTcpSubchannelAddress)(a)&&(0,Gte.isIPv6)(a.host)?r.push(a):n.push(a);let o=i?r:n,s=i?n:r;for(let a=0;a<Math.max(o.length,s.length);a++)a<o.length&&e.push(o[a]),a<s.length&&e.push(s[a]);return e}var Wte="grpc-node.internal.pick-first.report_health_status",nS=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=nr.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,n,i,o,s)=>{this.onSubchannelStateUpdate(r,n,i,s)},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(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.READY,new F1(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(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(nr.ConnectivityState.IDLE,new Wc.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.CONNECTING,new Wc.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 o;if(!((o=this.currentPick)===null||o===void 0)&&o.realSubchannelEquals(e)){n!==nr.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[s,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===nr.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===nr.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),s===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(s+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===nr.ConnectivityState.IDLE||i===nr.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===nr.ConnectivityState.IDLE&&(tS("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)},b1e),(n=(r=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(r)}pickSubchannel(e){tS("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){tS(nr.ConnectivityState[this.currentState]+" -> "+nr.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){tS("connectToAddressList(["+e.map(i=>(0,qte.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,r),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===nr.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()===nr.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,n,i){if(!(r instanceof Fp))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker(e.error),e.error.details),!0;let o=e.value;this.reportHealthStatus=n[Wte],r.getShuffleAddressList()&&(o=Hte(o));let s=[].concat(...o.map(c=>c.addresses));tS("updateAddressList(["+s.map(c=>(0,qte.subchannelAddressToString)(c))+"])");let a=T1e(s);return this.latestAddressList=a,this.latestOptions=n,this.connectToAddressList(a,n),this.latestResolutionNote=i,s.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===nr.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return rS}};Es.PickFirstLoadBalancer=nS;var w1e=new Fp(!1),z1=class{constructor(e,r,n,i){this.endpoint=e,this.options=n,this.resolutionNote=i,this.latestState=nr.ConnectivityState.IDLE;let o=(0,U1.createChildChannelControlHelper)(r,{updateState:(s,a,c)=>{this.latestState=s,this.latestPicker=a,r.updateState(s,a,c)}});this.pickFirstBalancer=new nS(o),this.latestPicker=new Wc.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,E1e.statusOrFromValue)([this.endpoint]),w1e,Object.assign(Object.assign({},this.options),{[Wte]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==nr.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};Es.LeafLoadBalancer=z1;function x1e(){(0,U1.registerLoadBalancerType)(rS,nS,Fp),(0,U1.registerDefaultLoadBalancerType)(rS)}});var Yte=y(eR=>{"use strict";Object.defineProperty(eR,"__esModule",{value:!0});eR.FileWatcherCertificateProvider=void 0;var A1e=Z("fs"),R1e=Nt(),C1e=Xe(),I1e=Z("util"),P1e="certificate_provider";function QA(t){R1e.trace(C1e.LogVerbosity.DEBUG,P1e,t)}var j1=(0,I1e.promisify)(A1e.readFile),B1=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");QA("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?j1(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?j1(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?j1(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,n])=>{if(this.refreshTimer){QA("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)}}),QA("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),QA("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()}};eR.FileWatcherCertificateProvider=B1});var G1=y(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=Se.createCertificateProviderChannelCredentials=Se.FileWatcherCertificateProvider=Se.createCertificateProviderServerCredentials=Se.createServerCredentialsWithInterceptors=Se.BaseSubchannelWrapper=Se.registerAdminService=Se.FilterStackFactory=Se.BaseFilter=Se.statusOrFromError=Se.statusOrFromValue=Se.PickResultType=Se.QueuePicker=Se.UnavailablePicker=Se.ChildLoadBalancerHandler=Se.EndpointMap=Se.endpointHasAddress=Se.endpointToString=Se.subchannelAddressToString=Se.LeafLoadBalancer=Se.isLoadBalancerNameRegistered=Se.parseLoadBalancingConfig=Se.selectLbConfigFromList=Se.registerLoadBalancerType=Se.createChildChannelControlHelper=Se.BackoffTimeout=Se.parseDuration=Se.durationToMs=Se.splitHostPort=Se.uriToString=Se.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=Se.createResolver=Se.registerResolver=Se.log=Se.trace=void 0;var Kte=Nt();Object.defineProperty(Se,"trace",{enumerable:!0,get:function(){return Kte.trace}});Object.defineProperty(Se,"log",{enumerable:!0,get:function(){return Kte.log}});var q1=fo();Object.defineProperty(Se,"registerResolver",{enumerable:!0,get:function(){return q1.registerResolver}});Object.defineProperty(Se,"createResolver",{enumerable:!0,get:function(){return q1.createResolver}});Object.defineProperty(Se,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return q1.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var Zte=xn();Object.defineProperty(Se,"uriToString",{enumerable:!0,get:function(){return Zte.uriToString}});Object.defineProperty(Se,"splitHostPort",{enumerable:!0,get:function(){return Zte.splitHostPort}});var Jte=eS();Object.defineProperty(Se,"durationToMs",{enumerable:!0,get:function(){return Jte.durationToMs}});Object.defineProperty(Se,"parseDuration",{enumerable:!0,get:function(){return Jte.parseDuration}});var O1e=cp();Object.defineProperty(Se,"BackoffTimeout",{enumerable:!0,get:function(){return O1e.BackoffTimeout}});var oS=Pc();Object.defineProperty(Se,"createChildChannelControlHelper",{enumerable:!0,get:function(){return oS.createChildChannelControlHelper}});Object.defineProperty(Se,"registerLoadBalancerType",{enumerable:!0,get:function(){return oS.registerLoadBalancerType}});Object.defineProperty(Se,"selectLbConfigFromList",{enumerable:!0,get:function(){return oS.selectLbConfigFromList}});Object.defineProperty(Se,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return oS.parseLoadBalancingConfig}});Object.defineProperty(Se,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return oS.isLoadBalancerNameRegistered}});var N1e=iS();Object.defineProperty(Se,"LeafLoadBalancer",{enumerable:!0,get:function(){return N1e.LeafLoadBalancer}});var tR=Bn();Object.defineProperty(Se,"subchannelAddressToString",{enumerable:!0,get:function(){return tR.subchannelAddressToString}});Object.defineProperty(Se,"endpointToString",{enumerable:!0,get:function(){return tR.endpointToString}});Object.defineProperty(Se,"endpointHasAddress",{enumerable:!0,get:function(){return tR.endpointHasAddress}});Object.defineProperty(Se,"EndpointMap",{enumerable:!0,get:function(){return tR.EndpointMap}});var k1e=Rx();Object.defineProperty(Se,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return k1e.ChildLoadBalancerHandler}});var V1=fa();Object.defineProperty(Se,"UnavailablePicker",{enumerable:!0,get:function(){return V1.UnavailablePicker}});Object.defineProperty(Se,"QueuePicker",{enumerable:!0,get:function(){return V1.QueuePicker}});Object.defineProperty(Se,"PickResultType",{enumerable:!0,get:function(){return V1.PickResultType}});var Xte=$u();Object.defineProperty(Se,"statusOrFromValue",{enumerable:!0,get:function(){return Xte.statusOrFromValue}});Object.defineProperty(Se,"statusOrFromError",{enumerable:!0,get:function(){return Xte.statusOrFromError}});var M1e=SL();Object.defineProperty(Se,"BaseFilter",{enumerable:!0,get:function(){return M1e.BaseFilter}});var $1e=wA();Object.defineProperty(Se,"FilterStackFactory",{enumerable:!0,get:function(){return $1e.FilterStackFactory}});var D1e=Ox();Object.defineProperty(Se,"registerAdminService",{enumerable:!0,get:function(){return D1e.registerAdminService}});var L1e=Xy();Object.defineProperty(Se,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return L1e.BaseSubchannelWrapper}});var Qte=GA();Object.defineProperty(Se,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return Qte.createServerCredentialsWithInterceptors}});Object.defineProperty(Se,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return Qte.createCertificateProviderServerCredentials}});var U1e=Yte();Object.defineProperty(Se,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return U1e.FileWatcherCertificateProvider}});var F1e=ap();Object.defineProperty(Se,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return F1e.createCertificateProviderChannelCredentials}});var z1e=a1();Object.defineProperty(Se,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return z1e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var ere=y(W1=>{"use strict";Object.defineProperty(W1,"__esModule",{value:!0});W1.setup=q1e;var j1e=fo(),B1e=$u(),H1=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,B1e.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function q1e(){(0,j1e.registerResolver)("unix",H1)}});var sre=y(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});J1.setup=Y1e;var tre=Z("net"),rre=$u(),rR=Xe(),Y1=Ar(),nre=fo(),V1e=Bn(),ire=xn(),G1e=Nt(),H1e="ip_resolver";function ore(t){G1e.trace(rR.LogVerbosity.DEBUG,H1e,t)}var K1="ipv4",Z1="ipv6",W1e=443,nR=class{constructor(e,r,n){var i;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,ore("Resolver constructed for target "+(0,ire.uriToString)(e));let o=[];if(!(e.scheme===K1||e.scheme===Z1)){this.error={code:rR.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new Y1.Metadata};return}let s=e.path.split(",");for(let a of s){let c=(0,ire.splitHostPort)(a);if(c===null){this.error={code:rR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new Y1.Metadata};return}if(e.scheme===K1&&!(0,tre.isIPv4)(c.host)||e.scheme===Z1&&!(0,tre.isIPv6)(c.host)){this.error={code:rR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new Y1.Metadata};return}o.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:W1e})}this.endpoints=o.map(a=>({addresses:[a]})),ore("Parsed "+e.scheme+" address list "+o.map(V1e.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,rre.statusOrFromError)(this.error),{},null,""):this.listener((0,rre.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function Y1e(){(0,nre.registerResolver)(K1,nR),(0,nre.registerResolver)(Z1,nR)}});var ure=y(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.RoundRobinLoadBalancer=void 0;aS.setup=eUe;var lre=Pc(),Vr=An(),sS=fa(),K1e=Nt(),Z1e=Xe(),are=Bn(),J1e=iS(),X1e="round_robin";function cre(t){K1e.trace(Z1e.LogVerbosity.DEBUG,X1e,t)}var iR="round_robin",oR=class t{getLoadBalancerName(){return iR}constructor(){}toJsonObject(){return{[iR]:{}}}static createFromJson(e){return new t}},X1=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 Q1e(t,e){return[...t.slice(e),...t.slice(0,e)]}var sR=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Vr.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,lre.createChildChannelControlHelper)(e,{updateState:(r,n,i)=>{this.currentState===Vr.ConnectivityState.READY&&r!==Vr.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(Vr.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===Vr.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(i=>(0,are.endpointEqual)(i.getEndpoint(),n)),r<0&&(r=0)}this.updateState(Vr.ConnectivityState.READY,new X1(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),r),null)}else if(this.countChildrenWithState(Vr.ConnectivityState.CONNECTING)>0)this.updateState(Vr.ConnectivityState.CONNECTING,new sS.QueuePicker(this),null);else if(this.countChildrenWithState(Vr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new sS.UnavailablePicker({details:e}),e)}else this.updateState(Vr.ConnectivityState.IDLE,new sS.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===Vr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){cre(Vr.ConnectivityState[this.currentState]+" -> "+Vr.ConnectivityState[e]),e===Vr.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 oR))return!1;if(!e.ok)return this.children.length===0&&this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new sS.UnavailablePicker(e.error),e.error.details),!0;let o=Math.random()*e.value.length|0,s=Q1e(e.value,o);if(this.resetSubchannelList(),s.length===0){let a=`No addresses resolved. Resolution note: ${i}`;this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new sS.UnavailablePicker({details:a}),a)}cre("Connect to endpoint list "+s.map(are.endpointToString)),this.updatesPaused=!0,this.children=s.map(a=>new J1e.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 iR}};aS.RoundRobinLoadBalancer=sR;function eUe(){(0,lre.registerLoadBalancerType)(iR,sR,oR)}});var pre=y(td=>{"use strict";var Q1;Object.defineProperty(td,"__esModule",{value:!0});td.OutlierDetectionLoadBalancer=td.OutlierDetectionLoadBalancingConfig=void 0;td.setup=dUe;var tUe=An(),dre=Xe(),ed=eS(),fre=G1(),rUe=Pc(),nUe=Rx(),iUe=fa(),eU=Bn(),oUe=Xy(),sUe=Nt(),aUe="outlier_detection";function Pr(t){sUe.trace(dre.LogVerbosity.DEBUG,aUe,t)}var sU="outlier_detection",cUe=((Q1=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&Q1!==void 0?Q1:"true")==="true",lUe={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},uUe={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function zp(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 tU(t,e,r){let n=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,ed.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 aR(t,e,r){let n=r?`${r}.${e}`:e;if(zp(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 cS=class t{constructor(e,r,n,i,o,s,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=o?Object.assign(Object.assign({},lUe),o):null,this.failurePercentageEjection=s?Object.assign(Object.assign({},uUe),s):null}getLoadBalancerName(){return sU}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,ed.msToDuration)(this.intervalMs),base_ejection_time:(0,ed.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,ed.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(tU(e,"interval"),tU(e,"base_ejection_time"),tU(e,"max_ejection_time"),aR(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");zp(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),aR(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),zp(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),zp(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");aR(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),aR(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),zp(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),zp(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,rUe.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,ed.durationToMs)(e.interval):null,e.base_ejection_time?(0,ed.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,ed.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)}};td.OutlierDetectionLoadBalancingConfig=cS;var nU=class extends oUe.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 rU(){return{success:0,failure:0}}var iU=class{constructor(){this.activeBucket=rU(),this.inactiveBucket=rU()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=rU()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},oU=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===iUe.PickResultType.COMPLETE){let n=r.subchannel,i=n.getMapEntry();if(i){let o=r.onCallEnded;return this.countCalls&&(o=(s,a,c)=>{var l;s===dre.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(l=r.onCallEnded)===null||l===void 0||l.call(r,s,a,c)}),Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel(),onCallEnded:o})}else return Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel()})}else return r}},cR=class{constructor(e){this.entryMap=new eU.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new nUe.ChildLoadBalancerHandler((0,fre.createChildChannelControlHelper)(e,{createSubchannel:(r,n)=>{let i=e.createSubchannel(r,n),o=this.entryMap.getForSubchannelAddress(r),s=new nU(i,o);return o?.currentEjectionTimestamp!==null&&s.eject(),o?.subchannelWrappers.push(s),s},updateState:(r,n,i)=>{r===tUe.ConnectivityState.READY?e.updateState(r,new oU(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;Pr("Running success rate check");let n=r.request_volume,i=0,o=[];for(let[d,f]of this.entryMap.entries()){let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();Pr("Stats for "+(0,eU.endpointToString)(d)+": successes="+p+" failures="+h+" targetRequestVolume="+n),p+h>=n&&(i+=1,o.push(p/(p+h)))}if(Pr("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+o+"]"),i<r.minimum_hosts)return;let s=o.reduce((d,f)=>d+f)/o.length,a=0;for(let d of o){let f=d-s;a+=f*f}let c=a/o.length,l=Math.sqrt(c),u=s-l*(r.stdev_factor/1e3);Pr("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(Pr("Checking candidate "+d+" successRate="+m),m<u){let g=Math.random()*100;Pr("Candidate "+d+" randomNumber="+g+" enforcement_percentage="+r.enforcement_percentage),g<r.enforcement_percentage&&(Pr("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;Pr("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let n=0;for(let i of this.entryMap.values()){let o=i.counter.getLastSuccesses(),s=i.counter.getLastFailures();o+s>=r.request_volume&&(n+=1)}if(!(n<r.minimum_hosts))for(let[i,o]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let s=o.counter.getLastSuccesses(),a=o.counter.getLastFailures();if(Pr("Candidate successes="+s+" failures="+a),s+a<r.request_volume)continue;if(a*100/(a+s)>r.threshold){let l=Math.random()*100;Pr("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+r.enforcement_percentage),l<r.enforcement_percentage&&(Pr("Ejecting candidate "+i),this.eject(o,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(Pr("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(),o=this.latestConfig.getMaxEjectionTimeMs(),s=new Date(n.currentEjectionTimestamp.getTime());s.setMilliseconds(s.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,o))),s<new Date&&(Pr("Unejecting "+r),this.uneject(n))}}}updateAddressList(e,r,n,i){if(!(r instanceof cS))return!1;if(Pr("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let s of e.value)this.entryMap.has(s)||(Pr("Adding map entry for "+(0,eU.endpointToString)(s)),this.entryMap.set(s,{counter:new iU,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let o=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,o,n,i),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){Pr("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let s=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(s)}else Pr("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{Pr("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let s of this.entryMap.values())this.uneject(s),s.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return sU}};td.OutlierDetectionLoadBalancer=cR;function dUe(){cUe&&(0,fre.registerLoadBalancerType)(sU,cR,cS)}});var hre=y(uR=>{"use strict";Object.defineProperty(uR,"__esModule",{value:!0});uR.PriorityQueue=void 0;var jp=0,aU=t=>Math.floor(t/2),lR=t=>t*2+1,lS=t=>t*2+2,cU=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[jp]}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>jp&&this.swap(jp,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[jp]=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>jp&&this.greater(e,aU(e));)this.swap(e,aU(e)),e=aU(e)}siftDown(){let e=jp;for(;lR(e)<this.size()&&this.greater(lR(e),e)||lS(e)<this.size()&&this.greater(lS(e),e);){let r=lS(e)<this.size()&&this.greater(lS(e),lR(e))?lS(e):lR(e);this.swap(e,r),e=r}}};uR.PriorityQueue=cU});var Sre=y(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});dS.WeightedRoundRobinLoadBalancingConfig=void 0;dS.setup=bUe;var Or=An(),fUe=Xe(),mi=eS(),_re=Pc(),pUe=iS(),hUe=Nt(),yre=WA(),Bp=fa(),mUe=hre(),mre=Bn(),gUe="weighted_round_robin";function lU(t){hUe.trace(fUe.LogVerbosity.DEBUG,gUe,t)}var fU="weighted_round_robin",_Ue=1e4,yUe=1e4,SUe=3*6e4,EUe=1e3,vUe=1;function gre(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 dR(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,mi.isDuration)(t[e]))r=t[e];else if((0,mi.isDurationMessage)(t[e]))r=(0,mi.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let n=(0,mi.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,mi.durationToMs)(r)}return null}var uS=class t{constructor(e,r,n,i,o,s){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??_Ue,this.blackoutPeriodMs=n??yUe,this.weightExpirationPeriodMs=i??SUe,this.weightUpdatePeriodMs=Math.max(o??EUe,100),this.errorUtilizationPenalty=s??vUe}getLoadBalancerName(){return fU}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,mi.durationToString)((0,mi.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,mi.durationToString)((0,mi.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,mi.durationToString)((0,mi.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,mi.durationToString)((0,mi.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if(gre(e,"enable_oob_load_report","boolean"),gre(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,dR(e,"oob_load_reporting_period"),dR(e,"blackout_period"),dR(e,"weight_expiration_period"),dR(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}};dS.WeightedRoundRobinLoadBalancingConfig=uS;var uU=class{constructor(e,r){this.metricsHandler=r,this.queue=new mUe.PriorityQueue((o,s)=>o.deadline<s.deadline);let n=e.filter(o=>o.weight>0),i;if(n.length<2)i=1;else{let o=0;for(let{weight:s}of n)o+=s;i=o/n.length}for(let o of e){let s=o.weight>0?1/o.weight:i;this.queue.push({endpointName:o.endpointName,picker:o.picker,period:s,deadline:Math.random()*s})}}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===Bp.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,yre.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}},dU=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=Or.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 o=r.rps_fractional,s=r.application_utilization;s>0&&o>0&&(s+=r.eps/o*((i=(n=this.latestConfig)===null||n===void 0?void 0:n.getErrorUtilizationPenalty())!==null&&i!==void 0?i:0));let a=s===0?0:o/s;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(Or.ConnectivityState.READY)>0){let e=[];for(let[n,i]of this.children)i.child.getConnectivityState()===Or.ConnectivityState.READY&&e.push({endpointName:n,picker:i.child.getPicker(),weight:this.getWeight(i)});lU("Created picker with weights: "+e.map(n=>n.endpointName+":"+n.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(n,i)=>{let o=this.children.get(i);o&&this.updateWeight(o,n)},this.updateState(Or.ConnectivityState.READY,new uU(e,r),null)}else if(this.countChildrenWithState(Or.ConnectivityState.CONNECTING)>0)this.updateState(Or.ConnectivityState.CONNECTING,new Bp.QueuePicker(this),null);else if(this.countChildrenWithState(Or.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Or.ConnectivityState.TRANSIENT_FAILURE,new Bp.UnavailablePicker({details:e}),e)}else this.updateState(Or.ConnectivityState.IDLE,new Bp.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===Or.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){lU(Or.ConnectivityState[this.currentState]+" -> "+Or.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}updateAddressList(e,r,n,i){var o,s;if(!(r instanceof uS))return!1;if(!e.ok)return this.children.size===0&&this.updateState(Or.ConnectivityState.TRANSIENT_FAILURE,new Bp.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let l=`No addresses resolved. Resolution note: ${i}`;return this.updateState(Or.ConnectivityState.TRANSIENT_FAILURE,new Bp.UnavailablePicker({details:l}),l),!1}lU("Connect to endpoint list "+e.value.map(mre.endpointToString));let a=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let l of e.value){let u=(0,mre.endpointToString)(l);c.add(u);let d=this.children.get(u);d||(d={child:new pUe.LeafLoadBalancer(l,(0,_re.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(f,p,h)=>{this.currentState===Or.ConnectivityState.READY&&f!==Or.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),f===Or.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 yre.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=(s=(o=setInterval(()=>{this.currentState===Or.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||s===void 0?void 0:s.call(o),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return fU}};function bUe(){(0,_re.registerLoadBalancerType)(fU,dU,uS)}});var fS=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.experimental=_e.ServerMetricRecorder=_e.ServerInterceptingCall=_e.ResponderBuilder=_e.ServerListenerBuilder=_e.addAdminServicesToServer=_e.getChannelzHandlers=_e.getChannelzServiceDefinition=_e.InterceptorConfigurationError=_e.InterceptingCall=_e.RequesterBuilder=_e.ListenerBuilder=_e.StatusBuilder=_e.getClientChannel=_e.ServerCredentials=_e.Server=_e.setLogVerbosity=_e.setLogger=_e.load=_e.loadObject=_e.CallCredentials=_e.ChannelCredentials=_e.waitForClientReady=_e.closeClient=_e.Channel=_e.makeGenericClientConstructor=_e.makeClientConstructor=_e.loadPackageDefinition=_e.Client=_e.compressionAlgorithms=_e.propagate=_e.connectivityState=_e.status=_e.logVerbosity=_e.Metadata=_e.credentials=void 0;var fR=gx();Object.defineProperty(_e,"CallCredentials",{enumerable:!0,get:function(){return fR.CallCredentials}});var TUe=eD();Object.defineProperty(_e,"Channel",{enumerable:!0,get:function(){return TUe.ChannelImplementation}});var wUe=_L();Object.defineProperty(_e,"compressionAlgorithms",{enumerable:!0,get:function(){return wUe.CompressionAlgorithms}});var xUe=An();Object.defineProperty(_e,"connectivityState",{enumerable:!0,get:function(){return xUe.ConnectivityState}});var pR=ap();Object.defineProperty(_e,"ChannelCredentials",{enumerable:!0,get:function(){return pR.ChannelCredentials}});var Ere=Q$();Object.defineProperty(_e,"Client",{enumerable:!0,get:function(){return Ere.Client}});var pU=Xe();Object.defineProperty(_e,"logVerbosity",{enumerable:!0,get:function(){return pU.LogVerbosity}});Object.defineProperty(_e,"status",{enumerable:!0,get:function(){return pU.Status}});Object.defineProperty(_e,"propagate",{enumerable:!0,get:function(){return pU.Propagate}});var vre=Nt(),hU=Dx();Object.defineProperty(_e,"loadPackageDefinition",{enumerable:!0,get:function(){return hU.loadPackageDefinition}});Object.defineProperty(_e,"makeClientConstructor",{enumerable:!0,get:function(){return hU.makeClientConstructor}});Object.defineProperty(_e,"makeGenericClientConstructor",{enumerable:!0,get:function(){return hU.makeClientConstructor}});var AUe=Ar();Object.defineProperty(_e,"Metadata",{enumerable:!0,get:function(){return AUe.Metadata}});var RUe=jte();Object.defineProperty(_e,"Server",{enumerable:!0,get:function(){return RUe.Server}});var CUe=GA();Object.defineProperty(_e,"ServerCredentials",{enumerable:!0,get:function(){return CUe.ServerCredentials}});var IUe=Bte();Object.defineProperty(_e,"StatusBuilder",{enumerable:!0,get:function(){return IUe.StatusBuilder}});_e.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),combineCallCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),createInsecure:pR.ChannelCredentials.createInsecure,createSsl:pR.ChannelCredentials.createSsl,createFromSecureContext:pR.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:fR.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:fR.CallCredentials.createFromGoogleCredential,createEmpty:fR.CallCredentials.createEmpty};var PUe=t=>t.close();_e.closeClient=PUe;var OUe=(t,e,r)=>t.waitForReady(e,r);_e.waitForClientReady=OUe;var NUe=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.loadObject=NUe;var kUe=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.load=kUe;var MUe=t=>{vre.setLogger(t)};_e.setLogger=MUe;var $Ue=t=>{vre.setLoggerVerbosity(t)};_e.setLogVerbosity=$Ue;var DUe=t=>Ere.Client.prototype.getChannel.call(t);_e.getClientChannel=DUe;var hR=Z$();Object.defineProperty(_e,"ListenerBuilder",{enumerable:!0,get:function(){return hR.ListenerBuilder}});Object.defineProperty(_e,"RequesterBuilder",{enumerable:!0,get:function(){return hR.RequesterBuilder}});Object.defineProperty(_e,"InterceptingCall",{enumerable:!0,get:function(){return hR.InterceptingCall}});Object.defineProperty(_e,"InterceptorConfigurationError",{enumerable:!0,get:function(){return hR.InterceptorConfigurationError}});var bre=zc();Object.defineProperty(_e,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return bre.getChannelzServiceDefinition}});Object.defineProperty(_e,"getChannelzHandlers",{enumerable:!0,get:function(){return bre.getChannelzHandlers}});var LUe=Ox();Object.defineProperty(_e,"addAdminServicesToServer",{enumerable:!0,get:function(){return LUe.addAdminServicesToServer}});var mU=k1();Object.defineProperty(_e,"ServerListenerBuilder",{enumerable:!0,get:function(){return mU.ServerListenerBuilder}});Object.defineProperty(_e,"ResponderBuilder",{enumerable:!0,get:function(){return mU.ResponderBuilder}});Object.defineProperty(_e,"ServerInterceptingCall",{enumerable:!0,get:function(){return mU.ServerInterceptingCall}});var UUe=WA();Object.defineProperty(_e,"ServerMetricRecorder",{enumerable:!0,get:function(){return UUe.ServerMetricRecorder}});var FUe=G1();_e.experimental=FUe;var zUe=DL(),jUe=ere(),BUe=sre(),qUe=iS(),VUe=ure(),GUe=pre(),HUe=Sre(),WUe=zc();zUe.setup(),jUe.setup(),BUe.setup(),qUe.setup(),VUe.setup(),GUe.setup(),HUe.setup(),WUe.setup()});var Tre=y(mR=>{"use strict";Object.defineProperty(mR,"__esModule",{value:!0});mR.createServiceClientConstructor=void 0;var YUe=fS();function KUe(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:n=>n,requestDeserialize:n=>n,responseSerialize:n=>n,responseDeserialize:n=>n}};return YUe.makeGenericClientConstructor(r,e)}mR.createServiceClientConstructor=KUe});var pS=y(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.createOtlpGrpcExporterTransport=Vi.GrpcExporterTransport=Vi.createEmptyMetadata=Vi.createSslCredentials=Vi.createInsecureCredentials=void 0;var ZUe=gX(),wre=`OTel-OTLP-Exporter-JavaScript/${ZUe.VERSION}`;function JUe(t){return t?`${t} ${wre}`:wre}var XUe=0,QUe=2;function eFe(t){return t==="gzip"?QUe:XUe}function tFe(){let{credentials:t}=fS();return t.createInsecure()}Vi.createInsecureCredentials=tFe;function rFe(t,e,r){let{credentials:n}=fS();return n.createSsl(t,e,r)}Vi.createSslCredentials=rFe;function nFe(){let{Metadata:t}=fS();return new t}Vi.createEmptyMetadata=nFe;var gR=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}=Tre();try{this._metadata=this._parameters.metadata()}catch(s){return Promise.resolve({status:"failure",error:s})}let o=i(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new o(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":eFe(this._parameters.compression),"grpc.primary_user_agent":JUe(this._parameters.userAgent)})}catch(s){return Promise.resolve({status:"failure",error:s})}}return new Promise(i=>{let o=Date.now()+r;if(this._metadata==null)return i({error:new Error("metadata was null"),status:"failure"});this._client.export(n,this._metadata,{deadline:o},(s,a)=>{i(s?{status:"failure",error:s}:{data:a,status:"success"})})})}};Vi.GrpcExporterTransport=gR;function iFe(t){return new gR(t)}Vi.createOtlpGrpcExporterTransport=iFe});var Ire=y(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.getOtlpGrpcDefaultConfiguration=Yc.mergeOtlpGrpcConfigurationWithDefaults=Yc.validateAndNormalizeUrl=void 0;var Rre=(lx(),bn(cx)),hS=pS(),oFe=Z("url"),xre=(ve(),bn(vc));function Cre(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new oFe.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&xre.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?:$/)&&xre.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}Yc.validateAndNormalizeUrl=Cre;function Are(t,e){for(let[r,n]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,n)}function sFe(t,e,r){let n=t.url??e.url??r.url;return{...(0,Rre.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let i=r.metadata();return Are(i,t.metadata?.().clone()??(0,hS.createEmptyMetadata)()),Are(i,e.metadata?.()??(0,hS.createEmptyMetadata)()),i},url:Cre(n),credentials:t.credentials??e.credentials?.(n)??r.credentials(n),userAgent:t.userAgent}}Yc.mergeOtlpGrpcConfigurationWithDefaults=sFe;function aFe(){return{...(0,Rre.getSharedConfigurationDefaults)(),metadata:()=>(0,hS.createEmptyMetadata)(),url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,hS.createInsecureCredentials)():()=>(0,hS.createSslCredentials)()}}Yc.getOtlpGrpcDefaultConfiguration=aFe});function Pre(t){let e={};return Object.entries(t??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):J.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}var Ore=R(()=>{"use strict";ve()});function cFe(t,e,r){return async()=>{let n={...await r()},i={};return e!=null&&Object.assign(i,await e()),t!=null&&Object.assign(i,Pre(await t())),Object.assign(i,n)}}function lFe(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 Nre(t,e,r){return{...Lw(t,e,r),headers:cFe(t.headers,e.headers,r.headers),url:lFe(t.url)??e.url??r.url}}function kre(t,e){return{...Uw(),headers:async()=>t,url:"http://localhost:4318/"+e}}var Mre=R(()=>{"use strict";ay();Ore()});function rd(t){return async e=>{let r=e==="http:",n=r?import("http"):import("https"),{Agent:i}=await n;if(r){let{ca:o,cert:s,key:a,...c}=t;return new i(c)}return new i(t)}}function $re(t,e,r){return{...Nre(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory,userAgent:t.userAgent}}function Dre(t,e){return{...kre(t,e),agentFactory:rd({keepAlive:!0})}}var _R=R(()=>{"use strict";Mre()});function gU(t){return t===429||t===502||t===503||t===504}function _U(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 Lre=R(()=>{"use strict"});var Ure,Fre=R(()=>{"use strict";Ure="0.218.0"});import*as Bre from"zlib";import{Readable as uFe}from"stream";function qre(t,e,r,n,i,o,s,a){return new Promise(c=>{let l=new URL(e);i?r["User-Agent"]=`${i} ${zre}`:r["User-Agent"]=zre;let d=t(l,{method:"POST",headers:r,agent:o},f=>{let p=[],h=0;f.on("data",m=>{if(h+=m.length,h>jre){let g=new Error(`OTLP export response body exceeded size limit of ${jre} bytes`);c({status:"failure",error:g}),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&&gU(f.statusCode))c({status:"retryable",retryInMillis:_U(f.headers["retry-after"])});else{let m=new ua(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&&gU(f.statusCode)?c({status:"retryable",error:m,retryInMillis:_U(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=>{pFe(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),dFe(d,n,s,f=>{c({status:"failure",error:f})})})}function dFe(t,e,r,n){let i=fFe(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),i=i.on("error",n).pipe(Bre.createGzip()).on("error",n)),i.pipe(t).on("error",n)}function fFe(t){let e=new uFe;return e.push(t),e.push(null),e}function pFe(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 zre,jre,Vre=R(()=>{"use strict";Lre();$w();Fre();zre=`OTel-OTLP-Exporter-JavaScript/${Ure}`,jre=4*1024*1024});async function hFe(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function Gre(t){return new yU(t)}var yU,Hre=R(()=>{"use strict";Vre();yU=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,r){let{agent:n,request:i}=await this._loadUtils(),o=await this._parameters.headers();return qre(i,this._parameters.url,o,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),hFe(r)]);e=this._utils={agent:n,request:i}}return e}}});function yFe(){return Math.random()*(2*Wre)-Wre}function Yre(t){return new EU(t.transport)}var SU,mFe,gFe,_Fe,Wre,EU,Kre=R(()=>{"use strict";ve();SU=5,mFe=1e3,gFe=5e3,_Fe=1.5,Wre=.2;EU=class{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,o)=>{setTimeout(()=>{this._transport.send(e,r).then(i,o)},n)})}async send(e,r){let n=SU,i=mFe,o=Date.now()+r,s=await this._transport.send(e,r);for(;s.status==="retryable"&&n>0;){n--;let a=Math.max(Math.min(i*(1+yFe()),gFe),0);i=i*_Fe;let c=s.retryInMillis??a,l=o-Date.now();if(c>l)return J.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),s;J.verbose(`Scheduling export retry in ${Math.round(c)}ms`),s=await this.retry(e,l,c)}return s.status==="success"?J.verbose(`Export succeeded after ${SU-n} retry attempts.`):s.status==="retryable"?J.info(`Export failed after maximum retry attempts (${SU}).`):J.info(`Export failed with non-retryable error: ${s.error}`),s}shutdown(){return this._transport.shutdown()}}});function Zre(t,e){return ax({transport:Yre({transport:Gre(t)}),serializer:e,promiseHandler:zw(t)},{timeout:t.timeoutMillis})}var Jre=R(()=>{"use strict";l$();Hre();VM();Kre()});function Xre(t){let e=Qf(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;J.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function SFe(t){let e=Xre(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=Xre("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function Qre(t){let e=zn(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;J.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function EFe(t){let e=Qre(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=Qre("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function yR(t){return{timeoutMillis:SFe(t),compression:EFe(t)}}var vU=R(()=>{"use strict";rp();ve()});import*as ene from"fs";import*as tne from"path";function vFe(t){let e=zn(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=zn("OTEL_EXPORTER_OTLP_HEADERS"),n=Iu(e),i=Iu(r);if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return Object.assign({},Iu(r),Iu(e))}function bFe(t){try{return new URL(t).toString()}catch{J.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function TFe(t,e){try{new URL(t)}catch{J.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{J.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function wFe(t){let e=zn("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return TFe(e,t)}function xFe(t){let e=zn(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return bFe(e)}function bU(t,e,r){let n=zn(t),i=zn(e),o=n??i;if(o!=null)try{return ene.readFileSync(tne.resolve(process.cwd(),o))}catch{J.warn(r);return}else return}function AFe(t){return bU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function RFe(t){return bU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function CFe(t){return bU(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function rne(t,e){return{...yR(t),url:xFe(t)??wFe(e),headers:Dw(vFe(t)),agentFactory:rd({keepAlive:!0,ca:CFe(t),cert:AFe(t),key:RFe(t)})}}var nne=R(()=>{"use strict";rp();ve();vU();ay();_R()});function ine(t){return typeof t.headers=="function"?t.headers:Dw(t.headers)}var one=R(()=>{"use strict";ay()});function IFe(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 rd(e)}function sne(t,e,r,n){return t.metadata&&J.warn("Metadata cannot be set when using http"),$re({url:t.url,headers:ine(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:IFe(t),userAgent:t.userAgent},rne(e,r),Dre(n,r))}var ane=R(()=>{"use strict";ve();_R();TU();nne();one()});var cne={};zr(cne,{convertLegacyHttpOptions:()=>sne,createOtlpHttpExportDelegate:()=>Zre,getSharedConfigurationFromEnvironment:()=>yR,httpAgentFactoryFromOptions:()=>rd});var TU=R(()=>{"use strict";_R();Jre();vU();ane()});var pne=y(SR=>{"use strict";Object.defineProperty(SR,"__esModule",{value:!0});SR.getOtlpGrpcConfigurationFromEnv=void 0;var lne=(rp(),bn(dX)),mS=pS(),PFe=(TU(),bn(cne)),OFe=Z("fs"),NFe=Z("path"),dne=(ve(),bn(vc));function wU(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function kFe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),n=(0,lne.parseKeyPairsIntoRecord)(e),i=(0,lne.parseKeyPairsIntoRecord)(r);if(Object.keys(n).length===0&&Object.keys(i).length===0)return;let o=Object.assign({},i,n),s=(0,mS.createEmptyMetadata)();for(let[a,c]of Object.entries(o))s.set(a,c);return s}function MFe(t){let e=kFe(t);if(e!=null)return()=>e}function $Fe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return wU(e,r)}function DFe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return wU(e,r)==="true"}function xU(t,e,r){let n=process.env[t]?.trim(),i=process.env[e]?.trim(),o=wU(n,i);if(o!=null)try{return OFe.readFileSync(NFe.resolve(process.cwd(),o))}catch{dne.diag.warn(r);return}else return}function LFe(t){return xU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function UFe(t){return xU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function une(t){return xU(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function fne(t){let e=UFe(t),r=LFe(t),n=une(t),i=e!=null&&r!=null;return n!=null&&!i?(dne.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,mS.createSslCredentials)(une(t))):(0,mS.createSslCredentials)(n,e,r)}function FFe(t){return DFe(t)?(0,mS.createInsecureCredentials)():fne(t)}function zFe(t){return{...(0,PFe.getSharedConfigurationFromEnvironment)(t),metadata:MFe(t),url:$Fe(t),credentials:e=>e.startsWith("http://")?()=>(0,mS.createInsecureCredentials)():e.startsWith("https://")?()=>fne(t):()=>FFe(t)}}SR.getOtlpGrpcConfigurationFromEnv=zFe});var mne=y(ER=>{"use strict";Object.defineProperty(ER,"__esModule",{value:!0});ER.convertLegacyOtlpGrpcOptions=void 0;var hne=Ire(),jFe=pS(),BFe=pne();function qFe(t,e){let r=t.credentials;return(0,hne.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,jFe.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0,userAgent:t.userAgent},(0,BFe.getOtlpGrpcConfigurationFromEnv)(e),(0,hne.getOtlpGrpcDefaultConfiguration)())}ER.convertLegacyOtlpGrpcOptions=qFe});var gne=y(vR=>{"use strict";Object.defineProperty(vR,"__esModule",{value:!0});vR.createOtlpGrpcExportDelegate=void 0;var VFe=(lx(),bn(cx)),GFe=pS();function HFe(t,e,r,n){return(0,VFe.createOtlpNetworkExportDelegate)(t,e,(0,GFe.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,userAgent:t.userAgent,grpcName:r,grpcPath:n}))}vR.createOtlpGrpcExportDelegate=HFe});var _ne=y(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.createOtlpGrpcExportDelegate=qp.convertLegacyOtlpGrpcOptions=void 0;var WFe=mne();Object.defineProperty(qp,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return WFe.convertLegacyOtlpGrpcOptions}});var YFe=gne();Object.defineProperty(qp,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return YFe.createOtlpGrpcExportDelegate}})});function xa(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 AU=R(()=>{"use strict"});var KFe,gS,Kc,bR=R(()=>{"use strict";ve();AU();KFe="ProtobufWriter: estimated size was too small, growing buffer.",gS=1,Kc=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;J.debug(KFe);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(gS),this.pos+=gS,e}finishLengthDelimited(e,r){let n=r>>>0,i=xa(n);if(i>gS){let s=i-gS;this._ensureCapacity(s),this._buffer.copyWithin(e+i,e+gS,this.pos),this.pos+=s}let o=e;n<128?this._buffer[o]=n:n<16384?(this._buffer[o++]=n&127|128,this._buffer[o]=n>>>7):n<2097152?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o]=n>>>14):n<268435456?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o]=n>>>21):(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o++]=n>>>21&127|128,this._buffer[o]=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(xa(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 yne(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Aa(t){let e=new Uint8Array(t.length/2),r=0;for(let n=0;n<t.length;n+=2){let i=yne(t.charCodeAt(n)),o=yne(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}var RU=R(()=>{"use strict"});var _S,Sne=R(()=>{"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"})(_S||(_S={}))});var yS,Ene,CU=R(()=>{"use strict";yS=class{emit(e){}enabled(){return!1}},Ene=new yS});function vne(t,e,r){return n=>n===t?e:r}var SS,Vp,IU,bne=R(()=>{"use strict";SS=Symbol.for("io.opentelemetry.js.api.logs"),Vp=globalThis;IU=1});var PU,TR,OU=R(()=>{"use strict";CU();PU=class{getLogger(e,r,n){return new yS}},TR=new PU});var wR,Tne=R(()=>{"use strict";CU();wR=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):Ene}}});var ES,wne=R(()=>{"use strict";OU();Tne();ES=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new wR(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:TR}_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 xR,xne=R(()=>{"use strict";bne();OU();wne();xR=class t{constructor(){this._proxyLoggerProvider=new ES}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Vp[SS]?this.getLoggerProvider():(Vp[SS]=vne(IU,e,TR),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Vp[SS])===null||e===void 0?void 0:e.call(Vp,IU))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Vp[SS],this._proxyLoggerProvider=new ES}}});var TCt,Ane=R(()=>{"use strict";Sne();xne();TCt=xR.getInstance()});function Gn(t,e){let r=e[0],n=e[1],i=1e9,o=r&65535,s=r/65536>>>0,a=o*i,c=s*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),g=u+f+m>>>0;t.writeFixed64(h,g)}function Ro(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 o=t.startLengthDelimited(),s=t.pos;ZFe(t,n,i),t.finishLengthDelimited(o,t.pos-s)}}function ZFe(t,e,r){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),i=t.pos;vS(t,r),t.finishLengthDelimited(n,t.pos-i)}function vS(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>=JFe&&n<XFe?(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 o of e){t.writeTag(1,2);let s=t.startLengthDelimited(),a=t.pos;vS(t,o),t.finishLengthDelimited(s,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,o=e;for(let s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;let a=o[s];t.writeTag(1,2);let c=t.startLengthDelimited(),l=t.pos;t.writeTag(1,2),t.writeString(s),t.writeTag(2,2);let u=t.startLengthDelimited(),d=t.pos;vS(t,a),t.finishLengthDelimited(u,t.pos-d),t.finishLengthDelimited(c,t.pos-l)}t.finishLengthDelimited(n,t.pos-i)}}function Gp(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 Hp(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;e.attributes&&Ro(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-i)}var JFe,XFe,AR=R(()=>{"use strict";JFe=-(2**63),XFe=2**63});function QFe(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 Zc,RR=R(()=>{"use strict";AU();Zc=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,r){this.pos+=xa(r)}writeVarint(e){this.pos+=xa(e)}writeSint32(e){this.pos+=xa((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+=xa(e.length),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this.pos+=8}writeString(e){let r=QFe(e);this.pos+=xa(r),this.pos+=r}}});function eze(t,e){let r=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),Gn(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==_S.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(),o=t.pos;vS(t,e.body),t.finishLengthDelimited(i,t.pos-o)}e.attributes&&Ro(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(Aa(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(Aa(e.spanContext.spanId))),t.writeTag(11,1),Gn(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(r,t.pos-n)}function tze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Gp(t,e,1);for(let o of r)t.writeTag(2,2),eze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Rne(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;tze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function rze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function Cne(t){let e=rze(t),r=new Zc;for(let[i,o]of e)r.writeTag(1,2),Rne(r,i,o);let n=new Kc(r.pos);for(let[i,o]of e)n.writeTag(1,2),Rne(n,i,o);return n.finish()}var Ine=R(()=>{"use strict";bR();RU();Ane();AR();RR()});var Co,CR=R(()=>{"use strict";Co=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 nze(t){let e=new Co(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 Pne(t){let e=new Co(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=nze(e.readBytes()):e.skip(i)}return r}var One=R(()=>{"use strict";CR()});var NU,Nne=R(()=>{"use strict";Ine();One();NU={serializeRequest:t=>Cne(t),deserializeResponse:t=>Pne(t)}});var kne=R(()=>{"use strict";Nne()});var Ra,Mne=R(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(Ra||(Ra={}))});var kU,gi,$ne=R(()=>{"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"})(kU||(kU={}));(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(gi||(gi={}))});var MU=R(()=>{"use strict";Mne();$ne()});function Une(t,e,r){let n=t.startLengthDelimited(),i=t.pos;t.writeTag(2,1),Gn(t,e.startTime),t.writeTag(3,1),Gn(t,e.endTime),r===ia.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&Ro(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-i)}function ize(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;if(t.writeTag(2,1),Gn(t,e.startTime),t.writeTag(3,1),Gn(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 o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.counts)t.writeFixed64(a>>>0,a/4294967296>>>0);t.finishLengthDelimited(o,t.pos-s)}if(i.buckets.boundaries.length>0){t.writeTag(7,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.boundaries)t.writeDouble(a);t.finishLengthDelimited(o,t.pos-s)}e.attributes&&Ro(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 Dne(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 o=t.startLengthDelimited(),s=t.pos;for(let a of r)t.writeVarint(a);t.finishLengthDelimited(o,t.pos-s)}t.finishLengthDelimited(n,t.pos-i)}function oze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;e.attributes&&Ro(t,e.attributes,1),t.writeTag(2,1),Gn(t,e.startTime),t.writeTag(3,1),Gn(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),Dne(t,i.positive.offset,i.positive.bucketCounts),t.writeTag(9,2),Dne(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 sze(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 gi.GAUGE:t.writeTag(5,2),aze(t,e);break;case gi.SUM:t.writeTag(7,2),cze(t,e);break;case gi.HISTOGRAM:t.writeTag(9,2),lze(t,e);break;case gi.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),uze(t,e);break;default:{let i=e}}t.finishLengthDelimited(r,t.pos-n)}function aze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let i of e.dataPoints)t.writeTag(1,2),Une(t,i,e.descriptor.valueType);t.finishLengthDelimited(r,t.pos-n)}function cze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),Une(t,o,e.descriptor.valueType);let i=$U(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 lze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),ize(t,o);let i=$U(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function uze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),oze(t,o);let i=$U(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function dze(t,e){let r=t.startLengthDelimited(),n=t.pos;Gp(t,e.scope,1);for(let i of e.metrics)t.writeTag(2,2),sze(t,i);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function Lne(t,e){let r=t.startLengthDelimited(),n=t.pos;Hp(t,e.resource,1);for(let i of e.scopeMetrics)t.writeTag(2,2),dze(t,i);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function $U(t){switch(t){case Ra.DELTA:return 1;case Ra.CUMULATIVE:return 2;default:return 0}}function Fne(t){let e=new Zc;e.writeTag(1,2),Lne(e,t);let r=new Kc(e.pos);return r.writeTag(1,2),Lne(r,t),r.finish()}var zne=R(()=>{"use strict";ve();MU();AR();RR();bR()});function fze(t){let e=new Co(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 jne(t){let e=new Co(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=fze(e.readBytes()):e.skip(i)}return r}var Bne=R(()=>{"use strict";CR()});var DU,qne=R(()=>{"use strict";zne();Bne();DU={serializeRequest:t=>Fne(t),deserializeResponse:t=>jne(t)}});var Vne=R(()=>{"use strict";qne()});function Hne(t,e){let r=t&255|pze;return e&&(r|=hze),r}function mze(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 gze(t,e){let r=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),Gn(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&Ro(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(r,t.pos-n)}function _ze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.context;t.writeTag(1,2),t.writeBytes(Aa(i.traceId)),t.writeTag(2,2),t.writeBytes(Aa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.attributes&&Ro(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let s=Hne(i.traceFlags,i.isRemote);s&&(t.writeTag(6,5),t.writeFixed32(s)),t.finishLengthDelimited(r,t.pos-n)}function yze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.spanContext();t.writeTag(1,2),t.writeBytes(Aa(i.traceId)),t.writeTag(2,2),t.writeBytes(Aa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(Aa(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let s=e.kind==null?0:e.kind+1;s!==0&&(t.writeTag(6,0),t.writeVarint(s)),t.writeTag(7,1),Gn(t,e.startTime),t.writeTag(8,1),Gn(t,e.endTime),e.attributes&&Ro(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),gze(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),_ze(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),mze(t,e.status);let a=Hne(i.traceFlags,e.parentSpanContext?.isRemote);a&&(t.writeTag(16,5),t.writeFixed32(a)),t.finishLengthDelimited(r,t.pos-n)}function Sze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Gp(t,e,1);for(let o of r)t.writeTag(2,2),yze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Gne(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;Sze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Eze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function Wne(t){let e=Eze(t),r=new Zc;for(let[i,o]of e)r.writeTag(1,2),Gne(r,i,o);let n=new Kc(r.pos);for(let[i,o]of e)n.writeTag(1,2),Gne(n,i,o);return n.finish()}var pze,hze,Yne=R(()=>{"use strict";bR();RU();AR();RR();pze=256,hze=512});function vze(t){let e=new Co(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 Kne(t){let e=new Co(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=vze(e.readBytes()):e.skip(i)}return r}var Zne=R(()=>{"use strict";CR()});var LU,Jne=R(()=>{"use strict";Yne();Zne();LU={serializeRequest:t=>Wne(t),deserializeResponse:t=>Kne(t)}});var Xne=R(()=>{"use strict";Jne()});function Wp(t,e){let r={attributes:Ca(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Yp(t){return{name:t.name,version:t.version}}function Ca(t,e){return Object.keys(t).map(r=>UU(r,t[r],e))}function UU(t,e,r){return{key:t,value:bS(e,r)}}function bS(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]=bS(t[i],e);return{arrayValue:{values:n}}}if(r==="object"&&t!=null){let n=Object.keys(t),i=new Array(n.length);for(let o=0;o<n.length;o++)i[o]={key:n[o],value:bS(t[n[o]],e)};return{kvlistValue:{values:i}}}return{}}var IR=R(()=>{"use strict"});function Qne(t,e){return{resourceLogs:Tze(t,e)}}function bze(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:s=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${o}:${s}`,l=a.get(c);l||(l=[],a.set(c,l)),l.push(r)}return e}function Tze(t,e){let r=bze(t);return Array.from(r,([n,i])=>{let o=Wp(n,e);return{resource:o,scopeLogs:Array.from(i,([,s])=>({scope:Yp(s[0].instrumentationScope),logRecords:s.map(a=>wze(a,e)),schemaUrl:s[0].instrumentationScope.schemaUrl})),schemaUrl:o.schemaUrl}})}function wze(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:bS(t.body,e),eventName:t.eventName,attributes:xze(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function xze(t,e){return Object.keys(t).map(r=>UU(r,t[r],e))}var eie=R(()=>{"use strict";IR()});function Aze(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Rze(t){return Aze(t).toString()}function tie(t){return t}var Cze,Kp,PR=R(()=>{"use strict";rp();Cze=typeof BigInt<"u"?Rze:Xw;Kp={encodeHrTime:Cze,encodeSpanContext:tie,encodeOptionalSpanContext:tie,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 FU,rie=R(()=>{"use strict";eie();PR();ve();FU={serializeRequest:t=>{let e=Qne(t,Kp);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 J.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}}});var nie=R(()=>{"use strict";rie()});var TS,iie=R(()=>{"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"})(TS||(TS={}))});function Ize(t,e){let r=Wp(t.resource,e);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:Pze(t.scopeMetrics,e)}}function Pze(t,e){return Array.from(t.map(r=>({scope:Yp(r.scope),metrics:r.metrics.map(n=>Oze(n,e)),schemaUrl:r.scope.schemaUrl})))}function Oze(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=$ze(t.aggregationTemporality);switch(t.dataPointType){case gi.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:oie(t,e)};break;case gi.GAUGE:r.gauge={dataPoints:oie(t,e)};break;case gi.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:kze(t,e)};break;case gi.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:Mze(t,e)};break}return r}function Nze(t,e,r){let n={attributes:Ca(t.attributes,r),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case ia.INT:n.asInt=t.value;break;case ia.DOUBLE:n.asDouble=t.value;break}return n}function oie(t,e){return t.dataPoints.map(r=>Nze(r,t.descriptor.valueType,e))}function kze(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Ca(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 Mze(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Ca(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 $ze(t){switch(t){case Ra.DELTA:return TS.AGGREGATION_TEMPORALITY_DELTA;case Ra.CUMULATIVE:return TS.AGGREGATION_TEMPORALITY_CUMULATIVE}}function sie(t,e){return{resourceMetrics:t.map(r=>Ize(r,e))}}var aie=R(()=>{"use strict";ve();MU();iie();IR()});var zU,cie=R(()=>{"use strict";aie();PR();ve();zU={serializeRequest:t=>{let e=sie([t],Kp);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 J.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}}});var lie=R(()=>{"use strict";cie()});function uie(t,e){let r=t&255|Dze;return e&&(r|=Lze),r}function Uze(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:Ca(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>zze(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>Fze(o,e)),droppedLinksCount:t.droppedLinksCount,flags:uie(r.traceFlags,t.parentSpanContext?.isRemote)}}function Fze(t,e){return{attributes:t.attributes?Ca(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:uie(t.context.traceFlags,t.context.isRemote)}}function zze(t,e){return{attributes:t.attributes?Ca(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function die(t,e){return{resourceSpans:Bze(t,e)}}function jze(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||""}`,o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return e}function Bze(t,e){let r=jze(t),n=[],i=r.entries(),o=i.next();for(;!o.done;){let[s,a]=o.value,c=[],l=a.values(),u=l.next();for(;!u.done;){let p=u.value;if(p.length>0){let h=p.map(m=>Uze(m,e));c.push({scope:Yp(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=l.next()}let d=Wp(s,e),f={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};n.push(f),o=i.next()}return n}var Dze,Lze,fie=R(()=>{"use strict";IR();Dze=256,Lze=512});var jU,pie=R(()=>{"use strict";fie();PR();ve();jU={serializeRequest:t=>{let e=die(t,Kp);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 J.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}}});var hie=R(()=>{"use strict";pie()});var mie={};zr(mie,{JsonLogsSerializer:()=>FU,JsonMetricsSerializer:()=>zU,JsonTraceSerializer:()=>jU,ProtobufLogsSerializer:()=>NU,ProtobufMetricsSerializer:()=>DU,ProtobufTraceSerializer:()=>LU});var gie=R(()=>{"use strict";kne();Vne();Xne();nie();lie();hie()});var yie=y(OR=>{"use strict";Object.defineProperty(OR,"__esModule",{value:!0});OR.OTLPTraceExporter=void 0;var _ie=_ne(),qze=(gie(),bn(mie)),Vze=(lx(),bn(cx)),BU=class extends Vze.OTLPExporterBase{constructor(e={}){super((0,_ie.createOtlpGrpcExportDelegate)((0,_ie.convertLegacyOtlpGrpcOptions)(e,"TRACES"),qze.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};OR.OTLPTraceExporter=BU});var Sie=y(NR=>{"use strict";Object.defineProperty(NR,"__esModule",{value:!0});NR.OTLPTraceExporter=void 0;var Gze=yie();Object.defineProperty(NR,"OTLPTraceExporter",{enumerable:!0,get:function(){return Gze.OTLPTraceExporter}})});var Boe=y((fkt,joe)=>{"use strict";joe.exports=zoe;zoe.sync=y2e;var Uoe=Z("fs");function _2e(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 Foe(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:_2e(e,r)}function zoe(t,e,r){Uoe.stat(t,function(n,i){r(n,n?!1:Foe(i,t,e))})}function y2e(t,e){return Foe(Uoe.statSync(t),t,e)}});var Woe=y((pkt,Hoe)=>{"use strict";Hoe.exports=Voe;Voe.sync=S2e;var qoe=Z("fs");function Voe(t,e,r){qoe.stat(t,function(n,i){r(n,n?!1:Goe(i,e))})}function S2e(t,e){return Goe(qoe.statSync(t),e)}function Goe(t,e){return t.isFile()&&E2e(t,e)}function E2e(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=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===s||r&a&&n===o||r&u&&o===0;return d}});var Koe=y((mkt,Yoe)=>{"use strict";var hkt=Z("fs"),a0;process.platform==="win32"||global.TESTING_WINDOWS?a0=Boe():a0=Woe();Yoe.exports=EF;EF.sync=v2e;function EF(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){EF(t,e||{},function(o,s){o?i(o):n(s)})})}a0(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function v2e(t,e){try{return a0.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var rse=y((gkt,tse)=>{"use strict";var th=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Zoe=Z("path"),b2e=th?";":":",Joe=Koe(),Xoe=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Qoe=(t,e)=>{let r=e.colon||b2e,n=t.match(/\//)||th&&t.match(/\\/)?[""]:[...th?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=th?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=th?i.split(r):[""];return th&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},ese=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Qoe(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(Xoe(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,h=Zoe.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];Joe(l+h,{pathExt:o},(m,g)=>{if(!m&&g)if(e.all)s.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)},T2e=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=Qoe(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=Zoe.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(Joe.sync(f,{pathExt:i}))if(e.all)o.push(f);else return f}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw Xoe(t)};tse.exports=ese;ese.sync=T2e});var ise=y((_kt,vF)=>{"use strict";var nse=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};vF.exports=nse;vF.exports.default=nse});var cse=y((ykt,ase)=>{"use strict";var ose=Z("path"),w2e=rse(),x2e=ise();function sse(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=w2e.sync(t.command,{path:r[x2e({env:r})],pathExt:e?ose.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=ose.resolve(i?t.options.cwd:"",s)),s}function A2e(t){return sse(t)||sse(t,!0)}ase.exports=A2e});var lse=y((Skt,TF)=>{"use strict";var bF=/([()\][%!^"`<>&|;, *?])/g;function R2e(t){return t=t.replace(bF,"^$1"),t}function C2e(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(bF,"^$1"),e&&(t=t.replace(bF,"^$1")),t}TF.exports.command=R2e;TF.exports.argument=C2e});var dse=y((Ekt,use)=>{"use strict";use.exports=/^#!(.*)/});var pse=y((vkt,fse)=>{"use strict";var I2e=dse();fse.exports=(t="")=>{let e=t.match(I2e);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var mse=y((bkt,hse)=>{"use strict";var wF=Z("fs"),P2e=pse();function O2e(t){let r=Buffer.alloc(150),n;try{n=wF.openSync(t,"r"),wF.readSync(n,r,0,150,0),wF.closeSync(n)}catch{}return P2e(r.toString())}hse.exports=O2e});var Sse=y((Tkt,yse)=>{"use strict";var N2e=Z("path"),gse=cse(),_se=lse(),k2e=mse(),M2e=process.platform==="win32",$2e=/\.(?:com|exe)$/i,D2e=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function L2e(t){t.file=gse(t);let e=t.file&&k2e(t.file);return e?(t.args.unshift(t.file),t.command=e,gse(t)):t.file}function U2e(t){if(!M2e)return t;let e=L2e(t),r=!$2e.test(e);if(t.options.forceShell||r){let n=D2e.test(e);t.command=N2e.normalize(t.command),t.command=_se.command(t.command),t.args=t.args.map(o=>_se.argument(o,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 F2e(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:U2e(n)}yse.exports=F2e});var bse=y((wkt,vse)=>{"use strict";var xF=process.platform==="win32";function AF(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 z2e(t,e){if(!xF)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=Ese(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function Ese(t,e){return xF&&t===1&&!e.file?AF(e.original,"spawn"):null}function j2e(t,e){return xF&&t===1&&!e.file?AF(e.original,"spawnSync"):null}vse.exports={hookChildProcess:z2e,verifyENOENT:Ese,verifyENOENTSync:j2e,notFoundError:AF}});var xse=y((xkt,rh)=>{"use strict";var Tse=Z("child_process"),RF=Sse(),CF=bse();function wse(t,e,r){let n=RF(t,e,r),i=Tse.spawn(n.command,n.args,n.options);return CF.hookChildProcess(i,n),i}function B2e(t,e,r){let n=RF(t,e,r),i=Tse.spawnSync(n.command,n.args,n.options);return i.error=i.error||CF.verifyENOENTSync(i.status,n),i}rh.exports=wse;rh.exports.spawn=wse;rh.exports.sync=B2e;rh.exports._parse=RF;rh.exports._enoent=CF});var Wv=y(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.regexpCode=pt.getEsmExportName=pt.getProperty=pt.safeStringify=pt.stringify=pt.strConcat=pt.addCodeArg=pt.str=pt._=pt.nil=pt._Code=pt.Name=pt.IDENTIFIER=pt._CodeOrName=void 0;var Gv=class{};pt._CodeOrName=Gv;pt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var lf=class extends Gv{constructor(e){if(super(),!pt.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};pt.Name=lf;var eo=class extends Gv{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof lf&&(r[n.str]=(r[n.str]||0)+1),r),{})}};pt._Code=eo;pt.nil=new eo("");function a_e(t,...e){let r=[t[0]],n=0;for(;n<e.length;)tH(r,e[n]),r.push(t[++n]);return new eo(r)}pt._=a_e;var eH=new eo("+");function c_e(t,...e){let r=[Hv(t[0])],n=0;for(;n<e.length;)r.push(eH),tH(r,e[n]),r.push(eH,Hv(t[++n]));return XJe(r),new eo(r)}pt.str=c_e;function tH(t,e){e instanceof eo?t.push(...e._items):e instanceof lf?t.push(e):t.push(tXe(e))}pt.addCodeArg=tH;function XJe(t){let e=1;for(;e<t.length-1;){if(t[e]===eH){let r=QJe(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function QJe(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof lf||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof lf))return`"${t}${e.slice(1)}`}function eXe(t,e){return e.emptyStr()?t:t.emptyStr()?e:c_e`${t}${e}`}pt.strConcat=eXe;function tXe(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Hv(Array.isArray(t)?t.join(","):t)}function rXe(t){return new eo(Hv(t))}pt.stringify=rXe;function Hv(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}pt.safeStringify=Hv;function nXe(t){return typeof t=="string"&&pt.IDENTIFIER.test(t)?new eo(`.${t}`):a_e`[${t}]`}pt.getProperty=nXe;function iXe(t){if(typeof t=="string"&&pt.IDENTIFIER.test(t))return new eo(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}pt.getEsmExportName=iXe;function oXe(t){return new eo(t.toString())}pt.regexpCode=oXe});var iH=y(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.ValueScope=ti.ValueScopeName=ti.Scope=ti.varKinds=ti.UsedValueState=void 0;var ei=Wv(),rH=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},mO;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(mO||(ti.UsedValueState=mO={}));ti.varKinds={const:new ei.Name("const"),let:new ei.Name("let"),var:new ei.Name("var")};var gO=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ei.Name?e:this.name(e)}name(e){return new ei.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};ti.Scope=gO;var _O=class extends ei.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ei._)`.${new ei.Name(r)}[${n}]`}};ti.ValueScopeName=_O;var sXe=(0,ei._)`\n`,nH=class extends gO{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?sXe:ei.nil}}get(){return this._scope}name(e){return new _O(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ei._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=ei.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,mO.Started);let u=r(l);if(u){let d=this.opts.es5?ti.varKinds.var:ti.varKinds.const;o=(0,ei._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,ei._)`${o}${u}${this.opts._n}`;else throw new rH(l);c.set(l,mO.Completed)})}return o}};ti.ValueScope=nH});var Ze=y(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.or=et.and=et.not=et.CodeGen=et.operators=et.varKinds=et.ValueScopeName=et.ValueScope=et.Scope=et.Name=et.regexpCode=et.stringify=et.getProperty=et.nil=et.strConcat=et.str=et._=void 0;var st=Wv(),qo=iH(),Zl=Wv();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return Zl._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return Zl.str}});Object.defineProperty(et,"strConcat",{enumerable:!0,get:function(){return Zl.strConcat}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return Zl.nil}});Object.defineProperty(et,"getProperty",{enumerable:!0,get:function(){return Zl.getProperty}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return Zl.stringify}});Object.defineProperty(et,"regexpCode",{enumerable:!0,get:function(){return Zl.regexpCode}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return Zl.Name}});var vO=iH();Object.defineProperty(et,"Scope",{enumerable:!0,get:function(){return vO.Scope}});Object.defineProperty(et,"ValueScope",{enumerable:!0,get:function(){return vO.ValueScope}});Object.defineProperty(et,"ValueScopeName",{enumerable:!0,get:function(){return vO.ValueScopeName}});Object.defineProperty(et,"varKinds",{enumerable:!0,get:function(){return vO.varKinds}});et.operators={GT:new st._Code(">"),GTE:new st._Code(">="),LT:new st._Code("<"),LTE:new st._Code("<="),EQ:new st._Code("==="),NEQ:new st._Code("!=="),NOT:new st._Code("!"),OR:new st._Code("||"),AND:new st._Code("&&"),ADD:new st._Code("+")};var uc=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},oH=class extends uc{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?qo.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ig(this.rhs,e,r)),this}get names(){return this.rhs instanceof st._CodeOrName?this.rhs.names:{}}},yO=class extends uc{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof st.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ig(this.rhs,e,r),this}get names(){let e=this.lhs instanceof st.Name?{}:{...this.lhs.names};return EO(e,this.rhs)}},sH=class extends yO{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},aH=class extends uc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},cH=class extends uc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},lH=class extends uc{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},uH=class extends uc{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ig(this.code,e,r),this}get names(){return this.code instanceof st._CodeOrName?this.code.names:{}}},Yv=class extends uc{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(aXe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ff(e,r.names),{})}},dc=class extends Yv{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},dH=class extends Yv{},Cg=class extends dc{};Cg.kind="else";var uf=class t extends dc{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Cg(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(l_e(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ig(this.condition,e,r),this}get names(){let e=super.names;return EO(e,this.condition),this.else&&ff(e,this.else.names),e}};uf.kind="if";var df=class extends dc{};df.kind="for";var fH=class extends df{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ig(this.iteration,e,r),this}get names(){return ff(super.names,this.iteration.names)}},pH=class extends df{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?qo.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=EO(super.names,this.from);return EO(e,this.to)}},SO=class extends df{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ig(this.iterable,e,r),this}get names(){return ff(super.names,this.iterable.names)}},Kv=class extends dc{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Kv.kind="func";var Zv=class extends Yv{render(e){return"return "+super.render(e)}};Zv.kind="return";var hH=class extends dc{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ff(e,this.catch.names),this.finally&&ff(e,this.finally.names),e}},Jv=class extends dc{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Jv.kind="catch";var Xv=class extends dc{render(e){return"finally"+super.render(e)}};Xv.kind="finally";var mH=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
23
|
-
`:""},this._extScope=e,this._scope=new qo.Scope({parent:e}),this._nodes=[new dH]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new oH(e,o,n)),o}const(e,r,n){return this._def(qo.varKinds.const,e,r,n)}let(e,r,n){return this._def(qo.varKinds.let,e,r,n)}var(e,r,n){return this._def(qo.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new yO(e,r,n))}add(e,r){return this._leafNode(new sH(e,et.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==st.nil&&this._leafNode(new uH(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,st.addCodeArg)(r,i));return r.push("}"),new st._Code(r)}if(e,r,n){if(this._blockNode(new uf(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new uf(e))}else(){return this._elseNode(new Cg)}endIf(){return this._endBlockNode(uf,Cg)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new fH(e),r)}forRange(e,r,n,i,o=this.opts.es5?qo.varKinds.var:qo.varKinds.let){let s=this._scope.toName(e);return this._for(new pH(o,s,r,n),()=>i(s))}forOf(e,r,n,i=qo.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof st.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,st._)`${s}.length`,a=>{this.var(o,(0,st._)`${s}[${a}]`),n(o)})}return this._for(new SO("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?qo.varKinds.var:qo.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,st._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new SO("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(df)}label(e){return this._leafNode(new aH(e))}break(e){return this._leafNode(new cH(e))}return(e){let r=new Zv;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Zv)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new hH;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new Jv(o),r(o)}return n&&(this._currNode=i.finally=new Xv,this.code(n)),this._endBlockNode(Jv,Xv)}throw(e){return this._leafNode(new lH(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=st.nil,n,i){return this._blockNode(new Kv(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Kv)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof uf))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};et.CodeGen=mH;function ff(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function EO(t,e){return e instanceof st._CodeOrName?ff(t,e.names):t}function Ig(t,e,r){if(t instanceof st.Name)return n(t);if(!i(t))return t;return new st._Code(t._items.reduce((o,s)=>(s instanceof st.Name&&(s=n(s)),s instanceof st._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof st._Code&&o._items.some(s=>s instanceof st.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function aXe(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function l_e(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,st._)`!${gH(t)}`}et.not=l_e;var cXe=u_e(et.operators.AND);function lXe(...t){return t.reduce(cXe)}et.and=lXe;var uXe=u_e(et.operators.OR);function dXe(...t){return t.reduce(uXe)}et.or=dXe;function u_e(t){return(e,r)=>e===st.nil?r:r===st.nil?e:(0,st._)`${gH(e)} ${t} ${gH(r)}`}function gH(t){return t instanceof st.Name?t:(0,st._)`(${t})`}});var lt=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.checkStrictMode=rt.getErrorPath=rt.Type=rt.useFunc=rt.setEvaluated=rt.evaluatedPropsToName=rt.mergeEvaluated=rt.eachItem=rt.unescapeJsonPointer=rt.escapeJsonPointer=rt.escapeFragment=rt.unescapeFragment=rt.schemaRefOrVal=rt.schemaHasRulesButRef=rt.schemaHasRules=rt.checkUnknownRules=rt.alwaysValidSchema=rt.toHash=void 0;var Lt=Ze(),fXe=Wv();function pXe(t){let e={};for(let r of t)e[r]=!0;return e}rt.toHash=pXe;function hXe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(p_e(t,e),!h_e(e,t.self.RULES.all))}rt.alwaysValidSchema=hXe;function p_e(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||__e(t,`unknown keyword: "${o}"`)}rt.checkUnknownRules=p_e;function h_e(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}rt.schemaHasRules=h_e;function mXe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}rt.schemaHasRulesButRef=mXe;function gXe({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Lt._)`${r}`}return(0,Lt._)`${t}${e}${(0,Lt.getProperty)(n)}`}rt.schemaRefOrVal=gXe;function _Xe(t){return m_e(decodeURIComponent(t))}rt.unescapeFragment=_Xe;function yXe(t){return encodeURIComponent(yH(t))}rt.escapeFragment=yXe;function yH(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}rt.escapeJsonPointer=yH;function m_e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}rt.unescapeJsonPointer=m_e;function SXe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}rt.eachItem=SXe;function d_e({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof Lt.Name?(o instanceof Lt.Name?t(i,o,s):e(i,o,s),s):o instanceof Lt.Name?(e(i,s,o),o):r(o,s);return a===Lt.Name&&!(c instanceof Lt.Name)?n(i,c):c}}rt.mergeEvaluated={props:d_e({mergeNames:(t,e,r)=>t.if((0,Lt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Lt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Lt._)`${r} || {}`).code((0,Lt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Lt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Lt._)`${r} || {}`),SH(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:g_e}),items:d_e({mergeNames:(t,e,r)=>t.if((0,Lt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Lt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Lt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Lt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function g_e(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Lt._)`{}`);return e!==void 0&&SH(t,r,e),r}rt.evaluatedPropsToName=g_e;function SH(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Lt._)`${e}${(0,Lt.getProperty)(n)}`,!0))}rt.setEvaluated=SH;var f_e={};function EXe(t,e){return t.scopeValue("func",{ref:e,code:f_e[e.code]||(f_e[e.code]=new fXe._Code(e.code))})}rt.useFunc=EXe;var _H;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(_H||(rt.Type=_H={}));function vXe(t,e,r){if(t instanceof Lt.Name){let n=e===_H.Num;return r?n?(0,Lt._)`"[" + ${t} + "]"`:(0,Lt._)`"['" + ${t} + "']"`:n?(0,Lt._)`"/" + ${t}`:(0,Lt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Lt.getProperty)(t).toString():"/"+yH(t)}rt.getErrorPath=vXe;function __e(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}rt.checkStrictMode=__e});var fc=y(EH=>{"use strict";Object.defineProperty(EH,"__esModule",{value:!0});var mn=Ze(),bXe={data:new mn.Name("data"),valCxt:new mn.Name("valCxt"),instancePath:new mn.Name("instancePath"),parentData:new mn.Name("parentData"),parentDataProperty:new mn.Name("parentDataProperty"),rootData:new mn.Name("rootData"),dynamicAnchors:new mn.Name("dynamicAnchors"),vErrors:new mn.Name("vErrors"),errors:new mn.Name("errors"),this:new mn.Name("this"),self:new mn.Name("self"),scope:new mn.Name("scope"),json:new mn.Name("json"),jsonPos:new mn.Name("jsonPos"),jsonLen:new mn.Name("jsonLen"),jsonPart:new mn.Name("jsonPart")};EH.default=bXe});var Qv=y(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.extendErrors=gn.resetErrorsCount=gn.reportExtraError=gn.reportError=gn.keyword$DataError=gn.keywordError=void 0;var ut=Ze(),bO=lt(),Mn=fc();gn.keywordError={message:({keyword:t})=>(0,ut.str)`must pass "${t}" keyword validation`};gn.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ut.str)`"${t}" keyword must be ${e} ($data)`:(0,ut.str)`"${t}" keyword is invalid ($data)`};function TXe(t,e=gn.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=E_e(t,e,r);n??(s||a)?y_e(o,c):S_e(i,(0,ut._)`[${c}]`)}gn.reportError=TXe;function wXe(t,e=gn.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=E_e(t,e,r);y_e(i,a),o||s||S_e(n,Mn.default.vErrors)}gn.reportExtraError=wXe;function xXe(t,e){t.assign(Mn.default.errors,e),t.if((0,ut._)`${Mn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ut._)`${Mn.default.vErrors}.length`,e),()=>t.assign(Mn.default.vErrors,null)))}gn.resetErrorsCount=xXe;function AXe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,Mn.default.errors,a=>{t.const(s,(0,ut._)`${Mn.default.vErrors}[${a}]`),t.if((0,ut._)`${s}.instancePath === undefined`,()=>t.assign((0,ut._)`${s}.instancePath`,(0,ut.strConcat)(Mn.default.instancePath,o.errorPath))),t.assign((0,ut._)`${s}.schemaPath`,(0,ut.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ut._)`${s}.schema`,r),t.assign((0,ut._)`${s}.data`,n))})}gn.extendErrors=AXe;function y_e(t,e){let r=t.const("err",e);t.if((0,ut._)`${Mn.default.vErrors} === null`,()=>t.assign(Mn.default.vErrors,(0,ut._)`[${r}]`),(0,ut._)`${Mn.default.vErrors}.push(${r})`),t.code((0,ut._)`${Mn.default.errors}++`)}function S_e(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ut._)`new ${t.ValidationError}(${e})`):(r.assign((0,ut._)`${n}.errors`,e),r.return(!1))}var pf={keyword:new ut.Name("keyword"),schemaPath:new ut.Name("schemaPath"),params:new ut.Name("params"),propertyName:new ut.Name("propertyName"),message:new ut.Name("message"),schema:new ut.Name("schema"),parentSchema:new ut.Name("parentSchema")};function E_e(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ut._)`{}`:RXe(t,e,r)}function RXe(t,e,r={}){let{gen:n,it:i}=t,o=[CXe(i,r),IXe(t,r)];return PXe(t,e,o),n.object(...o)}function CXe({errorPath:t},{instancePath:e}){let r=e?(0,ut.str)`${t}${(0,bO.getErrorPath)(e,bO.Type.Str)}`:t;return[Mn.default.instancePath,(0,ut.strConcat)(Mn.default.instancePath,r)]}function IXe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ut.str)`${e}/${t}`;return r&&(i=(0,ut.str)`${i}${(0,bO.getErrorPath)(r,bO.Type.Str)}`),[pf.schemaPath,i]}function PXe(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([pf.keyword,i],[pf.params,typeof e=="function"?e(t):e||(0,ut._)`{}`]),c.messages&&n.push([pf.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([pf.schema,s],[pf.parentSchema,(0,ut._)`${u}${d}`],[Mn.default.data,o]),l&&n.push([pf.propertyName,l])}});var b_e=y(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.boolOrEmptySchema=Pg.topBoolOrEmptySchema=void 0;var OXe=Qv(),NXe=Ze(),kXe=fc(),MXe={message:"boolean schema is false"};function $Xe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?v_e(t,!1):typeof r=="object"&&r.$async===!0?e.return(kXe.default.data):(e.assign((0,NXe._)`${n}.errors`,null),e.return(!0))}Pg.topBoolOrEmptySchema=$Xe;function DXe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),v_e(t)):r.var(e,!0)}Pg.boolOrEmptySchema=DXe;function v_e(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,OXe.reportError)(i,MXe,void 0,e)}});var vH=y(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.getRules=Og.isJSONType=void 0;var LXe=["string","number","integer","boolean","null","object","array"],UXe=new Set(LXe);function FXe(t){return typeof t=="string"&&UXe.has(t)}Og.isJSONType=FXe;function zXe(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Og.getRules=zXe});var bH=y(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.shouldUseRule=Jl.shouldUseGroup=Jl.schemaHasRulesForType=void 0;function jXe({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&T_e(t,n)}Jl.schemaHasRulesForType=jXe;function T_e(t,e){return e.rules.some(r=>w_e(t,r))}Jl.shouldUseGroup=T_e;function w_e(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Jl.shouldUseRule=w_e});var eb=y(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.reportTypeError=_n.checkDataTypes=_n.checkDataType=_n.coerceAndCheckDataType=_n.getJSONTypes=_n.getSchemaTypes=_n.DataType=void 0;var BXe=vH(),qXe=bH(),VXe=Qv(),Ye=Ze(),x_e=lt(),Ng;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ng||(_n.DataType=Ng={}));function GXe(t){let e=A_e(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}_n.getSchemaTypes=GXe;function A_e(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(BXe.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}_n.getJSONTypes=A_e;function HXe(t,e){let{gen:r,data:n,opts:i}=t,o=WXe(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,qXe.schemaHasRulesForType)(t,e[0]));if(s){let a=wH(e,n,i.strictNumbers,Ng.Wrong);r.if(a,()=>{o.length?YXe(t,e,o):xH(t)})}return s}_n.coerceAndCheckDataType=HXe;var R_e=new Set(["string","number","integer","boolean","null"]);function WXe(t,e){return e?t.filter(r=>R_e.has(r)||e==="array"&&r==="array"):[]}function YXe(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,Ye._)`typeof ${i}`),a=n.let("coerced",(0,Ye._)`undefined`);o.coerceTypes==="array"&&n.if((0,Ye._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ye._)`${i}[0]`).assign(s,(0,Ye._)`typeof ${i}`).if(wH(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,Ye._)`${a} !== undefined`);for(let l of r)(R_e.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),xH(t),n.endIf(),n.if((0,Ye._)`${a} !== undefined`,()=>{n.assign(i,a),KXe(t,a)});function c(l){switch(l){case"string":n.elseIf((0,Ye._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Ye._)`"" + ${i}`).elseIf((0,Ye._)`${i} === null`).assign(a,(0,Ye._)`""`);return;case"number":n.elseIf((0,Ye._)`${s} == "boolean" || ${i} === null
|
|
24
|
-
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,
|
|
25
|
-
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,
|
|
26
|
-
|| ${s} === "boolean" || ${i} === null`).assign(a,(0,Ye._)`[${i}]`)}}}function KXe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ye._)`${e} !== undefined`,()=>t.assign((0,Ye._)`${e}[${r}]`,n))}function TH(t,e,r,n=Ng.Correct){let i=n===Ng.Correct?Ye.operators.EQ:Ye.operators.NEQ,o;switch(t){case"null":return(0,Ye._)`${e} ${i} null`;case"array":o=(0,Ye._)`Array.isArray(${e})`;break;case"object":o=(0,Ye._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Ye._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Ye._)`typeof ${e} ${i} ${t}`}return n===Ng.Correct?o:(0,Ye.not)(o);function s(a=Ye.nil){return(0,Ye.and)((0,Ye._)`typeof ${e} == "number"`,a,r?(0,Ye._)`isFinite(${e})`:Ye.nil)}}_n.checkDataType=TH;function wH(t,e,r,n){if(t.length===1)return TH(t[0],e,r,n);let i,o=(0,x_e.toHash)(t);if(o.array&&o.object){let s=(0,Ye._)`typeof ${e} != "object"`;i=o.null?s:(0,Ye._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Ye.nil;o.number&&delete o.integer;for(let s in o)i=(0,Ye.and)(i,TH(s,e,r,n));return i}_n.checkDataTypes=wH;var ZXe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ye._)`{type: ${t}}`:(0,Ye._)`{type: ${e}}`};function xH(t){let e=JXe(t);(0,VXe.reportError)(e,ZXe)}_n.reportTypeError=xH;function JXe(t){let{gen:e,data:r,schema:n}=t,i=(0,x_e.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var I_e=y(TO=>{"use strict";Object.defineProperty(TO,"__esModule",{value:!0});TO.assignDefaults=void 0;var kg=Ze(),XXe=lt();function QXe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)C_e(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>C_e(t,o,i.default))}TO.assignDefaults=QXe;function C_e(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,kg._)`${o}${(0,kg.getProperty)(e)}`;if(i){(0,XXe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,kg._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,kg._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,kg._)`${a} = ${(0,kg.stringify)(r)}`)}});var to=y(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.validateUnion=Pt.validateArray=Pt.usePattern=Pt.callValidateCode=Pt.schemaProperties=Pt.allSchemaProperties=Pt.noPropertyInData=Pt.propertyInData=Pt.isOwnProperty=Pt.hasPropFunc=Pt.reportMissingProp=Pt.checkMissingProp=Pt.checkReportMissingProp=void 0;var Bt=Ze(),AH=lt(),Xl=fc(),eQe=lt();function tQe(t,e){let{gen:r,data:n,it:i}=t;r.if(CH(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Bt._)`${e}`},!0),t.error()})}Pt.checkReportMissingProp=tQe;function rQe({gen:t,data:e,it:{opts:r}},n,i){return(0,Bt.or)(...n.map(o=>(0,Bt.and)(CH(t,e,o,r.ownProperties),(0,Bt._)`${i} = ${o}`)))}Pt.checkMissingProp=rQe;function nQe(t,e){t.setParams({missingProperty:e},!0),t.error()}Pt.reportMissingProp=nQe;function P_e(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Bt._)`Object.prototype.hasOwnProperty`})}Pt.hasPropFunc=P_e;function RH(t,e,r){return(0,Bt._)`${P_e(t)}.call(${e}, ${r})`}Pt.isOwnProperty=RH;function iQe(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} !== undefined`;return n?(0,Bt._)`${i} && ${RH(t,e,r)}`:i}Pt.propertyInData=iQe;function CH(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} === undefined`;return n?(0,Bt.or)(i,(0,Bt.not)(RH(t,e,r))):i}Pt.noPropertyInData=CH;function O_e(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Pt.allSchemaProperties=O_e;function oQe(t,e){return O_e(e).filter(r=>!(0,AH.alwaysValidSchema)(t,e[r]))}Pt.schemaProperties=oQe;function sQe({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,Bt._)`${t}, ${e}, ${n}${i}`:e,d=[[Xl.default.instancePath,(0,Bt.strConcat)(Xl.default.instancePath,o)],[Xl.default.parentData,s.parentData],[Xl.default.parentDataProperty,s.parentDataProperty],[Xl.default.rootData,Xl.default.rootData]];s.opts.dynamicRef&&d.push([Xl.default.dynamicAnchors,Xl.default.dynamicAnchors]);let f=(0,Bt._)`${u}, ${r.object(...d)}`;return c!==Bt.nil?(0,Bt._)`${a}.call(${c}, ${f})`:(0,Bt._)`${a}(${f})`}Pt.callValidateCode=sQe;var aQe=(0,Bt._)`new RegExp`;function cQe({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Bt._)`${i.code==="new RegExp"?aQe:(0,eQe.useFunc)(t,i)}(${r}, ${n})`})}Pt.usePattern=cQe;function lQe(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,Bt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:AH.Type.Num},o),e.if((0,Bt.not)(o),a)})}}Pt.validateArray=lQe;function uQe(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,AH.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,Bt._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Bt.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}Pt.validateUnion=uQe});var M_e=y(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.validateKeywordUsage=Hs.validSchemaType=Hs.funcKeywordCode=Hs.macroKeywordCode=void 0;var $n=Ze(),hf=fc(),dQe=to(),fQe=Qv();function pQe(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=k_e(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:$n.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Hs.macroKeywordCode=pQe;function hQe(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;gQe(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=k_e(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)m(),e.modifying&&N_e(t),g(()=>t.error());else{let _=e.async?p():h();e.modifying&&N_e(t),g(()=>mQe(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>m((0,$n._)`await `),v=>n.assign(d,!1).if((0,$n._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,$n._)`${v}.errors`),()=>n.throw(v))),_}function h(){let _=(0,$n._)`${u}.errors`;return n.assign(_,null),m($n.nil),_}function m(_=e.async?(0,$n._)`await `:$n.nil){let v=c.opts.passContext?hf.default.this:hf.default.self,T=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,$n._)`${_}${(0,dQe.callValidateCode)(t,u,v,T)}`,e.modifying)}function g(_){var v;n.if((0,$n.not)((v=e.valid)!==null&&v!==void 0?v:d),_)}}Hs.funcKeywordCode=hQe;function N_e(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,$n._)`${n.parentData}[${n.parentDataProperty}]`))}function mQe(t,e){let{gen:r}=t;r.if((0,$n._)`Array.isArray(${e})`,()=>{r.assign(hf.default.vErrors,(0,$n._)`${hf.default.vErrors} === null ? ${e} : ${hf.default.vErrors}.concat(${e})`).assign(hf.default.errors,(0,$n._)`${hf.default.vErrors}.length`),(0,fQe.extendErrors)(t)},()=>t.error())}function gQe({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function k_e(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,$n.stringify)(r)})}function _Qe(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Hs.validSchemaType=_Qe;function yQe({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Hs.validateKeywordUsage=yQe});var D_e=y(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.extendSubschemaMode=Ql.extendSubschemaData=Ql.getSubschema=void 0;var Ws=Ze(),$_e=lt();function SQe(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ws._)`${t.schemaPath}${(0,Ws.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ws._)`${t.schemaPath}${(0,Ws.getProperty)(e)}${(0,Ws.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,$_e.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Ql.getSubschema=SQe;function EQe(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Ws._)`${e.data}${(0,Ws.getProperty)(r)}`,!0);c(f),t.errorPath=(0,Ws.str)`${l}${(0,$_e.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ws._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof Ws.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}Ql.extendSubschemaData=EQe;function vQe(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}Ql.extendSubschemaMode=vQe});var IH=y((wnr,L_e)=>{"use strict";L_e.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var F_e=y((xnr,U_e)=>{"use strict";var eu=U_e.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};wO(e,n,i,t,"",t)};eu.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};eu.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};eu.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};eu.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function wO(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in eu.arrayKeywords)for(var f=0;f<d.length;f++)wO(t,e,r,d[f],i+"/"+u+"/"+f,o,i,u,n,f)}else if(u in eu.propsKeywords){if(d&&typeof d=="object")for(var p in d)wO(t,e,r,d[p],i+"/"+u+"/"+bQe(p),o,i,u,n,p)}else(u in eu.keywords||t.allKeys&&!(u in eu.skipKeywords))&&wO(t,e,r,d,i+"/"+u,o,i,u,n)}r(n,i,o,s,a,c,l)}}function bQe(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var tb=y(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.getSchemaRefs=ri.resolveUrl=ri.normalizeId=ri._getFullPath=ri.getFullPath=ri.inlineRef=void 0;var TQe=lt(),wQe=IH(),xQe=F_e(),AQe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function RQe(t,e=!0){return typeof t=="boolean"?!0:e===!0?!PH(t):e?z_e(t)<=e:!1}ri.inlineRef=RQe;var CQe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function PH(t){for(let e in t){if(CQe.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(PH)||typeof r=="object"&&PH(r))return!0}return!1}function z_e(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!AQe.has(r)&&(typeof t[r]=="object"&&(0,TQe.eachItem)(t[r],n=>e+=z_e(n)),e===1/0))return 1/0}return e}function j_e(t,e="",r){r!==!1&&(e=Mg(e));let n=t.parse(e);return B_e(t,n)}ri.getFullPath=j_e;function B_e(t,e){return t.serialize(e).split("#")[0]+"#"}ri._getFullPath=B_e;var IQe=/#\/?$/;function Mg(t){return t?t.replace(IQe,""):""}ri.normalizeId=Mg;function PQe(t,e,r){return r=Mg(r),t.resolve(e,r)}ri.resolveUrl=PQe;var OQe=/^[a-z_][-a-z0-9._]*$/i;function NQe(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Mg(t[r]||e),o={"":i},s=j_e(n,i,!1),a={},c=new Set;return xQe(t,{allKeys:!0},(d,f,p,h)=>{if(h===void 0)return;let m=s+f,g=o[h];typeof d[r]=="string"&&(g=_.call(this,d[r])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),o[f]=g;function _(T){let b=this.opts.uriResolver.resolve;if(T=Mg(g?b(g,T):T),c.has(T))throw u(T);c.add(T);let A=this.refs[T];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,T):T!==Mg(m)&&(T[0]==="#"?(l(d,a[T],T),a[T]=d):this.refs[T]=m),T}function v(T){if(typeof T=="string"){if(!OQe.test(T))throw new Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function l(d,f,p){if(f!==void 0&&!wQe(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ri.getSchemaRefs=NQe});var ib=y(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.getData=tu.KeywordCxt=tu.validateFunctionCode=void 0;var W_e=b_e(),q_e=eb(),NH=bH(),xO=eb(),kQe=I_e(),nb=M_e(),OH=D_e(),Re=Ze(),Fe=fc(),MQe=tb(),pc=lt(),rb=Qv();function $Qe(t){if(Z_e(t)&&(J_e(t),K_e(t))){UQe(t);return}Y_e(t,()=>(0,W_e.topBoolOrEmptySchema)(t))}tu.validateFunctionCode=$Qe;function Y_e({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,Re._)`${Fe.default.data}, ${Fe.default.valCxt}`,n.$async,()=>{t.code((0,Re._)`"use strict"; ${V_e(r,i)}`),LQe(t,i),t.code(o)}):t.func(e,(0,Re._)`${Fe.default.data}, ${DQe(i)}`,n.$async,()=>t.code(V_e(r,i)).code(o))}function DQe(t){return(0,Re._)`{${Fe.default.instancePath}="", ${Fe.default.parentData}, ${Fe.default.parentDataProperty}, ${Fe.default.rootData}=${Fe.default.data}${t.dynamicRef?(0,Re._)`, ${Fe.default.dynamicAnchors}={}`:Re.nil}}={}`}function LQe(t,e){t.if(Fe.default.valCxt,()=>{t.var(Fe.default.instancePath,(0,Re._)`${Fe.default.valCxt}.${Fe.default.instancePath}`),t.var(Fe.default.parentData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentData}`),t.var(Fe.default.parentDataProperty,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentDataProperty}`),t.var(Fe.default.rootData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.rootData}`),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`${Fe.default.valCxt}.${Fe.default.dynamicAnchors}`)},()=>{t.var(Fe.default.instancePath,(0,Re._)`""`),t.var(Fe.default.parentData,(0,Re._)`undefined`),t.var(Fe.default.parentDataProperty,(0,Re._)`undefined`),t.var(Fe.default.rootData,Fe.default.data),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`{}`)})}function UQe(t){let{schema:e,opts:r,gen:n}=t;Y_e(t,()=>{r.$comment&&e.$comment&&Q_e(t),qQe(t),n.let(Fe.default.vErrors,null),n.let(Fe.default.errors,0),r.unevaluated&&FQe(t),X_e(t),HQe(t)})}function FQe(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,Re._)`${r}.evaluated`),e.if((0,Re._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Re._)`${t.evaluated}.props`,(0,Re._)`undefined`)),e.if((0,Re._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Re._)`${t.evaluated}.items`,(0,Re._)`undefined`))}function V_e(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,Re._)`/*# sourceURL=${r} */`:Re.nil}function zQe(t,e){if(Z_e(t)&&(J_e(t),K_e(t))){jQe(t,e);return}(0,W_e.boolOrEmptySchema)(t,e)}function K_e({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Z_e(t){return typeof t.schema!="boolean"}function jQe(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&Q_e(t),VQe(t),GQe(t);let o=n.const("_errs",Fe.default.errors);X_e(t,o),n.var(e,(0,Re._)`${o} === ${Fe.default.errors}`)}function J_e(t){(0,pc.checkUnknownRules)(t),BQe(t)}function X_e(t,e){if(t.opts.jtd)return G_e(t,[],!1,e);let r=(0,q_e.getSchemaTypes)(t.schema),n=(0,q_e.coerceAndCheckDataType)(t,r);G_e(t,r,!n,e)}function BQe(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,pc.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function qQe(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,pc.checkStrictMode)(t,"default is ignored in the schema root")}function VQe(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,MQe.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function GQe(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Q_e({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,Re._)`${Fe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,Re.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Re._)`${Fe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function HQe(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,Re._)`${Fe.default.errors} === 0`,()=>e.return(Fe.default.data),()=>e.throw((0,Re._)`new ${i}(${Fe.default.vErrors})`)):(e.assign((0,Re._)`${n}.errors`,Fe.default.vErrors),o.unevaluated&&WQe(t),e.return((0,Re._)`${Fe.default.errors} === 0`))}function WQe({gen:t,evaluated:e,props:r,items:n}){r instanceof Re.Name&&t.assign((0,Re._)`${e}.props`,r),n instanceof Re.Name&&t.assign((0,Re._)`${e}.items`,n)}function G_e(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,pc.schemaHasRulesButRef)(o,u))){i.block(()=>tye(t,"$ref",u.all.$ref.definition));return}c.jtd||YQe(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,NH.shouldUseGroup)(o,f)&&(f.type?(i.if((0,xO.checkDataType)(f.type,s,c.strictNumbers)),H_e(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,xO.reportTypeError)(t)),i.endIf()):H_e(t,f),a||i.if((0,Re._)`${Fe.default.errors} === ${n||0}`))}}function H_e(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,kQe.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,NH.shouldUseRule)(n,o)&&tye(t,o.keyword,o.definition,e.type)})}function YQe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(KQe(t,e),t.opts.allowUnionTypes||ZQe(t,e),JQe(t,t.dataTypes))}function KQe(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{eye(t.dataTypes,r)||kH(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),QQe(t,e)}}function ZQe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&kH(t,"use allowUnionTypes to allow union type keyword")}function JQe(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,NH.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>XQe(e,s))&&kH(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function XQe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function eye(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function QQe(t,e){let r=[];for(let n of t.dataTypes)eye(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function kH(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,pc.checkStrictMode)(t,e,t.opts.strictTypes)}var AO=class{constructor(e,r,n){if((0,nb.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,pc.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",rye(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,nb.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Fe.default.errors))}result(e,r,n){this.failResult((0,Re.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,Re.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,Re._)`${r} !== undefined && (${(0,Re.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?rb.reportExtraError:rb.reportError)(this,this.def.error,r)}$dataError(){(0,rb.reportError)(this,this.def.$dataError||rb.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,rb.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=Re.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=Re.nil,r=Re.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,Re.or)((0,Re._)`${i} === undefined`,r)),e!==Re.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==Re.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,Re.or)(s(),a());function s(){if(n.length){if(!(r instanceof Re.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,Re._)`${(0,xO.checkDataTypes)(c,r,o.opts.strictNumbers,xO.DataType.Wrong)}`}return Re.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Re._)`!${c}(${r})`}return Re.nil}}subschema(e,r){let n=(0,OH.getSubschema)(this.it,e);(0,OH.extendSubschemaData)(n,this.it,e),(0,OH.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return zQe(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=pc.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=pc.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,Re.Name)),!0}};tu.KeywordCxt=AO;function tye(t,e,r,n){let i=new AO(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,nb.funcKeywordCode)(i,r):"macro"in r?(0,nb.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,nb.funcKeywordCode)(i,r)}var e7e=/^\/(?:[^~]|~0|~1)*$/,t7e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function rye(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return Fe.default.rootData;if(t[0]==="/"){if(!e7e.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=Fe.default.rootData}else{let l=t7e.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,Re._)`${o}${(0,Re.getProperty)((0,pc.unescapeJsonPointer)(l))}`,s=(0,Re._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}tu.getData=rye});var RO=y($H=>{"use strict";Object.defineProperty($H,"__esModule",{value:!0});var MH=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};$H.default=MH});var ob=y(UH=>{"use strict";Object.defineProperty(UH,"__esModule",{value:!0});var DH=tb(),LH=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,DH.resolveUrl)(e,r,n),this.missingSchema=(0,DH.normalizeId)((0,DH.getFullPath)(e,this.missingRef))}};UH.default=LH});var IO=y(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.resolveSchema=ro.getCompilingSchema=ro.resolveRef=ro.compileSchema=ro.SchemaEnv=void 0;var Vo=Ze(),r7e=RO(),mf=fc(),Go=tb(),nye=lt(),n7e=ib(),$g=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Go.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ro.SchemaEnv=$g;function zH(t){let e=iye.call(this,t);if(e)return e;let r=(0,Go.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new Vo.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:r7e.default,code:(0,Vo._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:mf.default.data,parentData:mf.default.parentData,parentDataProperty:mf.default.parentDataProperty,dataNames:[mf.default.data],dataPathArr:[Vo.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Vo.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Vo.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Vo._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,n7e.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(mf.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${mf.default.self}`,`${mf.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:m}=l;p.evaluated={props:h instanceof Vo.Name?void 0:h,items:m instanceof Vo.Name?void 0:m,dynamicProps:h instanceof Vo.Name,dynamicItems:m instanceof Vo.Name},p.source&&(p.source.evaluated=(0,Vo.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}ro.compileSchema=zH;function i7e(t,e,r){var n;r=(0,Go.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=a7e.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new $g({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=o7e.call(this,o)}ro.resolveRef=i7e;function o7e(t){return(0,Go.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:zH.call(this,t)}function iye(t){for(let e of this._compilations)if(s7e(e,t))return e}ro.getCompilingSchema=iye;function s7e(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function a7e(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||CO.call(this,t,e)}function CO(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Go._getFullPath)(this.opts.uriResolver,r),i=(0,Go.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return FH.call(this,r,t);let o=(0,Go.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=CO.call(this,t,s);return typeof a?.schema!="object"?void 0:FH.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||zH.call(this,s),o===(0,Go.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Go.resolveUrl)(this.opts.uriResolver,i,l)),new $g({schema:a,schemaId:c,root:t,baseId:i})}return FH.call(this,r,s)}}ro.resolveSchema=CO;var c7e=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function FH(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,nye.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!c7e.has(a)&&l&&(e=(0,Go.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,nye.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Go.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=CO.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new $g({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var oye=y((Onr,l7e)=>{l7e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var qH=y((Nnr,dye)=>{"use strict";var u7e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),aye=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),jH=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),cye=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),d7e=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function BH(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var f7e=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function sye(t){return t.length=0,!0}function p7e(t,e,r){if(t.length){let n=BH(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function h7e(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=p7e;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(o===!0&&(s=!0),!a(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=sye}else{i.push(l);continue}}return i.length&&(a===sye?r.zone=i.join(""):s?n.push(i.join("")):n.push(BH(i))),r.address=n.join(""),r}function lye(t){if(m7e(t,":")<2)return{host:t,isIPV6:!1};let e=h7e(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function m7e(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function g7e(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var _7e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},y7e=/[@/?#:]/g,S7e=/[@/?#]/g;function uye(t,e){let r=e?S7e:y7e;return r.lastIndex=0,t.replace(r,n=>_7e[n])}function E7e(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(jH(i)){let o=i.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&cye(s)?r+=s:r+="%"+o,n+=2;continue}}r+=t[n]}return r}function v7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(jH(n)){let i=n.toUpperCase(),o=String.fromCharCode(parseInt(i,16));o!=="."&&cye(o)?e+=o:e+="%"+i,r+=2;continue}}d7e(t[r])?e+=t[r]:e+=escape(t[r])}return e}function b7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(jH(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function T7e(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!aye(r)){let n=lye(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=uye(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}dye.exports={nonSimpleDomain:f7e,recomposeAuthority:T7e,reescapeHostDelimiters:uye,normalizePercentEncoding:E7e,normalizePathEncoding:v7e,escapePreservingEscapes:b7e,removeDotSegments:g7e,isIPv4:aye,isUUID:u7e,normalizeIPv6:lye,stringArrayToHexStripped:BH}});var gye=y((knr,mye)=>{"use strict";var{isUUID:w7e}=qH(),x7e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,A7e=["http","https","ws","wss","urn","urn:uuid"];function R7e(t){return A7e.indexOf(t)!==-1}function VH(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function fye(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function pye(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function C7e(t){return t.secure=VH(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function I7e(t){if((t.port===(VH(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function P7e(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(x7e);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=GH(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function O7e(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=GH(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function N7e(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!w7e(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function k7e(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var hye={scheme:"http",domainHost:!0,parse:fye,serialize:pye},M7e={scheme:"https",domainHost:hye.domainHost,parse:fye,serialize:pye},PO={scheme:"ws",domainHost:!0,parse:C7e,serialize:I7e},$7e={scheme:"wss",domainHost:PO.domainHost,parse:PO.parse,serialize:PO.serialize},D7e={scheme:"urn",parse:P7e,serialize:O7e,skipNormalize:!0},L7e={scheme:"urn:uuid",parse:N7e,serialize:k7e,skipNormalize:!0},OO={http:hye,https:M7e,ws:PO,wss:$7e,urn:D7e,"urn:uuid":L7e};Object.setPrototypeOf(OO,null);function GH(t){return t&&(OO[t]||OO[t.toLowerCase()])||void 0}mye.exports={wsIsSecure:VH,SCHEMES:OO,isValidSchemeName:R7e,getSchemeHandler:GH}});var bye=y((Mnr,NO)=>{"use strict";var{normalizeIPv6:U7e,removeDotSegments:sb,recomposeAuthority:F7e,normalizePercentEncoding:z7e,normalizePathEncoding:j7e,escapePreservingEscapes:B7e,reescapeHostDelimiters:q7e,isIPv4:V7e,nonSimpleDomain:G7e}=qH(),{SCHEMES:H7e,getSchemeHandler:yye}=gye();function W7e(t,e){return typeof t=="string"?t=X7e(t,e):typeof t=="object"&&(t=Dg(gf(t,e),e)),t}function Y7e(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Sye(Dg(t,n),Dg(e,n),n,!0);return n.skipEscape=!0,gf(i,n)}function Sye(t,e,r,n){let i={};return n||(t=Dg(gf(t,r),r),e=Dg(gf(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=sb(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=sb(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=sb(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=sb(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function K7e(t,e,r){let n=_ye(t,r),i=_ye(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function gf(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=yye(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=z7e(r.path):(r.path=B7e(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=F7e(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=sb(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var Z7e=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function J7e(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Eye(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(Z7e);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=J7e(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(V7e(n.host)===!1){let u=U7e(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=yye(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&G7e(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=q7e(unescape(n.host),o))),n.path&&(n.path=j7e(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Dg(t,e){return Eye(t,e).parsed}function X7e(t,e){return vye(t,e).normalized}function vye(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Eye(t,e);return{normalized:n?t:gf(r,e),malformedAuthorityOrPort:n}}function _ye(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=vye(t,e);return n?void 0:r}if(typeof t=="object")return gf(t,e)}var HH={SCHEMES:H7e,normalize:W7e,resolve:Y7e,resolveComponent:Sye,equal:K7e,serialize:gf,parse:Dg};NO.exports=HH;NO.exports.default=HH;NO.exports.fastUri=HH});var wye=y(WH=>{"use strict";Object.defineProperty(WH,"__esModule",{value:!0});var Tye=bye();Tye.code='require("ajv/dist/runtime/uri").default';WH.default=Tye});var Nye=y(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.CodeGen=rn.Name=rn.nil=rn.stringify=rn.str=rn._=rn.KeywordCxt=void 0;var Q7e=ib();Object.defineProperty(rn,"KeywordCxt",{enumerable:!0,get:function(){return Q7e.KeywordCxt}});var Lg=Ze();Object.defineProperty(rn,"_",{enumerable:!0,get:function(){return Lg._}});Object.defineProperty(rn,"str",{enumerable:!0,get:function(){return Lg.str}});Object.defineProperty(rn,"stringify",{enumerable:!0,get:function(){return Lg.stringify}});Object.defineProperty(rn,"nil",{enumerable:!0,get:function(){return Lg.nil}});Object.defineProperty(rn,"Name",{enumerable:!0,get:function(){return Lg.Name}});Object.defineProperty(rn,"CodeGen",{enumerable:!0,get:function(){return Lg.CodeGen}});var eet=RO(),Iye=ob(),tet=vH(),ab=IO(),ret=Ze(),cb=tb(),kO=eb(),KH=lt(),xye=oye(),net=wye(),Pye=(t,e)=>new RegExp(t,e);Pye.code="new RegExp";var iet=["removeAdditional","useDefaults","coerceTypes"],oet=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),set={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},aet={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Aye=200;function cet(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_,v,T,b,A,k,P,N,D;let F=t.strict,E=(e=t.code)===null||e===void 0?void 0:e.optimize,oe=E===!0||E===void 0?1:E||0,M=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Pye,S=(i=t.uriResolver)!==null&&i!==void 0?i:net.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:F)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:F)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:F)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:F)!==null&&f!==void 0?f:"log",strictRequired:(h=(p=t.strictRequired)!==null&&p!==void 0?p:F)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:oe,regExp:M}:{optimize:oe,regExp:M},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:Aye,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Aye,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(T=t.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(b=t.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(A=t.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(k=t.validateSchema)!==null&&k!==void 0?k:!0,validateFormats:(P=t.validateFormats)!==null&&P!==void 0?P:!0,unicodeRegExp:(N=t.unicodeRegExp)!==null&&N!==void 0?N:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:S}}var lb=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...cet(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new ret.ValueScope({scope:{},prefixes:oet,es5:r,lines:n}),this.logger=met(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,tet.getRules)(),Rye.call(this,set,e,"NOT SUPPORTED"),Rye.call(this,aet,e,"DEPRECATED","warn"),this._metaOpts=pet.call(this),e.formats&&det.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&fet.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),uet.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=xye;n==="id"&&(i={...xye},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof Iye.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,cb.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Cye.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new ab.SchemaEnv({schema:{},schemaId:n});if(r=ab.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Cye.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,cb.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(_et.call(this,n,r),!r)return(0,KH.eachItem)(n,o=>YH.call(this,o)),this;Eet.call(this,r);let i={...r,type:(0,kO.getJSONTypes)(r.type),schemaType:(0,kO.getJSONTypes)(r.schemaType)};return(0,KH.eachItem)(n,i.type.length===0?o=>YH.call(this,o,i):o=>i.type.forEach(s=>YH.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=Oye(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,cb.normalizeId)(s||n);let l=cb.getSchemaRefs.call(this,e,n);return c=new ab.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ab.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{ab.compileSchema.call(this,e)}finally{this.opts=r}}};lb.ValidationError=eet.default;lb.MissingRefError=Iye.default;rn.default=lb;function Rye(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Cye(t){return t=(0,cb.normalizeId)(t),this.schemas[t]||this.refs[t]}function uet(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function det(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function fet(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function pet(){let t={...this.opts};for(let e of iet)delete t[e];return t}var het={log(){},warn(){},error(){}};function met(t){if(t===!1)return het;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var get=/^[a-z_$][a-z0-9_$:-]*$/i;function _et(t,e){let{RULES:r}=this;if((0,KH.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!get.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function YH(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,kO.getJSONTypes)(e.type),schemaType:(0,kO.getJSONTypes)(e.schemaType)}};e.before?yet.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function yet(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Eet(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Oye(e)),t.validateSchema=this.compile(e,!0))}var vet={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Oye(t){return{anyOf:[t,vet]}}});var kye=y(ZH=>{"use strict";Object.defineProperty(ZH,"__esModule",{value:!0});var bet={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ZH.default=bet});var Lye=y(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.callRef=_f.getValidate=void 0;var Tet=ob(),Mye=to(),ni=Ze(),Ug=fc(),$ye=IO(),MO=lt(),wet={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=$ye.resolveRef.call(c,l,i,r);if(u===void 0)throw new Tet.default(n.opts.uriResolver,i,r);if(u instanceof $ye.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return $O(t,s,o,o.$async);let h=e.scopeValue("root",{ref:l});return $O(t,(0,ni._)`${h}.validate`,l,l.$async)}function f(h){let m=Dye(t,h);$O(t,m,h,h.$async)}function p(h){let m=e.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,ni.stringify)(h)}:{ref:h}),g=e.name("valid"),_=t.subschema({schema:h,dataTypes:[],schemaPath:ni.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function Dye(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ni._)`${r.scopeValue("wrapper",{ref:e})}.validate`}_f.getValidate=Dye;function $O(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Ug.default.this:ni.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=i.let("valid");i.try(()=>{i.code((0,ni._)`await ${(0,Mye.callValidateCode)(t,e,l)}`),p(e),s||i.assign(h,!0)},m=>{i.if((0,ni._)`!(${m} instanceof ${o.ValidationError})`,()=>i.throw(m)),f(m),s||i.assign(h,!1)}),t.ok(h)}function d(){t.result((0,Mye.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(h){let m=(0,ni._)`${h}.errors`;i.assign(Ug.default.vErrors,(0,ni._)`${Ug.default.vErrors} === null ? ${m} : ${Ug.default.vErrors}.concat(${m})`),i.assign(Ug.default.errors,(0,ni._)`${Ug.default.vErrors}.length`)}function p(h){var m;if(!o.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=MO.mergeEvaluated.props(i,g.props,o.props));else{let _=i.var("props",(0,ni._)`${h}.evaluated.props`);o.props=MO.mergeEvaluated.props(i,_,o.props,ni.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=MO.mergeEvaluated.items(i,g.items,o.items));else{let _=i.var("items",(0,ni._)`${h}.evaluated.items`);o.items=MO.mergeEvaluated.items(i,_,o.items,ni.Name)}}}_f.callRef=$O;_f.default=wet});var Uye=y(JH=>{"use strict";Object.defineProperty(JH,"__esModule",{value:!0});var xet=kye(),Aet=Lye(),Ret=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xet.default,Aet.default];JH.default=Ret});var Fye=y(XH=>{"use strict";Object.defineProperty(XH,"__esModule",{value:!0});var DO=Ze(),ru=DO.operators,LO={maximum:{okStr:"<=",ok:ru.LTE,fail:ru.GT},minimum:{okStr:">=",ok:ru.GTE,fail:ru.LT},exclusiveMaximum:{okStr:"<",ok:ru.LT,fail:ru.GTE},exclusiveMinimum:{okStr:">",ok:ru.GT,fail:ru.LTE}},Cet={message:({keyword:t,schemaCode:e})=>(0,DO.str)`must be ${LO[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,DO._)`{comparison: ${LO[t].okStr}, limit: ${e}}`},Iet={keyword:Object.keys(LO),type:"number",schemaType:"number",$data:!0,error:Cet,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,DO._)`${r} ${LO[e].fail} ${n} || isNaN(${r})`)}};XH.default=Iet});var zye=y(QH=>{"use strict";Object.defineProperty(QH,"__esModule",{value:!0});var ub=Ze(),Pet={message:({schemaCode:t})=>(0,ub.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ub._)`{multipleOf: ${t}}`},Oet={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Pet,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,ub._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,ub._)`${s} !== parseInt(${s})`;t.fail$data((0,ub._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};QH.default=Oet});var Bye=y(e6=>{"use strict";Object.defineProperty(e6,"__esModule",{value:!0});function jye(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}e6.default=jye;jye.code='require("ajv/dist/runtime/ucs2length").default'});var qye=y(t6=>{"use strict";Object.defineProperty(t6,"__esModule",{value:!0});var yf=Ze(),Net=lt(),ket=Bye(),Met={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,yf.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,yf._)`{limit: ${t}}`},$et={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Met,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?yf.operators.GT:yf.operators.LT,s=i.opts.unicode===!1?(0,yf._)`${r}.length`:(0,yf._)`${(0,Net.useFunc)(t.gen,ket.default)}(${r})`;t.fail$data((0,yf._)`${s} ${o} ${n}`)}};t6.default=$et});var Vye=y(r6=>{"use strict";Object.defineProperty(r6,"__esModule",{value:!0});var Det=to(),Let=lt(),Fg=Ze(),Uet={message:({schemaCode:t})=>(0,Fg.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Fg._)`{pattern: ${t}}`},Fet={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Uet,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Fg._)`new RegExp`:(0,Let.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Fg._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Fg._)`!${u}`)}else{let c=(0,Det.usePattern)(t,i);t.fail$data((0,Fg._)`!${c}.test(${r})`)}}};r6.default=Fet});var Gye=y(n6=>{"use strict";Object.defineProperty(n6,"__esModule",{value:!0});var db=Ze(),zet={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,db.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,db._)`{limit: ${t}}`},jet={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:zet,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?db.operators.GT:db.operators.LT;t.fail$data((0,db._)`Object.keys(${r}).length ${i} ${n}`)}};n6.default=jet});var Hye=y(i6=>{"use strict";Object.defineProperty(i6,"__esModule",{value:!0});var fb=to(),pb=Ze(),Bet=lt(),qet={message:({params:{missingProperty:t}})=>(0,pb.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,pb._)`{missingProperty: ${t}}`},Vet={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qet,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:h}=t.it;for(let m of r)if(p?.[m]===void 0&&!h.has(m)){let g=s.schemaEnv.baseId+s.errSchemaPath,_=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,Bet.checkStrictMode)(s,_,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(pb.nil,d);else for(let p of r)(0,fb.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let h=e.let("valid",!0);t.block$data(h,()=>f(p,h)),t.ok(h)}else e.if((0,fb.checkMissingProp)(t,r,p)),(0,fb.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,fb.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,h){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(h,(0,fb.propertyInData)(e,i,p,a.ownProperties)),e.if((0,pb.not)(h),()=>{t.error(),e.break()})},pb.nil)}}};i6.default=Vet});var Wye=y(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0});var hb=Ze(),Get={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,hb.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,hb._)`{limit: ${t}}`},Het={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Get,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?hb.operators.GT:hb.operators.LT;t.fail$data((0,hb._)`${r}.length ${i} ${n}`)}};o6.default=Het});var UO=y(s6=>{"use strict";Object.defineProperty(s6,"__esModule",{value:!0});var Yye=IH();Yye.code='require("ajv/dist/runtime/equal").default';s6.default=Yye});var Kye=y(c6=>{"use strict";Object.defineProperty(c6,"__esModule",{value:!0});var a6=eb(),nn=Ze(),Wet=lt(),Yet=UO(),Ket={message:({params:{i:t,j:e}})=>(0,nn.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,nn._)`{i: ${t}, j: ${e}}`},Zet={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Ket,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,a6.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,nn._)`${s} === false`),t.ok(c);function u(){let h=e.let("i",(0,nn._)`${r}.length`),m=e.let("j");t.setParams({i:h,j:m}),e.assign(c,!0),e.if((0,nn._)`${h} > 1`,()=>(d()?f:p)(h,m))}function d(){return l.length>0&&!l.some(h=>h==="object"||h==="array")}function f(h,m){let g=e.name("item"),_=(0,a6.checkDataTypes)(l,g,a.opts.strictNumbers,a6.DataType.Wrong),v=e.const("indices",(0,nn._)`{}`);e.for((0,nn._)`;${h}--;`,()=>{e.let(g,(0,nn._)`${r}[${h}]`),e.if(_,(0,nn._)`continue`),l.length>1&&e.if((0,nn._)`typeof ${g} == "string"`,(0,nn._)`${g} += "_"`),e.if((0,nn._)`typeof ${v}[${g}] == "number"`,()=>{e.assign(m,(0,nn._)`${v}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,nn._)`${v}[${g}] = ${h}`)})}function p(h,m){let g=(0,Wet.useFunc)(e,Yet.default),_=e.name("outer");e.label(_).for((0,nn._)`;${h}--;`,()=>e.for((0,nn._)`${m} = ${h}; ${m}--;`,()=>e.if((0,nn._)`${g}(${r}[${h}], ${r}[${m}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};c6.default=Zet});var Zye=y(u6=>{"use strict";Object.defineProperty(u6,"__esModule",{value:!0});var l6=Ze(),Jet=lt(),Xet=UO(),Qet={message:"must be equal to constant",params:({schemaCode:t})=>(0,l6._)`{allowedValue: ${t}}`},ett={keyword:"const",$data:!0,error:Qet,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,l6._)`!${(0,Jet.useFunc)(e,Xet.default)}(${r}, ${i})`):t.fail((0,l6._)`${o} !== ${r}`)}};u6.default=ett});var Jye=y(d6=>{"use strict";Object.defineProperty(d6,"__esModule",{value:!0});var mb=Ze(),ttt=lt(),rtt=UO(),ntt={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,mb._)`{allowedValues: ${t}}`},itt={keyword:"enum",schemaType:"array",$data:!0,error:ntt,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,ttt.useFunc)(e,rtt.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,mb.or)(...i.map((h,m)=>f(p,m)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,mb._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,h){let m=i[h];return typeof m=="object"&&m!==null?(0,mb._)`${l()}(${r}, ${p}[${h}])`:(0,mb._)`${r} === ${m}`}}};d6.default=itt});var Xye=y(f6=>{"use strict";Object.defineProperty(f6,"__esModule",{value:!0});var ott=Fye(),stt=zye(),att=qye(),ctt=Vye(),ltt=Gye(),utt=Hye(),dtt=Wye(),ftt=Kye(),ptt=Zye(),htt=Jye(),mtt=[ott.default,stt.default,att.default,ctt.default,ltt.default,utt.default,dtt.default,ftt.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ptt.default,htt.default];f6.default=mtt});var h6=y(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.validateAdditionalItems=void 0;var Sf=Ze(),p6=lt(),gtt={message:({params:{len:t}})=>(0,Sf.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Sf._)`{limit: ${t}}`},_tt={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:gtt,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,p6.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Qye(t,n)}};function Qye(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,Sf._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Sf._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,p6.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Sf._)`${a} <= ${e.length}`);r.if((0,Sf.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:p6.Type.Num},l),s.allErrors||r.if((0,Sf.not)(l),()=>r.break())})}}gb.validateAdditionalItems=Qye;gb.default=_tt});var m6=y(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});_b.validateTuple=void 0;var eSe=Ze(),FO=lt(),ytt=to(),Stt={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return tSe(t,"additionalItems",e);r.items=!0,!(0,FO.alwaysValidSchema)(r,e)&&t.ok((0,ytt.validateArray)(t))}};function tSe(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=FO.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,eSe._)`${o}.length`);r.forEach((d,f)=>{(0,FO.alwaysValidSchema)(a,d)||(n.if((0,eSe._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,h=r.length,m=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(f.strictTuples&&!m){let g=`"${s}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,FO.checkStrictMode)(a,g,f.strictTuples)}}}_b.validateTuple=tSe;_b.default=Stt});var rSe=y(g6=>{"use strict";Object.defineProperty(g6,"__esModule",{value:!0});var Ett=m6(),vtt={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Ett.validateTuple)(t,"items")};g6.default=vtt});var iSe=y(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0});var nSe=Ze(),btt=lt(),Ttt=to(),wtt=h6(),xtt={message:({params:{len:t}})=>(0,nSe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,nSe._)`{limit: ${t}}`},Att={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:xtt,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,btt.alwaysValidSchema)(n,e)&&(i?(0,wtt.validateAdditionalItems)(t,i):t.ok((0,Ttt.validateArray)(t)))}};_6.default=Att});var oSe=y(y6=>{"use strict";Object.defineProperty(y6,"__esModule",{value:!0});var no=Ze(),zO=lt(),Rtt={message:({params:{min:t,max:e}})=>e===void 0?(0,no.str)`must contain at least ${t} valid item(s)`:(0,no.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,no._)`{minContains: ${t}}`:(0,no._)`{minContains: ${t}, maxContains: ${e}}`},Ctt={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Rtt,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,no._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,zO.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,zO.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,zO.alwaysValidSchema)(o,r)){let m=(0,no._)`${u} >= ${s}`;a!==void 0&&(m=(0,no._)`${m} && ${u} <= ${a}`),t.pass(m);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,no._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let m=e.name("_valid"),g=e.let("count",0);p(m,()=>e.if(m,()=>h(g)))}function p(m,g){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:zO.Type.Num,compositeRule:!0},m),g()})}function h(m){e.code((0,no._)`${m}++`),a===void 0?e.if((0,no._)`${m} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,no._)`${m} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,no._)`${m} >= ${s}`,()=>e.assign(d,!0)))}}};y6.default=Ctt});var cSe=y(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.validateSchemaDeps=Ys.validatePropertyDeps=Ys.error=void 0;var S6=Ze(),Itt=lt(),yb=to();Ys.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,S6.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,S6._)`{property: ${t},
|
|
22
|
+
`)+1))),this.lastActivityTimestamp=new Date}trace(e,r){(0,jA.trace)(r??Vc.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,BA.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},xLe)),!((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,jA.trace)(Vc.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,BA.uriToString)(this.target)+" "+Bi.ConnectivityState[this.connectivityState]+" -> "+Bi.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Bi.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!==Bi.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!==Bi.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(Bi.ConnectivityState.IDLE),this.currentPicker=new r1.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 o=new Date().valueOf()-this.lastActivityTimestamp.valueOf();o>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-o)},e),(n=(r=this.idleTimer).unref)===null||n===void 0||n.call(r)}maybeStartIdleTimer(){this.connectivityState!==Bi.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===Vc.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,n,i,o){let s=(0,e1.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+s+'] method="'+r+'"'),new ELe.LoadBalancingCall(this,e,r,n,i,o,s)}createRetryingCall(e,r,n,i,o){let s=(0,e1.getNextCallNumber)();return this.trace("createRetryingCall ["+s+'] method="'+r+'"'),new t1.RetryingCall(this,e,r,n,i,o,s,this.retryBufferTracker,qA.get(this.getTarget()))}createResolvingCall(e,r,n,i,o){let s=(0,e1.getNextCallNumber)();this.trace("createResolvingCall ["+s+'] method="'+e+'", deadline='+(0,vLe.deadlineToString)(r));let a={deadline:r,flags:o??Vc.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new bLe.ResolvingCall(this,e,a,this.filterStackFactory.clone(),s);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Bi.ConnectivityState.SHUTDOWN),this.currentPicker=new i1;for(let r of this.configSelectionQueue)r.cancelWithStatus(Vc.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(Vc.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,Qy.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,BA.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===Bi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(r!==1/0){let s=r instanceof Date?r:new Date(r),a=new Date;if(r===-1/0||s<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(o),n(new Error("Deadline passed without connectivity state change"))},s.getTime()-a.getTime())}let o={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(o)}getChannelzRef(){return this.channelzRef}createCall(e,r,n,i,o){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===Bi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,n,i,o)}getOptions(){return this.options}};Ju.InternalChannel=s1});var eD=y(VA=>{"use strict";Object.defineProperty(VA,"__esModule",{value:!0});VA.ChannelImplementation=void 0;var PLe=ap(),OLe=a1(),c1=class{constructor(e,r,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof PLe.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 OLe.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,o){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,o)}};VA.ChannelImplementation=c1});var Ete=y(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.ServerDuplexStreamImpl=xo.ServerWritableStreamImpl=xo.ServerReadableStreamImpl=xo.ServerUnaryCallImpl=void 0;xo.serverErrorToStatus=m1;var NLe=Z("events"),p1=Z("stream"),h1=Xe(),Ste=Ar();function m1(t,e){var r;let n={code:h1.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 l1=class extends NLe.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()}};xo.ServerUnaryCallImpl=l1;var u1=class extends p1.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()}};xo.ServerReadableStreamImpl=u1;var d1=class extends p1.Writable{constructor(e,r,n,i){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.request=i,this.pendingStatus={code:h1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ste.Metadata,this.on("error",o=>{this.pendingStatus=m1(o),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()}};xo.ServerWritableStreamImpl=d1;var f1=class extends p1.Duplex{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.pendingStatus={code:h1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ste.Metadata,this.on("error",i=>{this.pendingStatus=m1(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()}};xo.ServerDuplexStreamImpl=f1});var GA=y(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.ServerCredentials=void 0;Mp.createCertificateProviderServerCredentials=kLe;Mp.createServerCredentialsWithInterceptors=MLe;var g1=b$(),Xu=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 _1}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 o=[],s=[];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`);o.push(c.cert_chain),s.push(c.private_key)}return new y1({requestCert:n,ciphers:g1.CIPHER_SUITES},{ca:(i=e??(0,g1.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:o,key:s})}};Mp.ServerCredentials=Xu;var _1=class t extends Xu{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},y1=class t extends Xu{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}},S1=class t extends Xu{constructor(e,r,n){super({requestCert:r!==null,rejectUnauthorized:n,ciphers:g1.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 kLe(t,e,r){return new S1(t,e,r)}var E1=class t extends Xu{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 MLe(t,e){return new E1(t,e)}});var eS=y(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.durationMessageToDuration=$Le;wa.msToDuration=DLe;wa.durationToMs=LLe;wa.isDuration=ULe;wa.isDurationMessage=FLe;wa.parseDuration=jLe;wa.durationToString=BLe;function $Le(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function DLe(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function LLe(t){return t.seconds*1e3+t.nanos/1e6|0}function ULe(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function FLe(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var zLe=/^(\d+)(?:\.(\d+))?s$/;function jLe(t){let e=t.match(zLe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function BLe(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 WA=y(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.OrcaOobMetricsSubchannelWrapper=hi.GRPC_METRICS_HEADER=hi.ServerMetricRecorder=hi.PerRequestMetricRecorder=void 0;hi.createOrcaClient=wte;hi.createMetricsReader=KLe;var qLe=Dx(),v1=eS(),VLe=ap(),GLe=Xy(),vte=Xe(),HLe=cp(),WLe=An(),bte=null;function HA(){if(bte)return bte;let t=cL().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,qLe.loadPackageDefinition)(e)}var b1=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 HA().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};hi.PerRequestMetricRecorder=b1;var YLe=3e4,T1=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,v1.durationToMs)((0,v1.durationMessageToDuration)(e.request.report_interval)):YLe,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=HA().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};hi.ServerMetricRecorder=T1;function wte(t){let e=HA().xds.service.orca.v3.OpenRcaService;return new e("unused",VLe.ChannelCredentials.createInsecure(),{channelOverride:t})}hi.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var Tte="grpc_orca_load_report";function KLe(t,e){return(r,n,i)=>{let o=i.getOpaque(Tte);if(o)t(o);else{let s=i.get(hi.GRPC_METRICS_HEADER);s.length>0&&(o=HA().xds.data.orca.v3.OrcaLoadReport.deserialize(s[0]),t(o),i.setOpaque(Tte,o))}e&&e(r,n,i)}}var xte="orca_oob_metrics",w1=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(xte,ZLe);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)}},x1=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new HLe.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=wte(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(xte),(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()!==WLe.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,v1.msToDuration)(r)});this.metricsCall=n,n.on("data",i=>{this.dataWatchers.forEach(o=>{o.onMetricsUpdate(i)})}),n.on("error",i=>{if(this.metricsCall=null,i.code===vte.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}i.code!==vte.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},A1=class extends GLe.BaseSubchannelWrapper{constructor(e,r,n){super(e),this.addDataWatcher(new w1(r,n))}getWrappedSubchannel(){return this.child}};hi.OrcaOobMetricsSubchannelWrapper=A1;function ZLe(t){return new x1(t)}});var k1=y(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.BaseServerInterceptingCall=qi.ServerInterceptingCall=qi.ResponderBuilder=qi.ServerListenerBuilder=void 0;qi.isInterceptingServerListener=QLe;qi.getServerInterceptingCall=i1e;var ZA=Ar(),Cn=Xe(),$p=Z("http2"),Ate=fx(),Rte=Z("zlib"),JLe=FL(),Nte=Nt(),XLe=Z("tls"),Cte=WA(),kte="server_call";function Qu(t){Nte.trace(Cn.LogVerbosity.DEBUG,kte,t)}var C1=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}}};qi.ServerListenerBuilder=C1;function QLe(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var I1=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()}},P1=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}}};qi.ResponderBuilder=P1;var YA={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},KA={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},O1=class{constructor(e,r){var n,i,o,s;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:KA.start,sendMetadata:(i=r?.sendMetadata)!==null&&i!==void 0?i:KA.sendMetadata,sendMessage:(o=r?.sendMessage)!==null&&o!==void 0?o:KA.sendMessage,sendStatus:(s=r?.sendStatus)!==null&&s!==void 0?s:KA.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,o,s;let a={onReceiveMetadata:(n=r?.onReceiveMetadata)!==null&&n!==void 0?n:YA.onReceiveMetadata,onReceiveMessage:(i=r?.onReceiveMessage)!==null&&i!==void 0?i:YA.onReceiveMessage,onReceiveHalfClose:(o=r?.onReceiveHalfClose)!==null&&o!==void 0?o:YA.onReceiveHalfClose,onCancel:(s=r?.onCancel)!==null&&s!==void 0?s:YA.onCancel},c=new I1(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 ZA.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()}};qi.ServerInterceptingCall=O1;var Mte="grpc-accept-encoding",N1="grpc-encoding",Ite="grpc-message",Pte="grpc-status",R1="grpc-timeout",e1e=/(\d{1,8})\s*([HMSmun])/,t1e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},r1e={[Mte]:"identity,deflate,gzip",[N1]:"identity"},Ote={[$p.constants.HTTP2_HEADER_STATUS]:$p.constants.HTTP_STATUS_OK,[$p.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},n1e={waitForTrailers:!0},JA=class{constructor(e,r,n,i,o){var s,a;this.stream=e,this.callEventTracker=n,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=Cn.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=Cn.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 Cte.PerRequestMetricRecorder,this.stream.once("close",()=>{var f;Qu("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:Cn.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 o&&(this.maxSendMessageSize=o["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in o&&(this.maxReceiveMessageSize=o["grpc.max_receive_message_length"]),this.host=(s=r[":authority"])!==null&&s!==void 0?s:r.host,this.decoder=new JLe.StreamDecoder(this.maxReceiveMessageSize);let c=ZA.Metadata.fromHttp2Headers(r);Nte.isTracerEnabled(kte)&&Qu("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let l=c.get(R1);l.length>0&&this.handleTimeoutHeader(l[0]);let u=c.get(N1);u.length>0&&(this.incomingEncoding=u[0]),c.remove(R1),c.remove(N1),c.remove(Mte),c.remove($p.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove($p.constants.HTTP2_HEADER_TE),c.remove($p.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=!!o["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(e1e);if(r===null){let o={code:Cn.Status.INTERNAL,details:`Invalid ${R1} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(o)});return}let n=+r[1]*t1e[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let o={code:Cn.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(o)},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 ZA.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=Rte.createInflate():i=Rte.createGunzip(),new Promise((o,s)=>{let a=0,c=[];i.on("error",l=>{s({code:Cn.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(),s({code:Cn.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{o(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:Cn.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(o){this.sendStatus(o);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(o){this.sendStatus({code:Cn.Status.INTERNAL,details:`Error deserializing request: ${o.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;Qu("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:Cn.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let o={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(o),this.decompressAndMaybePush(o),(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){Qu("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({},Ote),r1e),r);this.stream.respond(n,n1e)}sendMessage(e,r){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:Cn.Status.INTERNAL,details:`Error serializing response: ${(0,Ate.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:Cn.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Qu("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var o;if(i){this.sendStatus({code:Cn.Status.INTERNAL,details:`Error writing message: ${(0,Ate.getErrorMessage)(i)}`,metadata:null});return}(o=this.callEventTracker)===null||o===void 0||o.addMessageSent(),r()})}sendStatus(e){var r,n,i;if(this.checkCancelled())return;Qu("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+Cn.Status[e.code]+" details: "+e.details);let o=(i=(n=e.metadata)===null||n===void 0?void 0:n.clone())!==null&&i!==void 0?i:new ZA.Metadata;if(this.shouldSendMetrics&&o.set(Cte.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 s=Object.assign({[Pte]:e.code,[Ite]:encodeURI(e.details)},o.toHttp2Headers());this.stream.sendTrailers(s),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Pte]:e.code,[Ite]:encodeURI(e.details)},Ote),o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Qu("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 XLe.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}};qi.BaseServerInterceptingCall=JA;function i1e(t,e,r,n,i,o){let s={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 JA(e,r,n,i,o);return t.reduce((c,l)=>l(s,c),a)}});var jte=y(Hc=>{"use strict";var o1e=Hc&&Hc.__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},s1e=Hc&&Hc.__esDecorate||function(t,e,r,n,i,o){function s(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}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(_){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(_||null))};var g=(0,r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],h);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(d=s(g.get))&&(u.get=d),(d=s(g.set))&&(u.set=d),(d=s(g.init))&&i.unshift(d)}else(d=s(g))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Server=void 0;var Vn=Z("http2"),a1e=Z("util"),rr=Xe(),Up=Ete(),M1=GA(),$te=fo(),Lp=Nt(),Gc=Bn(),Ao=xn(),_r=zc(),Dte=k1(),Dp=~(1<<31),$1=~(1<<31),c1e=2e4,Lte=~(1<<31),{HTTP2_HEADER_PATH:Ute}=Vn.constants,l1e="server",Fte=Buffer.from("max_age");function zte(t){Lp.trace(rr.LogVerbosity.DEBUG,"server_call",t)}function u1e(){}function d1e(t){return function(e,r){return a1e.deprecate(e,t)}}function D1(t){return{code:rr.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function f1e(t,e){let r=D1(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 p1e=(()=>{var t;let e=[],r;return t=class{constructor(i){var o,s,a,c,l,u;this.boundPorts=(o1e(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 _r.ChannelzTraceStub,this.callTracker=new _r.ChannelzCallTrackerStub,this.listenerChildrenTracker=new _r.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new _r.ChannelzChildrenTrackerStub):(this.channelzTrace=new _r.ChannelzTrace,this.callTracker=new _r.ChannelzCallTracker,this.listenerChildrenTracker=new _r.ChannelzChildrenTracker,this.sessionChildrenTracker=new _r.ChannelzChildrenTracker),this.channelzRef=(0,_r.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(o=this.options["grpc.max_connection_age_ms"])!==null&&o!==void 0?o:Dp,this.maxConnectionAgeGraceMs=(s=this.options["grpc.max_connection_age_grace_ms"])!==null&&s!==void 0?s:Dp,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:$1,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:c1e,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:Lte,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 o,s,a;let c=this.sessions.get(i),l=i.socket,u=l.remoteAddress?(0,Gc.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Gc.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let h=l,m=h.getCipher(),g=h.getCertificate(),_=h.getPeerCertificate();f={cipherSuiteStandardName:(o=m.standardName)!==null&&o!==void 0?o:null,cipherSuiteOtherName:m.standardName?null:m.name,localCertificate:g&&"raw"in g?g.raw:null,remoteCertificate:_&&"raw"in _?_.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:(s=i.state.localWindowSize)!==null&&s!==void 0?s:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){Lp.trace(rr.LogVerbosity.DEBUG,l1e,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){Lp.trace(rr.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,o){if(i===null||typeof i!="object"||o===null||typeof o!="object")throw new Error("addService() requires two objects as arguments");let s=Object.keys(i);if(s.length===0)throw new Error("Cannot add an empty service to a server");s.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let u=o[a],d;if(u===void 0&&typeof c.originalName=="string"&&(u=o[c.originalName]),u!==void 0?d=u.bind(o):d=f1e(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(s=>{let a=i[s];this.unregister(a.path)})}bind(i,o){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,_r.registerChannelzSocket)((0,Gc.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,_r.unregisterChannelzRef)(i)}createHttp2Server(i){let o;if(i._isSecure()){let s=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),s),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),o=Vn.createSecureServer(c),o.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),o.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=o;try{f.setSecureContext(d)}catch(p){Lp.log(rr.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),o.on("close",()=>{i._removeWatcher(u)})}else o=Vn.createServer(this.commonServerOptions);return o.setTimeout(0,u1e),this._setupHandlers(o,i._getInterceptors()),o}bindOneAddress(i,o){this.trace("Attempting to bind "+(0,Gc.subchannelAddressToString)(i));let s=this.createHttp2Server(o.credentials);return new Promise((a,c)=>{let l=u=>{this.trace("Failed to bind "+(0,Gc.subchannelAddressToString)(i)+" with error "+u.message),a({port:"port"in i?i.port:1,error:u.message})};s.once("error",l),s.listen(i,()=>{let u=s.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(s,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),o.listeningServers.add(s),this.trace("Successfully bound "+(0,Gc.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),s.removeListener("error",l)})})}async bindManyPorts(i,o){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Gc.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let s=await this.bindOneAddress(i[0],o);if(s.error){let a=await this.bindManyPorts(i.slice(1),o);return Object.assign(Object.assign({},a),{errors:[s.error,...a.errors]})}else{let a=i.slice(1).map(u=>(0,Gc.isTcpSubchannelAddress)(u)?{host:u.host,port:s.port}:u),c=await Promise.all(a.map(u=>this.bindOneAddress(u,o))),l=[s,...c];return{count:l.filter(u=>u.error===void 0).length,port:s.port,errors:l.filter(u=>u.error).map(u=>u.error)}}}else{let s=await Promise.all(i.map(a=>this.bindOneAddress(a,o)));return{count:s.filter(a=>a.error===void 0).length,port:s[0].port,errors:s.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,o){let s=await this.bindManyPorts(i,o);if(s.count>0)return s.count<i.length&&Lp.log(rr.LogVerbosity.INFO,`WARNING Only ${s.count} addresses added out of total ${i.length} resolved`),s.port;{let a=`No address added out of total ${i.length} resolved`;throw Lp.log(rr.LogVerbosity.ERROR,a),new Error(`${a} errors: [${s.errors.join(",")}]`)}}resolvePort(i){return new Promise((o,s)=>{let a=!1,c=(u,d,f,p)=>{if(a)return!0;if(a=!0,!u.ok)return s(new Error(u.error.details)),!0;let h=[].concat(...u.value.map(m=>m.addresses));return h.length===0?(s(new Error(`No addresses resolved for port ${i}`)),!0):(o(h),!0)};(0,$te.createResolver)(i,c,this.options).updateResolution()})}async bindPort(i,o){let s=await this.resolvePort(i);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(s,o);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let o=(0,Ao.parseUri)(i);if(o===null)throw new Error(`Could not parse port "${i}"`);let s=(0,$te.mapUriDefaultScheme)(o);if(s===null)throw new Error(`Could not get a default scheme for port "${i}"`);return s}bindAsync(i,o,s){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(o===null||!(o instanceof M1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof s!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,p)=>{process.nextTick(()=>s(f,p))},l=this.boundPorts.get((0,Ao.uriToString)(a));if(l){if(!o._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>s(null,f),f=>s(f,0)):c(null,l.portNumber);return}l={mapKey:(0,Ao.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:o,listeningServers:new Set};let u=(0,Ao.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,Ao.combineHostPort)({host:u.host,port:f})};l.mapKey=(0,Ao.uriToString)(p),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),s(null,f)},f=>{s(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,s(null,f)},f=>{s(f,0)}))}registerInjectorToChannelz(){return(0,_r.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,o,s=!1){if(i===null||!(i instanceof M1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(o);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:o,sessions:c,ownsChannelzRef:s}),{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(Vn.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 M1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let o=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,o,!0)}closeServer(i,o){this.trace("Closing server with address "+JSON.stringify(i.address()));let s=this.http2Servers.get(i);i.close(()=>{s&&s.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(s.channelzRef),(0,_r.unregisterChannelzRef)(s.channelzRef)),this.http2Servers.delete(i),o?.()})}closeSession(i,o){var s;this.trace("Closing session initiated by "+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,_r.unregisterChannelzRef)(a.ref)),o?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let o of i.listeningServers){let s=this.http2Servers.get(o);if(this.closeServer(o,()=>{i.listeningServers.delete(o)}),s)for(let a of s.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let o=this.normalizePort(i),s=(0,Ao.splitHostPort)(o.path);if(s?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,Ao.uriToString)(o));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,Ao.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,o){var s,a;this.trace("drain port="+i+" graceTimeMs="+o);let c=this.normalizePort(i),l=(0,Ao.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Ao.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=(s=setTimeout(()=>{for(let f of d)f.destroy(Vn.constants.NGHTTP2_CANCEL)},o)).unref)===null||a===void 0||a.call(s)}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,o)=>{this.closeSession(o),o.destroy(Vn.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,_r.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,o,s,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:o,serialize:s,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 o;let s=l=>{(0,_r.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&s()}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=(o=f.socket)===null||o===void 0?void 0:o.remoteAddress;this.trace("Waiting for session "+p+" to close"),this.closeSession(f,()=>{this.trace("Session "+p+" finished closing"),c()})}}a===0&&s()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,o){let s=o[Vn.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof s!="string"||!s.startsWith("application/grpc")?(i.respond({[Vn.constants.HTTP2_HEADER_STATUS]:Vn.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){zte("Received call to method "+i+" at address "+this.serverAddressString);let o=this.handlers.get(i);return o===void 0?(zte("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):o}_respondWithError(i,o,s=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:rr.Status.INTERNAL,"grpc-message":i.details,[Vn.constants.HTTP2_HEADER_STATUS]:Vn.constants.HTTP_STATUS_OK,[Vn.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());o.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),s?.streamTracker.addCallFailed()}_channelzHandler(i,o,s){o.once("error",f=>{}),this.onStreamOpened(o);let a=this.sessions.get(o.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(o,s)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=s[Ute],l=this._retrieveHandler(c);if(!l){this._respondWithError(D1(c),o,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===rr.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,Dte.getServerInterceptingCall)([...i,...this.interceptors],o,s,u,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,o,s){if(o.once("error",u=>{}),this.onStreamOpened(o),this._verifyContentType(o,s)!==!0)return;let a=s[Ute],c=this._retrieveHandler(a);if(!c){this._respondWithError(D1(a),o,null);return}let l=(0,Dte.getServerInterceptingCall)([...i,...this.interceptors],o,s,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,o){let{type:s}=o;if(s==="unary")h1e(i,o);else if(s==="clientStream")m1e(i,o);else if(s==="serverStream")g1e(i,o);else if(s==="bidi")_1e(i,o);else return!1;return!0}_setupHandlers(i,o){if(i===null)return;let s=i.address(),a="null";s&&(typeof s=="string"?a=s:a=s.address+":"+s.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,o)),i.on("session",l)}_sessionHandler(i){return o=>{var s,a;(s=this.http2Servers.get(i))===null||s===void 0||s.sessions.add(o);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==Dp){let _=this.maxConnectionAgeMs/10,v=Math.random()*_*2-_;c=setTimeout(()=>{var T,b;d=!0,this.trace("Connection dropped by max connection age: "+((T=o.socket)===null||T===void 0?void 0:T.remoteAddress));try{o.goaway(Vn.constants.NGHTTP2_NO_ERROR,~(1<<31),Fte)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==Dp&&(l=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(b=l.unref)===null||b===void 0||b.call(l))},this.maxConnectionAgeMs+v),(a=c.unref)===null||a===void 0||a.call(c)}let p=()=>{u&&(clearTimeout(u),u=null)},h=()=>!o.destroyed&&this.keepaliveTimeMs<$1&&this.keepaliveTimeMs>0,m,g=()=>{var _;h()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{p(),m()},this.keepaliveTimeMs),(_=u.unref)===null||_===void 0||_.call(u))};m=()=>{var _;if(!h())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let v="";try{o.ping((b,A,k)=>{p(),b?(this.keepaliveTrace("Ping failed with error: "+b.message),d=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),g())})||(v="Ping returned false")}catch(T){v=(T instanceof Error?T.message:"")||"Unknown error"}if(v){this.keepaliveTrace("Ping send failed: "+v),this.trace("Connection dropped due to ping send error: "+v),d=!0,o.destroy();return}u=setTimeout(()=>{p(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,o.destroy()},this.keepaliveTimeoutMs),(_=u.unref)===null||_===void 0||_.call(u)},g(),o.on("close",()=>{var _,v;d||this.trace(`Connection dropped by client ${(_=o.socket)===null||_===void 0?void 0:_.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),p(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(o)),(v=this.http2Servers.get(i))===null||v===void 0||v.sessions.delete(o)})}}_channelzSessionHandler(i){return o=>{var s,a,c,l;let u=(0,_r.registerChannelzSocket)((a=(s=o.socket)===null||s===void 0?void 0:s.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,o),this.channelzEnabled),d={ref:u,streamTracker:new _r.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(o),this.sessions.set(o,d);let f=`${o.socket.remoteAddress}:${o.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,g=!1,_=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==Dp){let k=this.maxConnectionAgeMs/10,P=Math.random()*k*2-k;p=setTimeout(()=>{var N;g=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{o.goaway(Vn.constants.NGHTTP2_NO_ERROR,~(1<<31),Fte)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==Dp&&(h=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(N=h.unref)===null||N===void 0||N.call(h))},this.maxConnectionAgeMs+P),(l=p.unref)===null||l===void 0||l.call(p)}let v=()=>{m&&(clearTimeout(m),m=null)},T=()=>!o.destroyed&&this.keepaliveTimeMs<$1&&this.keepaliveTimeMs>0,b,A=()=>{var k;T()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),m=setTimeout(()=>{v(),b()},this.keepaliveTimeMs),(k=m.unref)===null||k===void 0||k.call(m))};b=()=>{var k;if(!T())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let P="";try{o.ping((D,F,E)=>{v(),D?(this.keepaliveTrace("Ping failed with error: "+D.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+D.message+" return in "+F),g=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),A())})||(P="Ping returned false")}catch(N){P=(N instanceof Error?N.message:"")||"Unknown error"}if(P){this.keepaliveTrace("Ping send failed: "+P),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+P),g=!0,o.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),g=!0,o.destroy()},this.keepaliveTimeoutMs),(k=m.unref)===null||k===void 0||k.call(m)},A(),o.on("close",()=>{var k;g||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(u),(0,_r.unregisterChannelzRef)(u),p&&clearTimeout(p),h&&clearTimeout(h),v(),_!==null&&(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(o)),(k=this.http2Servers.get(i))===null||k===void 0||k.sessions.delete(o),this.sessions.delete(o)})}}enableIdleTimeout(i){var o,s;if(this.sessionIdleTimeout>=Lte)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(s=(o=a.timeout).unref)===null||s===void 0||s.call(o),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,o){let{socket:s}=o,a=i.sessionIdleTimeouts.get(o);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+s?.remoteAddress+":"+s?.remotePort+" last idle at "+a.lastIdle),i.closeSession(o)):a.timeout.refresh())}onStreamOpened(i){let o=i.session,s=this.sessionIdleTimeouts.get(o);s&&(s.activeStreams+=1,i.once("close",s.onClose))}onStreamClose(i){var o,s;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress)+":"+((s=i.socket)===null||s===void 0?void 0:s.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[d1e("Calling start() is no longer necessary. It can be safely omitted.")],s1e(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})();Hc.Server=p1e;async function h1e(t,e){let r;function n(s,a,c,l){if(s){t.sendStatus((0,Up.serverErrorToStatus)(s,c));return}t.sendMessage(a,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:c??null})})}let i,o=null;t.start({onReceiveMetadata(s){i=s,t.startRead()},onReceiveMessage(s){if(o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}o=s,t.startRead()},onReceiveHalfClose(){if(!o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Up.ServerWritableStreamImpl(e.path,t,i,o);try{e.func(r,n)}catch(s){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function m1e(t,e){let r;function n(i,o,s,a){if(i){t.sendStatus((0,Up.serverErrorToStatus)(i,s));return}t.sendMessage(o,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:s??null})})}t.start({onReceiveMetadata(i){r=new Up.ServerDuplexStreamImpl(e.path,t,i);try{e.func(r,n)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onReceiveMessage(i){r.push(i)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function g1e(t,e){let r,n,i=null;t.start({onReceiveMetadata(o){n=o,t.startRead()},onReceiveMessage(o){if(i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=o,t.startRead()},onReceiveHalfClose(){if(!i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Up.ServerWritableStreamImpl(e.path,t,n,i);try{e.func(r)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function _1e(t,e){let r;t.start({onReceiveMetadata(n){r=new Up.ServerDuplexStreamImpl(e.path,t,n);try{e.func(r)}catch(i){t.sendStatus({code:rr.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 Bte=y(XA=>{"use strict";Object.defineProperty(XA,"__esModule",{value:!0});XA.StatusBuilder=void 0;var L1=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}};XA.StatusBuilder=L1});var iS=y(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.LeafLoadBalancer=Es.PickFirstLoadBalancer=Es.PickFirstLoadBalancingConfig=void 0;Es.shuffled=Hte;Es.setup=x1e;var U1=Pc(),nr=An(),Wc=fa(),qte=Bn(),y1e=Nt(),S1e=Xe(),Vte=Bn(),Gte=Z("net"),E1e=$u(),v1e="pick_first";function tS(t){y1e.trace(S1e.LogVerbosity.DEBUG,v1e,t)}var rS="pick_first",b1e=250,Fp=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return rS}toJsonObject(){return{[rS]:{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)}};Es.PickFirstLoadBalancingConfig=Fp;var F1=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Wc.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function Hte(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 T1e(t){if(t.length===0)return[];let e=[],r=[],n=[],i=(0,Vte.isTcpSubchannelAddress)(t[0])&&(0,Gte.isIPv6)(t[0].host);for(let a of t)(0,Vte.isTcpSubchannelAddress)(a)&&(0,Gte.isIPv6)(a.host)?r.push(a):n.push(a);let o=i?r:n,s=i?n:r;for(let a=0;a<Math.max(o.length,s.length);a++)a<o.length&&e.push(o[a]),a<s.length&&e.push(s[a]);return e}var Wte="grpc-node.internal.pick-first.report_health_status",nS=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=nr.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,n,i,o,s)=>{this.onSubchannelStateUpdate(r,n,i,s)},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(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.READY,new F1(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(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(nr.ConnectivityState.IDLE,new Wc.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.CONNECTING,new Wc.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 o;if(!((o=this.currentPick)===null||o===void 0)&&o.realSubchannelEquals(e)){n!==nr.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[s,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===nr.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===nr.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),s===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(s+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===nr.ConnectivityState.IDLE||i===nr.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===nr.ConnectivityState.IDLE&&(tS("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)},b1e),(n=(r=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(r)}pickSubchannel(e){tS("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){tS(nr.ConnectivityState[this.currentState]+" -> "+nr.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){tS("connectToAddressList(["+e.map(i=>(0,qte.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,r),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===nr.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()===nr.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,n,i){if(!(r instanceof Fp))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Wc.UnavailablePicker(e.error),e.error.details),!0;let o=e.value;this.reportHealthStatus=n[Wte],r.getShuffleAddressList()&&(o=Hte(o));let s=[].concat(...o.map(c=>c.addresses));tS("updateAddressList(["+s.map(c=>(0,qte.subchannelAddressToString)(c))+"])");let a=T1e(s);return this.latestAddressList=a,this.latestOptions=n,this.connectToAddressList(a,n),this.latestResolutionNote=i,s.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===nr.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return rS}};Es.PickFirstLoadBalancer=nS;var w1e=new Fp(!1),z1=class{constructor(e,r,n,i){this.endpoint=e,this.options=n,this.resolutionNote=i,this.latestState=nr.ConnectivityState.IDLE;let o=(0,U1.createChildChannelControlHelper)(r,{updateState:(s,a,c)=>{this.latestState=s,this.latestPicker=a,r.updateState(s,a,c)}});this.pickFirstBalancer=new nS(o),this.latestPicker=new Wc.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,E1e.statusOrFromValue)([this.endpoint]),w1e,Object.assign(Object.assign({},this.options),{[Wte]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==nr.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};Es.LeafLoadBalancer=z1;function x1e(){(0,U1.registerLoadBalancerType)(rS,nS,Fp),(0,U1.registerDefaultLoadBalancerType)(rS)}});var Yte=y(eR=>{"use strict";Object.defineProperty(eR,"__esModule",{value:!0});eR.FileWatcherCertificateProvider=void 0;var A1e=Z("fs"),R1e=Nt(),C1e=Xe(),I1e=Z("util"),P1e="certificate_provider";function QA(t){R1e.trace(C1e.LogVerbosity.DEBUG,P1e,t)}var j1=(0,I1e.promisify)(A1e.readFile),B1=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");QA("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?j1(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?j1(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?j1(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,n])=>{if(this.refreshTimer){QA("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)}}),QA("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),QA("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()}};eR.FileWatcherCertificateProvider=B1});var G1=y(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=Se.createCertificateProviderChannelCredentials=Se.FileWatcherCertificateProvider=Se.createCertificateProviderServerCredentials=Se.createServerCredentialsWithInterceptors=Se.BaseSubchannelWrapper=Se.registerAdminService=Se.FilterStackFactory=Se.BaseFilter=Se.statusOrFromError=Se.statusOrFromValue=Se.PickResultType=Se.QueuePicker=Se.UnavailablePicker=Se.ChildLoadBalancerHandler=Se.EndpointMap=Se.endpointHasAddress=Se.endpointToString=Se.subchannelAddressToString=Se.LeafLoadBalancer=Se.isLoadBalancerNameRegistered=Se.parseLoadBalancingConfig=Se.selectLbConfigFromList=Se.registerLoadBalancerType=Se.createChildChannelControlHelper=Se.BackoffTimeout=Se.parseDuration=Se.durationToMs=Se.splitHostPort=Se.uriToString=Se.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=Se.createResolver=Se.registerResolver=Se.log=Se.trace=void 0;var Kte=Nt();Object.defineProperty(Se,"trace",{enumerable:!0,get:function(){return Kte.trace}});Object.defineProperty(Se,"log",{enumerable:!0,get:function(){return Kte.log}});var q1=fo();Object.defineProperty(Se,"registerResolver",{enumerable:!0,get:function(){return q1.registerResolver}});Object.defineProperty(Se,"createResolver",{enumerable:!0,get:function(){return q1.createResolver}});Object.defineProperty(Se,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return q1.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var Zte=xn();Object.defineProperty(Se,"uriToString",{enumerable:!0,get:function(){return Zte.uriToString}});Object.defineProperty(Se,"splitHostPort",{enumerable:!0,get:function(){return Zte.splitHostPort}});var Jte=eS();Object.defineProperty(Se,"durationToMs",{enumerable:!0,get:function(){return Jte.durationToMs}});Object.defineProperty(Se,"parseDuration",{enumerable:!0,get:function(){return Jte.parseDuration}});var O1e=cp();Object.defineProperty(Se,"BackoffTimeout",{enumerable:!0,get:function(){return O1e.BackoffTimeout}});var oS=Pc();Object.defineProperty(Se,"createChildChannelControlHelper",{enumerable:!0,get:function(){return oS.createChildChannelControlHelper}});Object.defineProperty(Se,"registerLoadBalancerType",{enumerable:!0,get:function(){return oS.registerLoadBalancerType}});Object.defineProperty(Se,"selectLbConfigFromList",{enumerable:!0,get:function(){return oS.selectLbConfigFromList}});Object.defineProperty(Se,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return oS.parseLoadBalancingConfig}});Object.defineProperty(Se,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return oS.isLoadBalancerNameRegistered}});var N1e=iS();Object.defineProperty(Se,"LeafLoadBalancer",{enumerable:!0,get:function(){return N1e.LeafLoadBalancer}});var tR=Bn();Object.defineProperty(Se,"subchannelAddressToString",{enumerable:!0,get:function(){return tR.subchannelAddressToString}});Object.defineProperty(Se,"endpointToString",{enumerable:!0,get:function(){return tR.endpointToString}});Object.defineProperty(Se,"endpointHasAddress",{enumerable:!0,get:function(){return tR.endpointHasAddress}});Object.defineProperty(Se,"EndpointMap",{enumerable:!0,get:function(){return tR.EndpointMap}});var k1e=Rx();Object.defineProperty(Se,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return k1e.ChildLoadBalancerHandler}});var V1=fa();Object.defineProperty(Se,"UnavailablePicker",{enumerable:!0,get:function(){return V1.UnavailablePicker}});Object.defineProperty(Se,"QueuePicker",{enumerable:!0,get:function(){return V1.QueuePicker}});Object.defineProperty(Se,"PickResultType",{enumerable:!0,get:function(){return V1.PickResultType}});var Xte=$u();Object.defineProperty(Se,"statusOrFromValue",{enumerable:!0,get:function(){return Xte.statusOrFromValue}});Object.defineProperty(Se,"statusOrFromError",{enumerable:!0,get:function(){return Xte.statusOrFromError}});var M1e=SL();Object.defineProperty(Se,"BaseFilter",{enumerable:!0,get:function(){return M1e.BaseFilter}});var $1e=wA();Object.defineProperty(Se,"FilterStackFactory",{enumerable:!0,get:function(){return $1e.FilterStackFactory}});var D1e=Ox();Object.defineProperty(Se,"registerAdminService",{enumerable:!0,get:function(){return D1e.registerAdminService}});var L1e=Xy();Object.defineProperty(Se,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return L1e.BaseSubchannelWrapper}});var Qte=GA();Object.defineProperty(Se,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return Qte.createServerCredentialsWithInterceptors}});Object.defineProperty(Se,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return Qte.createCertificateProviderServerCredentials}});var U1e=Yte();Object.defineProperty(Se,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return U1e.FileWatcherCertificateProvider}});var F1e=ap();Object.defineProperty(Se,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return F1e.createCertificateProviderChannelCredentials}});var z1e=a1();Object.defineProperty(Se,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return z1e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var ere=y(W1=>{"use strict";Object.defineProperty(W1,"__esModule",{value:!0});W1.setup=q1e;var j1e=fo(),B1e=$u(),H1=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,B1e.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function q1e(){(0,j1e.registerResolver)("unix",H1)}});var sre=y(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});J1.setup=Y1e;var tre=Z("net"),rre=$u(),rR=Xe(),Y1=Ar(),nre=fo(),V1e=Bn(),ire=xn(),G1e=Nt(),H1e="ip_resolver";function ore(t){G1e.trace(rR.LogVerbosity.DEBUG,H1e,t)}var K1="ipv4",Z1="ipv6",W1e=443,nR=class{constructor(e,r,n){var i;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,ore("Resolver constructed for target "+(0,ire.uriToString)(e));let o=[];if(!(e.scheme===K1||e.scheme===Z1)){this.error={code:rR.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new Y1.Metadata};return}let s=e.path.split(",");for(let a of s){let c=(0,ire.splitHostPort)(a);if(c===null){this.error={code:rR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new Y1.Metadata};return}if(e.scheme===K1&&!(0,tre.isIPv4)(c.host)||e.scheme===Z1&&!(0,tre.isIPv6)(c.host)){this.error={code:rR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new Y1.Metadata};return}o.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:W1e})}this.endpoints=o.map(a=>({addresses:[a]})),ore("Parsed "+e.scheme+" address list "+o.map(V1e.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,rre.statusOrFromError)(this.error),{},null,""):this.listener((0,rre.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function Y1e(){(0,nre.registerResolver)(K1,nR),(0,nre.registerResolver)(Z1,nR)}});var ure=y(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.RoundRobinLoadBalancer=void 0;aS.setup=eUe;var lre=Pc(),Vr=An(),sS=fa(),K1e=Nt(),Z1e=Xe(),are=Bn(),J1e=iS(),X1e="round_robin";function cre(t){K1e.trace(Z1e.LogVerbosity.DEBUG,X1e,t)}var iR="round_robin",oR=class t{getLoadBalancerName(){return iR}constructor(){}toJsonObject(){return{[iR]:{}}}static createFromJson(e){return new t}},X1=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 Q1e(t,e){return[...t.slice(e),...t.slice(0,e)]}var sR=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Vr.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,lre.createChildChannelControlHelper)(e,{updateState:(r,n,i)=>{this.currentState===Vr.ConnectivityState.READY&&r!==Vr.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(Vr.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===Vr.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(i=>(0,are.endpointEqual)(i.getEndpoint(),n)),r<0&&(r=0)}this.updateState(Vr.ConnectivityState.READY,new X1(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),r),null)}else if(this.countChildrenWithState(Vr.ConnectivityState.CONNECTING)>0)this.updateState(Vr.ConnectivityState.CONNECTING,new sS.QueuePicker(this),null);else if(this.countChildrenWithState(Vr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new sS.UnavailablePicker({details:e}),e)}else this.updateState(Vr.ConnectivityState.IDLE,new sS.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===Vr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){cre(Vr.ConnectivityState[this.currentState]+" -> "+Vr.ConnectivityState[e]),e===Vr.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 oR))return!1;if(!e.ok)return this.children.length===0&&this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new sS.UnavailablePicker(e.error),e.error.details),!0;let o=Math.random()*e.value.length|0,s=Q1e(e.value,o);if(this.resetSubchannelList(),s.length===0){let a=`No addresses resolved. Resolution note: ${i}`;this.updateState(Vr.ConnectivityState.TRANSIENT_FAILURE,new sS.UnavailablePicker({details:a}),a)}cre("Connect to endpoint list "+s.map(are.endpointToString)),this.updatesPaused=!0,this.children=s.map(a=>new J1e.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 iR}};aS.RoundRobinLoadBalancer=sR;function eUe(){(0,lre.registerLoadBalancerType)(iR,sR,oR)}});var pre=y(td=>{"use strict";var Q1;Object.defineProperty(td,"__esModule",{value:!0});td.OutlierDetectionLoadBalancer=td.OutlierDetectionLoadBalancingConfig=void 0;td.setup=dUe;var tUe=An(),dre=Xe(),ed=eS(),fre=G1(),rUe=Pc(),nUe=Rx(),iUe=fa(),eU=Bn(),oUe=Xy(),sUe=Nt(),aUe="outlier_detection";function Pr(t){sUe.trace(dre.LogVerbosity.DEBUG,aUe,t)}var sU="outlier_detection",cUe=((Q1=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&Q1!==void 0?Q1:"true")==="true",lUe={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},uUe={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function zp(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 tU(t,e,r){let n=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,ed.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 aR(t,e,r){let n=r?`${r}.${e}`:e;if(zp(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 cS=class t{constructor(e,r,n,i,o,s,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=o?Object.assign(Object.assign({},lUe),o):null,this.failurePercentageEjection=s?Object.assign(Object.assign({},uUe),s):null}getLoadBalancerName(){return sU}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,ed.msToDuration)(this.intervalMs),base_ejection_time:(0,ed.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,ed.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(tU(e,"interval"),tU(e,"base_ejection_time"),tU(e,"max_ejection_time"),aR(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");zp(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),aR(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),zp(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),zp(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");aR(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),aR(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),zp(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),zp(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,rUe.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,ed.durationToMs)(e.interval):null,e.base_ejection_time?(0,ed.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,ed.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)}};td.OutlierDetectionLoadBalancingConfig=cS;var nU=class extends oUe.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 rU(){return{success:0,failure:0}}var iU=class{constructor(){this.activeBucket=rU(),this.inactiveBucket=rU()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=rU()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},oU=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===iUe.PickResultType.COMPLETE){let n=r.subchannel,i=n.getMapEntry();if(i){let o=r.onCallEnded;return this.countCalls&&(o=(s,a,c)=>{var l;s===dre.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(l=r.onCallEnded)===null||l===void 0||l.call(r,s,a,c)}),Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel(),onCallEnded:o})}else return Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel()})}else return r}},cR=class{constructor(e){this.entryMap=new eU.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new nUe.ChildLoadBalancerHandler((0,fre.createChildChannelControlHelper)(e,{createSubchannel:(r,n)=>{let i=e.createSubchannel(r,n),o=this.entryMap.getForSubchannelAddress(r),s=new nU(i,o);return o?.currentEjectionTimestamp!==null&&s.eject(),o?.subchannelWrappers.push(s),s},updateState:(r,n,i)=>{r===tUe.ConnectivityState.READY?e.updateState(r,new oU(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;Pr("Running success rate check");let n=r.request_volume,i=0,o=[];for(let[d,f]of this.entryMap.entries()){let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();Pr("Stats for "+(0,eU.endpointToString)(d)+": successes="+p+" failures="+h+" targetRequestVolume="+n),p+h>=n&&(i+=1,o.push(p/(p+h)))}if(Pr("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+o+"]"),i<r.minimum_hosts)return;let s=o.reduce((d,f)=>d+f)/o.length,a=0;for(let d of o){let f=d-s;a+=f*f}let c=a/o.length,l=Math.sqrt(c),u=s-l*(r.stdev_factor/1e3);Pr("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(Pr("Checking candidate "+d+" successRate="+m),m<u){let g=Math.random()*100;Pr("Candidate "+d+" randomNumber="+g+" enforcement_percentage="+r.enforcement_percentage),g<r.enforcement_percentage&&(Pr("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;Pr("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let n=0;for(let i of this.entryMap.values()){let o=i.counter.getLastSuccesses(),s=i.counter.getLastFailures();o+s>=r.request_volume&&(n+=1)}if(!(n<r.minimum_hosts))for(let[i,o]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let s=o.counter.getLastSuccesses(),a=o.counter.getLastFailures();if(Pr("Candidate successes="+s+" failures="+a),s+a<r.request_volume)continue;if(a*100/(a+s)>r.threshold){let l=Math.random()*100;Pr("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+r.enforcement_percentage),l<r.enforcement_percentage&&(Pr("Ejecting candidate "+i),this.eject(o,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(Pr("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(),o=this.latestConfig.getMaxEjectionTimeMs(),s=new Date(n.currentEjectionTimestamp.getTime());s.setMilliseconds(s.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,o))),s<new Date&&(Pr("Unejecting "+r),this.uneject(n))}}}updateAddressList(e,r,n,i){if(!(r instanceof cS))return!1;if(Pr("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let s of e.value)this.entryMap.has(s)||(Pr("Adding map entry for "+(0,eU.endpointToString)(s)),this.entryMap.set(s,{counter:new iU,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let o=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,o,n,i),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){Pr("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let s=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(s)}else Pr("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{Pr("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let s of this.entryMap.values())this.uneject(s),s.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return sU}};td.OutlierDetectionLoadBalancer=cR;function dUe(){cUe&&(0,fre.registerLoadBalancerType)(sU,cR,cS)}});var hre=y(uR=>{"use strict";Object.defineProperty(uR,"__esModule",{value:!0});uR.PriorityQueue=void 0;var jp=0,aU=t=>Math.floor(t/2),lR=t=>t*2+1,lS=t=>t*2+2,cU=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[jp]}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>jp&&this.swap(jp,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[jp]=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>jp&&this.greater(e,aU(e));)this.swap(e,aU(e)),e=aU(e)}siftDown(){let e=jp;for(;lR(e)<this.size()&&this.greater(lR(e),e)||lS(e)<this.size()&&this.greater(lS(e),e);){let r=lS(e)<this.size()&&this.greater(lS(e),lR(e))?lS(e):lR(e);this.swap(e,r),e=r}}};uR.PriorityQueue=cU});var Sre=y(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});dS.WeightedRoundRobinLoadBalancingConfig=void 0;dS.setup=bUe;var Or=An(),fUe=Xe(),mi=eS(),_re=Pc(),pUe=iS(),hUe=Nt(),yre=WA(),Bp=fa(),mUe=hre(),mre=Bn(),gUe="weighted_round_robin";function lU(t){hUe.trace(fUe.LogVerbosity.DEBUG,gUe,t)}var fU="weighted_round_robin",_Ue=1e4,yUe=1e4,SUe=3*6e4,EUe=1e3,vUe=1;function gre(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 dR(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,mi.isDuration)(t[e]))r=t[e];else if((0,mi.isDurationMessage)(t[e]))r=(0,mi.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let n=(0,mi.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,mi.durationToMs)(r)}return null}var uS=class t{constructor(e,r,n,i,o,s){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??_Ue,this.blackoutPeriodMs=n??yUe,this.weightExpirationPeriodMs=i??SUe,this.weightUpdatePeriodMs=Math.max(o??EUe,100),this.errorUtilizationPenalty=s??vUe}getLoadBalancerName(){return fU}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,mi.durationToString)((0,mi.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,mi.durationToString)((0,mi.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,mi.durationToString)((0,mi.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,mi.durationToString)((0,mi.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if(gre(e,"enable_oob_load_report","boolean"),gre(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,dR(e,"oob_load_reporting_period"),dR(e,"blackout_period"),dR(e,"weight_expiration_period"),dR(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}};dS.WeightedRoundRobinLoadBalancingConfig=uS;var uU=class{constructor(e,r){this.metricsHandler=r,this.queue=new mUe.PriorityQueue((o,s)=>o.deadline<s.deadline);let n=e.filter(o=>o.weight>0),i;if(n.length<2)i=1;else{let o=0;for(let{weight:s}of n)o+=s;i=o/n.length}for(let o of e){let s=o.weight>0?1/o.weight:i;this.queue.push({endpointName:o.endpointName,picker:o.picker,period:s,deadline:Math.random()*s})}}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===Bp.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,yre.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}},dU=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=Or.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 o=r.rps_fractional,s=r.application_utilization;s>0&&o>0&&(s+=r.eps/o*((i=(n=this.latestConfig)===null||n===void 0?void 0:n.getErrorUtilizationPenalty())!==null&&i!==void 0?i:0));let a=s===0?0:o/s;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(Or.ConnectivityState.READY)>0){let e=[];for(let[n,i]of this.children)i.child.getConnectivityState()===Or.ConnectivityState.READY&&e.push({endpointName:n,picker:i.child.getPicker(),weight:this.getWeight(i)});lU("Created picker with weights: "+e.map(n=>n.endpointName+":"+n.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(n,i)=>{let o=this.children.get(i);o&&this.updateWeight(o,n)},this.updateState(Or.ConnectivityState.READY,new uU(e,r),null)}else if(this.countChildrenWithState(Or.ConnectivityState.CONNECTING)>0)this.updateState(Or.ConnectivityState.CONNECTING,new Bp.QueuePicker(this),null);else if(this.countChildrenWithState(Or.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Or.ConnectivityState.TRANSIENT_FAILURE,new Bp.UnavailablePicker({details:e}),e)}else this.updateState(Or.ConnectivityState.IDLE,new Bp.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===Or.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){lU(Or.ConnectivityState[this.currentState]+" -> "+Or.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}updateAddressList(e,r,n,i){var o,s;if(!(r instanceof uS))return!1;if(!e.ok)return this.children.size===0&&this.updateState(Or.ConnectivityState.TRANSIENT_FAILURE,new Bp.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let l=`No addresses resolved. Resolution note: ${i}`;return this.updateState(Or.ConnectivityState.TRANSIENT_FAILURE,new Bp.UnavailablePicker({details:l}),l),!1}lU("Connect to endpoint list "+e.value.map(mre.endpointToString));let a=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let l of e.value){let u=(0,mre.endpointToString)(l);c.add(u);let d=this.children.get(u);d||(d={child:new pUe.LeafLoadBalancer(l,(0,_re.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(f,p,h)=>{this.currentState===Or.ConnectivityState.READY&&f!==Or.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),f===Or.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 yre.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=(s=(o=setInterval(()=>{this.currentState===Or.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||s===void 0?void 0:s.call(o),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return fU}};function bUe(){(0,_re.registerLoadBalancerType)(fU,dU,uS)}});var fS=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.experimental=_e.ServerMetricRecorder=_e.ServerInterceptingCall=_e.ResponderBuilder=_e.ServerListenerBuilder=_e.addAdminServicesToServer=_e.getChannelzHandlers=_e.getChannelzServiceDefinition=_e.InterceptorConfigurationError=_e.InterceptingCall=_e.RequesterBuilder=_e.ListenerBuilder=_e.StatusBuilder=_e.getClientChannel=_e.ServerCredentials=_e.Server=_e.setLogVerbosity=_e.setLogger=_e.load=_e.loadObject=_e.CallCredentials=_e.ChannelCredentials=_e.waitForClientReady=_e.closeClient=_e.Channel=_e.makeGenericClientConstructor=_e.makeClientConstructor=_e.loadPackageDefinition=_e.Client=_e.compressionAlgorithms=_e.propagate=_e.connectivityState=_e.status=_e.logVerbosity=_e.Metadata=_e.credentials=void 0;var fR=gx();Object.defineProperty(_e,"CallCredentials",{enumerable:!0,get:function(){return fR.CallCredentials}});var TUe=eD();Object.defineProperty(_e,"Channel",{enumerable:!0,get:function(){return TUe.ChannelImplementation}});var wUe=_L();Object.defineProperty(_e,"compressionAlgorithms",{enumerable:!0,get:function(){return wUe.CompressionAlgorithms}});var xUe=An();Object.defineProperty(_e,"connectivityState",{enumerable:!0,get:function(){return xUe.ConnectivityState}});var pR=ap();Object.defineProperty(_e,"ChannelCredentials",{enumerable:!0,get:function(){return pR.ChannelCredentials}});var Ere=Q$();Object.defineProperty(_e,"Client",{enumerable:!0,get:function(){return Ere.Client}});var pU=Xe();Object.defineProperty(_e,"logVerbosity",{enumerable:!0,get:function(){return pU.LogVerbosity}});Object.defineProperty(_e,"status",{enumerable:!0,get:function(){return pU.Status}});Object.defineProperty(_e,"propagate",{enumerable:!0,get:function(){return pU.Propagate}});var vre=Nt(),hU=Dx();Object.defineProperty(_e,"loadPackageDefinition",{enumerable:!0,get:function(){return hU.loadPackageDefinition}});Object.defineProperty(_e,"makeClientConstructor",{enumerable:!0,get:function(){return hU.makeClientConstructor}});Object.defineProperty(_e,"makeGenericClientConstructor",{enumerable:!0,get:function(){return hU.makeClientConstructor}});var AUe=Ar();Object.defineProperty(_e,"Metadata",{enumerable:!0,get:function(){return AUe.Metadata}});var RUe=jte();Object.defineProperty(_e,"Server",{enumerable:!0,get:function(){return RUe.Server}});var CUe=GA();Object.defineProperty(_e,"ServerCredentials",{enumerable:!0,get:function(){return CUe.ServerCredentials}});var IUe=Bte();Object.defineProperty(_e,"StatusBuilder",{enumerable:!0,get:function(){return IUe.StatusBuilder}});_e.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),combineCallCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),createInsecure:pR.ChannelCredentials.createInsecure,createSsl:pR.ChannelCredentials.createSsl,createFromSecureContext:pR.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:fR.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:fR.CallCredentials.createFromGoogleCredential,createEmpty:fR.CallCredentials.createEmpty};var PUe=t=>t.close();_e.closeClient=PUe;var OUe=(t,e,r)=>t.waitForReady(e,r);_e.waitForClientReady=OUe;var NUe=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.loadObject=NUe;var kUe=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.load=kUe;var MUe=t=>{vre.setLogger(t)};_e.setLogger=MUe;var $Ue=t=>{vre.setLoggerVerbosity(t)};_e.setLogVerbosity=$Ue;var DUe=t=>Ere.Client.prototype.getChannel.call(t);_e.getClientChannel=DUe;var hR=Z$();Object.defineProperty(_e,"ListenerBuilder",{enumerable:!0,get:function(){return hR.ListenerBuilder}});Object.defineProperty(_e,"RequesterBuilder",{enumerable:!0,get:function(){return hR.RequesterBuilder}});Object.defineProperty(_e,"InterceptingCall",{enumerable:!0,get:function(){return hR.InterceptingCall}});Object.defineProperty(_e,"InterceptorConfigurationError",{enumerable:!0,get:function(){return hR.InterceptorConfigurationError}});var bre=zc();Object.defineProperty(_e,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return bre.getChannelzServiceDefinition}});Object.defineProperty(_e,"getChannelzHandlers",{enumerable:!0,get:function(){return bre.getChannelzHandlers}});var LUe=Ox();Object.defineProperty(_e,"addAdminServicesToServer",{enumerable:!0,get:function(){return LUe.addAdminServicesToServer}});var mU=k1();Object.defineProperty(_e,"ServerListenerBuilder",{enumerable:!0,get:function(){return mU.ServerListenerBuilder}});Object.defineProperty(_e,"ResponderBuilder",{enumerable:!0,get:function(){return mU.ResponderBuilder}});Object.defineProperty(_e,"ServerInterceptingCall",{enumerable:!0,get:function(){return mU.ServerInterceptingCall}});var UUe=WA();Object.defineProperty(_e,"ServerMetricRecorder",{enumerable:!0,get:function(){return UUe.ServerMetricRecorder}});var FUe=G1();_e.experimental=FUe;var zUe=DL(),jUe=ere(),BUe=sre(),qUe=iS(),VUe=ure(),GUe=pre(),HUe=Sre(),WUe=zc();zUe.setup(),jUe.setup(),BUe.setup(),qUe.setup(),VUe.setup(),GUe.setup(),HUe.setup(),WUe.setup()});var Tre=y(mR=>{"use strict";Object.defineProperty(mR,"__esModule",{value:!0});mR.createServiceClientConstructor=void 0;var YUe=fS();function KUe(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:n=>n,requestDeserialize:n=>n,responseSerialize:n=>n,responseDeserialize:n=>n}};return YUe.makeGenericClientConstructor(r,e)}mR.createServiceClientConstructor=KUe});var pS=y(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.createOtlpGrpcExporterTransport=Vi.GrpcExporterTransport=Vi.createEmptyMetadata=Vi.createSslCredentials=Vi.createInsecureCredentials=void 0;var ZUe=gX(),wre=`OTel-OTLP-Exporter-JavaScript/${ZUe.VERSION}`;function JUe(t){return t?`${t} ${wre}`:wre}var XUe=0,QUe=2;function eFe(t){return t==="gzip"?QUe:XUe}function tFe(){let{credentials:t}=fS();return t.createInsecure()}Vi.createInsecureCredentials=tFe;function rFe(t,e,r){let{credentials:n}=fS();return n.createSsl(t,e,r)}Vi.createSslCredentials=rFe;function nFe(){let{Metadata:t}=fS();return new t}Vi.createEmptyMetadata=nFe;var gR=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}=Tre();try{this._metadata=this._parameters.metadata()}catch(s){return Promise.resolve({status:"failure",error:s})}let o=i(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new o(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":eFe(this._parameters.compression),"grpc.primary_user_agent":JUe(this._parameters.userAgent)})}catch(s){return Promise.resolve({status:"failure",error:s})}}return new Promise(i=>{let o=Date.now()+r;if(this._metadata==null)return i({error:new Error("metadata was null"),status:"failure"});this._client.export(n,this._metadata,{deadline:o},(s,a)=>{i(s?{status:"failure",error:s}:{data:a,status:"success"})})})}};Vi.GrpcExporterTransport=gR;function iFe(t){return new gR(t)}Vi.createOtlpGrpcExporterTransport=iFe});var Ire=y(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.getOtlpGrpcDefaultConfiguration=Yc.mergeOtlpGrpcConfigurationWithDefaults=Yc.validateAndNormalizeUrl=void 0;var Rre=(lx(),bn(cx)),hS=pS(),oFe=Z("url"),xre=(ve(),bn(vc));function Cre(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new oFe.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&xre.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?:$/)&&xre.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}Yc.validateAndNormalizeUrl=Cre;function Are(t,e){for(let[r,n]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,n)}function sFe(t,e,r){let n=t.url??e.url??r.url;return{...(0,Rre.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let i=r.metadata();return Are(i,t.metadata?.().clone()??(0,hS.createEmptyMetadata)()),Are(i,e.metadata?.()??(0,hS.createEmptyMetadata)()),i},url:Cre(n),credentials:t.credentials??e.credentials?.(n)??r.credentials(n),userAgent:t.userAgent}}Yc.mergeOtlpGrpcConfigurationWithDefaults=sFe;function aFe(){return{...(0,Rre.getSharedConfigurationDefaults)(),metadata:()=>(0,hS.createEmptyMetadata)(),url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,hS.createInsecureCredentials)():()=>(0,hS.createSslCredentials)()}}Yc.getOtlpGrpcDefaultConfiguration=aFe});function Pre(t){let e={};return Object.entries(t??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):J.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}var Ore=R(()=>{"use strict";ve()});function cFe(t,e,r){return async()=>{let n={...await r()},i={};return e!=null&&Object.assign(i,await e()),t!=null&&Object.assign(i,Pre(await t())),Object.assign(i,n)}}function lFe(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 Nre(t,e,r){return{...Lw(t,e,r),headers:cFe(t.headers,e.headers,r.headers),url:lFe(t.url)??e.url??r.url}}function kre(t,e){return{...Uw(),headers:async()=>t,url:"http://localhost:4318/"+e}}var Mre=R(()=>{"use strict";ay();Ore()});function rd(t){return async e=>{let r=e==="http:",n=r?import("http"):import("https"),{Agent:i}=await n;if(r){let{ca:o,cert:s,key:a,...c}=t;return new i(c)}return new i(t)}}function $re(t,e,r){return{...Nre(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory,userAgent:t.userAgent}}function Dre(t,e){return{...kre(t,e),agentFactory:rd({keepAlive:!0})}}var _R=R(()=>{"use strict";Mre()});function gU(t){return t===429||t===502||t===503||t===504}function _U(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 Lre=R(()=>{"use strict"});var Ure,Fre=R(()=>{"use strict";Ure="0.218.0"});import*as Bre from"zlib";import{Readable as uFe}from"stream";function qre(t,e,r,n,i,o,s,a){return new Promise(c=>{let l=new URL(e);i?r["User-Agent"]=`${i} ${zre}`:r["User-Agent"]=zre;let d=t(l,{method:"POST",headers:r,agent:o},f=>{let p=[],h=0;f.on("data",m=>{if(h+=m.length,h>jre){let g=new Error(`OTLP export response body exceeded size limit of ${jre} bytes`);c({status:"failure",error:g}),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&&gU(f.statusCode))c({status:"retryable",retryInMillis:_U(f.headers["retry-after"])});else{let m=new ua(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&&gU(f.statusCode)?c({status:"retryable",error:m,retryInMillis:_U(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=>{pFe(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),dFe(d,n,s,f=>{c({status:"failure",error:f})})})}function dFe(t,e,r,n){let i=fFe(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),i=i.on("error",n).pipe(Bre.createGzip()).on("error",n)),i.pipe(t).on("error",n)}function fFe(t){let e=new uFe;return e.push(t),e.push(null),e}function pFe(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 zre,jre,Vre=R(()=>{"use strict";Lre();$w();Fre();zre=`OTel-OTLP-Exporter-JavaScript/${Ure}`,jre=4*1024*1024});async function hFe(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function Gre(t){return new yU(t)}var yU,Hre=R(()=>{"use strict";Vre();yU=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,r){let{agent:n,request:i}=await this._loadUtils(),o=await this._parameters.headers();return qre(i,this._parameters.url,o,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),hFe(r)]);e=this._utils={agent:n,request:i}}return e}}});function yFe(){return Math.random()*(2*Wre)-Wre}function Yre(t){return new EU(t.transport)}var SU,mFe,gFe,_Fe,Wre,EU,Kre=R(()=>{"use strict";ve();SU=5,mFe=1e3,gFe=5e3,_Fe=1.5,Wre=.2;EU=class{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,o)=>{setTimeout(()=>{this._transport.send(e,r).then(i,o)},n)})}async send(e,r){let n=SU,i=mFe,o=Date.now()+r,s=await this._transport.send(e,r);for(;s.status==="retryable"&&n>0;){n--;let a=Math.max(Math.min(i*(1+yFe()),gFe),0);i=i*_Fe;let c=s.retryInMillis??a,l=o-Date.now();if(c>l)return J.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),s;J.verbose(`Scheduling export retry in ${Math.round(c)}ms`),s=await this.retry(e,l,c)}return s.status==="success"?J.verbose(`Export succeeded after ${SU-n} retry attempts.`):s.status==="retryable"?J.info(`Export failed after maximum retry attempts (${SU}).`):J.info(`Export failed with non-retryable error: ${s.error}`),s}shutdown(){return this._transport.shutdown()}}});function Zre(t,e){return ax({transport:Yre({transport:Gre(t)}),serializer:e,promiseHandler:zw(t)},{timeout:t.timeoutMillis})}var Jre=R(()=>{"use strict";l$();Hre();VM();Kre()});function Xre(t){let e=Qf(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;J.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function SFe(t){let e=Xre(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=Xre("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function Qre(t){let e=zn(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;J.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function EFe(t){let e=Qre(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=Qre("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function yR(t){return{timeoutMillis:SFe(t),compression:EFe(t)}}var vU=R(()=>{"use strict";rp();ve()});import*as ene from"fs";import*as tne from"path";function vFe(t){let e=zn(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=zn("OTEL_EXPORTER_OTLP_HEADERS"),n=Iu(e),i=Iu(r);if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return Object.assign({},Iu(r),Iu(e))}function bFe(t){try{return new URL(t).toString()}catch{J.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function TFe(t,e){try{new URL(t)}catch{J.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{J.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function wFe(t){let e=zn("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return TFe(e,t)}function xFe(t){let e=zn(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return bFe(e)}function bU(t,e,r){let n=zn(t),i=zn(e),o=n??i;if(o!=null)try{return ene.readFileSync(tne.resolve(process.cwd(),o))}catch{J.warn(r);return}else return}function AFe(t){return bU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function RFe(t){return bU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function CFe(t){return bU(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function rne(t,e){return{...yR(t),url:xFe(t)??wFe(e),headers:Dw(vFe(t)),agentFactory:rd({keepAlive:!0,ca:CFe(t),cert:AFe(t),key:RFe(t)})}}var nne=R(()=>{"use strict";rp();ve();vU();ay();_R()});function ine(t){return typeof t.headers=="function"?t.headers:Dw(t.headers)}var one=R(()=>{"use strict";ay()});function IFe(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 rd(e)}function sne(t,e,r,n){return t.metadata&&J.warn("Metadata cannot be set when using http"),$re({url:t.url,headers:ine(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:IFe(t),userAgent:t.userAgent},rne(e,r),Dre(n,r))}var ane=R(()=>{"use strict";ve();_R();TU();nne();one()});var cne={};zr(cne,{convertLegacyHttpOptions:()=>sne,createOtlpHttpExportDelegate:()=>Zre,getSharedConfigurationFromEnvironment:()=>yR,httpAgentFactoryFromOptions:()=>rd});var TU=R(()=>{"use strict";_R();Jre();vU();ane()});var pne=y(SR=>{"use strict";Object.defineProperty(SR,"__esModule",{value:!0});SR.getOtlpGrpcConfigurationFromEnv=void 0;var lne=(rp(),bn(dX)),mS=pS(),PFe=(TU(),bn(cne)),OFe=Z("fs"),NFe=Z("path"),dne=(ve(),bn(vc));function wU(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function kFe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),n=(0,lne.parseKeyPairsIntoRecord)(e),i=(0,lne.parseKeyPairsIntoRecord)(r);if(Object.keys(n).length===0&&Object.keys(i).length===0)return;let o=Object.assign({},i,n),s=(0,mS.createEmptyMetadata)();for(let[a,c]of Object.entries(o))s.set(a,c);return s}function MFe(t){let e=kFe(t);if(e!=null)return()=>e}function $Fe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return wU(e,r)}function DFe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return wU(e,r)==="true"}function xU(t,e,r){let n=process.env[t]?.trim(),i=process.env[e]?.trim(),o=wU(n,i);if(o!=null)try{return OFe.readFileSync(NFe.resolve(process.cwd(),o))}catch{dne.diag.warn(r);return}else return}function LFe(t){return xU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function UFe(t){return xU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function une(t){return xU(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function fne(t){let e=UFe(t),r=LFe(t),n=une(t),i=e!=null&&r!=null;return n!=null&&!i?(dne.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,mS.createSslCredentials)(une(t))):(0,mS.createSslCredentials)(n,e,r)}function FFe(t){return DFe(t)?(0,mS.createInsecureCredentials)():fne(t)}function zFe(t){return{...(0,PFe.getSharedConfigurationFromEnvironment)(t),metadata:MFe(t),url:$Fe(t),credentials:e=>e.startsWith("http://")?()=>(0,mS.createInsecureCredentials)():e.startsWith("https://")?()=>fne(t):()=>FFe(t)}}SR.getOtlpGrpcConfigurationFromEnv=zFe});var mne=y(ER=>{"use strict";Object.defineProperty(ER,"__esModule",{value:!0});ER.convertLegacyOtlpGrpcOptions=void 0;var hne=Ire(),jFe=pS(),BFe=pne();function qFe(t,e){let r=t.credentials;return(0,hne.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,jFe.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0,userAgent:t.userAgent},(0,BFe.getOtlpGrpcConfigurationFromEnv)(e),(0,hne.getOtlpGrpcDefaultConfiguration)())}ER.convertLegacyOtlpGrpcOptions=qFe});var gne=y(vR=>{"use strict";Object.defineProperty(vR,"__esModule",{value:!0});vR.createOtlpGrpcExportDelegate=void 0;var VFe=(lx(),bn(cx)),GFe=pS();function HFe(t,e,r,n){return(0,VFe.createOtlpNetworkExportDelegate)(t,e,(0,GFe.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,userAgent:t.userAgent,grpcName:r,grpcPath:n}))}vR.createOtlpGrpcExportDelegate=HFe});var _ne=y(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.createOtlpGrpcExportDelegate=qp.convertLegacyOtlpGrpcOptions=void 0;var WFe=mne();Object.defineProperty(qp,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return WFe.convertLegacyOtlpGrpcOptions}});var YFe=gne();Object.defineProperty(qp,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return YFe.createOtlpGrpcExportDelegate}})});function xa(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 AU=R(()=>{"use strict"});var KFe,gS,Kc,bR=R(()=>{"use strict";ve();AU();KFe="ProtobufWriter: estimated size was too small, growing buffer.",gS=1,Kc=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;J.debug(KFe);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(gS),this.pos+=gS,e}finishLengthDelimited(e,r){let n=r>>>0,i=xa(n);if(i>gS){let s=i-gS;this._ensureCapacity(s),this._buffer.copyWithin(e+i,e+gS,this.pos),this.pos+=s}let o=e;n<128?this._buffer[o]=n:n<16384?(this._buffer[o++]=n&127|128,this._buffer[o]=n>>>7):n<2097152?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o]=n>>>14):n<268435456?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o]=n>>>21):(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o++]=n>>>21&127|128,this._buffer[o]=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(xa(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 yne(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Aa(t){let e=new Uint8Array(t.length/2),r=0;for(let n=0;n<t.length;n+=2){let i=yne(t.charCodeAt(n)),o=yne(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}var RU=R(()=>{"use strict"});var _S,Sne=R(()=>{"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"})(_S||(_S={}))});var yS,Ene,CU=R(()=>{"use strict";yS=class{emit(e){}enabled(){return!1}},Ene=new yS});function vne(t,e,r){return n=>n===t?e:r}var SS,Vp,IU,bne=R(()=>{"use strict";SS=Symbol.for("io.opentelemetry.js.api.logs"),Vp=globalThis;IU=1});var PU,TR,OU=R(()=>{"use strict";CU();PU=class{getLogger(e,r,n){return new yS}},TR=new PU});var wR,Tne=R(()=>{"use strict";CU();wR=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):Ene}}});var ES,wne=R(()=>{"use strict";OU();Tne();ES=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new wR(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:TR}_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 xR,xne=R(()=>{"use strict";bne();OU();wne();xR=class t{constructor(){this._proxyLoggerProvider=new ES}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Vp[SS]?this.getLoggerProvider():(Vp[SS]=vne(IU,e,TR),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Vp[SS])===null||e===void 0?void 0:e.call(Vp,IU))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Vp[SS],this._proxyLoggerProvider=new ES}}});var TCt,Ane=R(()=>{"use strict";Sne();xne();TCt=xR.getInstance()});function Gn(t,e){let r=e[0],n=e[1],i=1e9,o=r&65535,s=r/65536>>>0,a=o*i,c=s*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),g=u+f+m>>>0;t.writeFixed64(h,g)}function Ro(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 o=t.startLengthDelimited(),s=t.pos;ZFe(t,n,i),t.finishLengthDelimited(o,t.pos-s)}}function ZFe(t,e,r){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),i=t.pos;vS(t,r),t.finishLengthDelimited(n,t.pos-i)}function vS(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>=JFe&&n<XFe?(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 o of e){t.writeTag(1,2);let s=t.startLengthDelimited(),a=t.pos;vS(t,o),t.finishLengthDelimited(s,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,o=e;for(let s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;let a=o[s];t.writeTag(1,2);let c=t.startLengthDelimited(),l=t.pos;t.writeTag(1,2),t.writeString(s),t.writeTag(2,2);let u=t.startLengthDelimited(),d=t.pos;vS(t,a),t.finishLengthDelimited(u,t.pos-d),t.finishLengthDelimited(c,t.pos-l)}t.finishLengthDelimited(n,t.pos-i)}}function Gp(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 Hp(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;e.attributes&&Ro(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-i)}var JFe,XFe,AR=R(()=>{"use strict";JFe=-(2**63),XFe=2**63});function QFe(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 Zc,RR=R(()=>{"use strict";AU();Zc=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,r){this.pos+=xa(r)}writeVarint(e){this.pos+=xa(e)}writeSint32(e){this.pos+=xa((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+=xa(e.length),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this.pos+=8}writeString(e){let r=QFe(e);this.pos+=xa(r),this.pos+=r}}});function eze(t,e){let r=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),Gn(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==_S.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(),o=t.pos;vS(t,e.body),t.finishLengthDelimited(i,t.pos-o)}e.attributes&&Ro(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(Aa(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(Aa(e.spanContext.spanId))),t.writeTag(11,1),Gn(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(r,t.pos-n)}function tze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Gp(t,e,1);for(let o of r)t.writeTag(2,2),eze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Rne(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;tze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function rze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function Cne(t){let e=rze(t),r=new Zc;for(let[i,o]of e)r.writeTag(1,2),Rne(r,i,o);let n=new Kc(r.pos);for(let[i,o]of e)n.writeTag(1,2),Rne(n,i,o);return n.finish()}var Ine=R(()=>{"use strict";bR();RU();Ane();AR();RR()});var Co,CR=R(()=>{"use strict";Co=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 nze(t){let e=new Co(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 Pne(t){let e=new Co(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=nze(e.readBytes()):e.skip(i)}return r}var One=R(()=>{"use strict";CR()});var NU,Nne=R(()=>{"use strict";Ine();One();NU={serializeRequest:t=>Cne(t),deserializeResponse:t=>Pne(t)}});var kne=R(()=>{"use strict";Nne()});var Ra,Mne=R(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(Ra||(Ra={}))});var kU,gi,$ne=R(()=>{"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"})(kU||(kU={}));(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(gi||(gi={}))});var MU=R(()=>{"use strict";Mne();$ne()});function Une(t,e,r){let n=t.startLengthDelimited(),i=t.pos;t.writeTag(2,1),Gn(t,e.startTime),t.writeTag(3,1),Gn(t,e.endTime),r===ia.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&Ro(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-i)}function ize(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;if(t.writeTag(2,1),Gn(t,e.startTime),t.writeTag(3,1),Gn(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 o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.counts)t.writeFixed64(a>>>0,a/4294967296>>>0);t.finishLengthDelimited(o,t.pos-s)}if(i.buckets.boundaries.length>0){t.writeTag(7,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.boundaries)t.writeDouble(a);t.finishLengthDelimited(o,t.pos-s)}e.attributes&&Ro(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 Dne(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 o=t.startLengthDelimited(),s=t.pos;for(let a of r)t.writeVarint(a);t.finishLengthDelimited(o,t.pos-s)}t.finishLengthDelimited(n,t.pos-i)}function oze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;e.attributes&&Ro(t,e.attributes,1),t.writeTag(2,1),Gn(t,e.startTime),t.writeTag(3,1),Gn(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),Dne(t,i.positive.offset,i.positive.bucketCounts),t.writeTag(9,2),Dne(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 sze(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 gi.GAUGE:t.writeTag(5,2),aze(t,e);break;case gi.SUM:t.writeTag(7,2),cze(t,e);break;case gi.HISTOGRAM:t.writeTag(9,2),lze(t,e);break;case gi.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),uze(t,e);break;default:{let i=e}}t.finishLengthDelimited(r,t.pos-n)}function aze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let i of e.dataPoints)t.writeTag(1,2),Une(t,i,e.descriptor.valueType);t.finishLengthDelimited(r,t.pos-n)}function cze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),Une(t,o,e.descriptor.valueType);let i=$U(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 lze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),ize(t,o);let i=$U(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function uze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),oze(t,o);let i=$U(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function dze(t,e){let r=t.startLengthDelimited(),n=t.pos;Gp(t,e.scope,1);for(let i of e.metrics)t.writeTag(2,2),sze(t,i);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function Lne(t,e){let r=t.startLengthDelimited(),n=t.pos;Hp(t,e.resource,1);for(let i of e.scopeMetrics)t.writeTag(2,2),dze(t,i);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function $U(t){switch(t){case Ra.DELTA:return 1;case Ra.CUMULATIVE:return 2;default:return 0}}function Fne(t){let e=new Zc;e.writeTag(1,2),Lne(e,t);let r=new Kc(e.pos);return r.writeTag(1,2),Lne(r,t),r.finish()}var zne=R(()=>{"use strict";ve();MU();AR();RR();bR()});function fze(t){let e=new Co(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 jne(t){let e=new Co(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=fze(e.readBytes()):e.skip(i)}return r}var Bne=R(()=>{"use strict";CR()});var DU,qne=R(()=>{"use strict";zne();Bne();DU={serializeRequest:t=>Fne(t),deserializeResponse:t=>jne(t)}});var Vne=R(()=>{"use strict";qne()});function Hne(t,e){let r=t&255|pze;return e&&(r|=hze),r}function mze(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 gze(t,e){let r=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),Gn(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&Ro(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(r,t.pos-n)}function _ze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.context;t.writeTag(1,2),t.writeBytes(Aa(i.traceId)),t.writeTag(2,2),t.writeBytes(Aa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.attributes&&Ro(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let s=Hne(i.traceFlags,i.isRemote);s&&(t.writeTag(6,5),t.writeFixed32(s)),t.finishLengthDelimited(r,t.pos-n)}function yze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.spanContext();t.writeTag(1,2),t.writeBytes(Aa(i.traceId)),t.writeTag(2,2),t.writeBytes(Aa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(Aa(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let s=e.kind==null?0:e.kind+1;s!==0&&(t.writeTag(6,0),t.writeVarint(s)),t.writeTag(7,1),Gn(t,e.startTime),t.writeTag(8,1),Gn(t,e.endTime),e.attributes&&Ro(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),gze(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),_ze(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),mze(t,e.status);let a=Hne(i.traceFlags,e.parentSpanContext?.isRemote);a&&(t.writeTag(16,5),t.writeFixed32(a)),t.finishLengthDelimited(r,t.pos-n)}function Sze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Gp(t,e,1);for(let o of r)t.writeTag(2,2),yze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Gne(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Hp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;Sze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Eze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function Wne(t){let e=Eze(t),r=new Zc;for(let[i,o]of e)r.writeTag(1,2),Gne(r,i,o);let n=new Kc(r.pos);for(let[i,o]of e)n.writeTag(1,2),Gne(n,i,o);return n.finish()}var pze,hze,Yne=R(()=>{"use strict";bR();RU();AR();RR();pze=256,hze=512});function vze(t){let e=new Co(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 Kne(t){let e=new Co(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=vze(e.readBytes()):e.skip(i)}return r}var Zne=R(()=>{"use strict";CR()});var LU,Jne=R(()=>{"use strict";Yne();Zne();LU={serializeRequest:t=>Wne(t),deserializeResponse:t=>Kne(t)}});var Xne=R(()=>{"use strict";Jne()});function Wp(t,e){let r={attributes:Ca(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Yp(t){return{name:t.name,version:t.version}}function Ca(t,e){return Object.keys(t).map(r=>UU(r,t[r],e))}function UU(t,e,r){return{key:t,value:bS(e,r)}}function bS(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]=bS(t[i],e);return{arrayValue:{values:n}}}if(r==="object"&&t!=null){let n=Object.keys(t),i=new Array(n.length);for(let o=0;o<n.length;o++)i[o]={key:n[o],value:bS(t[n[o]],e)};return{kvlistValue:{values:i}}}return{}}var IR=R(()=>{"use strict"});function Qne(t,e){return{resourceLogs:Tze(t,e)}}function bze(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:s=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${o}:${s}`,l=a.get(c);l||(l=[],a.set(c,l)),l.push(r)}return e}function Tze(t,e){let r=bze(t);return Array.from(r,([n,i])=>{let o=Wp(n,e);return{resource:o,scopeLogs:Array.from(i,([,s])=>({scope:Yp(s[0].instrumentationScope),logRecords:s.map(a=>wze(a,e)),schemaUrl:s[0].instrumentationScope.schemaUrl})),schemaUrl:o.schemaUrl}})}function wze(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:bS(t.body,e),eventName:t.eventName,attributes:xze(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function xze(t,e){return Object.keys(t).map(r=>UU(r,t[r],e))}var eie=R(()=>{"use strict";IR()});function Aze(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Rze(t){return Aze(t).toString()}function tie(t){return t}var Cze,Kp,PR=R(()=>{"use strict";rp();Cze=typeof BigInt<"u"?Rze:Xw;Kp={encodeHrTime:Cze,encodeSpanContext:tie,encodeOptionalSpanContext:tie,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 FU,rie=R(()=>{"use strict";eie();PR();ve();FU={serializeRequest:t=>{let e=Qne(t,Kp);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 J.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}}});var nie=R(()=>{"use strict";rie()});var TS,iie=R(()=>{"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"})(TS||(TS={}))});function Ize(t,e){let r=Wp(t.resource,e);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:Pze(t.scopeMetrics,e)}}function Pze(t,e){return Array.from(t.map(r=>({scope:Yp(r.scope),metrics:r.metrics.map(n=>Oze(n,e)),schemaUrl:r.scope.schemaUrl})))}function Oze(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=$ze(t.aggregationTemporality);switch(t.dataPointType){case gi.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:oie(t,e)};break;case gi.GAUGE:r.gauge={dataPoints:oie(t,e)};break;case gi.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:kze(t,e)};break;case gi.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:Mze(t,e)};break}return r}function Nze(t,e,r){let n={attributes:Ca(t.attributes,r),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case ia.INT:n.asInt=t.value;break;case ia.DOUBLE:n.asDouble=t.value;break}return n}function oie(t,e){return t.dataPoints.map(r=>Nze(r,t.descriptor.valueType,e))}function kze(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Ca(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 Mze(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Ca(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 $ze(t){switch(t){case Ra.DELTA:return TS.AGGREGATION_TEMPORALITY_DELTA;case Ra.CUMULATIVE:return TS.AGGREGATION_TEMPORALITY_CUMULATIVE}}function sie(t,e){return{resourceMetrics:t.map(r=>Ize(r,e))}}var aie=R(()=>{"use strict";ve();MU();iie();IR()});var zU,cie=R(()=>{"use strict";aie();PR();ve();zU={serializeRequest:t=>{let e=sie([t],Kp);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 J.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}}});var lie=R(()=>{"use strict";cie()});function uie(t,e){let r=t&255|Dze;return e&&(r|=Lze),r}function Uze(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:Ca(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>zze(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>Fze(o,e)),droppedLinksCount:t.droppedLinksCount,flags:uie(r.traceFlags,t.parentSpanContext?.isRemote)}}function Fze(t,e){return{attributes:t.attributes?Ca(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:uie(t.context.traceFlags,t.context.isRemote)}}function zze(t,e){return{attributes:t.attributes?Ca(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function die(t,e){return{resourceSpans:Bze(t,e)}}function jze(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||""}`,o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return e}function Bze(t,e){let r=jze(t),n=[],i=r.entries(),o=i.next();for(;!o.done;){let[s,a]=o.value,c=[],l=a.values(),u=l.next();for(;!u.done;){let p=u.value;if(p.length>0){let h=p.map(m=>Uze(m,e));c.push({scope:Yp(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=l.next()}let d=Wp(s,e),f={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};n.push(f),o=i.next()}return n}var Dze,Lze,fie=R(()=>{"use strict";IR();Dze=256,Lze=512});var jU,pie=R(()=>{"use strict";fie();PR();ve();jU={serializeRequest:t=>{let e=die(t,Kp);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 J.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}}});var hie=R(()=>{"use strict";pie()});var mie={};zr(mie,{JsonLogsSerializer:()=>FU,JsonMetricsSerializer:()=>zU,JsonTraceSerializer:()=>jU,ProtobufLogsSerializer:()=>NU,ProtobufMetricsSerializer:()=>DU,ProtobufTraceSerializer:()=>LU});var gie=R(()=>{"use strict";kne();Vne();Xne();nie();lie();hie()});var yie=y(OR=>{"use strict";Object.defineProperty(OR,"__esModule",{value:!0});OR.OTLPTraceExporter=void 0;var _ie=_ne(),qze=(gie(),bn(mie)),Vze=(lx(),bn(cx)),BU=class extends Vze.OTLPExporterBase{constructor(e={}){super((0,_ie.createOtlpGrpcExportDelegate)((0,_ie.convertLegacyOtlpGrpcOptions)(e,"TRACES"),qze.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};OR.OTLPTraceExporter=BU});var Sie=y(NR=>{"use strict";Object.defineProperty(NR,"__esModule",{value:!0});NR.OTLPTraceExporter=void 0;var Gze=yie();Object.defineProperty(NR,"OTLPTraceExporter",{enumerable:!0,get:function(){return Gze.OTLPTraceExporter}})});var Boe=y((fkt,joe)=>{"use strict";joe.exports=zoe;zoe.sync=y2e;var Uoe=Z("fs");function _2e(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 Foe(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:_2e(e,r)}function zoe(t,e,r){Uoe.stat(t,function(n,i){r(n,n?!1:Foe(i,t,e))})}function y2e(t,e){return Foe(Uoe.statSync(t),t,e)}});var Woe=y((pkt,Hoe)=>{"use strict";Hoe.exports=Voe;Voe.sync=S2e;var qoe=Z("fs");function Voe(t,e,r){qoe.stat(t,function(n,i){r(n,n?!1:Goe(i,e))})}function S2e(t,e){return Goe(qoe.statSync(t),e)}function Goe(t,e){return t.isFile()&&E2e(t,e)}function E2e(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=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===s||r&a&&n===o||r&u&&o===0;return d}});var Koe=y((mkt,Yoe)=>{"use strict";var hkt=Z("fs"),a0;process.platform==="win32"||global.TESTING_WINDOWS?a0=Boe():a0=Woe();Yoe.exports=EF;EF.sync=v2e;function EF(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){EF(t,e||{},function(o,s){o?i(o):n(s)})})}a0(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function v2e(t,e){try{return a0.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var rse=y((gkt,tse)=>{"use strict";var th=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Zoe=Z("path"),b2e=th?";":":",Joe=Koe(),Xoe=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Qoe=(t,e)=>{let r=e.colon||b2e,n=t.match(/\//)||th&&t.match(/\\/)?[""]:[...th?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=th?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=th?i.split(r):[""];return th&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},ese=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Qoe(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(Xoe(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,h=Zoe.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];Joe(l+h,{pathExt:o},(m,g)=>{if(!m&&g)if(e.all)s.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)},T2e=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=Qoe(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=Zoe.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(Joe.sync(f,{pathExt:i}))if(e.all)o.push(f);else return f}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw Xoe(t)};tse.exports=ese;ese.sync=T2e});var ise=y((_kt,vF)=>{"use strict";var nse=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};vF.exports=nse;vF.exports.default=nse});var cse=y((ykt,ase)=>{"use strict";var ose=Z("path"),w2e=rse(),x2e=ise();function sse(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=w2e.sync(t.command,{path:r[x2e({env:r})],pathExt:e?ose.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=ose.resolve(i?t.options.cwd:"",s)),s}function A2e(t){return sse(t)||sse(t,!0)}ase.exports=A2e});var lse=y((Skt,TF)=>{"use strict";var bF=/([()\][%!^"`<>&|;, *?])/g;function R2e(t){return t=t.replace(bF,"^$1"),t}function C2e(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(bF,"^$1"),e&&(t=t.replace(bF,"^$1")),t}TF.exports.command=R2e;TF.exports.argument=C2e});var dse=y((Ekt,use)=>{"use strict";use.exports=/^#!(.*)/});var pse=y((vkt,fse)=>{"use strict";var I2e=dse();fse.exports=(t="")=>{let e=t.match(I2e);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var mse=y((bkt,hse)=>{"use strict";var wF=Z("fs"),P2e=pse();function O2e(t){let r=Buffer.alloc(150),n;try{n=wF.openSync(t,"r"),wF.readSync(n,r,0,150,0),wF.closeSync(n)}catch{}return P2e(r.toString())}hse.exports=O2e});var Sse=y((Tkt,yse)=>{"use strict";var N2e=Z("path"),gse=cse(),_se=lse(),k2e=mse(),M2e=process.platform==="win32",$2e=/\.(?:com|exe)$/i,D2e=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function L2e(t){t.file=gse(t);let e=t.file&&k2e(t.file);return e?(t.args.unshift(t.file),t.command=e,gse(t)):t.file}function U2e(t){if(!M2e)return t;let e=L2e(t),r=!$2e.test(e);if(t.options.forceShell||r){let n=D2e.test(e);t.command=N2e.normalize(t.command),t.command=_se.command(t.command),t.args=t.args.map(o=>_se.argument(o,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 F2e(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:U2e(n)}yse.exports=F2e});var bse=y((wkt,vse)=>{"use strict";var xF=process.platform==="win32";function AF(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 z2e(t,e){if(!xF)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=Ese(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function Ese(t,e){return xF&&t===1&&!e.file?AF(e.original,"spawn"):null}function j2e(t,e){return xF&&t===1&&!e.file?AF(e.original,"spawnSync"):null}vse.exports={hookChildProcess:z2e,verifyENOENT:Ese,verifyENOENTSync:j2e,notFoundError:AF}});var xse=y((xkt,rh)=>{"use strict";var Tse=Z("child_process"),RF=Sse(),CF=bse();function wse(t,e,r){let n=RF(t,e,r),i=Tse.spawn(n.command,n.args,n.options);return CF.hookChildProcess(i,n),i}function B2e(t,e,r){let n=RF(t,e,r),i=Tse.spawnSync(n.command,n.args,n.options);return i.error=i.error||CF.verifyENOENTSync(i.status,n),i}rh.exports=wse;rh.exports.spawn=wse;rh.exports.sync=B2e;rh.exports._parse=RF;rh.exports._enoent=CF});var Wv=y(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.regexpCode=pt.getEsmExportName=pt.getProperty=pt.safeStringify=pt.stringify=pt.strConcat=pt.addCodeArg=pt.str=pt._=pt.nil=pt._Code=pt.Name=pt.IDENTIFIER=pt._CodeOrName=void 0;var Gv=class{};pt._CodeOrName=Gv;pt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var lf=class extends Gv{constructor(e){if(super(),!pt.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};pt.Name=lf;var eo=class extends Gv{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof lf&&(r[n.str]=(r[n.str]||0)+1),r),{})}};pt._Code=eo;pt.nil=new eo("");function a_e(t,...e){let r=[t[0]],n=0;for(;n<e.length;)tH(r,e[n]),r.push(t[++n]);return new eo(r)}pt._=a_e;var eH=new eo("+");function c_e(t,...e){let r=[Hv(t[0])],n=0;for(;n<e.length;)r.push(eH),tH(r,e[n]),r.push(eH,Hv(t[++n]));return XJe(r),new eo(r)}pt.str=c_e;function tH(t,e){e instanceof eo?t.push(...e._items):e instanceof lf?t.push(e):t.push(tXe(e))}pt.addCodeArg=tH;function XJe(t){let e=1;for(;e<t.length-1;){if(t[e]===eH){let r=QJe(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function QJe(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof lf||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof lf))return`"${t}${e.slice(1)}`}function eXe(t,e){return e.emptyStr()?t:t.emptyStr()?e:c_e`${t}${e}`}pt.strConcat=eXe;function tXe(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Hv(Array.isArray(t)?t.join(","):t)}function rXe(t){return new eo(Hv(t))}pt.stringify=rXe;function Hv(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}pt.safeStringify=Hv;function nXe(t){return typeof t=="string"&&pt.IDENTIFIER.test(t)?new eo(`.${t}`):a_e`[${t}]`}pt.getProperty=nXe;function iXe(t){if(typeof t=="string"&&pt.IDENTIFIER.test(t))return new eo(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}pt.getEsmExportName=iXe;function oXe(t){return new eo(t.toString())}pt.regexpCode=oXe});var iH=y(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.ValueScope=ti.ValueScopeName=ti.Scope=ti.varKinds=ti.UsedValueState=void 0;var ei=Wv(),rH=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},mO;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(mO||(ti.UsedValueState=mO={}));ti.varKinds={const:new ei.Name("const"),let:new ei.Name("let"),var:new ei.Name("var")};var gO=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ei.Name?e:this.name(e)}name(e){return new ei.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};ti.Scope=gO;var _O=class extends ei.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ei._)`.${new ei.Name(r)}[${n}]`}};ti.ValueScopeName=_O;var sXe=(0,ei._)`\n`,nH=class extends gO{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?sXe:ei.nil}}get(){return this._scope}name(e){return new _O(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ei._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=ei.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,mO.Started);let u=r(l);if(u){let d=this.opts.es5?ti.varKinds.var:ti.varKinds.const;o=(0,ei._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,ei._)`${o}${u}${this.opts._n}`;else throw new rH(l);c.set(l,mO.Completed)})}return o}};ti.ValueScope=nH});var Je=y(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.or=et.and=et.not=et.CodeGen=et.operators=et.varKinds=et.ValueScopeName=et.ValueScope=et.Scope=et.Name=et.regexpCode=et.stringify=et.getProperty=et.nil=et.strConcat=et.str=et._=void 0;var st=Wv(),qo=iH(),Zl=Wv();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return Zl._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return Zl.str}});Object.defineProperty(et,"strConcat",{enumerable:!0,get:function(){return Zl.strConcat}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return Zl.nil}});Object.defineProperty(et,"getProperty",{enumerable:!0,get:function(){return Zl.getProperty}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return Zl.stringify}});Object.defineProperty(et,"regexpCode",{enumerable:!0,get:function(){return Zl.regexpCode}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return Zl.Name}});var vO=iH();Object.defineProperty(et,"Scope",{enumerable:!0,get:function(){return vO.Scope}});Object.defineProperty(et,"ValueScope",{enumerable:!0,get:function(){return vO.ValueScope}});Object.defineProperty(et,"ValueScopeName",{enumerable:!0,get:function(){return vO.ValueScopeName}});Object.defineProperty(et,"varKinds",{enumerable:!0,get:function(){return vO.varKinds}});et.operators={GT:new st._Code(">"),GTE:new st._Code(">="),LT:new st._Code("<"),LTE:new st._Code("<="),EQ:new st._Code("==="),NEQ:new st._Code("!=="),NOT:new st._Code("!"),OR:new st._Code("||"),AND:new st._Code("&&"),ADD:new st._Code("+")};var uc=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},oH=class extends uc{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?qo.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ig(this.rhs,e,r)),this}get names(){return this.rhs instanceof st._CodeOrName?this.rhs.names:{}}},yO=class extends uc{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof st.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ig(this.rhs,e,r),this}get names(){let e=this.lhs instanceof st.Name?{}:{...this.lhs.names};return EO(e,this.rhs)}},sH=class extends yO{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},aH=class extends uc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},cH=class extends uc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},lH=class extends uc{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},uH=class extends uc{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ig(this.code,e,r),this}get names(){return this.code instanceof st._CodeOrName?this.code.names:{}}},Yv=class extends uc{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(aXe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ff(e,r.names),{})}},dc=class extends Yv{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},dH=class extends Yv{},Cg=class extends dc{};Cg.kind="else";var uf=class t extends dc{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Cg(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(l_e(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ig(this.condition,e,r),this}get names(){let e=super.names;return EO(e,this.condition),this.else&&ff(e,this.else.names),e}};uf.kind="if";var df=class extends dc{};df.kind="for";var fH=class extends df{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ig(this.iteration,e,r),this}get names(){return ff(super.names,this.iteration.names)}},pH=class extends df{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?qo.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=EO(super.names,this.from);return EO(e,this.to)}},SO=class extends df{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ig(this.iterable,e,r),this}get names(){return ff(super.names,this.iterable.names)}},Kv=class extends dc{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Kv.kind="func";var Zv=class extends Yv{render(e){return"return "+super.render(e)}};Zv.kind="return";var hH=class extends dc{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ff(e,this.catch.names),this.finally&&ff(e,this.finally.names),e}},Jv=class extends dc{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Jv.kind="catch";var Xv=class extends dc{render(e){return"finally"+super.render(e)}};Xv.kind="finally";var mH=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
23
|
+
`:""},this._extScope=e,this._scope=new qo.Scope({parent:e}),this._nodes=[new dH]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new oH(e,o,n)),o}const(e,r,n){return this._def(qo.varKinds.const,e,r,n)}let(e,r,n){return this._def(qo.varKinds.let,e,r,n)}var(e,r,n){return this._def(qo.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new yO(e,r,n))}add(e,r){return this._leafNode(new sH(e,et.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==st.nil&&this._leafNode(new uH(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,st.addCodeArg)(r,i));return r.push("}"),new st._Code(r)}if(e,r,n){if(this._blockNode(new uf(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new uf(e))}else(){return this._elseNode(new Cg)}endIf(){return this._endBlockNode(uf,Cg)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new fH(e),r)}forRange(e,r,n,i,o=this.opts.es5?qo.varKinds.var:qo.varKinds.let){let s=this._scope.toName(e);return this._for(new pH(o,s,r,n),()=>i(s))}forOf(e,r,n,i=qo.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof st.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,st._)`${s}.length`,a=>{this.var(o,(0,st._)`${s}[${a}]`),n(o)})}return this._for(new SO("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?qo.varKinds.var:qo.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,st._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new SO("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(df)}label(e){return this._leafNode(new aH(e))}break(e){return this._leafNode(new cH(e))}return(e){let r=new Zv;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Zv)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new hH;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new Jv(o),r(o)}return n&&(this._currNode=i.finally=new Xv,this.code(n)),this._endBlockNode(Jv,Xv)}throw(e){return this._leafNode(new lH(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=st.nil,n,i){return this._blockNode(new Kv(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Kv)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof uf))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};et.CodeGen=mH;function ff(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function EO(t,e){return e instanceof st._CodeOrName?ff(t,e.names):t}function Ig(t,e,r){if(t instanceof st.Name)return n(t);if(!i(t))return t;return new st._Code(t._items.reduce((o,s)=>(s instanceof st.Name&&(s=n(s)),s instanceof st._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof st._Code&&o._items.some(s=>s instanceof st.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function aXe(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function l_e(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,st._)`!${gH(t)}`}et.not=l_e;var cXe=u_e(et.operators.AND);function lXe(...t){return t.reduce(cXe)}et.and=lXe;var uXe=u_e(et.operators.OR);function dXe(...t){return t.reduce(uXe)}et.or=dXe;function u_e(t){return(e,r)=>e===st.nil?r:r===st.nil?e:(0,st._)`${gH(e)} ${t} ${gH(r)}`}function gH(t){return t instanceof st.Name?t:(0,st._)`(${t})`}});var lt=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.checkStrictMode=rt.getErrorPath=rt.Type=rt.useFunc=rt.setEvaluated=rt.evaluatedPropsToName=rt.mergeEvaluated=rt.eachItem=rt.unescapeJsonPointer=rt.escapeJsonPointer=rt.escapeFragment=rt.unescapeFragment=rt.schemaRefOrVal=rt.schemaHasRulesButRef=rt.schemaHasRules=rt.checkUnknownRules=rt.alwaysValidSchema=rt.toHash=void 0;var Lt=Je(),fXe=Wv();function pXe(t){let e={};for(let r of t)e[r]=!0;return e}rt.toHash=pXe;function hXe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(p_e(t,e),!h_e(e,t.self.RULES.all))}rt.alwaysValidSchema=hXe;function p_e(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||__e(t,`unknown keyword: "${o}"`)}rt.checkUnknownRules=p_e;function h_e(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}rt.schemaHasRules=h_e;function mXe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}rt.schemaHasRulesButRef=mXe;function gXe({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Lt._)`${r}`}return(0,Lt._)`${t}${e}${(0,Lt.getProperty)(n)}`}rt.schemaRefOrVal=gXe;function _Xe(t){return m_e(decodeURIComponent(t))}rt.unescapeFragment=_Xe;function yXe(t){return encodeURIComponent(yH(t))}rt.escapeFragment=yXe;function yH(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}rt.escapeJsonPointer=yH;function m_e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}rt.unescapeJsonPointer=m_e;function SXe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}rt.eachItem=SXe;function d_e({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof Lt.Name?(o instanceof Lt.Name?t(i,o,s):e(i,o,s),s):o instanceof Lt.Name?(e(i,s,o),o):r(o,s);return a===Lt.Name&&!(c instanceof Lt.Name)?n(i,c):c}}rt.mergeEvaluated={props:d_e({mergeNames:(t,e,r)=>t.if((0,Lt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Lt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Lt._)`${r} || {}`).code((0,Lt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Lt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Lt._)`${r} || {}`),SH(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:g_e}),items:d_e({mergeNames:(t,e,r)=>t.if((0,Lt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Lt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Lt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Lt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function g_e(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Lt._)`{}`);return e!==void 0&&SH(t,r,e),r}rt.evaluatedPropsToName=g_e;function SH(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Lt._)`${e}${(0,Lt.getProperty)(n)}`,!0))}rt.setEvaluated=SH;var f_e={};function EXe(t,e){return t.scopeValue("func",{ref:e,code:f_e[e.code]||(f_e[e.code]=new fXe._Code(e.code))})}rt.useFunc=EXe;var _H;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(_H||(rt.Type=_H={}));function vXe(t,e,r){if(t instanceof Lt.Name){let n=e===_H.Num;return r?n?(0,Lt._)`"[" + ${t} + "]"`:(0,Lt._)`"['" + ${t} + "']"`:n?(0,Lt._)`"/" + ${t}`:(0,Lt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Lt.getProperty)(t).toString():"/"+yH(t)}rt.getErrorPath=vXe;function __e(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}rt.checkStrictMode=__e});var fc=y(EH=>{"use strict";Object.defineProperty(EH,"__esModule",{value:!0});var mn=Je(),bXe={data:new mn.Name("data"),valCxt:new mn.Name("valCxt"),instancePath:new mn.Name("instancePath"),parentData:new mn.Name("parentData"),parentDataProperty:new mn.Name("parentDataProperty"),rootData:new mn.Name("rootData"),dynamicAnchors:new mn.Name("dynamicAnchors"),vErrors:new mn.Name("vErrors"),errors:new mn.Name("errors"),this:new mn.Name("this"),self:new mn.Name("self"),scope:new mn.Name("scope"),json:new mn.Name("json"),jsonPos:new mn.Name("jsonPos"),jsonLen:new mn.Name("jsonLen"),jsonPart:new mn.Name("jsonPart")};EH.default=bXe});var Qv=y(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.extendErrors=gn.resetErrorsCount=gn.reportExtraError=gn.reportError=gn.keyword$DataError=gn.keywordError=void 0;var ut=Je(),bO=lt(),Mn=fc();gn.keywordError={message:({keyword:t})=>(0,ut.str)`must pass "${t}" keyword validation`};gn.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ut.str)`"${t}" keyword must be ${e} ($data)`:(0,ut.str)`"${t}" keyword is invalid ($data)`};function TXe(t,e=gn.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=E_e(t,e,r);n??(s||a)?y_e(o,c):S_e(i,(0,ut._)`[${c}]`)}gn.reportError=TXe;function wXe(t,e=gn.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=E_e(t,e,r);y_e(i,a),o||s||S_e(n,Mn.default.vErrors)}gn.reportExtraError=wXe;function xXe(t,e){t.assign(Mn.default.errors,e),t.if((0,ut._)`${Mn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ut._)`${Mn.default.vErrors}.length`,e),()=>t.assign(Mn.default.vErrors,null)))}gn.resetErrorsCount=xXe;function AXe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,Mn.default.errors,a=>{t.const(s,(0,ut._)`${Mn.default.vErrors}[${a}]`),t.if((0,ut._)`${s}.instancePath === undefined`,()=>t.assign((0,ut._)`${s}.instancePath`,(0,ut.strConcat)(Mn.default.instancePath,o.errorPath))),t.assign((0,ut._)`${s}.schemaPath`,(0,ut.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ut._)`${s}.schema`,r),t.assign((0,ut._)`${s}.data`,n))})}gn.extendErrors=AXe;function y_e(t,e){let r=t.const("err",e);t.if((0,ut._)`${Mn.default.vErrors} === null`,()=>t.assign(Mn.default.vErrors,(0,ut._)`[${r}]`),(0,ut._)`${Mn.default.vErrors}.push(${r})`),t.code((0,ut._)`${Mn.default.errors}++`)}function S_e(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ut._)`new ${t.ValidationError}(${e})`):(r.assign((0,ut._)`${n}.errors`,e),r.return(!1))}var pf={keyword:new ut.Name("keyword"),schemaPath:new ut.Name("schemaPath"),params:new ut.Name("params"),propertyName:new ut.Name("propertyName"),message:new ut.Name("message"),schema:new ut.Name("schema"),parentSchema:new ut.Name("parentSchema")};function E_e(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ut._)`{}`:RXe(t,e,r)}function RXe(t,e,r={}){let{gen:n,it:i}=t,o=[CXe(i,r),IXe(t,r)];return PXe(t,e,o),n.object(...o)}function CXe({errorPath:t},{instancePath:e}){let r=e?(0,ut.str)`${t}${(0,bO.getErrorPath)(e,bO.Type.Str)}`:t;return[Mn.default.instancePath,(0,ut.strConcat)(Mn.default.instancePath,r)]}function IXe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ut.str)`${e}/${t}`;return r&&(i=(0,ut.str)`${i}${(0,bO.getErrorPath)(r,bO.Type.Str)}`),[pf.schemaPath,i]}function PXe(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([pf.keyword,i],[pf.params,typeof e=="function"?e(t):e||(0,ut._)`{}`]),c.messages&&n.push([pf.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([pf.schema,s],[pf.parentSchema,(0,ut._)`${u}${d}`],[Mn.default.data,o]),l&&n.push([pf.propertyName,l])}});var b_e=y(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.boolOrEmptySchema=Pg.topBoolOrEmptySchema=void 0;var OXe=Qv(),NXe=Je(),kXe=fc(),MXe={message:"boolean schema is false"};function $Xe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?v_e(t,!1):typeof r=="object"&&r.$async===!0?e.return(kXe.default.data):(e.assign((0,NXe._)`${n}.errors`,null),e.return(!0))}Pg.topBoolOrEmptySchema=$Xe;function DXe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),v_e(t)):r.var(e,!0)}Pg.boolOrEmptySchema=DXe;function v_e(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,OXe.reportError)(i,MXe,void 0,e)}});var vH=y(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.getRules=Og.isJSONType=void 0;var LXe=["string","number","integer","boolean","null","object","array"],UXe=new Set(LXe);function FXe(t){return typeof t=="string"&&UXe.has(t)}Og.isJSONType=FXe;function zXe(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Og.getRules=zXe});var bH=y(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.shouldUseRule=Jl.shouldUseGroup=Jl.schemaHasRulesForType=void 0;function jXe({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&T_e(t,n)}Jl.schemaHasRulesForType=jXe;function T_e(t,e){return e.rules.some(r=>w_e(t,r))}Jl.shouldUseGroup=T_e;function w_e(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Jl.shouldUseRule=w_e});var eb=y(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.reportTypeError=_n.checkDataTypes=_n.checkDataType=_n.coerceAndCheckDataType=_n.getJSONTypes=_n.getSchemaTypes=_n.DataType=void 0;var BXe=vH(),qXe=bH(),VXe=Qv(),Ke=Je(),x_e=lt(),Ng;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ng||(_n.DataType=Ng={}));function GXe(t){let e=A_e(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}_n.getSchemaTypes=GXe;function A_e(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(BXe.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}_n.getJSONTypes=A_e;function HXe(t,e){let{gen:r,data:n,opts:i}=t,o=WXe(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,qXe.schemaHasRulesForType)(t,e[0]));if(s){let a=wH(e,n,i.strictNumbers,Ng.Wrong);r.if(a,()=>{o.length?YXe(t,e,o):xH(t)})}return s}_n.coerceAndCheckDataType=HXe;var R_e=new Set(["string","number","integer","boolean","null"]);function WXe(t,e){return e?t.filter(r=>R_e.has(r)||e==="array"&&r==="array"):[]}function YXe(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,Ke._)`typeof ${i}`),a=n.let("coerced",(0,Ke._)`undefined`);o.coerceTypes==="array"&&n.if((0,Ke._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ke._)`${i}[0]`).assign(s,(0,Ke._)`typeof ${i}`).if(wH(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,Ke._)`${a} !== undefined`);for(let l of r)(R_e.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),xH(t),n.endIf(),n.if((0,Ke._)`${a} !== undefined`,()=>{n.assign(i,a),KXe(t,a)});function c(l){switch(l){case"string":n.elseIf((0,Ke._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Ke._)`"" + ${i}`).elseIf((0,Ke._)`${i} === null`).assign(a,(0,Ke._)`""`);return;case"number":n.elseIf((0,Ke._)`${s} == "boolean" || ${i} === null
|
|
24
|
+
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,Ke._)`+${i}`);return;case"integer":n.elseIf((0,Ke._)`${s} === "boolean" || ${i} === null
|
|
25
|
+
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,Ke._)`+${i}`);return;case"boolean":n.elseIf((0,Ke._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,Ke._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Ke._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Ke._)`${s} === "string" || ${s} === "number"
|
|
26
|
+
|| ${s} === "boolean" || ${i} === null`).assign(a,(0,Ke._)`[${i}]`)}}}function KXe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ke._)`${e} !== undefined`,()=>t.assign((0,Ke._)`${e}[${r}]`,n))}function TH(t,e,r,n=Ng.Correct){let i=n===Ng.Correct?Ke.operators.EQ:Ke.operators.NEQ,o;switch(t){case"null":return(0,Ke._)`${e} ${i} null`;case"array":o=(0,Ke._)`Array.isArray(${e})`;break;case"object":o=(0,Ke._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Ke._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Ke._)`typeof ${e} ${i} ${t}`}return n===Ng.Correct?o:(0,Ke.not)(o);function s(a=Ke.nil){return(0,Ke.and)((0,Ke._)`typeof ${e} == "number"`,a,r?(0,Ke._)`isFinite(${e})`:Ke.nil)}}_n.checkDataType=TH;function wH(t,e,r,n){if(t.length===1)return TH(t[0],e,r,n);let i,o=(0,x_e.toHash)(t);if(o.array&&o.object){let s=(0,Ke._)`typeof ${e} != "object"`;i=o.null?s:(0,Ke._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Ke.nil;o.number&&delete o.integer;for(let s in o)i=(0,Ke.and)(i,TH(s,e,r,n));return i}_n.checkDataTypes=wH;var ZXe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ke._)`{type: ${t}}`:(0,Ke._)`{type: ${e}}`};function xH(t){let e=JXe(t);(0,VXe.reportError)(e,ZXe)}_n.reportTypeError=xH;function JXe(t){let{gen:e,data:r,schema:n}=t,i=(0,x_e.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var I_e=y(TO=>{"use strict";Object.defineProperty(TO,"__esModule",{value:!0});TO.assignDefaults=void 0;var kg=Je(),XXe=lt();function QXe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)C_e(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>C_e(t,o,i.default))}TO.assignDefaults=QXe;function C_e(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,kg._)`${o}${(0,kg.getProperty)(e)}`;if(i){(0,XXe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,kg._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,kg._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,kg._)`${a} = ${(0,kg.stringify)(r)}`)}});var to=y(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.validateUnion=Pt.validateArray=Pt.usePattern=Pt.callValidateCode=Pt.schemaProperties=Pt.allSchemaProperties=Pt.noPropertyInData=Pt.propertyInData=Pt.isOwnProperty=Pt.hasPropFunc=Pt.reportMissingProp=Pt.checkMissingProp=Pt.checkReportMissingProp=void 0;var Bt=Je(),AH=lt(),Xl=fc(),eQe=lt();function tQe(t,e){let{gen:r,data:n,it:i}=t;r.if(CH(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Bt._)`${e}`},!0),t.error()})}Pt.checkReportMissingProp=tQe;function rQe({gen:t,data:e,it:{opts:r}},n,i){return(0,Bt.or)(...n.map(o=>(0,Bt.and)(CH(t,e,o,r.ownProperties),(0,Bt._)`${i} = ${o}`)))}Pt.checkMissingProp=rQe;function nQe(t,e){t.setParams({missingProperty:e},!0),t.error()}Pt.reportMissingProp=nQe;function P_e(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Bt._)`Object.prototype.hasOwnProperty`})}Pt.hasPropFunc=P_e;function RH(t,e,r){return(0,Bt._)`${P_e(t)}.call(${e}, ${r})`}Pt.isOwnProperty=RH;function iQe(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} !== undefined`;return n?(0,Bt._)`${i} && ${RH(t,e,r)}`:i}Pt.propertyInData=iQe;function CH(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} === undefined`;return n?(0,Bt.or)(i,(0,Bt.not)(RH(t,e,r))):i}Pt.noPropertyInData=CH;function O_e(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Pt.allSchemaProperties=O_e;function oQe(t,e){return O_e(e).filter(r=>!(0,AH.alwaysValidSchema)(t,e[r]))}Pt.schemaProperties=oQe;function sQe({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,Bt._)`${t}, ${e}, ${n}${i}`:e,d=[[Xl.default.instancePath,(0,Bt.strConcat)(Xl.default.instancePath,o)],[Xl.default.parentData,s.parentData],[Xl.default.parentDataProperty,s.parentDataProperty],[Xl.default.rootData,Xl.default.rootData]];s.opts.dynamicRef&&d.push([Xl.default.dynamicAnchors,Xl.default.dynamicAnchors]);let f=(0,Bt._)`${u}, ${r.object(...d)}`;return c!==Bt.nil?(0,Bt._)`${a}.call(${c}, ${f})`:(0,Bt._)`${a}(${f})`}Pt.callValidateCode=sQe;var aQe=(0,Bt._)`new RegExp`;function cQe({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Bt._)`${i.code==="new RegExp"?aQe:(0,eQe.useFunc)(t,i)}(${r}, ${n})`})}Pt.usePattern=cQe;function lQe(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,Bt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:AH.Type.Num},o),e.if((0,Bt.not)(o),a)})}}Pt.validateArray=lQe;function uQe(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,AH.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,Bt._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Bt.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}Pt.validateUnion=uQe});var M_e=y(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.validateKeywordUsage=Hs.validSchemaType=Hs.funcKeywordCode=Hs.macroKeywordCode=void 0;var $n=Je(),hf=fc(),dQe=to(),fQe=Qv();function pQe(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=k_e(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:$n.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Hs.macroKeywordCode=pQe;function hQe(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;gQe(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=k_e(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)m(),e.modifying&&N_e(t),g(()=>t.error());else{let _=e.async?p():h();e.modifying&&N_e(t),g(()=>mQe(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>m((0,$n._)`await `),v=>n.assign(d,!1).if((0,$n._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,$n._)`${v}.errors`),()=>n.throw(v))),_}function h(){let _=(0,$n._)`${u}.errors`;return n.assign(_,null),m($n.nil),_}function m(_=e.async?(0,$n._)`await `:$n.nil){let v=c.opts.passContext?hf.default.this:hf.default.self,T=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,$n._)`${_}${(0,dQe.callValidateCode)(t,u,v,T)}`,e.modifying)}function g(_){var v;n.if((0,$n.not)((v=e.valid)!==null&&v!==void 0?v:d),_)}}Hs.funcKeywordCode=hQe;function N_e(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,$n._)`${n.parentData}[${n.parentDataProperty}]`))}function mQe(t,e){let{gen:r}=t;r.if((0,$n._)`Array.isArray(${e})`,()=>{r.assign(hf.default.vErrors,(0,$n._)`${hf.default.vErrors} === null ? ${e} : ${hf.default.vErrors}.concat(${e})`).assign(hf.default.errors,(0,$n._)`${hf.default.vErrors}.length`),(0,fQe.extendErrors)(t)},()=>t.error())}function gQe({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function k_e(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,$n.stringify)(r)})}function _Qe(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Hs.validSchemaType=_Qe;function yQe({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Hs.validateKeywordUsage=yQe});var D_e=y(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.extendSubschemaMode=Ql.extendSubschemaData=Ql.getSubschema=void 0;var Ws=Je(),$_e=lt();function SQe(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ws._)`${t.schemaPath}${(0,Ws.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ws._)`${t.schemaPath}${(0,Ws.getProperty)(e)}${(0,Ws.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,$_e.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Ql.getSubschema=SQe;function EQe(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Ws._)`${e.data}${(0,Ws.getProperty)(r)}`,!0);c(f),t.errorPath=(0,Ws.str)`${l}${(0,$_e.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ws._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof Ws.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}Ql.extendSubschemaData=EQe;function vQe(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}Ql.extendSubschemaMode=vQe});var IH=y((wnr,L_e)=>{"use strict";L_e.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var F_e=y((xnr,U_e)=>{"use strict";var eu=U_e.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};wO(e,n,i,t,"",t)};eu.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};eu.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};eu.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};eu.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function wO(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in eu.arrayKeywords)for(var f=0;f<d.length;f++)wO(t,e,r,d[f],i+"/"+u+"/"+f,o,i,u,n,f)}else if(u in eu.propsKeywords){if(d&&typeof d=="object")for(var p in d)wO(t,e,r,d[p],i+"/"+u+"/"+bQe(p),o,i,u,n,p)}else(u in eu.keywords||t.allKeys&&!(u in eu.skipKeywords))&&wO(t,e,r,d,i+"/"+u,o,i,u,n)}r(n,i,o,s,a,c,l)}}function bQe(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var tb=y(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.getSchemaRefs=ri.resolveUrl=ri.normalizeId=ri._getFullPath=ri.getFullPath=ri.inlineRef=void 0;var TQe=lt(),wQe=IH(),xQe=F_e(),AQe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function RQe(t,e=!0){return typeof t=="boolean"?!0:e===!0?!PH(t):e?z_e(t)<=e:!1}ri.inlineRef=RQe;var CQe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function PH(t){for(let e in t){if(CQe.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(PH)||typeof r=="object"&&PH(r))return!0}return!1}function z_e(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!AQe.has(r)&&(typeof t[r]=="object"&&(0,TQe.eachItem)(t[r],n=>e+=z_e(n)),e===1/0))return 1/0}return e}function j_e(t,e="",r){r!==!1&&(e=Mg(e));let n=t.parse(e);return B_e(t,n)}ri.getFullPath=j_e;function B_e(t,e){return t.serialize(e).split("#")[0]+"#"}ri._getFullPath=B_e;var IQe=/#\/?$/;function Mg(t){return t?t.replace(IQe,""):""}ri.normalizeId=Mg;function PQe(t,e,r){return r=Mg(r),t.resolve(e,r)}ri.resolveUrl=PQe;var OQe=/^[a-z_][-a-z0-9._]*$/i;function NQe(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Mg(t[r]||e),o={"":i},s=j_e(n,i,!1),a={},c=new Set;return xQe(t,{allKeys:!0},(d,f,p,h)=>{if(h===void 0)return;let m=s+f,g=o[h];typeof d[r]=="string"&&(g=_.call(this,d[r])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),o[f]=g;function _(T){let b=this.opts.uriResolver.resolve;if(T=Mg(g?b(g,T):T),c.has(T))throw u(T);c.add(T);let A=this.refs[T];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,T):T!==Mg(m)&&(T[0]==="#"?(l(d,a[T],T),a[T]=d):this.refs[T]=m),T}function v(T){if(typeof T=="string"){if(!OQe.test(T))throw new Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function l(d,f,p){if(f!==void 0&&!wQe(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ri.getSchemaRefs=NQe});var ib=y(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.getData=tu.KeywordCxt=tu.validateFunctionCode=void 0;var W_e=b_e(),q_e=eb(),NH=bH(),xO=eb(),kQe=I_e(),nb=M_e(),OH=D_e(),Re=Je(),Fe=fc(),MQe=tb(),pc=lt(),rb=Qv();function $Qe(t){if(Z_e(t)&&(J_e(t),K_e(t))){UQe(t);return}Y_e(t,()=>(0,W_e.topBoolOrEmptySchema)(t))}tu.validateFunctionCode=$Qe;function Y_e({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,Re._)`${Fe.default.data}, ${Fe.default.valCxt}`,n.$async,()=>{t.code((0,Re._)`"use strict"; ${V_e(r,i)}`),LQe(t,i),t.code(o)}):t.func(e,(0,Re._)`${Fe.default.data}, ${DQe(i)}`,n.$async,()=>t.code(V_e(r,i)).code(o))}function DQe(t){return(0,Re._)`{${Fe.default.instancePath}="", ${Fe.default.parentData}, ${Fe.default.parentDataProperty}, ${Fe.default.rootData}=${Fe.default.data}${t.dynamicRef?(0,Re._)`, ${Fe.default.dynamicAnchors}={}`:Re.nil}}={}`}function LQe(t,e){t.if(Fe.default.valCxt,()=>{t.var(Fe.default.instancePath,(0,Re._)`${Fe.default.valCxt}.${Fe.default.instancePath}`),t.var(Fe.default.parentData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentData}`),t.var(Fe.default.parentDataProperty,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentDataProperty}`),t.var(Fe.default.rootData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.rootData}`),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`${Fe.default.valCxt}.${Fe.default.dynamicAnchors}`)},()=>{t.var(Fe.default.instancePath,(0,Re._)`""`),t.var(Fe.default.parentData,(0,Re._)`undefined`),t.var(Fe.default.parentDataProperty,(0,Re._)`undefined`),t.var(Fe.default.rootData,Fe.default.data),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`{}`)})}function UQe(t){let{schema:e,opts:r,gen:n}=t;Y_e(t,()=>{r.$comment&&e.$comment&&Q_e(t),qQe(t),n.let(Fe.default.vErrors,null),n.let(Fe.default.errors,0),r.unevaluated&&FQe(t),X_e(t),HQe(t)})}function FQe(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,Re._)`${r}.evaluated`),e.if((0,Re._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Re._)`${t.evaluated}.props`,(0,Re._)`undefined`)),e.if((0,Re._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Re._)`${t.evaluated}.items`,(0,Re._)`undefined`))}function V_e(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,Re._)`/*# sourceURL=${r} */`:Re.nil}function zQe(t,e){if(Z_e(t)&&(J_e(t),K_e(t))){jQe(t,e);return}(0,W_e.boolOrEmptySchema)(t,e)}function K_e({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Z_e(t){return typeof t.schema!="boolean"}function jQe(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&Q_e(t),VQe(t),GQe(t);let o=n.const("_errs",Fe.default.errors);X_e(t,o),n.var(e,(0,Re._)`${o} === ${Fe.default.errors}`)}function J_e(t){(0,pc.checkUnknownRules)(t),BQe(t)}function X_e(t,e){if(t.opts.jtd)return G_e(t,[],!1,e);let r=(0,q_e.getSchemaTypes)(t.schema),n=(0,q_e.coerceAndCheckDataType)(t,r);G_e(t,r,!n,e)}function BQe(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,pc.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function qQe(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,pc.checkStrictMode)(t,"default is ignored in the schema root")}function VQe(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,MQe.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function GQe(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Q_e({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,Re._)`${Fe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,Re.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Re._)`${Fe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function HQe(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,Re._)`${Fe.default.errors} === 0`,()=>e.return(Fe.default.data),()=>e.throw((0,Re._)`new ${i}(${Fe.default.vErrors})`)):(e.assign((0,Re._)`${n}.errors`,Fe.default.vErrors),o.unevaluated&&WQe(t),e.return((0,Re._)`${Fe.default.errors} === 0`))}function WQe({gen:t,evaluated:e,props:r,items:n}){r instanceof Re.Name&&t.assign((0,Re._)`${e}.props`,r),n instanceof Re.Name&&t.assign((0,Re._)`${e}.items`,n)}function G_e(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,pc.schemaHasRulesButRef)(o,u))){i.block(()=>tye(t,"$ref",u.all.$ref.definition));return}c.jtd||YQe(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,NH.shouldUseGroup)(o,f)&&(f.type?(i.if((0,xO.checkDataType)(f.type,s,c.strictNumbers)),H_e(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,xO.reportTypeError)(t)),i.endIf()):H_e(t,f),a||i.if((0,Re._)`${Fe.default.errors} === ${n||0}`))}}function H_e(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,kQe.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,NH.shouldUseRule)(n,o)&&tye(t,o.keyword,o.definition,e.type)})}function YQe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(KQe(t,e),t.opts.allowUnionTypes||ZQe(t,e),JQe(t,t.dataTypes))}function KQe(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{eye(t.dataTypes,r)||kH(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),QQe(t,e)}}function ZQe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&kH(t,"use allowUnionTypes to allow union type keyword")}function JQe(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,NH.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>XQe(e,s))&&kH(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function XQe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function eye(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function QQe(t,e){let r=[];for(let n of t.dataTypes)eye(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function kH(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,pc.checkStrictMode)(t,e,t.opts.strictTypes)}var AO=class{constructor(e,r,n){if((0,nb.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,pc.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",rye(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,nb.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Fe.default.errors))}result(e,r,n){this.failResult((0,Re.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,Re.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,Re._)`${r} !== undefined && (${(0,Re.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?rb.reportExtraError:rb.reportError)(this,this.def.error,r)}$dataError(){(0,rb.reportError)(this,this.def.$dataError||rb.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,rb.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=Re.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=Re.nil,r=Re.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,Re.or)((0,Re._)`${i} === undefined`,r)),e!==Re.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==Re.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,Re.or)(s(),a());function s(){if(n.length){if(!(r instanceof Re.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,Re._)`${(0,xO.checkDataTypes)(c,r,o.opts.strictNumbers,xO.DataType.Wrong)}`}return Re.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Re._)`!${c}(${r})`}return Re.nil}}subschema(e,r){let n=(0,OH.getSubschema)(this.it,e);(0,OH.extendSubschemaData)(n,this.it,e),(0,OH.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return zQe(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=pc.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=pc.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,Re.Name)),!0}};tu.KeywordCxt=AO;function tye(t,e,r,n){let i=new AO(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,nb.funcKeywordCode)(i,r):"macro"in r?(0,nb.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,nb.funcKeywordCode)(i,r)}var e7e=/^\/(?:[^~]|~0|~1)*$/,t7e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function rye(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return Fe.default.rootData;if(t[0]==="/"){if(!e7e.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=Fe.default.rootData}else{let l=t7e.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,Re._)`${o}${(0,Re.getProperty)((0,pc.unescapeJsonPointer)(l))}`,s=(0,Re._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}tu.getData=rye});var RO=y($H=>{"use strict";Object.defineProperty($H,"__esModule",{value:!0});var MH=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};$H.default=MH});var ob=y(UH=>{"use strict";Object.defineProperty(UH,"__esModule",{value:!0});var DH=tb(),LH=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,DH.resolveUrl)(e,r,n),this.missingSchema=(0,DH.normalizeId)((0,DH.getFullPath)(e,this.missingRef))}};UH.default=LH});var IO=y(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.resolveSchema=ro.getCompilingSchema=ro.resolveRef=ro.compileSchema=ro.SchemaEnv=void 0;var Vo=Je(),r7e=RO(),mf=fc(),Go=tb(),nye=lt(),n7e=ib(),$g=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Go.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ro.SchemaEnv=$g;function zH(t){let e=iye.call(this,t);if(e)return e;let r=(0,Go.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new Vo.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:r7e.default,code:(0,Vo._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:mf.default.data,parentData:mf.default.parentData,parentDataProperty:mf.default.parentDataProperty,dataNames:[mf.default.data],dataPathArr:[Vo.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Vo.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Vo.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Vo._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,n7e.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(mf.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${mf.default.self}`,`${mf.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:m}=l;p.evaluated={props:h instanceof Vo.Name?void 0:h,items:m instanceof Vo.Name?void 0:m,dynamicProps:h instanceof Vo.Name,dynamicItems:m instanceof Vo.Name},p.source&&(p.source.evaluated=(0,Vo.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}ro.compileSchema=zH;function i7e(t,e,r){var n;r=(0,Go.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=a7e.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new $g({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=o7e.call(this,o)}ro.resolveRef=i7e;function o7e(t){return(0,Go.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:zH.call(this,t)}function iye(t){for(let e of this._compilations)if(s7e(e,t))return e}ro.getCompilingSchema=iye;function s7e(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function a7e(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||CO.call(this,t,e)}function CO(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Go._getFullPath)(this.opts.uriResolver,r),i=(0,Go.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return FH.call(this,r,t);let o=(0,Go.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=CO.call(this,t,s);return typeof a?.schema!="object"?void 0:FH.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||zH.call(this,s),o===(0,Go.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Go.resolveUrl)(this.opts.uriResolver,i,l)),new $g({schema:a,schemaId:c,root:t,baseId:i})}return FH.call(this,r,s)}}ro.resolveSchema=CO;var c7e=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function FH(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,nye.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!c7e.has(a)&&l&&(e=(0,Go.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,nye.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Go.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=CO.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new $g({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var oye=y((Onr,l7e)=>{l7e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var qH=y((Nnr,dye)=>{"use strict";var u7e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),aye=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),jH=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),cye=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),d7e=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function BH(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var f7e=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function sye(t){return t.length=0,!0}function p7e(t,e,r){if(t.length){let n=BH(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function h7e(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=p7e;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(o===!0&&(s=!0),!a(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=sye}else{i.push(l);continue}}return i.length&&(a===sye?r.zone=i.join(""):s?n.push(i.join("")):n.push(BH(i))),r.address=n.join(""),r}function lye(t){if(m7e(t,":")<2)return{host:t,isIPV6:!1};let e=h7e(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function m7e(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function g7e(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var _7e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},y7e=/[@/?#:]/g,S7e=/[@/?#]/g;function uye(t,e){let r=e?S7e:y7e;return r.lastIndex=0,t.replace(r,n=>_7e[n])}function E7e(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(jH(i)){let o=i.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&cye(s)?r+=s:r+="%"+o,n+=2;continue}}r+=t[n]}return r}function v7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(jH(n)){let i=n.toUpperCase(),o=String.fromCharCode(parseInt(i,16));o!=="."&&cye(o)?e+=o:e+="%"+i,r+=2;continue}}d7e(t[r])?e+=t[r]:e+=escape(t[r])}return e}function b7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(jH(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function T7e(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!aye(r)){let n=lye(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=uye(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}dye.exports={nonSimpleDomain:f7e,recomposeAuthority:T7e,reescapeHostDelimiters:uye,normalizePercentEncoding:E7e,normalizePathEncoding:v7e,escapePreservingEscapes:b7e,removeDotSegments:g7e,isIPv4:aye,isUUID:u7e,normalizeIPv6:lye,stringArrayToHexStripped:BH}});var gye=y((knr,mye)=>{"use strict";var{isUUID:w7e}=qH(),x7e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,A7e=["http","https","ws","wss","urn","urn:uuid"];function R7e(t){return A7e.indexOf(t)!==-1}function VH(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function fye(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function pye(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function C7e(t){return t.secure=VH(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function I7e(t){if((t.port===(VH(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function P7e(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(x7e);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=GH(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function O7e(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=GH(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function N7e(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!w7e(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function k7e(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var hye={scheme:"http",domainHost:!0,parse:fye,serialize:pye},M7e={scheme:"https",domainHost:hye.domainHost,parse:fye,serialize:pye},PO={scheme:"ws",domainHost:!0,parse:C7e,serialize:I7e},$7e={scheme:"wss",domainHost:PO.domainHost,parse:PO.parse,serialize:PO.serialize},D7e={scheme:"urn",parse:P7e,serialize:O7e,skipNormalize:!0},L7e={scheme:"urn:uuid",parse:N7e,serialize:k7e,skipNormalize:!0},OO={http:hye,https:M7e,ws:PO,wss:$7e,urn:D7e,"urn:uuid":L7e};Object.setPrototypeOf(OO,null);function GH(t){return t&&(OO[t]||OO[t.toLowerCase()])||void 0}mye.exports={wsIsSecure:VH,SCHEMES:OO,isValidSchemeName:R7e,getSchemeHandler:GH}});var bye=y((Mnr,NO)=>{"use strict";var{normalizeIPv6:U7e,removeDotSegments:sb,recomposeAuthority:F7e,normalizePercentEncoding:z7e,normalizePathEncoding:j7e,escapePreservingEscapes:B7e,reescapeHostDelimiters:q7e,isIPv4:V7e,nonSimpleDomain:G7e}=qH(),{SCHEMES:H7e,getSchemeHandler:yye}=gye();function W7e(t,e){return typeof t=="string"?t=X7e(t,e):typeof t=="object"&&(t=Dg(gf(t,e),e)),t}function Y7e(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Sye(Dg(t,n),Dg(e,n),n,!0);return n.skipEscape=!0,gf(i,n)}function Sye(t,e,r,n){let i={};return n||(t=Dg(gf(t,r),r),e=Dg(gf(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=sb(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=sb(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=sb(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=sb(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function K7e(t,e,r){let n=_ye(t,r),i=_ye(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function gf(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=yye(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=z7e(r.path):(r.path=B7e(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=F7e(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=sb(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var Z7e=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function J7e(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Eye(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(Z7e);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=J7e(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(V7e(n.host)===!1){let u=U7e(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=yye(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&G7e(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=q7e(unescape(n.host),o))),n.path&&(n.path=j7e(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Dg(t,e){return Eye(t,e).parsed}function X7e(t,e){return vye(t,e).normalized}function vye(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Eye(t,e);return{normalized:n?t:gf(r,e),malformedAuthorityOrPort:n}}function _ye(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=vye(t,e);return n?void 0:r}if(typeof t=="object")return gf(t,e)}var HH={SCHEMES:H7e,normalize:W7e,resolve:Y7e,resolveComponent:Sye,equal:K7e,serialize:gf,parse:Dg};NO.exports=HH;NO.exports.default=HH;NO.exports.fastUri=HH});var wye=y(WH=>{"use strict";Object.defineProperty(WH,"__esModule",{value:!0});var Tye=bye();Tye.code='require("ajv/dist/runtime/uri").default';WH.default=Tye});var Nye=y(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.CodeGen=rn.Name=rn.nil=rn.stringify=rn.str=rn._=rn.KeywordCxt=void 0;var Q7e=ib();Object.defineProperty(rn,"KeywordCxt",{enumerable:!0,get:function(){return Q7e.KeywordCxt}});var Lg=Je();Object.defineProperty(rn,"_",{enumerable:!0,get:function(){return Lg._}});Object.defineProperty(rn,"str",{enumerable:!0,get:function(){return Lg.str}});Object.defineProperty(rn,"stringify",{enumerable:!0,get:function(){return Lg.stringify}});Object.defineProperty(rn,"nil",{enumerable:!0,get:function(){return Lg.nil}});Object.defineProperty(rn,"Name",{enumerable:!0,get:function(){return Lg.Name}});Object.defineProperty(rn,"CodeGen",{enumerable:!0,get:function(){return Lg.CodeGen}});var eet=RO(),Iye=ob(),tet=vH(),ab=IO(),ret=Je(),cb=tb(),kO=eb(),KH=lt(),xye=oye(),net=wye(),Pye=(t,e)=>new RegExp(t,e);Pye.code="new RegExp";var iet=["removeAdditional","useDefaults","coerceTypes"],oet=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),set={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},aet={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Aye=200;function cet(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_,v,T,b,A,k,P,N,D;let F=t.strict,E=(e=t.code)===null||e===void 0?void 0:e.optimize,oe=E===!0||E===void 0?1:E||0,M=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Pye,S=(i=t.uriResolver)!==null&&i!==void 0?i:net.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:F)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:F)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:F)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:F)!==null&&f!==void 0?f:"log",strictRequired:(h=(p=t.strictRequired)!==null&&p!==void 0?p:F)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:oe,regExp:M}:{optimize:oe,regExp:M},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:Aye,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Aye,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(T=t.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(b=t.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(A=t.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(k=t.validateSchema)!==null&&k!==void 0?k:!0,validateFormats:(P=t.validateFormats)!==null&&P!==void 0?P:!0,unicodeRegExp:(N=t.unicodeRegExp)!==null&&N!==void 0?N:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:S}}var lb=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...cet(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new ret.ValueScope({scope:{},prefixes:oet,es5:r,lines:n}),this.logger=met(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,tet.getRules)(),Rye.call(this,set,e,"NOT SUPPORTED"),Rye.call(this,aet,e,"DEPRECATED","warn"),this._metaOpts=pet.call(this),e.formats&&det.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&fet.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),uet.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=xye;n==="id"&&(i={...xye},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof Iye.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,cb.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Cye.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new ab.SchemaEnv({schema:{},schemaId:n});if(r=ab.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Cye.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,cb.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(_et.call(this,n,r),!r)return(0,KH.eachItem)(n,o=>YH.call(this,o)),this;Eet.call(this,r);let i={...r,type:(0,kO.getJSONTypes)(r.type),schemaType:(0,kO.getJSONTypes)(r.schemaType)};return(0,KH.eachItem)(n,i.type.length===0?o=>YH.call(this,o,i):o=>i.type.forEach(s=>YH.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=Oye(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,cb.normalizeId)(s||n);let l=cb.getSchemaRefs.call(this,e,n);return c=new ab.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ab.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{ab.compileSchema.call(this,e)}finally{this.opts=r}}};lb.ValidationError=eet.default;lb.MissingRefError=Iye.default;rn.default=lb;function Rye(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Cye(t){return t=(0,cb.normalizeId)(t),this.schemas[t]||this.refs[t]}function uet(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function det(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function fet(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function pet(){let t={...this.opts};for(let e of iet)delete t[e];return t}var het={log(){},warn(){},error(){}};function met(t){if(t===!1)return het;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var get=/^[a-z_$][a-z0-9_$:-]*$/i;function _et(t,e){let{RULES:r}=this;if((0,KH.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!get.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function YH(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,kO.getJSONTypes)(e.type),schemaType:(0,kO.getJSONTypes)(e.schemaType)}};e.before?yet.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function yet(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Eet(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Oye(e)),t.validateSchema=this.compile(e,!0))}var vet={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Oye(t){return{anyOf:[t,vet]}}});var kye=y(ZH=>{"use strict";Object.defineProperty(ZH,"__esModule",{value:!0});var bet={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ZH.default=bet});var Lye=y(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.callRef=_f.getValidate=void 0;var Tet=ob(),Mye=to(),ni=Je(),Ug=fc(),$ye=IO(),MO=lt(),wet={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=$ye.resolveRef.call(c,l,i,r);if(u===void 0)throw new Tet.default(n.opts.uriResolver,i,r);if(u instanceof $ye.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return $O(t,s,o,o.$async);let h=e.scopeValue("root",{ref:l});return $O(t,(0,ni._)`${h}.validate`,l,l.$async)}function f(h){let m=Dye(t,h);$O(t,m,h,h.$async)}function p(h){let m=e.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,ni.stringify)(h)}:{ref:h}),g=e.name("valid"),_=t.subschema({schema:h,dataTypes:[],schemaPath:ni.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function Dye(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ni._)`${r.scopeValue("wrapper",{ref:e})}.validate`}_f.getValidate=Dye;function $O(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Ug.default.this:ni.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=i.let("valid");i.try(()=>{i.code((0,ni._)`await ${(0,Mye.callValidateCode)(t,e,l)}`),p(e),s||i.assign(h,!0)},m=>{i.if((0,ni._)`!(${m} instanceof ${o.ValidationError})`,()=>i.throw(m)),f(m),s||i.assign(h,!1)}),t.ok(h)}function d(){t.result((0,Mye.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(h){let m=(0,ni._)`${h}.errors`;i.assign(Ug.default.vErrors,(0,ni._)`${Ug.default.vErrors} === null ? ${m} : ${Ug.default.vErrors}.concat(${m})`),i.assign(Ug.default.errors,(0,ni._)`${Ug.default.vErrors}.length`)}function p(h){var m;if(!o.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=MO.mergeEvaluated.props(i,g.props,o.props));else{let _=i.var("props",(0,ni._)`${h}.evaluated.props`);o.props=MO.mergeEvaluated.props(i,_,o.props,ni.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=MO.mergeEvaluated.items(i,g.items,o.items));else{let _=i.var("items",(0,ni._)`${h}.evaluated.items`);o.items=MO.mergeEvaluated.items(i,_,o.items,ni.Name)}}}_f.callRef=$O;_f.default=wet});var Uye=y(JH=>{"use strict";Object.defineProperty(JH,"__esModule",{value:!0});var xet=kye(),Aet=Lye(),Ret=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xet.default,Aet.default];JH.default=Ret});var Fye=y(XH=>{"use strict";Object.defineProperty(XH,"__esModule",{value:!0});var DO=Je(),ru=DO.operators,LO={maximum:{okStr:"<=",ok:ru.LTE,fail:ru.GT},minimum:{okStr:">=",ok:ru.GTE,fail:ru.LT},exclusiveMaximum:{okStr:"<",ok:ru.LT,fail:ru.GTE},exclusiveMinimum:{okStr:">",ok:ru.GT,fail:ru.LTE}},Cet={message:({keyword:t,schemaCode:e})=>(0,DO.str)`must be ${LO[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,DO._)`{comparison: ${LO[t].okStr}, limit: ${e}}`},Iet={keyword:Object.keys(LO),type:"number",schemaType:"number",$data:!0,error:Cet,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,DO._)`${r} ${LO[e].fail} ${n} || isNaN(${r})`)}};XH.default=Iet});var zye=y(QH=>{"use strict";Object.defineProperty(QH,"__esModule",{value:!0});var ub=Je(),Pet={message:({schemaCode:t})=>(0,ub.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ub._)`{multipleOf: ${t}}`},Oet={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Pet,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,ub._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,ub._)`${s} !== parseInt(${s})`;t.fail$data((0,ub._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};QH.default=Oet});var Bye=y(e6=>{"use strict";Object.defineProperty(e6,"__esModule",{value:!0});function jye(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}e6.default=jye;jye.code='require("ajv/dist/runtime/ucs2length").default'});var qye=y(t6=>{"use strict";Object.defineProperty(t6,"__esModule",{value:!0});var yf=Je(),Net=lt(),ket=Bye(),Met={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,yf.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,yf._)`{limit: ${t}}`},$et={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Met,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?yf.operators.GT:yf.operators.LT,s=i.opts.unicode===!1?(0,yf._)`${r}.length`:(0,yf._)`${(0,Net.useFunc)(t.gen,ket.default)}(${r})`;t.fail$data((0,yf._)`${s} ${o} ${n}`)}};t6.default=$et});var Vye=y(r6=>{"use strict";Object.defineProperty(r6,"__esModule",{value:!0});var Det=to(),Let=lt(),Fg=Je(),Uet={message:({schemaCode:t})=>(0,Fg.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Fg._)`{pattern: ${t}}`},Fet={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Uet,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Fg._)`new RegExp`:(0,Let.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Fg._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Fg._)`!${u}`)}else{let c=(0,Det.usePattern)(t,i);t.fail$data((0,Fg._)`!${c}.test(${r})`)}}};r6.default=Fet});var Gye=y(n6=>{"use strict";Object.defineProperty(n6,"__esModule",{value:!0});var db=Je(),zet={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,db.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,db._)`{limit: ${t}}`},jet={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:zet,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?db.operators.GT:db.operators.LT;t.fail$data((0,db._)`Object.keys(${r}).length ${i} ${n}`)}};n6.default=jet});var Hye=y(i6=>{"use strict";Object.defineProperty(i6,"__esModule",{value:!0});var fb=to(),pb=Je(),Bet=lt(),qet={message:({params:{missingProperty:t}})=>(0,pb.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,pb._)`{missingProperty: ${t}}`},Vet={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qet,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:h}=t.it;for(let m of r)if(p?.[m]===void 0&&!h.has(m)){let g=s.schemaEnv.baseId+s.errSchemaPath,_=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,Bet.checkStrictMode)(s,_,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(pb.nil,d);else for(let p of r)(0,fb.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let h=e.let("valid",!0);t.block$data(h,()=>f(p,h)),t.ok(h)}else e.if((0,fb.checkMissingProp)(t,r,p)),(0,fb.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,fb.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,h){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(h,(0,fb.propertyInData)(e,i,p,a.ownProperties)),e.if((0,pb.not)(h),()=>{t.error(),e.break()})},pb.nil)}}};i6.default=Vet});var Wye=y(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0});var hb=Je(),Get={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,hb.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,hb._)`{limit: ${t}}`},Het={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Get,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?hb.operators.GT:hb.operators.LT;t.fail$data((0,hb._)`${r}.length ${i} ${n}`)}};o6.default=Het});var UO=y(s6=>{"use strict";Object.defineProperty(s6,"__esModule",{value:!0});var Yye=IH();Yye.code='require("ajv/dist/runtime/equal").default';s6.default=Yye});var Kye=y(c6=>{"use strict";Object.defineProperty(c6,"__esModule",{value:!0});var a6=eb(),nn=Je(),Wet=lt(),Yet=UO(),Ket={message:({params:{i:t,j:e}})=>(0,nn.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,nn._)`{i: ${t}, j: ${e}}`},Zet={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Ket,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,a6.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,nn._)`${s} === false`),t.ok(c);function u(){let h=e.let("i",(0,nn._)`${r}.length`),m=e.let("j");t.setParams({i:h,j:m}),e.assign(c,!0),e.if((0,nn._)`${h} > 1`,()=>(d()?f:p)(h,m))}function d(){return l.length>0&&!l.some(h=>h==="object"||h==="array")}function f(h,m){let g=e.name("item"),_=(0,a6.checkDataTypes)(l,g,a.opts.strictNumbers,a6.DataType.Wrong),v=e.const("indices",(0,nn._)`{}`);e.for((0,nn._)`;${h}--;`,()=>{e.let(g,(0,nn._)`${r}[${h}]`),e.if(_,(0,nn._)`continue`),l.length>1&&e.if((0,nn._)`typeof ${g} == "string"`,(0,nn._)`${g} += "_"`),e.if((0,nn._)`typeof ${v}[${g}] == "number"`,()=>{e.assign(m,(0,nn._)`${v}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,nn._)`${v}[${g}] = ${h}`)})}function p(h,m){let g=(0,Wet.useFunc)(e,Yet.default),_=e.name("outer");e.label(_).for((0,nn._)`;${h}--;`,()=>e.for((0,nn._)`${m} = ${h}; ${m}--;`,()=>e.if((0,nn._)`${g}(${r}[${h}], ${r}[${m}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};c6.default=Zet});var Zye=y(u6=>{"use strict";Object.defineProperty(u6,"__esModule",{value:!0});var l6=Je(),Jet=lt(),Xet=UO(),Qet={message:"must be equal to constant",params:({schemaCode:t})=>(0,l6._)`{allowedValue: ${t}}`},ett={keyword:"const",$data:!0,error:Qet,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,l6._)`!${(0,Jet.useFunc)(e,Xet.default)}(${r}, ${i})`):t.fail((0,l6._)`${o} !== ${r}`)}};u6.default=ett});var Jye=y(d6=>{"use strict";Object.defineProperty(d6,"__esModule",{value:!0});var mb=Je(),ttt=lt(),rtt=UO(),ntt={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,mb._)`{allowedValues: ${t}}`},itt={keyword:"enum",schemaType:"array",$data:!0,error:ntt,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,ttt.useFunc)(e,rtt.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,mb.or)(...i.map((h,m)=>f(p,m)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,mb._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,h){let m=i[h];return typeof m=="object"&&m!==null?(0,mb._)`${l()}(${r}, ${p}[${h}])`:(0,mb._)`${r} === ${m}`}}};d6.default=itt});var Xye=y(f6=>{"use strict";Object.defineProperty(f6,"__esModule",{value:!0});var ott=Fye(),stt=zye(),att=qye(),ctt=Vye(),ltt=Gye(),utt=Hye(),dtt=Wye(),ftt=Kye(),ptt=Zye(),htt=Jye(),mtt=[ott.default,stt.default,att.default,ctt.default,ltt.default,utt.default,dtt.default,ftt.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ptt.default,htt.default];f6.default=mtt});var h6=y(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.validateAdditionalItems=void 0;var Sf=Je(),p6=lt(),gtt={message:({params:{len:t}})=>(0,Sf.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Sf._)`{limit: ${t}}`},_tt={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:gtt,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,p6.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Qye(t,n)}};function Qye(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,Sf._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Sf._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,p6.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Sf._)`${a} <= ${e.length}`);r.if((0,Sf.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:p6.Type.Num},l),s.allErrors||r.if((0,Sf.not)(l),()=>r.break())})}}gb.validateAdditionalItems=Qye;gb.default=_tt});var m6=y(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});_b.validateTuple=void 0;var eSe=Je(),FO=lt(),ytt=to(),Stt={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return tSe(t,"additionalItems",e);r.items=!0,!(0,FO.alwaysValidSchema)(r,e)&&t.ok((0,ytt.validateArray)(t))}};function tSe(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=FO.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,eSe._)`${o}.length`);r.forEach((d,f)=>{(0,FO.alwaysValidSchema)(a,d)||(n.if((0,eSe._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,h=r.length,m=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(f.strictTuples&&!m){let g=`"${s}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,FO.checkStrictMode)(a,g,f.strictTuples)}}}_b.validateTuple=tSe;_b.default=Stt});var rSe=y(g6=>{"use strict";Object.defineProperty(g6,"__esModule",{value:!0});var Ett=m6(),vtt={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Ett.validateTuple)(t,"items")};g6.default=vtt});var iSe=y(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0});var nSe=Je(),btt=lt(),Ttt=to(),wtt=h6(),xtt={message:({params:{len:t}})=>(0,nSe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,nSe._)`{limit: ${t}}`},Att={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:xtt,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,btt.alwaysValidSchema)(n,e)&&(i?(0,wtt.validateAdditionalItems)(t,i):t.ok((0,Ttt.validateArray)(t)))}};_6.default=Att});var oSe=y(y6=>{"use strict";Object.defineProperty(y6,"__esModule",{value:!0});var no=Je(),zO=lt(),Rtt={message:({params:{min:t,max:e}})=>e===void 0?(0,no.str)`must contain at least ${t} valid item(s)`:(0,no.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,no._)`{minContains: ${t}}`:(0,no._)`{minContains: ${t}, maxContains: ${e}}`},Ctt={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Rtt,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,no._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,zO.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,zO.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,zO.alwaysValidSchema)(o,r)){let m=(0,no._)`${u} >= ${s}`;a!==void 0&&(m=(0,no._)`${m} && ${u} <= ${a}`),t.pass(m);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,no._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let m=e.name("_valid"),g=e.let("count",0);p(m,()=>e.if(m,()=>h(g)))}function p(m,g){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:zO.Type.Num,compositeRule:!0},m),g()})}function h(m){e.code((0,no._)`${m}++`),a===void 0?e.if((0,no._)`${m} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,no._)`${m} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,no._)`${m} >= ${s}`,()=>e.assign(d,!0)))}}};y6.default=Ctt});var cSe=y(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.validateSchemaDeps=Ys.validatePropertyDeps=Ys.error=void 0;var S6=Je(),Itt=lt(),yb=to();Ys.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,S6.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,S6._)`{property: ${t},
|
|
27
27
|
missingProperty: ${n},
|
|
28
28
|
depsCount: ${e},
|
|
29
|
-
deps: ${r}}`};var Ptt={keyword:"dependencies",type:"object",schemaType:"object",error:Ys.error,code(t){let[e,r]=Ott(t);sSe(t,e),aSe(t,r)}};function Ott({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function sSe(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,yb.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,yb.checkReportMissingProp)(t,l)}):(r.if((0,S6._)`${c} && (${(0,yb.checkMissingProp)(t,a,o)})`),(0,yb.reportMissingProp)(t,o),r.else())}}Ys.validatePropertyDeps=sSe;function aSe(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,Itt.alwaysValidSchema)(o,e[a])||(r.if((0,yb.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}Ys.validateSchemaDeps=aSe;Ys.default=Ptt});var uSe=y(E6=>{"use strict";Object.defineProperty(E6,"__esModule",{value:!0});var lSe=Ze(),Ntt=lt(),ktt={message:"property name must be valid",params:({params:t})=>(0,lSe._)`{propertyName: ${t.propertyName}}`},Mtt={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ktt,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,Ntt.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,lSe.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};E6.default=Mtt});var b6=y(v6=>{"use strict";Object.defineProperty(v6,"__esModule",{value:!0});var jO=to(),Ho=Ze(),$tt=fc(),BO=lt(),Dtt={message:"must NOT have additional properties",params:({params:t})=>(0,Ho._)`{additionalProperty: ${t.additionalProperty}}`},Ltt={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dtt,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,BO.alwaysValidSchema)(s,r))return;let l=(0,jO.allSchemaProperties)(n.properties),u=(0,jO.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Ho._)`${o} === ${$tt.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?h(g):e.if(f(g),()=>h(g))})}function f(g){let _;if(l.length>8){let v=(0,BO.schemaRefOrVal)(s,n.properties,"properties");_=(0,jO.isOwnProperty)(e,v,g)}else l.length?_=(0,Ho.or)(...l.map(v=>(0,Ho._)`${g} === ${v}`)):_=Ho.nil;return u.length&&(_=(0,Ho.or)(_,...u.map(v=>(0,Ho._)`${(0,jO.usePattern)(t,v)}.test(${g})`))),(0,Ho.not)(_)}function p(g){e.code((0,Ho._)`delete ${i}[${g}]`)}function h(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,BO.alwaysValidSchema)(s,r)){let _=e.name("valid");c.removeAdditional==="failing"?(m(g,_,!1),e.if((0,Ho.not)(_),()=>{t.reset(),p(g)})):(m(g,_),a||e.if((0,Ho.not)(_),()=>e.break()))}}function m(g,_,v){let T={keyword:"additionalProperties",dataProp:g,dataPropType:BO.Type.Str};v===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(T,_)}}};v6.default=Ltt});var pSe=y(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});var Utt=ib(),dSe=to(),T6=lt(),fSe=b6(),Ftt={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&fSe.default.code(new Utt.KeywordCxt(o,fSe.default,"additionalProperties"));let s=(0,dSe.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=T6.mergeEvaluated.props(e,(0,T6.toHash)(s),o.props));let a=s.filter(d=>!(0,T6.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,dSe.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};w6.default=Ftt});var _Se=y(x6=>{"use strict";Object.defineProperty(x6,"__esModule",{value:!0});var hSe=to(),qO=Ze(),mSe=lt(),gSe=lt(),ztt={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,hSe.allSchemaProperties)(r),c=a.filter(m=>(0,mSe.alwaysValidSchema)(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof qO.Name)&&(o.props=(0,gSe.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let m of a)l&&p(m),o.allErrors?h(m):(e.var(u,!0),h(m),e.if(u))}function p(m){for(let g in l)new RegExp(m).test(g)&&(0,mSe.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){e.forIn("key",n,g=>{e.if((0,qO._)`${(0,hSe.usePattern)(t,m)}.test(${g})`,()=>{let _=c.includes(m);_||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:gSe.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,qO._)`${d}[${g}]`,!0):!_&&!o.allErrors&&e.if((0,qO.not)(u),()=>e.break())})})}}};x6.default=ztt});var ySe=y(A6=>{"use strict";Object.defineProperty(A6,"__esModule",{value:!0});var jtt=lt(),Btt={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,jtt.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};A6.default=Btt});var SSe=y(R6=>{"use strict";Object.defineProperty(R6,"__esModule",{value:!0});var qtt=to(),Vtt={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:qtt.validateUnion,error:{message:"must match a schema in anyOf"}};R6.default=Vtt});var ESe=y(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});var VO=Ze(),Gtt=lt(),Htt={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,VO._)`{passingSchemas: ${t.passing}}`},Wtt={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Htt,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,Gtt.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,VO._)`${c} && ${s}`).assign(s,!1).assign(a,(0,VO._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,VO.Name)})})}}};C6.default=Wtt});var vSe=y(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});var Ytt=lt(),Ktt={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,Ytt.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};I6.default=Ktt});var wSe=y(P6=>{"use strict";Object.defineProperty(P6,"__esModule",{value:!0});var GO=Ze(),TSe=lt(),Ztt={message:({params:t})=>(0,GO.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,GO._)`{failingKeyword: ${t.ifClause}}`},Jtt={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Ztt,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,TSe.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=bSe(n,"then"),o=bSe(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,GO.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,GO._)`${u}`):t.setParams({ifClause:u})}}}};function bSe(t,e){let r=t.schema[e];return r!==void 0&&!(0,TSe.alwaysValidSchema)(t,r)}P6.default=Jtt});var xSe=y(O6=>{"use strict";Object.defineProperty(O6,"__esModule",{value:!0});var Xtt=lt(),Qtt={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Xtt.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};O6.default=Qtt});var ASe=y(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});var ert=h6(),trt=rSe(),rrt=m6(),nrt=iSe(),irt=oSe(),ort=cSe(),srt=uSe(),art=b6(),crt=pSe(),lrt=_Se(),urt=ySe(),drt=SSe(),frt=ESe(),prt=vSe(),hrt=wSe(),mrt=xSe();function grt(t=!1){let e=[urt.default,drt.default,frt.default,prt.default,hrt.default,mrt.default,srt.default,art.default,ort.default,crt.default,lrt.default];return t?e.push(trt.default,nrt.default):e.push(ert.default,rrt.default),e.push(irt.default),e}N6.default=grt});var RSe=y(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});var ar=Ze(),_rt={message:({schemaCode:t})=>(0,ar.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ar._)`{format: ${t}}`},yrt={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_rt,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=r.const("fDef",(0,ar._)`${h}[${s}]`),g=r.let("fType"),_=r.let("format");r.if((0,ar._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,ar._)`${m}.type || "string"`).assign(_,(0,ar._)`${m}.validate`),()=>r.assign(g,(0,ar._)`"string"`).assign(_,m)),t.fail$data((0,ar.or)(v(),T()));function v(){return c.strictSchema===!1?ar.nil:(0,ar._)`${s} && !${_}`}function T(){let b=u.$async?(0,ar._)`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,ar._)`${_}(${n})`,A=(0,ar._)`(typeof ${_} == "function" ? ${b} : ${_}.test(${n}))`;return(0,ar._)`${_} && ${_} !== true && ${g} === ${e} && !${A}`}}function p(){let h=d.formats[o];if(!h){v();return}if(h===!0)return;let[m,g,_]=T(h);m===e&&t.pass(b());function v(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function T(A){let k=A instanceof RegExp?(0,ar.regexpCode)(A):c.code.formats?(0,ar._)`${c.code.formats}${(0,ar.getProperty)(o)}`:void 0,P=r.scopeValue("formats",{key:o,ref:A,code:k});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,ar._)`${P}.validate`]:["string",A,P]}function b(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error("async format in sync schema");return(0,ar._)`await ${_}(${n})`}return typeof g=="function"?(0,ar._)`${_}(${n})`:(0,ar._)`${_}.test(${n})`}}}};k6.default=yrt});var CSe=y(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});var Srt=RSe(),Ert=[Srt.default];M6.default=Ert});var ISe=y(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.contentVocabulary=zg.metadataVocabulary=void 0;zg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];zg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var OSe=y($6=>{"use strict";Object.defineProperty($6,"__esModule",{value:!0});var vrt=Uye(),brt=Xye(),Trt=ASe(),wrt=CSe(),PSe=ISe(),xrt=[vrt.default,brt.default,(0,Trt.default)(),wrt.default,PSe.metadataVocabulary,PSe.contentVocabulary];$6.default=xrt});var kSe=y(HO=>{"use strict";Object.defineProperty(HO,"__esModule",{value:!0});HO.DiscrError=void 0;var NSe;(function(t){t.Tag="tag",t.Mapping="mapping"})(NSe||(HO.DiscrError=NSe={}))});var $Se=y(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});var jg=Ze(),D6=kSe(),MSe=IO(),Art=ob(),Rrt=lt(),Crt={message:({params:{discrError:t,tagName:e}})=>t===D6.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,jg._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Irt={keyword:"discriminator",type:"object",schemaType:"object",error:Crt,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,jg._)`${r}${(0,jg.getProperty)(a)}`);e.if((0,jg._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:D6.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let h in p)e.elseIf((0,jg._)`${l} === ${h}`),e.assign(c,d(p[h]));e.else(),t.error(!1,{discrError:D6.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let h=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:p},h);return t.mergeEvaluated(m,jg.Name),h}function f(){var p;let h={},m=_(i),g=!0;for(let b=0;b<s.length;b++){let A=s[b];if(A?.$ref&&!(0,Rrt.schemaHasRulesButRef)(A,o.self.RULES)){let P=A.$ref;if(A=MSe.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,P),A instanceof MSe.SchemaEnv&&(A=A.schema),A===void 0)throw new Art.default(o.opts.uriResolver,o.baseId,P)}let k=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof k!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||_(A)),v(k,b)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return h;function _({required:b}){return Array.isArray(b)&&b.includes(a)}function v(b,A){if(b.const)T(b.const,A);else if(b.enum)for(let k of b.enum)T(k,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(b,A){if(typeof b!="string"||b in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[b]=A}}}};L6.default=Irt});var DSe=y((bir,Prt)=>{Prt.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var USe=y((qt,U6)=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.MissingRefError=qt.ValidationError=qt.CodeGen=qt.Name=qt.nil=qt.stringify=qt.str=qt._=qt.KeywordCxt=qt.Ajv=void 0;var Ort=Nye(),Nrt=OSe(),krt=$Se(),LSe=DSe(),Mrt=["/properties"],WO="http://json-schema.org/draft-07/schema",Bg=class extends Ort.default{_addVocabularies(){super._addVocabularies(),Nrt.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(krt.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(LSe,Mrt):LSe;this.addMetaSchema(e,WO,!1),this.refs["http://json-schema.org/schema"]=WO}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(WO)?WO:void 0)}};qt.Ajv=Bg;U6.exports=qt=Bg;U6.exports.Ajv=Bg;Object.defineProperty(qt,"__esModule",{value:!0});qt.default=Bg;var $rt=ib();Object.defineProperty(qt,"KeywordCxt",{enumerable:!0,get:function(){return $rt.KeywordCxt}});var qg=Ze();Object.defineProperty(qt,"_",{enumerable:!0,get:function(){return qg._}});Object.defineProperty(qt,"str",{enumerable:!0,get:function(){return qg.str}});Object.defineProperty(qt,"stringify",{enumerable:!0,get:function(){return qg.stringify}});Object.defineProperty(qt,"nil",{enumerable:!0,get:function(){return qg.nil}});Object.defineProperty(qt,"Name",{enumerable:!0,get:function(){return qg.Name}});Object.defineProperty(qt,"CodeGen",{enumerable:!0,get:function(){return qg.CodeGen}});var Drt=RO();Object.defineProperty(qt,"ValidationError",{enumerable:!0,get:function(){return Drt.default}});var Lrt=ob();Object.defineProperty(qt,"MissingRefError",{enumerable:!0,get:function(){return Lrt.default}})});var HSe=y(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.formatNames=Zs.fastFormats=Zs.fullFormats=void 0;function Ks(t,e){return{validate:t,compare:e}}Zs.fullFormats={date:Ks(BSe,B6),time:Ks(z6(!0),q6),"date-time":Ks(FSe(!0),VSe),"iso-time":Ks(z6(),qSe),"iso-date-time":Ks(FSe(),GSe),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:qrt,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Zrt,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Vrt,int32:{type:"number",validate:Wrt},int64:{type:"number",validate:Yrt},float:{type:"number",validate:jSe},double:{type:"number",validate:jSe},password:!0,binary:!0};Zs.fastFormats={...Zs.fullFormats,date:Ks(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,B6),time:Ks(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,q6),"date-time":Ks(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,VSe),"iso-time":Ks(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,qSe),"iso-date-time":Ks(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,GSe),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Zs.formatNames=Object.keys(Zs.fullFormats);function Urt(t){return t%4===0&&(t%100!==0||t%400===0)}var Frt=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,zrt=[0,31,28,31,30,31,30,31,31,30,31,30,31];function BSe(t){let e=Frt.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&Urt(r)?29:zrt[n])}function B6(t,e){if(t&&e)return t>e?1:t<e?-1:0}var F6=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function z6(t){return function(r){let n=F6.exec(r);if(!n)return!1;let i=+n[1],o=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function q6(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function qSe(t,e){if(!(t&&e))return;let r=F6.exec(t),n=F6.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var j6=/t|\s/i;function FSe(t){let e=z6(t);return function(n){let i=n.split(j6);return i.length===2&&BSe(i[0])&&e(i[1])}}function VSe(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function GSe(t,e){if(!(t&&e))return;let[r,n]=t.split(j6),[i,o]=e.split(j6),s=B6(r,i);if(s!==void 0)return s||q6(n,o)}var jrt=/\/|:/,Brt=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function qrt(t){return jrt.test(t)&&Brt.test(t)}var zSe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Vrt(t){return zSe.lastIndex=0,zSe.test(t)}var Grt=-(2**31),Hrt=2**31-1;function Wrt(t){return Number.isInteger(t)&&t<=Hrt&&t>=Grt}function Yrt(t){return Number.isInteger(t)}function jSe(){return!0}var Krt=/[^\\]\\Z/;function Zrt(t){if(Krt.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var WSe=y(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.formatLimitDefinition=void 0;var Jrt=USe(),Wo=Ze(),nu=Wo.operators,YO={formatMaximum:{okStr:"<=",ok:nu.LTE,fail:nu.GT},formatMinimum:{okStr:">=",ok:nu.GTE,fail:nu.LT},formatExclusiveMaximum:{okStr:"<",ok:nu.LT,fail:nu.GTE},formatExclusiveMinimum:{okStr:">",ok:nu.GT,fail:nu.LTE}},Xrt={message:({keyword:t,schemaCode:e})=>(0,Wo.str)`should be ${YO[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Wo._)`{comparison: ${YO[t].okStr}, limit: ${e}}`};Vg.formatLimitDefinition={keyword:Object.keys(YO),type:"string",schemaType:"string",$data:!0,error:Xrt,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new Jrt.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,Wo._)`${f}[${c.schemaCode}]`);t.fail$data((0,Wo.or)((0,Wo._)`typeof ${p} != "object"`,(0,Wo._)`${p} instanceof RegExp`,(0,Wo._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let h=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Wo._)`${s.code.formats}${(0,Wo.getProperty)(f)}`:void 0});t.fail$data(d(h))}function d(f){return(0,Wo._)`${f}.compare(${r}, ${n}) ${YO[i].fail} 0`}},dependencies:["format"]};var Qrt=t=>(t.addKeyword(Vg.formatLimitDefinition),t);Vg.default=Qrt});var JSe=y((Sb,ZSe)=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var Gg=HSe(),ent=WSe(),V6=Ze(),YSe=new V6.Name("fullFormats"),tnt=new V6.Name("fastFormats"),G6=(t,e={keywords:!0})=>{if(Array.isArray(e))return KSe(t,e,Gg.fullFormats,YSe),t;let[r,n]=e.mode==="fast"?[Gg.fastFormats,tnt]:[Gg.fullFormats,YSe],i=e.formats||Gg.formatNames;return KSe(t,i,r,n),e.keywords&&(0,ent.default)(t),t};G6.get=(t,e="full")=>{let n=(e==="fast"?Gg.fastFormats:Gg.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function KSe(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,V6._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}ZSe.exports=Sb=G6;Object.defineProperty(Sb,"__esModule",{value:!0});Sb.default=G6});var FEe=y((Psr,UEe)=>{"use strict";var iu=Z("constants"),rit=process.cwd,QO=null,nit=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return QO||(QO=rit.call(process)),QO};try{process.cwd()}catch{}typeof process.chdir=="function"&&(i3=process.chdir,process.chdir=function(t){QO=null,i3.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i3));var i3;UEe.exports=iit;function iit(t){iu.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(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(){}),nit==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(f,p,h){var m=Date.now(),g=0;u(f,p,function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(p,function(T,b){T&&T.code==="ENOENT"?u(f,p,_):h(v)})},g),g<100&&(g+=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,g,_){var v;if(_&&typeof _=="function"){var T=0;v=function(b,A,k){if(b&&b.code==="EAGAIN"&&T<10)return T++,u.call(t,f,p,h,m,g,v);_.apply(this,arguments)}}return u.call(t,f,p,h,m,g,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 g=0;;)try{return u.call(t,d,f,p,h,m)}catch(_){if(_.code==="EAGAIN"&&g<10){g++;continue}throw _}}})(t.readSync);function e(u){u.lchmod=function(d,f,p){u.open(d,iu.O_WRONLY|iu.O_SYMLINK,f,function(h,m){if(h){p&&p(h);return}u.fchmod(m,f,function(g){u.close(m,function(_){p&&p(g||_)})})})},u.lchmodSync=function(d,f){var p=u.openSync(d,iu.O_WRONLY|iu.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){iu.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,f,p,h){u.open(d,iu.O_SYMLINK,function(m,g){if(m){h&&h(m);return}u.futimes(g,f,p,function(_){u.close(g,function(v){h&&h(_||v)})})})},u.lutimesSync=function(d,f,p){var h=u.openSync(d,iu.O_SYMLINK),m,g=!0;try{m=u.futimesSync(h,f,p),g=!1}finally{if(g)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 o(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 s(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,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.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 BEe=y((Osr,jEe)=>{"use strict";var zEe=Z("stream").Stream;jEe.exports=oit;function oit(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);zEe.call(this);var o=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 s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[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(){o._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){o.emit("error",u),o.readable=!1;return}o.fd=d,o.emit("open",d),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);zEe.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 o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];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 VEe=y((Nsr,qEe)=>{"use strict";qEe.exports=ait;var sit=Object.getPrototypeOf||function(t){return t.__proto__};function ait(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:sit(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var YEe=y((ksr,a3)=>{"use strict";var Kt=Z("fs"),cit=FEe(),lit=BEe(),uit=VEe(),eN=Z("util"),sn,rN;typeof Symbol=="function"&&typeof Symbol.for=="function"?(sn=Symbol.for("graceful-fs.queue"),rN=Symbol.for("graceful-fs.previous")):(sn="___graceful-fs.queue",rN="___graceful-fs.previous");function dit(){}function WEe(t,e){Object.defineProperty(t,sn,{get:function(){return e}})}var vf=dit;eN.debuglog?vf=eN.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(vf=function(){var t=eN.format.apply(eN,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
29
|
+
deps: ${r}}`};var Ptt={keyword:"dependencies",type:"object",schemaType:"object",error:Ys.error,code(t){let[e,r]=Ott(t);sSe(t,e),aSe(t,r)}};function Ott({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function sSe(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,yb.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,yb.checkReportMissingProp)(t,l)}):(r.if((0,S6._)`${c} && (${(0,yb.checkMissingProp)(t,a,o)})`),(0,yb.reportMissingProp)(t,o),r.else())}}Ys.validatePropertyDeps=sSe;function aSe(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,Itt.alwaysValidSchema)(o,e[a])||(r.if((0,yb.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}Ys.validateSchemaDeps=aSe;Ys.default=Ptt});var uSe=y(E6=>{"use strict";Object.defineProperty(E6,"__esModule",{value:!0});var lSe=Je(),Ntt=lt(),ktt={message:"property name must be valid",params:({params:t})=>(0,lSe._)`{propertyName: ${t.propertyName}}`},Mtt={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ktt,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,Ntt.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,lSe.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};E6.default=Mtt});var b6=y(v6=>{"use strict";Object.defineProperty(v6,"__esModule",{value:!0});var jO=to(),Ho=Je(),$tt=fc(),BO=lt(),Dtt={message:"must NOT have additional properties",params:({params:t})=>(0,Ho._)`{additionalProperty: ${t.additionalProperty}}`},Ltt={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dtt,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,BO.alwaysValidSchema)(s,r))return;let l=(0,jO.allSchemaProperties)(n.properties),u=(0,jO.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Ho._)`${o} === ${$tt.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?h(g):e.if(f(g),()=>h(g))})}function f(g){let _;if(l.length>8){let v=(0,BO.schemaRefOrVal)(s,n.properties,"properties");_=(0,jO.isOwnProperty)(e,v,g)}else l.length?_=(0,Ho.or)(...l.map(v=>(0,Ho._)`${g} === ${v}`)):_=Ho.nil;return u.length&&(_=(0,Ho.or)(_,...u.map(v=>(0,Ho._)`${(0,jO.usePattern)(t,v)}.test(${g})`))),(0,Ho.not)(_)}function p(g){e.code((0,Ho._)`delete ${i}[${g}]`)}function h(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,BO.alwaysValidSchema)(s,r)){let _=e.name("valid");c.removeAdditional==="failing"?(m(g,_,!1),e.if((0,Ho.not)(_),()=>{t.reset(),p(g)})):(m(g,_),a||e.if((0,Ho.not)(_),()=>e.break()))}}function m(g,_,v){let T={keyword:"additionalProperties",dataProp:g,dataPropType:BO.Type.Str};v===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(T,_)}}};v6.default=Ltt});var pSe=y(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});var Utt=ib(),dSe=to(),T6=lt(),fSe=b6(),Ftt={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&fSe.default.code(new Utt.KeywordCxt(o,fSe.default,"additionalProperties"));let s=(0,dSe.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=T6.mergeEvaluated.props(e,(0,T6.toHash)(s),o.props));let a=s.filter(d=>!(0,T6.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,dSe.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};w6.default=Ftt});var _Se=y(x6=>{"use strict";Object.defineProperty(x6,"__esModule",{value:!0});var hSe=to(),qO=Je(),mSe=lt(),gSe=lt(),ztt={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,hSe.allSchemaProperties)(r),c=a.filter(m=>(0,mSe.alwaysValidSchema)(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof qO.Name)&&(o.props=(0,gSe.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let m of a)l&&p(m),o.allErrors?h(m):(e.var(u,!0),h(m),e.if(u))}function p(m){for(let g in l)new RegExp(m).test(g)&&(0,mSe.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){e.forIn("key",n,g=>{e.if((0,qO._)`${(0,hSe.usePattern)(t,m)}.test(${g})`,()=>{let _=c.includes(m);_||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:gSe.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,qO._)`${d}[${g}]`,!0):!_&&!o.allErrors&&e.if((0,qO.not)(u),()=>e.break())})})}}};x6.default=ztt});var ySe=y(A6=>{"use strict";Object.defineProperty(A6,"__esModule",{value:!0});var jtt=lt(),Btt={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,jtt.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};A6.default=Btt});var SSe=y(R6=>{"use strict";Object.defineProperty(R6,"__esModule",{value:!0});var qtt=to(),Vtt={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:qtt.validateUnion,error:{message:"must match a schema in anyOf"}};R6.default=Vtt});var ESe=y(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});var VO=Je(),Gtt=lt(),Htt={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,VO._)`{passingSchemas: ${t.passing}}`},Wtt={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Htt,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,Gtt.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,VO._)`${c} && ${s}`).assign(s,!1).assign(a,(0,VO._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,VO.Name)})})}}};C6.default=Wtt});var vSe=y(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});var Ytt=lt(),Ktt={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,Ytt.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};I6.default=Ktt});var wSe=y(P6=>{"use strict";Object.defineProperty(P6,"__esModule",{value:!0});var GO=Je(),TSe=lt(),Ztt={message:({params:t})=>(0,GO.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,GO._)`{failingKeyword: ${t.ifClause}}`},Jtt={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Ztt,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,TSe.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=bSe(n,"then"),o=bSe(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,GO.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,GO._)`${u}`):t.setParams({ifClause:u})}}}};function bSe(t,e){let r=t.schema[e];return r!==void 0&&!(0,TSe.alwaysValidSchema)(t,r)}P6.default=Jtt});var xSe=y(O6=>{"use strict";Object.defineProperty(O6,"__esModule",{value:!0});var Xtt=lt(),Qtt={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Xtt.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};O6.default=Qtt});var ASe=y(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});var ert=h6(),trt=rSe(),rrt=m6(),nrt=iSe(),irt=oSe(),ort=cSe(),srt=uSe(),art=b6(),crt=pSe(),lrt=_Se(),urt=ySe(),drt=SSe(),frt=ESe(),prt=vSe(),hrt=wSe(),mrt=xSe();function grt(t=!1){let e=[urt.default,drt.default,frt.default,prt.default,hrt.default,mrt.default,srt.default,art.default,ort.default,crt.default,lrt.default];return t?e.push(trt.default,nrt.default):e.push(ert.default,rrt.default),e.push(irt.default),e}N6.default=grt});var RSe=y(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});var ar=Je(),_rt={message:({schemaCode:t})=>(0,ar.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ar._)`{format: ${t}}`},yrt={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_rt,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=r.const("fDef",(0,ar._)`${h}[${s}]`),g=r.let("fType"),_=r.let("format");r.if((0,ar._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,ar._)`${m}.type || "string"`).assign(_,(0,ar._)`${m}.validate`),()=>r.assign(g,(0,ar._)`"string"`).assign(_,m)),t.fail$data((0,ar.or)(v(),T()));function v(){return c.strictSchema===!1?ar.nil:(0,ar._)`${s} && !${_}`}function T(){let b=u.$async?(0,ar._)`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,ar._)`${_}(${n})`,A=(0,ar._)`(typeof ${_} == "function" ? ${b} : ${_}.test(${n}))`;return(0,ar._)`${_} && ${_} !== true && ${g} === ${e} && !${A}`}}function p(){let h=d.formats[o];if(!h){v();return}if(h===!0)return;let[m,g,_]=T(h);m===e&&t.pass(b());function v(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function T(A){let k=A instanceof RegExp?(0,ar.regexpCode)(A):c.code.formats?(0,ar._)`${c.code.formats}${(0,ar.getProperty)(o)}`:void 0,P=r.scopeValue("formats",{key:o,ref:A,code:k});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,ar._)`${P}.validate`]:["string",A,P]}function b(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error("async format in sync schema");return(0,ar._)`await ${_}(${n})`}return typeof g=="function"?(0,ar._)`${_}(${n})`:(0,ar._)`${_}.test(${n})`}}}};k6.default=yrt});var CSe=y(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});var Srt=RSe(),Ert=[Srt.default];M6.default=Ert});var ISe=y(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.contentVocabulary=zg.metadataVocabulary=void 0;zg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];zg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var OSe=y($6=>{"use strict";Object.defineProperty($6,"__esModule",{value:!0});var vrt=Uye(),brt=Xye(),Trt=ASe(),wrt=CSe(),PSe=ISe(),xrt=[vrt.default,brt.default,(0,Trt.default)(),wrt.default,PSe.metadataVocabulary,PSe.contentVocabulary];$6.default=xrt});var kSe=y(HO=>{"use strict";Object.defineProperty(HO,"__esModule",{value:!0});HO.DiscrError=void 0;var NSe;(function(t){t.Tag="tag",t.Mapping="mapping"})(NSe||(HO.DiscrError=NSe={}))});var $Se=y(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});var jg=Je(),D6=kSe(),MSe=IO(),Art=ob(),Rrt=lt(),Crt={message:({params:{discrError:t,tagName:e}})=>t===D6.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,jg._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Irt={keyword:"discriminator",type:"object",schemaType:"object",error:Crt,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,jg._)`${r}${(0,jg.getProperty)(a)}`);e.if((0,jg._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:D6.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let h in p)e.elseIf((0,jg._)`${l} === ${h}`),e.assign(c,d(p[h]));e.else(),t.error(!1,{discrError:D6.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let h=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:p},h);return t.mergeEvaluated(m,jg.Name),h}function f(){var p;let h={},m=_(i),g=!0;for(let b=0;b<s.length;b++){let A=s[b];if(A?.$ref&&!(0,Rrt.schemaHasRulesButRef)(A,o.self.RULES)){let P=A.$ref;if(A=MSe.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,P),A instanceof MSe.SchemaEnv&&(A=A.schema),A===void 0)throw new Art.default(o.opts.uriResolver,o.baseId,P)}let k=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof k!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||_(A)),v(k,b)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return h;function _({required:b}){return Array.isArray(b)&&b.includes(a)}function v(b,A){if(b.const)T(b.const,A);else if(b.enum)for(let k of b.enum)T(k,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(b,A){if(typeof b!="string"||b in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[b]=A}}}};L6.default=Irt});var DSe=y((bir,Prt)=>{Prt.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var USe=y((qt,U6)=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.MissingRefError=qt.ValidationError=qt.CodeGen=qt.Name=qt.nil=qt.stringify=qt.str=qt._=qt.KeywordCxt=qt.Ajv=void 0;var Ort=Nye(),Nrt=OSe(),krt=$Se(),LSe=DSe(),Mrt=["/properties"],WO="http://json-schema.org/draft-07/schema",Bg=class extends Ort.default{_addVocabularies(){super._addVocabularies(),Nrt.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(krt.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(LSe,Mrt):LSe;this.addMetaSchema(e,WO,!1),this.refs["http://json-schema.org/schema"]=WO}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(WO)?WO:void 0)}};qt.Ajv=Bg;U6.exports=qt=Bg;U6.exports.Ajv=Bg;Object.defineProperty(qt,"__esModule",{value:!0});qt.default=Bg;var $rt=ib();Object.defineProperty(qt,"KeywordCxt",{enumerable:!0,get:function(){return $rt.KeywordCxt}});var qg=Je();Object.defineProperty(qt,"_",{enumerable:!0,get:function(){return qg._}});Object.defineProperty(qt,"str",{enumerable:!0,get:function(){return qg.str}});Object.defineProperty(qt,"stringify",{enumerable:!0,get:function(){return qg.stringify}});Object.defineProperty(qt,"nil",{enumerable:!0,get:function(){return qg.nil}});Object.defineProperty(qt,"Name",{enumerable:!0,get:function(){return qg.Name}});Object.defineProperty(qt,"CodeGen",{enumerable:!0,get:function(){return qg.CodeGen}});var Drt=RO();Object.defineProperty(qt,"ValidationError",{enumerable:!0,get:function(){return Drt.default}});var Lrt=ob();Object.defineProperty(qt,"MissingRefError",{enumerable:!0,get:function(){return Lrt.default}})});var HSe=y(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.formatNames=Zs.fastFormats=Zs.fullFormats=void 0;function Ks(t,e){return{validate:t,compare:e}}Zs.fullFormats={date:Ks(BSe,B6),time:Ks(z6(!0),q6),"date-time":Ks(FSe(!0),VSe),"iso-time":Ks(z6(),qSe),"iso-date-time":Ks(FSe(),GSe),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:qrt,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Zrt,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Vrt,int32:{type:"number",validate:Wrt},int64:{type:"number",validate:Yrt},float:{type:"number",validate:jSe},double:{type:"number",validate:jSe},password:!0,binary:!0};Zs.fastFormats={...Zs.fullFormats,date:Ks(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,B6),time:Ks(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,q6),"date-time":Ks(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,VSe),"iso-time":Ks(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,qSe),"iso-date-time":Ks(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,GSe),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Zs.formatNames=Object.keys(Zs.fullFormats);function Urt(t){return t%4===0&&(t%100!==0||t%400===0)}var Frt=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,zrt=[0,31,28,31,30,31,30,31,31,30,31,30,31];function BSe(t){let e=Frt.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&Urt(r)?29:zrt[n])}function B6(t,e){if(t&&e)return t>e?1:t<e?-1:0}var F6=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function z6(t){return function(r){let n=F6.exec(r);if(!n)return!1;let i=+n[1],o=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function q6(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function qSe(t,e){if(!(t&&e))return;let r=F6.exec(t),n=F6.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var j6=/t|\s/i;function FSe(t){let e=z6(t);return function(n){let i=n.split(j6);return i.length===2&&BSe(i[0])&&e(i[1])}}function VSe(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function GSe(t,e){if(!(t&&e))return;let[r,n]=t.split(j6),[i,o]=e.split(j6),s=B6(r,i);if(s!==void 0)return s||q6(n,o)}var jrt=/\/|:/,Brt=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function qrt(t){return jrt.test(t)&&Brt.test(t)}var zSe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Vrt(t){return zSe.lastIndex=0,zSe.test(t)}var Grt=-(2**31),Hrt=2**31-1;function Wrt(t){return Number.isInteger(t)&&t<=Hrt&&t>=Grt}function Yrt(t){return Number.isInteger(t)}function jSe(){return!0}var Krt=/[^\\]\\Z/;function Zrt(t){if(Krt.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var WSe=y(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.formatLimitDefinition=void 0;var Jrt=USe(),Wo=Je(),nu=Wo.operators,YO={formatMaximum:{okStr:"<=",ok:nu.LTE,fail:nu.GT},formatMinimum:{okStr:">=",ok:nu.GTE,fail:nu.LT},formatExclusiveMaximum:{okStr:"<",ok:nu.LT,fail:nu.GTE},formatExclusiveMinimum:{okStr:">",ok:nu.GT,fail:nu.LTE}},Xrt={message:({keyword:t,schemaCode:e})=>(0,Wo.str)`should be ${YO[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Wo._)`{comparison: ${YO[t].okStr}, limit: ${e}}`};Vg.formatLimitDefinition={keyword:Object.keys(YO),type:"string",schemaType:"string",$data:!0,error:Xrt,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new Jrt.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,Wo._)`${f}[${c.schemaCode}]`);t.fail$data((0,Wo.or)((0,Wo._)`typeof ${p} != "object"`,(0,Wo._)`${p} instanceof RegExp`,(0,Wo._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let h=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Wo._)`${s.code.formats}${(0,Wo.getProperty)(f)}`:void 0});t.fail$data(d(h))}function d(f){return(0,Wo._)`${f}.compare(${r}, ${n}) ${YO[i].fail} 0`}},dependencies:["format"]};var Qrt=t=>(t.addKeyword(Vg.formatLimitDefinition),t);Vg.default=Qrt});var JSe=y((Sb,ZSe)=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var Gg=HSe(),ent=WSe(),V6=Je(),YSe=new V6.Name("fullFormats"),tnt=new V6.Name("fastFormats"),G6=(t,e={keywords:!0})=>{if(Array.isArray(e))return KSe(t,e,Gg.fullFormats,YSe),t;let[r,n]=e.mode==="fast"?[Gg.fastFormats,tnt]:[Gg.fullFormats,YSe],i=e.formats||Gg.formatNames;return KSe(t,i,r,n),e.keywords&&(0,ent.default)(t),t};G6.get=(t,e="full")=>{let n=(e==="fast"?Gg.fastFormats:Gg.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function KSe(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,V6._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}ZSe.exports=Sb=G6;Object.defineProperty(Sb,"__esModule",{value:!0});Sb.default=G6});var FEe=y((Psr,UEe)=>{"use strict";var iu=Z("constants"),rit=process.cwd,QO=null,nit=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return QO||(QO=rit.call(process)),QO};try{process.cwd()}catch{}typeof process.chdir=="function"&&(i3=process.chdir,process.chdir=function(t){QO=null,i3.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i3));var i3;UEe.exports=iit;function iit(t){iu.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(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(){}),nit==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(f,p,h){var m=Date.now(),g=0;u(f,p,function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(p,function(T,b){T&&T.code==="ENOENT"?u(f,p,_):h(v)})},g),g<100&&(g+=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,g,_){var v;if(_&&typeof _=="function"){var T=0;v=function(b,A,k){if(b&&b.code==="EAGAIN"&&T<10)return T++,u.call(t,f,p,h,m,g,v);_.apply(this,arguments)}}return u.call(t,f,p,h,m,g,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 g=0;;)try{return u.call(t,d,f,p,h,m)}catch(_){if(_.code==="EAGAIN"&&g<10){g++;continue}throw _}}})(t.readSync);function e(u){u.lchmod=function(d,f,p){u.open(d,iu.O_WRONLY|iu.O_SYMLINK,f,function(h,m){if(h){p&&p(h);return}u.fchmod(m,f,function(g){u.close(m,function(_){p&&p(g||_)})})})},u.lchmodSync=function(d,f){var p=u.openSync(d,iu.O_WRONLY|iu.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){iu.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,f,p,h){u.open(d,iu.O_SYMLINK,function(m,g){if(m){h&&h(m);return}u.futimes(g,f,p,function(_){u.close(g,function(v){h&&h(_||v)})})})},u.lutimesSync=function(d,f,p){var h=u.openSync(d,iu.O_SYMLINK),m,g=!0;try{m=u.futimesSync(h,f,p),g=!1}finally{if(g)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 o(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 s(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,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.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 BEe=y((Osr,jEe)=>{"use strict";var zEe=Z("stream").Stream;jEe.exports=oit;function oit(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);zEe.call(this);var o=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 s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[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(){o._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){o.emit("error",u),o.readable=!1;return}o.fd=d,o.emit("open",d),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);zEe.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 o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];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 VEe=y((Nsr,qEe)=>{"use strict";qEe.exports=ait;var sit=Object.getPrototypeOf||function(t){return t.__proto__};function ait(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:sit(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var YEe=y((ksr,a3)=>{"use strict";var Kt=Z("fs"),cit=FEe(),lit=BEe(),uit=VEe(),eN=Z("util"),sn,rN;typeof Symbol=="function"&&typeof Symbol.for=="function"?(sn=Symbol.for("graceful-fs.queue"),rN=Symbol.for("graceful-fs.previous")):(sn="___graceful-fs.queue",rN="___graceful-fs.previous");function dit(){}function WEe(t,e){Object.defineProperty(t,sn,{get:function(){return e}})}var vf=dit;eN.debuglog?vf=eN.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(vf=function(){var t=eN.format.apply(eN,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
30
30
|
GFS4: `),console.error(t)});Kt[sn]||(GEe=global[sn]||[],WEe(Kt,GEe),Kt.close=(function(t){function e(r,n){return t.call(Kt,r,function(i){i||HEe(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,rN,{value:t}),e})(Kt.close),Kt.closeSync=(function(t){function e(r){t.apply(Kt,arguments),HEe()}return Object.defineProperty(e,rN,{value:t}),e})(Kt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){vf(Kt[sn]),Z("assert").equal(Kt[sn].length,0)}));var GEe;global[sn]||WEe(global,Kt[sn]);a3.exports=o3(uit(Kt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Kt.__patched&&(a3.exports=o3(Kt),Kt.__patched=!0);function o3(t){cit(t),t.gracefulify=o3,t.createReadStream=A,t.createWriteStream=k;var e=t.readFile;t.readFile=r;function r(D,F,E){return typeof F=="function"&&(E=F,F=null),oe(D,F,E);function oe(M,S,w,O){return e(M,S,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Xg([oe,[M,S,w],Y,O||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(D,F,E,oe){return typeof E=="function"&&(oe=E,E=null),M(D,F,E,oe);function M(S,w,O,Y,H){return n(S,w,O,function(he){he&&(he.code==="EMFILE"||he.code==="ENFILE")?Xg([M,[S,w,O,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(D,F,E,oe){return typeof E=="function"&&(oe=E,E=null),M(D,F,E,oe);function M(S,w,O,Y,H){return o(S,w,O,function(he){he&&(he.code==="EMFILE"||he.code==="ENFILE")?Xg([M,[S,w,O,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=c);function c(D,F,E,oe){return typeof E=="function"&&(oe=E,E=0),M(D,F,E,oe);function M(S,w,O,Y,H){return a(S,w,O,function(he){he&&(he.code==="EMFILE"||he.code==="ENFILE")?Xg([M,[S,w,O,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var u=/^v[0-5]\./;function d(D,F,E){typeof F=="function"&&(E=F,F=null);var oe=u.test(process.version)?function(w,O,Y,H){return l(w,M(w,O,Y,H))}:function(w,O,Y,H){return l(w,O,M(w,O,Y,H))};return oe(D,F,E);function M(S,w,O,Y){return function(H,he){H&&(H.code==="EMFILE"||H.code==="ENFILE")?Xg([oe,[S,w,O],H,Y||Date.now(),Date.now()]):(he&&he.sort&&he.sort(),typeof O=="function"&&O.call(this,H,he))}}}if(process.version.substr(0,4)==="v0.8"){var f=lit(t);_=f.ReadStream,T=f.WriteStream}var p=t.ReadStream;p&&(_.prototype=Object.create(p.prototype),_.prototype.open=v);var h=t.WriteStream;h&&(T.prototype=Object.create(h.prototype),T.prototype.open=b),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(D){_=D},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return T},set:function(D){T=D},enumerable:!0,configurable:!0});var m=_;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(D){m=D},enumerable:!0,configurable:!0});var g=T;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(D){g=D},enumerable:!0,configurable:!0});function _(D,F){return this instanceof _?(p.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function v(){var D=this;N(D.path,D.flags,D.mode,function(F,E){F?(D.autoClose&&D.destroy(),D.emit("error",F)):(D.fd=E,D.emit("open",E),D.read())})}function T(D,F){return this instanceof T?(h.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function b(){var D=this;N(D.path,D.flags,D.mode,function(F,E){F?(D.destroy(),D.emit("error",F)):(D.fd=E,D.emit("open",E))})}function A(D,F){return new t.ReadStream(D,F)}function k(D,F){return new t.WriteStream(D,F)}var P=t.open;t.open=N;function N(D,F,E,oe){return typeof E=="function"&&(oe=E,E=null),M(D,F,E,oe);function M(S,w,O,Y,H){return P(S,w,O,function(he,je){he&&(he.code==="EMFILE"||he.code==="ENFILE")?Xg([M,[S,w,O,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}return t}function Xg(t){vf("ENQUEUE",t[0].name,t[1]),Kt[sn].push(t),s3()}var tN;function HEe(){for(var t=Date.now(),e=0;e<Kt[sn].length;++e)Kt[sn][e].length>2&&(Kt[sn][e][3]=t,Kt[sn][e][4]=t);s3()}function s3(){if(clearTimeout(tN),tN=void 0,Kt[sn].length!==0){var t=Kt[sn].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)vf("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){vf("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,c=Math.max(o-i,1),l=Math.min(c*1.2,100);a>=l?(vf("RETRY",e.name,r),e.apply(null,r.concat([i]))):Kt[sn].push(t)}tN===void 0&&(tN=setTimeout(s3,0))}}});var cve=y(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});Qg.splitWhen=Qg.flatten=void 0;function Oit(t){return t.reduce((e,r)=>[].concat(e,r),[])}Qg.flatten=Oit;function Nit(t,e){let r=[[]],n=0;for(let i of t)e(i)?(n++,r[n]=[]):r[n].push(i);return r}Qg.splitWhen=Nit});var lve=y(iN=>{"use strict";Object.defineProperty(iN,"__esModule",{value:!0});iN.isEnoentCodeError=void 0;function kit(t){return t.code==="ENOENT"}iN.isEnoentCodeError=kit});var uve=y(oN=>{"use strict";Object.defineProperty(oN,"__esModule",{value:!0});oN.createDirentFromStats=void 0;var g3=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 Mit(t,e){return new g3(t,e)}oN.createDirentFromStats=Mit});var hve=y(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.convertPosixPathToPattern=mr.convertWindowsPathToPattern=mr.convertPathToPattern=mr.escapePosixPath=mr.escapeWindowsPath=mr.escape=mr.removeLeadingDotSegment=mr.makeAbsolute=mr.unixify=void 0;var $it=Z("os"),Dit=Z("path"),dve=$it.platform()==="win32",Lit=2,Uit=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Fit=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,zit=/^\\\\([.?])/,jit=/\\(?![!()+@[\]{}])/g;function Bit(t){return t.replace(/\\/g,"/")}mr.unixify=Bit;function qit(t,e){return Dit.resolve(t,e)}mr.makeAbsolute=qit;function Vit(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Lit)}return t}mr.removeLeadingDotSegment=Vit;mr.escape=dve?_3:y3;function _3(t){return t.replace(Fit,"\\$2")}mr.escapeWindowsPath=_3;function y3(t){return t.replace(Uit,"\\$2")}mr.escapePosixPath=y3;mr.convertPathToPattern=dve?fve:pve;function fve(t){return _3(t).replace(zit,"//$1").replace(jit,"/")}mr.convertWindowsPathToPattern=fve;function pve(t){return y3(t)}mr.convertPosixPathToPattern=pve});var gve=y((sar,mve)=>{"use strict";mve.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 Sve=y((aar,yve)=>{"use strict";var Git=gve(),_ve={"{":"}","(":")","[":"]"},Hit=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,i=-2,o=-2,s=-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&&(s===-1||s>n||(s=t.indexOf("\\",e),s===-1||s>n)))||i!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(i=t.indexOf("}",e),i>e&&(s=t.indexOf("\\",e),s===-1||s>i))||o!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(o=t.indexOf(")",e),o>e&&(s=t.indexOf("\\",e),s===-1||s>o))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(o=t.indexOf(")",r),o>r&&(s=t.indexOf("\\",r),s===-1||s>o))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=_ve[a];if(c){var l=t.indexOf(c,e);l!==-1&&(e=l+1)}if(t[e]==="!")return!0}else e++}return!1},Wit=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=_ve[r];if(n){var i=t.indexOf(n,e);i!==-1&&(e=i+1)}if(t[e]==="!")return!0}else e++}return!1};yve.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(Git(e))return!0;var n=Hit;return r&&r.strict===!1&&(n=Wit),n(e)}});var vve=y((car,Eve)=>{"use strict";var Yit=Sve(),Kit=Z("path").posix.dirname,Zit=Z("os").platform()==="win32",S3="/",Jit=/\\/g,Xit=/[\{\[].*[\}\]]$/,Qit=/(^|[^\\])([\{\[]|\([^\)]+$)/,eot=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Eve.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Zit&&e.indexOf(S3)<0&&(e=e.replace(Jit,S3)),Xit.test(e)&&(e+=S3),e+="a";do e=Kit(e);while(Yit(e)||Qit.test(e));return e.replace(eot,"$1")}});var sN=y(io=>{"use strict";io.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;io.find=(t,e)=>t.nodes.find(r=>r.type===e);io.exceedsLimit=(t,e,r=1,n)=>n===!1||!io.isInteger(t)||!io.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;io.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)};io.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;io.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;io.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;io.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);io.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i<n.length;i++){let o=n[i];if(Array.isArray(o)){r(o);continue}o!==void 0&&e.push(o)}return e};return r(t),e}});var aN=y((uar,Tve)=>{"use strict";var bve=sN();Tve.exports=(t,e={})=>{let r=(n,i={})=>{let o=e.escapeInvalid&&bve.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(o||s)&&bve.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 xve=y((dar,wve)=>{"use strict";wve.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var Mve=y((far,kve)=>{"use strict";var Ave=xve(),Tf=(t,e,r)=>{if(Ave(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Ave(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),o=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=t+":"+e+"="+i+o+s+a;if(Tf.cache.hasOwnProperty(c))return Tf.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=Nve(t)||Nve(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=Rve(m,Math.abs(l),f,n),l=f.a=0}return u>=0&&(p=Rve(l,u,f,n)),f.negatives=h,f.positives=p,f.result=tot(h,p,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&p.length+h.length>1&&(f.result=`(?:${f.result})`),Tf.cache[c]=f,f.result};function tot(t,e,r){let n=E3(t,e,"-",!1,r)||[],i=E3(e,t,"",!1,r)||[],o=E3(t,e,"-?",!0,r)||[];return n.concat(o).concat(i).join("|")}function rot(t,e){let r=1,n=1,i=Ive(t,r),o=new Set([e]);for(;t<=i&&i<=e;)o.add(i),r+=1,i=Ive(t,r);for(i=Pve(e+1,n)-1;t<i&&i<=e;)o.add(i),n+=1,i=Pve(e+1,n)-1;return o=[...o],o.sort(oot),o}function not(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=iot(t,e),i=n.length,o="",s=0;for(let a=0;a<i;a++){let[c,l]=n[a];c===l?o+=c:c!=="0"||l!=="9"?o+=sot(c,l,r):s++}return s&&(o+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[s],digits:i}}function Rve(t,e,r,n){let i=rot(t,e),o=[],s=t,a;for(let c=0;c<i.length;c++){let l=i[c],u=not(String(s),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+Ove(a.count),s=l+1;continue}r.isPadded&&(d=aot(l,r,n)),u.string=d+u.pattern+Ove(u.count),o.push(u),s=l+1,a=u}return o}function E3(t,e,r,n,i){let o=[];for(let s of t){let{string:a}=s;!n&&!Cve(e,"string",a)&&o.push(r+a),n&&Cve(e,"string",a)&&o.push(r+a)}return o}function iot(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function oot(t,e){return t>e?1:e>t?-1:0}function Cve(t,e,r){return t.some(n=>n[e]===r)}function Ive(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Pve(t,e){return t-t%Math.pow(10,e)}function Ove(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function sot(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function Nve(t){return/^-?(0+)\d/.test(t)}function aot(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}}`}}Tf.cache={};Tf.clearCache=()=>Tf.cache={};kve.exports=Tf});var T3=y((par,jve)=>{"use strict";var cot=Z("util"),Dve=Mve(),$ve=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),lot=t=>e=>t===!0?Number(e):String(e),v3=t=>typeof t=="number"||typeof t=="string"&&t!=="",$b=t=>Number.isInteger(+t),b3=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},uot=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,dot=(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},lN=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},fot=(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="",o="",s;return t.positives.length&&(i=t.positives.map(a=>lN(String(a),r)).join("|")),t.negatives.length&&(o=`-(${n}${t.negatives.map(a=>lN(String(a),r)).join("|")})`),i&&o?s=`${i}|${o}`:s=i||o,e.wrap?`(${n}${s})`:s},Lve=(t,e,r,n)=>{if(r)return Dve(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let o=String.fromCharCode(e);return`[${i}-${o}]`},Uve=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return Dve(t,e,r)},Fve=(...t)=>new RangeError("Invalid range arguments: "+cot.inspect(...t)),zve=(t,e,r)=>{if(r.strictRanges===!0)throw Fve([t,e]);return[]},pot=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},hot=(t,e,r=1,n={})=>{let i=Number(t),o=Number(e);if(!Number.isInteger(i)||!Number.isInteger(o)){if(n.strictRanges===!0)throw Fve([t,e]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,a=String(t),c=String(e),l=String(r);r=Math.max(Math.abs(r),1);let u=b3(a)||b3(c)||b3(l),d=u?Math.max(a.length,c.length,l.length):0,f=u===!1&&uot(t,e,n)===!1,p=n.transform||lot(f);if(n.toRegex&&r===1)return Lve(lN(t,d),lN(e,d),!0,n);let h={negatives:[],positives:[]},m=v=>h[v<0?"negatives":"positives"].push(Math.abs(v)),g=[],_=0;for(;s?i>=o:i<=o;)n.toRegex===!0&&r>1?m(i):g.push(dot(p(i,_),d,f)),i=s?i-r:i+r,_++;return n.toRegex===!0?r>1?fot(h,n,d):Uve(g,null,{wrap:!1,...n}):g},mot=(t,e,r=1,n={})=>{if(!$b(t)&&t.length>1||!$b(e)&&e.length>1)return zve(t,e,n);let i=n.transform||(f=>String.fromCharCode(f)),o=`${t}`.charCodeAt(0),s=`${e}`.charCodeAt(0),a=o>s,c=Math.min(o,s),l=Math.max(o,s);if(n.toRegex&&r===1)return Lve(c,l,!1,n);let u=[],d=0;for(;a?o>=s:o<=s;)u.push(i(o,d)),o=a?o-r:o+r,d++;return n.toRegex===!0?Uve(u,null,{wrap:!1,options:n}):u},cN=(t,e,r,n={})=>{if(e==null&&v3(t))return[t];if(!v3(t)||!v3(e))return zve(t,e,n);if(typeof r=="function")return cN(t,e,1,{transform:r});if($ve(r))return cN(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,$b(r)?$b(t)&&$b(e)?hot(t,e,r,i):mot(t,e,Math.max(Math.abs(r),1),i):r!=null&&!$ve(r)?pot(r,i):cN(t,e,1,r)};jve.exports=cN});var Vve=y((har,qve)=>{"use strict";var got=T3(),Bve=sN(),_ot=(t,e={})=>{let r=(n,i={})=>{let o=Bve.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a=o===!0||s===!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=Bve.reduce(n.nodes),d=got(...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)};qve.exports=_ot});var Wve=y((mar,Hve)=>{"use strict";var yot=T3(),Gve=aN(),e_=sN(),wf=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?e_.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let o of i)n.push(wf(o,e,r));else for(let o of e)r===!0&&typeof o=="string"&&(o=`{${o}}`),n.push(Array.isArray(o)?wf(i,o,r):i+o);return e_.flatten(n)},Sot=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,o={})=>{i.queue=[];let s=o,a=o.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(i.invalid||i.dollar){a.push(wf(a.pop(),Gve(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(wf(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let d=e_.reduce(i.nodes);if(e_.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=yot(...d,e);f.length===0&&(f=Gve(i,e)),a.push(wf(a.pop(),f)),i.nodes=[];return}let c=e_.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(wf(a.pop(),l,c));continue}if(f.value&&f.type!=="open"){l.push(wf(l.pop(),f.value));continue}f.nodes&&n(f,i)}return l};return e_.flatten(n(t))};Hve.exports=Sot});var Kve=y((gar,Yve)=>{"use strict";Yve.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:`
|
|
31
|
-
`,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 ebe=y((_ar,Qve)=>{"use strict";var Eot=aN(),{MAX_LENGTH:Zve,CHAR_BACKSLASH:w3,CHAR_BACKTICK:vot,CHAR_COMMA:bot,CHAR_DOT:Tot,CHAR_LEFT_PARENTHESES:wot,CHAR_RIGHT_PARENTHESES:xot,CHAR_LEFT_CURLY_BRACE:Aot,CHAR_RIGHT_CURLY_BRACE:Rot,CHAR_LEFT_SQUARE_BRACKET:Jve,CHAR_RIGHT_SQUARE_BRACKET:Xve,CHAR_DOUBLE_QUOTE:Cot,CHAR_SINGLE_QUOTE:Iot,CHAR_NO_BREAK_SPACE:Pot,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Oot}=Kve(),Not=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Zve,r.maxLength):Zve;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},o=[i],s=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 s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(h({type:"bos"});u<l;)if(s=o[o.length-1],f=p(),!(f===Oot||f===Pot)){if(f===w3){h({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===Xve){h({type:"text",value:"\\"+f});continue}if(f===Jve){c++;let m;for(;u<l&&(m=p());){if(f+=m,m===Jve){c++;continue}if(m===w3){f+=p();continue}if(m===Xve&&(c--,c===0))break}h({type:"text",value:f});continue}if(f===wot){s=h({type:"paren",nodes:[]}),o.push(s),h({type:"text",value:f});continue}if(f===xot){if(s.type!=="paren"){h({type:"text",value:f});continue}s=o.pop(),h({type:"text",value:f}),s=o[o.length-1];continue}if(f===Cot||f===Iot||f===vot){let m=f,g;for(e.keepQuotes!==!0&&(f="");u<l&&(g=p());){if(g===w3){f+=g+p();continue}if(g===m){e.keepQuotes===!0&&(f+=g);break}f+=g}h({type:"text",value:f});continue}if(f===Aot){d++;let g={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};s=h(g),o.push(s),h({type:"open",value:f});continue}if(f===Rot){if(s.type!=="brace"){h({type:"text",value:f});continue}let m="close";s=o.pop(),s.close=!0,h({type:m,value:f}),d--,s=o[o.length-1];continue}if(f===bot&&d>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:Eot(s)}]}h({type:"comma",value:f}),s.commas++;continue}if(f===Tot&&d>0&&s.commas===0){let m=s.nodes;if(d===0||m.length===0){h({type:"text",value:f});continue}if(a.type==="dot"){if(s.range=[],a.value+=f,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let g=m[m.length-1];g.value+=a.value+f,a=g,s.ranges--;continue}h({type:"dot",value:f});continue}h({type:"text",value:f})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(_=>{_.nodes||(_.type==="open"&&(_.isOpen=!0),_.type==="close"&&(_.isClose=!0),_.nodes||(_.type="text"),_.invalid=!0)});let m=o[o.length-1],g=m.nodes.indexOf(s);m.nodes.splice(g,1,...s.nodes)}while(o.length>0);return h({type:"eos"}),i};Qve.exports=Not});var nbe=y((yar,rbe)=>{"use strict";var tbe=aN(),kot=Vve(),Mot=Wve(),$ot=ebe(),Ci=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=Ci.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(Ci.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Ci.parse=(t,e={})=>$ot(t,e);Ci.stringify=(t,e={})=>tbe(typeof t=="string"?Ci.parse(t,e):t,e);Ci.compile=(t,e={})=>(typeof t=="string"&&(t=Ci.parse(t,e)),kot(t,e));Ci.expand=(t,e={})=>{typeof t=="string"&&(t=Ci.parse(t,e));let r=Mot(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Ci.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Ci.compile(t,e):Ci.expand(t,e);rbe.exports=Ci});var Db=y((Sar,cbe)=>{"use strict";var Dot=Z("path"),Xs="\\\\/",ibe=`[^${Xs}]`,Lot=0,hc="\\.",Uot="\\+",Fot="\\?",uN="\\/",zot="(?=.)",obe="[^/]",x3=`(?:${uN}|$)`,sbe=`(?:^|${uN})`,A3=`${hc}{1,2}${x3}`,jot=`(?!${hc})`,Bot=`(?!${sbe}${A3})`,qot=`(?!${hc}{0,1}${x3})`,Vot=`(?!${A3})`,Got=`[^.${uN}]`,Hot=`${obe}*?`,abe={DOT_LITERAL:hc,PLUS_LITERAL:Uot,QMARK_LITERAL:Fot,SLASH_LITERAL:uN,ONE_CHAR:zot,QMARK:obe,END_ANCHOR:x3,DOTS_SLASH:A3,NO_DOT:jot,NO_DOTS:Bot,NO_DOT_SLASH:qot,NO_DOTS_SLASH:Vot,QMARK_NO_DOT:Got,STAR:Hot,START_ANCHOR:sbe},Wot={...abe,SLASH_LITERAL:`[${Xs}]`,QMARK:ibe,STAR:`${ibe}*?`,DOTS_SLASH:`${hc}{1,2}(?:[${Xs}]|$)`,NO_DOT:`(?!${hc})`,NO_DOTS:`(?!(?:^|[${Xs}])${hc}{1,2}(?:[${Xs}]|$))`,NO_DOT_SLASH:`(?!${hc}{0,1}(?:[${Xs}]|$))`,NO_DOTS_SLASH:`(?!${hc}{1,2}(?:[${Xs}]|$))`,QMARK_NO_DOT:`[^.${Xs}]`,START_ANCHOR:`(?:^|[${Xs}])`,END_ANCHOR:`(?:[${Xs}]|$)`},Yot={__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"};cbe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Lot,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Yot,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:Dot.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?Wot:abe}}});var Lb=y(oi=>{"use strict";var Kot=Z("path"),Zot=process.platform==="win32",{REGEX_BACKSLASH:Jot,REGEX_REMOVE_BACKSLASH:Xot,REGEX_SPECIAL_CHARS:Qot,REGEX_SPECIAL_CHARS_GLOBAL:est}=Db();oi.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);oi.hasRegexChars=t=>Qot.test(t);oi.isRegexChar=t=>t.length===1&&oi.hasRegexChars(t);oi.escapeRegex=t=>t.replace(est,"\\$1");oi.toPosixSlashes=t=>t.replace(Jot,"/");oi.removeBackslashes=t=>t.replace(Xot,e=>e==="\\"?"":e);oi.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};oi.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Zot===!0||Kot.sep==="\\";oi.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?oi.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};oi.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};oi.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var gbe=y((bar,mbe)=>{"use strict";var lbe=Lb(),{CHAR_ASTERISK:R3,CHAR_AT:tst,CHAR_BACKWARD_SLASH:Ub,CHAR_COMMA:rst,CHAR_DOT:C3,CHAR_EXCLAMATION_MARK:I3,CHAR_FORWARD_SLASH:hbe,CHAR_LEFT_CURLY_BRACE:P3,CHAR_LEFT_PARENTHESES:O3,CHAR_LEFT_SQUARE_BRACKET:nst,CHAR_PLUS:ist,CHAR_QUESTION_MARK:ube,CHAR_RIGHT_CURLY_BRACE:ost,CHAR_RIGHT_PARENTHESES:dbe,CHAR_RIGHT_SQUARE_BRACKET:sst}=Db(),fbe=t=>t===hbe||t===Ub,pbe=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},ast=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,h=!1,m=!1,g=!1,_=!1,v=!1,T=!1,b=!1,A=!1,k=0,P,N,D={value:"",depth:0,isGlob:!1},F=()=>l>=n,E=()=>c.charCodeAt(l+1),oe=()=>(P=N,c.charCodeAt(++l));for(;l<n;){N=oe();let Y;if(N===Ub){v=D.backslashes=!0,N=oe(),N===P3&&(_=!0);continue}if(_===!0||N===P3){for(k++;F()!==!0&&(N=oe());){if(N===Ub){v=D.backslashes=!0,oe();continue}if(N===P3){k++;continue}if(_!==!0&&N===C3&&(N=oe())===C3){if(f=D.isBrace=!0,h=D.isGlob=!0,A=!0,i===!0)continue;break}if(_!==!0&&N===rst){if(f=D.isBrace=!0,h=D.isGlob=!0,A=!0,i===!0)continue;break}if(N===ost&&(k--,k===0)){_=!1,f=D.isBrace=!0,A=!0;break}}if(i===!0)continue;break}if(N===hbe){if(o.push(l),s.push(D),D={value:"",depth:0,isGlob:!1},A===!0)continue;if(P===C3&&l===u+1){u+=2;continue}d=l+1;continue}if(r.noext!==!0&&(N===ist||N===tst||N===R3||N===ube||N===I3)===!0&&E()===O3){if(h=D.isGlob=!0,m=D.isExtglob=!0,A=!0,N===I3&&l===u&&(b=!0),i===!0){for(;F()!==!0&&(N=oe());){if(N===Ub){v=D.backslashes=!0,N=oe();continue}if(N===dbe){h=D.isGlob=!0,A=!0;break}}continue}break}if(N===R3){if(P===R3&&(g=D.isGlobstar=!0),h=D.isGlob=!0,A=!0,i===!0)continue;break}if(N===ube){if(h=D.isGlob=!0,A=!0,i===!0)continue;break}if(N===nst){for(;F()!==!0&&(Y=oe());){if(Y===Ub){v=D.backslashes=!0,oe();continue}if(Y===sst){p=D.isBracket=!0,h=D.isGlob=!0,A=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&N===I3&&l===u){T=D.negated=!0,u++;continue}if(r.noparen!==!0&&N===O3){if(h=D.isGlob=!0,i===!0){for(;F()!==!0&&(N=oe());){if(N===O3){v=D.backslashes=!0,N=oe();continue}if(N===dbe){A=!0;break}}continue}break}if(h===!0){if(A=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,h=!1);let M=c,S="",w="";u>0&&(S=c.slice(0,u),c=c.slice(u),d-=u),M&&h===!0&&d>0?(M=c.slice(0,d),w=c.slice(d)):h===!0?(M="",w=c):M=c,M&&M!==""&&M!=="/"&&M!==c&&fbe(M.charCodeAt(M.length-1))&&(M=M.slice(0,-1)),r.unescape===!0&&(w&&(w=lbe.removeBackslashes(w)),M&&v===!0&&(M=lbe.removeBackslashes(M)));let O={prefix:S,input:t,start:u,base:M,glob:w,isBrace:f,isBracket:p,isGlob:h,isExtglob:m,isGlobstar:g,negated:T,negatedExtglob:b};if(r.tokens===!0&&(O.maxDepth=0,fbe(N)||s.push(D),O.tokens=s),r.parts===!0||r.tokens===!0){let Y;for(let H=0;H<o.length;H++){let he=Y?Y+1:u,je=o[H],Ie=t.slice(he,je);r.tokens&&(H===0&&u!==0?(s[H].isPrefix=!0,s[H].value=S):s[H].value=Ie,pbe(s[H]),O.maxDepth+=s[H].depth),(H!==0||Ie!=="")&&a.push(Ie),Y=je}if(Y&&Y+1<t.length){let H=t.slice(Y+1);a.push(H),r.tokens&&(s[s.length-1].value=H,pbe(s[s.length-1]),O.maxDepth+=s[s.length-1].depth)}O.slashes=o,O.parts=a}return O};mbe.exports=ast});var vbe=y((Tar,Ebe)=>{"use strict";var Fb=Db(),yn=Lb(),{MAX_LENGTH:dN,POSIX_REGEX_SOURCE:cst,REGEX_NON_SPECIAL_CHARS:lst,REGEX_SPECIAL_CHARS_BACKREF:ust,REPLACEMENTS:_be}=Fb,dst=(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=>yn.escapeRegex(i)).join("..")}return r},t_=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,ybe=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=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(o),o="";continue}}}o+=a}return e.push(o),e},fst=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},Sbe=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(fst(e))return e.replace(/\\(.)/g,"$1")},pst=t=>{let e=t.map(Sbe).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let i=e[r],o=e[n],s=i[0];if(!(!s||i!==s.repeat(i.length)||o!==s.repeat(o.length))&&(i===o||i.startsWith(o)||o.startsWith(i)))return!0}return!1},N3=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s<t.length;s++){let a=t[s];if(o===!0){o=!1;continue}if(a==="\\"){o=!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&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},hst=t=>{let e=0,r=[];for(;e<t.length;){let i=N3(t.slice(e),!1);if(!i||i.type!=="*")return;let o=ybe(i.body).map(a=>a.trim());if(o.length!==1)return;let s=Sbe(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?yn.escapeRegex(r[0]):`[${r.map(i=>yn.escapeRegex(i)).join("")}]`}*`},mst=t=>{let e=0,r=t.trim(),n=N3(r);for(;n;)e++,r=n.body.trim(),n=N3(r);return e},gst=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Fb.DEFAULT_MAX_EXTGLOB_RECURSION,n=ybe(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||pst(n)))return{risky:!0};for(let i of n){let o=hst(i);if(o)return{risky:!0,safeOutput:o};if(mst(i)>r)return{risky:!0}}return{risky:!1}},k3=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=_be[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(dN,r.maxLength):dN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=yn.isWindows(e),l=Fb.globChars(c),u=Fb.extglobChars(l),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:_,NO_DOTS_SLASH:v,QMARK:T,QMARK_NO_DOT:b,STAR:A,START_ANCHOR:k}=l,P=re=>`(${a}(?:(?!${k}${re.dot?m:d}).)*?)`,N=r.dot?"":g,D=r.dot?T:b,F=r.bash===!0?P(r):A;r.capture&&(F=`(${F})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let E={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:s};t=yn.removePrefix(t,E),i=t.length;let oe=[],M=[],S=[],w=o,O,Y=()=>E.index===i-1,H=E.peek=(re=1)=>t[E.index+re],he=E.advance=()=>t[++E.index]||"",je=()=>t.slice(E.index+1),Ie=(re="",qe=0)=>{E.consumed+=re,E.index+=qe},$e=re=>{E.output+=re.output!=null?re.output:re.value,Ie(re.value)},Oe=()=>{let re=1;for(;H()==="!"&&(H(2)!=="("||H(3)==="?");)he(),E.start++,re++;return re%2===0?!1:(E.negated=!0,E.start++,!0)},Je=re=>{E[re]++,S.push(re)},Ne=re=>{E[re]--,S.pop()},ce=re=>{if(w.type==="globstar"){let qe=E.braces>0&&(re.type==="comma"||re.type==="brace"),z=re.extglob===!0||oe.length&&(re.type==="pipe"||re.type==="paren");re.type!=="slash"&&re.type!=="paren"&&!qe&&!z&&(E.output=E.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=F,E.output+=w.output)}if(oe.length&&re.type!=="paren"&&(oe[oe.length-1].inner+=re.value),(re.value||re.output)&&$e(re),w&&w.type==="text"&&re.type==="text"){w.value+=re.value,w.output=(w.output||"")+re.value;return}re.prev=w,s.push(re),w=re},me=(re,qe)=>{let z={...u[qe],conditions:1,inner:""};z.prev=w,z.parens=E.parens,z.output=E.output,z.startIndex=E.index,z.tokensIndex=s.length;let x=(r.capture?"(":"")+z.open;Je("parens"),ce({type:re,value:qe,output:E.output?"":h}),ce({type:"paren",extglob:!0,value:he(),output:x}),oe.push(z)},nt=re=>{let qe=t.slice(re.startIndex,E.index+1),z=t.slice(re.startIndex+2,E.index),x=gst(z,r);if((re.type==="plus"||re.type==="star")&&x.risky){let B=x.safeOutput?(re.output?"":h)+(r.capture?`(${x.safeOutput})`:x.safeOutput):void 0,te=s[re.tokensIndex];te.type="text",te.value=qe,te.output=B||yn.escapeRegex(qe);for(let ie=re.tokensIndex+1;ie<s.length;ie++)s[ie].value="",s[ie].output="",delete s[ie].suffix;E.output=re.output+te.output,E.backtrack=!0,ce({type:"paren",extglob:!0,value:O,output:""}),Ne("parens");return}let C=re.close+(r.capture?")":""),j;if(re.type==="negate"){let B=F;if(re.inner&&re.inner.length>1&&re.inner.includes("/")&&(B=P(r)),(B!==F||Y()||/^\)+$/.test(je()))&&(C=re.close=`)$))${B}`),re.inner.includes("*")&&(j=je())&&/^\.[^\\/.]+$/.test(j)){let te=k3(j,{...e,fastpaths:!1}).output;C=re.close=`)${te})${B})`}re.prev.type==="bos"&&(E.negatedExtglob=!0)}ce({type:"paren",extglob:!0,value:O,output:C}),Ne("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let re=!1,qe=t.replace(ust,(z,x,C,j,B,te)=>j==="\\"?(re=!0,z):j==="?"?x?x+j+(B?T.repeat(B.length):""):te===0?D+(B?T.repeat(B.length):""):T.repeat(C.length):j==="."?d.repeat(C.length):j==="*"?x?x+j+(B?F:""):F:x?z:`\\${z}`);return re===!0&&(r.unescape===!0?qe=qe.replace(/\\/g,""):qe=qe.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),qe===t&&r.contains===!0?(E.output=t,E):(E.output=yn.wrapOutput(qe,E,e),E)}for(;!Y();){if(O=he(),O==="\0")continue;if(O==="\\"){let z=H();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){O+="\\",ce({type:"text",value:O});continue}let x=/^\\+/.exec(je()),C=0;if(x&&x[0].length>2&&(C=x[0].length,E.index+=C,C%2!==0&&(O+="\\")),r.unescape===!0?O=he():O+=he(),E.brackets===0){ce({type:"text",value:O});continue}}if(E.brackets>0&&(O!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&O===":"){let z=w.value.slice(1);if(z.includes("[")&&(w.posix=!0,z.includes(":"))){let x=w.value.lastIndexOf("["),C=w.value.slice(0,x),j=w.value.slice(x+2),B=cst[j];if(B){w.value=C+B,E.backtrack=!0,he(),!o.output&&s.indexOf(w)===1&&(o.output=h);continue}}}(O==="["&&H()!==":"||O==="-"&&H()==="]")&&(O=`\\${O}`),O==="]"&&(w.value==="["||w.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&w.value==="["&&(O="^"),w.value+=O,$e({value:O});continue}if(E.quotes===1&&O!=='"'){O=yn.escapeRegex(O),w.value+=O,$e({value:O});continue}if(O==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&ce({type:"text",value:O});continue}if(O==="("){Je("parens"),ce({type:"paren",value:O});continue}if(O===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(t_("opening","("));let z=oe[oe.length-1];if(z&&E.parens===z.parens+1){nt(oe.pop());continue}ce({type:"paren",value:O,output:E.parens?")":"\\)"}),Ne("parens");continue}if(O==="["){if(r.nobracket===!0||!je().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(t_("closing","]"));O=`\\${O}`}else Je("brackets");ce({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){ce({type:"text",value:O,output:`\\${O}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(t_("opening","["));ce({type:"text",value:O,output:`\\${O}`});continue}Ne("brackets");let z=w.value.slice(1);if(w.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(O=`/${O}`),w.value+=O,$e({value:O}),r.literalBrackets===!1||yn.hasRegexChars(z))continue;let x=yn.escapeRegex(w.value);if(E.output=E.output.slice(0,-w.value.length),r.literalBrackets===!0){E.output+=x,w.value=x;continue}w.value=`(${a}${x}|${w.value})`,E.output+=w.value;continue}if(O==="{"&&r.nobrace!==!0){Je("braces");let z={type:"brace",value:O,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};M.push(z),ce(z);continue}if(O==="}"){let z=M[M.length-1];if(r.nobrace===!0||!z){ce({type:"text",value:O,output:O});continue}let x=")";if(z.dots===!0){let C=s.slice(),j=[];for(let B=C.length-1;B>=0&&(s.pop(),C[B].type!=="brace");B--)C[B].type!=="dots"&&j.unshift(C[B].value);x=dst(j,r),E.backtrack=!0}if(z.comma!==!0&&z.dots!==!0){let C=E.output.slice(0,z.outputIndex),j=E.tokens.slice(z.tokensIndex);z.value=z.output="\\{",O=x="\\}",E.output=C;for(let B of j)E.output+=B.output||B.value}ce({type:"brace",value:O,output:x}),Ne("braces"),M.pop();continue}if(O==="|"){oe.length>0&&oe[oe.length-1].conditions++,ce({type:"text",value:O});continue}if(O===","){let z=O,x=M[M.length-1];x&&S[S.length-1]==="braces"&&(x.comma=!0,z="|"),ce({type:"comma",value:O,output:z});continue}if(O==="/"){if(w.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",s.pop(),w=o;continue}ce({type:"slash",value:O,output:p});continue}if(O==="."){if(E.braces>0&&w.type==="dot"){w.value==="."&&(w.output=d);let z=M[M.length-1];w.type="dots",w.output+=O,w.value+=O,z.dots=!0;continue}if(E.braces+E.parens===0&&w.type!=="bos"&&w.type!=="slash"){ce({type:"text",value:O,output:d});continue}ce({type:"dot",value:O,output:d});continue}if(O==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("qmark",O);continue}if(w&&w.type==="paren"){let x=H(),C=O;if(x==="<"&&!yn.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(je()))&&(C=`\\${O}`),ce({type:"text",value:O,output:C});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){ce({type:"qmark",value:O,output:b});continue}ce({type:"qmark",value:O,output:T});continue}if(O==="!"){if(r.noextglob!==!0&&H()==="("&&(H(2)!=="?"||!/[!=<:]/.test(H(3)))){me("negate",O);continue}if(r.nonegate!==!0&&E.index===0){Oe();continue}}if(O==="+"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("plus",O);continue}if(w&&w.value==="("||r.regex===!1){ce({type:"plus",value:O,output:f});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||E.parens>0){ce({type:"plus",value:O});continue}ce({type:"plus",value:f});continue}if(O==="@"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){ce({type:"at",extglob:!0,value:O,output:""});continue}ce({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let z=lst.exec(je());z&&(O+=z[0],E.index+=z[0].length),ce({type:"text",value:O});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=O,w.output=F,E.backtrack=!0,E.globstar=!0,Ie(O);continue}let re=je();if(r.noextglob!==!0&&/^\([^?]/.test(re)){me("star",O);continue}if(w.type==="star"){if(r.noglobstar===!0){Ie(O);continue}let z=w.prev,x=z.prev,C=z.type==="slash"||z.type==="bos",j=x&&(x.type==="star"||x.type==="globstar");if(r.bash===!0&&(!C||re[0]&&re[0]!=="/")){ce({type:"star",value:O,output:""});continue}let B=E.braces>0&&(z.type==="comma"||z.type==="brace"),te=oe.length&&(z.type==="pipe"||z.type==="paren");if(!C&&z.type!=="paren"&&!B&&!te){ce({type:"star",value:O,output:""});continue}for(;re.slice(0,3)==="/**";){let ie=t[E.index+4];if(ie&&ie!=="/")break;re=re.slice(3),Ie("/**",3)}if(z.type==="bos"&&Y()){w.type="globstar",w.value+=O,w.output=P(r),E.output=w.output,E.globstar=!0,Ie(O);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!j&&Y()){E.output=E.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=P(r)+(r.strictSlashes?")":"|$)"),w.value+=O,E.globstar=!0,E.output+=z.output+w.output,Ie(O);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&re[0]==="/"){let ie=re[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=`${P(r)}${p}|${p}${ie})`,w.value+=O,E.output+=z.output+w.output,E.globstar=!0,Ie(O+he()),ce({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&re[0]==="/"){w.type="globstar",w.value+=O,w.output=`(?:^|${p}|${P(r)}${p})`,E.output=w.output,E.globstar=!0,Ie(O+he()),ce({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-w.output.length),w.type="globstar",w.output=P(r),w.value+=O,E.output+=w.output,E.globstar=!0,Ie(O);continue}let qe={type:"star",value:O,output:F};if(r.bash===!0){qe.output=".*?",(w.type==="bos"||w.type==="slash")&&(qe.output=N+qe.output),ce(qe);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){qe.output=O,ce(qe);continue}(E.index===E.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(E.output+=_,w.output+=_):r.dot===!0?(E.output+=v,w.output+=v):(E.output+=N,w.output+=N),H()!=="*"&&(E.output+=h,w.output+=h)),ce(qe)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(t_("closing","]"));E.output=yn.escapeLast(E.output,"["),Ne("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(t_("closing",")"));E.output=yn.escapeLast(E.output,"("),Ne("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(t_("closing","}"));E.output=yn.escapeLast(E.output,"{"),Ne("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${p}?`}),E.backtrack===!0){E.output="";for(let re of E.tokens)E.output+=re.output!=null?re.output:re.value,re.suffix&&(E.output+=re.suffix)}return E};k3.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(dN,r.maxLength):dN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=_be[t]||t;let o=yn.isWindows(e),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:h}=Fb.globChars(o),m=r.dot?d:u,g=r.dot?f:u,_=r.capture?"":"?:",v={negated:!1,prefix:""},T=r.bash===!0?".*?":p;r.capture&&(T=`(${T})`);let b=N=>N.noglobstar===!0?T:`(${_}(?:(?!${h}${N.dot?l:s}).)*?)`,A=N=>{switch(N){case"*":return`${m}${c}${T}`;case".*":return`${s}${c}${T}`;case"*.*":return`${m}${T}${s}${c}${T}`;case"*/*":return`${m}${T}${a}${c}${g}${T}`;case"**":return m+b(r);case"**/*":return`(?:${m}${b(r)}${a})?${g}${c}${T}`;case"**/*.*":return`(?:${m}${b(r)}${a})?${g}${T}${s}${c}${T}`;case"**/.*":return`(?:${m}${b(r)}${a})?${s}${c}${T}`;default:{let D=/^(.*?)\.(\w+)$/.exec(N);if(!D)return;let F=A(D[1]);return F?F+s+D[2]:void 0}}},k=yn.removePrefix(t,v),P=A(k);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};Ebe.exports=k3});var Tbe=y((war,bbe)=>{"use strict";var _st=Z("path"),yst=gbe(),M3=vbe(),$3=Lb(),Sst=Db(),Est=t=>t&&typeof t=="object"&&!Array.isArray(t),cr=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>cr(f,e,r));return f=>{for(let p of u){let h=p(f);if(h)return h}return!1}}let n=Est(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||{},o=$3.isWindows(e),s=n?cr.compileRe(t,e):cr.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=cr(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:h}=cr.test(u,s,e,{glob:t,posix:o}),m={glob:t,state:a,regex:s,posix:o,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};cr.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 o=r||{},s=o.format||(i?$3.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=cr.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};cr.matchBase=(t,e,r,n=$3.isWindows(r))=>(e instanceof RegExp?e:cr.makeRe(e,r)).test(_st.basename(t));cr.isMatch=(t,e,r)=>cr(e,r)(t);cr.parse=(t,e)=>Array.isArray(t)?t.map(r=>cr.parse(r,e)):M3(t,{...e,fastpaths:!1});cr.scan=(t,e)=>yst(t,e);cr.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=cr.toRegex(a,e);return n===!0&&(c.state=t),c};cr.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=M3.fastpaths(t,e)),i.output||(i=M3(t,e)),cr.compileRe(i,e,r,n)};cr.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/$^/}};cr.constants=Sst;bbe.exports=cr});var xbe=y((xar,wbe)=>{"use strict";wbe.exports=Tbe()});var L3=y((Aar,Pbe)=>{"use strict";var Rbe=Z("util"),Cbe=nbe(),Qs=xbe(),D3=Lb(),Abe=t=>t===""||t==="./",Ibe=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Vt=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,o=new Set,s=0,a=u=>{o.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<e.length;u++){let d=Qs(String(e[u]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&s++;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=(s===e.length?[...o]:[...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};Vt.match=Vt;Vt.matcher=(t,e)=>Qs(t,e);Vt.isMatch=(t,e,r)=>Qs(e,r)(t);Vt.any=Vt.isMatch;Vt.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],o=a=>{r.onResult&&r.onResult(a),i.push(a.output)},s=new Set(Vt(t,e,{...r,onResult:o}));for(let a of i)s.has(a)||n.add(a);return[...n]};Vt.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rbe.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Vt.contains(t,n,r));if(typeof e=="string"){if(Abe(t)||Abe(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Vt.isMatch(t,e,{...r,contains:!0})};Vt.matchKeys=(t,e,r)=>{if(!D3.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Vt(Object.keys(t),e,r),i={};for(let o of n)i[o]=t[o];return i};Vt.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=Qs(String(i),r);if(n.some(s=>o(s)))return!0}return!1};Vt.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=Qs(String(i),r);if(!n.every(s=>o(s)))return!1}return!0};Vt.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rbe.inspect(t)}"`);return[].concat(e).every(n=>Qs(n,r)(t))};Vt.capture=(t,e,r)=>{let n=D3.isWindows(r),o=Qs.makeRe(String(t),{...r,capture:!0}).exec(n?D3.toPosixSlashes(e):e);if(o)return o.slice(1).map(s=>s===void 0?"":s)};Vt.makeRe=(...t)=>Qs.makeRe(...t);Vt.scan=(...t)=>Qs.scan(...t);Vt.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of Cbe(String(n),e))r.push(Qs.parse(i,e));return r};Vt.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Ibe(t)?[t]:Cbe(t,e)};Vt.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Vt.braces(t,{...e,expand:!0})};Vt.hasBraces=Ibe;Pbe.exports=Vt});var zbe=y(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.isAbsolute=ke.partitionAbsoluteAndRelative=ke.removeDuplicateSlashes=ke.matchAny=ke.convertPatternsToRe=ke.makeRe=ke.getPatternParts=ke.expandBraceExpansion=ke.expandPatternsWithBraceExpansion=ke.isAffectDepthOfReadingPattern=ke.endsWithSlashGlobStar=ke.hasGlobStar=ke.getBaseDirectory=ke.isPatternRelatedToParentDirectory=ke.getPatternsOutsideCurrentDirectory=ke.getPatternsInsideCurrentDirectory=ke.getPositivePatterns=ke.getNegativePatterns=ke.isPositivePattern=ke.isNegativePattern=ke.convertToNegativePattern=ke.convertToPositivePattern=ke.isDynamicPattern=ke.isStaticPattern=void 0;var Obe=Z("path"),vst=vve(),U3=L3(),Nbe="**",bst="\\",Tst=/[*?]|^!/,wst=/\[[^[]*]/,xst=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Ast=/[!*+?@]\([^(]*\)/,Rst=/,|\.\./,Cst=/(?!^)\/{2,}/g;function kbe(t,e={}){return!Mbe(t,e)}ke.isStaticPattern=kbe;function Mbe(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(bst)||Tst.test(t)||wst.test(t)||xst.test(t)||e.extglob!==!1&&Ast.test(t)||e.braceExpansion!==!1&&Ist(t))}ke.isDynamicPattern=Mbe;function Ist(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 Rst.test(n)}function Pst(t){return fN(t)?t.slice(1):t}ke.convertToPositivePattern=Pst;function Ost(t){return"!"+t}ke.convertToNegativePattern=Ost;function fN(t){return t.startsWith("!")&&t[1]!=="("}ke.isNegativePattern=fN;function $be(t){return!fN(t)}ke.isPositivePattern=$be;function Nst(t){return t.filter(fN)}ke.getNegativePatterns=Nst;function kst(t){return t.filter($be)}ke.getPositivePatterns=kst;function Mst(t){return t.filter(e=>!F3(e))}ke.getPatternsInsideCurrentDirectory=Mst;function $st(t){return t.filter(F3)}ke.getPatternsOutsideCurrentDirectory=$st;function F3(t){return t.startsWith("..")||t.startsWith("./..")}ke.isPatternRelatedToParentDirectory=F3;function Dst(t){return vst(t,{flipBackslashes:!1})}ke.getBaseDirectory=Dst;function Lst(t){return t.includes(Nbe)}ke.hasGlobStar=Lst;function Dbe(t){return t.endsWith("/"+Nbe)}ke.endsWithSlashGlobStar=Dbe;function Ust(t){let e=Obe.basename(t);return Dbe(t)||kbe(e)}ke.isAffectDepthOfReadingPattern=Ust;function Fst(t){return t.reduce((e,r)=>e.concat(Lbe(r)),[])}ke.expandPatternsWithBraceExpansion=Fst;function Lbe(t){let e=U3.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ke.expandBraceExpansion=Lbe;function zst(t,e){let{parts:r}=U3.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}ke.getPatternParts=zst;function Ube(t,e){return U3.makeRe(t,e)}ke.makeRe=Ube;function jst(t,e){return t.map(r=>Ube(r,e))}ke.convertPatternsToRe=jst;function Bst(t,e){return e.some(r=>r.test(t))}ke.matchAny=Bst;function qst(t){return t.replace(Cst,"/")}ke.removeDuplicateSlashes=qst;function Vst(t){let e=[],r=[];for(let n of t)Fbe(n)?e.push(n):r.push(n);return[e,r]}ke.partitionAbsoluteAndRelative=Vst;function Fbe(t){return Obe.isAbsolute(t)}ke.isAbsolute=Fbe});var Vbe=y((Car,qbe)=>{"use strict";var Gst=Z("stream"),jbe=Gst.PassThrough,Hst=Array.prototype.slice;qbe.exports=Wst;function Wst(){let t=[],e=Hst.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,o=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=jbe(n);function a(){for(let u=0,d=arguments.length;u<d;u++)t.push(Bbe(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),o&&h.removeListener("error",g),f()}function g(_){s.emit("error",_)}if(h._readableState.endEmitted)return f();h.on("merge2UnpipeEnd",m),h.on("end",m),o&&h.on("error",g),h.pipe(s,{end:!1}),h.resume()}for(let h=0;h<u.length;h++)p(u[h]);f()}function l(){r=!1,s.emit("queueDrain"),i&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),s}function Bbe(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=Bbe(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(jbe(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var Hbe=y(pN=>{"use strict";Object.defineProperty(pN,"__esModule",{value:!0});pN.merge=void 0;var Yst=Vbe();function Kst(t){let e=Yst(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>Gbe(t)),e.once("end",()=>Gbe(t)),e}pN.merge=Kst;function Gbe(t){t.forEach(e=>e.emit("close"))}});var Wbe=y(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.isEmpty=r_.isString=void 0;function Zst(t){return typeof t=="string"}r_.isString=Zst;function Jst(t){return t===""}r_.isEmpty=Jst});var mc=y(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.string=Sn.stream=Sn.pattern=Sn.path=Sn.fs=Sn.errno=Sn.array=void 0;var Xst=cve();Sn.array=Xst;var Qst=lve();Sn.errno=Qst;var eat=uve();Sn.fs=eat;var tat=hve();Sn.path=tat;var rat=zbe();Sn.pattern=rat;var nat=Hbe();Sn.stream=nat;var iat=Wbe();Sn.string=iat});var Jbe=y(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.convertPatternGroupToTask=En.convertPatternGroupsToTasks=En.groupPatternsByBaseDirectory=En.getNegativePatternsAsPositive=En.getPositivePatterns=En.convertPatternsToTasks=En.generate=void 0;var Ko=mc();function oat(t,e){let r=Ybe(t,e),n=Ybe(e.ignore,e),i=Kbe(r),o=Zbe(r,n),s=i.filter(u=>Ko.pattern.isStaticPattern(u,e)),a=i.filter(u=>Ko.pattern.isDynamicPattern(u,e)),c=z3(s,o,!1),l=z3(a,o,!0);return c.concat(l)}En.generate=oat;function Ybe(t,e){let r=t;return e.braceExpansion&&(r=Ko.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Ko.pattern.removeDuplicateSlashes(n))}function z3(t,e,r){let n=[],i=Ko.pattern.getPatternsOutsideCurrentDirectory(t),o=Ko.pattern.getPatternsInsideCurrentDirectory(t),s=j3(i),a=j3(o);return n.push(...B3(s,e,r)),"."in a?n.push(q3(".",o,e,r)):n.push(...B3(a,e,r)),n}En.convertPatternsToTasks=z3;function Kbe(t){return Ko.pattern.getPositivePatterns(t)}En.getPositivePatterns=Kbe;function Zbe(t,e){return Ko.pattern.getNegativePatterns(t).concat(e).map(Ko.pattern.convertToPositivePattern)}En.getNegativePatternsAsPositive=Zbe;function j3(t){let e={};return t.reduce((r,n)=>{let i=Ko.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}En.groupPatternsByBaseDirectory=j3;function B3(t,e,r){return Object.keys(t).map(n=>q3(n,t[n],e,r))}En.convertPatternGroupsToTasks=B3;function q3(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Ko.pattern.convertToNegativePattern))}}En.convertPatternGroupToTask=q3});var Qbe=y(hN=>{"use strict";Object.defineProperty(hN,"__esModule",{value:!0});hN.read=void 0;function sat(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){Xbe(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){V3(r,i);return}e.fs.stat(t,(o,s)=>{if(o!==null){if(e.throwErrorOnBrokenSymbolicLink){Xbe(r,o);return}V3(r,i);return}e.markSymbolicLink&&(s.isSymbolicLink=()=>!0),V3(r,s)})})}hN.read=sat;function Xbe(t,e){t(e)}function V3(t,e){t(null,e)}});var eTe=y(mN=>{"use strict";Object.defineProperty(mN,"__esModule",{value:!0});mN.read=void 0;function aat(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}}mN.read=aat});var tTe=y(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.createFileSystemAdapter=ou.FILE_SYSTEM_ADAPTER=void 0;var gN=Z("fs");ou.FILE_SYSTEM_ADAPTER={lstat:gN.lstat,stat:gN.stat,lstatSync:gN.lstatSync,statSync:gN.statSync};function cat(t){return t===void 0?ou.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ou.FILE_SYSTEM_ADAPTER),t)}ou.createFileSystemAdapter=cat});var rTe=y(H3=>{"use strict";Object.defineProperty(H3,"__esModule",{value:!0});var lat=tTe(),G3=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=lat.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}};H3.default=G3});var xf=y(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.statSync=su.stat=su.Settings=void 0;var nTe=Qbe(),uat=eTe(),W3=rTe();su.Settings=W3.default;function dat(t,e,r){if(typeof e=="function"){nTe.read(t,Y3(),e);return}nTe.read(t,Y3(e),r)}su.stat=dat;function fat(t,e){let r=Y3(e);return uat.read(t,r)}su.statSync=fat;function Y3(t={}){return t instanceof W3.default?t:new W3.default(t)}});var sTe=y((Uar,oTe)=>{"use strict";var iTe;oTe.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(iTe||(iTe=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var cTe=y((Far,aTe)=>{"use strict";aTe.exports=hat;var pat=sTe();function hat(t,e){let r,n,i,o=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function s(c){function l(){e&&e(c,r),e=null}o?pat(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&s(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)})}):s(null),o=!1}});var K3=y(yN=>{"use strict";Object.defineProperty(yN,"__esModule",{value:!0});yN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var _N=process.versions.node.split(".");if(_N[0]===void 0||_N[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var lTe=Number.parseInt(_N[0],10),mat=Number.parseInt(_N[1],10),uTe=10,gat=10,_at=lTe>uTe,yat=lTe===uTe&&mat>=gat;yN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=_at||yat});var dTe=y(SN=>{"use strict";Object.defineProperty(SN,"__esModule",{value:!0});SN.createDirentFromStats=void 0;var Z3=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 Sat(t,e){return new Z3(t,e)}SN.createDirentFromStats=Sat});var J3=y(EN=>{"use strict";Object.defineProperty(EN,"__esModule",{value:!0});EN.fs=void 0;var Eat=dTe();EN.fs=Eat});var X3=y(vN=>{"use strict";Object.defineProperty(vN,"__esModule",{value:!0});vN.joinPathSegments=void 0;function vat(t,e,r){return t.endsWith(r)?t+e:t+r+e}vN.joinPathSegments=vat});var _Te=y(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.readdir=au.readdirWithFileTypes=au.read=void 0;var bat=xf(),fTe=cTe(),Tat=K3(),pTe=J3(),hTe=X3();function wat(t,e,r){if(!e.stats&&Tat.IS_SUPPORT_READDIR_WITH_FILE_TYPES){mTe(t,e,r);return}gTe(t,e,r)}au.read=wat;function mTe(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){bN(r,n);return}let o=i.map(a=>({dirent:a,name:a.name,path:hTe.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){Q3(r,o);return}let s=o.map(a=>xat(a,e));fTe(s,(a,c)=>{if(a!==null){bN(r,a);return}Q3(r,c)})})}au.readdirWithFileTypes=mTe;function xat(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=pTe.fs.createDirentFromStats(t.name,i),r(null,t)})}}function gTe(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){bN(r,n);return}let o=i.map(s=>{let a=hTe.joinPathSegments(t,s,e.pathSegmentSeparator);return c=>{bat.stat(a,e.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let d={name:s,path:a,dirent:pTe.fs.createDirentFromStats(s,u)};e.stats&&(d.stats=u),c(null,d)})}});fTe(o,(s,a)=>{if(s!==null){bN(r,s);return}Q3(r,a)})})}au.readdir=gTe;function bN(t,e){t(e)}function Q3(t,e){t(null,e)}});var bTe=y(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.readdir=cu.readdirWithFileTypes=cu.read=void 0;var Aat=xf(),Rat=K3(),yTe=J3(),STe=X3();function Cat(t,e){return!e.stats&&Rat.IS_SUPPORT_READDIR_WITH_FILE_TYPES?ETe(t,e):vTe(t,e)}cu.read=Cat;function ETe(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:STe.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let o=e.fs.statSync(i.path);i.dirent=yTe.fs.createDirentFromStats(i.name,o)}catch(o){if(e.throwErrorOnBrokenSymbolicLink)throw o}return i})}cu.readdirWithFileTypes=ETe;function vTe(t,e){return e.fs.readdirSync(t).map(n=>{let i=STe.joinPathSegments(t,n,e.pathSegmentSeparator),o=Aat.statSync(i,e.fsStatSettings),s={name:n,path:i,dirent:yTe.fs.createDirentFromStats(n,o)};return e.stats&&(s.stats=o),s})}cu.readdir=vTe});var TTe=y(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.createFileSystemAdapter=lu.FILE_SYSTEM_ADAPTER=void 0;var n_=Z("fs");lu.FILE_SYSTEM_ADAPTER={lstat:n_.lstat,stat:n_.stat,lstatSync:n_.lstatSync,statSync:n_.statSync,readdir:n_.readdir,readdirSync:n_.readdirSync};function Iat(t){return t===void 0?lu.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},lu.FILE_SYSTEM_ADAPTER),t)}lu.createFileSystemAdapter=Iat});var wTe=y(tW=>{"use strict";Object.defineProperty(tW,"__esModule",{value:!0});var Pat=Z("path"),Oat=xf(),Nat=TTe(),eW=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=Nat.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Pat.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new Oat.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};tW.default=eW});var TN=y(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.Settings=uu.scandirSync=uu.scandir=void 0;var xTe=_Te(),kat=bTe(),rW=wTe();uu.Settings=rW.default;function Mat(t,e,r){if(typeof e=="function"){xTe.read(t,nW(),e);return}xTe.read(t,nW(e),r)}uu.scandir=Mat;function $at(t,e){let r=nW(e);return kat.read(t,r)}uu.scandirSync=$at;function nW(t={}){return t instanceof rW.default?t:new rW.default(t)}});var RTe=y((Kar,ATe)=>{"use strict";function Dat(t){var e=new t,r=e;function n(){var o=e;return o.next?e=o.next:(e=new t,r=e),o.next=null,o}function i(o){r.next=o,r=o}return{get:n,release:i}}ATe.exports=Dat});var ITe=y((Zar,iW)=>{"use strict";var Lat=RTe();function CTe(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=Lat(Uat),i=null,o=null,s=0,a=null,c={push:m,drain:si,saturated:si,pause:u,paused:!1,get concurrency(){return r},set concurrency(k){if(!(k>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=k,!c.paused)for(;i&&s<r;)s++,_()},running:l,resume:p,idle:h,length:d,getQueue:f,unshift:g,empty:si,kill:v,killAndDrain:T,error:A,abort:b};return c;function l(){return s}function u(){c.paused=!0}function d(){for(var k=i,P=0;k;)k=k.next,P++;return P}function f(){for(var k=i,P=[];k;)P.push(k.value),k=k.next;return P}function p(){if(c.paused){if(c.paused=!1,i===null){s++,_();return}for(;i&&s<r;)s++,_()}}function h(){return s===0&&c.length()===0}function m(k,P){var N=n.get();N.context=t,N.release=_,N.value=k,N.callback=P||si,N.errorHandler=a,s>=r||c.paused?o?(o.next=N,o=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function g(k,P){var N=n.get();N.context=t,N.release=_,N.value=k,N.callback=P||si,N.errorHandler=a,s>=r||c.paused?i?(N.next=i,i=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function _(k){k&&n.release(k);var P=i;P&&s<=r?c.paused?s--:(o===i&&(o=null),i=P.next,P.next=null,e.call(t,P.value,P.worked),o===null&&c.empty()):--s===0&&c.drain()}function v(){i=null,o=null,c.drain=si}function T(){i=null,o=null,c.drain(),c.drain=si}function b(){var k=i;for(i=null,o=null;k;){var P=k.next,N=k.callback,D=k.errorHandler,F=k.value,E=k.context;k.value=null,k.callback=si,k.errorHandler=null,D&&D(new Error("abort"),F),N.call(E,new Error("abort")),k.release(k),k=P}c.drain=si}function A(k){a=k}}function si(){}function Uat(){this.value=null,this.callback=si,this.next=null,this.release=si,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,o=t.errorHandler,s=t.value;t.value=null,t.callback=si,t.errorHandler&&o(r,s),i.call(t.context,r,n),t.release(t)}}function Fat(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=CTe(t,n,r),o=i.push,s=i.unshift;return i.push=a,i.unshift=c,i.drained=l,i;function a(u){var d=new Promise(function(f,p){o(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(si),d}function c(u){var d=new Promise(function(f,p){s(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(si),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}}iW.exports=CTe;iW.exports.promise=Fat});var wN=y(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.joinPathSegments=ea.replacePathSegmentSeparator=ea.isAppliedFilter=ea.isFatalError=void 0;function zat(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}ea.isFatalError=zat;function jat(t,e){return t===null||t(e)}ea.isAppliedFilter=jat;function Bat(t,e){return t.split(/[/\\]/).join(e)}ea.replacePathSegmentSeparator=Bat;function qat(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}ea.joinPathSegments=qat});var aW=y(sW=>{"use strict";Object.defineProperty(sW,"__esModule",{value:!0});var Vat=wN(),oW=class{constructor(e,r){this._root=e,this._settings=r,this._root=Vat.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};sW.default=oW});var uW=y(lW=>{"use strict";Object.defineProperty(lW,"__esModule",{value:!0});var Gat=Z("events"),Hat=TN(),Wat=ITe(),xN=wN(),Yat=aW(),cW=class extends Yat.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=Hat.scandir,this._emitter=new Gat.EventEmitter,this._queue=Wat(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 o of i)this._handleEntry(o,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!xN.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=xN.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),xN.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&xN.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};lW.default=cW});var PTe=y(fW=>{"use strict";Object.defineProperty(fW,"__esModule",{value:!0});var Kat=uW(),dW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Kat.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{Zat(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Jat(e,this._storage)}),this._reader.read()}};fW.default=dW;function Zat(t,e){t(e)}function Jat(t,e){t(null,e)}});var OTe=y(hW=>{"use strict";Object.defineProperty(hW,"__esModule",{value:!0});var Xat=Z("stream"),Qat=uW(),pW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Qat.default(this._root,this._settings),this._stream=new Xat.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}};hW.default=pW});var NTe=y(gW=>{"use strict";Object.defineProperty(gW,"__esModule",{value:!0});var ect=TN(),AN=wN(),tct=aW(),mW=class extends tct.default{constructor(){super(...arguments),this._scandir=ect.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(AN.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=AN.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),AN.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&AN.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};gW.default=mW});var kTe=y(yW=>{"use strict";Object.defineProperty(yW,"__esModule",{value:!0});var rct=NTe(),_W=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new rct.default(this._root,this._settings)}read(){return this._reader.read()}};yW.default=_W});var MTe=y(EW=>{"use strict";Object.defineProperty(EW,"__esModule",{value:!0});var nct=Z("path"),ict=TN(),SW=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,nct.sep),this.fsScandirSettings=new ict.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}};EW.default=SW});var CN=y(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.Settings=ta.walkStream=ta.walkSync=ta.walk=void 0;var $Te=PTe(),oct=OTe(),sct=kTe(),vW=MTe();ta.Settings=vW.default;function act(t,e,r){if(typeof e=="function"){new $Te.default(t,RN()).read(e);return}new $Te.default(t,RN(e)).read(r)}ta.walk=act;function cct(t,e){let r=RN(e);return new sct.default(t,r).read()}ta.walkSync=cct;function lct(t,e){let r=RN(e);return new oct.default(t,r).read()}ta.walkStream=lct;function RN(t={}){return t instanceof vW.default?t:new vW.default(t)}});var IN=y(TW=>{"use strict";Object.defineProperty(TW,"__esModule",{value:!0});var uct=Z("path"),dct=xf(),DTe=mc(),bW=class{constructor(e){this._settings=e,this._fsStatSettings=new dct.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return uct.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:DTe.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!DTe.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};TW.default=bW});var AW=y(xW=>{"use strict";Object.defineProperty(xW,"__esModule",{value:!0});var fct=Z("stream"),pct=xf(),hct=CN(),mct=IN(),wW=class extends mct.default{constructor(){super(...arguments),this._walkStream=hct.walkStream,this._stat=pct.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new fct.PassThrough({objectMode:!0});i._write=(o,s,a)=>this._getEntry(n[o],e[o],r).then(c=>{c!==null&&r.entryFilter(c)&&i.push(c),o===n.length-1&&i.end(),a()}).catch(a);for(let o=0;o<n.length;o++)i.write(o);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,o)=>i===null?r(o):n(i))})}};xW.default=wW});var LTe=y(CW=>{"use strict";Object.defineProperty(CW,"__esModule",{value:!0});var gct=CN(),_ct=IN(),yct=AW(),RW=class extends _ct.default{constructor(){super(...arguments),this._walkAsync=gct.walk,this._readerStream=new yct.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(o,s)=>{o===null?n(s):i(o)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((o,s)=>{i.once("error",s),i.on("data",a=>n.push(a)),i.once("end",()=>o(n))})}};CW.default=RW});var UTe=y(PW=>{"use strict";Object.defineProperty(PW,"__esModule",{value:!0});var zb=mc(),IW=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 zb.pattern.getPatternParts(e,this._micromatchOptions).map(n=>zb.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:zb.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return zb.array.splitWhen(e,r=>r.dynamic&&zb.pattern.hasGlobStar(r.pattern))}};PW.default=IW});var FTe=y(NW=>{"use strict";Object.defineProperty(NW,"__esModule",{value:!0});var Sct=UTe(),OW=class extends Sct.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(o=>!o.complete||o.segments.length>n);for(let o of i){let s=o.sections[0];if(!o.complete&&n>s.length||r.every((c,l)=>{let u=o.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};NW.default=OW});var zTe=y(MW=>{"use strict";Object.defineProperty(MW,"__esModule",{value:!0});var PN=mc(),Ect=FTe(),kW=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),o=this._getNegativePatternsRe(n);return s=>this._filter(e,s,i,o)}_getMatcher(e){return new Ect.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(PN.pattern.isAffectDepthOfReadingPattern);return PN.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let o=PN.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(o,n)?!1:this._isSkippedByNegativePatterns(o,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!PN.pattern.matchAny(e,r)}};MW.default=kW});var jTe=y(DW=>{"use strict";Object.defineProperty(DW,"__esModule",{value:!0});var du=mc(),$W=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=du.pattern.partitionAbsoluteAndRelative(r),o={positive:{all:du.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:du.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:du.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,o)}_filter(e,r){let n=du.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=du.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=du.pattern.matchAny(e,r);return!i&&n?du.pattern.matchAny(e+"/",r):i}};DW.default=$W});var BTe=y(UW=>{"use strict";Object.defineProperty(UW,"__esModule",{value:!0});var vct=mc(),LW=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return vct.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};UW.default=LW});var VTe=y(zW=>{"use strict";Object.defineProperty(zW,"__esModule",{value:!0});var qTe=mc(),FW=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=qTe.path.makeAbsolute(this._settings.cwd,r),r=qTe.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};zW.default=FW});var ON=y(BW=>{"use strict";Object.defineProperty(BW,"__esModule",{value:!0});var bct=Z("path"),Tct=zTe(),wct=jTe(),xct=BTe(),Act=VTe(),jW=class{constructor(e){this._settings=e,this.errorFilter=new xct.default(this._settings),this.entryFilter=new wct.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Tct.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new Act.default(this._settings)}_getRootDirectory(e){return bct.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}}};BW.default=jW});var GTe=y(VW=>{"use strict";Object.defineProperty(VW,"__esModule",{value:!0});var Rct=LTe(),Cct=ON(),qW=class extends Cct.default{constructor(){super(...arguments),this._reader=new Rct.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(o=>n.transform(o))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};VW.default=qW});var HTe=y(HW=>{"use strict";Object.defineProperty(HW,"__esModule",{value:!0});var Ict=Z("stream"),Pct=AW(),Oct=ON(),GW=class extends Oct.default{constructor(){super(...arguments),this._reader=new Pct.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),o=new Ict.Readable({objectMode:!0,read:()=>{}});return i.once("error",s=>o.emit("error",s)).on("data",s=>o.emit("data",n.transform(s))).once("end",()=>o.emit("end")),o.once("close",()=>i.destroy()),o}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};HW.default=GW});var WTe=y(YW=>{"use strict";Object.defineProperty(YW,"__esModule",{value:!0});var Nct=xf(),kct=CN(),Mct=IN(),WW=class extends Mct.default{constructor(){super(...arguments),this._walkSync=kct.walkSync,this._statSync=Nct.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let o=this._getFullEntryPath(i),s=this._getEntry(o,i,r);s===null||!r.entryFilter(s)||n.push(s)}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)}};YW.default=WW});var YTe=y(ZW=>{"use strict";Object.defineProperty(ZW,"__esModule",{value:!0});var $ct=WTe(),Dct=ON(),KW=class extends Dct.default{constructor(){super(...arguments),this._reader=new $ct.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)}};ZW.default=KW});var KTe=y(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});o_.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var i_=Z("fs"),Lct=Z("os"),Uct=Math.max(Lct.cpus().length,1);o_.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:i_.lstat,lstatSync:i_.lstatSync,stat:i_.stat,statSync:i_.statSync,readdir:i_.readdir,readdirSync:i_.readdirSync};var JW=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,Uct),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({},o_.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};o_.default=JW});var jb=y((vcr,JTe)=>{"use strict";var ZTe=Jbe(),Fct=GTe(),zct=HTe(),jct=YTe(),XW=KTe(),oo=mc();async function QW(t,e){Zo(t);let r=eY(t,Fct.default,e),n=await Promise.all(r);return oo.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(l,u){Zo(l);let d=eY(l,jct.default,u);return oo.array.flatten(d)}t.sync=e;function r(l,u){Zo(l);let d=eY(l,zct.default,u);return oo.stream.merge(d)}t.stream=r;function n(l,u){Zo(l);let d=[].concat(l),f=new XW.default(u);return ZTe.generate(d,f)}t.generateTasks=n;function i(l,u){Zo(l);let d=new XW.default(u);return oo.pattern.isDynamicPattern(l,d)}t.isDynamicPattern=i;function o(l){return Zo(l),oo.path.escape(l)}t.escapePath=o;function s(l){return Zo(l),oo.path.convertPathToPattern(l)}t.convertPathToPattern=s;let a;(function(l){function u(f){return Zo(f),oo.path.escapePosixPath(f)}l.escapePath=u;function d(f){return Zo(f),oo.path.convertPosixPathToPattern(f)}l.convertPathToPattern=d})(a=t.posix||(t.posix={}));let c;(function(l){function u(f){return Zo(f),oo.path.escapeWindowsPath(f)}l.escapePath=u;function d(f){return Zo(f),oo.path.convertWindowsPathToPattern(f)}l.convertPathToPattern=d})(c=t.win32||(t.win32={}))})(QW||(QW={}));function eY(t,e,r){let n=[].concat(t),i=new XW.default(r),o=ZTe.generate(n,i),s=new e(i);return o.map(s.read,s)}function Zo(t){if(![].concat(t).every(n=>oo.string.isString(n)&&!oo.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}JTe.exports=QW});var lY=y((Icr,MN)=>{"use strict";function rwe(t){return Array.isArray(t)?t:[t]}var Vct=void 0,iY="",ewe=" ",nY="\\",Gct=/^\s+$/,Hct=/(?:[^\\]|^)\\$/,Wct=/^\\!/,Yct=/^\\#/,Kct=/\r?\n/g,Zct=/^\.{0,2}\/|^\.{1,2}$/,Jct=/\/$/,s_="/",nwe="node-ignore";typeof Symbol<"u"&&(nwe=Symbol.for("node-ignore"));var iwe=nwe,a_=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),Xct=/([0-z])-([0-z])/g,owe=()=>!1,Qct=t=>t.replace(Xct,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:iY),elt=t=>{let{length:e}=t;return t.slice(0,e-e%2)},tlt=[[/^\uFEFF/,()=>iY],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?ewe:iY)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+ewe}],[/[\\$.|*+(){^]/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,()=>nY],[/\\\\/g,()=>nY],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===nY?`\\[${r}${elt(n)}${i}`:i==="]"&&n.length%2===0?`[${Qct(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],rlt=/(^|\\\/)?\\\*$/,Bb="regex",NN="checkRegex",twe="_",nlt={[Bb](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[NN](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},ilt=t=>tlt.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),kN=t=>typeof t=="string",olt=t=>t&&kN(t)&&!Gct.test(t)&&!Hct.test(t)&&t.indexOf("#")!==0,slt=t=>t.split(Kct).filter(Boolean),oY=class{constructor(e,r,n,i,o,s){this.pattern=e,this.mark=r,this.negative=o,a_(this,"body",n),a_(this,"ignoreCase",i),a_(this,"regexPrefix",s)}get regex(){let e=twe+Bb;return this[e]?this[e]:this._make(Bb,e)}get checkRegex(){let e=twe+NN;return this[e]?this[e]:this._make(NN,e)}_make(e,r){let n=this.regexPrefix.replace(rlt,nlt[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return a_(this,r,i)}},alt=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(Wct,"!").replace(Yct,"#");let o=ilt(i);return new oY(t,e,i,r,n,o)},sY=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[iwe]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(kN(e)&&(e={pattern:e}),olt(e.pattern)){let r=alt(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,rwe(kN(e)?slt(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,o=!1,s;this._rules.forEach(c=>{let{negative:l}=c;o===l&&i!==o||l&&!i&&!o&&!r||!c[n].test(e)||(i=!l,o=l,s=l?Vct:c)});let a={ignored:i,unignored:o};return s&&(a.rule=s),a}},clt=(t,e)=>{throw new e(t)},gc=(t,e,r)=>kN(t)?t?gc.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),swe=t=>Zct.test(t);gc.isNotRelative=swe;gc.convert=t=>t;var aY=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){a_(this,iwe,!0),this._rules=new sY(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 o=e&&gc.convert(e);return gc(o,e,this._strictPathCheck?clt:owe),this._t(o,r,n,i)}checkIgnore(e){if(!Jct.test(e))return this.test(e);let r=e.split(s_).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(s_)+s_,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,NN)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(s_).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,Bb);let o=this._t(i.join(s_)+s_,r,n,i);return r[e]=o.ignored?o:this._rules.test(e,n,Bb)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return rwe(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},cY=t=>new aY(t),llt=t=>gc(t&&gc.convert(t),t,owe),awe=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");gc.convert=t;let e=/^[a-z]:\//i;gc.isNotRelative=r=>e.test(r)||swe(r)};typeof process<"u"&&process.platform==="win32"&&awe();MN.exports=cY;cY.default=cY;MN.exports.isPathValid=llt;a_(MN.exports,Symbol.for("setupWindows"),awe)});var BY=y(aAe=>{"use strict";aAe.parse=function(t,e){return new jY(t,e).parse()};var jY=class t{constructor(e,r){this.source=e,this.transform=r||Ldt,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 Ldt(t){return t}});var qY=y((Gfr,cAe)=>{"use strict";var Udt=BY();cAe.exports={create:function(t,e){return{parse:function(){return Udt.parse(t,e)}}}}});var dAe=y((Hfr,uAe)=>{"use strict";var Fdt=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,zdt=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,jdt=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Bdt=/^-?infinity$/;uAe.exports=function(e){if(Bdt.test(e))return Number(e.replace("i","I"));var r=Fdt.exec(e);if(!r)return qdt(e)||null;var n=!!r[8],i=parseInt(r[1],10);n&&(i=lAe(i));var o=parseInt(r[2],10)-1,s=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=Vdt(e);return f!=null?(d=new Date(Date.UTC(i,o,s,a,c,l,u)),VY(i)&&d.setUTCFullYear(i),f!==0&&d.setTime(d.getTime()-f)):(d=new Date(i,o,s,a,c,l,u),VY(i)&&d.setFullYear(i)),d};function qdt(t){var e=zdt.exec(t);if(e){var r=parseInt(e[1],10),n=!!e[4];n&&(r=lAe(r));var i=parseInt(e[2],10)-1,o=e[3],s=new Date(r,i,o);return VY(r)&&s.setFullYear(r),s}}function Vdt(t){if(t.endsWith("+00"))return 0;var e=jdt.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 lAe(t){return-(t-1)}function VY(t){return t>=0&&t<100}});var pAe=y((Wfr,fAe)=>{"use strict";fAe.exports=Hdt;var Gdt=Object.prototype.hasOwnProperty;function Hdt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Gdt.call(r,n)&&(t[n]=r[n])}return t}});var gAe=y((Yfr,mAe)=>{"use strict";var Wdt=pAe();mAe.exports=__;function __(t){if(!(this instanceof __))return new __(t);Wdt(this,oft(t))}var Ydt=["seconds","minutes","hours","days","months","years"];__.prototype.toPostgres=function(){var t=Ydt.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 Kdt={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},Zdt=["years","months","days"],Jdt=["hours","minutes","seconds"];__.prototype.toISOString=__.prototype.toISO=function(){var t=Zdt.map(r,this).join(""),e=Jdt.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+Kdt[n]}};var GY="([+-]?\\d+)",Xdt=GY+"\\s+years?",Qdt=GY+"\\s+mons?",eft=GY+"\\s+days?",tft="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",rft=new RegExp([Xdt,Qdt,eft,tft].map(function(t){return"("+t+")?"}).join("\\s*")),hAe={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},nft=["hours","minutes","seconds","milliseconds"];function ift(t){var e=t+"000000".slice(t.length);return parseInt(e,10)/1e3}function oft(t){if(!t)return{};var e=rft.exec(t),r=e[8]==="-";return Object.keys(hAe).reduce(function(n,i){var o=hAe[i],s=e[o];return!s||(s=i==="milliseconds"?ift(s):parseInt(s,10),!s)||(r&&~nft.indexOf(i)&&(s*=-1),n[i]=s),n},{})}});var SAe=y((Kfr,yAe)=>{"use strict";var _Ae=Buffer.from||Buffer;yAe.exports=function(e){if(/^\\x/.test(e))return _Ae(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 o=0;o<Math.floor(i/2);++o)r+="\\";n+=Math.floor(i/2)*2}return _Ae(r,"binary")}});var AAe=y((Zfr,xAe)=>{"use strict";var Qb=BY(),eT=qY(),YN=dAe(),vAe=gAe(),bAe=SAe();function KN(t){return function(r){return r===null?r:t(r)}}function TAe(t){return t===null?t:t==="TRUE"||t==="t"||t==="true"||t==="y"||t==="yes"||t==="on"||t==="1"}function sft(t){return t?Qb.parse(t,TAe):null}function aft(t){return parseInt(t,10)}function HY(t){return t?Qb.parse(t,KN(aft)):null}function cft(t){return t?Qb.parse(t,KN(function(e){return wAe(e).trim()})):null}var lft=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=ZY(r)),r});return e.parse()},WY=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=parseFloat(r)),r});return e.parse()},so=function(t){if(!t)return null;var e=eT.create(t);return e.parse()},YY=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=YN(r)),r});return e.parse()},uft=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=vAe(r)),r});return e.parse()},dft=function(t){return t?Qb.parse(t,KN(bAe)):null},KY=function(t){return parseInt(t,10)},wAe=function(t){var e=String(t);return/^\d+$/.test(e)?e:t},EAe=function(t){return t?Qb.parse(t,KN(JSON.parse)):null},ZY=function(t){return t[0]!=="("?null:(t=t.substring(1,t.length-1).split(","),{x:parseFloat(t[0]),y:parseFloat(t[1])})},fft=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 o=ZY(e);return o.radius=parseFloat(r),o},pft=function(t){t(20,wAe),t(21,KY),t(23,KY),t(26,KY),t(700,parseFloat),t(701,parseFloat),t(16,TAe),t(1082,YN),t(1114,YN),t(1184,YN),t(600,ZY),t(651,so),t(718,fft),t(1e3,sft),t(1001,dft),t(1005,HY),t(1007,HY),t(1028,HY),t(1016,cft),t(1017,lft),t(1021,WY),t(1022,WY),t(1231,WY),t(1014,so),t(1015,so),t(1008,so),t(1009,so),t(1040,so),t(1041,so),t(1115,YY),t(1182,YY),t(1185,YY),t(1186,vAe),t(1187,uft),t(17,bAe),t(114,JSON.parse.bind(JSON)),t(3802,JSON.parse.bind(JSON)),t(199,EAe),t(3807,EAe),t(3907,so),t(2951,so),t(791,so),t(1183,so),t(1270,so)};xAe.exports={init:pft}});var CAe=y((Jfr,RAe)=>{"use strict";var ai=1e6;function hft(t){var e=t.readInt32BE(0),r=t.readUInt32BE(4),n="";e<0&&(e=~e+(r===0),r=~r+1>>>0,n="-");var i="",o,s,a,c,l,u;{if(o=e%ai,e=e/ai>>>0,s=4294967296*o+r,r=s/ai>>>0,a=""+(s-ai*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(o=e%ai,e=e/ai>>>0,s=4294967296*o+r,r=s/ai>>>0,a=""+(s-ai*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(o=e%ai,e=e/ai>>>0,s=4294967296*o+r,r=s/ai>>>0,a=""+(s-ai*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 o=e%ai,s=4294967296*o+r,a=""+s%ai,n+a+i}RAe.exports=hft});var kAe=y((Xfr,NAe)=>{"use strict";var mft=CAe(),Zt=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 o=r>>3,s=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,s(t[o])&a,c));for(var u=e+r>>3,d=o+1;d<u;d++)l=i(l,s(t[d]),8);var f=(e+r)%8;return f>0&&(l=i(l,s(t[u])>>8-f,f)),l},OAe=function(t,e,r){var n=Math.pow(2,r-1)-1,i=Zt(t,1),o=Zt(t,r,1);if(o===0)return 0;var s=1,a=function(l,u,d){l===0&&(l=1);for(var f=1;f<=d;f++)s/=2,(u&1<<d-f)>0&&(l+=s);return l},c=Zt(t,e,r+1,!1,a);return o==Math.pow(2,r+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,o-n)*c},gft=function(t){return Zt(t,1)==1?-1*(Zt(t,15,1,!0)+1):Zt(t,15,1)},IAe=function(t){return Zt(t,1)==1?-1*(Zt(t,31,1,!0)+1):Zt(t,31,1)},_ft=function(t){return OAe(t,23,8)},yft=function(t){return OAe(t,52,11)},Sft=function(t){var e=Zt(t,16,32);if(e==49152)return NaN;for(var r=Math.pow(1e4,Zt(t,16,16)),n=0,i=[],o=Zt(t,16),s=0;s<o;s++)n+=Zt(t,16,64+16*s)*r,r/=1e4;var a=Math.pow(10,Zt(t,16,48));return(e===0?1:-1)*Math.round(n*a)/a},PAe=function(t,e){var r=Zt(e,1),n=Zt(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(o){this.usec=o},i.getUTCMicroSeconds=function(){return this.usec},i},tT=function(t){for(var e=Zt(t,32),r=Zt(t,32,32),n=Zt(t,32,64),i=96,o=[],s=0;s<e;s++)o[s]=Zt(t,32,i),i+=32,i+=32;var a=function(l){var u=Zt(t,32,i);if(i+=32,u==4294967295)return null;var d;if(l==23||l==20)return d=Zt(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(o,n)},Eft=function(t){return t.toString("utf8")},vft=function(t){return t===null?null:Zt(t,8)>0},bft=function(t){t(20,mft),t(21,gft),t(23,IAe),t(26,IAe),t(1700,Sft),t(700,_ft),t(701,yft),t(16,vft),t(1114,PAe.bind(null,!1)),t(1184,PAe.bind(null,!0)),t(1e3,tT),t(1007,tT),t(1016,tT),t(1008,tT),t(1009,tT),t(25,Eft)};NAe.exports={init:bft}});var $Ae=y((Qfr,MAe)=>{"use strict";MAe.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 iT=y(nT=>{"use strict";var Tft=AAe(),wft=kAe(),xft=qY(),Aft=$Ae();nT.getTypeParser=Rft;nT.setTypeParser=Cft;nT.arrayParser=xft;nT.builtins=Aft;var rT={text:{},binary:{}};function DAe(t){return String(t)}function Rft(t,e){return e=e||"text",rT[e]&&rT[e][t]||DAe}function Cft(t,e,r){typeof e=="function"&&(r=e,e="text"),rT[e][t]=r}Tft.init(function(t,e){rT.text[t]=e});wft.init(function(t,e){rT.binary[t]=e})});var oT=y((tpr,JY)=>{"use strict";var LAe;try{LAe=process.platform==="win32"?process.env.USERNAME:process.env.USER}catch{}JY.exports={host:"localhost",user:LAe,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 y_=iT(),Ift=y_.getTypeParser(20,"text"),Pft=y_.getTypeParser(1016,"text");JY.exports.__defineSetter__("parseInt8",function(t){y_.setTypeParser(20,"text",t?y_.getTypeParser(23,"text"):Ift),y_.setTypeParser(1016,"text",t?y_.getTypeParser(1007,"text"):Pft)})});var S_=y((rpr,FAe)=>{"use strict";var Oft=oT(),{isDate:Nft}=Z("util/types");function kft(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function UAe(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+=UAe(n):ArrayBuffer.isView(n)?(n instanceof Buffer||(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),e+="\\\\x"+n.toString("hex")):e+=kft(ZN(n))}return e+="}",e}var ZN=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):Nft(t)?Oft.parseInputDatesAsUTC?Dft(t):$ft(t):Array.isArray(t)?UAe(t):Mft(t,e):t.toString()};function Mft(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),ZN(t.toPostgres(ZN),e)}return JSON.stringify(t)}function $ft(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 Dft(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 Lft(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 Uft=function(t){return'"'+t.replace(/"/g,'""')+'"'},Fft=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};FAe.exports={prepareValue:function(e){return ZN(e)},normalizeQueryConfig:Lft,escapeIdentifier:Uft,escapeLiteral:Fft}});var eK=y((npr,BAe)=>{"use strict";var zAe=Z("crypto");BAe.exports={postgresMd5PasswordHash:jft,randomBytes:zft,deriveKey:Gft,sha256:Bft,hashByName:qft,hmacSha256:Vft,md5:XY};var jAe=zAe.webcrypto||globalThis.crypto,Cf=jAe.subtle,QY=new TextEncoder;function zft(t){return jAe.getRandomValues(Buffer.alloc(t))}async function XY(t){try{return zAe.createHash("md5").update(t,"utf-8").digest("hex")}catch{let r=typeof t=="string"?QY.encode(t):t,n=await Cf.digest("MD5",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}}async function jft(t,e,r){let n=await XY(e+t);return"md5"+await XY(Buffer.concat([Buffer.from(n),r]))}async function Bft(t){return await Cf.digest("SHA-256",t)}async function qft(t,e){return await Cf.digest(t,e)}async function Vft(t,e){let r=await Cf.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await Cf.sign("HMAC",r,QY.encode(e))}async function Gft(t,e,r){let n=await Cf.importKey("raw",QY.encode(t),"PBKDF2",!1,["deriveBits"]),i={name:"PBKDF2",hash:"SHA-256",salt:e,iterations:r};return await Cf.deriveBits(i,n,256,["deriveBits"])}});var GAe=y((ipr,VAe)=>{"use strict";function If(t,e){return new Error("SASL channel binding: "+t+" when parsing public certificate "+e.toString("base64"))}function tK(t,e){let r=t[e++];if(r<128)return{length:r,index:e};let n=r&127;if(n>4)throw If("bad length",t);r=0;for(let i=0;i<n;i++)r=r<<8|t[e++];return{length:r,index:e}}function qAe(t,e){if(t[e++]!==6)throw If("non-OID data",t);let{length:r,index:n}=tK(t,e);e=n;let i=e+r,o=t[e++],s=(o/40>>0)+"."+o%40;for(;e<i;){let a=0;for(;e<i;){let c=t[e++];if(a=a<<7|c&127,c<128)break}s+="."+a}return{oid:s,index:e}}function sT(t,e){if(t[e++]!==48)throw If("non-sequence data",t);return tK(t,e)}function Hft(t,e){e===void 0&&(e=0),e=sT(t,e).index;let{length:r,index:n}=sT(t,e);e=n+r,e=sT(t,e).index;let{oid:i,index:o}=qAe(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=o,e=sT(t,e).index,t[e++]!==160)throw If("non-tag data",t);e=tK(t,e).index,e=sT(t,e).index;let{oid:s}=qAe(t,e);switch(s){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 If("unknown hash OID "+s,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 If("Ed448 certificate channel binding is not currently supported by Postgres")}throw If("unknown OID "+i,t)}VAe.exports={signatureAlgorithmHashFromCertificate:Hft}});var KAe=y((opr,YAe)=>{"use strict";var hu=eK(),{signatureAlgorithmHashFromCertificate:Wft}=GAe();function Yft(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 rK=1e5;function Kft(t,e,r=rK){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 o=hu.randomBytes(18).toString("base64");return{mechanism:i,clientNonce:o,response:(i==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":e?"y":"n")+",,n=*,r="+o,message:"SASLInitialResponse",scramMaxIterations:r}}async function Zft(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=Qft(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 o=typeof t.scramMaxIterations=="number"?t.scramMaxIterations:rK;if(o!==0&&i.iteration>o)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count "+i.iteration+" exceeds scramMaxIterations of "+o);let s="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 T=n.getPeerCertificate().raw,b=Wft(T);(b==="MD5"||b==="SHA-1")&&(b="SHA-256");let A=await hu.hashByName(b,T);c=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(A)]).toString("base64")}let l="c="+c+",r="+i.nonce,u=s+","+a+","+l,d=Buffer.from(i.salt,"base64"),f=await hu.deriveKey(Yft(e),d,i.iteration),p=await hu.hmacSha256(f,"Client Key"),h=await hu.sha256(p),m=await hu.hmacSha256(h,u),g=tpt(Buffer.from(p),Buffer.from(m)).toString("base64"),_=await hu.hmacSha256(f,"Server Key"),v=await hu.hmacSha256(_,u);t.message="SASLResponse",t.serverSignature=Buffer.from(v).toString("base64"),t.response=l+",p="+g}function Jft(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}=ept(e);if(r!==t.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function Xft(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 HAe(t){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(t)}function WAe(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 Qft(t){let e=WAe(t),r=e.get("r");if(r){if(!Xft(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(!HAe(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 o=parseInt(i,10);return{nonce:r,salt:n,iteration:o}}function ept(t){let e=WAe(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(!HAe(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 tpt(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]))}YAe.exports={startSession:Kft,continueSession:Zft,finalizeSession:Jft,DEFAULT_MAX_SCRAM_ITERATIONS:rK}});var XN=y((spr,ZAe)=>{"use strict";var rpt=iT();function JN(t){this._types=t||rpt,this.text={},this.binary={}}JN.prototype.getOverrides=function(t){switch(t){case"text":return this.text;case"binary":return this.binary;default:return{}}};JN.prototype.setTypeParser=function(t,e,r){typeof e=="function"&&(r=e,e="text"),this.getOverrides(e)[t]=r};JN.prototype.getTypeParser=function(t,e){return e=e||"text",this.getOverrides(e)[t]||this._types.getTypeParser(t,e)};ZAe.exports=JN});var QAe=y((apr,XAe)=>{"use strict";function E_(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 o=i?"":n.hostname;r.host?o&&/^%2f/i.test(o)&&(n.pathname=o+n.pathname):r.host=decodeURIComponent(o),r.port||(r.port=n.port);let s=n.pathname.slice(1)||null;r.database=s?decodeURI(s):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?Z("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"&&nK(r.sslmode);break}case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}function npt(t){return Object.entries(t).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),Object.create(null))}function JAe(t){return Object.entries(t).reduce((r,[n,i])=>{if(n==="ssl"){let o=i;typeof o=="boolean"&&(r[n]=o),typeof o=="object"&&(r[n]=npt(o))}else if(i!=null)if(n==="port"){if(i!==""){let o=parseInt(i,10);if(isNaN(o))throw new Error(`Invalid ${n}: ${i}`);r[n]=o}}else r[n]=i;return r},Object.create(null))}function ipt(t){return JAe(E_(t))}function nK(t){!nK.warned&&typeof process<"u"&&process.emitWarning&&(nK.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
31
|
+
`,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 ebe=y((_ar,Qve)=>{"use strict";var Eot=aN(),{MAX_LENGTH:Zve,CHAR_BACKSLASH:w3,CHAR_BACKTICK:vot,CHAR_COMMA:bot,CHAR_DOT:Tot,CHAR_LEFT_PARENTHESES:wot,CHAR_RIGHT_PARENTHESES:xot,CHAR_LEFT_CURLY_BRACE:Aot,CHAR_RIGHT_CURLY_BRACE:Rot,CHAR_LEFT_SQUARE_BRACKET:Jve,CHAR_RIGHT_SQUARE_BRACKET:Xve,CHAR_DOUBLE_QUOTE:Cot,CHAR_SINGLE_QUOTE:Iot,CHAR_NO_BREAK_SPACE:Pot,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Oot}=Kve(),Not=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Zve,r.maxLength):Zve;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},o=[i],s=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 s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(h({type:"bos"});u<l;)if(s=o[o.length-1],f=p(),!(f===Oot||f===Pot)){if(f===w3){h({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===Xve){h({type:"text",value:"\\"+f});continue}if(f===Jve){c++;let m;for(;u<l&&(m=p());){if(f+=m,m===Jve){c++;continue}if(m===w3){f+=p();continue}if(m===Xve&&(c--,c===0))break}h({type:"text",value:f});continue}if(f===wot){s=h({type:"paren",nodes:[]}),o.push(s),h({type:"text",value:f});continue}if(f===xot){if(s.type!=="paren"){h({type:"text",value:f});continue}s=o.pop(),h({type:"text",value:f}),s=o[o.length-1];continue}if(f===Cot||f===Iot||f===vot){let m=f,g;for(e.keepQuotes!==!0&&(f="");u<l&&(g=p());){if(g===w3){f+=g+p();continue}if(g===m){e.keepQuotes===!0&&(f+=g);break}f+=g}h({type:"text",value:f});continue}if(f===Aot){d++;let g={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};s=h(g),o.push(s),h({type:"open",value:f});continue}if(f===Rot){if(s.type!=="brace"){h({type:"text",value:f});continue}let m="close";s=o.pop(),s.close=!0,h({type:m,value:f}),d--,s=o[o.length-1];continue}if(f===bot&&d>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:Eot(s)}]}h({type:"comma",value:f}),s.commas++;continue}if(f===Tot&&d>0&&s.commas===0){let m=s.nodes;if(d===0||m.length===0){h({type:"text",value:f});continue}if(a.type==="dot"){if(s.range=[],a.value+=f,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let g=m[m.length-1];g.value+=a.value+f,a=g,s.ranges--;continue}h({type:"dot",value:f});continue}h({type:"text",value:f})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(_=>{_.nodes||(_.type==="open"&&(_.isOpen=!0),_.type==="close"&&(_.isClose=!0),_.nodes||(_.type="text"),_.invalid=!0)});let m=o[o.length-1],g=m.nodes.indexOf(s);m.nodes.splice(g,1,...s.nodes)}while(o.length>0);return h({type:"eos"}),i};Qve.exports=Not});var nbe=y((yar,rbe)=>{"use strict";var tbe=aN(),kot=Vve(),Mot=Wve(),$ot=ebe(),Ci=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=Ci.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(Ci.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Ci.parse=(t,e={})=>$ot(t,e);Ci.stringify=(t,e={})=>tbe(typeof t=="string"?Ci.parse(t,e):t,e);Ci.compile=(t,e={})=>(typeof t=="string"&&(t=Ci.parse(t,e)),kot(t,e));Ci.expand=(t,e={})=>{typeof t=="string"&&(t=Ci.parse(t,e));let r=Mot(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Ci.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Ci.compile(t,e):Ci.expand(t,e);rbe.exports=Ci});var Db=y((Sar,cbe)=>{"use strict";var Dot=Z("path"),Xs="\\\\/",ibe=`[^${Xs}]`,Lot=0,hc="\\.",Uot="\\+",Fot="\\?",uN="\\/",zot="(?=.)",obe="[^/]",x3=`(?:${uN}|$)`,sbe=`(?:^|${uN})`,A3=`${hc}{1,2}${x3}`,jot=`(?!${hc})`,Bot=`(?!${sbe}${A3})`,qot=`(?!${hc}{0,1}${x3})`,Vot=`(?!${A3})`,Got=`[^.${uN}]`,Hot=`${obe}*?`,abe={DOT_LITERAL:hc,PLUS_LITERAL:Uot,QMARK_LITERAL:Fot,SLASH_LITERAL:uN,ONE_CHAR:zot,QMARK:obe,END_ANCHOR:x3,DOTS_SLASH:A3,NO_DOT:jot,NO_DOTS:Bot,NO_DOT_SLASH:qot,NO_DOTS_SLASH:Vot,QMARK_NO_DOT:Got,STAR:Hot,START_ANCHOR:sbe},Wot={...abe,SLASH_LITERAL:`[${Xs}]`,QMARK:ibe,STAR:`${ibe}*?`,DOTS_SLASH:`${hc}{1,2}(?:[${Xs}]|$)`,NO_DOT:`(?!${hc})`,NO_DOTS:`(?!(?:^|[${Xs}])${hc}{1,2}(?:[${Xs}]|$))`,NO_DOT_SLASH:`(?!${hc}{0,1}(?:[${Xs}]|$))`,NO_DOTS_SLASH:`(?!${hc}{1,2}(?:[${Xs}]|$))`,QMARK_NO_DOT:`[^.${Xs}]`,START_ANCHOR:`(?:^|[${Xs}])`,END_ANCHOR:`(?:[${Xs}]|$)`},Yot={__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"};cbe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Lot,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Yot,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:Dot.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?Wot:abe}}});var Lb=y(oi=>{"use strict";var Kot=Z("path"),Zot=process.platform==="win32",{REGEX_BACKSLASH:Jot,REGEX_REMOVE_BACKSLASH:Xot,REGEX_SPECIAL_CHARS:Qot,REGEX_SPECIAL_CHARS_GLOBAL:est}=Db();oi.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);oi.hasRegexChars=t=>Qot.test(t);oi.isRegexChar=t=>t.length===1&&oi.hasRegexChars(t);oi.escapeRegex=t=>t.replace(est,"\\$1");oi.toPosixSlashes=t=>t.replace(Jot,"/");oi.removeBackslashes=t=>t.replace(Xot,e=>e==="\\"?"":e);oi.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};oi.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Zot===!0||Kot.sep==="\\";oi.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?oi.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};oi.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};oi.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var gbe=y((bar,mbe)=>{"use strict";var lbe=Lb(),{CHAR_ASTERISK:R3,CHAR_AT:tst,CHAR_BACKWARD_SLASH:Ub,CHAR_COMMA:rst,CHAR_DOT:C3,CHAR_EXCLAMATION_MARK:I3,CHAR_FORWARD_SLASH:hbe,CHAR_LEFT_CURLY_BRACE:P3,CHAR_LEFT_PARENTHESES:O3,CHAR_LEFT_SQUARE_BRACKET:nst,CHAR_PLUS:ist,CHAR_QUESTION_MARK:ube,CHAR_RIGHT_CURLY_BRACE:ost,CHAR_RIGHT_PARENTHESES:dbe,CHAR_RIGHT_SQUARE_BRACKET:sst}=Db(),fbe=t=>t===hbe||t===Ub,pbe=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},ast=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,h=!1,m=!1,g=!1,_=!1,v=!1,T=!1,b=!1,A=!1,k=0,P,N,D={value:"",depth:0,isGlob:!1},F=()=>l>=n,E=()=>c.charCodeAt(l+1),oe=()=>(P=N,c.charCodeAt(++l));for(;l<n;){N=oe();let Y;if(N===Ub){v=D.backslashes=!0,N=oe(),N===P3&&(_=!0);continue}if(_===!0||N===P3){for(k++;F()!==!0&&(N=oe());){if(N===Ub){v=D.backslashes=!0,oe();continue}if(N===P3){k++;continue}if(_!==!0&&N===C3&&(N=oe())===C3){if(f=D.isBrace=!0,h=D.isGlob=!0,A=!0,i===!0)continue;break}if(_!==!0&&N===rst){if(f=D.isBrace=!0,h=D.isGlob=!0,A=!0,i===!0)continue;break}if(N===ost&&(k--,k===0)){_=!1,f=D.isBrace=!0,A=!0;break}}if(i===!0)continue;break}if(N===hbe){if(o.push(l),s.push(D),D={value:"",depth:0,isGlob:!1},A===!0)continue;if(P===C3&&l===u+1){u+=2;continue}d=l+1;continue}if(r.noext!==!0&&(N===ist||N===tst||N===R3||N===ube||N===I3)===!0&&E()===O3){if(h=D.isGlob=!0,m=D.isExtglob=!0,A=!0,N===I3&&l===u&&(b=!0),i===!0){for(;F()!==!0&&(N=oe());){if(N===Ub){v=D.backslashes=!0,N=oe();continue}if(N===dbe){h=D.isGlob=!0,A=!0;break}}continue}break}if(N===R3){if(P===R3&&(g=D.isGlobstar=!0),h=D.isGlob=!0,A=!0,i===!0)continue;break}if(N===ube){if(h=D.isGlob=!0,A=!0,i===!0)continue;break}if(N===nst){for(;F()!==!0&&(Y=oe());){if(Y===Ub){v=D.backslashes=!0,oe();continue}if(Y===sst){p=D.isBracket=!0,h=D.isGlob=!0,A=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&N===I3&&l===u){T=D.negated=!0,u++;continue}if(r.noparen!==!0&&N===O3){if(h=D.isGlob=!0,i===!0){for(;F()!==!0&&(N=oe());){if(N===O3){v=D.backslashes=!0,N=oe();continue}if(N===dbe){A=!0;break}}continue}break}if(h===!0){if(A=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,h=!1);let M=c,S="",w="";u>0&&(S=c.slice(0,u),c=c.slice(u),d-=u),M&&h===!0&&d>0?(M=c.slice(0,d),w=c.slice(d)):h===!0?(M="",w=c):M=c,M&&M!==""&&M!=="/"&&M!==c&&fbe(M.charCodeAt(M.length-1))&&(M=M.slice(0,-1)),r.unescape===!0&&(w&&(w=lbe.removeBackslashes(w)),M&&v===!0&&(M=lbe.removeBackslashes(M)));let O={prefix:S,input:t,start:u,base:M,glob:w,isBrace:f,isBracket:p,isGlob:h,isExtglob:m,isGlobstar:g,negated:T,negatedExtglob:b};if(r.tokens===!0&&(O.maxDepth=0,fbe(N)||s.push(D),O.tokens=s),r.parts===!0||r.tokens===!0){let Y;for(let H=0;H<o.length;H++){let he=Y?Y+1:u,je=o[H],Ie=t.slice(he,je);r.tokens&&(H===0&&u!==0?(s[H].isPrefix=!0,s[H].value=S):s[H].value=Ie,pbe(s[H]),O.maxDepth+=s[H].depth),(H!==0||Ie!=="")&&a.push(Ie),Y=je}if(Y&&Y+1<t.length){let H=t.slice(Y+1);a.push(H),r.tokens&&(s[s.length-1].value=H,pbe(s[s.length-1]),O.maxDepth+=s[s.length-1].depth)}O.slashes=o,O.parts=a}return O};mbe.exports=ast});var vbe=y((Tar,Ebe)=>{"use strict";var Fb=Db(),yn=Lb(),{MAX_LENGTH:dN,POSIX_REGEX_SOURCE:cst,REGEX_NON_SPECIAL_CHARS:lst,REGEX_SPECIAL_CHARS_BACKREF:ust,REPLACEMENTS:_be}=Fb,dst=(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=>yn.escapeRegex(i)).join("..")}return r},t_=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,ybe=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=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(o),o="";continue}}}o+=a}return e.push(o),e},fst=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},Sbe=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(fst(e))return e.replace(/\\(.)/g,"$1")},pst=t=>{let e=t.map(Sbe).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let i=e[r],o=e[n],s=i[0];if(!(!s||i!==s.repeat(i.length)||o!==s.repeat(o.length))&&(i===o||i.startsWith(o)||o.startsWith(i)))return!0}return!1},N3=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s<t.length;s++){let a=t[s];if(o===!0){o=!1;continue}if(a==="\\"){o=!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&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},hst=t=>{let e=0,r=[];for(;e<t.length;){let i=N3(t.slice(e),!1);if(!i||i.type!=="*")return;let o=ybe(i.body).map(a=>a.trim());if(o.length!==1)return;let s=Sbe(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?yn.escapeRegex(r[0]):`[${r.map(i=>yn.escapeRegex(i)).join("")}]`}*`},mst=t=>{let e=0,r=t.trim(),n=N3(r);for(;n;)e++,r=n.body.trim(),n=N3(r);return e},gst=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Fb.DEFAULT_MAX_EXTGLOB_RECURSION,n=ybe(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||pst(n)))return{risky:!0};for(let i of n){let o=hst(i);if(o)return{risky:!0,safeOutput:o};if(mst(i)>r)return{risky:!0}}return{risky:!1}},k3=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=_be[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(dN,r.maxLength):dN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=yn.isWindows(e),l=Fb.globChars(c),u=Fb.extglobChars(l),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:_,NO_DOTS_SLASH:v,QMARK:T,QMARK_NO_DOT:b,STAR:A,START_ANCHOR:k}=l,P=re=>`(${a}(?:(?!${k}${re.dot?m:d}).)*?)`,N=r.dot?"":g,D=r.dot?T:b,F=r.bash===!0?P(r):A;r.capture&&(F=`(${F})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let E={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:s};t=yn.removePrefix(t,E),i=t.length;let oe=[],M=[],S=[],w=o,O,Y=()=>E.index===i-1,H=E.peek=(re=1)=>t[E.index+re],he=E.advance=()=>t[++E.index]||"",je=()=>t.slice(E.index+1),Ie=(re="",qe=0)=>{E.consumed+=re,E.index+=qe},$e=re=>{E.output+=re.output!=null?re.output:re.value,Ie(re.value)},Pe=()=>{let re=1;for(;H()==="!"&&(H(2)!=="("||H(3)==="?");)he(),E.start++,re++;return re%2===0?!1:(E.negated=!0,E.start++,!0)},He=re=>{E[re]++,S.push(re)},Ne=re=>{E[re]--,S.pop()},ce=re=>{if(w.type==="globstar"){let qe=E.braces>0&&(re.type==="comma"||re.type==="brace"),z=re.extglob===!0||oe.length&&(re.type==="pipe"||re.type==="paren");re.type!=="slash"&&re.type!=="paren"&&!qe&&!z&&(E.output=E.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=F,E.output+=w.output)}if(oe.length&&re.type!=="paren"&&(oe[oe.length-1].inner+=re.value),(re.value||re.output)&&$e(re),w&&w.type==="text"&&re.type==="text"){w.value+=re.value,w.output=(w.output||"")+re.value;return}re.prev=w,s.push(re),w=re},me=(re,qe)=>{let z={...u[qe],conditions:1,inner:""};z.prev=w,z.parens=E.parens,z.output=E.output,z.startIndex=E.index,z.tokensIndex=s.length;let x=(r.capture?"(":"")+z.open;He("parens"),ce({type:re,value:qe,output:E.output?"":h}),ce({type:"paren",extglob:!0,value:he(),output:x}),oe.push(z)},nt=re=>{let qe=t.slice(re.startIndex,E.index+1),z=t.slice(re.startIndex+2,E.index),x=gst(z,r);if((re.type==="plus"||re.type==="star")&&x.risky){let B=x.safeOutput?(re.output?"":h)+(r.capture?`(${x.safeOutput})`:x.safeOutput):void 0,te=s[re.tokensIndex];te.type="text",te.value=qe,te.output=B||yn.escapeRegex(qe);for(let ie=re.tokensIndex+1;ie<s.length;ie++)s[ie].value="",s[ie].output="",delete s[ie].suffix;E.output=re.output+te.output,E.backtrack=!0,ce({type:"paren",extglob:!0,value:O,output:""}),Ne("parens");return}let C=re.close+(r.capture?")":""),j;if(re.type==="negate"){let B=F;if(re.inner&&re.inner.length>1&&re.inner.includes("/")&&(B=P(r)),(B!==F||Y()||/^\)+$/.test(je()))&&(C=re.close=`)$))${B}`),re.inner.includes("*")&&(j=je())&&/^\.[^\\/.]+$/.test(j)){let te=k3(j,{...e,fastpaths:!1}).output;C=re.close=`)${te})${B})`}re.prev.type==="bos"&&(E.negatedExtglob=!0)}ce({type:"paren",extglob:!0,value:O,output:C}),Ne("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let re=!1,qe=t.replace(ust,(z,x,C,j,B,te)=>j==="\\"?(re=!0,z):j==="?"?x?x+j+(B?T.repeat(B.length):""):te===0?D+(B?T.repeat(B.length):""):T.repeat(C.length):j==="."?d.repeat(C.length):j==="*"?x?x+j+(B?F:""):F:x?z:`\\${z}`);return re===!0&&(r.unescape===!0?qe=qe.replace(/\\/g,""):qe=qe.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),qe===t&&r.contains===!0?(E.output=t,E):(E.output=yn.wrapOutput(qe,E,e),E)}for(;!Y();){if(O=he(),O==="\0")continue;if(O==="\\"){let z=H();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){O+="\\",ce({type:"text",value:O});continue}let x=/^\\+/.exec(je()),C=0;if(x&&x[0].length>2&&(C=x[0].length,E.index+=C,C%2!==0&&(O+="\\")),r.unescape===!0?O=he():O+=he(),E.brackets===0){ce({type:"text",value:O});continue}}if(E.brackets>0&&(O!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&O===":"){let z=w.value.slice(1);if(z.includes("[")&&(w.posix=!0,z.includes(":"))){let x=w.value.lastIndexOf("["),C=w.value.slice(0,x),j=w.value.slice(x+2),B=cst[j];if(B){w.value=C+B,E.backtrack=!0,he(),!o.output&&s.indexOf(w)===1&&(o.output=h);continue}}}(O==="["&&H()!==":"||O==="-"&&H()==="]")&&(O=`\\${O}`),O==="]"&&(w.value==="["||w.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&w.value==="["&&(O="^"),w.value+=O,$e({value:O});continue}if(E.quotes===1&&O!=='"'){O=yn.escapeRegex(O),w.value+=O,$e({value:O});continue}if(O==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&ce({type:"text",value:O});continue}if(O==="("){He("parens"),ce({type:"paren",value:O});continue}if(O===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(t_("opening","("));let z=oe[oe.length-1];if(z&&E.parens===z.parens+1){nt(oe.pop());continue}ce({type:"paren",value:O,output:E.parens?")":"\\)"}),Ne("parens");continue}if(O==="["){if(r.nobracket===!0||!je().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(t_("closing","]"));O=`\\${O}`}else He("brackets");ce({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){ce({type:"text",value:O,output:`\\${O}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(t_("opening","["));ce({type:"text",value:O,output:`\\${O}`});continue}Ne("brackets");let z=w.value.slice(1);if(w.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(O=`/${O}`),w.value+=O,$e({value:O}),r.literalBrackets===!1||yn.hasRegexChars(z))continue;let x=yn.escapeRegex(w.value);if(E.output=E.output.slice(0,-w.value.length),r.literalBrackets===!0){E.output+=x,w.value=x;continue}w.value=`(${a}${x}|${w.value})`,E.output+=w.value;continue}if(O==="{"&&r.nobrace!==!0){He("braces");let z={type:"brace",value:O,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};M.push(z),ce(z);continue}if(O==="}"){let z=M[M.length-1];if(r.nobrace===!0||!z){ce({type:"text",value:O,output:O});continue}let x=")";if(z.dots===!0){let C=s.slice(),j=[];for(let B=C.length-1;B>=0&&(s.pop(),C[B].type!=="brace");B--)C[B].type!=="dots"&&j.unshift(C[B].value);x=dst(j,r),E.backtrack=!0}if(z.comma!==!0&&z.dots!==!0){let C=E.output.slice(0,z.outputIndex),j=E.tokens.slice(z.tokensIndex);z.value=z.output="\\{",O=x="\\}",E.output=C;for(let B of j)E.output+=B.output||B.value}ce({type:"brace",value:O,output:x}),Ne("braces"),M.pop();continue}if(O==="|"){oe.length>0&&oe[oe.length-1].conditions++,ce({type:"text",value:O});continue}if(O===","){let z=O,x=M[M.length-1];x&&S[S.length-1]==="braces"&&(x.comma=!0,z="|"),ce({type:"comma",value:O,output:z});continue}if(O==="/"){if(w.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",s.pop(),w=o;continue}ce({type:"slash",value:O,output:p});continue}if(O==="."){if(E.braces>0&&w.type==="dot"){w.value==="."&&(w.output=d);let z=M[M.length-1];w.type="dots",w.output+=O,w.value+=O,z.dots=!0;continue}if(E.braces+E.parens===0&&w.type!=="bos"&&w.type!=="slash"){ce({type:"text",value:O,output:d});continue}ce({type:"dot",value:O,output:d});continue}if(O==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("qmark",O);continue}if(w&&w.type==="paren"){let x=H(),C=O;if(x==="<"&&!yn.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(je()))&&(C=`\\${O}`),ce({type:"text",value:O,output:C});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){ce({type:"qmark",value:O,output:b});continue}ce({type:"qmark",value:O,output:T});continue}if(O==="!"){if(r.noextglob!==!0&&H()==="("&&(H(2)!=="?"||!/[!=<:]/.test(H(3)))){me("negate",O);continue}if(r.nonegate!==!0&&E.index===0){Pe();continue}}if(O==="+"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("plus",O);continue}if(w&&w.value==="("||r.regex===!1){ce({type:"plus",value:O,output:f});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||E.parens>0){ce({type:"plus",value:O});continue}ce({type:"plus",value:f});continue}if(O==="@"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){ce({type:"at",extglob:!0,value:O,output:""});continue}ce({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let z=lst.exec(je());z&&(O+=z[0],E.index+=z[0].length),ce({type:"text",value:O});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=O,w.output=F,E.backtrack=!0,E.globstar=!0,Ie(O);continue}let re=je();if(r.noextglob!==!0&&/^\([^?]/.test(re)){me("star",O);continue}if(w.type==="star"){if(r.noglobstar===!0){Ie(O);continue}let z=w.prev,x=z.prev,C=z.type==="slash"||z.type==="bos",j=x&&(x.type==="star"||x.type==="globstar");if(r.bash===!0&&(!C||re[0]&&re[0]!=="/")){ce({type:"star",value:O,output:""});continue}let B=E.braces>0&&(z.type==="comma"||z.type==="brace"),te=oe.length&&(z.type==="pipe"||z.type==="paren");if(!C&&z.type!=="paren"&&!B&&!te){ce({type:"star",value:O,output:""});continue}for(;re.slice(0,3)==="/**";){let ie=t[E.index+4];if(ie&&ie!=="/")break;re=re.slice(3),Ie("/**",3)}if(z.type==="bos"&&Y()){w.type="globstar",w.value+=O,w.output=P(r),E.output=w.output,E.globstar=!0,Ie(O);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!j&&Y()){E.output=E.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=P(r)+(r.strictSlashes?")":"|$)"),w.value+=O,E.globstar=!0,E.output+=z.output+w.output,Ie(O);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&re[0]==="/"){let ie=re[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=`${P(r)}${p}|${p}${ie})`,w.value+=O,E.output+=z.output+w.output,E.globstar=!0,Ie(O+he()),ce({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&re[0]==="/"){w.type="globstar",w.value+=O,w.output=`(?:^|${p}|${P(r)}${p})`,E.output=w.output,E.globstar=!0,Ie(O+he()),ce({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-w.output.length),w.type="globstar",w.output=P(r),w.value+=O,E.output+=w.output,E.globstar=!0,Ie(O);continue}let qe={type:"star",value:O,output:F};if(r.bash===!0){qe.output=".*?",(w.type==="bos"||w.type==="slash")&&(qe.output=N+qe.output),ce(qe);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){qe.output=O,ce(qe);continue}(E.index===E.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(E.output+=_,w.output+=_):r.dot===!0?(E.output+=v,w.output+=v):(E.output+=N,w.output+=N),H()!=="*"&&(E.output+=h,w.output+=h)),ce(qe)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(t_("closing","]"));E.output=yn.escapeLast(E.output,"["),Ne("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(t_("closing",")"));E.output=yn.escapeLast(E.output,"("),Ne("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(t_("closing","}"));E.output=yn.escapeLast(E.output,"{"),Ne("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${p}?`}),E.backtrack===!0){E.output="";for(let re of E.tokens)E.output+=re.output!=null?re.output:re.value,re.suffix&&(E.output+=re.suffix)}return E};k3.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(dN,r.maxLength):dN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=_be[t]||t;let o=yn.isWindows(e),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:h}=Fb.globChars(o),m=r.dot?d:u,g=r.dot?f:u,_=r.capture?"":"?:",v={negated:!1,prefix:""},T=r.bash===!0?".*?":p;r.capture&&(T=`(${T})`);let b=N=>N.noglobstar===!0?T:`(${_}(?:(?!${h}${N.dot?l:s}).)*?)`,A=N=>{switch(N){case"*":return`${m}${c}${T}`;case".*":return`${s}${c}${T}`;case"*.*":return`${m}${T}${s}${c}${T}`;case"*/*":return`${m}${T}${a}${c}${g}${T}`;case"**":return m+b(r);case"**/*":return`(?:${m}${b(r)}${a})?${g}${c}${T}`;case"**/*.*":return`(?:${m}${b(r)}${a})?${g}${T}${s}${c}${T}`;case"**/.*":return`(?:${m}${b(r)}${a})?${s}${c}${T}`;default:{let D=/^(.*?)\.(\w+)$/.exec(N);if(!D)return;let F=A(D[1]);return F?F+s+D[2]:void 0}}},k=yn.removePrefix(t,v),P=A(k);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};Ebe.exports=k3});var Tbe=y((war,bbe)=>{"use strict";var _st=Z("path"),yst=gbe(),M3=vbe(),$3=Lb(),Sst=Db(),Est=t=>t&&typeof t=="object"&&!Array.isArray(t),cr=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>cr(f,e,r));return f=>{for(let p of u){let h=p(f);if(h)return h}return!1}}let n=Est(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||{},o=$3.isWindows(e),s=n?cr.compileRe(t,e):cr.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=cr(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:h}=cr.test(u,s,e,{glob:t,posix:o}),m={glob:t,state:a,regex:s,posix:o,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};cr.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 o=r||{},s=o.format||(i?$3.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=cr.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};cr.matchBase=(t,e,r,n=$3.isWindows(r))=>(e instanceof RegExp?e:cr.makeRe(e,r)).test(_st.basename(t));cr.isMatch=(t,e,r)=>cr(e,r)(t);cr.parse=(t,e)=>Array.isArray(t)?t.map(r=>cr.parse(r,e)):M3(t,{...e,fastpaths:!1});cr.scan=(t,e)=>yst(t,e);cr.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=cr.toRegex(a,e);return n===!0&&(c.state=t),c};cr.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=M3.fastpaths(t,e)),i.output||(i=M3(t,e)),cr.compileRe(i,e,r,n)};cr.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/$^/}};cr.constants=Sst;bbe.exports=cr});var xbe=y((xar,wbe)=>{"use strict";wbe.exports=Tbe()});var L3=y((Aar,Pbe)=>{"use strict";var Rbe=Z("util"),Cbe=nbe(),Qs=xbe(),D3=Lb(),Abe=t=>t===""||t==="./",Ibe=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Vt=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,o=new Set,s=0,a=u=>{o.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<e.length;u++){let d=Qs(String(e[u]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&s++;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=(s===e.length?[...o]:[...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};Vt.match=Vt;Vt.matcher=(t,e)=>Qs(t,e);Vt.isMatch=(t,e,r)=>Qs(e,r)(t);Vt.any=Vt.isMatch;Vt.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],o=a=>{r.onResult&&r.onResult(a),i.push(a.output)},s=new Set(Vt(t,e,{...r,onResult:o}));for(let a of i)s.has(a)||n.add(a);return[...n]};Vt.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rbe.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Vt.contains(t,n,r));if(typeof e=="string"){if(Abe(t)||Abe(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Vt.isMatch(t,e,{...r,contains:!0})};Vt.matchKeys=(t,e,r)=>{if(!D3.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Vt(Object.keys(t),e,r),i={};for(let o of n)i[o]=t[o];return i};Vt.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=Qs(String(i),r);if(n.some(s=>o(s)))return!0}return!1};Vt.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=Qs(String(i),r);if(!n.every(s=>o(s)))return!1}return!0};Vt.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Rbe.inspect(t)}"`);return[].concat(e).every(n=>Qs(n,r)(t))};Vt.capture=(t,e,r)=>{let n=D3.isWindows(r),o=Qs.makeRe(String(t),{...r,capture:!0}).exec(n?D3.toPosixSlashes(e):e);if(o)return o.slice(1).map(s=>s===void 0?"":s)};Vt.makeRe=(...t)=>Qs.makeRe(...t);Vt.scan=(...t)=>Qs.scan(...t);Vt.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of Cbe(String(n),e))r.push(Qs.parse(i,e));return r};Vt.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Ibe(t)?[t]:Cbe(t,e)};Vt.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Vt.braces(t,{...e,expand:!0})};Vt.hasBraces=Ibe;Pbe.exports=Vt});var zbe=y(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.isAbsolute=ke.partitionAbsoluteAndRelative=ke.removeDuplicateSlashes=ke.matchAny=ke.convertPatternsToRe=ke.makeRe=ke.getPatternParts=ke.expandBraceExpansion=ke.expandPatternsWithBraceExpansion=ke.isAffectDepthOfReadingPattern=ke.endsWithSlashGlobStar=ke.hasGlobStar=ke.getBaseDirectory=ke.isPatternRelatedToParentDirectory=ke.getPatternsOutsideCurrentDirectory=ke.getPatternsInsideCurrentDirectory=ke.getPositivePatterns=ke.getNegativePatterns=ke.isPositivePattern=ke.isNegativePattern=ke.convertToNegativePattern=ke.convertToPositivePattern=ke.isDynamicPattern=ke.isStaticPattern=void 0;var Obe=Z("path"),vst=vve(),U3=L3(),Nbe="**",bst="\\",Tst=/[*?]|^!/,wst=/\[[^[]*]/,xst=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Ast=/[!*+?@]\([^(]*\)/,Rst=/,|\.\./,Cst=/(?!^)\/{2,}/g;function kbe(t,e={}){return!Mbe(t,e)}ke.isStaticPattern=kbe;function Mbe(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(bst)||Tst.test(t)||wst.test(t)||xst.test(t)||e.extglob!==!1&&Ast.test(t)||e.braceExpansion!==!1&&Ist(t))}ke.isDynamicPattern=Mbe;function Ist(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 Rst.test(n)}function Pst(t){return fN(t)?t.slice(1):t}ke.convertToPositivePattern=Pst;function Ost(t){return"!"+t}ke.convertToNegativePattern=Ost;function fN(t){return t.startsWith("!")&&t[1]!=="("}ke.isNegativePattern=fN;function $be(t){return!fN(t)}ke.isPositivePattern=$be;function Nst(t){return t.filter(fN)}ke.getNegativePatterns=Nst;function kst(t){return t.filter($be)}ke.getPositivePatterns=kst;function Mst(t){return t.filter(e=>!F3(e))}ke.getPatternsInsideCurrentDirectory=Mst;function $st(t){return t.filter(F3)}ke.getPatternsOutsideCurrentDirectory=$st;function F3(t){return t.startsWith("..")||t.startsWith("./..")}ke.isPatternRelatedToParentDirectory=F3;function Dst(t){return vst(t,{flipBackslashes:!1})}ke.getBaseDirectory=Dst;function Lst(t){return t.includes(Nbe)}ke.hasGlobStar=Lst;function Dbe(t){return t.endsWith("/"+Nbe)}ke.endsWithSlashGlobStar=Dbe;function Ust(t){let e=Obe.basename(t);return Dbe(t)||kbe(e)}ke.isAffectDepthOfReadingPattern=Ust;function Fst(t){return t.reduce((e,r)=>e.concat(Lbe(r)),[])}ke.expandPatternsWithBraceExpansion=Fst;function Lbe(t){let e=U3.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ke.expandBraceExpansion=Lbe;function zst(t,e){let{parts:r}=U3.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}ke.getPatternParts=zst;function Ube(t,e){return U3.makeRe(t,e)}ke.makeRe=Ube;function jst(t,e){return t.map(r=>Ube(r,e))}ke.convertPatternsToRe=jst;function Bst(t,e){return e.some(r=>r.test(t))}ke.matchAny=Bst;function qst(t){return t.replace(Cst,"/")}ke.removeDuplicateSlashes=qst;function Vst(t){let e=[],r=[];for(let n of t)Fbe(n)?e.push(n):r.push(n);return[e,r]}ke.partitionAbsoluteAndRelative=Vst;function Fbe(t){return Obe.isAbsolute(t)}ke.isAbsolute=Fbe});var Vbe=y((Car,qbe)=>{"use strict";var Gst=Z("stream"),jbe=Gst.PassThrough,Hst=Array.prototype.slice;qbe.exports=Wst;function Wst(){let t=[],e=Hst.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,o=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=jbe(n);function a(){for(let u=0,d=arguments.length;u<d;u++)t.push(Bbe(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),o&&h.removeListener("error",g),f()}function g(_){s.emit("error",_)}if(h._readableState.endEmitted)return f();h.on("merge2UnpipeEnd",m),h.on("end",m),o&&h.on("error",g),h.pipe(s,{end:!1}),h.resume()}for(let h=0;h<u.length;h++)p(u[h]);f()}function l(){r=!1,s.emit("queueDrain"),i&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),s}function Bbe(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=Bbe(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(jbe(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var Hbe=y(pN=>{"use strict";Object.defineProperty(pN,"__esModule",{value:!0});pN.merge=void 0;var Yst=Vbe();function Kst(t){let e=Yst(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>Gbe(t)),e.once("end",()=>Gbe(t)),e}pN.merge=Kst;function Gbe(t){t.forEach(e=>e.emit("close"))}});var Wbe=y(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.isEmpty=r_.isString=void 0;function Zst(t){return typeof t=="string"}r_.isString=Zst;function Jst(t){return t===""}r_.isEmpty=Jst});var mc=y(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.string=Sn.stream=Sn.pattern=Sn.path=Sn.fs=Sn.errno=Sn.array=void 0;var Xst=cve();Sn.array=Xst;var Qst=lve();Sn.errno=Qst;var eat=uve();Sn.fs=eat;var tat=hve();Sn.path=tat;var rat=zbe();Sn.pattern=rat;var nat=Hbe();Sn.stream=nat;var iat=Wbe();Sn.string=iat});var Jbe=y(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.convertPatternGroupToTask=En.convertPatternGroupsToTasks=En.groupPatternsByBaseDirectory=En.getNegativePatternsAsPositive=En.getPositivePatterns=En.convertPatternsToTasks=En.generate=void 0;var Ko=mc();function oat(t,e){let r=Ybe(t,e),n=Ybe(e.ignore,e),i=Kbe(r),o=Zbe(r,n),s=i.filter(u=>Ko.pattern.isStaticPattern(u,e)),a=i.filter(u=>Ko.pattern.isDynamicPattern(u,e)),c=z3(s,o,!1),l=z3(a,o,!0);return c.concat(l)}En.generate=oat;function Ybe(t,e){let r=t;return e.braceExpansion&&(r=Ko.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Ko.pattern.removeDuplicateSlashes(n))}function z3(t,e,r){let n=[],i=Ko.pattern.getPatternsOutsideCurrentDirectory(t),o=Ko.pattern.getPatternsInsideCurrentDirectory(t),s=j3(i),a=j3(o);return n.push(...B3(s,e,r)),"."in a?n.push(q3(".",o,e,r)):n.push(...B3(a,e,r)),n}En.convertPatternsToTasks=z3;function Kbe(t){return Ko.pattern.getPositivePatterns(t)}En.getPositivePatterns=Kbe;function Zbe(t,e){return Ko.pattern.getNegativePatterns(t).concat(e).map(Ko.pattern.convertToPositivePattern)}En.getNegativePatternsAsPositive=Zbe;function j3(t){let e={};return t.reduce((r,n)=>{let i=Ko.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}En.groupPatternsByBaseDirectory=j3;function B3(t,e,r){return Object.keys(t).map(n=>q3(n,t[n],e,r))}En.convertPatternGroupsToTasks=B3;function q3(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Ko.pattern.convertToNegativePattern))}}En.convertPatternGroupToTask=q3});var Qbe=y(hN=>{"use strict";Object.defineProperty(hN,"__esModule",{value:!0});hN.read=void 0;function sat(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){Xbe(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){V3(r,i);return}e.fs.stat(t,(o,s)=>{if(o!==null){if(e.throwErrorOnBrokenSymbolicLink){Xbe(r,o);return}V3(r,i);return}e.markSymbolicLink&&(s.isSymbolicLink=()=>!0),V3(r,s)})})}hN.read=sat;function Xbe(t,e){t(e)}function V3(t,e){t(null,e)}});var eTe=y(mN=>{"use strict";Object.defineProperty(mN,"__esModule",{value:!0});mN.read=void 0;function aat(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}}mN.read=aat});var tTe=y(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.createFileSystemAdapter=ou.FILE_SYSTEM_ADAPTER=void 0;var gN=Z("fs");ou.FILE_SYSTEM_ADAPTER={lstat:gN.lstat,stat:gN.stat,lstatSync:gN.lstatSync,statSync:gN.statSync};function cat(t){return t===void 0?ou.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ou.FILE_SYSTEM_ADAPTER),t)}ou.createFileSystemAdapter=cat});var rTe=y(H3=>{"use strict";Object.defineProperty(H3,"__esModule",{value:!0});var lat=tTe(),G3=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=lat.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}};H3.default=G3});var xf=y(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.statSync=su.stat=su.Settings=void 0;var nTe=Qbe(),uat=eTe(),W3=rTe();su.Settings=W3.default;function dat(t,e,r){if(typeof e=="function"){nTe.read(t,Y3(),e);return}nTe.read(t,Y3(e),r)}su.stat=dat;function fat(t,e){let r=Y3(e);return uat.read(t,r)}su.statSync=fat;function Y3(t={}){return t instanceof W3.default?t:new W3.default(t)}});var sTe=y((Uar,oTe)=>{"use strict";var iTe;oTe.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(iTe||(iTe=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var cTe=y((Far,aTe)=>{"use strict";aTe.exports=hat;var pat=sTe();function hat(t,e){let r,n,i,o=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function s(c){function l(){e&&e(c,r),e=null}o?pat(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&s(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)})}):s(null),o=!1}});var K3=y(yN=>{"use strict";Object.defineProperty(yN,"__esModule",{value:!0});yN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var _N=process.versions.node.split(".");if(_N[0]===void 0||_N[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var lTe=Number.parseInt(_N[0],10),mat=Number.parseInt(_N[1],10),uTe=10,gat=10,_at=lTe>uTe,yat=lTe===uTe&&mat>=gat;yN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=_at||yat});var dTe=y(SN=>{"use strict";Object.defineProperty(SN,"__esModule",{value:!0});SN.createDirentFromStats=void 0;var Z3=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 Sat(t,e){return new Z3(t,e)}SN.createDirentFromStats=Sat});var J3=y(EN=>{"use strict";Object.defineProperty(EN,"__esModule",{value:!0});EN.fs=void 0;var Eat=dTe();EN.fs=Eat});var X3=y(vN=>{"use strict";Object.defineProperty(vN,"__esModule",{value:!0});vN.joinPathSegments=void 0;function vat(t,e,r){return t.endsWith(r)?t+e:t+r+e}vN.joinPathSegments=vat});var _Te=y(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.readdir=au.readdirWithFileTypes=au.read=void 0;var bat=xf(),fTe=cTe(),Tat=K3(),pTe=J3(),hTe=X3();function wat(t,e,r){if(!e.stats&&Tat.IS_SUPPORT_READDIR_WITH_FILE_TYPES){mTe(t,e,r);return}gTe(t,e,r)}au.read=wat;function mTe(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){bN(r,n);return}let o=i.map(a=>({dirent:a,name:a.name,path:hTe.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){Q3(r,o);return}let s=o.map(a=>xat(a,e));fTe(s,(a,c)=>{if(a!==null){bN(r,a);return}Q3(r,c)})})}au.readdirWithFileTypes=mTe;function xat(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=pTe.fs.createDirentFromStats(t.name,i),r(null,t)})}}function gTe(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){bN(r,n);return}let o=i.map(s=>{let a=hTe.joinPathSegments(t,s,e.pathSegmentSeparator);return c=>{bat.stat(a,e.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let d={name:s,path:a,dirent:pTe.fs.createDirentFromStats(s,u)};e.stats&&(d.stats=u),c(null,d)})}});fTe(o,(s,a)=>{if(s!==null){bN(r,s);return}Q3(r,a)})})}au.readdir=gTe;function bN(t,e){t(e)}function Q3(t,e){t(null,e)}});var bTe=y(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.readdir=cu.readdirWithFileTypes=cu.read=void 0;var Aat=xf(),Rat=K3(),yTe=J3(),STe=X3();function Cat(t,e){return!e.stats&&Rat.IS_SUPPORT_READDIR_WITH_FILE_TYPES?ETe(t,e):vTe(t,e)}cu.read=Cat;function ETe(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:STe.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let o=e.fs.statSync(i.path);i.dirent=yTe.fs.createDirentFromStats(i.name,o)}catch(o){if(e.throwErrorOnBrokenSymbolicLink)throw o}return i})}cu.readdirWithFileTypes=ETe;function vTe(t,e){return e.fs.readdirSync(t).map(n=>{let i=STe.joinPathSegments(t,n,e.pathSegmentSeparator),o=Aat.statSync(i,e.fsStatSettings),s={name:n,path:i,dirent:yTe.fs.createDirentFromStats(n,o)};return e.stats&&(s.stats=o),s})}cu.readdir=vTe});var TTe=y(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.createFileSystemAdapter=lu.FILE_SYSTEM_ADAPTER=void 0;var n_=Z("fs");lu.FILE_SYSTEM_ADAPTER={lstat:n_.lstat,stat:n_.stat,lstatSync:n_.lstatSync,statSync:n_.statSync,readdir:n_.readdir,readdirSync:n_.readdirSync};function Iat(t){return t===void 0?lu.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},lu.FILE_SYSTEM_ADAPTER),t)}lu.createFileSystemAdapter=Iat});var wTe=y(tW=>{"use strict";Object.defineProperty(tW,"__esModule",{value:!0});var Pat=Z("path"),Oat=xf(),Nat=TTe(),eW=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=Nat.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Pat.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new Oat.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};tW.default=eW});var TN=y(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.Settings=uu.scandirSync=uu.scandir=void 0;var xTe=_Te(),kat=bTe(),rW=wTe();uu.Settings=rW.default;function Mat(t,e,r){if(typeof e=="function"){xTe.read(t,nW(),e);return}xTe.read(t,nW(e),r)}uu.scandir=Mat;function $at(t,e){let r=nW(e);return kat.read(t,r)}uu.scandirSync=$at;function nW(t={}){return t instanceof rW.default?t:new rW.default(t)}});var RTe=y((Kar,ATe)=>{"use strict";function Dat(t){var e=new t,r=e;function n(){var o=e;return o.next?e=o.next:(e=new t,r=e),o.next=null,o}function i(o){r.next=o,r=o}return{get:n,release:i}}ATe.exports=Dat});var ITe=y((Zar,iW)=>{"use strict";var Lat=RTe();function CTe(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=Lat(Uat),i=null,o=null,s=0,a=null,c={push:m,drain:si,saturated:si,pause:u,paused:!1,get concurrency(){return r},set concurrency(k){if(!(k>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=k,!c.paused)for(;i&&s<r;)s++,_()},running:l,resume:p,idle:h,length:d,getQueue:f,unshift:g,empty:si,kill:v,killAndDrain:T,error:A,abort:b};return c;function l(){return s}function u(){c.paused=!0}function d(){for(var k=i,P=0;k;)k=k.next,P++;return P}function f(){for(var k=i,P=[];k;)P.push(k.value),k=k.next;return P}function p(){if(c.paused){if(c.paused=!1,i===null){s++,_();return}for(;i&&s<r;)s++,_()}}function h(){return s===0&&c.length()===0}function m(k,P){var N=n.get();N.context=t,N.release=_,N.value=k,N.callback=P||si,N.errorHandler=a,s>=r||c.paused?o?(o.next=N,o=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function g(k,P){var N=n.get();N.context=t,N.release=_,N.value=k,N.callback=P||si,N.errorHandler=a,s>=r||c.paused?i?(N.next=i,i=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function _(k){k&&n.release(k);var P=i;P&&s<=r?c.paused?s--:(o===i&&(o=null),i=P.next,P.next=null,e.call(t,P.value,P.worked),o===null&&c.empty()):--s===0&&c.drain()}function v(){i=null,o=null,c.drain=si}function T(){i=null,o=null,c.drain(),c.drain=si}function b(){var k=i;for(i=null,o=null;k;){var P=k.next,N=k.callback,D=k.errorHandler,F=k.value,E=k.context;k.value=null,k.callback=si,k.errorHandler=null,D&&D(new Error("abort"),F),N.call(E,new Error("abort")),k.release(k),k=P}c.drain=si}function A(k){a=k}}function si(){}function Uat(){this.value=null,this.callback=si,this.next=null,this.release=si,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,o=t.errorHandler,s=t.value;t.value=null,t.callback=si,t.errorHandler&&o(r,s),i.call(t.context,r,n),t.release(t)}}function Fat(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=CTe(t,n,r),o=i.push,s=i.unshift;return i.push=a,i.unshift=c,i.drained=l,i;function a(u){var d=new Promise(function(f,p){o(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(si),d}function c(u){var d=new Promise(function(f,p){s(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(si),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}}iW.exports=CTe;iW.exports.promise=Fat});var wN=y(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.joinPathSegments=ea.replacePathSegmentSeparator=ea.isAppliedFilter=ea.isFatalError=void 0;function zat(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}ea.isFatalError=zat;function jat(t,e){return t===null||t(e)}ea.isAppliedFilter=jat;function Bat(t,e){return t.split(/[/\\]/).join(e)}ea.replacePathSegmentSeparator=Bat;function qat(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}ea.joinPathSegments=qat});var aW=y(sW=>{"use strict";Object.defineProperty(sW,"__esModule",{value:!0});var Vat=wN(),oW=class{constructor(e,r){this._root=e,this._settings=r,this._root=Vat.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};sW.default=oW});var uW=y(lW=>{"use strict";Object.defineProperty(lW,"__esModule",{value:!0});var Gat=Z("events"),Hat=TN(),Wat=ITe(),xN=wN(),Yat=aW(),cW=class extends Yat.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=Hat.scandir,this._emitter=new Gat.EventEmitter,this._queue=Wat(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 o of i)this._handleEntry(o,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!xN.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=xN.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),xN.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&xN.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};lW.default=cW});var PTe=y(fW=>{"use strict";Object.defineProperty(fW,"__esModule",{value:!0});var Kat=uW(),dW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Kat.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{Zat(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Jat(e,this._storage)}),this._reader.read()}};fW.default=dW;function Zat(t,e){t(e)}function Jat(t,e){t(null,e)}});var OTe=y(hW=>{"use strict";Object.defineProperty(hW,"__esModule",{value:!0});var Xat=Z("stream"),Qat=uW(),pW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Qat.default(this._root,this._settings),this._stream=new Xat.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}};hW.default=pW});var NTe=y(gW=>{"use strict";Object.defineProperty(gW,"__esModule",{value:!0});var ect=TN(),AN=wN(),tct=aW(),mW=class extends tct.default{constructor(){super(...arguments),this._scandir=ect.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(AN.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=AN.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),AN.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&AN.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};gW.default=mW});var kTe=y(yW=>{"use strict";Object.defineProperty(yW,"__esModule",{value:!0});var rct=NTe(),_W=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new rct.default(this._root,this._settings)}read(){return this._reader.read()}};yW.default=_W});var MTe=y(EW=>{"use strict";Object.defineProperty(EW,"__esModule",{value:!0});var nct=Z("path"),ict=TN(),SW=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,nct.sep),this.fsScandirSettings=new ict.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}};EW.default=SW});var CN=y(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.Settings=ta.walkStream=ta.walkSync=ta.walk=void 0;var $Te=PTe(),oct=OTe(),sct=kTe(),vW=MTe();ta.Settings=vW.default;function act(t,e,r){if(typeof e=="function"){new $Te.default(t,RN()).read(e);return}new $Te.default(t,RN(e)).read(r)}ta.walk=act;function cct(t,e){let r=RN(e);return new sct.default(t,r).read()}ta.walkSync=cct;function lct(t,e){let r=RN(e);return new oct.default(t,r).read()}ta.walkStream=lct;function RN(t={}){return t instanceof vW.default?t:new vW.default(t)}});var IN=y(TW=>{"use strict";Object.defineProperty(TW,"__esModule",{value:!0});var uct=Z("path"),dct=xf(),DTe=mc(),bW=class{constructor(e){this._settings=e,this._fsStatSettings=new dct.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return uct.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:DTe.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!DTe.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};TW.default=bW});var AW=y(xW=>{"use strict";Object.defineProperty(xW,"__esModule",{value:!0});var fct=Z("stream"),pct=xf(),hct=CN(),mct=IN(),wW=class extends mct.default{constructor(){super(...arguments),this._walkStream=hct.walkStream,this._stat=pct.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new fct.PassThrough({objectMode:!0});i._write=(o,s,a)=>this._getEntry(n[o],e[o],r).then(c=>{c!==null&&r.entryFilter(c)&&i.push(c),o===n.length-1&&i.end(),a()}).catch(a);for(let o=0;o<n.length;o++)i.write(o);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,o)=>i===null?r(o):n(i))})}};xW.default=wW});var LTe=y(CW=>{"use strict";Object.defineProperty(CW,"__esModule",{value:!0});var gct=CN(),_ct=IN(),yct=AW(),RW=class extends _ct.default{constructor(){super(...arguments),this._walkAsync=gct.walk,this._readerStream=new yct.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(o,s)=>{o===null?n(s):i(o)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((o,s)=>{i.once("error",s),i.on("data",a=>n.push(a)),i.once("end",()=>o(n))})}};CW.default=RW});var UTe=y(PW=>{"use strict";Object.defineProperty(PW,"__esModule",{value:!0});var zb=mc(),IW=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 zb.pattern.getPatternParts(e,this._micromatchOptions).map(n=>zb.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:zb.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return zb.array.splitWhen(e,r=>r.dynamic&&zb.pattern.hasGlobStar(r.pattern))}};PW.default=IW});var FTe=y(NW=>{"use strict";Object.defineProperty(NW,"__esModule",{value:!0});var Sct=UTe(),OW=class extends Sct.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(o=>!o.complete||o.segments.length>n);for(let o of i){let s=o.sections[0];if(!o.complete&&n>s.length||r.every((c,l)=>{let u=o.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};NW.default=OW});var zTe=y(MW=>{"use strict";Object.defineProperty(MW,"__esModule",{value:!0});var PN=mc(),Ect=FTe(),kW=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),o=this._getNegativePatternsRe(n);return s=>this._filter(e,s,i,o)}_getMatcher(e){return new Ect.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(PN.pattern.isAffectDepthOfReadingPattern);return PN.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let o=PN.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(o,n)?!1:this._isSkippedByNegativePatterns(o,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!PN.pattern.matchAny(e,r)}};MW.default=kW});var jTe=y(DW=>{"use strict";Object.defineProperty(DW,"__esModule",{value:!0});var du=mc(),$W=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=du.pattern.partitionAbsoluteAndRelative(r),o={positive:{all:du.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:du.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:du.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,o)}_filter(e,r){let n=du.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=du.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=du.pattern.matchAny(e,r);return!i&&n?du.pattern.matchAny(e+"/",r):i}};DW.default=$W});var BTe=y(UW=>{"use strict";Object.defineProperty(UW,"__esModule",{value:!0});var vct=mc(),LW=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return vct.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};UW.default=LW});var VTe=y(zW=>{"use strict";Object.defineProperty(zW,"__esModule",{value:!0});var qTe=mc(),FW=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=qTe.path.makeAbsolute(this._settings.cwd,r),r=qTe.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};zW.default=FW});var ON=y(BW=>{"use strict";Object.defineProperty(BW,"__esModule",{value:!0});var bct=Z("path"),Tct=zTe(),wct=jTe(),xct=BTe(),Act=VTe(),jW=class{constructor(e){this._settings=e,this.errorFilter=new xct.default(this._settings),this.entryFilter=new wct.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Tct.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new Act.default(this._settings)}_getRootDirectory(e){return bct.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}}};BW.default=jW});var GTe=y(VW=>{"use strict";Object.defineProperty(VW,"__esModule",{value:!0});var Rct=LTe(),Cct=ON(),qW=class extends Cct.default{constructor(){super(...arguments),this._reader=new Rct.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(o=>n.transform(o))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};VW.default=qW});var HTe=y(HW=>{"use strict";Object.defineProperty(HW,"__esModule",{value:!0});var Ict=Z("stream"),Pct=AW(),Oct=ON(),GW=class extends Oct.default{constructor(){super(...arguments),this._reader=new Pct.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),o=new Ict.Readable({objectMode:!0,read:()=>{}});return i.once("error",s=>o.emit("error",s)).on("data",s=>o.emit("data",n.transform(s))).once("end",()=>o.emit("end")),o.once("close",()=>i.destroy()),o}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};HW.default=GW});var WTe=y(YW=>{"use strict";Object.defineProperty(YW,"__esModule",{value:!0});var Nct=xf(),kct=CN(),Mct=IN(),WW=class extends Mct.default{constructor(){super(...arguments),this._walkSync=kct.walkSync,this._statSync=Nct.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let o=this._getFullEntryPath(i),s=this._getEntry(o,i,r);s===null||!r.entryFilter(s)||n.push(s)}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)}};YW.default=WW});var YTe=y(ZW=>{"use strict";Object.defineProperty(ZW,"__esModule",{value:!0});var $ct=WTe(),Dct=ON(),KW=class extends Dct.default{constructor(){super(...arguments),this._reader=new $ct.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)}};ZW.default=KW});var KTe=y(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});o_.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var i_=Z("fs"),Lct=Z("os"),Uct=Math.max(Lct.cpus().length,1);o_.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:i_.lstat,lstatSync:i_.lstatSync,stat:i_.stat,statSync:i_.statSync,readdir:i_.readdir,readdirSync:i_.readdirSync};var JW=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,Uct),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({},o_.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};o_.default=JW});var jb=y((vcr,JTe)=>{"use strict";var ZTe=Jbe(),Fct=GTe(),zct=HTe(),jct=YTe(),XW=KTe(),oo=mc();async function QW(t,e){Zo(t);let r=eY(t,Fct.default,e),n=await Promise.all(r);return oo.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(l,u){Zo(l);let d=eY(l,jct.default,u);return oo.array.flatten(d)}t.sync=e;function r(l,u){Zo(l);let d=eY(l,zct.default,u);return oo.stream.merge(d)}t.stream=r;function n(l,u){Zo(l);let d=[].concat(l),f=new XW.default(u);return ZTe.generate(d,f)}t.generateTasks=n;function i(l,u){Zo(l);let d=new XW.default(u);return oo.pattern.isDynamicPattern(l,d)}t.isDynamicPattern=i;function o(l){return Zo(l),oo.path.escape(l)}t.escapePath=o;function s(l){return Zo(l),oo.path.convertPathToPattern(l)}t.convertPathToPattern=s;let a;(function(l){function u(f){return Zo(f),oo.path.escapePosixPath(f)}l.escapePath=u;function d(f){return Zo(f),oo.path.convertPosixPathToPattern(f)}l.convertPathToPattern=d})(a=t.posix||(t.posix={}));let c;(function(l){function u(f){return Zo(f),oo.path.escapeWindowsPath(f)}l.escapePath=u;function d(f){return Zo(f),oo.path.convertWindowsPathToPattern(f)}l.convertPathToPattern=d})(c=t.win32||(t.win32={}))})(QW||(QW={}));function eY(t,e,r){let n=[].concat(t),i=new XW.default(r),o=ZTe.generate(n,i),s=new e(i);return o.map(s.read,s)}function Zo(t){if(![].concat(t).every(n=>oo.string.isString(n)&&!oo.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}JTe.exports=QW});var lY=y((Icr,MN)=>{"use strict";function rwe(t){return Array.isArray(t)?t:[t]}var Vct=void 0,iY="",ewe=" ",nY="\\",Gct=/^\s+$/,Hct=/(?:[^\\]|^)\\$/,Wct=/^\\!/,Yct=/^\\#/,Kct=/\r?\n/g,Zct=/^\.{0,2}\/|^\.{1,2}$/,Jct=/\/$/,s_="/",nwe="node-ignore";typeof Symbol<"u"&&(nwe=Symbol.for("node-ignore"));var iwe=nwe,a_=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),Xct=/([0-z])-([0-z])/g,owe=()=>!1,Qct=t=>t.replace(Xct,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:iY),elt=t=>{let{length:e}=t;return t.slice(0,e-e%2)},tlt=[[/^\uFEFF/,()=>iY],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?ewe:iY)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+ewe}],[/[\\$.|*+(){^]/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,()=>nY],[/\\\\/g,()=>nY],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===nY?`\\[${r}${elt(n)}${i}`:i==="]"&&n.length%2===0?`[${Qct(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],rlt=/(^|\\\/)?\\\*$/,Bb="regex",NN="checkRegex",twe="_",nlt={[Bb](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[NN](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},ilt=t=>tlt.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),kN=t=>typeof t=="string",olt=t=>t&&kN(t)&&!Gct.test(t)&&!Hct.test(t)&&t.indexOf("#")!==0,slt=t=>t.split(Kct).filter(Boolean),oY=class{constructor(e,r,n,i,o,s){this.pattern=e,this.mark=r,this.negative=o,a_(this,"body",n),a_(this,"ignoreCase",i),a_(this,"regexPrefix",s)}get regex(){let e=twe+Bb;return this[e]?this[e]:this._make(Bb,e)}get checkRegex(){let e=twe+NN;return this[e]?this[e]:this._make(NN,e)}_make(e,r){let n=this.regexPrefix.replace(rlt,nlt[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return a_(this,r,i)}},alt=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(Wct,"!").replace(Yct,"#");let o=ilt(i);return new oY(t,e,i,r,n,o)},sY=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[iwe]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(kN(e)&&(e={pattern:e}),olt(e.pattern)){let r=alt(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,rwe(kN(e)?slt(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,o=!1,s;this._rules.forEach(c=>{let{negative:l}=c;o===l&&i!==o||l&&!i&&!o&&!r||!c[n].test(e)||(i=!l,o=l,s=l?Vct:c)});let a={ignored:i,unignored:o};return s&&(a.rule=s),a}},clt=(t,e)=>{throw new e(t)},gc=(t,e,r)=>kN(t)?t?gc.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),swe=t=>Zct.test(t);gc.isNotRelative=swe;gc.convert=t=>t;var aY=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){a_(this,iwe,!0),this._rules=new sY(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 o=e&&gc.convert(e);return gc(o,e,this._strictPathCheck?clt:owe),this._t(o,r,n,i)}checkIgnore(e){if(!Jct.test(e))return this.test(e);let r=e.split(s_).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(s_)+s_,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,NN)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(s_).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,Bb);let o=this._t(i.join(s_)+s_,r,n,i);return r[e]=o.ignored?o:this._rules.test(e,n,Bb)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return rwe(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},cY=t=>new aY(t),llt=t=>gc(t&&gc.convert(t),t,owe),awe=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");gc.convert=t;let e=/^[a-z]:\//i;gc.isNotRelative=r=>e.test(r)||swe(r)};typeof process<"u"&&process.platform==="win32"&&awe();MN.exports=cY;cY.default=cY;MN.exports.isPathValid=llt;a_(MN.exports,Symbol.for("setupWindows"),awe)});var BY=y(aAe=>{"use strict";aAe.parse=function(t,e){return new jY(t,e).parse()};var jY=class t{constructor(e,r){this.source=e,this.transform=r||Ldt,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 Ldt(t){return t}});var qY=y((Gfr,cAe)=>{"use strict";var Udt=BY();cAe.exports={create:function(t,e){return{parse:function(){return Udt.parse(t,e)}}}}});var dAe=y((Hfr,uAe)=>{"use strict";var Fdt=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,zdt=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,jdt=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Bdt=/^-?infinity$/;uAe.exports=function(e){if(Bdt.test(e))return Number(e.replace("i","I"));var r=Fdt.exec(e);if(!r)return qdt(e)||null;var n=!!r[8],i=parseInt(r[1],10);n&&(i=lAe(i));var o=parseInt(r[2],10)-1,s=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=Vdt(e);return f!=null?(d=new Date(Date.UTC(i,o,s,a,c,l,u)),VY(i)&&d.setUTCFullYear(i),f!==0&&d.setTime(d.getTime()-f)):(d=new Date(i,o,s,a,c,l,u),VY(i)&&d.setFullYear(i)),d};function qdt(t){var e=zdt.exec(t);if(e){var r=parseInt(e[1],10),n=!!e[4];n&&(r=lAe(r));var i=parseInt(e[2],10)-1,o=e[3],s=new Date(r,i,o);return VY(r)&&s.setFullYear(r),s}}function Vdt(t){if(t.endsWith("+00"))return 0;var e=jdt.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 lAe(t){return-(t-1)}function VY(t){return t>=0&&t<100}});var pAe=y((Wfr,fAe)=>{"use strict";fAe.exports=Hdt;var Gdt=Object.prototype.hasOwnProperty;function Hdt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Gdt.call(r,n)&&(t[n]=r[n])}return t}});var gAe=y((Yfr,mAe)=>{"use strict";var Wdt=pAe();mAe.exports=__;function __(t){if(!(this instanceof __))return new __(t);Wdt(this,oft(t))}var Ydt=["seconds","minutes","hours","days","months","years"];__.prototype.toPostgres=function(){var t=Ydt.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 Kdt={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},Zdt=["years","months","days"],Jdt=["hours","minutes","seconds"];__.prototype.toISOString=__.prototype.toISO=function(){var t=Zdt.map(r,this).join(""),e=Jdt.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+Kdt[n]}};var GY="([+-]?\\d+)",Xdt=GY+"\\s+years?",Qdt=GY+"\\s+mons?",eft=GY+"\\s+days?",tft="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",rft=new RegExp([Xdt,Qdt,eft,tft].map(function(t){return"("+t+")?"}).join("\\s*")),hAe={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},nft=["hours","minutes","seconds","milliseconds"];function ift(t){var e=t+"000000".slice(t.length);return parseInt(e,10)/1e3}function oft(t){if(!t)return{};var e=rft.exec(t),r=e[8]==="-";return Object.keys(hAe).reduce(function(n,i){var o=hAe[i],s=e[o];return!s||(s=i==="milliseconds"?ift(s):parseInt(s,10),!s)||(r&&~nft.indexOf(i)&&(s*=-1),n[i]=s),n},{})}});var SAe=y((Kfr,yAe)=>{"use strict";var _Ae=Buffer.from||Buffer;yAe.exports=function(e){if(/^\\x/.test(e))return _Ae(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 o=0;o<Math.floor(i/2);++o)r+="\\";n+=Math.floor(i/2)*2}return _Ae(r,"binary")}});var AAe=y((Zfr,xAe)=>{"use strict";var Qb=BY(),eT=qY(),YN=dAe(),vAe=gAe(),bAe=SAe();function KN(t){return function(r){return r===null?r:t(r)}}function TAe(t){return t===null?t:t==="TRUE"||t==="t"||t==="true"||t==="y"||t==="yes"||t==="on"||t==="1"}function sft(t){return t?Qb.parse(t,TAe):null}function aft(t){return parseInt(t,10)}function HY(t){return t?Qb.parse(t,KN(aft)):null}function cft(t){return t?Qb.parse(t,KN(function(e){return wAe(e).trim()})):null}var lft=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=ZY(r)),r});return e.parse()},WY=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=parseFloat(r)),r});return e.parse()},so=function(t){if(!t)return null;var e=eT.create(t);return e.parse()},YY=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=YN(r)),r});return e.parse()},uft=function(t){if(!t)return null;var e=eT.create(t,function(r){return r!==null&&(r=vAe(r)),r});return e.parse()},dft=function(t){return t?Qb.parse(t,KN(bAe)):null},KY=function(t){return parseInt(t,10)},wAe=function(t){var e=String(t);return/^\d+$/.test(e)?e:t},EAe=function(t){return t?Qb.parse(t,KN(JSON.parse)):null},ZY=function(t){return t[0]!=="("?null:(t=t.substring(1,t.length-1).split(","),{x:parseFloat(t[0]),y:parseFloat(t[1])})},fft=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 o=ZY(e);return o.radius=parseFloat(r),o},pft=function(t){t(20,wAe),t(21,KY),t(23,KY),t(26,KY),t(700,parseFloat),t(701,parseFloat),t(16,TAe),t(1082,YN),t(1114,YN),t(1184,YN),t(600,ZY),t(651,so),t(718,fft),t(1e3,sft),t(1001,dft),t(1005,HY),t(1007,HY),t(1028,HY),t(1016,cft),t(1017,lft),t(1021,WY),t(1022,WY),t(1231,WY),t(1014,so),t(1015,so),t(1008,so),t(1009,so),t(1040,so),t(1041,so),t(1115,YY),t(1182,YY),t(1185,YY),t(1186,vAe),t(1187,uft),t(17,bAe),t(114,JSON.parse.bind(JSON)),t(3802,JSON.parse.bind(JSON)),t(199,EAe),t(3807,EAe),t(3907,so),t(2951,so),t(791,so),t(1183,so),t(1270,so)};xAe.exports={init:pft}});var CAe=y((Jfr,RAe)=>{"use strict";var ai=1e6;function hft(t){var e=t.readInt32BE(0),r=t.readUInt32BE(4),n="";e<0&&(e=~e+(r===0),r=~r+1>>>0,n="-");var i="",o,s,a,c,l,u;{if(o=e%ai,e=e/ai>>>0,s=4294967296*o+r,r=s/ai>>>0,a=""+(s-ai*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(o=e%ai,e=e/ai>>>0,s=4294967296*o+r,r=s/ai>>>0,a=""+(s-ai*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(o=e%ai,e=e/ai>>>0,s=4294967296*o+r,r=s/ai>>>0,a=""+(s-ai*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 o=e%ai,s=4294967296*o+r,a=""+s%ai,n+a+i}RAe.exports=hft});var kAe=y((Xfr,NAe)=>{"use strict";var mft=CAe(),Zt=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 o=r>>3,s=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,s(t[o])&a,c));for(var u=e+r>>3,d=o+1;d<u;d++)l=i(l,s(t[d]),8);var f=(e+r)%8;return f>0&&(l=i(l,s(t[u])>>8-f,f)),l},OAe=function(t,e,r){var n=Math.pow(2,r-1)-1,i=Zt(t,1),o=Zt(t,r,1);if(o===0)return 0;var s=1,a=function(l,u,d){l===0&&(l=1);for(var f=1;f<=d;f++)s/=2,(u&1<<d-f)>0&&(l+=s);return l},c=Zt(t,e,r+1,!1,a);return o==Math.pow(2,r+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,o-n)*c},gft=function(t){return Zt(t,1)==1?-1*(Zt(t,15,1,!0)+1):Zt(t,15,1)},IAe=function(t){return Zt(t,1)==1?-1*(Zt(t,31,1,!0)+1):Zt(t,31,1)},_ft=function(t){return OAe(t,23,8)},yft=function(t){return OAe(t,52,11)},Sft=function(t){var e=Zt(t,16,32);if(e==49152)return NaN;for(var r=Math.pow(1e4,Zt(t,16,16)),n=0,i=[],o=Zt(t,16),s=0;s<o;s++)n+=Zt(t,16,64+16*s)*r,r/=1e4;var a=Math.pow(10,Zt(t,16,48));return(e===0?1:-1)*Math.round(n*a)/a},PAe=function(t,e){var r=Zt(e,1),n=Zt(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(o){this.usec=o},i.getUTCMicroSeconds=function(){return this.usec},i},tT=function(t){for(var e=Zt(t,32),r=Zt(t,32,32),n=Zt(t,32,64),i=96,o=[],s=0;s<e;s++)o[s]=Zt(t,32,i),i+=32,i+=32;var a=function(l){var u=Zt(t,32,i);if(i+=32,u==4294967295)return null;var d;if(l==23||l==20)return d=Zt(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(o,n)},Eft=function(t){return t.toString("utf8")},vft=function(t){return t===null?null:Zt(t,8)>0},bft=function(t){t(20,mft),t(21,gft),t(23,IAe),t(26,IAe),t(1700,Sft),t(700,_ft),t(701,yft),t(16,vft),t(1114,PAe.bind(null,!1)),t(1184,PAe.bind(null,!0)),t(1e3,tT),t(1007,tT),t(1016,tT),t(1008,tT),t(1009,tT),t(25,Eft)};NAe.exports={init:bft}});var $Ae=y((Qfr,MAe)=>{"use strict";MAe.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 iT=y(nT=>{"use strict";var Tft=AAe(),wft=kAe(),xft=qY(),Aft=$Ae();nT.getTypeParser=Rft;nT.setTypeParser=Cft;nT.arrayParser=xft;nT.builtins=Aft;var rT={text:{},binary:{}};function DAe(t){return String(t)}function Rft(t,e){return e=e||"text",rT[e]&&rT[e][t]||DAe}function Cft(t,e,r){typeof e=="function"&&(r=e,e="text"),rT[e][t]=r}Tft.init(function(t,e){rT.text[t]=e});wft.init(function(t,e){rT.binary[t]=e})});var oT=y((tpr,JY)=>{"use strict";var LAe;try{LAe=process.platform==="win32"?process.env.USERNAME:process.env.USER}catch{}JY.exports={host:"localhost",user:LAe,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 y_=iT(),Ift=y_.getTypeParser(20,"text"),Pft=y_.getTypeParser(1016,"text");JY.exports.__defineSetter__("parseInt8",function(t){y_.setTypeParser(20,"text",t?y_.getTypeParser(23,"text"):Ift),y_.setTypeParser(1016,"text",t?y_.getTypeParser(1007,"text"):Pft)})});var S_=y((rpr,FAe)=>{"use strict";var Oft=oT(),{isDate:Nft}=Z("util/types");function kft(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function UAe(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+=UAe(n):ArrayBuffer.isView(n)?(n instanceof Buffer||(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),e+="\\\\x"+n.toString("hex")):e+=kft(ZN(n))}return e+="}",e}var ZN=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):Nft(t)?Oft.parseInputDatesAsUTC?Dft(t):$ft(t):Array.isArray(t)?UAe(t):Mft(t,e):t.toString()};function Mft(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),ZN(t.toPostgres(ZN),e)}return JSON.stringify(t)}function $ft(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 Dft(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 Lft(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 Uft=function(t){return'"'+t.replace(/"/g,'""')+'"'},Fft=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};FAe.exports={prepareValue:function(e){return ZN(e)},normalizeQueryConfig:Lft,escapeIdentifier:Uft,escapeLiteral:Fft}});var eK=y((npr,BAe)=>{"use strict";var zAe=Z("crypto");BAe.exports={postgresMd5PasswordHash:jft,randomBytes:zft,deriveKey:Gft,sha256:Bft,hashByName:qft,hmacSha256:Vft,md5:XY};var jAe=zAe.webcrypto||globalThis.crypto,Cf=jAe.subtle,QY=new TextEncoder;function zft(t){return jAe.getRandomValues(Buffer.alloc(t))}async function XY(t){try{return zAe.createHash("md5").update(t,"utf-8").digest("hex")}catch{let r=typeof t=="string"?QY.encode(t):t,n=await Cf.digest("MD5",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}}async function jft(t,e,r){let n=await XY(e+t);return"md5"+await XY(Buffer.concat([Buffer.from(n),r]))}async function Bft(t){return await Cf.digest("SHA-256",t)}async function qft(t,e){return await Cf.digest(t,e)}async function Vft(t,e){let r=await Cf.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await Cf.sign("HMAC",r,QY.encode(e))}async function Gft(t,e,r){let n=await Cf.importKey("raw",QY.encode(t),"PBKDF2",!1,["deriveBits"]),i={name:"PBKDF2",hash:"SHA-256",salt:e,iterations:r};return await Cf.deriveBits(i,n,256,["deriveBits"])}});var GAe=y((ipr,VAe)=>{"use strict";function If(t,e){return new Error("SASL channel binding: "+t+" when parsing public certificate "+e.toString("base64"))}function tK(t,e){let r=t[e++];if(r<128)return{length:r,index:e};let n=r&127;if(n>4)throw If("bad length",t);r=0;for(let i=0;i<n;i++)r=r<<8|t[e++];return{length:r,index:e}}function qAe(t,e){if(t[e++]!==6)throw If("non-OID data",t);let{length:r,index:n}=tK(t,e);e=n;let i=e+r,o=t[e++],s=(o/40>>0)+"."+o%40;for(;e<i;){let a=0;for(;e<i;){let c=t[e++];if(a=a<<7|c&127,c<128)break}s+="."+a}return{oid:s,index:e}}function sT(t,e){if(t[e++]!==48)throw If("non-sequence data",t);return tK(t,e)}function Hft(t,e){e===void 0&&(e=0),e=sT(t,e).index;let{length:r,index:n}=sT(t,e);e=n+r,e=sT(t,e).index;let{oid:i,index:o}=qAe(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=o,e=sT(t,e).index,t[e++]!==160)throw If("non-tag data",t);e=tK(t,e).index,e=sT(t,e).index;let{oid:s}=qAe(t,e);switch(s){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 If("unknown hash OID "+s,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 If("Ed448 certificate channel binding is not currently supported by Postgres")}throw If("unknown OID "+i,t)}VAe.exports={signatureAlgorithmHashFromCertificate:Hft}});var KAe=y((opr,YAe)=>{"use strict";var hu=eK(),{signatureAlgorithmHashFromCertificate:Wft}=GAe();function Yft(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 rK=1e5;function Kft(t,e,r=rK){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 o=hu.randomBytes(18).toString("base64");return{mechanism:i,clientNonce:o,response:(i==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":e?"y":"n")+",,n=*,r="+o,message:"SASLInitialResponse",scramMaxIterations:r}}async function Zft(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=Qft(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 o=typeof t.scramMaxIterations=="number"?t.scramMaxIterations:rK;if(o!==0&&i.iteration>o)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count "+i.iteration+" exceeds scramMaxIterations of "+o);let s="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 T=n.getPeerCertificate().raw,b=Wft(T);(b==="MD5"||b==="SHA-1")&&(b="SHA-256");let A=await hu.hashByName(b,T);c=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(A)]).toString("base64")}let l="c="+c+",r="+i.nonce,u=s+","+a+","+l,d=Buffer.from(i.salt,"base64"),f=await hu.deriveKey(Yft(e),d,i.iteration),p=await hu.hmacSha256(f,"Client Key"),h=await hu.sha256(p),m=await hu.hmacSha256(h,u),g=tpt(Buffer.from(p),Buffer.from(m)).toString("base64"),_=await hu.hmacSha256(f,"Server Key"),v=await hu.hmacSha256(_,u);t.message="SASLResponse",t.serverSignature=Buffer.from(v).toString("base64"),t.response=l+",p="+g}function Jft(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}=ept(e);if(r!==t.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function Xft(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 HAe(t){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(t)}function WAe(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 Qft(t){let e=WAe(t),r=e.get("r");if(r){if(!Xft(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(!HAe(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 o=parseInt(i,10);return{nonce:r,salt:n,iteration:o}}function ept(t){let e=WAe(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(!HAe(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 tpt(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]))}YAe.exports={startSession:Kft,continueSession:Zft,finalizeSession:Jft,DEFAULT_MAX_SCRAM_ITERATIONS:rK}});var XN=y((spr,ZAe)=>{"use strict";var rpt=iT();function JN(t){this._types=t||rpt,this.text={},this.binary={}}JN.prototype.getOverrides=function(t){switch(t){case"text":return this.text;case"binary":return this.binary;default:return{}}};JN.prototype.setTypeParser=function(t,e,r){typeof e=="function"&&(r=e,e="text"),this.getOverrides(e)[t]=r};JN.prototype.getTypeParser=function(t,e){return e=e||"text",this.getOverrides(e)[t]||this._types.getTypeParser(t,e)};ZAe.exports=JN});var QAe=y((apr,XAe)=>{"use strict";function E_(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 o=i?"":n.hostname;r.host?o&&/^%2f/i.test(o)&&(n.pathname=o+n.pathname):r.host=decodeURIComponent(o),r.port||(r.port=n.port);let s=n.pathname.slice(1)||null;r.database=s?decodeURI(s):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?Z("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"&&nK(r.sslmode);break}case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}function npt(t){return Object.entries(t).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),Object.create(null))}function JAe(t){return Object.entries(t).reduce((r,[n,i])=>{if(n==="ssl"){let o=i;typeof o=="boolean"&&(r[n]=o),typeof o=="object"&&(r[n]=npt(o))}else if(i!=null)if(n==="port"){if(i!==""){let o=parseInt(i,10);if(isNaN(o))throw new Error(`Invalid ${n}: ${i}`);r[n]=o}}else r[n]=i;return r},Object.create(null))}function ipt(t){return JAe(E_(t))}function nK(t){!nK.warned&&typeof process<"u"&&process.emitWarning&&(nK.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
32
32
|
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.
|
|
33
33
|
|
|
34
34
|
To prepare for this change:
|
|
@@ -104,7 +104,7 @@ ${s}
|
|
|
104
104
|
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
105
105
|
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},mF=t=>{if(t==="all")return t;if(Hi.includes(t))return Hi.indexOf(t);let e=LBe.exec(t);if(e!==null)return Number(e[1])},LBe=/^fd(\d+)$/,UBe=(t,e)=>t.map(r=>r===void 0?zBe[e]:r),FBe=OBe("execa").enabled?"full":"none",zBe={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:FBe,stripFinalNewline:!0},gF=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ma=(t,e)=>e==="ipc"?t.at(-1):t[e];var Qp=({verbose:t},e)=>_F(t,e)!=="none",eh=({verbose:t},e)=>!["none","short"].includes(_F(t,e)),boe=({verbose:t},e)=>{let r=_F(t,e);return QR(r)?r:void 0},_F=(t,e)=>e===void 0?jBe(t):Ma(t,e),jBe=t=>t.find(e=>QR(e))??e0.findLast(e=>t.includes(e)),QR=t=>typeof t=="function",e0=["none","short","full"];import{inspect as l2e}from"util";import{platform as BBe}from"process";import{stripVTControlCharacters as qBe}from"util";var Toe=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>KBe(woe(o))).join(" ");return{command:n,escapedCommand:i}},DS=t=>qBe(t).split(`
|
|
106
106
|
`).map(e=>woe(e)).join(`
|
|
107
|
-
`),woe=t=>t.replaceAll(HBe,e=>VBe(e)),VBe=t=>{let e=WBe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=YBe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},GBe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},HBe=GBe(),WBe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},YBe=65535,KBe=t=>ZBe.test(t)?t:BBe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,ZBe=/^[\w./-]+$/;import xoe from"process";function yF(){let{env:t}=xoe,{TERM:e,TERM_PROGRAM:r}=t;return xoe.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Aoe={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Roe={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},JBe={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},XBe={...Aoe,...Roe},QBe={...Aoe,...JBe},e2e=yF(),t2e=e2e?XBe:QBe,t0=t2e,rNt=Object.entries(Roe);import r2e from"tty";var n2e=r2e?.WriteStream?.prototype?.hasColors?.()??!1,
|
|
107
|
+
`),woe=t=>t.replaceAll(HBe,e=>VBe(e)),VBe=t=>{let e=WBe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=YBe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},GBe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},HBe=GBe(),WBe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},YBe=65535,KBe=t=>ZBe.test(t)?t:BBe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,ZBe=/^[\w./-]+$/;import xoe from"process";function yF(){let{env:t}=xoe,{TERM:e,TERM_PROGRAM:r}=t;return xoe.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Aoe={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Roe={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},JBe={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},XBe={...Aoe,...Roe},QBe={...Aoe,...JBe},e2e=yF(),t2e=e2e?XBe:QBe,t0=t2e,rNt=Object.entries(Roe);import r2e from"tty";var n2e=r2e?.WriteStream?.prototype?.hasColors?.()??!1,Ye=(t,e)=>{if(!n2e)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},oNt=Ye(0,0),Coe=Ye(1,22),sNt=Ye(2,22),aNt=Ye(3,23),cNt=Ye(4,24),lNt=Ye(53,55),uNt=Ye(7,27),dNt=Ye(8,28),fNt=Ye(9,29),pNt=Ye(30,39),hNt=Ye(31,39),mNt=Ye(32,39),gNt=Ye(33,39),_Nt=Ye(34,39),yNt=Ye(35,39),SNt=Ye(36,39),ENt=Ye(37,39),r0=Ye(90,39),vNt=Ye(40,49),bNt=Ye(41,49),TNt=Ye(42,49),wNt=Ye(43,49),xNt=Ye(44,49),ANt=Ye(45,49),RNt=Ye(46,49),CNt=Ye(47,49),INt=Ye(100,49),Ioe=Ye(91,39),PNt=Ye(92,39),Poe=Ye(93,39),ONt=Ye(94,39),NNt=Ye(95,39),kNt=Ye(96,39),MNt=Ye(97,39),$Nt=Ye(101,49),DNt=Ye(102,49),LNt=Ye(103,49),UNt=Ye(104,49),FNt=Ye(105,49),zNt=Ye(106,49),jNt=Ye(107,49);var koe=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=i2e(r),c=o2e[t]({failed:o,reject:s,piped:n}),l=s2e[t]({reject:s});return`${r0(`[${a}]`)} ${r0(`[${i}]`)} ${l(c)} ${l(e)}`},i2e=t=>`${n0(t.getHours(),2)}:${n0(t.getMinutes(),2)}:${n0(t.getSeconds(),2)}.${n0(t.getMilliseconds(),3)}`,n0=(t,e)=>String(t).padStart(e,"0"),Ooe=({failed:t,reject:e})=>t?e?t0.cross:t0.warning:t0.tick,o2e={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:Ooe,duration:Ooe},Noe=t=>t,s2e={command:()=>Coe,output:()=>Noe,ipc:()=>Noe,error:({reject:t})=>t?Ioe:Poe,duration:()=>r0};var Moe=(t,e,r)=>{let n=boe(e,r);return t.map(({verboseLine:i,verboseObject:o})=>a2e(i,o,n)).filter(i=>i!==void 0).map(i=>c2e(i)).join("")},a2e=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},c2e=t=>t.endsWith(`
|
|
108
108
|
`)?t:`${t}
|
|
109
109
|
`;var Ts=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=u2e({type:t,result:i,verboseInfo:n}),s=d2e(e,o),a=Moe(s,n,r);a!==""&&console.warn(a.slice(0,-1))},u2e=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),d2e=(t,e)=>t.split(`
|
|
110
110
|
`).map(r=>f2e({...e,message:r})),f2e=t=>({verboseLine:koe(t),verboseObject:t}),i0=t=>{let e=typeof t=="string"?t:l2e(t);return DS(e).replaceAll(" "," ".repeat(p2e))},p2e=2;var $oe=(t,e)=>{Qp(e)&&Ts({type:"command",verboseMessage:t,verboseInfo:e})};var Doe=(t,e,r)=>{g2e(t);let n=h2e(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},h2e=t=>Qp({verbose:t})?m2e++:void 0,m2e=0n,g2e=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!e0.includes(e)&&!QR(e)){let r=e0.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};import{hrtime as Loe}from"process";var o0=()=>Loe.bigint(),SF=t=>Number(Loe.bigint()-t)/1e6;var s0=(t,e,r)=>{let n=o0(),{command:i,escapedCommand:o}=Toe(t,e),s=hF(r,"verbose"),a=Doe(s,o,{...r});return $oe(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}};var Dae=Un(xse(),1);import Qqe from"path";import $ae from"process";import l0 from"process";import sd from"path";function c0(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as q2e}from"util";import{execFile as V2e,execFileSync as Ikt}from"child_process";import Ase from"path";import{fileURLToPath as G2e}from"url";var Nkt=q2e(V2e);function Yn(t){return t instanceof URL?G2e(t):t}function Rse(t){return{*[Symbol.iterator](){let e=Ase.resolve(Yn(t)),r;for(;r!==e;)yield e,r=e,e=Ase.resolve(e,"..")}}}var kkt=10*1024*1024;var H2e=({cwd:t=l0.cwd(),path:e=l0.env[c0()],preferLocal:r=!0,execPath:n=l0.execPath,addExecPath:i=!0}={})=>{let o=sd.resolve(Yn(t)),s=[],a=e.split(sd.delimiter);return r&&W2e(s,a,o),i&&Y2e(s,a,n,o),e===""||e===sd.delimiter?`${s.join(sd.delimiter)}${e}`:[...s,e].join(sd.delimiter)},W2e=(t,e,r)=>{for(let n of Rse(r)){let i=sd.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},Y2e=(t,e,r,n)=>{let i=sd.resolve(n,Yn(r),"..");e.includes(i)||t.push(i)},Cse=({env:t=l0.env,...e}={})=>{t={...t};let r=c0({env:t});return e.path=t[r],t[r]=H2e(e),t};import{setTimeout as lqe}from"timers/promises";var Ise=(t,e,r)=>{let n=r?US:LS,i=t instanceof ko?{}:{cause:t};return new n(e,i)},ko=class extends Error{},Pse=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,Nse,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Ose=t=>u0(t)&&Nse in t,Nse=Symbol("isExecaError"),u0=t=>Object.prototype.toString.call(t)==="[object Error]",LS=class extends Error{};Pse(LS,LS.name);var US=class extends Error{};Pse(US,US.name);import{constants as FS}from"os";import{constants as X2e}from"os";var kse=()=>{let t=$se-Mse+1;return Array.from({length:t},K2e)},K2e=(t,e)=>({name:`SIGRT${e+1}`,number:Mse+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Mse=34,$se=64;import{constants as Z2e}from"os";var Dse=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var IF=()=>{let t=kse();return[...Dse,...t].map(J2e)},J2e=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Z2e,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}};var Q2e=()=>{let t=IF();return Object.fromEntries(t.map(eqe))},eqe=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],Lse=Q2e(),tqe=()=>{let t=IF(),e=65,r=Array.from({length:e},(n,i)=>rqe(i,t));return Object.assign({},...r)},rqe=(t,e)=>{let r=nqe(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},nqe=(t,e)=>{let r=e.find(({name:n})=>X2e.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},Zkt=tqe();var Fse=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return jse(t,e)},zse=t=>t===0?t:jse(t,"`subprocess.kill()`'s argument"),jse=(t,e)=>{if(Number.isInteger(t))return iqe(t,e);if(typeof t=="string")return sqe(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
@@ -140,7 +140,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
|
140
140
|
`,LF:`
|
|
141
141
|
`,concatBytes:rz},tGe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},rGe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:tGe};import{Buffer as nGe}from"buffer";var zce=(t,e)=>t?void 0:iGe.bind(void 0,e),iGe=function*(t,e){if(typeof e!="string"&&!yr(e)&&!nGe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},jce=(t,e)=>t?oGe.bind(void 0,e):sGe.bind(void 0,e),oGe=function*(t,e){Bce(t,e),yield e},sGe=function*(t,e){if(Bce(t,e),typeof e!="string"&&!yr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},Bce=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
142
142
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
143
|
-
if (condition) { yield value; }`)};import{Buffer as aGe}from"buffer";import{StringDecoder as cGe}from"string_decoder";var j0=(t,e,r)=>{if(r)return;if(t)return{transform:lGe.bind(void 0,new TextEncoder)};let n=new cGe(e);return{transform:uGe.bind(void 0,n),final:dGe.bind(void 0,n)}},lGe=function*(t,e){aGe.isBuffer(e)?yield ka(e):typeof e=="string"?yield t.encode(e):yield e},uGe=function*(t,e){yield yr(e)?t.write(e):e},dGe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as qce}from"util";var iz=qce(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),B0=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=pGe}=e[r];for await(let i of n(t))yield*B0(i,e,r+1)},Vce=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*fGe(r,Number(e),t)},fGe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*B0(n,r,e+1)},Gce=qce(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),pGe=function*(t){yield t};var oz=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},Hce=(t,e)=>[...e.flatMap(r=>[...ud(r,t,0)]),...GS(t)],ud=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=mGe}=e[r];for(let i of n(t))yield*ud(i,e,r+1)},GS=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*hGe(r,Number(e),t)},hGe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ud(n,r,e+1)},mGe=function*(t){yield t};var sz=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=Yce(t,s,o),l=ld(e),u=ld(r),d=l?iz.bind(void 0,B0,a):oz.bind(void 0,ud),f=l||u?iz.bind(void 0,Vce,a):oz.bind(void 0,GS),p=l||u?Gce.bind(void 0,a):void 0;return{stream:new gGe({writableObjectMode:n,writableHighWaterMark:Wce(n),readableObjectMode:i,readableHighWaterMark:Wce(i),transform(m,g,_){d([m,c,0],this,_)},flush(m){f([c],this,m)},destroy:p})}},q0=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=Yce(s,r,a);t=Hce(c,t)}return t},Yce=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:zce(n,a)},j0(r,s,n),z0(r,o,n,c),{transform:t,final:e},{transform:jce(i,a)},Fce({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)};var Kce=(t,e)=>{for(let r of _Ge(t))yGe(t,r,e)},_Ge=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),yGe=(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 ${rl[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>SGe(a,n));r.input=$S(s)},SGe=(t,e)=>{let r=q0(t,e,"utf8",!0);return EGe(r),$S(r)},EGe=t=>{let e=t.find(r=>typeof r!="string"&&!yr(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 wGe,appendFileSync as xGe}from"fs";var V0=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&eh(r,n)&&!_i.has(e)&&vGe(n)&&(t.some(({type:i,value:o})=>i==="native"&&bGe.has(o))||t.every(({type:i})=>Wi.has(i))),vGe=t=>t===1||t===2,bGe=new Set(["pipe","overlapped"]),Zce=async(t,e,r,n)=>{for await(let i of t)TGe(e)||Xce(i,r,n)},Jce=(t,e,r)=>{for(let n of t)Xce(n,e,r)},TGe=t=>t._readableState.pipes.length>0,Xce=(t,e,r)=>{let n=i0(t);Ts({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Qce=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>AGe({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},AGe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=ece(t,o,d),p=ka(f),{stdioItems:h,objectMode:m}=e[r],g=RGe([p],h,c,n),{serializedResult:_,finalResult:v=_}=CGe({chunks:g,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});IGe({serializedResult:_,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});let T=a[r]?v:void 0;try{return n.error===void 0&&PGe(_,h,i),T}catch(b){return n.error=b,T}},RGe=(t,e,r,n)=>{try{return q0(t,e,r,!1)}catch(i){return n.error=i,t}},CGe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:$S(t)};let s=hoe(t,r);return n[o]?{serializedResult:s,finalResult:nz(s,!i[o],e)}:{serializedResult:s}},IGe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!V0({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=nz(t,!1,s);try{Jce(a,e,n)}catch(c){r.error??=c}},PGe=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>U0.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?xGe(n,t):(r.add(o),wGe(n,t))}};var ele=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Da(e,r,"all")]:Array.isArray(e)?[Da(t,r,"all"),...e]:yr(t)&&yr(e)?fF([t,e]):`${t}${e}`};import{once as az}from"events";var tle=async(t,e)=>{let[r,n]=await OGe(t);return e.isForcefullyTerminated??=!1,[r,n]},OGe=async t=>{let[e,r]=await Promise.allSettled([az(t,"spawn"),az(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?rle(t):r.value},rle=async t=>{try{return await az(t,"exit")}catch{return rle(t)}},nle=async t=>{let[e,r]=await t;if(!NGe(e,r)&&cz(e,r))throw new ko;return[e,r]},NGe=(t,e)=>t===void 0&&e===void 0,cz=(t,e)=>t!==0||e!==null;var ile=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=kGe(t,e,r),s=o?.code==="ETIMEDOUT",a=Qae(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},kGe=(t,e,r)=>t!==void 0?t:cz(e,r)?new ko:void 0;var ole=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=$Ge(t,e,r),d=UGe({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return uh(d,c,l)},$Ge=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=s0(t,e,r),a=DGe(r),{file:c,commandArguments:l,options:u}=A0(t,e,a);LGe(u);let d=$ce(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},DGe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,LGe=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&G0("ipcInput"),t&&G0("ipc: true"),r&&G0("detached: true"),n&&G0("cancelSignal")},G0=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},UGe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=FGe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=ile(c,r),{output:h,error:m=l}=Qce({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=h.map((v,T)=>Da(v,r,T)),_=Da(ele(h,r),r,"all");return jGe({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:r,command:n,escapedCommand:i,startTime:a})},FGe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{Kce(o,r);let a=zGe(r);return MGe(...R0(t,e,a))}catch(a){return lh({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},zGe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:M0(e)}),jGe=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?$0({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):VS({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as C6e}from"events";import{spawn as I6e}from"child_process";import ule from"process";import{once as lz,on as BGe}from"events";var sle=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(nh({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:E0(t)}),qGe({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),qGe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{g0(e,i);let o=tl(t,e,r),s=new AbortController;try{return await Promise.race([VGe(o,n,s),GGe(o,r,s),HGe(o,r,s)])}catch(a){throw ih(t),a}finally{s.abort(),_0(e,i)}},VGe=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await lz(t,"message",{signal:r});return n}for await(let[n]of BGe(t,"message",{signal:r}))if(e(n))return n},GGe=async(t,e,{signal:r})=>{await lz(t,"disconnect",{signal:r}),Hse(e)},HGe=async(t,e,{signal:r})=>{let[n]=await lz(t,"strict:error",{signal:r});throw p0(n,e)};import{once as cle,on as WGe}from"events";var lle=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>uz({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),uz=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{nh({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:E0(t)}),g0(e,o);let s=tl(t,e,r),a=new AbortController,c={};return YGe(t,s,a),KGe({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),ZGe({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},YGe=async(t,e,r)=>{try{await cle(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},KGe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await cle(t,"strict:error",{signal:r.signal});n.error=p0(i,e),r.abort()}catch{}},ZGe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of WGe(r,"message",{signal:o.signal}))ale(s),yield c}catch{ale(s)}finally{o.abort(),_0(e,a),n||ih(t),i&&await t}},ale=({error:t})=>{if(t)throw t};var dle=(t,{ipc:e})=>{Object.assign(t,ple(t,!1,e))},fle=()=>{let t=ule,e=!0,r=ule.channel!==void 0;return{...ple(t,e,r),getCancelSignal:Sae.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},ple=(t,e,r)=>({sendMessage:w0.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:sle.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:lle.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as JGe}from"child_process";import{PassThrough as XGe,Readable as QGe,Writable as eHe,Duplex as tHe}from"stream";var hle=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{ez(n);let a=new JGe;rHe(a,n),Object.assign(a,{readable:nHe,writable:iHe,duplex:oHe});let c=lh({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=sHe(c,s,i);return{subprocess:a,promise:l}},rHe=(t,e)=>{let r=HS(),n=HS(),i=HS(),o=Array.from({length:e.length-3},HS),s=HS(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},HS=()=>{let t=new XGe;return t.end(),t},nHe=()=>new QGe({read(){}}),iHe=()=>new eHe({write(){}}),oHe=()=>new tHe({read(){},write(){}}),sHe=async(t,e,r)=>uh(t,e,r);import{createReadStream as mle,createWriteStream as gle}from"fs";import{Buffer as aHe}from"buffer";import{Readable as WS,Writable as cHe,Duplex as lHe}from"stream";var yle=(t,e)=>F0(uHe,t,e,!1),YS=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${rl[t]}.`)},_le={fileNumber:YS,generator:sz,asyncGenerator:sz,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:lHe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},uHe={input:{..._le,fileUrl:({value:t})=>({stream:mle(t)}),filePath:({value:{file:t}})=>({stream:mle(t)}),webStream:({value:t})=>({stream:WS.fromWeb(t)}),iterable:({value:t})=>({stream:WS.from(t)}),asyncIterable:({value:t})=>({stream:WS.from(t)}),string:({value:t})=>({stream:WS.from(t)}),uint8Array:({value:t})=>({stream:WS.from(aHe.from(t))})},output:{..._le,fileUrl:({value:t})=>({stream:gle(t)}),filePath:({value:{file:t,append:e}})=>({stream:gle(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:cHe.fromWeb(t)}),iterable:YS,asyncIterable:YS,string:YS,uint8Array:YS}};import{on as dHe,once as Sle}from"events";import{PassThrough as fHe,getDefaultHighWaterMark as pHe}from"stream";import{finished as ble}from"stream/promises";function dd(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)fz(i);let e=t.some(({readableObjectMode:i})=>i),r=hHe(t,e),n=new dz({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var hHe=(t,e)=>{if(t.length===0)return pHe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},dz=class extends fHe{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(fz(e),this.#e.has(e))return;this.#e.add(e),this.#n??=mHe(this,this.#e,this.#o);let r=yHe({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(fz(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)}},mHe=async(t,e,r)=>{H0(t,Ele);let n=new AbortController;try{await Promise.race([gHe(t,n),_He(t,e,r,n)])}finally{n.abort(),H0(t,-Ele)}},gHe=async(t,{signal:e})=>{try{await ble(t,{signal:e,cleanup:!0})}catch(r){throw Tle(t,r),r}},_He=async(t,e,r,{signal:n})=>{for await(let[i]of dHe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},fz=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},yHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{H0(t,vle);let a=new AbortController;try{await Promise.race([SHe(o,e,a),EHe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),vHe({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),H0(t,-vle)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?pz(t):bHe(t))},SHe=async(t,e,{signal:r})=>{try{await t,r.aborted||pz(e)}catch(n){r.aborted||Tle(e,n)}},EHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await ble(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;wle(s)?i.add(e):xle(t,s)}},vHe=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await Sle(t,i,{signal:o}),!t.readable)return Sle(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},bHe=t=>{t.writable&&t.end()},Tle=(t,e)=>{wle(e)?pz(t):xle(t,e)},wle=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",pz=t=>{(t.readable||t.writable)&&t.destroy()},xle=(t,e)=>{t.destroyed||(t.once("error",THe),t.destroy(e))},THe=()=>{},H0=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},Ele=2,vle=1;import{finished as Ale}from"stream/promises";var fh=(t,e)=>{t.pipe(e),wHe(t,e),xHe(t,e)},wHe=async(t,e)=>{if(!(No(t)||No(e))){try{await Ale(t,{cleanup:!0,readable:!0,writable:!1})}catch{}hz(e)}},hz=t=>{t.writable&&t.end()},xHe=async(t,e)=>{if(!(No(t)||No(e))){try{await Ale(e,{cleanup:!0,readable:!1,writable:!0})}catch{}mz(t)}},mz=t=>{t.readable&&t.destroy()};var Rle=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Wi.has(c)))AHe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Wi.has(c)))CHe({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:dd(o);fh(s,i)}},AHe=(t,e,r,n)=>{r==="output"?fh(t.stdio[n],e):fh(e,t.stdio[n]);let i=RHe[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},RHe=["stdin","stdout","stderr"],CHe=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;IHe(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},IHe=(t,{signal:e})=>{No(t)&&ad(t,PHe,e)},PHe=2;import{addAbortListener as kHe}from"events";var fd=[];fd.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&fd.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&fd.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var W0=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",gz=Symbol.for("signal-exit emitter"),_z=globalThis,OHe=Object.defineProperty.bind(Object),yz=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(_z[gz])return _z[gz];OHe(_z,gz,{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 o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},Y0=class{},NHe=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Sz=class extends Y0{onExit(){return()=>{}}load(){}unload(){}},Ez=class extends Y0{#e=vz.platform==="win32"?"SIGINT":"SIGHUP";#r=new yz;#t;#n;#o;#i={};#s=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of fd)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!W0(this.#t))return()=>{};this.#s===!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.#s){this.#s=!0,this.#r.count+=1;for(let e of fd)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.#s&&(this.#s=!1,fd.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.#o,this.#r.count-=1)}#a(e){return W0(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&W0(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)}},vz=globalThis.process,{onExit:Cle,load:kUt,unload:MUt}=NHe(W0(vz)?new Ez(vz):new Sz);var Ile=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Cle(()=>{t.kill()});kHe(n,()=>{i()})};var Ole=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=o0(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=MHe(r,n,i),{sourceStream:d,sourceError:f}=DHe(t,l),{options:p,fileDescriptors:h}=xs.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:o}},MHe=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=$He(t,e,...r),a=m0(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},$He=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Ple,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||uF(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,o,s]=KR(r,...n);return{destination:e(Ple)(i,o,s),pipeOptions:s}}if(xs.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}`)},Ple=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),DHe=(t,e)=>{try{return{sourceStream:oh(t,e)}}catch(r){return{sourceError:r}}};var kle=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=LHe({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw bz({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},LHe=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return mz(t),n;if(e!==void 0)return hz(r),e},bz=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>lh({error:t,command:Nle,escapedCommand:Nle,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Nle="source.pipe(destination)";var Mle=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as UHe}from"stream/promises";var $le=(t,e,r)=>{let n=K0.has(e)?zHe(t,e):FHe(t,e);return ad(t,BHe,r.signal),ad(e,qHe,r.signal),jHe(e),n},FHe=(t,e)=>{let r=dd([t]);return fh(r,e),K0.set(e,r),r},zHe=(t,e)=>{let r=K0.get(e);return r.add(t),r},jHe=async t=>{try{await UHe(t,{cleanup:!0,readable:!1,writable:!0})}catch{}K0.delete(t)},K0=new WeakMap,BHe=2,qHe=1;import{aborted as VHe}from"util";var Dle=(t,e)=>t===void 0?[]:[GHe(t,e)],GHe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await VHe(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw bz({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var Z0=(t,...e)=>{if(ir(e[0]))return Z0.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Ole(t,...e),i=HHe({...n,destination:r});return i.pipe=Z0.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},HHe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=WHe(t,i);kle({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=$le(e,o,d);return await Promise.race([Mle(u),...Dle(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},WHe=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as e6e}from"timers/promises";import{on as YHe}from"events";import{getDefaultHighWaterMark as KHe}from"stream";var J0=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return ZHe(e,s),Ule({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},ZHe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Tz=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;JHe(e,s,t);let a=t.readableObjectMode&&!o;return Ule({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},JHe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Ule=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=YHe(t,"data",{signal:e.signal,highWaterMark:Lle,highWatermark:Lle});return XHe({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},wz=KHe(!0),Lle=wz,XHe=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=QHe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*ud(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*GS(a)}},QHe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[j0(t,r,!e),z0(t,i,!n,{})].filter(Boolean);var Fle=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=t6e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([r6e(t),d]);return}let f=tz(c,r),p=Tz({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([n6e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return h},t6e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!V0({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=Tz({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await Zce(a,t,r,o)},r6e=async t=>{await e6e(),t.readableFlowing===null&&t.resume()},n6e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await O0(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await N0(r,{maxBuffer:o})):await ch(r,{maxBuffer:o})}catch(a){return zle(Zae({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},xz=async t=>{try{return await t}catch(e){return zle(e)}},zle=({bufferedData:t})=>foe(t)?new Uint8Array(t):t;import{finished as i6e}from"stream/promises";var KS=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=o6e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],i6e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||c6e(a,e,r,n)}finally{s.abort()}},o6e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&s6e(t,r,n),n},s6e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{a6e(e,r),n.call(t,...i)}},a6e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},c6e=(t,e,r,n)=>{if(!l6e(t,e,r,n))throw t},l6e=(t,e,r,n=!0)=>r.propagating?jle(t)||X0(t):(r.propagating=!0,Az(r,e)===n?jle(t):X0(t)),Az=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",X0=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",jle=t=>t?.code==="EPIPE";var Ble=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>Rz({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),Rz=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=KS(t,e,l);if(Az(l,e)){await u;return}let[d]=await Promise.all([Fle({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var qle=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?dd([t,e].filter(Boolean)):void 0,Vle=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>Rz({...u6e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:d6e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),u6e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},d6e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as f6e}from"events";var Gle=t=>eh(t,"ipc"),Hle=(t,e)=>{let r=i0(t);Ts({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Wle=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=Gle(o),a=Ma(e,"ipc"),c=Ma(r,"ipc");for await(let l of uz({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Jae(t,i,c),i.push(l)),s&&Hle(l,o);return i},Yle=async(t,e)=>(await Promise.allSettled([t]),e);var Kle=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:_})=>{let v=tle(t,f),T={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:v,propagating:!1},b=Ble({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),A=Vle({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),k=[],P=Wle({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:k,verboseInfo:p}),N=p6e(m,t,T),D=h6e(h,T);try{return await Promise.race([Promise.all([{},nle(v),Promise.all(b),A,P,Iae(t,d),...N,...D]),g,m6e(t,_),...wae(t,o,f,_),...Gse({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:_}),...bae({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:_})])}catch(F){return f.terminationReason??="other",Promise.all([{error:F},v,Promise.all(b.map(E=>xz(E))),xz(A),Yle(P,k),Promise.allSettled(N),Promise.allSettled(D)])}},p6e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:KS(n,i,r)),h6e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>$o(o,{checkOpen:!1})&&!No(o)).map(({type:i,value:o,stream:s=o})=>KS(s,n,e,{isSameDirection:Wi.has(i),stopOnExit:i==="native"}))),m6e=async(t,{signal:e})=>{let[r]=await f6e(t,"error",{signal:e});throw r};var Zle=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ZS=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ws();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},ph=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 g6e}from"stream";import{callbackify as _6e}from"util";import{finished as Jle}from"stream/promises";var Cz=async t=>{if(t!==void 0)try{await Iz(t)}catch{}},Xle=async t=>{if(t!==void 0)try{await Pz(t)}catch{}},Iz=async t=>{await Jle(t,{cleanup:!0,readable:!1,writable:!0})},Pz=async t=>{await Jle(t,{cleanup:!0,readable:!0,writable:!1})},Q0=async(t,e)=>{if(await t,e)throw e},eC=(t,e,r)=>{r&&!X0(r)?t.destroy(r):e&&t.destroy()};var Qle=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||_i.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Oz(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Nz(a,s),{read:f,onStdoutDataDone:p}=kz({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),h=new g6e({read:f,destroy:_6e($z.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Mz({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},Oz=(t,e,r)=>{let n=oh(t,e),i=ZS(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},Nz=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:wz},kz=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ws(),s=J0({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){y6e(this,s,o)},onStdoutDataDone:o}},y6e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},Mz=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await Pz(t),await n,await Cz(i),await e,r.readable&&r.push(null)}catch(o){await Cz(i),eue(r,o)}},$z=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await ph(r,e)&&(eue(t,n),await Q0(e,n))},eue=(t,e)=>{eC(t,t.readable,e)};import{Writable as S6e}from"stream";import{callbackify as tue}from"util";var rue=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=Dz(t,r,e),s=new S6e({...Lz(n,t,i),destroy:tue(Fz.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Uz(n,s),s},Dz=(t,e,r)=>{let n=m0(t,e),i=ZS(r,n,"writableFinal"),o=ZS(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},Lz=(t,e,r)=>({write:E6e.bind(void 0,t),final:tue(v6e.bind(void 0,t,e,r))}),E6e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},v6e=async(t,e,r)=>{await ph(r,e)&&(t.writable&&t.end(),await e)},Uz=async(t,e,r)=>{try{await Iz(t),e.writable&&e.end()}catch(n){await Xle(r),nue(e,n)}},Fz=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await ph(r,e),await ph(n,e)&&(nue(t,i),await Q0(e,i))},nue=(t,e)=>{eC(t,t.writable,e)};import{Duplex as b6e}from"stream";import{callbackify as T6e}from"util";var iue=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||_i.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Oz(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Dz(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=Nz(c,a),{read:g,onStdoutDataDone:_}=kz({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),v=new b6e({read:g,...Lz(u,t,d),destroy:T6e(w6e.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 Mz({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:t,subprocessStdin:u}),Uz(u,v,c),v},w6e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([$z({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),Fz({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var zz=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||_i.has(e),s=oh(t,r),a=J0({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return x6e(a,s,t)},x6e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var oue=(t,{encoding:e})=>{let r=Zle();t.readable=Qle.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=rue.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=iue.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=zz.bind(void 0,t,e),t[Symbol.asyncIterator]=zz.bind(void 0,t,e,{})};var sue=(t,e)=>{for(let[r,n]of R6e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},A6e=(async()=>{})().constructor.prototype,R6e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(A6e,t)]);var aue=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=P6e(t,e,r),{subprocess:f,promise:p}=N6e({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=Z0.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),sue(f,p),xs.set(f,{options:u,fileDescriptors:d}),f},P6e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=s0(t,e,r),{file:a,commandArguments:c,options:l}=A0(t,e,r),u=O6e(l),d=yle(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},O6e=({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}},N6e=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=I6e(...R0(t,e,r))}catch(h){return hle({error:h,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;C6e(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];Rle(c,a,l),Ile(c,r,l);let d={},f=ws();c.kill=qse.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=qle(c,r),oue(c,r),dle(c,r);let p=k6e({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},k6e=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,g]=await Kle({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let _=h.map((b,A)=>Da(b,e,A)),v=Da(m,e,"all"),T=M6e({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return uh(T,n,e)},M6e=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?VS({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof As,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):$0({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u});var tC=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,$6e(n,t[n],i)]));return{...t,...r}},$6e=(t,e,r)=>D6e.has(t)&&ir(e)&&ir(r)?{...e,...r}:r,D6e=new Set(["env",...gF]);var nl=(t,e,r,n)=>{let i=(s,a,c)=>nl(s,a,r,c),o=(...s)=>L6e({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},L6e=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(ir(o))return i(t,tC(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=U6e({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?ole(a,c,l):aue(a,c,l,i)},U6e=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=yoe(e)?Soe(e,r):[e,...r],[s,a,c]=KR(...o),l=tC(tC(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var cue=({file:t,commandArguments:e})=>uue(t,e),lue=({file:t,commandArguments:e})=>({...uue(t,e),isSync:!0}),uue=(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]=F6e(t);return{file:r,commandArguments:n}},F6e=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(z6e)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},z6e=/ +/g;var due=(t,e,r)=>{t.sync=e(j6e,r),t.s=t.sync},fue=({options:t})=>pue(t),j6e=({options:t})=>({...pue(t),isSync:!0}),pue=t=>({options:{...B6e(t),...t}}),B6e=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},hue={preferLocal:!0};var mue=nl(()=>({})),Tjt=nl(()=>({isSync:!0})),gue=nl(cue),wjt=nl(lue),xjt=nl(Aae),Ajt=nl(fue,{},hue,due),{sendMessage:Rjt,getOneMessage:Cjt,getEachMessage:Ijt,getCancelSignal:Pjt}=fle();var _ue=!1,yue=()=>{_ue=!0},Cs=()=>_ue;var JS=null,Sue=t=>(JS&&JS.destroy(),JS=new Do({totalAllowedTime:t}),JS),Eue=()=>JS;var Do=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&&Cs())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let o=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),s=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{s=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await LR({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{ne.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),o(),s&&clearTimeout(s)}};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 vue={name:"@netlify/agent-runner-cli",type:"module",version:"1.172.0-model-default-effort.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:{prebuild:"rm -rf dist",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:opencode":"vitest run test/integration/opencode.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.6","@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.2.1","@netlify/otel":"^6.0.6","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.153.4","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.12.1",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var H6e=V6e(import.meta.url),W6e=La.dirname(H6e),Y6e=G6e(import.meta.url),hh=le("shell"),jz=new Set,bue={preferLocal:!0},jt=(t,e,r)=>{let[n,i]=K6e(e,r),o={...bue,...i},s=mue(t,n,o);wue(s,o),Rue(s);let a=r?.idleTimeout;return a&&a>0&&Aue(s,a),s},Tue=(t,e)=>{let r={...bue,...e},n=gue(t,r);return wue(n,r),Rue(n),e?.idleTimeout&&e.idleTimeout>0&&Aue(n,e.idleTimeout),n},K6e=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},wue=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0||Is.env.NETLIFY_LOCAL_QUIET==="true")return;if(Is.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new AS).pipe(Is.stdout),t.stderr?.pipe(new AS).pipe(Is.stderr);return}t.stdout?.pipe(Is.stdout),t.stderr?.pipe(Is.stderr)},Bz=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(Is.kill(-t.pid,e),hh.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return hh.error("Error killing process:",r),!1}},xue=t=>Bz(t,"SIGKILL"),Aue=(t,e)=>{let r=null,n=()=>{hh.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),Bz(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(hh.log(`Force killing idle process ${t.pid}`),xue(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let o=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",o),t.on("error",o)},Rue=t=>{jz.add(t);let e=Eue();if(e){let r=e.onTimesUp(()=>{hh.log(`Global timer expired, killing process ${t.pid}`),Bz(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(hh.log(`Force killing process ${t.pid} after timeout`),xue(t))},5e3)});t.on("exit",()=>{jz.delete(t),r()}),t.on("error",()=>{jz.delete(t),r()})}};function Ps(t,e){if(!Is.env.NETLIFY_LOCAL_MODE)try{let i=Y6e.resolve(vue.name),o=La.dirname(i);for(;o!==La.dirname(o);){let s=La.dirname(o);if(La.basename(s)==="node_modules"){let a=La.join(s,".bin",e);if(rC.existsSync(a))return a;break}o=s}}catch(i){console.error("Could not resolve package.json",i)}if(Is.env.NODE_PATH){let i=La.join(Is.env.NODE_PATH,".bin",e);if(rC.existsSync(i))return i}let r=La.join(t,"node_modules",".bin",e);if(rC.existsSync(r))return r;let n=La.join(W6e,"..","node_modules",".bin",e);if(rC.existsSync(n))return n}var Cue=le("repo"),kue="runner-diffs-",Mue=t=>`${kue}${t}-`,$ue=async t=>{let e=Nue.tmpdir(),r;try{r=await nC.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(kue)&&!n.startsWith(Mue(t))).map(n=>nC.rm(iC.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Kn=(t,e={})=>jt("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),oC=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{Cue.info("Getting runner diffs");let n=await Q6e(r),{hasChanges:i}=n,{status:o}=n;if(!i)return{hasChanges:!1};if(!e){let h=t3e(o);await r3e(h,r)}Cue.info("Changes after processing"),await Vz(r);let s=await Hz(o,r);if(await qz(s,r),i=await e3e(r),!i)return{hasChanges:!1,ignored:s};await Kn(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await nC.mkdtemp(iC.join(Nue.tmpdir(),Mue(t.sessionId))),c=async({from:h,to:m,fileName:g,binary:_})=>{let v=iC.join(a,g);await Kn([..._?["diff",h,m,"--binary"]:["diff",h,m],`--output=${v}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:b}=await nC.stat(v);return{path:v,size:b}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await Oue(r),{hasChanges:!1,ignored:s};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 Pue(d,h)||(f=h)}await Oue(r),ne.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:s};return await Pue(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Iue=async t=>{let e=Z6e("sha256");for await(let r of J6e(t))e.update(r);return e.digest("hex")},Pue=async(t,e)=>t.size===e.size&&await Iue(t.path)===await Iue(e.path),Oue=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Kn(["reset","--soft","HEAD~1"],{cwd:t})},qz=async(t=[],e=process.cwd())=>{await Kn(["add",".",...t],{cwd:e})},Vz=async(t=process.cwd())=>{let e=await Kn(["status","-s"],{cwd:t});return String(e.stdout??"")},Due=/.. (.+)?\.log$/,X6e=[Due],Q6e=async(t=process.cwd())=>{let e=await Vz(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
|
|
143
|
+
if (condition) { yield value; }`)};import{Buffer as aGe}from"buffer";import{StringDecoder as cGe}from"string_decoder";var j0=(t,e,r)=>{if(r)return;if(t)return{transform:lGe.bind(void 0,new TextEncoder)};let n=new cGe(e);return{transform:uGe.bind(void 0,n),final:dGe.bind(void 0,n)}},lGe=function*(t,e){aGe.isBuffer(e)?yield ka(e):typeof e=="string"?yield t.encode(e):yield e},uGe=function*(t,e){yield yr(e)?t.write(e):e},dGe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as qce}from"util";var iz=qce(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),B0=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=pGe}=e[r];for await(let i of n(t))yield*B0(i,e,r+1)},Vce=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*fGe(r,Number(e),t)},fGe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*B0(n,r,e+1)},Gce=qce(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),pGe=function*(t){yield t};var oz=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},Hce=(t,e)=>[...e.flatMap(r=>[...ud(r,t,0)]),...GS(t)],ud=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=mGe}=e[r];for(let i of n(t))yield*ud(i,e,r+1)},GS=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*hGe(r,Number(e),t)},hGe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ud(n,r,e+1)},mGe=function*(t){yield t};var sz=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=Yce(t,s,o),l=ld(e),u=ld(r),d=l?iz.bind(void 0,B0,a):oz.bind(void 0,ud),f=l||u?iz.bind(void 0,Vce,a):oz.bind(void 0,GS),p=l||u?Gce.bind(void 0,a):void 0;return{stream:new gGe({writableObjectMode:n,writableHighWaterMark:Wce(n),readableObjectMode:i,readableHighWaterMark:Wce(i),transform(m,g,_){d([m,c,0],this,_)},flush(m){f([c],this,m)},destroy:p})}},q0=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=Yce(s,r,a);t=Hce(c,t)}return t},Yce=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:zce(n,a)},j0(r,s,n),z0(r,o,n,c),{transform:t,final:e},{transform:jce(i,a)},Fce({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)};var Kce=(t,e)=>{for(let r of _Ge(t))yGe(t,r,e)},_Ge=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),yGe=(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 ${rl[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>SGe(a,n));r.input=$S(s)},SGe=(t,e)=>{let r=q0(t,e,"utf8",!0);return EGe(r),$S(r)},EGe=t=>{let e=t.find(r=>typeof r!="string"&&!yr(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 wGe,appendFileSync as xGe}from"fs";var V0=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&eh(r,n)&&!_i.has(e)&&vGe(n)&&(t.some(({type:i,value:o})=>i==="native"&&bGe.has(o))||t.every(({type:i})=>Wi.has(i))),vGe=t=>t===1||t===2,bGe=new Set(["pipe","overlapped"]),Zce=async(t,e,r,n)=>{for await(let i of t)TGe(e)||Xce(i,r,n)},Jce=(t,e,r)=>{for(let n of t)Xce(n,e,r)},TGe=t=>t._readableState.pipes.length>0,Xce=(t,e,r)=>{let n=i0(t);Ts({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Qce=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>AGe({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},AGe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=ece(t,o,d),p=ka(f),{stdioItems:h,objectMode:m}=e[r],g=RGe([p],h,c,n),{serializedResult:_,finalResult:v=_}=CGe({chunks:g,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});IGe({serializedResult:_,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});let T=a[r]?v:void 0;try{return n.error===void 0&&PGe(_,h,i),T}catch(b){return n.error=b,T}},RGe=(t,e,r,n)=>{try{return q0(t,e,r,!1)}catch(i){return n.error=i,t}},CGe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:$S(t)};let s=hoe(t,r);return n[o]?{serializedResult:s,finalResult:nz(s,!i[o],e)}:{serializedResult:s}},IGe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!V0({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=nz(t,!1,s);try{Jce(a,e,n)}catch(c){r.error??=c}},PGe=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>U0.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?xGe(n,t):(r.add(o),wGe(n,t))}};var ele=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Da(e,r,"all")]:Array.isArray(e)?[Da(t,r,"all"),...e]:yr(t)&&yr(e)?fF([t,e]):`${t}${e}`};import{once as az}from"events";var tle=async(t,e)=>{let[r,n]=await OGe(t);return e.isForcefullyTerminated??=!1,[r,n]},OGe=async t=>{let[e,r]=await Promise.allSettled([az(t,"spawn"),az(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?rle(t):r.value},rle=async t=>{try{return await az(t,"exit")}catch{return rle(t)}},nle=async t=>{let[e,r]=await t;if(!NGe(e,r)&&cz(e,r))throw new ko;return[e,r]},NGe=(t,e)=>t===void 0&&e===void 0,cz=(t,e)=>t!==0||e!==null;var ile=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=kGe(t,e,r),s=o?.code==="ETIMEDOUT",a=Qae(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},kGe=(t,e,r)=>t!==void 0?t:cz(e,r)?new ko:void 0;var ole=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=$Ge(t,e,r),d=UGe({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return uh(d,c,l)},$Ge=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=s0(t,e,r),a=DGe(r),{file:c,commandArguments:l,options:u}=A0(t,e,a);LGe(u);let d=$ce(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},DGe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,LGe=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&G0("ipcInput"),t&&G0("ipc: true"),r&&G0("detached: true"),n&&G0("cancelSignal")},G0=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},UGe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=FGe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=ile(c,r),{output:h,error:m=l}=Qce({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=h.map((v,T)=>Da(v,r,T)),_=Da(ele(h,r),r,"all");return jGe({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:r,command:n,escapedCommand:i,startTime:a})},FGe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{Kce(o,r);let a=zGe(r);return MGe(...R0(t,e,a))}catch(a){return lh({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},zGe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:M0(e)}),jGe=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?$0({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):VS({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as C6e}from"events";import{spawn as I6e}from"child_process";import ule from"process";import{once as lz,on as BGe}from"events";var sle=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(nh({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:E0(t)}),qGe({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),qGe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{g0(e,i);let o=tl(t,e,r),s=new AbortController;try{return await Promise.race([VGe(o,n,s),GGe(o,r,s),HGe(o,r,s)])}catch(a){throw ih(t),a}finally{s.abort(),_0(e,i)}},VGe=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await lz(t,"message",{signal:r});return n}for await(let[n]of BGe(t,"message",{signal:r}))if(e(n))return n},GGe=async(t,e,{signal:r})=>{await lz(t,"disconnect",{signal:r}),Hse(e)},HGe=async(t,e,{signal:r})=>{let[n]=await lz(t,"strict:error",{signal:r});throw p0(n,e)};import{once as cle,on as WGe}from"events";var lle=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>uz({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),uz=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{nh({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:E0(t)}),g0(e,o);let s=tl(t,e,r),a=new AbortController,c={};return YGe(t,s,a),KGe({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),ZGe({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},YGe=async(t,e,r)=>{try{await cle(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},KGe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await cle(t,"strict:error",{signal:r.signal});n.error=p0(i,e),r.abort()}catch{}},ZGe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of WGe(r,"message",{signal:o.signal}))ale(s),yield c}catch{ale(s)}finally{o.abort(),_0(e,a),n||ih(t),i&&await t}},ale=({error:t})=>{if(t)throw t};var dle=(t,{ipc:e})=>{Object.assign(t,ple(t,!1,e))},fle=()=>{let t=ule,e=!0,r=ule.channel!==void 0;return{...ple(t,e,r),getCancelSignal:Sae.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},ple=(t,e,r)=>({sendMessage:w0.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:sle.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:lle.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as JGe}from"child_process";import{PassThrough as XGe,Readable as QGe,Writable as eHe,Duplex as tHe}from"stream";var hle=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{ez(n);let a=new JGe;rHe(a,n),Object.assign(a,{readable:nHe,writable:iHe,duplex:oHe});let c=lh({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=sHe(c,s,i);return{subprocess:a,promise:l}},rHe=(t,e)=>{let r=HS(),n=HS(),i=HS(),o=Array.from({length:e.length-3},HS),s=HS(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},HS=()=>{let t=new XGe;return t.end(),t},nHe=()=>new QGe({read(){}}),iHe=()=>new eHe({write(){}}),oHe=()=>new tHe({read(){},write(){}}),sHe=async(t,e,r)=>uh(t,e,r);import{createReadStream as mle,createWriteStream as gle}from"fs";import{Buffer as aHe}from"buffer";import{Readable as WS,Writable as cHe,Duplex as lHe}from"stream";var yle=(t,e)=>F0(uHe,t,e,!1),YS=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${rl[t]}.`)},_le={fileNumber:YS,generator:sz,asyncGenerator:sz,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:lHe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},uHe={input:{..._le,fileUrl:({value:t})=>({stream:mle(t)}),filePath:({value:{file:t}})=>({stream:mle(t)}),webStream:({value:t})=>({stream:WS.fromWeb(t)}),iterable:({value:t})=>({stream:WS.from(t)}),asyncIterable:({value:t})=>({stream:WS.from(t)}),string:({value:t})=>({stream:WS.from(t)}),uint8Array:({value:t})=>({stream:WS.from(aHe.from(t))})},output:{..._le,fileUrl:({value:t})=>({stream:gle(t)}),filePath:({value:{file:t,append:e}})=>({stream:gle(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:cHe.fromWeb(t)}),iterable:YS,asyncIterable:YS,string:YS,uint8Array:YS}};import{on as dHe,once as Sle}from"events";import{PassThrough as fHe,getDefaultHighWaterMark as pHe}from"stream";import{finished as ble}from"stream/promises";function dd(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)fz(i);let e=t.some(({readableObjectMode:i})=>i),r=hHe(t,e),n=new dz({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var hHe=(t,e)=>{if(t.length===0)return pHe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},dz=class extends fHe{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(fz(e),this.#e.has(e))return;this.#e.add(e),this.#n??=mHe(this,this.#e,this.#o);let r=yHe({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(fz(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)}},mHe=async(t,e,r)=>{H0(t,Ele);let n=new AbortController;try{await Promise.race([gHe(t,n),_He(t,e,r,n)])}finally{n.abort(),H0(t,-Ele)}},gHe=async(t,{signal:e})=>{try{await ble(t,{signal:e,cleanup:!0})}catch(r){throw Tle(t,r),r}},_He=async(t,e,r,{signal:n})=>{for await(let[i]of dHe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},fz=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},yHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{H0(t,vle);let a=new AbortController;try{await Promise.race([SHe(o,e,a),EHe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),vHe({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),H0(t,-vle)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?pz(t):bHe(t))},SHe=async(t,e,{signal:r})=>{try{await t,r.aborted||pz(e)}catch(n){r.aborted||Tle(e,n)}},EHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await ble(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;wle(s)?i.add(e):xle(t,s)}},vHe=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await Sle(t,i,{signal:o}),!t.readable)return Sle(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},bHe=t=>{t.writable&&t.end()},Tle=(t,e)=>{wle(e)?pz(t):xle(t,e)},wle=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",pz=t=>{(t.readable||t.writable)&&t.destroy()},xle=(t,e)=>{t.destroyed||(t.once("error",THe),t.destroy(e))},THe=()=>{},H0=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},Ele=2,vle=1;import{finished as Ale}from"stream/promises";var fh=(t,e)=>{t.pipe(e),wHe(t,e),xHe(t,e)},wHe=async(t,e)=>{if(!(No(t)||No(e))){try{await Ale(t,{cleanup:!0,readable:!0,writable:!1})}catch{}hz(e)}},hz=t=>{t.writable&&t.end()},xHe=async(t,e)=>{if(!(No(t)||No(e))){try{await Ale(e,{cleanup:!0,readable:!1,writable:!0})}catch{}mz(t)}},mz=t=>{t.readable&&t.destroy()};var Rle=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Wi.has(c)))AHe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Wi.has(c)))CHe({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:dd(o);fh(s,i)}},AHe=(t,e,r,n)=>{r==="output"?fh(t.stdio[n],e):fh(e,t.stdio[n]);let i=RHe[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},RHe=["stdin","stdout","stderr"],CHe=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;IHe(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},IHe=(t,{signal:e})=>{No(t)&&ad(t,PHe,e)},PHe=2;import{addAbortListener as kHe}from"events";var fd=[];fd.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&fd.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&fd.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var W0=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",gz=Symbol.for("signal-exit emitter"),_z=globalThis,OHe=Object.defineProperty.bind(Object),yz=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(_z[gz])return _z[gz];OHe(_z,gz,{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 o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},Y0=class{},NHe=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Sz=class extends Y0{onExit(){return()=>{}}load(){}unload(){}},Ez=class extends Y0{#e=vz.platform==="win32"?"SIGINT":"SIGHUP";#r=new yz;#t;#n;#o;#i={};#s=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of fd)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!W0(this.#t))return()=>{};this.#s===!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.#s){this.#s=!0,this.#r.count+=1;for(let e of fd)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.#s&&(this.#s=!1,fd.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.#o,this.#r.count-=1)}#a(e){return W0(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&W0(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)}},vz=globalThis.process,{onExit:Cle,load:kUt,unload:MUt}=NHe(W0(vz)?new Ez(vz):new Sz);var Ile=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Cle(()=>{t.kill()});kHe(n,()=>{i()})};var Ole=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=o0(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=MHe(r,n,i),{sourceStream:d,sourceError:f}=DHe(t,l),{options:p,fileDescriptors:h}=xs.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:o}},MHe=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=$He(t,e,...r),a=m0(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},$He=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Ple,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||uF(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,o,s]=KR(r,...n);return{destination:e(Ple)(i,o,s),pipeOptions:s}}if(xs.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}`)},Ple=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),DHe=(t,e)=>{try{return{sourceStream:oh(t,e)}}catch(r){return{sourceError:r}}};var kle=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=LHe({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw bz({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},LHe=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return mz(t),n;if(e!==void 0)return hz(r),e},bz=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>lh({error:t,command:Nle,escapedCommand:Nle,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Nle="source.pipe(destination)";var Mle=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as UHe}from"stream/promises";var $le=(t,e,r)=>{let n=K0.has(e)?zHe(t,e):FHe(t,e);return ad(t,BHe,r.signal),ad(e,qHe,r.signal),jHe(e),n},FHe=(t,e)=>{let r=dd([t]);return fh(r,e),K0.set(e,r),r},zHe=(t,e)=>{let r=K0.get(e);return r.add(t),r},jHe=async t=>{try{await UHe(t,{cleanup:!0,readable:!1,writable:!0})}catch{}K0.delete(t)},K0=new WeakMap,BHe=2,qHe=1;import{aborted as VHe}from"util";var Dle=(t,e)=>t===void 0?[]:[GHe(t,e)],GHe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await VHe(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw bz({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var Z0=(t,...e)=>{if(ir(e[0]))return Z0.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Ole(t,...e),i=HHe({...n,destination:r});return i.pipe=Z0.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},HHe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=WHe(t,i);kle({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=$le(e,o,d);return await Promise.race([Mle(u),...Dle(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},WHe=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as e6e}from"timers/promises";import{on as YHe}from"events";import{getDefaultHighWaterMark as KHe}from"stream";var J0=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return ZHe(e,s),Ule({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},ZHe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Tz=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;JHe(e,s,t);let a=t.readableObjectMode&&!o;return Ule({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},JHe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Ule=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=YHe(t,"data",{signal:e.signal,highWaterMark:Lle,highWatermark:Lle});return XHe({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},wz=KHe(!0),Lle=wz,XHe=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=QHe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*ud(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*GS(a)}},QHe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[j0(t,r,!e),z0(t,i,!n,{})].filter(Boolean);var Fle=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=t6e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([r6e(t),d]);return}let f=tz(c,r),p=Tz({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([n6e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return h},t6e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!V0({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=Tz({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await Zce(a,t,r,o)},r6e=async t=>{await e6e(),t.readableFlowing===null&&t.resume()},n6e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await O0(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await N0(r,{maxBuffer:o})):await ch(r,{maxBuffer:o})}catch(a){return zle(Zae({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},xz=async t=>{try{return await t}catch(e){return zle(e)}},zle=({bufferedData:t})=>foe(t)?new Uint8Array(t):t;import{finished as i6e}from"stream/promises";var KS=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=o6e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],i6e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||c6e(a,e,r,n)}finally{s.abort()}},o6e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&s6e(t,r,n),n},s6e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{a6e(e,r),n.call(t,...i)}},a6e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},c6e=(t,e,r,n)=>{if(!l6e(t,e,r,n))throw t},l6e=(t,e,r,n=!0)=>r.propagating?jle(t)||X0(t):(r.propagating=!0,Az(r,e)===n?jle(t):X0(t)),Az=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",X0=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",jle=t=>t?.code==="EPIPE";var Ble=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>Rz({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),Rz=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=KS(t,e,l);if(Az(l,e)){await u;return}let[d]=await Promise.all([Fle({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var qle=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?dd([t,e].filter(Boolean)):void 0,Vle=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>Rz({...u6e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:d6e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),u6e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},d6e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as f6e}from"events";var Gle=t=>eh(t,"ipc"),Hle=(t,e)=>{let r=i0(t);Ts({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Wle=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=Gle(o),a=Ma(e,"ipc"),c=Ma(r,"ipc");for await(let l of uz({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Jae(t,i,c),i.push(l)),s&&Hle(l,o);return i},Yle=async(t,e)=>(await Promise.allSettled([t]),e);var Kle=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:_})=>{let v=tle(t,f),T={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:v,propagating:!1},b=Ble({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),A=Vle({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),k=[],P=Wle({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:k,verboseInfo:p}),N=p6e(m,t,T),D=h6e(h,T);try{return await Promise.race([Promise.all([{},nle(v),Promise.all(b),A,P,Iae(t,d),...N,...D]),g,m6e(t,_),...wae(t,o,f,_),...Gse({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:_}),...bae({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:_})])}catch(F){return f.terminationReason??="other",Promise.all([{error:F},v,Promise.all(b.map(E=>xz(E))),xz(A),Yle(P,k),Promise.allSettled(N),Promise.allSettled(D)])}},p6e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:KS(n,i,r)),h6e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>$o(o,{checkOpen:!1})&&!No(o)).map(({type:i,value:o,stream:s=o})=>KS(s,n,e,{isSameDirection:Wi.has(i),stopOnExit:i==="native"}))),m6e=async(t,{signal:e})=>{let[r]=await f6e(t,"error",{signal:e});throw r};var Zle=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ZS=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ws();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},ph=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 g6e}from"stream";import{callbackify as _6e}from"util";import{finished as Jle}from"stream/promises";var Cz=async t=>{if(t!==void 0)try{await Iz(t)}catch{}},Xle=async t=>{if(t!==void 0)try{await Pz(t)}catch{}},Iz=async t=>{await Jle(t,{cleanup:!0,readable:!1,writable:!0})},Pz=async t=>{await Jle(t,{cleanup:!0,readable:!0,writable:!1})},Q0=async(t,e)=>{if(await t,e)throw e},eC=(t,e,r)=>{r&&!X0(r)?t.destroy(r):e&&t.destroy()};var Qle=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||_i.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Oz(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Nz(a,s),{read:f,onStdoutDataDone:p}=kz({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),h=new g6e({read:f,destroy:_6e($z.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Mz({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},Oz=(t,e,r)=>{let n=oh(t,e),i=ZS(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},Nz=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:wz},kz=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ws(),s=J0({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){y6e(this,s,o)},onStdoutDataDone:o}},y6e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},Mz=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await Pz(t),await n,await Cz(i),await e,r.readable&&r.push(null)}catch(o){await Cz(i),eue(r,o)}},$z=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await ph(r,e)&&(eue(t,n),await Q0(e,n))},eue=(t,e)=>{eC(t,t.readable,e)};import{Writable as S6e}from"stream";import{callbackify as tue}from"util";var rue=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=Dz(t,r,e),s=new S6e({...Lz(n,t,i),destroy:tue(Fz.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Uz(n,s),s},Dz=(t,e,r)=>{let n=m0(t,e),i=ZS(r,n,"writableFinal"),o=ZS(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},Lz=(t,e,r)=>({write:E6e.bind(void 0,t),final:tue(v6e.bind(void 0,t,e,r))}),E6e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},v6e=async(t,e,r)=>{await ph(r,e)&&(t.writable&&t.end(),await e)},Uz=async(t,e,r)=>{try{await Iz(t),e.writable&&e.end()}catch(n){await Xle(r),nue(e,n)}},Fz=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await ph(r,e),await ph(n,e)&&(nue(t,i),await Q0(e,i))},nue=(t,e)=>{eC(t,t.writable,e)};import{Duplex as b6e}from"stream";import{callbackify as T6e}from"util";var iue=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||_i.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Oz(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Dz(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=Nz(c,a),{read:g,onStdoutDataDone:_}=kz({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),v=new b6e({read:g,...Lz(u,t,d),destroy:T6e(w6e.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 Mz({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:t,subprocessStdin:u}),Uz(u,v,c),v},w6e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([$z({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),Fz({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var zz=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||_i.has(e),s=oh(t,r),a=J0({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return x6e(a,s,t)},x6e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var oue=(t,{encoding:e})=>{let r=Zle();t.readable=Qle.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=rue.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=iue.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=zz.bind(void 0,t,e),t[Symbol.asyncIterator]=zz.bind(void 0,t,e,{})};var sue=(t,e)=>{for(let[r,n]of R6e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},A6e=(async()=>{})().constructor.prototype,R6e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(A6e,t)]);var aue=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=P6e(t,e,r),{subprocess:f,promise:p}=N6e({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=Z0.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),sue(f,p),xs.set(f,{options:u,fileDescriptors:d}),f},P6e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=s0(t,e,r),{file:a,commandArguments:c,options:l}=A0(t,e,r),u=O6e(l),d=yle(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},O6e=({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}},N6e=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=I6e(...R0(t,e,r))}catch(h){return hle({error:h,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;C6e(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];Rle(c,a,l),Ile(c,r,l);let d={},f=ws();c.kill=qse.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=qle(c,r),oue(c,r),dle(c,r);let p=k6e({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},k6e=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,g]=await Kle({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let _=h.map((b,A)=>Da(b,e,A)),v=Da(m,e,"all"),T=M6e({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return uh(T,n,e)},M6e=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?VS({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof As,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):$0({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u});var tC=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,$6e(n,t[n],i)]));return{...t,...r}},$6e=(t,e,r)=>D6e.has(t)&&ir(e)&&ir(r)?{...e,...r}:r,D6e=new Set(["env",...gF]);var nl=(t,e,r,n)=>{let i=(s,a,c)=>nl(s,a,r,c),o=(...s)=>L6e({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},L6e=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(ir(o))return i(t,tC(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=U6e({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?ole(a,c,l):aue(a,c,l,i)},U6e=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=yoe(e)?Soe(e,r):[e,...r],[s,a,c]=KR(...o),l=tC(tC(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var cue=({file:t,commandArguments:e})=>uue(t,e),lue=({file:t,commandArguments:e})=>({...uue(t,e),isSync:!0}),uue=(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]=F6e(t);return{file:r,commandArguments:n}},F6e=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(z6e)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},z6e=/ +/g;var due=(t,e,r)=>{t.sync=e(j6e,r),t.s=t.sync},fue=({options:t})=>pue(t),j6e=({options:t})=>({...pue(t),isSync:!0}),pue=t=>({options:{...B6e(t),...t}}),B6e=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},hue={preferLocal:!0};var mue=nl(()=>({})),Tjt=nl(()=>({isSync:!0})),gue=nl(cue),wjt=nl(lue),xjt=nl(Aae),Ajt=nl(fue,{},hue,due),{sendMessage:Rjt,getOneMessage:Cjt,getEachMessage:Ijt,getCancelSignal:Pjt}=fle();var _ue=!1,yue=()=>{_ue=!0},Cs=()=>_ue;var JS=null,Sue=t=>(JS&&JS.destroy(),JS=new Do({totalAllowedTime:t}),JS),Eue=()=>JS;var Do=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&&Cs())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let o=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),s=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{s=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await LR({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{ne.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),o(),s&&clearTimeout(s)}};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 vue={name:"@netlify/agent-runner-cli",type:"module",version:"1.172.1-model-default-effort.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:{prebuild:"rm -rf dist",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:opencode":"vitest run test/integration/opencode.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.6","@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.2.1","@netlify/otel":"^6.0.6","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.153.4","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.12.1",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var H6e=V6e(import.meta.url),W6e=La.dirname(H6e),Y6e=G6e(import.meta.url),hh=le("shell"),jz=new Set,bue={preferLocal:!0},jt=(t,e,r)=>{let[n,i]=K6e(e,r),o={...bue,...i},s=mue(t,n,o);wue(s,o),Rue(s);let a=r?.idleTimeout;return a&&a>0&&Aue(s,a),s},Tue=(t,e)=>{let r={...bue,...e},n=gue(t,r);return wue(n,r),Rue(n),e?.idleTimeout&&e.idleTimeout>0&&Aue(n,e.idleTimeout),n},K6e=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},wue=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0||Is.env.NETLIFY_LOCAL_QUIET==="true")return;if(Is.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new AS).pipe(Is.stdout),t.stderr?.pipe(new AS).pipe(Is.stderr);return}t.stdout?.pipe(Is.stdout),t.stderr?.pipe(Is.stderr)},Bz=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(Is.kill(-t.pid,e),hh.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return hh.error("Error killing process:",r),!1}},xue=t=>Bz(t,"SIGKILL"),Aue=(t,e)=>{let r=null,n=()=>{hh.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),Bz(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(hh.log(`Force killing idle process ${t.pid}`),xue(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let o=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",o),t.on("error",o)},Rue=t=>{jz.add(t);let e=Eue();if(e){let r=e.onTimesUp(()=>{hh.log(`Global timer expired, killing process ${t.pid}`),Bz(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(hh.log(`Force killing process ${t.pid} after timeout`),xue(t))},5e3)});t.on("exit",()=>{jz.delete(t),r()}),t.on("error",()=>{jz.delete(t),r()})}};function Ps(t,e){if(!Is.env.NETLIFY_LOCAL_MODE)try{let i=Y6e.resolve(vue.name),o=La.dirname(i);for(;o!==La.dirname(o);){let s=La.dirname(o);if(La.basename(s)==="node_modules"){let a=La.join(s,".bin",e);if(rC.existsSync(a))return a;break}o=s}}catch(i){console.error("Could not resolve package.json",i)}if(Is.env.NODE_PATH){let i=La.join(Is.env.NODE_PATH,".bin",e);if(rC.existsSync(i))return i}let r=La.join(t,"node_modules",".bin",e);if(rC.existsSync(r))return r;let n=La.join(W6e,"..","node_modules",".bin",e);if(rC.existsSync(n))return n}var Cue=le("repo"),kue="runner-diffs-",Mue=t=>`${kue}${t}-`,$ue=async t=>{let e=Nue.tmpdir(),r;try{r=await nC.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(kue)&&!n.startsWith(Mue(t))).map(n=>nC.rm(iC.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Kn=(t,e={})=>jt("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),oC=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{Cue.info("Getting runner diffs");let n=await Q6e(r),{hasChanges:i}=n,{status:o}=n;if(!i)return{hasChanges:!1};if(!e){let h=t3e(o);await r3e(h,r)}Cue.info("Changes after processing"),await Vz(r);let s=await Hz(o,r);if(await qz(s,r),i=await e3e(r),!i)return{hasChanges:!1,ignored:s};await Kn(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await nC.mkdtemp(iC.join(Nue.tmpdir(),Mue(t.sessionId))),c=async({from:h,to:m,fileName:g,binary:_})=>{let v=iC.join(a,g);await Kn([..._?["diff",h,m,"--binary"]:["diff",h,m],`--output=${v}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:b}=await nC.stat(v);return{path:v,size:b}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await Oue(r),{hasChanges:!1,ignored:s};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 Pue(d,h)||(f=h)}await Oue(r),ne.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:s};return await Pue(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Iue=async t=>{let e=Z6e("sha256");for await(let r of J6e(t))e.update(r);return e.digest("hex")},Pue=async(t,e)=>t.size===e.size&&await Iue(t.path)===await Iue(e.path),Oue=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Kn(["reset","--soft","HEAD~1"],{cwd:t})},qz=async(t=[],e=process.cwd())=>{await Kn(["add",".",...t],{cwd:e})},Vz=async(t=process.cwd())=>{let e=await Kn(["status","-s"],{cwd:t});return String(e.stdout??"")},Due=/.. (.+)?\.log$/,X6e=[Due],Q6e=async(t=process.cwd())=>{let e=await Vz(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
|
|
144
144
|
`).filter(i=>X6e.some(s=>s instanceof RegExp?s.test(i):i===s)?!1:i[1]?.trim()!=="")).length!==0,status:e}},e3e=async(t=process.cwd())=>{try{return await Kn(["diff","--staged","--quiet"],{cwd:t}),!1}catch{return!0}},Gz=async(t=process.cwd())=>{let{stdout:e}=await Kn(["rev-parse","HEAD"],{cwd:t});return String(e??"").trim()},Lue=async(t=process.cwd())=>{let{stdout:e}=await Kn(["rev-list","--max-parents=0","HEAD"],{cwd:t});return String(e??"").trim()},Hz=async(t,e=process.cwd())=>{t||=await Vz(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(`
|
|
145
145
|
`).forEach(i=>{r.forEach(s=>{let a=i===`?? ${s}`,c=i.startsWith(`?? ${s}/`)||i.startsWith(`?? ${s}${iC.sep}`);(a||c)&&n.push(`:!${s}`)});let o=i.match(Due)?.[1];o&&n.push(`:!${o}.log`)}),n},Uue=async(t=process.cwd())=>{await Kn(["reset","--hard","HEAD"],{cwd:t})},Fue=async(t=process.cwd())=>{let e=await Kn(["clean","-fd","-e",".netlify"],{stdio:["ignore","pipe","pipe"],cwd:t});return String(e.stdout??"").split(`
|
|
146
146
|
`).filter(r=>r.startsWith("Removing ")).map(r=>r.slice(9))},t3e=t=>{let e=t.split(`
|
|
@@ -367,12 +367,12 @@ Replace \`<template-id>\` with the matching template \`id\`. Include \`--package
|
|
|
367
367
|
`,1);return/^(Async agent launched successfully|Agent launched in background)/.test(e)||/\(internal ID:?\s*[\w./-]+\)/i.test(e)},rme=new Set(["SendMessage","ToolSearch","TaskList","TaskGet","EnterPlanMode","TaskStop"]);var fn=le("runner_claude"),sv="Claude Code",ime="claude-opus-5",LV="claude-sonnet-5",H9e={[JU]:"claude-sonnet-5"};async function W9e({aiGateway:t,config:e,model:r}){let n=r;if(t)if(e.modelVersionOverrides?.claude){let i=e.modelVersionOverrides?.claude?.[e.accountType];if(i){if(!await t.isModelAvailableForProvider("anthropic",i))throw new Error(`Model override '${i}' is not available for anthropic provider`);n=i}}else if(r){if(!await t.isModelAvailableForProvider("anthropic",r))throw new Error(`Model '${r}' is not available for anthropic provider`)}else{let i=H9e[e.accountType],o=i||ime;!!o&&await t.isModelAvailableForProvider("anthropic",o)?(fn.log(`Using ${i?"account override":"default"} model: ${o}`),n=o):o&&fn.log(`Model ${o} is not available, proceeding without model specification`)}return n}function Y9e({aiGateway:t}){if(t){let{token:e,url:r}=t;if(!e||!r)throw new Error("No token or url provided from AI Gateway");return{...Cm.env,ANTHROPIC_API_KEY:e,ANTHROPIC_BASE_URL:r}}if(!Cm.env.ANTHROPIC_API_KEY)throw new Error("ANTHROPIC_API_KEY is not provided");return{...Cm.env}}async function K9e(){let t=av.join(Cm.cwd(),"AGENTS.md");try{await Rm.access(t)}catch{return}let e=av.join(Cm.cwd(),"CLAUDE.local.md"),r="@AGENTS.md";try{if((await Rm.readFile(e,"utf-8")).includes(r))return;await Rm.appendFile(e,`
|
|
368
368
|
${r}
|
|
369
369
|
`)}catch{await Rm.writeFile(e,`${r}
|
|
370
|
-
`)}fn.log("Added @AGENTS.md import to CLAUDE.local.md")}async function UV({config:t,persistSteps:e,aiGateway:r,continueSession:n,priorAgentSessionId:i,cwd:o=Cm.cwd(),cliPath:s="netlify",abortSignal:a,onSessionId:c,forceLowEffortForCreditWrapUp:l}){let u=t,{prompt:d}=u,{model:f}=t,p="";await K9e();let h=Y9e({aiGateway:r}),m=await W9e({config:t,aiGateway:r,model:f});l&&m?.includes("fable")&&(!r||await r.isModelAvailableForProvider("anthropic",LV))&&(fn.log(`Credit wrap-up: downgrading model ${m} to ${LV}`),m=LV);let g=[],_=[],v={},T=new Set,b=[],A=
|
|
371
|
-
`)||void 0},P=(
|
|
370
|
+
`)}fn.log("Added @AGENTS.md import to CLAUDE.local.md")}async function UV({config:t,persistSteps:e,aiGateway:r,continueSession:n,priorAgentSessionId:i,cwd:o=Cm.cwd(),cliPath:s="netlify",abortSignal:a,onSessionId:c,forceLowEffortForCreditWrapUp:l}){let u=t,{prompt:d}=u,{model:f}=t,p="";await K9e();let h=Y9e({aiGateway:r}),m=await W9e({config:t,aiGateway:r,model:f});l&&m?.includes("fable")&&(!r||await r.isModelAvailableForProvider("anthropic",LV))&&(fn.log(`Credit wrap-up: downgrading model ${m} to ${LV}`),m=LV);let g=[],_=[],v={},T=new Set,b=[],A=We=>We?.match(/task\s+#([\w-]+)\s+created/i)?.[1],k=We=>{if(typeof We=="string")return We;if(Array.isArray(We))return We.filter(Ve=>Ve?.type==="text"&&typeof Ve.text=="string").map(Ve=>Ve.text).join(`
|
|
371
|
+
`)||void 0},P=(We,De)=>{let Ve=We.input||{};if(We.name==="TaskCreate"){b.push({id:A(De),subject:typeof Ve.subject=="string"?Ve.subject:"",activeForm:typeof Ve.activeForm=="string"?Ve.activeForm:void 0,status:"pending"});return}let Ae=typeof Ve.taskId=="string"?Ve.taskId:void 0,we=Ae===void 0?void 0:b.find(cn=>cn.id===Ae);if(!we&&typeof Ve.subject=="string"){let cn=b.filter(co=>co.subject===Ve.subject);cn.length===1&&(we=cn[0])}if(Ve.status==="deleted"){we&&b.splice(b.indexOf(we),1);return}if(!we){if(Ae===void 0||typeof Ve.subject!="string"&&typeof Ve.activeForm!="string")return;we={id:Ae,subject:"",status:"pending"},b.push(we)}typeof Ve.status=="string"&&(we.status=Ve.status),typeof Ve.subject=="string"&&(we.subject=Ve.subject),typeof Ve.activeForm=="string"&&(we.activeForm=Ve.activeForm)},N=()=>b.map(We=>({name:We.status==="in_progress"&&We.activeForm||We.subject,value:We.status})),D=0,F=0,E,oe,M,S,w,O="",Y="mode"in t&&t.mode==="create"&&t.accountType===JU,H="mode"in t&&t.mode==="ask",he=ml({creditWrapUpTurn:l}),je=tt().creditWrapUpEnabled&&Md(t),Ie=t.effort===Gi,$e=Y&&!je&&!Ie,Pe=["ExitPlanMode","EnterPlanMode","AskUserQuestion"];$e&&Pe.push("TodoWrite","TaskCreate","TaskUpdate","TaskList","TaskGet"),H&&(Pe.push("Edit","Write","NotebookEdit","EnterWorktree","Bash(git push:*)","Bash(netlify deploy:*)"),Hh(t)||Pe.push(...LC(s).map(We=>`Bash(${We}:*)`)));let He=Vh("claude",t.effort);t.effort&&!He&&fn.log(`Effort '${t.effort}' is not available on ${sv}; using its default`);let ce=l||$e?"low":Ie?Gi:He??"high",me=Ps(o,"claude");if(!me)throw new Error("Claude CLI binary not found");let nt=hl(t,{creditWrapUpTurn:l}),re=he||nt?await Xde({interactions:he,connections:nt}):void 0,qe=["--permission-mode","bypassPermissions","--dangerously-skip-permissions","--output-format","stream-json","--verbose","--disallowed-tools",Pe.join(","),...re?.args??[],...ce===Gi?[]:["--effort",ce],...m?["--model",m]:[],...n?i?["--resume",i]:["--continue"]:[],"-p"];fn.log(`Running ${me} ${qe.join(" ")}`);let z=jt(me,qe,{all:!0,env:h,cwd:o,idleTimeout:Pa,cancelSignal:a});z.stdin?.end(d);let x=Qc(()=>{e?.({steps:g,duration:F})},250),C=(We,De)=>{let{wrapMessage:Ve,...Ae}=We,we=YR({...Ae,id:D});we.message&&(we.message=we.message.replace(/\n?<system-reminder>.+?<\/system-reminder>\n?/gs,"").trim(),Ve&&we.message&&(we.message=`\`\`\`
|
|
372
372
|
${we.message}
|
|
373
|
-
\`\`\``)),D+=1,_.push(we),g.push(we),De||x.flush(),x(),De&&x.flush()},j=m||ime,B
|
|
373
|
+
\`\`\``)),D+=1,_.push(we),g.push(we),De||x.flush(),x(),De&&x.flush()},j=m||ime,B=$e?`Using ${sv} with ${j} and low effort because you are reaching your user limit`:`Using ${sv} with ${j}`;t.answeredInteraction||C({title:B,category:G.Environment},!0);let te=G9e.createInterface({input:z.all});te.on("error",We=>{fn.error("Readline interface error",{error:We.message,stack:We.stack})});let ie=!1,Ee=!1;te.on("line",We=>{let De=null;try{De=JSON.parse(We)}catch{fn.log("Could not parse line",We)}if(De?.session_id&&De.session_id!==p&&(p=De.session_id,c?.(p)),De?.type==="system"&&De.subtype==="status"&&De.status==="compacting"?ie||(C({category:G.Compaction,message:"Compacting context\u2026"}),ie=!0):De?.type==="system"&&De.subtype==="compact_boundary"&&(ie=!1,Ee=!0),Array.isArray(De?.message?.content)){let Ve=Ee&&De.message?.role==="user";Ee=!1,De.message.content.forEach(Ae=>{switch(Ae.type){case"text":{if(Ae.text){if(Ae.text.startsWith("Base directory for this skill:"))break;De.message?.role!=="user"&&(O=Ae.text);let we=G.AgentMessage;Ve?we=G.Compaction:De.message?.role==="user"&&(we=G.SubagentPrompt),C({message:Ae.text,category:we,parentGroupId:De.parent_tool_use_id||void 0})}break}case"image":{typeof Ae.source=="object"&&Ae.source&&Ae.source.type==="base64"&&Ae.source.media_type?C({message:``,category:G.AgentMessage,parentGroupId:De.parent_tool_use_id||void 0}):fn.log(`Unsupported image type ${Ae.source?.type}`,Ae.source);break}case"tool_use":{if(Ae.name&&!Ja[Ae.name]&&!T.has(Ae.name)&&(T.add(Ae.name),fn.log(`Unmapped tool in stream: ${Ae.name}`)),DV(Ae.name)){let cn=Ae.input?.description&&`\`${Ae.input.description}\``;C({title:[ov(Ae.name),cn].filter(Boolean).join(" "),category:Ja[Ae.name]?.category,groupId:Ae.id,parentGroupId:De.parent_tool_use_id||void 0})}else Ae.name==="Bash"&&Za(Ae.input?.command)&&C({title:"Generating the site",category:G.SiteGeneration,groupId:Ae.id,parentGroupId:De.parent_tool_use_id||void 0});let we=Ae.id&&!w?xm(Ae.name,Ae.input,xj):void 0;we&&"interaction"in we?(w=we.interaction,z.kill()):we&&(fn.warn("Ignoring malformed pause tool input",{toolUseId:Ae.id,tool:Ae.name,issues:we.issues}),ne.inc(we.metric,1)),Ae.id&&(v[Ae.id]=Ae),x.flush();break}case"tool_result":{let we=Ae.tool_use_id?v[Ae.tool_use_id]:void 0;if(Am(we?.name,xj))break;let cn=DV(we?.name),co=we?.name==="Bash"&&Za(we?.input?.command);if(we?.name==="Skill"&&we?.input?.skill){let Fr=bs(we.input.skill?.toString());Na(fn,Fr),C({title:`Use ${Fr}`,category:G.Skill,type:we.input.skill?.toString(),parentGroupId:De.parent_tool_use_id||void 0},!0);break}if(we?.name==="TodoWrite"){let{name:Fr,category:ur}=Ja.TodoWrite;C({title:Fr,category:ur,parentGroupId:De.parent_tool_use_id||void 0,tasks:De.tool_use_result?.newTodos?.map(dT=>({name:dT.status==="in_progress"?dT.activeForm:dT.content,value:dT.status}))},!0);break}if(we?.name==="TaskCreate"||we?.name==="TaskUpdate"){Ae.is_error||P(we,k(Ae.content)),C({title:ov(we.name),category:G.Todo,parentGroupId:De.parent_tool_use_id||void 0,tasks:N()},!0);break}if(we?.name&&rme.has(we.name)){let Fr=Ja[we.name]?.category||G.Tool,ur=Fr===G.Todo&&b.length>0;C({title:ov(we.name),category:Fr===G.Todo&&!ur?G.Tool:Fr,parentGroupId:De.parent_tool_use_id||void 0,...ur?{tasks:N()}:{}},!0);break}let R_=!!(we?.name&&Ja[we.name]),Oe;if(!cn&&!co&&we){let Fr=we.input?.file_path&&av.relative(o,we.input.file_path);Fr||(Fr=we.input?.pattern||we.input?.command);let ur=Fr&&`\`${Fr}\``;Oe=[ov(we.name||""),ur].filter(Boolean).join(" ")}else!cn&&!co&&!we&&(Oe="Tool result");let Ft=["Bash","Glob","Grep","LS","Read","Edit","Write","TaskOutput"].includes(we?.name||"")||!cn&&!co&&!R_,Ur=De.parent_tool_use_id||void 0;!Ur&&(cn||co)&&(Ur=Ae.tool_use_id);let Tr,ra=cn&&De.tool_use_result?.content||Ae.content;if(typeof ra=="string")Tr=ra;else if(Array.isArray(ra)){let Fr=[];ra.forEach(ur=>{ur?.type==="text"&&typeof ur.text=="string"?Fr.push(ur.text):ur?.type==="image"&&typeof ur.source=="object"&&ur.source?ur.source.type==="base64"&&ur.source.media_type?Fr.push(``):fn.log(`Unsupported image type ${ur.source.type}`,ur.source):fn.log(`Unsupported block type ${ur?.type}`)}),Tr=Fr.join(`
|
|
374
374
|
|
|
375
|
-
`)}if(cn&&Tr&&tme(Tr)){C({title:"Running in background",category:G.Task,parentGroupId:Ur},!0);break}C({title:Pe,message:Tr,wrapMessage:Ft,category:cn?G.AgentMessage:co?G.SiteGeneration:Ja[we?.name??""]?.category||G.Tool,parentGroupId:Ur},!0);break}case"thinking":{Ae.thinking&&C({title:"Reasoning",message:Ae.thinking,category:G.Reasoning,parentGroupId:De.parent_tool_use_id||void 0},!0);break}default:fn.log(`Message content type is not supported ${Ae.type}`,Ae)}})}else De?.type==="result"&&(F=De.duration_ms||0,De.is_error?w||(oe=De.result,M=De.api_error_status??void 0):E=De.result,De.usage&&(Jc(De.usage,m?{model:m}:{}),S=De.usage),[_,g].forEach(Ve=>{Ve[Ve.length-1]?.message===E&&Ve.pop()}))});let yt=!1;if(await z.catch(He=>{yt=fl(He,a),{error:oe,result:E}=Gh({catchError:He,runCmd:z,error:oe,result:E,runnerName:"Claude"})}),re&&await Rm.rm(re.mcpConfigPath,{force:!0}).catch(()=>{}),te.close(),x.flush(),w)return{steps:_,duration:F,agentSessionId:p,resolvedModel:m,effort:ce,usage:S,pendingInteraction:w};let lr=yt;lr&&(!E&&O.trim()&&(E=O.trim()),oe=void 0);let St=oe?Hhe({error:oe,apiErrorStatus:M}):void 0,ci=xP(St);return ci&&fn.log(`Classified provider failure as ${ci.failureClass}`,JSON.stringify({...St,retryable:ci.retryable})),{steps:_,duration:F,result:await Rl({initialResult:E,agentName:sv,hasError:!!oe}),error:Cl({error:oe,agentName:sv}),isRetryableError:ci?.retryable??Il(oe),isProviderUnavailableError:ci?.providerFault??Pl(oe),...St?{providerFailure:St}:{},agentSessionId:p,resolvedModel:m,effort:ce,usage:S,...lr?{aborted:!0}:{}}}var ome=async()=>{let t=av.join(nme.homedir(),".claude");await Rm.rm(t,{recursive:!0,force:!0})},sme={baseDir:av.join(nme.homedir(),".claude"),include:["projects"]};import Pv from"fs/promises";import Ov from"os";import Yl from"path";import ac from"process";import E8e from"readline";function Ce(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function U(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var FV=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return FV=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};function cv(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var lv=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};var ye=class extends Error{},er=class t extends ye{constructor(e,r,n,i){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("x-request-id"),this.error=r;let o=r;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new Ol({message:n,cause:lv(r)});let o=r?.error;return e===400?new Im(e,o,n,i):e===401?new Pm(e,o,n,i):e===403?new Om(e,o,n,i):e===404?new Nm(e,o,n,i):e===409?new km(e,o,n,i):e===422?new Mm(e,o,n,i):e===429?new $m(e,o,n,i):e>=500?new Dm(e,o,n,i):new t(e,o,n,i)}},fr=class extends er{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Ol=class extends er{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},Nl=class extends Ol{constructor({message:e}={}){super({message:e??"Request timed out."})}},Im=class extends er{},Pm=class extends er{},Om=class extends er{},Nm=class extends er{},km=class extends er{},Mm=class extends er{},$m=class extends er{},Dm=class extends er{},Lm=class extends ye{constructor(){super("Could not parse response content as the length limit was reached")}},Um=class extends ye{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},Us=class extends Error{constructor(e){super(e)}},Dd=class extends er{constructor(e,r,n){let i="OAuth2 authentication error",o;if(r&&typeof r=="object"){let s=r;o=s.error;let a=s.error_description;a&&typeof a=="string"?i=a:o&&(i=o)}super(e,r,i,n),this.error_code=o}},uv=class extends ye{constructor(e,r,n){super(e),this.provider=r,this.cause=n}};var J9e=/^[a-z][a-z0-9+.-]*:/i,ame=t=>J9e.test(t),pn=t=>(pn=Array.isArray,pn(t)),zV=pn;function jV(t){return typeof t!="object"?{}:t??{}}function BV(t){if(!t)return!0;for(let e in t)return!1;return!0}function cme(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function dv(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var lme=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new ye(`${t} must be an integer`);if(e<0)throw new ye(`${t} must be a positive integer`);return e};var ume=t=>{try{return JSON.parse(t)}catch{return}};var Fs=t=>new Promise(e=>setTimeout(e,t));var kl="6.34.0";var hme=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function X9e(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var Q9e=()=>{let t=X9e();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":fme(Deno.build.os),"X-Stainless-Arch":dme(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":fme(globalThis.process.platform??"unknown"),"X-Stainless-Arch":dme(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=eZe();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function eZe(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var dme=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",fme=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),pme,mme=()=>pme??(pme=Q9e());function CP(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function qV(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function IP(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return qV({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function VV(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function GV(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var _me=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});var HV="RFC3986",WV=t=>String(t),YV={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:WV},yme="RFC1738";var PP=(t,e)=>(PP=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),PP(t,e)),zs=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();var KV=1024,Sme=(t,e,r,n,i)=>{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a<o.length;a+=KV){let c=o.length>=KV?o.slice(a,a+KV):o,l=[];for(let u=0;u<c.length;++u){let d=c.charCodeAt(u);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===yme&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=zs[d];continue}if(d<2048){l[l.length]=zs[192|d>>6]+zs[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=zs[224|d>>12]+zs[128|d>>6&63]+zs[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=zs[240|d>>18]+zs[128|d>>12&63]+zs[128|d>>6&63]+zs[128|d&63]}s+=l.join("")}return s};function Eme(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function ZV(t,e){if(pn(t)){let r=[];for(let n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)}var bme={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},Tme=function(t,e){Array.prototype.push.apply(t,pn(e)?e:[e])},vme,Er={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Sme,encodeValuesOnly:!1,format:HV,formatter:WV,indices:!1,serializeDate(t){return(vme??(vme=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function rZe(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var JV={};function wme(t,e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_){let v=t,T=_,b=0,A=!1;for(;(T=T.get(JV))!==void 0&&!A;){let F=T.get(t);if(b+=1,typeof F<"u"){if(F===b)throw new RangeError("Cyclic object value");A=!0}typeof T.get(JV)>"u"&&(b=0)}if(typeof l=="function"?v=l(e,v):v instanceof Date?v=f?.(v):r==="comma"&&pn(v)&&(v=ZV(v,function(F){return F instanceof Date?f?.(F):F})),v===null){if(o)return c&&!m?c(e,Er.encoder,g,"key",p):e;v=""}if(rZe(v)||Eme(v)){if(c){let F=m?e:c(e,Er.encoder,g,"key",p);return[h?.(F)+"="+h?.(c(v,Er.encoder,g,"value",p))]}return[h?.(e)+"="+h?.(String(v))]}let k=[];if(typeof v>"u")return k;let P;if(r==="comma"&&pn(v))m&&c&&(v=ZV(v,c)),P=[{value:v.length>0?v.join(",")||null:void 0}];else if(pn(l))P=l;else{let F=Object.keys(v);P=u?F.sort(u):F}let N=a?String(e).replace(/\./g,"%2E"):String(e),D=n&&pn(v)&&v.length===1?N+"[]":N;if(i&&pn(v)&&v.length===0)return D+"[]";for(let F=0;F<P.length;++F){let E=P[F],oe=typeof E=="object"&&typeof E.value<"u"?E.value:v[E];if(s&&oe===null)continue;let M=d&&a?E.replace(/\./g,"%2E"):E,S=pn(v)?typeof r=="function"?r(D,M):D:D+(d?"."+M:"["+M+"]");_.set(t,b);let w=new WeakMap;w.set(JV,_),Tme(k,wme(oe,S,r,n,i,o,s,a,r==="comma"&&m&&pn(v)?null:c,l,u,d,f,p,h,m,g,w))}return k}function nZe(t=Er){if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");let e=t.charset||Er.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let r=HV;if(typeof t.format<"u"){if(!PP(YV,t.format))throw new TypeError("Unknown format option provided.");r=t.format}let n=YV[r],i=Er.filter;(typeof t.filter=="function"||pn(t.filter))&&(i=t.filter);let o;if(t.arrayFormat&&t.arrayFormat in bme?o=t.arrayFormat:"indices"in t?o=t.indices?"indices":"repeat":o=Er.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let s=typeof t.allowDots>"u"?t.encodeDotInKeys?!0:Er.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Er.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Er.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Er.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Er.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Er.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Er.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Er.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Er.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Er.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Er.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Er.strictNullHandling}}function xme(t,e={}){let r=t,n=nZe(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):pn(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=bme[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f<i.length;++f){let p=i[f];n.skipNulls&&r[p]===null||Tme(s,wme(r[p],p,a,c,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}let u=s.join(n.delimiter),d=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),u.length>0?d+u:""}function Ame(t){return xme(t,{arrayFormat:"brackets"})}function Ime(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var Rme;function Fm(t){let e;return(Rme??(e=new globalThis.TextEncoder,Rme=e.encode.bind(e)))(t)}var Cme;function XV(t){let e;return(Cme??(e=new globalThis.TextDecoder,Cme=e.decode.bind(e)))(t)}var Ti,wi,Ld=class{constructor(){Ti.set(this,void 0),wi.set(this,void 0),Ce(this,Ti,new Uint8Array,"f"),Ce(this,wi,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Fm(e):e;Ce(this,Ti,Ime([U(this,Ti,"f"),r]),"f");let n=[],i;for(;(i=oZe(U(this,Ti,"f"),U(this,wi,"f")))!=null;){if(i.carriage&&U(this,wi,"f")==null){Ce(this,wi,i.index,"f");continue}if(U(this,wi,"f")!=null&&(i.index!==U(this,wi,"f")+1||i.carriage)){n.push(XV(U(this,Ti,"f").subarray(0,U(this,wi,"f")-1))),Ce(this,Ti,U(this,Ti,"f").subarray(U(this,wi,"f")),"f"),Ce(this,wi,null,"f");continue}let o=U(this,wi,"f")!==null?i.preceding-1:i.preceding,s=XV(U(this,Ti,"f").subarray(0,o));n.push(s),Ce(this,Ti,U(this,Ti,"f").subarray(i.index),"f"),Ce(this,wi,null,"f")}return n}flush(){return U(this,Ti,"f").length?this.decode(`
|
|
375
|
+
`)}if(cn&&Tr&&tme(Tr)){C({title:"Running in background",category:G.Task,parentGroupId:Ur},!0);break}C({title:Oe,message:Tr,wrapMessage:Ft,category:cn?G.AgentMessage:co?G.SiteGeneration:Ja[we?.name??""]?.category||G.Tool,parentGroupId:Ur},!0);break}case"thinking":{Ae.thinking&&C({title:"Reasoning",message:Ae.thinking,category:G.Reasoning,parentGroupId:De.parent_tool_use_id||void 0},!0);break}default:fn.log(`Message content type is not supported ${Ae.type}`,Ae)}})}else De?.type==="result"&&(F=De.duration_ms||0,De.is_error?w||(oe=De.result,M=De.api_error_status??void 0):E=De.result,De.usage&&(Jc(De.usage,m?{model:m}:{}),S=De.usage),[_,g].forEach(Ve=>{Ve[Ve.length-1]?.message===E&&Ve.pop()}))});let yt=!1;if(await z.catch(We=>{yt=fl(We,a),{error:oe,result:E}=Gh({catchError:We,runCmd:z,error:oe,result:E,runnerName:"Claude"})}),re&&await Rm.rm(re.mcpConfigPath,{force:!0}).catch(()=>{}),te.close(),x.flush(),w)return{steps:_,duration:F,agentSessionId:p,resolvedModel:m,effort:ce,usage:S,pendingInteraction:w};let lr=yt;lr&&(!E&&O.trim()&&(E=O.trim()),oe=void 0);let St=oe?Hhe({error:oe,apiErrorStatus:M}):void 0,ci=xP(St);return ci&&fn.log(`Classified provider failure as ${ci.failureClass}`,JSON.stringify({...St,retryable:ci.retryable})),{steps:_,duration:F,result:await Rl({initialResult:E,agentName:sv,hasError:!!oe}),error:Cl({error:oe,agentName:sv}),isRetryableError:ci?.retryable??Il(oe),isProviderUnavailableError:ci?.providerFault??Pl(oe),...St?{providerFailure:St}:{},agentSessionId:p,resolvedModel:m,effort:ce,usage:S,...lr?{aborted:!0}:{}}}var ome=async()=>{let t=av.join(nme.homedir(),".claude");await Rm.rm(t,{recursive:!0,force:!0})},sme={baseDir:av.join(nme.homedir(),".claude"),include:["projects"]};import Pv from"fs/promises";import Ov from"os";import Yl from"path";import ac from"process";import E8e from"readline";function Ce(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function U(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var FV=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return FV=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};function cv(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var lv=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};var ye=class extends Error{},er=class t extends ye{constructor(e,r,n,i){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("x-request-id"),this.error=r;let o=r;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new Ol({message:n,cause:lv(r)});let o=r?.error;return e===400?new Im(e,o,n,i):e===401?new Pm(e,o,n,i):e===403?new Om(e,o,n,i):e===404?new Nm(e,o,n,i):e===409?new km(e,o,n,i):e===422?new Mm(e,o,n,i):e===429?new $m(e,o,n,i):e>=500?new Dm(e,o,n,i):new t(e,o,n,i)}},fr=class extends er{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Ol=class extends er{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},Nl=class extends Ol{constructor({message:e}={}){super({message:e??"Request timed out."})}},Im=class extends er{},Pm=class extends er{},Om=class extends er{},Nm=class extends er{},km=class extends er{},Mm=class extends er{},$m=class extends er{},Dm=class extends er{},Lm=class extends ye{constructor(){super("Could not parse response content as the length limit was reached")}},Um=class extends ye{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},Us=class extends Error{constructor(e){super(e)}},Dd=class extends er{constructor(e,r,n){let i="OAuth2 authentication error",o;if(r&&typeof r=="object"){let s=r;o=s.error;let a=s.error_description;a&&typeof a=="string"?i=a:o&&(i=o)}super(e,r,i,n),this.error_code=o}},uv=class extends ye{constructor(e,r,n){super(e),this.provider=r,this.cause=n}};var J9e=/^[a-z][a-z0-9+.-]*:/i,ame=t=>J9e.test(t),pn=t=>(pn=Array.isArray,pn(t)),zV=pn;function jV(t){return typeof t!="object"?{}:t??{}}function BV(t){if(!t)return!0;for(let e in t)return!1;return!0}function cme(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function dv(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var lme=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new ye(`${t} must be an integer`);if(e<0)throw new ye(`${t} must be a positive integer`);return e};var ume=t=>{try{return JSON.parse(t)}catch{return}};var Fs=t=>new Promise(e=>setTimeout(e,t));var kl="6.34.0";var hme=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function X9e(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var Q9e=()=>{let t=X9e();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":fme(Deno.build.os),"X-Stainless-Arch":dme(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":fme(globalThis.process.platform??"unknown"),"X-Stainless-Arch":dme(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=eZe();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kl,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function eZe(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var dme=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",fme=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),pme,mme=()=>pme??(pme=Q9e());function CP(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function qV(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function IP(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return qV({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function VV(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function GV(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var _me=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});var HV="RFC3986",WV=t=>String(t),YV={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:WV},yme="RFC1738";var PP=(t,e)=>(PP=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),PP(t,e)),zs=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();var KV=1024,Sme=(t,e,r,n,i)=>{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a<o.length;a+=KV){let c=o.length>=KV?o.slice(a,a+KV):o,l=[];for(let u=0;u<c.length;++u){let d=c.charCodeAt(u);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===yme&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=zs[d];continue}if(d<2048){l[l.length]=zs[192|d>>6]+zs[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=zs[224|d>>12]+zs[128|d>>6&63]+zs[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=zs[240|d>>18]+zs[128|d>>12&63]+zs[128|d>>6&63]+zs[128|d&63]}s+=l.join("")}return s};function Eme(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function ZV(t,e){if(pn(t)){let r=[];for(let n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)}var bme={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},Tme=function(t,e){Array.prototype.push.apply(t,pn(e)?e:[e])},vme,Er={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Sme,encodeValuesOnly:!1,format:HV,formatter:WV,indices:!1,serializeDate(t){return(vme??(vme=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function rZe(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var JV={};function wme(t,e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_){let v=t,T=_,b=0,A=!1;for(;(T=T.get(JV))!==void 0&&!A;){let F=T.get(t);if(b+=1,typeof F<"u"){if(F===b)throw new RangeError("Cyclic object value");A=!0}typeof T.get(JV)>"u"&&(b=0)}if(typeof l=="function"?v=l(e,v):v instanceof Date?v=f?.(v):r==="comma"&&pn(v)&&(v=ZV(v,function(F){return F instanceof Date?f?.(F):F})),v===null){if(o)return c&&!m?c(e,Er.encoder,g,"key",p):e;v=""}if(rZe(v)||Eme(v)){if(c){let F=m?e:c(e,Er.encoder,g,"key",p);return[h?.(F)+"="+h?.(c(v,Er.encoder,g,"value",p))]}return[h?.(e)+"="+h?.(String(v))]}let k=[];if(typeof v>"u")return k;let P;if(r==="comma"&&pn(v))m&&c&&(v=ZV(v,c)),P=[{value:v.length>0?v.join(",")||null:void 0}];else if(pn(l))P=l;else{let F=Object.keys(v);P=u?F.sort(u):F}let N=a?String(e).replace(/\./g,"%2E"):String(e),D=n&&pn(v)&&v.length===1?N+"[]":N;if(i&&pn(v)&&v.length===0)return D+"[]";for(let F=0;F<P.length;++F){let E=P[F],oe=typeof E=="object"&&typeof E.value<"u"?E.value:v[E];if(s&&oe===null)continue;let M=d&&a?E.replace(/\./g,"%2E"):E,S=pn(v)?typeof r=="function"?r(D,M):D:D+(d?"."+M:"["+M+"]");_.set(t,b);let w=new WeakMap;w.set(JV,_),Tme(k,wme(oe,S,r,n,i,o,s,a,r==="comma"&&m&&pn(v)?null:c,l,u,d,f,p,h,m,g,w))}return k}function nZe(t=Er){if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");let e=t.charset||Er.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let r=HV;if(typeof t.format<"u"){if(!PP(YV,t.format))throw new TypeError("Unknown format option provided.");r=t.format}let n=YV[r],i=Er.filter;(typeof t.filter=="function"||pn(t.filter))&&(i=t.filter);let o;if(t.arrayFormat&&t.arrayFormat in bme?o=t.arrayFormat:"indices"in t?o=t.indices?"indices":"repeat":o=Er.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let s=typeof t.allowDots>"u"?t.encodeDotInKeys?!0:Er.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Er.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Er.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Er.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Er.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Er.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Er.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Er.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Er.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Er.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Er.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Er.strictNullHandling}}function xme(t,e={}){let r=t,n=nZe(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):pn(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=bme[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f<i.length;++f){let p=i[f];n.skipNulls&&r[p]===null||Tme(s,wme(r[p],p,a,c,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}let u=s.join(n.delimiter),d=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),u.length>0?d+u:""}function Ame(t){return xme(t,{arrayFormat:"brackets"})}function Ime(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var Rme;function Fm(t){let e;return(Rme??(e=new globalThis.TextEncoder,Rme=e.encode.bind(e)))(t)}var Cme;function XV(t){let e;return(Cme??(e=new globalThis.TextDecoder,Cme=e.decode.bind(e)))(t)}var Ti,wi,Ld=class{constructor(){Ti.set(this,void 0),wi.set(this,void 0),Ce(this,Ti,new Uint8Array,"f"),Ce(this,wi,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Fm(e):e;Ce(this,Ti,Ime([U(this,Ti,"f"),r]),"f");let n=[],i;for(;(i=oZe(U(this,Ti,"f"),U(this,wi,"f")))!=null;){if(i.carriage&&U(this,wi,"f")==null){Ce(this,wi,i.index,"f");continue}if(U(this,wi,"f")!=null&&(i.index!==U(this,wi,"f")+1||i.carriage)){n.push(XV(U(this,Ti,"f").subarray(0,U(this,wi,"f")-1))),Ce(this,Ti,U(this,Ti,"f").subarray(U(this,wi,"f")),"f"),Ce(this,wi,null,"f");continue}let o=U(this,wi,"f")!==null?i.preceding-1:i.preceding,s=XV(U(this,Ti,"f").subarray(0,o));n.push(s),Ce(this,Ti,U(this,Ti,"f").subarray(i.index),"f"),Ce(this,wi,null,"f")}return n}flush(){return U(this,Ti,"f").length?this.decode(`
|
|
376
376
|
`):[]}};Ti=new WeakMap,wi=new WeakMap;Ld.NEWLINE_CHARS=new Set([`
|
|
377
377
|
`,"\r"]);Ld.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function oZe(t,e){for(let i=e??0;i<t.length;i++){if(t[i]===10)return{preceding:i,index:i+1,carriage:!1};if(t[i]===13)return{preceding:i,index:i+1,carriage:!0}}return null}function Pme(t){for(let n=0;n<t.length-1;n++){if(t[n]===10&&t[n+1]===10||t[n]===13&&t[n+1]===13)return n+2;if(t[n]===13&&t[n+1]===10&&n+3<t.length&&t[n+2]===13&&t[n+3]===10)return n+4}return-1}var NP={off:0,error:200,warn:300,info:400,debug:500},QV=(t,e,r)=>{if(t){if(cme(NP,t))return t;sr(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(NP))}`)}};function fv(){}function OP(t,e,r){return!e||NP[t]>NP[r]?fv:e[t].bind(e)}var sZe={error:fv,warn:fv,info:fv,debug:fv},Ome=new WeakMap;function sr(t){let e=t.logger,r=t.logLevel??"off";if(!e)return sZe;let n=Ome.get(e);if(n&&n[0]===r)return n[1];let i={error:OP("error",e,r),warn:OP("warn",e,r),info:OP("info",e,r),debug:OP("debug",e,r)};return Ome.set(e,[r,i]),i}var Xa=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);var pv,js=class t{constructor(e,r,n){this.iterator=e,pv.set(this,void 0),this.controller=r,Ce(this,pv,n,"f")}static fromSSEResponse(e,r,n,i){let o=!1,s=n?sr(n):console;async function*a(){if(o)throw new ye("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let c=!1;try{for await(let l of aZe(e,r))if(!c){if(l.data.startsWith("[DONE]")){c=!0;continue}if(l.event===null||!l.event.startsWith("thread.")){let u;try{u=JSON.parse(l.data)}catch(d){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),d}if(u&&u.error)throw new er(void 0,u.error,void 0,e.headers);yield i?{event:l.event,data:u}:u}else{let u;try{u=JSON.parse(l.data)}catch(d){throw console.error("Could not parse message into JSON:",l.data),console.error("From chunk:",l.raw),d}if(l.event=="error")throw new er(void 0,u.error,u.message,void 0);yield{event:l.event,data:u}}}c=!0}catch(l){if(cv(l))return;throw l}finally{c||r.abort()}}return new t(a,r,n)}static fromReadableStream(e,r,n){let i=!1;async function*o(){let a=new Ld,c=VV(e);for await(let l of c)for(let u of a.decode(l))yield u;for(let l of a.flush())yield l}async function*s(){if(i)throw new ye("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(cv(c))return;throw c}finally{a||r.abort()}}return new t(s,r,n)}[(pv=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),i=o=>({next:()=>{if(o.length===0){let s=n.next();e.push(s),r.push(s)}return o.shift()}});return[new t(()=>i(e),this.controller,U(this,pv,"f")),new t(()=>i(r),this.controller,U(this,pv,"f"))]}toReadableStream(){let e=this,r;return qV({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:i,done:o}=await r.next();if(o)return n.close();let s=Fm(JSON.stringify(i)+`
|
|
378
378
|
`);n.enqueue(s)}catch(i){n.error(i)}},async cancel(){await r.return?.()}})}};async function*aZe(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new ye("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new ye("Attempted to iterate over a response with no body");let r=new eG,n=new Ld,i=VV(t.body);for await(let o of cZe(i))for(let s of n.decode(o)){let a=r.decode(s);a&&(yield a)}for(let o of n.flush()){let s=r.decode(o);s&&(yield s)}}async function*cZe(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?Fm(r):r,i=new Uint8Array(e.length+n.length);i.set(e),i.set(n,e.length),e=i;let o;for(;(o=Pme(e))!==-1;)yield e.slice(0,o),e=e.slice(o)}e.length>0&&(yield e)}var eG=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
|
|
@@ -397,9 +397,9 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
397
397
|
`);this.baseURL=c.baseURL,this.timeout=c.timeout??xG.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=QV(c.logLevel,"ClientOptions.logLevel",this)??QV(zl("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??CP(),Ce(this,rO,_me,"f"),this._options=c,s&&(this._workloadIdentityAuth=new $P(s,this.fetch)),this.apiKey=typeof r=="string"?r:"Missing Key",this.organization=n,this.project=i,this.webhookSecret=o}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){}async authHeaders(e){return se([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return Ame(e)}getUserAgent(){return`${this.constructor.name}/JS ${kl}`}defaultIdempotencyKey(){return`stainless-node-retry-${FV()}`}makeStatusError(e,r,n,i){return er.generate(e,r,n,i)}async _callApiKey(){let e=this._options.apiKey;if(typeof e!="function")return!1;let r;try{r=await e()}catch(n){throw n instanceof ye?n:new ye(`Failed to get token from 'apiKey' function: ${n.message}`,{cause:n})}if(typeof r!="string"||!r)throw new ye(`Expected 'apiKey' function argument to return a string but it returned ${r}`);return this.apiKey=r,!0}buildURL(e,r,n){let i=!U(this,wG,"m",lge).call(this)&&n||this.baseURL,o=ame(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),s=this.defaultQuery(),a=Object.fromEntries(o.searchParams);return(!BV(s)||!BV(a))&&(r={...a,...s,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(o.search=this.stringifyQuery(r)),o.toString()}async prepareOptions(e){await this._callApiKey()}async prepareRequest(e,{url:r,options:n}){}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(i=>({method:e,path:r,...i})))}request(e,r=null){return new Ud(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let i=await e,o=i.maxRetries??this.maxRetries;r==null&&(r=o),await this.prepareOptions(i);let{req:s,url:a,timeout:c}=await this.buildRequest(i,{retryCount:o-r});await this.prepareRequest(s,{url:a,options:i});let l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=n===void 0?"":`, retryOf: ${n}`,d=Date.now();if(sr(this).debug(`[${l}] sending request`,Xa({retryOfRequestLogID:n,method:i.method,url:a,options:i,headers:s.headers})),i.signal?.aborted)throw new fr;let f=new AbortController,p=await this.fetchWithAuth(a,s,c,f).catch(lv),h=Date.now();if(p instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(i.signal?.aborted)throw new fr;let v=cv(p)||/timed? ?out/i.test(String(p)+("cause"in p?String(p.cause):""));if(r)return sr(this).info(`[${l}] connection ${v?"timed out":"failed"} - ${_}`),sr(this).debug(`[${l}] connection ${v?"timed out":"failed"} (${_})`,Xa({retryOfRequestLogID:n,url:a,durationMs:h-d,message:p.message})),this.retryRequest(i,r,n??l);throw sr(this).info(`[${l}] connection ${v?"timed out":"failed"} - error; no more retries left`),sr(this).debug(`[${l}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Xa({retryOfRequestLogID:n,url:a,durationMs:h-d,message:p.message})),p instanceof Dd||p instanceof uv?p:v?new Nl:new Ol({cause:p})}let m=[...p.headers.entries()].filter(([_])=>_==="x-request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),g=`[${l}${u}${m}] ${s.method} ${a} ${p.ok?"succeeded":"failed"} with status ${p.status} in ${h-d}ms`;if(!p.ok){if(p.status===401&&this._workloadIdentityAuth&&!i.__metadata?.hasStreamingBody&&!i.__metadata?.workloadIdentityTokenRefreshed)return await GV(p.body),this._workloadIdentityAuth.invalidateToken(),this.makeRequest({...i,__metadata:{...i.__metadata,workloadIdentityTokenRefreshed:!0}},r,n??l);let _=await this.shouldRetry(p);if(r&&_){let P=`retrying, ${r} attempts remaining`;return await GV(p.body),sr(this).info(`${g} - ${P}`),sr(this).debug(`[${l}] response error (${P})`,Xa({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:h-d})),this.retryRequest(i,r,n??l,p.headers)}let v=_?"error; no more retries left":"error; not retryable";sr(this).info(`${g} - ${v}`);let T=await p.text().catch(P=>lv(P).message),b=ume(T),A=b?void 0:T;throw sr(this).debug(`[${l}] response error (${v})`,Xa({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,message:A,durationMs:Date.now()-d})),this.makeStatusError(p.status,b,A,p.headers)}return sr(this).info(g),sr(this).debug(`[${l}] response start`,Xa({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:h-d})),{response:p,options:i,controller:f,requestLogID:l,retryOfRequestLogID:n,startTime:d}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(i=>({method:"get",path:e,...i})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new gv(this,n,e)}async fetchWithAuth(e,r,n,i){if(this._workloadIdentityAuth){let s=r.headers,a=s.get("Authorization");if(!a||a===`Bearer ${TG}`){let c=await this._workloadIdentityAuth.getToken();s.set("Authorization",`Bearer ${c}`)}}return await this.fetchWithTimeout(e,r,n,i)}async fetchWithTimeout(e,r,n,i){let{signal:o,method:s,...a}=r||{},c=this._makeAbort(i);o&&o.addEventListener("abort",c,{once:!0});let l=setTimeout(c,n),u=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,d={signal:i.signal,...u?{duplex:"half"}:{},method:"GET",...a};s&&(d.method=s.toUpperCase());try{return await this.fetch.call(void 0,e,d)}finally{clearTimeout(l)}}async shouldRetry(e){let r=e.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,i){let o,s=i?.get("retry-after-ms");if(s){let c=parseFloat(s);Number.isNaN(c)||(o=c)}let a=i?.get("retry-after");if(a&&!o){let c=parseFloat(a);Number.isNaN(c)?o=Date.parse(a)-Date.now():o=c*1e3}if(o===void 0){let c=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(r,c)}return await Fs(o),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let o=r-e,s=Math.min(.5*Math.pow(2,o),8),a=1-Math.random()*.25;return s*a*1e3}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:i,path:o,query:s,defaultBaseURL:a}=n,c=this.buildURL(o,s,a);"timeout"in n&&lme("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:l,body:u,isStreamingBody:d}=this.buildBody({options:n});d&&(e.__metadata={...e.__metadata,hasStreamingBody:!0});let f=await this.buildHeaders({options:e,method:i,bodyHeaders:l,retryCount:r});return{req:{method:i,headers:f,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...n.fetchOptions??{}},url:c,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:i}){let o={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let s=se([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...mme(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(s),s.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0,isStreamingBody:!1};let n=se([r]),i=typeof globalThis.ReadableStream<"u"&&e instanceof globalThis.ReadableStream,o=!i&&(typeof e=="string"||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof globalThis.Blob<"u"&&e instanceof globalThis.Blob||e instanceof URLSearchParams||e instanceof FormData);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||i?{bodyHeaders:void 0,body:e,isStreamingBody:!o}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:IP(e),isStreamingBody:!0}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e),isStreamingBody:!1}:{...U(this,rO,"f").call(this,{body:e,headers:n}),isStreamingBody:!1}}};xG=Ue,rO=new WeakMap,wG=new WeakSet,lge=function(){return this.baseURL!=="https://api.openai.com/v1"};Ue.OpenAI=xG;Ue.DEFAULT_TIMEOUT=6e5;Ue.OpenAIError=ye;Ue.APIError=er;Ue.APIConnectionError=Ol;Ue.APIConnectionTimeoutError=Nl;Ue.APIUserAbortError=fr;Ue.NotFoundError=Nm;Ue.ConflictError=km;Ue.RateLimitError=$m;Ue.BadRequestError=Im;Ue.AuthenticationError=Pm;Ue.InternalServerError=Dm;Ue.PermissionDeniedError=Om;Ue.UnprocessableEntityError=Mm;Ue.InvalidWebhookSignatureError=Us;Ue.toFile=LP;Ue.Completions=Wd;Ue.Chat=Ll;Ue.Embeddings=Kd;Ue.Files=Jd;Ue.Images=tf;Ue.Audio=qs;Ue.Moderations=nf;Ue.Models=rf;Ue.FineTuning=Bo;Ue.Graders=Gl;Ue.VectorStores=sc;Ue.Webhooks=af;Ue.Beta=jo;Ue.Batches=Bd;Ue.Uploads=Wl;Ue.Responses=ic;Ue.Realtime=nc;Ue.Conversations=ql;Ue.Evals=Vl;Ue.Containers=Bl;Ue.Skills=oc;Ue.Videos=sf;var Ai=le("runner_codex"),nO="Codex CLI",vg="gpt-5.6-sol";async function v8e({aiGateway:t,config:e,model:r}){let n=r;if(t)if(e.modelVersionOverrides?.codex){let i=e.modelVersionOverrides?.codex?.[e.accountType];if(i){if(!await t.isModelAvailableForProvider("openai",i))throw new Error(`Model override '${i}' is not available for openai provider`);n=i}}else if(r){if(!await t.isModelAvailableForProvider("openai",r))throw new Error(`Model '${r}' is not available for openai provider`)}else!!vg&&await t.isModelAvailableForProvider("openai",vg)?(n=vg,Ai.log(`Using default model: ${vg}`)):vg&&Ai.log(`Default model ${vg} is not available, proceeding without model specification`);return n}var iO="netlify-ask-db",b8e=`default_permissions = "${iO}"`,T8e=()=>Yl.join(ac.env.XDG_CONFIG_HOME??Yl.join(Ov.homedir(),".config"),"netlify"),w8e=t=>["",`[permissions.${iO}]`,'description = "Ask mode: read-only filesystem, network access for database reads"','extends = ":read-only"',"",`[permissions.${iO}.filesystem]`,'":minimal" = "read"','"/" = "read"',`"${t}" = "write"`,"",`[permissions.${iO}.network]`,"enabled = true"];function x8e({aiGateway:t}){if(t){let{token:e,url:r}=t;if(!e||!r)throw new Error("No token or url provided from AI Gateway");ac.env.OPENAI_API_KEY=e,ac.env.OPENAI_BASE_URL=r}else if(!ac.env.OPENAI_API_KEY)throw new Error("OPENAI_API_KEY is not provided")}async function AG({config:t,persistSteps:e,sendSteps:r,aiGateway:n,continueSession:i,priorAgentSessionId:o,cwd:s=ac.cwd(),abortSignal:a,onSessionId:c,forceLowEffortForCreditWrapUp:l}){let{prompt:u}=t,{model:d}=t;x8e({aiGateway:n});let f=await v8e({config:t,aiGateway:n,model:d}),p=[],h=[],m=[],g={},_=new Set,v=0,T=0,b,A,k,P,N,D=Hh(t),F=`${ac.env.NVM_BIN}/node`,E=Yl.join(Ov.homedir(),".codex"),oe=Yl.join(E,"config.toml"),M=Yl.join(E,"auth.json");try{await Pv.mkdir(E,{recursive:!0});let z={OPENAI_API_KEY:ac.env.OPENAI_API_KEY};await Pv.writeFile(M,JSON.stringify(z,null,2),"utf-8"),Ai.log("Created Codex auth.json file");let x=ac.env.OPENAI_BASE_URL,C=['forced_login_method = "api"'],j=ml({creditWrapUpTurn:l}),B=hl(t,{creditWrapUpTurn:l});D&&C.push(b8e),x&&C.push('model_provider = "openai_proxy"',"","[model_providers.openai_proxy]",'name = "OpenAI Proxy"',`base_url = "${x}"`,'env_key = "OPENAI_API_KEY"','wire_api = "responses"',"supports_websockets = false","requires_openai_auth = true"),j&&C.push(...Wde()),B&&C.push(...Yde(B));let te=[];D&&(te=w8e(T8e()),C.push(...te)),await Pv.writeFile(oe,`${C.join(`
|
|
398
398
|
`)}
|
|
399
399
|
`,"utf-8"),Ai.log("Wrote Codex config.toml",...te.length?[te.join(`
|
|
400
|
-
`)]:[])}catch(z){let x=z instanceof Error?z.message:String(z);throw Ai.warn("Failed to setup Codex config and credentials",{error:x}),new Error(`Codex setup failed: ${x}`)}let S=f==="gpt-5.6-sol",w=Vh("codex",t.effort);t.effort&&!w&&Ai.log(`Effort '${t.effort}' is not available on ${nO}; using its default`);let H=l?"low":w===Gi?Gi:w??(S?"low":void 0),he=H??"high",je=!!(i&&o),Ie="mode"in t&&t.mode==="ask",$e=!!D,
|
|
400
|
+
`)]:[])}catch(z){let x=z instanceof Error?z.message:String(z);throw Ai.warn("Failed to setup Codex config and credentials",{error:x}),new Error(`Codex setup failed: ${x}`)}let S=f==="gpt-5.6-sol",w=Vh("codex",t.effort);t.effort&&!w&&Ai.log(`Effort '${t.effort}' is not available on ${nO}; using its default`);let H=l?"low":w===Gi?Gi:w??(S?"low":void 0),he=H??"high",je=!!(i&&o),Ie="mode"in t&&t.mode==="ask",$e=!!D,Pe=[Ps(s,"codex"),"exec",...Ie&&!$e?["--sandbox","read-only"]:[],...je?["resume",o]:[],...Ie?[]:["--yolo"],"--json",...H&&H!==Gi?["-c",`model_reasoning_effort="${H}"`]:[],...f?["--model",f]:[]].filter(Boolean);Ai.log(`Running ${F} ${Pe.join(" ")}`);let He=jt(F,Pe,{all:!0,cwd:s,env:{...ac.env},stdin:"pipe",idleTimeout:Pa,cancelSignal:a});He.stdin?.end(u);let Ne=Qc(()=>{e?.({steps:p,duration:T}),r?.({steps:h,duration:T}),h=[]},250),ce=(z,x)=>{let C={...z,id:v};v+=1,m.push(C),p.push(C),h.push(C),x||Ne.flush(),Ne(),x&&Ne.flush()},me=f||"default";t.answeredInteraction||ce({title:`Using ${nO} with ${me}`,category:G.Environment},!0);let nt=E8e.createInterface({input:He.all});nt.on("error",z=>{Ai.error("Readline interface error",{error:z.message,stack:z.stack})}),nt.on("line",z=>{let x;try{x=JSON.parse(z)}catch{Ai.log("Could not parse line",z);return}if(x?.duration_ms&&(T=x.duration_ms),x?.type==="thread.started"&&typeof x?.thread_id=="string"&&(k=x.thread_id,c?.(k)),x?.type==="item.started"&&x?.item?.type==="command_execution")g[x.item.id]=x.item;else if(x?.type==="item.completed"&&x?.item?.type==="command_execution"){let C=x.item,j=C8e(C);j&&ce(j,!0);let B=C.command?.match(/\.agents\/skills\/([^\s/]+)/)?.[1];if(B&&!_.has(B)){_.add(B);let te=bs(B);Na(Ai,te),ce({title:`Use ${te}`,category:G.Skill,type:B},!0)}}else if(x?.type==="item.completed"&&x?.item?.type==="reasoning"){let C={title:"Reasoning",message:x.item.text,category:G.Reasoning};ce(C,!0)}else if(x?.type==="item.completed"&&x?.item?.type==="agent_message")b=x.item.text;else if(x?.type==="item.started"&&x?.item?.type==="mcp_tool_call"){let C=x.item,j=zde(C.server)&&!N?xm(C.tool,C.arguments,Fde):void 0;j&&"interaction"in j?(N=j.interaction,He.kill()):j&&(Ai.warn("Ignoring malformed pause tool input",{toolUseId:C.id,tool:C.tool,issues:j.issues}),ne.inc(j.metric,1))}else if(x?.type==="turn.completed"&&x.usage)P={input_tokens:x.usage.input_tokens,output_tokens:x.usage.output_tokens},Jc(P,f?{model:f}:{});else if(x?.type==="turn.failed"&&x?.error?.message)A=x.error.message;else if(x?.type==="local_shell_call"){let C=x;g[C.call_id]=C}else if(x?.type==="local_shell_call_output"){let C=x,j=g[C.call_id],B=I8e(j,C);B&&ce(B,!0);let ie=(j?.action?.command?.join(" ")??"").match(/\.agents\/skills\/([^\s/]+)/)?.[1];if(ie&&!_.has(ie)){_.add(ie);let Ee=bs(ie);Na(Ai,Ee),ce({title:`Use ${Ee}`,category:G.Skill,type:ie},!0)}}else x?.type==="message"&&x.role==="assistant"?b=x.content?.map(C=>C.text).join(`
|
|
401
401
|
`):x?.type==="message"&&x.role==="system"&&(A=x.content?.map(C=>C.text).join(`
|
|
402
|
-
`))});let re=!1;if(await
|
|
402
|
+
`))});let re=!1;if(await He.catch(z=>{re=fl(z,a);let x=Gh({catchError:z,runCmd:He,error:A,result:b,runnerName:"Codex"});A=x.error,b=x.result}),nt.close(),Ne.flush(),N)return{steps:m,duration:T,agentSessionId:k,resolvedModel:f,effort:he,usage:P,pendingInteraction:N};let qe=re;return qe&&(A=void 0),{steps:m,duration:T,result:await Rl({initialResult:b,agentName:nO,hasError:!!A}),error:Cl({error:A,agentName:nO}),isRetryableError:Il(A),isProviderUnavailableError:Pl(A),resolvedModel:f,effort:he,agentSessionId:k,usage:P,...qe?{aborted:!0}:{}}}var uge=async()=>{let t=Yl.join(Ov.homedir(),".codex");await Pv.rm(t,{recursive:!0,force:!0});let e=Yl.join(Ov.homedir(),".agents","skills");await Pv.rm(e,{recursive:!0,force:!0})},dge={baseDir:Yl.join(Ov.homedir(),".codex"),include:["sessions"]},A8e=new Set(["bash","-lc"]),R8e=/^sed\s+-n\s+(?:'[^']*'|"[^"]*"|\S+)\s+(\S+)\s*$/,fge=t=>{if(Za(t))return{title:"Generating the site",category:G.SiteGeneration};let e=t.match(R8e);return e?{title:`Reading \`${e[1]}\``,category:G.FileRead}:{title:`Running \`${t}\``,category:G.RunCommand}},C8e=t=>{if(!t||t.type!=="command_execution")return null;let e=t.command;e=e.replace(/^(\/usr\/bin\/)?bash -lc ['"]/,"").replace(/['"]$/,"");let{command:r,heredocContent:n}=cF(e),{title:i,category:o}=fge(r),s=t.aggregated_output?.trim();return n?s=`\`\`\`
|
|
403
403
|
${n}
|
|
404
404
|
\`\`\`${s?`
|
|
405
405
|
|
|
@@ -430,18 +430,18 @@ commandPrefix = [${i}]
|
|
|
430
430
|
decision = "allow"
|
|
431
431
|
priority = 20
|
|
432
432
|
`),Xr.log("Ask policy allows the read-only database query command",{allowedPrefixes:i})}let n=Kl.join(Mv.homedir(),".gemini","ask-policy.toml");return await cf.mkdir(Kl.dirname(n),{recursive:!0}),await cf.writeFile(n,r.join(`
|
|
433
|
-
`),"utf-8"),n};async function IG({config:t,persistSteps:e=void 0,sendSteps:r=void 0,aiGateway:n,continueSession:i=!1,priorAgentSessionId:o=void 0,cwd:s=Tg.cwd(),cliPath:a="netlify",abortSignal:c=void 0,onSessionId:l=void 0,forceLowEffortForCreditWrapUp:u=void 0}){let{prompt:d}=t,f=Vh("gemini",t.effort);t.effort&&!f&&Xr.log(`Effort '${t.effort}' is not available on ${sO}; using its default`);let h=u?"low":f===Gi?void 0:f;z8e({aiGateway:n});let m=await j8e({aiGateway:n,config:t,model:t.model});await U8e({config:t,model:m,effort:h,creditWrapUpTurn:u});let g=[],_=[],v=[],T={},b=0,A=0,k,P,N,D,F,E=!!(i&&o),oe=!1;E&&(oe=await kv(o)),E&&!oe&&(Xr.log(`Gemini resume requested for session ${o} but it was not resumable; starting a fresh session`),ne.inc("inference.native_resume",1,{outcome:"sanitize_failed"}));let M=t.mode==="ask",S=M?await B8e({config:t,cliPath:a}):void 0,w=[Ps(s,"gemini"),...m?["--model",m]:[],...M?["--approval-mode","default","--policy",S]:["--yolo"],"--skip-trust","--output-format","stream-json",...oe?["-r",o]:[],"-p",""],O=`${Tg.env.NVM_BIN}/node`;Xr.log(`Running ${O} ${w.join(" ")}`);let Y=jt(O,w,{all:!0,env:{...Tg.env,GEMINI_CLI_NO_RELAUNCH:"1"},cwd:s,idleTimeout:Pa,cancelSignal:c});Y.stdin?.end(d);let H=Qc(()=>{e?.({steps:g,duration:A}),r?.({steps:_,duration:A}),_=[]},250),he=(ce,me)=>{ce.id=b,b+=1,v.push(ce),g.push(ce),_.push(ce),me||H.flush(),H(),me&&H.flush()},je=m||"default";t.answeredInteraction||he({title:`Using ${sO} with ${je}`,category:G.Environment},!0);let Ie=M8e.createInterface({input:Y.all});Ie.on("error",ce=>{Xr.error("Readline interface error",{error:ce.message,stack:ce.stack})});let $e="",
|
|
433
|
+
`),"utf-8"),n};async function IG({config:t,persistSteps:e=void 0,sendSteps:r=void 0,aiGateway:n,continueSession:i=!1,priorAgentSessionId:o=void 0,cwd:s=Tg.cwd(),cliPath:a="netlify",abortSignal:c=void 0,onSessionId:l=void 0,forceLowEffortForCreditWrapUp:u=void 0}){let{prompt:d}=t,f=Vh("gemini",t.effort);t.effort&&!f&&Xr.log(`Effort '${t.effort}' is not available on ${sO}; using its default`);let h=u?"low":f===Gi?void 0:f;z8e({aiGateway:n});let m=await j8e({aiGateway:n,config:t,model:t.model});await U8e({config:t,model:m,effort:h,creditWrapUpTurn:u});let g=[],_=[],v=[],T={},b=0,A=0,k,P,N,D,F,E=!!(i&&o),oe=!1;E&&(oe=await kv(o)),E&&!oe&&(Xr.log(`Gemini resume requested for session ${o} but it was not resumable; starting a fresh session`),ne.inc("inference.native_resume",1,{outcome:"sanitize_failed"}));let M=t.mode==="ask",S=M?await B8e({config:t,cliPath:a}):void 0,w=[Ps(s,"gemini"),...m?["--model",m]:[],...M?["--approval-mode","default","--policy",S]:["--yolo"],"--skip-trust","--output-format","stream-json",...oe?["-r",o]:[],"-p",""],O=`${Tg.env.NVM_BIN}/node`;Xr.log(`Running ${O} ${w.join(" ")}`);let Y=jt(O,w,{all:!0,env:{...Tg.env,GEMINI_CLI_NO_RELAUNCH:"1"},cwd:s,idleTimeout:Pa,cancelSignal:c});Y.stdin?.end(d);let H=Qc(()=>{e?.({steps:g,duration:A}),r?.({steps:_,duration:A}),_=[]},250),he=(ce,me)=>{ce.id=b,b+=1,v.push(ce),g.push(ce),_.push(ce),me||H.flush(),H(),me&&H.flush()},je=m||"default";t.answeredInteraction||he({title:`Using ${sO} with ${je}`,category:G.Environment},!0);let Ie=M8e.createInterface({input:Y.all});Ie.on("error",ce=>{Xr.error("Readline interface error",{error:ce.message,stack:ce.stack})});let $e="",Pe=()=>{$e&&he({message:$e.trim(),category:G.AgentMessage}),$e=""};Ie.on("line",ce=>{let me;try{if(ce.startsWith("[API Error")){let nt=ce.match(/\[api error: (.+?)]$/i)?.[1];me={type:"error",value:loe(nt,!1)?.error?.message||nt||"Gemini encountered error"}}else me=JSON.parse(ce)}catch{return}if(me)switch(me.type==="init"&&typeof me.session_id=="string"&&(D=me.session_id,l?.(D)),["message","result"].includes(me.type)||Pe(),me.type){case"message":{me.role!=="user"&&me.content&&($e+=me.content);break}case"tool_use":{let nt=me.tool_id&&!F?xm(me.tool_name,me.parameters,Aj):void 0;if(nt&&"interaction"in nt){F=nt.interaction,Y.kill();break}if(nt){Xr.warn("Ignoring malformed pause tool input",{toolUseId:me.tool_id,tool:me.tool_name,issues:nt.issues}),ne.inc(nt.metric,1);break}if(Am(me.tool_name,Aj))break;let re=CG[me.tool_name]?.name??me.tool_name,qe=me.parameters?.file_path,z=qe&&Kl.relative(s,qe),x=me.parameters?.command,C=me.tool_name==="activate_skill"&&me.parameters?.name,j=me.tool_name==="run_shell_command"&&Za(x),B=[re,z&&`\`${z}\``,x&&`\`${x}\``].filter(Boolean).join(" ");if(C)B=`Use ${bs(C)}`;else if(j)B="Generating the site";else if(me.tool_name==="grep_search"){let{dir_path:ie,pattern:Ee}=me.parameters||{};ie&&Ee?B=`Search in \`${ie}\` for \`${Ee}\``:ie?B=`Search in \`${ie}\``:Ee&&(B=`Search for \`${Ee}\``)}else if(me.tool_name==="update_topic"){let ie=me.parameters?.title;ie&&(B=`${re} \`${ie}\``)}let te={title:B,category:j?G.SiteGeneration:CG[me.tool_name]?.category,...C&&{type:C}};T[me.tool_id]=te,H.flush();break}case"tool_result":{let nt=T[me.tool_id];nt&&(me.output&&(nt.message=`\`\`\`
|
|
434
434
|
${me.output.trim()}
|
|
435
|
-
\`\`\``),he(nt,!0),F8e(nt));break}case"result":{A=me.stats?.duration_ms,me.stats&&(Jc(me.stats,m?{model:m}:{}),N=me.stats),me.status==="error"?P=me.error?.message:k=$e.trim();break}case"error":{P=me.error;break}case"finished":break;case"init":break;default:{Xr.warn("Unhandled message type:",me.type);break}}});let
|
|
435
|
+
\`\`\``),he(nt,!0),F8e(nt));break}case"result":{A=me.stats?.duration_ms,me.stats&&(Jc(me.stats,m?{model:m}:{}),N=me.stats),me.status==="error"?P=me.error?.message:k=$e.trim();break}case"error":{P=me.error;break}case"finished":break;case"init":break;default:{Xr.warn("Unhandled message type:",me.type);break}}});let He=!1;if(await Y.catch(ce=>{He=fl(ce,c),{error:P,result:k}=$8e({catchError:ce,runCmd:Y,error:P,result:k,runnerName:"Gemini"})}),Ie.close(),F)return H.flush(),{steps:v,duration:A,agentSessionId:D,resolvedModel:m,usage:N,pendingInteraction:F};let Ne=He;return Ne&&(!k&&$e.trim()&&(k=$e.trim()),P=void 0),H.flush(),{steps:v,duration:A,result:await Rl({initialResult:k,agentName:sO,hasError:!!P}),error:Cl({error:P,agentName:sO}),isRetryableError:Il(P),isProviderUnavailableError:Pl(P),resolvedModel:m,usage:N,agentSessionId:D,...h&&hge(m)?{effort:h}:{},...Ne?{aborted:!0}:{}}}var mge=async()=>{let t=Kl.join(Mv.homedir(),".gemini");await cf.rm(t,{recursive:!0,force:!0});let e=Kl.join(Mv.homedir(),".agents","skills");await cf.rm(e,{recursive:!0,force:!0})},gge={baseDir:Kl.join(Mv.homedir(),".gemini"),include:["tmp"]};import OG from"fs/promises";import vge from"os";import $v from"path";import kG from"process";import G8e from"readline";import q8e from"os";import Sge from"path";import PG from"fs";var _ge=le("opencode_install"),yge="1.17.19",V8e=()=>Sge.join(q8e.homedir(),".netlify-agent-runner","opencode"),aO=async t=>{let e=Ps(t,"opencode");if(e)return e;let r=V8e(),n=Sge.join(r,"node_modules",".bin","opencode");if(PG.existsSync(n))return n;PG.mkdirSync(r,{recursive:!0}),_ge.log(`Installing opencode-ai@${yge} on demand`);let i=Date.now();await jt("npm",["install","--no-save","--no-audit","--no-fund","--prefix",r,`opencode-ai@${yge}`],{cwd:r});let o=Date.now()-i;if(ne.timing("opencode.install_duration",o),_ge.log(`Installed opencode-ai in ${o}ms`),!PG.existsSync(n))throw new Error("OpenCode CLI binary not found after installing opencode-ai");return n};var cc=le("runner_opencode"),cO="OpenCode",bge="gateway",H8e="z-ai/glm-5.3-flash",W8e=new Set(["z-ai/glm-5.3-flash","deepseek/deepseek-v4-pro","x-ai/grok-4.6"]),Y8e=(t,e)=>!t||!MR.includes(t)?t:e&&W8e.has(e)?"xhigh":"max",NG={bash:{name:"Run command",category:G.RunCommand},read:{name:"Read file",category:G.FileRead},write:{name:"Edit file",category:G.FileWrite},edit:{name:"Edit file",category:G.FileWrite},glob:{name:"Find files",category:G.Explore},grep:{name:"Search files",category:G.Explore},list:{name:"List directory",category:G.Explore},task:{name:"Task",category:G.Task},todowrite:{name:"Update task list",category:G.Todo},webfetch:{name:"Fetch web",category:G.Web},websearch:{name:"Search web",category:G.Web},skill:{name:"Use Skill",category:G.Skill}},Ege=t=>NG[t]?.name||t,K8e=t=>Array.isArray(t)?t.flatMap(e=>{let{content:r,status:n}=e??{};return typeof r!="string"||!r?[]:[{name:r,value:typeof n=="string"&&n?n:"pending"}]}):[],Z8e=250,J8e=t=>{let e;try{e=JSON.parse(t)}catch{return{issues:"invalid_json"}}let r=bP.safeParse(e);return r.success?{questions:r.data.questions}:{issues:wm(r.error.issues)}},Tge=(t,e,r,n)=>{let i=!0,o=setInterval(async()=>{let s=await OG.readFile(t,"utf-8").catch(()=>{});if(s===void 0)return;clearInterval(o),await OG.rm(t,{force:!0}).catch(()=>{});let{value:a,issues:c}=e(s);if(a===void 0){cc.warn(n.message,{filePath:t,issues:c}),ne.inc(n.metric,1);return}i&&r(a)},Z8e);return o.unref(),{stop:()=>{i=!1,clearInterval(o)}}},X8e=(t,e)=>Tge(t,r=>{let{questions:n,issues:i}=J8e(r);return n?{value:n}:{issues:i}},e,{message:"Ignoring malformed ask tool questions file",metric:"inference.malformed_ask"}),Q8e=(t,e)=>Tge(t,r=>{let n;try{n=JSON.parse(r)}catch{return{issues:"invalid_json"}}let i=TP.safeParse(n);return i.success?{value:i.data}:{issues:wm(i.error.issues)}},e,{message:"Ignoring malformed authorization request file",metric:"inference.malformed_authorization"});async function e5e({aiGateway:t,config:e,model:r}){let n=r;if(t){let i=t.isModelAvailable;if(!i)throw new Error("OpenCode runner requires a gateway with isModelAvailable support");let o=e.modelVersionOverrides?.opencode?.[e.accountType];o?n=o:r||(n=tt().opencodeDefaultModel||H8e),n&&(await i(n)||cc.log(`Model '${n}' not found in gateway catalog; proceeding anyway (gateway is authoritative, e.g. flag-gated OpenRouter models)`))}return n}function t5e({aiGateway:t,model:e,effort:r,questionsFilePath:n,connections:i}){if(!t)throw new Error("OpenCode runner requires the AI gateway");let{token:o,url:s}=t;if(!o||!s)throw new Error("No token or url provided from AI Gateway");let a=e?{[e]:{id:e,name:e,tool_call:!0,reasoning:!0,interleaved:{field:/^~?deepseek\//.test(e)?"reasoning_content":"reasoning_details"},...r?{options:{reasoningEffort:r}}:{}}}:{},c={$schema:"https://opencode.ai/config.json",provider:{[bge]:{api:"openai",name:"Netlify AI Gateway",options:{apiKey:o,baseURL:s},...Object.keys(a).length>0?{models:a}:{}}},...n||i?{mcp:{...n?Gde(n):{},...i?Hde(i):{}}}:{}};return{...kG.env,OPENCODE_CONFIG_CONTENT:JSON.stringify(c),OPENCODE_DISABLE_AUTOUPDATE:"1"}}async function MG({config:t,persistSteps:e,aiGateway:r,continueSession:n,priorAgentSessionId:i,cwd:o=kG.cwd(),abortSignal:s,onSessionId:a,forceLowEffortForCreditWrapUp:c}){let{prompt:l}=t,{model:u}=t,d=t.effort===Gi,f=c?"low":d?void 0:t.effort,p="",h,m,g,_,v=0,T=0,b,A=await e5e({config:t,aiGateway:r,model:u}),k=Y8e(f,A);cc.log(f?`Requesting reasoning effort '${f}' for model '${A}'${k===f?"":` (sent as '${k}')`}; ignored if unsupported`:`No reasoning effort requested for model '${A}'; running at its own default`);let P=ml({creditWrapUpTurn:c})?await Zde():void 0,N=Pj({creditWrapUpTurn:c})?await Jde():void 0,D=hl(t,{requestFilePath:N?.filePath,creditWrapUpTurn:c}),F=t5e({aiGateway:r,model:A,effort:k,questionsFilePath:P?.filePath,connections:D}),E=[],oe=[],M=0,S=Date.now(),w=await aO(o),O=["run","--format","json","--dangerously-skip-permissions","--agent","build",...A?["--model",`${bge}/${A}`]:[],...n?i?["--session",i]:["--continue"]:[]];cc.log(`Running ${w} ${O.join(" ")}`);let Y=jt(w,O,{all:!0,env:F,cwd:o,idleTimeout:Pa,cancelSignal:s});Y.stdin?.end(l);let H=P?X8e(P.filePath,z=>{b||(b={questions:z},Y.kill())}):void 0,he=N?Q8e(N.filePath,z=>{b||(b={authorization:z},Y.kill())}):void 0,je=Qc(()=>{e?.({steps:oe,duration:Date.now()-S})},250),Ie=(z,x)=>{let{wrapMessage:C,...j}=z,B=YR({...j,id:M});B.message&&C&&(B.message=`\`\`\`
|
|
436
436
|
${B.message}
|
|
437
|
-
\`\`\``),M+=1,E.push(B),oe.push(B),x||je.flush(),je(),x&&je.flush()},$e=A||"default";t.answeredInteraction||Ie({title:`Using ${cO} with ${$e}`,category:G.Environment},!0);let
|
|
437
|
+
\`\`\``),M+=1,E.push(B),oe.push(B),x||je.flush(),je(),x&&je.flush()},$e=A||"default";t.answeredInteraction||Ie({title:`Using ${cO} with ${$e}`,category:G.Environment},!0);let Pe=G8e.createInterface({input:Y.all});Pe.on("error",z=>{cc.error("Readline interface error",{error:z.message,stack:z.stack})});let He="",Ne,ce=new Set,me=()=>{He&&(Ie({message:He,category:G.AgentMessage}),Ne=He,He="")};Pe.on("line",z=>{let x;try{x=JSON.parse(z)}catch{cc.log("Could not parse line",z);return}switch(x.sessionID&&x.sessionID!==p&&(p=x.sessionID,a?.(p)),x.type){case"step_start":{me();break}case"text":{let C=x.part?.text;C&&(He+=C);break}case"reasoning":{me();let C=x.part?.text;C&&Ie({title:"Reasoning",message:C,category:G.Reasoning},!0);break}case"tool_use":{me();let C=x.part?.tool;if(!C)break;let j=x.part?.state?.input??{},B=x.part?.state?.status,te=x.part?.state?.output,ie=x.part?.state?.error;if(Am(C,Ude)){B==="error"&&cc.warn("Pause tool call rejected before it could pause the run",{tool:C,error:ie});break}if(B==="error"&&(v+=1),(B==="completed"||B==="error")&&(T+=1),C==="skill"){let Ve=typeof j.name=="string"?j.name:void 0;if(Ve){let Ae=bs(Ve);Na(cc,Ae),Ie({title:`Use ${Ae}`,category:G.Skill,type:Ve},!0);break}}if(C==="todowrite"){let Ve=K8e(j.todos);Ie({title:Ege(C),category:Ve.length>0?NG.todowrite.category:G.Tool,...Ve.length>0?{tasks:Ve}:{}},!0);break}let Ee=typeof j.command=="string"?j.command:void 0,yt=Ee?Za(Ee):!1,lr=typeof j.path=="string"&&j.path||typeof j.file_path=="string"&&j.file_path||typeof j.pattern=="string"&&j.pattern||void 0,St,ci;if(yt)St="Generating the site",ci=G.SiteGeneration;else if(Ee&&C==="bash")St=`Running \`${Ee}\``,ci=G.RunCommand;else{let Ve=lr&&`\`${$v.relative(o,lr)}\``;St=[Ege(C),Ve].filter(Boolean).join(" "),ci=NG[C]?.category||G.AgentMessage}let We,De=["bash","read","glob","grep","list","webfetch","websearch"].includes(C);ie?We=`\`\`\`
|
|
438
438
|
${ie.trim()}
|
|
439
|
-
\`\`\``:te&&(
|
|
439
|
+
\`\`\``:te&&(We=De?`\`\`\`
|
|
440
440
|
${te.trim()}
|
|
441
|
-
\`\`\``:te.trim()),B==="error"&&ie&&(
|
|
441
|
+
\`\`\``:te.trim()),B==="error"&&ie&&(We=We?`${We}
|
|
442
442
|
|
|
443
|
-
*Command failed*`:`*Command failed: ${ie.trim()}*`),Ie({title:St,message:
|
|
444
|
-
${j}`:j;break}default:x.type&&!ce.has(x.type)&&(ce.add(x.type),cc.log(`Unhandled opencode event type: ${x.type}`))}});let nt=!1;await Y.catch(z=>{nt=fl(z,s),me();let x=Gh({catchError:z,runCmd:Y,error:m,result:h??Ne,runnerName:cO});m=x.error,h=x.result}),H?.stop(),he?.stop(),await P?.remove(),await N?.remove();let re=Date.now()-S;me(),
|
|
443
|
+
*Command failed*`:`*Command failed: ${ie.trim()}*`),Ie({title:St,message:We,category:ci},!0);break}case"step_finish":{me();let C=x.part?.tokens;C&&(g={input_tokens:(g?.input_tokens??0)+(C.input??0),output_tokens:(g?.output_tokens??0)+(C.output??0),reasoning_output_tokens:(g?.reasoning_output_tokens??0)+(C.reasoning??0),cache_creation_input_tokens:(g?.cache_creation_input_tokens??0)+(C.cache?.write??0),cache_read_input_tokens:(g?.cache_read_input_tokens??0)+(C.cache?.read??0)}),x.part?.cost!=null&&(_=(_??0)+x.part.cost);break}case"error":{me();let j=x.error?.data?.message??x.error?.message??x.part?.state?.error??(x.error?JSON.stringify(x.error).slice(0,500):"unknown error");m=m?`${m}
|
|
444
|
+
${j}`:j;break}default:x.type&&!ce.has(x.type)&&(ce.add(x.type),cc.log(`Unhandled opencode event type: ${x.type}`))}});let nt=!1;await Y.catch(z=>{nt=fl(z,s),me();let x=Gh({catchError:z,runCmd:Y,error:m,result:h??Ne,runnerName:cO});m=x.error,h=x.result}),H?.stop(),he?.stop(),await P?.remove(),await N?.remove();let re=Date.now()-S;me(),Pe.close(),je.flush();let qe=nt;return qe&&(m=void 0),!m&&!h&&Ne&&(h=Ne),g&&Jc(g,A?{model:A}:{}),b?{steps:E,duration:re,agentSessionId:p,resolvedModel:A,effort:f,resolvedProviderEffort:k,usage:g,costUsd:_,toolErrorCount:v,toolCallCount:T,pendingInteraction:b}:{steps:E,duration:re,result:await Rl({initialResult:h,agentName:cO,hasError:!!m}),error:Cl({error:m,agentName:cO}),isRetryableError:Il(m),isProviderUnavailableError:Pl(m),agentSessionId:p,resolvedModel:A,effort:f,resolvedProviderEffort:k,usage:g,costUsd:_,toolErrorCount:v,toolCallCount:T,...qe?{aborted:!0}:{}}}var r5e=()=>$v.join(vge.homedir(),".config","opencode"),wge=()=>{let t=kG.env.XDG_DATA_HOME,e=t&&$v.isAbsolute(t)?t:$v.join(vge.homedir(),".local","share");return $v.join(e,"opencode")},xge=async()=>{let t=[r5e(),wge()];await Promise.all(t.map(e=>OG.rm(e,{recursive:!0,force:!0})))},Age={baseDir:wge(),include:["opencode.db","opencode.db-shm","opencode.db-wal"]};var $G={codex:{runner:AG,clean:uge,nativeSessionArchive:dge},claude:{runner:UV,clean:ome,nativeSessionArchive:sme},gemini:{runner:IG,clean:mge,nativeSessionArchive:gge},opencode:{runner:MG,clean:xge,nativeSessionArchive:Age}},zQt=Object.keys($G),Gs=t=>$G[t]?.nativeSessionArchive,wg=$G;import{execSync as n5e}from"child_process";import Rge from"fs/promises";import i5e from"path";import xg from"process";var Cge=le("git-wrapper"),o5e=["status","diff","log","show","rev-parse","rev-list","ls-files","show-ref","cat-file","merge-base","blame","grep","describe"],s5e=t=>`#!/bin/bash
|
|
445
445
|
# Git wrapper that only allows read-only commands.
|
|
446
446
|
# The deployment system handles staging, moves, and commits automatically.
|
|
447
447
|
|
|
@@ -635,13 +635,13 @@ Preview deploy created successfully:`,{deployId:p.deploy_id,deployUrl:p.deploy_u
|
|
|
635
635
|
`)},rAe=async({cliPath:t,cwd:e,isFreshDatabase:r})=>{if(r)return $dt();try{return Ddt(await zY({cliPath:t,cwd:e}))}catch(n){return WN.warn("Skipping migration context injection \u2014 failed to build state block",{error:n}),null}},nAe=t=>{let e=[];return t.missingOnDisk.length>0&&e.push("You deleted the following migration file(s) that are already applied to the preview database branch:",...t.missingOnDisk.map(r=>`- ${r.name}`),"","Applied migrations cannot be removed \u2014 the deploy will fail because the platform requires every applied","migration to exist on disk with its original content. Please revise your work:","","1. Restore the deleted file(s) by running `netlify db migrations pull --force`, which overwrites the"," local migrations directory with the authoritative state of the branch. Note this also wipes any"," unapplied migration files you generated this session \u2014 regenerate them via `npx drizzle-kit generate`"," afterwards if you still need them (your `db/schema.ts` edits aren't affected by the pull).","2. If the underlying problem is that an applied migration is wrong, add a NEW migration on top that"," corrects whatever it did (drop a column, rename a table, etc.). Do not touch the original."),t.outOfOrder.length>0&&(e.length>0&&e.push(""),e.push("The following pending migration file(s) have a version prefix that sorts BEFORE migrations already","applied to the branch, so the platform will reject them on deploy:",...t.outOfOrder.map(r=>`- ${r.name} (version ${r.version} \u2264 applied max ${r.maxApplied})`),"","Delete these out-of-order files (use `netlify db migrations reset` \u2014 it only removes unapplied files),","then run `npx drizzle-kit generate` to produce a replacement whose version sorts after the applied","migrations.")),e.length===0?null:e.join(`
|
|
636
636
|
`)},iAe=t=>t.missingOnDisk.length>0||t.outOfOrder.length>0;var oAe=le("db_migrations_verify"),sAe=async t=>await Mt(dt(),"db-migrations-verify-stage",async e=>{let r;try{r=await zY({cliPath:t.cliPath,cwd:t.cwd})}catch(i){return oAe.warn("Skipping migration verification \u2014 failed to read status",{error:i}),e?.setAttributes({"verify.skipped":!0,"verify.skip_reason":"status_error"}),{}}if(!iAe(r))return e?.setAttributes({"verify.drift":!1}),{};let n=nAe(r);return e?.setAttributes({"verify.drift":!0,"verify.missing_on_disk_count":r.missingOnDisk.length,"verify.out_of_order_count":r.outOfOrder.length}),oAe.log("Detected post-inference migration drift",{missingOnDisk:r.missingOnDisk.map(i=>i.name),outOfOrder:r.outOfOrder.map(i=>i.name)}),{error:n??void 0}});import VK from"process";import omt from"net";var Ni=Un(jK(),1),Opr=Ni.default.Client,Npr=Ni.default.Pool,kpr=Ni.default.Connection,Mpr=Ni.default.types,$pr=Ni.default.Query,Dpr=Ni.default.DatabaseError,Lpr=Ni.default.escapeIdentifier,Upr=Ni.default.escapeLiteral,Fpr=Ni.default.Result,zpr=Ni.default.TypeOverrides,jpr=Ni.default.defaults,ZRe=Ni.default;var smt=80877103,amt=196608,cmt=Buffer.from([78]);function lmt(){let t=Buffer.alloc(9);t.writeUInt8(82,0),t.writeInt32BE(8,1),t.writeInt32BE(0,5);let e=Buffer.alloc(6);return e.writeUInt8(90,0),e.writeInt32BE(5,1),e.writeUInt8(73,5),Buffer.concat([t,e])}function dk(t){let e=Buffer.from("SERROR\0","utf8"),r=Buffer.concat([Buffer.from("M","utf8"),Buffer.from(t+"\0","utf8")]),n=Buffer.from("CXX000\0","utf8"),i=Buffer.from([0]),o=e.length+r.length+n.length+i.length,s=Buffer.alloc(5);return s.writeUInt8(69,0),s.writeInt32BE(o+4,1),Buffer.concat([s,e,n,r,i])}async function umt(t){let{clientSocket:e,provision:r,logger:n,cleanup:i}=t,o;try{o=await r()}catch(f){let p=f instanceof Error?f.message:"Provisioning failed";throw n("Provisioning error:",p),e.end(dk(p)),i(),f}let s=fmt(o),a=new ZRe.Client({host:s.host,port:s.port,user:s.user,password:s.password,database:s.database,ssl:s.ssl,options:s.options});a.on("error",()=>{});try{await a.connect()}catch(f){let p=f instanceof Error?f.message:"Remote connection failed";throw n("Remote connection error:",p),e.end(dk(p)),i(),f}let c=a.connection,l=c.stream;c.removeAllListeners(),l.removeAllListeners();let u=l,d=f=>p=>{p.code!=="ECONNRESET"&&n(`${f} socket error:`,p.message),i()};return u.on("error",d("Remote")),u.on("close",i),e.on("error",d("Client")),e.on("close",i),e.write(lmt()),e.on("data",f=>{u.destroyed||u.write(f)}),u.on("data",f=>{e.destroyed||e.write(f)}),e.resume(),u}function dmt(t,e){let{provision:r,logger:n,onCleanup:i}=e,o,s="ssl",a=!1;function c(){a||(a=!0,t.destroy(),o?.destroy(),i())}t.on("error",l=>{l.code!=="ECONNRESET"&&n("Client socket error:",l.message),c()}),t.on("data",l=>{if(s==="ssl"){if(l.length>=8&&l.readInt32BE(4)===smt){t.write(cmt),s="startup";return}s="startup"}if(s==="startup"){if(l.length<8){t.end(dk("Invalid startup message")),c();return}if(l.readInt32BE(4)!==amt){t.end(dk("Unsupported protocol version")),c();return}t.pause(),t.removeAllListeners("data"),umt({clientSocket:t,provision:r,logger:n,cleanup:c}).then(d=>{o=d},d=>{n("Startup error:",d),c()})}})}function fmt(t){let e=new URL(t);return{host:e.hostname,port:Number(e.port)||5432,user:decodeURIComponent(e.username),password:decodeURIComponent(e.password),database:e.pathname.slice(1)||"postgres",ssl:e.searchParams.get("sslmode")==="require"?!0:void 0,options:e.searchParams.get("options")??void 0}}var JRe=class{server;sockets=new Set;host;port;logger;provision;constructor(t){this.host=t.host??"127.0.0.1",this.port=t.port??0,this.logger=t.logger??(()=>{}),this.provision=t.provision}async start(){return new Promise((t,e)=>{let r=omt.createServer(n=>{this.sockets.add(n),n.on("close",()=>{this.sockets.delete(n)}),dmt(n,{provision:this.provision,logger:this.logger,onCleanup:()=>{this.sockets.delete(n)}})});r.on("error",n=>{e(n)}),r.listen(this.port,this.host,()=>{this.server=r;let n=r.address(),i=`postgres://${this.host}:${String(n.port)}`;this.logger("Proxy listening on",i),t(i)})})}async stop(){for(let t of this.sockets)t.destroy();return this.sockets.clear(),new Promise(t=>{if(!this.server){t();return}this.server.close(()=>{this.server=void 0,t()})})}};var fk=le("db_setup"),XRe=async({siteId:t,isProd:e,alias:r,connectionString:n})=>await Mt(dt(),"db-setup-stage",async i=>{i?.setAttributes({"db_setup.site_id":t,"db_setup.is_prod":e,...r&&{"db_setup.alias":r}});let o;if(e?o="production":r&&(o=r),VK.env.NETLIFY_DB_BRANCH=o,n)return i?.setAttributes({"db_setup.source":"config","db_setup.has_proxy":!1}),fk.log("Using database connection string provided by the API"),VK.env.NETLIFY_DB_URL=n,{connectionString:n,wasProvisioned:()=>!1};let s=!1,a=new JRe({logger:(...l)=>fk.log("db-proxy:",...l),provision:async()=>(s=!0,fk.log("Provisioning database for site via API"),await eoe(t),await pmt(t,e,r))}),c=await a.start();return i?.setAttributes({"db_setup.source":"proxy","db_setup.has_proxy":!0}),fk.log("Local DB proxy started",{connectionString:c}),VK.env.NETLIFY_DB_URL=c,{connectionString:c,proxy:a,wasProvisioned:()=>s}}),pmt=async(t,e,r)=>e||!r?(await Jie(t)).connection_string:(await toe(t,r),(await Qie(t,r)).connection_string);var e0e=({config:t,cliPath:e,cwd:r,withStageTimer:n})=>{let i,o=null,s=t.mode==="ask";return{prepare:async({deploySubdomain:a,isProdDeploy:c})=>{if(s)return o=Pde(t,a),o?(ne.inc("ask_mode.db_read_granted",1),aEe({cliPath:e,branch:o.branch})):void 0;QRe.env.EXPERIMENTAL_NETLIFY_DB_ENABLED="1";let l=t.siteId;if(QRe.env.NETLIFY_LOCAL_MODE||!l)return;let u=await n("db-setup",()=>XRe({siteId:l,isProd:c,alias:a,connectionString:t.dbConnectionString}),Do.timeUnits.minutes(10));return i=u.proxy,r?await rAe({cliPath:e,cwd:r,isFreshDatabase:!!u.proxy})??void 0:void 0},generateMigrations:async()=>s?{skipped:!0}:await tAe({cwd:r}),verifyMigrations:async()=>r?await n("db-migrations-verify",()=>sAe({cliPath:e,cwd:r})):{},hasDatabase:async()=>t.siteId?await Xie(t.siteId):!1,stop:async()=>{await i?.stop()},revokeAskAccess:()=>{o&&wj()}}};import hmt from"process";var t0e=le("teardown"),r0e=({config:t,cwd:e,database:r,stopUsageTracking:n})=>{let i,o=t.mode==="ask";return{setRunnerCleanup:s=>{i=s},run:async s=>{let a=async(l,u)=>{try{await u()}catch(d){t0e.warn(`Teardown step failed: ${l}`,{state:s,error:d?.message||d}),ne.inc("teardown.step_failed",1,{step:l,state:s})}},c=s==="completed"&&!hmt.env.NETLIFY_LOCAL_MODE;await a("usage-tracker",n),(s==="errored"||c)&&await a("runner-cleanup",()=>i?.()),await a("db-proxy",()=>r.stop()),c&&await a("reset-repo",()=>Uue(e)),o&&c&&await a("remove-untracked-files",async()=>{let l=await Fue(e);l.length>0&&(t0e.warn(`Removed ${l.length} leftover untracked change(s) after ask run`,{removed:l}),ne.inc("ask_mode.leaked_untracked_files",l.length))})}}};var mmt=({isHotFollowUp:t,enqueuedAt:e})=>t?e===void 0?[]:[["request",e]]:[["spawn",Number(process.env.NETLIFY_AGENT_RUNNER_SPAWN_AT_MS)],["enqueue",Number(process.env.NETLIFY_AGENT_RUNNER_ENQUEUED_AT_MS)]],GK=(t,e,r,n)=>{for(let[i,o]of mmt(r))Number.isFinite(o)&&o>0&&o<=n&&t.timing(e,n-o,{from:i})},n0e=(t,e=Date.now(),r=ne)=>GK(r,"startup.duration",t,e),i0e=(t,e=Date.now(),r=ne)=>GK(r,"startup.time_to_prompt",t,e),o0e=(t,e=Date.now(),r=ne)=>GK(r,"startup.time_to_first_output",t,e);var s0e=(t,e=Date.now(),r=ne)=>{let n={outcome:t.outcome,native_resume:t.nativeResume,is_answer_resume:t.isAnswerResume};r.timing("session.duration",e-t.startedAt,{hot_follow_up:t.isHotFollowUp,...n}),t.creditsCost!=null&&r.distribution("session.credits_cost",t.creditsCost,{...n,...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{}})};function a0e(t){return["One or more AI functions use the legacy **v1** syntax (`exports.handler` / `module.exports.handler`):","",t.map(r=>`- ${r}`).join(`
|
|
637
637
|
`),"",'Netlify AI Gateway credentials (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` and the matching `*_BASE_URL` variables) are injected ONLY into the modern v2/v3 function runtime. A v1 function builds and deploys successfully but throws "missing API key" at runtime \u2014 this will NOT appear as a build error.',"","Rewrite each listed function using **v2** syntax \u2014 `export default async (req: Request) => Response` \u2014 or **v3** object export (`satisfies NetlifyFunction`), preserving its existing behavior and route. Do not set your own API keys; rely on the injected gateway credentials. See the `netlify-ai-gateway` skill for examples."].join(`
|
|
638
|
-
`)}var Pf=le("usage_tracker"),gmt=4e3,_mt=5e3,ymt=2e4,Smt=(t,e,r)=>t===!0||r!=null&&e!=null&&e>=r,Emt=(t,e,r)=>e!=null&&e>0&&r!=null&&t!=null&&e-t<=r,c0e=(t,e,r,{creditReserve:n,onCreditReserveReached:i}={})=>{let o=!1,s=!1,a=!1,c=!1,l,u,d,f=r,p,h=i!=null&&n!=null,m=()=>{p&&(clearInterval(p),p=void 0)},g=P=>{m(),p=setInterval(()=>{v()},P),p.unref?.()},_=async()=>{try{let P=await VR(t,e);Pf.log("Usage update response",{usage:P?.usage});let N=P?.usage?.total_credits_cost;N!=null&&(l=N);let D=P?.enforced_credits_cap;if(D!=null&&D!==f){let E=f==null;f=D,Pf.log("Took the session credit limit from a usage poll",{sessionCreditLimit:f,totalCreditsCost:N,isFirstLimit:E}),E&&ne.inc("session.credit_cap_late_arrival",1)}let F=Smt(P?.credit_limit_exceeded,N,f);if(F&&(Pf.log("Credit limit exceeded",{totalCreditsCost:N,sessionCreditLimit:f}),a||(u=Date.now(),d=N??l??0,g(ymt)),a=!0),h&&!c&&!F&&Emt(N,f,n)){c=!0,Pf.log("Credit reserve reached",{totalCreditsCost:N,sessionCreditLimit:f,creditReserve:n});try{i()}catch(E){Pf.warn("onCreditReserveReached callback threw",{error:E?.message||E})}}}catch(P){Pf.warn("Failed to update usage",{error:P?.message||P})}},v=WR(_,gmt);return{onAgentOutput:()=>{if(a)throw new Po("AI credit usage exceeded enforced limit.",503,"Credit limit reached. Check credit limits to continue using Agent Runners.",!0);s||(o=!0,p||g(_mt))},stop:async()=>{s||(s=!0,m(),o&&(v.cancel(),Pf.log("Sending final usage update"),await _(),u!==void 0&&(ne.timing("credit_limit.overage_duration",Date.now()-u),ne.distribution("credit_limit.overage_credits",Math.max(0,(l??d??0)-(d??0))))))},getCreditsCost:()=>l,getSessionCreditLimit:()=>f}};var l0e=le("session_credit_limit"),vmt=async t=>{if(t.sessionCreditLimit!=null)return{limit:t.sessionCreditLimit,source:"env"};try{let e=(await VR(t.id,t.sessionId))?.enforced_credits_cap;if(e!=null)return l0e.log("Resolved the session credit limit from the usage endpoint",{limit:e}),{limit:e,source:"usage"}}catch(e){l0e.warn("Usage call for the session credit limit failed",{error:e?.message||e})}return{source:"none"}},u0e=async(t,e=!1)=>{let{limit:r,source:n}=await vmt(t);t.sessionCreditLimit=r,ne.inc("session.credit_cap_source",1,{source:n,hot_follow_up:e})};var _u=le("credit_wrapup"),d0e="low",bmt=t=>t.mode==="ask"?YU:t.mode==="normal"?KU:Md(t)?HU:WU,HK=t=>{let e=tt();return e.creditWrapUpReserveByModeAndModel[t.mode]?.[t.runner]??e.creditWrapUpReserve},f0e=(t,e)=>{if(e<=0)return!1;let r=tt();return t.mode==="create"?r.creditWrapUpEnabled:t.mode==="ask"||t.mode==="normal"?r.creditWrapUpNormalEnabled:!1},WK=(t,e)=>{if(t==="fix"){_u.log("Credit reserve reached outside of the main inference turn \u2014 letting the fix finish without a wrap-up"),ne.inc("session.credit_wrapup_skipped_fix_turn",1,{credit_reserve:e});return}if(t==="no_session"){_u.warn("Credit reserve reached but no session id yet \u2014 skipping wrap-up interrupt"),ne.inc("session.credit_wrapup_skipped_no_session",1,{credit_reserve:e});return}_u.log("Credit reserve reached with no turn to interrupt \u2014 the agent had already finished")},p0e=(t,e,r)=>{if(e==null)return;let n=Math.max(0,e-t.creditsSpentBeforeWrapUp);_u.log("Credit wrap-up cost",{credits:n,creditsCostAtSessionEnd:e,effort:d0e,inferenceAfterWrapUp:r,...t}),ne.distribution("session.credit_wrapup_cost",n,{outcome:t.outcome,effort:d0e,credit_reserve:t.creditReserve,inference_after_wrap_up:r,...t.model?{model:t.model}:{}})},h0e=async({runnerResult:t,interruptedSessionId:e,creditsSpentBeforeWrapUp:r,cliPath:n,config:i,context:o,runner:s,aiGateway:a,cwd:c,persistSteps:l,usageTracker:u,withStageTimer:d,answerFold:f})=>{let p=HK(i),h=new AbortController,m=!1,g=!1,_,v=Object.assign(async A=>{try{u.onAgentOutput()}catch(k){Oa(k)&&!m&&(m=!0,_u.log("Wrap-up turn spent the credit reserve \u2014 stopping wrap-up",{creditsSpentBeforeWrapUp:r}),ne.inc("session.credit_wrapup_aborted",1,{credit_reserve:p}),h.abort())}return l(A)},{flush:l.flush.bind(l)});_u.log("Running credit wrap-up inference turn",{creditsSpentBeforeWrapUp:r,creditReserve:p});try{await l({steps:[{category:G.WrapUp,message:`You are reaching your usage limit. ${i.mode==="ask"?"Wrapping up and gathering the info found so far.":"Wrapping up and leaving your work in a usable state."}`}],duration:0})}catch{}let T;try{let{runnerResult:A}=await d("inference-credit-wrapup",()=>pu({cliPath:n,config:i,context:o,runner:s,persistSteps:v,aiGateway:a,cwd:c,contextPrefix:bmt(i),priorAgentSessionId:e,resumeForCreditWrapUp:!0,answerFold:f,forceLowEffortForCreditWrapUp:!0,abortSignal:h.signal}));_=A.resolvedModel,m&&_u.log("Wrap-up turn was aborted due to budget limit"),T={...bE(t,A),resolvedModel:t.resolvedModel,effort:t.effort,resolvedProviderEffort:t.resolvedProviderEffort}}catch(A){_u.warn("Credit wrap-up turn failed \u2014 proceeding with pre-wrap-up result",{error:A?.message||A}),ne.inc("session.credit_wrapup_failed",1,{credit_reserve:p}),g=!0,T=t}let b=_??t.resolvedModel;return{runnerResult:T,costReport:{creditsSpentBeforeWrapUp:r,creditReserve:p,outcome:g?"failed":m?"aborted":"completed",...b?{model:b}:{}}}};var m0e=t=>{let e,r=!1;return{getActiveTurn:()=>e?"main":r?"fix":"none",getMainTurnAbortSignal:()=>t?e?.signal:void 0,startMainTurn:()=>{e=new AbortController},finishMainTurn:()=>{e=void 0},runFixTurn:async n=>{r=!0;try{return await n()}finally{r=!1}},abortMainTurn:()=>e?.abort()}};import Tmt from"process";var YK=le("shutdown"),g0e=!1,wmt,xmt=async t=>{if(g0e)return;if(g0e=!0,YK.info("Shutting down...",{signal:t}),yue(),ne.distribution("session.hot_followups",vEe()),!EEe()){let r=Date.now(),n=bEe(),i=TEe();n!==void 0&&ne.timing("session.last_linger",r-n),i!==void 0&&ne.timing("session.total_linger",r-i)}let e=wmt?.close().catch(r=>{YK.error("Error closing server during graceful shutdown",r)});await xEe(),await e,await Iie(),YK.info("Shutdown complete"),Tmt.exit(0)};var _0e=t=>{xmt(t)};var Amt=4e3,Rmt=3e4,lT=le("credit_limit_preservation"),y0e=async(t,e)=>{if(!e)return null;Jg(e);let r=Gs(t.runner),n=null;try{await Promise.race([Promise.all([Rf({runnerId:t.id,sessionId:t.sessionId,archive:r,nativeSessionId:e}).then(i=>{n=i}),Zb({archive:r,cache:t.cache,nativeSessionId:e}).catch(i=>{lT.warn("Failed to seed the native session cache before teardown",{error:i?.message||i})})]),new Promise(i=>{setTimeout(i,Amt).unref()})])}catch(i){lT.warn("Failed to preserve native session before teardown",{error:i?.message||i})}return n},S0e=async(t,e)=>{let r=null,n={},i=[];if(e){Jg(e);let o=Gs(t.runner);i.push(Promise.all([Rf({runnerId:t.id,sessionId:t.sessionId,archive:o,nativeSessionId:e}).then(s=>{r=s}),Zb({archive:o,cache:t.cache,nativeSessionId:e}).catch(s=>{lT.warn("Failed to seed the native session cache on credit-limit shutdown",{error:s?.message||s})})]).catch(s=>{lT.warn("Failed to preserve native session on credit-limit shutdown",{error:s?.message||s})}))}if(t.mode!=="ask"&&i.push(oC({config:t}).then(o=>o.hasChanges?UY({config:t,diff:o.diff,diffBinary:o.diffBinary,resultDiff:o.resultDiff,resultDiffBinary:o.resultDiffBinary}):{}).then(o=>{n=o}).catch(o=>{lT.warn("Failed to preserve working-tree diff on credit-limit shutdown",{error:o?.message||o})})),i.length>0){let o=!1;await Promise.race([Promise.all(i).then(()=>{o=!0}),new Promise(s=>{setTimeout(s,Rmt).unref()})]),o||ne.inc("credit_preservation.timed_out",1)}return{nativeSessionS3Key:r,diffFields:n}};var Imt=Cmt(import.meta.url),uT=Imt("../package.json"),an=le("pipeline_index"),A_=3,Pmt=["codex","gemini"],Wnt=async({config:t,apiToken:e,cliPath:r="netlify",cwd:n,filter:i,isHotFollowUp:o=!1,enqueuedAt:s,tracing:a={}})=>{let c,l=Date.now(),u="success",d=!1,f,p,h=!1,m,g=!1,{withStageTimer:_}=Sue(Do.timeUnits.hours(4)),v=e0e({config:t,cliPath:r,cwd:n,withStageTimer:_}),T=r0e({config:t,cwd:n,database:v,stopUsageTracking:()=>c?.stop()}),b=await Pie(uT.version,t.id,a);an.log(`Agent runner orchestrator v${uT.version}`,{featureFlags:tt().raw,metrics:Uie()});let A={agent:t.runner,mode:t.mode,is_follow_up:t.sessionHistoryContext.length>0,version:uT.version,fast_init:t.fastInit,credit_wrapup:!1,budget_eligible:!1,budget_constrained:!1,ask_first:!1};IS({...A});let k=!!t.answeredInteraction;n0e({isHotFollowUp:o,enqueuedAt:s}),$ue(t.sessionId);try{await sy(dt(),"run-pipeline",{},b,async P=>{await Q6(X6(),t.runner),P?.setAttributes({"gen_ai.capability.name":t.mode,"session.id":t.sessionId,...process.env.NETLIFY_DEV_SERVER_ID?{"dev_server.id":process.env.NETLIFY_DEV_SERVER_ID}:{}});let{aiGateway:N,context:D,persistSteps:F,runner:E,sha:oe}=await _("init",()=>Pge({config:t,apiToken:e,cliPath:r,cwd:n,filter:i,runnerVersion:uT.version}),Do.timeUnits.minutes(10)),M=E.runner;tt().idleTimeoutEnabled||T.setRunnerCleanup(E.clean),await u0e(t,o),Object.assign(A,Jhe(t)),IS({...A});let S=HK(t),w=f0e(t,S),O=m0e(w),Y,H=!1,he=0,je;c=c0e(t.id,t.sessionId,t.sessionCreditLimit,{...w?{creditReserve:S,onCreditReserveReached:()=>{if(!H){if(O.getActiveTurn()!=="main"){H=!0,WK(O.getActiveTurn(),S);return}if(!je){WK("no_session",S);return}H=!0,he=c?.getCreditsCost()??0,an.log("Credit reserve reached \u2014 interrupting agent to wrap up",{creditsSpentBeforeWrapUp:he,creditReserve:S}),A.credit_wrapup=!0,IS({...A}),ne.inc("session.credit_wrapup_triggered",1,{credit_reserve:S}),O.abortMainTurn()}}}:{}});let Ie=$C(t.mode),$e;t.deployAlias&&t.deployAlias.length>0?$e=t.deployAlias:(t.deployAlias!==void 0&&!Ie&&an.warn("Received empty deploy alias for a non-prod deploy, falling back to local computation"),$e=uoe(t.id,process.env.SITE_NAME,Ie));let Oe=!1,Je=!1,Ne=Object.assign(async Pe=>{Oe||(Oe=!0,i0e({isHotFollowUp:o,enqueuedAt:s}));try{c?.onAgentOutput()}catch(Ft){return Oa(Ft)?Y??=Ft:an.warn("Unexpected error in onAgentOutput",{error:Ft?.message||Ft}),F(Pe)}return!Je&&Pe.steps?.some(Ft=>Ft.category!==G.Environment&&Ft.category!==G.SubagentPrompt)&&(Je=!0,o0e({isHotFollowUp:o,enqueuedAt:s})),F(Pe)},{flush:F.flush.bind(F)});if(t.sha=oe,t.mode==="redeploy"){await Qxe({cliPath:r,config:t,filter:i,deploySubdomain:$e,isProdDeploy:Ie,withStageTimer:_,stopUsageTracking:async()=>{await c?.stop()}}),await T.run("completed");return}let ce=NEe(),me=t.mode==="ask",nt;t.mode==="create"&&(nt=(await _("create",()=>eme({config:t,cwd:n}))).additionalContext),nt=await cEe(nt,t);let re=await v.prepare({deploySubdomain:$e,isProdDeploy:Ie});re&&(nt=[re,nt].filter(Boolean).join(`
|
|
638
|
+
`)}var Pf=le("usage_tracker"),gmt=4e3,_mt=5e3,ymt=2e4,Smt=(t,e,r)=>t===!0||r!=null&&e!=null&&e>=r,Emt=(t,e,r)=>e!=null&&e>0&&r!=null&&t!=null&&e-t<=r,c0e=(t,e,r,{creditReserve:n,onCreditReserveReached:i}={})=>{let o=!1,s=!1,a=!1,c=!1,l,u,d,f=r,p,h=i!=null&&n!=null,m=()=>{p&&(clearInterval(p),p=void 0)},g=P=>{m(),p=setInterval(()=>{v()},P),p.unref?.()},_=async()=>{try{let P=await VR(t,e);Pf.log("Usage update response",{usage:P?.usage});let N=P?.usage?.total_credits_cost;N!=null&&(l=N);let D=P?.enforced_credits_cap;if(D!=null&&D!==f){let E=f==null;f=D,Pf.log("Took the session credit limit from a usage poll",{sessionCreditLimit:f,totalCreditsCost:N,isFirstLimit:E}),E&&ne.inc("session.credit_cap_late_arrival",1)}let F=Smt(P?.credit_limit_exceeded,N,f);if(F&&(Pf.log("Credit limit exceeded",{totalCreditsCost:N,sessionCreditLimit:f}),a||(u=Date.now(),d=N??l??0,g(ymt)),a=!0),h&&!c&&!F&&Emt(N,f,n)){c=!0,Pf.log("Credit reserve reached",{totalCreditsCost:N,sessionCreditLimit:f,creditReserve:n});try{i()}catch(E){Pf.warn("onCreditReserveReached callback threw",{error:E?.message||E})}}}catch(P){Pf.warn("Failed to update usage",{error:P?.message||P})}},v=WR(_,gmt);return{onAgentOutput:()=>{if(a)throw new Po("AI credit usage exceeded enforced limit.",503,"Credit limit reached. Check credit limits to continue using Agent Runners.",!0);s||(o=!0,p||g(_mt))},stop:async()=>{s||(s=!0,m(),o&&(v.cancel(),Pf.log("Sending final usage update"),await _(),u!==void 0&&(ne.timing("credit_limit.overage_duration",Date.now()-u),ne.distribution("credit_limit.overage_credits",Math.max(0,(l??d??0)-(d??0))))))},getCreditsCost:()=>l,getSessionCreditLimit:()=>f}};var l0e=le("session_credit_limit"),vmt=async t=>{if(t.sessionCreditLimit!=null)return{limit:t.sessionCreditLimit,source:"env"};try{let e=(await VR(t.id,t.sessionId))?.enforced_credits_cap;if(e!=null)return l0e.log("Resolved the session credit limit from the usage endpoint",{limit:e}),{limit:e,source:"usage"}}catch(e){l0e.warn("Usage call for the session credit limit failed",{error:e?.message||e})}return{source:"none"}},u0e=async(t,e=!1)=>{let{limit:r,source:n}=await vmt(t);t.sessionCreditLimit=r,ne.inc("session.credit_cap_source",1,{source:n,hot_follow_up:e})};var _u=le("credit_wrapup"),d0e="low",bmt=t=>t.mode==="ask"?YU:t.mode==="normal"?KU:Md(t)?HU:WU,HK=t=>{let e=tt();return e.creditWrapUpReserveByModeAndModel[t.mode]?.[t.runner]??e.creditWrapUpReserve},f0e=(t,e)=>{if(e<=0)return!1;let r=tt();return t.mode==="create"?r.creditWrapUpEnabled:t.mode==="ask"||t.mode==="normal"?r.creditWrapUpNormalEnabled:!1},WK=(t,e)=>{if(t==="fix"){_u.log("Credit reserve reached outside of the main inference turn \u2014 letting the fix finish without a wrap-up"),ne.inc("session.credit_wrapup_skipped_fix_turn",1,{credit_reserve:e});return}if(t==="no_session"){_u.warn("Credit reserve reached but no session id yet \u2014 skipping wrap-up interrupt"),ne.inc("session.credit_wrapup_skipped_no_session",1,{credit_reserve:e});return}_u.log("Credit reserve reached with no turn to interrupt \u2014 the agent had already finished")},p0e=(t,e,r)=>{if(e==null)return;let n=Math.max(0,e-t.creditsSpentBeforeWrapUp);_u.log("Credit wrap-up cost",{credits:n,creditsCostAtSessionEnd:e,effort:d0e,inferenceAfterWrapUp:r,...t}),ne.distribution("session.credit_wrapup_cost",n,{outcome:t.outcome,effort:d0e,credit_reserve:t.creditReserve,inference_after_wrap_up:r,...t.model?{model:t.model}:{}})},h0e=async({runnerResult:t,interruptedSessionId:e,creditsSpentBeforeWrapUp:r,cliPath:n,config:i,context:o,runner:s,aiGateway:a,cwd:c,persistSteps:l,usageTracker:u,withStageTimer:d,answerFold:f})=>{let p=HK(i),h=new AbortController,m=!1,g=!1,_,v=Object.assign(async A=>{try{u.onAgentOutput()}catch(k){Oa(k)&&!m&&(m=!0,_u.log("Wrap-up turn spent the credit reserve \u2014 stopping wrap-up",{creditsSpentBeforeWrapUp:r}),ne.inc("session.credit_wrapup_aborted",1,{credit_reserve:p}),h.abort())}return l(A)},{flush:l.flush.bind(l)});_u.log("Running credit wrap-up inference turn",{creditsSpentBeforeWrapUp:r,creditReserve:p});try{await l({steps:[{category:G.WrapUp,message:`You are reaching your usage limit. ${i.mode==="ask"?"Wrapping up and gathering the info found so far.":"Wrapping up and leaving your work in a usable state."}`}],duration:0})}catch{}let T;try{let{runnerResult:A}=await d("inference-credit-wrapup",()=>pu({cliPath:n,config:i,context:o,runner:s,persistSteps:v,aiGateway:a,cwd:c,contextPrefix:bmt(i),priorAgentSessionId:e,resumeForCreditWrapUp:!0,answerFold:f,forceLowEffortForCreditWrapUp:!0,abortSignal:h.signal}));_=A.resolvedModel,m&&_u.log("Wrap-up turn was aborted due to budget limit"),T={...bE(t,A),resolvedModel:t.resolvedModel,effort:t.effort,resolvedProviderEffort:t.resolvedProviderEffort}}catch(A){_u.warn("Credit wrap-up turn failed \u2014 proceeding with pre-wrap-up result",{error:A?.message||A}),ne.inc("session.credit_wrapup_failed",1,{credit_reserve:p}),g=!0,T=t}let b=_??t.resolvedModel;return{runnerResult:T,costReport:{creditsSpentBeforeWrapUp:r,creditReserve:p,outcome:g?"failed":m?"aborted":"completed",...b?{model:b}:{}}}};var m0e=t=>{let e,r=!1;return{getActiveTurn:()=>e?"main":r?"fix":"none",getMainTurnAbortSignal:()=>t?e?.signal:void 0,startMainTurn:()=>{e=new AbortController},finishMainTurn:()=>{e=void 0},runFixTurn:async n=>{r=!0;try{return await n()}finally{r=!1}},abortMainTurn:()=>e?.abort()}};import Tmt from"process";var YK=le("shutdown"),g0e=!1,wmt,xmt=async t=>{if(g0e)return;if(g0e=!0,YK.info("Shutting down...",{signal:t}),yue(),ne.distribution("session.hot_followups",vEe()),!EEe()){let r=Date.now(),n=bEe(),i=TEe();n!==void 0&&ne.timing("session.last_linger",r-n),i!==void 0&&ne.timing("session.total_linger",r-i)}let e=wmt?.close().catch(r=>{YK.error("Error closing server during graceful shutdown",r)});await xEe(),await e,await Iie(),YK.info("Shutdown complete"),Tmt.exit(0)};var _0e=t=>{xmt(t)};var Amt=4e3,Rmt=3e4,lT=le("credit_limit_preservation"),y0e=async(t,e)=>{if(!e)return null;Jg(e);let r=Gs(t.runner),n=null;try{await Promise.race([Promise.all([Rf({runnerId:t.id,sessionId:t.sessionId,archive:r,nativeSessionId:e}).then(i=>{n=i}),Zb({archive:r,cache:t.cache,nativeSessionId:e}).catch(i=>{lT.warn("Failed to seed the native session cache before teardown",{error:i?.message||i})})]),new Promise(i=>{setTimeout(i,Amt).unref()})])}catch(i){lT.warn("Failed to preserve native session before teardown",{error:i?.message||i})}return n},S0e=async(t,e)=>{let r=null,n={},i=[];if(e){Jg(e);let o=Gs(t.runner);i.push(Promise.all([Rf({runnerId:t.id,sessionId:t.sessionId,archive:o,nativeSessionId:e}).then(s=>{r=s}),Zb({archive:o,cache:t.cache,nativeSessionId:e}).catch(s=>{lT.warn("Failed to seed the native session cache on credit-limit shutdown",{error:s?.message||s})})]).catch(s=>{lT.warn("Failed to preserve native session on credit-limit shutdown",{error:s?.message||s})}))}if(t.mode!=="ask"&&i.push(oC({config:t}).then(o=>o.hasChanges?UY({config:t,diff:o.diff,diffBinary:o.diffBinary,resultDiff:o.resultDiff,resultDiffBinary:o.resultDiffBinary}):{}).then(o=>{n=o}).catch(o=>{lT.warn("Failed to preserve working-tree diff on credit-limit shutdown",{error:o?.message||o})})),i.length>0){let o=!1;await Promise.race([Promise.all(i).then(()=>{o=!0}),new Promise(s=>{setTimeout(s,Rmt).unref()})]),o||ne.inc("credit_preservation.timed_out",1)}return{nativeSessionS3Key:r,diffFields:n}};var Imt=Cmt(import.meta.url),uT=Imt("../package.json"),an=le("pipeline_index"),A_=3,Pmt=["codex","gemini"],Wnt=async({config:t,apiToken:e,cliPath:r="netlify",cwd:n,filter:i,isHotFollowUp:o=!1,enqueuedAt:s,tracing:a={}})=>{let c,l=Date.now(),u="success",d=!1,f,p,h=!1,m,g=!1,{withStageTimer:_}=Sue(Do.timeUnits.hours(4)),v=e0e({config:t,cliPath:r,cwd:n,withStageTimer:_}),T=r0e({config:t,cwd:n,database:v,stopUsageTracking:()=>c?.stop()}),b=await Pie(uT.version,t.id,a);an.log(`Agent runner orchestrator v${uT.version}`,{featureFlags:tt().raw,metrics:Uie()});let A={agent:t.runner,mode:t.mode,is_follow_up:t.sessionHistoryContext.length>0,version:uT.version,fast_init:t.fastInit,credit_wrapup:!1,budget_eligible:!1,budget_constrained:!1,ask_first:!1};IS({...A});let k=!!t.answeredInteraction;n0e({isHotFollowUp:o,enqueuedAt:s}),$ue(t.sessionId);try{await sy(dt(),"run-pipeline",{},b,async P=>{await Q6(X6(),t.runner),P?.setAttributes({"gen_ai.capability.name":t.mode,"session.id":t.sessionId,...process.env.NETLIFY_DEV_SERVER_ID?{"dev_server.id":process.env.NETLIFY_DEV_SERVER_ID}:{}});let{aiGateway:N,context:D,persistSteps:F,runner:E,sha:oe}=await _("init",()=>Pge({config:t,apiToken:e,cliPath:r,cwd:n,filter:i,runnerVersion:uT.version}),Do.timeUnits.minutes(10)),M=E.runner;tt().idleTimeoutEnabled||T.setRunnerCleanup(E.clean),await u0e(t,o),Object.assign(A,Jhe(t)),IS({...A});let S=HK(t),w=f0e(t,S),O=m0e(w),Y,H=!1,he=0,je;c=c0e(t.id,t.sessionId,t.sessionCreditLimit,{...w?{creditReserve:S,onCreditReserveReached:()=>{if(!H){if(O.getActiveTurn()!=="main"){H=!0,WK(O.getActiveTurn(),S);return}if(!je){WK("no_session",S);return}H=!0,he=c?.getCreditsCost()??0,an.log("Credit reserve reached \u2014 interrupting agent to wrap up",{creditsSpentBeforeWrapUp:he,creditReserve:S}),A.credit_wrapup=!0,IS({...A}),ne.inc("session.credit_wrapup_triggered",1,{credit_reserve:S}),O.abortMainTurn()}}}:{}});let Ie=$C(t.mode),$e;t.deployAlias&&t.deployAlias.length>0?$e=t.deployAlias:(t.deployAlias!==void 0&&!Ie&&an.warn("Received empty deploy alias for a non-prod deploy, falling back to local computation"),$e=uoe(t.id,process.env.SITE_NAME,Ie));let Pe=!1,He=!1,Ne=Object.assign(async Oe=>{Pe||(Pe=!0,i0e({isHotFollowUp:o,enqueuedAt:s}));try{c?.onAgentOutput()}catch(Ft){return Oa(Ft)?Y??=Ft:an.warn("Unexpected error in onAgentOutput",{error:Ft?.message||Ft}),F(Oe)}return!He&&Oe.steps?.some(Ft=>Ft.category!==G.Environment&&Ft.category!==G.SubagentPrompt)&&(He=!0,o0e({isHotFollowUp:o,enqueuedAt:s})),F(Oe)},{flush:F.flush.bind(F)});if(t.sha=oe,t.mode==="redeploy"){await Qxe({cliPath:r,config:t,filter:i,deploySubdomain:$e,isProdDeploy:Ie,withStageTimer:_,stopUsageTracking:async()=>{await c?.stop()}}),await T.run("completed");return}let ce=NEe(),me=t.mode==="ask",nt;t.mode==="create"&&(nt=(await _("create",()=>eme({config:t,cwd:n}))).additionalContext),nt=await cEe(nt,t);let re=await v.prepare({deploySubdomain:$e,isProdDeploy:Ie});re&&(nt=[re,nt].filter(Boolean).join(`
|
|
639
639
|
|
|
640
|
-
`)),O.startMainTurn();let qe=await _("inference",async()=>{try{return await pu({cliPath:r,config:t,context:D,runner:M,persistSteps:Ne,aiGateway:N,additionalContext:nt,cwd:n,answerFold:ce,abortSignal:O.getMainTurnAbortSignal(),onSessionId:w?
|
|
640
|
+
`)),O.startMainTurn();let qe=await _("inference",async()=>{try{return await pu({cliPath:r,config:t,context:D,runner:M,persistSteps:Ne,aiGateway:N,additionalContext:nt,cwd:n,answerFold:ce,abortSignal:O.getMainTurnAbortSignal(),onSessionId:w?Oe=>{je=Oe}:void 0})}catch(Oe){if(!(Oe instanceof Zp)||t.mode!=="rebase"&&t.mode!=="conflict_resolution")throw Oe;for(let Ft of Pmt){if(Y&&Oa(Y))throw Y;if(Ft===t.runner)continue;let Ur=wg[Ft];if(Ur){an.log(`Primary runner ${t.runner} failed in ${t.mode} mode, falling back to ${Ft}`),IS({...A,agent:Ft}),await Q6(X6(),Ft);try{let Tr=await pu({cliPath:r,config:{...t,runner:Ft},context:D,runner:Ur.runner,persistSteps:Ne,aiGateway:N,additionalContext:nt,cwd:n,answerFold:ce,abortSignal:O.getMainTurnAbortSignal()});return t.runner=Ft,M=Ur.runner,tt().idleTimeoutEnabled||T.setRunnerCleanup(Ur.clean),Tr}catch(Tr){if(Oa(Tr))throw Tr;an.error(`Fallback runner ${Ft} also failed`,{error:String(Tr)})}}}throw Oe}}).finally(O.finishMainTurn),z=qe.runnerResult;d=qe.nativeResume??!1,f=z.resolvedModel,p=z.effort;let x=async(Oe,Ft)=>{let{runnerResult:Ur}=await O.runFixTurn(()=>_(Oe,()=>pu({cliPath:r,config:t,context:D,runner:M,persistSteps:Ne,aiGateway:N,buildErrors:Ft,priorAgentSessionId:z.agentSessionId,answerFold:ce})));if(Y)throw Object.assign(Y,{agentSessionId:Ur.agentSessionId??z.agentSessionId}),Y;z=bE(z,Ur)},C=z.agentSessionId;if(w&&H&&z.aborted&&!Y&&C&&c){h=!0;let Oe=await h0e({runnerResult:z,interruptedSessionId:C,creditsSpentBeforeWrapUp:he,cliPath:r,config:t,context:D,runner:M,aiGateway:N,cwd:n,persistSteps:F,usageTracker:c,withStageTimer:_,answerFold:ce});z=Oe.runnerResult,m=Oe.costReport}if(t.mode==="create"&&await Qhe(n??process.cwd()),Y)throw Object.assign(Y,{agentSessionId:z.agentSessionId}),Y;if(z.pendingInteraction){let Oe=z.agentSessionId;Oe&&Jg(Oe);let Ft=await Rf({runnerId:t.id,sessionId:t.sessionId,archive:Gs(t.runner)}),Ur;try{Ur=await IEe(t,z.pendingInteraction,{nativeSessionId:Oe,nativeSessionS3Key:Ft??void 0})}catch(Tr){throw ne.inc("inference.pause_persist_failed",1),Tr}PEe(z.pendingInteraction,t.sessionId,Ur),u="awaiting_input",await T.run("awaiting-input");return}let B=await v.generateMigrations();if(B.error&&(an.log("Migration generation failed, running inference to fix the issue"),await x("inference-migration-fix",[`Running \`drizzle-kit generate\` to generate database migrations failed with the following error:
|
|
641
641
|
|
|
642
642
|
${B.error}
|
|
643
643
|
|
|
644
|
-
Please fix the issue and do NOT run \`drizzle-kit generate\` yourself \u2014 it will be run automatically after you're done.`]),await v.generateMigrations()),!B.skipped){let
|
|
644
|
+
Please fix the issue and do NOT run \`drizzle-kit generate\` yourself \u2014 it will be run automatically after you're done.`]),await v.generateMigrations()),!B.skipped){let Oe=await v.verifyMigrations();Oe.error&&(an.log("Migration drift detected, running inference to fix"),await x("inference-migration-drift-fix",[Oe.error]))}if(tt().aiFnV1GuardrailEnabled&&n&&!me)try{let Oe=await eF(n);Oe.v1>0&&(an.log(`Detected ${Oe.v1} v1 AI function(s), running inference to fix`),await x("inference-ai-fn-v1-fix",[a0e(Oe.v1Files)]))}catch(Oe){if(Oa(Oe))throw Oe;an.warn("ai_fn_v1_guardrail failed",{err:Oe})}let te=await _("deploy",()=>Xb({cliPath:r,config:t,result:z.result,filter:i,isRetry:!1,deploySubdomain:$e})),ie=te.hasChanges?te:void 0,Ee=z;te.deployError&&ne.inc("deploy.failed",1,{attempt:1});let yt=[],lr;if(te.hasChanges&&te.deployError){yt.push(kie(te.deployError));let Oe=1,Ft=!1;for(;Oe<=A_&&!te.previewInfo&&!Ft;)an.log(`Deploy attempt had errors. Retrying. ${Oe}/${A_}`),await sy(dt(),"deploy-stage",async Ur=>{Ur?.setAttributes({"stage.attempt":Oe});let Tr;try{g=h,Tr=(await O.runFixTurn(()=>_(`inference-retry-${Oe}`,()=>pu({cliPath:r,config:t,context:D,runner:M,persistSteps:Ne,aiGateway:N,buildErrors:yt,priorAgentSessionId:z.agentSessionId,answerFold:ce})))).runnerResult}catch(ra){if(Oa(ra))throw ra;an.warn(`Inference retry ${Oe} failed, stopping deploy retries:`,ra),Ft=!0;return}if(Y)throw Object.assign(Y,{agentSessionId:Tr.agentSessionId??z.agentSessionId}),Y;Ee=bE(Ee,Tr),await v.generateMigrations(),te=await _(`deploy-retry-${Oe}`,()=>Xb({cliPath:r,config:t,result:Tr.result,filter:i,isRetry:!0,deploySubdomain:$e})),te.hasChanges&&(ie=te),te.deployError&&(ne.inc("deploy.failed",1,{attempt:Oe+1}),yt.push(te.deployError)),Oe++});Oe>A_&&!te.previewInfo&&(ne.inc("deploy.retries_exhausted",1),t.mode==="create"?(console.warn(`Deploy still failing after ${A_} retries, failing the create run`),lr=new Error(`Deploy failed after ${A_} retries`)):console.warn(`Deploy still failing after ${A_} retries, completing run without a preview`))}let St=te.previewInfo||te.hasChanges?te:ie??te,{diff:ci,resultDiff:We,previewInfo:De,diffBinary:Ve,resultDiffBinary:Ae,hasNetlifyForm:we,hasNetlifyIdentity:cn}=St;St.hasChanges&&UR({previewDeployed:!!St.previewInfo,hadFailedAttempts:yt.length>0}),await c?.stop(),P?.setAttributes($ie(Ee,c?.getCreditsCost())),f=Ee.resolvedModel,p=Ee.effort??p;let co=Ee.agentSessionId??z.agentSessionId;if(co&&Jg(co),await _("cleanup",()=>HN({config:t,diff:ci,result:Ee.result,duration:Ee.duration,resultDiff:We,diffBinary:Ve,resultDiffBinary:Ae,previewInfo:De,isProdDeploy:Ie,hasNetlifyForm:we,hasNetlifyIdentity:cn,nativeSessionArchive:Gs(t.runner),nativeSessionId:co,finalAgentConfig:{agent:t.runner,model:f,effort:p},creditWrapUp:h}),Do.timeUnits.minutes(10),{interruptible:!1}),lr)throw lr;try{let Oe=await eF(n??process.cwd());Oe.aiTotal>0&&P?.setAttributes({"agent.fn_ai_total":Oe.aiTotal,"agent.fn_ai_v1":Oe.v1,"agent.fn_ai_v2":Oe.v2,"agent.fn_ai_v3":Oe.v3,"agent.fn_ai_unknown":Oe.unknown})}catch{}await T.run("completed");let R_=await v.hasDatabase();typeof R_=="boolean"&&P?.setAttributes({"actual.has_db":R_}),await ioe({config:t,hasDb:R_,pipelineSpan:P,resolvedModel:Ee.resolvedModel??z.resolvedModel,cliVersion:uT.version})})}catch(P){if(Oa(P)){u="gracefulError",an.info("Agent run terminated gracefully",{statusCode:P.statusCode,reason:P.message}),await c?.stop();let M=P?.agentSessionId,S=P.isCreditLimitExceeded&&!!M,{nativeSessionS3Key:w,diffFields:O}=P.isCreditLimitExceeded?await S0e(t,M):{nativeSessionS3Key:null,diffFields:{}};await T.run("errored");try{await un(t.id,t.sessionId,{result:P.userMessage,state:P.isCreditLimitExceeded?"cancelled":"error",...P.isCreditLimitExceeded&&{credit_limit_exceeded:!0},...S?{native_session_id:M}:{},...w?{native_session_s3_key:w}:{},...O,metadata:{final_agent_config:{agent:t.runner,model:f,effort:p},...h?{credit_wrap_up:!0}:{}}})}catch{an.info("Could not update session (site may have been deleted)")}P.isCreditLimitExceeded&&_0e("credit_limit_cancelled");return}u=Cs()?"interrupted":"error",an.error("Got error while running pipeline",P),await c?.stop();let N=P?.agentSessionId,D=Cs()&&!!N,F=D?await y0e(t,N):null;await T.run("errored");let E=P instanceof Error?P.shortMessage||P.message:"",oe=E?Khe(AP(E)):"Encountered error when running agent";try{await un(t.id,t.sessionId,{result:oe,state:"error",...D?{native_session_id:N}:{},...F?{native_session_s3_key:F}:{}})}catch(M){an.error("Failed to update session with error state, retrying with minimal payload:",M);try{await un(t.id,t.sessionId,{result:"Encountered error when running agent",state:"error"})}catch(S){an.error("Failed to mark session as errored:",S)}}throw P}finally{v.revokeAskAccess(),m&&p0e(m,c?.getCreditsCost(),g),s0e({isHotFollowUp:o,startedAt:l,outcome:u,nativeResume:d,isAnswerResume:k,creditsCost:c?.getCreditsCost(),model:f,effort:p})}};export{Wnt as runPipeline};
|
|
645
645
|
/*! Bundled license information:
|
|
646
646
|
|
|
647
647
|
long/umd/index.js:
|