dts-linter 0.0.0-alpha10 → 0.0.0-alpha12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/dts-linter.js +36 -36
  2. package/package.json +1 -1
@@ -1,77 +1,77 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Bf=Object.create;var _s=Object.defineProperty;var Hf=Object.getOwnPropertyDescriptor;var Zf=Object.getOwnPropertyNames;var Jf=Object.getPrototypeOf,Gf=Object.prototype.hasOwnProperty;var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qf=(t,e)=>{for(var r in e)_s(t,r,{get:e[r],enumerable:!0})},Xf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zf(e))!Gf.call(t,i)&&i!==r&&_s(t,i,{get:()=>e[i],enumerable:!(n=Hf(e,i))||n.enumerable});return t};var Yr=(t,e,r)=>(r=t!=null?Bf(Jf(t)):{},Xf(e||!t||!t.__esModule?_s(r,"default",{value:t,enumerable:!0}):r,t));var Kr=M(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.stringArray=Ae.array=Ae.func=Ae.error=Ae.number=Ae.string=Ae.boolean=void 0;function Yf(t){return t===!0||t===!1}Ae.boolean=Yf;function vc(t){return typeof t=="string"||t instanceof String}Ae.string=vc;function Kf(t){return typeof t=="number"||t instanceof Number}Ae.number=Kf;function eh(t){return t instanceof Error}Ae.error=eh;function th(t){return typeof t=="function"}Ae.func=th;function _c(t){return Array.isArray(t)}Ae.array=_c;function rh(t){return _c(t)&&t.every(e=>vc(e))}Ae.stringArray=rh});var Us=M(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.Message=I.NotificationType9=I.NotificationType8=I.NotificationType7=I.NotificationType6=I.NotificationType5=I.NotificationType4=I.NotificationType3=I.NotificationType2=I.NotificationType1=I.NotificationType0=I.NotificationType=I.RequestType9=I.RequestType8=I.RequestType7=I.RequestType6=I.RequestType5=I.RequestType4=I.RequestType3=I.RequestType2=I.RequestType1=I.RequestType=I.RequestType0=I.AbstractMessageSignature=I.ParameterStructures=I.ResponseError=I.ErrorCodes=void 0;var lr=Kr(),bs;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(bs||(I.ErrorCodes=bs={}));var ws=class t extends Error{constructor(e,r,n){super(r),this.code=lr.number(e)?e:bs.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};I.ResponseError=ws;var Ze=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};I.ParameterStructures=Ze;Ze.auto=new Ze("auto");Ze.byPosition=new Ze("byPosition");Ze.byName=new Ze("byName");var ge=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Ze.auto}};I.AbstractMessageSignature=ge;var Ts=class extends ge{constructor(e){super(e,0)}};I.RequestType0=Ts;var Rs=class extends ge{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.RequestType=Rs;var ks=class extends ge{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.RequestType1=ks;var Ss=class extends ge{constructor(e){super(e,2)}};I.RequestType2=Ss;var Cs=class extends ge{constructor(e){super(e,3)}};I.RequestType3=Cs;var Ps=class extends ge{constructor(e){super(e,4)}};I.RequestType4=Ps;var xs=class extends ge{constructor(e){super(e,5)}};I.RequestType5=xs;var Ds=class extends ge{constructor(e){super(e,6)}};I.RequestType6=Ds;var Es=class extends ge{constructor(e){super(e,7)}};I.RequestType7=Es;var Os=class extends ge{constructor(e){super(e,8)}};I.RequestType8=Os;var Ns=class extends ge{constructor(e){super(e,9)}};I.RequestType9=Ns;var Ms=class extends ge{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.NotificationType=Ms;var js=class extends ge{constructor(e){super(e,0)}};I.NotificationType0=js;var qs=class extends ge{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.NotificationType1=qs;var Is=class extends ge{constructor(e){super(e,2)}};I.NotificationType2=Is;var As=class extends ge{constructor(e){super(e,3)}};I.NotificationType3=As;var Ls=class extends ge{constructor(e){super(e,4)}};I.NotificationType4=Ls;var $s=class extends ge{constructor(e){super(e,5)}};I.NotificationType5=$s;var Fs=class extends ge{constructor(e){super(e,6)}};I.NotificationType6=Fs;var Ws=class extends ge{constructor(e){super(e,7)}};I.NotificationType7=Ws;var Vs=class extends ge{constructor(e){super(e,8)}};I.NotificationType8=Vs;var zs=class extends ge{constructor(e){super(e,9)}};I.NotificationType9=zs;var bc;(function(t){function e(i){let s=i;return s&&lr.string(s.method)&&(lr.string(s.id)||lr.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&lr.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(lr.string(s.id)||lr.number(s.id)||s.id===null)}t.isResponse=n})(bc||(I.Message=bc={}))});var Hs=M(Jt=>{"use strict";var wc;Object.defineProperty(Jt,"__esModule",{value:!0});Jt.LRUCache=Jt.LinkedMap=Jt.Touch=void 0;var Le;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Le||(Jt.Touch=Le={}));var ii=class{constructor(){this[wc]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Le.None){let n=this._map.get(e);if(n)return r!==Le.None&&this.touch(n,r),n.value}set(e,r,n=Le.None){let i=this._map.get(e);if(i)i.value=r,n!==Le.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Le.None:this.addItemLast(i);break;case Le.First:this.addItemFirst(i);break;case Le.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(wc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Le.First&&r!==Le.Last)){if(r===Le.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Le.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Jt.LinkedMap=ii;var Bs=class extends ii{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Le.AsNew){return super.get(e,r)}peek(e){return super.get(e,Le.None)}set(e,r){return super.set(e,r,Le.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Jt.LRUCache=Bs});var Rc=M(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.Disposable=void 0;var Tc;(function(t){function e(r){return{dispose:r}}t.create=e})(Tc||(si.Disposable=Tc={}))});var Gt=M(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});var Zs;function Js(){if(Zs===void 0)throw new Error("No runtime abstraction layer installed");return Zs}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Zs=r}t.install=e})(Js||(Js={}));Gs.default=Js});var tn=M(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.Emitter=en.Event=void 0;var nh=Gt(),kc;(function(t){let e={dispose(){}};t.None=function(){return e}})(kc||(en.Event=kc={}));var Qs=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,l=n.length;s<l;s++)try{r.push(n[s].apply(i[s],e))}catch(p){(0,nh.default)().console.error(p)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},oi=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Qs),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};en.Emitter=oi;oi._noop=function(){}});var ui=M(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.CancellationTokenSource=rn.CancellationToken=void 0;var ih=Gt(),sh=Kr(),Xs=tn(),ai;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Xs.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Xs.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||sh.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(ai||(rn.CancellationToken=ai={}));var oh=Object.freeze(function(t,e){let r=(0,ih.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),ci=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?oh:(this._emitter||(this._emitter=new Xs.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Ys=class{get token(){return this._token||(this._token=new ci),this._token}cancel(){this._token?this._token.cancel():this._token=ai.Cancelled}dispose(){this._token?this._token instanceof ci&&this._token.dispose():this._token=ai.None}};rn.CancellationTokenSource=Ys});var Sc=M(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.SharedArrayReceiverStrategy=nn.SharedArraySenderStrategy=void 0;var ah=ui(),An;(function(t){t.Continue=0,t.Cancelled=1})(An||(An={}));var Ks=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=An.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,An.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};nn.SharedArraySenderStrategy=Ks;var eo=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===An.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},to=class{constructor(e){this.token=new eo(e)}cancel(){}dispose(){}},ro=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new ah.CancellationTokenSource:new to(r)}};nn.SharedArrayReceiverStrategy=ro});var io=M(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.Semaphore=void 0;var ch=Gt(),no=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,ch.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};di.Semaphore=no});var Pc=M(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ReadableStreamMessageReader=Qt.AbstractMessageReader=Qt.MessageReader=void 0;var oo=Gt(),sn=Kr(),so=tn(),uh=io(),Cc;(function(t){function e(r){let n=r;return n&&sn.func(n.listen)&&sn.func(n.dispose)&&sn.func(n.onError)&&sn.func(n.onClose)&&sn.func(n.onPartialMessage)}t.is=e})(Cc||(Qt.MessageReader=Cc={}));var li=class{constructor(){this.errorEmitter=new so.Emitter,this.closeEmitter=new so.Emitter,this.partialMessageEmitter=new so.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${sn.string(e.message)?e.message:"unknown"}`)}};Qt.AbstractMessageReader=li;var ao;(function(t){function e(r){let n,i,s,l=new Map,p,R=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,l.set(s.name,s)),r.contentDecoders!==void 0)for(let _ of r.contentDecoders)l.set(_.name,_);if(r.contentTypeDecoder!==void 0&&(p=r.contentTypeDecoder,R.set(p.name,p)),r.contentTypeDecoders!==void 0)for(let _ of r.contentTypeDecoders)R.set(_.name,_)}return p===void 0&&(p=(0,oo.default)().applicationJson.decoder,R.set(p.name,p)),{charset:n,contentDecoder:s,contentDecoders:l,contentTypeDecoder:p,contentTypeDecoders:R}}t.fromOptions=e})(ao||(ao={}));var co=class extends li{constructor(e,r){super(),this.readable=e,this.options=ao.fromOptions(r),this.buffer=(0,oo.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new uh.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
3
- ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,oo.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Qt.ReadableStreamMessageReader=co});var Nc=M(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.WriteableStreamMessageWriter=Xt.AbstractMessageWriter=Xt.MessageWriter=void 0;var xc=Gt(),Ln=Kr(),dh=io(),Dc=tn(),lh="Content-Length: ",Ec=`\r
4
- `,Oc;(function(t){function e(r){let n=r;return n&&Ln.func(n.dispose)&&Ln.func(n.onClose)&&Ln.func(n.onError)&&Ln.func(n.write)}t.is=e})(Oc||(Xt.MessageWriter=Oc={}));var fi=class{constructor(){this.errorEmitter=new Dc.Emitter,this.closeEmitter=new Dc.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Ln.string(e.message)?e.message:"unknown"}`)}};Xt.AbstractMessageWriter=fi;var uo;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,xc.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,xc.default)().applicationJson.encoder}}t.fromOptions=e})(uo||(uo={}));var lo=class extends fi{constructor(e,r){super(),this.writable=e,this.options=uo.fromOptions(r),this.errorCount=0,this.writeSemaphore=new dh.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(lh,n.byteLength.toString(),Ec),i.push(Ec),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Xt.WriteableStreamMessageWriter=lo});var Mc=M(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.AbstractMessageBuffer=void 0;var fh=13,hh=10,ph=`\r
5
- `,fo=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let _=this._chunks[n];for(i=0;i<_.length;){switch(_[i]){case fh:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case hh:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=_.byteLength,n++}if(r!==4)return;let l=this._read(s+i),p=new Map,R=this.toString(l,"ascii").split(ph);if(R.length<2)return p;for(let _=0;_<R.length-2;_++){let E=R[_],Z=E.indexOf(":");if(Z===-1)throw new Error(`Message header must separate key and value using ':'
6
- ${E}`);let ue=E.substr(0,Z),ee=E.substr(Z+1).trim();p.set(e?ue.toLowerCase():ue,ee)}return p}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],l=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,l}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let l=s.slice(0,e);r.set(l,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};hi.AbstractMessageBuffer=fo});var Lc=M(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.createMessageConnection=G.ConnectionOptions=G.MessageStrategy=G.CancellationStrategy=G.CancellationSenderStrategy=G.CancellationReceiverStrategy=G.RequestCancellationReceiverStrategy=G.IdCancellationReceiverStrategy=G.ConnectionStrategy=G.ConnectionError=G.ConnectionErrors=G.LogTraceNotification=G.SetTraceNotification=G.TraceFormat=G.TraceValues=G.Trace=G.NullLogger=G.ProgressType=G.ProgressToken=void 0;var jc=Gt(),Re=Kr(),V=Us(),qc=Hs(),$n=tn(),ho=ui(),Vn;(function(t){t.type=new V.NotificationType("$/cancelRequest")})(Vn||(Vn={}));var po;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(po||(G.ProgressToken=po={}));var Fn;(function(t){t.type=new V.NotificationType("$/progress")})(Fn||(Fn={}));var mo=class{constructor(){}};G.ProgressType=mo;var go;(function(t){function e(r){return Re.func(r)}t.is=e})(go||(go={}));G.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ae;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ae||(G.Trace=ae={}));var Ic;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(Ic||(G.TraceValues=Ic={}));(function(t){function e(n){if(!Re.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ae||(G.Trace=ae={}));var tt;(function(t){t.Text="text",t.JSON="json"})(tt||(G.TraceFormat=tt={}));(function(t){function e(r){return Re.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(tt||(G.TraceFormat=tt={}));var yo;(function(t){t.type=new V.NotificationType("$/setTrace")})(yo||(G.SetTraceNotification=yo={}));var pi;(function(t){t.type=new V.NotificationType("$/logTrace")})(pi||(G.LogTraceNotification=pi={}));var Wn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Wn||(G.ConnectionErrors=Wn={}));var on=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};G.ConnectionError=on;var vo;(function(t){function e(r){let n=r;return n&&Re.func(n.cancelUndispatched)}t.is=e})(vo||(G.ConnectionStrategy=vo={}));var mi;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(mi||(G.IdCancellationReceiverStrategy=mi={}));var _o;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(_o||(G.RequestCancellationReceiverStrategy=_o={}));var gi;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new ho.CancellationTokenSource}});function e(r){return mi.is(r)||_o.is(r)}t.is=e})(gi||(G.CancellationReceiverStrategy=gi={}));var yi;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Vn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Re.func(n.sendCancellation)&&Re.func(n.cleanup)}t.is=e})(yi||(G.CancellationSenderStrategy=yi={}));var vi;(function(t){t.Message=Object.freeze({receiver:gi.Message,sender:yi.Message});function e(r){let n=r;return n&&gi.is(n.receiver)&&yi.is(n.sender)}t.is=e})(vi||(G.CancellationStrategy=vi={}));var _i;(function(t){function e(r){let n=r;return n&&Re.func(n.handleMessage)}t.is=e})(_i||(G.MessageStrategy=_i={}));var Ac;(function(t){function e(r){let n=r;return n&&(vi.is(n.cancellationStrategy)||vo.is(n.connectionStrategy)||_i.is(n.messageStrategy))}t.is=e})(Ac||(G.ConnectionOptions=Ac={}));var mt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(mt||(mt={}));function mh(t,e,r,n){let i=r!==void 0?r:G.NullLogger,s=0,l=0,p=0,R="2.0",_,E=new Map,Z,ue=new Map,ee=new Map,ze,le=new qc.LinkedMap,de=new Map,Ue=new Set,oe=new Map,O=ae.Off,fe=tt.Text,W,ve=mt.New,_e=new $n.Emitter,Be=new $n.Emitter,_t=new $n.Emitter,lt=new $n.Emitter,ft=new $n.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:vi.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++p).toString():"res-"+o.toString()}function Ir(){return"not-"+(++l).toString()}function In(o,f){V.Message.isRequest(f)?o.set(Dt(f.id),f):V.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return ve===mt.Listening}function bt(){return ve===mt.Closed}function Me(){return ve===mt.Disposed}function Et(){(ve===mt.New||ve===mt.Listening)&&(ve=mt.Closed,Be.fire(void 0))}function Ot(o){_e.fire([o,void 0,void 0])}function Lr(o){_e.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){ze||le.size===0||(ze=(0,jc.default)().timer.setImmediate(()=>{ze=void 0,$r()}))}function zt(o){V.Message.isRequest(o)?Wr(o):V.Message.isNotification(o)?zr(o):V.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(le.size===0)return;let o=le.shift();try{let f=n?.messageStrategy;_i.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(V.Message.isNotification(o)&&o.method===Vn.type.method){let f=o.params.id,g=Dt(f),b=le.get(g);if(V.Message.isRequest(b)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(b,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){le.delete(g),oe.delete(f),B.id=b.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let L=oe.get(f);if(L!==void 0){L.cancel(),wt(o);return}else Ue.add(f)}In(le,o)}finally{Vt()}};function Wr(o){if(Me())return;function f(x,$,N){let X={jsonrpc:R,id:o.id};x instanceof V.ResponseError?X.error=x.toJson():X.result=x===void 0?null:x,st(X,$,N),e.write(X).catch(()=>i.error("Sending response failed."))}function g(x,$,N){let X={jsonrpc:R,id:o.id,error:x.toJson()};st(X,$,N),e.write(X).catch(()=>i.error("Sending response failed."))}function b(x,$,N){x===void 0&&(x=null);let X={jsonrpc:R,id:o.id,result:x};st(X,$,N),e.write(X).catch(()=>i.error("Sending response failed."))}Hr(o);let L=E.get(o.method),q,B;L&&(q=L.type,B=L.handler);let H=Date.now();if(B||_){let x=o.id??String(Date.now()),$=mi.is(Te.receiver)?Te.receiver.createCancellationTokenSource(x):Te.receiver.createCancellationTokenSource(o);o.id!==null&&Ue.has(o.id)&&$.cancel(),o.id!==null&&oe.set(x,$);try{let N;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}N=B($.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byName){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}N=B(...o.params,$.token)}else{if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byPosition){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}N=B(o.params,$.token)}else _&&(N=_(o.method,o.params,$.token));let X=N;N?X.then?X.then(se=>{oe.delete(x),f(se,o.method,H)},se=>{oe.delete(x),se instanceof V.ResponseError?g(se,o.method,H):se&&Re.string(se.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${se.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(oe.delete(x),f(N,o.method,H)):(oe.delete(x),b(N,o.method,H))}catch(N){oe.delete(x),N instanceof V.ResponseError?f(N,o.method,H):N&&Re.string(N.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${N.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new V.ResponseError(V.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!Me())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
7
- ${JSON.stringify(o.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let f=o.id,g=de.get(f);if(Zr(o,g),g!==void 0){de.delete(f);try{if(o.error){let b=o.error;g.reject(new V.ResponseError(b.code,b.message,b.data))}else if(o.result!==void 0)g.resolve(o.result);else throw new Error("Should never happen.")}catch(b){b.message?i.error(`Response handler '${g.method}' failed with message: ${b.message}`):i.error(`Response handler '${g.method}' failed unexpectedly.`)}}}}function zr(o){if(Me())return;let f,g;if(o.method===Vn.type.method){let b=o.params.id;Ue.delete(b),wt(o);return}else{let b=ue.get(o.method);b&&(g=b.handler,f=b.type)}if(g||Z)try{if(wt(o),g)if(o.params===void 0)f!==void 0&&f.numberOfParams!==0&&f.parameterStructures!==V.ParameterStructures.byName&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received none.`),g();else if(Array.isArray(o.params)){let b=o.params;o.method===Fn.type.method&&b.length===2&&po.is(b[0])?g({token:b[0],value:b[1]}):(f!==void 0&&(f.parameterStructures===V.ParameterStructures.byName&&i.error(`Notification ${o.method} defines parameters by name but received parameters by position`),f.numberOfParams!==o.params.length&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received ${b.length} arguments`)),g(...b))}else f!==void 0&&f.parameterStructures===V.ParameterStructures.byPosition&&i.error(`Notification ${o.method} defines parameters by position but received parameters by name`),g(o.params);else Z&&Z(o.method,o.params)}catch(b){b.message?i.error(`Notification handler '${o.method}' failed with message: ${b.message}`):i.error(`Notification handler '${o.method}' failed unexpectedly.`)}else _t.fire(o)}function Ut(o){if(!o){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
8
- ${JSON.stringify(o,null,4)}`);let f=o;if(Re.string(f.id)||Re.number(f.id)){let g=f.id,b=de.get(g);b&&b.reject(new Error("The received response has neither a result nor an error property."))}}function Pe(o){if(o!=null)switch(O){case ae.Verbose:return JSON.stringify(o,null,4);case ae.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(O===ae.Off||!W))if(fe===tt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
2
+ "use strict";var Uf=Object.create;var ys=Object.defineProperty;var Bf=Object.getOwnPropertyDescriptor;var Hf=Object.getOwnPropertyNames;var Zf=Object.getPrototypeOf,Jf=Object.prototype.hasOwnProperty;var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Gf=(t,e)=>{for(var r in e)ys(t,r,{get:e[r],enumerable:!0})},Qf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Hf(e))!Jf.call(t,i)&&i!==r&&ys(t,i,{get:()=>e[i],enumerable:!(n=Bf(e,i))||n.enumerable});return t};var Yr=(t,e,r)=>(r=t!=null?Uf(Zf(t)):{},Qf(e||!t||!t.__esModule?ys(r,"default",{value:t,enumerable:!0}):r,t));var Kr=N($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.stringArray=$e.array=$e.func=$e.error=$e.number=$e.string=$e.boolean=void 0;function Xf(t){return t===!0||t===!1}$e.boolean=Xf;function gc(t){return typeof t=="string"||t instanceof String}$e.string=gc;function Yf(t){return typeof t=="number"||t instanceof Number}$e.number=Yf;function Kf(t){return t instanceof Error}$e.error=Kf;function eh(t){return typeof t=="function"}$e.func=eh;function yc(t){return Array.isArray(t)}$e.array=yc;function th(t){return yc(t)&&t.every(e=>gc(e))}$e.stringArray=th});var Vs=N(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.Message=I.NotificationType9=I.NotificationType8=I.NotificationType7=I.NotificationType6=I.NotificationType5=I.NotificationType4=I.NotificationType3=I.NotificationType2=I.NotificationType1=I.NotificationType0=I.NotificationType=I.RequestType9=I.RequestType8=I.RequestType7=I.RequestType6=I.RequestType5=I.RequestType4=I.RequestType3=I.RequestType2=I.RequestType1=I.RequestType=I.RequestType0=I.AbstractMessageSignature=I.ParameterStructures=I.ResponseError=I.ErrorCodes=void 0;var lr=Kr(),vs;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(vs||(I.ErrorCodes=vs={}));var _s=class t extends Error{constructor(e,r,n){super(r),this.code=lr.number(e)?e:vs.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};I.ResponseError=_s;var Ze=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};I.ParameterStructures=Ze;Ze.auto=new Ze("auto");Ze.byPosition=new Ze("byPosition");Ze.byName=new Ze("byName");var ve=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Ze.auto}};I.AbstractMessageSignature=ve;var bs=class extends ve{constructor(e){super(e,0)}};I.RequestType0=bs;var ws=class extends ve{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.RequestType=ws;var Ts=class extends ve{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.RequestType1=Ts;var Rs=class extends ve{constructor(e){super(e,2)}};I.RequestType2=Rs;var ks=class extends ve{constructor(e){super(e,3)}};I.RequestType3=ks;var Ss=class extends ve{constructor(e){super(e,4)}};I.RequestType4=Ss;var Cs=class extends ve{constructor(e){super(e,5)}};I.RequestType5=Cs;var Ps=class extends ve{constructor(e){super(e,6)}};I.RequestType6=Ps;var xs=class extends ve{constructor(e){super(e,7)}};I.RequestType7=xs;var Ds=class extends ve{constructor(e){super(e,8)}};I.RequestType8=Ds;var Es=class extends ve{constructor(e){super(e,9)}};I.RequestType9=Es;var Os=class extends ve{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.NotificationType=Os;var Ns=class extends ve{constructor(e){super(e,0)}};I.NotificationType0=Ns;var Ms=class extends ve{constructor(e,r=Ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};I.NotificationType1=Ms;var js=class extends ve{constructor(e){super(e,2)}};I.NotificationType2=js;var qs=class extends ve{constructor(e){super(e,3)}};I.NotificationType3=qs;var Is=class extends ve{constructor(e){super(e,4)}};I.NotificationType4=Is;var As=class extends ve{constructor(e){super(e,5)}};I.NotificationType5=As;var Ls=class extends ve{constructor(e){super(e,6)}};I.NotificationType6=Ls;var $s=class extends ve{constructor(e){super(e,7)}};I.NotificationType7=$s;var Fs=class extends ve{constructor(e){super(e,8)}};I.NotificationType8=Fs;var Ws=class extends ve{constructor(e){super(e,9)}};I.NotificationType9=Ws;var vc;(function(t){function e(i){let s=i;return s&&lr.string(s.method)&&(lr.string(s.id)||lr.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&lr.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(lr.string(s.id)||lr.number(s.id)||s.id===null)}t.isResponse=n})(vc||(I.Message=vc={}))});var Us=N(Jt=>{"use strict";var _c;Object.defineProperty(Jt,"__esModule",{value:!0});Jt.LRUCache=Jt.LinkedMap=Jt.Touch=void 0;var Fe;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Fe||(Jt.Touch=Fe={}));var ri=class{constructor(){this[_c]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Fe.None){let n=this._map.get(e);if(n)return r!==Fe.None&&this.touch(n,r),n.value}set(e,r,n=Fe.None){let i=this._map.get(e);if(i)i.value=r,n!==Fe.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Fe.None:this.addItemLast(i);break;case Fe.First:this.addItemFirst(i);break;case Fe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(_c=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Fe.First&&r!==Fe.Last)){if(r===Fe.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Fe.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Jt.LinkedMap=ri;var zs=class extends ri{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Fe.AsNew){return super.get(e,r)}peek(e){return super.get(e,Fe.None)}set(e,r){return super.set(e,r,Fe.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Jt.LRUCache=zs});var wc=N(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Disposable=void 0;var bc;(function(t){function e(r){return{dispose:r}}t.create=e})(bc||(ni.Disposable=bc={}))});var Gt=N(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var Bs;function Hs(){if(Bs===void 0)throw new Error("No runtime abstraction layer installed");return Bs}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Bs=r}t.install=e})(Hs||(Hs={}));Zs.default=Hs});var tn=N(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.Emitter=en.Event=void 0;var rh=Gt(),Tc;(function(t){let e={dispose(){}};t.None=function(){return e}})(Tc||(en.Event=Tc={}));var Js=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,d=n.length;s<d;s++)try{r.push(n[s].apply(i[s],e))}catch(p){(0,rh.default)().console.error(p)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ii=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Js),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};en.Emitter=ii;ii._noop=function(){}});var ai=N(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.CancellationTokenSource=rn.CancellationToken=void 0;var nh=Gt(),ih=Kr(),Gs=tn(),si;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gs.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Gs.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||ih.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(si||(rn.CancellationToken=si={}));var sh=Object.freeze(function(t,e){let r=(0,nh.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),oi=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?sh:(this._emitter||(this._emitter=new Gs.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Qs=class{get token(){return this._token||(this._token=new oi),this._token}cancel(){this._token?this._token.cancel():this._token=si.Cancelled}dispose(){this._token?this._token instanceof oi&&this._token.dispose():this._token=si.None}};rn.CancellationTokenSource=Qs});var Rc=N(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.SharedArrayReceiverStrategy=nn.SharedArraySenderStrategy=void 0;var oh=ai(),In;(function(t){t.Continue=0,t.Cancelled=1})(In||(In={}));var Xs=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=In.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,In.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};nn.SharedArraySenderStrategy=Xs;var Ys=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===In.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Ks=class{constructor(e){this.token=new Ys(e)}cancel(){}dispose(){}},eo=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new oh.CancellationTokenSource:new Ks(r)}};nn.SharedArrayReceiverStrategy=eo});var ro=N(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.Semaphore=void 0;var ah=Gt(),to=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,ah.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};ci.Semaphore=to});var Sc=N(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ReadableStreamMessageReader=Qt.AbstractMessageReader=Qt.MessageReader=void 0;var io=Gt(),sn=Kr(),no=tn(),ch=ro(),kc;(function(t){function e(r){let n=r;return n&&sn.func(n.listen)&&sn.func(n.dispose)&&sn.func(n.onError)&&sn.func(n.onClose)&&sn.func(n.onPartialMessage)}t.is=e})(kc||(Qt.MessageReader=kc={}));var ui=class{constructor(){this.errorEmitter=new no.Emitter,this.closeEmitter=new no.Emitter,this.partialMessageEmitter=new no.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${sn.string(e.message)?e.message:"unknown"}`)}};Qt.AbstractMessageReader=ui;var so;(function(t){function e(r){let n,i,s,d=new Map,p,R=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,d.set(s.name,s)),r.contentDecoders!==void 0)for(let _ of r.contentDecoders)d.set(_.name,_);if(r.contentTypeDecoder!==void 0&&(p=r.contentTypeDecoder,R.set(p.name,p)),r.contentTypeDecoders!==void 0)for(let _ of r.contentTypeDecoders)R.set(_.name,_)}return p===void 0&&(p=(0,io.default)().applicationJson.decoder,R.set(p.name,p)),{charset:n,contentDecoder:s,contentDecoders:d,contentTypeDecoder:p,contentTypeDecoders:R}}t.fromOptions=e})(so||(so={}));var oo=class extends ui{constructor(e,r){super(),this.readable=e,this.options=so.fromOptions(r),this.buffer=(0,io.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new ch.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
3
+ ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,io.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Qt.ReadableStreamMessageReader=oo});var Ec=N(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.WriteableStreamMessageWriter=Xt.AbstractMessageWriter=Xt.MessageWriter=void 0;var Cc=Gt(),An=Kr(),uh=ro(),Pc=tn(),dh="Content-Length: ",xc=`\r
4
+ `,Dc;(function(t){function e(r){let n=r;return n&&An.func(n.dispose)&&An.func(n.onClose)&&An.func(n.onError)&&An.func(n.write)}t.is=e})(Dc||(Xt.MessageWriter=Dc={}));var di=class{constructor(){this.errorEmitter=new Pc.Emitter,this.closeEmitter=new Pc.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${An.string(e.message)?e.message:"unknown"}`)}};Xt.AbstractMessageWriter=di;var ao;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,Cc.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,Cc.default)().applicationJson.encoder}}t.fromOptions=e})(ao||(ao={}));var co=class extends di{constructor(e,r){super(),this.writable=e,this.options=ao.fromOptions(r),this.errorCount=0,this.writeSemaphore=new uh.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(dh,n.byteLength.toString(),xc),i.push(xc),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Xt.WriteableStreamMessageWriter=co});var Oc=N(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.AbstractMessageBuffer=void 0;var lh=13,fh=10,hh=`\r
5
+ `,uo=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let _=this._chunks[n];for(i=0;i<_.length;){switch(_[i]){case lh:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case fh:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=_.byteLength,n++}if(r!==4)return;let d=this._read(s+i),p=new Map,R=this.toString(d,"ascii").split(hh);if(R.length<2)return p;for(let _=0;_<R.length-2;_++){let E=R[_],Z=E.indexOf(":");if(Z===-1)throw new Error(`Message header must separate key and value using ':'
6
+ ${E}`);let de=E.substr(0,Z),te=E.substr(Z+1).trim();p.set(e?de.toLowerCase():de,te)}return p}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],d=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,d}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let d=s.slice(0,e);r.set(d,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};li.AbstractMessageBuffer=uo});var Ic=N(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.createMessageConnection=Q.ConnectionOptions=Q.MessageStrategy=Q.CancellationStrategy=Q.CancellationSenderStrategy=Q.CancellationReceiverStrategy=Q.RequestCancellationReceiverStrategy=Q.IdCancellationReceiverStrategy=Q.ConnectionStrategy=Q.ConnectionError=Q.ConnectionErrors=Q.LogTraceNotification=Q.SetTraceNotification=Q.TraceFormat=Q.TraceValues=Q.Trace=Q.NullLogger=Q.ProgressType=Q.ProgressToken=void 0;var Nc=Gt(),Re=Kr(),V=Vs(),Mc=Us(),Ln=tn(),lo=ai(),Wn;(function(t){t.type=new V.NotificationType("$/cancelRequest")})(Wn||(Wn={}));var fo;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(fo||(Q.ProgressToken=fo={}));var $n;(function(t){t.type=new V.NotificationType("$/progress")})($n||($n={}));var ho=class{constructor(){}};Q.ProgressType=ho;var po;(function(t){function e(r){return Re.func(r)}t.is=e})(po||(po={}));Q.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ce;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ce||(Q.Trace=ce={}));var jc;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(jc||(Q.TraceValues=jc={}));(function(t){function e(n){if(!Re.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ce||(Q.Trace=ce={}));var tt;(function(t){t.Text="text",t.JSON="json"})(tt||(Q.TraceFormat=tt={}));(function(t){function e(r){return Re.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(tt||(Q.TraceFormat=tt={}));var mo;(function(t){t.type=new V.NotificationType("$/setTrace")})(mo||(Q.SetTraceNotification=mo={}));var fi;(function(t){t.type=new V.NotificationType("$/logTrace")})(fi||(Q.LogTraceNotification=fi={}));var Fn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Fn||(Q.ConnectionErrors=Fn={}));var on=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Q.ConnectionError=on;var go;(function(t){function e(r){let n=r;return n&&Re.func(n.cancelUndispatched)}t.is=e})(go||(Q.ConnectionStrategy=go={}));var hi;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(hi||(Q.IdCancellationReceiverStrategy=hi={}));var yo;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(yo||(Q.RequestCancellationReceiverStrategy=yo={}));var pi;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new lo.CancellationTokenSource}});function e(r){return hi.is(r)||yo.is(r)}t.is=e})(pi||(Q.CancellationReceiverStrategy=pi={}));var mi;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Wn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Re.func(n.sendCancellation)&&Re.func(n.cleanup)}t.is=e})(mi||(Q.CancellationSenderStrategy=mi={}));var gi;(function(t){t.Message=Object.freeze({receiver:pi.Message,sender:mi.Message});function e(r){let n=r;return n&&pi.is(n.receiver)&&mi.is(n.sender)}t.is=e})(gi||(Q.CancellationStrategy=gi={}));var yi;(function(t){function e(r){let n=r;return n&&Re.func(n.handleMessage)}t.is=e})(yi||(Q.MessageStrategy=yi={}));var qc;(function(t){function e(r){let n=r;return n&&(gi.is(n.cancellationStrategy)||go.is(n.connectionStrategy)||yi.is(n.messageStrategy))}t.is=e})(qc||(Q.ConnectionOptions=qc={}));var mt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(mt||(mt={}));function ph(t,e,r,n){let i=r!==void 0?r:Q.NullLogger,s=0,d=0,p=0,R="2.0",_,E=new Map,Z,de=new Map,te=new Map,Be,he=new Mc.LinkedMap,fe=new Map,Oe=new Set,ye=new Map,M=ce.Off,J=tt.Text,L,le=mt.New,ae=new Ln.Emitter,De=new Ln.Emitter,_t=new Ln.Emitter,lt=new Ln.Emitter,ft=new Ln.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:gi.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++p).toString():"res-"+o.toString()}function Ir(){return"not-"+(++d).toString()}function qn(o,f){V.Message.isRequest(f)?o.set(Dt(f.id),f):V.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return le===mt.Listening}function bt(){return le===mt.Closed}function qe(){return le===mt.Disposed}function Et(){(le===mt.New||le===mt.Listening)&&(le=mt.Closed,De.fire(void 0))}function Ot(o){ae.fire([o,void 0,void 0])}function Lr(o){ae.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){Be||he.size===0||(Be=(0,Nc.default)().timer.setImmediate(()=>{Be=void 0,$r()}))}function zt(o){V.Message.isRequest(o)?Wr(o):V.Message.isNotification(o)?zr(o):V.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(he.size===0)return;let o=he.shift();try{let f=n?.messageStrategy;yi.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(V.Message.isNotification(o)&&o.method===Wn.type.method){let f=o.params.id,g=Dt(f),b=he.get(g);if(V.Message.isRequest(b)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(b,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){he.delete(g),ye.delete(f),B.id=b.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let $=ye.get(f);if($!==void 0){$.cancel(),wt(o);return}else Oe.add(f)}qn(he,o)}finally{Vt()}};function Wr(o){if(qe())return;function f(x,F,O){let Y={jsonrpc:R,id:o.id};x instanceof V.ResponseError?Y.error=x.toJson():Y.result=x===void 0?null:x,st(Y,F,O),e.write(Y).catch(()=>i.error("Sending response failed."))}function g(x,F,O){let Y={jsonrpc:R,id:o.id,error:x.toJson()};st(Y,F,O),e.write(Y).catch(()=>i.error("Sending response failed."))}function b(x,F,O){x===void 0&&(x=null);let Y={jsonrpc:R,id:o.id,result:x};st(Y,F,O),e.write(Y).catch(()=>i.error("Sending response failed."))}Hr(o);let $=E.get(o.method),q,B;$&&(q=$.type,B=$.handler);let H=Date.now();if(B||_){let x=o.id??String(Date.now()),F=hi.is(Te.receiver)?Te.receiver.createCancellationTokenSource(x):Te.receiver.createCancellationTokenSource(o);o.id!==null&&Oe.has(o.id)&&F.cancel(),o.id!==null&&ye.set(x,F);try{let O;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}O=B(F.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byName){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}O=B(...o.params,F.token)}else{if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byPosition){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}O=B(o.params,F.token)}else _&&(O=_(o.method,o.params,F.token));let Y=O;O?Y.then?Y.then(oe=>{ye.delete(x),f(oe,o.method,H)},oe=>{ye.delete(x),oe instanceof V.ResponseError?g(oe,o.method,H):oe&&Re.string(oe.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${oe.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(ye.delete(x),f(O,o.method,H)):(ye.delete(x),b(O,o.method,H))}catch(O){ye.delete(x),O instanceof V.ResponseError?f(O,o.method,H):O&&Re.string(O.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${O.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new V.ResponseError(V.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!qe())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
7
+ ${JSON.stringify(o.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let f=o.id,g=fe.get(f);if(Zr(o,g),g!==void 0){fe.delete(f);try{if(o.error){let b=o.error;g.reject(new V.ResponseError(b.code,b.message,b.data))}else if(o.result!==void 0)g.resolve(o.result);else throw new Error("Should never happen.")}catch(b){b.message?i.error(`Response handler '${g.method}' failed with message: ${b.message}`):i.error(`Response handler '${g.method}' failed unexpectedly.`)}}}}function zr(o){if(qe())return;let f,g;if(o.method===Wn.type.method){let b=o.params.id;Oe.delete(b),wt(o);return}else{let b=de.get(o.method);b&&(g=b.handler,f=b.type)}if(g||Z)try{if(wt(o),g)if(o.params===void 0)f!==void 0&&f.numberOfParams!==0&&f.parameterStructures!==V.ParameterStructures.byName&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received none.`),g();else if(Array.isArray(o.params)){let b=o.params;o.method===$n.type.method&&b.length===2&&fo.is(b[0])?g({token:b[0],value:b[1]}):(f!==void 0&&(f.parameterStructures===V.ParameterStructures.byName&&i.error(`Notification ${o.method} defines parameters by name but received parameters by position`),f.numberOfParams!==o.params.length&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received ${b.length} arguments`)),g(...b))}else f!==void 0&&f.parameterStructures===V.ParameterStructures.byPosition&&i.error(`Notification ${o.method} defines parameters by position but received parameters by name`),g(o.params);else Z&&Z(o.method,o.params)}catch(b){b.message?i.error(`Notification handler '${o.method}' failed with message: ${b.message}`):i.error(`Notification handler '${o.method}' failed unexpectedly.`)}else _t.fire(o)}function Ut(o){if(!o){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
8
+ ${JSON.stringify(o,null,4)}`);let f=o;if(Re.string(f.id)||Re.number(f.id)){let g=f.id,b=fe.get(g);b&&b.reject(new Error("The received response has neither a result nor an error property."))}}function Pe(o){if(o!=null)switch(M){case ce.Verbose:return JSON.stringify(o,null,4);case ce.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(M===ce.Off||!L))if(J===tt.Text){let f;(M===ce.Verbose||M===ce.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
9
9
 
10
- `),W.log(`Sending request '${o.method} - (${o.id})'.`,f)}else je("send-request",o)}function Br(o){if(!(O===ae.Off||!W))if(fe===tt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
10
+ `),L.log(`Sending request '${o.method} - (${o.id})'.`,f)}else Ie("send-request",o)}function Br(o){if(!(M===ce.Off||!L))if(J===tt.Text){let f;(M===ce.Verbose||M===ce.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
11
11
 
12
12
  `:f=`No parameters provided.
13
13
 
14
- `),W.log(`Sending notification '${o.method}'.`,f)}else je("send-notification",o)}function st(o,f,g){if(!(O===ae.Off||!W))if(fe===tt.Text){let b;(O===ae.Verbose||O===ae.Compact)&&(o.error&&o.error.data?b=`Error data: ${Pe(o.error.data)}
14
+ `),L.log(`Sending notification '${o.method}'.`,f)}else Ie("send-notification",o)}function st(o,f,g){if(!(M===ce.Off||!L))if(J===tt.Text){let b;(M===ce.Verbose||M===ce.Compact)&&(o.error&&o.error.data?b=`Error data: ${Pe(o.error.data)}
15
15
 
16
16
  `:o.result?b=`Result: ${Pe(o.result)}
17
17
 
18
18
  `:o.error===void 0&&(b=`No result returned.
19
19
 
20
- `)),W.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,b)}else je("send-response",o)}function Hr(o){if(!(O===ae.Off||!W))if(fe===tt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
20
+ `)),L.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,b)}else Ie("send-response",o)}function Hr(o){if(!(M===ce.Off||!L))if(J===tt.Text){let f;(M===ce.Verbose||M===ce.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
21
21
 
22
- `),W.log(`Received request '${o.method} - (${o.id})'.`,f)}else je("receive-request",o)}function wt(o){if(!(O===ae.Off||!W||o.method===pi.type.method))if(fe===tt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
22
+ `),L.log(`Received request '${o.method} - (${o.id})'.`,f)}else Ie("receive-request",o)}function wt(o){if(!(M===ce.Off||!L||o.method===fi.type.method))if(J===tt.Text){let f;(M===ce.Verbose||M===ce.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
23
23
 
24
24
  `:f=`No parameters provided.
25
25
 
26
- `),W.log(`Received notification '${o.method}'.`,f)}else je("receive-notification",o)}function Zr(o,f){if(!(O===ae.Off||!W))if(fe===tt.Text){let g;if((O===ae.Verbose||O===ae.Compact)&&(o.error&&o.error.data?g=`Error data: ${Pe(o.error.data)}
26
+ `),L.log(`Received notification '${o.method}'.`,f)}else Ie("receive-notification",o)}function Zr(o,f){if(!(M===ce.Off||!L))if(J===tt.Text){let g;if((M===ce.Verbose||M===ce.Compact)&&(o.error&&o.error.data?g=`Error data: ${Pe(o.error.data)}
27
27
 
28
28
  `:o.result?g=`Result: ${Pe(o.result)}
29
29
 
30
30
  `:o.error===void 0&&(g=`No result returned.
31
31
 
32
- `)),f){let b=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";W.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${b}`,g)}else W.log(`Received response ${o.id} without active response promise.`,g)}else je("receive-response",o)}function je(o,f){if(!W||O===ae.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};W.log(g)}function He(){if(bt())throw new on(Wn.Closed,"Connection is closed.");if(Me())throw new on(Wn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new on(Wn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function qe(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case V.ParameterStructures.auto:return Ht(f)?Bt(f):[qe(f)];case V.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case V.ParameterStructures.byPosition:return[qe(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,b=o.numberOfParams;switch(b){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let L=0;L<f.length&&L<b;L++)g.push(qe(f[L]));if(f.length<b)for(let L=f.length;L<b;L++)g.push(null);break}return g}let Ie={sendNotification:(o,...f)=>{He();let g,b;if(Re.string(o)){g=o;let q=f[0],B=0,H=V.ParameterStructures.auto;V.ParameterStructures.is(q)&&(B=1,H=q);let x=f.length,$=x-B;switch($){case 0:b=void 0;break;case 1:b=Tt(H,f[B]);break;default:if(H===V.ParameterStructures.byName)throw new Error(`Received ${$} parameters for 'by Name' notification parameter structure.`);b=f.slice(B,x).map(N=>qe(N));break}}else{let q=f;g=o.method,b=Zt(o,q)}let L={jsonrpc:R,method:g,params:b};return Br(L),e.write(L).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return Re.func(o)?Z=o:f&&(Re.string(o)?(g=o,ue.set(o,{type:void 0,handler:f})):(g=o.method,ue.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?ue.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(ee.has(f))throw new Error(`Progress handler for token ${f} already registered`);return ee.set(f,g),{dispose:()=>{ee.delete(f)}}},sendProgress:(o,f,g)=>Ie.sendNotification(Fn.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,b,L;if(Re.string(o)){g=o;let x=f[0],$=f[f.length-1],N=0,X=V.ParameterStructures.auto;V.ParameterStructures.is(x)&&(N=1,X=x);let se=f.length;ho.CancellationToken.is($)&&(se=se-1,L=$);let be=se-N;switch(be){case 0:b=void 0;break;case 1:b=Tt(X,f[N]);break;default:if(X===V.ParameterStructures.byName)throw new Error(`Received ${be} parameters for 'by Name' request parameter structure.`);b=f.slice(N,se).map(Qr=>qe(Qr));break}}else{let x=f;g=o.method,b=Zt(o,x);let $=o.numberOfParams;L=ho.CancellationToken.is(x[$])?x[$]:void 0}let q=s++,B;L&&(B=L.onCancellationRequested(()=>{let x=Te.sender.sendCancellation(Ie,q);return x===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):x.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:b};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(x,$)=>{let N=be=>{x(be),Te.sender.cleanup(q),B?.dispose()},X=be=>{$(be),Te.sender.cleanup(q),B?.dispose()},se={method:g,timerStart:Date.now(),resolve:N,reject:X};try{de.set(q,se),await e.write(H)}catch(be){throw de.delete(q),se.reject(new V.ResponseError(V.ErrorCodes.MessageWriteError,be.message?be.message:"Unknown reason")),i.error("Sending request failed."),be}})},onRequest:(o,f)=>{He();let g=null;return go.is(o)?(g=void 0,_=o):Re.string(o)?(g=null,f!==void 0&&(g=o,E.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,E.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?E.delete(g):_=void 0)}}},hasPendingResponse:()=>de.size>0,trace:async(o,f,g)=>{let b=!1,L=tt.Text;g!==void 0&&(Re.boolean(g)?b=g:(b=g.sendNotification||!1,L=g.traceFormat||tt.Text)),O=o,fe=L,O===ae.Off?W=void 0:W=f,b&&!bt()&&!Me()&&await Ie.sendNotification(yo.type,{value:ae.toString(o)})},onError:_e.event,onClose:Be.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(Me())return;ve=mt.Disposed,ft.fire(void 0);let o=new V.ResponseError(V.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of de.values())f.reject(o);de=new Map,oe=new Map,Ue=new Set,le=new qc.LinkedMap,Re.func(e.dispose)&&e.dispose(),Re.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),ve=mt.Listening,t.listen(Fr)},inspect:()=>{(0,jc.default)().console.log("inspect")}};return Ie.onNotification(pi.type,o=>{if(O===ae.Off||!W)return;let f=O===ae.Verbose||O===ae.Compact;W.log(o.message,f?o.verbose:void 0)}),Ie.onNotification(Fn.type,o=>{let f=ee.get(o.token);f?f(o.value):lt.fire(o)}),Ie}G.createMessageConnection=mh});var bi=M(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.ProgressType=w.ProgressToken=w.createMessageConnection=w.NullLogger=w.ConnectionOptions=w.ConnectionStrategy=w.AbstractMessageBuffer=w.WriteableStreamMessageWriter=w.AbstractMessageWriter=w.MessageWriter=w.ReadableStreamMessageReader=w.AbstractMessageReader=w.MessageReader=w.SharedArrayReceiverStrategy=w.SharedArraySenderStrategy=w.CancellationToken=w.CancellationTokenSource=w.Emitter=w.Event=w.Disposable=w.LRUCache=w.Touch=w.LinkedMap=w.ParameterStructures=w.NotificationType9=w.NotificationType8=w.NotificationType7=w.NotificationType6=w.NotificationType5=w.NotificationType4=w.NotificationType3=w.NotificationType2=w.NotificationType1=w.NotificationType0=w.NotificationType=w.ErrorCodes=w.ResponseError=w.RequestType9=w.RequestType8=w.RequestType7=w.RequestType6=w.RequestType5=w.RequestType4=w.RequestType3=w.RequestType2=w.RequestType1=w.RequestType0=w.RequestType=w.Message=w.RAL=void 0;w.MessageStrategy=w.CancellationStrategy=w.CancellationSenderStrategy=w.CancellationReceiverStrategy=w.ConnectionError=w.ConnectionErrors=w.LogTraceNotification=w.SetTraceNotification=w.TraceFormat=w.TraceValues=w.Trace=void 0;var pe=Us();Object.defineProperty(w,"Message",{enumerable:!0,get:function(){return pe.Message}});Object.defineProperty(w,"RequestType",{enumerable:!0,get:function(){return pe.RequestType}});Object.defineProperty(w,"RequestType0",{enumerable:!0,get:function(){return pe.RequestType0}});Object.defineProperty(w,"RequestType1",{enumerable:!0,get:function(){return pe.RequestType1}});Object.defineProperty(w,"RequestType2",{enumerable:!0,get:function(){return pe.RequestType2}});Object.defineProperty(w,"RequestType3",{enumerable:!0,get:function(){return pe.RequestType3}});Object.defineProperty(w,"RequestType4",{enumerable:!0,get:function(){return pe.RequestType4}});Object.defineProperty(w,"RequestType5",{enumerable:!0,get:function(){return pe.RequestType5}});Object.defineProperty(w,"RequestType6",{enumerable:!0,get:function(){return pe.RequestType6}});Object.defineProperty(w,"RequestType7",{enumerable:!0,get:function(){return pe.RequestType7}});Object.defineProperty(w,"RequestType8",{enumerable:!0,get:function(){return pe.RequestType8}});Object.defineProperty(w,"RequestType9",{enumerable:!0,get:function(){return pe.RequestType9}});Object.defineProperty(w,"ResponseError",{enumerable:!0,get:function(){return pe.ResponseError}});Object.defineProperty(w,"ErrorCodes",{enumerable:!0,get:function(){return pe.ErrorCodes}});Object.defineProperty(w,"NotificationType",{enumerable:!0,get:function(){return pe.NotificationType}});Object.defineProperty(w,"NotificationType0",{enumerable:!0,get:function(){return pe.NotificationType0}});Object.defineProperty(w,"NotificationType1",{enumerable:!0,get:function(){return pe.NotificationType1}});Object.defineProperty(w,"NotificationType2",{enumerable:!0,get:function(){return pe.NotificationType2}});Object.defineProperty(w,"NotificationType3",{enumerable:!0,get:function(){return pe.NotificationType3}});Object.defineProperty(w,"NotificationType4",{enumerable:!0,get:function(){return pe.NotificationType4}});Object.defineProperty(w,"NotificationType5",{enumerable:!0,get:function(){return pe.NotificationType5}});Object.defineProperty(w,"NotificationType6",{enumerable:!0,get:function(){return pe.NotificationType6}});Object.defineProperty(w,"NotificationType7",{enumerable:!0,get:function(){return pe.NotificationType7}});Object.defineProperty(w,"NotificationType8",{enumerable:!0,get:function(){return pe.NotificationType8}});Object.defineProperty(w,"NotificationType9",{enumerable:!0,get:function(){return pe.NotificationType9}});Object.defineProperty(w,"ParameterStructures",{enumerable:!0,get:function(){return pe.ParameterStructures}});var bo=Hs();Object.defineProperty(w,"LinkedMap",{enumerable:!0,get:function(){return bo.LinkedMap}});Object.defineProperty(w,"LRUCache",{enumerable:!0,get:function(){return bo.LRUCache}});Object.defineProperty(w,"Touch",{enumerable:!0,get:function(){return bo.Touch}});var gh=Rc();Object.defineProperty(w,"Disposable",{enumerable:!0,get:function(){return gh.Disposable}});var $c=tn();Object.defineProperty(w,"Event",{enumerable:!0,get:function(){return $c.Event}});Object.defineProperty(w,"Emitter",{enumerable:!0,get:function(){return $c.Emitter}});var Fc=ui();Object.defineProperty(w,"CancellationTokenSource",{enumerable:!0,get:function(){return Fc.CancellationTokenSource}});Object.defineProperty(w,"CancellationToken",{enumerable:!0,get:function(){return Fc.CancellationToken}});var Wc=Sc();Object.defineProperty(w,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Wc.SharedArraySenderStrategy}});Object.defineProperty(w,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Wc.SharedArrayReceiverStrategy}});var wo=Pc();Object.defineProperty(w,"MessageReader",{enumerable:!0,get:function(){return wo.MessageReader}});Object.defineProperty(w,"AbstractMessageReader",{enumerable:!0,get:function(){return wo.AbstractMessageReader}});Object.defineProperty(w,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return wo.ReadableStreamMessageReader}});var To=Nc();Object.defineProperty(w,"MessageWriter",{enumerable:!0,get:function(){return To.MessageWriter}});Object.defineProperty(w,"AbstractMessageWriter",{enumerable:!0,get:function(){return To.AbstractMessageWriter}});Object.defineProperty(w,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return To.WriteableStreamMessageWriter}});var yh=Mc();Object.defineProperty(w,"AbstractMessageBuffer",{enumerable:!0,get:function(){return yh.AbstractMessageBuffer}});var Ee=Lc();Object.defineProperty(w,"ConnectionStrategy",{enumerable:!0,get:function(){return Ee.ConnectionStrategy}});Object.defineProperty(w,"ConnectionOptions",{enumerable:!0,get:function(){return Ee.ConnectionOptions}});Object.defineProperty(w,"NullLogger",{enumerable:!0,get:function(){return Ee.NullLogger}});Object.defineProperty(w,"createMessageConnection",{enumerable:!0,get:function(){return Ee.createMessageConnection}});Object.defineProperty(w,"ProgressToken",{enumerable:!0,get:function(){return Ee.ProgressToken}});Object.defineProperty(w,"ProgressType",{enumerable:!0,get:function(){return Ee.ProgressType}});Object.defineProperty(w,"Trace",{enumerable:!0,get:function(){return Ee.Trace}});Object.defineProperty(w,"TraceValues",{enumerable:!0,get:function(){return Ee.TraceValues}});Object.defineProperty(w,"TraceFormat",{enumerable:!0,get:function(){return Ee.TraceFormat}});Object.defineProperty(w,"SetTraceNotification",{enumerable:!0,get:function(){return Ee.SetTraceNotification}});Object.defineProperty(w,"LogTraceNotification",{enumerable:!0,get:function(){return Ee.LogTraceNotification}});Object.defineProperty(w,"ConnectionErrors",{enumerable:!0,get:function(){return Ee.ConnectionErrors}});Object.defineProperty(w,"ConnectionError",{enumerable:!0,get:function(){return Ee.ConnectionError}});Object.defineProperty(w,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ee.CancellationReceiverStrategy}});Object.defineProperty(w,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ee.CancellationSenderStrategy}});Object.defineProperty(w,"CancellationStrategy",{enumerable:!0,get:function(){return Ee.CancellationStrategy}});Object.defineProperty(w,"MessageStrategy",{enumerable:!0,get:function(){return Ee.MessageStrategy}});var vh=Gt();w.RAL=vh.default});var Uc=M(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});var Vc=require("util"),Mt=bi(),wi=class t extends Mt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new Vc.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};wi.emptyBuffer=Buffer.allocUnsafe(0);var Ro=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mt.Disposable.create(()=>this.stream.off("data",e))}},ko=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=l=>{l==null?n():i(l)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},zc=Object.freeze({messageBuffer:Object.freeze({create:t=>new wi(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new Vc.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new Ro(t),asWritableStream:t=>new ko(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function So(){return zc}(function(t){function e(){Mt.RAL.install(zc)}t.install=e})(So||(So={}));Co.default=So});var Oo=M(ne=>{"use strict";var _h=ne&&ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bh=ne&&ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_h(e,t,r)};Object.defineProperty(ne,"__esModule",{value:!0});ne.createMessageConnection=ne.createServerSocketTransport=ne.createClientSocketTransport=ne.createServerPipeTransport=ne.createClientPipeTransport=ne.generateRandomPipeName=ne.StreamMessageWriter=ne.StreamMessageReader=ne.SocketMessageWriter=ne.SocketMessageReader=ne.PortMessageWriter=ne.PortMessageReader=ne.IPCMessageWriter=ne.IPCMessageReader=void 0;var an=Uc();an.default.install();var Bc=require("path"),wh=require("os"),Th=require("crypto"),ki=require("net"),rt=bi();bh(bi(),ne);var Po=class extends rt.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),rt.Disposable.create(()=>this.process.off("message",e))}};ne.IPCMessageReader=Po;var xo=class extends rt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ne.IPCMessageWriter=xo;var Do=class extends rt.AbstractMessageReader{constructor(e){super(),this.onData=new rt.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};ne.PortMessageReader=Do;var Eo=class extends rt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ne.PortMessageWriter=Eo;var fr=class extends rt.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,an.default)().stream.asReadableStream(e),r)}};ne.SocketMessageReader=fr;var hr=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ne.SocketMessageWriter=hr;var Ti=class extends rt.ReadableStreamMessageReader{constructor(e,r){super((0,an.default)().stream.asReadableStream(e),r)}};ne.StreamMessageReader=Ti;var Ri=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r)}};ne.StreamMessageWriter=Ri;var Hc=process.env.XDG_RUNTIME_DIR,Rh=new Map([["linux",107],["darwin",103]]);function kh(){let t=(0,Th.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Hc?e=Bc.join(Hc,`vscode-ipc-${t}.sock`):e=Bc.join(wh.tmpdir(),`vscode-${t}.sock`);let r=Rh.get(process.platform);return r!==void 0&&e.length>r&&(0,an.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}ne.generateRandomPipeName=kh;function Sh(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let l=(0,ki.createServer)(p=>{l.close(),r([new fr(p,e),new hr(p,e)])});l.on("error",s),l.listen(t,()=>{l.removeListener("error",s),i({onConnected:()=>n})})})}ne.createClientPipeTransport=Sh;function Ch(t,e="utf-8"){let r=(0,ki.createConnection)(t);return[new fr(r,e),new hr(r,e)]}ne.createServerPipeTransport=Ch;function Ph(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let l=(0,ki.createServer)(p=>{l.close(),r([new fr(p,e),new hr(p,e)])});l.on("error",s),l.listen(t,"127.0.0.1",()=>{l.removeListener("error",s),i({onConnected:()=>n})})})}ne.createClientSocketTransport=Ph;function xh(t,e="utf-8"){let r=(0,ki.createConnection)(t,"127.0.0.1");return[new fr(r,e),new hr(r,e)]}ne.createServerSocketTransport=xh;function Dh(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function Eh(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function Oh(t,e,r,n){r||(r=rt.NullLogger);let i=Dh(t)?new Ti(t):t,s=Eh(e)?new Ri(e):e;return rt.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,rt.createMessageConnection)(i,s,r,n)}ne.createMessageConnection=Oh});var Jc=M((Rg,Zc)=>{"use strict";Zc.exports=Oo()});var cn=M($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.stringArray=$e.array=$e.func=$e.error=$e.number=$e.string=$e.boolean=void 0;function Nh(t){return t===!0||t===!1}$e.boolean=Nh;function Gc(t){return typeof t=="string"||t instanceof String}$e.string=Gc;function Mh(t){return typeof t=="number"||t instanceof Number}$e.number=Mh;function jh(t){return t instanceof Error}$e.error=jh;function qh(t){return typeof t=="function"}$e.func=qh;function Qc(t){return Array.isArray(t)}$e.array=Qc;function Ih(t){return Qc(t)&&t.every(e=>Gc(e))}$e.stringArray=Ih});var ra=M(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.Message=A.NotificationType9=A.NotificationType8=A.NotificationType7=A.NotificationType6=A.NotificationType5=A.NotificationType4=A.NotificationType3=A.NotificationType2=A.NotificationType1=A.NotificationType0=A.NotificationType=A.RequestType9=A.RequestType8=A.RequestType7=A.RequestType6=A.RequestType5=A.RequestType4=A.RequestType3=A.RequestType2=A.RequestType1=A.RequestType=A.RequestType0=A.AbstractMessageSignature=A.ParameterStructures=A.ResponseError=A.ErrorCodes=void 0;var pr=cn(),No;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(No||(A.ErrorCodes=No={}));var Mo=class t extends Error{constructor(e,r,n){super(r),this.code=pr.number(e)?e:No.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};A.ResponseError=Mo;var Je=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};A.ParameterStructures=Je;Je.auto=new Je("auto");Je.byPosition=new Je("byPosition");Je.byName=new Je("byName");var ye=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Je.auto}};A.AbstractMessageSignature=ye;var jo=class extends ye{constructor(e){super(e,0)}};A.RequestType0=jo;var qo=class extends ye{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType=qo;var Io=class extends ye{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType1=Io;var Ao=class extends ye{constructor(e){super(e,2)}};A.RequestType2=Ao;var Lo=class extends ye{constructor(e){super(e,3)}};A.RequestType3=Lo;var $o=class extends ye{constructor(e){super(e,4)}};A.RequestType4=$o;var Fo=class extends ye{constructor(e){super(e,5)}};A.RequestType5=Fo;var Wo=class extends ye{constructor(e){super(e,6)}};A.RequestType6=Wo;var Vo=class extends ye{constructor(e){super(e,7)}};A.RequestType7=Vo;var zo=class extends ye{constructor(e){super(e,8)}};A.RequestType8=zo;var Uo=class extends ye{constructor(e){super(e,9)}};A.RequestType9=Uo;var Bo=class extends ye{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType=Bo;var Ho=class extends ye{constructor(e){super(e,0)}};A.NotificationType0=Ho;var Zo=class extends ye{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType1=Zo;var Jo=class extends ye{constructor(e){super(e,2)}};A.NotificationType2=Jo;var Go=class extends ye{constructor(e){super(e,3)}};A.NotificationType3=Go;var Qo=class extends ye{constructor(e){super(e,4)}};A.NotificationType4=Qo;var Xo=class extends ye{constructor(e){super(e,5)}};A.NotificationType5=Xo;var Yo=class extends ye{constructor(e){super(e,6)}};A.NotificationType6=Yo;var Ko=class extends ye{constructor(e){super(e,7)}};A.NotificationType7=Ko;var ea=class extends ye{constructor(e){super(e,8)}};A.NotificationType8=ea;var ta=class extends ye{constructor(e){super(e,9)}};A.NotificationType9=ta;var Xc;(function(t){function e(i){let s=i;return s&&pr.string(s.method)&&(pr.string(s.id)||pr.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&pr.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(pr.string(s.id)||pr.number(s.id)||s.id===null)}t.isResponse=n})(Xc||(A.Message=Xc={}))});var ia=M(Yt=>{"use strict";var Yc;Object.defineProperty(Yt,"__esModule",{value:!0});Yt.LRUCache=Yt.LinkedMap=Yt.Touch=void 0;var Fe;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Fe||(Yt.Touch=Fe={}));var Si=class{constructor(){this[Yc]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Fe.None){let n=this._map.get(e);if(n)return r!==Fe.None&&this.touch(n,r),n.value}set(e,r,n=Fe.None){let i=this._map.get(e);if(i)i.value=r,n!==Fe.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Fe.None:this.addItemLast(i);break;case Fe.First:this.addItemFirst(i);break;case Fe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(Yc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Fe.First&&r!==Fe.Last)){if(r===Fe.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Fe.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Yt.LinkedMap=Si;var na=class extends Si{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Fe.AsNew){return super.get(e,r)}peek(e){return super.get(e,Fe.None)}set(e,r){return super.set(e,r,Fe.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yt.LRUCache=na});var eu=M(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.Disposable=void 0;var Kc;(function(t){function e(r){return{dispose:r}}t.create=e})(Kc||(Ci.Disposable=Kc={}))});var Kt=M(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var sa;function oa(){if(sa===void 0)throw new Error("No runtime abstraction layer installed");return sa}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");sa=r}t.install=e})(oa||(oa={}));aa.default=oa});var dn=M(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.Emitter=un.Event=void 0;var Ah=Kt(),tu;(function(t){let e={dispose(){}};t.None=function(){return e}})(tu||(un.Event=tu={}));var ca=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,l=n.length;s<l;s++)try{r.push(n[s].apply(i[s],e))}catch(p){(0,Ah.default)().console.error(p)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Pi=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new ca),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};un.Emitter=Pi;Pi._noop=function(){}});var Ei=M(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.CancellationTokenSource=ln.CancellationToken=void 0;var Lh=Kt(),$h=cn(),ua=dn(),xi;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ua.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ua.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||$h.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(xi||(ln.CancellationToken=xi={}));var Fh=Object.freeze(function(t,e){let r=(0,Lh.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Di=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Fh:(this._emitter||(this._emitter=new ua.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},da=class{get token(){return this._token||(this._token=new Di),this._token}cancel(){this._token?this._token.cancel():this._token=xi.Cancelled}dispose(){this._token?this._token instanceof Di&&this._token.dispose():this._token=xi.None}};ln.CancellationTokenSource=da});var ru=M(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.SharedArrayReceiverStrategy=fn.SharedArraySenderStrategy=void 0;var Wh=Ei(),zn;(function(t){t.Continue=0,t.Cancelled=1})(zn||(zn={}));var la=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=zn.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,zn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};fn.SharedArraySenderStrategy=la;var fa=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===zn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},ha=class{constructor(e){this.token=new fa(e)}cancel(){}dispose(){}},pa=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Wh.CancellationTokenSource:new ha(r)}};fn.SharedArrayReceiverStrategy=pa});var ga=M(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.Semaphore=void 0;var Vh=Kt(),ma=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Vh.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Oi.Semaphore=ma});var iu=M(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.ReadableStreamMessageReader=er.AbstractMessageReader=er.MessageReader=void 0;var va=Kt(),hn=cn(),ya=dn(),zh=ga(),nu;(function(t){function e(r){let n=r;return n&&hn.func(n.listen)&&hn.func(n.dispose)&&hn.func(n.onError)&&hn.func(n.onClose)&&hn.func(n.onPartialMessage)}t.is=e})(nu||(er.MessageReader=nu={}));var Ni=class{constructor(){this.errorEmitter=new ya.Emitter,this.closeEmitter=new ya.Emitter,this.partialMessageEmitter=new ya.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${hn.string(e.message)?e.message:"unknown"}`)}};er.AbstractMessageReader=Ni;var _a;(function(t){function e(r){let n,i,s,l=new Map,p,R=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,l.set(s.name,s)),r.contentDecoders!==void 0)for(let _ of r.contentDecoders)l.set(_.name,_);if(r.contentTypeDecoder!==void 0&&(p=r.contentTypeDecoder,R.set(p.name,p)),r.contentTypeDecoders!==void 0)for(let _ of r.contentTypeDecoders)R.set(_.name,_)}return p===void 0&&(p=(0,va.default)().applicationJson.decoder,R.set(p.name,p)),{charset:n,contentDecoder:s,contentDecoders:l,contentTypeDecoder:p,contentTypeDecoders:R}}t.fromOptions=e})(_a||(_a={}));var ba=class extends Ni{constructor(e,r){super(),this.readable=e,this.options=_a.fromOptions(r),this.buffer=(0,va.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new zh.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
33
- ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,va.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};er.ReadableStreamMessageReader=ba});var uu=M(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.WriteableStreamMessageWriter=tr.AbstractMessageWriter=tr.MessageWriter=void 0;var su=Kt(),Un=cn(),Uh=ga(),ou=dn(),Bh="Content-Length: ",au=`\r
34
- `,cu;(function(t){function e(r){let n=r;return n&&Un.func(n.dispose)&&Un.func(n.onClose)&&Un.func(n.onError)&&Un.func(n.write)}t.is=e})(cu||(tr.MessageWriter=cu={}));var Mi=class{constructor(){this.errorEmitter=new ou.Emitter,this.closeEmitter=new ou.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Un.string(e.message)?e.message:"unknown"}`)}};tr.AbstractMessageWriter=Mi;var wa;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,su.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,su.default)().applicationJson.encoder}}t.fromOptions=e})(wa||(wa={}));var Ta=class extends Mi{constructor(e,r){super(),this.writable=e,this.options=wa.fromOptions(r),this.errorCount=0,this.writeSemaphore=new Uh.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(Bh,n.byteLength.toString(),au),i.push(au),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};tr.WriteableStreamMessageWriter=Ta});var du=M(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.AbstractMessageBuffer=void 0;var Hh=13,Zh=10,Jh=`\r
35
- `,Ra=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let _=this._chunks[n];for(i=0;i<_.length;){switch(_[i]){case Hh:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case Zh:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=_.byteLength,n++}if(r!==4)return;let l=this._read(s+i),p=new Map,R=this.toString(l,"ascii").split(Jh);if(R.length<2)return p;for(let _=0;_<R.length-2;_++){let E=R[_],Z=E.indexOf(":");if(Z===-1)throw new Error(`Message header must separate key and value using ':'
36
- ${E}`);let ue=E.substr(0,Z),ee=E.substr(Z+1).trim();p.set(e?ue.toLowerCase():ue,ee)}return p}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],l=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,l}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let l=s.slice(0,e);r.set(l,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};ji.AbstractMessageBuffer=Ra});var mu=M(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.createMessageConnection=Q.ConnectionOptions=Q.MessageStrategy=Q.CancellationStrategy=Q.CancellationSenderStrategy=Q.CancellationReceiverStrategy=Q.RequestCancellationReceiverStrategy=Q.IdCancellationReceiverStrategy=Q.ConnectionStrategy=Q.ConnectionError=Q.ConnectionErrors=Q.LogTraceNotification=Q.SetTraceNotification=Q.TraceFormat=Q.TraceValues=Q.Trace=Q.NullLogger=Q.ProgressType=Q.ProgressToken=void 0;var lu=Kt(),ke=cn(),z=ra(),fu=ia(),Bn=dn(),ka=Ei(),Jn;(function(t){t.type=new z.NotificationType("$/cancelRequest")})(Jn||(Jn={}));var Sa;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Sa||(Q.ProgressToken=Sa={}));var Hn;(function(t){t.type=new z.NotificationType("$/progress")})(Hn||(Hn={}));var Ca=class{constructor(){}};Q.ProgressType=Ca;var Pa;(function(t){function e(r){return ke.func(r)}t.is=e})(Pa||(Pa={}));Q.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ce;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ce||(Q.Trace=ce={}));var hu;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(hu||(Q.TraceValues=hu={}));(function(t){function e(n){if(!ke.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ce||(Q.Trace=ce={}));var nt;(function(t){t.Text="text",t.JSON="json"})(nt||(Q.TraceFormat=nt={}));(function(t){function e(r){return ke.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(nt||(Q.TraceFormat=nt={}));var xa;(function(t){t.type=new z.NotificationType("$/setTrace")})(xa||(Q.SetTraceNotification=xa={}));var qi;(function(t){t.type=new z.NotificationType("$/logTrace")})(qi||(Q.LogTraceNotification=qi={}));var Zn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Zn||(Q.ConnectionErrors=Zn={}));var pn=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Q.ConnectionError=pn;var Da;(function(t){function e(r){let n=r;return n&&ke.func(n.cancelUndispatched)}t.is=e})(Da||(Q.ConnectionStrategy=Da={}));var Ii;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(Ii||(Q.IdCancellationReceiverStrategy=Ii={}));var Ea;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(Ea||(Q.RequestCancellationReceiverStrategy=Ea={}));var Ai;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new ka.CancellationTokenSource}});function e(r){return Ii.is(r)||Ea.is(r)}t.is=e})(Ai||(Q.CancellationReceiverStrategy=Ai={}));var Li;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Jn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&ke.func(n.sendCancellation)&&ke.func(n.cleanup)}t.is=e})(Li||(Q.CancellationSenderStrategy=Li={}));var $i;(function(t){t.Message=Object.freeze({receiver:Ai.Message,sender:Li.Message});function e(r){let n=r;return n&&Ai.is(n.receiver)&&Li.is(n.sender)}t.is=e})($i||(Q.CancellationStrategy=$i={}));var Fi;(function(t){function e(r){let n=r;return n&&ke.func(n.handleMessage)}t.is=e})(Fi||(Q.MessageStrategy=Fi={}));var pu;(function(t){function e(r){let n=r;return n&&($i.is(n.cancellationStrategy)||Da.is(n.connectionStrategy)||Fi.is(n.messageStrategy))}t.is=e})(pu||(Q.ConnectionOptions=pu={}));var gt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(gt||(gt={}));function Gh(t,e,r,n){let i=r!==void 0?r:Q.NullLogger,s=0,l=0,p=0,R="2.0",_,E=new Map,Z,ue=new Map,ee=new Map,ze,le=new fu.LinkedMap,de=new Map,Ue=new Set,oe=new Map,O=ce.Off,fe=nt.Text,W,ve=gt.New,_e=new Bn.Emitter,Be=new Bn.Emitter,_t=new Bn.Emitter,lt=new Bn.Emitter,ft=new Bn.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:$i.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++p).toString():"res-"+o.toString()}function Ir(){return"not-"+(++l).toString()}function In(o,f){z.Message.isRequest(f)?o.set(Dt(f.id),f):z.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return ve===gt.Listening}function bt(){return ve===gt.Closed}function Me(){return ve===gt.Disposed}function Et(){(ve===gt.New||ve===gt.Listening)&&(ve=gt.Closed,Be.fire(void 0))}function Ot(o){_e.fire([o,void 0,void 0])}function Lr(o){_e.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){ze||le.size===0||(ze=(0,lu.default)().timer.setImmediate(()=>{ze=void 0,$r()}))}function zt(o){z.Message.isRequest(o)?Wr(o):z.Message.isNotification(o)?zr(o):z.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(le.size===0)return;let o=le.shift();try{let f=n?.messageStrategy;Fi.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(z.Message.isNotification(o)&&o.method===Jn.type.method){let f=o.params.id,g=Dt(f),b=le.get(g);if(z.Message.isRequest(b)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(b,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){le.delete(g),oe.delete(f),B.id=b.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let L=oe.get(f);if(L!==void 0){L.cancel(),wt(o);return}else Ue.add(f)}In(le,o)}finally{Vt()}};function Wr(o){if(Me())return;function f(x,$,N){let X={jsonrpc:R,id:o.id};x instanceof z.ResponseError?X.error=x.toJson():X.result=x===void 0?null:x,st(X,$,N),e.write(X).catch(()=>i.error("Sending response failed."))}function g(x,$,N){let X={jsonrpc:R,id:o.id,error:x.toJson()};st(X,$,N),e.write(X).catch(()=>i.error("Sending response failed."))}function b(x,$,N){x===void 0&&(x=null);let X={jsonrpc:R,id:o.id,result:x};st(X,$,N),e.write(X).catch(()=>i.error("Sending response failed."))}Hr(o);let L=E.get(o.method),q,B;L&&(q=L.type,B=L.handler);let H=Date.now();if(B||_){let x=o.id??String(Date.now()),$=Ii.is(Te.receiver)?Te.receiver.createCancellationTokenSource(x):Te.receiver.createCancellationTokenSource(o);o.id!==null&&Ue.has(o.id)&&$.cancel(),o.id!==null&&oe.set(x,$);try{let N;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}N=B($.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byName){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}N=B(...o.params,$.token)}else{if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byPosition){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}N=B(o.params,$.token)}else _&&(N=_(o.method,o.params,$.token));let X=N;N?X.then?X.then(se=>{oe.delete(x),f(se,o.method,H)},se=>{oe.delete(x),se instanceof z.ResponseError?g(se,o.method,H):se&&ke.string(se.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${se.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(oe.delete(x),f(N,o.method,H)):(oe.delete(x),b(N,o.method,H))}catch(N){oe.delete(x),N instanceof z.ResponseError?f(N,o.method,H):N&&ke.string(N.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${N.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new z.ResponseError(z.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!Me())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
37
- ${JSON.stringify(o.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let f=o.id,g=de.get(f);if(Zr(o,g),g!==void 0){de.delete(f);try{if(o.error){let b=o.error;g.reject(new z.ResponseError(b.code,b.message,b.data))}else if(o.result!==void 0)g.resolve(o.result);else throw new Error("Should never happen.")}catch(b){b.message?i.error(`Response handler '${g.method}' failed with message: ${b.message}`):i.error(`Response handler '${g.method}' failed unexpectedly.`)}}}}function zr(o){if(Me())return;let f,g;if(o.method===Jn.type.method){let b=o.params.id;Ue.delete(b),wt(o);return}else{let b=ue.get(o.method);b&&(g=b.handler,f=b.type)}if(g||Z)try{if(wt(o),g)if(o.params===void 0)f!==void 0&&f.numberOfParams!==0&&f.parameterStructures!==z.ParameterStructures.byName&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received none.`),g();else if(Array.isArray(o.params)){let b=o.params;o.method===Hn.type.method&&b.length===2&&Sa.is(b[0])?g({token:b[0],value:b[1]}):(f!==void 0&&(f.parameterStructures===z.ParameterStructures.byName&&i.error(`Notification ${o.method} defines parameters by name but received parameters by position`),f.numberOfParams!==o.params.length&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received ${b.length} arguments`)),g(...b))}else f!==void 0&&f.parameterStructures===z.ParameterStructures.byPosition&&i.error(`Notification ${o.method} defines parameters by position but received parameters by name`),g(o.params);else Z&&Z(o.method,o.params)}catch(b){b.message?i.error(`Notification handler '${o.method}' failed with message: ${b.message}`):i.error(`Notification handler '${o.method}' failed unexpectedly.`)}else _t.fire(o)}function Ut(o){if(!o){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
38
- ${JSON.stringify(o,null,4)}`);let f=o;if(ke.string(f.id)||ke.number(f.id)){let g=f.id,b=de.get(g);b&&b.reject(new Error("The received response has neither a result nor an error property."))}}function Pe(o){if(o!=null)switch(O){case ce.Verbose:return JSON.stringify(o,null,4);case ce.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(O===ce.Off||!W))if(fe===nt.Text){let f;(O===ce.Verbose||O===ce.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
32
+ `)),f){let b=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";L.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${b}`,g)}else L.log(`Received response ${o.id} without active response promise.`,g)}else Ie("receive-response",o)}function Ie(o,f){if(!L||M===ce.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};L.log(g)}function He(){if(bt())throw new on(Fn.Closed,"Connection is closed.");if(qe())throw new on(Fn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new on(Fn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function Ae(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case V.ParameterStructures.auto:return Ht(f)?Bt(f):[Ae(f)];case V.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case V.ParameterStructures.byPosition:return[Ae(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,b=o.numberOfParams;switch(b){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let $=0;$<f.length&&$<b;$++)g.push(Ae(f[$]));if(f.length<b)for(let $=f.length;$<b;$++)g.push(null);break}return g}let Le={sendNotification:(o,...f)=>{He();let g,b;if(Re.string(o)){g=o;let q=f[0],B=0,H=V.ParameterStructures.auto;V.ParameterStructures.is(q)&&(B=1,H=q);let x=f.length,F=x-B;switch(F){case 0:b=void 0;break;case 1:b=Tt(H,f[B]);break;default:if(H===V.ParameterStructures.byName)throw new Error(`Received ${F} parameters for 'by Name' notification parameter structure.`);b=f.slice(B,x).map(O=>Ae(O));break}}else{let q=f;g=o.method,b=Zt(o,q)}let $={jsonrpc:R,method:g,params:b};return Br($),e.write($).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return Re.func(o)?Z=o:f&&(Re.string(o)?(g=o,de.set(o,{type:void 0,handler:f})):(g=o.method,de.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?de.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(te.has(f))throw new Error(`Progress handler for token ${f} already registered`);return te.set(f,g),{dispose:()=>{te.delete(f)}}},sendProgress:(o,f,g)=>Le.sendNotification($n.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,b,$;if(Re.string(o)){g=o;let x=f[0],F=f[f.length-1],O=0,Y=V.ParameterStructures.auto;V.ParameterStructures.is(x)&&(O=1,Y=x);let oe=f.length;lo.CancellationToken.is(F)&&(oe=oe-1,$=F);let be=oe-O;switch(be){case 0:b=void 0;break;case 1:b=Tt(Y,f[O]);break;default:if(Y===V.ParameterStructures.byName)throw new Error(`Received ${be} parameters for 'by Name' request parameter structure.`);b=f.slice(O,oe).map(Qr=>Ae(Qr));break}}else{let x=f;g=o.method,b=Zt(o,x);let F=o.numberOfParams;$=lo.CancellationToken.is(x[F])?x[F]:void 0}let q=s++,B;$&&(B=$.onCancellationRequested(()=>{let x=Te.sender.sendCancellation(Le,q);return x===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):x.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:b};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(x,F)=>{let O=be=>{x(be),Te.sender.cleanup(q),B?.dispose()},Y=be=>{F(be),Te.sender.cleanup(q),B?.dispose()},oe={method:g,timerStart:Date.now(),resolve:O,reject:Y};try{fe.set(q,oe),await e.write(H)}catch(be){throw fe.delete(q),oe.reject(new V.ResponseError(V.ErrorCodes.MessageWriteError,be.message?be.message:"Unknown reason")),i.error("Sending request failed."),be}})},onRequest:(o,f)=>{He();let g=null;return po.is(o)?(g=void 0,_=o):Re.string(o)?(g=null,f!==void 0&&(g=o,E.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,E.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?E.delete(g):_=void 0)}}},hasPendingResponse:()=>fe.size>0,trace:async(o,f,g)=>{let b=!1,$=tt.Text;g!==void 0&&(Re.boolean(g)?b=g:(b=g.sendNotification||!1,$=g.traceFormat||tt.Text)),M=o,J=$,M===ce.Off?L=void 0:L=f,b&&!bt()&&!qe()&&await Le.sendNotification(mo.type,{value:ce.toString(o)})},onError:ae.event,onClose:De.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(qe())return;le=mt.Disposed,ft.fire(void 0);let o=new V.ResponseError(V.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of fe.values())f.reject(o);fe=new Map,ye=new Map,Oe=new Set,he=new Mc.LinkedMap,Re.func(e.dispose)&&e.dispose(),Re.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),le=mt.Listening,t.listen(Fr)},inspect:()=>{(0,Nc.default)().console.log("inspect")}};return Le.onNotification(fi.type,o=>{if(M===ce.Off||!L)return;let f=M===ce.Verbose||M===ce.Compact;L.log(o.message,f?o.verbose:void 0)}),Le.onNotification($n.type,o=>{let f=te.get(o.token);f?f(o.value):lt.fire(o)}),Le}Q.createMessageConnection=ph});var vi=N(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.ProgressType=w.ProgressToken=w.createMessageConnection=w.NullLogger=w.ConnectionOptions=w.ConnectionStrategy=w.AbstractMessageBuffer=w.WriteableStreamMessageWriter=w.AbstractMessageWriter=w.MessageWriter=w.ReadableStreamMessageReader=w.AbstractMessageReader=w.MessageReader=w.SharedArrayReceiverStrategy=w.SharedArraySenderStrategy=w.CancellationToken=w.CancellationTokenSource=w.Emitter=w.Event=w.Disposable=w.LRUCache=w.Touch=w.LinkedMap=w.ParameterStructures=w.NotificationType9=w.NotificationType8=w.NotificationType7=w.NotificationType6=w.NotificationType5=w.NotificationType4=w.NotificationType3=w.NotificationType2=w.NotificationType1=w.NotificationType0=w.NotificationType=w.ErrorCodes=w.ResponseError=w.RequestType9=w.RequestType8=w.RequestType7=w.RequestType6=w.RequestType5=w.RequestType4=w.RequestType3=w.RequestType2=w.RequestType1=w.RequestType0=w.RequestType=w.Message=w.RAL=void 0;w.MessageStrategy=w.CancellationStrategy=w.CancellationSenderStrategy=w.CancellationReceiverStrategy=w.ConnectionError=w.ConnectionErrors=w.LogTraceNotification=w.SetTraceNotification=w.TraceFormat=w.TraceValues=w.Trace=void 0;var me=Vs();Object.defineProperty(w,"Message",{enumerable:!0,get:function(){return me.Message}});Object.defineProperty(w,"RequestType",{enumerable:!0,get:function(){return me.RequestType}});Object.defineProperty(w,"RequestType0",{enumerable:!0,get:function(){return me.RequestType0}});Object.defineProperty(w,"RequestType1",{enumerable:!0,get:function(){return me.RequestType1}});Object.defineProperty(w,"RequestType2",{enumerable:!0,get:function(){return me.RequestType2}});Object.defineProperty(w,"RequestType3",{enumerable:!0,get:function(){return me.RequestType3}});Object.defineProperty(w,"RequestType4",{enumerable:!0,get:function(){return me.RequestType4}});Object.defineProperty(w,"RequestType5",{enumerable:!0,get:function(){return me.RequestType5}});Object.defineProperty(w,"RequestType6",{enumerable:!0,get:function(){return me.RequestType6}});Object.defineProperty(w,"RequestType7",{enumerable:!0,get:function(){return me.RequestType7}});Object.defineProperty(w,"RequestType8",{enumerable:!0,get:function(){return me.RequestType8}});Object.defineProperty(w,"RequestType9",{enumerable:!0,get:function(){return me.RequestType9}});Object.defineProperty(w,"ResponseError",{enumerable:!0,get:function(){return me.ResponseError}});Object.defineProperty(w,"ErrorCodes",{enumerable:!0,get:function(){return me.ErrorCodes}});Object.defineProperty(w,"NotificationType",{enumerable:!0,get:function(){return me.NotificationType}});Object.defineProperty(w,"NotificationType0",{enumerable:!0,get:function(){return me.NotificationType0}});Object.defineProperty(w,"NotificationType1",{enumerable:!0,get:function(){return me.NotificationType1}});Object.defineProperty(w,"NotificationType2",{enumerable:!0,get:function(){return me.NotificationType2}});Object.defineProperty(w,"NotificationType3",{enumerable:!0,get:function(){return me.NotificationType3}});Object.defineProperty(w,"NotificationType4",{enumerable:!0,get:function(){return me.NotificationType4}});Object.defineProperty(w,"NotificationType5",{enumerable:!0,get:function(){return me.NotificationType5}});Object.defineProperty(w,"NotificationType6",{enumerable:!0,get:function(){return me.NotificationType6}});Object.defineProperty(w,"NotificationType7",{enumerable:!0,get:function(){return me.NotificationType7}});Object.defineProperty(w,"NotificationType8",{enumerable:!0,get:function(){return me.NotificationType8}});Object.defineProperty(w,"NotificationType9",{enumerable:!0,get:function(){return me.NotificationType9}});Object.defineProperty(w,"ParameterStructures",{enumerable:!0,get:function(){return me.ParameterStructures}});var vo=Us();Object.defineProperty(w,"LinkedMap",{enumerable:!0,get:function(){return vo.LinkedMap}});Object.defineProperty(w,"LRUCache",{enumerable:!0,get:function(){return vo.LRUCache}});Object.defineProperty(w,"Touch",{enumerable:!0,get:function(){return vo.Touch}});var mh=wc();Object.defineProperty(w,"Disposable",{enumerable:!0,get:function(){return mh.Disposable}});var Ac=tn();Object.defineProperty(w,"Event",{enumerable:!0,get:function(){return Ac.Event}});Object.defineProperty(w,"Emitter",{enumerable:!0,get:function(){return Ac.Emitter}});var Lc=ai();Object.defineProperty(w,"CancellationTokenSource",{enumerable:!0,get:function(){return Lc.CancellationTokenSource}});Object.defineProperty(w,"CancellationToken",{enumerable:!0,get:function(){return Lc.CancellationToken}});var $c=Rc();Object.defineProperty(w,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return $c.SharedArraySenderStrategy}});Object.defineProperty(w,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return $c.SharedArrayReceiverStrategy}});var _o=Sc();Object.defineProperty(w,"MessageReader",{enumerable:!0,get:function(){return _o.MessageReader}});Object.defineProperty(w,"AbstractMessageReader",{enumerable:!0,get:function(){return _o.AbstractMessageReader}});Object.defineProperty(w,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return _o.ReadableStreamMessageReader}});var bo=Ec();Object.defineProperty(w,"MessageWriter",{enumerable:!0,get:function(){return bo.MessageWriter}});Object.defineProperty(w,"AbstractMessageWriter",{enumerable:!0,get:function(){return bo.AbstractMessageWriter}});Object.defineProperty(w,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return bo.WriteableStreamMessageWriter}});var gh=Oc();Object.defineProperty(w,"AbstractMessageBuffer",{enumerable:!0,get:function(){return gh.AbstractMessageBuffer}});var Ne=Ic();Object.defineProperty(w,"ConnectionStrategy",{enumerable:!0,get:function(){return Ne.ConnectionStrategy}});Object.defineProperty(w,"ConnectionOptions",{enumerable:!0,get:function(){return Ne.ConnectionOptions}});Object.defineProperty(w,"NullLogger",{enumerable:!0,get:function(){return Ne.NullLogger}});Object.defineProperty(w,"createMessageConnection",{enumerable:!0,get:function(){return Ne.createMessageConnection}});Object.defineProperty(w,"ProgressToken",{enumerable:!0,get:function(){return Ne.ProgressToken}});Object.defineProperty(w,"ProgressType",{enumerable:!0,get:function(){return Ne.ProgressType}});Object.defineProperty(w,"Trace",{enumerable:!0,get:function(){return Ne.Trace}});Object.defineProperty(w,"TraceValues",{enumerable:!0,get:function(){return Ne.TraceValues}});Object.defineProperty(w,"TraceFormat",{enumerable:!0,get:function(){return Ne.TraceFormat}});Object.defineProperty(w,"SetTraceNotification",{enumerable:!0,get:function(){return Ne.SetTraceNotification}});Object.defineProperty(w,"LogTraceNotification",{enumerable:!0,get:function(){return Ne.LogTraceNotification}});Object.defineProperty(w,"ConnectionErrors",{enumerable:!0,get:function(){return Ne.ConnectionErrors}});Object.defineProperty(w,"ConnectionError",{enumerable:!0,get:function(){return Ne.ConnectionError}});Object.defineProperty(w,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ne.CancellationReceiverStrategy}});Object.defineProperty(w,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ne.CancellationSenderStrategy}});Object.defineProperty(w,"CancellationStrategy",{enumerable:!0,get:function(){return Ne.CancellationStrategy}});Object.defineProperty(w,"MessageStrategy",{enumerable:!0,get:function(){return Ne.MessageStrategy}});var yh=Gt();w.RAL=yh.default});var Vc=N(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});var Fc=require("util"),Mt=vi(),_i=class t extends Mt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new Fc.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};_i.emptyBuffer=Buffer.allocUnsafe(0);var wo=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mt.Disposable.create(()=>this.stream.off("data",e))}},To=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=d=>{d==null?n():i(d)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},Wc=Object.freeze({messageBuffer:Object.freeze({create:t=>new _i(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new Fc.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new wo(t),asWritableStream:t=>new To(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Ro(){return Wc}(function(t){function e(){Mt.RAL.install(Wc)}t.install=e})(Ro||(Ro={}));ko.default=Ro});var Do=N(ie=>{"use strict";var vh=ie&&ie.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_h=ie&&ie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vh(e,t,r)};Object.defineProperty(ie,"__esModule",{value:!0});ie.createMessageConnection=ie.createServerSocketTransport=ie.createClientSocketTransport=ie.createServerPipeTransport=ie.createClientPipeTransport=ie.generateRandomPipeName=ie.StreamMessageWriter=ie.StreamMessageReader=ie.SocketMessageWriter=ie.SocketMessageReader=ie.PortMessageWriter=ie.PortMessageReader=ie.IPCMessageWriter=ie.IPCMessageReader=void 0;var an=Vc();an.default.install();var zc=require("path"),bh=require("os"),wh=require("crypto"),Ti=require("net"),rt=vi();_h(vi(),ie);var So=class extends rt.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),rt.Disposable.create(()=>this.process.off("message",e))}};ie.IPCMessageReader=So;var Co=class extends rt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ie.IPCMessageWriter=Co;var Po=class extends rt.AbstractMessageReader{constructor(e){super(),this.onData=new rt.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};ie.PortMessageReader=Po;var xo=class extends rt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ie.PortMessageWriter=xo;var fr=class extends rt.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,an.default)().stream.asReadableStream(e),r)}};ie.SocketMessageReader=fr;var hr=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ie.SocketMessageWriter=hr;var bi=class extends rt.ReadableStreamMessageReader{constructor(e,r){super((0,an.default)().stream.asReadableStream(e),r)}};ie.StreamMessageReader=bi;var wi=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r)}};ie.StreamMessageWriter=wi;var Uc=process.env.XDG_RUNTIME_DIR,Th=new Map([["linux",107],["darwin",103]]);function Rh(){let t=(0,wh.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Uc?e=zc.join(Uc,`vscode-ipc-${t}.sock`):e=zc.join(bh.tmpdir(),`vscode-${t}.sock`);let r=Th.get(process.platform);return r!==void 0&&e.length>r&&(0,an.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}ie.generateRandomPipeName=Rh;function kh(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ti.createServer)(p=>{d.close(),r([new fr(p,e),new hr(p,e)])});d.on("error",s),d.listen(t,()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}ie.createClientPipeTransport=kh;function Sh(t,e="utf-8"){let r=(0,Ti.createConnection)(t);return[new fr(r,e),new hr(r,e)]}ie.createServerPipeTransport=Sh;function Ch(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ti.createServer)(p=>{d.close(),r([new fr(p,e),new hr(p,e)])});d.on("error",s),d.listen(t,"127.0.0.1",()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}ie.createClientSocketTransport=Ch;function Ph(t,e="utf-8"){let r=(0,Ti.createConnection)(t,"127.0.0.1");return[new fr(r,e),new hr(r,e)]}ie.createServerSocketTransport=Ph;function xh(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function Dh(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function Eh(t,e,r,n){r||(r=rt.NullLogger);let i=xh(t)?new bi(t):t,s=Dh(e)?new wi(e):e;return rt.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,rt.createMessageConnection)(i,s,r,n)}ie.createMessageConnection=Eh});var Hc=N((Rg,Bc)=>{"use strict";Bc.exports=Do()});var cn=N(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.stringArray=We.array=We.func=We.error=We.number=We.string=We.boolean=void 0;function Oh(t){return t===!0||t===!1}We.boolean=Oh;function Zc(t){return typeof t=="string"||t instanceof String}We.string=Zc;function Nh(t){return typeof t=="number"||t instanceof Number}We.number=Nh;function Mh(t){return t instanceof Error}We.error=Mh;function jh(t){return typeof t=="function"}We.func=jh;function Jc(t){return Array.isArray(t)}We.array=Jc;function qh(t){return Jc(t)&&t.every(e=>Zc(e))}We.stringArray=qh});var ea=N(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.Message=A.NotificationType9=A.NotificationType8=A.NotificationType7=A.NotificationType6=A.NotificationType5=A.NotificationType4=A.NotificationType3=A.NotificationType2=A.NotificationType1=A.NotificationType0=A.NotificationType=A.RequestType9=A.RequestType8=A.RequestType7=A.RequestType6=A.RequestType5=A.RequestType4=A.RequestType3=A.RequestType2=A.RequestType1=A.RequestType=A.RequestType0=A.AbstractMessageSignature=A.ParameterStructures=A.ResponseError=A.ErrorCodes=void 0;var pr=cn(),Eo;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Eo||(A.ErrorCodes=Eo={}));var Oo=class t extends Error{constructor(e,r,n){super(r),this.code=pr.number(e)?e:Eo.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};A.ResponseError=Oo;var Je=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};A.ParameterStructures=Je;Je.auto=new Je("auto");Je.byPosition=new Je("byPosition");Je.byName=new Je("byName");var _e=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Je.auto}};A.AbstractMessageSignature=_e;var No=class extends _e{constructor(e){super(e,0)}};A.RequestType0=No;var Mo=class extends _e{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType=Mo;var jo=class extends _e{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType1=jo;var qo=class extends _e{constructor(e){super(e,2)}};A.RequestType2=qo;var Io=class extends _e{constructor(e){super(e,3)}};A.RequestType3=Io;var Ao=class extends _e{constructor(e){super(e,4)}};A.RequestType4=Ao;var Lo=class extends _e{constructor(e){super(e,5)}};A.RequestType5=Lo;var $o=class extends _e{constructor(e){super(e,6)}};A.RequestType6=$o;var Fo=class extends _e{constructor(e){super(e,7)}};A.RequestType7=Fo;var Wo=class extends _e{constructor(e){super(e,8)}};A.RequestType8=Wo;var Vo=class extends _e{constructor(e){super(e,9)}};A.RequestType9=Vo;var zo=class extends _e{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType=zo;var Uo=class extends _e{constructor(e){super(e,0)}};A.NotificationType0=Uo;var Bo=class extends _e{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType1=Bo;var Ho=class extends _e{constructor(e){super(e,2)}};A.NotificationType2=Ho;var Zo=class extends _e{constructor(e){super(e,3)}};A.NotificationType3=Zo;var Jo=class extends _e{constructor(e){super(e,4)}};A.NotificationType4=Jo;var Go=class extends _e{constructor(e){super(e,5)}};A.NotificationType5=Go;var Qo=class extends _e{constructor(e){super(e,6)}};A.NotificationType6=Qo;var Xo=class extends _e{constructor(e){super(e,7)}};A.NotificationType7=Xo;var Yo=class extends _e{constructor(e){super(e,8)}};A.NotificationType8=Yo;var Ko=class extends _e{constructor(e){super(e,9)}};A.NotificationType9=Ko;var Gc;(function(t){function e(i){let s=i;return s&&pr.string(s.method)&&(pr.string(s.id)||pr.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&pr.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(pr.string(s.id)||pr.number(s.id)||s.id===null)}t.isResponse=n})(Gc||(A.Message=Gc={}))});var ra=N(Yt=>{"use strict";var Qc;Object.defineProperty(Yt,"__esModule",{value:!0});Yt.LRUCache=Yt.LinkedMap=Yt.Touch=void 0;var Ve;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ve||(Yt.Touch=Ve={}));var Ri=class{constructor(){this[Qc]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Ve.None){let n=this._map.get(e);if(n)return r!==Ve.None&&this.touch(n,r),n.value}set(e,r,n=Ve.None){let i=this._map.get(e);if(i)i.value=r,n!==Ve.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Ve.None:this.addItemLast(i);break;case Ve.First:this.addItemFirst(i);break;case Ve.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(Qc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Ve.First&&r!==Ve.Last)){if(r===Ve.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Ve.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Yt.LinkedMap=Ri;var ta=class extends Ri{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Ve.AsNew){return super.get(e,r)}peek(e){return super.get(e,Ve.None)}set(e,r){return super.set(e,r,Ve.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yt.LRUCache=ta});var Yc=N(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.Disposable=void 0;var Xc;(function(t){function e(r){return{dispose:r}}t.create=e})(Xc||(ki.Disposable=Xc={}))});var Kt=N(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var na;function ia(){if(na===void 0)throw new Error("No runtime abstraction layer installed");return na}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");na=r}t.install=e})(ia||(ia={}));sa.default=ia});var dn=N(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.Emitter=un.Event=void 0;var Ih=Kt(),Kc;(function(t){let e={dispose(){}};t.None=function(){return e}})(Kc||(un.Event=Kc={}));var oa=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,d=n.length;s<d;s++)try{r.push(n[s].apply(i[s],e))}catch(p){(0,Ih.default)().console.error(p)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Si=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new oa),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};un.Emitter=Si;Si._noop=function(){}});var xi=N(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.CancellationTokenSource=ln.CancellationToken=void 0;var Ah=Kt(),Lh=cn(),aa=dn(),Ci;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:aa.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:aa.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||Lh.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Ci||(ln.CancellationToken=Ci={}));var $h=Object.freeze(function(t,e){let r=(0,Ah.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Pi=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?$h:(this._emitter||(this._emitter=new aa.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},ca=class{get token(){return this._token||(this._token=new Pi),this._token}cancel(){this._token?this._token.cancel():this._token=Ci.Cancelled}dispose(){this._token?this._token instanceof Pi&&this._token.dispose():this._token=Ci.None}};ln.CancellationTokenSource=ca});var eu=N(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.SharedArrayReceiverStrategy=fn.SharedArraySenderStrategy=void 0;var Fh=xi(),Vn;(function(t){t.Continue=0,t.Cancelled=1})(Vn||(Vn={}));var ua=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Vn.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,Vn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};fn.SharedArraySenderStrategy=ua;var da=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Vn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},la=class{constructor(e){this.token=new da(e)}cancel(){}dispose(){}},fa=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Fh.CancellationTokenSource:new la(r)}};fn.SharedArrayReceiverStrategy=fa});var pa=N(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.Semaphore=void 0;var Wh=Kt(),ha=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Wh.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Di.Semaphore=ha});var ru=N(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.ReadableStreamMessageReader=er.AbstractMessageReader=er.MessageReader=void 0;var ga=Kt(),hn=cn(),ma=dn(),Vh=pa(),tu;(function(t){function e(r){let n=r;return n&&hn.func(n.listen)&&hn.func(n.dispose)&&hn.func(n.onError)&&hn.func(n.onClose)&&hn.func(n.onPartialMessage)}t.is=e})(tu||(er.MessageReader=tu={}));var Ei=class{constructor(){this.errorEmitter=new ma.Emitter,this.closeEmitter=new ma.Emitter,this.partialMessageEmitter=new ma.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${hn.string(e.message)?e.message:"unknown"}`)}};er.AbstractMessageReader=Ei;var ya;(function(t){function e(r){let n,i,s,d=new Map,p,R=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,d.set(s.name,s)),r.contentDecoders!==void 0)for(let _ of r.contentDecoders)d.set(_.name,_);if(r.contentTypeDecoder!==void 0&&(p=r.contentTypeDecoder,R.set(p.name,p)),r.contentTypeDecoders!==void 0)for(let _ of r.contentTypeDecoders)R.set(_.name,_)}return p===void 0&&(p=(0,ga.default)().applicationJson.decoder,R.set(p.name,p)),{charset:n,contentDecoder:s,contentDecoders:d,contentTypeDecoder:p,contentTypeDecoders:R}}t.fromOptions=e})(ya||(ya={}));var va=class extends Ei{constructor(e,r){super(),this.readable=e,this.options=ya.fromOptions(r),this.buffer=(0,ga.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Vh.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
33
+ ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ga.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};er.ReadableStreamMessageReader=va});var au=N(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.WriteableStreamMessageWriter=tr.AbstractMessageWriter=tr.MessageWriter=void 0;var nu=Kt(),zn=cn(),zh=pa(),iu=dn(),Uh="Content-Length: ",su=`\r
34
+ `,ou;(function(t){function e(r){let n=r;return n&&zn.func(n.dispose)&&zn.func(n.onClose)&&zn.func(n.onError)&&zn.func(n.write)}t.is=e})(ou||(tr.MessageWriter=ou={}));var Oi=class{constructor(){this.errorEmitter=new iu.Emitter,this.closeEmitter=new iu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${zn.string(e.message)?e.message:"unknown"}`)}};tr.AbstractMessageWriter=Oi;var _a;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,nu.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,nu.default)().applicationJson.encoder}}t.fromOptions=e})(_a||(_a={}));var ba=class extends Oi{constructor(e,r){super(),this.writable=e,this.options=_a.fromOptions(r),this.errorCount=0,this.writeSemaphore=new zh.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(Uh,n.byteLength.toString(),su),i.push(su),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};tr.WriteableStreamMessageWriter=ba});var cu=N(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.AbstractMessageBuffer=void 0;var Bh=13,Hh=10,Zh=`\r
35
+ `,wa=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let _=this._chunks[n];for(i=0;i<_.length;){switch(_[i]){case Bh:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case Hh:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=_.byteLength,n++}if(r!==4)return;let d=this._read(s+i),p=new Map,R=this.toString(d,"ascii").split(Zh);if(R.length<2)return p;for(let _=0;_<R.length-2;_++){let E=R[_],Z=E.indexOf(":");if(Z===-1)throw new Error(`Message header must separate key and value using ':'
36
+ ${E}`);let de=E.substr(0,Z),te=E.substr(Z+1).trim();p.set(e?de.toLowerCase():de,te)}return p}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],d=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,d}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let d=s.slice(0,e);r.set(d,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};Ni.AbstractMessageBuffer=wa});var hu=N(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.createMessageConnection=X.ConnectionOptions=X.MessageStrategy=X.CancellationStrategy=X.CancellationSenderStrategy=X.CancellationReceiverStrategy=X.RequestCancellationReceiverStrategy=X.IdCancellationReceiverStrategy=X.ConnectionStrategy=X.ConnectionError=X.ConnectionErrors=X.LogTraceNotification=X.SetTraceNotification=X.TraceFormat=X.TraceValues=X.Trace=X.NullLogger=X.ProgressType=X.ProgressToken=void 0;var uu=Kt(),ke=cn(),z=ea(),du=ra(),Un=dn(),Ta=xi(),Zn;(function(t){t.type=new z.NotificationType("$/cancelRequest")})(Zn||(Zn={}));var Ra;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Ra||(X.ProgressToken=Ra={}));var Bn;(function(t){t.type=new z.NotificationType("$/progress")})(Bn||(Bn={}));var ka=class{constructor(){}};X.ProgressType=ka;var Sa;(function(t){function e(r){return ke.func(r)}t.is=e})(Sa||(Sa={}));X.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ue;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ue||(X.Trace=ue={}));var lu;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(lu||(X.TraceValues=lu={}));(function(t){function e(n){if(!ke.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ue||(X.Trace=ue={}));var nt;(function(t){t.Text="text",t.JSON="json"})(nt||(X.TraceFormat=nt={}));(function(t){function e(r){return ke.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(nt||(X.TraceFormat=nt={}));var Ca;(function(t){t.type=new z.NotificationType("$/setTrace")})(Ca||(X.SetTraceNotification=Ca={}));var Mi;(function(t){t.type=new z.NotificationType("$/logTrace")})(Mi||(X.LogTraceNotification=Mi={}));var Hn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Hn||(X.ConnectionErrors=Hn={}));var pn=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};X.ConnectionError=pn;var Pa;(function(t){function e(r){let n=r;return n&&ke.func(n.cancelUndispatched)}t.is=e})(Pa||(X.ConnectionStrategy=Pa={}));var ji;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(ji||(X.IdCancellationReceiverStrategy=ji={}));var xa;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(xa||(X.RequestCancellationReceiverStrategy=xa={}));var qi;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Ta.CancellationTokenSource}});function e(r){return ji.is(r)||xa.is(r)}t.is=e})(qi||(X.CancellationReceiverStrategy=qi={}));var Ii;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Zn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&ke.func(n.sendCancellation)&&ke.func(n.cleanup)}t.is=e})(Ii||(X.CancellationSenderStrategy=Ii={}));var Ai;(function(t){t.Message=Object.freeze({receiver:qi.Message,sender:Ii.Message});function e(r){let n=r;return n&&qi.is(n.receiver)&&Ii.is(n.sender)}t.is=e})(Ai||(X.CancellationStrategy=Ai={}));var Li;(function(t){function e(r){let n=r;return n&&ke.func(n.handleMessage)}t.is=e})(Li||(X.MessageStrategy=Li={}));var fu;(function(t){function e(r){let n=r;return n&&(Ai.is(n.cancellationStrategy)||Pa.is(n.connectionStrategy)||Li.is(n.messageStrategy))}t.is=e})(fu||(X.ConnectionOptions=fu={}));var gt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(gt||(gt={}));function Jh(t,e,r,n){let i=r!==void 0?r:X.NullLogger,s=0,d=0,p=0,R="2.0",_,E=new Map,Z,de=new Map,te=new Map,Be,he=new du.LinkedMap,fe=new Map,Oe=new Set,ye=new Map,M=ue.Off,J=nt.Text,L,le=gt.New,ae=new Un.Emitter,De=new Un.Emitter,_t=new Un.Emitter,lt=new Un.Emitter,ft=new Un.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:Ai.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++p).toString():"res-"+o.toString()}function Ir(){return"not-"+(++d).toString()}function qn(o,f){z.Message.isRequest(f)?o.set(Dt(f.id),f):z.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return le===gt.Listening}function bt(){return le===gt.Closed}function qe(){return le===gt.Disposed}function Et(){(le===gt.New||le===gt.Listening)&&(le=gt.Closed,De.fire(void 0))}function Ot(o){ae.fire([o,void 0,void 0])}function Lr(o){ae.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){Be||he.size===0||(Be=(0,uu.default)().timer.setImmediate(()=>{Be=void 0,$r()}))}function zt(o){z.Message.isRequest(o)?Wr(o):z.Message.isNotification(o)?zr(o):z.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(he.size===0)return;let o=he.shift();try{let f=n?.messageStrategy;Li.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(z.Message.isNotification(o)&&o.method===Zn.type.method){let f=o.params.id,g=Dt(f),b=he.get(g);if(z.Message.isRequest(b)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(b,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){he.delete(g),ye.delete(f),B.id=b.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let $=ye.get(f);if($!==void 0){$.cancel(),wt(o);return}else Oe.add(f)}qn(he,o)}finally{Vt()}};function Wr(o){if(qe())return;function f(x,F,O){let Y={jsonrpc:R,id:o.id};x instanceof z.ResponseError?Y.error=x.toJson():Y.result=x===void 0?null:x,st(Y,F,O),e.write(Y).catch(()=>i.error("Sending response failed."))}function g(x,F,O){let Y={jsonrpc:R,id:o.id,error:x.toJson()};st(Y,F,O),e.write(Y).catch(()=>i.error("Sending response failed."))}function b(x,F,O){x===void 0&&(x=null);let Y={jsonrpc:R,id:o.id,result:x};st(Y,F,O),e.write(Y).catch(()=>i.error("Sending response failed."))}Hr(o);let $=E.get(o.method),q,B;$&&(q=$.type,B=$.handler);let H=Date.now();if(B||_){let x=o.id??String(Date.now()),F=ji.is(Te.receiver)?Te.receiver.createCancellationTokenSource(x):Te.receiver.createCancellationTokenSource(o);o.id!==null&&Oe.has(o.id)&&F.cancel(),o.id!==null&&ye.set(x,F);try{let O;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}O=B(F.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byName){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}O=B(...o.params,F.token)}else{if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byPosition){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}O=B(o.params,F.token)}else _&&(O=_(o.method,o.params,F.token));let Y=O;O?Y.then?Y.then(oe=>{ye.delete(x),f(oe,o.method,H)},oe=>{ye.delete(x),oe instanceof z.ResponseError?g(oe,o.method,H):oe&&ke.string(oe.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${oe.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(ye.delete(x),f(O,o.method,H)):(ye.delete(x),b(O,o.method,H))}catch(O){ye.delete(x),O instanceof z.ResponseError?f(O,o.method,H):O&&ke.string(O.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${O.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new z.ResponseError(z.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!qe())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
37
+ ${JSON.stringify(o.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let f=o.id,g=fe.get(f);if(Zr(o,g),g!==void 0){fe.delete(f);try{if(o.error){let b=o.error;g.reject(new z.ResponseError(b.code,b.message,b.data))}else if(o.result!==void 0)g.resolve(o.result);else throw new Error("Should never happen.")}catch(b){b.message?i.error(`Response handler '${g.method}' failed with message: ${b.message}`):i.error(`Response handler '${g.method}' failed unexpectedly.`)}}}}function zr(o){if(qe())return;let f,g;if(o.method===Zn.type.method){let b=o.params.id;Oe.delete(b),wt(o);return}else{let b=de.get(o.method);b&&(g=b.handler,f=b.type)}if(g||Z)try{if(wt(o),g)if(o.params===void 0)f!==void 0&&f.numberOfParams!==0&&f.parameterStructures!==z.ParameterStructures.byName&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received none.`),g();else if(Array.isArray(o.params)){let b=o.params;o.method===Bn.type.method&&b.length===2&&Ra.is(b[0])?g({token:b[0],value:b[1]}):(f!==void 0&&(f.parameterStructures===z.ParameterStructures.byName&&i.error(`Notification ${o.method} defines parameters by name but received parameters by position`),f.numberOfParams!==o.params.length&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received ${b.length} arguments`)),g(...b))}else f!==void 0&&f.parameterStructures===z.ParameterStructures.byPosition&&i.error(`Notification ${o.method} defines parameters by position but received parameters by name`),g(o.params);else Z&&Z(o.method,o.params)}catch(b){b.message?i.error(`Notification handler '${o.method}' failed with message: ${b.message}`):i.error(`Notification handler '${o.method}' failed unexpectedly.`)}else _t.fire(o)}function Ut(o){if(!o){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
38
+ ${JSON.stringify(o,null,4)}`);let f=o;if(ke.string(f.id)||ke.number(f.id)){let g=f.id,b=fe.get(g);b&&b.reject(new Error("The received response has neither a result nor an error property."))}}function Pe(o){if(o!=null)switch(M){case ue.Verbose:return JSON.stringify(o,null,4);case ue.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(M===ue.Off||!L))if(J===nt.Text){let f;(M===ue.Verbose||M===ue.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
39
39
 
40
- `),W.log(`Sending request '${o.method} - (${o.id})'.`,f)}else je("send-request",o)}function Br(o){if(!(O===ce.Off||!W))if(fe===nt.Text){let f;(O===ce.Verbose||O===ce.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
40
+ `),L.log(`Sending request '${o.method} - (${o.id})'.`,f)}else Ie("send-request",o)}function Br(o){if(!(M===ue.Off||!L))if(J===nt.Text){let f;(M===ue.Verbose||M===ue.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
41
41
 
42
42
  `:f=`No parameters provided.
43
43
 
44
- `),W.log(`Sending notification '${o.method}'.`,f)}else je("send-notification",o)}function st(o,f,g){if(!(O===ce.Off||!W))if(fe===nt.Text){let b;(O===ce.Verbose||O===ce.Compact)&&(o.error&&o.error.data?b=`Error data: ${Pe(o.error.data)}
44
+ `),L.log(`Sending notification '${o.method}'.`,f)}else Ie("send-notification",o)}function st(o,f,g){if(!(M===ue.Off||!L))if(J===nt.Text){let b;(M===ue.Verbose||M===ue.Compact)&&(o.error&&o.error.data?b=`Error data: ${Pe(o.error.data)}
45
45
 
46
46
  `:o.result?b=`Result: ${Pe(o.result)}
47
47
 
48
48
  `:o.error===void 0&&(b=`No result returned.
49
49
 
50
- `)),W.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,b)}else je("send-response",o)}function Hr(o){if(!(O===ce.Off||!W))if(fe===nt.Text){let f;(O===ce.Verbose||O===ce.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
50
+ `)),L.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,b)}else Ie("send-response",o)}function Hr(o){if(!(M===ue.Off||!L))if(J===nt.Text){let f;(M===ue.Verbose||M===ue.Compact)&&o.params&&(f=`Params: ${Pe(o.params)}
51
51
 
52
- `),W.log(`Received request '${o.method} - (${o.id})'.`,f)}else je("receive-request",o)}function wt(o){if(!(O===ce.Off||!W||o.method===qi.type.method))if(fe===nt.Text){let f;(O===ce.Verbose||O===ce.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
52
+ `),L.log(`Received request '${o.method} - (${o.id})'.`,f)}else Ie("receive-request",o)}function wt(o){if(!(M===ue.Off||!L||o.method===Mi.type.method))if(J===nt.Text){let f;(M===ue.Verbose||M===ue.Compact)&&(o.params?f=`Params: ${Pe(o.params)}
53
53
 
54
54
  `:f=`No parameters provided.
55
55
 
56
- `),W.log(`Received notification '${o.method}'.`,f)}else je("receive-notification",o)}function Zr(o,f){if(!(O===ce.Off||!W))if(fe===nt.Text){let g;if((O===ce.Verbose||O===ce.Compact)&&(o.error&&o.error.data?g=`Error data: ${Pe(o.error.data)}
56
+ `),L.log(`Received notification '${o.method}'.`,f)}else Ie("receive-notification",o)}function Zr(o,f){if(!(M===ue.Off||!L))if(J===nt.Text){let g;if((M===ue.Verbose||M===ue.Compact)&&(o.error&&o.error.data?g=`Error data: ${Pe(o.error.data)}
57
57
 
58
58
  `:o.result?g=`Result: ${Pe(o.result)}
59
59
 
60
60
  `:o.error===void 0&&(g=`No result returned.
61
61
 
62
- `)),f){let b=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";W.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${b}`,g)}else W.log(`Received response ${o.id} without active response promise.`,g)}else je("receive-response",o)}function je(o,f){if(!W||O===ce.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};W.log(g)}function He(){if(bt())throw new pn(Zn.Closed,"Connection is closed.");if(Me())throw new pn(Zn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new pn(Zn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function qe(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case z.ParameterStructures.auto:return Ht(f)?Bt(f):[qe(f)];case z.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case z.ParameterStructures.byPosition:return[qe(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,b=o.numberOfParams;switch(b){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let L=0;L<f.length&&L<b;L++)g.push(qe(f[L]));if(f.length<b)for(let L=f.length;L<b;L++)g.push(null);break}return g}let Ie={sendNotification:(o,...f)=>{He();let g,b;if(ke.string(o)){g=o;let q=f[0],B=0,H=z.ParameterStructures.auto;z.ParameterStructures.is(q)&&(B=1,H=q);let x=f.length,$=x-B;switch($){case 0:b=void 0;break;case 1:b=Tt(H,f[B]);break;default:if(H===z.ParameterStructures.byName)throw new Error(`Received ${$} parameters for 'by Name' notification parameter structure.`);b=f.slice(B,x).map(N=>qe(N));break}}else{let q=f;g=o.method,b=Zt(o,q)}let L={jsonrpc:R,method:g,params:b};return Br(L),e.write(L).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return ke.func(o)?Z=o:f&&(ke.string(o)?(g=o,ue.set(o,{type:void 0,handler:f})):(g=o.method,ue.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?ue.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(ee.has(f))throw new Error(`Progress handler for token ${f} already registered`);return ee.set(f,g),{dispose:()=>{ee.delete(f)}}},sendProgress:(o,f,g)=>Ie.sendNotification(Hn.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,b,L;if(ke.string(o)){g=o;let x=f[0],$=f[f.length-1],N=0,X=z.ParameterStructures.auto;z.ParameterStructures.is(x)&&(N=1,X=x);let se=f.length;ka.CancellationToken.is($)&&(se=se-1,L=$);let be=se-N;switch(be){case 0:b=void 0;break;case 1:b=Tt(X,f[N]);break;default:if(X===z.ParameterStructures.byName)throw new Error(`Received ${be} parameters for 'by Name' request parameter structure.`);b=f.slice(N,se).map(Qr=>qe(Qr));break}}else{let x=f;g=o.method,b=Zt(o,x);let $=o.numberOfParams;L=ka.CancellationToken.is(x[$])?x[$]:void 0}let q=s++,B;L&&(B=L.onCancellationRequested(()=>{let x=Te.sender.sendCancellation(Ie,q);return x===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):x.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:b};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(x,$)=>{let N=be=>{x(be),Te.sender.cleanup(q),B?.dispose()},X=be=>{$(be),Te.sender.cleanup(q),B?.dispose()},se={method:g,timerStart:Date.now(),resolve:N,reject:X};try{await e.write(H),de.set(q,se)}catch(be){throw i.error("Sending request failed."),se.reject(new z.ResponseError(z.ErrorCodes.MessageWriteError,be.message?be.message:"Unknown reason")),be}})},onRequest:(o,f)=>{He();let g=null;return Pa.is(o)?(g=void 0,_=o):ke.string(o)?(g=null,f!==void 0&&(g=o,E.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,E.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?E.delete(g):_=void 0)}}},hasPendingResponse:()=>de.size>0,trace:async(o,f,g)=>{let b=!1,L=nt.Text;g!==void 0&&(ke.boolean(g)?b=g:(b=g.sendNotification||!1,L=g.traceFormat||nt.Text)),O=o,fe=L,O===ce.Off?W=void 0:W=f,b&&!bt()&&!Me()&&await Ie.sendNotification(xa.type,{value:ce.toString(o)})},onError:_e.event,onClose:Be.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(Me())return;ve=gt.Disposed,ft.fire(void 0);let o=new z.ResponseError(z.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of de.values())f.reject(o);de=new Map,oe=new Map,Ue=new Set,le=new fu.LinkedMap,ke.func(e.dispose)&&e.dispose(),ke.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),ve=gt.Listening,t.listen(Fr)},inspect:()=>{(0,lu.default)().console.log("inspect")}};return Ie.onNotification(qi.type,o=>{if(O===ce.Off||!W)return;let f=O===ce.Verbose||O===ce.Compact;W.log(o.message,f?o.verbose:void 0)}),Ie.onNotification(Hn.type,o=>{let f=ee.get(o.token);f?f(o.value):lt.fire(o)}),Ie}Q.createMessageConnection=Gh});var Wi=M(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.ProgressType=T.ProgressToken=T.createMessageConnection=T.NullLogger=T.ConnectionOptions=T.ConnectionStrategy=T.AbstractMessageBuffer=T.WriteableStreamMessageWriter=T.AbstractMessageWriter=T.MessageWriter=T.ReadableStreamMessageReader=T.AbstractMessageReader=T.MessageReader=T.SharedArrayReceiverStrategy=T.SharedArraySenderStrategy=T.CancellationToken=T.CancellationTokenSource=T.Emitter=T.Event=T.Disposable=T.LRUCache=T.Touch=T.LinkedMap=T.ParameterStructures=T.NotificationType9=T.NotificationType8=T.NotificationType7=T.NotificationType6=T.NotificationType5=T.NotificationType4=T.NotificationType3=T.NotificationType2=T.NotificationType1=T.NotificationType0=T.NotificationType=T.ErrorCodes=T.ResponseError=T.RequestType9=T.RequestType8=T.RequestType7=T.RequestType6=T.RequestType5=T.RequestType4=T.RequestType3=T.RequestType2=T.RequestType1=T.RequestType0=T.RequestType=T.Message=T.RAL=void 0;T.MessageStrategy=T.CancellationStrategy=T.CancellationSenderStrategy=T.CancellationReceiverStrategy=T.ConnectionError=T.ConnectionErrors=T.LogTraceNotification=T.SetTraceNotification=T.TraceFormat=T.TraceValues=T.Trace=void 0;var me=ra();Object.defineProperty(T,"Message",{enumerable:!0,get:function(){return me.Message}});Object.defineProperty(T,"RequestType",{enumerable:!0,get:function(){return me.RequestType}});Object.defineProperty(T,"RequestType0",{enumerable:!0,get:function(){return me.RequestType0}});Object.defineProperty(T,"RequestType1",{enumerable:!0,get:function(){return me.RequestType1}});Object.defineProperty(T,"RequestType2",{enumerable:!0,get:function(){return me.RequestType2}});Object.defineProperty(T,"RequestType3",{enumerable:!0,get:function(){return me.RequestType3}});Object.defineProperty(T,"RequestType4",{enumerable:!0,get:function(){return me.RequestType4}});Object.defineProperty(T,"RequestType5",{enumerable:!0,get:function(){return me.RequestType5}});Object.defineProperty(T,"RequestType6",{enumerable:!0,get:function(){return me.RequestType6}});Object.defineProperty(T,"RequestType7",{enumerable:!0,get:function(){return me.RequestType7}});Object.defineProperty(T,"RequestType8",{enumerable:!0,get:function(){return me.RequestType8}});Object.defineProperty(T,"RequestType9",{enumerable:!0,get:function(){return me.RequestType9}});Object.defineProperty(T,"ResponseError",{enumerable:!0,get:function(){return me.ResponseError}});Object.defineProperty(T,"ErrorCodes",{enumerable:!0,get:function(){return me.ErrorCodes}});Object.defineProperty(T,"NotificationType",{enumerable:!0,get:function(){return me.NotificationType}});Object.defineProperty(T,"NotificationType0",{enumerable:!0,get:function(){return me.NotificationType0}});Object.defineProperty(T,"NotificationType1",{enumerable:!0,get:function(){return me.NotificationType1}});Object.defineProperty(T,"NotificationType2",{enumerable:!0,get:function(){return me.NotificationType2}});Object.defineProperty(T,"NotificationType3",{enumerable:!0,get:function(){return me.NotificationType3}});Object.defineProperty(T,"NotificationType4",{enumerable:!0,get:function(){return me.NotificationType4}});Object.defineProperty(T,"NotificationType5",{enumerable:!0,get:function(){return me.NotificationType5}});Object.defineProperty(T,"NotificationType6",{enumerable:!0,get:function(){return me.NotificationType6}});Object.defineProperty(T,"NotificationType7",{enumerable:!0,get:function(){return me.NotificationType7}});Object.defineProperty(T,"NotificationType8",{enumerable:!0,get:function(){return me.NotificationType8}});Object.defineProperty(T,"NotificationType9",{enumerable:!0,get:function(){return me.NotificationType9}});Object.defineProperty(T,"ParameterStructures",{enumerable:!0,get:function(){return me.ParameterStructures}});var Oa=ia();Object.defineProperty(T,"LinkedMap",{enumerable:!0,get:function(){return Oa.LinkedMap}});Object.defineProperty(T,"LRUCache",{enumerable:!0,get:function(){return Oa.LRUCache}});Object.defineProperty(T,"Touch",{enumerable:!0,get:function(){return Oa.Touch}});var Qh=eu();Object.defineProperty(T,"Disposable",{enumerable:!0,get:function(){return Qh.Disposable}});var gu=dn();Object.defineProperty(T,"Event",{enumerable:!0,get:function(){return gu.Event}});Object.defineProperty(T,"Emitter",{enumerable:!0,get:function(){return gu.Emitter}});var yu=Ei();Object.defineProperty(T,"CancellationTokenSource",{enumerable:!0,get:function(){return yu.CancellationTokenSource}});Object.defineProperty(T,"CancellationToken",{enumerable:!0,get:function(){return yu.CancellationToken}});var vu=ru();Object.defineProperty(T,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return vu.SharedArraySenderStrategy}});Object.defineProperty(T,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return vu.SharedArrayReceiverStrategy}});var Na=iu();Object.defineProperty(T,"MessageReader",{enumerable:!0,get:function(){return Na.MessageReader}});Object.defineProperty(T,"AbstractMessageReader",{enumerable:!0,get:function(){return Na.AbstractMessageReader}});Object.defineProperty(T,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Na.ReadableStreamMessageReader}});var Ma=uu();Object.defineProperty(T,"MessageWriter",{enumerable:!0,get:function(){return Ma.MessageWriter}});Object.defineProperty(T,"AbstractMessageWriter",{enumerable:!0,get:function(){return Ma.AbstractMessageWriter}});Object.defineProperty(T,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Ma.WriteableStreamMessageWriter}});var Xh=du();Object.defineProperty(T,"AbstractMessageBuffer",{enumerable:!0,get:function(){return Xh.AbstractMessageBuffer}});var Oe=mu();Object.defineProperty(T,"ConnectionStrategy",{enumerable:!0,get:function(){return Oe.ConnectionStrategy}});Object.defineProperty(T,"ConnectionOptions",{enumerable:!0,get:function(){return Oe.ConnectionOptions}});Object.defineProperty(T,"NullLogger",{enumerable:!0,get:function(){return Oe.NullLogger}});Object.defineProperty(T,"createMessageConnection",{enumerable:!0,get:function(){return Oe.createMessageConnection}});Object.defineProperty(T,"ProgressToken",{enumerable:!0,get:function(){return Oe.ProgressToken}});Object.defineProperty(T,"ProgressType",{enumerable:!0,get:function(){return Oe.ProgressType}});Object.defineProperty(T,"Trace",{enumerable:!0,get:function(){return Oe.Trace}});Object.defineProperty(T,"TraceValues",{enumerable:!0,get:function(){return Oe.TraceValues}});Object.defineProperty(T,"TraceFormat",{enumerable:!0,get:function(){return Oe.TraceFormat}});Object.defineProperty(T,"SetTraceNotification",{enumerable:!0,get:function(){return Oe.SetTraceNotification}});Object.defineProperty(T,"LogTraceNotification",{enumerable:!0,get:function(){return Oe.LogTraceNotification}});Object.defineProperty(T,"ConnectionErrors",{enumerable:!0,get:function(){return Oe.ConnectionErrors}});Object.defineProperty(T,"ConnectionError",{enumerable:!0,get:function(){return Oe.ConnectionError}});Object.defineProperty(T,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Oe.CancellationReceiverStrategy}});Object.defineProperty(T,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Oe.CancellationSenderStrategy}});Object.defineProperty(T,"CancellationStrategy",{enumerable:!0,get:function(){return Oe.CancellationStrategy}});Object.defineProperty(T,"MessageStrategy",{enumerable:!0,get:function(){return Oe.MessageStrategy}});var Yh=Kt();T.RAL=Yh.default});var wu=M(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var _u=require("util"),jt=Wi(),Vi=class t extends jt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new _u.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};Vi.emptyBuffer=Buffer.allocUnsafe(0);var ja=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),jt.Disposable.create(()=>this.stream.off("data",e))}},qa=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=l=>{l==null?n():i(l)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},bu=Object.freeze({messageBuffer:Object.freeze({create:t=>new Vi(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new _u.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new ja(t),asWritableStream:t=>new qa(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Ia(){return bu}(function(t){function e(){jt.RAL.install(bu)}t.install=e})(Ia||(Ia={}));Aa.default=Ia});var yr=M(ie=>{"use strict";var Kh=ie&&ie.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ep=ie&&ie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kh(e,t,r)};Object.defineProperty(ie,"__esModule",{value:!0});ie.createMessageConnection=ie.createServerSocketTransport=ie.createClientSocketTransport=ie.createServerPipeTransport=ie.createClientPipeTransport=ie.generateRandomPipeName=ie.StreamMessageWriter=ie.StreamMessageReader=ie.SocketMessageWriter=ie.SocketMessageReader=ie.PortMessageWriter=ie.PortMessageReader=ie.IPCMessageWriter=ie.IPCMessageReader=void 0;var mn=wu();mn.default.install();var Tu=require("path"),tp=require("os"),rp=require("crypto"),Bi=require("net"),it=Wi();ep(Wi(),ie);var La=class extends it.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),it.Disposable.create(()=>this.process.off("message",e))}};ie.IPCMessageReader=La;var $a=class extends it.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ie.IPCMessageWriter=$a;var Fa=class extends it.AbstractMessageReader{constructor(e){super(),this.onData=new it.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};ie.PortMessageReader=Fa;var Wa=class extends it.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ie.PortMessageWriter=Wa;var mr=class extends it.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,mn.default)().stream.asReadableStream(e),r)}};ie.SocketMessageReader=mr;var gr=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ie.SocketMessageWriter=gr;var zi=class extends it.ReadableStreamMessageReader{constructor(e,r){super((0,mn.default)().stream.asReadableStream(e),r)}};ie.StreamMessageReader=zi;var Ui=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r)}};ie.StreamMessageWriter=Ui;var Ru=process.env.XDG_RUNTIME_DIR,np=new Map([["linux",107],["darwin",103]]);function ip(){let t=(0,rp.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Ru?e=Tu.join(Ru,`vscode-ipc-${t}.sock`):e=Tu.join(tp.tmpdir(),`vscode-${t}.sock`);let r=np.get(process.platform);return r!==void 0&&e.length>r&&(0,mn.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}ie.generateRandomPipeName=ip;function sp(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let l=(0,Bi.createServer)(p=>{l.close(),r([new mr(p,e),new gr(p,e)])});l.on("error",s),l.listen(t,()=>{l.removeListener("error",s),i({onConnected:()=>n})})})}ie.createClientPipeTransport=sp;function op(t,e="utf-8"){let r=(0,Bi.createConnection)(t);return[new mr(r,e),new gr(r,e)]}ie.createServerPipeTransport=op;function ap(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let l=(0,Bi.createServer)(p=>{l.close(),r([new mr(p,e),new gr(p,e)])});l.on("error",s),l.listen(t,"127.0.0.1",()=>{l.removeListener("error",s),i({onConnected:()=>n})})})}ie.createClientSocketTransport=ap;function cp(t,e="utf-8"){let r=(0,Bi.createConnection)(t,"127.0.0.1");return[new mr(r,e),new gr(r,e)]}ie.createServerSocketTransport=cp;function up(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function dp(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function lp(t,e,r,n){r||(r=it.NullLogger);let i=up(t)?new zi(t):t,s=dp(e)?new Ui(e):e;return it.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,it.createMessageConnection)(i,s,r,n)}ie.createMessageConnection=lp});var Va=M((Fg,ku)=>{"use strict";ku.exports=yr()});var Zi=M((Su,Hi)=>{(function(t){if(typeof Hi=="object"&&typeof Hi.exports=="object"){var e=t(require,Su);e!==void 0&&(Hi.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(c){function h(m){return typeof m=="string"}c.is=h})(r||(e.DocumentUri=r={}));var n;(function(c){function h(m){return typeof m=="string"}c.is=h})(n||(e.URI=n={}));var i;(function(c){c.MIN_VALUE=-2147483648,c.MAX_VALUE=2147483647;function h(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=h})(i||(e.integer=i={}));var s;(function(c){c.MIN_VALUE=0,c.MAX_VALUE=2147483647;function h(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=h})(s||(e.uinteger=s={}));var l;(function(c){function h(u,a){return u===Number.MAX_VALUE&&(u=s.MAX_VALUE),a===Number.MAX_VALUE&&(a=s.MAX_VALUE),{line:u,character:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.line)&&v.uinteger(a.character)}c.is=m})(l||(e.Position=l={}));var p;(function(c){function h(u,a,y,k){if(v.uinteger(u)&&v.uinteger(a)&&v.uinteger(y)&&v.uinteger(k))return{start:l.create(u,a),end:l.create(y,k)};if(l.is(u)&&l.is(a))return{start:u,end:a};throw new Error("Range#create called with invalid arguments[".concat(u,", ").concat(a,", ").concat(y,", ").concat(k,"]"))}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&l.is(a.start)&&l.is(a.end)}c.is=m})(p||(e.Range=p={}));var R;(function(c){function h(u,a){return{uri:u,range:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.range)&&(v.string(a.uri)||v.undefined(a.uri))}c.is=m})(R||(e.Location=R={}));var _;(function(c){function h(u,a,y,k){return{targetUri:u,targetRange:a,targetSelectionRange:y,originSelectionRange:k}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.targetRange)&&v.string(a.targetUri)&&p.is(a.targetSelectionRange)&&(p.is(a.originSelectionRange)||v.undefined(a.originSelectionRange))}c.is=m})(_||(e.LocationLink=_={}));var E;(function(c){function h(u,a,y,k){return{red:u,green:a,blue:y,alpha:k}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.numberRange(a.red,0,1)&&v.numberRange(a.green,0,1)&&v.numberRange(a.blue,0,1)&&v.numberRange(a.alpha,0,1)}c.is=m})(E||(e.Color=E={}));var Z;(function(c){function h(u,a){return{range:u,color:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.range)&&E.is(a.color)}c.is=m})(Z||(e.ColorInformation=Z={}));var ue;(function(c){function h(u,a,y){return{label:u,textEdit:a,additionalTextEdits:y}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.undefined(a.textEdit)||W.is(a))&&(v.undefined(a.additionalTextEdits)||v.typedArray(a.additionalTextEdits,W.is))}c.is=m})(ue||(e.ColorPresentation=ue={}));var ee;(function(c){c.Comment="comment",c.Imports="imports",c.Region="region"})(ee||(e.FoldingRangeKind=ee={}));var ze;(function(c){function h(u,a,y,k,J,Se){var he={startLine:u,endLine:a};return v.defined(y)&&(he.startCharacter=y),v.defined(k)&&(he.endCharacter=k),v.defined(J)&&(he.kind=J),v.defined(Se)&&(he.collapsedText=Se),he}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.startLine)&&v.uinteger(a.startLine)&&(v.undefined(a.startCharacter)||v.uinteger(a.startCharacter))&&(v.undefined(a.endCharacter)||v.uinteger(a.endCharacter))&&(v.undefined(a.kind)||v.string(a.kind))}c.is=m})(ze||(e.FoldingRange=ze={}));var le;(function(c){function h(u,a){return{location:u,message:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&R.is(a.location)&&v.string(a.message)}c.is=m})(le||(e.DiagnosticRelatedInformation=le={}));var de;(function(c){c.Error=1,c.Warning=2,c.Information=3,c.Hint=4})(de||(e.DiagnosticSeverity=de={}));var Ue;(function(c){c.Unnecessary=1,c.Deprecated=2})(Ue||(e.DiagnosticTag=Ue={}));var oe;(function(c){function h(m){var u=m;return v.objectLiteral(u)&&v.string(u.href)}c.is=h})(oe||(e.CodeDescription=oe={}));var O;(function(c){function h(u,a,y,k,J,Se){var he={range:u,message:a};return v.defined(y)&&(he.severity=y),v.defined(k)&&(he.code=k),v.defined(J)&&(he.source=J),v.defined(Se)&&(he.relatedInformation=Se),he}c.create=h;function m(u){var a,y=u;return v.defined(y)&&p.is(y.range)&&v.string(y.message)&&(v.number(y.severity)||v.undefined(y.severity))&&(v.integer(y.code)||v.string(y.code)||v.undefined(y.code))&&(v.undefined(y.codeDescription)||v.string((a=y.codeDescription)===null||a===void 0?void 0:a.href))&&(v.string(y.source)||v.undefined(y.source))&&(v.undefined(y.relatedInformation)||v.typedArray(y.relatedInformation,le.is))}c.is=m})(O||(e.Diagnostic=O={}));var fe;(function(c){function h(u,a){for(var y=[],k=2;k<arguments.length;k++)y[k-2]=arguments[k];var J={title:u,command:a};return v.defined(y)&&y.length>0&&(J.arguments=y),J}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.title)&&v.string(a.command)}c.is=m})(fe||(e.Command=fe={}));var W;(function(c){function h(y,k){return{range:y,newText:k}}c.replace=h;function m(y,k){return{range:{start:y,end:y},newText:k}}c.insert=m;function u(y){return{range:y,newText:""}}c.del=u;function a(y){var k=y;return v.objectLiteral(k)&&v.string(k.newText)&&p.is(k.range)}c.is=a})(W||(e.TextEdit=W={}));var ve;(function(c){function h(u,a,y){var k={label:u};return a!==void 0&&(k.needsConfirmation=a),y!==void 0&&(k.description=y),k}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(v.string(a.description)||a.description===void 0)}c.is=m})(ve||(e.ChangeAnnotation=ve={}));var _e;(function(c){function h(m){var u=m;return v.string(u)}c.is=h})(_e||(e.ChangeAnnotationIdentifier=_e={}));var Be;(function(c){function h(y,k,J){return{range:y,newText:k,annotationId:J}}c.replace=h;function m(y,k,J){return{range:{start:y,end:y},newText:k,annotationId:J}}c.insert=m;function u(y,k){return{range:y,newText:"",annotationId:k}}c.del=u;function a(y){var k=y;return W.is(k)&&(ve.is(k.annotationId)||_e.is(k.annotationId))}c.is=a})(Be||(e.AnnotatedTextEdit=Be={}));var _t;(function(c){function h(u,a){return{textDocument:u,edits:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&bt.is(a.textDocument)&&Array.isArray(a.edits)}c.is=m})(_t||(e.TextDocumentEdit=_t={}));var lt;(function(c){function h(u,a,y){var k={kind:"create",uri:u};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=h;function m(u){var a=u;return a&&a.kind==="create"&&v.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(lt||(e.CreateFile=lt={}));var ft;(function(c){function h(u,a,y,k){var J={kind:"rename",oldUri:u,newUri:a};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(J.options=y),k!==void 0&&(J.annotationId=k),J}c.create=h;function m(u){var a=u;return a&&a.kind==="rename"&&v.string(a.oldUri)&&v.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(ft||(e.RenameFile=ft={}));var Te;(function(c){function h(u,a,y){var k={kind:"delete",uri:u};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=h;function m(u){var a=u;return a&&a.kind==="delete"&&v.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||v.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||v.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(Te||(e.DeleteFile=Te={}));var Dt;(function(c){function h(m){var u=m;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(function(a){return v.string(a.kind)?lt.is(a)||ft.is(a)||Te.is(a):_t.is(a)}))}c.is=h})(Dt||(e.WorkspaceEdit=Dt={}));var Ft=function(){function c(h,m){this.edits=h,this.changeAnnotations=m}return c.prototype.insert=function(h,m,u){var a,y;if(u===void 0?a=W.insert(h,m):_e.is(u)?(y=u,a=Be.insert(h,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=Be.insert(h,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.replace=function(h,m,u){var a,y;if(u===void 0?a=W.replace(h,m):_e.is(u)?(y=u,a=Be.replace(h,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=Be.replace(h,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.delete=function(h,m){var u,a;if(m===void 0?u=W.del(h):_e.is(m)?(a=m,u=Be.del(h,m)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(m),u=Be.del(h,a)),this.edits.push(u),a!==void 0)return a},c.prototype.add=function(h){this.edits.push(h)},c.prototype.all=function(){return this.edits},c.prototype.clear=function(){this.edits.splice(0,this.edits.length)},c.prototype.assertChangeAnnotations=function(h){if(h===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},c}(),Ir=function(){function c(h){this._annotations=h===void 0?Object.create(null):h,this._counter=0,this._size=0}return c.prototype.all=function(){return this._annotations},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),c.prototype.manage=function(h,m){var u;if(_e.is(h)?u=h:(u=this.nextId(),m=h),this._annotations[u]!==void 0)throw new Error("Id ".concat(u," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(u));return this._annotations[u]=m,this._size++,u},c.prototype.nextId=function(){return this._counter++,this._counter.toString()},c}(),In=function(){function c(h){var m=this;this._textEditChanges=Object.create(null),h!==void 0?(this._workspaceEdit=h,h.documentChanges?(this._changeAnnotations=new Ir(h.changeAnnotations),h.changeAnnotations=this._changeAnnotations.all(),h.documentChanges.forEach(function(u){if(_t.is(u)){var a=new Ft(u.edits,m._changeAnnotations);m._textEditChanges[u.textDocument.uri]=a}})):h.changes&&Object.keys(h.changes).forEach(function(u){var a=new Ft(h.changes[u]);m._textEditChanges[u]=a})):this._workspaceEdit={}}return Object.defineProperty(c.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),c.prototype.getTextEditChange=function(h){if(bt.is(h)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:h.uri,version:h.version},u=this._textEditChanges[m.uri];if(!u){var a=[],y={textDocument:m,edits:a};this._workspaceEdit.documentChanges.push(y),u=new Ft(a,this._changeAnnotations),this._textEditChanges[m.uri]=u}return u}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var u=this._textEditChanges[h];if(!u){var a=[];this._workspaceEdit.changes[h]=a,u=new Ft(a),this._textEditChanges[h]=u}return u}},c.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ir,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},c.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},c.prototype.createFile=function(h,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;ve.is(m)||_e.is(m)?a=m:u=m;var y,k;if(a===void 0?y=lt.create(h,u):(k=_e.is(a)?a:this._changeAnnotations.manage(a),y=lt.create(h,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c.prototype.renameFile=function(h,m,u,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;ve.is(u)||_e.is(u)?y=u:a=u;var k,J;if(y===void 0?k=ft.create(h,m,a):(J=_e.is(y)?y:this._changeAnnotations.manage(y),k=ft.create(h,m,a,J)),this._workspaceEdit.documentChanges.push(k),J!==void 0)return J},c.prototype.deleteFile=function(h,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;ve.is(m)||_e.is(m)?a=m:u=m;var y,k;if(a===void 0?y=Te.create(h,u):(k=_e.is(a)?a:this._changeAnnotations.manage(a),y=Te.create(h,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c}();e.WorkspaceChange=In;var Ar;(function(c){function h(u){return{uri:u}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)}c.is=m})(Ar||(e.TextDocumentIdentifier=Ar={}));var Wt;(function(c){function h(u,a){return{uri:u,version:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.integer(a.version)}c.is=m})(Wt||(e.VersionedTextDocumentIdentifier=Wt={}));var bt;(function(c){function h(u,a){return{uri:u,version:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&(a.version===null||v.integer(a.version))}c.is=m})(bt||(e.OptionalVersionedTextDocumentIdentifier=bt={}));var Me;(function(c){function h(u,a,y,k){return{uri:u,languageId:a,version:y,text:k}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.string(a.languageId)&&v.integer(a.version)&&v.string(a.text)}c.is=m})(Me||(e.TextDocumentItem=Me={}));var Et;(function(c){c.PlainText="plaintext",c.Markdown="markdown";function h(m){var u=m;return u===c.PlainText||u===c.Markdown}c.is=h})(Et||(e.MarkupKind=Et={}));var Ot;(function(c){function h(m){var u=m;return v.objectLiteral(m)&&Et.is(u.kind)&&v.string(u.value)}c.is=h})(Ot||(e.MarkupContent=Ot={}));var Lr;(function(c){c.Text=1,c.Method=2,c.Function=3,c.Constructor=4,c.Field=5,c.Variable=6,c.Class=7,c.Interface=8,c.Module=9,c.Property=10,c.Unit=11,c.Value=12,c.Enum=13,c.Keyword=14,c.Snippet=15,c.Color=16,c.File=17,c.Reference=18,c.Folder=19,c.EnumMember=20,c.Constant=21,c.Struct=22,c.Event=23,c.Operator=24,c.TypeParameter=25})(Lr||(e.CompletionItemKind=Lr={}));var Vt;(function(c){c.PlainText=1,c.Snippet=2})(Vt||(e.InsertTextFormat=Vt={}));var zt;(function(c){c.Deprecated=1})(zt||(e.CompletionItemTag=zt={}));var $r;(function(c){function h(u,a,y){return{newText:u,insert:a,replace:y}}c.create=h;function m(u){var a=u;return a&&v.string(a.newText)&&p.is(a.insert)&&p.is(a.replace)}c.is=m})($r||(e.InsertReplaceEdit=$r={}));var Fr;(function(c){c.asIs=1,c.adjustIndentation=2})(Fr||(e.InsertTextMode=Fr={}));var Wr;(function(c){function h(m){var u=m;return u&&(v.string(u.detail)||u.detail===void 0)&&(v.string(u.description)||u.description===void 0)}c.is=h})(Wr||(e.CompletionItemLabelDetails=Wr={}));var Vr;(function(c){function h(m){return{label:m}}c.create=h})(Vr||(e.CompletionItem=Vr={}));var zr;(function(c){function h(m,u){return{items:m||[],isIncomplete:!!u}}c.create=h})(zr||(e.CompletionList=zr={}));var Ut;(function(c){function h(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}c.fromPlainText=h;function m(u){var a=u;return v.string(a)||v.objectLiteral(a)&&v.string(a.language)&&v.string(a.value)}c.is=m})(Ut||(e.MarkedString=Ut={}));var Pe;(function(c){function h(m){var u=m;return!!u&&v.objectLiteral(u)&&(Ot.is(u.contents)||Ut.is(u.contents)||v.typedArray(u.contents,Ut.is))&&(m.range===void 0||p.is(m.range))}c.is=h})(Pe||(e.Hover=Pe={}));var Ur;(function(c){function h(m,u){return u?{label:m,documentation:u}:{label:m}}c.create=h})(Ur||(e.ParameterInformation=Ur={}));var Br;(function(c){function h(m,u){for(var a=[],y=2;y<arguments.length;y++)a[y-2]=arguments[y];var k={label:m};return v.defined(u)&&(k.documentation=u),v.defined(a)?k.parameters=a:k.parameters=[],k}c.create=h})(Br||(e.SignatureInformation=Br={}));var st;(function(c){c.Text=1,c.Read=2,c.Write=3})(st||(e.DocumentHighlightKind=st={}));var Hr;(function(c){function h(m,u){var a={range:m};return v.number(u)&&(a.kind=u),a}c.create=h})(Hr||(e.DocumentHighlight=Hr={}));var wt;(function(c){c.File=1,c.Module=2,c.Namespace=3,c.Package=4,c.Class=5,c.Method=6,c.Property=7,c.Field=8,c.Constructor=9,c.Enum=10,c.Interface=11,c.Function=12,c.Variable=13,c.Constant=14,c.String=15,c.Number=16,c.Boolean=17,c.Array=18,c.Object=19,c.Key=20,c.Null=21,c.EnumMember=22,c.Struct=23,c.Event=24,c.Operator=25,c.TypeParameter=26})(wt||(e.SymbolKind=wt={}));var Zr;(function(c){c.Deprecated=1})(Zr||(e.SymbolTag=Zr={}));var je;(function(c){function h(m,u,a,y,k){var J={name:m,kind:u,location:{uri:y,range:a}};return k&&(J.containerName=k),J}c.create=h})(je||(e.SymbolInformation=je={}));var He;(function(c){function h(m,u,a,y){return y!==void 0?{name:m,kind:u,location:{uri:a,range:y}}:{name:m,kind:u,location:{uri:a}}}c.create=h})(He||(e.WorkspaceSymbol=He={}));var Jr;(function(c){function h(u,a,y,k,J,Se){var he={name:u,detail:a,kind:y,range:k,selectionRange:J};return Se!==void 0&&(he.children=Se),he}c.create=h;function m(u){var a=u;return a&&v.string(a.name)&&v.number(a.kind)&&p.is(a.range)&&p.is(a.selectionRange)&&(a.detail===void 0||v.string(a.detail))&&(a.deprecated===void 0||v.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}c.is=m})(Jr||(e.DocumentSymbol=Jr={}));var Gr;(function(c){c.Empty="",c.QuickFix="quickfix",c.Refactor="refactor",c.RefactorExtract="refactor.extract",c.RefactorInline="refactor.inline",c.RefactorRewrite="refactor.rewrite",c.Source="source",c.SourceOrganizeImports="source.organizeImports",c.SourceFixAll="source.fixAll"})(Gr||(e.CodeActionKind=Gr={}));var qe;(function(c){c.Invoked=1,c.Automatic=2})(qe||(e.CodeActionTriggerKind=qe={}));var Bt;(function(c){function h(u,a,y){var k={diagnostics:u};return a!=null&&(k.only=a),y!=null&&(k.triggerKind=y),k}c.create=h;function m(u){var a=u;return v.defined(a)&&v.typedArray(a.diagnostics,O.is)&&(a.only===void 0||v.typedArray(a.only,v.string))&&(a.triggerKind===void 0||a.triggerKind===qe.Invoked||a.triggerKind===qe.Automatic)}c.is=m})(Bt||(e.CodeActionContext=Bt={}));var Ht;(function(c){function h(u,a,y){var k={title:u},J=!0;return typeof a=="string"?(J=!1,k.kind=a):fe.is(a)?k.command=a:k.edit=a,J&&y!==void 0&&(k.kind=y),k}c.create=h;function m(u){var a=u;return a&&v.string(a.title)&&(a.diagnostics===void 0||v.typedArray(a.diagnostics,O.is))&&(a.kind===void 0||v.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||fe.is(a.command))&&(a.isPreferred===void 0||v.boolean(a.isPreferred))&&(a.edit===void 0||Dt.is(a.edit))}c.is=m})(Ht||(e.CodeAction=Ht={}));var Tt;(function(c){function h(u,a){var y={range:u};return v.defined(a)&&(y.data=a),y}c.create=h;function m(u){var a=u;return v.defined(a)&&p.is(a.range)&&(v.undefined(a.command)||fe.is(a.command))}c.is=m})(Tt||(e.CodeLens=Tt={}));var Zt;(function(c){function h(u,a){return{tabSize:u,insertSpaces:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.uinteger(a.tabSize)&&v.boolean(a.insertSpaces)}c.is=m})(Zt||(e.FormattingOptions=Zt={}));var Ie;(function(c){function h(u,a,y){return{range:u,target:a,data:y}}c.create=h;function m(u){var a=u;return v.defined(a)&&p.is(a.range)&&(v.undefined(a.target)||v.string(a.target))}c.is=m})(Ie||(e.DocumentLink=Ie={}));var o;(function(c){function h(u,a){return{range:u,parent:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.range)&&(a.parent===void 0||c.is(a.parent))}c.is=m})(o||(e.SelectionRange=o={}));var f;(function(c){c.namespace="namespace",c.type="type",c.class="class",c.enum="enum",c.interface="interface",c.struct="struct",c.typeParameter="typeParameter",c.parameter="parameter",c.variable="variable",c.property="property",c.enumMember="enumMember",c.event="event",c.function="function",c.method="method",c.macro="macro",c.keyword="keyword",c.modifier="modifier",c.comment="comment",c.string="string",c.number="number",c.regexp="regexp",c.operator="operator",c.decorator="decorator"})(f||(e.SemanticTokenTypes=f={}));var g;(function(c){c.declaration="declaration",c.definition="definition",c.readonly="readonly",c.static="static",c.deprecated="deprecated",c.abstract="abstract",c.async="async",c.modification="modification",c.documentation="documentation",c.defaultLibrary="defaultLibrary"})(g||(e.SemanticTokenModifiers=g={}));var b;(function(c){function h(m){var u=m;return v.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}c.is=h})(b||(e.SemanticTokens=b={}));var L;(function(c){function h(u,a){return{range:u,text:a}}c.create=h;function m(u){var a=u;return a!=null&&p.is(a.range)&&v.string(a.text)}c.is=m})(L||(e.InlineValueText=L={}));var q;(function(c){function h(u,a,y){return{range:u,variableName:a,caseSensitiveLookup:y}}c.create=h;function m(u){var a=u;return a!=null&&p.is(a.range)&&v.boolean(a.caseSensitiveLookup)&&(v.string(a.variableName)||a.variableName===void 0)}c.is=m})(q||(e.InlineValueVariableLookup=q={}));var B;(function(c){function h(u,a){return{range:u,expression:a}}c.create=h;function m(u){var a=u;return a!=null&&p.is(a.range)&&(v.string(a.expression)||a.expression===void 0)}c.is=m})(B||(e.InlineValueEvaluatableExpression=B={}));var H;(function(c){function h(u,a){return{frameId:u,stoppedLocation:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&p.is(u.stoppedLocation)}c.is=m})(H||(e.InlineValueContext=H={}));var x;(function(c){c.Type=1,c.Parameter=2;function h(m){return m===1||m===2}c.is=h})(x||(e.InlayHintKind=x={}));var $;(function(c){function h(u){return{value:u}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.location===void 0||R.is(a.location))&&(a.command===void 0||fe.is(a.command))}c.is=m})($||(e.InlayHintLabelPart=$={}));var N;(function(c){function h(u,a,y){var k={position:u,label:a};return y!==void 0&&(k.kind=y),k}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&l.is(a.position)&&(v.string(a.label)||v.typedArray(a.label,$.is))&&(a.kind===void 0||x.is(a.kind))&&a.textEdits===void 0||v.typedArray(a.textEdits,W.is)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.paddingLeft===void 0||v.boolean(a.paddingLeft))&&(a.paddingRight===void 0||v.boolean(a.paddingRight))}c.is=m})(N||(e.InlayHint=N={}));var X;(function(c){function h(m){return{kind:"snippet",value:m}}c.createSnippet=h})(X||(e.StringValue=X={}));var se;(function(c){function h(m,u,a,y){return{insertText:m,filterText:u,range:a,command:y}}c.create=h})(se||(e.InlineCompletionItem=se={}));var be;(function(c){function h(m){return{items:m}}c.create=h})(be||(e.InlineCompletionList=be={}));var Qr;(function(c){c.Invoked=0,c.Automatic=1})(Qr||(e.InlineCompletionTriggerKind=Qr={}));var hc;(function(c){function h(m,u){return{range:m,text:u}}c.create=h})(hc||(e.SelectedCompletionInfo=hc={}));var pc;(function(c){function h(m,u){return{triggerKind:m,selectedCompletionInfo:u}}c.create=h})(pc||(e.InlineCompletionContext=pc={}));var mc;(function(c){function h(m){var u=m;return v.objectLiteral(u)&&n.is(u.uri)&&v.string(u.name)}c.is=h})(mc||(e.WorkspaceFolder=mc={})),e.EOL=[`
62
+ `)),f){let b=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";L.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${b}`,g)}else L.log(`Received response ${o.id} without active response promise.`,g)}else Ie("receive-response",o)}function Ie(o,f){if(!L||M===ue.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};L.log(g)}function He(){if(bt())throw new pn(Hn.Closed,"Connection is closed.");if(qe())throw new pn(Hn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new pn(Hn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function Ae(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case z.ParameterStructures.auto:return Ht(f)?Bt(f):[Ae(f)];case z.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case z.ParameterStructures.byPosition:return[Ae(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,b=o.numberOfParams;switch(b){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let $=0;$<f.length&&$<b;$++)g.push(Ae(f[$]));if(f.length<b)for(let $=f.length;$<b;$++)g.push(null);break}return g}let Le={sendNotification:(o,...f)=>{He();let g,b;if(ke.string(o)){g=o;let q=f[0],B=0,H=z.ParameterStructures.auto;z.ParameterStructures.is(q)&&(B=1,H=q);let x=f.length,F=x-B;switch(F){case 0:b=void 0;break;case 1:b=Tt(H,f[B]);break;default:if(H===z.ParameterStructures.byName)throw new Error(`Received ${F} parameters for 'by Name' notification parameter structure.`);b=f.slice(B,x).map(O=>Ae(O));break}}else{let q=f;g=o.method,b=Zt(o,q)}let $={jsonrpc:R,method:g,params:b};return Br($),e.write($).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return ke.func(o)?Z=o:f&&(ke.string(o)?(g=o,de.set(o,{type:void 0,handler:f})):(g=o.method,de.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?de.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(te.has(f))throw new Error(`Progress handler for token ${f} already registered`);return te.set(f,g),{dispose:()=>{te.delete(f)}}},sendProgress:(o,f,g)=>Le.sendNotification(Bn.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,b,$;if(ke.string(o)){g=o;let x=f[0],F=f[f.length-1],O=0,Y=z.ParameterStructures.auto;z.ParameterStructures.is(x)&&(O=1,Y=x);let oe=f.length;Ta.CancellationToken.is(F)&&(oe=oe-1,$=F);let be=oe-O;switch(be){case 0:b=void 0;break;case 1:b=Tt(Y,f[O]);break;default:if(Y===z.ParameterStructures.byName)throw new Error(`Received ${be} parameters for 'by Name' request parameter structure.`);b=f.slice(O,oe).map(Qr=>Ae(Qr));break}}else{let x=f;g=o.method,b=Zt(o,x);let F=o.numberOfParams;$=Ta.CancellationToken.is(x[F])?x[F]:void 0}let q=s++,B;$&&(B=$.onCancellationRequested(()=>{let x=Te.sender.sendCancellation(Le,q);return x===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):x.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:b};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(x,F)=>{let O=be=>{x(be),Te.sender.cleanup(q),B?.dispose()},Y=be=>{F(be),Te.sender.cleanup(q),B?.dispose()},oe={method:g,timerStart:Date.now(),resolve:O,reject:Y};try{await e.write(H),fe.set(q,oe)}catch(be){throw i.error("Sending request failed."),oe.reject(new z.ResponseError(z.ErrorCodes.MessageWriteError,be.message?be.message:"Unknown reason")),be}})},onRequest:(o,f)=>{He();let g=null;return Sa.is(o)?(g=void 0,_=o):ke.string(o)?(g=null,f!==void 0&&(g=o,E.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,E.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?E.delete(g):_=void 0)}}},hasPendingResponse:()=>fe.size>0,trace:async(o,f,g)=>{let b=!1,$=nt.Text;g!==void 0&&(ke.boolean(g)?b=g:(b=g.sendNotification||!1,$=g.traceFormat||nt.Text)),M=o,J=$,M===ue.Off?L=void 0:L=f,b&&!bt()&&!qe()&&await Le.sendNotification(Ca.type,{value:ue.toString(o)})},onError:ae.event,onClose:De.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(qe())return;le=gt.Disposed,ft.fire(void 0);let o=new z.ResponseError(z.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of fe.values())f.reject(o);fe=new Map,ye=new Map,Oe=new Set,he=new du.LinkedMap,ke.func(e.dispose)&&e.dispose(),ke.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),le=gt.Listening,t.listen(Fr)},inspect:()=>{(0,uu.default)().console.log("inspect")}};return Le.onNotification(Mi.type,o=>{if(M===ue.Off||!L)return;let f=M===ue.Verbose||M===ue.Compact;L.log(o.message,f?o.verbose:void 0)}),Le.onNotification(Bn.type,o=>{let f=te.get(o.token);f?f(o.value):lt.fire(o)}),Le}X.createMessageConnection=Jh});var $i=N(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.ProgressType=T.ProgressToken=T.createMessageConnection=T.NullLogger=T.ConnectionOptions=T.ConnectionStrategy=T.AbstractMessageBuffer=T.WriteableStreamMessageWriter=T.AbstractMessageWriter=T.MessageWriter=T.ReadableStreamMessageReader=T.AbstractMessageReader=T.MessageReader=T.SharedArrayReceiverStrategy=T.SharedArraySenderStrategy=T.CancellationToken=T.CancellationTokenSource=T.Emitter=T.Event=T.Disposable=T.LRUCache=T.Touch=T.LinkedMap=T.ParameterStructures=T.NotificationType9=T.NotificationType8=T.NotificationType7=T.NotificationType6=T.NotificationType5=T.NotificationType4=T.NotificationType3=T.NotificationType2=T.NotificationType1=T.NotificationType0=T.NotificationType=T.ErrorCodes=T.ResponseError=T.RequestType9=T.RequestType8=T.RequestType7=T.RequestType6=T.RequestType5=T.RequestType4=T.RequestType3=T.RequestType2=T.RequestType1=T.RequestType0=T.RequestType=T.Message=T.RAL=void 0;T.MessageStrategy=T.CancellationStrategy=T.CancellationSenderStrategy=T.CancellationReceiverStrategy=T.ConnectionError=T.ConnectionErrors=T.LogTraceNotification=T.SetTraceNotification=T.TraceFormat=T.TraceValues=T.Trace=void 0;var ge=ea();Object.defineProperty(T,"Message",{enumerable:!0,get:function(){return ge.Message}});Object.defineProperty(T,"RequestType",{enumerable:!0,get:function(){return ge.RequestType}});Object.defineProperty(T,"RequestType0",{enumerable:!0,get:function(){return ge.RequestType0}});Object.defineProperty(T,"RequestType1",{enumerable:!0,get:function(){return ge.RequestType1}});Object.defineProperty(T,"RequestType2",{enumerable:!0,get:function(){return ge.RequestType2}});Object.defineProperty(T,"RequestType3",{enumerable:!0,get:function(){return ge.RequestType3}});Object.defineProperty(T,"RequestType4",{enumerable:!0,get:function(){return ge.RequestType4}});Object.defineProperty(T,"RequestType5",{enumerable:!0,get:function(){return ge.RequestType5}});Object.defineProperty(T,"RequestType6",{enumerable:!0,get:function(){return ge.RequestType6}});Object.defineProperty(T,"RequestType7",{enumerable:!0,get:function(){return ge.RequestType7}});Object.defineProperty(T,"RequestType8",{enumerable:!0,get:function(){return ge.RequestType8}});Object.defineProperty(T,"RequestType9",{enumerable:!0,get:function(){return ge.RequestType9}});Object.defineProperty(T,"ResponseError",{enumerable:!0,get:function(){return ge.ResponseError}});Object.defineProperty(T,"ErrorCodes",{enumerable:!0,get:function(){return ge.ErrorCodes}});Object.defineProperty(T,"NotificationType",{enumerable:!0,get:function(){return ge.NotificationType}});Object.defineProperty(T,"NotificationType0",{enumerable:!0,get:function(){return ge.NotificationType0}});Object.defineProperty(T,"NotificationType1",{enumerable:!0,get:function(){return ge.NotificationType1}});Object.defineProperty(T,"NotificationType2",{enumerable:!0,get:function(){return ge.NotificationType2}});Object.defineProperty(T,"NotificationType3",{enumerable:!0,get:function(){return ge.NotificationType3}});Object.defineProperty(T,"NotificationType4",{enumerable:!0,get:function(){return ge.NotificationType4}});Object.defineProperty(T,"NotificationType5",{enumerable:!0,get:function(){return ge.NotificationType5}});Object.defineProperty(T,"NotificationType6",{enumerable:!0,get:function(){return ge.NotificationType6}});Object.defineProperty(T,"NotificationType7",{enumerable:!0,get:function(){return ge.NotificationType7}});Object.defineProperty(T,"NotificationType8",{enumerable:!0,get:function(){return ge.NotificationType8}});Object.defineProperty(T,"NotificationType9",{enumerable:!0,get:function(){return ge.NotificationType9}});Object.defineProperty(T,"ParameterStructures",{enumerable:!0,get:function(){return ge.ParameterStructures}});var Da=ra();Object.defineProperty(T,"LinkedMap",{enumerable:!0,get:function(){return Da.LinkedMap}});Object.defineProperty(T,"LRUCache",{enumerable:!0,get:function(){return Da.LRUCache}});Object.defineProperty(T,"Touch",{enumerable:!0,get:function(){return Da.Touch}});var Gh=Yc();Object.defineProperty(T,"Disposable",{enumerable:!0,get:function(){return Gh.Disposable}});var pu=dn();Object.defineProperty(T,"Event",{enumerable:!0,get:function(){return pu.Event}});Object.defineProperty(T,"Emitter",{enumerable:!0,get:function(){return pu.Emitter}});var mu=xi();Object.defineProperty(T,"CancellationTokenSource",{enumerable:!0,get:function(){return mu.CancellationTokenSource}});Object.defineProperty(T,"CancellationToken",{enumerable:!0,get:function(){return mu.CancellationToken}});var gu=eu();Object.defineProperty(T,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return gu.SharedArraySenderStrategy}});Object.defineProperty(T,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return gu.SharedArrayReceiverStrategy}});var Ea=ru();Object.defineProperty(T,"MessageReader",{enumerable:!0,get:function(){return Ea.MessageReader}});Object.defineProperty(T,"AbstractMessageReader",{enumerable:!0,get:function(){return Ea.AbstractMessageReader}});Object.defineProperty(T,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Ea.ReadableStreamMessageReader}});var Oa=au();Object.defineProperty(T,"MessageWriter",{enumerable:!0,get:function(){return Oa.MessageWriter}});Object.defineProperty(T,"AbstractMessageWriter",{enumerable:!0,get:function(){return Oa.AbstractMessageWriter}});Object.defineProperty(T,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Oa.WriteableStreamMessageWriter}});var Qh=cu();Object.defineProperty(T,"AbstractMessageBuffer",{enumerable:!0,get:function(){return Qh.AbstractMessageBuffer}});var Me=hu();Object.defineProperty(T,"ConnectionStrategy",{enumerable:!0,get:function(){return Me.ConnectionStrategy}});Object.defineProperty(T,"ConnectionOptions",{enumerable:!0,get:function(){return Me.ConnectionOptions}});Object.defineProperty(T,"NullLogger",{enumerable:!0,get:function(){return Me.NullLogger}});Object.defineProperty(T,"createMessageConnection",{enumerable:!0,get:function(){return Me.createMessageConnection}});Object.defineProperty(T,"ProgressToken",{enumerable:!0,get:function(){return Me.ProgressToken}});Object.defineProperty(T,"ProgressType",{enumerable:!0,get:function(){return Me.ProgressType}});Object.defineProperty(T,"Trace",{enumerable:!0,get:function(){return Me.Trace}});Object.defineProperty(T,"TraceValues",{enumerable:!0,get:function(){return Me.TraceValues}});Object.defineProperty(T,"TraceFormat",{enumerable:!0,get:function(){return Me.TraceFormat}});Object.defineProperty(T,"SetTraceNotification",{enumerable:!0,get:function(){return Me.SetTraceNotification}});Object.defineProperty(T,"LogTraceNotification",{enumerable:!0,get:function(){return Me.LogTraceNotification}});Object.defineProperty(T,"ConnectionErrors",{enumerable:!0,get:function(){return Me.ConnectionErrors}});Object.defineProperty(T,"ConnectionError",{enumerable:!0,get:function(){return Me.ConnectionError}});Object.defineProperty(T,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Me.CancellationReceiverStrategy}});Object.defineProperty(T,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Me.CancellationSenderStrategy}});Object.defineProperty(T,"CancellationStrategy",{enumerable:!0,get:function(){return Me.CancellationStrategy}});Object.defineProperty(T,"MessageStrategy",{enumerable:!0,get:function(){return Me.MessageStrategy}});var Xh=Kt();T.RAL=Xh.default});var _u=N(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var yu=require("util"),jt=$i(),Fi=class t extends jt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new yu.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};Fi.emptyBuffer=Buffer.allocUnsafe(0);var Na=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),jt.Disposable.create(()=>this.stream.off("data",e))}},Ma=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=d=>{d==null?n():i(d)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},vu=Object.freeze({messageBuffer:Object.freeze({create:t=>new Fi(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new yu.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new Na(t),asWritableStream:t=>new Ma(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function ja(){return vu}(function(t){function e(){jt.RAL.install(vu)}t.install=e})(ja||(ja={}));qa.default=ja});var yr=N(se=>{"use strict";var Yh=se&&se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Kh=se&&se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yh(e,t,r)};Object.defineProperty(se,"__esModule",{value:!0});se.createMessageConnection=se.createServerSocketTransport=se.createClientSocketTransport=se.createServerPipeTransport=se.createClientPipeTransport=se.generateRandomPipeName=se.StreamMessageWriter=se.StreamMessageReader=se.SocketMessageWriter=se.SocketMessageReader=se.PortMessageWriter=se.PortMessageReader=se.IPCMessageWriter=se.IPCMessageReader=void 0;var mn=_u();mn.default.install();var bu=require("path"),ep=require("os"),tp=require("crypto"),zi=require("net"),it=$i();Kh($i(),se);var Ia=class extends it.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),it.Disposable.create(()=>this.process.off("message",e))}};se.IPCMessageReader=Ia;var Aa=class extends it.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};se.IPCMessageWriter=Aa;var La=class extends it.AbstractMessageReader{constructor(e){super(),this.onData=new it.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};se.PortMessageReader=La;var $a=class extends it.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};se.PortMessageWriter=$a;var mr=class extends it.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,mn.default)().stream.asReadableStream(e),r)}};se.SocketMessageReader=mr;var gr=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};se.SocketMessageWriter=gr;var Wi=class extends it.ReadableStreamMessageReader{constructor(e,r){super((0,mn.default)().stream.asReadableStream(e),r)}};se.StreamMessageReader=Wi;var Vi=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r)}};se.StreamMessageWriter=Vi;var wu=process.env.XDG_RUNTIME_DIR,rp=new Map([["linux",107],["darwin",103]]);function np(){let t=(0,tp.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;wu?e=bu.join(wu,`vscode-ipc-${t}.sock`):e=bu.join(ep.tmpdir(),`vscode-${t}.sock`);let r=rp.get(process.platform);return r!==void 0&&e.length>r&&(0,mn.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}se.generateRandomPipeName=np;function ip(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,zi.createServer)(p=>{d.close(),r([new mr(p,e),new gr(p,e)])});d.on("error",s),d.listen(t,()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}se.createClientPipeTransport=ip;function sp(t,e="utf-8"){let r=(0,zi.createConnection)(t);return[new mr(r,e),new gr(r,e)]}se.createServerPipeTransport=sp;function op(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,zi.createServer)(p=>{d.close(),r([new mr(p,e),new gr(p,e)])});d.on("error",s),d.listen(t,"127.0.0.1",()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}se.createClientSocketTransport=op;function ap(t,e="utf-8"){let r=(0,zi.createConnection)(t,"127.0.0.1");return[new mr(r,e),new gr(r,e)]}se.createServerSocketTransport=ap;function cp(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function up(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function dp(t,e,r,n){r||(r=it.NullLogger);let i=cp(t)?new Wi(t):t,s=up(e)?new Vi(e):e;return it.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,it.createMessageConnection)(i,s,r,n)}se.createMessageConnection=dp});var Fa=N((Fg,Tu)=>{"use strict";Tu.exports=yr()});var Bi=N((Ru,Ui)=>{(function(t){if(typeof Ui=="object"&&typeof Ui.exports=="object"){var e=t(require,Ru);e!==void 0&&(Ui.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(c){function h(m){return typeof m=="string"}c.is=h})(r||(e.DocumentUri=r={}));var n;(function(c){function h(m){return typeof m=="string"}c.is=h})(n||(e.URI=n={}));var i;(function(c){c.MIN_VALUE=-2147483648,c.MAX_VALUE=2147483647;function h(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=h})(i||(e.integer=i={}));var s;(function(c){c.MIN_VALUE=0,c.MAX_VALUE=2147483647;function h(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=h})(s||(e.uinteger=s={}));var d;(function(c){function h(u,a){return u===Number.MAX_VALUE&&(u=s.MAX_VALUE),a===Number.MAX_VALUE&&(a=s.MAX_VALUE),{line:u,character:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.line)&&v.uinteger(a.character)}c.is=m})(d||(e.Position=d={}));var p;(function(c){function h(u,a,y,k){if(v.uinteger(u)&&v.uinteger(a)&&v.uinteger(y)&&v.uinteger(k))return{start:d.create(u,a),end:d.create(y,k)};if(d.is(u)&&d.is(a))return{start:u,end:a};throw new Error("Range#create called with invalid arguments[".concat(u,", ").concat(a,", ").concat(y,", ").concat(k,"]"))}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&d.is(a.start)&&d.is(a.end)}c.is=m})(p||(e.Range=p={}));var R;(function(c){function h(u,a){return{uri:u,range:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.range)&&(v.string(a.uri)||v.undefined(a.uri))}c.is=m})(R||(e.Location=R={}));var _;(function(c){function h(u,a,y,k){return{targetUri:u,targetRange:a,targetSelectionRange:y,originSelectionRange:k}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.targetRange)&&v.string(a.targetUri)&&p.is(a.targetSelectionRange)&&(p.is(a.originSelectionRange)||v.undefined(a.originSelectionRange))}c.is=m})(_||(e.LocationLink=_={}));var E;(function(c){function h(u,a,y,k){return{red:u,green:a,blue:y,alpha:k}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.numberRange(a.red,0,1)&&v.numberRange(a.green,0,1)&&v.numberRange(a.blue,0,1)&&v.numberRange(a.alpha,0,1)}c.is=m})(E||(e.Color=E={}));var Z;(function(c){function h(u,a){return{range:u,color:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.range)&&E.is(a.color)}c.is=m})(Z||(e.ColorInformation=Z={}));var de;(function(c){function h(u,a,y){return{label:u,textEdit:a,additionalTextEdits:y}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.undefined(a.textEdit)||L.is(a))&&(v.undefined(a.additionalTextEdits)||v.typedArray(a.additionalTextEdits,L.is))}c.is=m})(de||(e.ColorPresentation=de={}));var te;(function(c){c.Comment="comment",c.Imports="imports",c.Region="region"})(te||(e.FoldingRangeKind=te={}));var Be;(function(c){function h(u,a,y,k,G,Se){var pe={startLine:u,endLine:a};return v.defined(y)&&(pe.startCharacter=y),v.defined(k)&&(pe.endCharacter=k),v.defined(G)&&(pe.kind=G),v.defined(Se)&&(pe.collapsedText=Se),pe}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.startLine)&&v.uinteger(a.startLine)&&(v.undefined(a.startCharacter)||v.uinteger(a.startCharacter))&&(v.undefined(a.endCharacter)||v.uinteger(a.endCharacter))&&(v.undefined(a.kind)||v.string(a.kind))}c.is=m})(Be||(e.FoldingRange=Be={}));var he;(function(c){function h(u,a){return{location:u,message:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&R.is(a.location)&&v.string(a.message)}c.is=m})(he||(e.DiagnosticRelatedInformation=he={}));var fe;(function(c){c.Error=1,c.Warning=2,c.Information=3,c.Hint=4})(fe||(e.DiagnosticSeverity=fe={}));var Oe;(function(c){c.Unnecessary=1,c.Deprecated=2})(Oe||(e.DiagnosticTag=Oe={}));var ye;(function(c){function h(m){var u=m;return v.objectLiteral(u)&&v.string(u.href)}c.is=h})(ye||(e.CodeDescription=ye={}));var M;(function(c){function h(u,a,y,k,G,Se){var pe={range:u,message:a};return v.defined(y)&&(pe.severity=y),v.defined(k)&&(pe.code=k),v.defined(G)&&(pe.source=G),v.defined(Se)&&(pe.relatedInformation=Se),pe}c.create=h;function m(u){var a,y=u;return v.defined(y)&&p.is(y.range)&&v.string(y.message)&&(v.number(y.severity)||v.undefined(y.severity))&&(v.integer(y.code)||v.string(y.code)||v.undefined(y.code))&&(v.undefined(y.codeDescription)||v.string((a=y.codeDescription)===null||a===void 0?void 0:a.href))&&(v.string(y.source)||v.undefined(y.source))&&(v.undefined(y.relatedInformation)||v.typedArray(y.relatedInformation,he.is))}c.is=m})(M||(e.Diagnostic=M={}));var J;(function(c){function h(u,a){for(var y=[],k=2;k<arguments.length;k++)y[k-2]=arguments[k];var G={title:u,command:a};return v.defined(y)&&y.length>0&&(G.arguments=y),G}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.title)&&v.string(a.command)}c.is=m})(J||(e.Command=J={}));var L;(function(c){function h(y,k){return{range:y,newText:k}}c.replace=h;function m(y,k){return{range:{start:y,end:y},newText:k}}c.insert=m;function u(y){return{range:y,newText:""}}c.del=u;function a(y){var k=y;return v.objectLiteral(k)&&v.string(k.newText)&&p.is(k.range)}c.is=a})(L||(e.TextEdit=L={}));var le;(function(c){function h(u,a,y){var k={label:u};return a!==void 0&&(k.needsConfirmation=a),y!==void 0&&(k.description=y),k}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(v.string(a.description)||a.description===void 0)}c.is=m})(le||(e.ChangeAnnotation=le={}));var ae;(function(c){function h(m){var u=m;return v.string(u)}c.is=h})(ae||(e.ChangeAnnotationIdentifier=ae={}));var De;(function(c){function h(y,k,G){return{range:y,newText:k,annotationId:G}}c.replace=h;function m(y,k,G){return{range:{start:y,end:y},newText:k,annotationId:G}}c.insert=m;function u(y,k){return{range:y,newText:"",annotationId:k}}c.del=u;function a(y){var k=y;return L.is(k)&&(le.is(k.annotationId)||ae.is(k.annotationId))}c.is=a})(De||(e.AnnotatedTextEdit=De={}));var _t;(function(c){function h(u,a){return{textDocument:u,edits:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&bt.is(a.textDocument)&&Array.isArray(a.edits)}c.is=m})(_t||(e.TextDocumentEdit=_t={}));var lt;(function(c){function h(u,a,y){var k={kind:"create",uri:u};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=h;function m(u){var a=u;return a&&a.kind==="create"&&v.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||ae.is(a.annotationId))}c.is=m})(lt||(e.CreateFile=lt={}));var ft;(function(c){function h(u,a,y,k){var G={kind:"rename",oldUri:u,newUri:a};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(G.options=y),k!==void 0&&(G.annotationId=k),G}c.create=h;function m(u){var a=u;return a&&a.kind==="rename"&&v.string(a.oldUri)&&v.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||ae.is(a.annotationId))}c.is=m})(ft||(e.RenameFile=ft={}));var Te;(function(c){function h(u,a,y){var k={kind:"delete",uri:u};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=h;function m(u){var a=u;return a&&a.kind==="delete"&&v.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||v.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||v.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||ae.is(a.annotationId))}c.is=m})(Te||(e.DeleteFile=Te={}));var Dt;(function(c){function h(m){var u=m;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(function(a){return v.string(a.kind)?lt.is(a)||ft.is(a)||Te.is(a):_t.is(a)}))}c.is=h})(Dt||(e.WorkspaceEdit=Dt={}));var Ft=function(){function c(h,m){this.edits=h,this.changeAnnotations=m}return c.prototype.insert=function(h,m,u){var a,y;if(u===void 0?a=L.insert(h,m):ae.is(u)?(y=u,a=De.insert(h,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=De.insert(h,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.replace=function(h,m,u){var a,y;if(u===void 0?a=L.replace(h,m):ae.is(u)?(y=u,a=De.replace(h,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=De.replace(h,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.delete=function(h,m){var u,a;if(m===void 0?u=L.del(h):ae.is(m)?(a=m,u=De.del(h,m)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(m),u=De.del(h,a)),this.edits.push(u),a!==void 0)return a},c.prototype.add=function(h){this.edits.push(h)},c.prototype.all=function(){return this.edits},c.prototype.clear=function(){this.edits.splice(0,this.edits.length)},c.prototype.assertChangeAnnotations=function(h){if(h===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},c}(),Ir=function(){function c(h){this._annotations=h===void 0?Object.create(null):h,this._counter=0,this._size=0}return c.prototype.all=function(){return this._annotations},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),c.prototype.manage=function(h,m){var u;if(ae.is(h)?u=h:(u=this.nextId(),m=h),this._annotations[u]!==void 0)throw new Error("Id ".concat(u," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(u));return this._annotations[u]=m,this._size++,u},c.prototype.nextId=function(){return this._counter++,this._counter.toString()},c}(),qn=function(){function c(h){var m=this;this._textEditChanges=Object.create(null),h!==void 0?(this._workspaceEdit=h,h.documentChanges?(this._changeAnnotations=new Ir(h.changeAnnotations),h.changeAnnotations=this._changeAnnotations.all(),h.documentChanges.forEach(function(u){if(_t.is(u)){var a=new Ft(u.edits,m._changeAnnotations);m._textEditChanges[u.textDocument.uri]=a}})):h.changes&&Object.keys(h.changes).forEach(function(u){var a=new Ft(h.changes[u]);m._textEditChanges[u]=a})):this._workspaceEdit={}}return Object.defineProperty(c.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),c.prototype.getTextEditChange=function(h){if(bt.is(h)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:h.uri,version:h.version},u=this._textEditChanges[m.uri];if(!u){var a=[],y={textDocument:m,edits:a};this._workspaceEdit.documentChanges.push(y),u=new Ft(a,this._changeAnnotations),this._textEditChanges[m.uri]=u}return u}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var u=this._textEditChanges[h];if(!u){var a=[];this._workspaceEdit.changes[h]=a,u=new Ft(a),this._textEditChanges[h]=u}return u}},c.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ir,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},c.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},c.prototype.createFile=function(h,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;le.is(m)||ae.is(m)?a=m:u=m;var y,k;if(a===void 0?y=lt.create(h,u):(k=ae.is(a)?a:this._changeAnnotations.manage(a),y=lt.create(h,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c.prototype.renameFile=function(h,m,u,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;le.is(u)||ae.is(u)?y=u:a=u;var k,G;if(y===void 0?k=ft.create(h,m,a):(G=ae.is(y)?y:this._changeAnnotations.manage(y),k=ft.create(h,m,a,G)),this._workspaceEdit.documentChanges.push(k),G!==void 0)return G},c.prototype.deleteFile=function(h,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;le.is(m)||ae.is(m)?a=m:u=m;var y,k;if(a===void 0?y=Te.create(h,u):(k=ae.is(a)?a:this._changeAnnotations.manage(a),y=Te.create(h,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c}();e.WorkspaceChange=qn;var Ar;(function(c){function h(u){return{uri:u}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)}c.is=m})(Ar||(e.TextDocumentIdentifier=Ar={}));var Wt;(function(c){function h(u,a){return{uri:u,version:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.integer(a.version)}c.is=m})(Wt||(e.VersionedTextDocumentIdentifier=Wt={}));var bt;(function(c){function h(u,a){return{uri:u,version:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&(a.version===null||v.integer(a.version))}c.is=m})(bt||(e.OptionalVersionedTextDocumentIdentifier=bt={}));var qe;(function(c){function h(u,a,y,k){return{uri:u,languageId:a,version:y,text:k}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.string(a.languageId)&&v.integer(a.version)&&v.string(a.text)}c.is=m})(qe||(e.TextDocumentItem=qe={}));var Et;(function(c){c.PlainText="plaintext",c.Markdown="markdown";function h(m){var u=m;return u===c.PlainText||u===c.Markdown}c.is=h})(Et||(e.MarkupKind=Et={}));var Ot;(function(c){function h(m){var u=m;return v.objectLiteral(m)&&Et.is(u.kind)&&v.string(u.value)}c.is=h})(Ot||(e.MarkupContent=Ot={}));var Lr;(function(c){c.Text=1,c.Method=2,c.Function=3,c.Constructor=4,c.Field=5,c.Variable=6,c.Class=7,c.Interface=8,c.Module=9,c.Property=10,c.Unit=11,c.Value=12,c.Enum=13,c.Keyword=14,c.Snippet=15,c.Color=16,c.File=17,c.Reference=18,c.Folder=19,c.EnumMember=20,c.Constant=21,c.Struct=22,c.Event=23,c.Operator=24,c.TypeParameter=25})(Lr||(e.CompletionItemKind=Lr={}));var Vt;(function(c){c.PlainText=1,c.Snippet=2})(Vt||(e.InsertTextFormat=Vt={}));var zt;(function(c){c.Deprecated=1})(zt||(e.CompletionItemTag=zt={}));var $r;(function(c){function h(u,a,y){return{newText:u,insert:a,replace:y}}c.create=h;function m(u){var a=u;return a&&v.string(a.newText)&&p.is(a.insert)&&p.is(a.replace)}c.is=m})($r||(e.InsertReplaceEdit=$r={}));var Fr;(function(c){c.asIs=1,c.adjustIndentation=2})(Fr||(e.InsertTextMode=Fr={}));var Wr;(function(c){function h(m){var u=m;return u&&(v.string(u.detail)||u.detail===void 0)&&(v.string(u.description)||u.description===void 0)}c.is=h})(Wr||(e.CompletionItemLabelDetails=Wr={}));var Vr;(function(c){function h(m){return{label:m}}c.create=h})(Vr||(e.CompletionItem=Vr={}));var zr;(function(c){function h(m,u){return{items:m||[],isIncomplete:!!u}}c.create=h})(zr||(e.CompletionList=zr={}));var Ut;(function(c){function h(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}c.fromPlainText=h;function m(u){var a=u;return v.string(a)||v.objectLiteral(a)&&v.string(a.language)&&v.string(a.value)}c.is=m})(Ut||(e.MarkedString=Ut={}));var Pe;(function(c){function h(m){var u=m;return!!u&&v.objectLiteral(u)&&(Ot.is(u.contents)||Ut.is(u.contents)||v.typedArray(u.contents,Ut.is))&&(m.range===void 0||p.is(m.range))}c.is=h})(Pe||(e.Hover=Pe={}));var Ur;(function(c){function h(m,u){return u?{label:m,documentation:u}:{label:m}}c.create=h})(Ur||(e.ParameterInformation=Ur={}));var Br;(function(c){function h(m,u){for(var a=[],y=2;y<arguments.length;y++)a[y-2]=arguments[y];var k={label:m};return v.defined(u)&&(k.documentation=u),v.defined(a)?k.parameters=a:k.parameters=[],k}c.create=h})(Br||(e.SignatureInformation=Br={}));var st;(function(c){c.Text=1,c.Read=2,c.Write=3})(st||(e.DocumentHighlightKind=st={}));var Hr;(function(c){function h(m,u){var a={range:m};return v.number(u)&&(a.kind=u),a}c.create=h})(Hr||(e.DocumentHighlight=Hr={}));var wt;(function(c){c.File=1,c.Module=2,c.Namespace=3,c.Package=4,c.Class=5,c.Method=6,c.Property=7,c.Field=8,c.Constructor=9,c.Enum=10,c.Interface=11,c.Function=12,c.Variable=13,c.Constant=14,c.String=15,c.Number=16,c.Boolean=17,c.Array=18,c.Object=19,c.Key=20,c.Null=21,c.EnumMember=22,c.Struct=23,c.Event=24,c.Operator=25,c.TypeParameter=26})(wt||(e.SymbolKind=wt={}));var Zr;(function(c){c.Deprecated=1})(Zr||(e.SymbolTag=Zr={}));var Ie;(function(c){function h(m,u,a,y,k){var G={name:m,kind:u,location:{uri:y,range:a}};return k&&(G.containerName=k),G}c.create=h})(Ie||(e.SymbolInformation=Ie={}));var He;(function(c){function h(m,u,a,y){return y!==void 0?{name:m,kind:u,location:{uri:a,range:y}}:{name:m,kind:u,location:{uri:a}}}c.create=h})(He||(e.WorkspaceSymbol=He={}));var Jr;(function(c){function h(u,a,y,k,G,Se){var pe={name:u,detail:a,kind:y,range:k,selectionRange:G};return Se!==void 0&&(pe.children=Se),pe}c.create=h;function m(u){var a=u;return a&&v.string(a.name)&&v.number(a.kind)&&p.is(a.range)&&p.is(a.selectionRange)&&(a.detail===void 0||v.string(a.detail))&&(a.deprecated===void 0||v.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}c.is=m})(Jr||(e.DocumentSymbol=Jr={}));var Gr;(function(c){c.Empty="",c.QuickFix="quickfix",c.Refactor="refactor",c.RefactorExtract="refactor.extract",c.RefactorInline="refactor.inline",c.RefactorRewrite="refactor.rewrite",c.Source="source",c.SourceOrganizeImports="source.organizeImports",c.SourceFixAll="source.fixAll"})(Gr||(e.CodeActionKind=Gr={}));var Ae;(function(c){c.Invoked=1,c.Automatic=2})(Ae||(e.CodeActionTriggerKind=Ae={}));var Bt;(function(c){function h(u,a,y){var k={diagnostics:u};return a!=null&&(k.only=a),y!=null&&(k.triggerKind=y),k}c.create=h;function m(u){var a=u;return v.defined(a)&&v.typedArray(a.diagnostics,M.is)&&(a.only===void 0||v.typedArray(a.only,v.string))&&(a.triggerKind===void 0||a.triggerKind===Ae.Invoked||a.triggerKind===Ae.Automatic)}c.is=m})(Bt||(e.CodeActionContext=Bt={}));var Ht;(function(c){function h(u,a,y){var k={title:u},G=!0;return typeof a=="string"?(G=!1,k.kind=a):J.is(a)?k.command=a:k.edit=a,G&&y!==void 0&&(k.kind=y),k}c.create=h;function m(u){var a=u;return a&&v.string(a.title)&&(a.diagnostics===void 0||v.typedArray(a.diagnostics,M.is))&&(a.kind===void 0||v.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||J.is(a.command))&&(a.isPreferred===void 0||v.boolean(a.isPreferred))&&(a.edit===void 0||Dt.is(a.edit))}c.is=m})(Ht||(e.CodeAction=Ht={}));var Tt;(function(c){function h(u,a){var y={range:u};return v.defined(a)&&(y.data=a),y}c.create=h;function m(u){var a=u;return v.defined(a)&&p.is(a.range)&&(v.undefined(a.command)||J.is(a.command))}c.is=m})(Tt||(e.CodeLens=Tt={}));var Zt;(function(c){function h(u,a){return{tabSize:u,insertSpaces:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&v.uinteger(a.tabSize)&&v.boolean(a.insertSpaces)}c.is=m})(Zt||(e.FormattingOptions=Zt={}));var Le;(function(c){function h(u,a,y){return{range:u,target:a,data:y}}c.create=h;function m(u){var a=u;return v.defined(a)&&p.is(a.range)&&(v.undefined(a.target)||v.string(a.target))}c.is=m})(Le||(e.DocumentLink=Le={}));var o;(function(c){function h(u,a){return{range:u,parent:a}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&p.is(a.range)&&(a.parent===void 0||c.is(a.parent))}c.is=m})(o||(e.SelectionRange=o={}));var f;(function(c){c.namespace="namespace",c.type="type",c.class="class",c.enum="enum",c.interface="interface",c.struct="struct",c.typeParameter="typeParameter",c.parameter="parameter",c.variable="variable",c.property="property",c.enumMember="enumMember",c.event="event",c.function="function",c.method="method",c.macro="macro",c.keyword="keyword",c.modifier="modifier",c.comment="comment",c.string="string",c.number="number",c.regexp="regexp",c.operator="operator",c.decorator="decorator"})(f||(e.SemanticTokenTypes=f={}));var g;(function(c){c.declaration="declaration",c.definition="definition",c.readonly="readonly",c.static="static",c.deprecated="deprecated",c.abstract="abstract",c.async="async",c.modification="modification",c.documentation="documentation",c.defaultLibrary="defaultLibrary"})(g||(e.SemanticTokenModifiers=g={}));var b;(function(c){function h(m){var u=m;return v.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}c.is=h})(b||(e.SemanticTokens=b={}));var $;(function(c){function h(u,a){return{range:u,text:a}}c.create=h;function m(u){var a=u;return a!=null&&p.is(a.range)&&v.string(a.text)}c.is=m})($||(e.InlineValueText=$={}));var q;(function(c){function h(u,a,y){return{range:u,variableName:a,caseSensitiveLookup:y}}c.create=h;function m(u){var a=u;return a!=null&&p.is(a.range)&&v.boolean(a.caseSensitiveLookup)&&(v.string(a.variableName)||a.variableName===void 0)}c.is=m})(q||(e.InlineValueVariableLookup=q={}));var B;(function(c){function h(u,a){return{range:u,expression:a}}c.create=h;function m(u){var a=u;return a!=null&&p.is(a.range)&&(v.string(a.expression)||a.expression===void 0)}c.is=m})(B||(e.InlineValueEvaluatableExpression=B={}));var H;(function(c){function h(u,a){return{frameId:u,stoppedLocation:a}}c.create=h;function m(u){var a=u;return v.defined(a)&&p.is(u.stoppedLocation)}c.is=m})(H||(e.InlineValueContext=H={}));var x;(function(c){c.Type=1,c.Parameter=2;function h(m){return m===1||m===2}c.is=h})(x||(e.InlayHintKind=x={}));var F;(function(c){function h(u){return{value:u}}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.location===void 0||R.is(a.location))&&(a.command===void 0||J.is(a.command))}c.is=m})(F||(e.InlayHintLabelPart=F={}));var O;(function(c){function h(u,a,y){var k={position:u,label:a};return y!==void 0&&(k.kind=y),k}c.create=h;function m(u){var a=u;return v.objectLiteral(a)&&d.is(a.position)&&(v.string(a.label)||v.typedArray(a.label,F.is))&&(a.kind===void 0||x.is(a.kind))&&a.textEdits===void 0||v.typedArray(a.textEdits,L.is)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.paddingLeft===void 0||v.boolean(a.paddingLeft))&&(a.paddingRight===void 0||v.boolean(a.paddingRight))}c.is=m})(O||(e.InlayHint=O={}));var Y;(function(c){function h(m){return{kind:"snippet",value:m}}c.createSnippet=h})(Y||(e.StringValue=Y={}));var oe;(function(c){function h(m,u,a,y){return{insertText:m,filterText:u,range:a,command:y}}c.create=h})(oe||(e.InlineCompletionItem=oe={}));var be;(function(c){function h(m){return{items:m}}c.create=h})(be||(e.InlineCompletionList=be={}));var Qr;(function(c){c.Invoked=0,c.Automatic=1})(Qr||(e.InlineCompletionTriggerKind=Qr={}));var lc;(function(c){function h(m,u){return{range:m,text:u}}c.create=h})(lc||(e.SelectedCompletionInfo=lc={}));var fc;(function(c){function h(m,u){return{triggerKind:m,selectedCompletionInfo:u}}c.create=h})(fc||(e.InlineCompletionContext=fc={}));var hc;(function(c){function h(m){var u=m;return v.objectLiteral(u)&&n.is(u.uri)&&v.string(u.name)}c.is=h})(hc||(e.WorkspaceFolder=hc={})),e.EOL=[`
63
63
  `,`\r
64
- `,"\r"];var gc;(function(c){function h(y,k,J,Se){return new Uf(y,k,J,Se)}c.create=h;function m(y){var k=y;return!!(v.defined(k)&&v.string(k.uri)&&(v.undefined(k.languageId)||v.string(k.languageId))&&v.uinteger(k.lineCount)&&v.func(k.getText)&&v.func(k.positionAt)&&v.func(k.offsetAt))}c.is=m;function u(y,k){for(var J=y.getText(),Se=a(k,function(Xr,ni){var yc=Xr.range.start.line-ni.range.start.line;return yc===0?Xr.range.start.character-ni.range.start.character:yc}),he=J.length,ht=Se.length-1;ht>=0;ht--){var pt=Se[ht],Nt=y.offsetAt(pt.range.start),re=y.offsetAt(pt.range.end);if(re<=he)J=J.substring(0,Nt)+pt.newText+J.substring(re,J.length);else throw new Error("Overlapping edit");he=Nt}return J}c.applyEdits=u;function a(y,k){if(y.length<=1)return y;var J=y.length/2|0,Se=y.slice(0,J),he=y.slice(J);a(Se,k),a(he,k);for(var ht=0,pt=0,Nt=0;ht<Se.length&&pt<he.length;){var re=k(Se[ht],he[pt]);re<=0?y[Nt++]=Se[ht++]:y[Nt++]=he[pt++]}for(;ht<Se.length;)y[Nt++]=Se[ht++];for(;pt<he.length;)y[Nt++]=he[pt++];return y}})(gc||(e.TextDocument=gc={}));var Uf=function(){function c(h,m,u,a){this._uri=h,this._languageId=m,this._version=u,this._content=a,this._lineOffsets=void 0}return Object.defineProperty(c.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),c.prototype.getText=function(h){if(h){var m=this.offsetAt(h.start),u=this.offsetAt(h.end);return this._content.substring(m,u)}return this._content},c.prototype.update=function(h,m){this._content=h.text,this._version=m,this._lineOffsets=void 0},c.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var h=[],m=this._content,u=!0,a=0;a<m.length;a++){u&&(h.push(a),u=!1);var y=m.charAt(a);u=y==="\r"||y===`
64
+ `,"\r"];var pc;(function(c){function h(y,k,G,Se){return new zf(y,k,G,Se)}c.create=h;function m(y){var k=y;return!!(v.defined(k)&&v.string(k.uri)&&(v.undefined(k.languageId)||v.string(k.languageId))&&v.uinteger(k.lineCount)&&v.func(k.getText)&&v.func(k.positionAt)&&v.func(k.offsetAt))}c.is=m;function u(y,k){for(var G=y.getText(),Se=a(k,function(Xr,ti){var mc=Xr.range.start.line-ti.range.start.line;return mc===0?Xr.range.start.character-ti.range.start.character:mc}),pe=G.length,ht=Se.length-1;ht>=0;ht--){var pt=Se[ht],Nt=y.offsetAt(pt.range.start),ne=y.offsetAt(pt.range.end);if(ne<=pe)G=G.substring(0,Nt)+pt.newText+G.substring(ne,G.length);else throw new Error("Overlapping edit");pe=Nt}return G}c.applyEdits=u;function a(y,k){if(y.length<=1)return y;var G=y.length/2|0,Se=y.slice(0,G),pe=y.slice(G);a(Se,k),a(pe,k);for(var ht=0,pt=0,Nt=0;ht<Se.length&&pt<pe.length;){var ne=k(Se[ht],pe[pt]);ne<=0?y[Nt++]=Se[ht++]:y[Nt++]=pe[pt++]}for(;ht<Se.length;)y[Nt++]=Se[ht++];for(;pt<pe.length;)y[Nt++]=pe[pt++];return y}})(pc||(e.TextDocument=pc={}));var zf=function(){function c(h,m,u,a){this._uri=h,this._languageId=m,this._version=u,this._content=a,this._lineOffsets=void 0}return Object.defineProperty(c.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),c.prototype.getText=function(h){if(h){var m=this.offsetAt(h.start),u=this.offsetAt(h.end);return this._content.substring(m,u)}return this._content},c.prototype.update=function(h,m){this._content=h.text,this._version=m,this._lineOffsets=void 0},c.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var h=[],m=this._content,u=!0,a=0;a<m.length;a++){u&&(h.push(a),u=!1);var y=m.charAt(a);u=y==="\r"||y===`
65
65
  `,y==="\r"&&a+1<m.length&&m.charAt(a+1)===`
66
- `&&a++}u&&m.length>0&&h.push(m.length),this._lineOffsets=h}return this._lineOffsets},c.prototype.positionAt=function(h){h=Math.max(Math.min(h,this._content.length),0);var m=this.getLineOffsets(),u=0,a=m.length;if(a===0)return l.create(0,h);for(;u<a;){var y=Math.floor((u+a)/2);m[y]>h?a=y:u=y+1}var k=u-1;return l.create(k,h-m[k])},c.prototype.offsetAt=function(h){var m=this.getLineOffsets();if(h.line>=m.length)return this._content.length;if(h.line<0)return 0;var u=m[h.line],a=h.line+1<m.length?m[h.line+1]:this._content.length;return Math.max(Math.min(u+h.character,a),u)},Object.defineProperty(c.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),c}(),v;(function(c){var h=Object.prototype.toString;function m(re){return typeof re<"u"}c.defined=m;function u(re){return typeof re>"u"}c.undefined=u;function a(re){return re===!0||re===!1}c.boolean=a;function y(re){return h.call(re)==="[object String]"}c.string=y;function k(re){return h.call(re)==="[object Number]"}c.number=k;function J(re,Xr,ni){return h.call(re)==="[object Number]"&&Xr<=re&&re<=ni}c.numberRange=J;function Se(re){return h.call(re)==="[object Number]"&&-2147483648<=re&&re<=2147483647}c.integer=Se;function he(re){return h.call(re)==="[object Number]"&&0<=re&&re<=2147483647}c.uinteger=he;function ht(re){return h.call(re)==="[object Function]"}c.func=ht;function pt(re){return re!==null&&typeof re=="object"}c.objectLiteral=pt;function Nt(re,Xr){return Array.isArray(re)&&re.every(Xr)}c.typedArray=Nt})(v||(v={}))})});var we=M(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ProtocolNotificationType=Ge.ProtocolNotificationType0=Ge.ProtocolRequestType=Ge.ProtocolRequestType0=Ge.RegistrationType=Ge.MessageDirection=void 0;var gn=yr(),Cu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Cu||(Ge.MessageDirection=Cu={}));var za=class{constructor(e){this.method=e}};Ge.RegistrationType=za;var Ua=class extends gn.RequestType0{constructor(e){super(e)}};Ge.ProtocolRequestType0=Ua;var Ba=class extends gn.RequestType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolRequestType=Ba;var Ha=class extends gn.NotificationType0{constructor(e){super(e)}};Ge.ProtocolNotificationType0=Ha;var Za=class extends gn.NotificationType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolNotificationType=Za});var Ji=M(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.objectLiteral=xe.typedArray=xe.stringArray=xe.array=xe.func=xe.error=xe.number=xe.string=xe.boolean=void 0;function fp(t){return t===!0||t===!1}xe.boolean=fp;function Pu(t){return typeof t=="string"||t instanceof String}xe.string=Pu;function hp(t){return typeof t=="number"||t instanceof Number}xe.number=hp;function pp(t){return t instanceof Error}xe.error=pp;function mp(t){return typeof t=="function"}xe.func=mp;function xu(t){return Array.isArray(t)}xe.array=xu;function gp(t){return xu(t)&&t.every(e=>Pu(e))}xe.stringArray=gp;function yp(t,e){return Array.isArray(t)&&t.every(e)}xe.typedArray=yp;function vp(t){return t!==null&&typeof t=="object"}xe.objectLiteral=vp});var Ou=M(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.ImplementationRequest=void 0;var Du=we(),Eu;(function(t){t.method="textDocument/implementation",t.messageDirection=Du.MessageDirection.clientToServer,t.type=new Du.ProtocolRequestType(t.method)})(Eu||(Gi.ImplementationRequest=Eu={}))});var ju=M(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.TypeDefinitionRequest=void 0;var Nu=we(),Mu;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Nu.MessageDirection.clientToServer,t.type=new Nu.ProtocolRequestType(t.method)})(Mu||(Qi.TypeDefinitionRequest=Mu={}))});var Au=M(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.DidChangeWorkspaceFoldersNotification=yn.WorkspaceFoldersRequest=void 0;var Xi=we(),qu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Xi.MessageDirection.serverToClient,t.type=new Xi.ProtocolRequestType0(t.method)})(qu||(yn.WorkspaceFoldersRequest=qu={}));var Iu;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Xi.MessageDirection.clientToServer,t.type=new Xi.ProtocolNotificationType(t.method)})(Iu||(yn.DidChangeWorkspaceFoldersNotification=Iu={}))});var Fu=M(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConfigurationRequest=void 0;var Lu=we(),$u;(function(t){t.method="workspace/configuration",t.messageDirection=Lu.MessageDirection.serverToClient,t.type=new Lu.ProtocolRequestType(t.method)})($u||(Yi.ConfigurationRequest=$u={}))});var zu=M(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ColorPresentationRequest=vn.DocumentColorRequest=void 0;var Ki=we(),Wu;(function(t){t.method="textDocument/documentColor",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolRequestType(t.method)})(Wu||(vn.DocumentColorRequest=Wu={}));var Vu;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolRequestType(t.method)})(Vu||(vn.ColorPresentationRequest=Vu={}))});var Hu=M(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.FoldingRangeRefreshRequest=_n.FoldingRangeRequest=void 0;var es=we(),Uu;(function(t){t.method="textDocument/foldingRange",t.messageDirection=es.MessageDirection.clientToServer,t.type=new es.ProtocolRequestType(t.method)})(Uu||(_n.FoldingRangeRequest=Uu={}));var Bu;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=es.MessageDirection.serverToClient,t.type=new es.ProtocolRequestType0(t.method)})(Bu||(_n.FoldingRangeRefreshRequest=Bu={}))});var Gu=M(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.DeclarationRequest=void 0;var Zu=we(),Ju;(function(t){t.method="textDocument/declaration",t.messageDirection=Zu.MessageDirection.clientToServer,t.type=new Zu.ProtocolRequestType(t.method)})(Ju||(ts.DeclarationRequest=Ju={}))});var Yu=M(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.SelectionRangeRequest=void 0;var Qu=we(),Xu;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Qu.MessageDirection.clientToServer,t.type=new Qu.ProtocolRequestType(t.method)})(Xu||(rs.SelectionRangeRequest=Xu={}))});var rd=M(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.WorkDoneProgressCancelNotification=rr.WorkDoneProgressCreateRequest=rr.WorkDoneProgress=void 0;var _p=yr(),ns=we(),Ku;(function(t){t.type=new _p.ProgressType;function e(r){return r===t.type}t.is=e})(Ku||(rr.WorkDoneProgress=Ku={}));var ed;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ns.MessageDirection.serverToClient,t.type=new ns.ProtocolRequestType(t.method)})(ed||(rr.WorkDoneProgressCreateRequest=ed={}));var td;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ns.MessageDirection.clientToServer,t.type=new ns.ProtocolNotificationType(t.method)})(td||(rr.WorkDoneProgressCancelNotification=td={}))});var od=M(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.CallHierarchyOutgoingCallsRequest=nr.CallHierarchyIncomingCallsRequest=nr.CallHierarchyPrepareRequest=void 0;var bn=we(),nd;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(nd||(nr.CallHierarchyPrepareRequest=nd={}));var id;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(id||(nr.CallHierarchyIncomingCallsRequest=id={}));var sd;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(sd||(nr.CallHierarchyOutgoingCallsRequest=sd={}))});var fd=M(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.SemanticTokensRefreshRequest=Qe.SemanticTokensRangeRequest=Qe.SemanticTokensDeltaRequest=Qe.SemanticTokensRequest=Qe.SemanticTokensRegistrationType=Qe.TokenFormat=void 0;var qt=we(),ad;(function(t){t.Relative="relative"})(ad||(Qe.TokenFormat=ad={}));var Gn;(function(t){t.method="textDocument/semanticTokens",t.type=new qt.RegistrationType(t.method)})(Gn||(Qe.SemanticTokensRegistrationType=Gn={}));var cd;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(cd||(Qe.SemanticTokensRequest=cd={}));var ud;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(ud||(Qe.SemanticTokensDeltaRequest=ud={}));var dd;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(dd||(Qe.SemanticTokensRangeRequest=dd={}));var ld;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=qt.MessageDirection.serverToClient,t.type=new qt.ProtocolRequestType0(t.method)})(ld||(Qe.SemanticTokensRefreshRequest=ld={}))});var md=M(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.ShowDocumentRequest=void 0;var hd=we(),pd;(function(t){t.method="window/showDocument",t.messageDirection=hd.MessageDirection.serverToClient,t.type=new hd.ProtocolRequestType(t.method)})(pd||(is.ShowDocumentRequest=pd={}))});var vd=M(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.LinkedEditingRangeRequest=void 0;var gd=we(),yd;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=gd.MessageDirection.clientToServer,t.type=new gd.ProtocolRequestType(t.method)})(yd||(ss.LinkedEditingRangeRequest=yd={}))});var Cd=M(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.WillDeleteFilesRequest=We.DidDeleteFilesNotification=We.DidRenameFilesNotification=We.WillRenameFilesRequest=We.DidCreateFilesNotification=We.WillCreateFilesRequest=We.FileOperationPatternKind=void 0;var ot=we(),_d;(function(t){t.file="file",t.folder="folder"})(_d||(We.FileOperationPatternKind=_d={}));var bd;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(bd||(We.WillCreateFilesRequest=bd={}));var wd;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(wd||(We.DidCreateFilesNotification=wd={}));var Td;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(Td||(We.WillRenameFilesRequest=Td={}));var Rd;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(Rd||(We.DidRenameFilesNotification=Rd={}));var kd;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(kd||(We.DidDeleteFilesNotification=kd={}));var Sd;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(Sd||(We.WillDeleteFilesRequest=Sd={}))});var Od=M(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.MonikerRequest=ir.MonikerKind=ir.UniquenessLevel=void 0;var Pd=we(),xd;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(xd||(ir.UniquenessLevel=xd={}));var Dd;(function(t){t.$import="import",t.$export="export",t.local="local"})(Dd||(ir.MonikerKind=Dd={}));var Ed;(function(t){t.method="textDocument/moniker",t.messageDirection=Pd.MessageDirection.clientToServer,t.type=new Pd.ProtocolRequestType(t.method)})(Ed||(ir.MonikerRequest=Ed={}))});var qd=M(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.TypeHierarchySubtypesRequest=sr.TypeHierarchySupertypesRequest=sr.TypeHierarchyPrepareRequest=void 0;var wn=we(),Nd;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(Nd||(sr.TypeHierarchyPrepareRequest=Nd={}));var Md;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(Md||(sr.TypeHierarchySupertypesRequest=Md={}));var jd;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(jd||(sr.TypeHierarchySubtypesRequest=jd={}))});var Ld=M(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.InlineValueRefreshRequest=Tn.InlineValueRequest=void 0;var os=we(),Id;(function(t){t.method="textDocument/inlineValue",t.messageDirection=os.MessageDirection.clientToServer,t.type=new os.ProtocolRequestType(t.method)})(Id||(Tn.InlineValueRequest=Id={}));var Ad;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=os.MessageDirection.serverToClient,t.type=new os.ProtocolRequestType0(t.method)})(Ad||(Tn.InlineValueRefreshRequest=Ad={}))});var Vd=M(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.InlayHintRefreshRequest=or.InlayHintResolveRequest=or.InlayHintRequest=void 0;var Rn=we(),$d;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})($d||(or.InlayHintRequest=$d={}));var Fd;(function(t){t.method="inlayHint/resolve",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})(Fd||(or.InlayHintResolveRequest=Fd={}));var Wd;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Rn.MessageDirection.serverToClient,t.type=new Rn.ProtocolRequestType0(t.method)})(Wd||(or.InlayHintRefreshRequest=Wd={}))});var Gd=M(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.DiagnosticRefreshRequest=at.WorkspaceDiagnosticRequest=at.DocumentDiagnosticRequest=at.DocumentDiagnosticReportKind=at.DiagnosticServerCancellationData=void 0;var Jd=yr(),bp=Ji(),kn=we(),zd;(function(t){function e(r){let n=r;return n&&bp.boolean(n.retriggerRequest)}t.is=e})(zd||(at.DiagnosticServerCancellationData=zd={}));var Ud;(function(t){t.Full="full",t.Unchanged="unchanged"})(Ud||(at.DocumentDiagnosticReportKind=Ud={}));var Bd;(function(t){t.method="textDocument/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Jd.ProgressType})(Bd||(at.DocumentDiagnosticRequest=Bd={}));var Hd;(function(t){t.method="workspace/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Jd.ProgressType})(Hd||(at.WorkspaceDiagnosticRequest=Hd={}));var Zd;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=kn.MessageDirection.serverToClient,t.type=new kn.ProtocolRequestType0(t.method)})(Zd||(at.DiagnosticRefreshRequest=Zd={}))});var rl=M(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.DidCloseNotebookDocumentNotification=Ce.DidSaveNotebookDocumentNotification=Ce.DidChangeNotebookDocumentNotification=Ce.NotebookCellArrayChange=Ce.DidOpenNotebookDocumentNotification=Ce.NotebookDocumentSyncRegistrationType=Ce.NotebookDocument=Ce.NotebookCell=Ce.ExecutionSummary=Ce.NotebookCellKind=void 0;var Qn=Zi(),yt=Ji(),Rt=we(),Ja;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Ja||(Ce.NotebookCellKind=Ja={}));var Ga;(function(t){function e(i,s){let l={executionOrder:i};return(s===!0||s===!1)&&(l.success=s),l}t.create=e;function r(i){let s=i;return yt.objectLiteral(s)&&Qn.uinteger.is(s.executionOrder)&&(s.success===void 0||yt.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(Ga||(Ce.ExecutionSummary=Ga={}));var as;(function(t){function e(s,l){return{kind:s,document:l}}t.create=e;function r(s){let l=s;return yt.objectLiteral(l)&&Ja.is(l.kind)&&Qn.DocumentUri.is(l.document)&&(l.metadata===void 0||yt.objectLiteral(l.metadata))}t.is=r;function n(s,l){let p=new Set;return s.document!==l.document&&p.add("document"),s.kind!==l.kind&&p.add("kind"),s.executionSummary!==l.executionSummary&&p.add("executionSummary"),(s.metadata!==void 0||l.metadata!==void 0)&&!i(s.metadata,l.metadata)&&p.add("metadata"),(s.executionSummary!==void 0||l.executionSummary!==void 0)&&!Ga.equals(s.executionSummary,l.executionSummary)&&p.add("executionSummary"),p}t.diff=n;function i(s,l){if(s===l)return!0;if(s==null||l===null||l===void 0||typeof s!=typeof l||typeof s!="object")return!1;let p=Array.isArray(s),R=Array.isArray(l);if(p!==R)return!1;if(p&&R){if(s.length!==l.length)return!1;for(let _=0;_<s.length;_++)if(!i(s[_],l[_]))return!1}if(yt.objectLiteral(s)&&yt.objectLiteral(l)){let _=Object.keys(s),E=Object.keys(l);if(_.length!==E.length||(_.sort(),E.sort(),!i(_,E)))return!1;for(let Z=0;Z<_.length;Z++){let ue=_[Z];if(!i(s[ue],l[ue]))return!1}}return!0}})(as||(Ce.NotebookCell=as={}));var Qd;(function(t){function e(n,i,s,l){return{uri:n,notebookType:i,version:s,cells:l}}t.create=e;function r(n){let i=n;return yt.objectLiteral(i)&&yt.string(i.uri)&&Qn.integer.is(i.version)&&yt.typedArray(i.cells,as.is)}t.is=r})(Qd||(Ce.NotebookDocument=Qd={}));var Sn;(function(t){t.method="notebookDocument/sync",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.RegistrationType(t.method)})(Sn||(Ce.NotebookDocumentSyncRegistrationType=Sn={}));var Xd;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Xd||(Ce.DidOpenNotebookDocumentNotification=Xd={}));var Yd;(function(t){function e(n){let i=n;return yt.objectLiteral(i)&&Qn.uinteger.is(i.start)&&Qn.uinteger.is(i.deleteCount)&&(i.cells===void 0||yt.typedArray(i.cells,as.is))}t.is=e;function r(n,i,s){let l={start:n,deleteCount:i};return s!==void 0&&(l.cells=s),l}t.create=r})(Yd||(Ce.NotebookCellArrayChange=Yd={}));var Kd;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Kd||(Ce.DidChangeNotebookDocumentNotification=Kd={}));var el;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(el||(Ce.DidSaveNotebookDocumentNotification=el={}));var tl;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(tl||(Ce.DidCloseNotebookDocumentNotification=tl={}))});var sl=M(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.InlineCompletionRequest=void 0;var nl=we(),il;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=nl.MessageDirection.clientToServer,t.type=new nl.ProtocolRequestType(t.method)})(il||(cs.InlineCompletionRequest=il={}))});var _f=M(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.WorkspaceSymbolRequest=d.CodeActionResolveRequest=d.CodeActionRequest=d.DocumentSymbolRequest=d.DocumentHighlightRequest=d.ReferencesRequest=d.DefinitionRequest=d.SignatureHelpRequest=d.SignatureHelpTriggerKind=d.HoverRequest=d.CompletionResolveRequest=d.CompletionRequest=d.CompletionTriggerKind=d.PublishDiagnosticsNotification=d.WatchKind=d.RelativePattern=d.FileChangeType=d.DidChangeWatchedFilesNotification=d.WillSaveTextDocumentWaitUntilRequest=d.WillSaveTextDocumentNotification=d.TextDocumentSaveReason=d.DidSaveTextDocumentNotification=d.DidCloseTextDocumentNotification=d.DidChangeTextDocumentNotification=d.TextDocumentContentChangeEvent=d.DidOpenTextDocumentNotification=d.TextDocumentSyncKind=d.TelemetryEventNotification=d.LogMessageNotification=d.ShowMessageRequest=d.ShowMessageNotification=d.MessageType=d.DidChangeConfigurationNotification=d.ExitNotification=d.ShutdownRequest=d.InitializedNotification=d.InitializeErrorCodes=d.InitializeRequest=d.WorkDoneProgressOptions=d.TextDocumentRegistrationOptions=d.StaticRegistrationOptions=d.PositionEncodingKind=d.FailureHandlingKind=d.ResourceOperationKind=d.UnregistrationRequest=d.RegistrationRequest=d.DocumentSelector=d.NotebookCellTextDocumentFilter=d.NotebookDocumentFilter=d.TextDocumentFilter=void 0;d.MonikerRequest=d.MonikerKind=d.UniquenessLevel=d.WillDeleteFilesRequest=d.DidDeleteFilesNotification=d.WillRenameFilesRequest=d.DidRenameFilesNotification=d.WillCreateFilesRequest=d.DidCreateFilesNotification=d.FileOperationPatternKind=d.LinkedEditingRangeRequest=d.ShowDocumentRequest=d.SemanticTokensRegistrationType=d.SemanticTokensRefreshRequest=d.SemanticTokensRangeRequest=d.SemanticTokensDeltaRequest=d.SemanticTokensRequest=d.TokenFormat=d.CallHierarchyPrepareRequest=d.CallHierarchyOutgoingCallsRequest=d.CallHierarchyIncomingCallsRequest=d.WorkDoneProgressCancelNotification=d.WorkDoneProgressCreateRequest=d.WorkDoneProgress=d.SelectionRangeRequest=d.DeclarationRequest=d.FoldingRangeRefreshRequest=d.FoldingRangeRequest=d.ColorPresentationRequest=d.DocumentColorRequest=d.ConfigurationRequest=d.DidChangeWorkspaceFoldersNotification=d.WorkspaceFoldersRequest=d.TypeDefinitionRequest=d.ImplementationRequest=d.ApplyWorkspaceEditRequest=d.ExecuteCommandRequest=d.PrepareRenameRequest=d.RenameRequest=d.PrepareSupportDefaultBehavior=d.DocumentOnTypeFormattingRequest=d.DocumentRangesFormattingRequest=d.DocumentRangeFormattingRequest=d.DocumentFormattingRequest=d.DocumentLinkResolveRequest=d.DocumentLinkRequest=d.CodeLensRefreshRequest=d.CodeLensResolveRequest=d.CodeLensRequest=d.WorkspaceSymbolResolveRequest=void 0;d.InlineCompletionRequest=d.DidCloseNotebookDocumentNotification=d.DidSaveNotebookDocumentNotification=d.DidChangeNotebookDocumentNotification=d.NotebookCellArrayChange=d.DidOpenNotebookDocumentNotification=d.NotebookDocumentSyncRegistrationType=d.NotebookDocument=d.NotebookCell=d.ExecutionSummary=d.NotebookCellKind=d.DiagnosticRefreshRequest=d.WorkspaceDiagnosticRequest=d.DocumentDiagnosticRequest=d.DocumentDiagnosticReportKind=d.DiagnosticServerCancellationData=d.InlayHintRefreshRequest=d.InlayHintResolveRequest=d.InlayHintRequest=d.InlineValueRefreshRequest=d.InlineValueRequest=d.TypeHierarchySupertypesRequest=d.TypeHierarchySubtypesRequest=d.TypeHierarchyPrepareRequest=void 0;var C=we(),ol=Zi(),De=Ji(),wp=Ou();Object.defineProperty(d,"ImplementationRequest",{enumerable:!0,get:function(){return wp.ImplementationRequest}});var Tp=ju();Object.defineProperty(d,"TypeDefinitionRequest",{enumerable:!0,get:function(){return Tp.TypeDefinitionRequest}});var mf=Au();Object.defineProperty(d,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return mf.WorkspaceFoldersRequest}});Object.defineProperty(d,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return mf.DidChangeWorkspaceFoldersNotification}});var Rp=Fu();Object.defineProperty(d,"ConfigurationRequest",{enumerable:!0,get:function(){return Rp.ConfigurationRequest}});var gf=zu();Object.defineProperty(d,"DocumentColorRequest",{enumerable:!0,get:function(){return gf.DocumentColorRequest}});Object.defineProperty(d,"ColorPresentationRequest",{enumerable:!0,get:function(){return gf.ColorPresentationRequest}});var yf=Hu();Object.defineProperty(d,"FoldingRangeRequest",{enumerable:!0,get:function(){return yf.FoldingRangeRequest}});Object.defineProperty(d,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return yf.FoldingRangeRefreshRequest}});var kp=Gu();Object.defineProperty(d,"DeclarationRequest",{enumerable:!0,get:function(){return kp.DeclarationRequest}});var Sp=Yu();Object.defineProperty(d,"SelectionRangeRequest",{enumerable:!0,get:function(){return Sp.SelectionRangeRequest}});var ec=rd();Object.defineProperty(d,"WorkDoneProgress",{enumerable:!0,get:function(){return ec.WorkDoneProgress}});Object.defineProperty(d,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return ec.WorkDoneProgressCreateRequest}});Object.defineProperty(d,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return ec.WorkDoneProgressCancelNotification}});var tc=od();Object.defineProperty(d,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return tc.CallHierarchyIncomingCallsRequest}});Object.defineProperty(d,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return tc.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(d,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return tc.CallHierarchyPrepareRequest}});var Cn=fd();Object.defineProperty(d,"TokenFormat",{enumerable:!0,get:function(){return Cn.TokenFormat}});Object.defineProperty(d,"SemanticTokensRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRequest}});Object.defineProperty(d,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensDeltaRequest}});Object.defineProperty(d,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRangeRequest}});Object.defineProperty(d,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRefreshRequest}});Object.defineProperty(d,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Cn.SemanticTokensRegistrationType}});var Cp=md();Object.defineProperty(d,"ShowDocumentRequest",{enumerable:!0,get:function(){return Cp.ShowDocumentRequest}});var Pp=vd();Object.defineProperty(d,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return Pp.LinkedEditingRangeRequest}});var vr=Cd();Object.defineProperty(d,"FileOperationPatternKind",{enumerable:!0,get:function(){return vr.FileOperationPatternKind}});Object.defineProperty(d,"DidCreateFilesNotification",{enumerable:!0,get:function(){return vr.DidCreateFilesNotification}});Object.defineProperty(d,"WillCreateFilesRequest",{enumerable:!0,get:function(){return vr.WillCreateFilesRequest}});Object.defineProperty(d,"DidRenameFilesNotification",{enumerable:!0,get:function(){return vr.DidRenameFilesNotification}});Object.defineProperty(d,"WillRenameFilesRequest",{enumerable:!0,get:function(){return vr.WillRenameFilesRequest}});Object.defineProperty(d,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return vr.DidDeleteFilesNotification}});Object.defineProperty(d,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return vr.WillDeleteFilesRequest}});var rc=Od();Object.defineProperty(d,"UniquenessLevel",{enumerable:!0,get:function(){return rc.UniquenessLevel}});Object.defineProperty(d,"MonikerKind",{enumerable:!0,get:function(){return rc.MonikerKind}});Object.defineProperty(d,"MonikerRequest",{enumerable:!0,get:function(){return rc.MonikerRequest}});var nc=qd();Object.defineProperty(d,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return nc.TypeHierarchyPrepareRequest}});Object.defineProperty(d,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return nc.TypeHierarchySubtypesRequest}});Object.defineProperty(d,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return nc.TypeHierarchySupertypesRequest}});var vf=Ld();Object.defineProperty(d,"InlineValueRequest",{enumerable:!0,get:function(){return vf.InlineValueRequest}});Object.defineProperty(d,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return vf.InlineValueRefreshRequest}});var ic=Vd();Object.defineProperty(d,"InlayHintRequest",{enumerable:!0,get:function(){return ic.InlayHintRequest}});Object.defineProperty(d,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ic.InlayHintResolveRequest}});Object.defineProperty(d,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ic.InlayHintRefreshRequest}});var Xn=Gd();Object.defineProperty(d,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Xn.DiagnosticServerCancellationData}});Object.defineProperty(d,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Xn.DocumentDiagnosticReportKind}});Object.defineProperty(d,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Xn.DocumentDiagnosticRequest}});Object.defineProperty(d,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Xn.WorkspaceDiagnosticRequest}});Object.defineProperty(d,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Xn.DiagnosticRefreshRequest}});var kt=rl();Object.defineProperty(d,"NotebookCellKind",{enumerable:!0,get:function(){return kt.NotebookCellKind}});Object.defineProperty(d,"ExecutionSummary",{enumerable:!0,get:function(){return kt.ExecutionSummary}});Object.defineProperty(d,"NotebookCell",{enumerable:!0,get:function(){return kt.NotebookCell}});Object.defineProperty(d,"NotebookDocument",{enumerable:!0,get:function(){return kt.NotebookDocument}});Object.defineProperty(d,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return kt.NotebookDocumentSyncRegistrationType}});Object.defineProperty(d,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidOpenNotebookDocumentNotification}});Object.defineProperty(d,"NotebookCellArrayChange",{enumerable:!0,get:function(){return kt.NotebookCellArrayChange}});Object.defineProperty(d,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidChangeNotebookDocumentNotification}});Object.defineProperty(d,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidSaveNotebookDocumentNotification}});Object.defineProperty(d,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidCloseNotebookDocumentNotification}});var xp=sl();Object.defineProperty(d,"InlineCompletionRequest",{enumerable:!0,get:function(){return xp.InlineCompletionRequest}});var Qa;(function(t){function e(r){let n=r;return De.string(n)||De.string(n.language)||De.string(n.scheme)||De.string(n.pattern)}t.is=e})(Qa||(d.TextDocumentFilter=Qa={}));var Xa;(function(t){function e(r){let n=r;return De.objectLiteral(n)&&(De.string(n.notebookType)||De.string(n.scheme)||De.string(n.pattern))}t.is=e})(Xa||(d.NotebookDocumentFilter=Xa={}));var Ya;(function(t){function e(r){let n=r;return De.objectLiteral(n)&&(De.string(n.notebook)||Xa.is(n.notebook))&&(n.language===void 0||De.string(n.language))}t.is=e})(Ya||(d.NotebookCellTextDocumentFilter=Ya={}));var Ka;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!De.string(n)&&!Qa.is(n)&&!Ya.is(n))return!1;return!0}t.is=e})(Ka||(d.DocumentSelector=Ka={}));var al;(function(t){t.method="client/registerCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(al||(d.RegistrationRequest=al={}));var cl;(function(t){t.method="client/unregisterCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(cl||(d.UnregistrationRequest=cl={}));var ul;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(ul||(d.ResourceOperationKind=ul={}));var dl;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(dl||(d.FailureHandlingKind=dl={}));var ll;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(ll||(d.PositionEncodingKind=ll={}));var fl;(function(t){function e(r){let n=r;return n&&De.string(n.id)&&n.id.length>0}t.hasId=e})(fl||(d.StaticRegistrationOptions=fl={}));var hl;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||Ka.is(n.documentSelector))}t.is=e})(hl||(d.TextDocumentRegistrationOptions=hl={}));var pl;(function(t){function e(n){let i=n;return De.objectLiteral(i)&&(i.workDoneProgress===void 0||De.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&De.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(pl||(d.WorkDoneProgressOptions=pl={}));var ml;(function(t){t.method="initialize",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ml||(d.InitializeRequest=ml={}));var gl;(function(t){t.unknownProtocolVersion=1})(gl||(d.InitializeErrorCodes=gl={}));var yl;(function(t){t.method="initialized",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(yl||(d.InitializedNotification=yl={}));var vl;(function(t){t.method="shutdown",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType0(t.method)})(vl||(d.ShutdownRequest=vl={}));var _l;(function(t){t.method="exit",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType0(t.method)})(_l||(d.ExitNotification=_l={}));var bl;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(bl||(d.DidChangeConfigurationNotification=bl={}));var wl;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(wl||(d.MessageType=wl={}));var Tl;(function(t){t.method="window/showMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Tl||(d.ShowMessageNotification=Tl={}));var Rl;(function(t){t.method="window/showMessageRequest",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(Rl||(d.ShowMessageRequest=Rl={}));var kl;(function(t){t.method="window/logMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(kl||(d.LogMessageNotification=kl={}));var Sl;(function(t){t.method="telemetry/event",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Sl||(d.TelemetryEventNotification=Sl={}));var Cl;(function(t){t.None=0,t.Full=1,t.Incremental=2})(Cl||(d.TextDocumentSyncKind=Cl={}));var Pl;(function(t){t.method="textDocument/didOpen",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Pl||(d.DidOpenTextDocumentNotification=Pl={}));var xl;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(xl||(d.TextDocumentContentChangeEvent=xl={}));var Dl;(function(t){t.method="textDocument/didChange",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Dl||(d.DidChangeTextDocumentNotification=Dl={}));var El;(function(t){t.method="textDocument/didClose",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(El||(d.DidCloseTextDocumentNotification=El={}));var Ol;(function(t){t.method="textDocument/didSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Ol||(d.DidSaveTextDocumentNotification=Ol={}));var Nl;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Nl||(d.TextDocumentSaveReason=Nl={}));var Ml;(function(t){t.method="textDocument/willSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Ml||(d.WillSaveTextDocumentNotification=Ml={}));var jl;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(jl||(d.WillSaveTextDocumentWaitUntilRequest=jl={}));var ql;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(ql||(d.DidChangeWatchedFilesNotification=ql={}));var Il;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Il||(d.FileChangeType=Il={}));var Al;(function(t){function e(r){let n=r;return De.objectLiteral(n)&&(ol.URI.is(n.baseUri)||ol.WorkspaceFolder.is(n.baseUri))&&De.string(n.pattern)}t.is=e})(Al||(d.RelativePattern=Al={}));var Ll;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Ll||(d.WatchKind=Ll={}));var $l;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})($l||(d.PublishDiagnosticsNotification=$l={}));var Fl;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Fl||(d.CompletionTriggerKind=Fl={}));var Wl;(function(t){t.method="textDocument/completion",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Wl||(d.CompletionRequest=Wl={}));var Vl;(function(t){t.method="completionItem/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Vl||(d.CompletionResolveRequest=Vl={}));var zl;(function(t){t.method="textDocument/hover",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(zl||(d.HoverRequest=zl={}));var Ul;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Ul||(d.SignatureHelpTriggerKind=Ul={}));var Bl;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Bl||(d.SignatureHelpRequest=Bl={}));var Hl;(function(t){t.method="textDocument/definition",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Hl||(d.DefinitionRequest=Hl={}));var Zl;(function(t){t.method="textDocument/references",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Zl||(d.ReferencesRequest=Zl={}));var Jl;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Jl||(d.DocumentHighlightRequest=Jl={}));var Gl;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Gl||(d.DocumentSymbolRequest=Gl={}));var Ql;(function(t){t.method="textDocument/codeAction",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Ql||(d.CodeActionRequest=Ql={}));var Xl;(function(t){t.method="codeAction/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Xl||(d.CodeActionResolveRequest=Xl={}));var Yl;(function(t){t.method="workspace/symbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Yl||(d.WorkspaceSymbolRequest=Yl={}));var Kl;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Kl||(d.WorkspaceSymbolResolveRequest=Kl={}));var ef;(function(t){t.method="textDocument/codeLens",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ef||(d.CodeLensRequest=ef={}));var tf;(function(t){t.method="codeLens/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(tf||(d.CodeLensResolveRequest=tf={}));var rf;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType0(t.method)})(rf||(d.CodeLensRefreshRequest=rf={}));var nf;(function(t){t.method="textDocument/documentLink",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(nf||(d.DocumentLinkRequest=nf={}));var sf;(function(t){t.method="documentLink/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(sf||(d.DocumentLinkResolveRequest=sf={}));var of;(function(t){t.method="textDocument/formatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(of||(d.DocumentFormattingRequest=of={}));var af;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(af||(d.DocumentRangeFormattingRequest=af={}));var cf;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(cf||(d.DocumentRangesFormattingRequest=cf={}));var uf;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(uf||(d.DocumentOnTypeFormattingRequest=uf={}));var df;(function(t){t.Identifier=1})(df||(d.PrepareSupportDefaultBehavior=df={}));var lf;(function(t){t.method="textDocument/rename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(lf||(d.RenameRequest=lf={}));var ff;(function(t){t.method="textDocument/prepareRename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ff||(d.PrepareRenameRequest=ff={}));var hf;(function(t){t.method="workspace/executeCommand",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(hf||(d.ExecuteCommandRequest=hf={}));var pf;(function(t){t.method="workspace/applyEdit",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType("workspace/applyEdit")})(pf||(d.ApplyWorkspaceEditRequest=pf={}))});var wf=M(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.createProtocolConnection=void 0;var bf=yr();function Dp(t,e,r,n){return bf.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,bf.createMessageConnection)(t,e,r,n)}us.createProtocolConnection=Dp});var Rf=M(Xe=>{"use strict";var Ep=Xe&&Xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ds=Xe&&Xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ep(e,t,r)};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.LSPErrorCodes=Xe.createProtocolConnection=void 0;ds(yr(),Xe);ds(Zi(),Xe);ds(we(),Xe);ds(_f(),Xe);var Op=wf();Object.defineProperty(Xe,"createProtocolConnection",{enumerable:!0,get:function(){return Op.createProtocolConnection}});var Tf;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(Tf||(Xe.LSPErrorCodes=Tf={}))});var Sf=M(St=>{"use strict";var Np=St&&St.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),kf=St&&St.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Np(e,t,r)};Object.defineProperty(St,"__esModule",{value:!0});St.createProtocolConnection=void 0;var Mp=Va();kf(Va(),St);kf(Rf(),St);function jp(t,e,r,n){return(0,Mp.createMessageConnection)(t,e,r,n)}St.createProtocolConnection=jp});var $f=Yr(require("child_process")),ti=Yr(require("fs")),ys=Yr(require("path")),Ff=Yr(Oo()),vs=Yr(Jc()),cc=Yr(Sf());var et={};Qf(et,{BRAND:()=>om,DIRTY:()=>_r,EMPTY_PATH:()=>Lp,INVALID:()=>F,NEVER:()=>Um,OK:()=>Ve,ParseStatus:()=>Ne,Schema:()=>K,ZodAny:()=>ur,ZodArray:()=>$t,ZodBigInt:()=>wr,ZodBoolean:()=>Tr,ZodBranded:()=>Kn,ZodCatch:()=>Mr,ZodDate:()=>Rr,ZodDefault:()=>Nr,ZodDiscriminatedUnion:()=>hs,ZodEffects:()=>dt,ZodEnum:()=>Er,ZodError:()=>Ye,ZodFirstPartyTypeKind:()=>U,ZodFunction:()=>ms,ZodIntersection:()=>Pr,ZodIssueCode:()=>S,ZodLazy:()=>xr,ZodLiteral:()=>Dr,ZodMap:()=>Nn,ZodNaN:()=>jn,ZodNativeEnum:()=>Or,ZodNever:()=>vt,ZodNull:()=>Sr,ZodNullable:()=>xt,ZodNumber:()=>br,ZodObject:()=>Ke,ZodOptional:()=>ct,ZodParsedType:()=>D,ZodPipeline:()=>ei,ZodPromise:()=>dr,ZodReadonly:()=>jr,ZodRecord:()=>ps,ZodSchema:()=>K,ZodSet:()=>Mn,ZodString:()=>cr,ZodSymbol:()=>En,ZodTransformer:()=>dt,ZodTuple:()=>Pt,ZodType:()=>K,ZodUndefined:()=>kr,ZodUnion:()=>Cr,ZodUnknown:()=>Lt,ZodVoid:()=>On,addIssueToContext:()=>P,any:()=>mm,array:()=>_m,bigint:()=>dm,boolean:()=>If,coerce:()=>zm,custom:()=>Mf,date:()=>lm,datetimeRegex:()=>Of,defaultErrorMap:()=>It,discriminatedUnion:()=>Rm,effect:()=>qm,enum:()=>Nm,function:()=>Dm,getErrorMap:()=>Pn,getParsedType:()=>Ct,instanceof:()=>cm,intersection:()=>km,isAborted:()=>ls,isAsync:()=>xn,isDirty:()=>fs,isValid:()=>ar,late:()=>am,lazy:()=>Em,literal:()=>Om,makeIssue:()=>Yn,map:()=>Pm,nan:()=>um,nativeEnum:()=>Mm,never:()=>ym,null:()=>pm,nullable:()=>Am,number:()=>qf,object:()=>bm,objectUtil:()=>sc,oboolean:()=>Vm,onumber:()=>Wm,optional:()=>Im,ostring:()=>Fm,pipeline:()=>$m,preprocess:()=>Lm,promise:()=>jm,quotelessJson:()=>qp,record:()=>Cm,set:()=>xm,setErrorMap:()=>Ap,strictObject:()=>wm,string:()=>jf,symbol:()=>fm,transformer:()=>qm,tuple:()=>Sm,undefined:()=>hm,union:()=>Tm,unknown:()=>gm,util:()=>te,void:()=>vm});var te;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let l of i)s[l]=l;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),l={};for(let p of s)l[p]=i[p];return t.objectValues(l)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},t.find=(i,s)=>{for(let l of i)if(s(l))return l},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(te||(te={}));var sc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(sc||(sc={}));var D=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ct=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}};var S=te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ye=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let p=n,R=0;for(;R<l.path.length;){let _=l.path[R];R===l.path.length-1?(p[_]=p[_]||{_errors:[]},p[_]._errors.push(r(l))):p[_]=p[_]||{_errors:[]},p=p[_],R++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ye.create=t=>new Ye(t);var Ip=(t,e)=>{let r;switch(t.code){case S.invalid_type:t.received===D.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case S.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,te.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(t.keys,", ")}`;break;case S.invalid_union:r="Invalid input";break;case S.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(t.options)}`;break;case S.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(t.options)}, received '${t.received}'`;break;case S.invalid_arguments:r="Invalid function arguments";break;case S.invalid_return_type:r="Invalid function return type";break;case S.invalid_date:r="Invalid date";break;case S.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case S.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case S.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case S.custom:r="Invalid input";break;case S.invalid_intersection_types:r="Intersection results could not be merged";break;case S.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case S.not_finite:r="Number must be finite";break;default:r=e.defaultError,te.assertNever(t)}return{message:r}},It=Ip;var Cf=It;function Ap(t){Cf=t}function Pn(){return Cf}var Yn=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],l={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let p="",R=n.filter(_=>!!_).slice().reverse();for(let _ of R)p=_(l,{data:e,defaultError:p}).message;return{...i,path:s,message:p}},Lp=[];function P(t,e){let r=Pn(),n=Yn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===It?void 0:It].filter(i=>!!i)});t.common.issues.push(n)}var Ne=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return F;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let s=await i.key,l=await i.value;n.push({key:s,value:l})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return F;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[s.value]=l.value)}return{status:e.value,value:n}}},F=Object.freeze({status:"aborted"}),_r=t=>({status:"dirty",value:t}),Ve=t=>({status:"valid",value:t}),ls=t=>t.status==="aborted",fs=t=>t.status==="dirty",ar=t=>t.status==="valid",xn=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(j||(j={}));var ut=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Pf=(t,e)=>{if(ar(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ye(t.common.issues);return this._error=r,this._error}}};function Y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,p)=>{let{message:R}=t;return l.code==="invalid_enum_value"?{message:R??p.defaultError}:typeof p.data>"u"?{message:R??n??p.defaultError}:l.code!=="invalid_type"?{message:p.defaultError}:{message:R??r??p.defaultError}},description:i}}var K=class{get description(){return this._def.description}_getType(e){return Ct(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ne,ctx:{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(xn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parseSync({data:e,path:n.path,parent:n});return Pf(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return ar(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ar(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(xn(i)?i:Promise.resolve(i));return Pf(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let l=e(i),p=()=>s.addIssue({code:S.custom,...n(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(R=>R?!0:(p(),!1)):l?!0:(p(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new dt({schema:this,typeName:U.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ct.create(this,this._def)}nullable(){return xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $t.create(this)}promise(){return dr.create(this,this._def)}or(e){return Cr.create([this,e],this._def)}and(e){return Pr.create(this,e,this._def)}transform(e){return new dt({...Y(this._def),schema:this,typeName:U.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Nr({...Y(this._def),innerType:this,defaultValue:r,typeName:U.ZodDefault})}brand(){return new Kn({typeName:U.ZodBranded,type:this,...Y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mr({...Y(this._def),innerType:this,catchValue:r,typeName:U.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ei.create(this,e)}readonly(){return jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$p=/^c[^\s-]{8,}$/i,Fp=/^[0-9a-z]+$/,Wp=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,zp=/^[a-z0-9_-]{21}$/i,Up=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Bp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Hp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",oc,Jp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Qp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Xp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Df="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",em=new RegExp(`^${Df}$`);function Ef(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function tm(t){return new RegExp(`^${Ef(t)}$`)}function Of(t){let e=`${Df}T${Ef(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function rm(t,e){return!!((e==="v4"||!e)&&Jp.test(t)||(e==="v6"||!e)&&Qp.test(t))}function nm(t,e){if(!Up.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function im(t,e){return!!((e==="v4"||!e)&&Gp.test(t)||(e==="v6"||!e)&&Xp.test(t))}var cr=class t extends K{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_type,expected:D.string,received:s.parsedType}),F}let n=new Ne,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let l=e.data.length>s.value,p=e.data.length<s.value;(l||p)&&(i=this._getOrReturnCtx(e,i),l?P(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):p&&P(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Hp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"email",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")oc||(oc=new RegExp(Zp,"u")),oc.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"emoji",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Vp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"uuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")zp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"nanoid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")$p.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Fp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid2",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Wp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ulid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),P(i,{validation:"url",code:S.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"regex",code:S.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Of(s).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?em.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?tm(s).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Bp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"duration",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?rm(e.data,s.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ip",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?nm(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"jwt",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?im(e.data,s.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cidr",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Yp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Kp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64url",code:S.invalid_string,message:s.message}),n.dirty()):te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:S.invalid_string,...j.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...j.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...j.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...j.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...j.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...j.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...j.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...j.errToObj(r)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cr.create=t=>new cr({checks:[],typeName:U.ZodString,coerce:t?.coerce??!1,...Y(t)});function sm(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),l=Number.parseInt(e.toFixed(i).replace(".",""));return s%l/10**i}var br=class t extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_type,expected:D.number,received:s.parsedType}),F}let n,i=new Ne;for(let s of this._def.checks)s.kind==="int"?te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?sm(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:S.not_finite,message:s.message}),i.dirty()):te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};br.create=t=>new br({checks:[],typeName:U.ZodNumber,coerce:t?.coerce||!1,...Y(t)});var wr=class t extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let n,i=new Ne;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):te.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return P(r,{code:S.invalid_type,expected:D.bigint,received:r.parsedType}),F}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};wr.create=t=>new wr({checks:[],typeName:U.ZodBigInt,coerce:t?.coerce??!1,...Y(t)});var Tr=class extends K{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.boolean,received:n.parsedType}),F}return Ve(e.data)}};Tr.create=t=>new Tr({typeName:U.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});var Rr=class t extends K{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_type,expected:D.date,received:s.parsedType}),F}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_date}),F}let n=new Ne,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Rr.create=t=>new Rr({checks:[],coerce:t?.coerce||!1,typeName:U.ZodDate,...Y(t)});var En=class extends K{_parse(e){if(this._getType(e)!==D.symbol){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.symbol,received:n.parsedType}),F}return Ve(e.data)}};En.create=t=>new En({typeName:U.ZodSymbol,...Y(t)});var kr=class extends K{_parse(e){if(this._getType(e)!==D.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.undefined,received:n.parsedType}),F}return Ve(e.data)}};kr.create=t=>new kr({typeName:U.ZodUndefined,...Y(t)});var Sr=class extends K{_parse(e){if(this._getType(e)!==D.null){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.null,received:n.parsedType}),F}return Ve(e.data)}};Sr.create=t=>new Sr({typeName:U.ZodNull,...Y(t)});var ur=class extends K{constructor(){super(...arguments),this._any=!0}_parse(e){return Ve(e.data)}};ur.create=t=>new ur({typeName:U.ZodAny,...Y(t)});var Lt=class extends K{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ve(e.data)}};Lt.create=t=>new Lt({typeName:U.ZodUnknown,...Y(t)});var vt=class extends K{_parse(e){let r=this._getOrReturnCtx(e);return P(r,{code:S.invalid_type,expected:D.never,received:r.parsedType}),F}};vt.create=t=>new vt({typeName:U.ZodNever,...Y(t)});var On=class extends K{_parse(e){if(this._getType(e)!==D.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.void,received:n.parsedType}),F}return Ve(e.data)}};On.create=t=>new On({typeName:U.ZodVoid,...Y(t)});var $t=class t extends K{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==D.array)return P(r,{code:S.invalid_type,expected:D.array,received:r.parsedType}),F;if(i.exactLength!==null){let l=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(l||p)&&(P(r,{code:l?S.too_big:S.too_small,minimum:p?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(P(r,{code:S.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(P(r,{code:S.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,p)=>i.type._parseAsync(new ut(r,l,r.path,p)))).then(l=>Ne.mergeArray(n,l));let s=[...r.data].map((l,p)=>i.type._parseSync(new ut(r,l,r.path,p)));return Ne.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:j.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:j.toString(r)}})}nonempty(e){return this.min(1,e)}};$t.create=(t,e)=>new $t({type:t,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...Y(e)});function Dn(t){if(t instanceof Ke){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ct.create(Dn(n))}return new Ke({...t._def,shape:()=>e})}else return t instanceof $t?new $t({...t._def,type:Dn(t.element)}):t instanceof ct?ct.create(Dn(t.unwrap())):t instanceof xt?xt.create(Dn(t.unwrap())):t instanceof Pt?Pt.create(t.items.map(e=>Dn(e))):t}var Ke=class t extends K{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=te.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==D.object){let _=this._getOrReturnCtx(e);return P(_,{code:S.invalid_type,expected:D.object,received:_.parsedType}),F}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),p=[];if(!(this._def.catchall instanceof vt&&this._def.unknownKeys==="strip"))for(let _ in i.data)l.includes(_)||p.push(_);let R=[];for(let _ of l){let E=s[_],Z=i.data[_];R.push({key:{status:"valid",value:_},value:E._parse(new ut(i,Z,i.path,_)),alwaysSet:_ in i.data})}if(this._def.catchall instanceof vt){let _=this._def.unknownKeys;if(_==="passthrough")for(let E of p)R.push({key:{status:"valid",value:E},value:{status:"valid",value:i.data[E]}});else if(_==="strict")p.length>0&&(P(i,{code:S.unrecognized_keys,keys:p}),n.dirty());else if(_!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let _=this._def.catchall;for(let E of p){let Z=i.data[E];R.push({key:{status:"valid",value:E},value:_._parse(new ut(i,Z,i.path,E)),alwaysSet:E in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let _=[];for(let E of R){let Z=await E.key,ue=await E.value;_.push({key:Z,value:ue,alwaysSet:E.alwaysSet})}return _}).then(_=>Ne.mergeObjectSync(n,_)):Ne.mergeObjectSync(n,R)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:j.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:U.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of te.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of te.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Dn(this)}partial(e){let r={};for(let n of te.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of te.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ct;)s=s._def.innerType;r[n]=s}return new t({...this._def,shape:()=>r})}keyof(){return Nf(te.objectKeys(this.shape))}};Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});var Cr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let p of s)if(p.result.status==="valid")return p.result;for(let p of s)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let l=s.map(p=>new Ye(p.ctx.common.issues));return P(r,{code:S.invalid_union,unionErrors:l}),F}if(r.common.async)return Promise.all(n.map(async s=>{let l={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let s,l=[];for(let R of n){let _={...r,common:{...r.common,issues:[]},parent:null},E=R._parseSync({data:r.data,path:r.path,parent:_});if(E.status==="valid")return E;E.status==="dirty"&&!s&&(s={result:E,ctx:_}),_.common.issues.length&&l.push(_.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let p=l.map(R=>new Ye(R));return P(r,{code:S.invalid_union,unionErrors:p}),F}}get options(){return this._def.options}};Cr.create=(t,e)=>new Cr({options:t,typeName:U.ZodUnion,...Y(e)});var At=t=>t instanceof xr?At(t.schema):t instanceof dt?At(t.innerType()):t instanceof Dr?[t.value]:t instanceof Er?t.options:t instanceof Or?te.objectValues(t.enum):t instanceof Nr?At(t._def.innerType):t instanceof kr?[void 0]:t instanceof Sr?[null]:t instanceof ct?[void 0,...At(t.unwrap())]:t instanceof xt?[null,...At(t.unwrap())]:t instanceof Kn||t instanceof jr?At(t.unwrap()):t instanceof Mr?At(t._def.innerType):[],hs=class t extends K{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.object)return P(r,{code:S.invalid_type,expected:D.object,received:r.parsedType}),F;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(P(r,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),F)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let l=At(s.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of l){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,s)}}return new t({typeName:U.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Y(n)})}};function ac(t,e){let r=Ct(t),n=Ct(e);if(t===e)return{valid:!0,data:t};if(r===D.object&&n===D.object){let i=te.objectKeys(e),s=te.objectKeys(t).filter(p=>i.indexOf(p)!==-1),l={...t,...e};for(let p of s){let R=ac(t[p],e[p]);if(!R.valid)return{valid:!1};l[p]=R.data}return{valid:!0,data:l}}else if(r===D.array&&n===D.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let l=t[s],p=e[s],R=ac(l,p);if(!R.valid)return{valid:!1};i.push(R.data)}return{valid:!0,data:i}}else return r===D.date&&n===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pr=class extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,l)=>{if(ls(s)||ls(l))return F;let p=ac(s.value,l.value);return p.valid?((fs(s)||fs(l))&&r.dirty(),{status:r.value,value:p.data}):(P(n,{code:S.invalid_intersection_types}),F)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Pr.create=(t,e,r)=>new Pr({left:t,right:e,typeName:U.ZodIntersection,...Y(r)});var Pt=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.array)return P(n,{code:S.invalid_type,expected:D.array,received:n.parsedType}),F;if(n.data.length<this._def.items.length)return P(n,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F;!this._def.rest&&n.data.length>this._def.items.length&&(P(n,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((l,p)=>{let R=this._def.items[p]||this._def.rest;return R?R._parse(new ut(n,l,n.path,p)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>Ne.mergeArray(r,l)):Ne.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pt({items:t,typeName:U.ZodTuple,rest:null,...Y(e)})};var ps=class t extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.object)return P(n,{code:S.invalid_type,expected:D.object,received:n.parsedType}),F;let i=[],s=this._def.keyType,l=this._def.valueType;for(let p in n.data)i.push({key:s._parse(new ut(n,p,n.path,p)),value:l._parse(new ut(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Ne.mergeObjectAsync(r,i):Ne.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof K?new t({keyType:e,valueType:r,typeName:U.ZodRecord,...Y(n)}):new t({keyType:cr.create(),valueType:e,typeName:U.ZodRecord,...Y(r)})}},Nn=class extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.map)return P(n,{code:S.invalid_type,expected:D.map,received:n.parsedType}),F;let i=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([p,R],_)=>({key:i._parse(new ut(n,p,n.path,[_,"key"])),value:s._parse(new ut(n,R,n.path,[_,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let R of l){let _=await R.key,E=await R.value;if(_.status==="aborted"||E.status==="aborted")return F;(_.status==="dirty"||E.status==="dirty")&&r.dirty(),p.set(_.value,E.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let R of l){let _=R.key,E=R.value;if(_.status==="aborted"||E.status==="aborted")return F;(_.status==="dirty"||E.status==="dirty")&&r.dirty(),p.set(_.value,E.value)}return{status:r.value,value:p}}}};Nn.create=(t,e,r)=>new Nn({valueType:e,keyType:t,typeName:U.ZodMap,...Y(r)});var Mn=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.set)return P(n,{code:S.invalid_type,expected:D.set,received:n.parsedType}),F;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(P(n,{code:S.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(P(n,{code:S.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function l(R){let _=new Set;for(let E of R){if(E.status==="aborted")return F;E.status==="dirty"&&r.dirty(),_.add(E.value)}return{status:r.value,value:_}}let p=[...n.data.values()].map((R,_)=>s._parse(new ut(n,R,n.path,_)));return n.common.async?Promise.all(p).then(R=>l(R)):l(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:j.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Mn.create=(t,e)=>new Mn({valueType:t,minSize:null,maxSize:null,typeName:U.ZodSet,...Y(e)});var ms=class t extends K{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.function)return P(r,{code:S.invalid_type,expected:D.function,received:r.parsedType}),F;function n(p,R){return Yn({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(_=>!!_),issueData:{code:S.invalid_arguments,argumentsError:R}})}function i(p,R){return Yn({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(_=>!!_),issueData:{code:S.invalid_return_type,returnTypeError:R}})}let s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof dr){let p=this;return Ve(async function(...R){let _=new Ye([]),E=await p._def.args.parseAsync(R,s).catch(ee=>{throw _.addIssue(n(R,ee)),_}),Z=await Reflect.apply(l,this,E);return await p._def.returns._def.type.parseAsync(Z,s).catch(ee=>{throw _.addIssue(i(Z,ee)),_})})}else{let p=this;return Ve(function(...R){let _=p._def.args.safeParse(R,s);if(!_.success)throw new Ye([n(R,_.error)]);let E=Reflect.apply(l,this,_.data),Z=p._def.returns.safeParse(E,s);if(!Z.success)throw new Ye([i(E,Z.error)]);return Z.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pt.create(e).rest(Lt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Pt.create([]).rest(Lt.create()),returns:r||Lt.create(),typeName:U.ZodFunction,...Y(n)})}},xr=class extends K{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};xr.create=(t,e)=>new xr({getter:t,typeName:U.ZodLazy,...Y(e)});var Dr=class extends K{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return P(r,{received:r.data,code:S.invalid_literal,expected:this._def.value}),F}return{status:"valid",value:e.data}}get value(){return this._def.value}};Dr.create=(t,e)=>new Dr({value:t,typeName:U.ZodLiteral,...Y(e)});function Nf(t,e){return new Er({values:t,typeName:U.ZodEnum,...Y(e)})}var Er=class t extends K{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{expected:te.joinValues(n),received:r.parsedType,code:S.invalid_type}),F}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{received:r.data,code:S.invalid_enum_value,options:n}),F}return Ve(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Er.create=Nf;var Or=class extends K{_parse(e){let r=te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==D.string&&n.parsedType!==D.number){let i=te.objectValues(r);return P(n,{expected:te.joinValues(i),received:n.parsedType,code:S.invalid_type}),F}if(this._cache||(this._cache=new Set(te.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=te.objectValues(r);return P(n,{received:n.data,code:S.invalid_enum_value,options:i}),F}return Ve(e.data)}get enum(){return this._def.values}};Or.create=(t,e)=>new Or({values:t,typeName:U.ZodNativeEnum,...Y(e)});var dr=class extends K{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.promise&&r.common.async===!1)return P(r,{code:S.invalid_type,expected:D.promise,received:r.parsedType}),F;let n=r.parsedType===D.promise?r.data:Promise.resolve(r.data);return Ve(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dr.create=(t,e)=>new dr({type:t,typeName:U.ZodPromise,...Y(e)});var dt=class extends K{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===U.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:l=>{P(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let l=i.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async p=>{if(r.value==="aborted")return F;let R=await this._def.schema._parseAsync({data:p,path:n.path,parent:n});return R.status==="aborted"?F:R.status==="dirty"?_r(R.value):r.value==="dirty"?_r(R.value):R});{if(r.value==="aborted")return F;let p=this._def.schema._parseSync({data:l,path:n.path,parent:n});return p.status==="aborted"?F:p.status==="dirty"?_r(p.value):r.value==="dirty"?_r(p.value):p}}if(i.type==="refinement"){let l=p=>{let R=i.refinement(p,s);if(n.common.async)return Promise.resolve(R);if(R instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?F:(p.status==="dirty"&&r.dirty(),l(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?F:(p.status==="dirty"&&r.dirty(),l(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ar(l))return F;let p=i.transform(l.value,s);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>ar(l)?Promise.resolve(i.transform(l.value,s)).then(p=>({status:r.value,value:p})):F);te.assertNever(i)}};dt.create=(t,e,r)=>new dt({schema:t,typeName:U.ZodEffects,effect:e,...Y(r)});dt.createWithPreprocess=(t,e,r)=>new dt({schema:e,effect:{type:"preprocess",transform:t},typeName:U.ZodEffects,...Y(r)});var ct=class extends K{_parse(e){return this._getType(e)===D.undefined?Ve(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ct.create=(t,e)=>new ct({innerType:t,typeName:U.ZodOptional,...Y(e)});var xt=class extends K{_parse(e){return this._getType(e)===D.null?Ve(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};xt.create=(t,e)=>new xt({innerType:t,typeName:U.ZodNullable,...Y(e)});var Nr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===D.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Nr.create=(t,e)=>new Nr({innerType:t,typeName:U.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});var Mr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return xn(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:U.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});var jn=class extends K{_parse(e){if(this._getType(e)!==D.nan){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.nan,received:n.parsedType}),F}return{status:"valid",value:e.data}}};jn.create=t=>new jn({typeName:U.ZodNaN,...Y(t)});var om=Symbol("zod_brand"),Kn=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ei=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?F:s.status==="dirty"?(r.dirty(),_r(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?F:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:U.ZodPipeline})}},jr=class extends K{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ar(i)&&(i.value=Object.freeze(i.value)),i);return xn(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};jr.create=(t,e)=>new jr({innerType:t,typeName:U.ZodReadonly,...Y(e)});function xf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Mf(t,e={},r){return t?ur.create().superRefine((n,i)=>{let s=t(n);if(s instanceof Promise)return s.then(l=>{if(!l){let p=xf(e,n),R=p.fatal??r??!0;i.addIssue({code:"custom",...p,fatal:R})}});if(!s){let l=xf(e,n),p=l.fatal??r??!0;i.addIssue({code:"custom",...l,fatal:p})}}):ur.create()}var am={object:Ke.lazycreate},U;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(U||(U={}));var cm=(t,e={message:`Input not instance of ${t.name}`})=>Mf(r=>r instanceof t,e),jf=cr.create,qf=br.create,um=jn.create,dm=wr.create,If=Tr.create,lm=Rr.create,fm=En.create,hm=kr.create,pm=Sr.create,mm=ur.create,gm=Lt.create,ym=vt.create,vm=On.create,_m=$t.create,bm=Ke.create,wm=Ke.strictCreate,Tm=Cr.create,Rm=hs.create,km=Pr.create,Sm=Pt.create,Cm=ps.create,Pm=Nn.create,xm=Mn.create,Dm=ms.create,Em=xr.create,Om=Dr.create,Nm=Er.create,Mm=Or.create,jm=dr.create,qm=dt.create,Im=ct.create,Am=xt.create,Lm=dt.createWithPreprocess,$m=ei.create,Fm=()=>jf().optional(),Wm=()=>qf().optional(),Vm=()=>If().optional(),zm={string:t=>cr.create({...t,coerce:!0}),number:t=>br.create({...t,coerce:!0}),boolean:t=>Tr.create({...t,coerce:!0}),bigint:t=>wr.create({...t,coerce:!0}),date:t=>Rr.create({...t,coerce:!0})};var Um=F;var Wf=require("node:util"),Bm=__dirname.endsWith("src"),Hm=Bm?ys.default.join(__dirname,"..","dist","server.js"):ys.default.join(__dirname,"server.js");function Zm(t){let e=ys.default.resolve(t);return e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e),`file://${e}`}function Jm(){let t=process.env;return!!(t.CI&&(t.GITHUB_ACTIONS||t.GITLAB_CI||t.BITBUCKET_BUILD_NUMBER||t.CIRCLECI||t.TRAVIS))}var Vf=Jm(),lc=()=>Vf?"::group::":"",fc=()=>Vf?"::endgroup::":"",Gm=et.object({files:et.array(et.string(),{required_error:"Missing --files"}),includes:et.array(et.string()).optional().default([]),bindings:et.array(et.string()).optional().default([]),logLevel:et.enum(["none","verbose"]).optional().default("none"),formatting:et.boolean().optional().default(!1),diagnostics:et.boolean().optional().default(!1),outFile:et.string().optional()}),{values:Qm}=(0,Wf.parseArgs)({options:{files:{type:"string",multiple:!0},includes:{type:"string",multiple:!0},bindings:{type:"string",multiple:!0},logLevel:{type:"string"},formatting:{type:"boolean"},diagnostics:{type:"boolean"},outFile:{type:"string"}},strict:!0}),uc=Gm.safeParse(Qm);uc.success||(console.error(`\u274C Invalid CLI input:
67
- `,uc.error.format()),process.exit(1));var qr=uc.data,zf=qr.files,Xm=qr.includes,Ym=qr.bindings,Km=qr.logLevel,Af=qr.formatting,Lf=qr.diagnostics,eg=qr.outFile;tg(zf,Km,Xm,Ym,eg).catch(t=>{console.error("Error validating files:",t),process.exit(1)});var qn=0,ri=zf.length;async function tg(t,e,r,n,i){let s=$f.default.spawn(Hm,["--stdio"],{stdio:["pipe","pipe","pipe"]});s.stderr.on("data",ee=>{console.error("LSP stderr:",ee.toString())});let l=(0,Ff.createMessageConnection)(new vs.StreamMessageReader(s.stdout),new vs.StreamMessageWriter(s.stdin));e==="verbose"&&l.onNotification("window/logMessage",ee=>{let le={1:"ERROR",2:"WARN",3:"INFO",4:"LOG"}[ee.type]||"LOG";console.log(`[LSP ${le}] ${ee.message}`)}),l.onRequest("workspace/workspaceFolders",()=>[{uri:`file://${process.cwd()}`,name:"root"}]),l.listen(),l.sendNotification("workspace/didChangeConfiguration",{settings:{devicetree:{defaultIncludePaths:r,defaultBindingType:"Zephyr",defaultZephyrBindings:n,autoChangeContext:!0,allowAdhocContexts:!0,defaultLockRenameEdits:[]}}});let p=[{uri:Zm(process.cwd()),name:"root"}];await l.sendRequest("initialize",{processId:process.pid,rootUri:`file://${process.cwd()}`,capabilities:{},workspaceFolders:p}),await l.sendNotification("initialized");let R=new Set,_=[],E=Array.from(new Set(t)).sort((ee,ze)=>{let le=de=>de.endsWith(".dts")?0:de.endsWith(".dtsi")?1:2;return le(ee)-le(ze)}),Z=[],ue=[];for(let ee of E){qn++;let ze=ti.default.readFileSync(ee,"utf8"),le={uri:`file://${ee}`,languageId:"devicetree",version:0,text:ze};l.sendNotification("textDocument/didOpen",{textDocument:le});let de=await ig(l),Ue=ee.endsWith(".overlay")?[de.mainDtsPath.file]:[...dc(de.mainDtsPath),...de.overlays.flatMap(dc)];await Promise.all(Ue.map(async oe=>{if(!(R.has(oe)||oe.endsWith(".h")||!(0,ti.existsSync)(oe))){if(Af){let O=await rg(l,oe);R.add(oe),O&&(Z.push({file:oe,context:de}),i&&_.push(O))}if(Lf&&ee.endsWith(".dts")){let O=await ng(l,oe);O?.length&&ue.push({file:oe,context:de,message:O.map(fe=>`${fe.message}: {${JSON.stringify(fe.range.start)}}-{${JSON.stringify(fe.range.end)}}`).join(`
68
- `)})}else console.log(`[${qn}/${ri}] \u26A0\uFE0F Skipping ${oe} diagnostic check. Check can only be done on full context!`)}})),l.sendNotification("textDocument/didClose",{textDocument:{uri:`file://${ee}`}}),await sg(l)}i&&ti.default.writeFileSync(i,_.join(`
66
+ `&&a++}u&&m.length>0&&h.push(m.length),this._lineOffsets=h}return this._lineOffsets},c.prototype.positionAt=function(h){h=Math.max(Math.min(h,this._content.length),0);var m=this.getLineOffsets(),u=0,a=m.length;if(a===0)return d.create(0,h);for(;u<a;){var y=Math.floor((u+a)/2);m[y]>h?a=y:u=y+1}var k=u-1;return d.create(k,h-m[k])},c.prototype.offsetAt=function(h){var m=this.getLineOffsets();if(h.line>=m.length)return this._content.length;if(h.line<0)return 0;var u=m[h.line],a=h.line+1<m.length?m[h.line+1]:this._content.length;return Math.max(Math.min(u+h.character,a),u)},Object.defineProperty(c.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),c}(),v;(function(c){var h=Object.prototype.toString;function m(ne){return typeof ne<"u"}c.defined=m;function u(ne){return typeof ne>"u"}c.undefined=u;function a(ne){return ne===!0||ne===!1}c.boolean=a;function y(ne){return h.call(ne)==="[object String]"}c.string=y;function k(ne){return h.call(ne)==="[object Number]"}c.number=k;function G(ne,Xr,ti){return h.call(ne)==="[object Number]"&&Xr<=ne&&ne<=ti}c.numberRange=G;function Se(ne){return h.call(ne)==="[object Number]"&&-2147483648<=ne&&ne<=2147483647}c.integer=Se;function pe(ne){return h.call(ne)==="[object Number]"&&0<=ne&&ne<=2147483647}c.uinteger=pe;function ht(ne){return h.call(ne)==="[object Function]"}c.func=ht;function pt(ne){return ne!==null&&typeof ne=="object"}c.objectLiteral=pt;function Nt(ne,Xr){return Array.isArray(ne)&&ne.every(Xr)}c.typedArray=Nt})(v||(v={}))})});var we=N(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ProtocolNotificationType=Ge.ProtocolNotificationType0=Ge.ProtocolRequestType=Ge.ProtocolRequestType0=Ge.RegistrationType=Ge.MessageDirection=void 0;var gn=yr(),ku;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(ku||(Ge.MessageDirection=ku={}));var Wa=class{constructor(e){this.method=e}};Ge.RegistrationType=Wa;var Va=class extends gn.RequestType0{constructor(e){super(e)}};Ge.ProtocolRequestType0=Va;var za=class extends gn.RequestType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolRequestType=za;var Ua=class extends gn.NotificationType0{constructor(e){super(e)}};Ge.ProtocolNotificationType0=Ua;var Ba=class extends gn.NotificationType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolNotificationType=Ba});var Hi=N(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.objectLiteral=xe.typedArray=xe.stringArray=xe.array=xe.func=xe.error=xe.number=xe.string=xe.boolean=void 0;function lp(t){return t===!0||t===!1}xe.boolean=lp;function Su(t){return typeof t=="string"||t instanceof String}xe.string=Su;function fp(t){return typeof t=="number"||t instanceof Number}xe.number=fp;function hp(t){return t instanceof Error}xe.error=hp;function pp(t){return typeof t=="function"}xe.func=pp;function Cu(t){return Array.isArray(t)}xe.array=Cu;function mp(t){return Cu(t)&&t.every(e=>Su(e))}xe.stringArray=mp;function gp(t,e){return Array.isArray(t)&&t.every(e)}xe.typedArray=gp;function yp(t){return t!==null&&typeof t=="object"}xe.objectLiteral=yp});var Du=N(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ImplementationRequest=void 0;var Pu=we(),xu;(function(t){t.method="textDocument/implementation",t.messageDirection=Pu.MessageDirection.clientToServer,t.type=new Pu.ProtocolRequestType(t.method)})(xu||(Zi.ImplementationRequest=xu={}))});var Nu=N(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.TypeDefinitionRequest=void 0;var Eu=we(),Ou;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Eu.MessageDirection.clientToServer,t.type=new Eu.ProtocolRequestType(t.method)})(Ou||(Ji.TypeDefinitionRequest=Ou={}))});var qu=N(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.DidChangeWorkspaceFoldersNotification=yn.WorkspaceFoldersRequest=void 0;var Gi=we(),Mu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Gi.MessageDirection.serverToClient,t.type=new Gi.ProtocolRequestType0(t.method)})(Mu||(yn.WorkspaceFoldersRequest=Mu={}));var ju;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Gi.MessageDirection.clientToServer,t.type=new Gi.ProtocolNotificationType(t.method)})(ju||(yn.DidChangeWorkspaceFoldersNotification=ju={}))});var Lu=N(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ConfigurationRequest=void 0;var Iu=we(),Au;(function(t){t.method="workspace/configuration",t.messageDirection=Iu.MessageDirection.serverToClient,t.type=new Iu.ProtocolRequestType(t.method)})(Au||(Qi.ConfigurationRequest=Au={}))});var Wu=N(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ColorPresentationRequest=vn.DocumentColorRequest=void 0;var Xi=we(),$u;(function(t){t.method="textDocument/documentColor",t.messageDirection=Xi.MessageDirection.clientToServer,t.type=new Xi.ProtocolRequestType(t.method)})($u||(vn.DocumentColorRequest=$u={}));var Fu;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Xi.MessageDirection.clientToServer,t.type=new Xi.ProtocolRequestType(t.method)})(Fu||(vn.ColorPresentationRequest=Fu={}))});var Uu=N(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.FoldingRangeRefreshRequest=_n.FoldingRangeRequest=void 0;var Yi=we(),Vu;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Yi.MessageDirection.clientToServer,t.type=new Yi.ProtocolRequestType(t.method)})(Vu||(_n.FoldingRangeRequest=Vu={}));var zu;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Yi.MessageDirection.serverToClient,t.type=new Yi.ProtocolRequestType0(t.method)})(zu||(_n.FoldingRangeRefreshRequest=zu={}))});var Zu=N(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.DeclarationRequest=void 0;var Bu=we(),Hu;(function(t){t.method="textDocument/declaration",t.messageDirection=Bu.MessageDirection.clientToServer,t.type=new Bu.ProtocolRequestType(t.method)})(Hu||(Ki.DeclarationRequest=Hu={}))});var Qu=N(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.SelectionRangeRequest=void 0;var Ju=we(),Gu;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Ju.MessageDirection.clientToServer,t.type=new Ju.ProtocolRequestType(t.method)})(Gu||(es.SelectionRangeRequest=Gu={}))});var ed=N(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.WorkDoneProgressCancelNotification=rr.WorkDoneProgressCreateRequest=rr.WorkDoneProgress=void 0;var vp=yr(),ts=we(),Xu;(function(t){t.type=new vp.ProgressType;function e(r){return r===t.type}t.is=e})(Xu||(rr.WorkDoneProgress=Xu={}));var Yu;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ts.MessageDirection.serverToClient,t.type=new ts.ProtocolRequestType(t.method)})(Yu||(rr.WorkDoneProgressCreateRequest=Yu={}));var Ku;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ts.MessageDirection.clientToServer,t.type=new ts.ProtocolNotificationType(t.method)})(Ku||(rr.WorkDoneProgressCancelNotification=Ku={}))});var id=N(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.CallHierarchyOutgoingCallsRequest=nr.CallHierarchyIncomingCallsRequest=nr.CallHierarchyPrepareRequest=void 0;var bn=we(),td;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(td||(nr.CallHierarchyPrepareRequest=td={}));var rd;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(rd||(nr.CallHierarchyIncomingCallsRequest=rd={}));var nd;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(nd||(nr.CallHierarchyOutgoingCallsRequest=nd={}))});var dd=N(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.SemanticTokensRefreshRequest=Qe.SemanticTokensRangeRequest=Qe.SemanticTokensDeltaRequest=Qe.SemanticTokensRequest=Qe.SemanticTokensRegistrationType=Qe.TokenFormat=void 0;var qt=we(),sd;(function(t){t.Relative="relative"})(sd||(Qe.TokenFormat=sd={}));var Jn;(function(t){t.method="textDocument/semanticTokens",t.type=new qt.RegistrationType(t.method)})(Jn||(Qe.SemanticTokensRegistrationType=Jn={}));var od;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Jn.method})(od||(Qe.SemanticTokensRequest=od={}));var ad;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Jn.method})(ad||(Qe.SemanticTokensDeltaRequest=ad={}));var cd;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Jn.method})(cd||(Qe.SemanticTokensRangeRequest=cd={}));var ud;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=qt.MessageDirection.serverToClient,t.type=new qt.ProtocolRequestType0(t.method)})(ud||(Qe.SemanticTokensRefreshRequest=ud={}))});var hd=N(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.ShowDocumentRequest=void 0;var ld=we(),fd;(function(t){t.method="window/showDocument",t.messageDirection=ld.MessageDirection.serverToClient,t.type=new ld.ProtocolRequestType(t.method)})(fd||(rs.ShowDocumentRequest=fd={}))});var gd=N(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.LinkedEditingRangeRequest=void 0;var pd=we(),md;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=pd.MessageDirection.clientToServer,t.type=new pd.ProtocolRequestType(t.method)})(md||(ns.LinkedEditingRangeRequest=md={}))});var kd=N(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.WillDeleteFilesRequest=ze.DidDeleteFilesNotification=ze.DidRenameFilesNotification=ze.WillRenameFilesRequest=ze.DidCreateFilesNotification=ze.WillCreateFilesRequest=ze.FileOperationPatternKind=void 0;var ot=we(),yd;(function(t){t.file="file",t.folder="folder"})(yd||(ze.FileOperationPatternKind=yd={}));var vd;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(vd||(ze.WillCreateFilesRequest=vd={}));var _d;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(_d||(ze.DidCreateFilesNotification=_d={}));var bd;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(bd||(ze.WillRenameFilesRequest=bd={}));var wd;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(wd||(ze.DidRenameFilesNotification=wd={}));var Td;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(Td||(ze.DidDeleteFilesNotification=Td={}));var Rd;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(Rd||(ze.WillDeleteFilesRequest=Rd={}))});var Dd=N(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.MonikerRequest=ir.MonikerKind=ir.UniquenessLevel=void 0;var Sd=we(),Cd;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Cd||(ir.UniquenessLevel=Cd={}));var Pd;(function(t){t.$import="import",t.$export="export",t.local="local"})(Pd||(ir.MonikerKind=Pd={}));var xd;(function(t){t.method="textDocument/moniker",t.messageDirection=Sd.MessageDirection.clientToServer,t.type=new Sd.ProtocolRequestType(t.method)})(xd||(ir.MonikerRequest=xd={}))});var Md=N(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.TypeHierarchySubtypesRequest=sr.TypeHierarchySupertypesRequest=sr.TypeHierarchyPrepareRequest=void 0;var wn=we(),Ed;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(Ed||(sr.TypeHierarchyPrepareRequest=Ed={}));var Od;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(Od||(sr.TypeHierarchySupertypesRequest=Od={}));var Nd;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(Nd||(sr.TypeHierarchySubtypesRequest=Nd={}))});var Id=N(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.InlineValueRefreshRequest=Tn.InlineValueRequest=void 0;var is=we(),jd;(function(t){t.method="textDocument/inlineValue",t.messageDirection=is.MessageDirection.clientToServer,t.type=new is.ProtocolRequestType(t.method)})(jd||(Tn.InlineValueRequest=jd={}));var qd;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=is.MessageDirection.serverToClient,t.type=new is.ProtocolRequestType0(t.method)})(qd||(Tn.InlineValueRefreshRequest=qd={}))});var Fd=N(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.InlayHintRefreshRequest=or.InlayHintResolveRequest=or.InlayHintRequest=void 0;var Rn=we(),Ad;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})(Ad||(or.InlayHintRequest=Ad={}));var Ld;(function(t){t.method="inlayHint/resolve",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})(Ld||(or.InlayHintResolveRequest=Ld={}));var $d;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Rn.MessageDirection.serverToClient,t.type=new Rn.ProtocolRequestType0(t.method)})($d||(or.InlayHintRefreshRequest=$d={}))});var Zd=N(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.DiagnosticRefreshRequest=at.WorkspaceDiagnosticRequest=at.DocumentDiagnosticRequest=at.DocumentDiagnosticReportKind=at.DiagnosticServerCancellationData=void 0;var Hd=yr(),_p=Hi(),kn=we(),Wd;(function(t){function e(r){let n=r;return n&&_p.boolean(n.retriggerRequest)}t.is=e})(Wd||(at.DiagnosticServerCancellationData=Wd={}));var Vd;(function(t){t.Full="full",t.Unchanged="unchanged"})(Vd||(at.DocumentDiagnosticReportKind=Vd={}));var zd;(function(t){t.method="textDocument/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Hd.ProgressType})(zd||(at.DocumentDiagnosticRequest=zd={}));var Ud;(function(t){t.method="workspace/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Hd.ProgressType})(Ud||(at.WorkspaceDiagnosticRequest=Ud={}));var Bd;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=kn.MessageDirection.serverToClient,t.type=new kn.ProtocolRequestType0(t.method)})(Bd||(at.DiagnosticRefreshRequest=Bd={}))});var el=N(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.DidCloseNotebookDocumentNotification=Ce.DidSaveNotebookDocumentNotification=Ce.DidChangeNotebookDocumentNotification=Ce.NotebookCellArrayChange=Ce.DidOpenNotebookDocumentNotification=Ce.NotebookDocumentSyncRegistrationType=Ce.NotebookDocument=Ce.NotebookCell=Ce.ExecutionSummary=Ce.NotebookCellKind=void 0;var Gn=Bi(),yt=Hi(),Rt=we(),Ha;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Ha||(Ce.NotebookCellKind=Ha={}));var Za;(function(t){function e(i,s){let d={executionOrder:i};return(s===!0||s===!1)&&(d.success=s),d}t.create=e;function r(i){let s=i;return yt.objectLiteral(s)&&Gn.uinteger.is(s.executionOrder)&&(s.success===void 0||yt.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(Za||(Ce.ExecutionSummary=Za={}));var ss;(function(t){function e(s,d){return{kind:s,document:d}}t.create=e;function r(s){let d=s;return yt.objectLiteral(d)&&Ha.is(d.kind)&&Gn.DocumentUri.is(d.document)&&(d.metadata===void 0||yt.objectLiteral(d.metadata))}t.is=r;function n(s,d){let p=new Set;return s.document!==d.document&&p.add("document"),s.kind!==d.kind&&p.add("kind"),s.executionSummary!==d.executionSummary&&p.add("executionSummary"),(s.metadata!==void 0||d.metadata!==void 0)&&!i(s.metadata,d.metadata)&&p.add("metadata"),(s.executionSummary!==void 0||d.executionSummary!==void 0)&&!Za.equals(s.executionSummary,d.executionSummary)&&p.add("executionSummary"),p}t.diff=n;function i(s,d){if(s===d)return!0;if(s==null||d===null||d===void 0||typeof s!=typeof d||typeof s!="object")return!1;let p=Array.isArray(s),R=Array.isArray(d);if(p!==R)return!1;if(p&&R){if(s.length!==d.length)return!1;for(let _=0;_<s.length;_++)if(!i(s[_],d[_]))return!1}if(yt.objectLiteral(s)&&yt.objectLiteral(d)){let _=Object.keys(s),E=Object.keys(d);if(_.length!==E.length||(_.sort(),E.sort(),!i(_,E)))return!1;for(let Z=0;Z<_.length;Z++){let de=_[Z];if(!i(s[de],d[de]))return!1}}return!0}})(ss||(Ce.NotebookCell=ss={}));var Jd;(function(t){function e(n,i,s,d){return{uri:n,notebookType:i,version:s,cells:d}}t.create=e;function r(n){let i=n;return yt.objectLiteral(i)&&yt.string(i.uri)&&Gn.integer.is(i.version)&&yt.typedArray(i.cells,ss.is)}t.is=r})(Jd||(Ce.NotebookDocument=Jd={}));var Sn;(function(t){t.method="notebookDocument/sync",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.RegistrationType(t.method)})(Sn||(Ce.NotebookDocumentSyncRegistrationType=Sn={}));var Gd;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Gd||(Ce.DidOpenNotebookDocumentNotification=Gd={}));var Qd;(function(t){function e(n){let i=n;return yt.objectLiteral(i)&&Gn.uinteger.is(i.start)&&Gn.uinteger.is(i.deleteCount)&&(i.cells===void 0||yt.typedArray(i.cells,ss.is))}t.is=e;function r(n,i,s){let d={start:n,deleteCount:i};return s!==void 0&&(d.cells=s),d}t.create=r})(Qd||(Ce.NotebookCellArrayChange=Qd={}));var Xd;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Xd||(Ce.DidChangeNotebookDocumentNotification=Xd={}));var Yd;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Yd||(Ce.DidSaveNotebookDocumentNotification=Yd={}));var Kd;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Kd||(Ce.DidCloseNotebookDocumentNotification=Kd={}))});var nl=N(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.InlineCompletionRequest=void 0;var tl=we(),rl;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=tl.MessageDirection.clientToServer,t.type=new tl.ProtocolRequestType(t.method)})(rl||(os.InlineCompletionRequest=rl={}))});var yf=N(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.WorkspaceSymbolRequest=l.CodeActionResolveRequest=l.CodeActionRequest=l.DocumentSymbolRequest=l.DocumentHighlightRequest=l.ReferencesRequest=l.DefinitionRequest=l.SignatureHelpRequest=l.SignatureHelpTriggerKind=l.HoverRequest=l.CompletionResolveRequest=l.CompletionRequest=l.CompletionTriggerKind=l.PublishDiagnosticsNotification=l.WatchKind=l.RelativePattern=l.FileChangeType=l.DidChangeWatchedFilesNotification=l.WillSaveTextDocumentWaitUntilRequest=l.WillSaveTextDocumentNotification=l.TextDocumentSaveReason=l.DidSaveTextDocumentNotification=l.DidCloseTextDocumentNotification=l.DidChangeTextDocumentNotification=l.TextDocumentContentChangeEvent=l.DidOpenTextDocumentNotification=l.TextDocumentSyncKind=l.TelemetryEventNotification=l.LogMessageNotification=l.ShowMessageRequest=l.ShowMessageNotification=l.MessageType=l.DidChangeConfigurationNotification=l.ExitNotification=l.ShutdownRequest=l.InitializedNotification=l.InitializeErrorCodes=l.InitializeRequest=l.WorkDoneProgressOptions=l.TextDocumentRegistrationOptions=l.StaticRegistrationOptions=l.PositionEncodingKind=l.FailureHandlingKind=l.ResourceOperationKind=l.UnregistrationRequest=l.RegistrationRequest=l.DocumentSelector=l.NotebookCellTextDocumentFilter=l.NotebookDocumentFilter=l.TextDocumentFilter=void 0;l.MonikerRequest=l.MonikerKind=l.UniquenessLevel=l.WillDeleteFilesRequest=l.DidDeleteFilesNotification=l.WillRenameFilesRequest=l.DidRenameFilesNotification=l.WillCreateFilesRequest=l.DidCreateFilesNotification=l.FileOperationPatternKind=l.LinkedEditingRangeRequest=l.ShowDocumentRequest=l.SemanticTokensRegistrationType=l.SemanticTokensRefreshRequest=l.SemanticTokensRangeRequest=l.SemanticTokensDeltaRequest=l.SemanticTokensRequest=l.TokenFormat=l.CallHierarchyPrepareRequest=l.CallHierarchyOutgoingCallsRequest=l.CallHierarchyIncomingCallsRequest=l.WorkDoneProgressCancelNotification=l.WorkDoneProgressCreateRequest=l.WorkDoneProgress=l.SelectionRangeRequest=l.DeclarationRequest=l.FoldingRangeRefreshRequest=l.FoldingRangeRequest=l.ColorPresentationRequest=l.DocumentColorRequest=l.ConfigurationRequest=l.DidChangeWorkspaceFoldersNotification=l.WorkspaceFoldersRequest=l.TypeDefinitionRequest=l.ImplementationRequest=l.ApplyWorkspaceEditRequest=l.ExecuteCommandRequest=l.PrepareRenameRequest=l.RenameRequest=l.PrepareSupportDefaultBehavior=l.DocumentOnTypeFormattingRequest=l.DocumentRangesFormattingRequest=l.DocumentRangeFormattingRequest=l.DocumentFormattingRequest=l.DocumentLinkResolveRequest=l.DocumentLinkRequest=l.CodeLensRefreshRequest=l.CodeLensResolveRequest=l.CodeLensRequest=l.WorkspaceSymbolResolveRequest=void 0;l.InlineCompletionRequest=l.DidCloseNotebookDocumentNotification=l.DidSaveNotebookDocumentNotification=l.DidChangeNotebookDocumentNotification=l.NotebookCellArrayChange=l.DidOpenNotebookDocumentNotification=l.NotebookDocumentSyncRegistrationType=l.NotebookDocument=l.NotebookCell=l.ExecutionSummary=l.NotebookCellKind=l.DiagnosticRefreshRequest=l.WorkspaceDiagnosticRequest=l.DocumentDiagnosticRequest=l.DocumentDiagnosticReportKind=l.DiagnosticServerCancellationData=l.InlayHintRefreshRequest=l.InlayHintResolveRequest=l.InlayHintRequest=l.InlineValueRefreshRequest=l.InlineValueRequest=l.TypeHierarchySupertypesRequest=l.TypeHierarchySubtypesRequest=l.TypeHierarchyPrepareRequest=void 0;var C=we(),il=Bi(),Ee=Hi(),bp=Du();Object.defineProperty(l,"ImplementationRequest",{enumerable:!0,get:function(){return bp.ImplementationRequest}});var wp=Nu();Object.defineProperty(l,"TypeDefinitionRequest",{enumerable:!0,get:function(){return wp.TypeDefinitionRequest}});var hf=qu();Object.defineProperty(l,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return hf.WorkspaceFoldersRequest}});Object.defineProperty(l,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return hf.DidChangeWorkspaceFoldersNotification}});var Tp=Lu();Object.defineProperty(l,"ConfigurationRequest",{enumerable:!0,get:function(){return Tp.ConfigurationRequest}});var pf=Wu();Object.defineProperty(l,"DocumentColorRequest",{enumerable:!0,get:function(){return pf.DocumentColorRequest}});Object.defineProperty(l,"ColorPresentationRequest",{enumerable:!0,get:function(){return pf.ColorPresentationRequest}});var mf=Uu();Object.defineProperty(l,"FoldingRangeRequest",{enumerable:!0,get:function(){return mf.FoldingRangeRequest}});Object.defineProperty(l,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return mf.FoldingRangeRefreshRequest}});var Rp=Zu();Object.defineProperty(l,"DeclarationRequest",{enumerable:!0,get:function(){return Rp.DeclarationRequest}});var kp=Qu();Object.defineProperty(l,"SelectionRangeRequest",{enumerable:!0,get:function(){return kp.SelectionRangeRequest}});var Ya=ed();Object.defineProperty(l,"WorkDoneProgress",{enumerable:!0,get:function(){return Ya.WorkDoneProgress}});Object.defineProperty(l,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Ya.WorkDoneProgressCreateRequest}});Object.defineProperty(l,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Ya.WorkDoneProgressCancelNotification}});var Ka=id();Object.defineProperty(l,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Ka.CallHierarchyIncomingCallsRequest}});Object.defineProperty(l,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Ka.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(l,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ka.CallHierarchyPrepareRequest}});var Cn=dd();Object.defineProperty(l,"TokenFormat",{enumerable:!0,get:function(){return Cn.TokenFormat}});Object.defineProperty(l,"SemanticTokensRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRequest}});Object.defineProperty(l,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensDeltaRequest}});Object.defineProperty(l,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRangeRequest}});Object.defineProperty(l,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRefreshRequest}});Object.defineProperty(l,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Cn.SemanticTokensRegistrationType}});var Sp=hd();Object.defineProperty(l,"ShowDocumentRequest",{enumerable:!0,get:function(){return Sp.ShowDocumentRequest}});var Cp=gd();Object.defineProperty(l,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return Cp.LinkedEditingRangeRequest}});var vr=kd();Object.defineProperty(l,"FileOperationPatternKind",{enumerable:!0,get:function(){return vr.FileOperationPatternKind}});Object.defineProperty(l,"DidCreateFilesNotification",{enumerable:!0,get:function(){return vr.DidCreateFilesNotification}});Object.defineProperty(l,"WillCreateFilesRequest",{enumerable:!0,get:function(){return vr.WillCreateFilesRequest}});Object.defineProperty(l,"DidRenameFilesNotification",{enumerable:!0,get:function(){return vr.DidRenameFilesNotification}});Object.defineProperty(l,"WillRenameFilesRequest",{enumerable:!0,get:function(){return vr.WillRenameFilesRequest}});Object.defineProperty(l,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return vr.DidDeleteFilesNotification}});Object.defineProperty(l,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return vr.WillDeleteFilesRequest}});var ec=Dd();Object.defineProperty(l,"UniquenessLevel",{enumerable:!0,get:function(){return ec.UniquenessLevel}});Object.defineProperty(l,"MonikerKind",{enumerable:!0,get:function(){return ec.MonikerKind}});Object.defineProperty(l,"MonikerRequest",{enumerable:!0,get:function(){return ec.MonikerRequest}});var tc=Md();Object.defineProperty(l,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return tc.TypeHierarchyPrepareRequest}});Object.defineProperty(l,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return tc.TypeHierarchySubtypesRequest}});Object.defineProperty(l,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return tc.TypeHierarchySupertypesRequest}});var gf=Id();Object.defineProperty(l,"InlineValueRequest",{enumerable:!0,get:function(){return gf.InlineValueRequest}});Object.defineProperty(l,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return gf.InlineValueRefreshRequest}});var rc=Fd();Object.defineProperty(l,"InlayHintRequest",{enumerable:!0,get:function(){return rc.InlayHintRequest}});Object.defineProperty(l,"InlayHintResolveRequest",{enumerable:!0,get:function(){return rc.InlayHintResolveRequest}});Object.defineProperty(l,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return rc.InlayHintRefreshRequest}});var Qn=Zd();Object.defineProperty(l,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Qn.DiagnosticServerCancellationData}});Object.defineProperty(l,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Qn.DocumentDiagnosticReportKind}});Object.defineProperty(l,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Qn.DocumentDiagnosticRequest}});Object.defineProperty(l,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Qn.WorkspaceDiagnosticRequest}});Object.defineProperty(l,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Qn.DiagnosticRefreshRequest}});var kt=el();Object.defineProperty(l,"NotebookCellKind",{enumerable:!0,get:function(){return kt.NotebookCellKind}});Object.defineProperty(l,"ExecutionSummary",{enumerable:!0,get:function(){return kt.ExecutionSummary}});Object.defineProperty(l,"NotebookCell",{enumerable:!0,get:function(){return kt.NotebookCell}});Object.defineProperty(l,"NotebookDocument",{enumerable:!0,get:function(){return kt.NotebookDocument}});Object.defineProperty(l,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return kt.NotebookDocumentSyncRegistrationType}});Object.defineProperty(l,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidOpenNotebookDocumentNotification}});Object.defineProperty(l,"NotebookCellArrayChange",{enumerable:!0,get:function(){return kt.NotebookCellArrayChange}});Object.defineProperty(l,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidChangeNotebookDocumentNotification}});Object.defineProperty(l,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidSaveNotebookDocumentNotification}});Object.defineProperty(l,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidCloseNotebookDocumentNotification}});var Pp=nl();Object.defineProperty(l,"InlineCompletionRequest",{enumerable:!0,get:function(){return Pp.InlineCompletionRequest}});var Ja;(function(t){function e(r){let n=r;return Ee.string(n)||Ee.string(n.language)||Ee.string(n.scheme)||Ee.string(n.pattern)}t.is=e})(Ja||(l.TextDocumentFilter=Ja={}));var Ga;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(Ee.string(n.notebookType)||Ee.string(n.scheme)||Ee.string(n.pattern))}t.is=e})(Ga||(l.NotebookDocumentFilter=Ga={}));var Qa;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(Ee.string(n.notebook)||Ga.is(n.notebook))&&(n.language===void 0||Ee.string(n.language))}t.is=e})(Qa||(l.NotebookCellTextDocumentFilter=Qa={}));var Xa;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Ee.string(n)&&!Ja.is(n)&&!Qa.is(n))return!1;return!0}t.is=e})(Xa||(l.DocumentSelector=Xa={}));var sl;(function(t){t.method="client/registerCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(sl||(l.RegistrationRequest=sl={}));var ol;(function(t){t.method="client/unregisterCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(ol||(l.UnregistrationRequest=ol={}));var al;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(al||(l.ResourceOperationKind=al={}));var cl;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(cl||(l.FailureHandlingKind=cl={}));var ul;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(ul||(l.PositionEncodingKind=ul={}));var dl;(function(t){function e(r){let n=r;return n&&Ee.string(n.id)&&n.id.length>0}t.hasId=e})(dl||(l.StaticRegistrationOptions=dl={}));var ll;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||Xa.is(n.documentSelector))}t.is=e})(ll||(l.TextDocumentRegistrationOptions=ll={}));var fl;(function(t){function e(n){let i=n;return Ee.objectLiteral(i)&&(i.workDoneProgress===void 0||Ee.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Ee.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(fl||(l.WorkDoneProgressOptions=fl={}));var hl;(function(t){t.method="initialize",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(hl||(l.InitializeRequest=hl={}));var pl;(function(t){t.unknownProtocolVersion=1})(pl||(l.InitializeErrorCodes=pl={}));var ml;(function(t){t.method="initialized",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(ml||(l.InitializedNotification=ml={}));var gl;(function(t){t.method="shutdown",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType0(t.method)})(gl||(l.ShutdownRequest=gl={}));var yl;(function(t){t.method="exit",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType0(t.method)})(yl||(l.ExitNotification=yl={}));var vl;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(vl||(l.DidChangeConfigurationNotification=vl={}));var _l;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(_l||(l.MessageType=_l={}));var bl;(function(t){t.method="window/showMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(bl||(l.ShowMessageNotification=bl={}));var wl;(function(t){t.method="window/showMessageRequest",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(wl||(l.ShowMessageRequest=wl={}));var Tl;(function(t){t.method="window/logMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Tl||(l.LogMessageNotification=Tl={}));var Rl;(function(t){t.method="telemetry/event",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Rl||(l.TelemetryEventNotification=Rl={}));var kl;(function(t){t.None=0,t.Full=1,t.Incremental=2})(kl||(l.TextDocumentSyncKind=kl={}));var Sl;(function(t){t.method="textDocument/didOpen",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Sl||(l.DidOpenTextDocumentNotification=Sl={}));var Cl;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(Cl||(l.TextDocumentContentChangeEvent=Cl={}));var Pl;(function(t){t.method="textDocument/didChange",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Pl||(l.DidChangeTextDocumentNotification=Pl={}));var xl;(function(t){t.method="textDocument/didClose",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(xl||(l.DidCloseTextDocumentNotification=xl={}));var Dl;(function(t){t.method="textDocument/didSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Dl||(l.DidSaveTextDocumentNotification=Dl={}));var El;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(El||(l.TextDocumentSaveReason=El={}));var Ol;(function(t){t.method="textDocument/willSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Ol||(l.WillSaveTextDocumentNotification=Ol={}));var Nl;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Nl||(l.WillSaveTextDocumentWaitUntilRequest=Nl={}));var Ml;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Ml||(l.DidChangeWatchedFilesNotification=Ml={}));var jl;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(jl||(l.FileChangeType=jl={}));var ql;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(il.URI.is(n.baseUri)||il.WorkspaceFolder.is(n.baseUri))&&Ee.string(n.pattern)}t.is=e})(ql||(l.RelativePattern=ql={}));var Il;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Il||(l.WatchKind=Il={}));var Al;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Al||(l.PublishDiagnosticsNotification=Al={}));var Ll;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Ll||(l.CompletionTriggerKind=Ll={}));var $l;(function(t){t.method="textDocument/completion",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})($l||(l.CompletionRequest=$l={}));var Fl;(function(t){t.method="completionItem/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Fl||(l.CompletionResolveRequest=Fl={}));var Wl;(function(t){t.method="textDocument/hover",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Wl||(l.HoverRequest=Wl={}));var Vl;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Vl||(l.SignatureHelpTriggerKind=Vl={}));var zl;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(zl||(l.SignatureHelpRequest=zl={}));var Ul;(function(t){t.method="textDocument/definition",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Ul||(l.DefinitionRequest=Ul={}));var Bl;(function(t){t.method="textDocument/references",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Bl||(l.ReferencesRequest=Bl={}));var Hl;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Hl||(l.DocumentHighlightRequest=Hl={}));var Zl;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Zl||(l.DocumentSymbolRequest=Zl={}));var Jl;(function(t){t.method="textDocument/codeAction",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Jl||(l.CodeActionRequest=Jl={}));var Gl;(function(t){t.method="codeAction/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Gl||(l.CodeActionResolveRequest=Gl={}));var Ql;(function(t){t.method="workspace/symbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Ql||(l.WorkspaceSymbolRequest=Ql={}));var Xl;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Xl||(l.WorkspaceSymbolResolveRequest=Xl={}));var Yl;(function(t){t.method="textDocument/codeLens",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Yl||(l.CodeLensRequest=Yl={}));var Kl;(function(t){t.method="codeLens/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Kl||(l.CodeLensResolveRequest=Kl={}));var ef;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType0(t.method)})(ef||(l.CodeLensRefreshRequest=ef={}));var tf;(function(t){t.method="textDocument/documentLink",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(tf||(l.DocumentLinkRequest=tf={}));var rf;(function(t){t.method="documentLink/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(rf||(l.DocumentLinkResolveRequest=rf={}));var nf;(function(t){t.method="textDocument/formatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(nf||(l.DocumentFormattingRequest=nf={}));var sf;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(sf||(l.DocumentRangeFormattingRequest=sf={}));var of;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(of||(l.DocumentRangesFormattingRequest=of={}));var af;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(af||(l.DocumentOnTypeFormattingRequest=af={}));var cf;(function(t){t.Identifier=1})(cf||(l.PrepareSupportDefaultBehavior=cf={}));var uf;(function(t){t.method="textDocument/rename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(uf||(l.RenameRequest=uf={}));var df;(function(t){t.method="textDocument/prepareRename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(df||(l.PrepareRenameRequest=df={}));var lf;(function(t){t.method="workspace/executeCommand",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(lf||(l.ExecuteCommandRequest=lf={}));var ff;(function(t){t.method="workspace/applyEdit",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType("workspace/applyEdit")})(ff||(l.ApplyWorkspaceEditRequest=ff={}))});var _f=N(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.createProtocolConnection=void 0;var vf=yr();function xp(t,e,r,n){return vf.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,vf.createMessageConnection)(t,e,r,n)}as.createProtocolConnection=xp});var wf=N(Xe=>{"use strict";var Dp=Xe&&Xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cs=Xe&&Xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dp(e,t,r)};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.LSPErrorCodes=Xe.createProtocolConnection=void 0;cs(yr(),Xe);cs(Bi(),Xe);cs(we(),Xe);cs(yf(),Xe);var Ep=_f();Object.defineProperty(Xe,"createProtocolConnection",{enumerable:!0,get:function(){return Ep.createProtocolConnection}});var bf;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(bf||(Xe.LSPErrorCodes=bf={}))});var Rf=N(St=>{"use strict";var Op=St&&St.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Tf=St&&St.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Op(e,t,r)};Object.defineProperty(St,"__esModule",{value:!0});St.createProtocolConnection=void 0;var Np=Fa();Tf(Fa(),St);Tf(wf(),St);function Mp(t,e,r,n){return(0,Np.createMessageConnection)(t,e,r,n)}St.createProtocolConnection=Mp});var Lf=Yr(require("child_process")),ei=Yr(require("fs")),ms=Yr(require("path")),$f=Yr(Do()),gs=Yr(Hc()),oc=Yr(Rf());var et={};Gf(et,{BRAND:()=>sm,DIRTY:()=>_r,EMPTY_PATH:()=>Ap,INVALID:()=>W,NEVER:()=>zm,OK:()=>Ue,ParseStatus:()=>je,Schema:()=>ee,ZodAny:()=>ur,ZodArray:()=>$t,ZodBigInt:()=>wr,ZodBoolean:()=>Tr,ZodBranded:()=>Yn,ZodCatch:()=>Mr,ZodDate:()=>Rr,ZodDefault:()=>Nr,ZodDiscriminatedUnion:()=>ls,ZodEffects:()=>dt,ZodEnum:()=>Er,ZodError:()=>Ye,ZodFirstPartyTypeKind:()=>U,ZodFunction:()=>hs,ZodIntersection:()=>Pr,ZodIssueCode:()=>S,ZodLazy:()=>xr,ZodLiteral:()=>Dr,ZodMap:()=>Nn,ZodNaN:()=>jn,ZodNativeEnum:()=>Or,ZodNever:()=>vt,ZodNull:()=>Sr,ZodNullable:()=>xt,ZodNumber:()=>br,ZodObject:()=>Ke,ZodOptional:()=>ct,ZodParsedType:()=>D,ZodPipeline:()=>Kn,ZodPromise:()=>dr,ZodReadonly:()=>jr,ZodRecord:()=>fs,ZodSchema:()=>ee,ZodSet:()=>Mn,ZodString:()=>cr,ZodSymbol:()=>En,ZodTransformer:()=>dt,ZodTuple:()=>Pt,ZodType:()=>ee,ZodUndefined:()=>kr,ZodUnion:()=>Cr,ZodUnknown:()=>Lt,ZodVoid:()=>On,addIssueToContext:()=>P,any:()=>pm,array:()=>vm,bigint:()=>um,boolean:()=>jf,coerce:()=>Vm,custom:()=>Of,date:()=>dm,datetimeRegex:()=>Df,defaultErrorMap:()=>It,discriminatedUnion:()=>Tm,effect:()=>jm,enum:()=>Om,function:()=>xm,getErrorMap:()=>Pn,getParsedType:()=>Ct,instanceof:()=>am,intersection:()=>Rm,isAborted:()=>us,isAsync:()=>xn,isDirty:()=>ds,isValid:()=>ar,late:()=>om,lazy:()=>Dm,literal:()=>Em,makeIssue:()=>Xn,map:()=>Cm,nan:()=>cm,nativeEnum:()=>Nm,never:()=>gm,null:()=>hm,nullable:()=>Im,number:()=>Mf,object:()=>_m,objectUtil:()=>nc,oboolean:()=>Wm,onumber:()=>Fm,optional:()=>qm,ostring:()=>$m,pipeline:()=>Lm,preprocess:()=>Am,promise:()=>Mm,quotelessJson:()=>jp,record:()=>Sm,set:()=>Pm,setErrorMap:()=>Ip,strictObject:()=>bm,string:()=>Nf,symbol:()=>lm,transformer:()=>jm,tuple:()=>km,undefined:()=>fm,union:()=>wm,unknown:()=>mm,util:()=>re,void:()=>ym});var re;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let d of i)s[d]=d;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),d={};for(let p of s)d[p]=i[p];return t.objectValues(d)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let d in i)Object.prototype.hasOwnProperty.call(i,d)&&s.push(d);return s},t.find=(i,s)=>{for(let d of i)if(s(d))return d},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(d=>typeof d=="string"?`'${d}'`:d).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(re||(re={}));var nc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(nc||(nc={}));var D=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ct=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}};var S=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),jp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ye=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let d of s.issues)if(d.code==="invalid_union")d.unionErrors.map(i);else if(d.code==="invalid_return_type")i(d.returnTypeError);else if(d.code==="invalid_arguments")i(d.argumentsError);else if(d.path.length===0)n._errors.push(r(d));else{let p=n,R=0;for(;R<d.path.length;){let _=d.path[R];R===d.path.length-1?(p[_]=p[_]||{_errors:[]},p[_]._errors.push(r(d))):p[_]=p[_]||{_errors:[]},p=p[_],R++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ye.create=t=>new Ye(t);var qp=(t,e)=>{let r;switch(t.code){case S.invalid_type:t.received===D.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case S.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case S.invalid_union:r="Invalid input";break;case S.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case S.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case S.invalid_arguments:r="Invalid function arguments";break;case S.invalid_return_type:r="Invalid function return type";break;case S.invalid_date:r="Invalid date";break;case S.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:re.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case S.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case S.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case S.custom:r="Invalid input";break;case S.invalid_intersection_types:r="Intersection results could not be merged";break;case S.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case S.not_finite:r="Number must be finite";break;default:r=e.defaultError,re.assertNever(t)}return{message:r}},It=qp;var kf=It;function Ip(t){kf=t}function Pn(){return kf}var Xn=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],d={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let p="",R=n.filter(_=>!!_).slice().reverse();for(let _ of R)p=_(d,{data:e,defaultError:p}).message;return{...i,path:s,message:p}},Ap=[];function P(t,e){let r=Pn(),n=Xn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===It?void 0:It].filter(i=>!!i)});t.common.issues.push(n)}var je=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return W;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let s=await i.key,d=await i.value;n.push({key:s,value:d})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:d}=i;if(s.status==="aborted"||d.status==="aborted")return W;s.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof d.value<"u"||i.alwaysSet)&&(n[s.value]=d.value)}return{status:e.value,value:n}}},W=Object.freeze({status:"aborted"}),_r=t=>({status:"dirty",value:t}),Ue=t=>({status:"valid",value:t}),us=t=>t.status==="aborted",ds=t=>t.status==="dirty",ar=t=>t.status==="valid",xn=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(j||(j={}));var ut=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Sf=(t,e)=>{if(ar(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ye(t.common.issues);return this._error=r,this._error}}};function K(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(d,p)=>{let{message:R}=t;return d.code==="invalid_enum_value"?{message:R??p.defaultError}:typeof p.data>"u"?{message:R??n??p.defaultError}:d.code!=="invalid_type"?{message:p.defaultError}:{message:R??r??p.defaultError}},description:i}}var ee=class{get description(){return this._def.description}_getType(e){return Ct(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new je,ctx:{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(xn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parseSync({data:e,path:n.path,parent:n});return Sf(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return ar(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ar(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(xn(i)?i:Promise.resolve(i));return Sf(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let d=e(i),p=()=>s.addIssue({code:S.custom,...n(i)});return typeof Promise<"u"&&d instanceof Promise?d.then(R=>R?!0:(p(),!1)):d?!0:(p(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new dt({schema:this,typeName:U.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ct.create(this,this._def)}nullable(){return xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $t.create(this)}promise(){return dr.create(this,this._def)}or(e){return Cr.create([this,e],this._def)}and(e){return Pr.create(this,e,this._def)}transform(e){return new dt({...K(this._def),schema:this,typeName:U.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Nr({...K(this._def),innerType:this,defaultValue:r,typeName:U.ZodDefault})}brand(){return new Yn({typeName:U.ZodBranded,type:this,...K(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mr({...K(this._def),innerType:this,catchValue:r,typeName:U.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Kn.create(this,e)}readonly(){return jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Lp=/^c[^\s-]{8,}$/i,$p=/^[0-9a-z]+$/,Fp=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Wp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Vp=/^[a-z0-9_-]{21}$/i,zp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Up=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Bp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ic,Zp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Gp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Pf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Kp=new RegExp(`^${Pf}$`);function xf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function em(t){return new RegExp(`^${xf(t)}$`)}function Df(t){let e=`${Pf}T${xf(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function tm(t,e){return!!((e==="v4"||!e)&&Zp.test(t)||(e==="v6"||!e)&&Gp.test(t))}function rm(t,e){if(!zp.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function nm(t,e){return!!((e==="v4"||!e)&&Jp.test(t)||(e==="v6"||!e)&&Qp.test(t))}var cr=class t extends ee{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_type,expected:D.string,received:s.parsedType}),W}let n=new je,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let d=e.data.length>s.value,p=e.data.length<s.value;(d||p)&&(i=this._getOrReturnCtx(e,i),d?P(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):p&&P(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Bp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"email",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")ic||(ic=new RegExp(Hp,"u")),ic.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"emoji",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Wp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"uuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Vp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"nanoid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Lp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")$p.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid2",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Fp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ulid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),P(i,{validation:"url",code:S.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"regex",code:S.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Df(s).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Kp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?em(s).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:S.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Up.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"duration",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?tm(e.data,s.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ip",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?rm(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"jwt",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?nm(e.data,s.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cidr",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Xp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Yp.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64url",code:S.invalid_string,message:s.message}),n.dirty()):re.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:S.invalid_string,...j.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...j.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...j.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...j.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...j.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...j.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...j.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...j.errToObj(r)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cr.create=t=>new cr({checks:[],typeName:U.ZodString,coerce:t?.coerce??!1,...K(t)});function im(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),d=Number.parseInt(e.toFixed(i).replace(".",""));return s%d/10**i}var br=class t extends ee{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_type,expected:D.number,received:s.parsedType}),W}let n,i=new je;for(let s of this._def.checks)s.kind==="int"?re.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?im(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:S.not_finite,message:s.message}),i.dirty()):re.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};br.create=t=>new br({checks:[],typeName:U.ZodNumber,coerce:t?.coerce||!1,...K(t)});var wr=class t extends ee{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let n,i=new je;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),P(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):re.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return P(r,{code:S.invalid_type,expected:D.bigint,received:r.parsedType}),W}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};wr.create=t=>new wr({checks:[],typeName:U.ZodBigInt,coerce:t?.coerce??!1,...K(t)});var Tr=class extends ee{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.boolean,received:n.parsedType}),W}return Ue(e.data)}};Tr.create=t=>new Tr({typeName:U.ZodBoolean,coerce:t?.coerce||!1,...K(t)});var Rr=class t extends ee{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_type,expected:D.date,received:s.parsedType}),W}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return P(s,{code:S.invalid_date}),W}let n=new je,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):re.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Rr.create=t=>new Rr({checks:[],coerce:t?.coerce||!1,typeName:U.ZodDate,...K(t)});var En=class extends ee{_parse(e){if(this._getType(e)!==D.symbol){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.symbol,received:n.parsedType}),W}return Ue(e.data)}};En.create=t=>new En({typeName:U.ZodSymbol,...K(t)});var kr=class extends ee{_parse(e){if(this._getType(e)!==D.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.undefined,received:n.parsedType}),W}return Ue(e.data)}};kr.create=t=>new kr({typeName:U.ZodUndefined,...K(t)});var Sr=class extends ee{_parse(e){if(this._getType(e)!==D.null){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.null,received:n.parsedType}),W}return Ue(e.data)}};Sr.create=t=>new Sr({typeName:U.ZodNull,...K(t)});var ur=class extends ee{constructor(){super(...arguments),this._any=!0}_parse(e){return Ue(e.data)}};ur.create=t=>new ur({typeName:U.ZodAny,...K(t)});var Lt=class extends ee{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ue(e.data)}};Lt.create=t=>new Lt({typeName:U.ZodUnknown,...K(t)});var vt=class extends ee{_parse(e){let r=this._getOrReturnCtx(e);return P(r,{code:S.invalid_type,expected:D.never,received:r.parsedType}),W}};vt.create=t=>new vt({typeName:U.ZodNever,...K(t)});var On=class extends ee{_parse(e){if(this._getType(e)!==D.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.void,received:n.parsedType}),W}return Ue(e.data)}};On.create=t=>new On({typeName:U.ZodVoid,...K(t)});var $t=class t extends ee{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==D.array)return P(r,{code:S.invalid_type,expected:D.array,received:r.parsedType}),W;if(i.exactLength!==null){let d=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(d||p)&&(P(r,{code:d?S.too_big:S.too_small,minimum:p?i.exactLength.value:void 0,maximum:d?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(P(r,{code:S.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(P(r,{code:S.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((d,p)=>i.type._parseAsync(new ut(r,d,r.path,p)))).then(d=>je.mergeArray(n,d));let s=[...r.data].map((d,p)=>i.type._parseSync(new ut(r,d,r.path,p)));return je.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:j.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:j.toString(r)}})}nonempty(e){return this.min(1,e)}};$t.create=(t,e)=>new $t({type:t,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...K(e)});function Dn(t){if(t instanceof Ke){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ct.create(Dn(n))}return new Ke({...t._def,shape:()=>e})}else return t instanceof $t?new $t({...t._def,type:Dn(t.element)}):t instanceof ct?ct.create(Dn(t.unwrap())):t instanceof xt?xt.create(Dn(t.unwrap())):t instanceof Pt?Pt.create(t.items.map(e=>Dn(e))):t}var Ke=class t extends ee{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=re.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==D.object){let _=this._getOrReturnCtx(e);return P(_,{code:S.invalid_type,expected:D.object,received:_.parsedType}),W}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:d}=this._getCached(),p=[];if(!(this._def.catchall instanceof vt&&this._def.unknownKeys==="strip"))for(let _ in i.data)d.includes(_)||p.push(_);let R=[];for(let _ of d){let E=s[_],Z=i.data[_];R.push({key:{status:"valid",value:_},value:E._parse(new ut(i,Z,i.path,_)),alwaysSet:_ in i.data})}if(this._def.catchall instanceof vt){let _=this._def.unknownKeys;if(_==="passthrough")for(let E of p)R.push({key:{status:"valid",value:E},value:{status:"valid",value:i.data[E]}});else if(_==="strict")p.length>0&&(P(i,{code:S.unrecognized_keys,keys:p}),n.dirty());else if(_!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let _=this._def.catchall;for(let E of p){let Z=i.data[E];R.push({key:{status:"valid",value:E},value:_._parse(new ut(i,Z,i.path,E)),alwaysSet:E in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let _=[];for(let E of R){let Z=await E.key,de=await E.value;_.push({key:Z,value:de,alwaysSet:E.alwaysSet})}return _}).then(_=>je.mergeObjectSync(n,_)):je.mergeObjectSync(n,R)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:j.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:U.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of re.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of re.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Dn(this)}partial(e){let r={};for(let n of re.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of re.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ct;)s=s._def.innerType;r[n]=s}return new t({...this._def,shape:()=>r})}keyof(){return Ef(re.objectKeys(this.shape))}};Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...K(e)});Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:vt.create(),typeName:U.ZodObject,...K(e)});Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...K(e)});var Cr=class extends ee{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let p of s)if(p.result.status==="valid")return p.result;for(let p of s)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let d=s.map(p=>new Ye(p.ctx.common.issues));return P(r,{code:S.invalid_union,unionErrors:d}),W}if(r.common.async)return Promise.all(n.map(async s=>{let d={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(i);{let s,d=[];for(let R of n){let _={...r,common:{...r.common,issues:[]},parent:null},E=R._parseSync({data:r.data,path:r.path,parent:_});if(E.status==="valid")return E;E.status==="dirty"&&!s&&(s={result:E,ctx:_}),_.common.issues.length&&d.push(_.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let p=d.map(R=>new Ye(R));return P(r,{code:S.invalid_union,unionErrors:p}),W}}get options(){return this._def.options}};Cr.create=(t,e)=>new Cr({options:t,typeName:U.ZodUnion,...K(e)});var At=t=>t instanceof xr?At(t.schema):t instanceof dt?At(t.innerType()):t instanceof Dr?[t.value]:t instanceof Er?t.options:t instanceof Or?re.objectValues(t.enum):t instanceof Nr?At(t._def.innerType):t instanceof kr?[void 0]:t instanceof Sr?[null]:t instanceof ct?[void 0,...At(t.unwrap())]:t instanceof xt?[null,...At(t.unwrap())]:t instanceof Yn||t instanceof jr?At(t.unwrap()):t instanceof Mr?At(t._def.innerType):[],ls=class t extends ee{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.object)return P(r,{code:S.invalid_type,expected:D.object,received:r.parsedType}),W;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(P(r,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let d=At(s.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of d){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,s)}}return new t({typeName:U.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...K(n)})}};function sc(t,e){let r=Ct(t),n=Ct(e);if(t===e)return{valid:!0,data:t};if(r===D.object&&n===D.object){let i=re.objectKeys(e),s=re.objectKeys(t).filter(p=>i.indexOf(p)!==-1),d={...t,...e};for(let p of s){let R=sc(t[p],e[p]);if(!R.valid)return{valid:!1};d[p]=R.data}return{valid:!0,data:d}}else if(r===D.array&&n===D.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let d=t[s],p=e[s],R=sc(d,p);if(!R.valid)return{valid:!1};i.push(R.data)}return{valid:!0,data:i}}else return r===D.date&&n===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pr=class extends ee{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,d)=>{if(us(s)||us(d))return W;let p=sc(s.value,d.value);return p.valid?((ds(s)||ds(d))&&r.dirty(),{status:r.value,value:p.data}):(P(n,{code:S.invalid_intersection_types}),W)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,d])=>i(s,d)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Pr.create=(t,e,r)=>new Pr({left:t,right:e,typeName:U.ZodIntersection,...K(r)});var Pt=class t extends ee{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.array)return P(n,{code:S.invalid_type,expected:D.array,received:n.parsedType}),W;if(n.data.length<this._def.items.length)return P(n,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&n.data.length>this._def.items.length&&(P(n,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((d,p)=>{let R=this._def.items[p]||this._def.rest;return R?R._parse(new ut(n,d,n.path,p)):null}).filter(d=>!!d);return n.common.async?Promise.all(s).then(d=>je.mergeArray(r,d)):je.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pt({items:t,typeName:U.ZodTuple,rest:null,...K(e)})};var fs=class t extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.object)return P(n,{code:S.invalid_type,expected:D.object,received:n.parsedType}),W;let i=[],s=this._def.keyType,d=this._def.valueType;for(let p in n.data)i.push({key:s._parse(new ut(n,p,n.path,p)),value:d._parse(new ut(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?je.mergeObjectAsync(r,i):je.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ee?new t({keyType:e,valueType:r,typeName:U.ZodRecord,...K(n)}):new t({keyType:cr.create(),valueType:e,typeName:U.ZodRecord,...K(r)})}},Nn=class extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.map)return P(n,{code:S.invalid_type,expected:D.map,received:n.parsedType}),W;let i=this._def.keyType,s=this._def.valueType,d=[...n.data.entries()].map(([p,R],_)=>({key:i._parse(new ut(n,p,n.path,[_,"key"])),value:s._parse(new ut(n,R,n.path,[_,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let R of d){let _=await R.key,E=await R.value;if(_.status==="aborted"||E.status==="aborted")return W;(_.status==="dirty"||E.status==="dirty")&&r.dirty(),p.set(_.value,E.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let R of d){let _=R.key,E=R.value;if(_.status==="aborted"||E.status==="aborted")return W;(_.status==="dirty"||E.status==="dirty")&&r.dirty(),p.set(_.value,E.value)}return{status:r.value,value:p}}}};Nn.create=(t,e,r)=>new Nn({valueType:e,keyType:t,typeName:U.ZodMap,...K(r)});var Mn=class t extends ee{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==D.set)return P(n,{code:S.invalid_type,expected:D.set,received:n.parsedType}),W;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(P(n,{code:S.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(P(n,{code:S.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function d(R){let _=new Set;for(let E of R){if(E.status==="aborted")return W;E.status==="dirty"&&r.dirty(),_.add(E.value)}return{status:r.value,value:_}}let p=[...n.data.values()].map((R,_)=>s._parse(new ut(n,R,n.path,_)));return n.common.async?Promise.all(p).then(R=>d(R)):d(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:j.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Mn.create=(t,e)=>new Mn({valueType:t,minSize:null,maxSize:null,typeName:U.ZodSet,...K(e)});var hs=class t extends ee{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.function)return P(r,{code:S.invalid_type,expected:D.function,received:r.parsedType}),W;function n(p,R){return Xn({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(_=>!!_),issueData:{code:S.invalid_arguments,argumentsError:R}})}function i(p,R){return Xn({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(_=>!!_),issueData:{code:S.invalid_return_type,returnTypeError:R}})}let s={errorMap:r.common.contextualErrorMap},d=r.data;if(this._def.returns instanceof dr){let p=this;return Ue(async function(...R){let _=new Ye([]),E=await p._def.args.parseAsync(R,s).catch(te=>{throw _.addIssue(n(R,te)),_}),Z=await Reflect.apply(d,this,E);return await p._def.returns._def.type.parseAsync(Z,s).catch(te=>{throw _.addIssue(i(Z,te)),_})})}else{let p=this;return Ue(function(...R){let _=p._def.args.safeParse(R,s);if(!_.success)throw new Ye([n(R,_.error)]);let E=Reflect.apply(d,this,_.data),Z=p._def.returns.safeParse(E,s);if(!Z.success)throw new Ye([i(E,Z.error)]);return Z.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pt.create(e).rest(Lt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Pt.create([]).rest(Lt.create()),returns:r||Lt.create(),typeName:U.ZodFunction,...K(n)})}},xr=class extends ee{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};xr.create=(t,e)=>new xr({getter:t,typeName:U.ZodLazy,...K(e)});var Dr=class extends ee{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return P(r,{received:r.data,code:S.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Dr.create=(t,e)=>new Dr({value:t,typeName:U.ZodLiteral,...K(e)});function Ef(t,e){return new Er({values:t,typeName:U.ZodEnum,...K(e)})}var Er=class t extends ee{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{expected:re.joinValues(n),received:r.parsedType,code:S.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{received:r.data,code:S.invalid_enum_value,options:n}),W}return Ue(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Er.create=Ef;var Or=class extends ee{_parse(e){let r=re.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==D.string&&n.parsedType!==D.number){let i=re.objectValues(r);return P(n,{expected:re.joinValues(i),received:n.parsedType,code:S.invalid_type}),W}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=re.objectValues(r);return P(n,{received:n.data,code:S.invalid_enum_value,options:i}),W}return Ue(e.data)}get enum(){return this._def.values}};Or.create=(t,e)=>new Or({values:t,typeName:U.ZodNativeEnum,...K(e)});var dr=class extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.promise&&r.common.async===!1)return P(r,{code:S.invalid_type,expected:D.promise,received:r.parsedType}),W;let n=r.parsedType===D.promise?r.data:Promise.resolve(r.data);return Ue(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dr.create=(t,e)=>new dr({type:t,typeName:U.ZodPromise,...K(e)});var dt=class extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===U.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:d=>{P(n,d),d.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let d=i.transform(n.data,s);if(n.common.async)return Promise.resolve(d).then(async p=>{if(r.value==="aborted")return W;let R=await this._def.schema._parseAsync({data:p,path:n.path,parent:n});return R.status==="aborted"?W:R.status==="dirty"?_r(R.value):r.value==="dirty"?_r(R.value):R});{if(r.value==="aborted")return W;let p=this._def.schema._parseSync({data:d,path:n.path,parent:n});return p.status==="aborted"?W:p.status==="dirty"?_r(p.value):r.value==="dirty"?_r(p.value):p}}if(i.type==="refinement"){let d=p=>{let R=i.refinement(p,s);if(n.common.async)return Promise.resolve(R);if(R instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?W:(p.status==="dirty"&&r.dirty(),d(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?W:(p.status==="dirty"&&r.dirty(),d(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(n.common.async===!1){let d=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ar(d))return W;let p=i.transform(d.value,s);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(d=>ar(d)?Promise.resolve(i.transform(d.value,s)).then(p=>({status:r.value,value:p})):W);re.assertNever(i)}};dt.create=(t,e,r)=>new dt({schema:t,typeName:U.ZodEffects,effect:e,...K(r)});dt.createWithPreprocess=(t,e,r)=>new dt({schema:e,effect:{type:"preprocess",transform:t},typeName:U.ZodEffects,...K(r)});var ct=class extends ee{_parse(e){return this._getType(e)===D.undefined?Ue(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ct.create=(t,e)=>new ct({innerType:t,typeName:U.ZodOptional,...K(e)});var xt=class extends ee{_parse(e){return this._getType(e)===D.null?Ue(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};xt.create=(t,e)=>new xt({innerType:t,typeName:U.ZodNullable,...K(e)});var Nr=class extends ee{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===D.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Nr.create=(t,e)=>new Nr({innerType:t,typeName:U.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});var Mr=class extends ee{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return xn(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:U.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});var jn=class extends ee{_parse(e){if(this._getType(e)!==D.nan){let n=this._getOrReturnCtx(e);return P(n,{code:S.invalid_type,expected:D.nan,received:n.parsedType}),W}return{status:"valid",value:e.data}}};jn.create=t=>new jn({typeName:U.ZodNaN,...K(t)});var sm=Symbol("zod_brand"),Yn=class extends ee{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Kn=class t extends ee{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?W:s.status==="dirty"?(r.dirty(),_r(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?W:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:U.ZodPipeline})}},jr=class extends ee{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ar(i)&&(i.value=Object.freeze(i.value)),i);return xn(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};jr.create=(t,e)=>new jr({innerType:t,typeName:U.ZodReadonly,...K(e)});function Cf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Of(t,e={},r){return t?ur.create().superRefine((n,i)=>{let s=t(n);if(s instanceof Promise)return s.then(d=>{if(!d){let p=Cf(e,n),R=p.fatal??r??!0;i.addIssue({code:"custom",...p,fatal:R})}});if(!s){let d=Cf(e,n),p=d.fatal??r??!0;i.addIssue({code:"custom",...d,fatal:p})}}):ur.create()}var om={object:Ke.lazycreate},U;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(U||(U={}));var am=(t,e={message:`Input not instance of ${t.name}`})=>Of(r=>r instanceof t,e),Nf=cr.create,Mf=br.create,cm=jn.create,um=wr.create,jf=Tr.create,dm=Rr.create,lm=En.create,fm=kr.create,hm=Sr.create,pm=ur.create,mm=Lt.create,gm=vt.create,ym=On.create,vm=$t.create,_m=Ke.create,bm=Ke.strictCreate,wm=Cr.create,Tm=ls.create,Rm=Pr.create,km=Pt.create,Sm=fs.create,Cm=Nn.create,Pm=Mn.create,xm=hs.create,Dm=xr.create,Em=Dr.create,Om=Er.create,Nm=Or.create,Mm=dr.create,jm=dt.create,qm=ct.create,Im=xt.create,Am=dt.createWithPreprocess,Lm=Kn.create,$m=()=>Nf().optional(),Fm=()=>Mf().optional(),Wm=()=>jf().optional(),Vm={string:t=>cr.create({...t,coerce:!0}),number:t=>br.create({...t,coerce:!0}),boolean:t=>Tr.create({...t,coerce:!0}),bigint:t=>wr.create({...t,coerce:!0}),date:t=>Rr.create({...t,coerce:!0})};var zm=W;var Ff=require("node:util"),Um=__dirname.endsWith("src"),Bm=Um?ms.default.join(__dirname,"..","dist","server.js"):ms.default.join(__dirname,"server.js");function Hm(t){let e=ms.default.resolve(t);return e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e),`file://${e}`}function Zm(){let t=process.env;return!!(t.CI&&(t.GITHUB_ACTIONS||t.GITLAB_CI||t.BITBUCKET_BUILD_NUMBER||t.CIRCLECI||t.TRAVIS))}var Wf=Zm(),uc=()=>Wf?"::group::":"",dc=()=>Wf?"::endgroup::":"",Jm=et.object({files:et.array(et.string(),{required_error:"Missing --files"}),includes:et.array(et.string()).optional().default([]),bindings:et.array(et.string()).optional().default([]),logLevel:et.enum(["none","verbose"]).optional().default("none"),formatting:et.boolean().optional().default(!1),diagnostics:et.boolean().optional().default(!1),outFile:et.string().optional()}),{values:Gm}=(0,Ff.parseArgs)({options:{files:{type:"string",multiple:!0},includes:{type:"string",multiple:!0},bindings:{type:"string",multiple:!0},logLevel:{type:"string"},formatting:{type:"boolean"},diagnostics:{type:"boolean"},outFile:{type:"string"}},strict:!0}),ac=Jm.safeParse(Gm);ac.success||(console.error(`\u274C Invalid CLI input:
67
+ `,ac.error.format()),process.exit(1));var qr=ac.data,Vf=qr.files,Qm=qr.includes,Xm=qr.bindings,Ym=qr.logLevel,qf=qr.formatting,If=qr.diagnostics,Km=qr.outFile;tg(Vf,Ym,Qm,Xm,Km).catch(t=>{console.error("Error validating files:",t),process.exit(1)});var Af=0,eg=Vf.length;async function tg(t,e,r,n,i){let s=Lf.default.spawn(Bm,["--stdio"],{stdio:["pipe","pipe","pipe"]});s.stderr.on("data",te=>{console.error("LSP stderr:",te.toString())});let d=(0,$f.createMessageConnection)(new gs.StreamMessageReader(s.stdout),new gs.StreamMessageWriter(s.stdin));e==="verbose"&&d.onNotification("window/logMessage",te=>{let he={1:"ERROR",2:"WARN",3:"INFO",4:"LOG"}[te.type]||"LOG";console.log(`[LSP ${he}] ${te.message}`)}),d.onRequest("workspace/workspaceFolders",()=>[{uri:`file://${process.cwd()}`,name:"root"}]),d.listen(),d.sendNotification("workspace/didChangeConfiguration",{settings:{devicetree:{defaultIncludePaths:r,defaultBindingType:"Zephyr",defaultZephyrBindings:n,autoChangeContext:!0,allowAdhocContexts:!0,defaultLockRenameEdits:[]}}});let p=[{uri:Hm(process.cwd()),name:"root"}];await d.sendRequest("initialize",{processId:process.pid,rootUri:`file://${process.cwd()}`,capabilities:{},workspaceFolders:p}),await d.sendNotification("initialized");let R=new Set,_=new Map,E=Array.from(new Set(t)).sort((te,Be)=>{let he=fe=>fe.endsWith(".dts")?0:fe.endsWith(".dtsi")?1:2;return he(te)-he(Be)}),Z=[],de=[];for(let te of E){Af++;let Be=ei.default.readFileSync(te,"utf8"),he={uri:`file://${te}`,languageId:"devicetree",version:0,text:Be};d.sendNotification("textDocument/didOpen",{textDocument:he});let fe=await ig(d),Oe=te.endsWith(".overlay")?[fe.mainDtsPath.file]:[...cc(fe.mainDtsPath),...fe.overlays.flatMap(cc)].filter(J=>!J.endsWith(".h")&&(0,ei.existsSync)(J)),ye=J=>J===te,M=(J,L)=>J?`[${Af}/${eg}]`:`[${L+1}/${Oe.length}]`.padEnd(Oe.length.toString().length*2+3," ");qf&&await Promise.all(Oe.map(async(J,L)=>{let le=ye(J),ae=await rg(d,J,le,M(le,L));ae&&(Z.push({file:J,context:fe}),_.has(J)?_.get(J)!==ae&&console.log(`[${M}] \u26A0\uFE0F Multiple diffs for the same file. This diff will not be in the generated file!`):_.set(J,ae)),R.add(J)})),If&&await Promise.all(Oe.map(async(J,L)=>{let le=ye(J);if(te.endsWith(".dts")){let ae=await ng(d,J,le,M(le,L));ae?.length&&de.push({file:J,context:fe,message:ae.map(De=>`${De.message}: {${JSON.stringify(De.range.start)}}-{${JSON.stringify(De.range.end)}}`).join(`
68
+ `)})}else console.log(`[${M}] \u26A0\uFE0F Skipping ${J} diagnostic check. Check can only be done on full context!`);R.add(J)})),d.sendNotification("textDocument/didClose",{textDocument:{uri:`file://${te}`}}),await sg(d)}i&&ei.default.writeFileSync(i,Array.from(_.values()).join(`
69
69
 
70
- `)),console.log("Processed",R.size,"files"),l.dispose(),s.kill(),Af&&(Z.length?console.log(`${Z.length} of ${R.size} Failed formatting checks`):console.log("All files passed formatting")),Lf&&(console.log("Diagnostic issues summary"),ue.length&&(console.log(ue.map(ee=>`${lc()}File: ${ee.file}
71
- Board File: ${ee.context.mainDtsPath.file}
70
+ `)),console.log("Processed",R.size,"files"),d.dispose(),s.kill(),qf&&(Z.length?console.log(`${Z.length} of ${R.size} Failed formatting checks`):console.log("All files passed formatting")),If&&(console.log("Diagnostic issues summary"),de.length&&(console.log(de.map(te=>`${uc()}File: ${te.file}
71
+ Board File: ${te.context.mainDtsPath.file}
72
72
  Issues:
73
- ${ee.message}
74
- ${fc()}`).join(`
75
- `)),console.log(`${ue.length} of ${R.size} Failed diagnostic checks`)),gs!==R.size&&console.log(`${R.size-gs} of ${R.size} Skipped diagnostic checks`),gs===R.size&&!Z.length&&console.log("All files passed diagnostic checks")),process.exit(Z.length||ue?1:0)}var dc=t=>[t.file,...t.includes.flatMap(e=>dc(e))],rg=async(t,e)=>{let r={textDocument:{uri:`file://${e}`},options:{tabSize:4,insertSpaces:!1,trimTrailingWhitespace:!0}},n=await t.sendRequest("devicetree/formatingDiff",r);if(n)return console.error(`${lc()}[${qn}/${ri}] \u274C ${e}`),console.log(`${n}
76
- ${fc()}`),n;console.log(`[${qn}/${ri}] \u2705 ${e} is correctly formatted.`)},gs=0,ng=async(t,e)=>{gs++;let r=(await t.sendRequest("devicetree/diagnosticIssues",{uri:`file://${e}`})??[]).filter(n=>n.severity===cc.DiagnosticSeverity.Error||n.severity===cc.DiagnosticSeverity.Warning);if(r.length)return console.log(`${lc()}[${qn}/${ri}] \u274C ${e} has ${r.length} diagnostic errors!`),console.log(r.map(n=>`${n.message}: ${JSON.stringify(n.range.start)}${JSON.stringify(n.range.end)}`).join(`
77
- `)),console.log(fc()),r;console.log(`[${qn}/${ri}] \u2705 ${e} has no diagnostic errors.`)};function ig(t,e=6e4){return new Promise((r,n)=>{let i=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/newActiveContext")),s.dispose()},e),s=t.onNotification("devicetree/newActiveContext",l=>{clearTimeout(i),r(l),s.dispose()})})}function sg(t,e=5e3){return new Promise((r,n)=>{let i=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/contextDeleted")),s.dispose()},e),s=t.onNotification("devicetree/contextDeleted",()=>{clearTimeout(i),r(),s.dispose()})})}
73
+ ${te.message}
74
+ ${dc()}`).join(`
75
+ `)),console.log(`${de.length} of ${R.size} Failed diagnostic checks`)),ps!==R.size&&console.log(`${R.size-ps} of ${R.size} Skipped diagnostic checks`),ps===R.size&&!Z.length&&console.log("All files passed diagnostic checks")),process.exit(Z.length||de?1:0)}var cc=t=>[t.file,...t.includes.flatMap(e=>cc(e))],rg=async(t,e,r,n)=>{let i={textDocument:{uri:`file://${e}`},options:{tabSize:4,insertSpaces:!1,trimTrailingWhitespace:!0}},s=await t.sendRequest("devicetree/formatingDiff",i),d=r?"":" ";if(s)return console.error(`${d}${uc()}${n} \u274C ${e} is not correctly formatted.`),console.log(`${s}
76
+ ${dc()}`),s;console.log(`${d}${n} \u2705 ${e} is correctly formatted.`)},ps=0,ng=async(t,e,r,n)=>{ps++;let i=(await t.sendRequest("devicetree/diagnosticIssues",{uri:`file://${e}`})??[]).filter(d=>d.severity===oc.DiagnosticSeverity.Error||d.severity===oc.DiagnosticSeverity.Warning),s=r?"":" ";if(i.length)return console.log(`${s}${uc()}${n} \u274C ${e} has ${i.length} diagnostic errors!`),console.log(i.map(d=>`${s}${d.message}: ${JSON.stringify(d.range.start)}${JSON.stringify(d.range.end)}`).join(`
77
+ `)),console.log(dc()),i;console.log(`${s}${n} \u2705 ${e} has no diagnostic errors.`)};function ig(t,e=6e4){return new Promise((r,n)=>{let i=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/newActiveContext")),s.dispose()},e),s=t.onNotification("devicetree/newActiveContext",d=>{clearTimeout(i),r(d),s.dispose()})})}function sg(t,e=5e3){return new Promise((r,n)=>{let i=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/contextDeleted")),s.dispose()},e),s=t.onNotification("devicetree/contextDeleted",()=>{clearTimeout(i),r(),s.dispose()})})}