diff --git a/.github/workflows/update.yaml b/.github/workflows/update.yaml new file mode 100644 index 00000000..494a5031 --- /dev/null +++ b/.github/workflows/update.yaml @@ -0,0 +1,22 @@ +name: Update_Copilot_Client + +on: + schedule: [{ cron: '0 0 * * *' }] + push: { branches: ['master', 'main'] } + +jobs: + keep_file_updated: + runs-on: ubuntu-latest + name: Keep file updated + steps: + - name: Checkout repo + id: checkout + uses: actions/checkout@v2 + - name: Update file + id: update_file + uses: TheLastProject/keep-remote-file-locally-up-to-date-action@v1 + with: + git_user: 'GitHub Actions' + git_email: 'github-actions[bot]@users.noreply.github.com' + url: https://raw.githubusercontent.com/github/copilot.vim/release/copilot/dist/agent.js + file_in_repo: copilot/dist/agent.js diff --git a/copilot/dist/agent.js b/copilot/dist/agent.js index 888df6f6..712f1f45 100644 --- a/copilot/dist/agent.js +++ b/copilot/dist/agent.js @@ -1,9 +1,9 @@ /*! For license information please see agent.js.LICENSE.txt */ -(()=>{var e={3870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.Trace=t.ProgressType=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=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.RAL=void 0,t.CancellationStrategy=void 0;const r=n(839);Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return r.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return r.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return r.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return r.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return r.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return r.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return r.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return r.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return r.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return r.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return r.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return r.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return r.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return r.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return r.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return r.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return r.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return r.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return r.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return r.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return r.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return r.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return r.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return r.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return r.ParameterStructures}});const o=n(3911);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});const i=n(7135);Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=n(3881);Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=n(6525);Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=n(6654);Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=n(1343);Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}});const u=n(147);t.RAL=u.default},3881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;const r=n(147),o=n(7574),i=n(7135);var s;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||o.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(s=t.CancellationToken||(t.CancellationToken={}));const a=Object.freeze((function(e,t){const n=r.default().timer.setTimeout(e.bind(t),0);return{dispose(){r.default().timer.clearTimeout(n)}}}));class c{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?a:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.CancellationTokenSource=class{get token(){return this._token||(this._token=new c),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof c&&this._token.dispose():this._token=s.None}}},1343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.Trace=t.NullLogger=t.ProgressType=void 0;const r=n(147),o=n(7574),i=n(839),s=n(6184),a=n(7135),c=n(3881);var l,u,d,p,h,f,m,g,_,y,v,b,w;!function(e){e.type=new i.NotificationType("$/cancelRequest")}(l||(l={})),function(e){e.type=new i.NotificationType("$/progress")}(u||(u={})),t.ProgressType=class{constructor(){}},function(e){e.is=function(e){return o.func(e)}}(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(p=t.Trace||(t.Trace={})),function(e){e.fromString=function(t){if(!o.string(t))return e.Off;switch(t=t.toLowerCase()){default:return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Verbose:return"verbose";default:return"off"}}}(p=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(h=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new i.NotificationType("$/setTrace")}(f=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new i.NotificationType("$/logTrace")}(m=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(g=t.ConnectionErrors||(t.ConnectionErrors={}));class x extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,x.prototype)}}t.ConnectionError=x,function(e){e.is=function(e){const t=e;return t&&o.func(t.cancelUndispatched)}}(_=t.ConnectionStrategy||(t.ConnectionStrategy={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new c.CancellationTokenSource}),e.is=function(e){const t=e;return t&&o.func(t.createCancellationTokenSource)}}(y=t.CancellationReceiverStrategy||(t.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation(e,t){e.sendNotification(l.type,{id:t})},cleanup(e){}}),e.is=function(e){const t=e;return t&&o.func(t.sendCancellation)&&o.func(t.cleanup)}}(v=t.CancellationSenderStrategy||(t.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:y.Message,sender:v.Message}),e.is=function(e){const t=e;return t&&y.is(t.receiver)&&v.is(t.sender)}}(b=t.CancellationStrategy||(t.CancellationStrategy={})),(t.ConnectionOptions||(t.ConnectionOptions={})).is=function(e){const t=e;return t&&(b.is(t.cancellationStrategy)||_.is(t.connectionStrategy))},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(w||(w={})),t.createMessageConnection=function(e,n,_,y){const v=void 0!==_?_:t.NullLogger;let T=0,E=0,C=0;const S="2.0";let k;const P=Object.create(null);let I;const R=Object.create(null),O=new Map;let A,N,D=new s.LinkedMap,M=Object.create(null),$=Object.create(null),j=p.Off,L=h.Text,F=w.New;const q=new a.Emitter,B=new a.Emitter,H=new a.Emitter,U=new a.Emitter,W=new a.Emitter,z=y&&y.cancellationStrategy?y.cancellationStrategy:b.Message;function K(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function V(e){}function G(){return F===w.Listening}function J(){return F===w.Closed}function X(){return F===w.Disposed}function Q(){F!==w.New&&F!==w.Listening||(F=w.Closed,B.fire(void 0))}function Y(){A||0===D.size||(A=r.default().timer.setImmediate((()=>{A=void 0,function(){if(0===D.size)return;const e=D.shift();try{i.isRequestMessage(e)?function(e){if(X())return;function t(t,r,o){const s={jsonrpc:S,id:e.id};t instanceof i.ResponseError?s.error=t.toJson():s.result=void 0===t?null:t,ee(s,r,o),n.write(s)}function r(t,r,o){const i={jsonrpc:S,id:e.id,error:t.toJson()};ee(i,r,o),n.write(i)}!function(e){if(j!==p.Off&&N)if(L===h.Text){let t;j===p.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),N.log(`Received request '${e.method} - (${e.id})'.`,t)}else te("receive-request",e)}(e);const s=P[e.method];let a,c;s&&(a=s.type,c=s.handler);const l=Date.now();if(c||k){const s=String(e.id),u=z.receiver.createCancellationTokenSource(s);$[s]=u;try{let d;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void r(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but recevied none.`),e.method,l);d=c(u.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===i.ParameterStructures.byName)return void r(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,l);d=c(...e.params,u.token)}else{if(void 0!==a&&a.parameterStructures===i.ParameterStructures.byPosition)return void r(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,l);d=c(e.params,u.token)}else k&&(d=k(e.method,e.params,u.token));const p=d;d?p.then?p.then((n=>{delete $[s],t(n,e.method,l)}),(t=>{delete $[s],t instanceof i.ResponseError?r(t,e.method,l):t&&o.string(t.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)})):(delete $[s],t(d,e.method,l)):(delete $[s],function(t,r,o){void 0===t&&(t=null);const i={jsonrpc:S,id:e.id,result:t};ee(i,r,o),n.write(i)}(d,e.method,l))}catch(n){delete $[s],n instanceof i.ResponseError?t(n,e.method,l):n&&o.string(n.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,l):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}}else r(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,l)}(e):i.isNotificationMessage(e)?function(e){if(X())return;let t,n;if(e.method===l.type.method)n=e=>{const t=e.id,n=$[String(t)];n&&n.cancel()};else{const r=R[e.method];r&&(n=r.handler,t=r.type)}if(n||I)try{!function(e){if(j!==p.Off&&N&&e.method!==m.type.method)if(L===h.Text){let t;j===p.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),N.log(`Received notification '${e.method}'.`,t)}else te("receive-notification",e)}(e),n?void 0===e.params?(void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==i.ParameterStructures.byName&&v.error(`Notification ${e.method} defines ${t.numberOfParams} params but recevied none.`),n()):Array.isArray(e.params)?(void 0!==t&&(t.parameterStructures===i.ParameterStructures.byName&&v.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&v.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${e.params.length} argumennts`)),n(...e.params)):(void 0!==t&&t.parameterStructures===i.ParameterStructures.byPosition&&v.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params)):I&&I(e.method,e.params)}catch(t){t.message?v.error(`Notification handler '${e.method}' failed with message: ${t.message}`):v.error(`Notification handler '${e.method}' failed unexpectedly.`)}else H.fire(e)}(e):i.isResponseMessage(e)?function(e){if(!X())if(null===e.id)e.error?v.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):v.error("Received response message without id. No further error information provided.");else{const t=String(e.id),n=M[t];if(function(e,t){if(j!==p.Off&&N)if(L===h.Text){let n;if(j===p.Verbose&&(e.error&&e.error.data?n=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?n=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";N.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else N.log(`Received response ${e.id} without active response promise.`,n)}else te("receive-response",e)}(e,n),n){delete M[t];try{if(e.error){const t=e.error;n.reject(new i.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?v.error(`Response handler '${n.method}' failed with message: ${e.message}`):v.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void v.error("Received empty message.");v.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(o.string(t.id)||o.number(t.id)){const e=String(t.id),n=M[e];n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{Y()}}()})))}e.onClose(Q),e.onError((function(e){q.fire([e,void 0,void 0])})),n.onClose(Q),n.onError((function(e){q.fire(e)}));const Z=e=>{try{if(i.isNotificationMessage(e)&&e.method===l.type.method){const t=K(e.params.id),r=D.get(t);if(i.isRequestMessage(r)){const o=null==y?void 0:y.connectionStrategy,i=o&&o.cancelUndispatched?o.cancelUndispatched(r,V):void 0;if(i&&(void 0!==i.error||void 0!==i.result))return D.delete(t),i.id=r.id,ee(i,e.method,Date.now()),void n.write(i)}}!function(e,t){var n;i.isRequestMessage(t)?e.set(K(t.id),t):i.isResponseMessage(t)?e.set(null===(n=t.id)?"res-unknown-"+(++C).toString():"res-"+n.toString(),t):e.set("not-"+(++E).toString(),t)}(D,e)}finally{Y()}};function ee(e,t,n){if(j!==p.Off&&N)if(L===h.Text){let r;j===p.Verbose&&(e.error&&e.error.data?r=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?r=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),N.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else te("send-response",e)}function te(e,t){if(!N||j===p.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};N.log(n)}function ne(){if(J())throw new x(g.Closed,"Connection is closed.");if(X())throw new x(g.Disposed,"Connection is disposed.")}function re(e){return void 0===e?null:e}function oe(e){return null===e?void 0:e}function ie(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function se(e,t){switch(e){case i.ParameterStructures.auto:return ie(t)?oe(t):[re(t)];case i.ParameterStructures.byName:if(!ie(t))throw new Error("Recevied parameters by name but param is not an object literal.");return oe(t);case i.ParameterStructures.byPosition:return[re(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function ae(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=se(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e{let r,s;if(ne(),o.string(e)){r=e;const n=t[0];let o=0,a=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(o=1,a=n);let c=t.length;const l=c-o;switch(l){case 0:s=void 0;break;case 1:s=se(a,t[o]);break;default:if(a===i.ParameterStructures.byName)throw new Error(`Recevied ${l} parameters for 'by Name' notification parameter structure.`);s=t.slice(o,c).map((e=>re(e)))}}else{const n=t;r=e.method,s=ae(e,n)}const a={jsonrpc:S,method:r,params:s};!function(e){if(j!==p.Off&&N)if(L===h.Text){let t;j===p.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),N.log(`Sending notification '${e.method}'.`,t)}else te("send-notification",e)}(a),n.write(a)},onNotification:(e,t)=>{let n;return ne(),o.func(e)?I=e:t&&(o.string(e)?(n=e,R[e]={type:void 0,handler:t}):(n=e.method,R[e.method]={type:e,handler:t})),{dispose:()=>{void 0!==n?delete R[n]:I=void 0}}},onProgress:(e,t,n)=>{if(O.has(t))throw new Error(`Progress handler for token ${t} already registered`);return O.set(t,n),{dispose:()=>{O.delete(t)}}},sendProgress:(e,t,n)=>{ce.sendNotification(u.type,{token:t,value:n})},onUnhandledProgress:U.event,sendRequest:(e,...t)=>{let r,s,a;if(ne(),function(){if(!G())throw new Error("Call listen() first.")}(),o.string(e)){r=e;const n=t[0],o=t[t.length-1];let l=0,u=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(l=1,u=n);let d=t.length;c.CancellationToken.is(o)&&(d-=1,a=o);const p=d-l;switch(p){case 0:s=void 0;break;case 1:s=se(u,t[l]);break;default:if(u===i.ParameterStructures.byName)throw new Error(`Recevied ${p} parameters for 'by Name' request parameter structure.`);s=t.slice(l,d).map((e=>re(e)))}}else{const n=t;r=e.method,s=ae(e,n);const o=e.numberOfParams;a=c.CancellationToken.is(n[o])?n[o]:void 0}const l=T++;let u;return a&&(u=a.onCancellationRequested((()=>{z.sender.sendCancellation(ce,l)}))),new Promise(((e,t)=>{const o={jsonrpc:S,id:l,method:r,params:s};let a={method:r,timerStart:Date.now(),resolve:t=>{e(t),z.sender.cleanup(l),null==u||u.dispose()},reject:e=>{t(e),z.sender.cleanup(l),null==u||u.dispose()}};!function(e){if(j!==p.Off&&N)if(L===h.Text){let t;j===p.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),N.log(`Sending request '${e.method} - (${e.id})'.`,t)}else te("send-request",e)}(o);try{n.write(o)}catch(e){a.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),a=null}a&&(M[String(l)]=a)}))},onRequest:(e,t)=>{ne();let n=null;return d.is(e)?(n=void 0,k=e):o.string(e)?(n=null,void 0!==t&&(n=e,P[e]={handler:t,type:void 0})):void 0!==t&&(n=e.method,P[e.method]={type:e,handler:t}),{dispose:()=>{null!==n&&(void 0!==n?delete P[n]:k=void 0)}}},trace:(e,t,n)=>{let r=!1,i=h.Text;void 0!==n&&(o.boolean(n)?r=n:(r=n.sendNotification||!1,i=n.traceFormat||h.Text)),j=e,L=i,N=j===p.Off?void 0:t,!r||J()||X()||ce.sendNotification(f.type,{value:p.toString(e)})},onError:q.event,onClose:B.event,onUnhandledNotification:H.event,onDispose:W.event,end:()=>{n.end()},dispose:()=>{if(X())return;F=w.Disposed,W.fire(void 0);const t=new Error("Connection got disposed.");Object.keys(M).forEach((e=>{M[e].reject(t)})),M=Object.create(null),$=Object.create(null),D=new s.LinkedMap,o.func(n.dispose)&&n.dispose(),o.func(e.dispose)&&e.dispose()},listen:()=>{ne(),function(){if(G())throw new x(g.AlreadyListening,"Connection is already listening")}(),F=w.Listening,e.listen(Z)},inspect:()=>{r.default().console.log("inspect")}};return ce.onNotification(m.type,(e=>{j!==p.Off&&N&&N.log(e.message,j===p.Verbose?e.verbose:void 0)})),ce.onNotification(u.type,(e=>{const t=O.get(e.token);t?t(e.value):U.fire(e)})),ce}},3911:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0,(t.Disposable||(t.Disposable={})).create=function(e){return{dispose:e}}},7135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;const r=n(147);!function(e){const t={dispose(){}};e.None=function(){return t}}(t.Event||(t.Event={}));class o{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,o=this._callbacks.length;r{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=i._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=i,i._noop=function(){}},7574:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))}},6184:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(n=t.Touch||(t.Touch={}));class r{constructor(){this[Symbol.toStringTag]="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(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=n.None){const r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let o=this._map.get(e);if(o)o.value=t,r!==n.None&&this.touch(o,r);else{switch(o={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(o);break;case n.First:this.addItemFirst(o);break;case n.Last:default:this.addItemLast(o)}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.key,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.value,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:[n.key,n.value],done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;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{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}t.LinkedMap=r,t.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),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,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}},5530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0,t.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(0===this._chunks.length)return;let e=0,t=0,n=0,r=0;e:for(;tthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const o=r.slice(0,e);t.set(o,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}},6525:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;const r=n(147),o=n(7574),i=n(7135);var s;(t.MessageReader||(t.MessageReader={})).is=function(e){let t=e;return t&&o.func(t.listen)&&o.func(t.dispose)&&o.func(t.onError)&&o.func(t.onClose)&&o.func(t.onPartialMessage)};class a{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter,this.partialMessageEmitter=new i.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: ${o.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageReader=a,function(e){e.fromOptions=function(e){var t;let n,o;const i=new Map;let s;const a=new Map;if(void 0===e||"string"==typeof e)n=null!=e?e:"utf-8";else{if(n=null!==(t=e.charset)&&void 0!==t?t:"utf-8",void 0!==e.contentDecoder&&(o=e.contentDecoder,i.set(o.name,o)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)i.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(s=e.contentTypeDecoder,a.set(s.name,s)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)a.set(t.name,t)}return void 0===s&&(s=r.default().applicationJson.decoder,a.set(s.name,s)),{charset:n,contentDecoder:o,contentDecoders:i,contentTypeDecoder:s,contentTypeDecoders:a}}}(s||(s={})),t.ReadableStreamMessageReader=class extends a{constructor(e,t){super(),this.readable=e,this.options=s.fromOptions(t),this.buffer=r.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}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;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders();if(!e)return;const t=e.get("Content-Length");if(!t)throw new Error("Header must provide a Content-Length property.");const n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();let t;this.clearPartialMessageTimer(),this.nextMessageLength=-1,t=void 0!==this.options.contentDecoder?this.options.contentDecoder.decode(e):Promise.resolve(e),t.then((e=>{this.options.contentTypeDecoder.decode(e,this.options).then((e=>{this.callback(e)}),(e=>{this.fireError(e)}))}),(e=>{this.fireError(e)}))}}clearPartialMessageTimer(){this.partialMessageTimer&&(r.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=r.default().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}},6654:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;const r=n(147),o=n(7574),i=n(142),s=n(7135);var a;(t.MessageWriter||(t.MessageWriter={})).is=function(e){let t=e;return t&&o.func(t.dispose)&&o.func(t.onClose)&&o.func(t.onError)&&o.func(t.write)};class c{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,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: ${o.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageWriter=c,function(e){e.fromOptions=function(e){var t,n;return void 0===e||"string"==typeof e?{charset:null!=e?e:"utf-8",contentTypeEncoder:r.default().applicationJson.encoder}:{charset:null!==(t=e.charset)&&void 0!==t?t:"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:null!==(n=e.contentTypeEncoder)&&void 0!==n?n:r.default().applicationJson.encoder}}}(a||(a={})),t.WriteableStreamMessageWriter=class extends c{constructor(e,t){super(),this.writable=e,this.options=a.fromOptions(t),this.errorCount=0,this.writeSemaphore=new i.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}},839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isResponseMessage=t.isNotificationMessage=t.isRequestMessage=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;const r=n(7574);var o;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=e.jsonrpcReservedErrorRangeStart,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=e.jsonrpcReservedErrorRangeEnd}(o=t.ErrorCodes||(t.ErrorCodes={}));class i extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:o.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,i.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}}t.ResponseError=i;class s{constructor(e){this.kind=e}static is(e){return e===s.auto||e===s.byName||e===s.byPosition}toString(){return this.kind}}t.ParameterStructures=s,s.auto=new s("auto"),s.byPosition=new s("byPosition"),s.byName=new s("byName");class a{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return s.auto}}t.AbstractMessageSignature=a,t.RequestType0=class extends a{constructor(e){super(e,0)}},t.RequestType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType2=class extends a{constructor(e){super(e,2)}},t.RequestType3=class extends a{constructor(e){super(e,3)}},t.RequestType4=class extends a{constructor(e){super(e,4)}},t.RequestType5=class extends a{constructor(e){super(e,5)}},t.RequestType6=class extends a{constructor(e){super(e,6)}},t.RequestType7=class extends a{constructor(e){super(e,7)}},t.RequestType8=class extends a{constructor(e){super(e,8)}},t.RequestType9=class extends a{constructor(e){super(e,9)}},t.NotificationType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType0=class extends a{constructor(e){super(e,0)}},t.NotificationType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType2=class extends a{constructor(e){super(e,2)}},t.NotificationType3=class extends a{constructor(e){super(e,3)}},t.NotificationType4=class extends a{constructor(e){super(e,4)}},t.NotificationType5=class extends a{constructor(e){super(e,5)}},t.NotificationType6=class extends a{constructor(e){super(e,6)}},t.NotificationType7=class extends a{constructor(e){super(e,7)}},t.NotificationType8=class extends a{constructor(e){super(e,8)}},t.NotificationType9=class extends a{constructor(e){super(e,9)}},t.isRequestMessage=function(e){const t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},t.isNotificationMessage=function(e){const t=e;return t&&r.string(t.method)&&void 0===e.id},t.isResponseMessage=function(e){const t=e;return t&&(void 0!==t.result||!!t.error)&&(r.string(t.id)||r.number(t.id)||null===t.id)}},147:(e,t)=>{"use strict";let n;function r(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(r||(r={})),t.default=r},142:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;const r=n(147);t.Semaphore=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(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&r.default().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}},4389:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const i=n(3034);i.default.install();const s=n(3870),a=n(1017),c=n(2037),l=n(6113),u=n(1808);o(n(3870),t);class d extends s.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){return this.process.on("message",e),s.Disposable.create((()=>this.process.off("message",e)))}}t.IPCMessageReader=d;class p extends s.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){try{return"function"==typeof this.process.send&&this.process.send(e,void 0,void 0,(t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0})),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}t.IPCMessageWriter=p;class h extends s.ReadableStreamMessageReader{constructor(e,t="utf-8"){super(i.default().stream.asReadableStream(e),t)}}t.SocketMessageReader=h;class f extends s.WriteableStreamMessageWriter{constructor(e,t){super(i.default().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=f;class m extends s.ReadableStreamMessageReader{constructor(e,t){super(i.default().stream.asReadableStream(e),t)}}t.StreamMessageReader=m;class g extends s.WriteableStreamMessageWriter{constructor(e,t){super(i.default().stream.asWritableStream(e),t)}}t.StreamMessageWriter=g;const _=process.env.XDG_RUNTIME_DIR,y=new Map([["linux",107],["darwin",103]]);t.generateRandomPipeName=function(){const e=l.randomBytes(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=_?a.join(_,`vscode-ipc-${e}.sock`):a.join(c.tmpdir(),`vscode-${e}.sock`);const n=y.get(process.platform);return void 0!==n&&t.length>=n&&i.default().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t},t.createClientPipeTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((o,i)=>{let s=u.createServer((e=>{s.close(),n([new h(e,t),new f(e,t)])}));s.on("error",i),s.listen(e,(()=>{s.removeListener("error",i),o({onConnected:()=>r})}))}))},t.createServerPipeTransport=function(e,t="utf-8"){const n=u.createConnection(e);return[new h(n,t),new f(n,t)]},t.createClientSocketTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((o,i)=>{const s=u.createServer((e=>{s.close(),n([new h(e,t),new f(e,t)])}));s.on("error",i),s.listen(e,"127.0.0.1",(()=>{s.removeListener("error",i),o({onConnected:()=>r})}))}))},t.createServerSocketTransport=function(e,t="utf-8"){const n=u.createConnection(e,"127.0.0.1");return[new h(n,t),new f(n,t)]},t.createMessageConnection=function(e,t,n,r){n||(n=s.NullLogger);const o=function(e){const t=e;return void 0!==t.read&&void 0!==t.addListener}(e)?new m(e):e,i=function(e){const t=e;return void 0!==t.write&&void 0!==t.addListener}(t)?new g(t):t;return s.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),s.createMessageConnection(o,i,n,r)}},3034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(147),o=n(3837),i=n(3911),s=n(5530);class a extends s.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return a.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new o.TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}}a.emptyBuffer=Buffer.allocUnsafe(0);class c{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),i.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),i.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),i.Disposable.create((()=>this.stream.off("end",e)))}onData(e){return this.stream.on("data",e),i.Disposable.create((()=>this.stream.off("data",e)))}}class l{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),i.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),i.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),i.Disposable.create((()=>this.stream.off("end",e)))}write(e,t){return new Promise(((n,r)=>{const o=e=>{null==e?n():r(e)};"string"==typeof e?this.stream.write(e,t,o):this.stream.write(e,o)}))}end(){this.stream.end()}}const u=Object.freeze({messageBuffer:Object.freeze({create:e=>new a(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(e){return Promise.reject(e)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new o.TextDecoder(t.charset).decode(e)))}catch(e){return Promise.reject(e)}}})}),stream:Object.freeze({asReadableStream:e=>new c(e),asWritableStream:e=>new l(e)}),console,timer:Object.freeze({setTimeout:(e,t,...n)=>setTimeout(e,t,...n),clearTimeout(e){clearTimeout(e)},setImmediate:(e,...t)=>setImmediate(e,...t),clearImmediate(e){clearImmediate(e)}})});function d(){return u}!function(e){e.install=function(){r.default.install(u)}}(d||(d={})),t.default=d},5028:(e,t,n)=>{"use strict";e.exports=n(4389)},4437:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,o(n(4389),t),o(n(1674),t),o(n(6140),t),o(n(542),t);var i,s=n(3767);Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return s.createProtocolConnection}}),(i=t.LSPErrorCodes||(t.LSPErrorCodes={})).lspReservedErrorRangeStart=-32899,i.ContentModified=-32801,i.RequestCancelled=-32800,i.lspReservedErrorRangeEnd=-32800},3767:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=n(4389);t.createProtocolConnection=function(e,t,n,o){return r.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),r.createMessageConnection(e,t,n,o)}},6140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=void 0;const r=n(4389);t.RegistrationType=class{constructor(e){this.method=e}};class o extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=o;class i extends r.RequestType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolRequestType=i;class s extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=s;class a extends r.NotificationType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolNotificationType=a},2918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;const r=n(6140);var o,i,s;(s=t.CallHierarchyPrepareRequest||(t.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",s.type=new r.ProtocolRequestType(s.method),(i=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",i.type=new r.ProtocolRequestType(i.method),(o=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",o.type=new r.ProtocolRequestType(o.method)},3390:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;const r=n(6140);var o;(o=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",o.type=new r.ProtocolRequestType(o.method),(t.ColorPresentationRequest||(t.ColorPresentationRequest={})).type=new r.ProtocolRequestType("textDocument/colorPresentation")},5934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;const r=n(6140);(t.ConfigurationRequest||(t.ConfigurationRequest={})).type=new r.ProtocolRequestType("workspace/configuration")},764:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;const r=n(6140);var o;(o=t.DeclarationRequest||(t.DeclarationRequest={})).method="textDocument/declaration",o.type=new r.ProtocolRequestType(o.method)},7846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;const r=n(6140);var o,i,s,a,c,l,u;(u=t.FileOperationPatternKind||(t.FileOperationPatternKind={})).file="file",u.folder="folder",(l=t.WillCreateFilesRequest||(t.WillCreateFilesRequest={})).method="workspace/willCreateFiles",l.type=new r.ProtocolRequestType(l.method),(c=t.DidCreateFilesNotification||(t.DidCreateFilesNotification={})).method="workspace/didCreateFiles",c.type=new r.ProtocolNotificationType(c.method),(a=t.WillRenameFilesRequest||(t.WillRenameFilesRequest={})).method="workspace/willRenameFiles",a.type=new r.ProtocolRequestType(a.method),(s=t.DidRenameFilesNotification||(t.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.type=new r.ProtocolNotificationType(s.method),(i=t.DidDeleteFilesNotification||(t.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",i.type=new r.ProtocolNotificationType(i.method),(o=t.WillDeleteFilesRequest||(t.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",o.type=new r.ProtocolRequestType(o.method)},3394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRequest=t.FoldingRangeKind=void 0;const r=n(6140);var o,i;(i=t.FoldingRangeKind||(t.FoldingRangeKind={})).Comment="comment",i.Imports="imports",i.Region="region",(o=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",o.type=new r.ProtocolRequestType(o.method)},2122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;const r=n(6140);var o;(o=t.ImplementationRequest||(t.ImplementationRequest={})).method="textDocument/implementation",o.type=new r.ProtocolRequestType(o.method)},542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeError=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.DocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=void 0;const r=n(9533),o=n(6140),i=n(2122);Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=n(1589);Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=n(9795);Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const c=n(5934);Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return c.ConfigurationRequest}});const l=n(3390);Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const u=n(3394);Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}});const d=n(764);Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return d.DeclarationRequest}});const p=n(5206);Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return p.SelectionRangeRequest}});const h=n(1862);Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return h.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return h.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return h.WorkDoneProgressCancelNotification}});const f=n(2918);Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return f.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return f.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return f.CallHierarchyPrepareRequest}});const m=n(9434);Object.defineProperty(t,"SemanticTokenTypes",{enumerable:!0,get:function(){return m.SemanticTokenTypes}}),Object.defineProperty(t,"SemanticTokenModifiers",{enumerable:!0,get:function(){return m.SemanticTokenModifiers}}),Object.defineProperty(t,"SemanticTokens",{enumerable:!0,get:function(){return m.SemanticTokens}}),Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});const g=n(5726);Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return g.ShowDocumentRequest}});const _=n(6305);Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return _.LinkedEditingRangeRequest}});const y=n(7846);Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const v=n(3443);var b,w,x,T,E,C,S,k,P,I,R,O,A,N,D,M,$,j,L,F,q,B,H,U,W,z,K,V,G,J,X,Q,Y,Z,ee,te,ne,re,oe,ie;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}}),function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(b=t.DocumentFilter||(t.DocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!b.is(t))return!1;return!0}}(w=t.DocumentSelector||(t.DocumentSelector={})),(t.RegistrationRequest||(t.RegistrationRequest={})).type=new o.ProtocolRequestType("client/registerCapability"),(t.UnregistrationRequest||(t.UnregistrationRequest={})).type=new o.ProtocolRequestType("client/unregisterCapability"),(ie=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",ie.Rename="rename",ie.Delete="delete",(oe=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",oe.Transactional="transactional",oe.TextOnlyTransactional="textOnlyTransactional",oe.Undo="undo",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||w.is(t.documentSelector))},(re=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},re.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(t.InitializeRequest||(t.InitializeRequest={})).type=new o.ProtocolRequestType("initialize"),(t.InitializeError||(t.InitializeError={})).unknownProtocolVersion=1,(t.InitializedNotification||(t.InitializedNotification={})).type=new o.ProtocolNotificationType("initialized"),(t.ShutdownRequest||(t.ShutdownRequest={})).type=new o.ProtocolRequestType0("shutdown"),(t.ExitNotification||(t.ExitNotification={})).type=new o.ProtocolNotificationType0("exit"),(t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).type=new o.ProtocolNotificationType("workspace/didChangeConfiguration"),(ne=t.MessageType||(t.MessageType={})).Error=1,ne.Warning=2,ne.Info=3,ne.Log=4,(t.ShowMessageNotification||(t.ShowMessageNotification={})).type=new o.ProtocolNotificationType("window/showMessage"),(t.ShowMessageRequest||(t.ShowMessageRequest={})).type=new o.ProtocolRequestType("window/showMessageRequest"),(t.LogMessageNotification||(t.LogMessageNotification={})).type=new o.ProtocolNotificationType("window/logMessage"),(t.TelemetryEventNotification||(t.TelemetryEventNotification={})).type=new o.ProtocolNotificationType("telemetry/event"),(te=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,te.Full=1,te.Incremental=2,(ee=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",ee.type=new o.ProtocolNotificationType(ee.method),(Z=t.TextDocumentContentChangeEvent||(t.TextDocumentContentChangeEvent={})).isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},Z.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(Y=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",Y.type=new o.ProtocolNotificationType(Y.method),(Q=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",Q.type=new o.ProtocolNotificationType(Q.method),(X=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",X.type=new o.ProtocolNotificationType(X.method),(J=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,J.AfterDelay=2,J.FocusOut=3,(G=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",G.type=new o.ProtocolNotificationType(G.method),(V=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",V.type=new o.ProtocolRequestType(V.method),(t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).type=new o.ProtocolNotificationType("workspace/didChangeWatchedFiles"),(K=t.FileChangeType||(t.FileChangeType={})).Created=1,K.Changed=2,K.Deleted=3,(z=t.WatchKind||(t.WatchKind={})).Create=1,z.Change=2,z.Delete=4,(t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).type=new o.ProtocolNotificationType("textDocument/publishDiagnostics"),(W=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,W.TriggerCharacter=2,W.TriggerForIncompleteCompletions=3,(U=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",U.type=new o.ProtocolRequestType(U.method),(H=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",H.type=new o.ProtocolRequestType(H.method),(B=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",B.type=new o.ProtocolRequestType(B.method),(q=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,q.TriggerCharacter=2,q.ContentChange=3,(F=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",F.type=new o.ProtocolRequestType(F.method),(L=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",L.type=new o.ProtocolRequestType(L.method),(j=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",j.type=new o.ProtocolRequestType(j.method),($=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",$.type=new o.ProtocolRequestType($.method),(M=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",M.type=new o.ProtocolRequestType(M.method),(D=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",D.type=new o.ProtocolRequestType(D.method),(N=t.CodeActionResolveRequest||(t.CodeActionResolveRequest={})).method="codeAction/resolve",N.type=new o.ProtocolRequestType(N.method),(A=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",A.type=new o.ProtocolRequestType(A.method),(O=t.CodeLensRequest||(t.CodeLensRequest={})).method="textDocument/codeLens",O.type=new o.ProtocolRequestType(O.method),(R=t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).method="codeLens/resolve",R.type=new o.ProtocolRequestType(R.method),(I=t.CodeLensRefreshRequest||(t.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",I.type=new o.ProtocolRequestType0(I.method),(P=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",P.type=new o.ProtocolRequestType(P.method),(k=t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).method="documentLink/resolve",k.type=new o.ProtocolRequestType(k.method),(S=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",S.type=new o.ProtocolRequestType(S.method),(C=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",C.type=new o.ProtocolRequestType(C.method),(E=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",E.type=new o.ProtocolRequestType(E.method),(t.PrepareSupportDefaultBehavior||(t.PrepareSupportDefaultBehavior={})).Identifier=1,(T=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",T.type=new o.ProtocolRequestType(T.method),(x=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",x.type=new o.ProtocolRequestType(x.method),(t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).type=new o.ProtocolRequestType("workspace/executeCommand"),(t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).type=new o.ProtocolRequestType("workspace/applyEdit")},6305:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;const r=n(6140);var o;(o=t.LinkedEditingRangeRequest||(t.LinkedEditingRangeRequest={})).method="textDocument/linkedEditingRange",o.type=new r.ProtocolRequestType(o.method)},3443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;const r=n(6140);var o,i,s;(s=t.UniquenessLevel||(t.UniquenessLevel={})).document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global",(i=t.MonikerKind||(t.MonikerKind={})).import="import",i.export="export",i.local="local",(o=t.MonikerRequest||(t.MonikerRequest={})).method="textDocument/moniker",o.type=new r.ProtocolRequestType(o.method)},1862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;const r=n(4389),o=n(6140);var i;(i=t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,i.is=function(e){return e===i.type},(t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).type=new o.ProtocolRequestType("window/workDoneProgress/create"),(t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).type=new o.ProtocolNotificationType("window/workDoneProgress/cancel")},5206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;const r=n(6140);var o;(o=t.SelectionRangeRequest||(t.SelectionRangeRequest={})).method="textDocument/selectionRange",o.type=new r.ProtocolRequestType(o.method)},9434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=void 0;const r=n(6140);var o,i,s,a,c,l,u;(u=t.SemanticTokenTypes||(t.SemanticTokenTypes={})).namespace="namespace",u.type="type",u.class="class",u.enum="enum",u.interface="interface",u.struct="struct",u.typeParameter="typeParameter",u.parameter="parameter",u.variable="variable",u.property="property",u.enumMember="enumMember",u.event="event",u.function="function",u.method="method",u.macro="macro",u.keyword="keyword",u.modifier="modifier",u.comment="comment",u.string="string",u.number="number",u.regexp="regexp",u.operator="operator",(l=t.SemanticTokenModifiers||(t.SemanticTokenModifiers={})).declaration="declaration",l.definition="definition",l.readonly="readonly",l.static="static",l.deprecated="deprecated",l.abstract="abstract",l.async="async",l.modification="modification",l.documentation="documentation",l.defaultLibrary="defaultLibrary",(t.SemanticTokens||(t.SemanticTokens={})).is=function(e){const t=e;return void 0!==t&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])},(t.TokenFormat||(t.TokenFormat={})).Relative="relative",(c=t.SemanticTokensRegistrationType||(t.SemanticTokensRegistrationType={})).method="textDocument/semanticTokens",c.type=new r.RegistrationType(c.method),(a=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",a.type=new r.ProtocolRequestType(a.method),(s=t.SemanticTokensDeltaRequest||(t.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",s.type=new r.ProtocolRequestType(s.method),(i=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",i.type=new r.ProtocolRequestType(i.method),(o=t.SemanticTokensRefreshRequest||(t.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",o.type=new r.ProtocolRequestType0(o.method)},5726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;const r=n(6140);var o;(o=t.ShowDocumentRequest||(t.ShowDocumentRequest={})).method="window/showDocument",o.type=new r.ProtocolRequestType(o.method)},1589:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;const r=n(6140);var o;(o=t.TypeDefinitionRequest||(t.TypeDefinitionRequest={})).method="textDocument/typeDefinition",o.type=new r.ProtocolRequestType(o.method)},9795:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;const r=n(6140);(t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).type=new r.ProtocolRequestType0("workspace/workspaceFolders"),(t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).type=new r.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")},9533:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.objectLiteral=function(e){return null!==e&&"object"==typeof e}},273:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const i=n(5028);o(n(5028),t),o(n(4437),t),t.createProtocolConnection=function(e,t,n,r){return i.createMessageConnection(e,t,n,r)}},6560:(e,t,n)=>{"use strict";e.exports=n(273)},6813:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TextDocument:()=>r});var r,o=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;oe?r=o:n=o+1}var i=n-1;return{line:i,character:e-t[i]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function l(e){var t=c(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new i(e,t,n,r)},e.update=function(e,t,n){if(e instanceof i)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var n=e.getText(),r=0,o=[],i=0,a=s(t.map(l),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}));ir&&o.push(n.substring(r,u)),c.newText.length&&o.push(c.newText),r=e.offsetAt(c.range.end)}return o.push(n.substr(r)),o.join("")}}(r||(r={}))},1674:(e,t,n)=>{"use strict";var r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w,x,T,E,C,S,k,P;n.r(t),n.d(t,{integer:()=>r,uinteger:()=>o,Position:()=>i,Range:()=>s,Location:()=>a,LocationLink:()=>c,Color:()=>l,ColorInformation:()=>u,ColorPresentation:()=>d,FoldingRangeKind:()=>p,FoldingRange:()=>h,DiagnosticRelatedInformation:()=>f,DiagnosticSeverity:()=>m,DiagnosticTag:()=>g,CodeDescription:()=>_,Diagnostic:()=>y,Command:()=>v,TextEdit:()=>b,ChangeAnnotation:()=>w,ChangeAnnotationIdentifier:()=>x,AnnotatedTextEdit:()=>T,TextDocumentEdit:()=>E,CreateFile:()=>C,RenameFile:()=>S,DeleteFile:()=>k,WorkspaceEdit:()=>P,WorkspaceChange:()=>ae,TextDocumentIdentifier:()=>I,VersionedTextDocumentIdentifier:()=>R,OptionalVersionedTextDocumentIdentifier:()=>O,TextDocumentItem:()=>A,MarkupKind:()=>N,MarkupContent:()=>D,CompletionItemKind:()=>M,InsertTextFormat:()=>$,CompletionItemTag:()=>j,InsertReplaceEdit:()=>L,InsertTextMode:()=>F,CompletionItem:()=>q,CompletionList:()=>B,MarkedString:()=>H,Hover:()=>U,ParameterInformation:()=>W,SignatureInformation:()=>z,DocumentHighlightKind:()=>K,DocumentHighlight:()=>V,SymbolKind:()=>G,SymbolTag:()=>J,SymbolInformation:()=>X,DocumentSymbol:()=>Q,CodeActionKind:()=>Y,CodeActionContext:()=>Z,CodeAction:()=>ee,CodeLens:()=>te,FormattingOptions:()=>ne,DocumentLink:()=>re,SelectionRange:()=>oe,EOL:()=>le,TextDocument:()=>ce}),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647}(r||(r={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647}(o||(o={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=o.MAX_VALUE),t===Number.MAX_VALUE&&(t=o.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return ue.objectLiteral(t)&&ue.uinteger(t.line)&&ue.uinteger(t.character)}}(i||(i={})),function(e){e.create=function(e,t,n,r){if(ue.uinteger(e)&&ue.uinteger(t)&&ue.uinteger(n)&&ue.uinteger(r))return{start:i.create(e,t),end:i.create(n,r)};if(i.is(e)&&i.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")},e.is=function(e){var t=e;return ue.objectLiteral(t)&&i.is(t.start)&&i.is(t.end)}}(s||(s={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return ue.defined(t)&&s.is(t.range)&&(ue.string(t.uri)||ue.undefined(t.uri))}}(a||(a={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return ue.defined(t)&&s.is(t.targetRange)&&ue.string(t.targetUri)&&(s.is(t.targetSelectionRange)||ue.undefined(t.targetSelectionRange))&&(s.is(t.originSelectionRange)||ue.undefined(t.originSelectionRange))}}(c||(c={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return ue.numberRange(t.red,0,1)&&ue.numberRange(t.green,0,1)&&ue.numberRange(t.blue,0,1)&&ue.numberRange(t.alpha,0,1)}}(l||(l={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return s.is(t.range)&&l.is(t.color)}}(u||(u={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return ue.string(t.label)&&(ue.undefined(t.textEdit)||b.is(t))&&(ue.undefined(t.additionalTextEdits)||ue.typedArray(t.additionalTextEdits,b.is))}}(d||(d={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(p||(p={})),function(e){e.create=function(e,t,n,r,o){var i={startLine:e,endLine:t};return ue.defined(n)&&(i.startCharacter=n),ue.defined(r)&&(i.endCharacter=r),ue.defined(o)&&(i.kind=o),i},e.is=function(e){var t=e;return ue.uinteger(t.startLine)&&ue.uinteger(t.startLine)&&(ue.undefined(t.startCharacter)||ue.uinteger(t.startCharacter))&&(ue.undefined(t.endCharacter)||ue.uinteger(t.endCharacter))&&(ue.undefined(t.kind)||ue.string(t.kind))}}(h||(h={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return ue.defined(t)&&a.is(t.location)&&ue.string(t.message)}}(f||(f={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(m||(m={})),function(e){e.Unnecessary=1,e.Deprecated=2}(g||(g={})),function(e){e.is=function(e){var t=e;return null!=t&&ue.string(t.href)}}(_||(_={})),function(e){e.create=function(e,t,n,r,o,i){var s={range:e,message:t};return ue.defined(n)&&(s.severity=n),ue.defined(r)&&(s.code=r),ue.defined(o)&&(s.source=o),ue.defined(i)&&(s.relatedInformation=i),s},e.is=function(e){var t,n=e;return ue.defined(n)&&s.is(n.range)&&ue.string(n.message)&&(ue.number(n.severity)||ue.undefined(n.severity))&&(ue.integer(n.code)||ue.string(n.code)||ue.undefined(n.code))&&(ue.undefined(n.codeDescription)||ue.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(ue.string(n.source)||ue.undefined(n.source))&&(ue.undefined(n.relatedInformation)||ue.typedArray(n.relatedInformation,f.is))}}(y||(y={})),function(e){e.create=function(e,t){for(var n=[],r=2;r0&&(o.arguments=n),o},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.title)&&ue.string(t.command)}}(v||(v={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return ue.objectLiteral(t)&&ue.string(t.newText)&&s.is(t.range)}}(b||(b={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return void 0!==t&&ue.objectLiteral(t)&&ue.string(t.label)&&(ue.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(ue.string(t.description)||void 0===t.description)}}(w||(w={})),function(e){e.is=function(e){return"string"==typeof e}}(x||(x={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return b.is(t)&&(w.is(t.annotationId)||x.is(t.annotationId))}}(T||(T={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return ue.defined(t)&&O.is(t.textDocument)&&Array.isArray(t.edits)}}(E||(E={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&ue.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||ue.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ue.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||x.is(t.annotationId))}}(C||(C={})),function(e){e.create=function(e,t,n,r){var o={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(o.options=n),void 0!==r&&(o.annotationId=r),o},e.is=function(e){var t=e;return t&&"rename"===t.kind&&ue.string(t.oldUri)&&ue.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||ue.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ue.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||x.is(t.annotationId))}}(S||(S={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&ue.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||ue.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||ue.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||x.is(t.annotationId))}}(k||(k={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return ue.string(e.kind)?C.is(e)||S.is(e)||k.is(e):E.is(e)})))}}(P||(P={}));var I,R,O,A,N,D,M,$,j,L,F,q,B,H,U,W,z,K,V,G,J,X,Q,Y,Z,ee,te,ne,re,oe,ie=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,o;if(void 0===n?r=b.insert(e,t):x.is(n)?(o=n,r=T.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),r=T.insert(e,t,o)),this.edits.push(r),void 0!==o)return o},e.prototype.replace=function(e,t,n){var r,o;if(void 0===n?r=b.replace(e,t):x.is(n)?(o=n,r=T.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),r=T.replace(e,t,o)),this.edits.push(r),void 0!==o)return o},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=b.del(e):x.is(t)?(r=t,n=T.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=T.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),se=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(x.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id "+n+" is already in use.");if(void 0===t)throw new Error("No annotation provided for id "+n);return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),ae=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new se(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(E.is(e)){var n=new ie(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new ie(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(O.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(n),r=new ie(o,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var o=[];this._workspaceEdit.changes[e]=o,r=new ie(o),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new se,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,o,i;if(w.is(t)||x.is(t)?r=t:n=t,void 0===r?o=C.create(e,n):(i=x.is(r)?r:this._changeAnnotations.manage(r),o=C.create(e,n,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var o,i,s;if(w.is(n)||x.is(n)?o=n:r=n,void 0===o?i=S.create(e,t,r):(s=x.is(o)?o:this._changeAnnotations.manage(o),i=S.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(i),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,o,i;if(w.is(t)||x.is(t)?r=t:n=t,void 0===r?o=k.create(e,n):(i=x.is(r)?r:this._changeAnnotations.manage(r),o=k.create(e,n,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)}}(I||(I={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)&&ue.integer(t.version)}}(R||(R={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)&&(null===t.version||ue.integer(t.version))}}(O||(O={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)&&ue.string(t.languageId)&&ue.integer(t.version)&&ue.string(t.text)}}(A||(A={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(N||(N={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(N||(N={})),function(e){e.is=function(e){var t=e;return ue.objectLiteral(e)&&N.is(t.kind)&&ue.string(t.value)}}(D||(D={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(M||(M={})),function(e){e.PlainText=1,e.Snippet=2}($||($={})),function(e){e.Deprecated=1}(j||(j={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&ue.string(t.newText)&&s.is(t.insert)&&s.is(t.replace)}}(L||(L={})),function(e){e.asIs=1,e.adjustIndentation=2}(F||(F={})),function(e){e.create=function(e){return{label:e}}}(q||(q={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(B||(B={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return ue.string(t)||ue.objectLiteral(t)&&ue.string(t.language)&&ue.string(t.value)}}(H||(H={})),function(e){e.is=function(e){var t=e;return!!t&&ue.objectLiteral(t)&&(D.is(t.contents)||H.is(t.contents)||ue.typedArray(t.contents,H.is))&&(void 0===e.range||s.is(e.range))}}(U||(U={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(W||(W={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;s--){var a=o[s],c=e.offsetAt(a.range.start),l=e.offsetAt(a.range.end);if(!(l<=i))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(l,r.length),i=c}return r}}(ce||(ce={}));var ue,de=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return i.create(0,e);for(;ne?r=o:n=o+1}var s=n-1;return i.create(s,e-t[s])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyFeature=void 0;const r=n(273);t.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>{this.connection.onRequest(r.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))},onIncomingCalls:e=>{const t=r.CallHierarchyIncomingCallsRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=r.CallHierarchyOutgoingCallsRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},2507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationFeature=void 0;const r=n(273),o=n(289);t.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?o.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(r.ConfigurationRequest.type,t).then((t=>Array.isArray(e)?t:t[0]))}}},828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileOperationsFeature=void 0;const r=n(273);t.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){this.connection.onNotification(r.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){this.connection.onNotification(r.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){this.connection.onNotification(r.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(r.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(r.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(r.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}}},2776:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeFeature=void 0;const r=n(273);t.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){this.connection.onRequest(r.LinkedEditingRangeRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))}}},8120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerFeature=void 0;const r=n(273);t.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=r.MonikerRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},2731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attachPartialResult=t.ProgressFeature=t.attachWorkDone=void 0;const r=n(273),o=n(7560);class i{constructor(e,t){this._connection=e,this._token=t,i.Instances.set(this._token,this)}begin(e,t,n,o){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:o};this._connection.sendProgress(r.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};"number"==typeof e?(n.percentage=e,void 0!==t&&(n.message=t)):n.message=e,this._connection.sendProgress(r.WorkDoneProgress.type,this._token,n)}done(){i.Instances.delete(this._token),this._connection.sendProgress(r.WorkDoneProgress.type,this._token,{kind:"end"})}}i.Instances=new Map;class s extends i{constructor(e,t){super(e,t),this._source=new r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class a{constructor(){}begin(){}report(){}done(){}}class c extends a{constructor(){super(),this._source=new r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var l;t.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new a;const n=t.workDoneToken;return delete t.workDoneToken,new i(e,n)},t.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){var t;!0===(null===(t=null==e?void 0:e.window)||void 0===t?void 0:t.workDoneProgress)&&(this._progressSupported=!0,this.connection.onNotification(r.WorkDoneProgressCancelNotification.type,(e=>{let t=i.Instances.get(e.token);(t instanceof s||t instanceof c)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new a:new i(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=o.generateUuid();return this.connection.sendRequest(r.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new s(this.connection,e)))}return Promise.resolve(new c)}},function(e){e.type=new r.ProgressType}(l||(l={}));class u{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(l.type,this._token,e)}}t.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new u(e,n)}},9817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensFeature=void 0;const r=n(273);t.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{on:e=>{const t=r.SemanticTokensRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=r.SemanticTokensDeltaRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=r.SemanticTokensRangeRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}},t.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,o){let i=e,s=t;this._dataLen>0&&(i-=this._prevLine,0===i&&(s-=this._prevChar)),this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return void 0!==this._prevData}buildEdits(){if(void 0!==this._prevData){const e=this._prevData.length,t=this._data.length;let n=0;for(;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=t.TextDocuments=void 0;const r=n(273),o=n(289),i=n(7560),s=n(2731),a=n(2507),c=n(7021),l=n(7985),u=n(9817),d=n(5421),p=n(828),h=n(2776),f=n(8120);function m(e){if(null!==e)return e}t.TextDocuments=class{constructor(e){this._documents=Object.create(null),this._configuration=e,this._onDidChangeContent=new r.Emitter,this._onDidOpen=new r.Emitter,this._onDidClose=new r.Emitter,this._onDidSave=new r.Emitter,this._onWillSave=new r.Emitter}get onDidChangeContent(){return this._onDidChangeContent.event}get onDidOpen(){return this._onDidOpen.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._documents[e]}all(){return Object.keys(this._documents).map((e=>this._documents[e]))}keys(){return Object.keys(this._documents)}listen(e){e.__textDocumentSync=r.TextDocumentSyncKind.Full,e.onDidOpenTextDocument((e=>{let t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._documents[t.uri]=n;let r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)})),e.onDidChangeTextDocument((e=>{let t=e.textDocument,n=e.contentChanges;if(0===n.length)return;let r=this._documents[t.uri];const{version:o}=t;if(null==o)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);r=this._configuration.update(r,n,o),this._documents[t.uri]=r,this._onDidChangeContent.fire(Object.freeze({document:r}))})),e.onDidCloseTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&(delete this._documents[e.textDocument.uri],this._onDidClose.fire(Object.freeze({document:t})))})),e.onWillSaveTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))})),e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._documents[e.textDocument.uri];return n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]})),e.onDidSaveTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&this._onDidSave.fire(Object.freeze({document:t}))}))}},t.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach((t=>{e.window.showErrorMessage(t)}))}};class g{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(r.MessageType.Error,e)}warn(e){this.send(r.MessageType.Warning,e)}info(e){this.send(r.MessageType.Info,e)}log(e){this.send(r.MessageType.Log,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(r.LogMessageNotification.type,{type:e,message:t})}}const _=d.ShowDocumentFeature(s.ProgressFeature(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let n={type:r.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}showWarningMessage(e,...t){let n={type:r.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}showInformationMessage(e,...t){let n={type:r.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}}));(t.BulkRegistration||(t.BulkRegistration={})).create=function(){return new y};class y{constructor(){this._registrations=[],this._registered=new Set}add(e,t){const n=o.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);const r=i.generateUuid();this._registrations.push({id:r,method:n,registerOptions:t||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}}(t.BulkUnregistration||(t.BulkUnregistration={})).create=function(){return new v(void 0,[])};class v{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach((e=>{this._unregistrations.set(e.method,e)}))}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let t={unregisterations:e};this._connection.sendRequest(r.UnregistrationRequest.type,t).then(void 0,(e=>{this._connection.console.info("Bulk unregistration failed.")}))}disposeSingle(e){const t=o.string(e)?e:e.method,n=this._unregistrations.get(t);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(r.UnregistrationRequest.type,i).then((()=>{this._unregistrations.delete(t)}),(e=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)})),!0}}class b{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof y?this.registerMany(e):e instanceof v?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,t,n){const s=o.string(t)?t:t.method,a=i.generateUuid();let c={registrations:[{id:a,method:s,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(r.RegistrationRequest.type,c).then((t=>(e.add({id:a,method:s}),e)),(e=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(e))))}registerSingle2(e,t){const n=o.string(e)?e:e.method,s=i.generateUuid();let a={registrations:[{id:s,method:n,registerOptions:t||{}}]};return this.connection.sendRequest(r.RegistrationRequest.type,a).then((e=>r.Disposable.create((()=>{this.unregisterSingle(s,n)}))),(e=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(e))))}unregisterSingle(e,t){let n={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(r.UnregistrationRequest.type,n).then(void 0,(t=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)}))}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(r.RegistrationRequest.type,t).then((()=>new v(this._connection,t.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const w=p.FileOperationsFeature(c.WorkspaceFoldersFeature(a.ConfigurationFeature(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){let t=(n=e)&&n.edit?e:{edit:e};var n;return this.connection.sendRequest(r.ApplyWorkspaceEditRequest.type,t)}})));class x{constructor(){this._trace=r.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==r.Trace.Off&&this.connection.sendNotification(r.LogTraceNotification.type,{message:e,verbose:this._trace===r.Trace.Verbose?t:void 0})}}class T{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(r.TelemetryEventNotification.type,e)}}class E{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return s.attachWorkDone(this.connection,e)}attachPartialResultProgress(e,t){return s.attachPartialResult(this.connection,t)}}t._LanguagesImpl=E;const C=f.MonikerFeature(h.LinkedEditingRangeFeature(u.SemanticTokensFeature(l.CallHierarchyFeature(E))));function S(e,t){return function(n){return t(e(n))}}function k(e,t){return function(n){return t(e(n))}}function P(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function R(e,t){return function(n){return t(e(n))}}function O(e,t){return function(n){return t(e(n))}}t.combineConsoleFeatures=S,t.combineTelemetryFeatures=k,t.combineTracerFeatures=P,t.combineClientFeatures=I,t.combineWindowFeatures=R,t.combineWorkspaceFeatures=O,t.combineLanguagesFeatures=function(e,t){return function(n){return t(e(n))}},t.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:"features",console:n(e.console,t.console,S),tracer:n(e.tracer,t.tracer,P),telemetry:n(e.telemetry,t.telemetry,k),client:n(e.client,t.client,I),window:n(e.window,t.window,R),workspace:n(e.workspace,t.workspace,O)}},t.createConnection=function(e,t,n){const i=n&&n.console?new(n.console(g)):new g,a=e(i);i.rawAttach(a);const c=n&&n.tracer?new(n.tracer(x)):new x,l=n&&n.telemetry?new(n.telemetry(T)):new T,u=n&&n.client?new(n.client(b)):new b,d=n&&n.window?new(n.window(_)):new _,p=n&&n.workspace?new(n.workspace(w)):new w,h=n&&n.languages?new(n.languages(C)):new C,f=[i,c,l,u,d,p,h];function m(e){return e instanceof Promise?e:o.thenable(e)?new Promise(((t,n)=>{e.then((e=>t(e)),(e=>n(e)))})):Promise.resolve(e)}let y,v,E,S={listen:()=>a.listen(),sendRequest:(e,...t)=>a.sendRequest(o.string(e)?e:e.method,...t),onRequest:(e,t)=>a.onRequest(e,t),sendNotification:(e,t)=>{const n=o.string(e)?e:e.method;1===arguments.length?a.sendNotification(n):a.sendNotification(n,t)},onNotification:(e,t)=>a.onNotification(e,t),onProgress:a.onProgress,sendProgress:a.sendProgress,onInitialize:e=>v=e,onInitialized:e=>a.onNotification(r.InitializedNotification.type,e),onShutdown:e=>y=e,onExit:e=>E=e,get console(){return i},get telemetry(){return l},get tracer(){return c},get client(){return u},get window(){return d},get workspace(){return p},get languages(){return h},onDidChangeConfiguration:e=>a.onNotification(r.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>a.onNotification(r.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>a.onNotification(r.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>a.onNotification(r.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>a.onNotification(r.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>a.onNotification(r.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>a.onRequest(r.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>a.onNotification(r.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>a.sendNotification(r.PublishDiagnosticsNotification.type,e),onHover:e=>a.onRequest(r.HoverRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onCompletion:e=>a.onRequest(r.CompletionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCompletionResolve:e=>a.onRequest(r.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(r.SignatureHelpRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDeclaration:e=>a.onRequest(r.DeclarationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDefinition:e=>a.onRequest(r.DefinitionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onTypeDefinition:e=>a.onRequest(r.TypeDefinitionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onImplementation:e=>a.onRequest(r.ImplementationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onReferences:e=>a.onRequest(r.ReferencesRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentHighlight:e=>a.onRequest(r.DocumentHighlightRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentSymbol:e=>a.onRequest(r.DocumentSymbolRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onWorkspaceSymbol:e=>a.onRequest(r.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeAction:e=>a.onRequest(r.CodeActionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeActionResolve:e=>a.onRequest(r.CodeActionResolveRequest.type,((t,n)=>e(t,n))),onCodeLens:e=>a.onRequest(r.CodeLensRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeLensResolve:e=>a.onRequest(r.CodeLensResolveRequest.type,((t,n)=>e(t,n))),onDocumentFormatting:e=>a.onRequest(r.DocumentFormattingRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(r.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDocumentOnTypeFormatting:e=>a.onRequest(r.DocumentOnTypeFormattingRequest.type,((t,n)=>e(t,n))),onRenameRequest:e=>a.onRequest(r.RenameRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onPrepareRename:e=>a.onRequest(r.PrepareRenameRequest.type,((t,n)=>e(t,n))),onDocumentLinks:e=>a.onRequest(r.DocumentLinkRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentLinkResolve:e=>a.onRequest(r.DocumentLinkResolveRequest.type,((t,n)=>e(t,n))),onDocumentColor:e=>a.onRequest(r.DocumentColorRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onColorPresentation:e=>a.onRequest(r.ColorPresentationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onFoldingRanges:e=>a.onRequest(r.FoldingRangeRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onSelectionRanges:e=>a.onRequest(r.SelectionRangeRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onExecuteCommand:e=>a.onRequest(r.ExecuteCommandRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),dispose:()=>a.dispose()};for(let e of f)e.attach(S);return a.onRequest(r.InitializeRequest.type,(e=>{t.initialize(e),o.string(e.trace)&&(c.trace=r.Trace.fromString(e.trace));for(let t of f)t.initialize(e.capabilities);if(v)return m(v(e,(new r.CancellationTokenSource).token,s.attachWorkDone(a,e),void 0)).then((e=>{if(e instanceof r.ResponseError)return e;let t=e;t||(t={capabilities:{}});let n=t.capabilities;n||(n={},t.capabilities=n),void 0===n.textDocumentSync||null===n.textDocumentSync?n.textDocumentSync=o.number(S.__textDocumentSync)?S.__textDocumentSync:r.TextDocumentSyncKind.None:o.number(n.textDocumentSync)||o.number(n.textDocumentSync.change)||(n.textDocumentSync.change=o.number(S.__textDocumentSync)?S.__textDocumentSync:r.TextDocumentSyncKind.None);for(let e of f)e.fillServerCapabilities(n);return t}));{let e={capabilities:{textDocumentSync:r.TextDocumentSyncKind.None}};for(let t of f)t.fillServerCapabilities(e.capabilities);return e}})),a.onRequest(r.ShutdownRequest.type,(()=>(t.shutdownReceived=!0,y?y((new r.CancellationTokenSource).token):void 0))),a.onNotification(r.ExitNotification.type,(()=>{try{E&&E()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}})),a.onNotification(r.SetTraceNotification.type,(e=>{c.trace=r.Trace.fromString(e.value)})),S}},5421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentFeature=void 0;const r=n(273);t.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(r.ShowDocumentRequest.type,e)}}},289:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return"function"==typeof e}function o(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.thenable=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=r,t.array=o,t.stringArray=function(e){return o(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.thenable=function(e){return e&&r(e.then)}},7560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateUuid=t.parse=t.isUUID=t.v4=t.empty=void 0;class n{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class r extends n{constructor(){super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}}function o(){return new r}r._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],r._timeHighBits=["8","9","a","b"],t.empty=new n("00000000-0000-0000-0000-000000000000"),t.v4=o;const i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function s(e){return i.test(e)}t.isUUID=s,t.parse=function(e){if(!s(e))throw new Error("invalid uuid");return new n(e)},t.generateUuid=function(){return o().asHex()}},7021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFoldersFeature=void 0;const r=n(273);t.WorkspaceFoldersFeature=e=>class extends e{initialize(e){let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new r.Emitter,this.connection.onNotification(r.DidChangeWorkspaceFoldersNotification.type,(e=>{this._onDidChangeWorkspaceFolders.fire(e.event)})))}getWorkspaceFolders(){return this.connection.sendRequest(r.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._unregistration||(this._unregistration=this.connection.client.register(r.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}}},7613:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveModulePath=t.FileSystem=t.resolveGlobalYarnPath=t.resolveGlobalNodePath=t.resolve=t.uriToFilePath=void 0;const r=n(7310),o=n(1017),i=n(7147),s=n(2081);function a(){return"win32"===process.platform}function c(e,t,n,r){const a=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise(((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach((e=>d[e]=u[e])),t&&i.existsSync(t)&&(d.NODE_PATH?d.NODE_PATH=t+o.delimiter+d.NODE_PATH:d.NODE_PATH=t,r&&r(`NODE_PATH value is: ${d.NODE_PATH}`)),d.ELECTRON_RUN_AS_NODE="1";try{let t=s.fork("",[],{cwd:n,env:d,execArgv:["-e",a]});if(void 0===t.pid)return void l(new Error(`Starting process to resolve node module ${e} failed`));t.on("error",(e=>{l(e)})),t.on("message",(n=>{"r"===n.c&&(t.send({c:"e"}),n.s?c(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let r={c:"rs",a:e};t.send(r)}catch(e){l(e)}}))}function l(e){let t="npm";const n=Object.create(null);Object.keys(process.env).forEach((e=>n[e]=process.env[e])),n.NO_UPDATE_NOTIFIER="true";const r={encoding:"utf8",env:n};a()&&(t="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let n=s.spawnSync(t,["config","get","prefix"],r).stdout;if(!n)return void(e&&e("'npm config get prefix' didn't return a value."));let c=n.trim();return e&&e(`'npm config get prefix' value is: ${c}`),c.length>0?a()?o.join(c,"node_modules"):o.join(c,"lib","node_modules"):void 0}catch(e){return}finally{process.removeListener("SIGPIPE",i)}}var u;t.uriToFilePath=function(e){let t=r.parse(e);if("file:"!==t.protocol||!t.path)return;let n=t.path.split("/");for(var i=0,s=n.length;i1){let e=n[0],t=n[1];0===e.length&&t.length>1&&":"===t[1]&&n.shift()}return o.normalize(n.join("/"))},t.resolve=c,t.resolveGlobalNodePath=l,t.resolveGlobalYarnPath=function(e){let t="yarn",n={encoding:"utf8"};a()&&(t="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=s.spawnSync(t,["global","dir","--json"],n),a=i.stdout;if(!a)return void(e&&(e("'yarn global dir' didn't return a value."),i.stderr&&e(i.stderr)));let c=a.trim().split(/\r?\n/);for(let e of c)try{let t=JSON.parse(e);if("log"===t.type)return o.join(t.data,"node_modules")}catch(e){}return}catch(e){return}finally{process.removeListener("SIGPIPE",r)}},function(e){let t;function n(){return void 0!==t||(t=!("win32"===process.platform||i.existsSync(__filename.toUpperCase())&&i.existsSync(__filename.toLowerCase()))),t}e.isCaseSensitive=n,e.isParent=function(e,t){return n()?0===o.normalize(t).indexOf(o.normalize(e)):0===o.normalize(t).toLowerCase().indexOf(o.normalize(e).toLowerCase())}}(u=t.FileSystem||(t.FileSystem={})),t.resolveModulePath=function(e,t,n,r){return n?(o.isAbsolute(n)||(n=o.join(e,n)),c(t,n,n,r).then((e=>u.isParent(n,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>c(t,l(r),e,r)))):c(t,l(r),e,r)}},5809:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const i=n(289),s=n(9891),a=n(7613),c=n(6560);var l;o(n(6560),t),o(n(6265),t),(l=t.Files||(t.Files={})).uriToFilePath=a.uriToFilePath,l.resolveGlobalNodePath=a.resolveGlobalNodePath,l.resolveGlobalYarnPath=a.resolveGlobalYarnPath,l.resolve=a.resolve,l.resolveModulePath=a.resolveModulePath;let u,d=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(u=setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(d?0:1)}}),3e3))}catch(e){}}for(let n=2;n{const t=e.processId;i.number(t)&&void 0===u&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(d?0:1)}}),3e3)},get shutdownReceived(){return d},set shutdownReceived(e){d=e},exit:e=>{process.exit(e)}};t.createConnection=function(e,t,n,r){let o,a,l,u;return void 0!==e&&"features"===e.__brand&&(o=e,e=t,t=n,n=r),c.ConnectionStrategy.is(e)||c.ConnectionOptions.is(e)?u=e:(a=e,l=t,u=n),function(e,t,n,r){if(!e&&!t&&process.argv.length>2){let n,r,i=process.argv.slice(2);for(let s=0;s{process.exit(d?0:1)})),t.on("close",(()=>{process.exit(d?0:1)}))}return s.createConnection((r=>c.createProtocolConnection(e,t,r,n)),p,r)}(a,l,u,o)}},7089:(e,t,n)=>{"use strict";e.exports=n(5809)},4086:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TextDocument:()=>o});class r{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(let t of e)if(r.isIncremental(t)){const e=a(t.range),n=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,n)+t.text+this._content.substring(r,this._content.length);const o=Math.max(e.start.line,0),i=Math.max(e.end.line,0);let c=this._lineOffsets;const l=s(t.text,!1,n);if(i-o===l.length)for(let e=0,t=l.length;ee?r=o:n=o+1}let o=n-1;return{line:o,character:e-t[o]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function c(e){const t=a(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,o){return new r(e,t,n,o)},e.update=function(e,t,n){if(e instanceof r)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){let n=e.getText(),r=i(t.map(c),((e,t)=>{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=0;const s=[];for(const t of r){let r=e.offsetAt(t.range.start);if(ro&&s.push(n.substring(o,r)),t.newText.length&&s.push(t.newText),o=e.offsetAt(t.range.end)}return s.push(n.substr(o)),s.join("")}}(o||(o={}))},9941:e=>{const t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,n="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new i}abort(){this.signal.dispatchEvent("abort")}},r="function"==typeof AbortSignal,o="function"==typeof n.AbortSignal,i=r?AbortSignal:o?n.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if("abort"===e){this.aborted=!0;const t={type:e,target:this};this.onabort(t),this._listeners.forEach((e=>e(t)),this)}}onabort(){}addEventListener(e,t){"abort"===e&&this._listeners.push(t)}removeEventListener(e,t){"abort"===e&&(this._listeners=this._listeners.filter((e=>e!==t)))}},s=new Set,a=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;u(n)&&d(n,`${e} option`,`options.${t}`,g)},c=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(u(n)){const{prototype:r}=g,{get:o}=Object.getOwnPropertyDescriptor(r,e);d(n,`${e} method`,`cache.${t}()`,o)}},l=(...e)=>{"object"==typeof process&&process&&"function"==typeof process.emitWarning?process.emitWarning(...e):console.error(...e)},u=e=>!s.has(e),d=(e,t,n,r)=>{s.add(e),l(`The ${t} is deprecated. Please use ${n} instead.`,"DeprecationWarning",e,r)},p=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),h=e=>p(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?f:null:null;class f extends Array{constructor(e){super(e),this.fill(0)}}class m{constructor(e){if(0===e)return[];const t=h(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class g{constructor(e={}){const{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:i,updateAgeOnHas:c,allowStale:d,dispose:f,disposeAfter:_,noDisposeOnSet:y,noUpdateTTL:v,maxSize:b=0,sizeCalculation:w,fetchMethod:x,fetchContext:T,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:C}=e,{length:S,maxAge:k,stale:P}=e instanceof g?{}:e;if(0!==t&&!p(t))throw new TypeError("max option must be a nonnegative integer");const I=t?h(t):Array;if(!I)throw new Error("invalid max value: "+t);if(this.max=t,this.maxSize=b,this.sizeCalculation=w||S,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=x||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=T,!this.fetchMethod&&void 0!==T)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(t).fill(null),this.valList=new Array(t).fill(null),this.next=new I(t),this.prev=new I(t),this.head=0,this.tail=0,this.free=new m(t),this.initialFill=1,this.size=0,"function"==typeof f&&(this.dispose=f),"function"==typeof _?(this.disposeAfter=_,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!E,0!==this.maxSize){if(!p(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!d||!!P,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!c,this.ttlResolution=p(r)||0===r?r:1,this.ttlAutopurge=!!o,this.ttl=n||k||0,this.ttl){if(!p(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const e="LRU_CACHE_UNBOUNDED";u(e)&&(s.add(e),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,g))}P&&a("stale","allowStale"),k&&a("maxAge","ttl"),S&&a("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new f(this.max),this.starts=new f(this.max),this.setItemTTL=(e,n,r=t.now())=>{if(this.starts[e]=0!==n?r:0,this.ttls[e]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.isStale(e)&&this.delete(this.keyList[e])}),n+1);t.unref&&t.unref()}},this.updateItemAge=e=>{this.starts[e]=0!==this.ttls[e]?t.now():0};let e=0;const n=()=>{const n=t.now();if(this.ttlResolution>0){e=n;const t=setTimeout((()=>e=0),this.ttlResolution);t.unref&&t.unref()}return n};this.getRemainingTTL=t=>{const r=this.keyMap.get(t);return void 0===r?0:0===this.ttls[r]||0===this.starts[r]?1/0:this.starts[r]+this.ttls[r]-(e||n())},this.isStale=t=>0!==this.ttls[t]&&0!==this.starts[t]&&(e||n())-this.starts[t]>this.ttls[t]}updateItemAge(e){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new f(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(!p(n)){if(!r)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!p(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.addItemSize=(e,t)=>{this.sizes[e]=t;const n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.head);)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.tail);)t=this.next[t]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(const e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(const e of this.indexes())yield this.keyList[e]}*rkeys(){for(const e of this.rindexes())yield this.keyList[e]}*values(){for(const e of this.indexes())yield this.valList[e]}*rvalues(){for(const e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],t)}forEach(e,t=this){for(const n of this.indexes())e.call(t,this.valList[n],this.keyList[n],this)}rforEach(e,t=this){for(const n of this.rindexes())e.call(t,this.valList[n],this.keyList[n],this)}get prune(){return c("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){const e=[];for(const n of this.indexes({allowStale:!0})){const r=this.keyList[n],o=this.valList[n],i={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){i.ttl=this.ttls[n];const e=t.now()-this.starts[n];i.start=Math.floor(Date.now()-e)}this.sizes&&(i.size=this.sizes[n]),e.unshift([r,i])}return e}load(e){this.clear();for(const[n,r]of e){if(r.start){const e=Date.now()-r.start;r.start=t.now()-e}this.set(n,r.value,r)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,size:i=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){if(i=this.requireSize(e,t,i,s),this.maxSize&&i>this.maxSize)return this;let c=0===this.size?void 0:this.keyMap.get(e);if(void 0===c)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=t,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,i),a=!1;else{const n=this.valList[c];t!==n&&(this.isBackgroundFetch(n)?n.__abortController.abort():o||(this.dispose(n,e,"set"),this.disposeAfter&&this.disposed.push([n,e,"set"])),this.removeItemSize(c),this.valList[c]=t,this.addItemSize(c,i)),this.moveToTail(c)}if(0===n||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(c,n,r),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort():(this.dispose(r,n,"evict"),this.disposeAfter&&this.disposed.push([r,n,"evict"])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas}={}){const n=this.keyMap.get(e);return void 0!==n&&!this.isStale(n)&&(t&&this.updateItemAge(n),!0)}peek(e,{allowStale:t=this.allowStale}={}){const n=this.keyMap.get(e);if(void 0!==n&&(t||!this.isStale(n))){const e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,r,o){const i=void 0===t?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;const s=new n,a={signal:s.signal,options:r,context:o},c=new Promise((t=>t(this.fetchMethod(e,i,a)))).then((t=>(s.signal.aborted||this.set(e,t,a.options),t)),(n=>{if(this.valList[t]===c&&(r.noDeleteOnFetchRejection&&void 0!==c.__staleWhileFetching?this.valList[t]=c.__staleWhileFetching:this.delete(e)),c.__returned===c)throw n}));return c.__abortController=s,c.__staleWhileFetching=i,c.__returned=null,void 0===t?(this.set(e,c,a.options),t=this.keyMap.get(e)):this.valList[t]=c,c}isBackgroundFetch(e){return e&&"object"==typeof e&&"function"==typeof e.then&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||null===e.__returned)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,fetchContext:u=this.fetchContext,forceRefresh:d=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r});const p={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:i,size:s,sizeCalculation:a,noUpdateTTL:c,noDeleteOnFetchRejection:l};let h=this.keyMap.get(e);if(void 0===h){const t=this.backgroundFetch(e,h,p,u);return t.__returned=t}{const r=this.valList[h];if(this.isBackgroundFetch(r))return t&&void 0!==r.__staleWhileFetching?r.__staleWhileFetching:r.__returned=r;if(!d&&!this.isStale(h))return this.moveToTail(h),n&&this.updateItemAge(h),r;const o=this.backgroundFetch(e,h,p,u);return t&&void 0!==o.__staleWhileFetching?o.__staleWhileFetching:o.__returned=o}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet}={}){const o=this.keyMap.get(e);if(void 0!==o){const i=this.valList[o],s=this.isBackgroundFetch(i);if(this.isStale(o))return s?t?i.__staleWhileFetching:void 0:(r||this.delete(e),t?i:void 0);if(s)return;return this.moveToTail(o),n&&this.updateItemAge(o),i}}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return c("del","delete"),this.delete}delete(e){let t=!1;if(0!==this.size){const n=this.keyMap.get(e);if(void 0!==n)if(t=!0,1===this.size)this.clear();else{this.removeItemSize(n);const t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort():(this.dispose(t,e,"delete"),this.disposeAfter&&this.disposed.push([t,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(const e of this.rindexes({allowStale:!0})){const t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort();else{const n=this.keyList[e];this.dispose(t,n,"delete"),this.disposeAfter&&this.disposed.push([t,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return c("reset","clear"),this.clear}get length(){return((e,t)=>{const n="LRU_CACHE_PROPERTY_length";if(u(n)){const{prototype:t}=g,{get:r}=Object.getOwnPropertyDescriptor(t,e);d(n,"length property","cache.size",r)}})("length"),this.size}static get AbortController(){return n}static get AbortSignal(){return i}}e.exports=g},6029:(e,t,n)=>{"use strict";const{randomBytes:r}=n(6113),{Readable:o}=n(2781),i=e=>"object"==typeof e&&0===["arrayBuffer","stream","text","slice","constructor"].map((t=>typeof e[t])).filter((e=>"function"!==e)).length&&"string"==typeof e.type&&"number"==typeof e.size&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),s=e=>`--${e}--\r\n\r\n`,a=(e,t,n)=>{let r="";return r+=`--${e}\r\n`,r+=`Content-Disposition: form-data; name="${t}"`,i(n)&&(r+=`; filename="${n.name}"\r\n`,r+=`Content-Type: ${n.type||"application/octet-stream"}`),`${r}\r\n\r\n`};e.exports={isFormData:e=>null!=e&&"object"==typeof e&&0===["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map((t=>typeof e[t])).filter((e=>"function"!==e)).length&&"FormData"===e[Symbol.toStringTag],FormDataSerializer:class{constructor(e){this.fd=e,this.boundary=r(8).toString("hex")}length(){return void 0===this._length&&(this._length=((e,t)=>{let n=0;for(const[r,o]of e)n+=Buffer.byteLength(a(t,r,o)),n+=i(o)?o.size:Buffer.byteLength(String(o)),n+=Buffer.byteLength("\r\n");return n+=Buffer.byteLength(s(t)),n})(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return o.from(async function*(e,t){for(const[n,r]of e)yield a(t,n,r),i(r)?yield*r.stream():yield r,yield"\r\n";yield s(t)}(this.fd,this.boundary))}}}},5591:(e,t,n)=>{"use strict";const{constants:{MAX_LENGTH:r}}=n(4300),{pipeline:o,PassThrough:i}=n(2781),{promisify:s}=n(3837),{createGunzip:a,createInflate:c,createBrotliDecompress:l,constants:{Z_SYNC_FLUSH:u}}=n(9796),d=n(1241)("helix-fetch:utils"),p=s(o),h=(e,t)=>{if(Buffer.isBuffer(e))return e.length;switch(typeof e){case"string":return 2*e.length;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(e)?2*Symbol.keyFor(e).length:2*(e.toString().length-8);case"object":return Array.isArray(e)?f(e,t):m(e,t);default:return 0}},f=(e,t)=>(t.add(e),e.map((e=>t.has(e)?0:h(e,t))).reduce(((e,t)=>e+t),0)),m=(e,t)=>{if(null==e)return 0;t.add(e);let n=0;const r=[];for(const t in e)r.push(t);return r.push(...Object.getOwnPropertySymbols(e)),r.forEach((r=>{if(n+=h(r,t),"object"==typeof e[r]&&null!==e[r]){if(t.has(e[r]))return;t.add(e[r])}n+=h(e[r],t)})),n};e.exports={decodeStream:(e,t,n,r)=>{if(!((e,t)=>204!==e&&304!==e&&0!=+t["content-length"]&&/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(t["content-encoding"]))(e,t))return n;const i=e=>{e&&(d(`encountered error while decoding stream: ${e}`),r(e))};switch(t["content-encoding"].trim()){case"gzip":case"x-gzip":return o(n,a({flush:u,finishFlush:u}),i);case"deflate":case"x-deflate":return o(n,c(),i);case"br":return o(n,l(),i);default:return n}},isPlainObject:e=>{if(!e||"object"!=typeof e)return!1;if("[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},sizeof:e=>h(e,new WeakSet),streamToBuffer:async e=>{const t=new i;let n=0;const o=[];return t.on("data",(e=>{if(n+e.length>r)throw new Error("Buffer.constants.MAX_SIZE exceeded");o.push(e),n+=e.length})),await p(e,t),Buffer.concat(o,n)}}},5899:e=>{"use strict";class t extends Error{get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={RequestAbortedError:t}},4751:(e,t,n)=>{"use strict";const r=n(3685),o=n(5687),{Readable:i}=n(2781),s=n(1241)("helix-fetch:h1"),{RequestAbortedError:a}=n(5899),{decodeStream:c}=n(5591);e.exports={request:async(e,t,n)=>{const{request:l}="https:"===t.protocol?o:r,u=((e,t)=>{const{h1:n,options:{h1:i,rejectUnauthorized:s}}=e;return"https:"===t?n.httpsAgent?n.httpsAgent:i||"boolean"==typeof s?(n.httpsAgent=new o.Agent("boolean"==typeof s?{...i||{},rejectUnauthorized:s}:i),n.httpsAgent):void 0:n.httpAgent?n.httpAgent:i?(n.httpAgent=new r.Agent(i),n.httpAgent):void 0})(e,t.protocol),d={...n,agent:u},{socket:p,body:h}=d;return p&&(delete d.socket,p.assigned||(p.assigned=!0,u?d.agent=new Proxy(u,{get:(e,t)=>"createConnection"!==t||p.inUse?e[t]:(e,t)=>{s(`agent reusing socket #${p.id} (${p.servername})`),p.inUse=!0,t(null,p)}}):d.createConnection=(e,t)=>{s(`reusing socket #${p.id} (${p.servername})`),p.inUse=!0,t(null,p)})),new Promise(((e,n)=>{let r;s(`${d.method} ${t.href}`);const{signal:o}=d,u=()=>{o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),n(new a),r&&r.abort()};if(o){if(o.aborted)return void n(new a);o.addEventListener("abort",u)}r=l(t,d),r.once("response",(t=>{o&&o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),e(((e,t,n)=>{const{statusCode:r,statusMessage:o,httpVersion:i,httpVersionMajor:s,httpVersionMinor:a,headers:l}=e,u=t?c(r,l,e,n):e;return{statusCode:r,statusText:o,httpVersion:i,httpVersionMajor:s,httpVersionMinor:a,headers:l,readable:u,decoded:!(!t||u===e)}})(t,d.decode,n))})),r.once("error",(e=>{o&&o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),r.aborted||(s(`${d.method} ${t.href} failed with: ${e.message}`),r.abort(),n(e))})),h instanceof i?h.pipe(r):(h&&r.write(h),r.end())}))},setupContext:e=>{e.h1={}},resetContext:async({h1:e})=>{e.httpAgent&&(s("resetContext: destroying httpAgent"),e.httpAgent.destroy(),delete e.httpAgent),e.httpsAgent&&(s("resetContext: destroying httpsAgent"),e.httpsAgent.destroy(),delete e.httpsAgent)}}},7652:(e,t,n)=>{"use strict";const{connect:r,constants:o}=n(5158),{Readable:i}=n(2781),s=n(1241)("helix-fetch:h2"),{RequestAbortedError:a}=n(5899),{decodeStream:c}=n(5591),{NGHTTP2_CANCEL:l}=o,u=3e5,d=5e3,p=(e,t,n,r=(()=>{}))=>{const o={...e},i=o[":status"];delete o[":status"];const s=n?c(i,e,t,r):t;return{statusCode:i,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:s,decoded:!(!n||s===t)}};e.exports={request:async(e,t,n)=>{const{origin:o,pathname:c,search:h,hash:f}=t,m=`${c}${h}${f}`,{options:{h2:g={}},h2:{sessionCache:_}}=e,{idleSessionTimeout:y=u,pushPromiseHandler:v,pushHandler:b}=g,w={...n},{method:x,headers:T,socket:E,body:C,decode:S}=w;return E&&delete w.socket,T.host&&(T[":authority"]=T.host,delete T.host),new Promise(((n,c)=>{let u,h=_[o];if(!h||h.closed||h.destroyed){const t=!(!1===e.options.rejectUnauthorized||!1===g.rejectUnauthorized),n={...g,rejectUnauthorized:t};E&&!E.inUse&&(n.createConnection=()=>(s(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E));const i=!(!v&&!b);h=r(o,{...n,settings:{enablePush:i}}),h.setMaxListeners(1e3),h.setTimeout(y,(()=>{s(`closing session ${o} after ${y} ms of inactivity`),h.close()})),h.once("connect",(()=>{s(`session ${o} established`),s(`caching session ${o}`),_[o]=h})),h.on("localSettings",(e=>{s(`session ${o} localSettings: ${JSON.stringify(e)}`)})),h.on("remoteSettings",(e=>{s(`session ${o} remoteSettings: ${JSON.stringify(e)}`)})),h.once("close",(()=>{s(`session ${o} closed`),_[o]===h&&(s(`discarding cached session ${o}`),delete _[o])})),h.once("error",(e=>{s(`session ${o} encountered error: ${e}`),_[o]===h&&(s(`discarding cached session ${o}`),delete _[o])})),h.on("frameError",((e,t,n)=>{s(`session ${o} encountered frameError: type: ${e}, code: ${t}, id: ${n}`)})),h.once("goaway",((e,t,n)=>{s(`session ${o} received GOAWAY frame: errorCode: ${e}, lastStreamID: ${t}, opaqueData: ${n?n.toString():void 0}`)})),h.on("stream",((t,n,r)=>{((e,t,n,r,o,i)=>{const{options:{h2:{pushPromiseHandler:a,pushHandler:c,pushedStreamIdleTimeout:u=d}}}=e,h=o[":path"],f=`${t}${h}`;s(`received PUSH_PROMISE: ${f}, stream #${r.id}, headers: ${JSON.stringify(o)}, flags: ${i}`),a&&a(f,o,(()=>{r.close(l)})),r.on("push",((e,i)=>{s(`received push headers for ${t}${h}, stream #${r.id}, headers: ${JSON.stringify(e)}, flags: ${i}`),r.setTimeout(u,(()=>{s(`closing pushed stream #${r.id} after ${u} ms of inactivity`),r.close(l)})),c&&c(f,o,p(e,r,n))})),r.on("aborted",(()=>{s(`pushed stream #${r.id} aborted`)})),r.on("error",(e=>{s(`pushed stream #${r.id} encountered error: ${e}`)})),r.on("frameError",((e,t,n)=>{s(`pushed stream #${r.id} encountered frameError: type: ${e}, code: ${t}, id: ${n}`)}))})(e,o,S,t,n,r)}))}else E&&E.id!==h.socket.id&&!E.inUse&&(s(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());s(`${x} ${t.host}${m}`);const{signal:f}=w,k=()=>{f.removeEventListener("abort",k),c(new a),u&&u.close(l)};if(f){if(f.aborted)return void c(new a);f.addEventListener("abort",k)}const P=e=>{s(`session ${o} encountered error during ${w.method} ${t.href}: ${e}`),c(e)};h.once("error",P),u=h.request({":method":x,":path":m,...T}),u.once("response",(e=>{h.off("error",P),f&&f.removeEventListener("abort",k),n(p(e,u,w.decode,c))})),u.once("error",(e=>{h.off("error",P),f&&f.removeEventListener("abort",k),u.rstCode!==l&&(s(`${w.method} ${t.href} failed with: ${e.message}`),u.close(l),c(e))})),u.once("frameError",((e,n,r)=>{h.off("error",P),s(`encountered frameError during ${w.method} ${t.href}: type: ${e}, code: ${n}, id: ${r}`)})),u.on("push",((e,t)=>{s(`received 'push' event: headers: ${JSON.stringify(e)}, flags: ${t}`)})),C instanceof i?C.pipe(u):(C&&u.write(C),u.end())}))},setupContext:e=>{e.h2={sessionCache:{}}},resetContext:async({h2:e})=>Promise.all(Object.values(e.sessionCache).map((e=>new Promise((t=>{e.on("close",t),s(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()})))))}},4673:(e,t,n)=>{"use strict";const r=n(1241)("helix-fetch:core"),{request:o,setupContext:i,resetContext:s,RequestAbortedError:a,ALPN_HTTP2:c,ALPN_HTTP2C:l,ALPN_HTTP1_1:u,ALPN_HTTP1_0:d}=n(6633);class p{constructor(e){this.options={...e||{}},i(this)}api(){return{request:async(e,t)=>this.request(e,t),context:(e={})=>new p(e).api(),reset:async()=>this.reset(),RequestAbortedError:a,ALPN_HTTP2:c,ALPN_HTTP2C:l,ALPN_HTTP1_1:u,ALPN_HTTP1_0:d}}async request(e,t){return o(this,e,t)}async reset(){return r("resetting context"),s(this)}}e.exports=(new p).api()},3430:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361);e.exports=()=>{const e={},t=new r;return t.setMaxListeners(0),{acquire:n=>new Promise((r=>{if(!e[n])return e[n]=!0,void r();const o=i=>{e[n]||(e[n]=!0,t.removeListener(n,o),r(i))};t.on(n,o)})),release:(n,r)=>{Reflect.deleteProperty(e,n),setImmediate((()=>t.emit(n,r)))}}}},6633:(e,t,n)=>{"use strict";const{Readable:r}=n(2781),o=n(4404),{types:{isAnyArrayBuffer:i}}=n(3837),s=n(9941),a=n(1241)("helix-fetch:core"),{RequestAbortedError:c}=n(5899),l=n(4751),u=n(7652),d=n(3430),{isPlainObject:p}=n(5591),{isFormData:h,FormDataSerializer:f}=n(6029),{version:m}=n(3180),g="h2",_="h2c",y="http/1.0",v="http/1.1",b=100,w=36e5,x=[g,v,y],T=`helix-fetch/${m}`,E={method:"GET",compress:!0,decode:!0};let C=0;const S=d(),k=(e,t)=>new Promise(((n,r)=>{const{signal:i}=t;let s;const l=()=>{i.removeEventListener("abort",l);const e=new c;r(e),s&&s.destroy(e)};if(i){if(i.aborted)return void r(new c);i.addEventListener("abort",l)}const u=+e.port||443,d=t=>{i&&i.removeEventListener("abort",l),t instanceof c||(a(`connecting to ${e.hostname}:${u} failed with: ${t.message}`),r(t))};s=o.connect(u,e.hostname,t),s.once("secureConnect",(()=>{i&&i.removeEventListener("abort",l),s.off("error",d),C+=1,s.id=C,s.secureConnecting=!1,a(`established TLS connection: #${s.id} (${s.servername})`),n(s)})),s.once("error",d)}));e.exports={request:async(e,t,n)=>{const o=new URL(t),s={...E,...n||{}};let c;if("string"==typeof s.method&&(s.method=s.method.toUpperCase()),s.headers=(e=>{const t={};return Object.keys(e).forEach((n=>{t[n.toLowerCase()]=e[n]})),t})(s.headers||{}),void 0===s.headers.host&&(s.headers.host=o.host),e.userAgent&&void 0===s.headers["user-agent"]&&(s.headers["user-agent"]=e.userAgent),s.body instanceof URLSearchParams)c="application/x-www-form-urlencoded; charset=utf-8",s.body=s.body.toString();else if(h(s.body)){const e=new f(s.body);c=e.contentType(),s.body=e.stream(),void 0===s.headers["transfer-encoding"]&&void 0===s.headers["content-length"]&&(s.headers["content-length"]=String(e.length()))}else"string"==typeof s.body||s.body instanceof String?c="text/plain; charset=utf-8":p(s.body)?(s.body=JSON.stringify(s.body),c="application/json"):i(s.body)&&(s.body=Buffer.from(s.body));void 0===s.headers["content-type"]&&void 0!==c&&(s.headers["content-type"]=c),null!=s.body&&(s.body instanceof r||("string"==typeof s.body||s.body instanceof String||Buffer.isBuffer(s.body)||(s.body=String(s.body)),void 0===s.headers["transfer-encoding"]&&void 0===s.headers["content-length"]&&(s.headers["content-length"]=String(Buffer.isBuffer(s.body)?s.body.length:Buffer.byteLength(s.body,"utf-8"))))),void 0===s.headers.accept&&(s.headers.accept="*/*"),null==s.body&&["POST","PUT"].includes(s.method)&&(s.headers["content-length"]="0"),s.compress&&void 0===s.headers["accept-encoding"]&&(s.headers["accept-encoding"]="gzip,deflate,br");const{signal:d}=s,{protocol:m,socket:b=null}=e.socketFactory?await(async(e,t,n,r)=>{const o="https:"===t.protocol;let i;i=t.port?t.port:o?443:80;const s={...n,host:t.host,port:i},a=await e(s);if(o){const e={...s,ALPNProtocols:r};e.socket=a;const n=await k(t,e);return{protocol:n.alpnProtocol||v,socket:n}}return{protocol:a.alpnProtocol||v,socket:a}})(e.socketFactory,o,s,e.alpnProtocols):await(async(e,t,n)=>{const r=`${t.protocol}//${t.host}`;let o=e.alpnCache.get(r);if(o)return{protocol:o};switch(t.protocol){case"http:":return o=v,e.alpnCache.set(r,o),{protocol:o};case"http2:":return o=_,e.alpnCache.set(r,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${t.protocol}`)}const{options:{rejectUnauthorized:i,h1:s={},h2:a={}}}=e,c=!(!1===i||!1===s.rejectUnauthorized||!1===a.rejectUnauthorized),l={servername:t.hostname,ALPNProtocols:e.alpnProtocols,signal:n,rejectUnauthorized:c},u=await(async(e,t)=>{let n=await S.acquire(e.origin);try{return n||(n=await k(e,t)),n}finally{S.release(e.origin,n)}})(t,l);return o=u.alpnProtocol,o||(o=v),e.alpnCache.set(r,o),{protocol:o,socket:u}})(e,o,d);switch(a(`${o.host} -> ${m}`),m){case g:try{return await u.request(e,o,b?{...s,socket:b}:s)}catch(t){const{code:n,message:r}=t;throw"ERR_HTTP2_ERROR"===n&&"Protocol error"===r&&e.alpnCache.delete(`${o.protocol}//${o.host}`),t}case _:return u.request(e,new URL(`http://${o.host}${o.pathname}${o.hash}${o.search}`),b?{...s,socket:b}:s);case y:case v:return l.request(e,o,b?{...s,socket:b}:s);default:throw new TypeError(`unsupported protocol: ${m}`)}},setupContext:e=>{const{options:{alpnProtocols:t=x,alpnCacheTTL:n=w,alpnCacheSize:r=b,userAgent:o=T,socketFactory:i}}=e;e.alpnProtocols=t,e.alpnCache=new s({max:r,ttl:n}),e.userAgent=o,e.socketFactory=i,l.setupContext(e),u.setupContext(e)},resetContext:async e=>(e.alpnCache.clear(),Promise.all([l.resetContext(e),u.resetContext(e)])),RequestAbortedError:c,ALPN_HTTP2:g,ALPN_HTTP2C:_,ALPN_HTTP1_1:v,ALPN_HTTP1_0:y}},4346:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361),o=Symbol("AbortSignal internals");class i{constructor(){this[o]={eventEmitter:new r,onabort:null,aborted:!1}}get aborted(){return this[o].aborted}get onabort(){return this[o].onabort}set onabort(e){this[o].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,t){this[o].eventEmitter.removeListener(e,t)}addEventListener(e,t){this[o].eventEmitter.on(e,t)}dispatchEvent(e){const t={type:e,target:this},n=`on${e}`;"function"==typeof this[o][n]&&this[n](t),this[o].eventEmitter.emit(e,t)}fire(){this[o].aborted=!0,this.dispatchEvent("abort")}}Object.defineProperties(i.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});class s extends i{constructor(e){if(!Number.isInteger(e))throw new TypeError("Expected an integer, got "+typeof e);super(),this[o].timerId=setTimeout((()=>{this.fire()}),e)}clear(){clearTimeout(this[o].timerId)}}Object.defineProperties(s.prototype,{clear:{enumerable:!0}});const a=Symbol("AbortController internals");class c{constructor(){this[a]={signal:new i}}get signal(){return this[a].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[a].signal.aborted||this[a].signal.fire()}}Object.defineProperties(c.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),e.exports={AbortController:c,AbortSignal:i,TimeoutSignal:s}},4214:(e,t,n)=>{"use strict";const{PassThrough:r,Readable:o}=n(2781),{types:{isAnyArrayBuffer:i}}=n(3837),{FetchError:s,FetchBaseError:a}=n(2501),{streamToBuffer:c}=n(5591),l=Buffer.alloc(0),u=Symbol("Body internals"),d=async e=>{if(e[u].disturbed)throw new TypeError("Already read");if(e[u].error)throw new TypeError(`Stream had error: ${e[u].error.message}`);e[u].disturbed=!0;const{stream:t}=e[u];return null===t?l:c(t)};class p{constructor(e){let t;t=null==e?null:e instanceof URLSearchParams?o.from(e.toString()):e instanceof o?e:Buffer.isBuffer(e)?o.from(e):i(e)?o.from(Buffer.from(e)):"string"==typeof e||e instanceof String?o.from(e):o.from(String(e)),this[u]={stream:t,disturbed:!1,error:null},e instanceof o&&t.on("error",(e=>{const t=e instanceof a?e:new s(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,"system",e);this[u].error=t}))}get body(){return this[u].stream}get bodyUsed(){return this[u].disturbed}async buffer(){return d(this)}async arrayBuffer(){return(e=await this.buffer()).buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);var e}async text(){return(await d(this)).toString()}async json(){return JSON.parse(await this.text())}}Object.defineProperties(p.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),e.exports={Body:p,cloneStream:e=>{if(e[u].disturbed)throw new TypeError("Cannot clone: already read");const{stream:t}=e[u];let n=t;if(t instanceof o){n=new r;const o=new r;t.pipe(n),t.pipe(o),e[u].stream=o}return n},guessContentType:e=>null===e?null:"string"==typeof e?"text/plain; charset=utf-8":e instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(e)||i(e)||e instanceof o?null:"text/plain; charset=utf-8"}},8941:(e,t,n)=>{"use strict";const{Readable:r}=n(2781),{Headers:o}=n(8226),{Response:i}=n(8327),s=Symbol("CacheableResponse internals");class a extends i{constructor(e,t){super(e,t);const n=new o(t.headers);this[s]={headers:n,bufferedBody:e}}get headers(){return this[s].headers}set headers(e){if(!(e instanceof o))throw new TypeError("instance of Headers expected");this[s].headers=e}get body(){return r.from(this[s].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[s].bufferedBody}async arrayBuffer(){return(e=this[s].bufferedBody).buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);var e}async text(){return this[s].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){const{url:e,status:t,statusText:n,headers:r,httpVersion:o,decoded:i,counter:c}=this;return new a(this[s].bufferedBody,{url:e,status:t,statusText:n,headers:r,httpVersion:o,decoded:i,counter:c})}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={cacheableResponse:async e=>{const t=await e.buffer(),{url:n,status:r,statusText:o,headers:i,httpVersion:s,decoded:c,counter:l}=e;return new a(t,{url:n,status:r,statusText:o,headers:i,httpVersion:s,decoded:c,counter:l})}}},2501:e=>{"use strict";class t extends Error{constructor(e,t){super(e),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={FetchBaseError:t,FetchError:class extends t{constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}},AbortError:class extends t{constructor(e,t="aborted"){super(e,t)}}}},8226:(e,t,n)=>{"use strict";const{validateHeaderName:r,validateHeaderValue:o}=n(3685),{isPlainObject:i}=n(5591),s=Symbol("Headers internals"),a=e=>{const t="string"!=typeof e?String(e):e;if("function"==typeof r)r(t);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){const e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}return t.toLowerCase()},c=(e,t)=>{const n="string"!=typeof e?String(e):e;if("function"==typeof o)o(t,n);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(n)){const e=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_CHAR"}),e}return n};class l{constructor(e={}){if(this[s]={map:new Map},e instanceof l)e.forEach(((e,t)=>{this.append(t,e)}));else if(Array.isArray(e))e.forEach((([e,t])=>{this.append(e,t)}));else if(i(e))for(const[t,n]of Object.entries(e))this.append(t,n)}set(e,t){this[s].map.set(a(e),c(t,e))}has(e){return this[s].map.has(a(e))}get(e){const t=this[s].map.get(a(e));return void 0===t?null:t}append(e,t){const n=a(e),r=c(t,e),o=this[s].map.get(n);this[s].map.set(n,o?`${o}, ${r}`:r)}delete(e){this[s].map.delete(a(e))}forEach(e,t){for(const n of this.keys())e.call(t,this.get(n),n)}keys(){return Array.from(this[s].map.keys()).sort()}*values(){for(const e of this.keys())yield this.get(e)}*entries(){for(const e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[s].map)}}Object.defineProperties(l.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce(((e,t)=>(e[t]={enumerable:!0},e)),{})),e.exports={Headers:l}},4735:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361),{Readable:o}=n(2781),i=n(1241)("helix-fetch"),s=n(9941),{Body:a}=n(4214),{Headers:c}=n(8226),{Request:l}=n(3505),{Response:u}=n(8327),{FetchBaseError:d,FetchError:p,AbortError:h}=n(2501),{AbortController:f,AbortSignal:m,TimeoutSignal:g}=n(4346),_=n(7619),{cacheableResponse:y}=n(8941),{sizeof:v}=n(5591),{isFormData:b}=n(6029),{context:w,RequestAbortedError:x}=n(4673),T=["GET","HEAD"],E="push",C=async(e,t,n)=>{const{request:r}=e.context,i=t instanceof l&&void 0===n?t:new l(t,n),{method:s,body:a,signal:d,compress:f,decode:m,follow:g,redirect:_,init:{body:y}}=i;let v;if(d&&d.aborted){const e=new h("The operation was aborted.");throw i.init.body instanceof o&&i.init.body.destroy(e),e}try{v=await r(i.url,{...n,method:s,headers:i.headers.plain(),body:!y||y instanceof o||b(y)?a:y,compress:f,decode:m,follow:g,redirect:_,signal:d})}catch(e){if(y instanceof o&&y.destroy(e),e instanceof TypeError)throw e;if(e instanceof x)throw new h("The operation was aborted.");throw new p(e.message,"system",e)}const w=()=>{d.removeEventListener("abort",w);const e=new h("The operation was aborted.");i.init.body instanceof o&&i.init.body.destroy(e),v.readable.emit("error",e)};d&&d.addEventListener("abort",w);const{statusCode:T,statusText:E,httpVersion:S,headers:k,readable:P,decoded:I}=v;if([301,302,303,307,308].includes(T)){const{location:t}=k,n=null==t?null:new URL(t,i.url);switch(i.redirect){case"manual":break;case"error":throw d&&d.removeEventListener("abort",w),new p(`uri requested responds with a redirect, redirect mode is set to 'error': ${i.url}`,"no-redirect");case"follow":{if(null===n)break;if(i.counter>=i.follow)throw d&&d.removeEventListener("abort",w),new p(`maximum redirect reached at: ${i.url}`,"max-redirect");const t={headers:new c(i.headers),follow:i.follow,compress:i.compress,decode:i.decode,counter:i.counter+1,method:i.method,body:i.body,signal:i.signal};if(303!==T&&i.body&&i.init.body instanceof o)throw d&&d.removeEventListener("abort",w),new p("Cannot follow redirect with body being a readable stream","unsupported-redirect");return 303!==T&&(301!==T&&302!==T||"POST"!==i.method)||(t.method="GET",t.body=void 0,t.headers.delete("content-length")),d&&d.removeEventListener("abort",w),C(e,new l(n,t))}}}return d&&(P.once("end",(()=>{d.removeEventListener("abort",w)})),P.once("error",(()=>{d.removeEventListener("abort",w)}))),new u(P,{url:i.url,status:T,statusText:E,headers:k,httpVersion:S,decoded:I,counter:i.counter})},S=async(e,t,n)=>{if(0===e.options.maxCacheSize)return n;if(!T.includes(t.method))return n;const r=new _(t,n,{shared:!1});if(r.storable()){const o=await y(n);return e.cache.set(t.url,{policy:r,response:o},r.timeToLive()),o}return n},k=(e,t={})=>{const n=new URL(e);if("object"!=typeof t||Array.isArray(t))throw new TypeError("qs: object expected");return Object.entries(t).forEach((([e,t])=>{Array.isArray(t)?t.forEach((t=>n.searchParams.append(e,t))):n.searchParams.append(e,t)})),n.href},P=e=>new g(e);class I{constructor(e){this.options={...e};const{maxCacheSize:t}=this.options;let n="number"==typeof t&&t>=0?t:104857600,o=500;0===n&&(n=1,o=1),this.cache=new s({max:o,maxSize:n,sizeCalculation:({response:e},t)=>v(e)}),this.eventEmitter=new r,this.options.h2=this.options.h2||{},void 0===this.options.h2.enablePush&&(this.options.h2.enablePush=!0);const{enablePush:i}=this.options.h2;i&&(this.options.h2.pushPromiseHandler=(e,t,n)=>{const r={...t};Object.keys(r).filter((e=>e.startsWith(":"))).forEach((e=>delete r[e])),this.pushPromiseHandler(e,r,n)},this.options.h2.pushHandler=(e,t,n)=>{const r={...t};Object.keys(r).filter((e=>e.startsWith(":"))).forEach((e=>delete r[e]));const{statusCode:o,statusText:i,httpVersion:s,headers:a,readable:c,decoded:l}=n;this.pushHandler(e,r,new u(c,{url:e,status:o,statusText:i,headers:a,httpVersion:s,decoded:l}))}),this.context=w(this.options)}api(){return{fetch:async(e,t)=>this.fetch(e,t),Body:a,Headers:c,Request:l,Response:u,AbortController:f,AbortSignal:m,FetchBaseError:d,FetchError:p,AbortError:h,context:(e={})=>new I(e).api(),noCache:(e={})=>new I({...e,maxCacheSize:0}).api(),h1:(e={})=>new I({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),keepAlive:(e={})=>new I({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),h1NoCache:(e={})=>new I({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),keepAliveNoCache:(e={})=>new I({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),reset:async()=>this.context.reset(),onPush:e=>this.onPush(e),offPush:e=>this.offPush(e),createUrl:k,timeoutSignal:P,clearCache:()=>this.clearCache(),cacheStats:()=>this.cacheStats(),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,t){return(async(e,t,n)=>{const r=new l(t,n);if(0!==e.options.maxCacheSize&&T.includes(r.method)&&!["no-store","reload"].includes(r.cache)){const{policy:t,response:n}=e.cache.get(r.url)||{};if(t&&t.satisfiesWithoutRevalidation(r)){n.headers=new c(t.responseHeaders(n));const e=n.clone();return e.fromCache=!0,e}}const o=await C(e,r);return"no-store"!==r.cache?S(e,r,o):o})(this,e,t)}onPush(e){return this.eventEmitter.on(E,e)}offPush(e){return this.eventEmitter.off(E,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,t,n){i(`received server push promise: ${e}, headers: ${JSON.stringify(t)}`);const r=new l(e,{headers:t}),{policy:o}=this.cache.get(e)||{};o&&o.satisfiesWithoutRevalidation(r)&&(i(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(t)}`),n())}async pushHandler(e,t,n){i(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(t)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);const r=await S(this,new l(e,{headers:t}),n);this.eventEmitter.emit(E,e,r)}}e.exports=(new I).api()},7619:(e,t,n)=>{"use strict";const r=n(3573),{Headers:o}=n(8226),i=e=>({url:e.url,method:e.method,headers:e.headers.plain()}),s=e=>({status:e.status,headers:e.headers.plain()});e.exports=class{constructor(e,t,n){this.policy=new r(i(e),s(t),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(i(e))}responseHeaders(e){return new o(this.policy.responseHeaders(s(e)))}timeToLive(){return this.policy.timeToLive()}}},3505:(e,t,n)=>{"use strict";const{AbortSignal:r}=n(4346),{Body:o,cloneStream:i,guessContentType:s}=n(4214),{Headers:a}=n(8226),{isPlainObject:c}=n(5591),{isFormData:l,FormDataSerializer:u}=n(6029),d=Symbol("Request internals");class p extends o{constructor(e,t={}){const n=e instanceof p?e:null,o=n?new URL(n.url):new URL(e);let h=t.method||n&&n.method||"GET";if(h=h.toUpperCase(),(null!=t.body||n&&null!==n.body)&&["GET","HEAD"].includes(h))throw new TypeError("Request with GET/HEAD method cannot have body");let f=t.body||(n&&n.body?i(n):null);const m=new a(t.headers||n&&n.headers||{});if(l(f)&&!m.has("content-type")){const e=new u(f);f=e.stream(),m.set("content-type",e.contentType()),m.has("transfer-encoding")||m.has("content-length")||m.set("content-length",e.length())}if(!m.has("content-type"))if(c(f))f=JSON.stringify(f),m.set("content-type","application/json");else{const e=s(f);e&&m.set("content-type",e)}super(f);let g=n?n.signal:null;if("signal"in t&&(g=t.signal),g&&!(g instanceof r))throw new TypeError("signal needs to be an instance of AbortSignal");const _=t.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(_))throw new TypeError(`'${_}' is not a valid redirect option`);const y=t.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(y))throw new TypeError(`'${y}' is not a valid cache option`);this[d]={init:{...t},method:h,redirect:_,cache:y,headers:m,parsedURL:o,signal:g},void 0===t.follow?n&&void 0!==n.follow?this.follow=n.follow:this.follow=20:this.follow=t.follow,this.counter=t.counter||n&&n.counter||0,void 0===t.compress?n&&void 0!==n.compress?this.compress=n.compress:this.compress=!0:this.compress=t.compress,void 0===t.decode?n&&void 0!==n.decode?this.decode=n.decode:this.decode=!0:this.decode=t.decode}get method(){return this[d].method}get url(){return this[d].parsedURL.toString()}get headers(){return this[d].headers}get redirect(){return this[d].redirect}get cache(){return this[d].cache}get signal(){return this[d].signal}clone(){return new p(this)}get init(){return this[d].init}get[Symbol.toStringTag](){return this.constructor.name}}Object.defineProperties(p.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),e.exports={Request:p}},8327:(e,t,n)=>{"use strict";const{Body:r,cloneStream:o,guessContentType:i}=n(4214),{Headers:s}=n(8226),{isPlainObject:a}=n(5591),{isFormData:c,FormDataSerializer:l}=n(6029),u=Symbol("Response internals");class d extends r{constructor(e=null,t={}){const n=new s(t.headers);let r=e;if(c(r)&&!n.has("content-type")){const e=new l(r);r=e.stream(),n.set("content-type",e.contentType()),n.has("transfer-encoding")||n.has("content-length")||n.set("content-length",e.length())}if(null!==r&&!n.has("content-type"))if(a(r))r=JSON.stringify(r),n.set("content-type","application/json");else{const e=i(r);e&&n.set("content-type",e)}super(r),this[u]={url:t.url,status:t.status||200,statusText:t.statusText||"",headers:n,httpVersion:t.httpVersion,decoded:t.decoded,counter:t.counter}}get url(){return this[u].url||""}get status(){return this[u].status}get statusText(){return this[u].statusText}get ok(){return this[u].status>=200&&this[u].status<300}get redirected(){return this[u].counter>0}get headers(){return this[u].headers}get httpVersion(){return this[u].httpVersion}get decoded(){return this[u].decoded}static redirect(e,t=302){if(![301,302,303,307,308].includes(t))throw new RangeError("Invalid status code");return new d(null,{headers:{location:new URL(e).toString()},status:t})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new d(o(this),{...this[u]})}get[Symbol.toStringTag](){return this.constructor.name}}Object.defineProperties(d.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),e.exports={Response:d}},8606:(e,t,n)=>{"use strict";e.exports=n(4735)},892:(e,t)=>{"use strict";function n(e){return function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}(e)?Object.keys(e).reduce(((t,r)=>({...t,[r]:n(e[r])})),{}):function(e){return"object"==typeof e&&null!==e&&Array.isArray(e)}(e)?e.map((e=>n(e))):e}Object.defineProperty(t,"__esModule",{value:!0}),t.Type=t.TypeBuilder=t.VoidKind=t.UndefinedKind=t.PromiseKind=t.FunctionKind=t.ConstructorKind=t.RefKind=t.AnyKind=t.UnknownKind=t.NullKind=t.BooleanKind=t.IntegerKind=t.NumberKind=t.StringKind=t.LiteralKind=t.EnumKind=t.ArrayKind=t.RecordKind=t.ObjectKind=t.TupleKind=t.UnionKind=t.IntersectKind=t.KeyOfKind=t.NamespaceKind=t.ReadonlyModifier=t.OptionalModifier=t.ReadonlyOptionalModifier=void 0,t.ReadonlyOptionalModifier=Symbol("ReadonlyOptionalModifier"),t.OptionalModifier=Symbol("OptionalModifier"),t.ReadonlyModifier=Symbol("ReadonlyModifier"),t.NamespaceKind=Symbol("NamespaceKind"),t.KeyOfKind=Symbol("KeyOfKind"),t.IntersectKind=Symbol("IntersectKind"),t.UnionKind=Symbol("UnionKind"),t.TupleKind=Symbol("TupleKind"),t.ObjectKind=Symbol("ObjectKind"),t.RecordKind=Symbol("RecordKind"),t.ArrayKind=Symbol("ArrayKind"),t.EnumKind=Symbol("EnumKind"),t.LiteralKind=Symbol("LiteralKind"),t.StringKind=Symbol("StringKind"),t.NumberKind=Symbol("NumberKind"),t.IntegerKind=Symbol("IntegerKind"),t.BooleanKind=Symbol("BooleanKind"),t.NullKind=Symbol("NullKind"),t.UnknownKind=Symbol("UnknownKind"),t.AnyKind=Symbol("AnyKind"),t.RefKind=Symbol("RefKind"),t.ConstructorKind=Symbol("ConstructorKind"),t.FunctionKind=Symbol("FunctionKind"),t.PromiseKind=Symbol("PromiseKind"),t.UndefinedKind=Symbol("UndefinedKind"),t.VoidKind=Symbol("VoidKind");class r{schemas=new Map;ReadonlyOptional(e){return{...e,modifier:t.ReadonlyOptionalModifier}}Readonly(e){return{...e,modifier:t.ReadonlyModifier}}Optional(e){return{...e,modifier:t.OptionalModifier}}Tuple(e,n={}){const r=e.length,o=e.length,i=e.length>0?{...n,kind:t.TupleKind,type:"array",items:e,additionalItems:!1,minItems:r,maxItems:o}:{...n,kind:t.TupleKind,type:"array",minItems:r,maxItems:o};return this.Store(i)}Object(e,n={}){const r=Object.keys(e),o=r.filter((n=>{const r=e[n];return r.modifier&&(r.modifier===t.OptionalModifier||r.modifier===t.ReadonlyOptionalModifier)})),i=r.filter((e=>!o.includes(e))),s=i.length>0?i:void 0;return this.Store(s?{...n,kind:t.ObjectKind,type:"object",properties:e,required:s}:{...n,kind:t.ObjectKind,type:"object",properties:e})}Intersect(e,n={}){return this.Store({...n,kind:t.IntersectKind,type:"object",allOf:e})}Union(e,n={}){return this.Store({...n,kind:t.UnionKind,anyOf:e})}Array(e,n={}){return this.Store({...n,kind:t.ArrayKind,type:"array",items:e})}Enum(e,n={}){const r=Object.keys(e).filter((e=>isNaN(e))).map((t=>e[t])).map((e=>"string"==typeof e?{type:"string",const:e}:{type:"number",const:e}));return this.Store({...n,kind:t.EnumKind,anyOf:r})}Literal(e,n={}){return this.Store({...n,kind:t.LiteralKind,const:e,type:typeof e})}String(e={}){return this.Store({...e,kind:t.StringKind,type:"string"})}RegEx(e,t={}){return this.String({...t,pattern:e.source})}Number(e={}){return this.Store({...e,kind:t.NumberKind,type:"number"})}Integer(e={}){return this.Store({...e,kind:t.IntegerKind,type:"integer"})}Boolean(e={}){return this.Store({...e,kind:t.BooleanKind,type:"boolean"})}Null(e={}){return this.Store({...e,kind:t.NullKind,type:"null"})}Unknown(e={}){return this.Store({...e,kind:t.UnknownKind})}Any(e={}){return this.Store({...e,kind:t.AnyKind})}Record(e,n,r={}){const o=(()=>{switch(e.kind){case t.UnionKind:return`^${e.anyOf.map((e=>e.const)).join("|")}$`;case t.KeyOfKind:return`^${e.enum.join("|")}$`;case t.NumberKind:return"^(0|[1-9][0-9]*)$";case t.StringKind:return e.pattern?e.pattern:"^.*$";default:throw Error("Invalid Record Key")}})();return this.Store({...r,kind:t.RecordKind,type:"object",patternProperties:{[o]:n}})}KeyOf(e,n={}){const r=this.Deref(e),o=Object.keys(r.properties);return this.Store({...n,kind:t.KeyOfKind,type:"string",enum:o})}Required(e,r={}){const o={...n(this.Deref(e)),...r};o.required=Object.keys(o.properties);for(const e of Object.keys(o.properties)){const n=o.properties[e];switch(n.modifier){case t.ReadonlyOptionalModifier:case t.ReadonlyModifier:n.modifier=t.ReadonlyModifier;break;case t.OptionalModifier:default:delete n.modifier}}return this.Store(o)}Partial(e,r={}){const o={...n(this.Deref(e)),...r};delete o.required;for(const e of Object.keys(o.properties)){const n=o.properties[e];switch(n.modifier){case t.ReadonlyOptionalModifier:case t.ReadonlyModifier:n.modifier=t.ReadonlyOptionalModifier;break;case t.OptionalModifier:default:n.modifier=t.OptionalModifier}}return this.Store(o)}Pick(e,t,r={}){const o={...n(this.Deref(e)),...r};o.required=o.required?o.required.filter((e=>t.includes(e))):void 0;for(const e of Object.keys(o.properties))t.includes(e)||delete o.properties[e];return this.Store(o)}Omit(e,t,r={}){const o={...n(this.Deref(e)),...r};o.required=o.required?o.required.filter((e=>!t.includes(e))):void 0;for(const e of Object.keys(o.properties))t.includes(e)&&delete o.properties[e];return this.Store(o)}Strict(e,t={}){return JSON.parse(JSON.stringify({...t,...e}))}Constructor(e,n,r={}){return this.Store({...r,kind:t.ConstructorKind,type:"constructor",arguments:e,returns:n})}Function(e,n,r={}){return this.Store({...r,kind:t.FunctionKind,type:"function",arguments:e,returns:n})}Promise(e,n={}){return this.Store({...n,type:"promise",kind:t.PromiseKind,item:e})}Undefined(e={}){return this.Store({...e,type:"undefined",kind:t.UndefinedKind})}Void(e={}){return this.Store({...e,type:"void",kind:t.VoidKind})}Namespace(e,n={}){return this.Store({...n,kind:t.NamespaceKind,$defs:e})}Ref(...e){if(2===e.length){const n=e[0],r=e[1];if(void 0===n.$id)throw new Error("Referenced namespace has no $id");if(!this.schemas.has(n.$id))throw new Error(`Unable to locate namespace with $id '${n.$id}'`);return this.Store({kind:t.RefKind,$ref:`${n.$id}#/$defs/${r}`})}if(1===e.length){const n=e[0];if(void 0===n.$id)throw new Error("Referenced schema has no $id");if(!this.schemas.has(n.$id))throw new Error(`Unable to locate schema with $id '${n.$id}'`);return this.Store({kind:t.RefKind,$ref:n.$id})}throw new Error("Type.Ref: Invalid arguments")}Rec(e,t={}){const n=t.$id||"",r=e({$ref:`${n}#/$defs/self`});return this.Store({...t,$ref:`${n}#/$defs/self`,$defs:{self:r}})}Store(e){const t=e;return t.$id?(this.schemas.set(t.$id,t),t):t}Deref(e){const n=e;if(n.kind!==t.RefKind)return e;if(!this.schemas.has(n.$ref))throw Error(`Unable to locate schema with $id '${n.$ref}'`);return this.Deref(this.schemas.get(n.$ref))}}t.TypeBuilder=r,t.Type=new r},6236:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=n(8355),o=n(5671),i=n(2),s=n(1512),a=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=n(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},6545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class o extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const n=[e[0]];let r=0;for(;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(6545),o=n(9187);var i=n(6545);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=n(9187);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?o.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=O(this.rhs,e,t),this}get names(){return R(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class p extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=O(this.code,e,t),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||(A(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>I(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class _ extends m{}class y extends g{}y.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(N(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=O(this.condition,e,t),this}get names(){const e=super.names;return R(e,this.condition),this.else&&I(e,this.else.names),e}}v.kind="if";class b extends g{}b.kind="for";class w extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=O(this.iteration,e,t),this}get names(){return I(super.names,this.iteration.names)}}class x extends b{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:r,to:i}=this;return`for(${t} ${n}=${r}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){const e=R(super.names,this.from);return R(e,this.to)}}class T extends b{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=O(this.iterable,e,t),this}get names(){return I(super.names,this.iterable.names)}}class E extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class C extends m{render(e){return"return "+super.render(e)}}C.kind="return";class S extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&I(e,this.catch.names),this.finally&&I(e,this.finally.names),e}}class k extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class P extends g{render(e){return"finally"+super.render(e)}}function I(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function R(e,t){return t instanceof r._CodeOrName?I(e,t.names):e}function O(e,t,n){return e instanceof r.Name?i(e):(o=e)instanceof r._Code&&o._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=i(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function i(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function A(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function N(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${j(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new c(e,o,n)),o}const(e,t,n){return this._def(o.varKinds.const,e,t,n)}let(e,t,n){return this._def(o.varKinds.let,e,t,n)}var(e,t,n){return this._def(o.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new f(e)),this}object(...e){const t=["{"];for(const[n,o]of e)t.length>1&&t.push(","),t.push(n),(n!==o||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,o));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new v(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(v,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,n,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new x(i,s,t,n),(()=>r(s)))}forOf(e,t,n,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(s,r._`${e}[${t}]`),n(s)}))}return this._for(new T("of",i,s,t),(()=>n(s)))}forIn(e,t,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const s=this._scope.toName(e);return this._for(new T("in",i,s,t),(()=>n(s)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new p(e))}return(e){const t=new C;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new S;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new k(e),t(e)}return n&&(this._currNode=r.finally=new P,this.code(n)),this._endBlockNode(k,P)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,o){return this._blockNode(new E(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=N;const D=$(t.operators.AND);t.and=function(...e){return e.reduce(D)};const M=$(t.operators.OR);function $(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${j(t)} ${e} ${j(n)}`}function j(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(M)}},9187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(6545);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=a;const c=r._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,i=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,r);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,s={},a){let c=r.nil;for(const l in e){const u=e[l];if(!u)continue;const d=s[l]=s[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,i.Started);let s=n(e);if(s){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new o(e);c=r._`${c}${s}${this.opts._n}`}d.set(e,i.Completed)}))}return c}}},6930:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(5669),o=n(8936),i=n(7250);function s(e,t){const n=e.const("err",t);e.if(r._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,r._`[${n}]`)),r._`${i.default.vErrors}.push(${n})`),e.code(r._`${i.default.errors}++`)}function a(e,t){const{gen:n,validateName:o,schemaEnv:i}=e;i.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,i){const{it:c}=e,{gen:u,compositeRule:d,allErrors:p}=c,h=l(e,n,o);(null!=i?i:d||p)?s(u,h):a(c,r._`[${h}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:o}=e,{gen:c,compositeRule:u,allErrors:d}=o;s(c,l(e,n,r)),u||d||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(r._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,i.default.errors,(s=>{e.const(c,r._`${i.default.vErrors}[${s}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,o))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:o}=e.it;return!1===o?r._`{}`:function(e,t,n={}){const{gen:o,it:s}=e,a=[u(s,n),d(e,n)];return function(e,{params:t,message:n},o){const{keyword:s,data:a,schemaValue:l,it:u}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=u;o.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||r._`{}`]),d.messages&&o.push([c.message,"function"==typeof n?n(e):n]),d.verbose&&o.push([c.schema,l],[c.parentSchema,r._`${h}${f}`],[i.default.data,a]),p&&o.push([c.propertyName,p])}(e,t,a),o.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:i}){let s=i?t:r.str`${t}/${e}`;return n&&(s=r.str`${s}${(0,o.getErrorPath)(n,o.Type.Str)}`),[c.schemaPath,s]}},7382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(5669),o=n(6448),i=n(7250),s=n(6696),a=n(8936),c=n(1686),l=n(2371);class u{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function d(e){const t=h.call(this,e);if(t)return t;const n=(0,s.getFullPath)(e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new r.CodeGen(this.scope,{es5:a,lines:l,ownProperties:u});let p;e.$async&&(p=d.scopeValue("Error",{ref:o.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const m={gen:d,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${i.default.self}`,`${i.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function p(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function f(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){const n=l.parse(t),r=(0,s._getFullPath)(n);let o=(0,s.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&r===o)return _.call(this,n,e);const i=(0,s.normalizeId)(r),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return _.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||d.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,r=t[n];return r&&(o=(0,s.resolveUrl)(o,r)),new u({schema:t,schemaId:n,root:e,baseId:o})}return _.call(this,n,a)}}t.SchemaEnv=u,t.compileSchema=d,t.resolveRef=function(e,t,n){var r;n=(0,s.resolveUrl)(t,n);const o=e.refs[n];if(o)return o;let i=f.call(this,e,n);if(void 0===i){const o=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:s}=this.opts;o&&(i=new u({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[n]=p.call(this,i):void 0},t.getCompilingSchema=h,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(e,{baseId:t,schema:n,root:r}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(r)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(r)&&o&&(t=(0,s.resolveUrl)(t,o))}let i;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,s.resolveUrl)(t,n.$ref);i=m.call(this,r,e)}const{schemaId:c}=this.opts;return i=i||new u({schema:n,schemaId:c,root:r,baseId:t}),i.schema!==i.root.schema?i:void 0}},7250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=o},1578:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6696);class o extends Error{constructor(e,t,n){super(n||`can't resolve reference ${t} from id ${e}`),this.missingRef=(0,r.resolveUrl)(e,t),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(this.missingRef))}}t.default=o},6696:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(8936),o=n(6471),i=n(5127),s=n(2371),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&u(e)<=t)};const c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(c.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function u(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=u(e))),t===1/0))return 1/0}return t}function d(e="",t){return!1!==t&&(e=f(e)),p(s.parse(e))}function p(e){return s.serialize(e).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=p;const h=/#\/?$/;function f(e){return e?e.replace(h,""):""}t.normalizeId=f,t.resolveUrl=function(e,t){return t=f(t),s.resolve(e,t)};const m=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n}=this.opts,r=f(e[n]||t),a={"":r},c=d(r,!1),l={},u=new Set;return i(e,{allKeys:!0},((e,t,r,o)=>{if(void 0===o)return;const i=c+t;let d=a[o];function g(t){if(t=f(d?s.resolve(d,t):t),u.has(t))throw h(t);u.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?p(e,n.schema,t):t!==f(i)&&("#"===t[0]?(p(e,l[t],t),l[t]=e):this.refs[t]=i),t}function _(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);g.call(this,`#${e}`)}}"string"==typeof e[n]&&(d=g.call(this,e[n])),_.call(this,e.$anchor),_.call(this,e.$dynamicAnchor),a[t]=d})),l;function p(e,t,n){if(void 0!==t&&!o(e,t))throw h(n)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},2881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},8936:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(5669),o=n(6545);function i(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const n in t)o[n]||f(e,`unknown keyword: "${n}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(i,s,a,c)=>{const l=void 0===a?s:a instanceof r.Name?(s instanceof r.Name?e(i,s,a):t(i,s,a),a):s instanceof r.Name?(t(i,a,s),s):n(s,a);return c!==r.Name||l instanceof r.Name?l:o(i,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,o,i){if(!i){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const p={};var h;function f(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const o=t===h.Num;return n?o?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:o?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},9073:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const o=t.RULES.types[r];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=r},2171:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(6930),o=n(5669),i=n(7250),s={message:"boolean schema is false"};function a(e,t){const{gen:n,data:o}=e,i={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(i.default.data):(t.assign(o._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),a(e)):n.var(t,!0)}},7332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(2881),o=n(9073),i=n(6930),s=n(5669),a=n(8936);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:i}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),l=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(l){const o=p(t,r,i.strictNumbers,c.Wrong);n.if(o,(()=>{a.length?function(e,t,n){const{gen:r,data:o,opts:i}=e,a=r.let("dataType",s._`typeof ${o}`),c=r.let("coerced",s._`undefined`);"array"===i.coerceTypes&&r.if(s._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>r.assign(o,s._`${o}[0]`).assign(a,s._`typeof ${o}`).if(p(t,o,i.strictNumbers),(()=>r.assign(c,o))))),r.if(s._`${c} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===i.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void r.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(c,s._`"" + ${o}`).elseIf(s._`${o} === null`).assign(c,s._`""`);case"number":return void r.elseIf(s._`${a} == "boolean" || ${o} === null +(()=>{var e={3870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.Trace=t.ProgressType=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=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.RAL=void 0,t.CancellationStrategy=void 0;const r=n(839);Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return r.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return r.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return r.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return r.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return r.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return r.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return r.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return r.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return r.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return r.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return r.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return r.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return r.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return r.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return r.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return r.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return r.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return r.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return r.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return r.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return r.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return r.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return r.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return r.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return r.ParameterStructures}});const o=n(3911);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});const i=n(7135);Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=n(3881);Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=n(6525);Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=n(6654);Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=n(1343);Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}});const u=n(147);t.RAL=u.default},3881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;const r=n(147),o=n(7574),i=n(7135);var s;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||o.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(s=t.CancellationToken||(t.CancellationToken={}));const a=Object.freeze((function(e,t){const n=r.default().timer.setTimeout(e.bind(t),0);return{dispose(){r.default().timer.clearTimeout(n)}}}));class c{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?a:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.CancellationTokenSource=class{get token(){return this._token||(this._token=new c),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof c&&this._token.dispose():this._token=s.None}}},1343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.Trace=t.NullLogger=t.ProgressType=void 0;const r=n(147),o=n(7574),i=n(839),s=n(6184),a=n(7135),c=n(3881);var l,u,d,p,h,f,m,g,_,y,v,b,w;!function(e){e.type=new i.NotificationType("$/cancelRequest")}(l||(l={})),function(e){e.type=new i.NotificationType("$/progress")}(u||(u={})),t.ProgressType=class{constructor(){}},function(e){e.is=function(e){return o.func(e)}}(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(p=t.Trace||(t.Trace={})),function(e){e.fromString=function(t){if(!o.string(t))return e.Off;switch(t=t.toLowerCase()){default:return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Verbose:return"verbose";default:return"off"}}}(p=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(h=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new i.NotificationType("$/setTrace")}(f=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new i.NotificationType("$/logTrace")}(m=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(g=t.ConnectionErrors||(t.ConnectionErrors={}));class x extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,x.prototype)}}t.ConnectionError=x,function(e){e.is=function(e){const t=e;return t&&o.func(t.cancelUndispatched)}}(_=t.ConnectionStrategy||(t.ConnectionStrategy={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new c.CancellationTokenSource}),e.is=function(e){const t=e;return t&&o.func(t.createCancellationTokenSource)}}(y=t.CancellationReceiverStrategy||(t.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation(e,t){e.sendNotification(l.type,{id:t})},cleanup(e){}}),e.is=function(e){const t=e;return t&&o.func(t.sendCancellation)&&o.func(t.cleanup)}}(v=t.CancellationSenderStrategy||(t.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:y.Message,sender:v.Message}),e.is=function(e){const t=e;return t&&y.is(t.receiver)&&v.is(t.sender)}}(b=t.CancellationStrategy||(t.CancellationStrategy={})),(t.ConnectionOptions||(t.ConnectionOptions={})).is=function(e){const t=e;return t&&(b.is(t.cancellationStrategy)||_.is(t.connectionStrategy))},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(w||(w={})),t.createMessageConnection=function(e,n,_,y){const v=void 0!==_?_:t.NullLogger;let T=0,E=0,C=0;const S="2.0";let k;const P=Object.create(null);let I;const R=Object.create(null),O=new Map;let A,N,D=new s.LinkedMap,M=Object.create(null),$=Object.create(null),L=p.Off,j=h.Text,F=w.New;const q=new a.Emitter,B=new a.Emitter,H=new a.Emitter,U=new a.Emitter,W=new a.Emitter,z=y&&y.cancellationStrategy?y.cancellationStrategy:b.Message;function K(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function V(e){}function G(){return F===w.Listening}function J(){return F===w.Closed}function X(){return F===w.Disposed}function Q(){F!==w.New&&F!==w.Listening||(F=w.Closed,B.fire(void 0))}function Y(){A||0===D.size||(A=r.default().timer.setImmediate((()=>{A=void 0,function(){if(0===D.size)return;const e=D.shift();try{i.isRequestMessage(e)?function(e){if(X())return;function t(t,r,o){const s={jsonrpc:S,id:e.id};t instanceof i.ResponseError?s.error=t.toJson():s.result=void 0===t?null:t,ee(s,r,o),n.write(s)}function r(t,r,o){const i={jsonrpc:S,id:e.id,error:t.toJson()};ee(i,r,o),n.write(i)}!function(e){if(L!==p.Off&&N)if(j===h.Text){let t;L===p.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),N.log(`Received request '${e.method} - (${e.id})'.`,t)}else te("receive-request",e)}(e);const s=P[e.method];let a,c;s&&(a=s.type,c=s.handler);const l=Date.now();if(c||k){const s=String(e.id),u=z.receiver.createCancellationTokenSource(s);$[s]=u;try{let d;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void r(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but recevied none.`),e.method,l);d=c(u.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===i.ParameterStructures.byName)return void r(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,l);d=c(...e.params,u.token)}else{if(void 0!==a&&a.parameterStructures===i.ParameterStructures.byPosition)return void r(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,l);d=c(e.params,u.token)}else k&&(d=k(e.method,e.params,u.token));const p=d;d?p.then?p.then((n=>{delete $[s],t(n,e.method,l)}),(t=>{delete $[s],t instanceof i.ResponseError?r(t,e.method,l):t&&o.string(t.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)})):(delete $[s],t(d,e.method,l)):(delete $[s],function(t,r,o){void 0===t&&(t=null);const i={jsonrpc:S,id:e.id,result:t};ee(i,r,o),n.write(i)}(d,e.method,l))}catch(n){delete $[s],n instanceof i.ResponseError?t(n,e.method,l):n&&o.string(n.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,l):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}}else r(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,l)}(e):i.isNotificationMessage(e)?function(e){if(X())return;let t,n;if(e.method===l.type.method)n=e=>{const t=e.id,n=$[String(t)];n&&n.cancel()};else{const r=R[e.method];r&&(n=r.handler,t=r.type)}if(n||I)try{!function(e){if(L!==p.Off&&N&&e.method!==m.type.method)if(j===h.Text){let t;L===p.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),N.log(`Received notification '${e.method}'.`,t)}else te("receive-notification",e)}(e),n?void 0===e.params?(void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==i.ParameterStructures.byName&&v.error(`Notification ${e.method} defines ${t.numberOfParams} params but recevied none.`),n()):Array.isArray(e.params)?(void 0!==t&&(t.parameterStructures===i.ParameterStructures.byName&&v.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&v.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${e.params.length} argumennts`)),n(...e.params)):(void 0!==t&&t.parameterStructures===i.ParameterStructures.byPosition&&v.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params)):I&&I(e.method,e.params)}catch(t){t.message?v.error(`Notification handler '${e.method}' failed with message: ${t.message}`):v.error(`Notification handler '${e.method}' failed unexpectedly.`)}else H.fire(e)}(e):i.isResponseMessage(e)?function(e){if(!X())if(null===e.id)e.error?v.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):v.error("Received response message without id. No further error information provided.");else{const t=String(e.id),n=M[t];if(function(e,t){if(L!==p.Off&&N)if(j===h.Text){let n;if(L===p.Verbose&&(e.error&&e.error.data?n=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?n=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";N.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else N.log(`Received response ${e.id} without active response promise.`,n)}else te("receive-response",e)}(e,n),n){delete M[t];try{if(e.error){const t=e.error;n.reject(new i.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?v.error(`Response handler '${n.method}' failed with message: ${e.message}`):v.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void v.error("Received empty message.");v.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(o.string(t.id)||o.number(t.id)){const e=String(t.id),n=M[e];n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{Y()}}()})))}e.onClose(Q),e.onError((function(e){q.fire([e,void 0,void 0])})),n.onClose(Q),n.onError((function(e){q.fire(e)}));const Z=e=>{try{if(i.isNotificationMessage(e)&&e.method===l.type.method){const t=K(e.params.id),r=D.get(t);if(i.isRequestMessage(r)){const o=null==y?void 0:y.connectionStrategy,i=o&&o.cancelUndispatched?o.cancelUndispatched(r,V):void 0;if(i&&(void 0!==i.error||void 0!==i.result))return D.delete(t),i.id=r.id,ee(i,e.method,Date.now()),void n.write(i)}}!function(e,t){var n;i.isRequestMessage(t)?e.set(K(t.id),t):i.isResponseMessage(t)?e.set(null===(n=t.id)?"res-unknown-"+(++C).toString():"res-"+n.toString(),t):e.set("not-"+(++E).toString(),t)}(D,e)}finally{Y()}};function ee(e,t,n){if(L!==p.Off&&N)if(j===h.Text){let r;L===p.Verbose&&(e.error&&e.error.data?r=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?r=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),N.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else te("send-response",e)}function te(e,t){if(!N||L===p.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};N.log(n)}function ne(){if(J())throw new x(g.Closed,"Connection is closed.");if(X())throw new x(g.Disposed,"Connection is disposed.")}function re(e){return void 0===e?null:e}function oe(e){return null===e?void 0:e}function ie(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function se(e,t){switch(e){case i.ParameterStructures.auto:return ie(t)?oe(t):[re(t)];case i.ParameterStructures.byName:if(!ie(t))throw new Error("Recevied parameters by name but param is not an object literal.");return oe(t);case i.ParameterStructures.byPosition:return[re(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function ae(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=se(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e{let r,s;if(ne(),o.string(e)){r=e;const n=t[0];let o=0,a=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(o=1,a=n);let c=t.length;const l=c-o;switch(l){case 0:s=void 0;break;case 1:s=se(a,t[o]);break;default:if(a===i.ParameterStructures.byName)throw new Error(`Recevied ${l} parameters for 'by Name' notification parameter structure.`);s=t.slice(o,c).map((e=>re(e)))}}else{const n=t;r=e.method,s=ae(e,n)}const a={jsonrpc:S,method:r,params:s};!function(e){if(L!==p.Off&&N)if(j===h.Text){let t;L===p.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),N.log(`Sending notification '${e.method}'.`,t)}else te("send-notification",e)}(a),n.write(a)},onNotification:(e,t)=>{let n;return ne(),o.func(e)?I=e:t&&(o.string(e)?(n=e,R[e]={type:void 0,handler:t}):(n=e.method,R[e.method]={type:e,handler:t})),{dispose:()=>{void 0!==n?delete R[n]:I=void 0}}},onProgress:(e,t,n)=>{if(O.has(t))throw new Error(`Progress handler for token ${t} already registered`);return O.set(t,n),{dispose:()=>{O.delete(t)}}},sendProgress:(e,t,n)=>{ce.sendNotification(u.type,{token:t,value:n})},onUnhandledProgress:U.event,sendRequest:(e,...t)=>{let r,s,a;if(ne(),function(){if(!G())throw new Error("Call listen() first.")}(),o.string(e)){r=e;const n=t[0],o=t[t.length-1];let l=0,u=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(l=1,u=n);let d=t.length;c.CancellationToken.is(o)&&(d-=1,a=o);const p=d-l;switch(p){case 0:s=void 0;break;case 1:s=se(u,t[l]);break;default:if(u===i.ParameterStructures.byName)throw new Error(`Recevied ${p} parameters for 'by Name' request parameter structure.`);s=t.slice(l,d).map((e=>re(e)))}}else{const n=t;r=e.method,s=ae(e,n);const o=e.numberOfParams;a=c.CancellationToken.is(n[o])?n[o]:void 0}const l=T++;let u;return a&&(u=a.onCancellationRequested((()=>{z.sender.sendCancellation(ce,l)}))),new Promise(((e,t)=>{const o={jsonrpc:S,id:l,method:r,params:s};let a={method:r,timerStart:Date.now(),resolve:t=>{e(t),z.sender.cleanup(l),null==u||u.dispose()},reject:e=>{t(e),z.sender.cleanup(l),null==u||u.dispose()}};!function(e){if(L!==p.Off&&N)if(j===h.Text){let t;L===p.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),N.log(`Sending request '${e.method} - (${e.id})'.`,t)}else te("send-request",e)}(o);try{n.write(o)}catch(e){a.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),a=null}a&&(M[String(l)]=a)}))},onRequest:(e,t)=>{ne();let n=null;return d.is(e)?(n=void 0,k=e):o.string(e)?(n=null,void 0!==t&&(n=e,P[e]={handler:t,type:void 0})):void 0!==t&&(n=e.method,P[e.method]={type:e,handler:t}),{dispose:()=>{null!==n&&(void 0!==n?delete P[n]:k=void 0)}}},trace:(e,t,n)=>{let r=!1,i=h.Text;void 0!==n&&(o.boolean(n)?r=n:(r=n.sendNotification||!1,i=n.traceFormat||h.Text)),L=e,j=i,N=L===p.Off?void 0:t,!r||J()||X()||ce.sendNotification(f.type,{value:p.toString(e)})},onError:q.event,onClose:B.event,onUnhandledNotification:H.event,onDispose:W.event,end:()=>{n.end()},dispose:()=>{if(X())return;F=w.Disposed,W.fire(void 0);const t=new Error("Connection got disposed.");Object.keys(M).forEach((e=>{M[e].reject(t)})),M=Object.create(null),$=Object.create(null),D=new s.LinkedMap,o.func(n.dispose)&&n.dispose(),o.func(e.dispose)&&e.dispose()},listen:()=>{ne(),function(){if(G())throw new x(g.AlreadyListening,"Connection is already listening")}(),F=w.Listening,e.listen(Z)},inspect:()=>{r.default().console.log("inspect")}};return ce.onNotification(m.type,(e=>{L!==p.Off&&N&&N.log(e.message,L===p.Verbose?e.verbose:void 0)})),ce.onNotification(u.type,(e=>{const t=O.get(e.token);t?t(e.value):U.fire(e)})),ce}},3911:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0,(t.Disposable||(t.Disposable={})).create=function(e){return{dispose:e}}},7135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;const r=n(147);!function(e){const t={dispose(){}};e.None=function(){return t}}(t.Event||(t.Event={}));class o{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,o=this._callbacks.length;r{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=i._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=i,i._noop=function(){}},7574:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))}},6184:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(n=t.Touch||(t.Touch={}));class r{constructor(){this[Symbol.toStringTag]="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(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=n.None){const r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let o=this._map.get(e);if(o)o.value=t,r!==n.None&&this.touch(o,r);else{switch(o={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(o);break;case n.First:this.addItemFirst(o);break;case n.Last:default:this.addItemLast(o)}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.key,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.value,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:[n.key,n.value],done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;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{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}t.LinkedMap=r,t.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),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,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}},5530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0,t.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(0===this._chunks.length)return;let e=0,t=0,n=0,r=0;e:for(;tthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const o=r.slice(0,e);t.set(o,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}},6525:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;const r=n(147),o=n(7574),i=n(7135);var s;(t.MessageReader||(t.MessageReader={})).is=function(e){let t=e;return t&&o.func(t.listen)&&o.func(t.dispose)&&o.func(t.onError)&&o.func(t.onClose)&&o.func(t.onPartialMessage)};class a{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter,this.partialMessageEmitter=new i.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: ${o.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageReader=a,function(e){e.fromOptions=function(e){var t;let n,o;const i=new Map;let s;const a=new Map;if(void 0===e||"string"==typeof e)n=null!=e?e:"utf-8";else{if(n=null!==(t=e.charset)&&void 0!==t?t:"utf-8",void 0!==e.contentDecoder&&(o=e.contentDecoder,i.set(o.name,o)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)i.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(s=e.contentTypeDecoder,a.set(s.name,s)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)a.set(t.name,t)}return void 0===s&&(s=r.default().applicationJson.decoder,a.set(s.name,s)),{charset:n,contentDecoder:o,contentDecoders:i,contentTypeDecoder:s,contentTypeDecoders:a}}}(s||(s={})),t.ReadableStreamMessageReader=class extends a{constructor(e,t){super(),this.readable=e,this.options=s.fromOptions(t),this.buffer=r.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}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;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders();if(!e)return;const t=e.get("Content-Length");if(!t)throw new Error("Header must provide a Content-Length property.");const n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();let t;this.clearPartialMessageTimer(),this.nextMessageLength=-1,t=void 0!==this.options.contentDecoder?this.options.contentDecoder.decode(e):Promise.resolve(e),t.then((e=>{this.options.contentTypeDecoder.decode(e,this.options).then((e=>{this.callback(e)}),(e=>{this.fireError(e)}))}),(e=>{this.fireError(e)}))}}clearPartialMessageTimer(){this.partialMessageTimer&&(r.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=r.default().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}},6654:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;const r=n(147),o=n(7574),i=n(142),s=n(7135);var a;(t.MessageWriter||(t.MessageWriter={})).is=function(e){let t=e;return t&&o.func(t.dispose)&&o.func(t.onClose)&&o.func(t.onError)&&o.func(t.write)};class c{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,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: ${o.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageWriter=c,function(e){e.fromOptions=function(e){var t,n;return void 0===e||"string"==typeof e?{charset:null!=e?e:"utf-8",contentTypeEncoder:r.default().applicationJson.encoder}:{charset:null!==(t=e.charset)&&void 0!==t?t:"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:null!==(n=e.contentTypeEncoder)&&void 0!==n?n:r.default().applicationJson.encoder}}}(a||(a={})),t.WriteableStreamMessageWriter=class extends c{constructor(e,t){super(),this.writable=e,this.options=a.fromOptions(t),this.errorCount=0,this.writeSemaphore=new i.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}},839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isResponseMessage=t.isNotificationMessage=t.isRequestMessage=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;const r=n(7574);var o;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=e.jsonrpcReservedErrorRangeStart,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=e.jsonrpcReservedErrorRangeEnd}(o=t.ErrorCodes||(t.ErrorCodes={}));class i extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:o.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,i.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}}t.ResponseError=i;class s{constructor(e){this.kind=e}static is(e){return e===s.auto||e===s.byName||e===s.byPosition}toString(){return this.kind}}t.ParameterStructures=s,s.auto=new s("auto"),s.byPosition=new s("byPosition"),s.byName=new s("byName");class a{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return s.auto}}t.AbstractMessageSignature=a,t.RequestType0=class extends a{constructor(e){super(e,0)}},t.RequestType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType2=class extends a{constructor(e){super(e,2)}},t.RequestType3=class extends a{constructor(e){super(e,3)}},t.RequestType4=class extends a{constructor(e){super(e,4)}},t.RequestType5=class extends a{constructor(e){super(e,5)}},t.RequestType6=class extends a{constructor(e){super(e,6)}},t.RequestType7=class extends a{constructor(e){super(e,7)}},t.RequestType8=class extends a{constructor(e){super(e,8)}},t.RequestType9=class extends a{constructor(e){super(e,9)}},t.NotificationType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType0=class extends a{constructor(e){super(e,0)}},t.NotificationType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType2=class extends a{constructor(e){super(e,2)}},t.NotificationType3=class extends a{constructor(e){super(e,3)}},t.NotificationType4=class extends a{constructor(e){super(e,4)}},t.NotificationType5=class extends a{constructor(e){super(e,5)}},t.NotificationType6=class extends a{constructor(e){super(e,6)}},t.NotificationType7=class extends a{constructor(e){super(e,7)}},t.NotificationType8=class extends a{constructor(e){super(e,8)}},t.NotificationType9=class extends a{constructor(e){super(e,9)}},t.isRequestMessage=function(e){const t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},t.isNotificationMessage=function(e){const t=e;return t&&r.string(t.method)&&void 0===e.id},t.isResponseMessage=function(e){const t=e;return t&&(void 0!==t.result||!!t.error)&&(r.string(t.id)||r.number(t.id)||null===t.id)}},147:(e,t)=>{"use strict";let n;function r(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(r||(r={})),t.default=r},142:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;const r=n(147);t.Semaphore=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(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&r.default().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}},4389:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const i=n(3034);i.default.install();const s=n(3870),a=n(1017),c=n(2037),l=n(6113),u=n(1808);o(n(3870),t);class d extends s.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){return this.process.on("message",e),s.Disposable.create((()=>this.process.off("message",e)))}}t.IPCMessageReader=d;class p extends s.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){try{return"function"==typeof this.process.send&&this.process.send(e,void 0,void 0,(t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0})),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}t.IPCMessageWriter=p;class h extends s.ReadableStreamMessageReader{constructor(e,t="utf-8"){super(i.default().stream.asReadableStream(e),t)}}t.SocketMessageReader=h;class f extends s.WriteableStreamMessageWriter{constructor(e,t){super(i.default().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=f;class m extends s.ReadableStreamMessageReader{constructor(e,t){super(i.default().stream.asReadableStream(e),t)}}t.StreamMessageReader=m;class g extends s.WriteableStreamMessageWriter{constructor(e,t){super(i.default().stream.asWritableStream(e),t)}}t.StreamMessageWriter=g;const _=process.env.XDG_RUNTIME_DIR,y=new Map([["linux",107],["darwin",103]]);t.generateRandomPipeName=function(){const e=l.randomBytes(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=_?a.join(_,`vscode-ipc-${e}.sock`):a.join(c.tmpdir(),`vscode-${e}.sock`);const n=y.get(process.platform);return void 0!==n&&t.length>=n&&i.default().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t},t.createClientPipeTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((o,i)=>{let s=u.createServer((e=>{s.close(),n([new h(e,t),new f(e,t)])}));s.on("error",i),s.listen(e,(()=>{s.removeListener("error",i),o({onConnected:()=>r})}))}))},t.createServerPipeTransport=function(e,t="utf-8"){const n=u.createConnection(e);return[new h(n,t),new f(n,t)]},t.createClientSocketTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((o,i)=>{const s=u.createServer((e=>{s.close(),n([new h(e,t),new f(e,t)])}));s.on("error",i),s.listen(e,"127.0.0.1",(()=>{s.removeListener("error",i),o({onConnected:()=>r})}))}))},t.createServerSocketTransport=function(e,t="utf-8"){const n=u.createConnection(e,"127.0.0.1");return[new h(n,t),new f(n,t)]},t.createMessageConnection=function(e,t,n,r){n||(n=s.NullLogger);const o=function(e){const t=e;return void 0!==t.read&&void 0!==t.addListener}(e)?new m(e):e,i=function(e){const t=e;return void 0!==t.write&&void 0!==t.addListener}(t)?new g(t):t;return s.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),s.createMessageConnection(o,i,n,r)}},3034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(147),o=n(3837),i=n(3911),s=n(5530);class a extends s.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return a.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new o.TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}}a.emptyBuffer=Buffer.allocUnsafe(0);class c{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),i.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),i.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),i.Disposable.create((()=>this.stream.off("end",e)))}onData(e){return this.stream.on("data",e),i.Disposable.create((()=>this.stream.off("data",e)))}}class l{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),i.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),i.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),i.Disposable.create((()=>this.stream.off("end",e)))}write(e,t){return new Promise(((n,r)=>{const o=e=>{null==e?n():r(e)};"string"==typeof e?this.stream.write(e,t,o):this.stream.write(e,o)}))}end(){this.stream.end()}}const u=Object.freeze({messageBuffer:Object.freeze({create:e=>new a(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(e){return Promise.reject(e)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new o.TextDecoder(t.charset).decode(e)))}catch(e){return Promise.reject(e)}}})}),stream:Object.freeze({asReadableStream:e=>new c(e),asWritableStream:e=>new l(e)}),console,timer:Object.freeze({setTimeout:(e,t,...n)=>setTimeout(e,t,...n),clearTimeout(e){clearTimeout(e)},setImmediate:(e,...t)=>setImmediate(e,...t),clearImmediate(e){clearImmediate(e)}})});function d(){return u}!function(e){e.install=function(){r.default.install(u)}}(d||(d={})),t.default=d},5028:(e,t,n)=>{"use strict";e.exports=n(4389)},4437:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,o(n(4389),t),o(n(1674),t),o(n(6140),t),o(n(542),t);var i,s=n(3767);Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return s.createProtocolConnection}}),(i=t.LSPErrorCodes||(t.LSPErrorCodes={})).lspReservedErrorRangeStart=-32899,i.ContentModified=-32801,i.RequestCancelled=-32800,i.lspReservedErrorRangeEnd=-32800},3767:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=n(4389);t.createProtocolConnection=function(e,t,n,o){return r.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),r.createMessageConnection(e,t,n,o)}},6140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=void 0;const r=n(4389);t.RegistrationType=class{constructor(e){this.method=e}};class o extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=o;class i extends r.RequestType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolRequestType=i;class s extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=s;class a extends r.NotificationType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolNotificationType=a},2918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;const r=n(6140);var o,i,s;(s=t.CallHierarchyPrepareRequest||(t.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",s.type=new r.ProtocolRequestType(s.method),(i=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",i.type=new r.ProtocolRequestType(i.method),(o=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",o.type=new r.ProtocolRequestType(o.method)},3390:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;const r=n(6140);var o;(o=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",o.type=new r.ProtocolRequestType(o.method),(t.ColorPresentationRequest||(t.ColorPresentationRequest={})).type=new r.ProtocolRequestType("textDocument/colorPresentation")},5934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;const r=n(6140);(t.ConfigurationRequest||(t.ConfigurationRequest={})).type=new r.ProtocolRequestType("workspace/configuration")},764:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;const r=n(6140);var o;(o=t.DeclarationRequest||(t.DeclarationRequest={})).method="textDocument/declaration",o.type=new r.ProtocolRequestType(o.method)},7846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;const r=n(6140);var o,i,s,a,c,l,u;(u=t.FileOperationPatternKind||(t.FileOperationPatternKind={})).file="file",u.folder="folder",(l=t.WillCreateFilesRequest||(t.WillCreateFilesRequest={})).method="workspace/willCreateFiles",l.type=new r.ProtocolRequestType(l.method),(c=t.DidCreateFilesNotification||(t.DidCreateFilesNotification={})).method="workspace/didCreateFiles",c.type=new r.ProtocolNotificationType(c.method),(a=t.WillRenameFilesRequest||(t.WillRenameFilesRequest={})).method="workspace/willRenameFiles",a.type=new r.ProtocolRequestType(a.method),(s=t.DidRenameFilesNotification||(t.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.type=new r.ProtocolNotificationType(s.method),(i=t.DidDeleteFilesNotification||(t.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",i.type=new r.ProtocolNotificationType(i.method),(o=t.WillDeleteFilesRequest||(t.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",o.type=new r.ProtocolRequestType(o.method)},3394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRequest=t.FoldingRangeKind=void 0;const r=n(6140);var o,i;(i=t.FoldingRangeKind||(t.FoldingRangeKind={})).Comment="comment",i.Imports="imports",i.Region="region",(o=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",o.type=new r.ProtocolRequestType(o.method)},2122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;const r=n(6140);var o;(o=t.ImplementationRequest||(t.ImplementationRequest={})).method="textDocument/implementation",o.type=new r.ProtocolRequestType(o.method)},542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeError=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.DocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=void 0;const r=n(9533),o=n(6140),i=n(2122);Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=n(1589);Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=n(9795);Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const c=n(5934);Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return c.ConfigurationRequest}});const l=n(3390);Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const u=n(3394);Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}});const d=n(764);Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return d.DeclarationRequest}});const p=n(5206);Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return p.SelectionRangeRequest}});const h=n(1862);Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return h.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return h.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return h.WorkDoneProgressCancelNotification}});const f=n(2918);Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return f.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return f.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return f.CallHierarchyPrepareRequest}});const m=n(9434);Object.defineProperty(t,"SemanticTokenTypes",{enumerable:!0,get:function(){return m.SemanticTokenTypes}}),Object.defineProperty(t,"SemanticTokenModifiers",{enumerable:!0,get:function(){return m.SemanticTokenModifiers}}),Object.defineProperty(t,"SemanticTokens",{enumerable:!0,get:function(){return m.SemanticTokens}}),Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});const g=n(5726);Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return g.ShowDocumentRequest}});const _=n(6305);Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return _.LinkedEditingRangeRequest}});const y=n(7846);Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const v=n(3443);var b,w,x,T,E,C,S,k,P,I,R,O,A,N,D,M,$,L,j,F,q,B,H,U,W,z,K,V,G,J,X,Q,Y,Z,ee,te,ne,re,oe,ie;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}}),function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(b=t.DocumentFilter||(t.DocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!b.is(t))return!1;return!0}}(w=t.DocumentSelector||(t.DocumentSelector={})),(t.RegistrationRequest||(t.RegistrationRequest={})).type=new o.ProtocolRequestType("client/registerCapability"),(t.UnregistrationRequest||(t.UnregistrationRequest={})).type=new o.ProtocolRequestType("client/unregisterCapability"),(ie=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",ie.Rename="rename",ie.Delete="delete",(oe=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",oe.Transactional="transactional",oe.TextOnlyTransactional="textOnlyTransactional",oe.Undo="undo",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||w.is(t.documentSelector))},(re=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},re.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(t.InitializeRequest||(t.InitializeRequest={})).type=new o.ProtocolRequestType("initialize"),(t.InitializeError||(t.InitializeError={})).unknownProtocolVersion=1,(t.InitializedNotification||(t.InitializedNotification={})).type=new o.ProtocolNotificationType("initialized"),(t.ShutdownRequest||(t.ShutdownRequest={})).type=new o.ProtocolRequestType0("shutdown"),(t.ExitNotification||(t.ExitNotification={})).type=new o.ProtocolNotificationType0("exit"),(t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).type=new o.ProtocolNotificationType("workspace/didChangeConfiguration"),(ne=t.MessageType||(t.MessageType={})).Error=1,ne.Warning=2,ne.Info=3,ne.Log=4,(t.ShowMessageNotification||(t.ShowMessageNotification={})).type=new o.ProtocolNotificationType("window/showMessage"),(t.ShowMessageRequest||(t.ShowMessageRequest={})).type=new o.ProtocolRequestType("window/showMessageRequest"),(t.LogMessageNotification||(t.LogMessageNotification={})).type=new o.ProtocolNotificationType("window/logMessage"),(t.TelemetryEventNotification||(t.TelemetryEventNotification={})).type=new o.ProtocolNotificationType("telemetry/event"),(te=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,te.Full=1,te.Incremental=2,(ee=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",ee.type=new o.ProtocolNotificationType(ee.method),(Z=t.TextDocumentContentChangeEvent||(t.TextDocumentContentChangeEvent={})).isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},Z.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(Y=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",Y.type=new o.ProtocolNotificationType(Y.method),(Q=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",Q.type=new o.ProtocolNotificationType(Q.method),(X=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",X.type=new o.ProtocolNotificationType(X.method),(J=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,J.AfterDelay=2,J.FocusOut=3,(G=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",G.type=new o.ProtocolNotificationType(G.method),(V=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",V.type=new o.ProtocolRequestType(V.method),(t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).type=new o.ProtocolNotificationType("workspace/didChangeWatchedFiles"),(K=t.FileChangeType||(t.FileChangeType={})).Created=1,K.Changed=2,K.Deleted=3,(z=t.WatchKind||(t.WatchKind={})).Create=1,z.Change=2,z.Delete=4,(t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).type=new o.ProtocolNotificationType("textDocument/publishDiagnostics"),(W=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,W.TriggerCharacter=2,W.TriggerForIncompleteCompletions=3,(U=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",U.type=new o.ProtocolRequestType(U.method),(H=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",H.type=new o.ProtocolRequestType(H.method),(B=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",B.type=new o.ProtocolRequestType(B.method),(q=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,q.TriggerCharacter=2,q.ContentChange=3,(F=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",F.type=new o.ProtocolRequestType(F.method),(j=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",j.type=new o.ProtocolRequestType(j.method),(L=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",L.type=new o.ProtocolRequestType(L.method),($=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",$.type=new o.ProtocolRequestType($.method),(M=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",M.type=new o.ProtocolRequestType(M.method),(D=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",D.type=new o.ProtocolRequestType(D.method),(N=t.CodeActionResolveRequest||(t.CodeActionResolveRequest={})).method="codeAction/resolve",N.type=new o.ProtocolRequestType(N.method),(A=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",A.type=new o.ProtocolRequestType(A.method),(O=t.CodeLensRequest||(t.CodeLensRequest={})).method="textDocument/codeLens",O.type=new o.ProtocolRequestType(O.method),(R=t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).method="codeLens/resolve",R.type=new o.ProtocolRequestType(R.method),(I=t.CodeLensRefreshRequest||(t.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",I.type=new o.ProtocolRequestType0(I.method),(P=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",P.type=new o.ProtocolRequestType(P.method),(k=t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).method="documentLink/resolve",k.type=new o.ProtocolRequestType(k.method),(S=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",S.type=new o.ProtocolRequestType(S.method),(C=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",C.type=new o.ProtocolRequestType(C.method),(E=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",E.type=new o.ProtocolRequestType(E.method),(t.PrepareSupportDefaultBehavior||(t.PrepareSupportDefaultBehavior={})).Identifier=1,(T=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",T.type=new o.ProtocolRequestType(T.method),(x=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",x.type=new o.ProtocolRequestType(x.method),(t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).type=new o.ProtocolRequestType("workspace/executeCommand"),(t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).type=new o.ProtocolRequestType("workspace/applyEdit")},6305:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;const r=n(6140);var o;(o=t.LinkedEditingRangeRequest||(t.LinkedEditingRangeRequest={})).method="textDocument/linkedEditingRange",o.type=new r.ProtocolRequestType(o.method)},3443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;const r=n(6140);var o,i,s;(s=t.UniquenessLevel||(t.UniquenessLevel={})).document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global",(i=t.MonikerKind||(t.MonikerKind={})).import="import",i.export="export",i.local="local",(o=t.MonikerRequest||(t.MonikerRequest={})).method="textDocument/moniker",o.type=new r.ProtocolRequestType(o.method)},1862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;const r=n(4389),o=n(6140);var i;(i=t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,i.is=function(e){return e===i.type},(t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).type=new o.ProtocolRequestType("window/workDoneProgress/create"),(t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).type=new o.ProtocolNotificationType("window/workDoneProgress/cancel")},5206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;const r=n(6140);var o;(o=t.SelectionRangeRequest||(t.SelectionRangeRequest={})).method="textDocument/selectionRange",o.type=new r.ProtocolRequestType(o.method)},9434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=void 0;const r=n(6140);var o,i,s,a,c,l,u;(u=t.SemanticTokenTypes||(t.SemanticTokenTypes={})).namespace="namespace",u.type="type",u.class="class",u.enum="enum",u.interface="interface",u.struct="struct",u.typeParameter="typeParameter",u.parameter="parameter",u.variable="variable",u.property="property",u.enumMember="enumMember",u.event="event",u.function="function",u.method="method",u.macro="macro",u.keyword="keyword",u.modifier="modifier",u.comment="comment",u.string="string",u.number="number",u.regexp="regexp",u.operator="operator",(l=t.SemanticTokenModifiers||(t.SemanticTokenModifiers={})).declaration="declaration",l.definition="definition",l.readonly="readonly",l.static="static",l.deprecated="deprecated",l.abstract="abstract",l.async="async",l.modification="modification",l.documentation="documentation",l.defaultLibrary="defaultLibrary",(t.SemanticTokens||(t.SemanticTokens={})).is=function(e){const t=e;return void 0!==t&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])},(t.TokenFormat||(t.TokenFormat={})).Relative="relative",(c=t.SemanticTokensRegistrationType||(t.SemanticTokensRegistrationType={})).method="textDocument/semanticTokens",c.type=new r.RegistrationType(c.method),(a=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",a.type=new r.ProtocolRequestType(a.method),(s=t.SemanticTokensDeltaRequest||(t.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",s.type=new r.ProtocolRequestType(s.method),(i=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",i.type=new r.ProtocolRequestType(i.method),(o=t.SemanticTokensRefreshRequest||(t.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",o.type=new r.ProtocolRequestType0(o.method)},5726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;const r=n(6140);var o;(o=t.ShowDocumentRequest||(t.ShowDocumentRequest={})).method="window/showDocument",o.type=new r.ProtocolRequestType(o.method)},1589:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;const r=n(6140);var o;(o=t.TypeDefinitionRequest||(t.TypeDefinitionRequest={})).method="textDocument/typeDefinition",o.type=new r.ProtocolRequestType(o.method)},9795:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;const r=n(6140);(t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).type=new r.ProtocolRequestType0("workspace/workspaceFolders"),(t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).type=new r.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")},9533:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.objectLiteral=function(e){return null!==e&&"object"==typeof e}},273:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const i=n(5028);o(n(5028),t),o(n(4437),t),t.createProtocolConnection=function(e,t,n,r){return i.createMessageConnection(e,t,n,r)}},6560:(e,t,n)=>{"use strict";e.exports=n(273)},6813:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TextDocument:()=>r});var r,o=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;oe?r=o:n=o+1}var i=n-1;return{line:i,character:e-t[i]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function l(e){var t=c(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new i(e,t,n,r)},e.update=function(e,t,n){if(e instanceof i)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var n=e.getText(),r=0,o=[],i=0,a=s(t.map(l),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}));ir&&o.push(n.substring(r,u)),c.newText.length&&o.push(c.newText),r=e.offsetAt(c.range.end)}return o.push(n.substr(r)),o.join("")}}(r||(r={}))},1674:(e,t,n)=>{"use strict";var r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w,x,T,E,C,S,k,P;n.r(t),n.d(t,{integer:()=>r,uinteger:()=>o,Position:()=>i,Range:()=>s,Location:()=>a,LocationLink:()=>c,Color:()=>l,ColorInformation:()=>u,ColorPresentation:()=>d,FoldingRangeKind:()=>p,FoldingRange:()=>h,DiagnosticRelatedInformation:()=>f,DiagnosticSeverity:()=>m,DiagnosticTag:()=>g,CodeDescription:()=>_,Diagnostic:()=>y,Command:()=>v,TextEdit:()=>b,ChangeAnnotation:()=>w,ChangeAnnotationIdentifier:()=>x,AnnotatedTextEdit:()=>T,TextDocumentEdit:()=>E,CreateFile:()=>C,RenameFile:()=>S,DeleteFile:()=>k,WorkspaceEdit:()=>P,WorkspaceChange:()=>ae,TextDocumentIdentifier:()=>I,VersionedTextDocumentIdentifier:()=>R,OptionalVersionedTextDocumentIdentifier:()=>O,TextDocumentItem:()=>A,MarkupKind:()=>N,MarkupContent:()=>D,CompletionItemKind:()=>M,InsertTextFormat:()=>$,CompletionItemTag:()=>L,InsertReplaceEdit:()=>j,InsertTextMode:()=>F,CompletionItem:()=>q,CompletionList:()=>B,MarkedString:()=>H,Hover:()=>U,ParameterInformation:()=>W,SignatureInformation:()=>z,DocumentHighlightKind:()=>K,DocumentHighlight:()=>V,SymbolKind:()=>G,SymbolTag:()=>J,SymbolInformation:()=>X,DocumentSymbol:()=>Q,CodeActionKind:()=>Y,CodeActionContext:()=>Z,CodeAction:()=>ee,CodeLens:()=>te,FormattingOptions:()=>ne,DocumentLink:()=>re,SelectionRange:()=>oe,EOL:()=>le,TextDocument:()=>ce}),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647}(r||(r={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647}(o||(o={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=o.MAX_VALUE),t===Number.MAX_VALUE&&(t=o.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return ue.objectLiteral(t)&&ue.uinteger(t.line)&&ue.uinteger(t.character)}}(i||(i={})),function(e){e.create=function(e,t,n,r){if(ue.uinteger(e)&&ue.uinteger(t)&&ue.uinteger(n)&&ue.uinteger(r))return{start:i.create(e,t),end:i.create(n,r)};if(i.is(e)&&i.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")},e.is=function(e){var t=e;return ue.objectLiteral(t)&&i.is(t.start)&&i.is(t.end)}}(s||(s={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return ue.defined(t)&&s.is(t.range)&&(ue.string(t.uri)||ue.undefined(t.uri))}}(a||(a={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return ue.defined(t)&&s.is(t.targetRange)&&ue.string(t.targetUri)&&(s.is(t.targetSelectionRange)||ue.undefined(t.targetSelectionRange))&&(s.is(t.originSelectionRange)||ue.undefined(t.originSelectionRange))}}(c||(c={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return ue.numberRange(t.red,0,1)&&ue.numberRange(t.green,0,1)&&ue.numberRange(t.blue,0,1)&&ue.numberRange(t.alpha,0,1)}}(l||(l={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return s.is(t.range)&&l.is(t.color)}}(u||(u={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return ue.string(t.label)&&(ue.undefined(t.textEdit)||b.is(t))&&(ue.undefined(t.additionalTextEdits)||ue.typedArray(t.additionalTextEdits,b.is))}}(d||(d={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(p||(p={})),function(e){e.create=function(e,t,n,r,o){var i={startLine:e,endLine:t};return ue.defined(n)&&(i.startCharacter=n),ue.defined(r)&&(i.endCharacter=r),ue.defined(o)&&(i.kind=o),i},e.is=function(e){var t=e;return ue.uinteger(t.startLine)&&ue.uinteger(t.startLine)&&(ue.undefined(t.startCharacter)||ue.uinteger(t.startCharacter))&&(ue.undefined(t.endCharacter)||ue.uinteger(t.endCharacter))&&(ue.undefined(t.kind)||ue.string(t.kind))}}(h||(h={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return ue.defined(t)&&a.is(t.location)&&ue.string(t.message)}}(f||(f={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(m||(m={})),function(e){e.Unnecessary=1,e.Deprecated=2}(g||(g={})),function(e){e.is=function(e){var t=e;return null!=t&&ue.string(t.href)}}(_||(_={})),function(e){e.create=function(e,t,n,r,o,i){var s={range:e,message:t};return ue.defined(n)&&(s.severity=n),ue.defined(r)&&(s.code=r),ue.defined(o)&&(s.source=o),ue.defined(i)&&(s.relatedInformation=i),s},e.is=function(e){var t,n=e;return ue.defined(n)&&s.is(n.range)&&ue.string(n.message)&&(ue.number(n.severity)||ue.undefined(n.severity))&&(ue.integer(n.code)||ue.string(n.code)||ue.undefined(n.code))&&(ue.undefined(n.codeDescription)||ue.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(ue.string(n.source)||ue.undefined(n.source))&&(ue.undefined(n.relatedInformation)||ue.typedArray(n.relatedInformation,f.is))}}(y||(y={})),function(e){e.create=function(e,t){for(var n=[],r=2;r0&&(o.arguments=n),o},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.title)&&ue.string(t.command)}}(v||(v={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return ue.objectLiteral(t)&&ue.string(t.newText)&&s.is(t.range)}}(b||(b={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return void 0!==t&&ue.objectLiteral(t)&&ue.string(t.label)&&(ue.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(ue.string(t.description)||void 0===t.description)}}(w||(w={})),function(e){e.is=function(e){return"string"==typeof e}}(x||(x={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return b.is(t)&&(w.is(t.annotationId)||x.is(t.annotationId))}}(T||(T={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return ue.defined(t)&&O.is(t.textDocument)&&Array.isArray(t.edits)}}(E||(E={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&ue.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||ue.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ue.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||x.is(t.annotationId))}}(C||(C={})),function(e){e.create=function(e,t,n,r){var o={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(o.options=n),void 0!==r&&(o.annotationId=r),o},e.is=function(e){var t=e;return t&&"rename"===t.kind&&ue.string(t.oldUri)&&ue.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||ue.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ue.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||x.is(t.annotationId))}}(S||(S={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&ue.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||ue.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||ue.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||x.is(t.annotationId))}}(k||(k={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return ue.string(e.kind)?C.is(e)||S.is(e)||k.is(e):E.is(e)})))}}(P||(P={}));var I,R,O,A,N,D,M,$,L,j,F,q,B,H,U,W,z,K,V,G,J,X,Q,Y,Z,ee,te,ne,re,oe,ie=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,o;if(void 0===n?r=b.insert(e,t):x.is(n)?(o=n,r=T.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),r=T.insert(e,t,o)),this.edits.push(r),void 0!==o)return o},e.prototype.replace=function(e,t,n){var r,o;if(void 0===n?r=b.replace(e,t):x.is(n)?(o=n,r=T.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),r=T.replace(e,t,o)),this.edits.push(r),void 0!==o)return o},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=b.del(e):x.is(t)?(r=t,n=T.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=T.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),se=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(x.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id "+n+" is already in use.");if(void 0===t)throw new Error("No annotation provided for id "+n);return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),ae=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new se(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(E.is(e)){var n=new ie(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new ie(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(O.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(n),r=new ie(o,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var o=[];this._workspaceEdit.changes[e]=o,r=new ie(o),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new se,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,o,i;if(w.is(t)||x.is(t)?r=t:n=t,void 0===r?o=C.create(e,n):(i=x.is(r)?r:this._changeAnnotations.manage(r),o=C.create(e,n,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var o,i,s;if(w.is(n)||x.is(n)?o=n:r=n,void 0===o?i=S.create(e,t,r):(s=x.is(o)?o:this._changeAnnotations.manage(o),i=S.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(i),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,o,i;if(w.is(t)||x.is(t)?r=t:n=t,void 0===r?o=k.create(e,n):(i=x.is(r)?r:this._changeAnnotations.manage(r),o=k.create(e,n,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)}}(I||(I={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)&&ue.integer(t.version)}}(R||(R={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)&&(null===t.version||ue.integer(t.version))}}(O||(O={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return ue.defined(t)&&ue.string(t.uri)&&ue.string(t.languageId)&&ue.integer(t.version)&&ue.string(t.text)}}(A||(A={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(N||(N={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(N||(N={})),function(e){e.is=function(e){var t=e;return ue.objectLiteral(e)&&N.is(t.kind)&&ue.string(t.value)}}(D||(D={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(M||(M={})),function(e){e.PlainText=1,e.Snippet=2}($||($={})),function(e){e.Deprecated=1}(L||(L={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&ue.string(t.newText)&&s.is(t.insert)&&s.is(t.replace)}}(j||(j={})),function(e){e.asIs=1,e.adjustIndentation=2}(F||(F={})),function(e){e.create=function(e){return{label:e}}}(q||(q={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(B||(B={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return ue.string(t)||ue.objectLiteral(t)&&ue.string(t.language)&&ue.string(t.value)}}(H||(H={})),function(e){e.is=function(e){var t=e;return!!t&&ue.objectLiteral(t)&&(D.is(t.contents)||H.is(t.contents)||ue.typedArray(t.contents,H.is))&&(void 0===e.range||s.is(e.range))}}(U||(U={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(W||(W={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;s--){var a=o[s],c=e.offsetAt(a.range.start),l=e.offsetAt(a.range.end);if(!(l<=i))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(l,r.length),i=c}return r}}(ce||(ce={}));var ue,de=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return i.create(0,e);for(;ne?r=o:n=o+1}var s=n-1;return i.create(s,e-t[s])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyFeature=void 0;const r=n(273);t.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>{this.connection.onRequest(r.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))},onIncomingCalls:e=>{const t=r.CallHierarchyIncomingCallsRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=r.CallHierarchyOutgoingCallsRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},2507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationFeature=void 0;const r=n(273),o=n(289);t.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?o.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(r.ConfigurationRequest.type,t).then((t=>Array.isArray(e)?t:t[0]))}}},828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileOperationsFeature=void 0;const r=n(273);t.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){this.connection.onNotification(r.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){this.connection.onNotification(r.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){this.connection.onNotification(r.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(r.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(r.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(r.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}}},2776:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeFeature=void 0;const r=n(273);t.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){this.connection.onRequest(r.LinkedEditingRangeRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))}}},8120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerFeature=void 0;const r=n(273);t.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=r.MonikerRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},2731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attachPartialResult=t.ProgressFeature=t.attachWorkDone=void 0;const r=n(273),o=n(7560);class i{constructor(e,t){this._connection=e,this._token=t,i.Instances.set(this._token,this)}begin(e,t,n,o){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:o};this._connection.sendProgress(r.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};"number"==typeof e?(n.percentage=e,void 0!==t&&(n.message=t)):n.message=e,this._connection.sendProgress(r.WorkDoneProgress.type,this._token,n)}done(){i.Instances.delete(this._token),this._connection.sendProgress(r.WorkDoneProgress.type,this._token,{kind:"end"})}}i.Instances=new Map;class s extends i{constructor(e,t){super(e,t),this._source=new r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class a{constructor(){}begin(){}report(){}done(){}}class c extends a{constructor(){super(),this._source=new r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var l;t.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new a;const n=t.workDoneToken;return delete t.workDoneToken,new i(e,n)},t.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){var t;!0===(null===(t=null==e?void 0:e.window)||void 0===t?void 0:t.workDoneProgress)&&(this._progressSupported=!0,this.connection.onNotification(r.WorkDoneProgressCancelNotification.type,(e=>{let t=i.Instances.get(e.token);(t instanceof s||t instanceof c)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new a:new i(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=o.generateUuid();return this.connection.sendRequest(r.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new s(this.connection,e)))}return Promise.resolve(new c)}},function(e){e.type=new r.ProgressType}(l||(l={}));class u{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(l.type,this._token,e)}}t.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new u(e,n)}},9817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensFeature=void 0;const r=n(273);t.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{on:e=>{const t=r.SemanticTokensRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=r.SemanticTokensDeltaRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=r.SemanticTokensRangeRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}},t.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,o){let i=e,s=t;this._dataLen>0&&(i-=this._prevLine,0===i&&(s-=this._prevChar)),this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return void 0!==this._prevData}buildEdits(){if(void 0!==this._prevData){const e=this._prevData.length,t=this._data.length;let n=0;for(;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=t.TextDocuments=void 0;const r=n(273),o=n(289),i=n(7560),s=n(2731),a=n(2507),c=n(7021),l=n(7985),u=n(9817),d=n(5421),p=n(828),h=n(2776),f=n(8120);function m(e){if(null!==e)return e}t.TextDocuments=class{constructor(e){this._documents=Object.create(null),this._configuration=e,this._onDidChangeContent=new r.Emitter,this._onDidOpen=new r.Emitter,this._onDidClose=new r.Emitter,this._onDidSave=new r.Emitter,this._onWillSave=new r.Emitter}get onDidChangeContent(){return this._onDidChangeContent.event}get onDidOpen(){return this._onDidOpen.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._documents[e]}all(){return Object.keys(this._documents).map((e=>this._documents[e]))}keys(){return Object.keys(this._documents)}listen(e){e.__textDocumentSync=r.TextDocumentSyncKind.Full,e.onDidOpenTextDocument((e=>{let t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._documents[t.uri]=n;let r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)})),e.onDidChangeTextDocument((e=>{let t=e.textDocument,n=e.contentChanges;if(0===n.length)return;let r=this._documents[t.uri];const{version:o}=t;if(null==o)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);r=this._configuration.update(r,n,o),this._documents[t.uri]=r,this._onDidChangeContent.fire(Object.freeze({document:r}))})),e.onDidCloseTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&(delete this._documents[e.textDocument.uri],this._onDidClose.fire(Object.freeze({document:t})))})),e.onWillSaveTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))})),e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._documents[e.textDocument.uri];return n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]})),e.onDidSaveTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&this._onDidSave.fire(Object.freeze({document:t}))}))}},t.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach((t=>{e.window.showErrorMessage(t)}))}};class g{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(r.MessageType.Error,e)}warn(e){this.send(r.MessageType.Warning,e)}info(e){this.send(r.MessageType.Info,e)}log(e){this.send(r.MessageType.Log,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(r.LogMessageNotification.type,{type:e,message:t})}}const _=d.ShowDocumentFeature(s.ProgressFeature(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let n={type:r.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}showWarningMessage(e,...t){let n={type:r.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}showInformationMessage(e,...t){let n={type:r.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}}));(t.BulkRegistration||(t.BulkRegistration={})).create=function(){return new y};class y{constructor(){this._registrations=[],this._registered=new Set}add(e,t){const n=o.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);const r=i.generateUuid();this._registrations.push({id:r,method:n,registerOptions:t||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}}(t.BulkUnregistration||(t.BulkUnregistration={})).create=function(){return new v(void 0,[])};class v{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach((e=>{this._unregistrations.set(e.method,e)}))}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let t={unregisterations:e};this._connection.sendRequest(r.UnregistrationRequest.type,t).then(void 0,(e=>{this._connection.console.info("Bulk unregistration failed.")}))}disposeSingle(e){const t=o.string(e)?e:e.method,n=this._unregistrations.get(t);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(r.UnregistrationRequest.type,i).then((()=>{this._unregistrations.delete(t)}),(e=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)})),!0}}class b{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof y?this.registerMany(e):e instanceof v?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,t,n){const s=o.string(t)?t:t.method,a=i.generateUuid();let c={registrations:[{id:a,method:s,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(r.RegistrationRequest.type,c).then((t=>(e.add({id:a,method:s}),e)),(e=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(e))))}registerSingle2(e,t){const n=o.string(e)?e:e.method,s=i.generateUuid();let a={registrations:[{id:s,method:n,registerOptions:t||{}}]};return this.connection.sendRequest(r.RegistrationRequest.type,a).then((e=>r.Disposable.create((()=>{this.unregisterSingle(s,n)}))),(e=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(e))))}unregisterSingle(e,t){let n={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(r.UnregistrationRequest.type,n).then(void 0,(t=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)}))}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(r.RegistrationRequest.type,t).then((()=>new v(this._connection,t.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const w=p.FileOperationsFeature(c.WorkspaceFoldersFeature(a.ConfigurationFeature(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){let t=(n=e)&&n.edit?e:{edit:e};var n;return this.connection.sendRequest(r.ApplyWorkspaceEditRequest.type,t)}})));class x{constructor(){this._trace=r.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==r.Trace.Off&&this.connection.sendNotification(r.LogTraceNotification.type,{message:e,verbose:this._trace===r.Trace.Verbose?t:void 0})}}class T{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(r.TelemetryEventNotification.type,e)}}class E{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return s.attachWorkDone(this.connection,e)}attachPartialResultProgress(e,t){return s.attachPartialResult(this.connection,t)}}t._LanguagesImpl=E;const C=f.MonikerFeature(h.LinkedEditingRangeFeature(u.SemanticTokensFeature(l.CallHierarchyFeature(E))));function S(e,t){return function(n){return t(e(n))}}function k(e,t){return function(n){return t(e(n))}}function P(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function R(e,t){return function(n){return t(e(n))}}function O(e,t){return function(n){return t(e(n))}}t.combineConsoleFeatures=S,t.combineTelemetryFeatures=k,t.combineTracerFeatures=P,t.combineClientFeatures=I,t.combineWindowFeatures=R,t.combineWorkspaceFeatures=O,t.combineLanguagesFeatures=function(e,t){return function(n){return t(e(n))}},t.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:"features",console:n(e.console,t.console,S),tracer:n(e.tracer,t.tracer,P),telemetry:n(e.telemetry,t.telemetry,k),client:n(e.client,t.client,I),window:n(e.window,t.window,R),workspace:n(e.workspace,t.workspace,O)}},t.createConnection=function(e,t,n){const i=n&&n.console?new(n.console(g)):new g,a=e(i);i.rawAttach(a);const c=n&&n.tracer?new(n.tracer(x)):new x,l=n&&n.telemetry?new(n.telemetry(T)):new T,u=n&&n.client?new(n.client(b)):new b,d=n&&n.window?new(n.window(_)):new _,p=n&&n.workspace?new(n.workspace(w)):new w,h=n&&n.languages?new(n.languages(C)):new C,f=[i,c,l,u,d,p,h];function m(e){return e instanceof Promise?e:o.thenable(e)?new Promise(((t,n)=>{e.then((e=>t(e)),(e=>n(e)))})):Promise.resolve(e)}let y,v,E,S={listen:()=>a.listen(),sendRequest:(e,...t)=>a.sendRequest(o.string(e)?e:e.method,...t),onRequest:(e,t)=>a.onRequest(e,t),sendNotification:(e,t)=>{const n=o.string(e)?e:e.method;1===arguments.length?a.sendNotification(n):a.sendNotification(n,t)},onNotification:(e,t)=>a.onNotification(e,t),onProgress:a.onProgress,sendProgress:a.sendProgress,onInitialize:e=>v=e,onInitialized:e=>a.onNotification(r.InitializedNotification.type,e),onShutdown:e=>y=e,onExit:e=>E=e,get console(){return i},get telemetry(){return l},get tracer(){return c},get client(){return u},get window(){return d},get workspace(){return p},get languages(){return h},onDidChangeConfiguration:e=>a.onNotification(r.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>a.onNotification(r.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>a.onNotification(r.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>a.onNotification(r.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>a.onNotification(r.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>a.onNotification(r.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>a.onRequest(r.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>a.onNotification(r.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>a.sendNotification(r.PublishDiagnosticsNotification.type,e),onHover:e=>a.onRequest(r.HoverRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onCompletion:e=>a.onRequest(r.CompletionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCompletionResolve:e=>a.onRequest(r.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(r.SignatureHelpRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDeclaration:e=>a.onRequest(r.DeclarationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDefinition:e=>a.onRequest(r.DefinitionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onTypeDefinition:e=>a.onRequest(r.TypeDefinitionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onImplementation:e=>a.onRequest(r.ImplementationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onReferences:e=>a.onRequest(r.ReferencesRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentHighlight:e=>a.onRequest(r.DocumentHighlightRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentSymbol:e=>a.onRequest(r.DocumentSymbolRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onWorkspaceSymbol:e=>a.onRequest(r.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeAction:e=>a.onRequest(r.CodeActionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeActionResolve:e=>a.onRequest(r.CodeActionResolveRequest.type,((t,n)=>e(t,n))),onCodeLens:e=>a.onRequest(r.CodeLensRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeLensResolve:e=>a.onRequest(r.CodeLensResolveRequest.type,((t,n)=>e(t,n))),onDocumentFormatting:e=>a.onRequest(r.DocumentFormattingRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(r.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDocumentOnTypeFormatting:e=>a.onRequest(r.DocumentOnTypeFormattingRequest.type,((t,n)=>e(t,n))),onRenameRequest:e=>a.onRequest(r.RenameRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onPrepareRename:e=>a.onRequest(r.PrepareRenameRequest.type,((t,n)=>e(t,n))),onDocumentLinks:e=>a.onRequest(r.DocumentLinkRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentLinkResolve:e=>a.onRequest(r.DocumentLinkResolveRequest.type,((t,n)=>e(t,n))),onDocumentColor:e=>a.onRequest(r.DocumentColorRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onColorPresentation:e=>a.onRequest(r.ColorPresentationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onFoldingRanges:e=>a.onRequest(r.FoldingRangeRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onSelectionRanges:e=>a.onRequest(r.SelectionRangeRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onExecuteCommand:e=>a.onRequest(r.ExecuteCommandRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),dispose:()=>a.dispose()};for(let e of f)e.attach(S);return a.onRequest(r.InitializeRequest.type,(e=>{t.initialize(e),o.string(e.trace)&&(c.trace=r.Trace.fromString(e.trace));for(let t of f)t.initialize(e.capabilities);if(v)return m(v(e,(new r.CancellationTokenSource).token,s.attachWorkDone(a,e),void 0)).then((e=>{if(e instanceof r.ResponseError)return e;let t=e;t||(t={capabilities:{}});let n=t.capabilities;n||(n={},t.capabilities=n),void 0===n.textDocumentSync||null===n.textDocumentSync?n.textDocumentSync=o.number(S.__textDocumentSync)?S.__textDocumentSync:r.TextDocumentSyncKind.None:o.number(n.textDocumentSync)||o.number(n.textDocumentSync.change)||(n.textDocumentSync.change=o.number(S.__textDocumentSync)?S.__textDocumentSync:r.TextDocumentSyncKind.None);for(let e of f)e.fillServerCapabilities(n);return t}));{let e={capabilities:{textDocumentSync:r.TextDocumentSyncKind.None}};for(let t of f)t.fillServerCapabilities(e.capabilities);return e}})),a.onRequest(r.ShutdownRequest.type,(()=>(t.shutdownReceived=!0,y?y((new r.CancellationTokenSource).token):void 0))),a.onNotification(r.ExitNotification.type,(()=>{try{E&&E()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}})),a.onNotification(r.SetTraceNotification.type,(e=>{c.trace=r.Trace.fromString(e.value)})),S}},5421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentFeature=void 0;const r=n(273);t.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(r.ShowDocumentRequest.type,e)}}},289:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return"function"==typeof e}function o(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.thenable=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=r,t.array=o,t.stringArray=function(e){return o(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.thenable=function(e){return e&&r(e.then)}},7560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateUuid=t.parse=t.isUUID=t.v4=t.empty=void 0;class n{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class r extends n{constructor(){super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}}function o(){return new r}r._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],r._timeHighBits=["8","9","a","b"],t.empty=new n("00000000-0000-0000-0000-000000000000"),t.v4=o;const i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function s(e){return i.test(e)}t.isUUID=s,t.parse=function(e){if(!s(e))throw new Error("invalid uuid");return new n(e)},t.generateUuid=function(){return o().asHex()}},7021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFoldersFeature=void 0;const r=n(273);t.WorkspaceFoldersFeature=e=>class extends e{initialize(e){let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new r.Emitter,this.connection.onNotification(r.DidChangeWorkspaceFoldersNotification.type,(e=>{this._onDidChangeWorkspaceFolders.fire(e.event)})))}getWorkspaceFolders(){return this.connection.sendRequest(r.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._unregistration||(this._unregistration=this.connection.client.register(r.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}}},7613:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveModulePath=t.FileSystem=t.resolveGlobalYarnPath=t.resolveGlobalNodePath=t.resolve=t.uriToFilePath=void 0;const r=n(7310),o=n(1017),i=n(7147),s=n(2081);function a(){return"win32"===process.platform}function c(e,t,n,r){const a=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise(((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach((e=>d[e]=u[e])),t&&i.existsSync(t)&&(d.NODE_PATH?d.NODE_PATH=t+o.delimiter+d.NODE_PATH:d.NODE_PATH=t,r&&r(`NODE_PATH value is: ${d.NODE_PATH}`)),d.ELECTRON_RUN_AS_NODE="1";try{let t=s.fork("",[],{cwd:n,env:d,execArgv:["-e",a]});if(void 0===t.pid)return void l(new Error(`Starting process to resolve node module ${e} failed`));t.on("error",(e=>{l(e)})),t.on("message",(n=>{"r"===n.c&&(t.send({c:"e"}),n.s?c(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let r={c:"rs",a:e};t.send(r)}catch(e){l(e)}}))}function l(e){let t="npm";const n=Object.create(null);Object.keys(process.env).forEach((e=>n[e]=process.env[e])),n.NO_UPDATE_NOTIFIER="true";const r={encoding:"utf8",env:n};a()&&(t="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let n=s.spawnSync(t,["config","get","prefix"],r).stdout;if(!n)return void(e&&e("'npm config get prefix' didn't return a value."));let c=n.trim();return e&&e(`'npm config get prefix' value is: ${c}`),c.length>0?a()?o.join(c,"node_modules"):o.join(c,"lib","node_modules"):void 0}catch(e){return}finally{process.removeListener("SIGPIPE",i)}}var u;t.uriToFilePath=function(e){let t=r.parse(e);if("file:"!==t.protocol||!t.path)return;let n=t.path.split("/");for(var i=0,s=n.length;i1){let e=n[0],t=n[1];0===e.length&&t.length>1&&":"===t[1]&&n.shift()}return o.normalize(n.join("/"))},t.resolve=c,t.resolveGlobalNodePath=l,t.resolveGlobalYarnPath=function(e){let t="yarn",n={encoding:"utf8"};a()&&(t="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=s.spawnSync(t,["global","dir","--json"],n),a=i.stdout;if(!a)return void(e&&(e("'yarn global dir' didn't return a value."),i.stderr&&e(i.stderr)));let c=a.trim().split(/\r?\n/);for(let e of c)try{let t=JSON.parse(e);if("log"===t.type)return o.join(t.data,"node_modules")}catch(e){}return}catch(e){return}finally{process.removeListener("SIGPIPE",r)}},function(e){let t;function n(){return void 0!==t||(t=!("win32"===process.platform||i.existsSync(__filename.toUpperCase())&&i.existsSync(__filename.toLowerCase()))),t}e.isCaseSensitive=n,e.isParent=function(e,t){return n()?0===o.normalize(t).indexOf(o.normalize(e)):0===o.normalize(t).toLowerCase().indexOf(o.normalize(e).toLowerCase())}}(u=t.FileSystem||(t.FileSystem={})),t.resolveModulePath=function(e,t,n,r){return n?(o.isAbsolute(n)||(n=o.join(e,n)),c(t,n,n,r).then((e=>u.isParent(n,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>c(t,l(r),e,r)))):c(t,l(r),e,r)}},5809:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const i=n(289),s=n(9891),a=n(7613),c=n(6560);var l;o(n(6560),t),o(n(6265),t),(l=t.Files||(t.Files={})).uriToFilePath=a.uriToFilePath,l.resolveGlobalNodePath=a.resolveGlobalNodePath,l.resolveGlobalYarnPath=a.resolveGlobalYarnPath,l.resolve=a.resolve,l.resolveModulePath=a.resolveModulePath;let u,d=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(u=setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(d?0:1)}}),3e3))}catch(e){}}for(let n=2;n{const t=e.processId;i.number(t)&&void 0===u&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(d?0:1)}}),3e3)},get shutdownReceived(){return d},set shutdownReceived(e){d=e},exit:e=>{process.exit(e)}};t.createConnection=function(e,t,n,r){let o,a,l,u;return void 0!==e&&"features"===e.__brand&&(o=e,e=t,t=n,n=r),c.ConnectionStrategy.is(e)||c.ConnectionOptions.is(e)?u=e:(a=e,l=t,u=n),function(e,t,n,r){if(!e&&!t&&process.argv.length>2){let n,r,i=process.argv.slice(2);for(let s=0;s{process.exit(d?0:1)})),t.on("close",(()=>{process.exit(d?0:1)}))}return s.createConnection((r=>c.createProtocolConnection(e,t,r,n)),p,r)}(a,l,u,o)}},7089:(e,t,n)=>{"use strict";e.exports=n(5809)},4086:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TextDocument:()=>o});class r{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(let t of e)if(r.isIncremental(t)){const e=a(t.range),n=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,n)+t.text+this._content.substring(r,this._content.length);const o=Math.max(e.start.line,0),i=Math.max(e.end.line,0);let c=this._lineOffsets;const l=s(t.text,!1,n);if(i-o===l.length)for(let e=0,t=l.length;ee?r=o:n=o+1}let o=n-1;return{line:o,character:e-t[o]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function c(e){const t=a(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,o){return new r(e,t,n,o)},e.update=function(e,t,n){if(e instanceof r)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){let n=e.getText(),r=i(t.map(c),((e,t)=>{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=0;const s=[];for(const t of r){let r=e.offsetAt(t.range.start);if(ro&&s.push(n.substring(o,r)),t.newText.length&&s.push(t.newText),o=e.offsetAt(t.range.end)}return s.push(n.substr(o)),s.join("")}}(o||(o={}))},9941:e=>{const t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,n="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new i}abort(){this.signal.dispatchEvent("abort")}},r="function"==typeof AbortSignal,o="function"==typeof n.AbortSignal,i=r?AbortSignal:o?n.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if("abort"===e){this.aborted=!0;const t={type:e,target:this};this.onabort(t),this._listeners.forEach((e=>e(t)),this)}}onabort(){}addEventListener(e,t){"abort"===e&&this._listeners.push(t)}removeEventListener(e,t){"abort"===e&&(this._listeners=this._listeners.filter((e=>e!==t)))}},s=new Set,a=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;u(n)&&d(n,`${e} option`,`options.${t}`,g)},c=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(u(n)){const{prototype:r}=g,{get:o}=Object.getOwnPropertyDescriptor(r,e);d(n,`${e} method`,`cache.${t}()`,o)}},l=(...e)=>{"object"==typeof process&&process&&"function"==typeof process.emitWarning?process.emitWarning(...e):console.error(...e)},u=e=>!s.has(e),d=(e,t,n,r)=>{s.add(e),l(`The ${t} is deprecated. Please use ${n} instead.`,"DeprecationWarning",e,r)},p=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),h=e=>p(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?f:null:null;class f extends Array{constructor(e){super(e),this.fill(0)}}class m{constructor(e){if(0===e)return[];const t=h(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class g{constructor(e={}){const{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:i,updateAgeOnHas:c,allowStale:d,dispose:f,disposeAfter:_,noDisposeOnSet:y,noUpdateTTL:v,maxSize:b=0,sizeCalculation:w,fetchMethod:x,fetchContext:T,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:C}=e,{length:S,maxAge:k,stale:P}=e instanceof g?{}:e;if(0!==t&&!p(t))throw new TypeError("max option must be a nonnegative integer");const I=t?h(t):Array;if(!I)throw new Error("invalid max value: "+t);if(this.max=t,this.maxSize=b,this.sizeCalculation=w||S,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=x||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=T,!this.fetchMethod&&void 0!==T)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(t).fill(null),this.valList=new Array(t).fill(null),this.next=new I(t),this.prev=new I(t),this.head=0,this.tail=0,this.free=new m(t),this.initialFill=1,this.size=0,"function"==typeof f&&(this.dispose=f),"function"==typeof _?(this.disposeAfter=_,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!E,0!==this.maxSize){if(!p(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!d||!!P,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!c,this.ttlResolution=p(r)||0===r?r:1,this.ttlAutopurge=!!o,this.ttl=n||k||0,this.ttl){if(!p(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const e="LRU_CACHE_UNBOUNDED";u(e)&&(s.add(e),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,g))}P&&a("stale","allowStale"),k&&a("maxAge","ttl"),S&&a("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new f(this.max),this.starts=new f(this.max),this.setItemTTL=(e,n,r=t.now())=>{if(this.starts[e]=0!==n?r:0,this.ttls[e]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.isStale(e)&&this.delete(this.keyList[e])}),n+1);t.unref&&t.unref()}},this.updateItemAge=e=>{this.starts[e]=0!==this.ttls[e]?t.now():0};let e=0;const n=()=>{const n=t.now();if(this.ttlResolution>0){e=n;const t=setTimeout((()=>e=0),this.ttlResolution);t.unref&&t.unref()}return n};this.getRemainingTTL=t=>{const r=this.keyMap.get(t);return void 0===r?0:0===this.ttls[r]||0===this.starts[r]?1/0:this.starts[r]+this.ttls[r]-(e||n())},this.isStale=t=>0!==this.ttls[t]&&0!==this.starts[t]&&(e||n())-this.starts[t]>this.ttls[t]}updateItemAge(e){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new f(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(!p(n)){if(!r)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!p(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.addItemSize=(e,t)=>{this.sizes[e]=t;const n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.head);)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.tail);)t=this.next[t]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(const e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(const e of this.indexes())yield this.keyList[e]}*rkeys(){for(const e of this.rindexes())yield this.keyList[e]}*values(){for(const e of this.indexes())yield this.valList[e]}*rvalues(){for(const e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],t)}forEach(e,t=this){for(const n of this.indexes())e.call(t,this.valList[n],this.keyList[n],this)}rforEach(e,t=this){for(const n of this.rindexes())e.call(t,this.valList[n],this.keyList[n],this)}get prune(){return c("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){const e=[];for(const n of this.indexes({allowStale:!0})){const r=this.keyList[n],o=this.valList[n],i={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){i.ttl=this.ttls[n];const e=t.now()-this.starts[n];i.start=Math.floor(Date.now()-e)}this.sizes&&(i.size=this.sizes[n]),e.unshift([r,i])}return e}load(e){this.clear();for(const[n,r]of e){if(r.start){const e=Date.now()-r.start;r.start=t.now()-e}this.set(n,r.value,r)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,size:i=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){if(i=this.requireSize(e,t,i,s),this.maxSize&&i>this.maxSize)return this;let c=0===this.size?void 0:this.keyMap.get(e);if(void 0===c)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=t,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,i),a=!1;else{const n=this.valList[c];t!==n&&(this.isBackgroundFetch(n)?n.__abortController.abort():o||(this.dispose(n,e,"set"),this.disposeAfter&&this.disposed.push([n,e,"set"])),this.removeItemSize(c),this.valList[c]=t,this.addItemSize(c,i)),this.moveToTail(c)}if(0===n||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(c,n,r),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort():(this.dispose(r,n,"evict"),this.disposeAfter&&this.disposed.push([r,n,"evict"])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas}={}){const n=this.keyMap.get(e);return void 0!==n&&!this.isStale(n)&&(t&&this.updateItemAge(n),!0)}peek(e,{allowStale:t=this.allowStale}={}){const n=this.keyMap.get(e);if(void 0!==n&&(t||!this.isStale(n))){const e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,r,o){const i=void 0===t?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;const s=new n,a={signal:s.signal,options:r,context:o},c=new Promise((t=>t(this.fetchMethod(e,i,a)))).then((t=>(s.signal.aborted||this.set(e,t,a.options),t)),(n=>{if(this.valList[t]===c&&(r.noDeleteOnFetchRejection&&void 0!==c.__staleWhileFetching?this.valList[t]=c.__staleWhileFetching:this.delete(e)),c.__returned===c)throw n}));return c.__abortController=s,c.__staleWhileFetching=i,c.__returned=null,void 0===t?(this.set(e,c,a.options),t=this.keyMap.get(e)):this.valList[t]=c,c}isBackgroundFetch(e){return e&&"object"==typeof e&&"function"==typeof e.then&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||null===e.__returned)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,fetchContext:u=this.fetchContext,forceRefresh:d=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r});const p={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:i,size:s,sizeCalculation:a,noUpdateTTL:c,noDeleteOnFetchRejection:l};let h=this.keyMap.get(e);if(void 0===h){const t=this.backgroundFetch(e,h,p,u);return t.__returned=t}{const r=this.valList[h];if(this.isBackgroundFetch(r))return t&&void 0!==r.__staleWhileFetching?r.__staleWhileFetching:r.__returned=r;if(!d&&!this.isStale(h))return this.moveToTail(h),n&&this.updateItemAge(h),r;const o=this.backgroundFetch(e,h,p,u);return t&&void 0!==o.__staleWhileFetching?o.__staleWhileFetching:o.__returned=o}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet}={}){const o=this.keyMap.get(e);if(void 0!==o){const i=this.valList[o],s=this.isBackgroundFetch(i);if(this.isStale(o))return s?t?i.__staleWhileFetching:void 0:(r||this.delete(e),t?i:void 0);if(s)return;return this.moveToTail(o),n&&this.updateItemAge(o),i}}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return c("del","delete"),this.delete}delete(e){let t=!1;if(0!==this.size){const n=this.keyMap.get(e);if(void 0!==n)if(t=!0,1===this.size)this.clear();else{this.removeItemSize(n);const t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort():(this.dispose(t,e,"delete"),this.disposeAfter&&this.disposed.push([t,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(const e of this.rindexes({allowStale:!0})){const t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort();else{const n=this.keyList[e];this.dispose(t,n,"delete"),this.disposeAfter&&this.disposed.push([t,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return c("reset","clear"),this.clear}get length(){return((e,t)=>{const n="LRU_CACHE_PROPERTY_length";if(u(n)){const{prototype:t}=g,{get:r}=Object.getOwnPropertyDescriptor(t,e);d(n,"length property","cache.size",r)}})("length"),this.size}static get AbortController(){return n}static get AbortSignal(){return i}}e.exports=g},6029:(e,t,n)=>{"use strict";const{randomBytes:r}=n(6113),{Readable:o}=n(2781),i=e=>"object"==typeof e&&0===["arrayBuffer","stream","text","slice","constructor"].map((t=>typeof e[t])).filter((e=>"function"!==e)).length&&"string"==typeof e.type&&"number"==typeof e.size&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),s=e=>`--${e}--\r\n\r\n`,a=(e,t,n)=>{let r="";return r+=`--${e}\r\n`,r+=`Content-Disposition: form-data; name="${t}"`,i(n)&&(r+=`; filename="${n.name}"\r\n`,r+=`Content-Type: ${n.type||"application/octet-stream"}`),`${r}\r\n\r\n`};e.exports={isFormData:e=>null!=e&&"object"==typeof e&&0===["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map((t=>typeof e[t])).filter((e=>"function"!==e)).length&&"FormData"===e[Symbol.toStringTag],FormDataSerializer:class{constructor(e){this.fd=e,this.boundary=r(8).toString("hex")}length(){return void 0===this._length&&(this._length=((e,t)=>{let n=0;for(const[r,o]of e)n+=Buffer.byteLength(a(t,r,o)),n+=i(o)?o.size:Buffer.byteLength(String(o)),n+=Buffer.byteLength("\r\n");return n+=Buffer.byteLength(s(t)),n})(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return o.from(async function*(e,t){for(const[n,r]of e)yield a(t,n,r),i(r)?yield*r.stream():yield r,yield"\r\n";yield s(t)}(this.fd,this.boundary))}}}},5591:(e,t,n)=>{"use strict";const{constants:{MAX_LENGTH:r}}=n(4300),{pipeline:o,PassThrough:i}=n(2781),{promisify:s}=n(3837),{createGunzip:a,createInflate:c,createBrotliDecompress:l,constants:{Z_SYNC_FLUSH:u}}=n(9796),d=n(1241)("helix-fetch:utils"),p=s(o),h=(e,t)=>{if(Buffer.isBuffer(e))return e.length;switch(typeof e){case"string":return 2*e.length;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(e)?2*Symbol.keyFor(e).length:2*(e.toString().length-8);case"object":return Array.isArray(e)?f(e,t):m(e,t);default:return 0}},f=(e,t)=>(t.add(e),e.map((e=>t.has(e)?0:h(e,t))).reduce(((e,t)=>e+t),0)),m=(e,t)=>{if(null==e)return 0;t.add(e);let n=0;const r=[];for(const t in e)r.push(t);return r.push(...Object.getOwnPropertySymbols(e)),r.forEach((r=>{if(n+=h(r,t),"object"==typeof e[r]&&null!==e[r]){if(t.has(e[r]))return;t.add(e[r])}n+=h(e[r],t)})),n};e.exports={decodeStream:(e,t,n,r)=>{if(!((e,t)=>204!==e&&304!==e&&0!=+t["content-length"]&&/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(t["content-encoding"]))(e,t))return n;const i=e=>{e&&(d(`encountered error while decoding stream: ${e}`),r(e))};switch(t["content-encoding"].trim()){case"gzip":case"x-gzip":return o(n,a({flush:u,finishFlush:u}),i);case"deflate":case"x-deflate":return o(n,c(),i);case"br":return o(n,l(),i);default:return n}},isPlainObject:e=>{if(!e||"object"!=typeof e)return!1;if("[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},sizeof:e=>h(e,new WeakSet),streamToBuffer:async e=>{const t=new i;let n=0;const o=[];return t.on("data",(e=>{if(n+e.length>r)throw new Error("Buffer.constants.MAX_SIZE exceeded");o.push(e),n+=e.length})),await p(e,t),Buffer.concat(o,n)}}},5899:e=>{"use strict";class t extends Error{get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={RequestAbortedError:t}},4751:(e,t,n)=>{"use strict";const r=n(3685),o=n(5687),{Readable:i}=n(2781),s=n(1241)("helix-fetch:h1"),{RequestAbortedError:a}=n(5899),{decodeStream:c}=n(5591);e.exports={request:async(e,t,n)=>{const{request:l}="https:"===t.protocol?o:r,u=((e,t)=>{const{h1:n,options:{h1:i,rejectUnauthorized:s}}=e;return"https:"===t?n.httpsAgent?n.httpsAgent:i||"boolean"==typeof s?(n.httpsAgent=new o.Agent("boolean"==typeof s?{...i||{},rejectUnauthorized:s}:i),n.httpsAgent):void 0:n.httpAgent?n.httpAgent:i?(n.httpAgent=new r.Agent(i),n.httpAgent):void 0})(e,t.protocol),d={...n,agent:u},{socket:p,body:h}=d;return p&&(delete d.socket,p.assigned||(p.assigned=!0,u?d.agent=new Proxy(u,{get:(e,t)=>"createConnection"!==t||p.inUse?e[t]:(e,t)=>{s(`agent reusing socket #${p.id} (${p.servername})`),p.inUse=!0,t(null,p)}}):d.createConnection=(e,t)=>{s(`reusing socket #${p.id} (${p.servername})`),p.inUse=!0,t(null,p)})),new Promise(((e,n)=>{let r;s(`${d.method} ${t.href}`);const{signal:o}=d,u=()=>{o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),n(new a),r&&r.abort()};if(o){if(o.aborted)return void n(new a);o.addEventListener("abort",u)}r=l(t,d),r.once("response",(t=>{o&&o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),e(((e,t,n)=>{const{statusCode:r,statusMessage:o,httpVersion:i,httpVersionMajor:s,httpVersionMinor:a,headers:l}=e,u=t?c(r,l,e,n):e;return{statusCode:r,statusText:o,httpVersion:i,httpVersionMajor:s,httpVersionMinor:a,headers:l,readable:u,decoded:!(!t||u===e)}})(t,d.decode,n))})),r.once("error",(e=>{o&&o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),r.aborted||(s(`${d.method} ${t.href} failed with: ${e.message}`),r.abort(),n(e))})),h instanceof i?h.pipe(r):(h&&r.write(h),r.end())}))},setupContext:e=>{e.h1={}},resetContext:async({h1:e})=>{e.httpAgent&&(s("resetContext: destroying httpAgent"),e.httpAgent.destroy(),delete e.httpAgent),e.httpsAgent&&(s("resetContext: destroying httpsAgent"),e.httpsAgent.destroy(),delete e.httpsAgent)}}},7652:(e,t,n)=>{"use strict";const{connect:r,constants:o}=n(5158),{Readable:i}=n(2781),s=n(1241)("helix-fetch:h2"),{RequestAbortedError:a}=n(5899),{decodeStream:c}=n(5591),{NGHTTP2_CANCEL:l}=o,u=3e5,d=5e3,p=(e,t,n,r=(()=>{}))=>{const o={...e},i=o[":status"];delete o[":status"];const s=n?c(i,e,t,r):t;return{statusCode:i,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:s,decoded:!(!n||s===t)}};e.exports={request:async(e,t,n)=>{const{origin:o,pathname:c,search:h,hash:f}=t,m=`${c}${h}${f}`,{options:{h2:g={}},h2:{sessionCache:_}}=e,{idleSessionTimeout:y=u,pushPromiseHandler:v,pushHandler:b}=g,w={...n},{method:x,headers:T,socket:E,body:C,decode:S}=w;return E&&delete w.socket,T.host&&(T[":authority"]=T.host,delete T.host),new Promise(((n,c)=>{let u,h=_[o];if(!h||h.closed||h.destroyed){const t=!(!1===e.options.rejectUnauthorized||!1===g.rejectUnauthorized),n={...g,rejectUnauthorized:t};E&&!E.inUse&&(n.createConnection=()=>(s(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E));const i=!(!v&&!b);h=r(o,{...n,settings:{enablePush:i}}),h.setMaxListeners(1e3),h.setTimeout(y,(()=>{s(`closing session ${o} after ${y} ms of inactivity`),h.close()})),h.once("connect",(()=>{s(`session ${o} established`),s(`caching session ${o}`),_[o]=h})),h.on("localSettings",(e=>{s(`session ${o} localSettings: ${JSON.stringify(e)}`)})),h.on("remoteSettings",(e=>{s(`session ${o} remoteSettings: ${JSON.stringify(e)}`)})),h.once("close",(()=>{s(`session ${o} closed`),_[o]===h&&(s(`discarding cached session ${o}`),delete _[o])})),h.once("error",(e=>{s(`session ${o} encountered error: ${e}`),_[o]===h&&(s(`discarding cached session ${o}`),delete _[o])})),h.on("frameError",((e,t,n)=>{s(`session ${o} encountered frameError: type: ${e}, code: ${t}, id: ${n}`)})),h.once("goaway",((e,t,n)=>{s(`session ${o} received GOAWAY frame: errorCode: ${e}, lastStreamID: ${t}, opaqueData: ${n?n.toString():void 0}`)})),h.on("stream",((t,n,r)=>{((e,t,n,r,o,i)=>{const{options:{h2:{pushPromiseHandler:a,pushHandler:c,pushedStreamIdleTimeout:u=d}}}=e,h=o[":path"],f=`${t}${h}`;s(`received PUSH_PROMISE: ${f}, stream #${r.id}, headers: ${JSON.stringify(o)}, flags: ${i}`),a&&a(f,o,(()=>{r.close(l)})),r.on("push",((e,i)=>{s(`received push headers for ${t}${h}, stream #${r.id}, headers: ${JSON.stringify(e)}, flags: ${i}`),r.setTimeout(u,(()=>{s(`closing pushed stream #${r.id} after ${u} ms of inactivity`),r.close(l)})),c&&c(f,o,p(e,r,n))})),r.on("aborted",(()=>{s(`pushed stream #${r.id} aborted`)})),r.on("error",(e=>{s(`pushed stream #${r.id} encountered error: ${e}`)})),r.on("frameError",((e,t,n)=>{s(`pushed stream #${r.id} encountered frameError: type: ${e}, code: ${t}, id: ${n}`)}))})(e,o,S,t,n,r)}))}else E&&E.id!==h.socket.id&&!E.inUse&&(s(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());s(`${x} ${t.host}${m}`);const{signal:f}=w,k=()=>{f.removeEventListener("abort",k),c(new a),u&&u.close(l)};if(f){if(f.aborted)return void c(new a);f.addEventListener("abort",k)}const P=e=>{s(`session ${o} encountered error during ${w.method} ${t.href}: ${e}`),c(e)};h.once("error",P),u=h.request({":method":x,":path":m,...T}),u.once("response",(e=>{h.off("error",P),f&&f.removeEventListener("abort",k),n(p(e,u,w.decode,c))})),u.once("error",(e=>{h.off("error",P),f&&f.removeEventListener("abort",k),u.rstCode!==l&&(s(`${w.method} ${t.href} failed with: ${e.message}`),u.close(l),c(e))})),u.once("frameError",((e,n,r)=>{h.off("error",P),s(`encountered frameError during ${w.method} ${t.href}: type: ${e}, code: ${n}, id: ${r}`)})),u.on("push",((e,t)=>{s(`received 'push' event: headers: ${JSON.stringify(e)}, flags: ${t}`)})),C instanceof i?C.pipe(u):(C&&u.write(C),u.end())}))},setupContext:e=>{e.h2={sessionCache:{}}},resetContext:async({h2:e})=>Promise.all(Object.values(e.sessionCache).map((e=>new Promise((t=>{e.on("close",t),s(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()})))))}},4673:(e,t,n)=>{"use strict";const r=n(1241)("helix-fetch:core"),{request:o,setupContext:i,resetContext:s,RequestAbortedError:a,ALPN_HTTP2:c,ALPN_HTTP2C:l,ALPN_HTTP1_1:u,ALPN_HTTP1_0:d}=n(6633);class p{constructor(e){this.options={...e||{}},i(this)}api(){return{request:async(e,t)=>this.request(e,t),context:(e={})=>new p(e).api(),reset:async()=>this.reset(),RequestAbortedError:a,ALPN_HTTP2:c,ALPN_HTTP2C:l,ALPN_HTTP1_1:u,ALPN_HTTP1_0:d}}async request(e,t){return o(this,e,t)}async reset(){return r("resetting context"),s(this)}}e.exports=(new p).api()},3430:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361);e.exports=()=>{const e={},t=new r;return t.setMaxListeners(0),{acquire:n=>new Promise((r=>{if(!e[n])return e[n]=!0,void r();const o=i=>{e[n]||(e[n]=!0,t.removeListener(n,o),r(i))};t.on(n,o)})),release:(n,r)=>{Reflect.deleteProperty(e,n),setImmediate((()=>t.emit(n,r)))}}}},6633:(e,t,n)=>{"use strict";const{Readable:r}=n(2781),o=n(4404),{types:{isAnyArrayBuffer:i}}=n(3837),s=n(9941),a=n(1241)("helix-fetch:core"),{RequestAbortedError:c}=n(5899),l=n(4751),u=n(7652),d=n(3430),{isPlainObject:p}=n(5591),{isFormData:h,FormDataSerializer:f}=n(6029),{version:m}=n(3180),g="h2",_="h2c",y="http/1.0",v="http/1.1",b=100,w=36e5,x=[g,v,y],T=`helix-fetch/${m}`,E={method:"GET",compress:!0,decode:!0};let C=0;const S=d(),k=(e,t)=>new Promise(((n,r)=>{const{signal:i}=t;let s;const l=()=>{i.removeEventListener("abort",l);const e=new c;r(e),s&&s.destroy(e)};if(i){if(i.aborted)return void r(new c);i.addEventListener("abort",l)}const u=+e.port||443,d=t=>{i&&i.removeEventListener("abort",l),t instanceof c||(a(`connecting to ${e.hostname}:${u} failed with: ${t.message}`),r(t))};s=o.connect(u,e.hostname,t),s.once("secureConnect",(()=>{i&&i.removeEventListener("abort",l),s.off("error",d),C+=1,s.id=C,s.secureConnecting=!1,a(`established TLS connection: #${s.id} (${s.servername})`),n(s)})),s.once("error",d)}));e.exports={request:async(e,t,n)=>{const o=new URL(t),s={...E,...n||{}};let c;if("string"==typeof s.method&&(s.method=s.method.toUpperCase()),s.headers=(e=>{const t={};return Object.keys(e).forEach((n=>{t[n.toLowerCase()]=e[n]})),t})(s.headers||{}),void 0===s.headers.host&&(s.headers.host=o.host),e.userAgent&&void 0===s.headers["user-agent"]&&(s.headers["user-agent"]=e.userAgent),s.body instanceof URLSearchParams)c="application/x-www-form-urlencoded; charset=utf-8",s.body=s.body.toString();else if(h(s.body)){const e=new f(s.body);c=e.contentType(),s.body=e.stream(),void 0===s.headers["transfer-encoding"]&&void 0===s.headers["content-length"]&&(s.headers["content-length"]=String(e.length()))}else"string"==typeof s.body||s.body instanceof String?c="text/plain; charset=utf-8":p(s.body)?(s.body=JSON.stringify(s.body),c="application/json"):i(s.body)&&(s.body=Buffer.from(s.body));void 0===s.headers["content-type"]&&void 0!==c&&(s.headers["content-type"]=c),null!=s.body&&(s.body instanceof r||("string"==typeof s.body||s.body instanceof String||Buffer.isBuffer(s.body)||(s.body=String(s.body)),void 0===s.headers["transfer-encoding"]&&void 0===s.headers["content-length"]&&(s.headers["content-length"]=String(Buffer.isBuffer(s.body)?s.body.length:Buffer.byteLength(s.body,"utf-8"))))),void 0===s.headers.accept&&(s.headers.accept="*/*"),null==s.body&&["POST","PUT"].includes(s.method)&&(s.headers["content-length"]="0"),s.compress&&void 0===s.headers["accept-encoding"]&&(s.headers["accept-encoding"]="gzip,deflate,br");const{signal:d}=s,{protocol:m,socket:b=null}=e.socketFactory?await(async(e,t,n,r)=>{const o="https:"===t.protocol;let i;i=t.port?t.port:o?443:80;const s={...n,host:t.host,port:i},a=await e(s);if(o){const e={...s,ALPNProtocols:r};e.socket=a;const n=await k(t,e);return{protocol:n.alpnProtocol||v,socket:n}}return{protocol:a.alpnProtocol||v,socket:a}})(e.socketFactory,o,s,e.alpnProtocols):await(async(e,t,n)=>{const r=`${t.protocol}//${t.host}`;let o=e.alpnCache.get(r);if(o)return{protocol:o};switch(t.protocol){case"http:":return o=v,e.alpnCache.set(r,o),{protocol:o};case"http2:":return o=_,e.alpnCache.set(r,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${t.protocol}`)}const{options:{rejectUnauthorized:i,h1:s={},h2:a={}}}=e,c=!(!1===i||!1===s.rejectUnauthorized||!1===a.rejectUnauthorized),l={servername:t.hostname,ALPNProtocols:e.alpnProtocols,signal:n,rejectUnauthorized:c},u=await(async(e,t)=>{let n=await S.acquire(e.origin);try{return n||(n=await k(e,t)),n}finally{S.release(e.origin,n)}})(t,l);return o=u.alpnProtocol,o||(o=v),e.alpnCache.set(r,o),{protocol:o,socket:u}})(e,o,d);switch(a(`${o.host} -> ${m}`),m){case g:try{return await u.request(e,o,b?{...s,socket:b}:s)}catch(t){const{code:n,message:r}=t;throw"ERR_HTTP2_ERROR"===n&&"Protocol error"===r&&e.alpnCache.delete(`${o.protocol}//${o.host}`),t}case _:return u.request(e,new URL(`http://${o.host}${o.pathname}${o.hash}${o.search}`),b?{...s,socket:b}:s);case y:case v:return l.request(e,o,b?{...s,socket:b}:s);default:throw new TypeError(`unsupported protocol: ${m}`)}},setupContext:e=>{const{options:{alpnProtocols:t=x,alpnCacheTTL:n=w,alpnCacheSize:r=b,userAgent:o=T,socketFactory:i}}=e;e.alpnProtocols=t,e.alpnCache=new s({max:r,ttl:n}),e.userAgent=o,e.socketFactory=i,l.setupContext(e),u.setupContext(e)},resetContext:async e=>(e.alpnCache.clear(),Promise.all([l.resetContext(e),u.resetContext(e)])),RequestAbortedError:c,ALPN_HTTP2:g,ALPN_HTTP2C:_,ALPN_HTTP1_1:v,ALPN_HTTP1_0:y}},4346:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361),o=Symbol("AbortSignal internals");class i{constructor(){this[o]={eventEmitter:new r,onabort:null,aborted:!1}}get aborted(){return this[o].aborted}get onabort(){return this[o].onabort}set onabort(e){this[o].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,t){this[o].eventEmitter.removeListener(e,t)}addEventListener(e,t){this[o].eventEmitter.on(e,t)}dispatchEvent(e){const t={type:e,target:this},n=`on${e}`;"function"==typeof this[o][n]&&this[n](t),this[o].eventEmitter.emit(e,t)}fire(){this[o].aborted=!0,this.dispatchEvent("abort")}}Object.defineProperties(i.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});class s extends i{constructor(e){if(!Number.isInteger(e))throw new TypeError("Expected an integer, got "+typeof e);super(),this[o].timerId=setTimeout((()=>{this.fire()}),e)}clear(){clearTimeout(this[o].timerId)}}Object.defineProperties(s.prototype,{clear:{enumerable:!0}});const a=Symbol("AbortController internals");class c{constructor(){this[a]={signal:new i}}get signal(){return this[a].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[a].signal.aborted||this[a].signal.fire()}}Object.defineProperties(c.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),e.exports={AbortController:c,AbortSignal:i,TimeoutSignal:s}},4214:(e,t,n)=>{"use strict";const{PassThrough:r,Readable:o}=n(2781),{types:{isAnyArrayBuffer:i}}=n(3837),{FetchError:s,FetchBaseError:a}=n(2501),{streamToBuffer:c}=n(5591),l=Buffer.alloc(0),u=Symbol("Body internals"),d=async e=>{if(e[u].disturbed)throw new TypeError("Already read");if(e[u].error)throw new TypeError(`Stream had error: ${e[u].error.message}`);e[u].disturbed=!0;const{stream:t}=e[u];return null===t?l:c(t)};class p{constructor(e){let t;t=null==e?null:e instanceof URLSearchParams?o.from(e.toString()):e instanceof o?e:Buffer.isBuffer(e)?o.from(e):i(e)?o.from(Buffer.from(e)):"string"==typeof e||e instanceof String?o.from(e):o.from(String(e)),this[u]={stream:t,disturbed:!1,error:null},e instanceof o&&t.on("error",(e=>{const t=e instanceof a?e:new s(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,"system",e);this[u].error=t}))}get body(){return this[u].stream}get bodyUsed(){return this[u].disturbed}async buffer(){return d(this)}async arrayBuffer(){return(e=await this.buffer()).buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);var e}async text(){return(await d(this)).toString()}async json(){return JSON.parse(await this.text())}}Object.defineProperties(p.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),e.exports={Body:p,cloneStream:e=>{if(e[u].disturbed)throw new TypeError("Cannot clone: already read");const{stream:t}=e[u];let n=t;if(t instanceof o){n=new r;const o=new r;t.pipe(n),t.pipe(o),e[u].stream=o}return n},guessContentType:e=>null===e?null:"string"==typeof e?"text/plain; charset=utf-8":e instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(e)||i(e)||e instanceof o?null:"text/plain; charset=utf-8"}},8941:(e,t,n)=>{"use strict";const{Readable:r}=n(2781),{Headers:o}=n(8226),{Response:i}=n(8327),s=Symbol("CacheableResponse internals");class a extends i{constructor(e,t){super(e,t);const n=new o(t.headers);this[s]={headers:n,bufferedBody:e}}get headers(){return this[s].headers}set headers(e){if(!(e instanceof o))throw new TypeError("instance of Headers expected");this[s].headers=e}get body(){return r.from(this[s].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[s].bufferedBody}async arrayBuffer(){return(e=this[s].bufferedBody).buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);var e}async text(){return this[s].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){const{url:e,status:t,statusText:n,headers:r,httpVersion:o,decoded:i,counter:c}=this;return new a(this[s].bufferedBody,{url:e,status:t,statusText:n,headers:r,httpVersion:o,decoded:i,counter:c})}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={cacheableResponse:async e=>{const t=await e.buffer(),{url:n,status:r,statusText:o,headers:i,httpVersion:s,decoded:c,counter:l}=e;return new a(t,{url:n,status:r,statusText:o,headers:i,httpVersion:s,decoded:c,counter:l})}}},2501:e=>{"use strict";class t extends Error{constructor(e,t){super(e),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={FetchBaseError:t,FetchError:class extends t{constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}},AbortError:class extends t{constructor(e,t="aborted"){super(e,t)}}}},8226:(e,t,n)=>{"use strict";const{validateHeaderName:r,validateHeaderValue:o}=n(3685),{isPlainObject:i}=n(5591),s=Symbol("Headers internals"),a=e=>{const t="string"!=typeof e?String(e):e;if("function"==typeof r)r(t);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){const e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}return t.toLowerCase()},c=(e,t)=>{const n="string"!=typeof e?String(e):e;if("function"==typeof o)o(t,n);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(n)){const e=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_CHAR"}),e}return n};class l{constructor(e={}){if(this[s]={map:new Map},e instanceof l)e.forEach(((e,t)=>{this.append(t,e)}));else if(Array.isArray(e))e.forEach((([e,t])=>{this.append(e,t)}));else if(i(e))for(const[t,n]of Object.entries(e))this.append(t,n)}set(e,t){this[s].map.set(a(e),c(t,e))}has(e){return this[s].map.has(a(e))}get(e){const t=this[s].map.get(a(e));return void 0===t?null:t}append(e,t){const n=a(e),r=c(t,e),o=this[s].map.get(n);this[s].map.set(n,o?`${o}, ${r}`:r)}delete(e){this[s].map.delete(a(e))}forEach(e,t){for(const n of this.keys())e.call(t,this.get(n),n)}keys(){return Array.from(this[s].map.keys()).sort()}*values(){for(const e of this.keys())yield this.get(e)}*entries(){for(const e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[s].map)}}Object.defineProperties(l.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce(((e,t)=>(e[t]={enumerable:!0},e)),{})),e.exports={Headers:l}},4735:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361),{Readable:o}=n(2781),i=n(1241)("helix-fetch"),s=n(9941),{Body:a}=n(4214),{Headers:c}=n(8226),{Request:l}=n(3505),{Response:u}=n(8327),{FetchBaseError:d,FetchError:p,AbortError:h}=n(2501),{AbortController:f,AbortSignal:m,TimeoutSignal:g}=n(4346),_=n(7619),{cacheableResponse:y}=n(8941),{sizeof:v}=n(5591),{isFormData:b}=n(6029),{context:w,RequestAbortedError:x}=n(4673),T=["GET","HEAD"],E="push",C=async(e,t,n)=>{const{request:r}=e.context,i=t instanceof l&&void 0===n?t:new l(t,n),{method:s,body:a,signal:d,compress:f,decode:m,follow:g,redirect:_,init:{body:y}}=i;let v;if(d&&d.aborted){const e=new h("The operation was aborted.");throw i.init.body instanceof o&&i.init.body.destroy(e),e}try{v=await r(i.url,{...n,method:s,headers:i.headers.plain(),body:!y||y instanceof o||b(y)?a:y,compress:f,decode:m,follow:g,redirect:_,signal:d})}catch(e){if(y instanceof o&&y.destroy(e),e instanceof TypeError)throw e;if(e instanceof x)throw new h("The operation was aborted.");throw new p(e.message,"system",e)}const w=()=>{d.removeEventListener("abort",w);const e=new h("The operation was aborted.");i.init.body instanceof o&&i.init.body.destroy(e),v.readable.emit("error",e)};d&&d.addEventListener("abort",w);const{statusCode:T,statusText:E,httpVersion:S,headers:k,readable:P,decoded:I}=v;if([301,302,303,307,308].includes(T)){const{location:t}=k,n=null==t?null:new URL(t,i.url);switch(i.redirect){case"manual":break;case"error":throw d&&d.removeEventListener("abort",w),new p(`uri requested responds with a redirect, redirect mode is set to 'error': ${i.url}`,"no-redirect");case"follow":{if(null===n)break;if(i.counter>=i.follow)throw d&&d.removeEventListener("abort",w),new p(`maximum redirect reached at: ${i.url}`,"max-redirect");const t={headers:new c(i.headers),follow:i.follow,compress:i.compress,decode:i.decode,counter:i.counter+1,method:i.method,body:i.body,signal:i.signal};if(303!==T&&i.body&&i.init.body instanceof o)throw d&&d.removeEventListener("abort",w),new p("Cannot follow redirect with body being a readable stream","unsupported-redirect");return 303!==T&&(301!==T&&302!==T||"POST"!==i.method)||(t.method="GET",t.body=void 0,t.headers.delete("content-length")),d&&d.removeEventListener("abort",w),C(e,new l(n,t))}}}return d&&(P.once("end",(()=>{d.removeEventListener("abort",w)})),P.once("error",(()=>{d.removeEventListener("abort",w)}))),new u(P,{url:i.url,status:T,statusText:E,headers:k,httpVersion:S,decoded:I,counter:i.counter})},S=async(e,t,n)=>{if(0===e.options.maxCacheSize)return n;if(!T.includes(t.method))return n;const r=new _(t,n,{shared:!1});if(r.storable()){const o=await y(n);return e.cache.set(t.url,{policy:r,response:o},r.timeToLive()),o}return n},k=(e,t={})=>{const n=new URL(e);if("object"!=typeof t||Array.isArray(t))throw new TypeError("qs: object expected");return Object.entries(t).forEach((([e,t])=>{Array.isArray(t)?t.forEach((t=>n.searchParams.append(e,t))):n.searchParams.append(e,t)})),n.href},P=e=>new g(e);class I{constructor(e){this.options={...e};const{maxCacheSize:t}=this.options;let n="number"==typeof t&&t>=0?t:104857600,o=500;0===n&&(n=1,o=1),this.cache=new s({max:o,maxSize:n,sizeCalculation:({response:e},t)=>v(e)}),this.eventEmitter=new r,this.options.h2=this.options.h2||{},void 0===this.options.h2.enablePush&&(this.options.h2.enablePush=!0);const{enablePush:i}=this.options.h2;i&&(this.options.h2.pushPromiseHandler=(e,t,n)=>{const r={...t};Object.keys(r).filter((e=>e.startsWith(":"))).forEach((e=>delete r[e])),this.pushPromiseHandler(e,r,n)},this.options.h2.pushHandler=(e,t,n)=>{const r={...t};Object.keys(r).filter((e=>e.startsWith(":"))).forEach((e=>delete r[e]));const{statusCode:o,statusText:i,httpVersion:s,headers:a,readable:c,decoded:l}=n;this.pushHandler(e,r,new u(c,{url:e,status:o,statusText:i,headers:a,httpVersion:s,decoded:l}))}),this.context=w(this.options)}api(){return{fetch:async(e,t)=>this.fetch(e,t),Body:a,Headers:c,Request:l,Response:u,AbortController:f,AbortSignal:m,FetchBaseError:d,FetchError:p,AbortError:h,context:(e={})=>new I(e).api(),noCache:(e={})=>new I({...e,maxCacheSize:0}).api(),h1:(e={})=>new I({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),keepAlive:(e={})=>new I({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),h1NoCache:(e={})=>new I({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),keepAliveNoCache:(e={})=>new I({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),reset:async()=>this.context.reset(),onPush:e=>this.onPush(e),offPush:e=>this.offPush(e),createUrl:k,timeoutSignal:P,clearCache:()=>this.clearCache(),cacheStats:()=>this.cacheStats(),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,t){return(async(e,t,n)=>{const r=new l(t,n);if(0!==e.options.maxCacheSize&&T.includes(r.method)&&!["no-store","reload"].includes(r.cache)){const{policy:t,response:n}=e.cache.get(r.url)||{};if(t&&t.satisfiesWithoutRevalidation(r)){n.headers=new c(t.responseHeaders(n));const e=n.clone();return e.fromCache=!0,e}}const o=await C(e,r);return"no-store"!==r.cache?S(e,r,o):o})(this,e,t)}onPush(e){return this.eventEmitter.on(E,e)}offPush(e){return this.eventEmitter.off(E,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,t,n){i(`received server push promise: ${e}, headers: ${JSON.stringify(t)}`);const r=new l(e,{headers:t}),{policy:o}=this.cache.get(e)||{};o&&o.satisfiesWithoutRevalidation(r)&&(i(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(t)}`),n())}async pushHandler(e,t,n){i(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(t)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);const r=await S(this,new l(e,{headers:t}),n);this.eventEmitter.emit(E,e,r)}}e.exports=(new I).api()},7619:(e,t,n)=>{"use strict";const r=n(3573),{Headers:o}=n(8226),i=e=>({url:e.url,method:e.method,headers:e.headers.plain()}),s=e=>({status:e.status,headers:e.headers.plain()});e.exports=class{constructor(e,t,n){this.policy=new r(i(e),s(t),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(i(e))}responseHeaders(e){return new o(this.policy.responseHeaders(s(e)))}timeToLive(){return this.policy.timeToLive()}}},3505:(e,t,n)=>{"use strict";const{AbortSignal:r}=n(4346),{Body:o,cloneStream:i,guessContentType:s}=n(4214),{Headers:a}=n(8226),{isPlainObject:c}=n(5591),{isFormData:l,FormDataSerializer:u}=n(6029),d=Symbol("Request internals");class p extends o{constructor(e,t={}){const n=e instanceof p?e:null,o=n?new URL(n.url):new URL(e);let h=t.method||n&&n.method||"GET";if(h=h.toUpperCase(),(null!=t.body||n&&null!==n.body)&&["GET","HEAD"].includes(h))throw new TypeError("Request with GET/HEAD method cannot have body");let f=t.body||(n&&n.body?i(n):null);const m=new a(t.headers||n&&n.headers||{});if(l(f)&&!m.has("content-type")){const e=new u(f);f=e.stream(),m.set("content-type",e.contentType()),m.has("transfer-encoding")||m.has("content-length")||m.set("content-length",e.length())}if(!m.has("content-type"))if(c(f))f=JSON.stringify(f),m.set("content-type","application/json");else{const e=s(f);e&&m.set("content-type",e)}super(f);let g=n?n.signal:null;if("signal"in t&&(g=t.signal),g&&!(g instanceof r))throw new TypeError("signal needs to be an instance of AbortSignal");const _=t.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(_))throw new TypeError(`'${_}' is not a valid redirect option`);const y=t.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(y))throw new TypeError(`'${y}' is not a valid cache option`);this[d]={init:{...t},method:h,redirect:_,cache:y,headers:m,parsedURL:o,signal:g},void 0===t.follow?n&&void 0!==n.follow?this.follow=n.follow:this.follow=20:this.follow=t.follow,this.counter=t.counter||n&&n.counter||0,void 0===t.compress?n&&void 0!==n.compress?this.compress=n.compress:this.compress=!0:this.compress=t.compress,void 0===t.decode?n&&void 0!==n.decode?this.decode=n.decode:this.decode=!0:this.decode=t.decode}get method(){return this[d].method}get url(){return this[d].parsedURL.toString()}get headers(){return this[d].headers}get redirect(){return this[d].redirect}get cache(){return this[d].cache}get signal(){return this[d].signal}clone(){return new p(this)}get init(){return this[d].init}get[Symbol.toStringTag](){return this.constructor.name}}Object.defineProperties(p.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),e.exports={Request:p}},8327:(e,t,n)=>{"use strict";const{Body:r,cloneStream:o,guessContentType:i}=n(4214),{Headers:s}=n(8226),{isPlainObject:a}=n(5591),{isFormData:c,FormDataSerializer:l}=n(6029),u=Symbol("Response internals");class d extends r{constructor(e=null,t={}){const n=new s(t.headers);let r=e;if(c(r)&&!n.has("content-type")){const e=new l(r);r=e.stream(),n.set("content-type",e.contentType()),n.has("transfer-encoding")||n.has("content-length")||n.set("content-length",e.length())}if(null!==r&&!n.has("content-type"))if(a(r))r=JSON.stringify(r),n.set("content-type","application/json");else{const e=i(r);e&&n.set("content-type",e)}super(r),this[u]={url:t.url,status:t.status||200,statusText:t.statusText||"",headers:n,httpVersion:t.httpVersion,decoded:t.decoded,counter:t.counter}}get url(){return this[u].url||""}get status(){return this[u].status}get statusText(){return this[u].statusText}get ok(){return this[u].status>=200&&this[u].status<300}get redirected(){return this[u].counter>0}get headers(){return this[u].headers}get httpVersion(){return this[u].httpVersion}get decoded(){return this[u].decoded}static redirect(e,t=302){if(![301,302,303,307,308].includes(t))throw new RangeError("Invalid status code");return new d(null,{headers:{location:new URL(e).toString()},status:t})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new d(o(this),{...this[u]})}get[Symbol.toStringTag](){return this.constructor.name}}Object.defineProperties(d.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),e.exports={Response:d}},8606:(e,t,n)=>{"use strict";e.exports=n(4735)},892:(e,t)=>{"use strict";function n(e){return function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}(e)?Object.keys(e).reduce(((t,r)=>({...t,[r]:n(e[r])})),{}):function(e){return"object"==typeof e&&null!==e&&Array.isArray(e)}(e)?e.map((e=>n(e))):e}Object.defineProperty(t,"__esModule",{value:!0}),t.Type=t.TypeBuilder=t.VoidKind=t.UndefinedKind=t.PromiseKind=t.FunctionKind=t.ConstructorKind=t.RefKind=t.AnyKind=t.UnknownKind=t.NullKind=t.BooleanKind=t.IntegerKind=t.NumberKind=t.StringKind=t.LiteralKind=t.EnumKind=t.ArrayKind=t.RecordKind=t.ObjectKind=t.TupleKind=t.UnionKind=t.IntersectKind=t.KeyOfKind=t.NamespaceKind=t.ReadonlyModifier=t.OptionalModifier=t.ReadonlyOptionalModifier=void 0,t.ReadonlyOptionalModifier=Symbol("ReadonlyOptionalModifier"),t.OptionalModifier=Symbol("OptionalModifier"),t.ReadonlyModifier=Symbol("ReadonlyModifier"),t.NamespaceKind=Symbol("NamespaceKind"),t.KeyOfKind=Symbol("KeyOfKind"),t.IntersectKind=Symbol("IntersectKind"),t.UnionKind=Symbol("UnionKind"),t.TupleKind=Symbol("TupleKind"),t.ObjectKind=Symbol("ObjectKind"),t.RecordKind=Symbol("RecordKind"),t.ArrayKind=Symbol("ArrayKind"),t.EnumKind=Symbol("EnumKind"),t.LiteralKind=Symbol("LiteralKind"),t.StringKind=Symbol("StringKind"),t.NumberKind=Symbol("NumberKind"),t.IntegerKind=Symbol("IntegerKind"),t.BooleanKind=Symbol("BooleanKind"),t.NullKind=Symbol("NullKind"),t.UnknownKind=Symbol("UnknownKind"),t.AnyKind=Symbol("AnyKind"),t.RefKind=Symbol("RefKind"),t.ConstructorKind=Symbol("ConstructorKind"),t.FunctionKind=Symbol("FunctionKind"),t.PromiseKind=Symbol("PromiseKind"),t.UndefinedKind=Symbol("UndefinedKind"),t.VoidKind=Symbol("VoidKind");class r{schemas=new Map;ReadonlyOptional(e){return{...e,modifier:t.ReadonlyOptionalModifier}}Readonly(e){return{...e,modifier:t.ReadonlyModifier}}Optional(e){return{...e,modifier:t.OptionalModifier}}Tuple(e,n={}){const r=e.length,o=e.length,i=e.length>0?{...n,kind:t.TupleKind,type:"array",items:e,additionalItems:!1,minItems:r,maxItems:o}:{...n,kind:t.TupleKind,type:"array",minItems:r,maxItems:o};return this.Store(i)}Object(e,n={}){const r=Object.keys(e),o=r.filter((n=>{const r=e[n];return r.modifier&&(r.modifier===t.OptionalModifier||r.modifier===t.ReadonlyOptionalModifier)})),i=r.filter((e=>!o.includes(e))),s=i.length>0?i:void 0;return this.Store(s?{...n,kind:t.ObjectKind,type:"object",properties:e,required:s}:{...n,kind:t.ObjectKind,type:"object",properties:e})}Intersect(e,n={}){return this.Store({...n,kind:t.IntersectKind,type:"object",allOf:e})}Union(e,n={}){return this.Store({...n,kind:t.UnionKind,anyOf:e})}Array(e,n={}){return this.Store({...n,kind:t.ArrayKind,type:"array",items:e})}Enum(e,n={}){const r=Object.keys(e).filter((e=>isNaN(e))).map((t=>e[t])).map((e=>"string"==typeof e?{type:"string",const:e}:{type:"number",const:e}));return this.Store({...n,kind:t.EnumKind,anyOf:r})}Literal(e,n={}){return this.Store({...n,kind:t.LiteralKind,const:e,type:typeof e})}String(e={}){return this.Store({...e,kind:t.StringKind,type:"string"})}RegEx(e,t={}){return this.String({...t,pattern:e.source})}Number(e={}){return this.Store({...e,kind:t.NumberKind,type:"number"})}Integer(e={}){return this.Store({...e,kind:t.IntegerKind,type:"integer"})}Boolean(e={}){return this.Store({...e,kind:t.BooleanKind,type:"boolean"})}Null(e={}){return this.Store({...e,kind:t.NullKind,type:"null"})}Unknown(e={}){return this.Store({...e,kind:t.UnknownKind})}Any(e={}){return this.Store({...e,kind:t.AnyKind})}Record(e,n,r={}){const o=(()=>{switch(e.kind){case t.UnionKind:return`^${e.anyOf.map((e=>e.const)).join("|")}$`;case t.KeyOfKind:return`^${e.enum.join("|")}$`;case t.NumberKind:return"^(0|[1-9][0-9]*)$";case t.StringKind:return e.pattern?e.pattern:"^.*$";default:throw Error("Invalid Record Key")}})();return this.Store({...r,kind:t.RecordKind,type:"object",patternProperties:{[o]:n}})}KeyOf(e,n={}){const r=this.Deref(e),o=Object.keys(r.properties);return this.Store({...n,kind:t.KeyOfKind,type:"string",enum:o})}Required(e,r={}){const o={...n(this.Deref(e)),...r};o.required=Object.keys(o.properties);for(const e of Object.keys(o.properties)){const n=o.properties[e];switch(n.modifier){case t.ReadonlyOptionalModifier:case t.ReadonlyModifier:n.modifier=t.ReadonlyModifier;break;case t.OptionalModifier:default:delete n.modifier}}return this.Store(o)}Partial(e,r={}){const o={...n(this.Deref(e)),...r};delete o.required;for(const e of Object.keys(o.properties)){const n=o.properties[e];switch(n.modifier){case t.ReadonlyOptionalModifier:case t.ReadonlyModifier:n.modifier=t.ReadonlyOptionalModifier;break;case t.OptionalModifier:default:n.modifier=t.OptionalModifier}}return this.Store(o)}Pick(e,t,r={}){const o={...n(this.Deref(e)),...r};o.required=o.required?o.required.filter((e=>t.includes(e))):void 0;for(const e of Object.keys(o.properties))t.includes(e)||delete o.properties[e];return this.Store(o)}Omit(e,t,r={}){const o={...n(this.Deref(e)),...r};o.required=o.required?o.required.filter((e=>!t.includes(e))):void 0;for(const e of Object.keys(o.properties))t.includes(e)&&delete o.properties[e];return this.Store(o)}Strict(e,t={}){return JSON.parse(JSON.stringify({...t,...e}))}Constructor(e,n,r={}){return this.Store({...r,kind:t.ConstructorKind,type:"constructor",arguments:e,returns:n})}Function(e,n,r={}){return this.Store({...r,kind:t.FunctionKind,type:"function",arguments:e,returns:n})}Promise(e,n={}){return this.Store({...n,type:"promise",kind:t.PromiseKind,item:e})}Undefined(e={}){return this.Store({...e,type:"undefined",kind:t.UndefinedKind})}Void(e={}){return this.Store({...e,type:"void",kind:t.VoidKind})}Namespace(e,n={}){return this.Store({...n,kind:t.NamespaceKind,$defs:e})}Ref(...e){if(2===e.length){const n=e[0],r=e[1];if(void 0===n.$id)throw new Error("Referenced namespace has no $id");if(!this.schemas.has(n.$id))throw new Error(`Unable to locate namespace with $id '${n.$id}'`);return this.Store({kind:t.RefKind,$ref:`${n.$id}#/$defs/${r}`})}if(1===e.length){const n=e[0];if(void 0===n.$id)throw new Error("Referenced schema has no $id");if(!this.schemas.has(n.$id))throw new Error(`Unable to locate schema with $id '${n.$id}'`);return this.Store({kind:t.RefKind,$ref:n.$id})}throw new Error("Type.Ref: Invalid arguments")}Rec(e,t={}){const n=t.$id||"",r=e({$ref:`${n}#/$defs/self`});return this.Store({...t,$ref:`${n}#/$defs/self`,$defs:{self:r}})}Store(e){const t=e;return t.$id?(this.schemas.set(t.$id,t),t):t}Deref(e){const n=e;if(n.kind!==t.RefKind)return e;if(!this.schemas.has(n.$ref))throw Error(`Unable to locate schema with $id '${n.$ref}'`);return this.Deref(this.schemas.get(n.$ref))}}t.TypeBuilder=r,t.Type=new r},6236:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=n(8355),o=n(5671),i=n(2),s=n(1512),a=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=n(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},6545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class o extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const n=[e[0]];let r=0;for(;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(6545),o=n(9187);var i=n(6545);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=n(9187);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?o.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=O(this.rhs,e,t),this}get names(){return R(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class p extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=O(this.code,e,t),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||(A(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>I(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class _ extends m{}class y extends g{}y.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(N(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=O(this.condition,e,t),this}get names(){const e=super.names;return R(e,this.condition),this.else&&I(e,this.else.names),e}}v.kind="if";class b extends g{}b.kind="for";class w extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=O(this.iteration,e,t),this}get names(){return I(super.names,this.iteration.names)}}class x extends b{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:r,to:i}=this;return`for(${t} ${n}=${r}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){const e=R(super.names,this.from);return R(e,this.to)}}class T extends b{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=O(this.iterable,e,t),this}get names(){return I(super.names,this.iterable.names)}}class E extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class C extends m{render(e){return"return "+super.render(e)}}C.kind="return";class S extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&I(e,this.catch.names),this.finally&&I(e,this.finally.names),e}}class k extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class P extends g{render(e){return"finally"+super.render(e)}}function I(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function R(e,t){return t instanceof r._CodeOrName?I(e,t.names):e}function O(e,t,n){return e instanceof r.Name?i(e):(o=e)instanceof r._Code&&o._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=i(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function i(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function A(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function N(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${L(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new c(e,o,n)),o}const(e,t,n){return this._def(o.varKinds.const,e,t,n)}let(e,t,n){return this._def(o.varKinds.let,e,t,n)}var(e,t,n){return this._def(o.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new f(e)),this}object(...e){const t=["{"];for(const[n,o]of e)t.length>1&&t.push(","),t.push(n),(n!==o||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,o));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new v(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(v,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,n,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new x(i,s,t,n),(()=>r(s)))}forOf(e,t,n,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(s,r._`${e}[${t}]`),n(s)}))}return this._for(new T("of",i,s,t),(()=>n(s)))}forIn(e,t,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const s=this._scope.toName(e);return this._for(new T("in",i,s,t),(()=>n(s)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new p(e))}return(e){const t=new C;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new S;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new k(e),t(e)}return n&&(this._currNode=r.finally=new P,this.code(n)),this._endBlockNode(k,P)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,o){return this._blockNode(new E(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=N;const D=$(t.operators.AND);t.and=function(...e){return e.reduce(D)};const M=$(t.operators.OR);function $(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${L(t)} ${e} ${L(n)}`}function L(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(M)}},9187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(6545);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=a;const c=r._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,i=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,r);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,s={},a){let c=r.nil;for(const l in e){const u=e[l];if(!u)continue;const d=s[l]=s[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,i.Started);let s=n(e);if(s){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new o(e);c=r._`${c}${s}${this.opts._n}`}d.set(e,i.Completed)}))}return c}}},6930:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(5669),o=n(8936),i=n(7250);function s(e,t){const n=e.const("err",t);e.if(r._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,r._`[${n}]`)),r._`${i.default.vErrors}.push(${n})`),e.code(r._`${i.default.errors}++`)}function a(e,t){const{gen:n,validateName:o,schemaEnv:i}=e;i.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,i){const{it:c}=e,{gen:u,compositeRule:d,allErrors:p}=c,h=l(e,n,o);(null!=i?i:d||p)?s(u,h):a(c,r._`[${h}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:o}=e,{gen:c,compositeRule:u,allErrors:d}=o;s(c,l(e,n,r)),u||d||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(r._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,i.default.errors,(s=>{e.const(c,r._`${i.default.vErrors}[${s}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,o))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:o}=e.it;return!1===o?r._`{}`:function(e,t,n={}){const{gen:o,it:s}=e,a=[u(s,n),d(e,n)];return function(e,{params:t,message:n},o){const{keyword:s,data:a,schemaValue:l,it:u}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=u;o.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||r._`{}`]),d.messages&&o.push([c.message,"function"==typeof n?n(e):n]),d.verbose&&o.push([c.schema,l],[c.parentSchema,r._`${h}${f}`],[i.default.data,a]),p&&o.push([c.propertyName,p])}(e,t,a),o.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:i}){let s=i?t:r.str`${t}/${e}`;return n&&(s=r.str`${s}${(0,o.getErrorPath)(n,o.Type.Str)}`),[c.schemaPath,s]}},7382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(5669),o=n(6448),i=n(7250),s=n(6696),a=n(8936),c=n(1686),l=n(2371);class u{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function d(e){const t=h.call(this,e);if(t)return t;const n=(0,s.getFullPath)(e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new r.CodeGen(this.scope,{es5:a,lines:l,ownProperties:u});let p;e.$async&&(p=d.scopeValue("Error",{ref:o.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const m={gen:d,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${i.default.self}`,`${i.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function p(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function f(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){const n=l.parse(t),r=(0,s._getFullPath)(n);let o=(0,s.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&r===o)return _.call(this,n,e);const i=(0,s.normalizeId)(r),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return _.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||d.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,r=t[n];return r&&(o=(0,s.resolveUrl)(o,r)),new u({schema:t,schemaId:n,root:e,baseId:o})}return _.call(this,n,a)}}t.SchemaEnv=u,t.compileSchema=d,t.resolveRef=function(e,t,n){var r;n=(0,s.resolveUrl)(t,n);const o=e.refs[n];if(o)return o;let i=f.call(this,e,n);if(void 0===i){const o=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:s}=this.opts;o&&(i=new u({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[n]=p.call(this,i):void 0},t.getCompilingSchema=h,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(e,{baseId:t,schema:n,root:r}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(r)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(r)&&o&&(t=(0,s.resolveUrl)(t,o))}let i;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,s.resolveUrl)(t,n.$ref);i=m.call(this,r,e)}const{schemaId:c}=this.opts;return i=i||new u({schema:n,schemaId:c,root:r,baseId:t}),i.schema!==i.root.schema?i:void 0}},7250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=o},1578:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6696);class o extends Error{constructor(e,t,n){super(n||`can't resolve reference ${t} from id ${e}`),this.missingRef=(0,r.resolveUrl)(e,t),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(this.missingRef))}}t.default=o},6696:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(8936),o=n(6471),i=n(5127),s=n(2371),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&u(e)<=t)};const c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(c.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function u(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=u(e))),t===1/0))return 1/0}return t}function d(e="",t){return!1!==t&&(e=f(e)),p(s.parse(e))}function p(e){return s.serialize(e).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=p;const h=/#\/?$/;function f(e){return e?e.replace(h,""):""}t.normalizeId=f,t.resolveUrl=function(e,t){return t=f(t),s.resolve(e,t)};const m=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n}=this.opts,r=f(e[n]||t),a={"":r},c=d(r,!1),l={},u=new Set;return i(e,{allKeys:!0},((e,t,r,o)=>{if(void 0===o)return;const i=c+t;let d=a[o];function g(t){if(t=f(d?s.resolve(d,t):t),u.has(t))throw h(t);u.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?p(e,n.schema,t):t!==f(i)&&("#"===t[0]?(p(e,l[t],t),l[t]=e):this.refs[t]=i),t}function _(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);g.call(this,`#${e}`)}}"string"==typeof e[n]&&(d=g.call(this,e[n])),_.call(this,e.$anchor),_.call(this,e.$dynamicAnchor),a[t]=d})),l;function p(e,t,n){if(void 0!==t&&!o(e,t))throw h(n)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},2881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},8936:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(5669),o=n(6545);function i(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const n in t)o[n]||f(e,`unknown keyword: "${n}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(i,s,a,c)=>{const l=void 0===a?s:a instanceof r.Name?(s instanceof r.Name?e(i,s,a):t(i,s,a),a):s instanceof r.Name?(t(i,a,s),s):n(s,a);return c!==r.Name||l instanceof r.Name?l:o(i,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,o,i){if(!i){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const p={};var h;function f(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const o=t===h.Num;return n?o?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:o?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},9073:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const o=t.RULES.types[r];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=r},2171:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(6930),o=n(5669),i=n(7250),s={message:"boolean schema is false"};function a(e,t){const{gen:n,data:o}=e,i={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(i.default.data):(t.assign(o._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),a(e)):n.var(t,!0)}},7332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(2881),o=n(9073),i=n(6930),s=n(5669),a=n(8936);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:i}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),l=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(l){const o=p(t,r,i.strictNumbers,c.Wrong);n.if(o,(()=>{a.length?function(e,t,n){const{gen:r,data:o,opts:i}=e,a=r.let("dataType",s._`typeof ${o}`),c=r.let("coerced",s._`undefined`);"array"===i.coerceTypes&&r.if(s._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>r.assign(o,s._`${o}[0]`).assign(a,s._`typeof ${o}`).if(p(t,o,i.strictNumbers),(()=>r.assign(c,o))))),r.if(s._`${c} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===i.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void r.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(c,s._`"" + ${o}`).elseIf(s._`${o} === null`).assign(c,s._`""`);case"number":return void r.elseIf(s._`${a} == "boolean" || ${o} === null || (${a} == "string" && ${o} && ${o} == +${o})`).assign(c,s._`+${o}`);case"integer":return void r.elseIf(s._`${a} === "boolean" || ${o} === null || (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(c,s._`+${o}`);case"boolean":return void r.elseIf(s._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(c,!1).elseIf(s._`${o} === "true" || ${o} === 1`).assign(c,!0);case"null":return r.elseIf(s._`${o} === "" || ${o} === 0 || ${o} === false`),void r.assign(c,null);case"array":r.elseIf(s._`${a} === "string" || ${a} === "number" || ${a} === "boolean" || ${o} === null`).assign(c,s._`[${o}]`)}}r.else(),f(e),r.endIf(),r.if(s._`${c} !== undefined`,(()=>{r.assign(o,c),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${n}]`,r)))}(e,c)}))}(e,t,a):f(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=c.Correct){const o=r===c.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return r===c.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,n?s._`isFinite(${t})`:s.nil)}}function p(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,d(e,t,n,r));return o}t.checkDataType=d,t.checkDataTypes=p;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:n,schema:r}=e,o=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}(e);(0,i.reportError)(t,h)}t.reportTypeError=f},1481:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(5669),o=n(8936);function i(e,t,n){const{gen:i,compositeRule:s,data:a,opts:c}=e;if(void 0===n)return;const l=r._`${a}${(0,r.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${l}`);let u=r._`${l} === undefined`;"empty"===c.useDefaults&&(u=r._`${u} || ${l} === null || ${l} === ""`),i.if(u,r._`${l} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)i(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>i(e,n,t.default)))}},1686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(2171),o=n(7332),i=n(9073),s=n(7332),a=n(1481),c=n(5782),l=n(8878),u=n(5669),d=n(7250),p=n(6696),h=n(8936),f=n(6930);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},i){o.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,o)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,o),e.code(i)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,r.$async,(()=>e.code(g(n,o)).code(i)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function _({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function v(e){(0,h.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function b(e,t){if(e.opts.jtd)return x(e,[],!1,t);const n=(0,o.getSchemaTypes)(e.schema);x(e,n,!(0,o.coerceAndCheckDataType)(e,n),t)}function w({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const i=n.$comment;if(!0===o.$comment)e.code(u._`${d.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const n=u.str`${r}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${i}, ${n}, ${o}.schema)`)}}function x(e,t,n,r){const{gen:o,schema:a,data:c,allErrors:l,opts:p,self:f}=e,{RULES:m}=f;function g(h){(0,i.shouldUseGroup)(a,h)&&(h.type?(o.if((0,s.checkDataType)(h.type,c,p.strictNumbers)),T(e,h),1===t.length&&t[0]===h.type&&n&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):T(e,h),l||o.if(u._`${d.default.errors} === ${r||0}`))}!a.$ref||!p.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(a,m)?(p.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{E(e.dataTypes,t)||C(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>E(t,e)))):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&C(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const r in n){const o=n[r];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:n}=o.definition;n.length&&!n.some((e=>{return r=e,(n=t).includes(r)||"number"===r&&n.includes("integer");var n,r}))&&C(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):o.block((()=>k(e,"$ref",m.all.$ref.definition)))}function T(e,t){const{gen:n,schema:r,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,i.shouldUseRule)(r,n)&&k(e,n.keyword,n.definition,t.type)}))}function E(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function C(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){y(e)&&(v(e),_(e))?function(e){const{schema:t,opts:n,gen:r}=e;m(e,(()=>{n.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(d.default.vErrors,null),r.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),b(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:i}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${o}(${d.default.vErrors})`))):(t.assign(u._`${r}.errors`,d.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),r instanceof u.Name&&e.assign(u._`${t}.items`,r)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class S{constructor(e,t,n){if((0,c.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",R(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,u.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=u.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:o,def:i}=this;n.if((0,u.or)(u._`${r} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(o.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,u.or)(function(){if(n.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return u._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return u.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(n,this.it,e),(0,l.extendSubschemaMode)(n,e);const o={...this.it,...n,items:void 0,props:void 0};return function(e,t){y(e)&&(v(e),_(e))?function(e,t){const{schema:n,gen:r,opts:o}=e;o.$comment&&n.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,p.resolveUrl)(e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=r.const("_errs",d.default.errors);b(e,i),r.var(t,u._`${i} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=h.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=h.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function k(e,t,n,r){const o=new S(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,c.funcKeywordCode)(o,n):"macro"in n?(0,c.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(o,n)}t.KeywordCxt=S;const P=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,i;if(""===e)return d.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=d.default.rootData}else{const s=I.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return r[t-a]}if(a>t)throw new Error(c("data",a));if(i=n[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=u._`${i}${(0,u.getProperty)((0,h.unescapeJsonPointer)(e))}`,s=u._`${s} && ${i}`);return s;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=R},5782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(5669),o=n(7250),i=n(3499),s=n(6930);function a(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,(()=>t.assign(n,r._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:o,schema:i,parentSchema:s,it:a}=e,l=t.macro.call(a.self,i,s,a),u=c(n,o,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const d=n.name("valid");e.subschema({schema:l,schemaPath:r.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:l,keyword:u,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const m=!h&&t.compile?t.compile.call(f.self,d,p,f):t.validate,g=c(l,u,m),_=l.let("valid");function y(n=(t.async?r._`await `:r.nil)){const s=f.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!h||!1===t.schema);l.assign(_,r._`${n}${(0,i.callValidateCode)(e,g,s,a)}`,t.modifying)}function v(e){var n;l.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:_),e)}e.block$data(_,(function(){if(!1===t.errors)y(),t.modifying&&a(e),v((()=>e.error()));else{const n=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>y(r._`await `)),(t=>l.assign(_,!1).if(r._`${t} instanceof ${f.ValidationError}`,(()=>l.assign(e,r._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=r._`${g}.errors`;return l.assign(e,null),y(r.nil),e}();t.modifying&&a(e),v((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,r._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:_)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},8878:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(5669),o=n(8936);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===n?{schema:i,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(n)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==n){const{errorPath:s,dataPathArr:a,opts:c}=t;u(l.let("data",r._`${t.data}${(0,r.getProperty)(n)}`,!0)),e.errorPath=r.str`${s}${(0,o.getErrorPath)(n,i,c.jsPropertySyntax)}`,e.parentDataProperty=r._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==s&&(u(s instanceof r.Name?s:l.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:i}){void 0!==r&&(e.compositeRule=r),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}},8355:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=n(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var o=n(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=n(6448),s=n(1578),a=n(2881),c=n(7382),l=n(5669),u=n(6696),d=n(7332),p=n(8936),h=n(1143),f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,n,r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w,x;const T=e.strict,E=null===(t=e.code)||void 0===t?void 0:t.optimize,C=!0===E||void 0===E?1:E||0;return{strictSchema:null===(r=null!==(n=e.strictSchema)&&void 0!==n?n:T)||void 0===r||r,strictNumbers:null===(i=null!==(o=e.strictNumbers)&&void 0!==o?o:T)||void 0===i||i,strictTypes:null!==(a=null!==(s=e.strictTypes)&&void 0!==s?s:T)&&void 0!==a?a:"log",strictTuples:null!==(l=null!==(c=e.strictTuples)&&void 0!==c?c:T)&&void 0!==l?l:"log",strictRequired:null!==(d=null!==(u=e.strictRequired)&&void 0!==u?u:T)&&void 0!==d&&d,code:e.code?{...e.code,optimize:C}:{optimize:C},loopRequired:null!==(p=e.loopRequired)&&void 0!==p?p:200,loopEnum:null!==(h=e.loopEnum)&&void 0!==h?h:200,meta:null===(f=e.meta)||void 0===f||f,messages:null===(m=e.messages)||void 0===m||m,inlineRefs:null===(g=e.inlineRefs)||void 0===g||g,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(y=e.addUsedSchema)||void 0===y||y,validateSchema:null===(v=e.validateSchema)||void 0===v||v,validateFormats:null===(b=e.validateFormats)||void 0===b||b,unicodeRegExp:null===(w=e.unicodeRegExp)||void 0===w||w,int32range:null===(x=e.int32range)||void 0===x||x}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:m,es5:t,lines:n}),this.logger=function(e){if(!1===e)return S;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,"NOT SUPPORTED"),b.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=C.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),x.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=h;"id"===n&&(r={...h},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await o.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||i.call(this,n)}async function o(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const n=await l.call(this,e);this.refs[e]||await o.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=w.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new c.SchemaEnv({schema:{},schemaId:n});if(t=c.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=w.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,u.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(P.call(this,n,t),!t)return(0,p.eachItem)(n,(e=>I.call(this,e))),this;O.call(this,t);const r={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,p.eachItem)(n,0===r.type.length?e=>I.call(this,e,r):e=>r.type.forEach((t=>I.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,i=o[e];r&&i&&(o[e]=N(i))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,u.normalizeId)(i||n);const l=u.getSchemaRefs.call(this,e,n);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:l}),this._cache.set(a.schema,a),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),r&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,n,r="error"){for(const o in e){const i=o;i in t&&this.logger[r](`${n}: option ${o}. ${e[i]}`)}}function w(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function x(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function T(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function C(){const e={...this.opts};for(const t of f)delete e[t];return e}t.default=v,v.ValidationError=i.default,v.MissingRefError=s.default;const S={log(){},warn(){},error(){}},k=/^[a-z_$][a-z0-9_$:-]*$/i;function P(e,t){const{RULES:n}=this;if((0,p.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function I(e,t,n){var r;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find((({type:e})=>e===n));if(s||(s={type:n,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?R.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function R(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function O(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const A={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,A]}}},4285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6471);r.code='require("ajv/dist/runtime/equal").default',t.default=r},9161:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,o=0;for(;o=55296&&n<=56319&&o{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},8891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(5669),o=n(8936),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?s(e,r):(0,o.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:n,schema:i,data:s,keyword:a,it:c}=e;c.items=!0;const l=n.const("len",r._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(c,i)){const i=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(i),(()=>function(i){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),c.allErrors||n.if((0,r.not)(i),(()=>n.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},4943:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(7250),s=n(8936),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:c,errsCount:l,it:u}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,s.alwaysValidSchema)(u,n))return;const h=(0,r.allSchemaProperties)(a.properties),f=(0,r.allSchemaProperties)(a.patternProperties);function m(e){t.code(o._`delete ${c}[${e}]`)}function g(r){if("all"===p.removeAdditional||p.removeAdditional&&!1===n)m(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,s.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===p.removeAdditional?(_(r,n,!1),t.if((0,o.not)(n),(()=>{e.reset(),m(r)}))):(_(r,n),d||t.if((0,o.not)(n),(()=>t.break())))}}}function _(t,n,r){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===r&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",c,(n=>{h.length||f.length?t.if(function(n){let i;if(h.length>8){const e=(0,s.schemaRefOrVal)(u,a.properties,"properties");i=(0,r.isOwnProperty)(t,e,n)}else i=h.length?(0,o.or)(...h.map((e=>o._`${n} === ${e}`))):o.nil;return f.length&&(i=(0,o.or)(i,...f.map((t=>o._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,o.not)(i)}(n),(()=>g(n))):g(n)})),e.ok(o._`${l} === ${i.default.errors}`)}};t.default=a},2609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:n},i);e.ok(i),e.mergeEvaluated(s)}))}};t.default=o},4279:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(3499).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},5609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?r.str`must contain at least ${e} valid item(s)`:r.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:i,data:s,it:a}=e;let c,l;const{minContains:u,maxContains:d}=i;a.opts.next?(c=void 0===u?1:u,l=d):c=1;const p=t.const("len",r._`${s}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,n)){let t=r._`${p} >= ${c}`;return void 0!==l&&(t=r._`${t} && ${p} <= ${l}`),void e.pass(t)}a.items=!0;const h=t.name("valid");if(void 0===l&&1===c)f(h,(()=>t.if(h,(()=>t.break()))));else{t.let(h,!1);const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===l?t.if(r._`${e} >= ${c}`,(()=>t.assign(h,!0).break())):(t.if(r._`${e} > ${l}`,(()=>t.assign(h,!1).break())),1===c?t.assign(h,!0):t.if(r._`${e} >= ${c}`,(()=>t.assign(h,!0))))}(n)))))}function f(n,r){t.forRange("i",0,p,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},n),r()}))}e.result(h,(()=>e.reset()))}};t.default=i},5463:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(5669),o=n(8936),i=n(3499);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const o=1===t?"property":"properties";return r.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:o}})=>r._`{property: ${e}, missingProperty: ${o}, depsCount: ${t}, - deps: ${n}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,i.propertyInData)(n,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?n.if(u,(()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,i.checkMissingProp)(e,l,a)})`),(0,i.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:s,it:a}=e,c=n.name("valid");for(const l in t)(0,o.alwaysValidSchema)(a,t[l])||(n.if((0,i.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},76:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:i}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else a?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,o){return()=>{const i=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(i,l),o?t.assign(o,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!(0,o.alwaysValidSchema)(e,n)}t.default=i},6951:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8891),o=n(1162),i=n(8634),s=n(5151),a=n(5609),c=n(5463),l=n(3021),u=n(4943),d=n(4243),p=n(8103),h=n(2869),f=n(4279),m=n(4880),g=n(2609),_=n(76),y=n(5316);t.default=function(e=!1){const t=[h.default,f.default,m.default,g.default,_.default,y.default,l.default,u.default,c.default,d.default,p.default];return e?t.push(o.default,s.default):t.push(r.default,i.default),t.push(a.default),t}},8634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(5669),o=n(8936),i=n(3499),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,o.alwaysValidSchema)(n,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:i}=l,s=n.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(l,e,r.strictTuples)}}(s),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(i,n.length,l.items));const u=i.name("valid"),d=i.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,o.alwaysValidSchema)(l,t)||(i.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=a,t.default=s},5151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(3499),s=n(8891),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,o.alwaysValidSchema)(r,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},2869:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,r.alwaysValidSchema)(o,n))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},4880:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=n,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,i)=>{let a;(0,o.alwaysValidSchema)(s,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${i}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,i),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},8103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s=n(8936),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,r.allSchemaProperties)(n),p=d.filter((e=>(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length||p.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const h=u.strictSchema&&!u.allowMatchingProperties&&c.properties,f=t.name("valid");!0===l.props||l.props instanceof o.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:m}=l;function g(e){for(const t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function _(n){t.forIn("key",a,(i=>{t.if(o._`${(0,r.usePattern)(e,n)}.test(${i})`,(()=>{const r=p.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:i,dataPropType:s.Type.Str},f),l.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):r||l.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of d)h&&g(e),l.allErrors?_(e):(t.var(f,!0),_(e),t.if(f))}()}};t.default=a},1162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8634),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=o},4243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1686),o=n(3499),i=n(8936),s=n(4943),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new r.KeywordCxt(l,s.default,"additionalProperties"));const u=(0,o.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),l.props));const d=u.filter((e=>!(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const p=t.name("valid");for(const n of d)h(n)?f(n):(t.if((0,o.propertyInData)(t,c,n,l.opts.ownProperties)),f(n),l.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(p);function h(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}};t.default=a},3021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,n))return;const a=t.name("valid");t.forIn("key",i,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},5316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=o},3499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(5669),o=n(8936),i=n(7250);function s(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return r._`${s(e)}.call(${t}, ${n})`}function c(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} === undefined`;return o?(0,r.or)(i,(0,r.not)(a(e,t,n))):i}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:o,it:i}=e;n.if(c(n,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},o,i){return(0,r.or)(...o.map((o=>(0,r.and)(c(e,t,o,n.ownProperties),r._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=s,t.isOwnProperty=a,t.propertyInData=function(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return o?r._`${i} && ${a(e,t,n)}`:i},t.noPropertyInData=c,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((n=>!(0,o.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},l,u,d){const p=d?r._`${e}, ${t}, ${o}${s}`:t,h=[[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=r._`${p}, ${n.object(...h)}`;return u!==r.nil?r._`${l}.call(${u}, ${f})`:r._`${l}(${f})`},t.usePattern=function({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,o),code:r._`new RegExp(${n}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:i,dataProp:n,dataPropType:o.Type.Num},a),t.if((0,r.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},1018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},2101:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1018),o=n(1939),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default];t.default=i},1939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(1578),o=n(3499),i=n(5669),s=n(7250),a=n(7382),c=n(8936),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:p,self:h}=o,{root:f}=c;if(("#"===n||"#/"===n)&&s===f.baseId)return function(){if(c===f)return d(e,l,c,c.$async);const n=t.scopeValue("root",{ref:f});return d(e,i._`${n}.validate`,f,f.$async)}();const m=a.resolveRef.call(h,f,s,n);if(void 0===m)throw new r.default(s,n);return m instanceof a.SchemaEnv?function(t){const n=u(e,t);d(e,n,t,t.$async)}(m):function(r){const o=t.scopeValue("schema",!0===p.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),s=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:n},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):i._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:d,opts:p}=l,h=p.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=c.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",i._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,i.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=c.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",i._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,i.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,h)}`),m(t),u||a.assign(n,!0)}),(e=>{a.if(i._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),f(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,o.callValidateCode)(e,t,h),(()=>m(t)),(()=>f(t)))}t.getValidate=u,t.callRef=d,t.default=l},2:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(7421),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:i,parentSchema:s,it:a}=e,{oneOf:c}=s;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),d=t.const("tag",r._`${n}${(0,r.getProperty)(l)}`);function p(n){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:n},o);return e.mergeEvaluated(i,r.Name),o}t.if(r._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=o(s);let r=!0;for(let t=0;te.error(!1,{discrError:o.DiscrError.Tag,tag:d,tagName:l}))),e.ok(u)}};t.default=i},7421:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(n=t.DiscrError||(t.DiscrError={})).Tag="tag",n.Mapping="mapping"},5671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2101),o=n(7499),i=n(6951),s=n(4480),a=n(2480),c=[r.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},3599:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=c;l.validateFormats&&(i?function(){const i=n.scopeValue("formats",{ref:p.formats,code:l.code.formats}),s=n.const("fDef",r._`${i}[${a}]`),c=n.let("fType"),u=n.let("format");n.if(r._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>n.assign(c,r._`${s}.type || "string"`).assign(u,r._`${s}.validate`)),(()=>n.assign(c,r._`"string"`).assign(u,s))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${u}`,function(){const e=d.$async?r._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:r._`${u}(${o})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const i=p.formats[s];if(!i)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}p.logger.warn(e())}();if(!0===i)return;const[a,c,h]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(s)}`:void 0,o=n.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,r._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${h}(${o})`}return"function"==typeof c?r._`${h}(${o})`:r._`${h}.test(${o})`}())}())}};t.default=o},4480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(3599).default];t.default=r},2480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},6577:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(r._`!${(0,o.useFunc)(t,i.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=s},9450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum,d=(0,o.useFunc)(t,i.default);let p;if(u||s)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(r._`${d}(${n}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,r.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?r._`${d}(${n}, ${e}[${t}])`:r._`${n} === ${o}`}(e,o))))}e.pass(p)}};t.default=s},7499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1337),o=n(9706),i=n(9507),s=n(1216),a=n(34),c=n(6962),l=n(1135),u=n(194),d=n(6577),p=n(9450),h=[r.default,o.default,i.default,s.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default];t.default=h},1135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${i} ${o}`)}};t.default=o},9507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(9161),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,o.useFunc)(e.gen,i.default)}(${n})`;e.fail$data(r._`${l} ${c} ${s}`)}};t.default=s},1337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=r.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>r.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data(r._`${n} ${i[t].fail} ${o} || isNaN(${n})`)}};t.default=a},34:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${i} ${o}`)}};t.default=o},9706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};t.default=o},1216:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?o._`(new RegExp(${s}, ${c}))`:(0,r.usePattern)(e,i);e.fail$data(o._`!${l}.test(${t})`)}};t.default=i},6962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:s,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===n.length)return;const d=n.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)e.block$data(o.nil,p);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,i){e.setParams({missingProperty:n}),t.forOf(n,s,(()=>{t.assign(i,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,i)),(0,r.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function p(){t.forOf("prop",s,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,u.ownProperties),(()=>e.error()))}))}}};t.default=s},194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7332),o=n(5669),i=n(8936),s=n(4285),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!a&&!c)return;const p=t.let("valid"),h=l.items?(0,r.getSchemaTypes)(l.items):[];function f(i,s){const a=t.name("item"),c=(0,r.checkDataTypes)(h,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${n}[${i}]`),t.if(c,o._`continue`),h.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,o._`${l}[${a}]`),e.error(),t.assign(p,!1).break()})).code(o._`${l}[${a}] = ${i}`)}))}function m(r,a){const c=(0,i.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(o._`;${r}--;`,(()=>t.for(o._`${a} = ${r}; ${a}--;`,(()=>t.if(o._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(p,!1).break(l)}))))))}e.block$data(p,(function(){const r=t.let("i",o._`${n}.length`),i=t.let("j");e.setParams({i:r,j:i}),t.assign(p,!0),t.if(o._`${r} > 1`,(()=>(h.length>0&&!h.some((e=>"object"===e||"array"===e))?f:m)(r,i)))}),o._`${u} === false`),e.ok(p)}};t.default=a},3245:(e,t,n)=>{"use strict";var r=n(1767),o=function(){function e(t){if(e.INSTANCE)throw new Error("Console logging adapter tracking should be configured from the applicationInsights object");this._client=t,e.INSTANCE=this}return e.prototype.enable=function(e,t){r.IsInitialized&&(n(2469).wp(e&&t,this._client),n(3805).wp(e,this._client),n(7916).wp(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1,!1)},e._methodNames=["debug","info","log","warn","error"],e}();e.exports=o},6751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2010),o=n(1767),i=function(){function e(){}return e.getCurrentContext=function(){if(!e.enabled)return null;var t=e.session.get(e.CONTEXT_NAME);return void 0===t?null:t},e.generateContextObject=function(e,t,n,r,o,i){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t,traceparent:o,tracestate:i},customProperties:new s(r)}:null},e.runWithContext=function(t,n){return e.enabled?e.session.bind(n,((r={})[e.CONTEXT_NAME]=t,r))():n();var r},e.wrapEmitter=function(t){e.enabled&&e.session.bindEmitter(t)},e.wrapCallback=function(t){return e.enabled?e.session.bind(t):t},e.enable=function(t){this.enabled||(this.isNodeVersionCompatible()?(e.hasEverEnabled||(this.forceClsHooked=t,this.hasEverEnabled=!0,void 0===this.cls&&(!0===e.forceClsHooked||void 0===e.forceClsHooked&&e.shouldUseClsHooked()?this.cls=n(9172):this.cls=n(2611)),e.session=this.cls.createNamespace("AI-CLS-Session"),o.registerContextPreservation((function(t){return e.session.bind(t)}))),this.enabled=!0):this.enabled=!1)},e.disable=function(){this.enabled=!1},e.reset=function(){e.hasEverEnabled&&(e.session=null,e.session=this.cls.createNamespace("AI-CLS-Session"))},e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},e.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},e.canUseClsHooked=function(){var e=process.versions.node.split("."),t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r},e.enabled=!1,e.hasEverEnabled=!1,e.forceClsHooked=void 0,e.CONTEXT_NAME="ApplicationInsights-Context",e}();t.CorrelationContextManager=i;var s=function(){function e(e){this.props=[],this.addHeaderData(e)}return e.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map((function(e){var t=e.split("=");return{key:t[0],value:t[1]}})).concat(this.props)},e.prototype.serializeToHeader=function(){return this.props.map((function(e){return e.key+"="+e.value})).join(", ")},e.prototype.getProperty=function(e){for(var t=0;t0&&process.once("uncaughtException",(function(){e.post.call(l,p,!0),s.delete(h),e.destroy.call(null,p)}))}e.post.call(l,p,!1),u=null,(a||d)&&(d=!1,s.delete(h),e.destroy.call(null,p))},h=c.apply(r,n),s.set(h,p),h},r[o]=function(t){if(u===t&&null!==t)d=!0;else if(s.has(t)){const n=s.get(t);s.delete(t),e.destroy.call(null,n)}l.apply(r,arguments)}}e.exports=function(){p(this._hooks,this._state,"setTimeout","clearTimeout",o,a,!0),p(this._hooks,this._state,"setInterval","clearInterval",i,c,!1),p(this._hooks,this._state,"setImmediate","clearImmediate",s,l,!0),global.setTimeout=r.setTimeout,global.setInterval=r.setInterval,global.setImmediate=r.setImmediate,global.clearTimeout=r.clearTimeout,global.clearInterval=r.clearInterval,global.clearImmediate=r.clearImmediate}},7600:e=>{"use strict";e.exports=(e,t)=>class extends e{constructor(e){var n,r;super((function(e,i){n=this,r=[function(n){return t(o,!1),e(n)},function(e){return t(o,!1),i(e)}]}));var o=this;try{e.apply(n,r)}catch(e){r[1](e)}return o}}},1747:(e,t,n)=>{var r,o,i=n(4403).wrap,s=[],a=0,c=!1,l=[];function u(e,t){var n=e.length,r=t.length,o=[];if(0===n&&0===r)return o;for(var i=0;i0&&(s=l.pop()),d=void 0,n&&!c},o=function(e,t,n){var r=[];c=!0;for(var o=0;o0&&t[o].before(this,r[t[o].uid]);c=!1;var i=e.apply(this,arguments);for(c=!0,o=0;o0&&t[o].after(this,r[t[o].uid]);return c=!1,s=l.pop(),d=void 0,i}},i(process,"_fatalException",(function(e){return function(t){return r(t)||e(t)}}))}else{var h=!1;r=function(e){if(h)throw e;for(var t=!1,n=s.length,r=0;r0&&t[p].before(this,o[t[p].uid]);c=!1;try{i=e.apply(this,arguments)}catch(e){for(a=!0,p=0;p0&&t[p].after(this,o[t[p].uid]);c=!1}s=l.pop()}return i}},process.addListener("uncaughtException",r)}function f(e,t){"function"==typeof e.create&&(this.create=e.create,this.flags|=1),"function"==typeof e.before&&(this.before=e.before,this.flags|=2),"function"==typeof e.after&&(this.after=e.after,this.flags|=4),"function"==typeof e.error&&(this.error=e.error,this.flags|=8),this.uid=++a,this.data=void 0===t?null:t}function m(e,t){if("object"!=typeof e||!e)throw new TypeError("callbacks argument must be an object");return e instanceof f?e:new f(e,t)}f.prototype.create=void 0,f.prototype.before=void 0,f.prototype.after=void 0,f.prototype.error=void 0,f.prototype.data=void 0,f.prototype.uid=0,f.prototype.flags=0,process.createAsyncListener=m,process.addAsyncListener=function(e,t){var n;n=e instanceof f?e:m(e,t);for(var r=!1,o=0;o0)return o(e,n,t);return function(e,t,n){c=!0;for(var r=0;r{"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(4403),o=n(3341),i=r.wrap,s=r.massWrap,a=n(1747),c=n(3837),l=o.gte(process.version,"6.0.0"),u=o.gte(process.version,"7.0.0"),d=o.gte(process.version,"8.0.0"),p=o.gte(process.version,"11.0.0"),h=n(1808);function f(e){return function(){this.on("connection",(function(e){e._handle&&(e._handle.onread=a(e._handle.onread))}));try{return e.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=a(this._handle.onconnection))}}}function m(e){if(e&&e._handle){var t=e._handle;t._originalOnread||(t._originalOnread=t.onread),t.onread=a(t._originalOnread)}}u&&!h._normalizeArgs?h._normalizeArgs=function(e){if(0===e.length)return[{},null];var t,n,r=e[0],o={};"object"==typeof r&&null!==r?o=r:"string"==typeof(t=r)&&!1===(n=t,(n=Number(n))>=0&&n)?o.path=r:(o.port=r,e.length>1&&"string"==typeof e[1]&&(o.host=e[1]));var i=e[e.length-1];return"function"!=typeof i?[o,null]:[o,i]}:u||h._normalizeConnectArgs||(h._normalizeConnectArgs=function(e){var t,n={};"object"==typeof e[0]&&null!==e[0]?n=e[0]:"string"==typeof e[0]&&!1===(t=e[0],(t=Number(t))>=0&&t)?n.path=e[0]:(n.port=e[0],"string"==typeof e[1]&&(n.host=e[1]));var r=e[e.length-1];return"function"==typeof r?[n,r]:[n]}),"_setUpListenHandle"in h.Server.prototype?i(h.Server.prototype,"_setUpListenHandle",f):i(h.Server.prototype,"_listen2",f),i(h.Socket.prototype,"connect",(function(e){return function(){var t;(t=d&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?arguments[0]:u?h._normalizeArgs(arguments):h._normalizeConnectArgs(arguments))[1]&&(t[1]=a(t[1]));var n=e.apply(this,t);return m(this),n}}));var g=n(3685);i(g.Agent.prototype,"addRequest",(function(e){return function(t){var n=t.onSocket;return t.onSocket=a((function(e){return m(e),n.apply(this,arguments)})),e.apply(this,arguments)}}));var _=n(2081);function y(e){Array.isArray(e.stdio)&&e.stdio.forEach((function(e){e&&e._handle&&(e._handle.onread=a(e._handle.onread),i(e._handle,"close",A))})),e._handle&&(e._handle.onexit=a(e._handle.onexit))}_.ChildProcess?i(_.ChildProcess.prototype,"spawn",(function(e){return function(){var t=e.apply(this,arguments);return y(this),t}})):s(_,["execFile","fork","spawn"],(function(e){return function(){var t=e.apply(this,arguments);return y(t),t}})),process._fatalException||(process._originalNextTick=process.nextTick);var v=[];process._nextDomainTick&&v.push("_nextDomainTick"),process._tickDomainCallback&&v.push("_tickDomainCallback"),s(process,v,O),i(process,"nextTick",A);var b=["setTimeout","setInterval"];global.setImmediate&&b.push("setImmediate");var w=n(9512),x=global.setTimeout===w.setTimeout;s(w,b,A),x&&s(global,b,A);var T=n(9523);s(T,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],O),T.resolveNaptr&&i(T,"resolveNaptr",O);var E,C,S=n(7147);s(S,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],O),S.lchown&&i(S,"lchown",O),S.lchmod&&i(S,"lchmod",O),S.ftruncate&&i(S,"ftruncate",O);try{E=n(9796)}catch(e){}if(E&&E.Deflate&&E.Deflate.prototype){var k=Object.getPrototypeOf(E.Deflate.prototype);k._transform?i(k,"_transform",O):k.write&&k.flush&&k.end&&s(k,["write","flush","end"],O)}try{C=n(6113)}catch(e){}if(C){var P=["pbkdf2","randomBytes"];p||P.push("pseudoRandomBytes"),s(C,P,O)}var I=!!global.Promise&&"function Promise() { [native code] }"===Promise.toString()&&"function toString() { [native code] }"===Promise.toString.toString();if(I){var R=process.addAsyncListener({create:function(){I=!1}});global.Promise.resolve(!0).then((function(){I=!1})),process.removeAsyncListener(R)}function O(e){var t=function(){var t,n=arguments.length-1;if("function"==typeof arguments[n]){t=Array(arguments.length);for(var r=0;r{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var $=s++;i[$]="^"+i[D]+i[C]+"$";var j=s++;i[j]="^"+i[D]+i[S]+"$";var L=s++;i[L]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var H=s++;i[H]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[L]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[H]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[L]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[j]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[U],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2172:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(632),a="error@context",c=[];for(let e in s.providers)c[s.providers[e]]=e;const l=process.env.DEBUG_CLS_HOOKED;let u=-1;function d(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}function p(e){return process.namespaces[e]}function h(e){let t=p(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function f(e){process.env.DEBUG&&process._rawDebug(e)}function m(e){return e?"function"==typeof e?e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]:e.constructor&&e.constructor.name?e.constructor.name:void 0:e}if(e.exports={getNamespace:p,createNamespace:function(e){o.ok(e,"namespace must be given a name."),l&&f("CREATING NAMESPACE "+e);let t=new d(e);return t.id=u,s.addHooks({init(n,o,i,s,a){u=n,s?(t._contexts.set(n,t._contexts.get(s)),l&&f("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+i)):t._contexts.set(u,t.active),l&&f("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+c[i]+" active:"+r.inspect(t.active,!0))},pre(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" PRE "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.enter(i)):l&&f(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},post(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" POST "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.exit(i)):l&&f(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},destroy(n){u=n,l&&f("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(u))+" active:"+r.inspect(t.active,!0)),t._contexts.delete(n)}}),process.namespaces[e]=t,t},destroyNamespace:h,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){h(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},d.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return l&&f(" SETTING KEY:"+e+"="+t+" in ns:"+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e]=t,t},d.prototype.get=function(e){if(this.active)return l&&f(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e];l&&f(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0))},d.prototype.createContext=function(){l&&f(" CREATING Context: "+this.name+" uid:"+u+" len:"+this._set.length+" active:"+r.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=u,l&&f(" CREATED Context: "+this.name+" uid:"+u+" len:"+this._set.length+" context:"+r.inspect(e,!0,2,!0)),e},d.prototype.run=function(e){let t=this.createContext();this.enter(t);try{return l&&f(" BEFORE RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),e(t),t}catch(e){throw e&&(e[a]=t),e}finally{l&&f(" AFTER RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t)}},d.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},d.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return l&&f(" BEFORE runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},d.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},d.prototype.enter=function(e){o.ok(e,"context must be provided for entering"),l&&f(" ENTER "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this._set.push(this.active),this.active=e},d.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),l&&f(" EXIT "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(l&&f("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},d.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},d.prototype.fromException=function(e){return e[a]},process.namespaces={},s._state&&!s._state.enabled&&s.enable(),l){var g=n(6818);for(var _ in g.filter._modifiers)g.filter.deattach(_)}},8423:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(852),a="error@context",c=process.env.DEBUG_CLS_HOOKED;let l=-1;function u(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}function d(e){return process.namespaces[e]}function p(e){let t=d(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function h(...e){c&&process._rawDebug(`${r.format(...e)}`)}e.exports={getNamespace:d,createNamespace:function(e){o.ok(e,"namespace must be given a name."),c&&h(`NS-CREATING NAMESPACE (${e})`);let t=new u(e);return t.id=l,s.createHook({init(n,o,i,a){if(l=s.executionAsyncId(),t.active){if(t._contexts.set(n,t.active),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(0===l){const i=s.triggerAsyncId(),u=t._contexts.get(i);if(u){if(t._contexts.set(n,u),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT USING CONTEXT FROM TRIGGERID [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT MISSING CONTEXT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}if(c&&"PROMISE"===o){h(r.inspect(a,{showHidden:!0}));const s=a.parentId;h(`${" ".repeat(t._indent<0?0:t._indent)}INIT RESOURCE-PROMISE [${o}] (${e}) parentId:${s} asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}},before(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`),t._indent+=2}t.enter(o)}else if(c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${r.inspect(t._contexts,{showHidden:!0,depth:2,colors:!0})}`),t._indent+=2}},after(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}t.exit(o)}else if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}},destroy(n){if(l=s.executionAsyncId(),c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}DESTROY (${e}) currentUid:${l} asyncId:${n} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(t._contexts.get(l))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t},destroyNamespace:p,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){p(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},u.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,c&&h(" ".repeat(this._indent<0?0:this._indent)+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),t},u.prototype.get=function(e){if(this.active){if(c){const t=s.executionAsyncId(),n=s.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);h(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),h(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]}if(c){const t=s.currentId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}},u.prototype.createContext=function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=l,c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-CREATED Context: (${this.name}) currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},u.prototype.run=function(e){let t=this.createContext();this.enter(t);try{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}return e(t),t}catch(e){throw e&&(e[a]=t),e}finally{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN END: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}},u.prototype.runAndReturn=function(e){let t;return this.run((function(n){t=e(n)})),t},u.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return c&&h("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(c&&h("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,c&&h("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},u.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},u.prototype.enter=function(e){if(o.ok(e,"context must be provided for entering"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-ENTER: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active),this.active=e},u.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-EXIT: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(c&&h("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},u.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},u.prototype.fromException=function(e){return e[a]},process.namespaces={}},9172:(e,t,n)=>{"use strict";const r=n(2173);process&&r.gte(process.versions.node,"8.0.0")?e.exports=n(8423):e.exports=n(2172)},2173:(e,t)=>{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var $=s++;i[$]="^"+i[D]+i[C]+"$";var j=s++;i[j]="^"+i[D]+i[S]+"$";var L=s++;i[L]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var H=s++;i[H]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[L]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[H]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[L]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[j]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[U],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2611:(e,t,n)=>{"use strict";var r=n(9491),o=n(7267),i="error@context";function s(e){this.name=e,this.active=null,this._set=[],this.id=null}function a(e){return process.namespaces[e]}function c(e){var t=a(e);r.ok(t,"can't delete nonexistent namespace!"),r.ok(t.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(t.id),process.namespaces[e]=null}function l(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){c(e)})),process.namespaces=Object.create(null)}process.addAsyncListener||n(1274),s.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,t},s.prototype.get=function(e){if(this.active)return this.active[e]},s.prototype.createContext=function(){return Object.create(this.active)},s.prototype.run=function(e){var t=this.createContext();this.enter(t);try{return e(t),t}catch(e){throw e&&(e[i]=t),e}finally{this.exit(t)}},s.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},s.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());var n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[i]=t),e}finally{n.exit(t)}}},s.prototype.enter=function(e){r.ok(e,"context must be provided for entering"),this._set.push(this.active),this.active=e},s.prototype.exit=function(e){if(r.ok(e,"context must be provided for exiting"),this.active===e)return r.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());var t=this._set.lastIndexOf(e);r.ok(t>=0,"context not currently entered; can't exit"),r.ok(t,"can't remove top context"),this._set.splice(t,1)},s.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this,n="context@"+this.name;o(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;var t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){var r=n[e];t=r.namespace.bind(t,r.context)})),t}))},s.prototype.fromException=function(e){return e[i]},process.namespaces||l(),e.exports={getNamespace:a,createNamespace:function(e){r.ok(e,"namespace must be given a name!");var t=new s(e);return t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){n&&t.enter(n)},after:function(e,n){n&&t.exit(n)},error:function(e){e&&t.exit(e)}}),process.namespaces[e]=t,t},destroyNamespace:c,reset:l}},6725:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],s=[],a=[],c=[],l=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,o[n]=f,i[f]=n;var m=e[n],g=e[m],_=e[g],y=257*e[f]^16843008*f;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*_^65537*g^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=m^e[e[e[_^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],s=0;s6&&s%n==4&&(l=o[l>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l]):(l=o[(l=l<<8|l>>>24)>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l],l^=f[s/n|0]<<24),i[s]=i[s-n]^l);for(var a=this._invKeySchedule=[],c=0;c>>24]]^d[o[l>>>16&255]]^p[o[l>>>8&255]]^h[o[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,l,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,s,a){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f>>24]^o[u>>>16&255]^i[d>>>8&255]^s[255&p]^n[h++],g=r[u>>>24]^o[d>>>16&255]^i[p>>>8&255]^s[255&l]^n[h++],_=r[d>>>24]^o[p>>>16&255]^i[l>>>8&255]^s[255&u]^n[h++],y=r[p>>>24]^o[l>>>16&255]^i[u>>>8&255]^s[255&d]^n[h++];l=m,u=g,d=_,p=y}m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^n[h++],g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&l])^n[h++],_=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^n[h++],y=(a[p>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],e[t]=m,e[t+1]=g,e[t+2]=_,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)},8976:function(e,t,n){var r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w;e.exports=(r=n(8112),n(6165),void(r.lib.Cipher||(o=r,i=o.lib,s=i.Base,a=i.WordArray,c=i.BufferedBlockAlgorithm,l=o.enc,l.Utf8,u=l.Base64,d=o.algo.EvpKDF,p=i.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?w:v}return function(t){return{encrypt:function(n,r,o){return e(r).encrypt(t,n,r,o)},decrypt:function(n,r,o){return e(r).decrypt(t,n,r,o)}}}}()}),i.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),h=o.mode={},f=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=h.CBC=function(){var e=f.extend();function t(e,t,n){var r,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var i=0;i>>2];e.sigBytes-=t}},i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:m,padding:g}),reset:function(){var e;p.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),_=i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(o.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?a.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),_.create({ciphertext:n,salt:t})}},v=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r),i=o.finalize(t),s=o.cfg;return _.create({ciphertext:i,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(o.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var o=d.create({keySize:t+n}).compute(e,r),i=a.create(o.words.slice(t),4*n);return o.sigBytes=4*t,_.create({key:o,iv:i,salt:r})}},w=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:b}),encrypt:function(e,t,n,r){var o=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=o.iv;var i=v.encrypt.call(this,e,t,o.key,r);return i.mixIn(o),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var o=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=o.iv,v.decrypt.call(this,e,t,o.key,r)}}))))},8112:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r)try{r=n(6113)}catch(e){}var o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(i=0;i>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},p=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},h=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*c,i);if(c){for(var d=0;d>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},8559:function(e,t,n){var r;e.exports=(r=n(8112),function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(r,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(r,2*n)}}}(),r.enc.Utf16)},6165:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(1284),n(3456),i=(o=(r=u).lib).Base,s=o.WordArray,c=(a=r.algo).MD5,l=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),i=s.create(),a=i.words,c=r.keySize,l=r.iterations;a.lengthr&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,l=0;l>>2]|=e[o]<<24-o%4*8;t.call(this,r,n)}else t.apply(this,arguments)};n.prototype=e}}(),r.lib.WordArray)},4678:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,s=e[t+0],c=e[t+1],h=e[t+2],f=e[t+3],m=e[t+4],g=e[t+5],_=e[t+6],y=e[t+7],v=e[t+8],b=e[t+9],w=e[t+10],x=e[t+11],T=e[t+12],E=e[t+13],C=e[t+14],S=e[t+15],k=i[0],P=i[1],I=i[2],R=i[3];k=l(k,P,I,R,s,7,a[0]),R=l(R,k,P,I,c,12,a[1]),I=l(I,R,k,P,h,17,a[2]),P=l(P,I,R,k,f,22,a[3]),k=l(k,P,I,R,m,7,a[4]),R=l(R,k,P,I,g,12,a[5]),I=l(I,R,k,P,_,17,a[6]),P=l(P,I,R,k,y,22,a[7]),k=l(k,P,I,R,v,7,a[8]),R=l(R,k,P,I,b,12,a[9]),I=l(I,R,k,P,w,17,a[10]),P=l(P,I,R,k,x,22,a[11]),k=l(k,P,I,R,T,7,a[12]),R=l(R,k,P,I,E,12,a[13]),I=l(I,R,k,P,C,17,a[14]),k=u(k,P=l(P,I,R,k,S,22,a[15]),I,R,c,5,a[16]),R=u(R,k,P,I,_,9,a[17]),I=u(I,R,k,P,x,14,a[18]),P=u(P,I,R,k,s,20,a[19]),k=u(k,P,I,R,g,5,a[20]),R=u(R,k,P,I,w,9,a[21]),I=u(I,R,k,P,S,14,a[22]),P=u(P,I,R,k,m,20,a[23]),k=u(k,P,I,R,b,5,a[24]),R=u(R,k,P,I,C,9,a[25]),I=u(I,R,k,P,f,14,a[26]),P=u(P,I,R,k,v,20,a[27]),k=u(k,P,I,R,E,5,a[28]),R=u(R,k,P,I,h,9,a[29]),I=u(I,R,k,P,y,14,a[30]),k=d(k,P=u(P,I,R,k,T,20,a[31]),I,R,g,4,a[32]),R=d(R,k,P,I,v,11,a[33]),I=d(I,R,k,P,x,16,a[34]),P=d(P,I,R,k,C,23,a[35]),k=d(k,P,I,R,c,4,a[36]),R=d(R,k,P,I,m,11,a[37]),I=d(I,R,k,P,y,16,a[38]),P=d(P,I,R,k,w,23,a[39]),k=d(k,P,I,R,E,4,a[40]),R=d(R,k,P,I,s,11,a[41]),I=d(I,R,k,P,f,16,a[42]),P=d(P,I,R,k,_,23,a[43]),k=d(k,P,I,R,b,4,a[44]),R=d(R,k,P,I,T,11,a[45]),I=d(I,R,k,P,S,16,a[46]),k=p(k,P=d(P,I,R,k,h,23,a[47]),I,R,s,6,a[48]),R=p(R,k,P,I,y,10,a[49]),I=p(I,R,k,P,C,15,a[50]),P=p(P,I,R,k,g,21,a[51]),k=p(k,P,I,R,T,6,a[52]),R=p(R,k,P,I,f,10,a[53]),I=p(I,R,k,P,w,15,a[54]),P=p(P,I,R,k,c,21,a[55]),k=p(k,P,I,R,v,6,a[56]),R=p(R,k,P,I,S,10,a[57]),I=p(I,R,k,P,_,15,a[58]),P=p(P,I,R,k,E,21,a[59]),k=p(k,P,I,R,m,6,a[60]),R=p(R,k,P,I,x,10,a[61]),I=p(I,R,k,P,h,15,a[62]),P=p(P,I,R,k,b,21,a[63]),i[0]=i[0]+k|0,i[1]=i[1]+P|0,i[2]=i[2]+I|0,i[3]=i[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),s=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,o,i,s){var a=e+(t&n|~t&r)+o+s;return(a<>>32-i)+t}function u(e,t,n,r,o,i,s){var a=e+(t&r|n&~r)+o+s;return(a<>>32-i)+t}function d(e,t,n,r,o,i,s){var a=e+(t^n^r)+o+s;return(a<>>32-i)+t}function p(e,t,n,r,o,i,s){var a=e+(n^(t|~r))+o+s;return(a<>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)},8581:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,n,r){var o,i=this._iv;i?(o=i.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var s=0;s>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var a=s.slice(0);r.encryptBlock(a,0);for(var c=0;c>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)},7051:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(o-1)).concat(r.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)},6863:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)},6261:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},2864:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},r.pad.ZeroPadding)},9220:function(e,t,n){var r,o,i,s,a,c,l,u,d;e.exports=(d=n(8112),n(1284),n(3456),i=(o=(r=d).lib).Base,s=o.WordArray,c=(a=r.algo).SHA1,l=a.HMAC,u=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=l.create(n.hasher,e),o=s.create(),i=s.create([1]),a=o.words,c=i.words,u=n.keySize,d=n.iterations;a.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)r[o]^=n[o+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=p,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),r.RabbitLegacy)},5129:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],a=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)o[n]^=r[n+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(o[0]^=l,o[1]^=d,o[2]^=u,o[3]^=p,o[4]^=l,o[5]^=d,o[6]^=u,o[7]^=p,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),r.Rabbit)},3954:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var i=0;o<256;o++){var s=o%n,a=t[s>>>2]>>>24-s%4*8&255;i=(i+r[o]+a)%256;var c=r[o];r[o]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}e.RC4=t._createHelper(o);var s=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(),r.RC4)},3787:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=o.create([0,1518500249,1859775393,2400959708,2840853838]),p=o.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=i.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i,s,h,b,w,x,T,E,C,S,k,P=this._hash.words,I=d.words,R=p.words,O=a.words,A=c.words,N=l.words,D=u.words;for(x=i=P[0],T=s=P[1],E=h=P[2],C=b=P[3],S=w=P[4],n=0;n<80;n+=1)k=i+e[t+O[n]]|0,k+=n<16?f(s,h,b)+I[0]:n<32?m(s,h,b)+I[1]:n<48?g(s,h,b)+I[2]:n<64?_(s,h,b)+I[3]:y(s,h,b)+I[4],k=(k=v(k|=0,N[n]))+w|0,i=w,w=b,b=v(h,10),h=s,s=k,k=x+e[t+A[n]]|0,k+=n<16?y(T,E,C)+R[0]:n<32?_(T,E,C)+R[1]:n<48?g(T,E,C)+R[2]:n<64?m(T,E,C)+R[3]:f(T,E,C)+R[4],k=(k=v(k|=0,D[n]))+S|0,x=S,S=C,C=v(E,10),E=T,T=k;k=P[1]+h+C|0,P[1]=P[2]+b+S|0,P[2]=P[3]+w+x|0,P[3]=P[4]+i+T|0,P[4]=P[0]+s+E|0,P[0]=k},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,i=o.words,s=0;s<5;s++){var a=i[s];i[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function v(e,t){return e<>>32-t}t.RIPEMD160=i._createHelper(h),t.HmacRIPEMD160=i._createHmacHelper(h)}(Math),r.RIPEMD160)},1284:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(o=(r=u=n(8112)).lib,i=o.WordArray,s=o.Hasher,a=r.algo,c=[],l=a.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],l=0;l<80;l++){if(l<16)c[l]=0|e[t+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+a+c[l];d+=l<20?1518500249+(o&i|~o&s):l<40?1859775393+(o^i^s):l<60?(o&i|o&s|i&s)-1894007588:(o^i^s)-899497514,a=s,s=i,i=o<<30|o>>>2,o=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=s._createHelper(l),r.HmacSHA1=s._createHmacHelper(l),u.SHA1)},3816:function(e,t,n){var r,o,i,s,a,c;e.exports=(c=n(8112),n(2232),o=(r=c).lib.WordArray,i=r.algo,s=i.SHA256,a=i.SHA224=s.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=s._createHelper(a),r.HmacSHA224=s._createHmacHelper(a),c.SHA224)},2232:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(a[o]=n(e.pow(r,.5))),c[o]=n(e.pow(r,1/3)),o++),r++}();var l=[],u=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=0;h<64;h++){if(h<16)l[h]=0|e[t+h];else{var f=l[h-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,g=l[h-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+_+l[h-16]}var y=r&o^r&i^o&i,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&d)+c[h]+l[h];p=d,d=u,u=a,a=s+b|0,s=i,i=o,o=r,r=b+(v+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(u),t.HmacSHA256=i._createHmacHelper(u)}(Math),r.SHA256)},1455:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.x64.Word,a=t.algo,c=[],l=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var a=0,d=0,p=0;p<7;p++){if(1&o){var h=(1<>>24)|4278255360&(i<<24|i>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(P=n[o]).high^=s,P.low^=i}for(var a=0;a<24;a++){for(var p=0;p<5;p++){for(var h=0,f=0,m=0;m<5;m++)h^=(P=n[p+5*m]).high,f^=P.low;var g=d[p];g.high=h,g.low=f}for(p=0;p<5;p++){var _=d[(p+4)%5],y=d[(p+1)%5],v=y.high,b=y.low;for(h=_.high^(v<<1|b>>>31),f=_.low^(b<<1|v>>>31),m=0;m<5;m++)(P=n[p+5*m]).high^=h,P.low^=f}for(var w=1;w<25;w++){var x=(P=n[w]).high,T=P.low,E=c[w];E<32?(h=x<>>32-E,f=T<>>32-E):(h=T<>>64-E,f=x<>>64-E);var C=d[l[w]];C.high=h,C.low=f}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,p=0;p<5;p++)for(m=0;m<5;m++){var P=n[w=p+5*m],I=d[w],R=d[(p+1)%5+5*m],O=d[(p+2)%5+5*m];P.high=I.high^~R.high&O.high,P.low=I.low^~R.low&O.low}P=n[0];var A=u[a];P.high^=A.high,P.low^=A.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,l=[],u=0;u>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(p)}return new o.init(l,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=i._createHelper(p),t.HmacSHA3=i._createHmacHelper(p)}(Math),r.SHA3)},1007:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(8400),n(9039),o=(r=u).x64,i=o.Word,s=o.WordArray,a=r.algo,c=a.SHA512,l=a.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},9039:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,s=e.algo;function a(){return o.create.apply(o,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=a()}();var u=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=r.high,f=r.low,m=o.high,g=o.low,_=i.high,y=i.low,v=s.high,b=s.low,w=a.high,x=a.low,T=u.high,E=u.low,C=d.high,S=d.low,k=p.high,P=p.low,I=h,R=f,O=m,A=g,N=_,D=y,M=v,$=b,j=w,L=x,F=T,q=E,B=C,H=S,U=k,W=P,z=0;z<80;z++){var K,V,G=l[z];if(z<16)V=G.high=0|e[t+2*z],K=G.low=0|e[t+2*z+1];else{var J=l[z-15],X=J.high,Q=J.low,Y=(X>>>1|Q<<31)^(X>>>8|Q<<24)^X>>>7,Z=(Q>>>1|X<<31)^(Q>>>8|X<<24)^(Q>>>7|X<<25),ee=l[z-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,oe=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=l[z-7],se=ie.high,ae=ie.low,ce=l[z-16],le=ce.high,ue=ce.low;V=(V=(V=Y+se+((K=Z+ae)>>>0>>0?1:0))+re+((K+=oe)>>>0>>0?1:0))+le+((K+=ue)>>>0>>0?1:0),G.high=V,G.low=K}var de,pe=j&F^~j&B,he=L&q^~L&H,fe=I&O^I&N^O&N,me=R&A^R&D^A&D,ge=(I>>>28|R<<4)^(I<<30|R>>>2)^(I<<25|R>>>7),_e=(R>>>28|I<<4)^(R<<30|I>>>2)^(R<<25|I>>>7),ye=(j>>>14|L<<18)^(j>>>18|L<<14)^(j<<23|L>>>9),ve=(L>>>14|j<<18)^(L>>>18|j<<14)^(L<<23|j>>>9),be=c[z],we=be.high,xe=be.low,Te=U+ye+((de=W+ve)>>>0>>0?1:0),Ee=_e+me;U=B,W=H,B=F,H=q,F=j,q=L,j=M+(Te=(Te=(Te=Te+pe+((de+=he)>>>0>>0?1:0))+we+((de+=xe)>>>0>>0?1:0))+V+((de+=K)>>>0>>0?1:0))+((L=$+de|0)>>>0<$>>>0?1:0)|0,M=N,$=D,N=O,D=A,O=I,A=R,I=Te+(ge+fe+(Ee>>>0<_e>>>0?1:0))+((R=de+Ee|0)>>>0>>0?1:0)|0}f=r.low=f+R,r.high=h+I+(f>>>0>>0?1:0),g=o.low=g+A,o.high=m+O+(g>>>0>>0?1:0),y=i.low=y+D,i.high=_+N+(y>>>0>>0?1:0),b=s.low=b+$,s.high=v+M+(b>>>0<$>>>0?1:0),x=a.low=x+L,a.high=w+j+(x>>>0>>0?1:0),E=u.low=E+q,u.high=T+F+(E>>>0>>0?1:0),S=d.low=S+H,d.high=C+B+(S>>>0>>0?1:0),P=p.low=P+W,p.high=k+U+(P>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},9708:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=s[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var l=o[i]=[],u=c[i];for(n=0;n<24;n++)l[n/6|0]|=t[(a[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(a[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var d=this._invSubKeys=[];for(n=0;n<16;n++)d[n]=o[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),p.call(this,1,1431655765);for(var r=0;r<16;r++){for(var o=n[r],i=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=l[c][((s^o[c])&u[c])>>>0];this._lBlock=s,this._rBlock=i^a}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,p.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(f)}(),r.TripleDES)},8400:function(e,t,n){var r,o,i,s,a,c;e.exports=(r=n(8112),i=(o=r).lib,s=i.Base,a=i.WordArray,(c=o.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(9374)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},9374:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(6292):e.exports=n(4428)},4428:(e,t,n)=>{const r=n(6224),o=n(3837);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(6974);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=n(9374)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},1321:e=>{"use strict";e.exports=(e,t,n)=>{const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}},2784:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 1.0.0 < 2.0.0",patch:function(e){try{var s=new(0,n(8028).BasicTracer)(o.channel.spanContextPropagator?{scopeManager:o.channel.spanContextPropagator}:void 0),a=s.startSpan;s.startSpan=function(e,t){if(!t||!t.parent){var n=s.getCurrentSpan();n&&n.operation&&n.operation.traceparent&&(t=r({},t,{parent:{traceId:n.operation.traceparent.traceId,spanId:n.operation.traceparent.spanId}}))}var o=a.call(this,e,t);return o.addEvent("Application Insights Integration enabled"),o},s.addSpanProcessor(new i),s[t.AzureMonitorSymbol]=!0,e.setTracer(s)}catch(e){}return e}},t.enable=function(){o.channel.registerMonkeyPatch("@azure/core-tracing",t.azureCoreTracing)}},248:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:function(e){var t=e.prototype._emit;return e.prototype._emit=function(e,n){var o=t.apply(this,arguments);if(!n){var i=o;i||(i=t.call(this,e,!0)),r.channel.publish("bunyan",{level:e.level,result:i})}return o},e}},t.enable=function(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}},8159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2781);t.console={versionSpecifier:">= 4.0.0",patch:function(e){var t=new o.Writable,n=new o.Writable;t.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t}),!0},n.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t,stderr:!0}),!0};for(var i=new e.Console(t,n),s=function(t){var n=e[t];n&&(e[t]=function(){if(i[t])try{i[t].apply(i,arguments)}catch(e){}return n.apply(e,arguments)})},a=0,c=["log","info","warn","error","dir","time","timeEnd","trace","assert"];a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2784);t.azuresdk=r;var o=n(248);t.bunyan=o;var i=n(8159);t.console=i;var s=n(7834);t.mongodbCore=s;var a=n(4826);t.mongodb=a;var c=n(5856);t.mysql=c;var l=n(8345);t.pgPool=l;var u=n(7726);t.pg=u;var d=n(4765);t.redis=d;var p=n(1624);t.tedious=p;var h=n(8041);t.winston=h,t.enable=function(){o.enable(),i.enable(),s.enable(),a.enable(),c.enable(),u.enable(),l.enable(),d.enable(),h.enable(),r.enable(),p.enable()}},7834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.Server.prototype.connect;return e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.pool.write;this.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=r.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var o=this.s.pool.logout;return this.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=r.channel.bindToContext(arguments[1])),o.apply(this,arguments)},e},e}},t.enable=function(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore)}},4826:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 2.0.0 <= 3.0.5",patch:function(e){var t=e.instrument({operationIdGenerator:{next:function(){return o.channel.bindToContext((function(e){return e()}))}}}),n={};return t.on("started",(function(e){n[e.requestId]||(n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),e}},t.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:function(e){var t=e.instrument(),n={},i={};return t.on("started",(function(e){n[e.requestId]||(i[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete i[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete i[e.requestId])})),e}},t.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:function(e){!function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.coreTopology.s.pool.write;this.s.coreTopology.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=o.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var r=this.s.coreTopology.s.pool.logout;return this.s.coreTopology.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=o.channel.bindToContext(arguments[1])),r.apply(this,arguments)},e}}(e);var t=e.instrument(),n={},r={};return t.on("started",(function(e){n[e.requestId]||(r[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=e)})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete r[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete r[e.requestId])})),e}},t.enable=function(){o.channel.registerMonkeyPatch("mongodb",t.mongo2),o.channel.registerMonkeyPatch("mongodb",t.mongo3),o.channel.registerMonkeyPatch("mongodb",t.mongo330)}},5856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(1017);t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:function(e,t){var i=function(e,t){return function(t,n){var o=e[t];o&&(e[t]=function(){for(var e=arguments.length-1,t=arguments.length-1;t>=0;--t){if("function"==typeof arguments[t]){e=t;break}if(void 0!==arguments[t])break}var i=arguments[e],s={result:null,startTime:null,startDate:null};"function"==typeof i&&(n?(s.startTime=process.hrtime(),s.startDate=new Date,arguments[e]=r.channel.bindToContext(n(s,i))):arguments[e]=r.channel.bindToContext(i));var a=o.apply(this,arguments);return s.result=a,a})}},s=function(e,t){return i(e.prototype)},a=n(1055)(o.dirname(t)+"/lib/Connection");["connect","changeUser","ping","statistics","end"].forEach((function(e){return s(a)(e)})),i(a)("createQuery",(function(e,t){return function(n){var o=process.hrtime(e.startTime),i=1e3*o[0]+o[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:i,time:e.startDate}),t.apply(this,arguments)}}));var c=n(6990)(o.dirname(t)+"/lib/Pool");return["_enqueueCallback"].forEach((function(e){return s(c)(e)})),e}},t.enable=function(){r.channel.registerMonkeyPatch("mysql",t.mysql)}},8345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:function(e){var t=e.prototype.connect;return e.prototype.connect=function(e){return e&&(arguments[0]=r.channel.bindToContext(e)),t.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}},7726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2361);t.postgres6={versionSpecifier:"6.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},l=process.hrtime();function u(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(l);if(c.result=n&&{rowCount:n.rowCount,command:n.command},c.error=t,c.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",c),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(c.query.preparable={text:e,args:t},s=u(s)):(c.query.text=e,s?s=u(s):t=u(t)):("string"==typeof e.name?c.query.plan=e.name:e.values instanceof Array?c.query.preparable={text:e.text,args:e.values}:c.query.text=e.text,s?s=u(s):t?t=u(t):e.callback=u(e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments)},e}},t.postgres7={versionSpecifier:">=7.* <=8.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c=this,l=!!s,u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime();function p(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(d);if(u.result=n&&{rowCount:n.rowCount,command:n.command},u.error=t,u.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",u),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(u.query.preparable={text:e,args:t},s=(l="function"==typeof s)?p(s):s):(u.query.text=e,s?s=(l="function"==typeof s)?p(s):s:t=(l="function"==typeof t)?p(t):t):("string"==typeof e.name?u.query.plan=e.name:e.values instanceof Array?u.query.preparable={text:e.text,args:e.values}:u.query.text=e.text,s?(l="function"==typeof s,s=p(s)):t?t=(l="function"==typeof t)?p(t):t:(l="function"==typeof e.callback,e.callback=l?p(e.callback):e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments),l?a:a.then((function(e){return p()(void 0,e),new c._Promise((function(t,n){t(e)}))})).catch((function(e){return p()(e,void 0),new c._Promise((function(t,n){n(e)}))}))},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg",t.postgres6),r.channel.registerMonkeyPatch("pg",t.postgres7)}},4765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.RedisClient.prototype.internal_send_command;return e.RedisClient.prototype.internal_send_command=function(e){if(e){var n=e.callback;if(!n||!n.pubsubBound){var o=this.address,i=process.hrtime(),s=new Date;e.callback=r.channel.bindToContext((function(t,a){var c=process.hrtime(i),l=1e3*c[0]+c[1]/1e6|0;r.channel.publish("redis",{duration:l,address:o,commandObj:e,err:t,result:a,time:s}),"function"==typeof n&&n.apply(this,arguments)})),e.callback.pubsubBound=!0}}return t.call(this,e)},e}},t.enable=function(){r.channel.registerMonkeyPatch("redis",t.redis)}},1624:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 6.0.0 < 9.0.0",patch:function(e){var t=e.Connection.prototype.makeRequest;return e.Connection.prototype.makeRequest=function(){function e(e){var t=process.hrtime(),n={query:{},database:{host:null,port:null},result:null,error:null,duration:0};return o.channel.bindToContext((function(i,s,a){var c=process.hrtime(t);n=r({},n,{database:{host:this.connection.config.server,port:this.connection.config.options.port},result:!i&&{rowCount:s,rows:a},query:{text:this.parametersByName.statement.value},error:i,duration:Math.ceil(1e3*c[0]+c[1]/1e6)}),o.channel.publish("tedious",n),e.call(this,i,s,a)}))}var n=arguments[0];arguments[0].callback=e(n.callback),t.apply(this,arguments)},e}},t.enable=function(){o.channel.registerMonkeyPatch("tedious",t.tedious)}},8041:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);or[n]?o:n);this.add(new t(e,{level:n}))}var r=e.createLogger;e.createLogger=function(){var o,i=arguments[0].levels||e.config.npm.levels;for(var s in i)i.hasOwnProperty(s)&&(o=void 0===o||i[s]>i[o]?s:o);var a=r.apply(this,arguments);a.add(new t(e,{level:o}));var c=a.configure;return a.configure=function(){c.apply(this,arguments),n.apply(this,arguments)},a};var a=e.createLogger;return e.configure=function(){a.apply(this,arguments),n.apply(this,arguments)},e.add(new t(e)),e}},t.winston2={versionSpecifier:"2.x",patch:function(e){var t,n=e.Logger.prototype.log,r=function(n,r,o){var i;return i=t===e.config.npm.levels?"npm":t===e.config.syslog.levels?"syslog":"unknown",s.channel.publish("winston",{level:n,message:r,meta:o,levelKind:i}),r};return e.Logger.prototype.log=function(){return t=this.levels,this.filters&&0!==this.filters.length?this.filters[this.filters.length-1]!==r&&(this.filters=this.filters.filter((function(e){return e!==r})),this.filters.push(r)):this.filters=[r],n.apply(this,arguments)},e}},t.enable=function(){s.channel.registerMonkeyPatch("winston",t.winston2),s.channel.registerMonkeyPatch("winston",t.winston3)}},1055:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=1055,e.exports=t},6990:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=6990,e.exports=t},6932:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8497),o=n(8497);t.makePatchingRequire=o.makePatchingRequire;var i=function(e){return!0},s=function(){function e(){this.version=n(9674).i8,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.currentlyPublishing=!1}return e.prototype.shouldPublish=function(e){var t=this.subscribers[e];return!!t&&t.some((function(e){var t=e.filter;return!t||t(!1)}))},e.prototype.publish=function(e,t){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=!0,n.forEach((function(e){var t=e.listener,n=e.filter;try{n&&n(!0)&&t(r)}catch(e){}})),this.currentlyPublishing=!1}}},e.prototype.subscribe=function(e,t,n){void 0===n&&(n=i),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:t,filter:n})},e.prototype.unsubscribe=function(e,t,n){void 0===n&&(n=i);var r=this.subscribers[e];if(r)for(var o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1017),o=n(6190),i=n(8188),s=Object.keys(process.binding("natives")),a=i.prototype.require;t.makePatchingRequire=function(e){var t={};return function(n){var c=a.apply(this,arguments);if(e[n]){var l=i._resolveFilename(n,this);if(t.hasOwnProperty(l))return t[l];var u=void 0;if(s.indexOf(n)<0)try{u=a.call(this,r.join(n,"package.json")).version}catch(e){return c}else u=process.version.substring(1);var d=u.indexOf("-");d>=0&&(u=u.substring(0,d));for(var p=c,h=0,f=e[n];h{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var $=s++;i[$]="^"+i[D]+i[C]+"$";var j=s++;i[j]="^"+i[D]+i[S]+"$";var L=s++;i[L]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var H=s++;i[H]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[L]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[H]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[L]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[j]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[U],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},7267:(e,t,n)=>{"use strict";var r=n(4403),o=r.wrap,i=r.unwrap,s="wrap@before";function a(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function c(e,t){var n;return n=e._events&&e._events[t],Array.isArray(n)||(n=n?[n]:[]),n}function l(e,t){if(e){var n=e;if("function"==typeof e)n=t(e);else if(Array.isArray(e)){n=[];for(var r=0;r0&&function(e,t){for(var n=t.length,r=0;r{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},1875:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return-1!==r&&(-1===o||r{"use strict";const t=new Set([200,203,204,206,300,301,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),r=new Set([500,502,503,504]),o={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},i={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function s(e){const t=parseInt(e,10);return isFinite(t)?t:0}function a(e){const t={};if(!e)return t;const n=e.trim().split(/\s*,\s*/);for(const e of n){const[n,r]=e.split(/\s*=\s*/,2);t[n]=void 0===r||r.replace(/^"|"$/g,"")}return t}function c(e){let t=[];for(const n in e){const r=e[n];t.push(!0===r?n:n+"="+r)}if(t.length)return t.join(", ")}e.exports=class{constructor(e,t,{shared:n,cacheHeuristic:r,immutableMinTimeToLive:o,ignoreCargoCult:i,_fromObject:s}={}){if(s)this._fromObject(s);else{if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=!1!==n,this._cacheHeuristic=void 0!==r?r:.1,this._immutableMinTtl=void 0!==o?o:864e5,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=a(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=a(e.headers["cache-control"]),i&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!n.has(this._status)||this._rescc["no-store"]||this._isShared&&this._rescc.private||this._isShared&&!this._noAuthorization&&!this._allowsStoringAuthenticated()||!(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=a(e.headers["cache-control"]);return!t["no-cache"]&&!/no-cache/.test(e.headers.pragma)&&(!(t["max-age"]&&this.age()>t["max-age"])&&(!(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"])&&(!(this.stale()&&(!t["max-stale"]||this._rescc["must-revalidate"]||!(!0===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge())))&&this._requestMatches(e,!1))))}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){const t={};for(const n in e)o[n]||(t[n]=e[n]);if(e.connection){const n=e.connection.trim().split(/\s*,\s*/);for(const e of n)delete t[e]}if(t.warning){const e=t.warning.split(/,/).filter((e=>!/^\s*1[0-9][0-9]/.test(e)));e.length?t.warning=e.join(",").trim():delete t.warning}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){const e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return s(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"])return 0;if(this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)return 0;if("*"===this._resHeaders.vary)return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return s(this._rescc["s-maxage"])}if(this._rescc["max-age"])return s(this._rescc["max-age"]);const e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){const n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){const e=this.maxAge()-this.age(),t=e+s(this._rescc["stale-if-error"]),n=e+s(this._rescc["stale-while-revalidate"]);return 1e3*Math.max(0,e,t,n)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+s(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+s(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||1!==e.v)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=void 0!==e.imm?e.imm:864e5,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete t["if-modified-since"],t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter((e=>!/^\s*W\//.test(e)));e.length?t["if-none-match"]=e.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&function(e){return!e||r.has(e.status)}(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let n=!1;if(void 0!==t.status&&304!=t.status?n=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===t.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||t.headers.etag||t.headers["last-modified"]||(n=!0),!n)return{policy:new this.constructor(e,t),modified:304!=t.status,matches:!1};const o={};for(const e in this._resHeaders)o[e]=e in t.headers&&!i[e]?t.headers[e]:this._resHeaders[e];const s=Object.assign({},t,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}},7546:(e,t,n)=>{"use strict";const r=n(7147);let o;e.exports=()=>(void 0===o&&(o=function(){try{return r.statSync("/.dockerenv"),!0}catch(e){return!1}}()||function(){try{return r.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return!1}}()),o)},7684:(e,t,n)=>{"use strict";const r=n(2037),o=n(7147),i=n(7546),s=()=>{if("linux"!==process.platform)return!1;if(r.release().toLowerCase().includes("microsoft"))return!i();try{return!!o.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!i()}catch(e){return!1}};process.env.__IS_WSL_TEST__?e.exports=s:e.exports=s()},5127:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,o,i,s,a,c,l,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in r(i,s,a,c,l,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in t.arrayKeywords)for(var f=0;f{var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,s){s=s||{};var a,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=o?i(a,c,o,"day"):c>=r?i(a,c,r,"hour"):c>=n?i(a,c,n,"minute"):c>=t?i(a,c,t,"second"):a+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},1814:(e,t,n)=>{const r=n(1017),o=n(2081),{promises:i,constants:s}=n(7147),a=n(7684),c=n(7546),l=n(1321),u=r.join(__dirname,"xdg-open"),{platform:d,arch:p}=process,h=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await i.access(n,s.F_OK),r=!0}catch{}if(!r)return e;const o=await i.readFile(n,{encoding:"utf8"}),a=/(?.*)/g.exec(o);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),f=async(e,t)=>{let n;for(const r of e)try{return await t(r)}catch(e){n=e}throw n},m=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return f(e.app,(t=>m({...e,app:t})));let t,{name:n,arguments:r=[]}=e.app||{};if(r=[...r],Array.isArray(n))return f(n,(t=>m({...e,app:{name:t,arguments:r}})));const l=[],p={};if("darwin"===d)t="open",e.wait&&l.push("--wait-apps"),e.background&&l.push("--background"),e.newInstance&&l.push("--new"),n&&l.push("-a",n);else if("win32"===d||a&&!c()){const o=await h();t=a?`${o}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,l.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),a||(p.windowsVerbatimArguments=!0);const i=["Start"];e.wait&&i.push("-Wait"),n?(i.push(`"\`"${n}\`""`,"-ArgumentList"),e.target&&r.unshift(e.target)):e.target&&i.push(`"${e.target}"`),r.length>0&&(r=r.map((e=>`"\`"${e}\`""`)),i.push(r.join(","))),e.target=Buffer.from(i.join(" "),"utf16le").toString("base64")}else{if(n)t=n;else{const e="/"===__dirname;let n=!1;try{await i.access(u,s.X_OK),n=!0}catch{}t=process.versions.electron||"android"===d||e||!n?"xdg-open":u}r.length>0&&l.push(...r),e.wait||(p.stdio="ignore",p.detached=!0)}e.target&&l.push(e.target),"darwin"===d&&r.length>0&&l.push("--args",...r);const g=o.spawn(t,l,p);return e.wait?new Promise(((t,n)=>{g.once("error",n),g.once("close",(r=>{e.allowNonzeroExitCode&&r>0?n(new Error(`Exited with code ${r}`)):t(g)}))})):(g.unref(),g)},g=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return m({...t,target:e})};function _(e){if("string"==typeof e||Array.isArray(e))return e;const{[p]:t}=e;if(!t)throw new Error(`${p} is not supported`);return t}function y({[d]:e},{wsl:t}){if(t&&a)return _(t);if(!e)throw new Error(`${d} is not supported`);return _(e)}const v={};l(v,"chrome",(()=>y({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}))),l(v,"firefox",(()=>y({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}))),l(v,"edge",(()=>y({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}))),g.apps=v,g.openApp=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `name`");const{arguments:n=[]}=t||{};if(null!=n&&!Array.isArray(n))throw new TypeError("Expected `appArguments` as Array type");return m({...t,app:{name:e,arguments:n}})},e.exports=g},4403:e=>{"use strict";function t(e){return"function"==typeof e}var n=console.error.bind(console);function r(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function o(e){e&&e.logger&&(t(e.logger)?n=e.logger:n("new logger isn't a function, not replacing"))}function i(e,o,i){if(e&&e[o]){if(!i)return n("no wrapper function"),void n((new Error).stack);if(t(e[o])&&t(i)){var s=e[o],a=i(s,o);return r(a,"__original",s),r(a,"__unwrap",(function(){e[o]===a&&r(e,o,s)})),r(a,"__wrapped",!0),r(e,o,a),a}n("original object and wrapper must be functions")}else n("no original function "+o+" to wrap")}function s(e,t){return e&&e[t]?e[t].__unwrap?e[t].__unwrap():void n("no original to unwrap to -- has "+t+" already been unwrapped?"):(n("no function to unwrap."),void n((new Error).stack))}o.wrap=i,o.massWrap=function(e,t,r){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){i(e,t,r)}))})):n("must provide one or more functions to wrap on modules")},o.unwrap=s,o.massUnwrap=function(e,t){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){s(e,t)}))})):n("must provide one or more functions to unwrap on modules")},e.exports=o},3031:e=>{e.exports=function(e,t){var n=[];n.push(function(e){try{return Error.prototype.toString.call(e)}catch(e){try{return""}catch(e){return""}}}(e));for(var r=0;r"}catch(e){o=""}}n.push(" at "+o)}return n.join("\n")}},6818:(e,t,n)=>{if(global._stackChain){if(global._stackChain.version!==n(735).i8)throw new Error("Conflicting version of stack-chain found");e.exports=global._stackChain}else e.exports=global._stackChain=n(2396)},2396:(e,t,n)=>{var r=n(3031);function o(){this.extend=new a,this.filter=new a,this.format=new c,this.version=n(735).i8}var i=!1;o.prototype.callSite=function e(t){t||(t={}),i=!0;var n={};Error.captureStackTrace(n,e);var r=n.stack;return i=!1,r=r.slice(t.slice||0),t.extend&&(r=this.extend._modify(n,r)),t.filter&&(r=this.filter._modify(n,r)),r};var s=new o;function a(){this._modifiers=[]}function c(){this._formater=r,this._previous=void 0}a.prototype._modify=function(e,t){for(var n=0,r=this._modifiers.length;n{"use strict";const r=n(2037),o=n(1875),i=process.env;let s;function a(e){const t=function(e){if(!1===s)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!e.isTTY&&!0!==s)return 0;const t=s?1:0;if("win32"===process.platform){const e=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||"codeship"===i.CI_NAME?1:t;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}o("no-color")||o("no-colors")||o("color=false")?s=!1:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(s=!0),"FORCE_COLOR"in i&&(s=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},3406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GitHubDeviceFlow=void 0;const r=n(9800),o=n(39),i="Iv1.b507a08c87ecfe98";async function s(e,t){const n={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4};return e.get(o.Fetcher).fetch("https://github.com/login/oauth/access_token",n).then((e=>e.json()))}async function a(e,t){return e.get(o.Fetcher).fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}}).then((e=>e.json()))}t.GitHubDeviceFlow=class{async getToken(e){const t=await async function(e){const t={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,scope:"read:user"},timeout:3e4},n=e.get(o.Fetcher).fetch("https://github.com/login/device/code",t);return(await n).json()}(e),n=new Promise((async(n,r)=>{let o,i=t.expires_in;for(;i>0;){const r=await s(e,t.device_code);if(i-=t.interval,await new Promise((e=>setTimeout(e,1e3*t.interval))),o=r.access_token,o)return void n({user:(await a(e,o)).login,oauth_token:o})}r("Timed out waiting for login to complete")}));return{...t,waitForAuth:n}}}},9321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestContext=t.AuthManager=void 0;const r=n(5765),o=n(150),i=n(5611),s=n(5381);class a{constructor(e,t){this.persistenceManager=e,this.mkTokenManager=t,this._pendingSignIn=void 0}getCopilotTokenManager(){return this._copilotTokenManager}setPendingSignIn(e){this._pendingSignIn=e}getPendingSignIn(){return this._pendingSignIn}async checkAndUpdateStatus(e,t){var n;const r=null!==(n=null==t?void 0:t.localChecksOnly)&&void 0!==n&&n;let o;if("true"===process.env.CODESPACES&&process.env.GITHUB_TOKEN&&(o={user:process.env.GITHUB_USER||"codespace-user",oauth_token:process.env.GITHUB_TOKEN}),void 0===o&&(o=await this.getAuthRecord()),void 0===o)return this._copilotTokenManager=void 0,{status:"NotSignedIn"};if(r)return{status:"MaybeOK",user:o.user};const i={token:o.oauth_token};o.dev_override&&(i.devOverride={copilotTokenUrl:o.dev_override.copilot_token_url,notificationUrl:o.dev_override.notification_url});const s=this.mkTokenManager(i),a=await s.checkCopilotToken(e);return"status"in a?"unconfigured"===a.telemetry&&!1===await this.getTelemetryConsent(o.user)?(this._copilotTokenManager=void 0,{status:"NoTelemetryConsent",user:o.user}):(this._copilotTokenManager=s,{status:"OK",user:o.user}):(this._copilotTokenManager=void 0,{status:"HTTP401"===a.reason?"NotSignedIn":a.reason,user:o.user})}async getAuthRecord(){return await this.persistenceManager.read("hosts","github.com")}async setAuthRecord(e){await this.persistenceManager.update("hosts","github.com",e)}async deleteAuthRecord(){await this.persistenceManager.delete("hosts","github.com")}async getTelemetryConsent(e){const t=await this.persistenceManager.read("terms",e);return!(!(null==t?void 0:t.version)||t.version!==o.LAST_TELEMETRY_TERMS_UPDATE)}async recordTelemetryConsent(e){await this.persistenceManager.update("terms",e,{version:o.LAST_TELEMETRY_TERMS_UPDATE})}}t.AuthManager=a,t.createRequestContext=async function(e,t){let n=t;if(void 0===n&&(n=e.get(a).getCopilotTokenManager()),void 0===n){const t=await e.get(a).checkAndUpdateStatus(e);if("OK"!==t.status)return{code:s.ErrorCode.NoCopilotToken,message:`Not authenticated: ${t.status}`};if(n=e.get(a).getCopilotTokenManager(),void 0===n)return{code:s.ErrorCode.InternalError,message:"Unexpected missing Copilot token"}}const o=new i.Context(e);return o.set(r.CopilotTokenManager,n),o}},9582:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.MergedToken=void 0;const n=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}})),r=Object.freeze({isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),o=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n});class i{constructor(){this._isCancelled=!1,this.handlers=[]}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}get isCancellationRequested(){return this._isCancelled}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}dispose(){this.handlers=[]}}t.MergedToken=class{constructor(e){this.tokens=[],this.handlers=[],this._isCancelled=!1,this.tokens=e,this._isCancelled=e.some((e=>e.isCancellationRequested)),e.forEach((e=>{e.onCancellationRequested(this.cancel,this)}))}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}dispose(){this.tokens=[]}get isCancellationRequested(){return this.tokens.some((e=>e.isCancellationRequested))}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}},t.CancellationTokenSource=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new i),this._token}cancel(){this._token?this._token instanceof i&&this._token.cancel():this._token=o}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof i&&this._token.dispose():this._token=r}}},8212:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.extensions=t.workspace=t.env=t.UIKind=t.EndOfLine=void 0,(r=t.EndOfLine||(t.EndOfLine={}))[r.LF=1]="LF",r[r.CRLF=2]="CRLF",function(e){e[e.Web=0]="Web",e[e.Desktop=1]="Desktop"}(n=t.UIKind||(t.UIKind={})),t.env={isTelemetryEnabled:!0,uiKind:n.Desktop,appRoot:"/non-existent-path"},t.workspace={onDidChangeConfiguration:()=>{},getConfiguration:()=>({})},t.extensions={getExtension:e=>{}}},3895:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentEditorInfo=t.AgentConfigProvider=void 0;const r=n(9800);class o extends r.InMemoryConfigProvider{constructor(){super(new r.DefaultsOnlyConfigProvider,new Map)}getOptionalConfig(e){if(!Array.isArray(e)||"editor"!=e[0]||this.isDefaultSettingOverwritten(e))return super.getConfig(e)}}t.AgentConfigProvider=o;class i extends r.EditorAndPluginInfo{setEditorAndPluginInfo(e,t){this._editorInfo=e,this._editorPluginInfo=t}getEditorInfo(e){return this._editorInfo?this._editorInfo:{name:"unknown-editor",version:"0"}}getEditorPluginInfo(e){return this._editorPluginInfo?this._editorPluginInfo:{name:"unknown-editor-plugin",version:"0"}}}t.AgentEditorInfo=i},3007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotCompletionCache=void 0;const r=n(140);class o extends r.LRUCache{constructor(e=100){super(e)}}t.CopilotCompletionCache=o},9841:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationLogger=void 0;const r=n(7089),o=n(5798),i=n(7214);class s extends o.LogTarget{constructor(e){super(),this.debugMode=e}logIt(e,t,n,...s){const a={level:t,message:`${n} ${s.map(o.toPlainText)}`,metadataStr:n,extra:s.map(o.toPlainText)};e.get(i.AgentNotificationSender).sendNotification(new r.NotificationType("LogMessage"),a)}shouldLog(e,t){return!!this.debugMode||t>o.LogLevel.DEBUG}}t.NotificationLogger=s},1926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationStatusReporter=void 0;const r=n(7089),o=n(7214);t.NotificationStatusReporter=class{constructor(e){this.ctx=e,this.notificationEndpoint="statusNotification",this.status="Normal"}setProgress(){"Error"!==this.status&&(this.status="InProgress",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"InProgress",message:""}))}removeProgress(){"Error"!==this.status&&"Warning"!==this.status&&(this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""}))}forceNormal(){this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""})}setWarning(){"Error"!==this.status&&(this.status="Warning",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Warning",message:""}))}setError(e){this.status="Error";const t={status:"Error",message:e};this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),t)}}},6021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.agentFileSystem=void 0;const r=n(7147);t.agentFileSystem={readFile:function(e){return r.promises.readFile(e)},mtime:async function(e){return(await r.promises.stat(e)).mtimeMs},stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},9729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sessionId=t.getMachineId=void 0;const r=n(6113),o=n(2037),i=n(7057),s=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function a(e){const t=e.replace(/-/g,":").toLowerCase();return!s.has(t)}let c;t.getMachineId=function(){if(!c){const e=function(){try{const e=function(){const e=(0,o.networkInterfaces)();for(const t in e){const n=e[t];if(n)for(const{mac:e}of n)if(a(e))return e}throw new Error("Unable to retrieve mac address (unexpected format)")}();return r.createHash("sha256").update(e,"utf8").digest("hex")}catch(e){return}}();c=e||i.v4()}return c},t.sessionId=i.v4()+Date.now()},6995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.initializeLateDependencies=t.init=void 0;const r=n(4617),o=n(5765),i=n(2137),s=n(9800),a=n(5611),c=n(446),l=n(6905),u=n(6046),d=n(4619),p=n(5798),h=n(39),f=n(598),m=n(5489),g=n(913),_=n(2369),y=n(4567),v=n(3406),b=n(9321),w=n(3895),x=n(3007),T=n(6021),E=n(9729),C=n(5332),S=n(585),k=n(2401);t.init=function(){const e=new a.Context;e.set(i.Clock,new i.Clock),e.set(s.ConfigProvider,new w.AgentConfigProvider),e.set(s.BuildInfo,new s.BuildInfo),function(e){e.set(g.RuntimeMode,g.RuntimeMode.fromEnvironment(!1)),e.set(p.LogVerbose,new p.LogVerbose((0,g.isVerboseLoggingEnabled)(e))),e.set(p.LogTarget,new p.ConsoleLog(console))}(e),t.logger.debug(e,"Initializing agent"),e.set(u.ExpConfigMaker,new u.ExpConfigNone);const n=(0,S.makeXdgPersistenceManager)();e.set(S.PersistenceManager,n);const P=new b.AuthManager(n,(e=>new o.CopilotTokenManagerFromGitHubToken(e)));e.set(v.GitHubDeviceFlow,new v.GitHubDeviceFlow),e.set(b.AuthManager,P);const I=new s.VscInfo(E.sessionId,(0,E.getMachineId)(),(0,s.getVersion)(e));return e.set(s.VscInfo,I),e.set(s.EditorAndPluginInfo,new w.AgentEditorInfo),e.set(d.GhostTextDebounceManager,new d.GhostTextDebounceManager),e.set(h.Fetcher,new h.HelixFetcher(e)),e.set(f.OpenAIFetcher,new f.LiveOpenAIFetcher),e.set(y.UrlOpener,new y.RealUrlOpener),e.set(s.BlockModeConfig,new s.ConfigBlockModeConfig),e.set(C.MethodHandlers,(0,C.getAllMethods)()),e.set(C.NotificationHandlers,(0,C.getAllNotifications)()),e.set(x.CopilotCompletionCache,new x.CopilotCompletionCache),e.set(_.LocationFactory,new k.AgentLocationFactory),e.set(l.Features,new l.Features(e)),e.set(r.FileSystem,T.agentFileSystem),e.set(m.TelemetryReporters,(0,m.setupEmptyReporters)()),(0,h.init)((0,s.getVersion)(e)),(0,c.registerDefaultHandlers)(e,"agent"),process.on("exit",(()=>{try{t.logger.debug(e,"Shutting down agent"),e.get(m.TelemetryReporters).deactivate()}catch(e){}})),e},t.initializeLateDependencies=function(e){e.set(m.TelemetryEndpointUrlOverride,m.telemetryEndpointUrlOverride),(0,m.setupStandardReporters)(e,"agent"),t.logger.debug(e,"Telemetry initialized")},t.logger=new p.Logger(p.LogLevel.DEBUG,"agent")},6934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(6159),c=r.Type.Object({options:r.Type.Optional(r.Type.Intersect([r.Type.Object({localChecksOnly:r.Type.Optional(r.Type.Boolean())}),a.TestingOptions]))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){var r;if(!l(n)){const e=(0,s.extractAjvErrors)(l.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,a.getTestingContext)(n.options.testingCtx)),[await e.get(i.AuthManager).checkAndUpdateStatus(e,n.options),null]}},3340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetCompletionsCycling=t.handleGetCompletions=void 0;const r=n(892),o=n(6236),i=n(7057),s=n(6630),a=n(5611),c=n(3993),l=n(702),u=n(1749),d=n(2369),p=n(9321),h=n(9582),f=n(3007),m=n(5381),g=n(7838),_=n(6159),y=n(2401),v=n(2930),b=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),insertSpaces:r.Type.Optional(r.Type.Boolean()),tabSize:r.Type.Optional(r.Type.Number()),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),options:r.Type.Optional(_.TestingOptions)}),w=(new o.default).compile(r.Type.Strict(b));let x;async function T(e,t,n,r,o){var b;x&&(x.cancel(),x.dispose()),x=new h.CancellationTokenSource;const T=new h.MergedToken([t,x.token]);if(!w(n)){const e=(0,m.extractAjvErrors)(w.errors);return[null,{code:m.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let E;void 0!==(null===(b=n.options)||void 0===b?void 0:b.testingCtx)&&(e=(0,_.getTestingContext)(n.options.testingCtx));try{E=e.get(v.CompletionDocuments)}catch(e){}if(E){const e=o?3:1;return[{completions:E.documents.slice(0,e).map((e=>{const{cursorLine:t,lines:r,start:o,end:s}=(0,g.parseChallengeDoc)(e,n.doc.position),a=[t.slice(Math.min(o.character,n.doc.position.character))].concat(r.slice(n.doc.position.line+1)).join("\n");return{uuid:i.v4(),text:a,displayText:a,position:n.doc.position,range:{start:o,end:s}}}))},null]}const C=await(0,p.createRequestContext)(e,r);if(!(C instanceof a.Context))return[null,C];const S=s.URI.parse(n.doc.uri);let k;try{k=await(0,y.getTextDocumentChecked)(e,S,n.doc)}catch(e){return[null,{code:m.ErrorCode.InvalidParams,message:e.message}]}const P=k.offsetAt(C.get(d.LocationFactory).position(n.doc.position.line,n.doc.position.character)),I=k.positionAt(P),R=await(0,l.getGhostText)(C,k,I,o,T),O=await(0,u.handleGhostTextResultTelemetry)(e,R);if(!O)return[{completions:[]},null];const[A,N]=O,D=(0,c.completionsFromGhostTextResults)(e,A,N,k,I,n.doc),M=e.get(f.CopilotCompletionCache);for(const e of D)M.put(e.uuid,e);return[{completions:D.map((e=>({uuid:e.uuid,text:e.text,range:e.range,displayText:e.displayText,position:e.position})))},null]}t.handleGetCompletions=async function(e,t,n,r){return T(e,t,n,r,!1)},t.handleGetCompletionsCycling=async function(e,t,n,r){return T(e,t,n,r,!0)}},9638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetPanelCompletions=void 0;const r=n(892),o=n(6236),i=n(6679),s=n(7057),a=n(5809),c=n(6630),l=n(9800),u=n(5611),d=n(5680),p=n(6317),h=n(5489),f=n(2369),m=n(9321),g=n(9582),_=n(7214),y=n(5381),v=n(7838),b=n(6159),w=n(2401),x=n(8730),T=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),panelId:r.Type.String(),options:r.Type.Optional(b.TestingOptions)}),E=(new o.default).compile(r.Type.Strict(T));class C{constructor(e,t,n,r,o){this.textDocument=e,this.startPosition=t,this.completionContext=n,this.solutionCountTarget=r,this.cancellationToken=o,this.savedTelemetryData=h.TelemetryData.createAndMarkAsIssued()}reportCancelled(){}getCancellationToken(){return this.cancellationToken}async getDocument(){return this.textDocument}}async function S(e,t,n,r,o){const s=await r;switch(s.status){case"Solution":n.sendNotification(new a.NotificationType("PanelSolution"),function(e,t,n){const r=(0,p.normalizeCompletionText)(n.completionText);return{panelId:e,range:t,completionText:n.completionText,displayText:n.displayText,score:n.meanProb,solutionId:(0,i.SHA256)(r).toString()}}(e,t,s.solution)),await S(e,t,n,s.next,o);break;case"FinishedNormally":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:e}),o();break;case"FinishedWithError":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"Error",message:s.error,panelId:e}),o()}}let k;t.handleGetPanelCompletions=async function(e,t,n,r,o){var i;k&&(k.cancel(),k.dispose()),k=new g.CancellationTokenSource;const a=new g.MergedToken([t,k.token]);if(!E(n)){const e=(0,y.extractAjvErrors)(E.errors);return[null,{code:y.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let h,T;void 0!==(null===(i=n.options)||void 0===i?void 0:i.testingCtx)&&(e=(0,b.getTestingContext)(n.options.testingCtx));const P=(0,l.getConfig)(e,l.ConfigKey.ListCount);let I;try{I=e.get(x.PanelCompletionDocuments)}catch(e){}if(I){const e=s.v4(),t=I.documents,r=async o=>{if(o>=P||o>=t.length)return{status:"FinishedNormally"};const{text:i,score:a}=t[o],{cursorLine:c,lines:l,start:u}=(0,v.parseChallengeDoc)(i,n.doc.position),d=[c.slice(Math.min(u.character,n.doc.position.character))].concat(l.slice(n.doc.position.line+1)).join("\n");return{status:"Solution",solution:{requestId:{headerRequestId:e,completionId:s.v4(),created:0,serverExperiments:"",deploymentId:""},completionText:d,displayText:d,meanProb:a,meanLogProb:-1,choiceIndex:o,prependToCompletion:""},next:r(o+1)}};T=n.doc.position,h=r(0)}else{const t=await(0,m.createRequestContext)(e,r);if(!(t instanceof u.Context))return[null,t];const o=c.URI.parse(n.doc.uri);let i;try{i=await(0,w.getTextDocumentChecked)(e,o,n.doc)}catch(e){return[null,{code:y.ErrorCode.InvalidParams,message:e.message}]}const s=i.offsetAt(t.get(f.LocationFactory).position(n.doc.position.line,n.doc.position.character));T=i.positionAt(s);const l=(0,d.completionContextForDocument)(e,i,T),g=new C(i,T,l,P,a);h=(0,p.launchSolutions)(t,g),e=t}return setImmediate((()=>S(n.panelId,e.get(f.LocationFactory).range(T,T),e.get(_.AgentNotificationSender),h,null!=o?o:()=>{}))),[{solutionCountTarget:P},null]}},1025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9800),s=n(5381),a=r.Type.Object({}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[{version:(0,i.getVersion)(e)},null]}},2389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(39),s=n(5381),a=r.Type.Object({url:r.Type.String(),method:r.Type.Optional(r.Type.String()),headers:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String())),body:r.Type.Optional(r.Type.String()),json:r.Type.Optional(r.Type.Any()),timeout:r.Type.Optional(r.Type.Number())}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r={};"method"in n&&(r.method=n.method),"body"in n&&(r.body=n.body),"json"in n&&(r.json=n.json);const o=n.timeout;null!=o&&(r.timeout=o),n.headers&&(r.headers=n.headers);try{const t=await e.get(i.Fetcher).fetch(n.url,r),o=await t.text();return[{status:t.status,statusText:t.statusText,headers:Object.fromEntries(t.headers),body:o},null]}catch(e){return[null,{code:s.ErrorCode.InternalError,message:e.message}]}}},5332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAllNotifications=t.NotificationHandlers=t.getAllMethods=t.MethodHandlers=void 0;const r=n(6934),o=n(3340),i=n(9638),s=n(1025),a=n(2389),c=n(5581),l=n(1382),u=n(1300),d=n(4885),p=n(9629),h=n(6885),f=n(1451),m=n(6656),g=n(1620),_=n(2530),y=n(8269),v=n(7803),b=n(2930),w=n(8730),x=n(2043),T=n(2229),E=n(8127);class C{constructor(e){this.handlers=e}}t.MethodHandlers=C,t.getAllMethods=function(){const e=new Map;return e.set("getCompletions",o.handleGetCompletions),e.set("getCompletionsCycling",o.handleGetCompletionsCycling),e.set("getPanelCompletions",i.handleGetPanelCompletions),e.set("httpRequest",a.default),e.set("getVersion",s.default),e.set("setEditorInfo",p.handleSetEditorInfo),e.set("checkStatus",r.default),e.set("signInInitiate",f.default),e.set("signInConfirm",h.default),e.set("signOut",m.default),e.set("recordTelemetryConsent",d.default),e.set("notifyShown",u.notifyShown),e.set("notifyAccepted",c.notifyAccepted),e.set("notifyRejected",l.notifyRejected),e.set("telemetry/exception",g.telemetryExceptionMethod),e.set("testing/createContext",y.default),e.set("testing/alwaysAuth",_.default),e.set("testing/neverAuth",v.default),e.set("testing/useTestingToken",T.default),e.set("testing/setCompletionDocuments",b.default),e.set("testing/setPanelCompletionDocuments",w.default),e.set("testing/triggerShowMessageRequest",x.default),e.set("debug/verifyState",E.handleVerifyState),e.set("debug/verifyWorkspaceState",E.handleVerifyWorkspaceState),new C(e)};class S{constructor(e){this.handlers=e}}t.NotificationHandlers=S,t.getAllNotifications=function(){const e=new Map;return new S(e)}},5581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyAccepted=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyAccepted=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=o.get(n.uuid);return l&&(o.deleteKey(n.uuid),(0,i.postInsertionTasks)(e,"ghostText",l.text,l.offset,l.file,l.telemetry)),["OK",null]}},4340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyNetworkProxyConfiguration=t.applySettingsToConfiguration=t.notifyChangeConfiguration=t.EditorConfigurationSettings=t.NetworkProxy=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(39),a=n(5381),c=n(6159);t.NetworkProxy=r.Type.Object({host:r.Type.String(),port:r.Type.Number(),username:r.Type.Optional(r.Type.String()),password:r.Type.Optional(r.Type.String())}),t.EditorConfigurationSettings=r.Type.Object({showEditorCompletions:r.Type.Optional(r.Type.Boolean()),enableAutoCompletions:r.Type.Optional(r.Type.Boolean()),delayCompletions:r.Type.Optional(r.Type.Boolean()),filterCompletions:r.Type.Optional(r.Type.Boolean()),disabledLanguages:r.Type.Optional(r.Type.Array(r.Type.Object({languageId:r.Type.String()})))});const l=r.Type.Object({settings:r.Type.Optional(t.EditorConfigurationSettings),networkProxy:r.Type.Optional(r.Type.Union([t.NetworkProxy,r.Type.Null()])),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));function d(e,t){const n=e.get(i.ConfigProvider);if(n.setConfig(i.ConfigKey.ShowEditorCompletions,t.showEditorCompletions),n.setConfig(i.ConfigKey.DelayCompletions,t.delayCompletions),n.setConfig(i.ConfigKey.EnableAutoCompletions,t.enableAutoCompletions),n.setConfig(i.ConfigKey.FilterCompletions,t.filterCompletions),t.disabledLanguages)for(const e of t.disabledLanguages)n.setLanguageEnablement(e.languageId,!1)}function p(e,t){if(!t)return void(e.get(s.Fetcher).proxySettings=void 0);let n;t.username&&(n=t.password?t.username+":"+t.password:t.username);const r=n?n+"@":"";process.env.http_proxy=`http://${r}${t.host}:${t.port}`,process.env.https_proxy=`http://${r}${t.host}:${t.port}`,e.get(s.Fetcher).proxySettings={host:t.host,port:t.port,proxyAuth:n,headers:{}}}t.notifyChangeConfiguration=function(e,t){var n;if(!u(t)){const e=(0,a.extractAjvErrors)(u.errors);throw new Error(`Invalid params: ${e.join(", ")}`)}void 0!==(null===(n=t.options)||void 0===n?void 0:n.testingCtx)&&(e=(0,c.getTestingContext)(t.options.testingCtx)),t.settings&&d(e,t.settings),void 0!==t.networkProxy&&p(e,t.networkProxy)},t.applySettingsToConfiguration=d,t.applyNetworkProxyConfiguration=p},1382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyRejected=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuids:r.Type.Array(r.Type.String()),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyRejected=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=n.uuids.flatMap((e=>{var t;return null!==(t=o.get(e))&&void 0!==t?t:[]}));if(l.length>0){const t=l[0];for(const e of n.uuids)o.deleteKey(e);const r=l.map((e=>({completionText:e.displayText,completionTelemetryData:e.telemetry})));(0,i.postRejectionTasks)(e,"ghostText",t.offset,t.file,r)}return["OK",null]}},1300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyShown=void 0;const r=n(892),o=n(6236),i=n(702),s=n(1749),a=n(3007),c=n(5381),l=n(6159),u=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(l.TestingOptions)}),d=(new o.default).compile(r.Type.Strict(u));t.notifyShown=async function(e,t,n){var r;if(!d(n)){const e=(0,c.extractAjvErrors)(d.errors);return[null,{code:c.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,l.getTestingContext)(n.options.testingCtx));const o=e.get(a.CopilotCompletionCache).get(n.uuid);if(o){const t=!(o.resultType===i.ResultType.Network);(0,s.telemetryShown)(e,"ghostText",o.telemetry,t)}return["OK",null]}},4885:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(i.AuthManager).getAuthRecord();return r?(e.get(i.AuthManager).recordTelemetryConsent(r.user),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]):[null,{code:s.ErrorCode.InvalidRequest,message:"Trying to record telemetry consent but the user is not signed in"}]}},9629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSetEditorInfo=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(6995),a=n(5381),c=n(4340),l=r.Type.Object({name:r.Type.String(),version:r.Type.String()}),u=r.Type.Object({editorInfo:l,editorPluginInfo:l,editorConfiguration:r.Type.Optional(c.EditorConfigurationSettings),networkProxy:r.Type.Optional(c.NetworkProxy),options:r.Type.Optional(r.Type.Object({}))}),d=(new o.default).compile(r.Type.Strict(u));t.handleSetEditorInfo=async function(e,t,n){if(!d(n)){const e=(0,a.extractAjvErrors)(d.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return e.get(i.EditorAndPluginInfo).setEditorAndPluginInfo(n.editorInfo,n.editorPluginInfo),n.editorConfiguration&&(0,c.applySettingsToConfiguration)(e,n.editorConfiguration),n.networkProxy&&(0,c.applyNetworkProxyConfiguration)(e,n.networkProxy),(0,s.initializeLateDependencies)(e),["OK",null]}},6885:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(i.AuthManager).getPendingSignIn();if(void 0===r)return[null,{code:s.ErrorCode.InvalidRequest,message:"No pending sign in"}];let o;try{return o=await r,[o,null]}catch(e){return[null,{code:s.ErrorCode.DeviceFlowFailed,message:e.toString()}]}finally{e.get(i.AuthManager).setPendingSignIn(void 0)}}},1451:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(3406),s=n(9321),a=n(5381),c=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(s.AuthManager).checkAndUpdateStatus(e);if("OK"===r.status)return[{status:"AlreadySignedIn",user:r.user},null];const o=await e.get(i.GitHubDeviceFlow).getToken(e),c=o.waitForAuth.then((async t=>(await e.get(s.AuthManager).setAuthRecord(t),await e.get(s.AuthManager).checkAndUpdateStatus(e))));return e.get(s.AuthManager).setPendingSignIn(c),[{status:"PromptUserDeviceFlow",userCode:o.user_code,verificationUri:o.verification_uri,expiresIn:o.expires_in,interval:o.interval},null]}},6656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return await e.get(i.AuthManager).deleteAuthRecord(),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]}},1620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryExceptionMethod=void 0;const r=n(892),o=n(6236),i=n(5489),s=n(5381),a=r.Type.Object({origin:r.Type.String(),stacktrace:r.Type.Optional(r.Type.String()),properties:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String()))}),c=(new o.default).compile(r.Type.Strict(a));t.telemetryExceptionMethod=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=new Error("Original stacktrace: "+n.stacktrace);r.stack="";const o=n.properties||{};return await(0,i.telemetryException)(e,r,n.origin,o),["OK",null]}},2530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.AlwaysAuthManager),["OK",null]}},8269:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[(0,s.newTestingContext)(e),null]}},7803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.NotAuthManager),["OK",null]}},2930:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(r.Type.String()),options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));class l{constructor(e){this.documents=e}}t.CompletionDocuments=l,t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(l,new l(n.documents)),["OK",null]}},8730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PanelCompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({text:r.Type.String(),score:r.Type.Number()}),c=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(a),options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));class u{constructor(e){this.documents=e}}t.PanelCompletionDocuments=u,t.default=async function(e,t,n){if(!l(n)){const e=(0,i.extractAjvErrors)(l.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(u,new u(n.documents)),["OK",null]}},2043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5798),s=n(7214),a=n(5381),c=r.Type.Object({}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t){if(!l(t)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const n=e.get(s.AgentNotificationSender),r=e.get(i.LogTarget);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).catch((e=>o(i.LogLevel.ERROR,"error sending show message request",e))).then((e=>o(i.LogLevel.INFO,"response from message request",e.title))),["OK",null];async function o(t,n,o){return r.logIt(e,t,n+" ("+o+")",o)}}},2229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FakeAuthManager=void 0;const r=n(892),o=n(6236),i=n(5922),s=n(9321),a=n(5381),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));class d extends s.AuthManager{constructor(e){super(void 0,(t=>e)),this.tokenManager=e,this.user="user"}getCopilotTokenManager(){return this.tokenManager}async checkAndUpdateStatus(e,t){const n=await this.tokenManager.checkCopilotToken(e);return"status"in n?{status:"OK",user:this.user}:{status:"HTTP401"===n.reason?"NotSignedIn":n.reason,user:this.user}}}t.FakeAuthManager=d,t.default=async function(e,t,n){if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=(0,i.makeTestingCopilotTokenManager)();return(0,c.getTestingContext)(n.testingCtx).forceSet(s.AuthManager,new d(r)),["OK",null]}},8127:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleVerifyWorkspaceState=t.handleVerifyState=void 0;const r=n(892),o=n(6236),i=n(6630),s=n(819),a=n(5381),c=r.Type.Object({source:r.Type.String(),languageId:r.Type.String(),version:r.Type.Number(),uri:r.Type.String()}),l=(new o.default).compile(r.Type.Strict(c));t.handleVerifyState=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(s.TextDocumentManager),o=await r.getTextDocument(i.URI.parse(n.uri));return o?o.languageId!==n.languageId?[{status:!1,message:`Language id mismatch: [State] ${o.languageId} !== [Request] ${n.languageId}`},null]:o.getText()!==n.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${n.source}`},null]:o.version!==n.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${n.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: "${i.URI.parse(n.uri)}" (given by the editor: "${n.uri}")`},null]},t.handleVerifyWorkspaceState=async function(e,t,n){return[e.get(s.TextDocumentManager).workspaceFolders,null]}},7214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionNotificationSender=t.AgentNotificationSender=void 0;const r=n(9035);class o extends r.NotificationSender{}t.AgentNotificationSender=o,t.ConnectionNotificationSender=class extends o{constructor(e){super(),this.connection=e}sendNotification(e,t){this.connection.sendNotification(e,t)}showWarningMessage(e,...t){return this.connection.window.showWarningMessage(e,...t)}}},585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeXdgPersistenceManager=t.PersistenceManager=void 0;const r=n(7147),o=n(2037),i=n(7282);class s{constructor(e){this.directory=e}async read(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"});return JSON.parse(e)[t]}catch(e){return}}async update(e,t,n){await r.promises.mkdir(this.directory,{recursive:!0,mode:448});const o=`${this.directory}/${e}.json`;let i={};try{const e=await r.promises.readFile(o,{encoding:"utf8"});i=JSON.parse(e)}catch(e){}i[t]=n,await r.promises.writeFile(o,JSON.stringify(i)+"\n",{encoding:"utf8"})}async delete(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"}),o=JSON.parse(e);delete o[t],await r.promises.writeFile(n,JSON.stringify(o)+"\n",{encoding:"utf8"})}catch(e){}}}t.PersistenceManager=s,t.makeXdgPersistenceManager=function(){return new s(i.env.XDG_CONFIG_HOME?i.env.XDG_CONFIG_HOME+"/github-copilot":"win32"===(0,o.platform)()?i.env.USERPROFILE+"\\AppData\\Local\\github-copilot":i.env.HOME+"/.config/github-copilot")}},5381:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.extractAjvErrors=t.ErrorCode=void 0,(n=t.ErrorCode||(t.ErrorCode={}))[n.ParseError=-32700]="ParseError",n[n.InvalidRequest=-32600]="InvalidRequest",n[n.MethodNotFound=-32601]="MethodNotFound",n[n.InvalidParams=-32602]="InvalidParams",n[n.InternalError=-32603]="InternalError",n[n.NoCopilotToken=1e3]="NoCopilotToken",n[n.DeviceFlowFailed=1001]="DeviceFlowFailed",n[n.ContextNotInitialized=1002]="ContextNotInitialized",t.extractAjvErrors=function(e){return e.map((e=>`${e.instancePath} ${e.message}`))}},2879:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateCopilotService=t.createWrappedConnection=t.CopilotService=void 0;const r=n(7147),o=n(2781),i=n(7089),s=n(6630),a=n(5611),c=n(5225),l=n(5798),u=n(9035),d=n(6635),p=n(913),h=n(819),f=n(9841),m=n(1926),g=n(6995),_=n(5332),y=n(4340),v=n(7214),b=n(5381),w=n(540);class x{constructor(e,t){this.connection=t,this.initialized=!1,this.ctx=new a.Context(e);const n=new v.ConnectionNotificationSender(t);this.ctx.set(u.NotificationSender,n),this.ctx.set(v.AgentNotificationSender,n),this.ctx.set(d.StatusReporter,new m.NotificationStatusReporter(this.ctx));const r=new l.MultiLog([this.ctx.get(l.LogTarget),new f.NotificationLogger((0,p.isDebugEnabled)(this.ctx))]);this.ctx.forceSet(l.LogTarget,r),new l.Logger(l.LogLevel.DEBUG,"agent").debug(this.ctx,"Agent service starting"),t.onRequest(this.messageHandler.bind(this)),t.onNotification(this.notificationHandler.bind(this)),t.onInitialize((async e=>{var n,r,o,a;const l=null!==(r=null===(n=e.capabilities.workspace)||void 0===n?void 0:n.workspaceFolders)&&void 0!==r&&r;return this.ctx.set(h.TextDocumentManager,new w.AgentTextDocumentManager(t,null!==(a=null===(o=e.workspaceFolders)||void 0===o?void 0:o.map((e=>s.URI.parse(e.uri))))&&void 0!==a?a:[],!(0,p.isRunningInTest)(this.ctx)&&l)),(0,c.registerDocumentTracker)(this.ctx),this.initialized=!0,{capabilities:{textDocumentSync:{openClose:!0,change:i.TextDocumentSyncKind.Incremental},workspace:{workspaceFolders:{supported:l,changeNotifications:l}}}}})),t.onDidChangeConfiguration((async e=>{(0,y.notifyChangeConfiguration)(this.ctx,e)}))}async messageHandler(e,t,n){const r=this.ctx.get(_.MethodHandlers).handlers.get(e);if(!r)return new i.ResponseError(b.ErrorCode.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new i.ResponseError(b.ErrorCode.ContextNotInitialized,"Agent service not initialized.");Array.isArray(t)&&(t=t[0]);const[o,s]=await r(this.ctx,n,t);return s?new i.ResponseError(s.code,s.message,s.data):o}async notificationHandler(e,t){const n=this.ctx.get(_.NotificationHandlers).handlers.get(e);n&&(Array.isArray(t)&&(t=t[0]),await n(this.ctx,t))}listen(){this.connection.listen()}dispose(){this.connection.dispose()}}function T(e,t,n){let s=n;if(e.get(p.RuntimeMode).flags.recordInput){const e=Date.now().toString(),n=`stdin${e}.log`;t.on("data",(e=>{(0,r.appendFile)(n,e,(e=>{e&&console.error(e)}))}));const i=`stdout${e}.log`;a=s,c=e=>{(0,r.appendFile)(i,e,(e=>{e&&console.error(e)}))},s=new o.Writable({write:(e,t,n)=>(c(e.toString()),a.write(e,t,n))})}var a,c;return(0,i.createConnection)(i.ProposedFeatures.all,new i.StreamMessageReader(t),new i.StreamMessageWriter(s))}t.CopilotService=x,t.createWrappedConnection=T,t.CreateCopilotService=function(e){const t=(0,g.init)(),n=T(t,e,e);new x(t,n).listen()}},1728:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlwaysAuthManager=t.NotAuthManager=void 0;const r=n(5765),o=n(9321);class i extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"NotSignedIn"}}}t.NotAuthManager=i;class s extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"OK",user:"user"}}getCopilotTokenManager(){return new r.FixedCopilotTokenManager({token:"tid=valid-copilot-token",telemetry:"enabled"})}}t.AlwaysAuthManager=s},7838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseChallengeDoc=void 0,t.parseChallengeDoc=function(e,t){const n=e.split("\n");let r=t,o=t,i=n[t.line];const s=i.indexOf("%");-1!==s&&(i=i.substring(0,s)+i.substring(s+1),r={line:t.line,character:s});const a=i.indexOf("^");if(-1!==a){const e=i.indexOf("^",a+1);if(-1===e)throw new Error("Challenge document must contain zero or two ^ characters.");i=i.substring(0,a)+i.substring(a+1,e)+i.substring(e+1),r={line:t.line,character:t.character},o={line:t.line,character:t.character+e-a-1}}return{cursorLine:i,lines:n,start:r,end:o}}},6159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAgentTestingContext=t.setAgentTestEditorInfo=t.TestTextDocumentManager=t.getTestingContext=t.newTestingContext=t.TestingOptions=void 0;const r=n(4617),o=n(892),i=n(9800),s=n(5611),a=n(4630),c=n(2369),l=n(819),u=n(3895),d=n(3007),p=n(6021),h=n(2401),f=new Map;let m=0;t.TestingOptions=o.Type.Object({testingCtx:o.Type.Optional(o.Type.Number())}),t.newTestingContext=function(e){const t=m,n=new s.Context(e);return f.set(t,n),m++,t},t.getTestingContext=function(e){const t=f.get(e);if(void 0===t)throw new Error(`Testing context ${e} not found`);return t};class g extends l.TextDocumentManager{constructor(){super(...arguments),this._textDocuments=[],this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.onDidChangeTextDocument=()=>({dispose:()=>{}})}get textDocuments(){return this._textDocuments}async getTextDocument(e){return this.textDocuments.find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){}setTextDocument(e,t,n){this._textDocuments.push(new h.AgentTextDocument(e,t,0,n))}findNotebook(e){}}function _(e){const t=new u.AgentEditorInfo;t.setEditorAndPluginInfo({name:"agent-tests",version:"0"},{name:"agent-tests",version:"0"}),e.set(i.EditorAndPluginInfo,t)}t.TestTextDocumentManager=g,t.setAgentTestEditorInfo=_,t.createAgentTestingContext=function(){const e=new s.Context;e.set(i.ConfigProvider,new u.AgentConfigProvider),(0,a.setupTestingContext)(e),_(e),e.set(d.CopilotCompletionCache,new d.CopilotCompletionCache),e.set(c.LocationFactory,new h.AgentLocationFactory),e.set(l.TextDocumentManager,new g),e.set(i.BlockModeConfig,new i.ConfigBlockModeConfig);const t=new i.VscInfo("TestSessionId","TestMachineId","TestVscVersion");return e.set(i.VscInfo,t),e.set(r.FileSystem,p.agentFileSystem),e}},2401:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocument=t.getTextDocumentChecked=t.AgentLocationFactory=void 0;const r=n(2369),o=n(1674),i=n(6813),s=n(819);class a extends r.LocationFactory{range(e,t,n,r){return void 0!==n&&void 0!==r?o.Range.create(e,t,n,r):o.Range.create(e,t)}position(e,t){return o.Position.create(e,t)}}t.AgentLocationFactory=a,t.getTextDocumentChecked=async function(e,t,n){if(n&&n.source&&n.languageId){const e=new c(t,n.languageId,0,n.source);return n.relativePath&&(e.relativePath=n.relativePath),e}const r=e.get(s.TextDocumentManager);return await r.getTextDocument(t).then((e=>{if(!e){const e=r.textDocuments.map((e=>e.uri)).join(", ");throw new Error(`Couldn't find document for uri: ${t}, known document uris are: ${e}`)}return e}))};class c{constructor(e,t,n,r){this._uri=e,this._textDocument=i.TextDocument.create(e.toString(),t,n,r)}get uri(){return this._uri}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}get relativePath(){return this._relativePath}set relativePath(e){this._relativePath=e}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r=o.Range.create(o.Position.create(t,0),o.Position.create(t,n.length)),i=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:i}}getWordRangeAtPosition(e){}update(e,t){i.TextDocument.update(this._textDocument,e,t)}}t.AgentTextDocument=c},540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocumentManager=void 0;const r=n(2361),o=n(1017),i=n(5809),s=n(6630),a=n(819),c=n(2401);class l{constructor(){this.emitter=new r}create(e,t,n,r){return new c.AgentTextDocument(s.URI.parse(e),t,n,r)}update(e,t,n){const r=[];for(const n of t)if(i.TextDocumentContentChangeEvent.isIncremental(n)){const t={range:n.range,rangeOffset:e.offsetAt(n.range.start),rangeLength:e.offsetAt(n.range.end)-e.offsetAt(n.range.start),text:n.text};r.push(t)}const o={document:e,contentChanges:r};return this.emitter.emit("change",o),e.update(t,n),e}}class u extends a.TextDocumentManager{constructor(e,t,n){super(),this.connection=e,this.workspaceFolders=t,this.onDidChangeTextDocument=(e,t,n)=>{const r=e.bind(t);return this._textDocumentConfiguration.emitter.on("change",r),{dispose:()=>{this._textDocumentConfiguration.emitter.removeListener("change",r)}}},this.onDidFocusTextDocument=(e,t,n)=>(this.connection.onNotification("textDocument/didFocus",(n=>{const r=s.URI.parse(n.uri);e.call(t,{document:{uri:r}})})),{dispose:()=>{}}),this._textDocumentConfiguration=new l,this._textDocumentListener=new i.TextDocuments(this._textDocumentConfiguration),this._textDocumentListener.listen(e),n&&this.connection.workspace.onDidChangeWorkspaceFolders((e=>{e.added.forEach((e=>this.registerWorkspaceFolder(e))),e.removed.forEach((e=>this.unregisterWorkspaceFolder(e)))})),this.connection.onNotification("vs/didAddWorkspaceFolder",(e=>this.registerWorkspaceFolder(e))),this.connection.onNotification("vs/didRemoveWorkspaceFolder",(e=>this.unregisterWorkspaceFolder(e)))}unregisterWorkspaceFolder(e){const t=this.workspaceFolders.findIndex((t=>t.toString()===s.URI.parse(e.uri).toString()));t>=0&&this.workspaceFolders.splice(t,1)}registerWorkspaceFolder(e){this.workspaceFolders.push(s.URI.parse(e.uri))}get textDocuments(){return this._textDocumentListener.all()}async getTextDocument(e){return this._textDocumentListener.all().find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){var t,n;const r=e;return r.relativePath?r.relativePath:null!==(n=(0,a.getRelativePath)(null!==(t=this.workspaceFolders)&&void 0!==t?t:[],e.fileName))&&void 0!==n?n:o.basename(e.fileName)}findNotebook(e){}}t.AgentTextDocumentManager=u},5765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshToken=t.CopilotTokenManagerFromGitHubToken=t.FixedCopilotTokenManager=t.CopilotTokenManager=t.setTelemetryConfigFromTokenInfo=t.extractTrackingIdFromToken=t.authFromGitHubToken=t.nowSeconds=void 0;const r=n(9800),o=n(5798),i=n(39),s=n(9035),a=n(5489),c=n(4567),l=new o.Logger(o.LogLevel.INFO,"auth");let u=0;function d(){return Math.floor(Date.now()/1e3)}async function p(e,t){var n,o;(0,a.telemetry)(e,"auth.new_login");const s=null!==(o=null===(n=t.devOverride)||void 0===n?void 0:n.copilotTokenUrl)&&void 0!==o?o:"https://api.github.com/copilot_internal/v2/token",c=await e.get(i.Fetcher).fetch(s,{headers:{Authorization:`token ${t.token}`,...(0,r.editorVersionHeaders)(e)}});if(!c)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_failed"),{kind:"failure",reason:"FailedToGetToken"};const u=await c.json();if(!u)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_read_failed"),{kind:"failure",reason:"FailedToGetToken"};if(f(e,u.user_notification,t),401===c.status)return l.info(e,"Failed to get copilot token due to 401 status"),(0,a.telemetryError)(e,"auth.unknown_401"),{kind:"failure",reason:"HTTP401"};if(!c.ok||!u.token){l.info(e,`Invalid copilot token: missing token: ${c.status} ${c.statusText}`),(0,a.telemetryError)(e,"auth.invalid_token",a.TelemetryData.createAndMarkAsIssued({status:c.status.toString(),status_text:c.statusText}));const n=u.error_details;return f(e,n,t),{kind:"failure",reason:"NotAuthorized",...n}}const p=u.expires_at;return u.expires_at=d()+u.refresh_in+60,e.get(a.TelemetryReporters).setToken(u),g(u),(0,a.telemetry)(e,"auth.new_token",a.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:u.expires_at,expires_at:p,current_time:d()})),{kind:"success",...u}}t.nowSeconds=d,t.authFromGitHubToken=p;const h=new Map;function f(e,t,n){if(!t)return;const o=d();h.get(t.message)||(h.set(t.message,o),e.get(s.NotificationSender).showWarningMessage(t.message,{title:t.title},{title:"Dismiss"}).catch((t=>{console.error(t),l.error(e,`Error while sending notification: ${t.message}`)})).then((async o=>{const s=(null==o?void 0:o.title)===t.title,a=s||"Dismiss"===(null==o?void 0:o.title);if(s){const n=e.get(r.EditorAndPluginInfo).getEditorPluginInfo(e),o=t.url.replace("{EDITOR}",encodeURIComponent(n.name+"_"+n.version));await e.get(c.UrlOpener).open(o)}"notification_id"in t&&a&&await async function(e,t,n){var o,s;const a=null!==(s=null===(o=n.devOverride)||void 0===o?void 0:o.notificationUrl)&&void 0!==s?s:"https://api.github.com/copilot_internal/notification",c=await e.get(i.Fetcher).fetch(a,{headers:{Authorization:`token ${n.token}`,...(0,r.editorVersionHeaders)(e)},method:"POST",body:JSON.stringify({notification_id:t})});c&&c.ok||l.error(e,`Failed to send notification result to GitHub: ${null==c?void 0:c.status} ${null==c?void 0:c.statusText}`)}(e,t.notification_id,n)})))}function m(e){const t=null==e?void 0:e.split(":")[0],n=null==t?void 0:t.split(";");for(const e of n){const[t,n]=e.split("=");if("tid"===t)return n}}function g(e){const t=m(e.token);void 0!==t&&(0,a.setTelemetryConfig)({trackingId:t,optedIn:"enabled"===e.telemetry||"unconfigured"===e.telemetry})}t.extractTrackingIdFromToken=m,t.setTelemetryConfigFromTokenInfo=g;class _{}function y(e,t,n){const r=d();u>0||(u++,setTimeout((async()=>{let n,o="";try{u--,await t.getCopilotToken(e,!0),n="success"}catch(e){n="failure",o=e.toString()}const i=a.TelemetryData.createAndMarkAsIssued({result:n},{time_taken:d()-r,refresh_count:u});o&&(i.properties.reason=o),(0,a.telemetry)(e,"auth.token_refresh",i)}),1e3*n))}t.CopilotTokenManager=_,t.FixedCopilotTokenManager=class extends _{constructor(e){super(),this.tokenInfo=e,this.wasReset=!1,g(e)}async getCopilotToken(e,t){return this.tokenInfo.token}resetCopilotToken(e,t){this.wasReset=!0}async checkCopilotToken(e){return{status:"OK",telemetry:this.tokenInfo.telemetry}}},t.CopilotTokenManagerFromGitHubToken=class extends _{constructor(e){super(),this.githubToken=e,this.copilotToken=void 0}async getCopilotToken(e,t){var n;if(!this.copilotToken||this.copilotToken.expires_at{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TELEMETRY_TERMS_URL=t.LAST_TELEMETRY_TERMS_UPDATE=void 0,t.LAST_TELEMETRY_TERMS_UPDATE="2021-10-14",t.TELEMETRY_TERMS_URL="https://github.co/copilot-telemetry-terms"},5135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeTracker=void 0;const r=n(819);t.ChangeTracker=class{constructor(e,t,n){this._referenceCount=0,this._isDisposed=!1,this._offset=n;const o=e.get(r.TextDocumentManager);this._tracker=o.onDidChangeTextDocument((async e=>{if(e.document.uri===t)for(const t of e.contentChanges)if(t.rangeOffset+t.rangeLength<=this.offset){const e=t.text.length-t.rangeLength;this._offset=this._offset+e}}))}get offset(){return this._offset}push(e,t){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout((()=>{e(),this._referenceCount--,0===this._referenceCount&&(this._tracker.dispose(),this._isDisposed=!0)}),t)}}},2137:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Clock=void 0,t.Clock=class{now(){return new Date}}},140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.keyForPrompt=void 0;const r=n(6679);t.keyForPrompt=function(e){return(0,r.SHA256)(e.prefix+e.suffix).toString()},t.LRUCache=class{constructor(e=10){this.values=new Map,this.lruKeys=[],this.size=e}removeKeyFromLRU(e){const t=this.lruKeys.indexOf(e);-1!==t&&this.lruKeys.splice(t,1)}touchKeyInLRU(e){this.removeKeyFromLRU(e),this.lruKeys.push(e)}clear(){this.values.clear(),this.lruKeys=[]}deleteKey(e){this.removeKeyFromLRU(e),void 0!==this.values.get(e)&&this.values.delete(e)}get(e){if(this.values.has(e)){const t=this.values.get(e);return this.touchKeyInLRU(e),t}}put(e,t){let n=[];this.values.has(e)?n=[e]:this.lruKeys.length>=this.size&&(n=this.lruKeys.splice(0,1));for(const e of n)this.deleteKey(e);this.values.set(e,t),this.touchKeyInLRU(e)}}},3940:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=t.Debouncer=void 0,t.Debouncer=class{async debounce(e){return this.state&&(clearTimeout(this.state.timer),this.state.reject(),this.state=void 0),new Promise(((t,n)=>{this.state={timer:setTimeout((()=>t()),e),reject:n}}))}},t.debounce=function(e,t){let n;return(...r)=>(n&&clearTimeout(n),new Promise((o=>{n=setTimeout((()=>{const e=t(...r);o(e)}),e)})))}},1661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncIterableFromArray=t.asyncIterableMapFilter=t.asyncIterableFilter=t.asyncIterableMap=void 0,t.asyncIterableMap=async function*(e,t){for await(const n of e)yield t(n)},t.asyncIterableFilter=async function*(e,t){for await(const n of e)await t(n)&&(yield n)},t.asyncIterableMapFilter=async function*(e,t){for await(const n of e){const e=await t(n);void 0!==e&&(yield e)}},t.asyncIterableFromArray=async function*(e){for(const t of e)yield t}},9800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorVersionHeaders=t.EditorAndPluginInfo=t.formatNameAndVersion=t.getTestVscInfo=t.VscInfo=t.getVersion=t.getBuild=t.getBuildType=t.isProduction=t.BuildInfo=t.suffixPercent=t.getEnabledConfig=t.getLanguageConfig=t.dumpConfig=t.getHiddenConfig=t.isDefaultSettingOverwritten=t.getConfig=t.getConfigDefaultForObjectKey=t.getConfigDefaultForKey=t.InMemoryConfigProvider=t.DefaultsOnlyConfigProvider=t.ConfigProvider=t.ConfigBlockModeConfig=t.BlockModeConfig=t.BuildType=t.BlockMode=t.ConfigKey=void 0;const r=n(4617),o=n(8139),i=n(6905),s=n(9876);var a,c;t.ConfigKey={Enable:"enable",InlineSuggestEnable:"inlineSuggest.enable",ShowEditorCompletions:["editor","showEditorCompletions"],EnableAutoCompletions:["editor","enableAutoCompletions"],DelayCompletions:["editor","delayCompletions"],FilterCompletions:["editor","filterCompletions"],DisplayStyle:["advanced","displayStyle"],SecretKey:["advanced","secret_key"],SolutionLength:["advanced","length"],Stops:["advanced","stops"],Temperature:["advanced","temperature"],TopP:["advanced","top_p"],IndentationMode:["advanced","indentationMode"],InlineSuggestCount:["advanced","inlineSuggestCount"],ListCount:["advanced","listCount"],DebugOverrideProxyUrl:["advanced","debug.overrideProxyUrl"],DebugTestOverrideProxyUrl:["advanced","debug.testOverrideProxyUrl"],DebugOverrideEngine:["advanced","debug.overrideEngine"],DebugShowScores:["advanced","debug.showScores"],DebugOverrideLogLevels:["advanced","debug.overrideLogLevels"],DebugFilterLogCategories:["advanced","debug.filterLogCategories"],DebugUseSuffix:["advanced","debug.useSuffix"],DebugAcceptSelfSignedCertificate:["advanced","debug.acceptSelfSignedCertificate"]},function(e){e.Parsing="parsing",e.Server="server"}(a=t.BlockMode||(t.BlockMode={})),(c=t.BuildType||(t.BuildType={})).DEV="dev",c.PROD="prod",c.NIGHTLY="nightly";class l{}t.BlockModeConfig=l,t.ConfigBlockModeConfig=class extends l{async forLanguage(e,n){if(e.get(u).isDefaultSettingOverwritten(t.ConfigKey.IndentationMode))switch(e.get(u).getLanguageConfig(t.ConfigKey.IndentationMode,n)){case"client":case!0:case"server":return a.Server;default:return a.Parsing}return await e.get(i.Features).overrideBlockMode()||((0,r.isSupportedLanguageId)(n)?a.Parsing:a.Server)}};class u{}function d(e){try{const t=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].default;if(void 0===t)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return t}catch(t){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}: ${t}`)}}function p(e,t){try{const n=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].properties[t].default;if(void 0===n)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return n}catch(n){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}.${t}: ${n}`)}}function h(e,t){return e.get(u).getConfig(t)}function f(e,t){return e.get(u).isDefaultSettingOverwritten(t)}function m(e,t,n){return f(e,t)?h(e,t):n.default}function g(e,t,n){return e.get(u).getLanguageConfig(t,n)}t.ConfigProvider=u,t.DefaultsOnlyConfigProvider=class extends u{getConfig(e){return Array.isArray(e)?p(e[0],e[1]):d(e)}isDefaultSettingOverwritten(e){return!1}dumpConfig(){return{}}getLanguageConfig(e,t){const n=this.getConfig(e);return t&&t in n?n[t]:n["*"]}},t.InMemoryConfigProvider=class{constructor(e,t){this.baseConfigProvider=e,this.overrides=t}getConfig(e){const t=this.overrides.get(e);return void 0!==t?t:this.baseConfigProvider.getConfig(e)}setConfig(e,t){void 0!==t?this.overrides.set(e,t):this.overrides.delete(e)}setLanguageEnablement(e,n){this.overrides.set(t.ConfigKey.Enable,{[e]:n})}isDefaultSettingOverwritten(e){return!!this.overrides.has(e)||this.baseConfigProvider.isDefaultSettingOverwritten(e)}keyAsString(e){return Array.isArray(e)?e.join("."):e}dumpConfig(){const e=this.baseConfigProvider.dumpConfig();return this.overrides.forEach(((t,n)=>{e[this.keyAsString(n)]=JSON.stringify(t)})),e}getLanguageConfig(e,t){const n=this.overrides.get(e);return void 0!==n?void 0!==t?n[t]:n["*"]:this.baseConfigProvider.getLanguageConfig(e,t)}},t.getConfigDefaultForKey=d,t.getConfigDefaultForObjectKey=p,t.getConfig=h,t.isDefaultSettingOverwritten=f,t.getHiddenConfig=m,t.dumpConfig=function(e){return e.get(u).dumpConfig()},t.getLanguageConfig=g,t.getEnabledConfig=function(e,n){return g(e,t.ConfigKey.Enable,n)},t.suffixPercent=async function(e,n,r){return m(e,t.ConfigKey.DebugUseSuffix,{default:!1})?15:e.get(i.Features).suffixPercent(n,r)};class _{constructor(){this.packageJson=s}isProduction(){return"dev"!=this.getBuildType()}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}}t.BuildInfo=_,t.isProduction=function(e){return e.get(_).isProduction()},t.getBuildType=function(e){return e.get(_).getBuildType()},t.getBuild=function(e){return e.get(_).getBuild()},t.getVersion=function(e){return e.get(_).getVersion()};class y{constructor(e,t,n){this.sessionId=e,this.machineId=t,this.vsCodeVersion=n}}function v({name:e,version:t}){return`${e}/${t}`}t.VscInfo=y,t.getTestVscInfo=function(){return new y("test-session-id","test-machine-id","test-vscode-version")},t.formatNameAndVersion=v;class b{}t.EditorAndPluginInfo=b,t.editorVersionHeaders=function(e){const t=e.get(b);return{"Editor-Version":v(t.getEditorInfo(e)),"Editor-Plugin-Version":v(t.getEditorPluginInfo(e))}}},8139:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotScheme=t.CopilotConfigPrefix=void 0,t.CopilotConfigPrefix="github.copilot",t.CopilotScheme="copilot"},5611:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0,t.Context=class{constructor(e){var t;this.baseContext=e,this.constructionStack=[],this.instances=new Map;const n=null===(t=(new Error).stack)||void 0===t?void 0:t.split("\n");n&&this.constructionStack.push(...n.slice(1))}get(e){const t=this.tryGet(e);if(t)return t;throw new Error(`No instance of ${e.name} has been registered.\n${this}`)}tryGet(e){return this.instances.get(e)||(this.baseContext?this.baseContext.tryGet(e):void 0)}set(e,t){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.instances.set(e,t)}forceSet(e,t){this.instances.set(e,t)}toString(){var e,t;let n=" Context created at:\n";for(const e of this.constructionStack||[])n+=` ${e}\n`;return n+=null!==(t=null===(e=this.baseContext)||void 0===e?void 0:e.toString())&&void 0!==t?t:"",n}get debug(){const e={};for(const[t,n]of this.instances)e[t.name]=n;return e}}},5680:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeLocation=t.encodeLocation=t.completionContextForDocument=t.CompletionContext=t.completionTypeToString=t.CompletionType=void 0;const r=n(6630),o=n(2369),i=n(8139);var s;!function(e){e[e.OPEN_COPILOT=2]="OPEN_COPILOT",e[e.TODO_QUICK_FIX=3]="TODO_QUICK_FIX",e[e.UNKNOWN_FUNCTION_QUICK_FIX=4]="UNKNOWN_FUNCTION_QUICK_FIX"}(s=t.CompletionType||(t.CompletionType={})),t.completionTypeToString=function(e){switch(e){case s.OPEN_COPILOT:return"open copilot";case s.TODO_QUICK_FIX:return"todo quick fix";case s.UNKNOWN_FUNCTION_QUICK_FIX:return"unknown function quick fix";default:return"unknown"}};class a{constructor(e,t,n){this.prependToCompletion="",this.appendToCompletion="",this.indentation=null,this.completionType=s.OPEN_COPILOT,this.insertPosition=e.get(o.LocationFactory).position(t.line,t.character),this.completionType=n}static fromJSONParse(e,t){const n=e.get(o.LocationFactory).position(t.insertPosition.line,t.insertPosition.character),r=new a(e,n,t.completionType);return r.prependToCompletion=t.prependToCompletion,r.appendToCompletion=t.appendToCompletion,r.indentation=t.indentation,r}}t.CompletionContext=a,t.completionContextForDocument=function(e,t,n){let r=n;const o=t.lineAt(n.line);return o.isEmptyOrWhitespace||(r=o.range.end),new a(e,r,s.OPEN_COPILOT)};let c=0;t.encodeLocation=function(e,t){const n=e.toString().split("#"),o=n.length>1?n[1]:"",s=JSON.stringify([n[0],t,o]);return r.URI.parse(`${i.CopilotScheme}:GitHub%20Copilot?${s}#${c++}`)},t.decodeLocation=function(e,t){const[n,o,i]=JSON.parse(t.query);return[r.URI.parse(i.length>0?n+"#"+i:n),a.fromJSONParse(e,o)]}},6317:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSolutions=t.normalizeCompletionText=void 0;const r=n(7057),o=n(1661),i=n(9800),s=n(5680),a=n(5798),c=n(7553),l=n(598),u=n(6635),d=n(7917),p=n(4090),h=n(2273),f=n(3591),m=n(3883),g=n(5489),_=n(2369),y=new a.Logger(a.LogLevel.INFO,"solutions");async function v(e,t,n){if(t.isCancellationRequested)return e.removeProgress(),{status:"FinishedWithError",error:"Cancelled"};const r=await n.next();return!0===r.done?(e.removeProgress(),{status:"FinishedNormally"}):{status:"Solution",solution:r.value,next:v(e,t,n)}}t.normalizeCompletionText=function(e){return e.replace(/\s+/g,"")},t.launchSolutions=async function(e,t){var n,a;const b=t.completionContext.insertPosition,w=t.completionContext.prependToCompletion,x=t.completionContext.indentation,T=e.get(_.LocationFactory),E=await t.getDocument(),C=await(0,p.extractPrompt)(e,E,b);if("contextTooShort"===C.type)return t.reportCancelled(),{status:"FinishedWithError",error:"Context too short"};const S=C.prompt,k=C.trailingWs;k.length>0&&(t.startPosition=T.position(t.startPosition.line,t.startPosition.character-k.length));const P=t.getCancellationToken(),I=r.v4();if(t.savedTelemetryData=g.TelemetryData.createAndMarkAsIssued({headerRequestId:I,languageId:E.languageId,source:(0,s.completionTypeToString)(t.completionContext.completionType)},{...(0,g.telemetrizePromptLength)(S),solutionCount:t.solutionCountTarget,promptEndPos:E.offsetAt(b)}),t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){const e=S.prefix.split("\n"),t=e.pop(),n=e.pop();if(n){const r=/^\W+(todo:?\s+)/i.exec(n);if(r){const o=r[1],i=n.replace(o,"");S.prefix=e.join("\n")+"\n"+i+"\n"+t}}}t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX&&(S.prefix+=t.completionContext.prependToCompletion),y.info(e,`prompt: ${JSON.stringify(S)}`),y.debug(e,`prependToCompletion: ${w}`),(0,g.telemetry)(e,"solution.requested",t.savedTelemetryData);const R=await e.get(i.BlockModeConfig).forLanguage(e,E.languageId),O=(0,h.isSupportedLanguageId)(E.languageId),A=(0,d.contextIndentation)(E,b),N={stream:!0,extra:{language:E.languageId,next_indent:null!==(n=A.next)&&void 0!==n?n:0}};"parsing"!==R||O||(N.stop=["\n\n","\r\n\r\n"]);const D=(0,f.extractRepoInfoInBackground)(e,E.fileName),M={prompt:S,languageId:E.languageId,repoInfo:D,ourRequestId:I,engineUrl:await(0,c.getEngineURL)(e,(0,f.tryGetGitHubNWO)(D),E.languageId,t.savedTelemetryData),count:t.solutionCountTarget,uiKind:l.CopilotUiKind.Panel,postOptions:N};let $;const j=t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX?[s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX,t.completionContext.prependToCompletion]:t.completionContext.completionType;switch(R){case i.BlockMode.Server:$=async e=>{},N.extra.force_indent=null!==(a=A.prev)&&void 0!==a?a:-1;break;case i.BlockMode.Parsing:default:$=O?function(e,t,n,r){return async o=>{if(r instanceof Array){const[i,s]=r;return(0,d.isBlockBodyFinishedWithPrefix)(e,t,n,o,s)}return(0,d.isBlockBodyFinished)(e,t,n,o)}}(e,E,t.startPosition,j):async e=>{}}e.get(u.StatusReporter).setProgress();const L=await e.get(l.OpenAIFetcher).fetchAndStreamCompletions(e,M,g.TelemetryData.createAndMarkAsIssued(),$,P);if("failed"===L.type||"canceled"===L.type)return t.reportCancelled(),e.get(u.StatusReporter).removeProgress(),{status:"FinishedWithError",error:`${L.type}: ${L.reason}`};let F=L.choices;F=async function*(e,t){for await(const n of e){const e={...n};e.completionText=t+e.completionText.trimRight(),yield e}}(F,w),null!==x&&(F=(0,l.cleanupIndentChoices)(F,x)),F=(0,o.asyncIterableMapFilter)(F,(async t=>(0,m.postProcessChoice)(e,"solution",E,b,t,!1,y)));const q=(0,o.asyncIterableMapFilter)(F,(async n=>{let r=n.completionText;if(y.info(e,`Open Copilot completion: [${n.completionText}]`),t.completionContext.completionType===s.CompletionType.OPEN_COPILOT||t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){let t="";const o=await(0,d.getNodeStart)(e,E,b,n.completionText);if(o)[t]=(0,p.trimLastLine)(E.getText(T.range(T.position(o.line,o.character),b)));else{const e=T.position(b.line,0);t=E.getText(T.range(e,b))}r=t+r}let o=n.completionText;t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX&&(E.lineAt(b.line).isEmptyOrWhitespace||(o+="\n")),k.length>0&&o.startsWith(k)&&(o=o.substring(k.length));const i=n.meanLogProb;return{displayText:r,meanProb:void 0!==i?Math.exp(i):0,meanLogProb:i||0,completionText:o,requestId:n.requestId,choiceIndex:n.choiceIndex,prependToCompletion:w}}));return v(e.get(u.StatusReporter),P,q[Symbol.asyncIterator]())}},446:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDefaultHandlers=void 0;const r=n(39),o=n(5489);t.registerDefaultHandlers=function(e,t){process.addListener("uncaughtException",(t=>{console.error("uncaughtException",t),o.telemetryException(e,t,"uncaughtException")}));let n=!1;process.addListener("unhandledRejection",((i,s)=>{if(n)return;if(n=!0,"vscode"===t&&!i)return;if("aborted"===i.type||(0,r.isAbortError)(i))return;if("vscode"===t&&["ENOTFOUND","ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENETDOWN","ENETUNREACH","EADDRNOTAVAIL"].includes(i.code))return;if("ENOENT"==i.code)return;let a="";try{a=`${i.message} (${i.code})`,a=JSON.stringify(i)}catch(e){a="[actual reason JSON was cyclic]"}"vscode"===t&&"{}"===a||(console.error("unhandledRejection",a),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:"Unhandled rejection logged to restricted telemetry"}),!1),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:a}),!0),n=!1)}))}},5225:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDocumentTracker=t.sortByAccessTimes=void 0;const r=n(819),o=new Map;t.sortByAccessTimes=function(e){return[...e].sort(((e,t)=>{var n,r;const i=null!==(n=o.get(e.uri.toString()))&&void 0!==n?n:0;return(null!==(r=o.get(t.uri.toString()))&&void 0!==r?r:0)-i}))},t.registerDocumentTracker=e=>e.get(r.TextDocumentManager).onDidFocusTextDocument((e=>{e&&o.set(e.document.uri.toString(),Date.now())}))},5917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfig=t.ExpTreatmentVariables=void 0;const r=n(5489),o=n(4914);var i;(i=t.ExpTreatmentVariables||(t.ExpTreatmentVariables={})).AA="copilotaa",i.CustomEngine="copilotcustomengine",i.Fetcher="copilotfetcher",i.OverrideBlockMode="copilotoverrideblockmode",i.OverrideNumGhostCompletions="copilotoverridednumghostcompletions",i.SuffixPercent="CopilotSuffixPercent",i.BeforeRequestWaitMs="copilotlms",i.NeighboringTabsOption="copilotneighboringtabs",i.DebounceMs="copilotdebouncems",i.GranularityTimePeriodSizeInH="copilottimeperiodsizeinh",i.GranularityByCallBuckets="copilotbycallbuckets",i.SuffixStartMode="copilotsuffixstartmode",i.MultiLogitBias="copilotlbeot";class s{constructor(e,t,n){this.variables=e,this.assignmentContext=t,this.features=n}static createFallbackConfig(e,t){return(0,r.telemetryExpProblem)(e,{reason:t}),this.createEmptyConfig()}static createEmptyConfig(){return new s({},"","")}addToTelemetry(e){e.properties[o.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features,e.properties[o.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName]=this.assignmentContext}}t.ExpConfig=s},6905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Features=t.Task=void 0;const r=n(4617),o=n(2137),i=n(140),s=n(5917),a=n(6046),c=n(2249),l=n(8495);class u{constructor(e){this.ctx=e,this.cache=new i.LRUCache(200)}async fetchExpConfig(e){let t=this.cache.get(e.stringify());return t||(t=new d((()=>this.ctx.get(a.ExpConfigMaker).fetchExperiments(this.ctx,e.toHeaders())),36e5),this.cache.put(e.stringify(),t)),t.run()}getCachedExpConfig(e){const t=this.cache.get(e.stringify());return null==t?void 0:t.value()}}class d{constructor(e,t=1/0){this.producer=e,this.expirationMs=t}async run(){return void 0===this.promise&&(this.promise=this.producer(),this.storeResult(this.promise).then((()=>{this.expirationMs<1/0&&void 0!==this.promise&&setTimeout((()=>this.promise=void 0),this.expirationMs)}))),this.promise}async storeResult(e){try{this.result=await e}finally{void 0===this.result&&(this.promise=void 0)}}value(){return this.result}}t.Task=d;class p{constructor(e){this.ctx=e,this.staticFilters={},this.dynamicFilters={},this.upcomingDynamicFilters={},this.assignments=new u(this.ctx),this.granularityDirectory=new l.GranularityDirectory("unspecified",e.get(o.Clock))}setPrefix(e){this.granularityDirectory=new l.GranularityDirectory(e,this.ctx.get(o.Clock))}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,t){this.dynamicFilters[e]=t}getDynamicFilterValues(){const e={};for(const[t,n]of Object.entries(this.dynamicFilters))e[t]=n();return e}registerUpcomingDynamicFilter(e,t){this.upcomingDynamicFilters[e]=t}async getAssignment(e,t={},n){var r,o;const i=this.makeFilterSettings(t),a=this.granularityDirectory.extendFilters(i),c=await this.getExpConfig(a.newFilterSettings);this.granularityDirectory.update(i,+(null!==(r=c.variables[s.ExpTreatmentVariables.GranularityByCallBuckets])&&void 0!==r?r:NaN),+(null!==(o=c.variables[s.ExpTreatmentVariables.GranularityTimePeriodSizeInH])&&void 0!==o?o:NaN));const l=this.granularityDirectory.extendFilters(i),u=l.newFilterSettings,d=await this.getExpConfig(u);let h=new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs)));for(const e of l.otherFilterSettingsToPrefetch)h=h.then((async()=>{await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e)}));return this.prepareForUpcomingFilters(u),n&&(n.filtersAndExp={exp:d,filters:u}),d.variables[e]}makeFilterSettings(e){return new c.FilterSettings({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e){try{return this.assignments.fetchExpConfig(e)}catch(e){return s.ExpConfig.createFallbackConfig(this.ctx,`Error fetching ExP config: ${e}`)}}async prepareForUpcomingFilters(e){if(!((new Date).getMinutes()<60-p.upcomingTimeBucketMinutes))for(const[t,n]of Object.entries(this.upcomingDynamicFilters))await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e.withChange(t,n()))}stringify(){var e;const t=this.assignments.getCachedExpConfig(new c.FilterSettings({}));return JSON.stringify(null!==(e=null==t?void 0:t.variables)&&void 0!==e?e:{})}async customEngine(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.CustomEngine,o,n))&&void 0!==r?r:""}async beforeRequestWaitMs(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.BeforeRequestWaitMs,o,n))&&void 0!==r?r:0}async multiLogitBias(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.MultiLogitBias,o,n))&&void 0!==r&&r}async debounceMs(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.DebounceMs))&&void 0!==e?e:0}async overrideBlockMode(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideBlockMode)}async overrideNumGhostCompletions(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideNumGhostCompletions)}async suffixPercent(e,t){var n;const r={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(s.ExpTreatmentVariables.SuffixPercent,r))&&void 0!==n?n:0}async suffixStartMode(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.SuffixStartMode,n)){default:return r.SuffixStartMode.Cursor;case"cursortrimstart":return r.SuffixStartMode.CursorTrimStart;case"siblingblock":return r.SuffixStartMode.SiblingBlock;case"siblingblocktrimstart":return r.SuffixStartMode.SiblingBlockTrimStart}}async neighboringTabsOption(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.NeighboringTabsOption,n)){case"none":return r.NeighboringTabsOption.None;case"conservative":return r.NeighboringTabsOption.Conservative;case"medium":return r.NeighboringTabsOption.Medium;default:return r.NeighboringTabsOption.Eager;case"eagerbutlittle":return r.NeighboringTabsOption.EagerButLittle}}async addExpAndFilterToTelemetry(e){const t=this.makeFilterSettings({});e.filtersAndExp={filters:t,exp:await this.getExpConfig(t)}}}t.Features=p,p.upcomingDynamicFilterCheckDelayMs=20,p.upcomingTimeBucketMinutes=5+Math.floor(11*Math.random())},6046:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfigNone=t.ExpConfigFromTAS=t.ExpConfigMaker=void 0;const r=n(39),o=n(5917);class i{}t.ExpConfigMaker=i,t.ExpConfigFromTAS=class extends i{async fetchExperiments(e,t){var n;const i=e.get(r.Fetcher);let s;try{s=await i.fetch("https://default.exp-tas.com/vscode/ab",{method:"GET",headers:t})}catch(t){return o.ExpConfig.createFallbackConfig(e,`Error fetching ExP config: ${t}`)}if(!s.ok)return o.ExpConfig.createFallbackConfig(e,`ExP responded with ${s.status}`);const a=await s.json(),c=null!==(n=a.Configs.find((e=>"vscode"===e.Id)))&&void 0!==n?n:{Id:"vscode",Parameters:{}},l=Object.entries(c.Parameters).map((([e,t])=>e+(t?"":"cf")));return new o.ExpConfig(c.Parameters,a.AssignmentContext,l.join(";"))}},t.ExpConfigNone=class extends i{async fetchExperiments(e,t){return o.ExpConfig.createEmptyConfig()}}},2249:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.FilterSettings=t.telmetryNames=t.TargetPopulation=t.Filter=void 0,function(e){e.Market="X-MSEdge-Market",e.CorpNet="X-FD-Corpnet",e.ApplicationVersion="X-VSCode-AppVersion",e.Build="X-VSCode-Build",e.ClientId="X-MSEdge-ClientId",e.ExtensionName="X-VSCode-ExtensionName",e.ExtensionVersion="X-VSCode-ExtensionVersion",e.Language="X-VSCode-Language",e.TargetPopulation="X-VSCode-TargetPopulation",e.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",e.CopilotOverrideEngine="X-Copilot-OverrideEngine",e.CopilotRepository="X-Copilot-Repository",e.CopilotFileType="X-Copilot-FileType",e.CopilotUserKind="X-Copilot-UserKind"}(n=t.Filter||(t.Filter={})),(r=t.TargetPopulation||(t.TargetPopulation={})).Team="team",r.Internal="internal",r.Insiders="insider",r.Public="public",t.telmetryNames={[n.CopilotClientTimeBucket]:"timeBucket",[n.CopilotOverrideEngine]:"engine",[n.CopilotRepository]:"repo",[n.CopilotFileType]:"fileType",[n.CopilotUserKind]:"userKind"};class o{constructor(e){this.filters=e;for(const[e,t]of Object.entries(this.filters))""===t&&delete this.filters[e]}extends(e){for(const[t,n]of Object.entries(e.filters))if(this.filters[t]!==n)return!1;return!0}addToTelemetry(e){for(const[n,r]of Object.entries(this.filters)){const o=t.telmetryNames[n];void 0!==o&&(e.properties[o]=r)}}stringify(){const e=Object.keys(this.filters);return e.sort(),e.map((e=>`${e}:${this.filters[e]}`)).join(";")}toHeaders(){return{...this.filters}}withChange(e,t){return new o({...this.filters,[e]:t})}}t.FilterSettings=o},8495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GranularityDirectory=void 0;const r=n(2249),o=n(2505),i=r.Filter.CopilotClientTimeBucket;t.GranularityDirectory=class{constructor(e,t){this.specs=new Map,this.prefix=e,this.clock=t,this.defaultGranularity=(0,o.DEFAULT_GRANULARITY)(e)}selectGranularity(e){for(const[t,n]of this.specs.entries())if(e.extends(t))return n;return this.defaultGranularity}update(e,t,n){if(t=t>1?t:NaN,n=n>0?n:NaN,isNaN(t)&&isNaN(n))this.specs.delete(e);else{const r=new o.TimeBucketGranularity(this.prefix);isNaN(t)||r.setByCallBuckets(t),isNaN(n)||r.setTimePeriod(3600*n*1e3),this.specs.set(e,r)}}extendFilters(e){const t=this.selectGranularity(e),[n,r]=t.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(i,n),otherFilterSettingsToPrefetch:r.map((t=>e.withChange(i,t)))}}}},2505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBucketGranularity=t.DEFAULT_GRANULARITY=t.GranularityImplementation=void 0;class n{constructor(e){this.prefix=e}getCurrentAndUpComingValues(e){return[this.getValue(e),this.getUpcomingValues(e)]}}t.GranularityImplementation=n;class r extends n{getValue(e){return this.prefix}getUpcomingValues(e){return[]}}t.DEFAULT_GRANULARITY=e=>new r(e),t.TimeBucketGranularity=class extends n{constructor(e,t=.5,n=(new Date).setUTCHours(0,0,0,0)){super(e),this.prefix=e,this.fetchBeforeFactor=t,this.anchor=n}setTimePeriod(e){isNaN(e)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=e}setByCallBuckets(e){isNaN(e)?this.numByCallBuckets=void 0:this.numByCallBuckets=e}getValue(e){return this.prefix+this.getTimePeriodBucketString(e)+(this.numByCallBuckets?this.timeHash(e):"")}getTimePeriodBucketString(e){return this.timePeriodLengthMs?this.dateToTimePartString(e):""}getUpcomingValues(e){const t=[],n=this.getUpcomingTimePeriodBucketStrings(e),r=this.getUpcomingByCallBucketStrings();for(const e of n)for(const n of r)t.push(this.prefix+e+n);return t}getUpcomingTimePeriodBucketStrings(e){if(void 0===this.timePeriodLengthMs)return[""];if((e.getTime()-this.anchor)%this.timePeriodLengthMse.toString()))}timeHash(e){return null==this.numByCallBuckets?0:e.getTime()%this.numByCallBuckets*7883%this.numByCallBuckets}dateToTimePartString(e){return null==this.timePeriodLengthMs?"":Math.floor((e.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}}},4914:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpServiceTelemetryNames=void 0,(n=t.ExpServiceTelemetryNames||(t.ExpServiceTelemetryNames={})).featuresTelemetryPropertyName="VSCode.ABExp.Features",n.assignmentContextTelemetryPropertyName="abexp.assignmentcontext"},3993:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.completionsFromGhostTextResults=void 0;const r=n(7057),o=n(2369),i=n(702),s=n(5034);t.completionsFromGhostTextResults=function(e,t,n,a,c,l,u){const d=e.get(o.LocationFactory),p=a.lineAt(c);let h=t.map((e=>{let t,o="";if(l&&(e.completion=(0,s.normalizeIndentCharacter)(l,e.completion,p.isEmptyOrWhitespace)),e.completion.displayNeedsWsOffset&&p.isEmptyOrWhitespace)t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else if(p.isEmptyOrWhitespace&&e.completion.completionText.startsWith(p.text))t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else{const n=a.getWordRangeAtPosition(c);if(e.isMiddleOfTheLine){const n=a.lineAt(c),r=d.range(d.position(c.line,0),c),i=a.getText(r);t=e.coversSuffix?n.range:r,o=i+e.completion.displayText}else if(n){const r=a.getText(n);t=d.range(n.start,c),o=r+e.completion.completionText}else{const n=d.range(d.position(c.line,0),c);t=n,o=a.getText(n)+e.completion.displayText}}return{uuid:(0,r.v4)(),text:o,range:t,file:a.uri,index:e.completion.completionIndex,telemetry:e.telemetry,displayText:e.completion.displayText,position:c,offset:a.offsetAt(c),resultType:n}}));if(n===i.ResultType.TypingAsSuggested&&void 0!==u){const e=h.find((e=>e.index===u));if(e){const t=h.filter((e=>e.index!==u));h=[e,...t]}}return h}},4619:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDebounceLimit=t.GhostTextDebounceManager=void 0;const r=n(6905);class o{constructor(e){this.forceDelayMs=e,this.extraDebounceMs=0}}t.GhostTextDebounceManager=o,t.getDebounceLimit=async function(e){const t=await e.get(r.Features).debounceMs();return(t>0?t:75)+e.get(o).extraDebounceMs}},702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGhostText=t.completionCache=t.ResultType=t.ghostTextLogger=void 0;const r=n(4617),o=n(7057),i=n(140),s=n(3940),a=n(1661),c=n(9800),l=n(6905),u=n(5798),d=n(39),p=n(7553),h=n(2031),f=n(598),m=n(6635),g=n(7917),_=n(4090),y=n(3591),v=n(1153),b=n(3883),w=n(5489),x=n(913),T=n(2369),E=n(4619),C=n(1749);var S;let k,P;async function I(e,n,r,o,i,s,a){var u,p,m;t.ghostTextLogger.debug(e,`Getting ${s} from network`),r=r.extendedBy();const g=await async function(e,t){const n=await e.get(l.Features).overrideNumGhostCompletions();return n?t.isCycling?Math.max(0,3-n):n:t.blockMode==c.BlockMode.Server&&t.isCycling?2:t.blockMode==c.BlockMode.Server?1:t.blockMode==c.BlockMode.Parsing&&t.isCycling&&!t.multiline?2:t.multiline?(0,c.getConfig)(e,c.ConfigKey.InlineSuggestCount):1}(e,n),_=(0,f.getTemperatureForSamples)(e,g),y={stream:!0,n:g,temperature:_,extra:{language:n.languageId,next_indent:null!==(u=n.indentation.next)&&void 0!==u?u:0}};n.multiline||(y.stop=["\n"]),n.multiline&&n.multiLogitBias&&(y.logit_bias={50256:-100});const v=Date.now(),b={endpoint:"completions",uiKind:h.CopilotUiKind.GhostText,isCycling:JSON.stringify(n.isCycling),temperature:JSON.stringify(_),n:JSON.stringify(g),stop:null!==(p=JSON.stringify(y.stop))&&void 0!==p?p:"unset",logit_bias:JSON.stringify(null!==(m=y.logit_bias)&&void 0!==m?m:null)},T=(0,w.telemetrizePromptLength)(n.prompt);Object.assign(r.properties,b),Object.assign(r.measurements,T);try{const s={prompt:n.prompt,languageId:n.languageId,repoInfo:n.repoInfo,ourRequestId:n.ourRequestId,engineUrl:n.engineURL,count:g,uiKind:h.CopilotUiKind.GhostText,postOptions:y};n.delayMs>0&&await new Promise((e=>setTimeout(e,n.delayMs)));const c=await e.get(h.OpenAIFetcher).fetchAndStreamCompletions(e,s,r,i,o);return"failed"===c.type?{type:"failed",reason:c.reason,telemetryData:(0,C.mkBasicResultTelemetry)(r)}:"canceled"===c.type?(t.ghostTextLogger.debug(e,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:c.reason,telemetryData:(0,C.mkCanceledResultTelemetry)(r)}):a(g,v,c.getProcessingTime(),c.choices)}catch(n){if((0,d.isAbortError)(n))return{type:"canceled",reason:"network request aborted",telemetryData:(0,C.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(t.ghostTextLogger.error(e,`Error on ghost text request ${n}`),(0,x.shouldFailForDebugPurposes)(e))throw n;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,C.mkBasicResultTelemetry)(r)}}}function R(e,t){const n={...e};return n.completionText=e.completionText.trimEnd(),t.forceSingleLine&&(n.completionText=n.completionText.split("\n")[0]),n}t.ghostTextLogger=new u.Logger(u.LogLevel.INFO,"ghostText"),function(e){e[e.Network=0]="Network",e[e.Cache=1]="Cache",e[e.TypingAsSuggested=2]="TypingAsSuggested",e[e.Cycling=3]="Cycling"}(S=t.ResultType||(t.ResultType={})),t.completionCache=new i.LRUCache(100);const O=new s.Debouncer;function A(e,t){k=e,P=t}function N(e,n,r){const o=(0,i.keyForPrompt)(n.prompt),s=t.completionCache.get(o);s&&s.multiline===r.multiline?t.completionCache.put(o,{multiline:s.multiline,choices:s.choices.concat(r.choices)}):t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Appended cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}function D(e,n){const r=t.completionCache.get(e);if(r&&(!n||r.multiline))return r.choices}function M(e,t,n){if(n.length>0){if(t.startsWith(n))return{completionIndex:e,completionText:t,displayText:t.substr(n.length),displayNeedsWsOffset:!1};{const r=t.substr(0,t.length-t.trimLeft().length);return n.startsWith(r)?{completionIndex:e,completionText:t,displayText:t.trimLeft(),displayNeedsWsOffset:!0}:{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}}return{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}function $(e,n){const r=n.requestId,o={choiceIndex:n.choiceIndex.toString()},i={numTokens:n.numTokens,compCharLen:n.completionText.length,numLines:n.completionText.split("\n").length};n.meanLogProb&&(i.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(i.meanAlternativeLogProb=n.meanAlternativeLogProb);const s=n.telemetryData.extendedBy(o,i);return s.extendWithRequestId(r),s.measurements.confidence=(0,v.ghostTextScoreConfidence)(e,s),s.measurements.quantile=(0,v.ghostTextScoreQuantile)(e,s),t.ghostTextLogger.debug(e,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${s.measurements.confidence} (expected as good or better than about ${s.measurements.quantile} of all suggestions)`),s}function j(e,t,n,r,o){const i=Date.now()-r,s=i-o,a=n.telemetryData.extendedBy({},{completionCharLen:n.completionText.length,requestTimeMs:i,processingTimeMs:o,deltaMs:s,meanLogProb:n.meanLogProb||NaN,meanAlternativeLogProb:n.meanAlternativeLogProb||NaN,numTokens:n.numTokens});a.extendWithRequestId(n.requestId),(0,w.telemetry)(e,`ghostText.${t}`,a)}t.getGhostText=async function(e,n,s,u,d){var f,v;const L=await(0,_.extractPrompt)(e,n,s);if("contextTooShort"===L.type)return t.ghostTextLogger.debug(e,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context"};if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled after extractPrompt"};const F=function(e,t){const n=(o=t,0!=e.lineAt(o).text.substr(o.character).trim().length),r=function(e,t){const n=t.lineAt(e).text.substr(e.character).trim();return/^\s*[)}\]"'`]*\s*[:{;,]?\s*$/.test(n)}(t,e);var o;if(!n||r)return n&&r}(n,s);if(void 0===F)return t.ghostTextLogger.debug(e,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line"};const q=e.get(m.StatusReporter),B=e.get(T.LocationFactory),H=await async function(e,t,n,o,i,s){switch(await e.get(c.BlockModeConfig).forLanguage(e,t.languageId)){case c.BlockMode.Server:return{blockMode:c.BlockMode.Server,requestMultiline:!0,isCyclingRequest:i,finishedCb:async e=>{}};case c.BlockMode.Parsing:default:{const a=await async function(e,t,n,o){if(t.lineCount>=8e3)(0,w.telemetry)(e,"ghostText.longFileMultilineSkip",w.TelemetryData.createAndMarkAsIssued({languageId:t.languageId,lineCount:String(t.lineCount),currentLine:String(n.line)}));else{if(!o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n);if(o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n)||await(0,g.isEmptyBlockStart)(t,t.lineAt(n).range.end)}return!1}(e,t,n,s);return a?{blockMode:c.BlockMode.Parsing,requestMultiline:!0,isCyclingRequest:!1,finishedCb:async r=>{let i;return i=o.trailingWs.length>0&&!o.prompt.prefix.endsWith(o.trailingWs)?e.get(T.LocationFactory).position(n.line,Math.max(n.character-o.trailingWs.length,0)):n,(0,g.isBlockBodyFinished)(e,t,i,r)}}:{blockMode:c.BlockMode.Parsing,requestMultiline:!1,isCyclingRequest:i,finishedCb:async e=>{}}}}}(e,n,s,L,u,F);if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after requestMultiline"),{type:"abortedBeforeIssued",reason:"Cancelled after requestMultiline"};const[U]=(0,_.trimLastLine)(n.getText(B.range(B.position(0,0),s)));let W=function(e,n,r,o){const s=function(e,n,r){if(!k||!P||!n.startsWith(k))return;const o=D(P,r);if(!o)return;const i=n.substring(k.length);t.ghostTextLogger.debug(e,`Getting completions for user-typing flow - remaining prefix: ${i}`);const s=[];return o.forEach((e=>{const t=R(e,{forceSingleLine:!1});t.completionText.startsWith(i)&&(t.completionText=t.completionText.substring(i.length),s.push(t))})),s}(e,n,o);if(s&&s.length>0)return[s,S.TypingAsSuggested];const a=function(e,n,r,o){const s=(0,i.keyForPrompt)(r);t.ghostTextLogger.debug(e,`Trying to get completions from cache for key: ${s}`);const a=D(s,o);if(a){t.ghostTextLogger.debug(e,`Got completions from cache for key: ${s}`);const r=[];a.forEach((e=>{const t=R(e,{forceSingleLine:!o});r.push(t)}));const i=r.filter((e=>e.completionText));return i.length>0&&A(n,s),i}}(e,n,r,o);return a&&a.length>0?[a,S.Cache]:void 0}(e,U,L.prompt,H.requestMultiline);const z=o.v4(),K=w.TelemetryData.createAndMarkAsIssued(),V=(0,y.extractRepoInfoInBackground)(e,n.fileName),G=await(0,p.getEngineURL)(e,(0,y.tryGetGitHubNWO)(V),n.languageId,K),J=await e.get(l.Features).beforeRequestWaitMs((0,y.tryGetGitHubNWO)(V)||"",n.languageId),X=await e.get(l.Features).multiLogitBias((0,y.tryGetGitHubNWO)(V)||"",n.languageId),Q={blockMode:H.blockMode,languageId:n.languageId,repoInfo:V,engineURL:G,ourRequestId:z,prefix:U,prompt:L.prompt,multiline:H.requestMultiline,indentation:(0,g.contextIndentation)(n,s),isCycling:u,delayMs:J,multiLogitBias:X},Y=function(e,t,n,r,o,i){const s=e.get(T.LocationFactory),a=t.lineAt(r.line),c=t.getText(s.range(a.range.start,r)),l=t.getText(s.range(r,a.range.end)),u={languageId:t.languageId,beforeCursorWhitespace:JSON.stringify(""===c.trim()),afterCursorWhitespace:JSON.stringify(""===l.trim())},d={...(0,w.telemetrizePromptLength)(o.prompt),promptEndPos:t.offsetAt(r),documentLength:t.getText().length,delayMs:n.delayMs},p=i.extendedBy(u,d);p.properties.promptChoices=JSON.stringify(o.promptChoices,((e,t)=>t instanceof Map?Array.from(t.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{}):t)),p.properties.promptBackground=JSON.stringify(o.promptBackground,((e,t)=>t instanceof Map?Array.from(t.values()):t)),p.measurements.promptComputeTimeMs=o.computeTimeMs;const f=n.repoInfo;return p.properties.gitRepoInformation=void 0===f?"unavailable":f===y.ComputationStatus.PENDING?"pending":"available",void 0!==f&&f!==y.ComputationStatus.PENDING&&(p.properties.gitRepoUrl=f.url,p.properties.gitRepoHost=f.hostname,p.properties.gitRepoOwner=f.owner,p.properties.gitRepoName=f.repo),p.properties.engineName=(0,h.extractEngineName)(e,n.engineURL),p.properties.isMultiline=JSON.stringify(n.multiline),p.properties.blockMode=n.blockMode,p.properties.isCycling=JSON.stringify(n.isCycling),p.properties.headerRequestId=n.ourRequestId,(0,w.telemetry)(e,"ghostText.issued",p),p}(e,n,Q,s,L,K);if(H.isCyclingRequest&&(null!==(f=null==W?void 0:W[0].length)&&void 0!==f?f:0)>1||!H.isCyclingRequest&&void 0!==W)t.ghostTextLogger.info(e,"Found inline suggestions locally");else{if(null==q||q.setProgress(),H.isCyclingRequest){const n=await async function(e,n,r,o,i){return I(e,n,r,o,i,"all completions",(async(i,s,a,c)=>{const l=[];for await(const n of c){if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,C.mkCanceledResultTelemetry)(r)};if(n.completionText.trimEnd()){if(-1!==l.findIndex((e=>e.completionText.trim()===n.completionText.trim())))continue;l.push(n)}}return l.length>0&&(N(e,n,{multiline:n.multiline,choices:l}),j(e,"cyclingPerformance",l[0],s,a)),{type:"success",value:l,telemetryData:(0,C.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Q,Y,d,H.finishedCb);if("success"===n.type){const e=null!==(v=null==W?void 0:W[0])&&void 0!==v?v:[];n.value.forEach((t=>{-1===e.findIndex((e=>e.completionText.trim()===t.completionText.trim()))&&e.push(t)})),W=[e,S.Cycling]}else if(void 0===W)return null==q||q.removeProgress(),n}else{const n=await(0,E.getDebounceLimit)(e);try{await O.debounce(n)}catch{return{type:"canceled",reason:"by debouncer",telemetryData:(0,C.mkCanceledResultTelemetry)(Y)}}if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled during debounce"),{type:"canceled",reason:"during debounce",telemetryData:(0,C.mkCanceledResultTelemetry)(Y)};const r=await async function(e,n,r,o,s){return I(e,n,r,o,s,"completions",(async(s,a,c,l)=>{const u=l[Symbol.asyncIterator](),d=await u.next();if(d.done)return t.ghostTextLogger.debug(e,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,C.mkBasicResultTelemetry)(r)};if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,C.mkCanceledResultTelemetry)(r)};const p=d.value;if(void 0===p)return t.ghostTextLogger.debug(e,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,C.mkBasicResultTelemetry)(r)};j(e,"performance",p,a,c);const h=s-1;t.ghostTextLogger.debug(e,`Awaited first result, id: ${p.choiceIndex}`),function(e,n,r){const o=(0,i.keyForPrompt)(n.prompt);A(n.prefix,o),t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}(e,n,{multiline:n.multiline,choices:[p]});const f=[];for(let e=0;e{t.ghostTextLogger.debug(e,`Awaited remaining results, number of results: ${r.length}`);const o=[];for(const n of r){const r=n.value;if(void 0!==r&&(t.ghostTextLogger.info(e,`GhostText later completion: [${r.completionText}]`),r.completionText.trimEnd())){if(-1!==o.findIndex((e=>e.completionText.trim()===r.completionText.trim())))continue;if(r.completionText.trim()===p.completionText.trim())continue;o.push(r)}}o.length>0&&N(e,n,{multiline:n.multiline,choices:o})}));return(0,x.isRunningInTest)(e)&&await m,{type:"success",value:R(d.value,{forceSingleLine:!1}),telemetryData:(0,C.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Q,Y,d,H.finishedCb);if("success"!==r.type)return null==q||q.removeProgress(),r;W=[[r.value],S.Network]}null==q||q.removeProgress()}if(void 0===W)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,C.mkBasicResultTelemetry)(Y)};const[Z,ee]=W,te=(0,a.asyncIterableMapFilter)((0,a.asyncIterableFromArray)(Z),(async r=>(0,b.postProcessChoice)(e,"ghostText",n,s,r,F,t.ghostTextLogger))),ne=[];for await(const r of te){const o=F&&(0,b.checkSuffix)(n,s,r);if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after post processing completions"),{type:"canceled",reason:"after post processing completions",telemetryData:(0,C.mkCanceledResultTelemetry)(Y)};const i=$(e,r),a={completion:M(r.choiceIndex,r.completionText,L.trailingWs),telemetry:i,isMiddleOfTheLine:F,coversSuffix:o};ne.push(a)}return{type:"success",value:[ne,ee],telemetryData:(0,C.mkBasicResultTelemetry)(Y),telemetryBlob:Y}}},5034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeIndentCharacter=void 0,t.normalizeIndentCharacter=function(e,t,n){function r(e,t,n){const r=new RegExp(`^(${t})+`,"g");return e.split("\n").map((e=>{const t=e.replace(r,""),o=e.length-t.length;return n(o)+t})).join("\n")}let o;if(o=void 0===e.tabSize||"string"==typeof e.tabSize?4:e.tabSize,!1===e.insertSpaces){const e=e=>r(e," ",(e=>"\t".repeat(Math.floor(e/o))+" ".repeat(e%o)));t.displayText=e(t.displayText),t.completionText=e(t.completionText)}else if(!0===e.insertSpaces){const e=e=>r(e,"\t",(e=>" ".repeat(e*o)));if(t.displayText=e(t.displayText),t.completionText=e(t.completionText),n){const e=e=>{const t=e.length-e.trimLeft().length,n=t%o;return 0!==n&&t>0?r(e," ".repeat(n),(e=>" ".repeat((Math.floor(e/o)+1)*o))):e};t.displayText=e(t.displayText),t.completionText=e(t.completionText)}}return t}},1749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGhostTextResultTelemetry=t.mkBasicResultTelemetry=t.mkCanceledResultTelemetry=t.telemetryRejected=t.telemetryAccepted=t.telemetryShown=void 0;const r=n(5489);t.telemetryShown=function(e,t,n,o){n.markAsDisplayed();const i=o?`${t}.shownFromCache`:`${t}.shown`;(0,r.telemetry)(e,i,n)},t.telemetryAccepted=function(e,t,n){const o=t+".accepted";(0,r.telemetry)(e,o,n)},t.telemetryRejected=function(e,t,n){const o=t+".rejected";(0,r.telemetry)(e,o,n)},t.mkCanceledResultTelemetry=function(e,t={}){return{...t,telemetryBlob:e}},t.mkBasicResultTelemetry=function(e){return{headerRequestId:e.properties.headerRequestId,copilot_trackingId:e.properties.copilot_trackingId}},t.handleGhostTextResultTelemetry=async function(e,t){if("success"===t.type)return(0,r.telemetryRaw)(e,"ghostText.produced",t.telemetryData,{}),t.value;"abortedBeforeIssued"!==t.type&&("canceled"!==t.type?(0,r.telemetryRaw)(e,`ghostText.${t.type}`,{...t.telemetryData,reason:t.reason},{}):(0,r.telemetry)(e,"ghostText.canceled",t.telemetryData.telemetryBlob.extendedBy({reason:t.reason,cancelledNetworkRequest:t.telemetryData.cancelledNetworkRequest?"true":"false"})))}},5798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.toPlainText=t.Logger=t.MultiLog=t.OutputChannelLog=t.ConsoleLog=t.LogTarget=t.verboseLogging=t.LogVerbose=t.LogLevel=void 0;const r=n(2137),o=n(9800),i=n(5489);var s;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(s=t.LogLevel||(t.LogLevel={}));class a{constructor(e){this.logVerbose=e}}function c(e){return e.get(a).logVerbose}t.LogVerbose=a,t.verboseLogging=c;class l{shouldLog(e,t){}}t.LogTarget=l,t.ConsoleLog=class extends l{constructor(e){super(),this.console=e}logIt(e,t,n,...r){c(e)||t==s.ERROR?this.console.error(n,...r):t==s.WARN&&this.console.warn(n,...r)}},t.OutputChannelLog=class extends l{constructor(e){super(),this.output=e}logIt(e,t,n,...r){this.output.appendLine(`${n} ${r.map(d)}`)}},t.MultiLog=class extends l{constructor(e){super(),this.targets=e}logIt(e,t,n,...r){this.targets.forEach((o=>o.logIt(e,t,n,...r)))}};class u{constructor(e,t){this.minLoggedLevel=e,this.context=t}setLevel(e){this.minLoggedLevel=e}stringToLevel(e){return s[e]}log(e,t,n,...o){const a=s[t];t==s.ERROR&&(0,i.telemetryError)(e,"log",i.TelemetryData.createAndMarkAsIssued({context:this.context,level:a,message:o.length>0?JSON.stringify(o):"no msg"}),n);const c=e.get(l),u=c.shouldLog(e,t);if(!1===u)return;if(void 0===u&&!this.shouldLog(e,t,this.context))return;const d=e.get(r.Clock).now().toISOString(),p=`[${a}] [${this.context}] [${d}]`;c.logIt(e,t,p,...o)}shouldLog(e,t,n){var r,i;if(c(e))return!0;const s=(0,o.getConfig)(e,o.ConfigKey.DebugFilterLogCategories);if(s.length>0&&!s.includes(n))return!1;if((0,o.isProduction)(e))return t>=this.minLoggedLevel;const a=(0,o.getConfig)(e,o.ConfigKey.DebugOverrideLogLevels);return t>=(null!==(i=null!==(r=this.stringToLevel(a["*"]))&&void 0!==r?r:this.stringToLevel(a[this.context]))&&void 0!==i?i:this.minLoggedLevel)}debug(e,...t){this.log(e,s.DEBUG,!1,...t)}info(e,...t){this.log(e,s.INFO,!1,...t)}warn(e,...t){this.log(e,s.WARN,!1,...t)}error(e,...t){this.log(e,s.ERROR,!1,...t)}secureError(e,t,...n){this.log(e,s.ERROR,!1,t),this.log(e,s.ERROR,!0,t,...n)}}function d(e){return"object"==typeof e?JSON.stringify(e):String(e)}t.Logger=u,t.toPlainText=d,t.logger=new u(s.INFO,"default")},39:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postRequest=t.Response=t.HelixFetcher=t.isAbortError=t.Fetcher=t.init=void 0;const r=n(8606),o=n(3582),i=n(3837),s=n(9800),a=n(4619),c=n(5489);let l,u=!1;t.init=function(e){if(u){if(e!==l)throw new Error(`Networking re-initialized with mismatched version (old: ${l}, new: ${e})`)}else l=e,u=!0};class d{}t.Fetcher=d,t.isAbortError=function(e){return e instanceof r.AbortError},t.HelixFetcher=class extends d{constructor(e){super(),this.ctx=e,this.createSocketFactory=e=>{const t=o.httpOverHttp({proxy:e});return e=>new Promise((n=>{t.createSocket(e,(e=>{n(e)}))}))},this.fetchApi=this.createFetchApi(e)}set proxySettings(e){this._proxySettings=e,this.fetchApi=this.createFetchApi(this.ctx)}get proxySettings(){return this._proxySettings}createFetchApi(e){const t=e.get(s.BuildInfo),n=t.getBuildType()===s.BuildType.DEV,o=t.getBuildType()===s.BuildType.NIGHTLY,i=(0,s.getHiddenConfig)(e,s.ConfigKey.DebugAcceptSelfSignedCertificate,{default:!1})&&(n||o);return r.context({userAgent:`GithubCopilot/${t.getVersion()}`,rejectUnauthorized:!i,socketFactory:this._proxySettings?this.createSocketFactory(this._proxySettings):void 0})}async fetch(e,t){const n={...t,body:t.body?t.body:t.json,signal:t.signal},r=await this.fetchApi.fetch(e,n);return new p(r.status,r.statusText,r.headers,(()=>r.text()),(()=>r.json()),(async()=>r.body))}disconnectAll(){return this.fetchApi.reset()}async makeAbortController(){return new r.AbortController}};class p{constructor(e,t,n,r,o,i){this.status=e,this.statusText=t,this.headers=n,this.getText=r,this.getJson=o,this.getBody=i,this.ok=this.status>=200&&this.status<300}async text(){return this.getText()}async json(){return this.getJson()}async body(){return this.getBody()}}t.Response=p,t.postRequest=async function(e,t,n,r,o,l,p){if(!u)throw new Error("Networking must be initialized before being used");const h={Authorization:i.format("Bearer %s",n),"X-Request-Id":o,"Openai-Organization":"github-copilot","VScode-SessionId":e.get(s.VscInfo).sessionId,"VScode-MachineId":e.get(s.VscInfo).machineId,...(0,s.editorVersionHeaders)(e)};r&&(h["OpenAI-Intent"]=r);const f=e.get(a.GhostTextDebounceManager).forceDelayMs;f&&(h["X-Copilot-Force-Delay"]=f.toString());const m={method:"POST",headers:h,json:l,timeout:3e4},g=e.get(d);if(p){const t=await g.makeAbortController();p.onCancellationRequested((()=>{(0,c.telemetry)(e,"networking.cancelRequest",c.TelemetryData.createAndMarkAsIssued({headerRequestId:o})),t.abort()})),m.signal=t.signal}return g.fetch(t,m).catch((n=>{if("ECONNRESET"==n.code||"ETIMEDOUT"==n.code||"ERR_HTTP2_INVALID_SESSION"==n.code||"ERR_HTTP2_GOAWAY_SESSION"==n.message)return(0,c.telemetry)(e,"networking.disconnectAll"),g.disconnectAll().then((()=>g.fetch(t,m)));throw n}))}},9035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationSender=void 0,t.NotificationSender=class{}},7553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEngineURL=t.TEST_ENGINE_PATHS=t.OPENAI_PROXY_HOST=void 0;const r=n(9800),o=n(6905),i=n(913);t.OPENAI_PROXY_HOST="https://copilot-proxy.githubusercontent.com";const s="/v1/engines/copilot-codex";t.TEST_ENGINE_PATHS=[s],t.getEngineURL=async function(e,n="",a,c){return function(e,n){let o=function(e){return(0,i.isRunningInTest)(e)?(0,r.getConfig)(e,r.ConfigKey.DebugTestOverrideProxyUrl):(0,r.getConfig)(e,r.ConfigKey.DebugOverrideProxyUrl)}(e);return 0==o.length&&(o=t.OPENAI_PROXY_HOST),`${o}${n}`}(e,await async function(e,t,n,i){const a=(0,r.getConfig)(e,r.ConfigKey.DebugOverrideEngine);if(a)return`/v1/engines/${a}`;const c=await e.get(o.Features).customEngine(t,n,i);return""!==c?`/v1/engines/${c}`:s}(e,n,a,c))}},2031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveOpenAIFetcher=t.postProcessChoices=t.OpenAIFetcher=t.extractEngineName=t.getProcessingTime=t.getRequestId=t.CopilotUiKind=void 0;const r=n(3837),o=n(5765),i=n(1661),s=n(9800),a=n(4619),c=n(5798),l=n(39),u=n(6635),d=n(3591),p=n(5489),h=n(598),f=n(4586),m=new c.Logger(c.LogLevel.INFO,"fetch");var g;function _(e,t){return{headerRequestId:e.headers.get("x-request-id")||"",completionId:t&&t.id?t.id:"",created:t&&t.created?t.created:0,serverExperiments:e.headers.get("X-Copilot-Experiment")||"",deploymentId:e.headers.get("azureml-model-deployment")||""}}function y(e){const t=e.headers.get("openai-processing-ms");return t?parseInt(t,10):0}function v(e,t){return t.split("/").pop()||(m.error(e,"Malformed engine URL: "+t),t)}!function(e){e.GhostText="ghostText",e.Panel="synthesize"}(g=t.CopilotUiKind||(t.CopilotUiKind={})),t.getRequestId=_,t.getProcessingTime=y,t.extractEngineName=v;class b{}function w(e,t){return null!=t&&t?e:(0,i.asyncIterableFilter)(e,(async e=>e.completionText.trim().length>0))}t.OpenAIFetcher=b,t.postProcessChoices=w,t.LiveOpenAIFetcher=class extends b{async fetchAndStreamCompletions(e,t,n,r,o){const s=e.get(u.StatusReporter),a="completions",l=await this.fetchWithParameters(e,a,t,o);if(null==o?void 0:o.isCancellationRequested){const t=await l.body();try{t.destroy()}catch(t){c.logger.error(e,`Error destroying stream: ${t}`)}return{type:"canceled",reason:"after fetch request"}}if(void 0===l){const n=this.createTelemetryData(a,e,t);return s.setWarning(),n.properties.error="Response was undefined",(0,p.telemetry)(e,"request.shownWarning",n),{type:"failed",reason:"fetch response was undefined"}}if(200!==l.status){const n=this.createTelemetryData(a,e,t);return this.handleError(e,s,n,l)}return{type:"success",choices:w((0,i.asyncIterableMap)((0,f.processSSE)(e,l,r,o),(async t=>(0,f.prepareSolutionForReturn)(e,t,n))),t.allowEmptyChoices),getProcessingTime:()=>y(l)}}createTelemetryData(e,t,n){return p.TelemetryData.createAndMarkAsIssued({endpoint:e,engineName:v(t,n.engineUrl),uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,t,n,i){const f=(0,s.getLanguageConfig)(e,s.ConfigKey.Stops),m={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:(0,s.getConfig)(e,s.ConfigKey.SolutionLength),temperature:(0,h.getTemperatureForSamples)(e,n.count),top_p:(0,s.getConfig)(e,s.ConfigKey.TopP),n:n.count,logprobs:2,stop:f},y=(0,d.tryGetGitHubNWO)(n.repoInfo);return void 0!==y&&(m.nwo=y),await e.get(s.BlockModeConfig).forLanguage(e,n.languageId)===s.BlockMode.Server&&(m.feature_flags=["trim_to_block"]),n.postOptions&&Object.assign(m,n.postOptions),c.logger.info(e,`[fetchCompletions] engine ${n.engineUrl}`),await function(e,t,n,o,i,s,d,h,f){var m;const y=e.get(u.StatusReporter),b=r.format("%s/%s",n,o);if(!d)return void c.logger.error(e,`Failed to send request to ${b} due to missing key`);const w=p.TelemetryData.createAndMarkAsIssued({endpoint:o,engineName:v(e,n),uiKind:h},(0,p.telemetrizePromptLength)(t));for(const[e,t]of Object.entries(s))"prompt"!=e&&"suffix"!=e&&(w.properties[`request.option.${e}`]=null!==(m=JSON.stringify(t))&&void 0!==m?m:"undefined");w.properties.headerRequestId=i,(0,p.telemetry)(e,"request.sent",w);const x=(0,p.now)(),T=function(e){switch(e){case g.GhostText:return"copilot-ghost";case g.Panel:return"copilot-panel"}}(h);return(0,l.postRequest)(e,b,d,T,i,s,f).then((n=>{const r=_(n,void 0);w.extendWithRequestId(r);const o=(0,p.now)()-x;w.measurements.totalTimeMs=o,c.logger.info(e,`request.response: [${b}] took ${o} ms`),c.logger.debug(e,"request.response properties",w.properties),c.logger.debug(e,"request.response measurements",w.measurements),c.logger.debug(e,`prompt: ${JSON.stringify(t)}`),(0,p.telemetry)(e,"request.response",w),(0,p.logEnginePrompt)(e,t,w);const i=n.headers.get("x-copilot-delay"),s=i?parseInt(i,10):0;return e.get(a.GhostTextDebounceManager).extraDebounceMs=s,n})).catch((t=>{var n,r,o,i;if((0,l.isAbortError)(t))throw t;y.setWarning();const s=w.extendedBy({error:"Network exception"});(0,p.telemetry)(e,"request.shownWarning",s),w.properties.code=String(null!==(n=t.code)&&void 0!==n?n:""),w.properties.errno=String(null!==(r=t.errno)&&void 0!==r?r:""),w.properties.message=String(null!==(o=t.message)&&void 0!==o?o:""),w.properties.type=String(null!==(i=t.type)&&void 0!==i?i:"");const a=(0,p.now)()-x;throw w.measurements.totalTimeMs=a,c.logger.debug(e,`request.response: [${b}] took ${a} ms`),c.logger.debug(e,"request.error properties",w.properties),c.logger.debug(e,"request.error measurements",w.measurements),c.logger.error(e,`Request Error: ${t.message}`),(0,p.telemetry)(e,"request.error",w),t}))}(e,n.prompt,n.engineUrl,t,n.ourRequestId,m,await e.get(o.CopilotTokenManager).getCopilotToken(e),n.uiKind,i)}async handleError(e,t,n,r){if(t.setWarning(),n.properties.error=`Response status was ${r.status}`,n.properties.status=String(r.status),(0,p.telemetry)(e,"request.shownWarning",n),401===r.status||403===r.status)return e.get(o.CopilotTokenManager).resetCopilotToken(e,r.status),{type:"failed",reason:`token expired or invalid: ${r.status}`};if(499===r.status)return m.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"};const i=await r.text();return 466===r.status?(t.setError(i),m.info(e,i),{type:"failed",reason:`client not supported: ${i}`}):(m.error(e,"Unhandled status from server:",r.status,i),{type:"failed",reason:`unhandled status from server: ${r.status} ${i}`})}}},598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTemperatureForSamples=t.calculateMeanAlternativeLogProb=t.calculateMeanLogProb=t.cleanupIndentChoices=t.convertToAPIChoice=t.DEFAULT_CHARACTER_MULTIPLIER=t.MAX_PROMPT_LENGTH=t.OpenAIFetcher=t.LiveOpenAIFetcher=t.getRequestId=t.CopilotUiKind=void 0;const r=n(9800),o=n(5798),i=n(5489),s=n(913);var a=n(2031);function c(e,t){if(t.logprobs.token_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--)e+=t.logprobs.token_logprobs[o],n+=1;return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}function l(e,t){if(t.logprobs.top_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--){const r={...t.logprobs.top_logprobs[o]};delete r[t.logprobs.tokens[o]],e+=Math.max(...Object.values(r)),n+=1}return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}Object.defineProperty(t,"CopilotUiKind",{enumerable:!0,get:function(){return a.CopilotUiKind}}),Object.defineProperty(t,"getRequestId",{enumerable:!0,get:function(){return a.getRequestId}}),Object.defineProperty(t,"LiveOpenAIFetcher",{enumerable:!0,get:function(){return a.LiveOpenAIFetcher}}),Object.defineProperty(t,"OpenAIFetcher",{enumerable:!0,get:function(){return a.OpenAIFetcher}}),t.MAX_PROMPT_LENGTH=1500,t.DEFAULT_CHARACTER_MULTIPLIER=3,t.convertToAPIChoice=function(e,t,n,r,o,s,a,u){return(0,i.logEngineCompletion)(e,t,n,o,r),{completionText:t,meanLogProb:c(e,n),meanAlternativeLogProb:l(e,n),choiceIndex:r,requestId:o,modelInfo:u,blockFinished:s,tokens:n.logprobs.tokens,numTokens:n.logprobs.tokens.length,telemetryData:a}},t.cleanupIndentChoices=async function*(e,t){for await(const n of e){const e={...n},r=e.completionText.split("\n");for(let e=0;e=0&&n<=1?n:t<=1?0:t<10?.2:t<20?.4:.8}},4586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareSolutionForReturn=t.processSSE=t.splitChunk=void 0;const r=n(5798),o=n(598),i=new r.Logger(r.LogLevel.INFO,"streamChoices");function s(e){const t=e.split("\n"),n=t.pop();return[t.filter((e=>""!=e)),n]}t.splitChunk=s,t.processSSE=async function*(e,t,n,r){var a,c,l,u,d,p,h,f;const m=await t.body();m.setEncoding("utf8");let g=(0,o.getRequestId)(t);i.debug(e,`requestId: ${g.headerRequestId}`);const _={};let y="";for await(const v of m){if(null==r?void 0:r.isCancellationRequested)return i.info(e,"Cancelled after awaiting body chunk"),void m.destroy();i.debug(e,"chunk",v.toString());const[b,w]=s(y+v.toString());y=w;for(const s of b){const y=s.slice("data:".length).trim();if("[DONE]"==y){for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"DONE",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding on DONE"),void m.destroy()}return}let v;try{v=JSON.parse(y)}catch(t){i.error(e,"Error parsing JSON stream data",s);continue}if(void 0!==v.choices||void 0===v.error){0==g.created&&(g=(0,o.getRequestId)(t,v),0==g.created&&i.error(e,`Request id invalid, should have "completionId" and "created": ${g}`,g));for(let t=0;t-1)&&(y=await n(s.text.join("")),null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after awaiting finishedCb"),void m.destroy();if(o.finish_reason||void 0!==y){if(yield{solution:s,finishOffset:y,reason:JSON.stringify(o.finish_reason),requestId:g,index:o.index},null==r?void 0:r.isCancellationRequested)return i.debug(e,"Cancelled after yielding finished choice"),void m.destroy();_[o.index]=null}}}else i.error(e,"Error in response:",v.error.message)}}for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"Iteration Done",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding after iteration done"),void m.destroy()}if(y.length>0)try{const t=JSON.parse(y);void 0!==t.error&&i.error(e,`Error in response: ${t.error.message}`,t.error)}catch(t){i.error(e,`Error parsing extraData: ${y}`)}},t.prepareSolutionForReturn=function(e,t,n){let r=t.solution.text.join(""),s=!1;void 0!==t.finishOffset&&(i.debug(e,`solution ${t.index}: early finish at offset ${t.finishOffset}`),r=r.substring(0,t.finishOffset),s=!0),i.info(e,`solution ${t.index} returned. finish reason: [${t.reason}] finishOffset: [${t.finishOffset}] completionId: [{${t.requestId.completionId}}] created: [{${t.requestId.created}}]`);const a=function(e,t){const n=t.text.length,r=t.tokens.length,o=t.text_offset.length,s=t.logprobs.length;n===r&&n===o&&r===s||i.error(e,`Invalid streamingData: numText:${n}, numTokens:${r}, numOffsets:${o}, numLogprobs:${s}`);const a=t.text.join(""),c=t.tokens.map((e=>e.join(""))).join("");c.indexOf(a)<0&&i.secureError(e,"Invalid streamingData",`joinedText:[${a}] not a substring of joinedTokens:[${c}]`);return{text:a,logprobs:{token_logprobs:t.logprobs.reduce(((e,t)=>e.concat(t)),[]),top_logprobs:t.top_logprobs.reduce(((e,t)=>e.concat(t)),[]),text_offset:t.text_offset.reduce(((e,t)=>e.concat(t)),[]),tokens:t.tokens.reduce(((e,t)=>e.concat(t)),[])}}}(e,t.solution);return(0,o.convertToAPIChoice)(e,r,a,t.index,t.requestId,s,n)}},3402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postInsertionTasks=t.postRejectionTasks=t.captureCode=void 0;const r=n(5135),o=n(1749),i=n(5798),s=n(7917),a=n(4090),c=n(9558),l=n(5489),u=n(819),d=new i.Logger(i.LogLevel.INFO,"post-insertion"),p=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}];async function h(e,t,n){const r=await e.get(u.TextDocumentManager).getTextDocument(t);if(!r)return d.info(e,`Could not get document for ${t.fsPath}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1,promptElementRanges:[]},capturedCode:"",terminationOffset:0};const o=r.getText(),i=o.substring(0,n),c=r.positionAt(n),l=await(0,a.extractPrompt)(e,r,c),p="prompt"===l.type?l.prompt:{prefix:i,suffix:"",isFimEnabled:!1,promptElementRanges:[]},h=o.substring(n),f=(0,s.contextIndentationFromText)(i,n,r.languageId),m=(0,s.indentationBlockFinished)(f,void 0),g=await m(h),_=Math.min(o.length,n+(g?2*g:500));return{prompt:p,capturedCode:o.substring(n,_),terminationOffset:null!=g?g:-1}}function f(e,t,n,r){const o=e.substring(Math.max(0,r-n),Math.min(e.length,r+t.length+n)),i=(0,c.lexEditDistance)(o,t),s=i.lexDistance/i.needleLexLength,{distance:a}=(0,c.editDistance)(o.substring(i.startOffset,i.endOffset),t);return{relativeLexEditDistance:s,charEditDistance:a,completionLexLength:i.needleLexLength,foundOffset:i.startOffset+Math.max(0,r-n),lexEditDistance:i.lexDistance,stillInCodeHeuristic:s<=.5?1:0}}t.captureCode=h,t.postRejectionTasks=function(e,t,n,i,s){s.forEach((({completionText:n,completionTelemetryData:r})=>{d.debug(e,`${t}.rejected choiceIndex: ${r.properties.choiceIndex}`),(0,o.telemetryRejected)(e,t,r)}));const a=new r.ChangeTracker(e,i,n);p.filter((e=>e.captureRejection)).map((r=>{a.push((async()=>{d.debug(e,`Original offset: ${n}, Tracked offset: ${a.offset}`);const{completionTelemetryData:o}=s[0],{prompt:c,capturedCode:u,terminationOffset:p}=await h(e,i,a.offset);let f;f=c.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(c.prefix),hypotheticalPromptSuffixJson:JSON.stringify(c.suffix)}:{hypotheticalPromptJson:JSON.stringify(c.prefix)};const m=o.extendedBy({...f,capturedCodeJson:JSON.stringify(u)},{timeout:r.seconds,insertionOffset:n,trackedOffset:a.offset,terminationOffsetInCapturedCode:p});d.debug(e,`${t}.capturedAfterRejected choiceIndex: ${o.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterRejected",m,!0)}),1e3*r.seconds)}))},t.postInsertionTasks=async function(e,t,n,i,s,a){d.debug(e,`${t}.accepted choiceIndex: ${a.properties.choiceIndex}`),(0,o.telemetryAccepted)(e,t,a);const c=new r.ChangeTracker(e,s,i),m=n.trim();p.map((n=>c.push((()=>async function(e,t,n,r,o,i,s,a){const c=await e.get(u.TextDocumentManager).getTextDocument(o);if(c){const u=c.getText();let p=f(u,n,50,a.offset);p.stillInCodeHeuristic||(p=f(u,n,1500,a.offset)),d.debug(e,`stillInCode: ${p.stillInCodeHeuristic?"Found":"Not found"}! Completion '${n}' in file ${o.fsPath}. lexEditDistance fraction was ${p.relativeLexEditDistance}. Char edit distance was ${p.charEditDistance}. Inserted at ${r}, tracked at ${a.offset}, found at ${p.foundOffset}. choiceIndex: ${s.properties.choiceIndex}`);const m=s.extendedBy({},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset}).extendedBy({},p);if((0,l.telemetry)(e,t+".stillInCode",m),i.captureCode){const{prompt:n,capturedCode:c,terminationOffset:u}=await h(e,o,a.offset);let p;p=n.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(n.prefix),hypotheticalPromptSuffixJson:JSON.stringify(n.suffix)}:{hypotheticalPromptJson:JSON.stringify(n.prefix)};const f=s.extendedBy({...p,capturedCodeJson:JSON.stringify(c)},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset,terminationOffsetInCapturedCode:u});d.debug(e,`${t}.capturedAfterAccepted choiceIndex: ${s.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterAccepted",f,!0)}}}(e,t,m,i,s,n,a,c)),1e3*n.seconds)))}},6635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpStatusReporter=t.StatusReporter=void 0;class n{}t.StatusReporter=n,t.NoOpStatusReporter=class extends n{setProgress(){}removeProgress(){}setWarning(){}setError(e){}forceNormal(){}}},7917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indentationBlockFinished=t.completionCutOrContinue=t.contextIndentationFromText=t.contextIndentation=t.getNodeStart=t.isBlockBodyFinishedWithPrefix=t.isBlockBodyFinished=t.isEmptyBlockStart=void 0;const r=n(2369),o=n(2273);t.isEmptyBlockStart=function(e,t){return o.isEmptyBlockStart(e.languageId,e.getText(),e.offsetAt(t))},t.isBlockBodyFinished=function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n)),c=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,a,i,c)},t.isBlockBodyFinishedWithPrefix=function(e,t,n,i,s){const a=e.get(r.LocationFactory),c=t.getText(a.range(a.position(0,0),n)),l=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,c+s,i,l+s.length)},t.getNodeStart=async function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n))+i,c=await o.getNodeStart(t.languageId,a,t.offsetAt(n));if(c)return t.positionAt(c)};const i=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map((e=>e+"\\b"))),s=new RegExp(`^(${i.join("|")})`);function a(e){return s.test(e.trimLeft().toLowerCase())}function c(e){const t=/^(\s*)([^]*)$/.exec(e);return t&&t[2]&&t[2].length>0?t[1].length:void 0}function l(e,t,n){const r=e.slice(0,t).split("\n"),o=e.slice(t).split("\n");function i(e,t,r){let o,i,s=t;for(;void 0===o&&s>=0&&s=0&&!e[s].trim().startsWith('"""');)s--;if(s>=0)for(o=void 0,s--;void 0===o&&s>=0;)o=c(e[s]),i=s,s--}}return[o,i]}const[s,a]=i(r,r.length-1,-1),l=(()=>{if(void 0!==s&&void 0!==a)for(let e=a-1;e>=0;e--){const t=c(r[e]);if(void 0!==t&&t{const r=u(n,e,t);return"continue"===r?void 0:r}}},4090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractPrompt=t.trimLastLine=t._contextTooShort=t.MIN_PROMPT_CHARS=void 0;const r=n(4617),o=n(9800),i=n(5225),s=n(6905),a=n(819),c=n(2273),l=n(3591);function u(e){const t=e.split("\n"),n=t[t.length-1],r=n.length-n.trimRight().length,o=e.slice(0,e.length-r),i=e.substr(o.length);return[n.length==r?o:e,i]}async function d(e,n,d,p,h,f){var m;const g=null!==(m=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,h.toString())))&&void 0!==m?m:"",_=await(0,o.suffixPercent)(e,g,f);if((_>0?n.length:d)20||s+i.getText().length>2e5)break;"file"==i.uri.scheme&&i.fileName!==t&&i.languageId===n&&(r.push({uri:i.uri.toString(),relativePath:await e.get(a.TextDocumentManager).getRelativePath(i),languageId:i.languageId,source:i.getText()}),s+=i.getText().length)}return r}(e,d.fsPath,p);const m={uri:d.toString(),source:t,offset:n,relativePath:u,languageId:p},g=null!==(h=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,d.toString())))&&void 0!==h?h:"";let _={maxPromptLength:2048-(0,o.getConfig)(e,o.ConfigKey.SolutionLength),neighboringTabs:await e.get(s.Features).neighboringTabsOption(g,p),suffixStartMode:await e.get(s.Features).suffixStartMode(g,p)};const y=await(0,o.suffixPercent)(e,g,p);y>0&&(_={..._,includeSiblingFunctions:r.SiblingOption.NoSiblings,suffixPercent:y});const v=e.get(r.FileSystem);return await(0,c.getPrompt)(v,m,_,f)}(e,n,d,p,h,f),[E,C]=u(v),S=Date.now();return{type:"prompt",prompt:{prefix:E,suffix:b,isFimEnabled:_>0,promptElementRanges:T.ranges},trailingWs:C,promptChoices:w,computeTimeMs:S-y,promptBackground:x}}async function p(e,t,n){const r=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,t.getText(),t.offsetAt(n),r,t.uri,t.languageId)}t.MIN_PROMPT_CHARS=10,t._contextTooShort={type:"contextTooShort"},t.trimLastLine=u,t.extractPrompt=function(e,t,n){const r=e.get(a.TextDocumentManager).findNotebook(t);return void 0===r?p(e,t,n):async function(e,t,n,r){const o=n.getCells().find((e=>e.document.uri===t.uri));if(o){const i=n.getCells().filter((e=>e.index0?i.map((e=>e.document.getText())).join("\n\n")+"\n\n":"",c=s+t.getText(),l=s.length+t.offsetAt(r),u=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,c,l,u,t.uri,o.document.languageId)}return p(e,t,r)}(e,t,r,n)}},2273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsesWithoutError=t.getPrompt=t.getNodeStart=t.getFunctionPositions=t.getBlockCloseToken=t.isSupportedLanguageId=t.isBlockBodyFinished=t.isEmptyBlockStart=t.terminate=t.init=void 0;const r=n(4617);let o=null;const i=new Map;let s=0;t.init=function(t,u,d){if(!u){const t=n(3094);for(const n of[...a,...c])e.exports[n]=t[n];return}for(const n of a)e.exports[n]=l(t,d,n);e.exports.getPrompt=function(e,t){return function(n,...r){const a=s++;return new Promise(((n,s)=>{i.set(a,{resolve:n,reject:s}),t.debug(e,`Proxy getPrompt - ${a}`),null==o||o.postMessage({id:a,fn:"getPrompt",args:r})}))}}(t,d),o=r.createWorker(),i.clear(),s=0;const p=t.get(r.FileSystem);function h(e){d.error(t,e);for(const t of i.values())t.reject(e);i.clear()}o.on("message",(({id:e,err:n,res:r})=>{const o=i.get(e);d.debug(t,`Response ${e} - ${r}, ${n}`),o&&(i.delete(e),n?o.reject(n):o.resolve(r))})),o.on("error",h),o.on("exit",(e=>{0!==e&&h(new Error(`Worker thread exited with code ${e}.`))})),o.on("readFileReq",(e=>{d.debug(t,`READ_FILE_REQ - ${e}`),p.readFile(e).then((e=>{null==o||o.emit("readFileRes",e)})).catch(h)})),o.on("mtimeRes",(e=>{d.debug(t,`mTime_REQ - ${e}`),p.mtime(e).then((e=>{null==o||o.emit("mtimeRes",e)})).catch(h)}))},t.terminate=function(){o&&(o.removeAllListeners(),o.terminate(),o=null,i.clear())};const a=["getFunctionPositions","isEmptyBlockStart","isBlockBodyFinished","getNodeStart","parsesWithoutError"],c=["isSupportedLanguageId","getBlockCloseToken"];function l(e,t,n){return function(...r){const a=s++;return new Promise(((s,c)=>{i.set(a,{resolve:s,reject:c}),t.debug(e,`Proxy ${n}`),null==o||o.postMessage({id:a,fn:n,args:r})}))}}t.isEmptyBlockStart=r.isEmptyBlockStart,t.isBlockBodyFinished=r.isBlockBodyFinished,t.isSupportedLanguageId=r.isSupportedLanguageId,t.getBlockCloseToken=r.getBlockCloseToken,t.getFunctionPositions=r.getFunctionPositions,t.getNodeStart=r.getNodeStart,t.getPrompt=r.getPrompt,t.parsesWithoutError=r.parsesWithoutError},3591:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputationStatus=t.getRepoUrlUsingChildProcess=t.getRepoUrlFromConfigText=t.parseRepoUrl=t.extractRepoInfoInBackground=t.tryGetGitHubNWO=void 0;const r=n(1017),o=n(140),i=n(2081),s=n(4617);t.tryGetGitHubNWO=function(e){if(void 0!==e&&e!==d.PENDING)return"github.com"===e.hostname?e.owner+"/"+e.repo:void 0},t.extractRepoInfoInBackground=function(e,t){if(!t)return;const n=(0,r.dirname)(t);return a(e,n)};const a=function(e,t){const n=new o.LRUCache(1e4),i=new Set;return(e,...t)=>{const o=JSON.stringify(t),a=n.get(o);if(a)return a.result;if(i.has(o))return d.PENDING;const c=async function(e,t){var n;const o=await async function(e,t){let n=t+"_add_to_make_longer";const o=e.get(s.FileSystem);for(;t.length>1&&t.length!0),(()=>!1)))return t;n=t,t=(0,r.dirname)(t)}}(e,t);if(!o)return;const i=e.get(s.FileSystem),a=(0,r.join)(o,".git","config"),c=(await i.readFile(a)).toString(),d=null!==(n=u(c))&&void 0!==n?n:"";return{baseFolder:o,url:d,...l(d)}}(e,...t);return i.add(o),c.then((e=>{n.put(o,new p(e)),i.delete(o)})),d.PENDING}}(),c=/([^:/@]+)[:/]([^/:]+)\/([^/]+)+/;function l(e){var t,n,r,o;const i=null!==(t=e.match(c))&&void 0!==t?t:[];return{hostname:null!==(n=i[1])&&void 0!==n?n:"",owner:null!==(r=i[2])&&void 0!==r?r:"",repo:i[3]&&i[3].endsWith(".git")?i[3].slice(0,-4):null!==(o=i[3])&&void 0!==o?o:""}}function u(e){var t;const n=/^\s*\[\s*remote\s+"((\\\\|\\"|[^\\"])+)"/,r=/^\s*\[remote.([^"\s]+)/,o=/^\s*url\s*=\s*([^\s#;]+)/,i=/^\s*\[/;let s,a,c=!1;for(const l of e.split("\n"))if(c&&void 0!==s){if(s+=l,l.endsWith("\\"))s=s.substring(0,s.length-1);else if(c=!1,"origin"===a)return s}else{const e=null!==(t=l.match(n))&&void 0!==t?t:l.match(r);if(e)a=e[1];else if(l.match(i))a=void 0;else{if(s&&"origin"!==a)continue;{const e=l.match(o);if(e)if(s=e[1],s.endsWith("\\"))s=s.substring(0,s.length-1),c=!0;else if("origin"===a)return s}}}return s}var d;t.parseRepoUrl=l,t.getRepoUrlFromConfigText=u,t.getRepoUrlUsingChildProcess=async function(e){const t=(0,r.dirname)(e),n=(0,i.execFile)("git",["config","--get","remote.origin.url"],{cwd:t,encoding:"utf8"});return await new Promise(((e,t)=>{var r;null===(r=n.stdout)||void 0===r||r.on("data",(t=>{t=null==t?void 0:t.replace(/\n$/,""),e(t||void 0)})),n.on("exit",(()=>{e(void 0)}))}))},function(e){e[e.PENDING=0]="PENDING"}(d=t.ComputationStatus||(t.ComputationStatus={}));class p{constructor(e){this.result=e}}},4604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRepetitive=void 0;const n=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function r(e){const t=function(e){const t=Array(e.length).fill(0);t[0]=-1;let n=-1;for(let r=1;r=0&&e[n+1]!==e[r];)n=t[n];e[n+1]===e[r]&&n++,t[r]=n}return t}(e);for(const r of n)if(!(e.lengthe.trim().length>0)))}},9558:(e,t)=>{"use strict";function n(e,t,n=((e,t)=>e===t?0:1)){if(0===t.length||0===e.length)return{distance:t.length,startOffset:0,endOffset:0};let r=new Array(t.length+1).fill(0),o=new Array(t.length+1).fill(0),i=new Array(e.length+1).fill(0),s=new Array(e.length+1).fill(0),a=t[0];for(let t=0;t0?t-1:0;for(let c=1;c0&&(yield n),n=o,r=e)}n.length>0&&(yield n)}function s(e,t,n,r){const o=[];let i=0;for(const s of n(e))r(s)&&(t.has(s)||t.set(s,t.size),o.push([t.get(s),i])),i+=s.length;return[o,t]}function a(e){return" "!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.lexEditDistance=t.lexicalAnalyzer=t.lexGeneratorWords=t.reverseLexDictionary=t.emptyLexDictionary=t.editDistance=void 0,t.editDistance=n,t.emptyLexDictionary=r,t.reverseLexDictionary=o,t.lexGeneratorWords=i,t.lexicalAnalyzer=s,t.lexEditDistance=function(e,t,c=i){const[l,u]=s(e,r(),c,a),[d,p]=s(t,u,c,a);if(0===d.length||0===l.length)return{lexDistance:d.length,startOffset:0,endOffset:0,haystackLexLength:l.length,needleLexLength:d.length};const h=o(p),f=d.length,m=h[d[0][0]],g=h[d[f-1][0]],_=n(l.map((e=>e[0])),d.map((e=>e[0])),(function(e,t,n,r){if(0===r||r===f-1){const e=h[l[n][0]];return 0==r&&e.endsWith(m)||r==f-1&&e.startsWith(g)?0:1}return e===t?0:1})),y=l[_.startOffset][1];let v=_.endOffset0&&" "===e[v-1]&&--v,{lexDistance:_.distance,startOffset:y,endOffset:v,haystackLexLength:l.length,needleLexLength:d.length}}},1523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextDisplayQuantiles=t.ghostTextDisplayLanguageParameters=t.ghostTextDisplayMeanAlternativeLogProbParameter=t.ghostTextDisplayMeanLogProbParameter=t.ghostTextDisplayLog1pcompCharLenParameter=t.ghostTextDisplayInterceptParameter=void 0,t.ghostTextDisplayInterceptParameter=2.98410452738298,t.ghostTextDisplayLog1pcompCharLenParameter=-.838732736843507,t.ghostTextDisplayMeanLogProbParameter=1.50314646255716,t.ghostTextDisplayMeanAlternativeLogProbParameter=-.237798634012662,t.ghostTextDisplayLanguageParameters={python:.314368072478742},t.ghostTextDisplayQuantiles={.01:.225800751784931,.02:.290204307767402,.03:.333153496466045,.05:.404516749849559,.1:.513216040545626,.2:.626904979128674,.3:.694880719658273,.4:.743100684947291,.5:.782524520571946,.6:.816856186092243,.7:.84922977716585,.8:.883694877241999,.9:.921859050950077,.95:.944571268106974,.99:.969535563141733}},1153:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextScoreQuantile=t.ghostTextScoreConfidence=void 0;const r=n(5798),o=n(1523),i=(new r.Logger(r.LogLevel.INFO,"restraint"),{link:e=>Math.exp(e)/(1+Math.exp(e)),unlink:e=>Math.log(e/(1-e))});class s{constructor(e,t,n){this.name=e,this.coefficient=t,this.transformation=n||(e=>e)}contribution(e){return this.coefficient*this.transformation(e)}}const a=new class{constructor(e,t,n){if(this.link=i,this.intercept=e,this.coefficients=t,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(const e in n)this.logitsToQuantiles.set(n[e],Number(e))}predict(e,t){let n=this.intercept;for(const e of this.coefficients){const r=t[e.name];if(void 0===r)return NaN;n+=e.contribution(r)}return this.link.link(n)}quantile(e,t){return function(e,t){const n=Math.min(...Array.from(t.keys()).filter((t=>t>=e))),r=Math.max(...Array.from(t.keys()).filter((t=>tMath.log(1+e))),new s("meanLogProb",o.ghostTextDisplayMeanLogProbParameter),new s("meanAlternativeLogProb",o.ghostTextDisplayMeanAlternativeLogProbParameter)].concat(Object.entries(o.ghostTextDisplayLanguageParameters).map((e=>new s(e[0],e[1])))),o.ghostTextDisplayQuantiles);t.ghostTextScoreConfidence=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.predict(e,n)},t.ghostTextScoreQuantile=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.quantile(e,n)}},3883:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkSuffix=t.postProcessChoice=void 0;const r=n(2273),o=n(5489),i=n(913),s=n(4604);t.postProcessChoice=async function(e,t,n,a,c,l,u){if((0,s.isRepetitive)(c.tokens)){const t=o.TelemetryData.createAndMarkAsIssued();return t.extendWithRequestId(c.requestId),(0,o.telemetry)(e,"repetition.detected",t,!0),void u.info(e,"Filtered out repetitive solution")}const d={...c};if(function(e,t,n){let r="",o=t.line+1;for(;""===r&&o1);return o}(e,n,a,d.completionText,l),d.completionText?d:void 0},t.checkSuffix=function(e,t,n){const r=e.lineAt(t.line).text.substring(t.character);if(r.length>0){if(-1!==n.completionText.indexOf(r))return!0;{let e=0;for(const t of r){const r=n.completionText.indexOf(t,e+1);if(!(r>e)){e=-1;break}e=r}return-1!==e}}return!1}},5489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forceSendingTelemetry=t.dropTelemetryConfig=t.setTelemetryConfig=t.logEnginePrompt=t.logEngineCompletion=t.telemetryError=t.telemetryException=t.telemetryRaw=t.telemetryExpProblem=t.telemetry=t.configureReporter=t.telemetryEndpointUrlOverride=t.noTelemetryEndpointUrlOverride=t.TelemetryEndpointUrlOverride=t.now=t.telemetrizePromptLength=t.TelemetryData=t.setupEmptyReporters=t.setupStandardReporters=t.TelemetryReporters=t.APP_INSIGHTS_KEY_SECURE=t.APP_INSIGHTS_KEY=void 0;const r=n(6236),o=n(9929),i=n(9800),s=n(6905),a=n(4914),c=n(913),l=n(9591);t.APP_INSIGHTS_KEY="7d7048df-6dd0-4048-bb23-b716c1461f8f",t.APP_INSIGHTS_KEY_SECURE="3fdd7f28-937a-48c8-9a21-ba337db23bd1";class u{constructor(e,t){this.reporter=e,this.reporterSecure=t}getReporter(e){return this.reporter}getSecureReporter(e){if(y())return this.reporterSecure;if((0,c.shouldFailForDebugPurposes)(e))throw new Error("Internal error: telemetry opt-out")}setReporter(e){this.reporter=e}setSecureReporter(e){this.reporterSecure=e}async deactivate(){let e=Promise.resolve();this.reporter&&(e=this.reporter.dispose(),this.reporter=void 0);let t=Promise.resolve();this.reporterSecure&&(t=this.reporterSecure.dispose(),this.reporterSecure=void 0),await Promise.all([e,t])}hackOptOutListener(){this.reporter.optOutListener={dispose(){}},this.reporterSecure.optOutListener={dispose(){}}}setToken(e){this.reporter&&this.configureToken(this.reporter,e),this.reporterSecure&&this.configureToken(this.reporterSecure,e)}configureToken(e,t){const n=e;n&&n.appInsightsClient&&(n.appInsightsClient.context.tags.github_telemetry_token=t.token)}}let d;function p(e,t,n,r){const i=new o.default(t,n,r);return _(e,i),i}t.TelemetryReporters=u,t.setupStandardReporters=function(e,n){const r=(0,i.getVersion)(e),o=p(e,n,r,t.APP_INSIGHTS_KEY),s=p(e,n,r,t.APP_INSIGHTS_KEY_SECURE),a=e.get(u);return a.setReporter(o),a.setSecureReporter(s),a},t.setupEmptyReporters=function(){return new u};class h{constructor(e,t,n){this.properties=e,this.measurements=t,this.issuedTime=n}static createAndMarkAsIssued(e,t){return new h(e||{},t||{},m())}extendedBy(e,t){const n={...this.properties,...e},r={...this.measurements,...t},o=new h(n,r,this.issuedTime);return o.displayedTime=this.displayedTime,o.filtersAndExp=this.filtersAndExp,o}markAsDisplayed(){void 0===this.displayedTime&&(this.displayedTime=m())}async extendWithExpTelemetry(e){this.filtersAndExp||await e.get(s.Features).addExpAndFilterToTelemetry(this),this.filtersAndExp.exp.addToTelemetry(this),this.filtersAndExp.filters.addToTelemetry(this)}extendWithEditorAgnosticFields(e){this.properties.editor_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorInfo(e)),this.properties.editor_plugin_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e));const t=e.get(i.VscInfo);this.properties.client_machineid=t.machineId,this.properties.client_sessionid=t.sessionId,this.properties.copilot_version=`copilot/${(0,i.getVersion)(e)}`,this.properties.common_extname=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).name,this.properties.common_extversion=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).version}extendWithConfigProperties(e){const t=(0,i.dumpConfig)(e);try{t["copilot.build"]=(0,i.getBuild)(e),t["copilot.buildType"]=(0,i.getBuildType)(e)}catch(e){}d&&(t["copilot.trackingId"]=d.trackingId),this.properties={...this.properties,...t}}extendWithRequestId(e){const t={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...t}}static maybeRemoveRepoInfoFromPropertiesHack(e,t){if(e)return t;const n={};for(const e in t)h.keysToRemoveFromStandardTelemetryHack.includes(e)||(n[e]=t[e]);return n}sanitizeKeys(){this.properties=h.sanitizeKeys(this.properties),this.measurements=h.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};const t={};for(const n in e)t[h.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_")]=e[n];return t}updateTimeSinceIssuedAndDisplayed(){const e=m()-this.issuedTime;if(this.measurements.timeSinceIssuedMs=e,void 0!==this.displayedTime){const e=m()-this.displayedTime;this.measurements.timeSinceDisplayedMs=e}}validateData(e,t){var n;let r;if(h.validateTelemetryProperties(this.properties)||(r={problem:"properties",error:JSON.stringify(h.validateTelemetryProperties.errors)}),!h.validateTelemetryMeasurements(this.measurements)){const e=JSON.stringify(h.validateTelemetryMeasurements.errors);void 0===r?r={problem:"measurements",error:e}:(r.problem="both",r.error+=`; ${e}`)}if(void 0===r)return!0;if((0,c.shouldFailForDebugPurposes)(e))throw new Error(`Invalid telemetry data: ${r.problem} ${r.error} properties=${JSON.stringify(this.properties)} measurements=${JSON.stringify(this.measurements)}`);return b(e,"invalidTelemetryData",h.createAndMarkAsIssued({properties:JSON.stringify(this.properties),measurements:JSON.stringify(this.measurements),problem:r.problem,validationError:r.error}),t),t&&b(e,"invalidTelemetryData_in_secure",h.createAndMarkAsIssued({problem:r.problem,requestId:null!==(n=this.properties.requestId)&&void 0!==n?n:"unknown"}),!1),!1}async makeReadyForSending(e,t,n){this.extendWithConfigProperties(e),this.extendWithEditorAgnosticFields(e),this.sanitizeKeys(),"IncludeExp"===n&&await this.extendWithExpTelemetry(e),this.updateTimeSinceIssuedAndDisplayed(),this.validateData(e,t)||(this.properties.telemetry_failed_validation="true")}}function f(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}function m(){return(new Date).getTime()}t.TelemetryData=h,h.ajv=new r.default({strictNumbers:!1}),h.validateTelemetryProperties=h.ajv.compile({type:"object",additionalProperties:{type:"string"},required:[]}),h.validateTelemetryMeasurements=h.ajv.compile({type:"object",properties:{meanLogProb:{type:"number",nullable:!0},meanAlternativeLogProb:{type:"number",nullable:!0}},additionalProperties:{type:"number"},required:[]}),h.keysExemptedFromSanitization=[a.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName,a.ExpServiceTelemetryNames.featuresTelemetryPropertyName],h.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","repo","request_option_nwo"],t.telemetrizePromptLength=function(e){return e.isFimEnabled?{promptPrefixCharLen:e.prefix.length,promptSuffixCharLen:e.suffix.length}:{promptCharLen:e.prefix.length}},t.now=m;class g{constructor(e){this.url=e}getUrl(){return this.url}}function _(e,t){const n=t;if(n.appInsightsClient){const t=n.appInsightsClient.commonProperties,r=h.sanitizeKeys(t);n.appInsightsClient.commonProperties=r,n.appInsightsClient.context.tags[n.appInsightsClient.context.keys.cloudRoleInstance]="REDACTED";const o=e.get(g).getUrl();void 0!==o&&(n.appInsightsClient.config.endpointUrl=o)}}function y(){var e;return null!==(e=null==d?void 0:d.optedIn)&&void 0!==e&&e}async function v(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),f(e,null!=r&&r,t,o)}async function b(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),function(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryErrorEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}(e,null!=r&&r,t,o)}t.TelemetryEndpointUrlOverride=g,t.noTelemetryEndpointUrlOverride=new g,t.telemetryEndpointUrlOverride=new g("https://copilot-telemetry.githubusercontent.com/telemetry"),t.configureReporter=_,t.telemetry=v,t.telemetryExpProblem=async function(e,t){const n=h.createAndMarkAsIssued(t,{});await n.makeReadyForSending(e,!1,"SkipExp"),f(e,!1,"expProblem",n)},t.telemetryRaw=async function(e,t,n,r){f(e,!1,t,{properties:n,measurements:r})},t.telemetryException=async function(e,t,n,r){const o=t instanceof Error?t:new Error("Non-error thrown: "+t),i=y(),s=h.createAndMarkAsIssued({origin:(0,l.redactPaths)(n),reason:i?"Exception logged to restricted telemetry":"Exception, not logged due to opt-out",...r});if(await s.makeReadyForSending(e,!1,"IncludeExp"),f(e,!1,"exception",s),!i)return;const a=h.createAndMarkAsIssued({origin:n,...r});await a.makeReadyForSending(e,!0,"IncludeExp"),function(e,t,n,r){const o=e.get(u).getSecureReporter(e);o&&o.sendTelemetryException(n,h.maybeRemoveRepoInfoFromPropertiesHack(true,r.properties),r.measurements)}(e,0,o,a)},t.telemetryError=b,t.logEngineCompletion=async function(e,t,n,r,o){var i;const s=h.createAndMarkAsIssued({completionTextJson:JSON.stringify(t),choiceIndex:o.toString()});for(const[e,t]of Object.entries(n.logprobs))s.properties["logprobs_"+e]=null!==(i=JSON.stringify(t))&&void 0!==i?i:"unset";s.extendWithRequestId(r),await v(e,"engine.completion",s,!0)},t.logEnginePrompt=async function(e,t,n){let r;r=t.isFimEnabled?{promptPrefixJson:JSON.stringify(t.prefix),promptSuffixJson:JSON.stringify(t.suffix),promptElementRanges:JSON.stringify(t.promptElementRanges)}:{promptJson:JSON.stringify(t.prefix),promptElementRanges:JSON.stringify(t.promptElementRanges)};const o=n.extendedBy(r);await v(e,"engine.prompt",o,!0)},t.setTelemetryConfig=function(e){d=e},t.dropTelemetryConfig=function(){d=void 0},t.forceSendingTelemetry=function(e,n){const r=n.getReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY),_(e,r)}try{const r=n.getSecureReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY_SECURE),_(e,r)}}catch(e){}}},4630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LibTestsEditorInfo=t.createLibTestingContext=t.setupTestingContext=t.setupTestingContextNoTelemetry=t.setupTestingContextNoTelemetryNoLog=t.setupTestingContextNoTelemetryNoLogNoNotifications=void 0;const r=n(4617),o=n(7147),i=n(2137),s=n(9800),a=n(5611),c=n(6905),l=n(6046),u=n(4619),d=n(5798),p=n(39),h=n(9035),f=n(5489),m=n(2369),g=n(819),_=n(4567),y=n(913),v=n(6584),b=n(751);function w(e){e.set(s.BuildInfo,new s.BuildInfo),e.set(y.RuntimeMode,y.RuntimeMode.fromEnvironment(!0)),e.set(p.Fetcher,new p.HelixFetcher(e)),e.set(d.LogVerbose,new d.LogVerbose(!1)),e.set(i.Clock,new i.Clock),e.set(l.ExpConfigMaker,new l.ExpConfigNone),e.set(u.GhostTextDebounceManager,new u.GhostTextDebounceManager)}function x(e){w(e),e.set(h.NotificationSender,new v.TestNotificationSender),e.set(_.UrlOpener,new v.TestUrlOpener)}function T(e){x(e),e.set(d.LogTarget,new d.ConsoleLog(console))}function E(e){T(e),e.set(f.TelemetryEndpointUrlOverride,f.noTelemetryEndpointUrlOverride),e.set(f.TelemetryReporters,(0,f.setupEmptyReporters)()),(0,f.setupStandardReporters)(e,"copilot-test"),e.set(c.Features,new c.Features(e))}t.setupTestingContextNoTelemetryNoLogNoNotifications=w,t.setupTestingContextNoTelemetryNoLog=x,t.setupTestingContextNoTelemetry=T,t.setupTestingContext=E,t.createLibTestingContext=function(){const e=new a.Context;return e.set(s.ConfigProvider,new s.DefaultsOnlyConfigProvider),E(e),e.set(s.EditorAndPluginInfo,new C),e.set(r.FileSystem,S),e.set(g.TextDocumentManager,new b.TestTextDocumentManager),e.set(m.LocationFactory,new b.TestLocationFactory),e};class C extends s.EditorAndPluginInfo{getEditorInfo(e){return{name:"lib-tests-editor",version:"1"}}getEditorPluginInfo(e){return{name:"lib-tests-plugin",version:"2"}}}t.LibTestsEditorInfo=C;const S={readFile:function(e){return o.promises.readFile(e)},mtime:async function(e){return(await o.promises.stat(e)).mtimeMs},stat:async function(e){const t=await o.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},5922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readTestingGitHubToken=t.makeTestingCopilotTokenManager=void 0;const r=n(7147),o=n(5765);function i(){const e=`${process.env.HOME}/.copilot-testing-gh-token`;if(r.existsSync(e))return r.readFileSync(e).toString();throw new Error(`Tests: either GH_COPILOT_TOKEN, or GITHUB_TOKEN, must be set, or there must be a GitHub token from an app with access to Copilot in ${e}. Run "npm run get_token" to get one.`)}t.makeTestingCopilotTokenManager=function(){if(process.env.GH_COPILOT_TOKEN)return new o.FixedCopilotTokenManager({token:process.env.GH_COPILOT_TOKEN,telemetry:"enabled"});if(process.env.GITHUB_TOKEN)return new o.CopilotTokenManagerFromGitHubToken({token:process.env.GITHUB_TOKEN});const e=i();return process.env.GITHUB_TOKEN=e,new o.CopilotTokenManagerFromGitHubToken({token:e})},t.readTestingGitHubToken=i},913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVerboseLoggingEnabled=t.isDebugEnabled=t.shouldFailForDebugPurposes=t.isRunningInTest=t.RuntimeMode=void 0;class n{constructor(e){this.flags=e}static fromEnvironment(e){return new n({debug:(t=process.argv,r=process.env,t.includes("--debug")||"true"===(null===(s=r.GITHUB_COPILOT_DEBUG)||void 0===s?void 0:s.toLowerCase())),verboseLogging:o(process.env),testMode:e,recordInput:i(process.argv,process.env)});var t,r,s}}function r(e){return e.get(n).flags.testMode}function o(e){if("COPILOT_AGENT_VERBOSE"in e){const t=e.COPILOT_AGENT_VERBOSE;return"1"===t||"true"===t}return!1}function i(e,t){var n;return e.includes("--record")||"true"===(null===(n=t.GITHUB_COPILOT_RECORD)||void 0===n?void 0:n.toLowerCase())}t.RuntimeMode=n,t.isRunningInTest=r,t.shouldFailForDebugPurposes=function(e){return r(e)},t.isDebugEnabled=function(e){return e.get(n).flags.debug},t.isVerboseLoggingEnabled=function(e){return e.get(n).flags.verboseLogging}},6584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestNotificationSender=t.TestUrlOpener=t.rangeToString=t.positionToString=void 0;const r=n(9035);function o(e){return`${e.line}:${e.character}`}t.positionToString=o,t.rangeToString=function(e){return`[${o(e.start)}--${o(e.end)}]`},t.TestUrlOpener=class{constructor(){this.openedUrls=[]}open(e){this.openedUrls.push(e)}};class i extends r.NotificationSender{constructor(){super(),this.sentMessages=[]}showWarningMessage(e,...t){return this.sentMessages.push(e),t?Promise.resolve(t[0]):Promise.resolve(void 0)}}t.TestNotificationSender=i},751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestLocationFactory=t.TestTextDocumentManager=t.InMemoryTextDocument=void 0;const r=n(4086);t.InMemoryTextDocument=class{constructor(e,t,n,o,i){this._uri=e,this._textDocument=r.TextDocument.create(e.toString(),t,n,o),this._relativePath=i}get uri(){return this._uri}get relativePath(){return this._relativePath}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r={start:{line:t,character:0},end:{line:t,character:n.length}},o=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:o}}getWordRangeAtPosition(e){}update(e,t){r.TextDocument.update(this._textDocument,e,t)}},t.TestTextDocumentManager=class{constructor(){this.onDidChangeTextDocument=()=>({dispose:()=>{}}),this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.textDocuments=[]}async getTextDocument(e){}async getRelativePath(e){}findNotebook(e){}},t.TestLocationFactory=class{position(e,t){return{line:e,character:t}}range(e,t,n,r){return"number"==typeof e?{start:{line:e,character:t},end:{line:n,character:r}}:{start:e,end:t}}}},2369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocationFactory=void 0,t.LocationFactory=class{}},819:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocumentManager=t.getRelativePath=void 0;const r=n(1017);t.getRelativePath=function(e,t){for(const n of e){const e=n.fsPath;if(t.startsWith(e+r.sep))return r.relative(e,t)}},t.TextDocumentManager=class{}},4567:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealUrlOpener=t.UrlOpener=void 0;const r=n(1814);t.UrlOpener=class{},t.RealUrlOpener=class{async open(e){await r(e)}}},9591:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactPaths=void 0,t.redactPaths=function(e){return e.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}},5614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(7147);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},3272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={shellscript:"#!/bin/sh",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",html:"",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(1017),o=n(2133);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===(0,r.extname)(o))o+=".ts";else if(".ts"!==(0,r.extname)(o))return null;return(0,r.join)((0,r.dirname)(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=(0,o.getFirstPrecedingComment)(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=(0,o.getFirstPrecedingComment)(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await(0,o.parseTree)(t,s);for(let e of(0,o.queryExports)(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await(0,o.parseTree)(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},2133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(1017),o=n(498),i=n(498);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=(0,r.resolve)(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},4343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(2133);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await(0,r.parseTree)(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!(0,r.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[(0,r.languageIdToWasmLanguage)(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!(0,r.isSupportedLanguageId)(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if((0,r.isSupportedLanguageId)(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if((0,r.isSupportedLanguageId)(e))return d(e).getNodeStart(t,n)}},8684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(5037),o=n(3272),i=n(1986),s=n(7289),a=n(1729),c=n(5037),l=n(7503);var u,d,p,h,f,m,g,_,y;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(u=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(d=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(p=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(h=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(f=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(m=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(g=t.LineEndingOptions||(t.LineEndingOptions={})),(y=t.SuffixOption||(t.SuffixOption={})).None="none",y.FifteenPercent="fifteenPercent",function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(_=t.SuffixStartMode||(t.SuffixStartMode={}));class v{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=u.Top,this.pathMarker=d.Top,this.includeSiblingFunctions=p.ContextOverSiblings,this.localImportContext=m.Declarations,this.neighboringTabs=h.Eager,this.neighboringTabsPosition=f.TopOfText,this.lineEnding=g.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=_.Cursor,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=p.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`)}}t.PromptOptions=v;const b={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function w(e){var t;return e=e.toLowerCase(),null!==(t=b[e])&&void 0!==t?t:e}function x(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=w,t.newLineEnded=x,t.getPrompt=async function(e,n,g={},y=[]){const b=new v(e,g),{source:T,offset:E}=n;if(E<0||E>T.length)throw new Error(`Offset ${E} is out of range.`);n.languageId=w(n.languageId);const C=new l.Priorities,S=C.justBelow(l.Priorities.TOP),k=b.pathMarker==d.Always?C.justBelow(l.Priorities.TOP):C.justBelow(S),P=b.languageMarker==u.Always?C.justBelow(l.Priorities.TOP):C.justBelow(S),I=b.includeSiblingFunctions==p.ContextOverSiblings?C.justBelow(S):C.justAbove(S),R=C.justBelow(S,I),O=C.justBelow(R),A=new l.PromptWishlist(b.lineEnding);let N,D;if(b.languageMarker!=u.NoMarker){const e=x((0,o.getLanguageMarker)(n));N=A.append(e,l.PromptElementKind.LanguageMarker,P)}if(b.pathMarker!=d.NoMarker){const e=x((0,o.getPathMarker)(n));D=A.append(e,l.PromptElementKind.PathMarker,k)}if(b.localImportContext!=m.NoContext)for(const e of await(0,i.extractLocalImportContext)(n,b.fs))A.append(x(e),l.PromptElementKind.ImportedFile,R);const M=b.neighboringTabs==h.None||0==y.length?[]:await(0,s.getNeighborSnippets)(n,y,b.neighboringTabs);function $(){M.forEach((e=>A.append(e.snippet,l.PromptElementKind.SimilarFile,O,(0,c.tokenLength)(e.snippet),e.score)))}b.neighboringTabsPosition==f.TopOfText&&$();const j=[];let L;if(b.includeSiblingFunctions==p.NoSiblings)L=T.substring(0,E);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await(0,a.getSiblingFunctions)(n);A.appendLineForLine(t,l.PromptElementKind.BeforeCursor,S).forEach((e=>j.push(e)));let o=I;e.forEach((e=>{A.append(e,l.PromptElementKind.AfterCursor,o),o=C.justBelow(o)})),b.neighboringTabsPosition==f.AfterSiblings&&$(),L=r}if(b.neighboringTabsPosition==f.DirectlyAboveCursor){const e=L.lastIndexOf("\n")+1,t=L.substring(0,e),n=L.substring(e);A.appendLineForLine(t,l.PromptElementKind.BeforeCursor,S).forEach((e=>j.push(e))),$(),n.length>0&&(j.push(A.append(n,l.PromptElementKind.AfterCursor,S)),j.length>1&&A.require(j[j.length-2],j[j.length-1]))}else A.appendLineForLine(L,l.PromptElementKind.BeforeCursor,S).forEach((e=>j.push(e)));if(u.Top==b.languageMarker&&j.length>0&&void 0!==N&&A.require(N,j[0]),d.Top==b.pathMarker&&j.length>0&&void 0!==D&&(N?A.require(D,N):A.require(D,j[0])),0==b.suffixPercent)return A.fulfill(b.maxPromptLength);{let e=n.offset;b.suffixStartMode!==_.Cursor&&b.suffixStartMode!==_.CursorTrimStart&&(e=await(0,a.getSiblingFunctionStart)(n));const o=b.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-b.suffixPercent)/100),s=A.fulfill(i);const l=o-s.prefixLength;let u=T.slice(e);b.suffixStartMode!=_.SiblingBlockTrimStart&&b.suffixStartMode!=_.CursorTrimStart||(u=u.trimStart());const d=(0,r.takeFirstTokens)(u,l),p=(0,c.tokenLength)(d);return p<=l-3&&(i=o-p,s=A.fulfill(i)),s.suffix=d,s.suffixLength=p,s}}},1729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(8684),o=n(2133);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if((0,o.isSupportedLanguageId)(n)){const u=await(0,o.parseTree)(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=(0,o.getAncestorWithSiblingFunctions)(n,p);if(h){const u=(0,o.getFirstPrecedingComment)(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if((0,o.isFunctionDefinition)(n,i)){const n=(0,o.getFirstPrecedingComment)(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=(0,o.getAncestorWithSiblingFunctions)(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if((0,o.isFunctionDefinition)(n,e)){const n=(0,o.getFirstPrecedingComment)(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},1186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedWindowSizeJaccardMatcher=void 0;const r=n(1864);class o extends r.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}(e,t)}}t.FixedWindowSizeJaccardMatcher=o,o.FACTORY=e=>({to:t=>new o(t,e)})},7289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=void 0;const r=n(3272),o=n(1186),i={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}};function s(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.getNeighborSnippets=async function(e,t,n){const o=i[n],a=o.matcherFactory.to(e);return t.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...a.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>o.threshold)).sort(((e,t)=>e.score-t.score)).slice(-o.numberOfNeighbors).map((t=>({score:t.score,snippet:s(t).map((t=>(0,r.comment)(t,e.languageId)+"\n")).join("")})))}},1864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},7503:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(8684),o=n(5037);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=(0,o.tokenLength)(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=(0,o.tokenLength)(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{e.exports=n(1193)},1193:(e,t,n)=>{"use strict";n(1808);var r,o=n(4404),i=n(3685),s=n(5687),a=n(2361),c=(n(9491),n(3837));function l(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||i.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,n,r,o){for(var i=d(n,r,o),s=0,a=t.requests.length;s=this.maxSockets?o.requests.push(i):o.createSocket(i,(function(t){function n(){o.emit("free",t,i)}function r(e){o.removeSocket(t),t.removeListener("free",n),t.removeListener("close",r),t.removeListener("agentRemove",r)}t.on("free",n),t.on("close",r),t.on("agentRemove",r),e.onSocket(t)}))},l.prototype.createSocket=function(e,t){var n=this,o={};n.sockets.push(o);var i=p({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),r("making CONNECT request");var s=n.request(i);function a(i,a,c){var l;return s.removeAllListeners(),a.removeAllListeners(),200!==i.statusCode?(r("tunneling socket could not be established, statusCode=%d",i.statusCode),a.destroy(),(l=new Error("tunneling socket could not be established, statusCode="+i.statusCode)).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):c.length>0?(r("got illegal response body from proxy"),a.destroy(),(l=new Error("got illegal response body from proxy")).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):(r("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=a,t(a))}s.useChunkedEncodingByDefault=!1,s.once("response",(function(e){e.upgrade=!0})),s.once("upgrade",(function(e,t,n){process.nextTick((function(){a(e,t,n)}))})),s.once("connect",a),s.once("error",(function(t){s.removeAllListeners(),r("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, cause="+t.message);i.code="ECONNRESET",e.request.emit("error",i),n.removeSocket(o)})),s.end()},l.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var n=this.requests.shift();n&&this.createSocket(n,(function(e){n.request.onSocket(e)}))}},r=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},t.debug=r},2371:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),n=0;n1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,o=1;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function _(e){throw new RangeError(f[e])}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(h,".")).split("."),t).join(".")}function v(e){for(var t=[],n=0,r=e.length;n=55296&&o<=56319&&n>1,e+=m(e/t);e>455;r+=u)e=m(e/35);return m(r+36*e/(e+38))},x=function(e){var t,n=[],r=e.length,o=0,i=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c=128&&_("not-basic"),n.push(e.charCodeAt(c));for(var d=a>0?a+1:0;d=r&&_("invalid-input");var g=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(g>=u||g>m((l-o)/h))&&_("overflow"),o+=g*h;var y=f<=s?1:f>=s+26?26:f-s;if(gm(l/v)&&_("overflow"),h*=v}var b=n.length+1;s=w(o-p,b,0==p),m(o/b)>l-i&&_("overflow"),i+=m(o/b),o%=b,n.splice(o++,0,i)}return String.fromCodePoint.apply(String,n)},T=function(e){var t=[],n=(e=v(e)).length,r=128,o=0,i=72,s=!0,a=!1,c=void 0;try{for(var d,p=e[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;h<128&&t.push(g(h))}}catch(e){a=!0,c=e}finally{try{!s&&p.return&&p.return()}finally{if(a)throw c}}var f=t.length,y=f;for(f&&t.push("-");y=r&&Pm((l-o)/I)&&_("overflow"),o+=(x-r)*I,r=x;var R=!0,O=!1,A=void 0;try{for(var N,D=e[Symbol.iterator]();!(R=(N=D.next()).done);R=!0){var M=N.value;if(Ml&&_("overflow"),M==r){for(var $=o,j=u;;j+=u){var L=j<=i?1:j>=i+26?26:j-i;if($>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function P(e){for(var t="",n=0,r=e.length;n=194&&o<224){if(r-n>=6){var i=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&o)<<6|63&i)}else t+=e.substr(n,6);n+=6}else if(o>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function I(e,t){function n(e){var n=P(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,k).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,k).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,k).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,k).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,k).replace(t.PCT_ENCODED,o)),e}function R(e){return e.replace(/^0*(.*)/,"$1")||"0"}function O(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=c(n,2)[1];return r?r.split(".").map(R).join("."):e}function A(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=c(n,3),o=r[1],i=r[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),a=c(s,2),l=a[0],u=a[1],d=u?u.split(":").map(R):[],p=l.split(":").map(R),h=t.IPV4ADDRESS.test(p[p.length-1]),f=h?7:8,m=p.length-f,g=Array(f),_=0;_1){var b=g.slice(0,y.index),w=g.slice(y.index+y.length);v=b.join(":")+"::"+w.join(":")}else v=g.join(":");return i&&(v+="%"+i),v}return e}var N=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,D=void 0==="".match(/(){0}/)[1];function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(N);if(o){D?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||void 0,n.userinfo=-1!==e.indexOf("@")?o[3]:void 0,n.host=-1!==e.indexOf("//")?o[4]:void 0,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:void 0,n.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),n.host&&(n.host=A(O(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var i=S[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)I(n,r);else{if(n.host&&(t.domainHost||i&&i.domainHost))try{n.host=E(n.host.replace(r.PCT_ENCODED,P).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}I(n,s)}i&&i.parse&&i.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function $(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(A(O(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}var j=/^\.\.?\//,L=/^\/\.(\/|$)/,F=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function B(e){for(var t=[];e.length;)if(e.match(j))e=e.replace(j,"");else if(e.match(L))e=e.replace(L,"/");else if(e.match(F))e=e.replace(F,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(q);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],o=S[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?C(e.host):E(e.host.replace(n.PCT_ENCODED,P).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}I(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var i=$(e,t);if(void 0!==i&&("suffix"!==t.reference&&r.push("//"),r.push(i),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||o&&o.absolutePath||(c=B(c)),void 0===i&&(c=c.replace(/^\/\//,"/%2F")),r.push(c)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function U(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=M(H(e,n),n),t=M(H(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=B(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=B(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function W(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,P)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},K={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function V(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var G={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=V(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(V(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=c(n,2),o=r[0],i=r[1];e.path=o&&"/"!==o?o:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:G.domainHost,parse:G.parse,serialize:G.serialize},X={},Q="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",Z=n(n("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+n("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Q,"g"),ne=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),oe=new RegExp(t("[^]",Q,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=oe;function se(e){var t=P(e);return t.match(te)?t:e}var ae={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var o=!1,i={},s=n.query.split("&"),a=0,c=s.length;a{"use strict";n.r(t),n.d(t,{NIL:()=>x,parse:()=>_,stringify:()=>d,v1:()=>g,v3:()=>v,v4:()=>b,v5:()=>w,validate:()=>l,version:()=>T});var r=n(6113),o=n.n(r);const i=new Uint8Array(256);let s=i.length;function a(){return s>i.length-16&&(o().randomFillSync(i),s=0),i.slice(s,s+=16)}const c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&c.test(e)},u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).substr(1));const d=function(e,t=0){const n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};let p,h,f=0,m=0;const g=function(e,t,n){let r=t&&n||0;const o=t||new Array(16);let i=(e=e||{}).node||p,s=void 0!==e.clockseq?e.clockseq:h;if(null==i||null==s){const t=e.random||(e.rng||a)();null==i&&(i=p=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=h=16383&(t[6]<<8|t[7]))}let c=void 0!==e.msecs?e.msecs:Date.now(),l=void 0!==e.nsecs?e.nsecs:m+1;const u=c-f+(l-m)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||c>f)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=c,m=l,h=s,c+=122192928e5;const g=(1e4*(268435455&c)+l)%4294967296;o[r++]=g>>>24&255,o[r++]=g>>>16&255,o[r++]=g>>>8&255,o[r++]=255&g;const _=c/4294967296*1e4&268435455;o[r++]=_>>>8&255,o[r++]=255&_,o[r++]=_>>>24&15|16,o[r++]=_>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(let e=0;e<6;++e)o[r+e]=i[e];return t||d(o)},_=function(e){if(!l(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function y(e,t,n){function r(e,r,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=!0;var r=n(7147),o=n(2037),i=n(1017),s=n(8212),a=n(8144),c=function(){function e(e,t,n,o){var a=this;this.extensionId=e,this.extensionVersion=t,this.firstParty=!1,this.userOptIn=!1,this.firstParty=!!o;var c=process.env.VSCODE_LOGS||"";c&&e&&"trace"===process.env.VSCODE_LOG_LEVEL&&(c=i.join(c,e+".txt"),this.logStream=r.createWriteStream(c,{flags:"a",encoding:"utf8",autoClose:!0})),this.updateUserOptIn(n),void 0!==s.env.onDidChangeTelemetryEnabled?this.optOutListener=s.env.onDidChangeTelemetryEnabled((function(){return a.updateUserOptIn(n)})):this.optOutListener=s.workspace.onDidChangeConfiguration((function(){return a.updateUserOptIn(n)}))}return e.prototype.updateUserOptIn=function(t){var n=s.workspace.getConfiguration(e.TELEMETRY_CONFIG_ID),r=void 0===s.env.isTelemetryEnabled?n.get(e.TELEMETRY_CONFIG_ENABLED_ID,!0):s.env.isTelemetryEnabled;this.userOptIn!==r&&(this.userOptIn=r,this.userOptIn?this.createAppInsightsClient(t):this.dispose())},e.prototype.createAppInsightsClient=function(e){a.defaultClient?(this.appInsightsClient=new a.TelemetryClient(e),this.appInsightsClient.channel.setUseDiskRetryCaching(!0)):(a.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0).start(),this.appInsightsClient=a.defaultClient),this.appInsightsClient.commonProperties=this.getCommonProperties(),s&&s.env&&(this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.userId]=s.env.machineId,this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.sessionId]=s.env.sessionId),e&&0===e.indexOf("AIF-")&&(this.appInsightsClient.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1",this.firstParty=!0)},e.prototype.getCommonProperties=function(){var e=Object.create(null);if(e["common.os"]=o.platform(),e["common.platformversion"]=(o.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),e["common.extname"]=this.extensionId,e["common.extversion"]=this.extensionVersion,s&&s.env){switch(e["common.vscodemachineid"]=s.env.machineId,e["common.vscodesessionid"]=s.env.sessionId,e["common.vscodeversion"]=s.version,e["common.isnewappinstall"]=s.env.isNewAppInstall,s.env.uiKind){case s.UIKind.Web:e["common.uikind"]="web";break;case s.UIKind.Desktop:e["common.uikind"]="desktop";break;default:e["common.uikind"]="unknown"}e["common.remotename"]=this.cleanRemoteName(s.env.remoteName)}return e},e.prototype.cleanRemoteName=function(e){if(!e)return"none";var t="other";return["ssh-remote","dev-container","attached-container","wsl"].forEach((function(n){0===e.indexOf(n+"+")&&(t=n)})),t},e.prototype.shouldSendErrorTelemetry=function(){return!this.firstParty||"other"!==this.cleanRemoteName(s.env.remoteName)||void 0!==this.extension&&this.extension.extensionKind!==s.ExtensionKind.Workspace&&s.env.uiKind!==s.UIKind.Web},Object.defineProperty(e.prototype,"extension",{get:function(){return void 0===this._extension&&(this._extension=s.extensions.getExtension(this.extensionId)),this._extension},enumerable:!1,configurable:!0}),e.prototype.cloneAndChange=function(e,t){if(null===e||"object"!=typeof e)return e;if("function"!=typeof t)return e;var n={};for(var r in e)n[r]=t(r,e[r]);return n},e.prototype.anonymizeFilePaths=function(e,t){if(null==e)return"";var n=[new RegExp(s.env.appRoot.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi")];this.extension&&n.push(new RegExp(this.extension.extensionPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"));var r=e;if(t){for(var o=[],i=0,a=n;i=r}))&&(r+=e.substring(p,t.index)+"",p=d.lastIndex)};"break"!==h(););p{"use strict";var r;n.r(t),n.d(t,{URI:()=>o,Utils:()=>i}),r=(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",o=0):o=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",o=0,i=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s;i>=0?s=arguments[i]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,o=47===s.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;ol){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>l&&(47===e.charCodeAt(o+d)?u=d:0===d&&(u=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(u=d)}var h="";for(d=o+u+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,i=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(l===n.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){o=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!i){r=a+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),i=47===o;i?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==d&&(d=1):-1!==s&&(d=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===d||1===d&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},447:(e,t,n)=>{var r;if(n.r(t),n.d(t,{URI:()=>f,Utils:()=>C}),"object"==typeof process)r="win32"===process.platform;else if("object"==typeof navigator){var o=navigator.userAgent;r=o.indexOf("Windows")>=0}var i,s,a=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=/^\w[\w\d+.-]*$/,l=/^\//,u=/^\/\//,d="",p="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function e(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||d,this.authority=e.authority||d,this.path=e.path||d,this.query=e.query||d,this.fragment=e.fragment||d):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||d,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==p&&(t=p+t):t=p}return t}(this.scheme,n||d),this.query=r||d,this.fragment=o||d,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!c.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!l.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,i))}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString},Object.defineProperty(e.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,o=e.query,i=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=d),void 0===n?n=this.authority:null===n&&(n=d),void 0===r?r=this.path:null===r&&(r=d),void 0===o?o=this.query:null===o&&(o=d),void 0===i?i=this.fragment:null===i&&(i=d),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new g(t,n,r,o,i)},e.parse=function(e,t){void 0===t&&(t=!1);var n=h.exec(e);return n?new g(n[2]||d,E(n[4]||d),E(n[5]||d),E(n[7]||d),E(n[9]||d),t):new g(d,d,d,d,d)},e.file=function(e){var t=d;if(r&&(e=e.replace(/\\/g,p)),e[0]===p&&e[1]===p){var n=e.indexOf(p,2);-1===n?(t=e.substring(2),e=p):(t=e.substring(2,n),e=e.substring(n)||p)}return new g("file",t,e,d,d)},e.from=function(e){return new g(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new g(t);return n._formatted=t.external,n._fsPath=t._sep===m?t.fsPath:null,n}return t},e}(),m=r?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return a(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),_=((s={})[58]="%3A",s[47]="%2F",s[63]="%3F",s[35]="%23",s[91]="%5B",s[93]="%5D",s[64]="%40",s[33]="%21",s[36]="%24",s[38]="%26",s[39]="%27",s[40]="%28",s[41]="%29",s[42]="%2A",s[43]="%2B",s[44]="%2C",s[59]="%3B",s[61]="%3D",s[32]="%20",s);function y(e,t){for(var n=void 0,r=-1,o=0;o=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||45===i||46===i||95===i||126===i||t&&47===i)-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=_[i];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),n+=s):-1===r&&(r=o)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function v(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,r&&(n=n.replace(/\//g,"\\")),n}function w(e,t){var n=t?v:y,r="",o=e.scheme,i=e.authority,s=e.path,a=e.query,c=e.fragment;if(o&&(r+=o,r+=":"),(i||"file"===o)&&(r+=p,r+=p),i){var l=i.indexOf("@");if(-1!==l){var u=i.substr(0,l);i=i.substr(l+1),-1===(l=u.indexOf(":"))?r+=n(u,!1):(r+=n(u.substr(0,l),!1),r+=":",r+=n(u.substr(l+1),!1)),r+="@"}-1===(l=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,l),!1),r+=i.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(d=s.charCodeAt(1))>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var d;(d=s.charCodeAt(0))>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function x(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+x(e.substr(3)):e}}var T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(T)?e.replace(T,(function(e){return x(e)})):e}var C,S=n(470),k=function(){for(var e=0,t=0,n=arguments.length;t{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(447)})();const{URI:o,Utils:i}=r},4617:(e,t,n)=>{var r,o,i;r={271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(747);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={shellscript:"#!/bin/sh",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",html:"",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(622),o=n(306);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===r.extname(o))o+=".ts";else if(".ts"!==r.extname(o))return null;return r.join(r.dirname(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=o.getFirstPrecedingComment(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=o.getFirstPrecedingComment(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await o.parseTree(t,s);for(let e of o.queryExports(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await o.parseTree(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(622),o=n(87),i=n(87);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=r.resolve(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(306);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await r.parseTree(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!r.queryPythonIsDocstring(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[r.languageIdToWasmLanguage(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!r.isSupportedLanguageId(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if(r.isSupportedLanguageId(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if(r.isSupportedLanguageId(e))return d(e).getNodeStart(t,n)}},312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(94),o=n(417),i=n(179),s=n(125),a=n(670),c=n(94),l=n(456);var u,d,p,h,f,m,g,_,y;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(u=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(d=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(p=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(h=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(f=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(m=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(g=t.LineEndingOptions||(t.LineEndingOptions={})),(y=t.SuffixOption||(t.SuffixOption={})).None="none",y.FifteenPercent="fifteenPercent",function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(_=t.SuffixStartMode||(t.SuffixStartMode={}));class v{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=u.Top,this.pathMarker=d.Top,this.includeSiblingFunctions=p.ContextOverSiblings,this.localImportContext=m.Declarations,this.neighboringTabs=h.Eager,this.neighboringTabsPosition=f.TopOfText,this.lineEnding=g.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=_.Cursor,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=p.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`)}}t.PromptOptions=v;const b={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function w(e){var t;return e=e.toLowerCase(),null!==(t=b[e])&&void 0!==t?t:e}function x(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=w,t.newLineEnded=x,t.getPrompt=async function(e,n,g={},y=[]){const b=new v(e,g),{source:T,offset:E}=n;if(E<0||E>T.length)throw new Error(`Offset ${E} is out of range.`);n.languageId=w(n.languageId);const C=new l.Priorities,S=C.justBelow(l.Priorities.TOP),k=b.pathMarker==d.Always?C.justBelow(l.Priorities.TOP):C.justBelow(S),P=b.languageMarker==u.Always?C.justBelow(l.Priorities.TOP):C.justBelow(S),I=b.includeSiblingFunctions==p.ContextOverSiblings?C.justBelow(S):C.justAbove(S),R=C.justBelow(S,I),O=C.justBelow(R),A=new l.PromptWishlist(b.lineEnding);let N,D;if(b.languageMarker!=u.NoMarker){const e=x(o.getLanguageMarker(n));N=A.append(e,l.PromptElementKind.LanguageMarker,P)}if(b.pathMarker!=d.NoMarker){const e=x(o.getPathMarker(n));D=A.append(e,l.PromptElementKind.PathMarker,k)}if(b.localImportContext!=m.NoContext)for(const e of await i.extractLocalImportContext(n,b.fs))A.append(x(e),l.PromptElementKind.ImportedFile,R);const M=b.neighboringTabs==h.None||0==y.length?[]:await s.getNeighborSnippets(n,y,b.neighboringTabs);function $(){M.forEach((e=>A.append(e.snippet,l.PromptElementKind.SimilarFile,O,c.tokenLength(e.snippet),e.score)))}b.neighboringTabsPosition==f.TopOfText&&$();const j=[];let L;if(b.includeSiblingFunctions==p.NoSiblings)L=T.substring(0,E);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await a.getSiblingFunctions(n);A.appendLineForLine(t,l.PromptElementKind.BeforeCursor,S).forEach((e=>j.push(e)));let o=I;e.forEach((e=>{A.append(e,l.PromptElementKind.AfterCursor,o),o=C.justBelow(o)})),b.neighboringTabsPosition==f.AfterSiblings&&$(),L=r}if(b.neighboringTabsPosition==f.DirectlyAboveCursor){const e=L.lastIndexOf("\n")+1,t=L.substring(0,e),n=L.substring(e);A.appendLineForLine(t,l.PromptElementKind.BeforeCursor,S).forEach((e=>j.push(e))),$(),n.length>0&&(j.push(A.append(n,l.PromptElementKind.AfterCursor,S)),j.length>1&&A.require(j[j.length-2],j[j.length-1]))}else A.appendLineForLine(L,l.PromptElementKind.BeforeCursor,S).forEach((e=>j.push(e)));if(u.Top==b.languageMarker&&j.length>0&&void 0!==N&&A.require(N,j[0]),d.Top==b.pathMarker&&j.length>0&&void 0!==D&&(N?A.require(D,N):A.require(D,j[0])),0==b.suffixPercent)return A.fulfill(b.maxPromptLength);{let e=n.offset;b.suffixStartMode!==_.Cursor&&b.suffixStartMode!==_.CursorTrimStart&&(e=await a.getSiblingFunctionStart(n));const o=b.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-b.suffixPercent)/100),s=A.fulfill(i);const l=o-s.prefixLength;let u=T.slice(e);b.suffixStartMode!=_.SiblingBlockTrimStart&&b.suffixStartMode!=_.CursorTrimStart||(u=u.trimStart());const d=r.takeFirstTokens(u,l),p=c.tokenLength(d);return p<=l-3&&(i=o-p,s=A.fulfill(i)),s.suffix=d,s.suffixLength=p,s}}},670:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(312),o=n(306);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if(o.isSupportedLanguageId(n)){const u=await o.parseTree(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=o.getAncestorWithSiblingFunctions(n,p);if(h){const u=o.getFirstPrecedingComment(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if(o.isFunctionDefinition(n,i)){const n=o.getFirstPrecedingComment(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=o.getAncestorWithSiblingFunctions(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if(o.isFunctionDefinition(n,e)){const n=o.getFirstPrecedingComment(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},404:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedWindowSizeJaccardMatcher=void 0;const r=n(467);class o extends r.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}(e,t)}}t.FixedWindowSizeJaccardMatcher=o,o.FACTORY=e=>({to:t=>new o(t,e)})},125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=void 0;const r=n(417),o=n(404),i={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}};function s(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.getNeighborSnippets=async function(e,t,n){const o=i[n],a=o.matcherFactory.to(e);return t.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...a.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>o.threshold)).sort(((e,t)=>e.score-t.score)).slice(-o.numberOfNeighbors).map((t=>({score:t.score,snippet:s(t).map((t=>r.comment(t,e.languageId)+"\n")).join("")})))}},467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},456:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(312),o=n(94);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=o.tokenLength(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=o.tokenLength(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{var r,o,i=void 0!==i?i:{};void 0===(o="function"==typeof(r=function(){var t,r={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t]);var o,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!o&&!d;var p,h,f,m,g,_="";o?(_=d?n(622).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(747)),g||(g=n(622)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=i,l=function(e){process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),i.print||console.log.bind(console);var y=i.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);r=null,i.arguments&&(a=i.arguments),i.thisProgram&&(c=i.thisProgram),i.quit&&(l=i.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":$[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],$[e>>2]=pe[0],$[e+4>>2]=pe[1];break;case"float":j[e>>2]=t;break;case"double":L[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return $[e>>2];case"float":return j[e>>2];case"double":return L[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,$,j,L,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function H(e,t){return e?B(D,e,t):""}function U(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return U(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return U(e,N,n,t),n}function V(e){A=e,i.HEAP8=N=new Int8Array(e),i.HEAP16=M=new Int16Array(e),i.HEAP32=$=new Int32Array(e),i.HEAPU8=D=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=j=new Float32Array(e),i.HEAPF64=L=new Float64Array(e)}var G=i.INITIAL_MEMORY||33554432;(S=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,i.monitorRunDependencies&&i.monitorRunDependencies(te)}function ie(e){if(te--,i.monitorRunDependencies&&i.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw i.onAbort&&i.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}i.preloadedImages={},i.preloadedAudios={},i.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=i.locateFile?i.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(i)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}var we={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function xe(e,t,n){return e.includes("j")?function(e,t,n){var r=i["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Te=5250832;function Ee(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function Ce(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Ee(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Se(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function ke(e,t){var n,r;return t&&(n=i.asm["orig$"+e]),n||(n=i.asm[e]),!n&&t&&(n=i["_orig$"+e]),n||(n=i[Se(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return xe(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Pe(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return He(e);var t=Te,n=t+e+15&-16;return Te=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return $[t>>2]=n/1e3|0,$[t+4>>2]=n%1e3*1e3*1e3|0,0}function je(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function Le(e){Qe(e)}function Fe(e){E(e)}$e.sig="iii",Le.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Te,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:$e,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),je(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:Le,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=H(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},He=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=Ce(n,1024),i.asm=n;var r,o=ye(t);o.neededDynlibs&&(C=o.neededDynlibs.concat(C)),r=i.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.__wasm_call_ctors).apply(null,arguments)},i._malloc=function(){return(He=i._malloc=i.asm.malloc).apply(null,arguments)}),Ue=(i._ts_language_symbol_count=function(){return(i._ts_language_symbol_count=i.asm.ts_language_symbol_count).apply(null,arguments)},i._ts_language_version=function(){return(i._ts_language_version=i.asm.ts_language_version).apply(null,arguments)},i._ts_language_field_count=function(){return(i._ts_language_field_count=i.asm.ts_language_field_count).apply(null,arguments)},i._ts_language_symbol_name=function(){return(i._ts_language_symbol_name=i.asm.ts_language_symbol_name).apply(null,arguments)},i._ts_language_symbol_for_name=function(){return(i._ts_language_symbol_for_name=i.asm.ts_language_symbol_for_name).apply(null,arguments)},i._ts_language_symbol_type=function(){return(i._ts_language_symbol_type=i.asm.ts_language_symbol_type).apply(null,arguments)},i._ts_language_field_name_for_id=function(){return(i._ts_language_field_name_for_id=i.asm.ts_language_field_name_for_id).apply(null,arguments)},i._memcpy=function(){return(i._memcpy=i.asm.memcpy).apply(null,arguments)},i._free=function(){return(i._free=i.asm.free).apply(null,arguments)},i._calloc=function(){return(i._calloc=i.asm.calloc).apply(null,arguments)},i._ts_parser_delete=function(){return(i._ts_parser_delete=i.asm.ts_parser_delete).apply(null,arguments)},i._ts_parser_reset=function(){return(i._ts_parser_reset=i.asm.ts_parser_reset).apply(null,arguments)},i._ts_parser_set_language=function(){return(i._ts_parser_set_language=i.asm.ts_parser_set_language).apply(null,arguments)},i._ts_parser_timeout_micros=function(){return(i._ts_parser_timeout_micros=i.asm.ts_parser_timeout_micros).apply(null,arguments)},i._ts_parser_set_timeout_micros=function(){return(i._ts_parser_set_timeout_micros=i.asm.ts_parser_set_timeout_micros).apply(null,arguments)},i._memcmp=function(){return(i._memcmp=i.asm.memcmp).apply(null,arguments)},i._ts_query_new=function(){return(i._ts_query_new=i.asm.ts_query_new).apply(null,arguments)},i._ts_query_delete=function(){return(i._ts_query_delete=i.asm.ts_query_delete).apply(null,arguments)},i._iswspace=function(){return(i._iswspace=i.asm.iswspace).apply(null,arguments)},i._iswalnum=function(){return(i._iswalnum=i.asm.iswalnum).apply(null,arguments)},i._ts_query_pattern_count=function(){return(i._ts_query_pattern_count=i.asm.ts_query_pattern_count).apply(null,arguments)},i._ts_query_capture_count=function(){return(i._ts_query_capture_count=i.asm.ts_query_capture_count).apply(null,arguments)},i._ts_query_string_count=function(){return(i._ts_query_string_count=i.asm.ts_query_string_count).apply(null,arguments)},i._ts_query_capture_name_for_id=function(){return(i._ts_query_capture_name_for_id=i.asm.ts_query_capture_name_for_id).apply(null,arguments)},i._ts_query_string_value_for_id=function(){return(i._ts_query_string_value_for_id=i.asm.ts_query_string_value_for_id).apply(null,arguments)},i._ts_query_predicates_for_pattern=function(){return(i._ts_query_predicates_for_pattern=i.asm.ts_query_predicates_for_pattern).apply(null,arguments)},i._ts_tree_copy=function(){return(i._ts_tree_copy=i.asm.ts_tree_copy).apply(null,arguments)},i._ts_tree_delete=function(){return(i._ts_tree_delete=i.asm.ts_tree_delete).apply(null,arguments)},i._ts_init=function(){return(i._ts_init=i.asm.ts_init).apply(null,arguments)},i._ts_parser_new_wasm=function(){return(i._ts_parser_new_wasm=i.asm.ts_parser_new_wasm).apply(null,arguments)},i._ts_parser_enable_logger_wasm=function(){return(i._ts_parser_enable_logger_wasm=i.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},i._ts_parser_parse_wasm=function(){return(i._ts_parser_parse_wasm=i.asm.ts_parser_parse_wasm).apply(null,arguments)},i._ts_language_type_is_named_wasm=function(){return(i._ts_language_type_is_named_wasm=i.asm.ts_language_type_is_named_wasm).apply(null,arguments)},i._ts_language_type_is_visible_wasm=function(){return(i._ts_language_type_is_visible_wasm=i.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},i._ts_tree_root_node_wasm=function(){return(i._ts_tree_root_node_wasm=i.asm.ts_tree_root_node_wasm).apply(null,arguments)},i._ts_tree_edit_wasm=function(){return(i._ts_tree_edit_wasm=i.asm.ts_tree_edit_wasm).apply(null,arguments)},i._ts_tree_get_changed_ranges_wasm=function(){return(i._ts_tree_get_changed_ranges_wasm=i.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},i._ts_tree_cursor_new_wasm=function(){return(i._ts_tree_cursor_new_wasm=i.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},i._ts_tree_cursor_delete_wasm=function(){return(i._ts_tree_cursor_delete_wasm=i.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},i._ts_tree_cursor_reset_wasm=function(){return(i._ts_tree_cursor_reset_wasm=i.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_first_child_wasm=function(){return(i._ts_tree_cursor_goto_first_child_wasm=i.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_next_sibling_wasm=function(){return(i._ts_tree_cursor_goto_next_sibling_wasm=i.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_parent_wasm=function(){return(i._ts_tree_cursor_goto_parent_wasm=i.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_type_id_wasm=function(){return(i._ts_tree_cursor_current_node_type_id_wasm=i.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_named_wasm=function(){return(i._ts_tree_cursor_current_node_is_named_wasm=i.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_missing_wasm=function(){return(i._ts_tree_cursor_current_node_is_missing_wasm=i.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_id_wasm=function(){return(i._ts_tree_cursor_current_node_id_wasm=i.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},i._ts_tree_cursor_start_position_wasm=function(){return(i._ts_tree_cursor_start_position_wasm=i.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},i._ts_tree_cursor_end_position_wasm=function(){return(i._ts_tree_cursor_end_position_wasm=i.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},i._ts_tree_cursor_start_index_wasm=function(){return(i._ts_tree_cursor_start_index_wasm=i.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},i._ts_tree_cursor_end_index_wasm=function(){return(i._ts_tree_cursor_end_index_wasm=i.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},i._ts_tree_cursor_current_field_id_wasm=function(){return(i._ts_tree_cursor_current_field_id_wasm=i.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_wasm=function(){return(i._ts_tree_cursor_current_node_wasm=i.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},i._ts_node_symbol_wasm=function(){return(i._ts_node_symbol_wasm=i.asm.ts_node_symbol_wasm).apply(null,arguments)},i._ts_node_child_count_wasm=function(){return(i._ts_node_child_count_wasm=i.asm.ts_node_child_count_wasm).apply(null,arguments)},i._ts_node_named_child_count_wasm=function(){return(i._ts_node_named_child_count_wasm=i.asm.ts_node_named_child_count_wasm).apply(null,arguments)},i._ts_node_child_wasm=function(){return(i._ts_node_child_wasm=i.asm.ts_node_child_wasm).apply(null,arguments)},i._ts_node_named_child_wasm=function(){return(i._ts_node_named_child_wasm=i.asm.ts_node_named_child_wasm).apply(null,arguments)},i._ts_node_child_by_field_id_wasm=function(){return(i._ts_node_child_by_field_id_wasm=i.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},i._ts_node_next_sibling_wasm=function(){return(i._ts_node_next_sibling_wasm=i.asm.ts_node_next_sibling_wasm).apply(null,arguments)},i._ts_node_prev_sibling_wasm=function(){return(i._ts_node_prev_sibling_wasm=i.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},i._ts_node_next_named_sibling_wasm=function(){return(i._ts_node_next_named_sibling_wasm=i.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},i._ts_node_prev_named_sibling_wasm=function(){return(i._ts_node_prev_named_sibling_wasm=i.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},i._ts_node_parent_wasm=function(){return(i._ts_node_parent_wasm=i.asm.ts_node_parent_wasm).apply(null,arguments)},i._ts_node_descendant_for_index_wasm=function(){return(i._ts_node_descendant_for_index_wasm=i.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_index_wasm=function(){return(i._ts_node_named_descendant_for_index_wasm=i.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_descendant_for_position_wasm=function(){return(i._ts_node_descendant_for_position_wasm=i.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_position_wasm=function(){return(i._ts_node_named_descendant_for_position_wasm=i.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_start_point_wasm=function(){return(i._ts_node_start_point_wasm=i.asm.ts_node_start_point_wasm).apply(null,arguments)},i._ts_node_end_point_wasm=function(){return(i._ts_node_end_point_wasm=i.asm.ts_node_end_point_wasm).apply(null,arguments)},i._ts_node_start_index_wasm=function(){return(i._ts_node_start_index_wasm=i.asm.ts_node_start_index_wasm).apply(null,arguments)},i._ts_node_end_index_wasm=function(){return(i._ts_node_end_index_wasm=i.asm.ts_node_end_index_wasm).apply(null,arguments)},i._ts_node_to_string_wasm=function(){return(i._ts_node_to_string_wasm=i.asm.ts_node_to_string_wasm).apply(null,arguments)},i._ts_node_children_wasm=function(){return(i._ts_node_children_wasm=i.asm.ts_node_children_wasm).apply(null,arguments)},i._ts_node_named_children_wasm=function(){return(i._ts_node_named_children_wasm=i.asm.ts_node_named_children_wasm).apply(null,arguments)},i._ts_node_descendants_of_type_wasm=function(){return(i._ts_node_descendants_of_type_wasm=i.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},i._ts_node_is_named_wasm=function(){return(i._ts_node_is_named_wasm=i.asm.ts_node_is_named_wasm).apply(null,arguments)},i._ts_node_has_changes_wasm=function(){return(i._ts_node_has_changes_wasm=i.asm.ts_node_has_changes_wasm).apply(null,arguments)},i._ts_node_has_error_wasm=function(){return(i._ts_node_has_error_wasm=i.asm.ts_node_has_error_wasm).apply(null,arguments)},i._ts_node_is_missing_wasm=function(){return(i._ts_node_is_missing_wasm=i.asm.ts_node_is_missing_wasm).apply(null,arguments)},i._ts_query_matches_wasm=function(){return(i._ts_query_matches_wasm=i.asm.ts_query_matches_wasm).apply(null,arguments)},i._ts_query_captures_wasm=function(){return(i._ts_query_captures_wasm=i.asm.ts_query_captures_wasm).apply(null,arguments)},i._iswalpha=function(){return(i._iswalpha=i.asm.iswalpha).apply(null,arguments)},i._iswdigit=function(){return(i._iswdigit=i.asm.iswdigit).apply(null,arguments)},i._iswlower=function(){return(i._iswlower=i.asm.iswlower).apply(null,arguments)},i._towupper=function(){return(i._towupper=i.asm.towupper).apply(null,arguments)},i._memchr=function(){return(i._memchr=i.asm.memchr).apply(null,arguments)},i.___errno_location=function(){return(Ue=i.___errno_location=i.asm.__errno_location).apply(null,arguments)}),We=(i._strlen=function(){return(i._strlen=i.asm.strlen).apply(null,arguments)},i.stackSave=function(){return(We=i.stackSave=i.asm.stackSave).apply(null,arguments)}),ze=i.stackRestore=function(){return(ze=i.stackRestore=i.asm.stackRestore).apply(null,arguments)},Ke=i.stackAlloc=function(){return(Ke=i.stackAlloc=i.asm.stackAlloc).apply(null,arguments)},Ve=i._setThrew=function(){return(Ve=i._setThrew=i.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=i.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=i.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},i.__Znwm=function(){return(i.__Znwm=i.asm._Znwm).apply(null,arguments)},i.__ZdlPv=function(){return(i.__ZdlPv=i.asm._ZdlPv).apply(null,arguments)},i._orig$ts_parser_timeout_micros=function(){return(i._orig$ts_parser_timeout_micros=i.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},i._orig$ts_parser_set_timeout_micros=function(){return(i._orig$ts_parser_set_timeout_micros=i.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},i._TRANSFER_BUFFER=7296,i.___THREW__=7932,i.___threwValue=7936,i.___cxa_new_handler=7928,i.allocate=function(e,t){var n;return n=t==F?Ke(e.length):He(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,i.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Ye&&function(e){var t=i._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));$[r>>2]=K(c);for(var o=1;o>2)+o]=K(e[o-1]);$[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(i.onExit&&i.onExit(e),R=!0),l(e,new Ge(e)))}if(i.run=Xe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Ye=!0;i.noInitialRun&&(Ye=!1),Xe();const Ze=i,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{i.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(747);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Pe;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{const r=n(747),o=n(622),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=n(7147)},622:e=>{"use strict";e.exports=n(1017)},13:e=>{"use strict";e.exports=n(1267)}},o={},i=function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(563),e.exports=i},498:(e,t,n)=>{var r,o=void 0!==o?o:{};void 0===(r=function(){var t,r={};for(t in o)o.hasOwnProperty(t)&&(r[t]=o[t]);var i,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,i="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!i&&!d;var p,h,f,m,g,_="";i?(_=d?n(1017).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(7147)),g||(g=n(1017)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=o,l=function(e){process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),o.print||console.log.bind(console);var y=o.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(o[t]=r[t]);r=null,o.arguments&&(a=o.arguments),o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":$[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],$[e>>2]=pe[0],$[e+4>>2]=pe[1];break;case"float":j[e>>2]=t;break;case"double":L[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return $[e>>2];case"float":return j[e>>2];case"double":return L[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,$,j,L,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function H(e,t){return e?B(D,e,t):""}function U(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return U(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return U(e,N,n,t),n}function V(e){A=e,o.HEAP8=N=new Int8Array(e),o.HEAP16=M=new Int16Array(e),o.HEAP32=$=new Int32Array(e),o.HEAPU8=D=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=new Uint32Array(e),o.HEAPF32=j=new Float32Array(e),o.HEAPF64=L=new Float64Array(e)}var G=o.INITIAL_MEMORY||33554432;(S=o.wasmMemory?o.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,o.monitorRunDependencies&&o.monitorRunDependencies(te)}function ie(e){if(te--,o.monitorRunDependencies&&o.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw o.onAbort&&o.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}o.preloadedImages={},o.preloadedAudios={},o.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=o.locateFile?o.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(o)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}var we={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function xe(e,t,n){return e.includes("j")?function(e,t,n){var r=o["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Te=5250832;function Ee(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function Ce(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Ee(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Se(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function ke(e,t){var n,r;return t&&(n=o.asm["orig$"+e]),n||(n=o.asm[e]),!n&&t&&(n=o["_orig$"+e]),n||(n=o[Se(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return xe(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Pe(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return He(e);var t=Te,n=t+e+15&-16;return Te=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return $[t>>2]=n/1e3|0,$[t+4>>2]=n%1e3*1e3*1e3|0,0}function je(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function Le(e){Qe(e)}function Fe(e){E(e)}$e.sig="iii",Le.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Te,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:$e,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),je(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:Le,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=H(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},He=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=Ce(n,1024),o.asm=n;var r,i=ye(t);i.neededDynlibs&&(C=i.neededDynlibs.concat(C)),r=o.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.__wasm_call_ctors).apply(null,arguments)},o._malloc=function(){return(He=o._malloc=o.asm.malloc).apply(null,arguments)}),Ue=(o._ts_language_symbol_count=function(){return(o._ts_language_symbol_count=o.asm.ts_language_symbol_count).apply(null,arguments)},o._ts_language_version=function(){return(o._ts_language_version=o.asm.ts_language_version).apply(null,arguments)},o._ts_language_field_count=function(){return(o._ts_language_field_count=o.asm.ts_language_field_count).apply(null,arguments)},o._ts_language_symbol_name=function(){return(o._ts_language_symbol_name=o.asm.ts_language_symbol_name).apply(null,arguments)},o._ts_language_symbol_for_name=function(){return(o._ts_language_symbol_for_name=o.asm.ts_language_symbol_for_name).apply(null,arguments)},o._ts_language_symbol_type=function(){return(o._ts_language_symbol_type=o.asm.ts_language_symbol_type).apply(null,arguments)},o._ts_language_field_name_for_id=function(){return(o._ts_language_field_name_for_id=o.asm.ts_language_field_name_for_id).apply(null,arguments)},o._memcpy=function(){return(o._memcpy=o.asm.memcpy).apply(null,arguments)},o._free=function(){return(o._free=o.asm.free).apply(null,arguments)},o._calloc=function(){return(o._calloc=o.asm.calloc).apply(null,arguments)},o._ts_parser_delete=function(){return(o._ts_parser_delete=o.asm.ts_parser_delete).apply(null,arguments)},o._ts_parser_reset=function(){return(o._ts_parser_reset=o.asm.ts_parser_reset).apply(null,arguments)},o._ts_parser_set_language=function(){return(o._ts_parser_set_language=o.asm.ts_parser_set_language).apply(null,arguments)},o._ts_parser_timeout_micros=function(){return(o._ts_parser_timeout_micros=o.asm.ts_parser_timeout_micros).apply(null,arguments)},o._ts_parser_set_timeout_micros=function(){return(o._ts_parser_set_timeout_micros=o.asm.ts_parser_set_timeout_micros).apply(null,arguments)},o._memcmp=function(){return(o._memcmp=o.asm.memcmp).apply(null,arguments)},o._ts_query_new=function(){return(o._ts_query_new=o.asm.ts_query_new).apply(null,arguments)},o._ts_query_delete=function(){return(o._ts_query_delete=o.asm.ts_query_delete).apply(null,arguments)},o._iswspace=function(){return(o._iswspace=o.asm.iswspace).apply(null,arguments)},o._iswalnum=function(){return(o._iswalnum=o.asm.iswalnum).apply(null,arguments)},o._ts_query_pattern_count=function(){return(o._ts_query_pattern_count=o.asm.ts_query_pattern_count).apply(null,arguments)},o._ts_query_capture_count=function(){return(o._ts_query_capture_count=o.asm.ts_query_capture_count).apply(null,arguments)},o._ts_query_string_count=function(){return(o._ts_query_string_count=o.asm.ts_query_string_count).apply(null,arguments)},o._ts_query_capture_name_for_id=function(){return(o._ts_query_capture_name_for_id=o.asm.ts_query_capture_name_for_id).apply(null,arguments)},o._ts_query_string_value_for_id=function(){return(o._ts_query_string_value_for_id=o.asm.ts_query_string_value_for_id).apply(null,arguments)},o._ts_query_predicates_for_pattern=function(){return(o._ts_query_predicates_for_pattern=o.asm.ts_query_predicates_for_pattern).apply(null,arguments)},o._ts_tree_copy=function(){return(o._ts_tree_copy=o.asm.ts_tree_copy).apply(null,arguments)},o._ts_tree_delete=function(){return(o._ts_tree_delete=o.asm.ts_tree_delete).apply(null,arguments)},o._ts_init=function(){return(o._ts_init=o.asm.ts_init).apply(null,arguments)},o._ts_parser_new_wasm=function(){return(o._ts_parser_new_wasm=o.asm.ts_parser_new_wasm).apply(null,arguments)},o._ts_parser_enable_logger_wasm=function(){return(o._ts_parser_enable_logger_wasm=o.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},o._ts_parser_parse_wasm=function(){return(o._ts_parser_parse_wasm=o.asm.ts_parser_parse_wasm).apply(null,arguments)},o._ts_language_type_is_named_wasm=function(){return(o._ts_language_type_is_named_wasm=o.asm.ts_language_type_is_named_wasm).apply(null,arguments)},o._ts_language_type_is_visible_wasm=function(){return(o._ts_language_type_is_visible_wasm=o.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},o._ts_tree_root_node_wasm=function(){return(o._ts_tree_root_node_wasm=o.asm.ts_tree_root_node_wasm).apply(null,arguments)},o._ts_tree_edit_wasm=function(){return(o._ts_tree_edit_wasm=o.asm.ts_tree_edit_wasm).apply(null,arguments)},o._ts_tree_get_changed_ranges_wasm=function(){return(o._ts_tree_get_changed_ranges_wasm=o.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},o._ts_tree_cursor_new_wasm=function(){return(o._ts_tree_cursor_new_wasm=o.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},o._ts_tree_cursor_delete_wasm=function(){return(o._ts_tree_cursor_delete_wasm=o.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},o._ts_tree_cursor_reset_wasm=function(){return(o._ts_tree_cursor_reset_wasm=o.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_first_child_wasm=function(){return(o._ts_tree_cursor_goto_first_child_wasm=o.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_next_sibling_wasm=function(){return(o._ts_tree_cursor_goto_next_sibling_wasm=o.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_parent_wasm=function(){return(o._ts_tree_cursor_goto_parent_wasm=o.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_type_id_wasm=function(){return(o._ts_tree_cursor_current_node_type_id_wasm=o.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_named_wasm=function(){return(o._ts_tree_cursor_current_node_is_named_wasm=o.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_missing_wasm=function(){return(o._ts_tree_cursor_current_node_is_missing_wasm=o.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_id_wasm=function(){return(o._ts_tree_cursor_current_node_id_wasm=o.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},o._ts_tree_cursor_start_position_wasm=function(){return(o._ts_tree_cursor_start_position_wasm=o.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},o._ts_tree_cursor_end_position_wasm=function(){return(o._ts_tree_cursor_end_position_wasm=o.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},o._ts_tree_cursor_start_index_wasm=function(){return(o._ts_tree_cursor_start_index_wasm=o.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},o._ts_tree_cursor_end_index_wasm=function(){return(o._ts_tree_cursor_end_index_wasm=o.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},o._ts_tree_cursor_current_field_id_wasm=function(){return(o._ts_tree_cursor_current_field_id_wasm=o.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_wasm=function(){return(o._ts_tree_cursor_current_node_wasm=o.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},o._ts_node_symbol_wasm=function(){return(o._ts_node_symbol_wasm=o.asm.ts_node_symbol_wasm).apply(null,arguments)},o._ts_node_child_count_wasm=function(){return(o._ts_node_child_count_wasm=o.asm.ts_node_child_count_wasm).apply(null,arguments)},o._ts_node_named_child_count_wasm=function(){return(o._ts_node_named_child_count_wasm=o.asm.ts_node_named_child_count_wasm).apply(null,arguments)},o._ts_node_child_wasm=function(){return(o._ts_node_child_wasm=o.asm.ts_node_child_wasm).apply(null,arguments)},o._ts_node_named_child_wasm=function(){return(o._ts_node_named_child_wasm=o.asm.ts_node_named_child_wasm).apply(null,arguments)},o._ts_node_child_by_field_id_wasm=function(){return(o._ts_node_child_by_field_id_wasm=o.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},o._ts_node_next_sibling_wasm=function(){return(o._ts_node_next_sibling_wasm=o.asm.ts_node_next_sibling_wasm).apply(null,arguments)},o._ts_node_prev_sibling_wasm=function(){return(o._ts_node_prev_sibling_wasm=o.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},o._ts_node_next_named_sibling_wasm=function(){return(o._ts_node_next_named_sibling_wasm=o.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},o._ts_node_prev_named_sibling_wasm=function(){return(o._ts_node_prev_named_sibling_wasm=o.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},o._ts_node_parent_wasm=function(){return(o._ts_node_parent_wasm=o.asm.ts_node_parent_wasm).apply(null,arguments)},o._ts_node_descendant_for_index_wasm=function(){return(o._ts_node_descendant_for_index_wasm=o.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_index_wasm=function(){return(o._ts_node_named_descendant_for_index_wasm=o.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_descendant_for_position_wasm=function(){return(o._ts_node_descendant_for_position_wasm=o.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_position_wasm=function(){return(o._ts_node_named_descendant_for_position_wasm=o.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_start_point_wasm=function(){return(o._ts_node_start_point_wasm=o.asm.ts_node_start_point_wasm).apply(null,arguments)},o._ts_node_end_point_wasm=function(){return(o._ts_node_end_point_wasm=o.asm.ts_node_end_point_wasm).apply(null,arguments)},o._ts_node_start_index_wasm=function(){return(o._ts_node_start_index_wasm=o.asm.ts_node_start_index_wasm).apply(null,arguments)},o._ts_node_end_index_wasm=function(){return(o._ts_node_end_index_wasm=o.asm.ts_node_end_index_wasm).apply(null,arguments)},o._ts_node_to_string_wasm=function(){return(o._ts_node_to_string_wasm=o.asm.ts_node_to_string_wasm).apply(null,arguments)},o._ts_node_children_wasm=function(){return(o._ts_node_children_wasm=o.asm.ts_node_children_wasm).apply(null,arguments)},o._ts_node_named_children_wasm=function(){return(o._ts_node_named_children_wasm=o.asm.ts_node_named_children_wasm).apply(null,arguments)},o._ts_node_descendants_of_type_wasm=function(){return(o._ts_node_descendants_of_type_wasm=o.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},o._ts_node_is_named_wasm=function(){return(o._ts_node_is_named_wasm=o.asm.ts_node_is_named_wasm).apply(null,arguments)},o._ts_node_has_changes_wasm=function(){return(o._ts_node_has_changes_wasm=o.asm.ts_node_has_changes_wasm).apply(null,arguments)},o._ts_node_has_error_wasm=function(){return(o._ts_node_has_error_wasm=o.asm.ts_node_has_error_wasm).apply(null,arguments)},o._ts_node_is_missing_wasm=function(){return(o._ts_node_is_missing_wasm=o.asm.ts_node_is_missing_wasm).apply(null,arguments)},o._ts_query_matches_wasm=function(){return(o._ts_query_matches_wasm=o.asm.ts_query_matches_wasm).apply(null,arguments)},o._ts_query_captures_wasm=function(){return(o._ts_query_captures_wasm=o.asm.ts_query_captures_wasm).apply(null,arguments)},o._iswalpha=function(){return(o._iswalpha=o.asm.iswalpha).apply(null,arguments)},o._iswdigit=function(){return(o._iswdigit=o.asm.iswdigit).apply(null,arguments)},o._iswlower=function(){return(o._iswlower=o.asm.iswlower).apply(null,arguments)},o._towupper=function(){return(o._towupper=o.asm.towupper).apply(null,arguments)},o._memchr=function(){return(o._memchr=o.asm.memchr).apply(null,arguments)},o.___errno_location=function(){return(Ue=o.___errno_location=o.asm.__errno_location).apply(null,arguments)}),We=(o._strlen=function(){return(o._strlen=o.asm.strlen).apply(null,arguments)},o.stackSave=function(){return(We=o.stackSave=o.asm.stackSave).apply(null,arguments)}),ze=o.stackRestore=function(){return(ze=o.stackRestore=o.asm.stackRestore).apply(null,arguments)},Ke=o.stackAlloc=function(){return(Ke=o.stackAlloc=o.asm.stackAlloc).apply(null,arguments)},Ve=o._setThrew=function(){return(Ve=o._setThrew=o.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=o.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=o.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},o.__Znwm=function(){return(o.__Znwm=o.asm._Znwm).apply(null,arguments)},o.__ZdlPv=function(){return(o.__ZdlPv=o.asm._ZdlPv).apply(null,arguments)},o._orig$ts_parser_timeout_micros=function(){return(o._orig$ts_parser_timeout_micros=o.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},o._orig$ts_parser_set_timeout_micros=function(){return(o._orig$ts_parser_set_timeout_micros=o.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},o._TRANSFER_BUFFER=7296,o.___THREW__=7932,o.___threwValue=7936,o.___cxa_new_handler=7928,o.allocate=function(e,t){var n;return n=t==F?Ke(e.length):He(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,o.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Ye&&function(e){var t=o._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));$[r>>2]=K(c);for(var i=1;i>2)+i]=K(e[i-1]);$[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(o.onExit&&o.onExit(e),R=!0),l(e,new Ge(e)))}if(o.run=Xe,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Ye=!0;o.noInitialRun&&(Ye=!1),Xe();const Ze=o,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{o.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(7147);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Pe;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{const r=n(7147),o=n(1017),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=require("@opentelemetry/tracing")},9166:e=>{"use strict";e.exports=require("applicationinsights-native-metrics")},9491:e=>{"use strict";e.exports=require("assert")},852:e=>{"use strict";e.exports=require("async_hooks")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6206:e=>{"use strict";e.exports=require("console")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5158:e=>{"use strict";e.exports=require("http2")},5687:e=>{"use strict";e.exports=require("https")},8188:e=>{"use strict";e.exports=require("module")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},2781:e=>{"use strict";e.exports=require("stream")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},9796:e=>{"use strict";e.exports=require("zlib")},3180:e=>{"use strict";e.exports=JSON.parse('{"name":"@adobe/helix-fetch","version":"3.1.1","description":"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2","main":"src/index.js","scripts":{"test":"nyc mocha","lint":"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},"mocha":{"timeout":"5000","recursive":"true","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"engines":{"node":">=12.0"},"types":"src/index.d.ts","exports":{"import":"./src/index.mjs","require":"./src/index.js"},"repository":{"type":"git","url":"https://github.com/adobe/helix-fetch"},"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/adobe/helix-fetch/issues"},"homepage":"https://github.com/adobe/helix-fetch#readme","keywords":["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],"dependencies":{"debug":"4.3.4","http-cache-semantics":"4.1.0","lru-cache":"7.13.1"},"devDependencies":{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2","eslint":"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3","mocha":"10.0.0","mocha-multi-reporters":"1.5.1","nock":"13.2.9","nyc":"15.1.0","parse-cache-control":"1.0.1","pem":"1.14.6","proxy":"^1.0.2","semantic-release":"19.0.3","sinon":"14.0.0","stream-buffers":"3.0.2","tunnel":"^0.0.6"},"lint-staged":{"*.js":"eslint"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"ghooks":{"pre-commit":"npx lint-staged"}}}')},1143:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3186:e=>{"use strict";e.exports={i8:"1.7.6"}},9674:e=>{"use strict";e.exports={i8:"0.2.0"}},735:e=>{"use strict";e.exports={i8:"1.3.7"}},9876:e=>{"use strict";e.exports=JSON.parse('{"name":"copilot","displayName":"GitHub Copilot","description":"Your AI pair programmer","version":"1.43.0","build":"dev","buildType":"dev","publisher":"GitHub","preview":false,"qna":"https://github.com/github-community/community/discussions/categories/copilot","icon":"assets/Copilot-App-Icon.png","engines":{"vscode":"^1.68.0","npm":">=7.0.0"},"categories":["Other"],"badges":[{"url":"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange","href":"https://github.com/github-copilot/signup","description":"Sign up for GitHub Copilot"}],"activationEvents":["onStartupFinished"],"main":"./dist/extension","enabledApiProposals":["inlineCompletionsAdditions"],"contributes":{"commands":[{"command":"github.copilot.generate","title":"Open GitHub Copilot"},{"command":"github.copilot.toggleCopilot","title":"GitHub Copilot: Configure Enabled/Disabled"},{"command":"github.copilot.sendFeedback","title":"GitHub Copilot: Send Feedback"}],"keybindings":[{"command":"github.copilot.generate","key":"ctrl+enter","mac":"ctrl+enter","when":"editorTextFocus && github.copilot.activated"},{"command":"editor.action.inlineSuggest.trigger","key":"alt+\\\\","when":"editorTextFocus && !editorHasSelection && config.github.copilot.inlineSuggest.enable && !inlineSuggestionsVisible"}],"menus":{"editor/inlineCompletions/actions":[{"command":"github.copilot.generate","when":"github.copilot.activated"}],"commandPalette":[{"command":"github.copilot.generate","when":"github.copilot.activated"},{"command":"github.copilot.toggleCopilot","when":"github.copilot.activated"},{"command":"github.copilot.sendFeedback","when":"github.copilot.activated"}]},"configuration":[{"title":"Copilot","properties":{"github.copilot.advanced":{"type":"object","title":"Advanced Settings","properties":{"secret_key":{"type":"string","default":"","description":"Secret API key"},"length":{"type":"integer","default":500,"description":"Length of code to generate in tokens"},"temperature":{"type":"string","default":"","description":"Override sampling temperature (range 0.0 - 1.0)"},"top_p":{"type":"number","default":1,"description":"Top probability mass to consider"},"stops":{"type":"object","default":{"*":["\\n\\n\\n"],"python":["\\ndef ","\\nclass ","\\nif ","\\n\\n#"]},"description":"Configure per-language stop sequences"},"indentationMode":{"type":"object","default":{"python":false,"javascript":false,"javascriptreact":false,"jsx":false,"typescript":false,"typescriptreact":false,"go":false,"ruby":false,"*":true},"markdownDescription":"Enable or disable indentation block termination for specified [languages](https://code.visualstudio.com/docs/languages/identifiers)."},"inlineSuggestCount":{"type":"integer","default":3,"description":"Number of inline suggestions to fetch"},"listCount":{"type":"integer","default":10,"description":"Number of solutions to list in Open GitHub Copilot"},"debug.showScores":{"type":"boolean","default":false,"description":"Show scores in sorted solutions"},"debug.overrideEngine":{"type":"string","default":"","description":"Override engine name"},"debug.overrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy full URL"},"debug.testOverrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy URL when running tests"},"debug.overrideLogLevels":{"type":"object","default":{},"description":"Override what the minimum logged level is per logger (or \'*\' for all loggers). Levels are \'DEBUG\', \'INFO\', \'WARN\', \'ERROR\'. Ex: `{\\"default\\": \\"DEBUG\\"}` to see all things logged to the \'default\' logger."},"debug.filterLogCategories":{"type":"array","default":[],"description":"Show only log categories listed in this setting. If an array is empty, show all loggers"}}},"github.copilot.enable":{"type":"object","default":{"*":true,"yaml":false,"plaintext":false,"markdown":false},"markdownDescription":"Enable or disable Copilot for specified [languages](https://code.visualstudio.com/docs/languages/identifiers)"},"github.copilot.inlineSuggest.enable":{"type":"boolean","default":true,"description":"Show inline suggestions"}}}],"icons":{"copilot-logo":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0041"}},"copilot-warning":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0042"}},"copilot-notconnected":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0043"}}},"iconFonts":[{"id":"copilot-font","src":[{"path":"assets/copilot.woff","format":"woff"}]}]},"scripts":{"postinstall":"npx vscode-dts dev && mv vscode.proposed.*.ts extension/src","vscode:prepublish":"npm-run-all build:extension","build":"npm-run-all build:*","build:agent":"cd agent && npm run build","build:agent-no-pkg":"cd agent && npm run build-no-pkg","build:extension":"webpack --mode production","build:lib":"cd lib && npm run build","compile":"npm-run-all compile:*","compile:agent":"cd agent && npm run compile","compile:extension":"webpack --mode development","compile:lib":"cd lib && npm run compile","watch":"npm-run-all -p watch:*","watch:agent":"cd agent && npm run watch","watch:extension":"webpack --mode development --watch","watch:lib":"cd lib && npm run watch","lint":"eslint lib extension agent --ext ts","check_deps":"depcruise -c .dependency-cruiser.js .","test":"npm-run-all test:*","test:agent":"cd agent && npm run test","test:extension":"cd extension && ts-node ./test/runTest.ts","test:prompt":"cd prompt && npm install && npm run test","test:lib":"cd lib && npm run test","test:lsp-client":"cd lsp-client && npm run smokeTest","build_test":"tsc extension/test/run.ts","get_token":"ts-node script/getToken.ts"},"devDependencies":{"@github/prettier-config":"0.0.4","@types/crypto-js":"^4.0.1","@types/mocha":"^5.2.6","@types/node":"^13.11.0","@types/tunnel":"^0.0.3","@types/uuid":"^8.3.1","@types/vscode":"^1.68.0","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","dependency-cruiser":"^9.26.1","eslint":"^7.29.0","eslint-plugin-no-only-tests":"^2.6.0","fantasticon":"^1.2.2","get-port":"^5.1.1","mocha":"^6.1.4","npm-run-all":"^4.1.5","prettier":"2.5.1","prettier-plugin-organize-imports":"^2.3.4","ts-dedent":"^2.2.0","ts-loader":"^8.0.11","ts-node":"^9.0.0","typescript":"^4.4.3","vsce":"1.91.0","vscode-dts":"^0.3.2","vscode-test":"^1.3.0","webpack":"^5.54.0","webpack-cli":"^4.2.0","zlib":"^1.0.5"},"dependencies":{"@adobe/helix-fetch":"github:bmuskalla/helix-fetch#4e33e47bf6e64b637d5d713558fde504bf71c947","@github/copilot-promptlib":"file:prompt","@sinclair/typebox":"^0.23.4","ajv":"^8.6.3","ajv-errors":"^3.0.0","crypto-js":"^4.0.0","open":"^8.4.0","source-map-support":"^0.5.19","tunnel":"^0.0.6","uuid":"^8.3.2","vscode-extension-telemetry":"^0.1.6","vscode-uri":"^3.0.2"}}')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});const t=n(6995),o=n(2879);!async function(){const e=(0,t.init)(),n=(0,o.createWrappedConnection)(e,process.stdin,process.stdout);new o.CopilotService(e,n).listen()}()})(),module.exports=r})(); + deps: ${n}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,i.propertyInData)(n,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?n.if(u,(()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,i.checkMissingProp)(e,l,a)})`),(0,i.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:s,it:a}=e,c=n.name("valid");for(const l in t)(0,o.alwaysValidSchema)(a,t[l])||(n.if((0,i.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},76:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:i}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else a?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,o){return()=>{const i=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(i,l),o?t.assign(o,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!(0,o.alwaysValidSchema)(e,n)}t.default=i},6951:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8891),o=n(1162),i=n(8634),s=n(5151),a=n(5609),c=n(5463),l=n(3021),u=n(4943),d=n(4243),p=n(8103),h=n(2869),f=n(4279),m=n(4880),g=n(2609),_=n(76),y=n(5316);t.default=function(e=!1){const t=[h.default,f.default,m.default,g.default,_.default,y.default,l.default,u.default,c.default,d.default,p.default];return e?t.push(o.default,s.default):t.push(r.default,i.default),t.push(a.default),t}},8634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(5669),o=n(8936),i=n(3499),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,o.alwaysValidSchema)(n,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:i}=l,s=n.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(l,e,r.strictTuples)}}(s),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(i,n.length,l.items));const u=i.name("valid"),d=i.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,o.alwaysValidSchema)(l,t)||(i.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=a,t.default=s},5151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(3499),s=n(8891),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,o.alwaysValidSchema)(r,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},2869:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,r.alwaysValidSchema)(o,n))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},4880:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=n,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,i)=>{let a;(0,o.alwaysValidSchema)(s,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${i}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,i),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},8103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s=n(8936),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,r.allSchemaProperties)(n),p=d.filter((e=>(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length||p.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const h=u.strictSchema&&!u.allowMatchingProperties&&c.properties,f=t.name("valid");!0===l.props||l.props instanceof o.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:m}=l;function g(e){for(const t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function _(n){t.forIn("key",a,(i=>{t.if(o._`${(0,r.usePattern)(e,n)}.test(${i})`,(()=>{const r=p.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:i,dataPropType:s.Type.Str},f),l.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):r||l.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of d)h&&g(e),l.allErrors?_(e):(t.var(f,!0),_(e),t.if(f))}()}};t.default=a},1162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8634),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=o},4243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1686),o=n(3499),i=n(8936),s=n(4943),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new r.KeywordCxt(l,s.default,"additionalProperties"));const u=(0,o.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),l.props));const d=u.filter((e=>!(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const p=t.name("valid");for(const n of d)h(n)?f(n):(t.if((0,o.propertyInData)(t,c,n,l.opts.ownProperties)),f(n),l.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(p);function h(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}};t.default=a},3021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,n))return;const a=t.name("valid");t.forIn("key",i,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},5316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=o},3499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(5669),o=n(8936),i=n(7250);function s(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return r._`${s(e)}.call(${t}, ${n})`}function c(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} === undefined`;return o?(0,r.or)(i,(0,r.not)(a(e,t,n))):i}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:o,it:i}=e;n.if(c(n,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},o,i){return(0,r.or)(...o.map((o=>(0,r.and)(c(e,t,o,n.ownProperties),r._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=s,t.isOwnProperty=a,t.propertyInData=function(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return o?r._`${i} && ${a(e,t,n)}`:i},t.noPropertyInData=c,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((n=>!(0,o.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},l,u,d){const p=d?r._`${e}, ${t}, ${o}${s}`:t,h=[[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=r._`${p}, ${n.object(...h)}`;return u!==r.nil?r._`${l}.call(${u}, ${f})`:r._`${l}(${f})`},t.usePattern=function({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,o),code:r._`new RegExp(${n}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:i,dataProp:n,dataPropType:o.Type.Num},a),t.if((0,r.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},1018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},2101:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1018),o=n(1939),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default];t.default=i},1939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(1578),o=n(3499),i=n(5669),s=n(7250),a=n(7382),c=n(8936),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:p,self:h}=o,{root:f}=c;if(("#"===n||"#/"===n)&&s===f.baseId)return function(){if(c===f)return d(e,l,c,c.$async);const n=t.scopeValue("root",{ref:f});return d(e,i._`${n}.validate`,f,f.$async)}();const m=a.resolveRef.call(h,f,s,n);if(void 0===m)throw new r.default(s,n);return m instanceof a.SchemaEnv?function(t){const n=u(e,t);d(e,n,t,t.$async)}(m):function(r){const o=t.scopeValue("schema",!0===p.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),s=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:n},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):i._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:d,opts:p}=l,h=p.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=c.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",i._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,i.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=c.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",i._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,i.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,h)}`),m(t),u||a.assign(n,!0)}),(e=>{a.if(i._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),f(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,o.callValidateCode)(e,t,h),(()=>m(t)),(()=>f(t)))}t.getValidate=u,t.callRef=d,t.default=l},2:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(7421),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:i,parentSchema:s,it:a}=e,{oneOf:c}=s;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),d=t.const("tag",r._`${n}${(0,r.getProperty)(l)}`);function p(n){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:n},o);return e.mergeEvaluated(i,r.Name),o}t.if(r._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=o(s);let r=!0;for(let t=0;te.error(!1,{discrError:o.DiscrError.Tag,tag:d,tagName:l}))),e.ok(u)}};t.default=i},7421:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(n=t.DiscrError||(t.DiscrError={})).Tag="tag",n.Mapping="mapping"},5671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2101),o=n(7499),i=n(6951),s=n(4480),a=n(2480),c=[r.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},3599:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=c;l.validateFormats&&(i?function(){const i=n.scopeValue("formats",{ref:p.formats,code:l.code.formats}),s=n.const("fDef",r._`${i}[${a}]`),c=n.let("fType"),u=n.let("format");n.if(r._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>n.assign(c,r._`${s}.type || "string"`).assign(u,r._`${s}.validate`)),(()=>n.assign(c,r._`"string"`).assign(u,s))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${u}`,function(){const e=d.$async?r._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:r._`${u}(${o})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const i=p.formats[s];if(!i)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}p.logger.warn(e())}();if(!0===i)return;const[a,c,h]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(s)}`:void 0,o=n.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,r._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${h}(${o})`}return"function"==typeof c?r._`${h}(${o})`:r._`${h}.test(${o})`}())}())}};t.default=o},4480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(3599).default];t.default=r},2480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},6577:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(r._`!${(0,o.useFunc)(t,i.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=s},9450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum,d=(0,o.useFunc)(t,i.default);let p;if(u||s)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(r._`${d}(${n}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,r.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?r._`${d}(${n}, ${e}[${t}])`:r._`${n} === ${o}`}(e,o))))}e.pass(p)}};t.default=s},7499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1337),o=n(9706),i=n(9507),s=n(1216),a=n(34),c=n(6962),l=n(1135),u=n(194),d=n(6577),p=n(9450),h=[r.default,o.default,i.default,s.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default];t.default=h},1135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${i} ${o}`)}};t.default=o},9507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(9161),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,o.useFunc)(e.gen,i.default)}(${n})`;e.fail$data(r._`${l} ${c} ${s}`)}};t.default=s},1337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=r.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>r.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data(r._`${n} ${i[t].fail} ${o} || isNaN(${n})`)}};t.default=a},34:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${i} ${o}`)}};t.default=o},9706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};t.default=o},1216:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?o._`(new RegExp(${s}, ${c}))`:(0,r.usePattern)(e,i);e.fail$data(o._`!${l}.test(${t})`)}};t.default=i},6962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:s,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===n.length)return;const d=n.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)e.block$data(o.nil,p);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,i){e.setParams({missingProperty:n}),t.forOf(n,s,(()=>{t.assign(i,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,i)),(0,r.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function p(){t.forOf("prop",s,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,u.ownProperties),(()=>e.error()))}))}}};t.default=s},194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7332),o=n(5669),i=n(8936),s=n(4285),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!a&&!c)return;const p=t.let("valid"),h=l.items?(0,r.getSchemaTypes)(l.items):[];function f(i,s){const a=t.name("item"),c=(0,r.checkDataTypes)(h,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${n}[${i}]`),t.if(c,o._`continue`),h.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,o._`${l}[${a}]`),e.error(),t.assign(p,!1).break()})).code(o._`${l}[${a}] = ${i}`)}))}function m(r,a){const c=(0,i.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(o._`;${r}--;`,(()=>t.for(o._`${a} = ${r}; ${a}--;`,(()=>t.if(o._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(p,!1).break(l)}))))))}e.block$data(p,(function(){const r=t.let("i",o._`${n}.length`),i=t.let("j");e.setParams({i:r,j:i}),t.assign(p,!0),t.if(o._`${r} > 1`,(()=>(h.length>0&&!h.some((e=>"object"===e||"array"===e))?f:m)(r,i)))}),o._`${u} === false`),e.ok(p)}};t.default=a},3245:(e,t,n)=>{"use strict";var r=n(1767),o=function(){function e(t){if(e.INSTANCE)throw new Error("Console logging adapter tracking should be configured from the applicationInsights object");this._client=t,e.INSTANCE=this}return e.prototype.enable=function(e,t){r.IsInitialized&&(n(2469).wp(e&&t,this._client),n(3805).wp(e,this._client),n(7916).wp(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1,!1)},e._methodNames=["debug","info","log","warn","error"],e}();e.exports=o},6751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2010),o=n(1767),i=function(){function e(){}return e.getCurrentContext=function(){if(!e.enabled)return null;var t=e.session.get(e.CONTEXT_NAME);return void 0===t?null:t},e.generateContextObject=function(e,t,n,r,o,i){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t,traceparent:o,tracestate:i},customProperties:new s(r)}:null},e.runWithContext=function(t,n){return e.enabled?e.session.bind(n,((r={})[e.CONTEXT_NAME]=t,r))():n();var r},e.wrapEmitter=function(t){e.enabled&&e.session.bindEmitter(t)},e.wrapCallback=function(t){return e.enabled?e.session.bind(t):t},e.enable=function(t){this.enabled||(this.isNodeVersionCompatible()?(e.hasEverEnabled||(this.forceClsHooked=t,this.hasEverEnabled=!0,void 0===this.cls&&(!0===e.forceClsHooked||void 0===e.forceClsHooked&&e.shouldUseClsHooked()?this.cls=n(9172):this.cls=n(2611)),e.session=this.cls.createNamespace("AI-CLS-Session"),o.registerContextPreservation((function(t){return e.session.bind(t)}))),this.enabled=!0):this.enabled=!1)},e.disable=function(){this.enabled=!1},e.reset=function(){e.hasEverEnabled&&(e.session=null,e.session=this.cls.createNamespace("AI-CLS-Session"))},e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},e.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},e.canUseClsHooked=function(){var e=process.versions.node.split("."),t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r},e.enabled=!1,e.hasEverEnabled=!1,e.forceClsHooked=void 0,e.CONTEXT_NAME="ApplicationInsights-Context",e}();t.CorrelationContextManager=i;var s=function(){function e(e){this.props=[],this.addHeaderData(e)}return e.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map((function(e){var t=e.split("=");return{key:t[0],value:t[1]}})).concat(this.props)},e.prototype.serializeToHeader=function(){return this.props.map((function(e){return e.key+"="+e.value})).join(", ")},e.prototype.getProperty=function(e){for(var t=0;t0&&process.once("uncaughtException",(function(){e.post.call(l,p,!0),s.delete(h),e.destroy.call(null,p)}))}e.post.call(l,p,!1),u=null,(a||d)&&(d=!1,s.delete(h),e.destroy.call(null,p))},h=c.apply(r,n),s.set(h,p),h},r[o]=function(t){if(u===t&&null!==t)d=!0;else if(s.has(t)){const n=s.get(t);s.delete(t),e.destroy.call(null,n)}l.apply(r,arguments)}}e.exports=function(){p(this._hooks,this._state,"setTimeout","clearTimeout",o,a,!0),p(this._hooks,this._state,"setInterval","clearInterval",i,c,!1),p(this._hooks,this._state,"setImmediate","clearImmediate",s,l,!0),global.setTimeout=r.setTimeout,global.setInterval=r.setInterval,global.setImmediate=r.setImmediate,global.clearTimeout=r.clearTimeout,global.clearInterval=r.clearInterval,global.clearImmediate=r.clearImmediate}},7600:e=>{"use strict";e.exports=(e,t)=>class extends e{constructor(e){var n,r;super((function(e,i){n=this,r=[function(n){return t(o,!1),e(n)},function(e){return t(o,!1),i(e)}]}));var o=this;try{e.apply(n,r)}catch(e){r[1](e)}return o}}},1747:(e,t,n)=>{var r,o,i=n(4403).wrap,s=[],a=0,c=!1,l=[];function u(e,t){var n=e.length,r=t.length,o=[];if(0===n&&0===r)return o;for(var i=0;i0&&(s=l.pop()),d=void 0,n&&!c},o=function(e,t,n){var r=[];c=!0;for(var o=0;o0&&t[o].before(this,r[t[o].uid]);c=!1;var i=e.apply(this,arguments);for(c=!0,o=0;o0&&t[o].after(this,r[t[o].uid]);return c=!1,s=l.pop(),d=void 0,i}},i(process,"_fatalException",(function(e){return function(t){return r(t)||e(t)}}))}else{var h=!1;r=function(e){if(h)throw e;for(var t=!1,n=s.length,r=0;r0&&t[p].before(this,o[t[p].uid]);c=!1;try{i=e.apply(this,arguments)}catch(e){for(a=!0,p=0;p0&&t[p].after(this,o[t[p].uid]);c=!1}s=l.pop()}return i}},process.addListener("uncaughtException",r)}function f(e,t){"function"==typeof e.create&&(this.create=e.create,this.flags|=1),"function"==typeof e.before&&(this.before=e.before,this.flags|=2),"function"==typeof e.after&&(this.after=e.after,this.flags|=4),"function"==typeof e.error&&(this.error=e.error,this.flags|=8),this.uid=++a,this.data=void 0===t?null:t}function m(e,t){if("object"!=typeof e||!e)throw new TypeError("callbacks argument must be an object");return e instanceof f?e:new f(e,t)}f.prototype.create=void 0,f.prototype.before=void 0,f.prototype.after=void 0,f.prototype.error=void 0,f.prototype.data=void 0,f.prototype.uid=0,f.prototype.flags=0,process.createAsyncListener=m,process.addAsyncListener=function(e,t){var n;n=e instanceof f?e:m(e,t);for(var r=!1,o=0;o0)return o(e,n,t);return function(e,t,n){c=!0;for(var r=0;r{"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(4403),o=n(3341),i=r.wrap,s=r.massWrap,a=n(1747),c=n(3837),l=o.gte(process.version,"6.0.0"),u=o.gte(process.version,"7.0.0"),d=o.gte(process.version,"8.0.0"),p=o.gte(process.version,"11.0.0"),h=n(1808);function f(e){return function(){this.on("connection",(function(e){e._handle&&(e._handle.onread=a(e._handle.onread))}));try{return e.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=a(this._handle.onconnection))}}}function m(e){if(e&&e._handle){var t=e._handle;t._originalOnread||(t._originalOnread=t.onread),t.onread=a(t._originalOnread)}}u&&!h._normalizeArgs?h._normalizeArgs=function(e){if(0===e.length)return[{},null];var t,n,r=e[0],o={};"object"==typeof r&&null!==r?o=r:"string"==typeof(t=r)&&!1===(n=t,(n=Number(n))>=0&&n)?o.path=r:(o.port=r,e.length>1&&"string"==typeof e[1]&&(o.host=e[1]));var i=e[e.length-1];return"function"!=typeof i?[o,null]:[o,i]}:u||h._normalizeConnectArgs||(h._normalizeConnectArgs=function(e){var t,n={};"object"==typeof e[0]&&null!==e[0]?n=e[0]:"string"==typeof e[0]&&!1===(t=e[0],(t=Number(t))>=0&&t)?n.path=e[0]:(n.port=e[0],"string"==typeof e[1]&&(n.host=e[1]));var r=e[e.length-1];return"function"==typeof r?[n,r]:[n]}),"_setUpListenHandle"in h.Server.prototype?i(h.Server.prototype,"_setUpListenHandle",f):i(h.Server.prototype,"_listen2",f),i(h.Socket.prototype,"connect",(function(e){return function(){var t;(t=d&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?arguments[0]:u?h._normalizeArgs(arguments):h._normalizeConnectArgs(arguments))[1]&&(t[1]=a(t[1]));var n=e.apply(this,t);return m(this),n}}));var g=n(3685);i(g.Agent.prototype,"addRequest",(function(e){return function(t){var n=t.onSocket;return t.onSocket=a((function(e){return m(e),n.apply(this,arguments)})),e.apply(this,arguments)}}));var _=n(2081);function y(e){Array.isArray(e.stdio)&&e.stdio.forEach((function(e){e&&e._handle&&(e._handle.onread=a(e._handle.onread),i(e._handle,"close",A))})),e._handle&&(e._handle.onexit=a(e._handle.onexit))}_.ChildProcess?i(_.ChildProcess.prototype,"spawn",(function(e){return function(){var t=e.apply(this,arguments);return y(this),t}})):s(_,["execFile","fork","spawn"],(function(e){return function(){var t=e.apply(this,arguments);return y(t),t}})),process._fatalException||(process._originalNextTick=process.nextTick);var v=[];process._nextDomainTick&&v.push("_nextDomainTick"),process._tickDomainCallback&&v.push("_tickDomainCallback"),s(process,v,O),i(process,"nextTick",A);var b=["setTimeout","setInterval"];global.setImmediate&&b.push("setImmediate");var w=n(9512),x=global.setTimeout===w.setTimeout;s(w,b,A),x&&s(global,b,A);var T=n(9523);s(T,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],O),T.resolveNaptr&&i(T,"resolveNaptr",O);var E,C,S=n(7147);s(S,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],O),S.lchown&&i(S,"lchown",O),S.lchmod&&i(S,"lchmod",O),S.ftruncate&&i(S,"ftruncate",O);try{E=n(9796)}catch(e){}if(E&&E.Deflate&&E.Deflate.prototype){var k=Object.getPrototypeOf(E.Deflate.prototype);k._transform?i(k,"_transform",O):k.write&&k.flush&&k.end&&s(k,["write","flush","end"],O)}try{C=n(6113)}catch(e){}if(C){var P=["pbkdf2","randomBytes"];p||P.push("pseudoRandomBytes"),s(C,P,O)}var I=!!global.Promise&&"function Promise() { [native code] }"===Promise.toString()&&"function toString() { [native code] }"===Promise.toString.toString();if(I){var R=process.addAsyncListener({create:function(){I=!1}});global.Promise.resolve(!0).then((function(){I=!1})),process.removeAsyncListener(R)}function O(e){var t=function(){var t,n=arguments.length-1;if("function"==typeof arguments[n]){t=Array(arguments.length);for(var r=0;r{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var $=s++;i[$]="^"+i[D]+i[C]+"$";var L=s++;i[L]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var H=s++;i[H]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[H]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[L]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[U],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2172:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(632),a="error@context",c=[];for(let e in s.providers)c[s.providers[e]]=e;const l=process.env.DEBUG_CLS_HOOKED;let u=-1;function d(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}function p(e){return process.namespaces[e]}function h(e){let t=p(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function f(e){process.env.DEBUG&&process._rawDebug(e)}function m(e){return e?"function"==typeof e?e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]:e.constructor&&e.constructor.name?e.constructor.name:void 0:e}if(e.exports={getNamespace:p,createNamespace:function(e){o.ok(e,"namespace must be given a name."),l&&f("CREATING NAMESPACE "+e);let t=new d(e);return t.id=u,s.addHooks({init(n,o,i,s,a){u=n,s?(t._contexts.set(n,t._contexts.get(s)),l&&f("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+i)):t._contexts.set(u,t.active),l&&f("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+c[i]+" active:"+r.inspect(t.active,!0))},pre(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" PRE "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.enter(i)):l&&f(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},post(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" POST "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.exit(i)):l&&f(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},destroy(n){u=n,l&&f("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(u))+" active:"+r.inspect(t.active,!0)),t._contexts.delete(n)}}),process.namespaces[e]=t,t},destroyNamespace:h,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){h(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},d.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return l&&f(" SETTING KEY:"+e+"="+t+" in ns:"+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e]=t,t},d.prototype.get=function(e){if(this.active)return l&&f(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e];l&&f(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0))},d.prototype.createContext=function(){l&&f(" CREATING Context: "+this.name+" uid:"+u+" len:"+this._set.length+" active:"+r.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=u,l&&f(" CREATED Context: "+this.name+" uid:"+u+" len:"+this._set.length+" context:"+r.inspect(e,!0,2,!0)),e},d.prototype.run=function(e){let t=this.createContext();this.enter(t);try{return l&&f(" BEFORE RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),e(t),t}catch(e){throw e&&(e[a]=t),e}finally{l&&f(" AFTER RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t)}},d.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},d.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return l&&f(" BEFORE runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},d.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},d.prototype.enter=function(e){o.ok(e,"context must be provided for entering"),l&&f(" ENTER "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this._set.push(this.active),this.active=e},d.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),l&&f(" EXIT "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(l&&f("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},d.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},d.prototype.fromException=function(e){return e[a]},process.namespaces={},s._state&&!s._state.enabled&&s.enable(),l){var g=n(6818);for(var _ in g.filter._modifiers)g.filter.deattach(_)}},8423:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(852),a="error@context",c=process.env.DEBUG_CLS_HOOKED;let l=-1;function u(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}function d(e){return process.namespaces[e]}function p(e){let t=d(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function h(...e){c&&process._rawDebug(`${r.format(...e)}`)}e.exports={getNamespace:d,createNamespace:function(e){o.ok(e,"namespace must be given a name."),c&&h(`NS-CREATING NAMESPACE (${e})`);let t=new u(e);return t.id=l,s.createHook({init(n,o,i,a){if(l=s.executionAsyncId(),t.active){if(t._contexts.set(n,t.active),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(0===l){const i=s.triggerAsyncId(),u=t._contexts.get(i);if(u){if(t._contexts.set(n,u),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT USING CONTEXT FROM TRIGGERID [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT MISSING CONTEXT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}if(c&&"PROMISE"===o){h(r.inspect(a,{showHidden:!0}));const s=a.parentId;h(`${" ".repeat(t._indent<0?0:t._indent)}INIT RESOURCE-PROMISE [${o}] (${e}) parentId:${s} asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}},before(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`),t._indent+=2}t.enter(o)}else if(c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${r.inspect(t._contexts,{showHidden:!0,depth:2,colors:!0})}`),t._indent+=2}},after(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}t.exit(o)}else if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}},destroy(n){if(l=s.executionAsyncId(),c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}DESTROY (${e}) currentUid:${l} asyncId:${n} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(t._contexts.get(l))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t},destroyNamespace:p,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){p(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},u.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,c&&h(" ".repeat(this._indent<0?0:this._indent)+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),t},u.prototype.get=function(e){if(this.active){if(c){const t=s.executionAsyncId(),n=s.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);h(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),h(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]}if(c){const t=s.currentId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}},u.prototype.createContext=function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=l,c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-CREATED Context: (${this.name}) currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},u.prototype.run=function(e){let t=this.createContext();this.enter(t);try{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}return e(t),t}catch(e){throw e&&(e[a]=t),e}finally{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN END: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}},u.prototype.runAndReturn=function(e){let t;return this.run((function(n){t=e(n)})),t},u.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return c&&h("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(c&&h("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,c&&h("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},u.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},u.prototype.enter=function(e){if(o.ok(e,"context must be provided for entering"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-ENTER: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active),this.active=e},u.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-EXIT: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(c&&h("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},u.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},u.prototype.fromException=function(e){return e[a]},process.namespaces={}},9172:(e,t,n)=>{"use strict";const r=n(2173);process&&r.gte(process.versions.node,"8.0.0")?e.exports=n(8423):e.exports=n(2172)},2173:(e,t)=>{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var $=s++;i[$]="^"+i[D]+i[C]+"$";var L=s++;i[L]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var H=s++;i[H]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[H]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[L]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[U],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2611:(e,t,n)=>{"use strict";var r=n(9491),o=n(7267),i="error@context";function s(e){this.name=e,this.active=null,this._set=[],this.id=null}function a(e){return process.namespaces[e]}function c(e){var t=a(e);r.ok(t,"can't delete nonexistent namespace!"),r.ok(t.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(t.id),process.namespaces[e]=null}function l(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){c(e)})),process.namespaces=Object.create(null)}process.addAsyncListener||n(1274),s.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,t},s.prototype.get=function(e){if(this.active)return this.active[e]},s.prototype.createContext=function(){return Object.create(this.active)},s.prototype.run=function(e){var t=this.createContext();this.enter(t);try{return e(t),t}catch(e){throw e&&(e[i]=t),e}finally{this.exit(t)}},s.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},s.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());var n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[i]=t),e}finally{n.exit(t)}}},s.prototype.enter=function(e){r.ok(e,"context must be provided for entering"),this._set.push(this.active),this.active=e},s.prototype.exit=function(e){if(r.ok(e,"context must be provided for exiting"),this.active===e)return r.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());var t=this._set.lastIndexOf(e);r.ok(t>=0,"context not currently entered; can't exit"),r.ok(t,"can't remove top context"),this._set.splice(t,1)},s.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this,n="context@"+this.name;o(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;var t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){var r=n[e];t=r.namespace.bind(t,r.context)})),t}))},s.prototype.fromException=function(e){return e[i]},process.namespaces||l(),e.exports={getNamespace:a,createNamespace:function(e){r.ok(e,"namespace must be given a name!");var t=new s(e);return t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){n&&t.enter(n)},after:function(e,n){n&&t.exit(n)},error:function(e){e&&t.exit(e)}}),process.namespaces[e]=t,t},destroyNamespace:c,reset:l}},6725:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],s=[],a=[],c=[],l=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,o[n]=f,i[f]=n;var m=e[n],g=e[m],_=e[g],y=257*e[f]^16843008*f;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*_^65537*g^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=m^e[e[e[_^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],s=0;s6&&s%n==4&&(l=o[l>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l]):(l=o[(l=l<<8|l>>>24)>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l],l^=f[s/n|0]<<24),i[s]=i[s-n]^l);for(var a=this._invKeySchedule=[],c=0;c>>24]]^d[o[l>>>16&255]]^p[o[l>>>8&255]]^h[o[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,l,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,s,a){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f>>24]^o[u>>>16&255]^i[d>>>8&255]^s[255&p]^n[h++],g=r[u>>>24]^o[d>>>16&255]^i[p>>>8&255]^s[255&l]^n[h++],_=r[d>>>24]^o[p>>>16&255]^i[l>>>8&255]^s[255&u]^n[h++],y=r[p>>>24]^o[l>>>16&255]^i[u>>>8&255]^s[255&d]^n[h++];l=m,u=g,d=_,p=y}m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^n[h++],g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&l])^n[h++],_=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^n[h++],y=(a[p>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],e[t]=m,e[t+1]=g,e[t+2]=_,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)},8976:function(e,t,n){var r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w;e.exports=(r=n(8112),n(6165),void(r.lib.Cipher||(o=r,i=o.lib,s=i.Base,a=i.WordArray,c=i.BufferedBlockAlgorithm,l=o.enc,l.Utf8,u=l.Base64,d=o.algo.EvpKDF,p=i.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?w:v}return function(t){return{encrypt:function(n,r,o){return e(r).encrypt(t,n,r,o)},decrypt:function(n,r,o){return e(r).decrypt(t,n,r,o)}}}}()}),i.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),h=o.mode={},f=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=h.CBC=function(){var e=f.extend();function t(e,t,n){var r,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var i=0;i>>2];e.sigBytes-=t}},i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:m,padding:g}),reset:function(){var e;p.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),_=i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(o.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?a.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),_.create({ciphertext:n,salt:t})}},v=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r),i=o.finalize(t),s=o.cfg;return _.create({ciphertext:i,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(o.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var o=d.create({keySize:t+n}).compute(e,r),i=a.create(o.words.slice(t),4*n);return o.sigBytes=4*t,_.create({key:o,iv:i,salt:r})}},w=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:b}),encrypt:function(e,t,n,r){var o=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=o.iv;var i=v.encrypt.call(this,e,t,o.key,r);return i.mixIn(o),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var o=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=o.iv,v.decrypt.call(this,e,t,o.key,r)}}))))},8112:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r)try{r=n(6113)}catch(e){}var o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(i=0;i>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},p=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},h=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*c,i);if(c){for(var d=0;d>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},8559:function(e,t,n){var r;e.exports=(r=n(8112),function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(r,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(r,2*n)}}}(),r.enc.Utf16)},6165:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(1284),n(3456),i=(o=(r=u).lib).Base,s=o.WordArray,c=(a=r.algo).MD5,l=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),i=s.create(),a=i.words,c=r.keySize,l=r.iterations;a.lengthr&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,l=0;l>>2]|=e[o]<<24-o%4*8;t.call(this,r,n)}else t.apply(this,arguments)};n.prototype=e}}(),r.lib.WordArray)},4678:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,s=e[t+0],c=e[t+1],h=e[t+2],f=e[t+3],m=e[t+4],g=e[t+5],_=e[t+6],y=e[t+7],v=e[t+8],b=e[t+9],w=e[t+10],x=e[t+11],T=e[t+12],E=e[t+13],C=e[t+14],S=e[t+15],k=i[0],P=i[1],I=i[2],R=i[3];k=l(k,P,I,R,s,7,a[0]),R=l(R,k,P,I,c,12,a[1]),I=l(I,R,k,P,h,17,a[2]),P=l(P,I,R,k,f,22,a[3]),k=l(k,P,I,R,m,7,a[4]),R=l(R,k,P,I,g,12,a[5]),I=l(I,R,k,P,_,17,a[6]),P=l(P,I,R,k,y,22,a[7]),k=l(k,P,I,R,v,7,a[8]),R=l(R,k,P,I,b,12,a[9]),I=l(I,R,k,P,w,17,a[10]),P=l(P,I,R,k,x,22,a[11]),k=l(k,P,I,R,T,7,a[12]),R=l(R,k,P,I,E,12,a[13]),I=l(I,R,k,P,C,17,a[14]),k=u(k,P=l(P,I,R,k,S,22,a[15]),I,R,c,5,a[16]),R=u(R,k,P,I,_,9,a[17]),I=u(I,R,k,P,x,14,a[18]),P=u(P,I,R,k,s,20,a[19]),k=u(k,P,I,R,g,5,a[20]),R=u(R,k,P,I,w,9,a[21]),I=u(I,R,k,P,S,14,a[22]),P=u(P,I,R,k,m,20,a[23]),k=u(k,P,I,R,b,5,a[24]),R=u(R,k,P,I,C,9,a[25]),I=u(I,R,k,P,f,14,a[26]),P=u(P,I,R,k,v,20,a[27]),k=u(k,P,I,R,E,5,a[28]),R=u(R,k,P,I,h,9,a[29]),I=u(I,R,k,P,y,14,a[30]),k=d(k,P=u(P,I,R,k,T,20,a[31]),I,R,g,4,a[32]),R=d(R,k,P,I,v,11,a[33]),I=d(I,R,k,P,x,16,a[34]),P=d(P,I,R,k,C,23,a[35]),k=d(k,P,I,R,c,4,a[36]),R=d(R,k,P,I,m,11,a[37]),I=d(I,R,k,P,y,16,a[38]),P=d(P,I,R,k,w,23,a[39]),k=d(k,P,I,R,E,4,a[40]),R=d(R,k,P,I,s,11,a[41]),I=d(I,R,k,P,f,16,a[42]),P=d(P,I,R,k,_,23,a[43]),k=d(k,P,I,R,b,4,a[44]),R=d(R,k,P,I,T,11,a[45]),I=d(I,R,k,P,S,16,a[46]),k=p(k,P=d(P,I,R,k,h,23,a[47]),I,R,s,6,a[48]),R=p(R,k,P,I,y,10,a[49]),I=p(I,R,k,P,C,15,a[50]),P=p(P,I,R,k,g,21,a[51]),k=p(k,P,I,R,T,6,a[52]),R=p(R,k,P,I,f,10,a[53]),I=p(I,R,k,P,w,15,a[54]),P=p(P,I,R,k,c,21,a[55]),k=p(k,P,I,R,v,6,a[56]),R=p(R,k,P,I,S,10,a[57]),I=p(I,R,k,P,_,15,a[58]),P=p(P,I,R,k,E,21,a[59]),k=p(k,P,I,R,m,6,a[60]),R=p(R,k,P,I,x,10,a[61]),I=p(I,R,k,P,h,15,a[62]),P=p(P,I,R,k,b,21,a[63]),i[0]=i[0]+k|0,i[1]=i[1]+P|0,i[2]=i[2]+I|0,i[3]=i[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),s=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,o,i,s){var a=e+(t&n|~t&r)+o+s;return(a<>>32-i)+t}function u(e,t,n,r,o,i,s){var a=e+(t&r|n&~r)+o+s;return(a<>>32-i)+t}function d(e,t,n,r,o,i,s){var a=e+(t^n^r)+o+s;return(a<>>32-i)+t}function p(e,t,n,r,o,i,s){var a=e+(n^(t|~r))+o+s;return(a<>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)},8581:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,n,r){var o,i=this._iv;i?(o=i.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var s=0;s>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var a=s.slice(0);r.encryptBlock(a,0);for(var c=0;c>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)},7051:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(o-1)).concat(r.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)},6863:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)},6261:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},2864:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},r.pad.ZeroPadding)},9220:function(e,t,n){var r,o,i,s,a,c,l,u,d;e.exports=(d=n(8112),n(1284),n(3456),i=(o=(r=d).lib).Base,s=o.WordArray,c=(a=r.algo).SHA1,l=a.HMAC,u=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=l.create(n.hasher,e),o=s.create(),i=s.create([1]),a=o.words,c=i.words,u=n.keySize,d=n.iterations;a.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)r[o]^=n[o+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=p,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),r.RabbitLegacy)},5129:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],a=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)o[n]^=r[n+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(o[0]^=l,o[1]^=d,o[2]^=u,o[3]^=p,o[4]^=l,o[5]^=d,o[6]^=u,o[7]^=p,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),r.Rabbit)},3954:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var i=0;o<256;o++){var s=o%n,a=t[s>>>2]>>>24-s%4*8&255;i=(i+r[o]+a)%256;var c=r[o];r[o]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}e.RC4=t._createHelper(o);var s=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(),r.RC4)},3787:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=o.create([0,1518500249,1859775393,2400959708,2840853838]),p=o.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=i.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i,s,h,b,w,x,T,E,C,S,k,P=this._hash.words,I=d.words,R=p.words,O=a.words,A=c.words,N=l.words,D=u.words;for(x=i=P[0],T=s=P[1],E=h=P[2],C=b=P[3],S=w=P[4],n=0;n<80;n+=1)k=i+e[t+O[n]]|0,k+=n<16?f(s,h,b)+I[0]:n<32?m(s,h,b)+I[1]:n<48?g(s,h,b)+I[2]:n<64?_(s,h,b)+I[3]:y(s,h,b)+I[4],k=(k=v(k|=0,N[n]))+w|0,i=w,w=b,b=v(h,10),h=s,s=k,k=x+e[t+A[n]]|0,k+=n<16?y(T,E,C)+R[0]:n<32?_(T,E,C)+R[1]:n<48?g(T,E,C)+R[2]:n<64?m(T,E,C)+R[3]:f(T,E,C)+R[4],k=(k=v(k|=0,D[n]))+S|0,x=S,S=C,C=v(E,10),E=T,T=k;k=P[1]+h+C|0,P[1]=P[2]+b+S|0,P[2]=P[3]+w+x|0,P[3]=P[4]+i+T|0,P[4]=P[0]+s+E|0,P[0]=k},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,i=o.words,s=0;s<5;s++){var a=i[s];i[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function v(e,t){return e<>>32-t}t.RIPEMD160=i._createHelper(h),t.HmacRIPEMD160=i._createHmacHelper(h)}(Math),r.RIPEMD160)},1284:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(o=(r=u=n(8112)).lib,i=o.WordArray,s=o.Hasher,a=r.algo,c=[],l=a.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],l=0;l<80;l++){if(l<16)c[l]=0|e[t+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+a+c[l];d+=l<20?1518500249+(o&i|~o&s):l<40?1859775393+(o^i^s):l<60?(o&i|o&s|i&s)-1894007588:(o^i^s)-899497514,a=s,s=i,i=o<<30|o>>>2,o=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=s._createHelper(l),r.HmacSHA1=s._createHmacHelper(l),u.SHA1)},3816:function(e,t,n){var r,o,i,s,a,c;e.exports=(c=n(8112),n(2232),o=(r=c).lib.WordArray,i=r.algo,s=i.SHA256,a=i.SHA224=s.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=s._createHelper(a),r.HmacSHA224=s._createHmacHelper(a),c.SHA224)},2232:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(a[o]=n(e.pow(r,.5))),c[o]=n(e.pow(r,1/3)),o++),r++}();var l=[],u=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=0;h<64;h++){if(h<16)l[h]=0|e[t+h];else{var f=l[h-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,g=l[h-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+_+l[h-16]}var y=r&o^r&i^o&i,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&d)+c[h]+l[h];p=d,d=u,u=a,a=s+b|0,s=i,i=o,o=r,r=b+(v+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(u),t.HmacSHA256=i._createHmacHelper(u)}(Math),r.SHA256)},1455:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.x64.Word,a=t.algo,c=[],l=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var a=0,d=0,p=0;p<7;p++){if(1&o){var h=(1<>>24)|4278255360&(i<<24|i>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(P=n[o]).high^=s,P.low^=i}for(var a=0;a<24;a++){for(var p=0;p<5;p++){for(var h=0,f=0,m=0;m<5;m++)h^=(P=n[p+5*m]).high,f^=P.low;var g=d[p];g.high=h,g.low=f}for(p=0;p<5;p++){var _=d[(p+4)%5],y=d[(p+1)%5],v=y.high,b=y.low;for(h=_.high^(v<<1|b>>>31),f=_.low^(b<<1|v>>>31),m=0;m<5;m++)(P=n[p+5*m]).high^=h,P.low^=f}for(var w=1;w<25;w++){var x=(P=n[w]).high,T=P.low,E=c[w];E<32?(h=x<>>32-E,f=T<>>32-E):(h=T<>>64-E,f=x<>>64-E);var C=d[l[w]];C.high=h,C.low=f}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,p=0;p<5;p++)for(m=0;m<5;m++){var P=n[w=p+5*m],I=d[w],R=d[(p+1)%5+5*m],O=d[(p+2)%5+5*m];P.high=I.high^~R.high&O.high,P.low=I.low^~R.low&O.low}P=n[0];var A=u[a];P.high^=A.high,P.low^=A.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,l=[],u=0;u>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(p)}return new o.init(l,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=i._createHelper(p),t.HmacSHA3=i._createHmacHelper(p)}(Math),r.SHA3)},1007:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(8400),n(9039),o=(r=u).x64,i=o.Word,s=o.WordArray,a=r.algo,c=a.SHA512,l=a.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},9039:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,s=e.algo;function a(){return o.create.apply(o,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=a()}();var u=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=r.high,f=r.low,m=o.high,g=o.low,_=i.high,y=i.low,v=s.high,b=s.low,w=a.high,x=a.low,T=u.high,E=u.low,C=d.high,S=d.low,k=p.high,P=p.low,I=h,R=f,O=m,A=g,N=_,D=y,M=v,$=b,L=w,j=x,F=T,q=E,B=C,H=S,U=k,W=P,z=0;z<80;z++){var K,V,G=l[z];if(z<16)V=G.high=0|e[t+2*z],K=G.low=0|e[t+2*z+1];else{var J=l[z-15],X=J.high,Q=J.low,Y=(X>>>1|Q<<31)^(X>>>8|Q<<24)^X>>>7,Z=(Q>>>1|X<<31)^(Q>>>8|X<<24)^(Q>>>7|X<<25),ee=l[z-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,oe=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=l[z-7],se=ie.high,ae=ie.low,ce=l[z-16],le=ce.high,ue=ce.low;V=(V=(V=Y+se+((K=Z+ae)>>>0>>0?1:0))+re+((K+=oe)>>>0>>0?1:0))+le+((K+=ue)>>>0>>0?1:0),G.high=V,G.low=K}var de,pe=L&F^~L&B,he=j&q^~j&H,fe=I&O^I&N^O&N,me=R&A^R&D^A&D,ge=(I>>>28|R<<4)^(I<<30|R>>>2)^(I<<25|R>>>7),_e=(R>>>28|I<<4)^(R<<30|I>>>2)^(R<<25|I>>>7),ye=(L>>>14|j<<18)^(L>>>18|j<<14)^(L<<23|j>>>9),ve=(j>>>14|L<<18)^(j>>>18|L<<14)^(j<<23|L>>>9),be=c[z],we=be.high,xe=be.low,Te=U+ye+((de=W+ve)>>>0>>0?1:0),Ee=_e+me;U=B,W=H,B=F,H=q,F=L,q=j,L=M+(Te=(Te=(Te=Te+pe+((de+=he)>>>0>>0?1:0))+we+((de+=xe)>>>0>>0?1:0))+V+((de+=K)>>>0>>0?1:0))+((j=$+de|0)>>>0<$>>>0?1:0)|0,M=N,$=D,N=O,D=A,O=I,A=R,I=Te+(ge+fe+(Ee>>>0<_e>>>0?1:0))+((R=de+Ee|0)>>>0>>0?1:0)|0}f=r.low=f+R,r.high=h+I+(f>>>0>>0?1:0),g=o.low=g+A,o.high=m+O+(g>>>0>>0?1:0),y=i.low=y+D,i.high=_+N+(y>>>0>>0?1:0),b=s.low=b+$,s.high=v+M+(b>>>0<$>>>0?1:0),x=a.low=x+j,a.high=w+L+(x>>>0>>0?1:0),E=u.low=E+q,u.high=T+F+(E>>>0>>0?1:0),S=d.low=S+H,d.high=C+B+(S>>>0>>0?1:0),P=p.low=P+W,p.high=k+U+(P>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},9708:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=s[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var l=o[i]=[],u=c[i];for(n=0;n<24;n++)l[n/6|0]|=t[(a[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(a[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var d=this._invSubKeys=[];for(n=0;n<16;n++)d[n]=o[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),p.call(this,1,1431655765);for(var r=0;r<16;r++){for(var o=n[r],i=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=l[c][((s^o[c])&u[c])>>>0];this._lBlock=s,this._rBlock=i^a}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,p.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(f)}(),r.TripleDES)},8400:function(e,t,n){var r,o,i,s,a,c;e.exports=(r=n(8112),i=(o=r).lib,s=i.Base,a=i.WordArray,(c=o.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(9374)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},9374:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(6292):e.exports=n(4428)},4428:(e,t,n)=>{const r=n(6224),o=n(3837);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(6974);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=n(9374)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},1321:e=>{"use strict";e.exports=(e,t,n)=>{const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}},2784:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 1.0.0 < 2.0.0",patch:function(e){try{var s=new(0,n(8028).BasicTracer)(o.channel.spanContextPropagator?{scopeManager:o.channel.spanContextPropagator}:void 0),a=s.startSpan;s.startSpan=function(e,t){if(!t||!t.parent){var n=s.getCurrentSpan();n&&n.operation&&n.operation.traceparent&&(t=r({},t,{parent:{traceId:n.operation.traceparent.traceId,spanId:n.operation.traceparent.spanId}}))}var o=a.call(this,e,t);return o.addEvent("Application Insights Integration enabled"),o},s.addSpanProcessor(new i),s[t.AzureMonitorSymbol]=!0,e.setTracer(s)}catch(e){}return e}},t.enable=function(){o.channel.registerMonkeyPatch("@azure/core-tracing",t.azureCoreTracing)}},248:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:function(e){var t=e.prototype._emit;return e.prototype._emit=function(e,n){var o=t.apply(this,arguments);if(!n){var i=o;i||(i=t.call(this,e,!0)),r.channel.publish("bunyan",{level:e.level,result:i})}return o},e}},t.enable=function(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}},8159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2781);t.console={versionSpecifier:">= 4.0.0",patch:function(e){var t=new o.Writable,n=new o.Writable;t.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t}),!0},n.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t,stderr:!0}),!0};for(var i=new e.Console(t,n),s=function(t){var n=e[t];n&&(e[t]=function(){if(i[t])try{i[t].apply(i,arguments)}catch(e){}return n.apply(e,arguments)})},a=0,c=["log","info","warn","error","dir","time","timeEnd","trace","assert"];a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2784);t.azuresdk=r;var o=n(248);t.bunyan=o;var i=n(8159);t.console=i;var s=n(7834);t.mongodbCore=s;var a=n(4826);t.mongodb=a;var c=n(5856);t.mysql=c;var l=n(8345);t.pgPool=l;var u=n(7726);t.pg=u;var d=n(4765);t.redis=d;var p=n(1624);t.tedious=p;var h=n(8041);t.winston=h,t.enable=function(){o.enable(),i.enable(),s.enable(),a.enable(),c.enable(),u.enable(),l.enable(),d.enable(),h.enable(),r.enable(),p.enable()}},7834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.Server.prototype.connect;return e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.pool.write;this.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=r.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var o=this.s.pool.logout;return this.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=r.channel.bindToContext(arguments[1])),o.apply(this,arguments)},e},e}},t.enable=function(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore)}},4826:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 2.0.0 <= 3.0.5",patch:function(e){var t=e.instrument({operationIdGenerator:{next:function(){return o.channel.bindToContext((function(e){return e()}))}}}),n={};return t.on("started",(function(e){n[e.requestId]||(n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),e}},t.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:function(e){var t=e.instrument(),n={},i={};return t.on("started",(function(e){n[e.requestId]||(i[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete i[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete i[e.requestId])})),e}},t.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:function(e){!function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.coreTopology.s.pool.write;this.s.coreTopology.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=o.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var r=this.s.coreTopology.s.pool.logout;return this.s.coreTopology.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=o.channel.bindToContext(arguments[1])),r.apply(this,arguments)},e}}(e);var t=e.instrument(),n={},r={};return t.on("started",(function(e){n[e.requestId]||(r[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=e)})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete r[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete r[e.requestId])})),e}},t.enable=function(){o.channel.registerMonkeyPatch("mongodb",t.mongo2),o.channel.registerMonkeyPatch("mongodb",t.mongo3),o.channel.registerMonkeyPatch("mongodb",t.mongo330)}},5856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(1017);t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:function(e,t){var i=function(e,t){return function(t,n){var o=e[t];o&&(e[t]=function(){for(var e=arguments.length-1,t=arguments.length-1;t>=0;--t){if("function"==typeof arguments[t]){e=t;break}if(void 0!==arguments[t])break}var i=arguments[e],s={result:null,startTime:null,startDate:null};"function"==typeof i&&(n?(s.startTime=process.hrtime(),s.startDate=new Date,arguments[e]=r.channel.bindToContext(n(s,i))):arguments[e]=r.channel.bindToContext(i));var a=o.apply(this,arguments);return s.result=a,a})}},s=function(e,t){return i(e.prototype)},a=n(1055)(o.dirname(t)+"/lib/Connection");["connect","changeUser","ping","statistics","end"].forEach((function(e){return s(a)(e)})),i(a)("createQuery",(function(e,t){return function(n){var o=process.hrtime(e.startTime),i=1e3*o[0]+o[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:i,time:e.startDate}),t.apply(this,arguments)}}));var c=n(6990)(o.dirname(t)+"/lib/Pool");return["_enqueueCallback"].forEach((function(e){return s(c)(e)})),e}},t.enable=function(){r.channel.registerMonkeyPatch("mysql",t.mysql)}},8345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:function(e){var t=e.prototype.connect;return e.prototype.connect=function(e){return e&&(arguments[0]=r.channel.bindToContext(e)),t.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}},7726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2361);t.postgres6={versionSpecifier:"6.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},l=process.hrtime();function u(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(l);if(c.result=n&&{rowCount:n.rowCount,command:n.command},c.error=t,c.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",c),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(c.query.preparable={text:e,args:t},s=u(s)):(c.query.text=e,s?s=u(s):t=u(t)):("string"==typeof e.name?c.query.plan=e.name:e.values instanceof Array?c.query.preparable={text:e.text,args:e.values}:c.query.text=e.text,s?s=u(s):t?t=u(t):e.callback=u(e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments)},e}},t.postgres7={versionSpecifier:">=7.* <=8.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c=this,l=!!s,u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime();function p(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(d);if(u.result=n&&{rowCount:n.rowCount,command:n.command},u.error=t,u.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",u),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(u.query.preparable={text:e,args:t},s=(l="function"==typeof s)?p(s):s):(u.query.text=e,s?s=(l="function"==typeof s)?p(s):s:t=(l="function"==typeof t)?p(t):t):("string"==typeof e.name?u.query.plan=e.name:e.values instanceof Array?u.query.preparable={text:e.text,args:e.values}:u.query.text=e.text,s?(l="function"==typeof s,s=p(s)):t?t=(l="function"==typeof t)?p(t):t:(l="function"==typeof e.callback,e.callback=l?p(e.callback):e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments),l?a:a.then((function(e){return p()(void 0,e),new c._Promise((function(t,n){t(e)}))})).catch((function(e){return p()(e,void 0),new c._Promise((function(t,n){n(e)}))}))},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg",t.postgres6),r.channel.registerMonkeyPatch("pg",t.postgres7)}},4765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.RedisClient.prototype.internal_send_command;return e.RedisClient.prototype.internal_send_command=function(e){if(e){var n=e.callback;if(!n||!n.pubsubBound){var o=this.address,i=process.hrtime(),s=new Date;e.callback=r.channel.bindToContext((function(t,a){var c=process.hrtime(i),l=1e3*c[0]+c[1]/1e6|0;r.channel.publish("redis",{duration:l,address:o,commandObj:e,err:t,result:a,time:s}),"function"==typeof n&&n.apply(this,arguments)})),e.callback.pubsubBound=!0}}return t.call(this,e)},e}},t.enable=function(){r.channel.registerMonkeyPatch("redis",t.redis)}},1624:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 6.0.0 < 9.0.0",patch:function(e){var t=e.Connection.prototype.makeRequest;return e.Connection.prototype.makeRequest=function(){function e(e){var t=process.hrtime(),n={query:{},database:{host:null,port:null},result:null,error:null,duration:0};return o.channel.bindToContext((function(i,s,a){var c=process.hrtime(t);n=r({},n,{database:{host:this.connection.config.server,port:this.connection.config.options.port},result:!i&&{rowCount:s,rows:a},query:{text:this.parametersByName.statement.value},error:i,duration:Math.ceil(1e3*c[0]+c[1]/1e6)}),o.channel.publish("tedious",n),e.call(this,i,s,a)}))}var n=arguments[0];arguments[0].callback=e(n.callback),t.apply(this,arguments)},e}},t.enable=function(){o.channel.registerMonkeyPatch("tedious",t.tedious)}},8041:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);or[n]?o:n);this.add(new t(e,{level:n}))}var r=e.createLogger;e.createLogger=function(){var o,i=arguments[0].levels||e.config.npm.levels;for(var s in i)i.hasOwnProperty(s)&&(o=void 0===o||i[s]>i[o]?s:o);var a=r.apply(this,arguments);a.add(new t(e,{level:o}));var c=a.configure;return a.configure=function(){c.apply(this,arguments),n.apply(this,arguments)},a};var a=e.createLogger;return e.configure=function(){a.apply(this,arguments),n.apply(this,arguments)},e.add(new t(e)),e}},t.winston2={versionSpecifier:"2.x",patch:function(e){var t,n=e.Logger.prototype.log,r=function(n,r,o){var i;return i=t===e.config.npm.levels?"npm":t===e.config.syslog.levels?"syslog":"unknown",s.channel.publish("winston",{level:n,message:r,meta:o,levelKind:i}),r};return e.Logger.prototype.log=function(){return t=this.levels,this.filters&&0!==this.filters.length?this.filters[this.filters.length-1]!==r&&(this.filters=this.filters.filter((function(e){return e!==r})),this.filters.push(r)):this.filters=[r],n.apply(this,arguments)},e}},t.enable=function(){s.channel.registerMonkeyPatch("winston",t.winston2),s.channel.registerMonkeyPatch("winston",t.winston3)}},1055:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=1055,e.exports=t},6990:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=6990,e.exports=t},6932:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8497),o=n(8497);t.makePatchingRequire=o.makePatchingRequire;var i=function(e){return!0},s=function(){function e(){this.version=n(9674).i8,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.currentlyPublishing=!1}return e.prototype.shouldPublish=function(e){var t=this.subscribers[e];return!!t&&t.some((function(e){var t=e.filter;return!t||t(!1)}))},e.prototype.publish=function(e,t){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=!0,n.forEach((function(e){var t=e.listener,n=e.filter;try{n&&n(!0)&&t(r)}catch(e){}})),this.currentlyPublishing=!1}}},e.prototype.subscribe=function(e,t,n){void 0===n&&(n=i),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:t,filter:n})},e.prototype.unsubscribe=function(e,t,n){void 0===n&&(n=i);var r=this.subscribers[e];if(r)for(var o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1017),o=n(6190),i=n(8188),s=Object.keys(process.binding("natives")),a=i.prototype.require;t.makePatchingRequire=function(e){var t={};return function(n){var c=a.apply(this,arguments);if(e[n]){var l=i._resolveFilename(n,this);if(t.hasOwnProperty(l))return t[l];var u=void 0;if(s.indexOf(n)<0)try{u=a.call(this,r.join(n,"package.json")).version}catch(e){return c}else u=process.version.substring(1);var d=u.indexOf("-");d>=0&&(u=u.substring(0,d));for(var p=c,h=0,f=e[n];h{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var $=s++;i[$]="^"+i[D]+i[C]+"$";var L=s++;i[L]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var H=s++;i[H]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[H]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[L]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[U],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},7267:(e,t,n)=>{"use strict";var r=n(4403),o=r.wrap,i=r.unwrap,s="wrap@before";function a(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function c(e,t){var n;return n=e._events&&e._events[t],Array.isArray(n)||(n=n?[n]:[]),n}function l(e,t){if(e){var n=e;if("function"==typeof e)n=t(e);else if(Array.isArray(e)){n=[];for(var r=0;r0&&function(e,t){for(var n=t.length,r=0;r{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},1875:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return-1!==r&&(-1===o||r{"use strict";const t=new Set([200,203,204,206,300,301,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),r=new Set([500,502,503,504]),o={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},i={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function s(e){const t=parseInt(e,10);return isFinite(t)?t:0}function a(e){const t={};if(!e)return t;const n=e.trim().split(/\s*,\s*/);for(const e of n){const[n,r]=e.split(/\s*=\s*/,2);t[n]=void 0===r||r.replace(/^"|"$/g,"")}return t}function c(e){let t=[];for(const n in e){const r=e[n];t.push(!0===r?n:n+"="+r)}if(t.length)return t.join(", ")}e.exports=class{constructor(e,t,{shared:n,cacheHeuristic:r,immutableMinTimeToLive:o,ignoreCargoCult:i,_fromObject:s}={}){if(s)this._fromObject(s);else{if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=!1!==n,this._cacheHeuristic=void 0!==r?r:.1,this._immutableMinTtl=void 0!==o?o:864e5,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=a(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=a(e.headers["cache-control"]),i&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!n.has(this._status)||this._rescc["no-store"]||this._isShared&&this._rescc.private||this._isShared&&!this._noAuthorization&&!this._allowsStoringAuthenticated()||!(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=a(e.headers["cache-control"]);return!t["no-cache"]&&!/no-cache/.test(e.headers.pragma)&&(!(t["max-age"]&&this.age()>t["max-age"])&&(!(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"])&&(!(this.stale()&&(!t["max-stale"]||this._rescc["must-revalidate"]||!(!0===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge())))&&this._requestMatches(e,!1))))}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){const t={};for(const n in e)o[n]||(t[n]=e[n]);if(e.connection){const n=e.connection.trim().split(/\s*,\s*/);for(const e of n)delete t[e]}if(t.warning){const e=t.warning.split(/,/).filter((e=>!/^\s*1[0-9][0-9]/.test(e)));e.length?t.warning=e.join(",").trim():delete t.warning}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){const e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return s(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"])return 0;if(this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)return 0;if("*"===this._resHeaders.vary)return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return s(this._rescc["s-maxage"])}if(this._rescc["max-age"])return s(this._rescc["max-age"]);const e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){const n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){const e=this.maxAge()-this.age(),t=e+s(this._rescc["stale-if-error"]),n=e+s(this._rescc["stale-while-revalidate"]);return 1e3*Math.max(0,e,t,n)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+s(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+s(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||1!==e.v)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=void 0!==e.imm?e.imm:864e5,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete t["if-modified-since"],t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter((e=>!/^\s*W\//.test(e)));e.length?t["if-none-match"]=e.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&function(e){return!e||r.has(e.status)}(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let n=!1;if(void 0!==t.status&&304!=t.status?n=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===t.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||t.headers.etag||t.headers["last-modified"]||(n=!0),!n)return{policy:new this.constructor(e,t),modified:304!=t.status,matches:!1};const o={};for(const e in this._resHeaders)o[e]=e in t.headers&&!i[e]?t.headers[e]:this._resHeaders[e];const s=Object.assign({},t,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}},7546:(e,t,n)=>{"use strict";const r=n(7147);let o;e.exports=()=>(void 0===o&&(o=function(){try{return r.statSync("/.dockerenv"),!0}catch(e){return!1}}()||function(){try{return r.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return!1}}()),o)},7684:(e,t,n)=>{"use strict";const r=n(2037),o=n(7147),i=n(7546),s=()=>{if("linux"!==process.platform)return!1;if(r.release().toLowerCase().includes("microsoft"))return!i();try{return!!o.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!i()}catch(e){return!1}};process.env.__IS_WSL_TEST__?e.exports=s:e.exports=s()},5127:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,o,i,s,a,c,l,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in r(i,s,a,c,l,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in t.arrayKeywords)for(var f=0;f{var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,s){s=s||{};var a,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=o?i(a,c,o,"day"):c>=r?i(a,c,r,"hour"):c>=n?i(a,c,n,"minute"):c>=t?i(a,c,t,"second"):a+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},1814:(e,t,n)=>{const r=n(1017),o=n(2081),{promises:i,constants:s}=n(7147),a=n(7684),c=n(7546),l=n(1321),u=r.join(__dirname,"xdg-open"),{platform:d,arch:p}=process,h=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await i.access(n,s.F_OK),r=!0}catch{}if(!r)return e;const o=await i.readFile(n,{encoding:"utf8"}),a=/(?.*)/g.exec(o);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),f=async(e,t)=>{let n;for(const r of e)try{return await t(r)}catch(e){n=e}throw n},m=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return f(e.app,(t=>m({...e,app:t})));let t,{name:n,arguments:r=[]}=e.app||{};if(r=[...r],Array.isArray(n))return f(n,(t=>m({...e,app:{name:t,arguments:r}})));const l=[],p={};if("darwin"===d)t="open",e.wait&&l.push("--wait-apps"),e.background&&l.push("--background"),e.newInstance&&l.push("--new"),n&&l.push("-a",n);else if("win32"===d||a&&!c()){const o=await h();t=a?`${o}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,l.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),a||(p.windowsVerbatimArguments=!0);const i=["Start"];e.wait&&i.push("-Wait"),n?(i.push(`"\`"${n}\`""`,"-ArgumentList"),e.target&&r.unshift(e.target)):e.target&&i.push(`"${e.target}"`),r.length>0&&(r=r.map((e=>`"\`"${e}\`""`)),i.push(r.join(","))),e.target=Buffer.from(i.join(" "),"utf16le").toString("base64")}else{if(n)t=n;else{const e="/"===__dirname;let n=!1;try{await i.access(u,s.X_OK),n=!0}catch{}t=process.versions.electron||"android"===d||e||!n?"xdg-open":u}r.length>0&&l.push(...r),e.wait||(p.stdio="ignore",p.detached=!0)}e.target&&l.push(e.target),"darwin"===d&&r.length>0&&l.push("--args",...r);const g=o.spawn(t,l,p);return e.wait?new Promise(((t,n)=>{g.once("error",n),g.once("close",(r=>{e.allowNonzeroExitCode&&r>0?n(new Error(`Exited with code ${r}`)):t(g)}))})):(g.unref(),g)},g=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return m({...t,target:e})};function _(e){if("string"==typeof e||Array.isArray(e))return e;const{[p]:t}=e;if(!t)throw new Error(`${p} is not supported`);return t}function y({[d]:e},{wsl:t}){if(t&&a)return _(t);if(!e)throw new Error(`${d} is not supported`);return _(e)}const v={};l(v,"chrome",(()=>y({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}))),l(v,"firefox",(()=>y({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}))),l(v,"edge",(()=>y({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}))),g.apps=v,g.openApp=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `name`");const{arguments:n=[]}=t||{};if(null!=n&&!Array.isArray(n))throw new TypeError("Expected `appArguments` as Array type");return m({...t,app:{name:e,arguments:n}})},e.exports=g},4403:e=>{"use strict";function t(e){return"function"==typeof e}var n=console.error.bind(console);function r(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function o(e){e&&e.logger&&(t(e.logger)?n=e.logger:n("new logger isn't a function, not replacing"))}function i(e,o,i){if(e&&e[o]){if(!i)return n("no wrapper function"),void n((new Error).stack);if(t(e[o])&&t(i)){var s=e[o],a=i(s,o);return r(a,"__original",s),r(a,"__unwrap",(function(){e[o]===a&&r(e,o,s)})),r(a,"__wrapped",!0),r(e,o,a),a}n("original object and wrapper must be functions")}else n("no original function "+o+" to wrap")}function s(e,t){return e&&e[t]?e[t].__unwrap?e[t].__unwrap():void n("no original to unwrap to -- has "+t+" already been unwrapped?"):(n("no function to unwrap."),void n((new Error).stack))}o.wrap=i,o.massWrap=function(e,t,r){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){i(e,t,r)}))})):n("must provide one or more functions to wrap on modules")},o.unwrap=s,o.massUnwrap=function(e,t){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){s(e,t)}))})):n("must provide one or more functions to unwrap on modules")},e.exports=o},3031:e=>{e.exports=function(e,t){var n=[];n.push(function(e){try{return Error.prototype.toString.call(e)}catch(e){try{return""}catch(e){return""}}}(e));for(var r=0;r"}catch(e){o=""}}n.push(" at "+o)}return n.join("\n")}},6818:(e,t,n)=>{if(global._stackChain){if(global._stackChain.version!==n(735).i8)throw new Error("Conflicting version of stack-chain found");e.exports=global._stackChain}else e.exports=global._stackChain=n(2396)},2396:(e,t,n)=>{var r=n(3031);function o(){this.extend=new a,this.filter=new a,this.format=new c,this.version=n(735).i8}var i=!1;o.prototype.callSite=function e(t){t||(t={}),i=!0;var n={};Error.captureStackTrace(n,e);var r=n.stack;return i=!1,r=r.slice(t.slice||0),t.extend&&(r=this.extend._modify(n,r)),t.filter&&(r=this.filter._modify(n,r)),r};var s=new o;function a(){this._modifiers=[]}function c(){this._formater=r,this._previous=void 0}a.prototype._modify=function(e,t){for(var n=0,r=this._modifiers.length;n{"use strict";const r=n(2037),o=n(1875),i=process.env;let s;function a(e){const t=function(e){if(!1===s)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!e.isTTY&&!0!==s)return 0;const t=s?1:0;if("win32"===process.platform){const e=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||"codeship"===i.CI_NAME?1:t;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}o("no-color")||o("no-colors")||o("color=false")?s=!1:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(s=!0),"FORCE_COLOR"in i&&(s=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},3406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GitHubDeviceFlow=void 0;const r=n(9800),o=n(39),i="Iv1.b507a08c87ecfe98";async function s(e,t){const n={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4};return e.get(o.Fetcher).fetch("https://github.com/login/oauth/access_token",n).then((e=>e.json()))}async function a(e,t){return e.get(o.Fetcher).fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}}).then((e=>e.json()))}t.GitHubDeviceFlow=class{async getToken(e){const t=await async function(e){const t={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,scope:"read:user"},timeout:3e4},n=e.get(o.Fetcher).fetch("https://github.com/login/device/code",t);return(await n).json()}(e),n=new Promise((async(n,r)=>{let o,i=t.expires_in;for(;i>0;){const r=await s(e,t.device_code);if(i-=t.interval,await new Promise((e=>setTimeout(e,1e3*t.interval))),o=r.access_token,o)return void n({user:(await a(e,o)).login,oauth_token:o})}r("Timed out waiting for login to complete")}));return{...t,waitForAuth:n}}}},9321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestContext=t.AuthManager=void 0;const r=n(5765),o=n(150),i=n(5611),s=n(5381);class a{constructor(e,t){this.persistenceManager=e,this.mkTokenManager=t,this._pendingSignIn=void 0}getCopilotTokenManager(){return this._copilotTokenManager}setPendingSignIn(e){this._pendingSignIn=e}getPendingSignIn(){return this._pendingSignIn}async checkAndUpdateStatus(e,t){var n;const r=null!==(n=null==t?void 0:t.localChecksOnly)&&void 0!==n&&n;let o;if("true"===process.env.CODESPACES&&process.env.GITHUB_TOKEN&&(o={user:process.env.GITHUB_USER||"codespace-user",oauth_token:process.env.GITHUB_TOKEN}),void 0===o&&(o=await this.getAuthRecord()),void 0===o)return this._copilotTokenManager=void 0,{status:"NotSignedIn"};if(r)return{status:"MaybeOK",user:o.user};const i={token:o.oauth_token};o.dev_override&&(i.devOverride={copilotTokenUrl:o.dev_override.copilot_token_url,notificationUrl:o.dev_override.notification_url});const s=this.mkTokenManager(i),a=await s.checkCopilotToken(e);return"status"in a?"unconfigured"===a.telemetry&&!1===await this.getTelemetryConsent(o.user)?(this._copilotTokenManager=void 0,{status:"NoTelemetryConsent",user:o.user}):(this._copilotTokenManager=s,{status:"OK",user:o.user}):(this._copilotTokenManager=void 0,{status:"HTTP401"===a.reason?"NotSignedIn":a.reason,user:o.user})}async getAuthRecord(){return await this.persistenceManager.read("hosts","github.com")}async setAuthRecord(e){await this.persistenceManager.update("hosts","github.com",e)}async deleteAuthRecord(){await this.persistenceManager.delete("hosts","github.com")}async getTelemetryConsent(e){const t=await this.persistenceManager.read("terms",e);return!(!(null==t?void 0:t.version)||t.version!==o.LAST_TELEMETRY_TERMS_UPDATE)}async recordTelemetryConsent(e){await this.persistenceManager.update("terms",e,{version:o.LAST_TELEMETRY_TERMS_UPDATE})}}t.AuthManager=a,t.createRequestContext=async function(e,t){let n=t;if(void 0===n&&(n=e.get(a).getCopilotTokenManager()),void 0===n){const t=await e.get(a).checkAndUpdateStatus(e);if("OK"!==t.status)return{code:s.ErrorCode.NoCopilotToken,message:`Not authenticated: ${t.status}`};if(n=e.get(a).getCopilotTokenManager(),void 0===n)return{code:s.ErrorCode.InternalError,message:"Unexpected missing Copilot token"}}const o=new i.Context(e);return o.set(r.CopilotTokenManager,n),o}},9582:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.MergedToken=void 0;const n=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}})),r=Object.freeze({isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),o=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n});class i{constructor(){this._isCancelled=!1,this.handlers=[]}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}get isCancellationRequested(){return this._isCancelled}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}dispose(){this.handlers=[]}}t.MergedToken=class{constructor(e){this.tokens=[],this.handlers=[],this._isCancelled=!1,this.tokens=e,this._isCancelled=e.some((e=>e.isCancellationRequested)),e.forEach((e=>{e.onCancellationRequested(this.cancel,this)}))}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}dispose(){this.tokens=[]}get isCancellationRequested(){return this.tokens.some((e=>e.isCancellationRequested))}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}},t.CancellationTokenSource=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new i),this._token}cancel(){this._token?this._token instanceof i&&this._token.cancel():this._token=o}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof i&&this._token.dispose():this._token=r}}},8212:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.extensions=t.workspace=t.env=t.UIKind=t.EndOfLine=void 0,(r=t.EndOfLine||(t.EndOfLine={}))[r.LF=1]="LF",r[r.CRLF=2]="CRLF",function(e){e[e.Web=0]="Web",e[e.Desktop=1]="Desktop"}(n=t.UIKind||(t.UIKind={})),t.env={isTelemetryEnabled:!0,uiKind:n.Desktop,appRoot:"/non-existent-path"},t.workspace={onDidChangeConfiguration:()=>{},getConfiguration:()=>({})},t.extensions={getExtension:e=>{}}},3895:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentEditorInfo=t.AgentConfigProvider=void 0;const r=n(9800);class o extends r.InMemoryConfigProvider{constructor(){super(new r.DefaultsOnlyConfigProvider,new Map)}getOptionalConfig(e){if(!Array.isArray(e)||"editor"!=e[0]||this.isDefaultSettingOverwritten(e))return super.getConfig(e)}}t.AgentConfigProvider=o;class i extends r.EditorAndPluginInfo{setEditorAndPluginInfo(e,t){this._editorInfo=e,this._editorPluginInfo=t}getEditorInfo(e){return this._editorInfo?this._editorInfo:{name:"unknown-editor",version:"0"}}getEditorPluginInfo(e){return this._editorPluginInfo?this._editorPluginInfo:{name:"unknown-editor-plugin",version:"0"}}}t.AgentEditorInfo=i},3007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotCompletionCache=void 0;const r=n(140);class o extends r.LRUCache{constructor(e=100){super(e)}}t.CopilotCompletionCache=o},9841:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationLogger=void 0;const r=n(7089),o=n(5798),i=n(7214);class s extends o.LogTarget{constructor(e){super(),this.debugMode=e}logIt(e,t,n,...s){const a={level:t,message:`${n} ${s.map(o.toPlainText)}`,metadataStr:n,extra:s.map(o.toPlainText)};e.get(i.AgentNotificationSender).sendNotification(new r.NotificationType("LogMessage"),a)}shouldLog(e,t){return!!this.debugMode||t>o.LogLevel.DEBUG}}t.NotificationLogger=s},1926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationStatusReporter=void 0;const r=n(7089),o=n(7214);t.NotificationStatusReporter=class{constructor(e){this.ctx=e,this.notificationEndpoint="statusNotification",this.status="Normal"}setProgress(){"Error"!==this.status&&(this.status="InProgress",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"InProgress",message:""}))}removeProgress(){"Error"!==this.status&&"Warning"!==this.status&&(this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""}))}forceNormal(){this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""})}setWarning(){"Error"!==this.status&&(this.status="Warning",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Warning",message:""}))}setError(e){this.status="Error";const t={status:"Error",message:e};this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),t)}}},6021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.agentFileSystem=void 0;const r=n(7147);t.agentFileSystem={readFile:function(e){return r.promises.readFile(e)},mtime:async function(e){return(await r.promises.stat(e)).mtimeMs},stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},9729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sessionId=t.getMachineId=void 0;const r=n(6113),o=n(2037),i=n(7057),s=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function a(e){const t=e.replace(/-/g,":").toLowerCase();return!s.has(t)}let c;t.getMachineId=function(){if(!c){const e=function(){try{const e=function(){const e=(0,o.networkInterfaces)();for(const t in e){const n=e[t];if(n)for(const{mac:e}of n)if(a(e))return e}throw new Error("Unable to retrieve mac address (unexpected format)")}();return r.createHash("sha256").update(e,"utf8").digest("hex")}catch(e){return}}();c=e||i.v4()}return c},t.sessionId=i.v4()+Date.now()},6995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.initializeLateDependencies=t.init=void 0;const r=n(4617),o=n(5765),i=n(2137),s=n(9800),a=n(5611),c=n(446),l=n(6905),u=n(6046),d=n(6817),p=n(4619),h=n(5798),f=n(39),m=n(598),g=n(5489),_=n(913),y=n(2369),v=n(4567),b=n(3406),w=n(9321),x=n(3895),T=n(3007),E=n(6021),C=n(9729),S=n(5332),k=n(585),P=n(2401);t.init=function(){const e=new a.Context;e.set(i.Clock,new i.Clock),e.set(s.ConfigProvider,new x.AgentConfigProvider),e.set(s.BuildInfo,new s.BuildInfo),function(e){e.set(_.RuntimeMode,_.RuntimeMode.fromEnvironment(!1)),e.set(h.LogVerbose,new h.LogVerbose((0,_.isVerboseLoggingEnabled)(e))),e.set(h.LogTarget,new h.ConsoleLog(console))}(e),t.logger.debug(e,"Initializing agent"),e.set(u.ExpConfigMaker,new u.ExpConfigNone);const n=(0,k.makeXdgPersistenceManager)();e.set(k.PersistenceManager,n);const I=new w.AuthManager(n,(e=>new o.CopilotTokenManagerFromGitHubToken(e)));e.set(b.GitHubDeviceFlow,new b.GitHubDeviceFlow),e.set(w.AuthManager,I);const R=new s.VscInfo(C.sessionId,(0,C.getMachineId)(),(0,s.getVersion)(e));return e.set(s.VscInfo,R),e.set(s.EditorAndPluginInfo,new x.AgentEditorInfo),e.set(p.GhostTextDebounceManager,new p.GhostTextDebounceManager),e.set(d.ContextualFilterManager,new d.ContextualFilterManager),e.set(f.Fetcher,new f.HelixFetcher(e)),e.set(m.OpenAIFetcher,new m.LiveOpenAIFetcher),e.set(v.UrlOpener,new v.RealUrlOpener),e.set(s.BlockModeConfig,new s.ConfigBlockModeConfig),e.set(S.MethodHandlers,(0,S.getAllMethods)()),e.set(S.NotificationHandlers,(0,S.getAllNotifications)()),e.set(T.CopilotCompletionCache,new T.CopilotCompletionCache),e.set(y.LocationFactory,new P.AgentLocationFactory),e.set(l.Features,new l.Features(e)),e.set(r.FileSystem,E.agentFileSystem),e.set(g.TelemetryReporters,(0,g.setupEmptyReporters)()),(0,f.init)((0,s.getVersion)(e)),(0,c.registerDefaultHandlers)(e,"agent"),process.on("exit",(()=>{try{t.logger.debug(e,"Shutting down agent"),e.get(g.TelemetryReporters).deactivate()}catch(e){}})),e},t.initializeLateDependencies=function(e){e.set(g.TelemetryEndpointUrlOverride,g.telemetryEndpointUrlOverride),(0,g.setupStandardReporters)(e,"agent"),t.logger.debug(e,"Telemetry initialized")},t.logger=new h.Logger(h.LogLevel.DEBUG,"agent")},6934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(6159),c=r.Type.Object({options:r.Type.Optional(r.Type.Intersect([r.Type.Object({localChecksOnly:r.Type.Optional(r.Type.Boolean())}),a.TestingOptions]))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){var r;if(!l(n)){const e=(0,s.extractAjvErrors)(l.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,a.getTestingContext)(n.options.testingCtx)),[await e.get(i.AuthManager).checkAndUpdateStatus(e,n.options),null]}},3340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetCompletionsCycling=t.handleGetCompletions=void 0;const r=n(892),o=n(6236),i=n(7057),s=n(6630),a=n(5611),c=n(3993),l=n(702),u=n(1749),d=n(2369),p=n(9321),h=n(9582),f=n(3007),m=n(5381),g=n(7838),_=n(6159),y=n(2401),v=n(2930),b=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),insertSpaces:r.Type.Optional(r.Type.Boolean()),tabSize:r.Type.Optional(r.Type.Number()),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),options:r.Type.Optional(_.TestingOptions)}),w=(new o.default).compile(r.Type.Strict(b));let x;async function T(e,t,n,r,o){var b;x&&(x.cancel(),x.dispose()),x=new h.CancellationTokenSource;const T=new h.MergedToken([t,x.token]);if(!w(n)){const e=(0,m.extractAjvErrors)(w.errors);return[null,{code:m.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let E;void 0!==(null===(b=n.options)||void 0===b?void 0:b.testingCtx)&&(e=(0,_.getTestingContext)(n.options.testingCtx));try{E=e.get(v.CompletionDocuments)}catch(e){}if(E){const e=o?3:1;return[{completions:E.documents.slice(0,e).map((e=>{const{cursorLine:t,lines:r,start:o,end:s}=(0,g.parseChallengeDoc)(e,n.doc.position),a=[t.slice(Math.min(o.character,n.doc.position.character))].concat(r.slice(n.doc.position.line+1)).join("\n");return{uuid:i.v4(),text:a,displayText:a,position:n.doc.position,range:{start:o,end:s}}}))},null]}const C=await(0,p.createRequestContext)(e,r);if(!(C instanceof a.Context))return[null,C];const S=s.URI.parse(n.doc.uri);let k;try{k=await(0,y.getTextDocumentChecked)(e,S,n.doc)}catch(e){return[null,{code:m.ErrorCode.InvalidParams,message:e.message}]}const P=k.offsetAt(C.get(d.LocationFactory).position(n.doc.position.line,n.doc.position.character)),I=k.positionAt(P),R=await(0,l.getGhostText)(C,k,I,o,T),O=await(0,u.handleGhostTextResultTelemetry)(e,R);if(!O)return[{completions:[]},null];const[A,N]=O,D=(0,c.completionsFromGhostTextResults)(e,A,N,k,I,n.doc),M=e.get(f.CopilotCompletionCache);for(const e of D)M.put(e.uuid,e);return[{completions:D.map((e=>({uuid:e.uuid,text:e.text,range:e.range,displayText:e.displayText,position:e.position})))},null]}t.handleGetCompletions=async function(e,t,n,r){return T(e,t,n,r,!1)},t.handleGetCompletionsCycling=async function(e,t,n,r){return T(e,t,n,r,!0)}},9638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetPanelCompletions=void 0;const r=n(892),o=n(6236),i=n(6679),s=n(7057),a=n(5809),c=n(6630),l=n(9800),u=n(5611),d=n(5680),p=n(6317),h=n(5489),f=n(2369),m=n(9321),g=n(9582),_=n(7214),y=n(5381),v=n(7838),b=n(6159),w=n(2401),x=n(8730),T=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),panelId:r.Type.String(),options:r.Type.Optional(b.TestingOptions)}),E=(new o.default).compile(r.Type.Strict(T));class C{constructor(e,t,n,r,o){this.textDocument=e,this.startPosition=t,this.completionContext=n,this.solutionCountTarget=r,this.cancellationToken=o,this.savedTelemetryData=h.TelemetryData.createAndMarkAsIssued()}reportCancelled(){}getCancellationToken(){return this.cancellationToken}async getDocument(){return this.textDocument}}async function S(e,t,n,r,o){const s=await r;switch(s.status){case"Solution":n.sendNotification(new a.NotificationType("PanelSolution"),function(e,t,n){const r=(0,p.normalizeCompletionText)(n.completionText);return{panelId:e,range:t,completionText:n.completionText,displayText:n.displayText,score:n.meanProb,solutionId:(0,i.SHA256)(r).toString()}}(e,t,s.solution)),await S(e,t,n,s.next,o);break;case"FinishedNormally":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:e}),o();break;case"FinishedWithError":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"Error",message:s.error,panelId:e}),o()}}let k;t.handleGetPanelCompletions=async function(e,t,n,r,o){var i;k&&(k.cancel(),k.dispose()),k=new g.CancellationTokenSource;const a=new g.MergedToken([t,k.token]);if(!E(n)){const e=(0,y.extractAjvErrors)(E.errors);return[null,{code:y.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let h,T;void 0!==(null===(i=n.options)||void 0===i?void 0:i.testingCtx)&&(e=(0,b.getTestingContext)(n.options.testingCtx));const P=(0,l.getConfig)(e,l.ConfigKey.ListCount);let I;try{I=e.get(x.PanelCompletionDocuments)}catch(e){}if(I){const e=s.v4(),t=I.documents,r=async o=>{if(o>=P||o>=t.length)return{status:"FinishedNormally"};const{text:i,score:a}=t[o],{cursorLine:c,lines:l,start:u}=(0,v.parseChallengeDoc)(i,n.doc.position),d=[c.slice(Math.min(u.character,n.doc.position.character))].concat(l.slice(n.doc.position.line+1)).join("\n");return{status:"Solution",solution:{requestId:{headerRequestId:e,completionId:s.v4(),created:0,serverExperiments:"",deploymentId:""},completionText:d,displayText:d,meanProb:a,meanLogProb:-1,choiceIndex:o,prependToCompletion:""},next:r(o+1)}};T=n.doc.position,h=r(0)}else{const t=await(0,m.createRequestContext)(e,r);if(!(t instanceof u.Context))return[null,t];const o=c.URI.parse(n.doc.uri);let i;try{i=await(0,w.getTextDocumentChecked)(e,o,n.doc)}catch(e){return[null,{code:y.ErrorCode.InvalidParams,message:e.message}]}const s=i.offsetAt(t.get(f.LocationFactory).position(n.doc.position.line,n.doc.position.character));T=i.positionAt(s);const l=(0,d.completionContextForDocument)(e,i,T),g=new C(i,T,l,P,a);h=(0,p.launchSolutions)(t,g),e=t}return setImmediate((()=>S(n.panelId,e.get(f.LocationFactory).range(T,T),e.get(_.AgentNotificationSender),h,null!=o?o:()=>{}))),[{solutionCountTarget:P},null]}},1025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9800),s=n(5381),a=r.Type.Object({}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[{version:(0,i.getVersion)(e)},null]}},2389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(39),s=n(5381),a=r.Type.Object({url:r.Type.String(),method:r.Type.Optional(r.Type.String()),headers:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String())),body:r.Type.Optional(r.Type.String()),json:r.Type.Optional(r.Type.Any()),timeout:r.Type.Optional(r.Type.Number())}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r={};"method"in n&&(r.method=n.method),"body"in n&&(r.body=n.body),"json"in n&&(r.json=n.json);const o=n.timeout;null!=o&&(r.timeout=o),n.headers&&(r.headers=n.headers);try{const t=await e.get(i.Fetcher).fetch(n.url,r),o=await t.text();return[{status:t.status,statusText:t.statusText,headers:Object.fromEntries(t.headers),body:o},null]}catch(e){return[null,{code:s.ErrorCode.InternalError,message:e.message}]}}},5332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAllNotifications=t.NotificationHandlers=t.getAllMethods=t.MethodHandlers=void 0;const r=n(6934),o=n(3340),i=n(9638),s=n(1025),a=n(2389),c=n(5581),l=n(1382),u=n(1300),d=n(4885),p=n(9629),h=n(4489),f=n(1451),m=n(6656),g=n(1620),_=n(2530),y=n(8269),v=n(7803),b=n(2930),w=n(8730),x=n(2043),T=n(2229),E=n(8127);class C{constructor(e){this.handlers=e}}t.MethodHandlers=C,t.getAllMethods=function(){const e=new Map;return e.set("getCompletions",o.handleGetCompletions),e.set("getCompletionsCycling",o.handleGetCompletionsCycling),e.set("getPanelCompletions",i.handleGetPanelCompletions),e.set("httpRequest",a.default),e.set("getVersion",s.default),e.set("setEditorInfo",p.handleSetEditorInfo),e.set("checkStatus",r.default),e.set("signInInitiate",f.default),e.set("signInConfirm",h.default),e.set("signOut",m.default),e.set("recordTelemetryConsent",d.default),e.set("notifyShown",u.notifyShown),e.set("notifyAccepted",c.notifyAccepted),e.set("notifyRejected",l.notifyRejected),e.set("telemetry/exception",g.telemetryExceptionMethod),e.set("testing/createContext",y.default),e.set("testing/alwaysAuth",_.default),e.set("testing/neverAuth",v.default),e.set("testing/useTestingToken",T.default),e.set("testing/setCompletionDocuments",b.default),e.set("testing/setPanelCompletionDocuments",w.default),e.set("testing/triggerShowMessageRequest",x.default),e.set("debug/verifyState",E.handleVerifyState),e.set("debug/verifyWorkspaceState",E.handleVerifyWorkspaceState),new C(e)};class S{constructor(e){this.handlers=e}}t.NotificationHandlers=S,t.getAllNotifications=function(){const e=new Map;return new S(e)}},5581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyAccepted=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyAccepted=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=o.get(n.uuid);return l&&(o.deleteKey(n.uuid),(0,i.postInsertionTasks)(e,"ghostText",l.text,l.offset,l.file,l.telemetry)),["OK",null]}},4340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyNetworkProxyConfiguration=t.applySettingsToConfiguration=t.notifyChangeConfiguration=t.EditorConfigurationSettings=t.NetworkProxy=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(39),a=n(5381),c=n(6159);t.NetworkProxy=r.Type.Object({host:r.Type.String(),port:r.Type.Number(),username:r.Type.Optional(r.Type.String()),password:r.Type.Optional(r.Type.String())}),t.EditorConfigurationSettings=r.Type.Object({showEditorCompletions:r.Type.Optional(r.Type.Boolean()),enableAutoCompletions:r.Type.Optional(r.Type.Boolean()),delayCompletions:r.Type.Optional(r.Type.Boolean()),filterCompletions:r.Type.Optional(r.Type.Boolean()),disabledLanguages:r.Type.Optional(r.Type.Array(r.Type.Object({languageId:r.Type.String()})))});const l=r.Type.Object({settings:r.Type.Optional(t.EditorConfigurationSettings),networkProxy:r.Type.Optional(r.Type.Union([t.NetworkProxy,r.Type.Null()])),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));function d(e,t){const n=e.get(i.ConfigProvider);if(n.setConfig(i.ConfigKey.ShowEditorCompletions,t.showEditorCompletions),n.setConfig(i.ConfigKey.DelayCompletions,t.delayCompletions),n.setConfig(i.ConfigKey.EnableAutoCompletions,t.enableAutoCompletions),n.setConfig(i.ConfigKey.FilterCompletions,t.filterCompletions),t.disabledLanguages)for(const e of t.disabledLanguages)n.setLanguageEnablement(e.languageId,!1)}function p(e,t){if(!t)return void(e.get(s.Fetcher).proxySettings=void 0);let n;t.username&&(n=t.password?t.username+":"+t.password:t.username);const r=n?n+"@":"";process.env.http_proxy=`http://${r}${t.host}:${t.port}`,process.env.https_proxy=`http://${r}${t.host}:${t.port}`,e.get(s.Fetcher).proxySettings={host:t.host,port:t.port,proxyAuth:n,headers:{}}}t.notifyChangeConfiguration=function(e,t){var n;if(!u(t)){const e=(0,a.extractAjvErrors)(u.errors);throw new Error(`Invalid params: ${e.join(", ")}`)}void 0!==(null===(n=t.options)||void 0===n?void 0:n.testingCtx)&&(e=(0,c.getTestingContext)(t.options.testingCtx)),t.settings&&d(e,t.settings),void 0!==t.networkProxy&&p(e,t.networkProxy)},t.applySettingsToConfiguration=d,t.applyNetworkProxyConfiguration=p},1382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyRejected=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuids:r.Type.Array(r.Type.String()),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyRejected=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=n.uuids.flatMap((e=>{var t;return null!==(t=o.get(e))&&void 0!==t?t:[]}));if(l.length>0){const t=l[0];for(const e of n.uuids)o.deleteKey(e);const r=l.map((e=>({completionText:e.displayText,completionTelemetryData:e.telemetry})));(0,i.postRejectionTasks)(e,"ghostText",t.offset,t.file,r)}return["OK",null]}},1300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyShown=void 0;const r=n(892),o=n(6236),i=n(702),s=n(1749),a=n(3007),c=n(5381),l=n(6159),u=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(l.TestingOptions)}),d=(new o.default).compile(r.Type.Strict(u));t.notifyShown=async function(e,t,n){var r;if(!d(n)){const e=(0,c.extractAjvErrors)(d.errors);return[null,{code:c.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,l.getTestingContext)(n.options.testingCtx));const o=e.get(a.CopilotCompletionCache).get(n.uuid);if(o){const t=!(o.resultType===i.ResultType.Network);(0,s.telemetryShown)(e,"ghostText",o.telemetry,t)}return["OK",null]}},4885:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(i.AuthManager).getAuthRecord();return r?(e.get(i.AuthManager).recordTelemetryConsent(r.user),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]):[null,{code:s.ErrorCode.InvalidRequest,message:"Trying to record telemetry consent but the user is not signed in"}]}},9629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSetEditorInfo=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(6995),a=n(5381),c=n(4340),l=r.Type.Object({name:r.Type.String(),version:r.Type.String()}),u=r.Type.Object({editorInfo:l,editorPluginInfo:l,editorConfiguration:r.Type.Optional(c.EditorConfigurationSettings),networkProxy:r.Type.Optional(c.NetworkProxy),options:r.Type.Optional(r.Type.Object({}))}),d=(new o.default).compile(r.Type.Strict(u));t.handleSetEditorInfo=async function(e,t,n){if(!d(n)){const e=(0,a.extractAjvErrors)(d.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return e.get(i.EditorAndPluginInfo).setEditorAndPluginInfo(n.editorInfo,n.editorPluginInfo),n.editorConfiguration&&(0,c.applySettingsToConfiguration)(e,n.editorConfiguration),n.networkProxy&&(0,c.applyNetworkProxyConfiguration)(e,n.networkProxy),(0,s.initializeLateDependencies)(e),["OK",null]}},4489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(i.AuthManager).getPendingSignIn();if(void 0===r)return[null,{code:s.ErrorCode.InvalidRequest,message:"No pending sign in"}];let o;try{return o=await r,[o,null]}catch(e){return[null,{code:s.ErrorCode.DeviceFlowFailed,message:e.toString()}]}finally{e.get(i.AuthManager).setPendingSignIn(void 0)}}},1451:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(3406),s=n(9321),a=n(5381),c=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(s.AuthManager).checkAndUpdateStatus(e);if("OK"===r.status)return[{status:"AlreadySignedIn",user:r.user},null];const o=await e.get(i.GitHubDeviceFlow).getToken(e),c=o.waitForAuth.then((async t=>(await e.get(s.AuthManager).setAuthRecord(t),await e.get(s.AuthManager).checkAndUpdateStatus(e))));return e.get(s.AuthManager).setPendingSignIn(c),[{status:"PromptUserDeviceFlow",userCode:o.user_code,verificationUri:o.verification_uri,expiresIn:o.expires_in,interval:o.interval},null]}},6656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return await e.get(i.AuthManager).deleteAuthRecord(),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]}},1620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryExceptionMethod=void 0;const r=n(892),o=n(6236),i=n(5489),s=n(5381),a=r.Type.Object({origin:r.Type.String(),stacktrace:r.Type.Optional(r.Type.String()),properties:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String()))}),c=(new o.default).compile(r.Type.Strict(a));t.telemetryExceptionMethod=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=new Error("Original stacktrace: "+n.stacktrace);r.stack="";const o=n.properties||{};return await(0,i.telemetryException)(e,r,n.origin,o),["OK",null]}},2530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.AlwaysAuthManager),["OK",null]}},8269:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[(0,s.newTestingContext)(e),null]}},7803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.NotAuthManager),["OK",null]}},2930:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(r.Type.String()),options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));class l{constructor(e){this.documents=e}}t.CompletionDocuments=l,t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(l,new l(n.documents)),["OK",null]}},8730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PanelCompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({text:r.Type.String(),score:r.Type.Number()}),c=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(a),options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));class u{constructor(e){this.documents=e}}t.PanelCompletionDocuments=u,t.default=async function(e,t,n){if(!l(n)){const e=(0,i.extractAjvErrors)(l.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(u,new u(n.documents)),["OK",null]}},2043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5798),s=n(7214),a=n(5381),c=r.Type.Object({}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t){if(!l(t)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const n=e.get(s.AgentNotificationSender),r=e.get(i.LogTarget);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).catch((e=>o(i.LogLevel.ERROR,"error sending show message request",e))).then((e=>o(i.LogLevel.INFO,"response from message request",e.title))),["OK",null];async function o(t,n,o){return r.logIt(e,t,n+" ("+o+")",o)}}},2229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FakeAuthManager=void 0;const r=n(892),o=n(6236),i=n(5922),s=n(9321),a=n(5381),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));class d extends s.AuthManager{constructor(e){super(void 0,(t=>e)),this.tokenManager=e,this.user="user"}getCopilotTokenManager(){return this.tokenManager}async checkAndUpdateStatus(e,t){const n=await this.tokenManager.checkCopilotToken(e);return"status"in n?{status:"OK",user:this.user}:{status:"HTTP401"===n.reason?"NotSignedIn":n.reason,user:this.user}}}t.FakeAuthManager=d,t.default=async function(e,t,n){if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=(0,i.makeTestingCopilotTokenManager)();return(0,c.getTestingContext)(n.testingCtx).forceSet(s.AuthManager,new d(r)),["OK",null]}},8127:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleVerifyWorkspaceState=t.handleVerifyState=void 0;const r=n(892),o=n(6236),i=n(6630),s=n(819),a=n(5381),c=r.Type.Object({source:r.Type.String(),languageId:r.Type.String(),version:r.Type.Number(),uri:r.Type.String()}),l=(new o.default).compile(r.Type.Strict(c));t.handleVerifyState=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(s.TextDocumentManager),o=await r.getTextDocument(i.URI.parse(n.uri));return o?o.languageId!==n.languageId?[{status:!1,message:`Language id mismatch: [State] ${o.languageId} !== [Request] ${n.languageId}`},null]:o.getText()!==n.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${n.source}`},null]:o.version!==n.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${n.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: "${i.URI.parse(n.uri)}" (given by the editor: "${n.uri}")`},null]},t.handleVerifyWorkspaceState=async function(e,t,n){return[e.get(s.TextDocumentManager).workspaceFolders,null]}},7214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionNotificationSender=t.AgentNotificationSender=void 0;const r=n(9035);class o extends r.NotificationSender{}t.AgentNotificationSender=o,t.ConnectionNotificationSender=class extends o{constructor(e){super(),this.connection=e}sendNotification(e,t){this.connection.sendNotification(e,t)}showWarningMessage(e,...t){return this.connection.window.showWarningMessage(e,...t)}}},585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeXdgPersistenceManager=t.PersistenceManager=void 0;const r=n(7147),o=n(2037),i=n(7282);class s{constructor(e){this.directory=e}async read(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"});return JSON.parse(e)[t]}catch(e){return}}async update(e,t,n){await r.promises.mkdir(this.directory,{recursive:!0,mode:448});const o=`${this.directory}/${e}.json`;let i={};try{const e=await r.promises.readFile(o,{encoding:"utf8"});i=JSON.parse(e)}catch(e){}i[t]=n,await r.promises.writeFile(o,JSON.stringify(i)+"\n",{encoding:"utf8"})}async delete(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"}),o=JSON.parse(e);delete o[t],await r.promises.writeFile(n,JSON.stringify(o)+"\n",{encoding:"utf8"})}catch(e){}}}t.PersistenceManager=s,t.makeXdgPersistenceManager=function(){return new s(i.env.XDG_CONFIG_HOME?i.env.XDG_CONFIG_HOME+"/github-copilot":"win32"===(0,o.platform)()?i.env.USERPROFILE+"\\AppData\\Local\\github-copilot":i.env.HOME+"/.config/github-copilot")}},5381:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.extractAjvErrors=t.ErrorCode=void 0,(n=t.ErrorCode||(t.ErrorCode={}))[n.ParseError=-32700]="ParseError",n[n.InvalidRequest=-32600]="InvalidRequest",n[n.MethodNotFound=-32601]="MethodNotFound",n[n.InvalidParams=-32602]="InvalidParams",n[n.InternalError=-32603]="InternalError",n[n.NoCopilotToken=1e3]="NoCopilotToken",n[n.DeviceFlowFailed=1001]="DeviceFlowFailed",n[n.ContextNotInitialized=1002]="ContextNotInitialized",t.extractAjvErrors=function(e){return e.map((e=>`${e.instancePath} ${e.message}`))}},2879:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateCopilotService=t.createWrappedConnection=t.CopilotService=void 0;const r=n(7147),o=n(2781),i=n(7089),s=n(6630),a=n(5611),c=n(5225),l=n(5798),u=n(9035),d=n(6635),p=n(913),h=n(819),f=n(9841),m=n(1926),g=n(6995),_=n(5332),y=n(4340),v=n(7214),b=n(5381),w=n(540);class x{constructor(e,t){this.connection=t,this.initialized=!1,this.ctx=new a.Context(e);const n=new v.ConnectionNotificationSender(t);this.ctx.set(u.NotificationSender,n),this.ctx.set(v.AgentNotificationSender,n),this.ctx.set(d.StatusReporter,new m.NotificationStatusReporter(this.ctx));const r=new l.MultiLog([this.ctx.get(l.LogTarget),new f.NotificationLogger((0,p.isDebugEnabled)(this.ctx))]);this.ctx.forceSet(l.LogTarget,r),new l.Logger(l.LogLevel.DEBUG,"agent").debug(this.ctx,"Agent service starting"),t.onRequest(this.messageHandler.bind(this)),t.onNotification(this.notificationHandler.bind(this)),t.onInitialize((async e=>{var n,r,o,a;const l=null!==(r=null===(n=e.capabilities.workspace)||void 0===n?void 0:n.workspaceFolders)&&void 0!==r&&r;return this.ctx.set(h.TextDocumentManager,new w.AgentTextDocumentManager(t,null!==(a=null===(o=e.workspaceFolders)||void 0===o?void 0:o.map((e=>s.URI.parse(e.uri))))&&void 0!==a?a:[],!(0,p.isRunningInTest)(this.ctx)&&l)),(0,c.registerDocumentTracker)(this.ctx),this.initialized=!0,{capabilities:{textDocumentSync:{openClose:!0,change:i.TextDocumentSyncKind.Incremental},workspace:{workspaceFolders:{supported:l,changeNotifications:l}}}}})),t.onDidChangeConfiguration((async e=>{(0,y.notifyChangeConfiguration)(this.ctx,e)}))}async messageHandler(e,t,n){const r=this.ctx.get(_.MethodHandlers).handlers.get(e);if(!r)return new i.ResponseError(b.ErrorCode.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new i.ResponseError(b.ErrorCode.ContextNotInitialized,"Agent service not initialized.");Array.isArray(t)&&(t=t[0]);const[o,s]=await r(this.ctx,n,t);return s?new i.ResponseError(s.code,s.message,s.data):o}async notificationHandler(e,t){const n=this.ctx.get(_.NotificationHandlers).handlers.get(e);n&&(Array.isArray(t)&&(t=t[0]),await n(this.ctx,t))}listen(){this.connection.listen()}dispose(){this.connection.dispose()}}function T(e,t,n){let s=n;if(e.get(p.RuntimeMode).flags.recordInput){const e=Date.now().toString(),n=`stdin${e}.log`;t.on("data",(e=>{(0,r.appendFile)(n,e,(e=>{e&&console.error(e)}))}));const i=`stdout${e}.log`;a=s,c=e=>{(0,r.appendFile)(i,e,(e=>{e&&console.error(e)}))},s=new o.Writable({write:(e,t,n)=>(c(e.toString()),a.write(e,t,n))})}var a,c;return(0,i.createConnection)(i.ProposedFeatures.all,new i.StreamMessageReader(t),new i.StreamMessageWriter(s))}t.CopilotService=x,t.createWrappedConnection=T,t.CreateCopilotService=function(e){const t=(0,g.init)(),n=T(t,e,e);new x(t,n).listen()}},1728:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlwaysAuthManager=t.NotAuthManager=void 0;const r=n(5765),o=n(9321);class i extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"NotSignedIn"}}}t.NotAuthManager=i;class s extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"OK",user:"user"}}getCopilotTokenManager(){return new r.FixedCopilotTokenManager({token:"tid=valid-copilot-token",telemetry:"enabled"})}}t.AlwaysAuthManager=s},7838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseChallengeDoc=void 0,t.parseChallengeDoc=function(e,t){const n=e.split("\n");let r=t,o=t,i=n[t.line];const s=i.indexOf("%");-1!==s&&(i=i.substring(0,s)+i.substring(s+1),r={line:t.line,character:s});const a=i.indexOf("^");if(-1!==a){const e=i.indexOf("^",a+1);if(-1===e)throw new Error("Challenge document must contain zero or two ^ characters.");i=i.substring(0,a)+i.substring(a+1,e)+i.substring(e+1),r={line:t.line,character:t.character},o={line:t.line,character:t.character+e-a-1}}return{cursorLine:i,lines:n,start:r,end:o}}},6159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAgentTestingContext=t.setAgentTestEditorInfo=t.TestTextDocumentManager=t.getTestingContext=t.newTestingContext=t.TestingOptions=void 0;const r=n(4617),o=n(892),i=n(9800),s=n(5611),a=n(4630),c=n(2369),l=n(819),u=n(3895),d=n(3007),p=n(6021),h=n(2401),f=new Map;let m=0;t.TestingOptions=o.Type.Object({testingCtx:o.Type.Optional(o.Type.Number())}),t.newTestingContext=function(e){const t=m,n=new s.Context(e);return f.set(t,n),m++,t},t.getTestingContext=function(e){const t=f.get(e);if(void 0===t)throw new Error(`Testing context ${e} not found`);return t};class g extends l.TextDocumentManager{constructor(){super(...arguments),this._textDocuments=[],this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.onDidChangeTextDocument=()=>({dispose:()=>{}})}get textDocuments(){return this._textDocuments}async getTextDocument(e){return this.textDocuments.find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){}setTextDocument(e,t,n){this._textDocuments.push(new h.AgentTextDocument(e,t,0,n))}findNotebook(e){}}function _(e){const t=new u.AgentEditorInfo;t.setEditorAndPluginInfo({name:"agent-tests",version:"0"},{name:"agent-tests",version:"0"}),e.set(i.EditorAndPluginInfo,t)}t.TestTextDocumentManager=g,t.setAgentTestEditorInfo=_,t.createAgentTestingContext=function(){const e=new s.Context;e.set(i.ConfigProvider,new u.AgentConfigProvider),(0,a.setupTestingContext)(e),_(e),e.set(d.CopilotCompletionCache,new d.CopilotCompletionCache),e.set(c.LocationFactory,new h.AgentLocationFactory),e.set(l.TextDocumentManager,new g),e.set(i.BlockModeConfig,new i.ConfigBlockModeConfig);const t=new i.VscInfo("TestSessionId","TestMachineId","TestVscVersion");return e.set(i.VscInfo,t),e.set(r.FileSystem,p.agentFileSystem),e}},2401:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocument=t.getTextDocumentChecked=t.AgentLocationFactory=void 0;const r=n(2369),o=n(1674),i=n(6813),s=n(819);class a extends r.LocationFactory{range(e,t,n,r){return void 0!==n&&void 0!==r?o.Range.create(e,t,n,r):o.Range.create(e,t)}position(e,t){return o.Position.create(e,t)}}t.AgentLocationFactory=a,t.getTextDocumentChecked=async function(e,t,n){if(n&&n.source&&n.languageId){const e=new c(t,n.languageId,0,n.source);return n.relativePath&&(e.relativePath=n.relativePath),e}const r=e.get(s.TextDocumentManager);return await r.getTextDocument(t).then((e=>{if(!e){const e=r.textDocuments.map((e=>e.uri)).join(", ");throw new Error(`Couldn't find document for uri: ${t}, known document uris are: ${e}`)}return e}))};class c{constructor(e,t,n,r){this._uri=e,this._textDocument=i.TextDocument.create(e.toString(),t,n,r)}get uri(){return this._uri}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}get relativePath(){return this._relativePath}set relativePath(e){this._relativePath=e}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r=o.Range.create(o.Position.create(t,0),o.Position.create(t,n.length)),i=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:i}}getWordRangeAtPosition(e){}update(e,t){i.TextDocument.update(this._textDocument,e,t)}}t.AgentTextDocument=c},540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocumentManager=void 0;const r=n(2361),o=n(1017),i=n(5809),s=n(6630),a=n(819),c=n(2401);class l{constructor(){this.emitter=new r}create(e,t,n,r){return new c.AgentTextDocument(s.URI.parse(e),t,n,r)}update(e,t,n){const r=[];for(const n of t)if(i.TextDocumentContentChangeEvent.isIncremental(n)){const t={range:n.range,rangeOffset:e.offsetAt(n.range.start),rangeLength:e.offsetAt(n.range.end)-e.offsetAt(n.range.start),text:n.text};r.push(t)}const o={document:e,contentChanges:r};return this.emitter.emit("change",o),e.update(t,n),e}}class u extends a.TextDocumentManager{constructor(e,t,n){super(),this.connection=e,this.workspaceFolders=t,this.onDidChangeTextDocument=(e,t,n)=>{const r=e.bind(t);return this._textDocumentConfiguration.emitter.on("change",r),{dispose:()=>{this._textDocumentConfiguration.emitter.removeListener("change",r)}}},this.onDidFocusTextDocument=(e,t,n)=>(this.connection.onNotification("textDocument/didFocus",(n=>{const r=s.URI.parse(n.uri);e.call(t,{document:{uri:r}})})),{dispose:()=>{}}),this._textDocumentConfiguration=new l,this._textDocumentListener=new i.TextDocuments(this._textDocumentConfiguration),this._textDocumentListener.listen(e),n&&this.connection.workspace.onDidChangeWorkspaceFolders((e=>{e.added.forEach((e=>this.registerWorkspaceFolder(e))),e.removed.forEach((e=>this.unregisterWorkspaceFolder(e)))})),this.connection.onNotification("vs/didAddWorkspaceFolder",(e=>this.registerWorkspaceFolder(e))),this.connection.onNotification("vs/didRemoveWorkspaceFolder",(e=>this.unregisterWorkspaceFolder(e)))}unregisterWorkspaceFolder(e){const t=this.workspaceFolders.findIndex((t=>t.toString()===s.URI.parse(e.uri).toString()));t>=0&&this.workspaceFolders.splice(t,1)}registerWorkspaceFolder(e){this.workspaceFolders.push(s.URI.parse(e.uri))}get textDocuments(){return this._textDocumentListener.all()}async getTextDocument(e){return this._textDocumentListener.all().find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){var t,n;const r=e;return r.relativePath?r.relativePath:null!==(n=(0,a.getRelativePath)(null!==(t=this.workspaceFolders)&&void 0!==t?t:[],e.fileName))&&void 0!==n?n:o.basename(e.fileName)}findNotebook(e){}}t.AgentTextDocumentManager=u},5765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshToken=t.CopilotTokenManagerFromGitHubToken=t.FixedCopilotTokenManager=t.CopilotTokenManager=t.setTelemetryConfigFromTokenInfo=t.extractTrackingIdFromToken=t.authFromGitHubToken=t.nowSeconds=void 0;const r=n(9800),o=n(5798),i=n(39),s=n(9035),a=n(5489),c=n(4567),l=new o.Logger(o.LogLevel.INFO,"auth");let u=0;function d(){return Math.floor(Date.now()/1e3)}async function p(e,t){var n,o;(0,a.telemetry)(e,"auth.new_login");const s=null!==(o=null===(n=t.devOverride)||void 0===n?void 0:n.copilotTokenUrl)&&void 0!==o?o:"https://api.github.com/copilot_internal/v2/token",c=await e.get(i.Fetcher).fetch(s,{headers:{Authorization:`token ${t.token}`,...(0,r.editorVersionHeaders)(e)}});if(!c)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_failed"),{kind:"failure",reason:"FailedToGetToken"};const u=await c.json();if(!u)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_read_failed"),{kind:"failure",reason:"FailedToGetToken"};if(f(e,u.user_notification,t),401===c.status)return l.info(e,"Failed to get copilot token due to 401 status"),(0,a.telemetryError)(e,"auth.unknown_401"),{kind:"failure",reason:"HTTP401"};if(!c.ok||!u.token){l.info(e,`Invalid copilot token: missing token: ${c.status} ${c.statusText}`),(0,a.telemetryError)(e,"auth.invalid_token",a.TelemetryData.createAndMarkAsIssued({status:c.status.toString(),status_text:c.statusText}));const n=u.error_details;return f(e,n,t),{kind:"failure",reason:"NotAuthorized",...n}}const p=u.expires_at;return u.expires_at=d()+u.refresh_in+60,e.get(a.TelemetryReporters).setToken(u),g(u),(0,a.telemetry)(e,"auth.new_token",a.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:u.expires_at,expires_at:p,current_time:d()})),{kind:"success",...u}}t.nowSeconds=d,t.authFromGitHubToken=p;const h=new Map;function f(e,t,n){if(!t)return;const o=d();h.get(t.message)||(h.set(t.message,o),e.get(s.NotificationSender).showWarningMessage(t.message,{title:t.title},{title:"Dismiss"}).catch((t=>{console.error(t),l.error(e,`Error while sending notification: ${t.message}`)})).then((async o=>{const s=(null==o?void 0:o.title)===t.title,a=s||"Dismiss"===(null==o?void 0:o.title);if(s){const n=e.get(r.EditorAndPluginInfo).getEditorPluginInfo(e),o=t.url.replace("{EDITOR}",encodeURIComponent(n.name+"_"+n.version));await e.get(c.UrlOpener).open(o)}"notification_id"in t&&a&&await async function(e,t,n){var o,s;const a=null!==(s=null===(o=n.devOverride)||void 0===o?void 0:o.notificationUrl)&&void 0!==s?s:"https://api.github.com/copilot_internal/notification",c=await e.get(i.Fetcher).fetch(a,{headers:{Authorization:`token ${n.token}`,...(0,r.editorVersionHeaders)(e)},method:"POST",body:JSON.stringify({notification_id:t})});c&&c.ok||l.error(e,`Failed to send notification result to GitHub: ${null==c?void 0:c.status} ${null==c?void 0:c.statusText}`)}(e,t.notification_id,n)})))}function m(e){const t=null==e?void 0:e.split(":")[0],n=null==t?void 0:t.split(";");for(const e of n){const[t,n]=e.split("=");if("tid"===t)return n}}function g(e){const t=m(e.token);void 0!==t&&(0,a.setTelemetryConfig)({trackingId:t,optedIn:"enabled"===e.telemetry||"unconfigured"===e.telemetry})}t.extractTrackingIdFromToken=m,t.setTelemetryConfigFromTokenInfo=g;class _{}function y(e,t,n){const r=d();u>0||(u++,setTimeout((async()=>{let n,o="";try{u--,await t.getCopilotToken(e,!0),n="success"}catch(e){n="failure",o=e.toString()}const i=a.TelemetryData.createAndMarkAsIssued({result:n},{time_taken:d()-r,refresh_count:u});o&&(i.properties.reason=o),(0,a.telemetry)(e,"auth.token_refresh",i)}),1e3*n))}t.CopilotTokenManager=_,t.FixedCopilotTokenManager=class extends _{constructor(e){super(),this.tokenInfo=e,this.wasReset=!1,g(e)}async getCopilotToken(e,t){return this.tokenInfo.token}resetCopilotToken(e,t){this.wasReset=!0}async checkCopilotToken(e){return{status:"OK",telemetry:this.tokenInfo.telemetry}}},t.CopilotTokenManagerFromGitHubToken=class extends _{constructor(e){super(),this.githubToken=e,this.copilotToken=void 0}async getCopilotToken(e,t){var n;if(!this.copilotToken||this.copilotToken.expires_at{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TELEMETRY_TERMS_URL=t.LAST_TELEMETRY_TERMS_UPDATE=void 0,t.LAST_TELEMETRY_TERMS_UPDATE="2021-10-14",t.TELEMETRY_TERMS_URL="https://github.co/copilot-telemetry-terms"},5135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeTracker=void 0;const r=n(819);t.ChangeTracker=class{constructor(e,t,n){this._referenceCount=0,this._isDisposed=!1,this._offset=n;const o=e.get(r.TextDocumentManager);this._tracker=o.onDidChangeTextDocument((async e=>{if(e.document.uri===t)for(const t of e.contentChanges)if(t.rangeOffset+t.rangeLength<=this.offset){const e=t.text.length-t.rangeLength;this._offset=this._offset+e}}))}get offset(){return this._offset}push(e,t){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout((()=>{e(),this._referenceCount--,0===this._referenceCount&&(this._tracker.dispose(),this._isDisposed=!0)}),t)}}},2137:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Clock=void 0,t.Clock=class{now(){return new Date}}},140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.keyForPrompt=void 0;const r=n(6679);t.keyForPrompt=function(e){return(0,r.SHA256)(e.prefix+e.suffix).toString()},t.LRUCache=class{constructor(e=10){this.values=new Map,this.lruKeys=[],this.size=e}removeKeyFromLRU(e){const t=this.lruKeys.indexOf(e);-1!==t&&this.lruKeys.splice(t,1)}touchKeyInLRU(e){this.removeKeyFromLRU(e),this.lruKeys.push(e)}clear(){this.values.clear(),this.lruKeys=[]}deleteKey(e){this.removeKeyFromLRU(e),void 0!==this.values.get(e)&&this.values.delete(e)}get(e){if(this.values.has(e)){const t=this.values.get(e);return this.touchKeyInLRU(e),t}}put(e,t){let n=[];this.values.has(e)?n=[e]:this.lruKeys.length>=this.size&&(n=this.lruKeys.splice(0,1));for(const e of n)this.deleteKey(e);this.values.set(e,t),this.touchKeyInLRU(e)}}},3940:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=t.Debouncer=void 0,t.Debouncer=class{async debounce(e){return this.state&&(clearTimeout(this.state.timer),this.state.reject(),this.state=void 0),new Promise(((t,n)=>{this.state={timer:setTimeout((()=>t()),e),reject:n}}))}},t.debounce=function(e,t){let n;return(...r)=>(n&&clearTimeout(n),new Promise((o=>{n=setTimeout((()=>{const e=t(...r);o(e)}),e)})))}},1661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncIterableFromArray=t.asyncIterableMapFilter=t.asyncIterableFilter=t.asyncIterableMap=void 0,t.asyncIterableMap=async function*(e,t){for await(const n of e)yield t(n)},t.asyncIterableFilter=async function*(e,t){for await(const n of e)await t(n)&&(yield n)},t.asyncIterableMapFilter=async function*(e,t){for await(const n of e){const e=await t(n);void 0!==e&&(yield e)}},t.asyncIterableFromArray=async function*(e){for(const t of e)yield t}},9800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorVersionHeaders=t.EditorAndPluginInfo=t.formatNameAndVersion=t.getTestVscInfo=t.VscInfo=t.getVersion=t.getBuild=t.getBuildType=t.isProduction=t.BuildInfo=t.suffixMatchThreshold=t.suffixPercent=t.getEnabledConfig=t.getLanguageConfig=t.dumpConfig=t.getHiddenConfig=t.isDefaultSettingOverwritten=t.getConfig=t.getConfigDefaultForObjectKey=t.getConfigDefaultForKey=t.InMemoryConfigProvider=t.DefaultsOnlyConfigProvider=t.ConfigProvider=t.ConfigBlockModeConfig=t.BlockModeConfig=t.BuildType=t.BlockMode=t.ConfigKey=void 0;const r=n(4617),o=n(8139),i=n(6905),s=n(9876);var a,c;t.ConfigKey={Enable:"enable",InlineSuggestEnable:"inlineSuggest.enable",ShowEditorCompletions:["editor","showEditorCompletions"],EnableAutoCompletions:["editor","enableAutoCompletions"],DelayCompletions:["editor","delayCompletions"],FilterCompletions:["editor","filterCompletions"],DisplayStyle:["advanced","displayStyle"],SecretKey:["advanced","secret_key"],SolutionLength:["advanced","length"],Stops:["advanced","stops"],Temperature:["advanced","temperature"],TopP:["advanced","top_p"],IndentationMode:["advanced","indentationMode"],InlineSuggestCount:["advanced","inlineSuggestCount"],ListCount:["advanced","listCount"],DebugOverrideProxyUrl:["advanced","debug.overrideProxyUrl"],DebugTestOverrideProxyUrl:["advanced","debug.testOverrideProxyUrl"],DebugOverrideEngine:["advanced","debug.overrideEngine"],DebugShowScores:["advanced","debug.showScores"],DebugOverrideLogLevels:["advanced","debug.overrideLogLevels"],DebugFilterLogCategories:["advanced","debug.filterLogCategories"],DebugUseSuffix:["advanced","debug.useSuffix"],DebugAcceptSelfSignedCertificate:["advanced","debug.acceptSelfSignedCertificate"]},function(e){e.Parsing="parsing",e.Server="server"}(a=t.BlockMode||(t.BlockMode={})),(c=t.BuildType||(t.BuildType={})).DEV="dev",c.PROD="prod",c.NIGHTLY="nightly";class l{}t.BlockModeConfig=l,t.ConfigBlockModeConfig=class extends l{async forLanguage(e,n){if(e.get(u).isDefaultSettingOverwritten(t.ConfigKey.IndentationMode))switch(e.get(u).getLanguageConfig(t.ConfigKey.IndentationMode,n)){case"client":case!0:case"server":return a.Server;default:return a.Parsing}return await e.get(i.Features).overrideBlockMode()||((0,r.isSupportedLanguageId)(n)?a.Parsing:a.Server)}};class u{}function d(e){try{const t=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].default;if(void 0===t)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return t}catch(t){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}: ${t}`)}}function p(e,t){try{const n=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].properties[t].default;if(void 0===n)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return n}catch(n){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}.${t}: ${n}`)}}function h(e,t){return e.get(u).getConfig(t)}function f(e,t){return e.get(u).isDefaultSettingOverwritten(t)}function m(e,t,n){return f(e,t)?h(e,t):n.default}function g(e,t,n){return e.get(u).getLanguageConfig(t,n)}t.ConfigProvider=u,t.DefaultsOnlyConfigProvider=class extends u{getConfig(e){return Array.isArray(e)?p(e[0],e[1]):d(e)}isDefaultSettingOverwritten(e){return!1}dumpConfig(){return{}}getLanguageConfig(e,t){const n=this.getConfig(e);return t&&t in n?n[t]:n["*"]}},t.InMemoryConfigProvider=class{constructor(e,t){this.baseConfigProvider=e,this.overrides=t}getConfig(e){const t=this.overrides.get(e);return void 0!==t?t:this.baseConfigProvider.getConfig(e)}setConfig(e,t){void 0!==t?this.overrides.set(e,t):this.overrides.delete(e)}setLanguageEnablement(e,n){this.overrides.set(t.ConfigKey.Enable,{[e]:n})}isDefaultSettingOverwritten(e){return!!this.overrides.has(e)||this.baseConfigProvider.isDefaultSettingOverwritten(e)}keyAsString(e){return Array.isArray(e)?e.join("."):e}dumpConfig(){const e=this.baseConfigProvider.dumpConfig();return this.overrides.forEach(((t,n)=>{e[this.keyAsString(n)]=JSON.stringify(t)})),e}getLanguageConfig(e,t){const n=this.overrides.get(e);return void 0!==n?void 0!==t?n[t]:n["*"]:this.baseConfigProvider.getLanguageConfig(e,t)}},t.getConfigDefaultForKey=d,t.getConfigDefaultForObjectKey=p,t.getConfig=h,t.isDefaultSettingOverwritten=f,t.getHiddenConfig=m,t.dumpConfig=function(e){return e.get(u).dumpConfig()},t.getLanguageConfig=g,t.getEnabledConfig=function(e,n){return g(e,t.ConfigKey.Enable,n)},t.suffixPercent=async function(e,n,r){return m(e,t.ConfigKey.DebugUseSuffix,{default:!1})?15:e.get(i.Features).suffixPercent(n,r)},t.suffixMatchThreshold=async function(e,n,r){return m(e,t.ConfigKey.DebugUseSuffix,{default:!1})?20:e.get(i.Features).suffixMatchThreshold(n,r)};class _{constructor(){this.packageJson=s}isProduction(){return"dev"!=this.getBuildType()}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}}t.BuildInfo=_,t.isProduction=function(e){return e.get(_).isProduction()},t.getBuildType=function(e){return e.get(_).getBuildType()},t.getBuild=function(e){return e.get(_).getBuild()},t.getVersion=function(e){return e.get(_).getVersion()};class y{constructor(e,t,n){this.sessionId=e,this.machineId=t,this.vsCodeVersion=n}}function v({name:e,version:t}){return`${e}/${t}`}t.VscInfo=y,t.getTestVscInfo=function(){return new y("test-session-id","test-machine-id","test-vscode-version")},t.formatNameAndVersion=v;class b{}t.EditorAndPluginInfo=b,t.editorVersionHeaders=function(e){const t=e.get(b);return{"Editor-Version":v(t.getEditorInfo(e)),"Editor-Plugin-Version":v(t.getEditorPluginInfo(e))}}},8139:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotScheme=t.CopilotConfigPrefix=void 0,t.CopilotConfigPrefix="github.copilot",t.CopilotScheme="copilot"},5611:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0,t.Context=class{constructor(e){var t;this.baseContext=e,this.constructionStack=[],this.instances=new Map;const n=null===(t=(new Error).stack)||void 0===t?void 0:t.split("\n");n&&this.constructionStack.push(...n.slice(1))}get(e){const t=this.tryGet(e);if(t)return t;throw new Error(`No instance of ${e.name} has been registered.\n${this}`)}tryGet(e){return this.instances.get(e)||(this.baseContext?this.baseContext.tryGet(e):void 0)}set(e,t){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.instances.set(e,t)}forceSet(e,t){this.instances.set(e,t)}toString(){var e,t;let n=" Context created at:\n";for(const e of this.constructionStack||[])n+=` ${e}\n`;return n+=null!==(t=null===(e=this.baseContext)||void 0===e?void 0:e.toString())&&void 0!==t?t:"",n}get debug(){const e={};for(const[t,n]of this.instances)e[t.name]=n;return e}}},5680:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeLocation=t.encodeLocation=t.completionContextForDocument=t.CompletionContext=t.completionTypeToString=t.CompletionType=void 0;const r=n(6630),o=n(2369),i=n(8139);var s;!function(e){e[e.OPEN_COPILOT=2]="OPEN_COPILOT",e[e.TODO_QUICK_FIX=3]="TODO_QUICK_FIX",e[e.UNKNOWN_FUNCTION_QUICK_FIX=4]="UNKNOWN_FUNCTION_QUICK_FIX"}(s=t.CompletionType||(t.CompletionType={})),t.completionTypeToString=function(e){switch(e){case s.OPEN_COPILOT:return"open copilot";case s.TODO_QUICK_FIX:return"todo quick fix";case s.UNKNOWN_FUNCTION_QUICK_FIX:return"unknown function quick fix";default:return"unknown"}};class a{constructor(e,t,n){this.prependToCompletion="",this.appendToCompletion="",this.indentation=null,this.completionType=s.OPEN_COPILOT,this.insertPosition=e.get(o.LocationFactory).position(t.line,t.character),this.completionType=n}static fromJSONParse(e,t){const n=e.get(o.LocationFactory).position(t.insertPosition.line,t.insertPosition.character),r=new a(e,n,t.completionType);return r.prependToCompletion=t.prependToCompletion,r.appendToCompletion=t.appendToCompletion,r.indentation=t.indentation,r}}t.CompletionContext=a,t.completionContextForDocument=function(e,t,n){let r=n;const o=t.lineAt(n.line);return o.isEmptyOrWhitespace||(r=o.range.end),new a(e,r,s.OPEN_COPILOT)};let c=0;t.encodeLocation=function(e,t){const n=e.toString().split("#"),o=n.length>1?n[1]:"",s=JSON.stringify([n[0],t,o]);return r.URI.parse(`${i.CopilotScheme}:GitHub%20Copilot?${s}#${c++}`)},t.decodeLocation=function(e,t){const[n,o,i]=JSON.parse(t.query);return[r.URI.parse(i.length>0?n+"#"+i:n),a.fromJSONParse(e,o)]}},6317:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSolutions=t.normalizeCompletionText=void 0;const r=n(7057),o=n(1661),i=n(9800),s=n(5680),a=n(5798),c=n(7553),l=n(598),u=n(6635),d=n(7917),p=n(4090),h=n(2273),f=n(3591),m=n(3883),g=n(5489),_=n(2369),y=new a.Logger(a.LogLevel.INFO,"solutions");async function v(e,t,n){if(t.isCancellationRequested)return e.removeProgress(),{status:"FinishedWithError",error:"Cancelled"};const r=await n.next();return!0===r.done?(e.removeProgress(),{status:"FinishedNormally"}):{status:"Solution",solution:r.value,next:v(e,t,n)}}t.normalizeCompletionText=function(e){return e.replace(/\s+/g,"")},t.launchSolutions=async function(e,t){var n,a;const b=t.completionContext.insertPosition,w=t.completionContext.prependToCompletion,x=t.completionContext.indentation,T=e.get(_.LocationFactory),E=await t.getDocument(),C=await(0,p.extractPrompt)(e,E,b);if("contextTooShort"===C.type)return t.reportCancelled(),{status:"FinishedWithError",error:"Context too short"};const S=C.prompt,k=C.trailingWs;k.length>0&&(t.startPosition=T.position(t.startPosition.line,t.startPosition.character-k.length));const P=t.getCancellationToken(),I=r.v4();if(t.savedTelemetryData=g.TelemetryData.createAndMarkAsIssued({headerRequestId:I,languageId:E.languageId,source:(0,s.completionTypeToString)(t.completionContext.completionType)},{...(0,g.telemetrizePromptLength)(S),solutionCount:t.solutionCountTarget,promptEndPos:E.offsetAt(b)}),t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){const e=S.prefix.split("\n"),t=e.pop(),n=e.pop();if(n){const r=/^\W+(todo:?\s+)/i.exec(n);if(r){const o=r[1],i=n.replace(o,"");S.prefix=e.join("\n")+"\n"+i+"\n"+t}}}t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX&&(S.prefix+=t.completionContext.prependToCompletion),y.info(e,`prompt: ${JSON.stringify(S)}`),y.debug(e,`prependToCompletion: ${w}`),(0,g.telemetry)(e,"solution.requested",t.savedTelemetryData);const R=await e.get(i.BlockModeConfig).forLanguage(e,E.languageId),O=(0,h.isSupportedLanguageId)(E.languageId),A=(0,d.contextIndentation)(E,b),N={stream:!0,extra:{language:E.languageId,next_indent:null!==(n=A.next)&&void 0!==n?n:0}};"parsing"!==R||O||(N.stop=["\n\n","\r\n\r\n"]);const D=(0,f.extractRepoInfoInBackground)(e,E.fileName),M={prompt:S,languageId:E.languageId,repoInfo:D,ourRequestId:I,engineUrl:await(0,c.getEngineURL)(e,(0,f.tryGetGitHubNWO)(D),E.languageId,t.savedTelemetryData),count:t.solutionCountTarget,uiKind:l.CopilotUiKind.Panel,postOptions:N};let $;const L=t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX?[s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX,t.completionContext.prependToCompletion]:t.completionContext.completionType;switch(R){case i.BlockMode.Server:$=async e=>{},N.extra.force_indent=null!==(a=A.prev)&&void 0!==a?a:-1;break;case i.BlockMode.Parsing:default:$=O?function(e,t,n,r){return async o=>{if(r instanceof Array){const[i,s]=r;return(0,d.isBlockBodyFinishedWithPrefix)(e,t,n,o,s)}return(0,d.isBlockBodyFinished)(e,t,n,o)}}(e,E,t.startPosition,L):async e=>{}}e.get(u.StatusReporter).setProgress();const j=await e.get(l.OpenAIFetcher).fetchAndStreamCompletions(e,M,g.TelemetryData.createAndMarkAsIssued(),$,P);if("failed"===j.type||"canceled"===j.type)return t.reportCancelled(),e.get(u.StatusReporter).removeProgress(),{status:"FinishedWithError",error:`${j.type}: ${j.reason}`};let F=j.choices;F=async function*(e,t){for await(const n of e){const e={...n};e.completionText=t+e.completionText.trimRight(),yield e}}(F,w),null!==x&&(F=(0,l.cleanupIndentChoices)(F,x)),F=(0,o.asyncIterableMapFilter)(F,(async t=>(0,m.postProcessChoice)(e,"solution",E,b,t,!1,y)));const q=(0,o.asyncIterableMapFilter)(F,(async n=>{let r=n.completionText;if(y.info(e,`Open Copilot completion: [${n.completionText}]`),t.completionContext.completionType===s.CompletionType.OPEN_COPILOT||t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){let t="";const o=await(0,d.getNodeStart)(e,E,b,n.completionText);if(o)[t]=(0,p.trimLastLine)(E.getText(T.range(T.position(o.line,o.character),b)));else{const e=T.position(b.line,0);t=E.getText(T.range(e,b))}r=t+r}let o=n.completionText;t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX&&(E.lineAt(b.line).isEmptyOrWhitespace||(o+="\n")),k.length>0&&o.startsWith(k)&&(o=o.substring(k.length));const i=n.meanLogProb;return{displayText:r,meanProb:void 0!==i?Math.exp(i):0,meanLogProb:i||0,completionText:o,requestId:n.requestId,choiceIndex:n.choiceIndex,prependToCompletion:w}}));return v(e.get(u.StatusReporter),P,q[Symbol.asyncIterator]())}},446:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDefaultHandlers=void 0;const r=n(39),o=n(5489);t.registerDefaultHandlers=function(e,t){process.addListener("uncaughtException",(t=>{console.error("uncaughtException",t),o.telemetryException(e,t,"uncaughtException")}));let n=!1;process.addListener("unhandledRejection",((i,s)=>{if(n)return;if(n=!0,"vscode"===t&&!i)return;if("aborted"===i.type||(0,r.isAbortError)(i))return;if("vscode"===t&&["ENOTFOUND","ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENETDOWN","ENETUNREACH","EADDRNOTAVAIL"].includes(i.code))return;if("ENOENT"==i.code)return;let a="";try{a=`${i.message} (${i.code})`,a=JSON.stringify(i)}catch(e){a="[actual reason JSON was cyclic]"}"vscode"===t&&"{}"===a||(console.error("unhandledRejection",a),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:"Unhandled rejection logged to restricted telemetry"}),!1),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:a}),!0),n=!1)}))}},5225:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDocumentTracker=t.sortByAccessTimes=void 0;const r=n(819),o=new Map;t.sortByAccessTimes=function(e){return[...e].sort(((e,t)=>{var n,r;const i=null!==(n=o.get(e.uri.toString()))&&void 0!==n?n:0;return(null!==(r=o.get(t.uri.toString()))&&void 0!==r?r:0)-i}))},t.registerDocumentTracker=e=>e.get(r.TextDocumentManager).onDidFocusTextDocument((e=>{e&&o.set(e.document.uri.toString(),Date.now())}))},5917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfig=t.ExpTreatmentVariables=void 0;const r=n(5489),o=n(4914);var i;(i=t.ExpTreatmentVariables||(t.ExpTreatmentVariables={})).AA="copilotaa",i.CustomEngine="copilotcustomengine",i.Fetcher="copilotfetcher",i.OverrideBlockMode="copilotoverrideblockmode",i.OverrideNumGhostCompletions="copilotoverridednumghostcompletions",i.SuffixPercent="CopilotSuffixPercent",i.BeforeRequestWaitMs="copilotlms",i.NeighboringTabsOption="copilotneighboringtabs",i.DebounceMs="copilotdebouncems",i.DebouncePredict="copilotdebouncepredict",i.ContextualFilterAcceptThreshold="copilotcontextualfilteracceptthreshold",i.GranularityTimePeriodSizeInH="copilottimeperiodsizeinh",i.GranularityByCallBuckets="copilotbycallbuckets",i.SuffixStartMode="copilotsuffixstartmode",i.SuffixMatchThreshold="copilotsuffixmatchthreshold",i.MultiLogitBias="copilotlbeot";class s{constructor(e,t,n){this.variables=e,this.assignmentContext=t,this.features=n}static createFallbackConfig(e,t){return(0,r.telemetryExpProblem)(e,{reason:t}),this.createEmptyConfig()}static createEmptyConfig(){return new s({},"","")}addToTelemetry(e){e.properties[o.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features,e.properties[o.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName]=this.assignmentContext}}t.ExpConfig=s},6905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Features=t.Task=void 0;const r=n(4617),o=n(2137),i=n(140),s=n(5917),a=n(6046),c=n(2249),l=n(8495);class u{constructor(e){this.ctx=e,this.cache=new i.LRUCache(200)}async fetchExpConfig(e){let t=this.cache.get(e.stringify());return t||(t=new d((()=>this.ctx.get(a.ExpConfigMaker).fetchExperiments(this.ctx,e.toHeaders())),36e5),this.cache.put(e.stringify(),t)),t.run()}getCachedExpConfig(e){const t=this.cache.get(e.stringify());return null==t?void 0:t.value()}}class d{constructor(e,t=1/0){this.producer=e,this.expirationMs=t}async run(){return void 0===this.promise&&(this.promise=this.producer(),this.storeResult(this.promise).then((()=>{this.expirationMs<1/0&&void 0!==this.promise&&setTimeout((()=>this.promise=void 0),this.expirationMs)}))),this.promise}async storeResult(e){try{this.result=await e}finally{void 0===this.result&&(this.promise=void 0)}}value(){return this.result}}t.Task=d;class p{constructor(e){this.ctx=e,this.staticFilters={},this.dynamicFilters={},this.upcomingDynamicFilters={},this.assignments=new u(this.ctx),this.granularityDirectory=new l.GranularityDirectory("unspecified",e.get(o.Clock))}setPrefix(e){this.granularityDirectory=new l.GranularityDirectory(e,this.ctx.get(o.Clock))}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,t){this.dynamicFilters[e]=t}getDynamicFilterValues(){const e={};for(const[t,n]of Object.entries(this.dynamicFilters))e[t]=n();return e}registerUpcomingDynamicFilter(e,t){this.upcomingDynamicFilters[e]=t}async getAssignment(e,t={},n){var r,o;const i=this.makeFilterSettings(t),a=this.granularityDirectory.extendFilters(i),c=await this.getExpConfig(a.newFilterSettings);this.granularityDirectory.update(i,+(null!==(r=c.variables[s.ExpTreatmentVariables.GranularityByCallBuckets])&&void 0!==r?r:NaN),+(null!==(o=c.variables[s.ExpTreatmentVariables.GranularityTimePeriodSizeInH])&&void 0!==o?o:NaN));const l=this.granularityDirectory.extendFilters(i),u=l.newFilterSettings,d=await this.getExpConfig(u);let h=new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs)));for(const e of l.otherFilterSettingsToPrefetch)h=h.then((async()=>{await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e)}));return this.prepareForUpcomingFilters(u),n&&(n.filtersAndExp={exp:d,filters:u}),d.variables[e]}makeFilterSettings(e){return new c.FilterSettings({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e){try{return this.assignments.fetchExpConfig(e)}catch(e){return s.ExpConfig.createFallbackConfig(this.ctx,`Error fetching ExP config: ${e}`)}}async prepareForUpcomingFilters(e){if(!((new Date).getMinutes()<60-p.upcomingTimeBucketMinutes))for(const[t,n]of Object.entries(this.upcomingDynamicFilters))await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e.withChange(t,n()))}stringify(){var e;const t=this.assignments.getCachedExpConfig(new c.FilterSettings({}));return JSON.stringify(null!==(e=null==t?void 0:t.variables)&&void 0!==e?e:{})}async customEngine(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.CustomEngine,o,n))&&void 0!==r?r:""}async beforeRequestWaitMs(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.BeforeRequestWaitMs,o,n))&&void 0!==r?r:0}async multiLogitBias(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.MultiLogitBias,o,n))&&void 0!==r&&r}async debounceMs(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.DebounceMs))&&void 0!==e?e:0}async debouncePredict(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.DebouncePredict))&&void 0!==e&&e}async contextualFilterAcceptThreshold(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.ContextualFilterAcceptThreshold))&&void 0!==e?e:void 0}async overrideBlockMode(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideBlockMode)}async overrideNumGhostCompletions(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideNumGhostCompletions)}async suffixPercent(e,t){var n;const r={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(s.ExpTreatmentVariables.SuffixPercent,r))&&void 0!==n?n:0}async suffixMatchThreshold(e,t){var n;const r={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(s.ExpTreatmentVariables.SuffixMatchThreshold,r))&&void 0!==n?n:0}async suffixStartMode(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.SuffixStartMode,n)){default:return r.SuffixStartMode.Cursor;case"cursortrimstart":return r.SuffixStartMode.CursorTrimStart;case"siblingblock":return r.SuffixStartMode.SiblingBlock;case"siblingblocktrimstart":return r.SuffixStartMode.SiblingBlockTrimStart}}async neighboringTabsOption(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.NeighboringTabsOption,n)){case"none":return r.NeighboringTabsOption.None;case"conservative":return r.NeighboringTabsOption.Conservative;case"medium":return r.NeighboringTabsOption.Medium;default:return r.NeighboringTabsOption.Eager;case"eagerbutlittle":return r.NeighboringTabsOption.EagerButLittle}}async addExpAndFilterToTelemetry(e){const t=this.makeFilterSettings({});e.filtersAndExp={filters:t,exp:await this.getExpConfig(t)}}}t.Features=p,p.upcomingDynamicFilterCheckDelayMs=20,p.upcomingTimeBucketMinutes=5+Math.floor(11*Math.random())},6046:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfigNone=t.ExpConfigFromTAS=t.ExpConfigMaker=void 0;const r=n(39),o=n(5917);class i{}t.ExpConfigMaker=i,t.ExpConfigFromTAS=class extends i{async fetchExperiments(e,t){var n;const i=e.get(r.Fetcher);let s;try{s=await i.fetch("https://default.exp-tas.com/vscode/ab",{method:"GET",headers:t})}catch(t){return o.ExpConfig.createFallbackConfig(e,`Error fetching ExP config: ${t}`)}if(!s.ok)return o.ExpConfig.createFallbackConfig(e,`ExP responded with ${s.status}`);const a=await s.json(),c=null!==(n=a.Configs.find((e=>"vscode"===e.Id)))&&void 0!==n?n:{Id:"vscode",Parameters:{}},l=Object.entries(c.Parameters).map((([e,t])=>e+(t?"":"cf")));return new o.ExpConfig(c.Parameters,a.AssignmentContext,l.join(";"))}},t.ExpConfigNone=class extends i{async fetchExperiments(e,t){return o.ExpConfig.createEmptyConfig()}}},2249:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.FilterSettings=t.telmetryNames=t.TargetPopulation=t.Filter=void 0,function(e){e.Market="X-MSEdge-Market",e.CorpNet="X-FD-Corpnet",e.ApplicationVersion="X-VSCode-AppVersion",e.Build="X-VSCode-Build",e.ClientId="X-MSEdge-ClientId",e.ExtensionName="X-VSCode-ExtensionName",e.ExtensionVersion="X-VSCode-ExtensionVersion",e.Language="X-VSCode-Language",e.TargetPopulation="X-VSCode-TargetPopulation",e.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",e.CopilotOverrideEngine="X-Copilot-OverrideEngine",e.CopilotRepository="X-Copilot-Repository",e.CopilotFileType="X-Copilot-FileType",e.CopilotUserKind="X-Copilot-UserKind"}(n=t.Filter||(t.Filter={})),(r=t.TargetPopulation||(t.TargetPopulation={})).Team="team",r.Internal="internal",r.Insiders="insider",r.Public="public",t.telmetryNames={[n.CopilotClientTimeBucket]:"timeBucket",[n.CopilotOverrideEngine]:"engine",[n.CopilotRepository]:"repo",[n.CopilotFileType]:"fileType",[n.CopilotUserKind]:"userKind"};class o{constructor(e){this.filters=e;for(const[e,t]of Object.entries(this.filters))""===t&&delete this.filters[e]}extends(e){for(const[t,n]of Object.entries(e.filters))if(this.filters[t]!==n)return!1;return!0}addToTelemetry(e){for(const[n,r]of Object.entries(this.filters)){const o=t.telmetryNames[n];void 0!==o&&(e.properties[o]=r)}}stringify(){const e=Object.keys(this.filters);return e.sort(),e.map((e=>`${e}:${this.filters[e]}`)).join(";")}toHeaders(){return{...this.filters}}withChange(e,t){return new o({...this.filters,[e]:t})}}t.FilterSettings=o},8495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GranularityDirectory=void 0;const r=n(2249),o=n(2505),i=r.Filter.CopilotClientTimeBucket;t.GranularityDirectory=class{constructor(e,t){this.specs=new Map,this.prefix=e,this.clock=t,this.defaultGranularity=(0,o.DEFAULT_GRANULARITY)(e)}selectGranularity(e){for(const[t,n]of this.specs.entries())if(e.extends(t))return n;return this.defaultGranularity}update(e,t,n){if(t=t>1?t:NaN,n=n>0?n:NaN,isNaN(t)&&isNaN(n))this.specs.delete(e);else{const r=new o.TimeBucketGranularity(this.prefix);isNaN(t)||r.setByCallBuckets(t),isNaN(n)||r.setTimePeriod(3600*n*1e3),this.specs.set(e,r)}}extendFilters(e){const t=this.selectGranularity(e),[n,r]=t.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(i,n),otherFilterSettingsToPrefetch:r.map((t=>e.withChange(i,t)))}}}},2505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBucketGranularity=t.DEFAULT_GRANULARITY=t.GranularityImplementation=void 0;class n{constructor(e){this.prefix=e}getCurrentAndUpComingValues(e){return[this.getValue(e),this.getUpcomingValues(e)]}}t.GranularityImplementation=n;class r extends n{getValue(e){return this.prefix}getUpcomingValues(e){return[]}}t.DEFAULT_GRANULARITY=e=>new r(e),t.TimeBucketGranularity=class extends n{constructor(e,t=.5,n=(new Date).setUTCHours(0,0,0,0)){super(e),this.prefix=e,this.fetchBeforeFactor=t,this.anchor=n}setTimePeriod(e){isNaN(e)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=e}setByCallBuckets(e){isNaN(e)?this.numByCallBuckets=void 0:this.numByCallBuckets=e}getValue(e){return this.prefix+this.getTimePeriodBucketString(e)+(this.numByCallBuckets?this.timeHash(e):"")}getTimePeriodBucketString(e){return this.timePeriodLengthMs?this.dateToTimePartString(e):""}getUpcomingValues(e){const t=[],n=this.getUpcomingTimePeriodBucketStrings(e),r=this.getUpcomingByCallBucketStrings();for(const e of n)for(const n of r)t.push(this.prefix+e+n);return t}getUpcomingTimePeriodBucketStrings(e){if(void 0===this.timePeriodLengthMs)return[""];if((e.getTime()-this.anchor)%this.timePeriodLengthMse.toString()))}timeHash(e){return null==this.numByCallBuckets?0:e.getTime()%this.numByCallBuckets*7883%this.numByCallBuckets}dateToTimePartString(e){return null==this.timePeriodLengthMs?"":Math.floor((e.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}}},4914:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpServiceTelemetryNames=void 0,(n=t.ExpServiceTelemetryNames||(t.ExpServiceTelemetryNames={})).featuresTelemetryPropertyName="VSCode.ABExp.Features",n.assignmentContextTelemetryPropertyName="abexp.assignmentcontext"},6817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterScore=t.getLastLineLength=t.ContextualFilterManager=void 0;const r=n(187);class o{constructor(){this.previousLabel=0,this.previousLabelTimestamp=Date.now()-3600,this.probabilityAccept=0}}function i(e){const t=e.split("\n");return t[t.length-1].length}t.ContextualFilterManager=o,t.getLastLineLength=i,t.contextualFilterScore=function(e,t,n){const s=e.get(o),a=s.previousLabel;let c=0;"afterCursorWhitespace"in t.properties&&"true"===t.properties.afterCursorWhitespace&&(c=1);const l=(Date.now()-s.previousLabelTimestamp)/1e3,u=Math.log(1+l);let d=0,p=0;const h=n.prefix;if(h){d=Math.log(1+i(h));const e=h.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(p=r.contextualFilterCharacterMap[e])}let f=0,m=0;const g=h.trimEnd();if(g){f=Math.log(1+i(g));const e=g.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(m=r.contextualFilterCharacterMap[e])}let _=0;if("documentLength"in t.measurements){const e=t.measurements.documentLength;_=Math.log(1+e)}let y=0;if("promptEndPos"in t.measurements){const e=t.measurements.promptEndPos;y=Math.log(1+e)}let v=0;if("promptEndPos"in t.measurements&&"documentLength"in t.measurements){const e=t.measurements.documentLength;v=(t.measurements.promptEndPos+.5)/(1+e)}let b=0;void 0!==r.contextualFilterLanguageMap[t.properties.languageId]&&(b=r.contextualFilterLanguageMap[t.properties.languageId]);let w=r.contextualFilterIntercept;w+=r.contextualFilterWeights[0]*a,w+=r.contextualFilterWeights[1]*c,w+=r.contextualFilterWeights[2]*u,w+=r.contextualFilterWeights[3]*d,w+=r.contextualFilterWeights[4]*f,w+=r.contextualFilterWeights[5]*_,w+=r.contextualFilterWeights[6]*y,w+=r.contextualFilterWeights[7]*v,w+=r.contextualFilterWeights[8+b],w+=r.contextualFilterWeights[29+p],w+=r.contextualFilterWeights[125+m];const x=1/(1+Math.exp(-w));return e.get(o).probabilityAccept=x,x}},187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterCharacterMap=t.contextualFilterLanguageMap=t.contextualFilterWeights=t.contextualFilterIntercept=void 0,t.contextualFilterIntercept=-.3043572714994554,t.contextualFilterWeights=[.9978708359643611,.7001905605239328,-.1736749244124868,-.22994157947320112,.13406692641682572,-.007751370662011853,.0057783222035240715,.41910878254476003,-.1621657125711092,.13770814958908187,-.06036011308184006,-.07351180985800129,0,-.05584878151248109,.30618794079412015,-.1282197982598485,.10951859303997555,.1700461782788777,-.3346057842644757,.22497985923128136,0,-.44038101825774356,-.6540115939236782,.16595600081341702,.20733910722385135,-.1337033766105696,-.06923072125290894,-.05806684191976292,.3583334671633344,-.47357732824944315,.17810871365594377,.42268219963946685,0,0,-.16379620467004602,-.43893868831061167,0,.11570094006709251,.9326431262654882,-.9990110509203912,-.44125275652726503,-.15840786997162004,-.4600396256644451,-.018814811994044403,.09230944537175266,.025814790934742798,-1.0940162204190154,-.9407503631235489,-.9854303778694269,-1.1045822488262245,-1.1417299456573262,-1.5623704405345513,-.4157473855795939,-1.0244257735561713,-.7477401944601753,-1.1275109699068402,-.0714715633552533,-1.1408628006786907,-1.0409898655074672,-.2288889836518878,-.5469549893760344,-.181946611106845,.1264329316374918,0,0,.312206968554707,-.3656436392517924,.23655650686038968,.1014912419901576,0,.06287549221765308,0,0,.19027065218932154,-.8519502045974378,0,.23753599905971923,.2488809322489166,.019969251907983224,0,.06916505526229488,.29053356359188204,-.14484456555431657,.014768129429370188,-.15051464926341374,.07614835502776021,-.3317489901313935,0,0,.04921938684669103,-.28248576768353445,-.9708816204525345,-1.3560464522265527,.014165375212383239,-.23924166472544983,.10006595730248855,.09867233147279562,.32330430333220644,-.058625706114180595,.17149853105783947,.4436484054395367,.047189049576707255,.16832520944790552,.1117259900942179,-.35469010329927253,0,-.1528189124465582,-.3804848349564939,.07278077320753953,.13263786480064088,.22920682659292527,1.1512955314336537,0,.016939862282340023,.4242994650403408,.12759835577444986,-.5577261135825583,-.19764560943067672,-.4042102444736004,.12063461617733708,-.2933966817484834,.2715683893968593,0,-.7138548251238751,0,-.023066228703035277,0,-.06383043976746139,.09683723720709651,-.7337151424080791,0,-.27191370124625525,.2819781269656171,-.08711496549050252,.11048604909969338,-.0934849550450534,.0721001250772912,.2589126797890794,.6729582659532254,-.21921032738244908,-.21535277468651456,-.45474006124091354,-.05861820126419139,-.007875306207720204,-.056661261678809284,.17727881404222662,.23603713348534658,.17485861412377932,-.5737483768696752,-.38220029570342745,-.5202722985519168,-.37187947527657256,.47155277792990113,-.12077912346691123,.47825628981545326,.4736704404000214,-.1615218651546898,.18362447973513005,0,0,-.18183417425866824,0,0,-.2538532305733833,-.1303692690676528,-.4073577969188216,.04172985870928789,-.1704527388573901,0,0,.7536858953385828,-.44703159588787644,0,-.7246484085580873,-.21378128540782063,0,.037461090552656146,-.16205852364367032,-.10973952064404884,.017468043407647377,-.1288980387397392,0,0,0,-1.218692715379445,.05536949662193305,-.3763799844799116,-.1845001725624579,-.1615576298149558,0,-.15373262203249874,-.04603412604270418,0,-.3068149681460828,.09412352468269412,0,.09116543650609721,.06065865264082559,.05688267379386188,-.05873945477722306,0,.14532465133322153,.1870857769705463,.36304258043185555,.1411392422180405,.0630388629716367,0,-1.1170522012450395,.16133697772771127,.15908534390781448,-.23485453704002232,-.1419980841417892,.21909510179526218,.39948420260153766,.40802294284289187,.15403767653746853,0,.19764784115096676,.584914157527457,0,-.4573883817015294],t.contextualFilterLanguageMap={javascript:1,typescript:2,typescriptreact:3,python:4,vue:5,php:6,dart:7,javascriptreact:8,go:9,css:10,cpp:11,html:12,scss:13,markdown:14,csharp:15,java:16,json:17,rust:18,ruby:19,c:20},t.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}},3993:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.completionsFromGhostTextResults=void 0;const r=n(7057),o=n(2369),i=n(702),s=n(5034);t.completionsFromGhostTextResults=function(e,t,n,a,c,l,u){const d=e.get(o.LocationFactory),p=a.lineAt(c);let h=t.map((e=>{let t,o="";if(l&&(e.completion=(0,s.normalizeIndentCharacter)(l,e.completion,p.isEmptyOrWhitespace)),e.completion.displayNeedsWsOffset&&p.isEmptyOrWhitespace)t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else if(p.isEmptyOrWhitespace&&e.completion.completionText.startsWith(p.text))t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else{const n=a.getWordRangeAtPosition(c);if(e.isMiddleOfTheLine){const n=a.lineAt(c),r=d.range(d.position(c.line,0),c),i=a.getText(r);t=e.coversSuffix?n.range:r,o=i+e.completion.displayText}else if(n){const r=a.getText(n);t=d.range(n.start,c),o=r+e.completion.completionText}else{const n=d.range(d.position(c.line,0),c);t=n,o=a.getText(n)+e.completion.displayText}}return{uuid:(0,r.v4)(),text:o,range:t,file:a.uri,index:e.completion.completionIndex,telemetry:e.telemetry,displayText:e.completion.displayText,position:c,offset:a.offsetAt(c),resultType:n}}));if(n===i.ResultType.TypingAsSuggested&&void 0!==u){const e=h.find((e=>e.index===u));if(e){const t=h.filter((e=>e.index!==u));h=[e,...t]}}return h}},4619:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDebounceLimit=t.GhostTextDebounceManager=void 0;const r=n(6905);class o{constructor(e){this.forceDelayMs=e,this.extraDebounceMs=0}}t.GhostTextDebounceManager=o,t.getDebounceLimit=async function(e,t){let n;if(await e.get(r.Features).debouncePredict()&&t.measurements.contextualFilterScore){const e=t.measurements.contextualFilterScore,r=.275,o=6;n=25+250/(1+Math.pow(e/r,o))}else n=await e.get(r.Features).debounceMs();return(n>0?n:75)+e.get(o).extraDebounceMs}},702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGhostText=t.completionCache=t.ResultType=t.ghostTextLogger=void 0;const r=n(4617),o=n(7057),i=n(140),s=n(3940),a=n(1661),c=n(9800),l=n(6905),u=n(5798),d=n(39),p=n(7553),h=n(2031),f=n(598),m=n(6635),g=n(7917),_=n(4090),y=n(3591),v=n(1153),b=n(3883),w=n(5489),x=n(913),T=n(2369),E=n(6817),C=n(4619),S=n(1749);var k;let P,I;async function R(e,n,r,o,i,s,a){var u,p,m;t.ghostTextLogger.debug(e,`Getting ${s} from network`),r=r.extendedBy();const g=await async function(e,t){const n=await e.get(l.Features).overrideNumGhostCompletions();return n?t.isCycling?Math.max(0,3-n):n:t.blockMode==c.BlockMode.Server&&t.isCycling?2:t.blockMode==c.BlockMode.Server?1:t.blockMode==c.BlockMode.Parsing&&t.isCycling&&!t.multiline?2:t.multiline?(0,c.getConfig)(e,c.ConfigKey.InlineSuggestCount):1}(e,n),_=(0,f.getTemperatureForSamples)(e,g),y={stream:!0,n:g,temperature:_,extra:{language:n.languageId,next_indent:null!==(u=n.indentation.next)&&void 0!==u?u:0}};n.multiline||(y.stop=["\n"]),n.multiline&&n.multiLogitBias&&(y.logit_bias={50256:-100});const v=Date.now(),b={endpoint:"completions",uiKind:h.CopilotUiKind.GhostText,isCycling:JSON.stringify(n.isCycling),temperature:JSON.stringify(_),n:JSON.stringify(g),stop:null!==(p=JSON.stringify(y.stop))&&void 0!==p?p:"unset",logit_bias:JSON.stringify(null!==(m=y.logit_bias)&&void 0!==m?m:null)},T=(0,w.telemetrizePromptLength)(n.prompt);Object.assign(r.properties,b),Object.assign(r.measurements,T);try{const s={prompt:n.prompt,languageId:n.languageId,repoInfo:n.repoInfo,ourRequestId:n.ourRequestId,engineUrl:n.engineURL,count:g,uiKind:h.CopilotUiKind.GhostText,postOptions:y};n.delayMs>0&&await new Promise((e=>setTimeout(e,n.delayMs)));const c=await e.get(h.OpenAIFetcher).fetchAndStreamCompletions(e,s,r,i,o);return"failed"===c.type?{type:"failed",reason:c.reason,telemetryData:(0,S.mkBasicResultTelemetry)(r)}:"canceled"===c.type?(t.ghostTextLogger.debug(e,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:c.reason,telemetryData:(0,S.mkCanceledResultTelemetry)(r)}):a(g,v,c.getProcessingTime(),c.choices)}catch(n){if((0,d.isAbortError)(n))return{type:"canceled",reason:"network request aborted",telemetryData:(0,S.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(t.ghostTextLogger.error(e,`Error on ghost text request ${n}`),(0,x.shouldFailForDebugPurposes)(e))throw n;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,S.mkBasicResultTelemetry)(r)}}}function O(e,t){const n={...e};return n.completionText=e.completionText.trimEnd(),t.forceSingleLine&&(n.completionText=n.completionText.split("\n")[0]),n}t.ghostTextLogger=new u.Logger(u.LogLevel.INFO,"ghostText"),function(e){e[e.Network=0]="Network",e[e.Cache=1]="Cache",e[e.TypingAsSuggested=2]="TypingAsSuggested",e[e.Cycling=3]="Cycling"}(k=t.ResultType||(t.ResultType={})),t.completionCache=new i.LRUCache(100);const A=new s.Debouncer;function N(e,t){P=e,I=t}function D(e,n,r){const o=(0,i.keyForPrompt)(n.prompt),s=t.completionCache.get(o);s&&s.multiline===r.multiline?t.completionCache.put(o,{multiline:s.multiline,choices:s.choices.concat(r.choices)}):t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Appended cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}function M(e,n){const r=t.completionCache.get(e);if(r&&(!n||r.multiline))return r.choices}function $(e,t,n){if(n.length>0){if(t.startsWith(n))return{completionIndex:e,completionText:t,displayText:t.substr(n.length),displayNeedsWsOffset:!1};{const r=t.substr(0,t.length-t.trimLeft().length);return n.startsWith(r)?{completionIndex:e,completionText:t,displayText:t.trimLeft(),displayNeedsWsOffset:!0}:{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}}return{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}function L(e,n){const r=n.requestId,o={choiceIndex:n.choiceIndex.toString()},i={numTokens:n.numTokens,compCharLen:n.completionText.length,numLines:n.completionText.split("\n").length};n.meanLogProb&&(i.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(i.meanAlternativeLogProb=n.meanAlternativeLogProb);const s=n.telemetryData.extendedBy(o,i);return s.extendWithRequestId(r),s.measurements.confidence=(0,v.ghostTextScoreConfidence)(e,s),s.measurements.quantile=(0,v.ghostTextScoreQuantile)(e,s),t.ghostTextLogger.debug(e,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${s.measurements.confidence} (expected as good or better than about ${s.measurements.quantile} of all suggestions)`),s}function j(e,t,n,r,o){const i=Date.now()-r,s=i-o,a=n.telemetryData.extendedBy({},{completionCharLen:n.completionText.length,requestTimeMs:i,processingTimeMs:o,deltaMs:s,meanLogProb:n.meanLogProb||NaN,meanAlternativeLogProb:n.meanAlternativeLogProb||NaN,numTokens:n.numTokens});a.extendWithRequestId(n.requestId),(0,w.telemetry)(e,`ghostText.${t}`,a)}t.getGhostText=async function(e,n,s,u,d){var f,v;const F=await(0,_.extractPrompt)(e,n,s);if("contextTooShort"===F.type)return t.ghostTextLogger.debug(e,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context"};if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled after extractPrompt"};const q=function(e,t){const n=(o=t,0!=e.lineAt(o).text.substr(o.character).trim().length),r=function(e,t){const n=t.lineAt(e).text.substr(e.character).trim();return/^\s*[)}\]"'`]*\s*[:{;,]?\s*$/.test(n)}(t,e);var o;if(!n||r)return n&&r}(n,s);if(void 0===q)return t.ghostTextLogger.debug(e,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line"};const B=e.get(m.StatusReporter),H=e.get(T.LocationFactory),U=await async function(e,t,n,o,i,s){switch(await e.get(c.BlockModeConfig).forLanguage(e,t.languageId)){case c.BlockMode.Server:return{blockMode:c.BlockMode.Server,requestMultiline:!0,isCyclingRequest:i,finishedCb:async e=>{}};case c.BlockMode.Parsing:default:{const a=await async function(e,t,n,o){if(t.lineCount>=8e3)(0,w.telemetry)(e,"ghostText.longFileMultilineSkip",w.TelemetryData.createAndMarkAsIssued({languageId:t.languageId,lineCount:String(t.lineCount),currentLine:String(n.line)}));else{if(!o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n);if(o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n)||await(0,g.isEmptyBlockStart)(t,t.lineAt(n).range.end)}return!1}(e,t,n,s);return a?{blockMode:c.BlockMode.Parsing,requestMultiline:!0,isCyclingRequest:!1,finishedCb:async r=>{let i;return i=o.trailingWs.length>0&&!o.prompt.prefix.endsWith(o.trailingWs)?e.get(T.LocationFactory).position(n.line,Math.max(n.character-o.trailingWs.length,0)):n,(0,g.isBlockBodyFinished)(e,t,i,r)}}:{blockMode:c.BlockMode.Parsing,requestMultiline:!1,isCyclingRequest:i,finishedCb:async e=>{}}}}}(e,n,s,F,u,q);if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after requestMultiline"),{type:"abortedBeforeIssued",reason:"Cancelled after requestMultiline"};const[W]=(0,_.trimLastLine)(n.getText(H.range(H.position(0,0),s)));let z=function(e,n,r,o){const s=function(e,n,r){if(!P||!I||!n.startsWith(P))return;const o=M(I,r);if(!o)return;const i=n.substring(P.length);t.ghostTextLogger.debug(e,`Getting completions for user-typing flow - remaining prefix: ${i}`);const s=[];return o.forEach((e=>{const t=O(e,{forceSingleLine:!1});t.completionText.startsWith(i)&&(t.completionText=t.completionText.substring(i.length),s.push(t))})),s}(e,n,o);if(s&&s.length>0)return[s,k.TypingAsSuggested];const a=function(e,n,r,o){const s=(0,i.keyForPrompt)(r);t.ghostTextLogger.debug(e,`Trying to get completions from cache for key: ${s}`);const a=M(s,o);if(a){t.ghostTextLogger.debug(e,`Got completions from cache for key: ${s}`);const r=[];a.forEach((e=>{const t=O(e,{forceSingleLine:!o});r.push(t)}));const i=r.filter((e=>e.completionText));return i.length>0&&N(n,s),i}}(e,n,r,o);return a&&a.length>0?[a,k.Cache]:void 0}(e,W,F.prompt,U.requestMultiline);const K=o.v4(),V=w.TelemetryData.createAndMarkAsIssued(),G=(0,y.extractRepoInfoInBackground)(e,n.fileName),J=await(0,p.getEngineURL)(e,(0,y.tryGetGitHubNWO)(G),n.languageId,V),X=await e.get(l.Features).beforeRequestWaitMs((0,y.tryGetGitHubNWO)(G)||"",n.languageId),Q=await e.get(l.Features).multiLogitBias((0,y.tryGetGitHubNWO)(G)||"",n.languageId),Y={blockMode:U.blockMode,languageId:n.languageId,repoInfo:G,engineURL:J,ourRequestId:K,prefix:W,prompt:F.prompt,multiline:U.requestMultiline,indentation:(0,g.contextIndentation)(n,s),isCycling:u,delayMs:X,multiLogitBias:Q},Z=await e.get(l.Features).debouncePredict(),ee=await e.get(l.Features).contextualFilterAcceptThreshold();let te=!1;(Z||"number"==typeof ee)&&(te=!0);const ne=function(e,t,n,r,o,i,s){const a=e.get(T.LocationFactory),c=t.lineAt(r.line),l=t.getText(a.range(c.range.start,r)),u=t.getText(a.range(r,c.range.end)),d={languageId:t.languageId,beforeCursorWhitespace:JSON.stringify(""===l.trim()),afterCursorWhitespace:JSON.stringify(""===u.trim())},p={...(0,w.telemetrizePromptLength)(o.prompt),promptEndPos:t.offsetAt(r),documentLength:t.getText().length,delayMs:n.delayMs},f=i.extendedBy(d,p);f.properties.promptChoices=JSON.stringify(o.promptChoices,((e,t)=>t instanceof Map?Array.from(t.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{}):t)),f.properties.promptBackground=JSON.stringify(o.promptBackground,((e,t)=>t instanceof Map?Array.from(t.values()):t)),f.measurements.promptComputeTimeMs=o.computeTimeMs,s&&(f.measurements.contextualFilterScore=(0,E.contextualFilterScore)(e,f,o.prompt));const m=n.repoInfo;return f.properties.gitRepoInformation=void 0===m?"unavailable":m===y.ComputationStatus.PENDING?"pending":"available",void 0!==m&&m!==y.ComputationStatus.PENDING&&(f.properties.gitRepoUrl=m.url,f.properties.gitRepoHost=m.hostname,f.properties.gitRepoOwner=m.owner,f.properties.gitRepoName=m.repo),f.properties.engineName=(0,h.extractEngineName)(e,n.engineURL),f.properties.isMultiline=JSON.stringify(n.multiline),f.properties.blockMode=n.blockMode,f.properties.isCycling=JSON.stringify(n.isCycling),f.properties.headerRequestId=n.ourRequestId,(0,w.telemetry)(e,"ghostText.issued",f),f}(e,n,Y,s,F,V,te);if(U.isCyclingRequest&&(null!==(f=null==z?void 0:z[0].length)&&void 0!==f?f:0)>1||!U.isCyclingRequest&&void 0!==z)t.ghostTextLogger.info(e,"Found inline suggestions locally");else{if(null==B||B.setProgress(),U.isCyclingRequest){const n=await async function(e,n,r,o,i){return R(e,n,r,o,i,"all completions",(async(i,s,a,c)=>{const l=[];for await(const n of c){if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,S.mkCanceledResultTelemetry)(r)};if(n.completionText.trimEnd()){if(-1!==l.findIndex((e=>e.completionText.trim()===n.completionText.trim())))continue;l.push(n)}}return l.length>0&&(D(e,n,{multiline:n.multiline,choices:l}),j(e,"cyclingPerformance",l[0],s,a)),{type:"success",value:l,telemetryData:(0,S.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,d,U.finishedCb);if("success"===n.type){const e=null!==(v=null==z?void 0:z[0])&&void 0!==v?v:[];n.value.forEach((t=>{-1===e.findIndex((e=>e.completionText.trim()===t.completionText.trim()))&&e.push(t)})),z=[e,k.Cycling]}else if(void 0===z)return null==B||B.removeProgress(),n}else{const n=await(0,C.getDebounceLimit)(e,ne);try{await A.debounce(n)}catch{return{type:"canceled",reason:"by debouncer",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)}}if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled during debounce"),{type:"canceled",reason:"during debounce",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)};if(ee&&ne.measurements.contextualFilterScore&&ne.measurements.contextualFilterScore{const u=l[Symbol.asyncIterator](),d=await u.next();if(d.done)return t.ghostTextLogger.debug(e,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,S.mkBasicResultTelemetry)(r)};if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,S.mkCanceledResultTelemetry)(r)};const p=d.value;if(void 0===p)return t.ghostTextLogger.debug(e,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,S.mkBasicResultTelemetry)(r)};j(e,"performance",p,a,c);const h=s-1;t.ghostTextLogger.debug(e,`Awaited first result, id: ${p.choiceIndex}`),function(e,n,r){const o=(0,i.keyForPrompt)(n.prompt);N(n.prefix,o),t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}(e,n,{multiline:n.multiline,choices:[p]});const f=[];for(let e=0;e{t.ghostTextLogger.debug(e,`Awaited remaining results, number of results: ${r.length}`);const o=[];for(const n of r){const r=n.value;if(void 0!==r&&(t.ghostTextLogger.info(e,`GhostText later completion: [${r.completionText}]`),r.completionText.trimEnd())){if(-1!==o.findIndex((e=>e.completionText.trim()===r.completionText.trim())))continue;if(r.completionText.trim()===p.completionText.trim())continue;o.push(r)}}o.length>0&&D(e,n,{multiline:n.multiline,choices:o})}));return(0,x.isRunningInTest)(e)&&await m,{type:"success",value:O(d.value,{forceSingleLine:!1}),telemetryData:(0,S.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,d,U.finishedCb);if("success"!==r.type)return null==B||B.removeProgress(),r;z=[[r.value],k.Network]}null==B||B.removeProgress()}if(void 0===z)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,S.mkBasicResultTelemetry)(ne)};const[re,oe]=z,ie=(0,a.asyncIterableMapFilter)((0,a.asyncIterableFromArray)(re),(async r=>(0,b.postProcessChoice)(e,"ghostText",n,s,r,q,t.ghostTextLogger))),se=[];for await(const r of ie){const o=q&&(0,b.checkSuffix)(n,s,r);if(null==d?void 0:d.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after post processing completions"),{type:"canceled",reason:"after post processing completions",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)};const i=L(e,r),a={completion:$(r.choiceIndex,r.completionText,F.trailingWs),telemetry:i,isMiddleOfTheLine:q,coversSuffix:o};se.push(a)}return{type:"success",value:[se,oe],telemetryData:(0,S.mkBasicResultTelemetry)(ne),telemetryBlob:ne}}},5034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeIndentCharacter=void 0,t.normalizeIndentCharacter=function(e,t,n){function r(e,t,n){const r=new RegExp(`^(${t})+`,"g");return e.split("\n").map((e=>{const t=e.replace(r,""),o=e.length-t.length;return n(o)+t})).join("\n")}let o;if(o=void 0===e.tabSize||"string"==typeof e.tabSize?4:e.tabSize,!1===e.insertSpaces){const e=e=>r(e," ",(e=>"\t".repeat(Math.floor(e/o))+" ".repeat(e%o)));t.displayText=e(t.displayText),t.completionText=e(t.completionText)}else if(!0===e.insertSpaces){const e=e=>r(e,"\t",(e=>" ".repeat(e*o)));if(t.displayText=e(t.displayText),t.completionText=e(t.completionText),n){const e=e=>{const t=e.length-e.trimLeft().length,n=t%o;return 0!==n&&t>0?r(e," ".repeat(n),(e=>" ".repeat((Math.floor(e/o)+1)*o))):e};t.displayText=e(t.displayText),t.completionText=e(t.completionText)}}return t}},1749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGhostTextResultTelemetry=t.mkBasicResultTelemetry=t.mkCanceledResultTelemetry=t.telemetryRejected=t.telemetryAccepted=t.telemetryShown=void 0;const r=n(5489),o=n(6817);t.telemetryShown=function(e,t,n,o){n.markAsDisplayed();const i=o?`${t}.shownFromCache`:`${t}.shown`;(0,r.telemetry)(e,i,n)},t.telemetryAccepted=function(e,t,n){const i=t+".accepted",s=e.get(o.ContextualFilterManager);s.previousLabel=1,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.telemetryRejected=function(e,t,n){const i=t+".rejected",s=e.get(o.ContextualFilterManager);s.previousLabel=0,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.mkCanceledResultTelemetry=function(e,t={}){return{...t,telemetryBlob:e}},t.mkBasicResultTelemetry=function(e){return{headerRequestId:e.properties.headerRequestId,copilot_trackingId:e.properties.copilot_trackingId}},t.handleGhostTextResultTelemetry=async function(e,t){if("success"===t.type)return(0,r.telemetryRaw)(e,"ghostText.produced",t.telemetryData,{}),t.value;"abortedBeforeIssued"!==t.type&&("canceled"!==t.type?(0,r.telemetryRaw)(e,`ghostText.${t.type}`,{...t.telemetryData,reason:t.reason},{}):(0,r.telemetry)(e,"ghostText.canceled",t.telemetryData.telemetryBlob.extendedBy({reason:t.reason,cancelledNetworkRequest:t.telemetryData.cancelledNetworkRequest?"true":"false"})))}},5798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.toPlainText=t.Logger=t.MultiLog=t.OutputChannelLog=t.ConsoleLog=t.LogTarget=t.verboseLogging=t.LogVerbose=t.LogLevel=void 0;const r=n(2137),o=n(9800),i=n(5489);var s;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(s=t.LogLevel||(t.LogLevel={}));class a{constructor(e){this.logVerbose=e}}function c(e){return e.get(a).logVerbose}t.LogVerbose=a,t.verboseLogging=c;class l{shouldLog(e,t){}}t.LogTarget=l,t.ConsoleLog=class extends l{constructor(e){super(),this.console=e}logIt(e,t,n,...r){c(e)||t==s.ERROR?this.console.error(n,...r):t==s.WARN&&this.console.warn(n,...r)}},t.OutputChannelLog=class extends l{constructor(e){super(),this.output=e}logIt(e,t,n,...r){this.output.appendLine(`${n} ${r.map(d)}`)}},t.MultiLog=class extends l{constructor(e){super(),this.targets=e}logIt(e,t,n,...r){this.targets.forEach((o=>o.logIt(e,t,n,...r)))}};class u{constructor(e,t){this.minLoggedLevel=e,this.context=t}setLevel(e){this.minLoggedLevel=e}stringToLevel(e){return s[e]}log(e,t,n,...o){const a=s[t];t==s.ERROR&&(0,i.telemetryError)(e,"log",i.TelemetryData.createAndMarkAsIssued({context:this.context,level:a,message:o.length>0?JSON.stringify(o):"no msg"}),n);const c=e.get(l),u=c.shouldLog(e,t);if(!1===u)return;if(void 0===u&&!this.shouldLog(e,t,this.context))return;const d=e.get(r.Clock).now().toISOString(),p=`[${a}] [${this.context}] [${d}]`;c.logIt(e,t,p,...o)}shouldLog(e,t,n){var r,i;if(c(e))return!0;const s=(0,o.getConfig)(e,o.ConfigKey.DebugFilterLogCategories);if(s.length>0&&!s.includes(n))return!1;if((0,o.isProduction)(e))return t>=this.minLoggedLevel;const a=(0,o.getConfig)(e,o.ConfigKey.DebugOverrideLogLevels);return t>=(null!==(i=null!==(r=this.stringToLevel(a["*"]))&&void 0!==r?r:this.stringToLevel(a[this.context]))&&void 0!==i?i:this.minLoggedLevel)}debug(e,...t){this.log(e,s.DEBUG,!1,...t)}info(e,...t){this.log(e,s.INFO,!1,...t)}warn(e,...t){this.log(e,s.WARN,!1,...t)}error(e,...t){this.log(e,s.ERROR,!1,...t)}secureError(e,t,...n){this.log(e,s.ERROR,!1,t),this.log(e,s.ERROR,!0,t,...n)}}function d(e){return"object"==typeof e?JSON.stringify(e):String(e)}t.Logger=u,t.toPlainText=d,t.logger=new u(s.INFO,"default")},39:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postRequest=t.Response=t.HelixFetcher=t.isAbortError=t.Fetcher=t.init=void 0;const r=n(8606),o=n(3582),i=n(3837),s=n(9800),a=n(4619),c=n(5489);let l,u=!1;t.init=function(e){if(u){if(e!==l)throw new Error(`Networking re-initialized with mismatched version (old: ${l}, new: ${e})`)}else l=e,u=!0};class d{}t.Fetcher=d,t.isAbortError=function(e){return e instanceof r.AbortError},t.HelixFetcher=class extends d{constructor(e){super(),this.ctx=e,this.createSocketFactory=e=>{const t=o.httpOverHttp({proxy:e});return e=>new Promise((n=>{t.createSocket(e,(e=>{n(e)}))}))},this.fetchApi=this.createFetchApi(e)}set proxySettings(e){this._proxySettings=e,this.fetchApi=this.createFetchApi(this.ctx)}get proxySettings(){return this._proxySettings}createFetchApi(e){const t=e.get(s.BuildInfo),n=t.getBuildType()===s.BuildType.DEV,o=t.getBuildType()===s.BuildType.NIGHTLY,i=(0,s.getHiddenConfig)(e,s.ConfigKey.DebugAcceptSelfSignedCertificate,{default:!1})&&(n||o);return r.context({userAgent:`GithubCopilot/${t.getVersion()}`,rejectUnauthorized:!i,socketFactory:this._proxySettings?this.createSocketFactory(this._proxySettings):void 0})}async fetch(e,t){const n={...t,body:t.body?t.body:t.json,signal:t.signal},r=await this.fetchApi.fetch(e,n);return new p(r.status,r.statusText,r.headers,(()=>r.text()),(()=>r.json()),(async()=>r.body))}disconnectAll(){return this.fetchApi.reset()}async makeAbortController(){return new r.AbortController}};class p{constructor(e,t,n,r,o,i){this.status=e,this.statusText=t,this.headers=n,this.getText=r,this.getJson=o,this.getBody=i,this.ok=this.status>=200&&this.status<300}async text(){return this.getText()}async json(){return this.getJson()}async body(){return this.getBody()}}t.Response=p,t.postRequest=async function(e,t,n,r,o,l,p){if(!u)throw new Error("Networking must be initialized before being used");const h={Authorization:i.format("Bearer %s",n),"X-Request-Id":o,"Openai-Organization":"github-copilot","VScode-SessionId":e.get(s.VscInfo).sessionId,"VScode-MachineId":e.get(s.VscInfo).machineId,...(0,s.editorVersionHeaders)(e)};r&&(h["OpenAI-Intent"]=r);const f=e.get(a.GhostTextDebounceManager).forceDelayMs;f&&(h["X-Copilot-Force-Delay"]=f.toString());const m={method:"POST",headers:h,json:l,timeout:3e4},g=e.get(d);if(p){const t=await g.makeAbortController();p.onCancellationRequested((()=>{(0,c.telemetry)(e,"networking.cancelRequest",c.TelemetryData.createAndMarkAsIssued({headerRequestId:o})),t.abort()})),m.signal=t.signal}return g.fetch(t,m).catch((n=>{if("ECONNRESET"==n.code||"ETIMEDOUT"==n.code||"ERR_HTTP2_INVALID_SESSION"==n.code||"ERR_HTTP2_GOAWAY_SESSION"==n.message)return(0,c.telemetry)(e,"networking.disconnectAll"),g.disconnectAll().then((()=>g.fetch(t,m)));throw n}))}},9035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationSender=void 0,t.NotificationSender=class{}},7553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEngineURL=t.TEST_ENGINE_PATHS=t.OPENAI_PROXY_HOST=void 0;const r=n(9800),o=n(6905),i=n(913);t.OPENAI_PROXY_HOST="https://copilot-proxy.githubusercontent.com";const s="/v1/engines/copilot-codex";t.TEST_ENGINE_PATHS=[s],t.getEngineURL=async function(e,n="",a,c){return function(e,n){let o=function(e){return(0,i.isRunningInTest)(e)?(0,r.getConfig)(e,r.ConfigKey.DebugTestOverrideProxyUrl):(0,r.getConfig)(e,r.ConfigKey.DebugOverrideProxyUrl)}(e);return 0==o.length&&(o=t.OPENAI_PROXY_HOST),`${o}${n}`}(e,await async function(e,t,n,i){const a=(0,r.getConfig)(e,r.ConfigKey.DebugOverrideEngine);if(a)return`/v1/engines/${a}`;const c=await e.get(o.Features).customEngine(t,n,i);return""!==c?`/v1/engines/${c}`:s}(e,n,a,c))}},2031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveOpenAIFetcher=t.postProcessChoices=t.OpenAIFetcher=t.extractEngineName=t.getProcessingTime=t.getRequestId=t.CopilotUiKind=void 0;const r=n(3837),o=n(5765),i=n(1661),s=n(9800),a=n(4619),c=n(5798),l=n(39),u=n(6635),d=n(3591),p=n(5489),h=n(598),f=n(4586),m=new c.Logger(c.LogLevel.INFO,"fetch");var g;function _(e,t){return{headerRequestId:e.headers.get("x-request-id")||"",completionId:t&&t.id?t.id:"",created:t&&t.created?t.created:0,serverExperiments:e.headers.get("X-Copilot-Experiment")||"",deploymentId:e.headers.get("azureml-model-deployment")||""}}function y(e){const t=e.headers.get("openai-processing-ms");return t?parseInt(t,10):0}function v(e,t){return t.split("/").pop()||(m.error(e,"Malformed engine URL: "+t),t)}!function(e){e.GhostText="ghostText",e.Panel="synthesize"}(g=t.CopilotUiKind||(t.CopilotUiKind={})),t.getRequestId=_,t.getProcessingTime=y,t.extractEngineName=v;class b{}function w(e,t){return null!=t&&t?e:(0,i.asyncIterableFilter)(e,(async e=>e.completionText.trim().length>0))}t.OpenAIFetcher=b,t.postProcessChoices=w,t.LiveOpenAIFetcher=class extends b{async fetchAndStreamCompletions(e,t,n,r,o){const s=e.get(u.StatusReporter),a="completions",l=await this.fetchWithParameters(e,a,t,o);if(null==o?void 0:o.isCancellationRequested){const t=await l.body();try{t.destroy()}catch(t){c.logger.error(e,`Error destroying stream: ${t}`)}return{type:"canceled",reason:"after fetch request"}}if(void 0===l){const n=this.createTelemetryData(a,e,t);return s.setWarning(),n.properties.error="Response was undefined",(0,p.telemetry)(e,"request.shownWarning",n),{type:"failed",reason:"fetch response was undefined"}}if(200!==l.status){const n=this.createTelemetryData(a,e,t);return this.handleError(e,s,n,l)}return{type:"success",choices:w((0,i.asyncIterableMap)((0,f.processSSE)(e,l,r,o),(async t=>(0,f.prepareSolutionForReturn)(e,t,n))),t.allowEmptyChoices),getProcessingTime:()=>y(l)}}createTelemetryData(e,t,n){return p.TelemetryData.createAndMarkAsIssued({endpoint:e,engineName:v(t,n.engineUrl),uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,t,n,i){const f=(0,s.getLanguageConfig)(e,s.ConfigKey.Stops),m={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:(0,s.getConfig)(e,s.ConfigKey.SolutionLength),temperature:(0,h.getTemperatureForSamples)(e,n.count),top_p:(0,s.getConfig)(e,s.ConfigKey.TopP),n:n.count,logprobs:2,stop:f},y=(0,d.tryGetGitHubNWO)(n.repoInfo);return void 0!==y&&(m.nwo=y),await e.get(s.BlockModeConfig).forLanguage(e,n.languageId)===s.BlockMode.Server&&(m.feature_flags=["trim_to_block"]),n.postOptions&&Object.assign(m,n.postOptions),c.logger.info(e,`[fetchCompletions] engine ${n.engineUrl}`),await function(e,t,n,o,i,s,d,h,f){var m;const y=e.get(u.StatusReporter),b=r.format("%s/%s",n,o);if(!d)return void c.logger.error(e,`Failed to send request to ${b} due to missing key`);const w=p.TelemetryData.createAndMarkAsIssued({endpoint:o,engineName:v(e,n),uiKind:h},(0,p.telemetrizePromptLength)(t));for(const[e,t]of Object.entries(s))"prompt"!=e&&"suffix"!=e&&(w.properties[`request.option.${e}`]=null!==(m=JSON.stringify(t))&&void 0!==m?m:"undefined");w.properties.headerRequestId=i,(0,p.telemetry)(e,"request.sent",w);const x=(0,p.now)(),T=function(e){switch(e){case g.GhostText:return"copilot-ghost";case g.Panel:return"copilot-panel"}}(h);return(0,l.postRequest)(e,b,d,T,i,s,f).then((n=>{const r=_(n,void 0);w.extendWithRequestId(r);const o=(0,p.now)()-x;w.measurements.totalTimeMs=o,c.logger.info(e,`request.response: [${b}] took ${o} ms`),c.logger.debug(e,"request.response properties",w.properties),c.logger.debug(e,"request.response measurements",w.measurements),c.logger.debug(e,`prompt: ${JSON.stringify(t)}`),(0,p.telemetry)(e,"request.response",w),(0,p.logEnginePrompt)(e,t,w);const i=n.headers.get("x-copilot-delay"),s=i?parseInt(i,10):0;return e.get(a.GhostTextDebounceManager).extraDebounceMs=s,n})).catch((t=>{var n,r,o,i;if((0,l.isAbortError)(t))throw t;y.setWarning();const s=w.extendedBy({error:"Network exception"});(0,p.telemetry)(e,"request.shownWarning",s),w.properties.code=String(null!==(n=t.code)&&void 0!==n?n:""),w.properties.errno=String(null!==(r=t.errno)&&void 0!==r?r:""),w.properties.message=String(null!==(o=t.message)&&void 0!==o?o:""),w.properties.type=String(null!==(i=t.type)&&void 0!==i?i:"");const a=(0,p.now)()-x;throw w.measurements.totalTimeMs=a,c.logger.debug(e,`request.response: [${b}] took ${a} ms`),c.logger.debug(e,"request.error properties",w.properties),c.logger.debug(e,"request.error measurements",w.measurements),c.logger.error(e,`Request Error: ${t.message}`),(0,p.telemetry)(e,"request.error",w),t}))}(e,n.prompt,n.engineUrl,t,n.ourRequestId,m,await e.get(o.CopilotTokenManager).getCopilotToken(e),n.uiKind,i)}async handleError(e,t,n,r){if(t.setWarning(),n.properties.error=`Response status was ${r.status}`,n.properties.status=String(r.status),(0,p.telemetry)(e,"request.shownWarning",n),401===r.status||403===r.status)return e.get(o.CopilotTokenManager).resetCopilotToken(e,r.status),{type:"failed",reason:`token expired or invalid: ${r.status}`};if(499===r.status)return m.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"};const i=await r.text();return 466===r.status?(t.setError(i),m.info(e,i),{type:"failed",reason:`client not supported: ${i}`}):(m.error(e,"Unhandled status from server:",r.status,i),{type:"failed",reason:`unhandled status from server: ${r.status} ${i}`})}}},598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTemperatureForSamples=t.calculateMeanAlternativeLogProb=t.calculateMeanLogProb=t.cleanupIndentChoices=t.convertToAPIChoice=t.DEFAULT_CHARACTER_MULTIPLIER=t.MAX_PROMPT_LENGTH=t.OpenAIFetcher=t.LiveOpenAIFetcher=t.getRequestId=t.CopilotUiKind=void 0;const r=n(9800),o=n(5798),i=n(5489),s=n(913);var a=n(2031);function c(e,t){if(t.logprobs.token_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--)e+=t.logprobs.token_logprobs[o],n+=1;return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}function l(e,t){if(t.logprobs.top_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--){const r={...t.logprobs.top_logprobs[o]};delete r[t.logprobs.tokens[o]],e+=Math.max(...Object.values(r)),n+=1}return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}Object.defineProperty(t,"CopilotUiKind",{enumerable:!0,get:function(){return a.CopilotUiKind}}),Object.defineProperty(t,"getRequestId",{enumerable:!0,get:function(){return a.getRequestId}}),Object.defineProperty(t,"LiveOpenAIFetcher",{enumerable:!0,get:function(){return a.LiveOpenAIFetcher}}),Object.defineProperty(t,"OpenAIFetcher",{enumerable:!0,get:function(){return a.OpenAIFetcher}}),t.MAX_PROMPT_LENGTH=1500,t.DEFAULT_CHARACTER_MULTIPLIER=3,t.convertToAPIChoice=function(e,t,n,r,o,s,a,u){return(0,i.logEngineCompletion)(e,t,n,o,r),{completionText:t,meanLogProb:c(e,n),meanAlternativeLogProb:l(e,n),choiceIndex:r,requestId:o,modelInfo:u,blockFinished:s,tokens:n.logprobs.tokens,numTokens:n.logprobs.tokens.length,telemetryData:a}},t.cleanupIndentChoices=async function*(e,t){for await(const n of e){const e={...n},r=e.completionText.split("\n");for(let e=0;e=0&&n<=1?n:t<=1?0:t<10?.2:t<20?.4:.8}},4586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareSolutionForReturn=t.processSSE=t.splitChunk=void 0;const r=n(5798),o=n(598),i=new r.Logger(r.LogLevel.INFO,"streamChoices");function s(e){const t=e.split("\n"),n=t.pop();return[t.filter((e=>""!=e)),n]}t.splitChunk=s,t.processSSE=async function*(e,t,n,r){var a,c,l,u,d,p,h,f;const m=await t.body();m.setEncoding("utf8");let g=(0,o.getRequestId)(t);i.debug(e,`requestId: ${g.headerRequestId}`);const _={};let y="";for await(const v of m){if(null==r?void 0:r.isCancellationRequested)return i.info(e,"Cancelled after awaiting body chunk"),void m.destroy();i.debug(e,"chunk",v.toString());const[b,w]=s(y+v.toString());y=w;for(const s of b){const y=s.slice("data:".length).trim();if("[DONE]"==y){for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"DONE",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding on DONE"),void m.destroy()}return}let v;try{v=JSON.parse(y)}catch(t){i.error(e,"Error parsing JSON stream data",s);continue}if(void 0!==v.choices||void 0===v.error){0==g.created&&(g=(0,o.getRequestId)(t,v),0==g.created&&i.error(e,`Request id invalid, should have "completionId" and "created": ${g}`,g));for(let t=0;t-1)&&(y=await n(s.text.join("")),null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after awaiting finishedCb"),void m.destroy();if(o.finish_reason||void 0!==y){if(yield{solution:s,finishOffset:y,reason:JSON.stringify(o.finish_reason),requestId:g,index:o.index},null==r?void 0:r.isCancellationRequested)return i.debug(e,"Cancelled after yielding finished choice"),void m.destroy();_[o.index]=null}}}else i.error(e,"Error in response:",v.error.message)}}for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"Iteration Done",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding after iteration done"),void m.destroy()}if(y.length>0)try{const t=JSON.parse(y);void 0!==t.error&&i.error(e,`Error in response: ${t.error.message}`,t.error)}catch(t){i.error(e,`Error parsing extraData: ${y}`)}},t.prepareSolutionForReturn=function(e,t,n){let r=t.solution.text.join(""),s=!1;void 0!==t.finishOffset&&(i.debug(e,`solution ${t.index}: early finish at offset ${t.finishOffset}`),r=r.substring(0,t.finishOffset),s=!0),i.info(e,`solution ${t.index} returned. finish reason: [${t.reason}] finishOffset: [${t.finishOffset}] completionId: [{${t.requestId.completionId}}] created: [{${t.requestId.created}}]`);const a={text:(c=t.solution).text.join(""),logprobs:{token_logprobs:c.logprobs.reduce(((e,t)=>e.concat(t)),[]),top_logprobs:c.top_logprobs.reduce(((e,t)=>e.concat(t)),[]),text_offset:c.text_offset.reduce(((e,t)=>e.concat(t)),[]),tokens:c.tokens.reduce(((e,t)=>e.concat(t)),[])}};var c;return(0,o.convertToAPIChoice)(e,r,a,t.index,t.requestId,s,n)}},3402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postInsertionTasks=t.postRejectionTasks=t.captureCode=void 0;const r=n(5135),o=n(1749),i=n(5798),s=n(7917),a=n(4090),c=n(9558),l=n(5489),u=n(819),d=new i.Logger(i.LogLevel.INFO,"post-insertion"),p=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}];async function h(e,t,n){const r=await e.get(u.TextDocumentManager).getTextDocument(t);if(!r)return d.info(e,`Could not get document for ${t.fsPath}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1,promptElementRanges:[]},capturedCode:"",terminationOffset:0};const o=r.getText(),i=o.substring(0,n),c=r.positionAt(n),l=await(0,a.extractPrompt)(e,r,c),p="prompt"===l.type?l.prompt:{prefix:i,suffix:"",isFimEnabled:!1,promptElementRanges:[]},h=o.substring(n),f=(0,s.contextIndentationFromText)(i,n,r.languageId),m=(0,s.indentationBlockFinished)(f,void 0),g=await m(h),_=Math.min(o.length,n+(g?2*g:500));return{prompt:p,capturedCode:o.substring(n,_),terminationOffset:null!=g?g:-1}}function f(e,t,n,r){const o=e.substring(Math.max(0,r-n),Math.min(e.length,r+t.length+n)),i=(0,c.lexEditDistance)(o,t),s=i.lexDistance/i.needleLexLength,{distance:a}=(0,c.editDistance)(o.substring(i.startOffset,i.endOffset),t);return{relativeLexEditDistance:s,charEditDistance:a,completionLexLength:i.needleLexLength,foundOffset:i.startOffset+Math.max(0,r-n),lexEditDistance:i.lexDistance,stillInCodeHeuristic:s<=.5?1:0}}t.captureCode=h,t.postRejectionTasks=function(e,t,n,i,s){s.forEach((({completionText:n,completionTelemetryData:r})=>{d.debug(e,`${t}.rejected choiceIndex: ${r.properties.choiceIndex}`),(0,o.telemetryRejected)(e,t,r)}));const a=new r.ChangeTracker(e,i,n);p.filter((e=>e.captureRejection)).map((r=>{a.push((async()=>{d.debug(e,`Original offset: ${n}, Tracked offset: ${a.offset}`);const{completionTelemetryData:o}=s[0],{prompt:c,capturedCode:u,terminationOffset:p}=await h(e,i,a.offset);let f;f=c.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(c.prefix),hypotheticalPromptSuffixJson:JSON.stringify(c.suffix)}:{hypotheticalPromptJson:JSON.stringify(c.prefix)};const m=o.extendedBy({...f,capturedCodeJson:JSON.stringify(u)},{timeout:r.seconds,insertionOffset:n,trackedOffset:a.offset,terminationOffsetInCapturedCode:p});d.debug(e,`${t}.capturedAfterRejected choiceIndex: ${o.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterRejected",m,!0)}),1e3*r.seconds)}))},t.postInsertionTasks=async function(e,t,n,i,s,a){d.debug(e,`${t}.accepted choiceIndex: ${a.properties.choiceIndex}`),(0,o.telemetryAccepted)(e,t,a);const c=new r.ChangeTracker(e,s,i),m=n.trim();p.map((n=>c.push((()=>async function(e,t,n,r,o,i,s,a){const c=await e.get(u.TextDocumentManager).getTextDocument(o);if(c){const u=c.getText();let p=f(u,n,50,a.offset);p.stillInCodeHeuristic||(p=f(u,n,1500,a.offset)),d.debug(e,`stillInCode: ${p.stillInCodeHeuristic?"Found":"Not found"}! Completion '${n}' in file ${o.fsPath}. lexEditDistance fraction was ${p.relativeLexEditDistance}. Char edit distance was ${p.charEditDistance}. Inserted at ${r}, tracked at ${a.offset}, found at ${p.foundOffset}. choiceIndex: ${s.properties.choiceIndex}`);const m=s.extendedBy({},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset}).extendedBy({},p);if((0,l.telemetry)(e,t+".stillInCode",m),i.captureCode){const{prompt:n,capturedCode:c,terminationOffset:u}=await h(e,o,a.offset);let p;p=n.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(n.prefix),hypotheticalPromptSuffixJson:JSON.stringify(n.suffix)}:{hypotheticalPromptJson:JSON.stringify(n.prefix)};const f=s.extendedBy({...p,capturedCodeJson:JSON.stringify(c)},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset,terminationOffsetInCapturedCode:u});d.debug(e,`${t}.capturedAfterAccepted choiceIndex: ${s.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterAccepted",f,!0)}}}(e,t,m,i,s,n,a,c)),1e3*n.seconds)))}},6635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpStatusReporter=t.StatusReporter=void 0;class n{}t.StatusReporter=n,t.NoOpStatusReporter=class extends n{setProgress(){}removeProgress(){}setWarning(){}setError(e){}forceNormal(){}}},7917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indentationBlockFinished=t.completionCutOrContinue=t.contextIndentationFromText=t.contextIndentation=t.getNodeStart=t.isBlockBodyFinishedWithPrefix=t.isBlockBodyFinished=t.isEmptyBlockStart=void 0;const r=n(2369),o=n(2273);t.isEmptyBlockStart=function(e,t){return o.isEmptyBlockStart(e.languageId,e.getText(),e.offsetAt(t))},t.isBlockBodyFinished=function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n)),c=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,a,i,c)},t.isBlockBodyFinishedWithPrefix=function(e,t,n,i,s){const a=e.get(r.LocationFactory),c=t.getText(a.range(a.position(0,0),n)),l=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,c+s,i,l+s.length)},t.getNodeStart=async function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n))+i,c=await o.getNodeStart(t.languageId,a,t.offsetAt(n));if(c)return t.positionAt(c)};const i=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map((e=>e+"\\b"))),s=new RegExp(`^(${i.join("|")})`);function a(e){return s.test(e.trimLeft().toLowerCase())}function c(e){const t=/^(\s*)([^]*)$/.exec(e);return t&&t[2]&&t[2].length>0?t[1].length:void 0}function l(e,t,n){const r=e.slice(0,t).split("\n"),o=e.slice(t).split("\n");function i(e,t,r){let o,i,s=t;for(;void 0===o&&s>=0&&s=0&&!e[s].trim().startsWith('"""');)s--;if(s>=0)for(o=void 0,s--;void 0===o&&s>=0;)o=c(e[s]),i=s,s--}}return[o,i]}const[s,a]=i(r,r.length-1,-1),l=(()=>{if(void 0!==s&&void 0!==a)for(let e=a-1;e>=0;e--){const t=c(r[e]);if(void 0!==t&&t{const r=u(n,e,t);return"continue"===r?void 0:r}}},4090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractPrompt=t.trimLastLine=t._contextTooShort=t.MIN_PROMPT_CHARS=void 0;const r=n(4617),o=n(9800),i=n(5225),s=n(6905),a=n(819),c=n(2273),l=n(3591);function u(e){const t=e.split("\n"),n=t[t.length-1],r=n.length-n.trimRight().length,o=e.slice(0,e.length-r),i=e.substr(o.length);return[n.length==r?o:e,i]}async function d(e,n,d,p,h,f){var m;const g=null!==(m=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,h.toString())))&&void 0!==m?m:"",_=await(0,o.suffixPercent)(e,g,f);if((_>0?n.length:d)20||s+i.getText().length>2e5)break;"file"==i.uri.scheme&&i.fileName!==t&&i.languageId===n&&(r.push({uri:i.uri.toString(),relativePath:await e.get(a.TextDocumentManager).getRelativePath(i),languageId:i.languageId,source:i.getText()}),s+=i.getText().length)}return r}(e,d.fsPath,p);const m={uri:d.toString(),source:t,offset:n,relativePath:u,languageId:p},g=null!==(h=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,d.toString())))&&void 0!==h?h:"";let _={maxPromptLength:2048-(0,o.getConfig)(e,o.ConfigKey.SolutionLength),neighboringTabs:await e.get(s.Features).neighboringTabsOption(g,p),suffixStartMode:await e.get(s.Features).suffixStartMode(g,p)};const y=await(0,o.suffixPercent)(e,g,p),v=await(0,o.suffixMatchThreshold)(e,g,p);y>0&&(_={..._,includeSiblingFunctions:r.SiblingOption.NoSiblings,suffixPercent:y,suffixMatchThreshold:v});const b=e.get(r.FileSystem);return await(0,c.getPrompt)(b,m,_,f)}(e,n,d,p,h,f),[E,C]=u(v),S=Date.now();return{type:"prompt",prompt:{prefix:E,suffix:b,isFimEnabled:_>0,promptElementRanges:T.ranges},trailingWs:C,promptChoices:w,computeTimeMs:S-y,promptBackground:x}}async function p(e,t,n){const r=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,t.getText(),t.offsetAt(n),r,t.uri,t.languageId)}t.MIN_PROMPT_CHARS=10,t._contextTooShort={type:"contextTooShort"},t.trimLastLine=u,t.extractPrompt=function(e,t,n){const r=e.get(a.TextDocumentManager).findNotebook(t);return void 0===r?p(e,t,n):async function(e,t,n,r){const o=n.getCells().find((e=>e.document.uri===t.uri));if(o){const i=n.getCells().filter((e=>e.index0?i.map((e=>e.document.getText())).join("\n\n")+"\n\n":"",c=s+t.getText(),l=s.length+t.offsetAt(r),u=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,c,l,u,t.uri,o.document.languageId)}return p(e,t,r)}(e,t,r,n)}},2273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsesWithoutError=t.getPrompt=t.getNodeStart=t.getFunctionPositions=t.getBlockCloseToken=t.isSupportedLanguageId=t.isBlockBodyFinished=t.isEmptyBlockStart=t.terminate=t.init=void 0;const r=n(4617);let o=null;const i=new Map;let s=0;t.init=function(t,u,d){if(!u){const t=n(3094);for(const n of[...a,...c])e.exports[n]=t[n];return}for(const n of a)e.exports[n]=l(t,d,n);e.exports.getPrompt=function(e,t){return function(n,...r){const a=s++;return new Promise(((n,s)=>{i.set(a,{resolve:n,reject:s}),t.debug(e,`Proxy getPrompt - ${a}`),null==o||o.postMessage({id:a,fn:"getPrompt",args:r})}))}}(t,d),o=r.createWorker(),i.clear(),s=0;const p=t.get(r.FileSystem);function h(e){d.error(t,e);for(const t of i.values())t.reject(e);i.clear()}o.on("message",(({id:e,err:n,res:r})=>{const o=i.get(e);d.debug(t,`Response ${e} - ${r}, ${n}`),o&&(i.delete(e),n?o.reject(n):o.resolve(r))})),o.on("error",h),o.on("exit",(e=>{0!==e&&h(new Error(`Worker thread exited with code ${e}.`))})),o.on("readFileReq",(e=>{d.debug(t,`READ_FILE_REQ - ${e}`),p.readFile(e).then((e=>{null==o||o.emit("readFileRes",e)})).catch(h)})),o.on("mtimeRes",(e=>{d.debug(t,`mTime_REQ - ${e}`),p.mtime(e).then((e=>{null==o||o.emit("mtimeRes",e)})).catch(h)}))},t.terminate=function(){o&&(o.removeAllListeners(),o.terminate(),o=null,i.clear())};const a=["getFunctionPositions","isEmptyBlockStart","isBlockBodyFinished","getNodeStart","parsesWithoutError"],c=["isSupportedLanguageId","getBlockCloseToken"];function l(e,t,n){return function(...r){const a=s++;return new Promise(((s,c)=>{i.set(a,{resolve:s,reject:c}),t.debug(e,`Proxy ${n}`),null==o||o.postMessage({id:a,fn:n,args:r})}))}}t.isEmptyBlockStart=r.isEmptyBlockStart,t.isBlockBodyFinished=r.isBlockBodyFinished,t.isSupportedLanguageId=r.isSupportedLanguageId,t.getBlockCloseToken=r.getBlockCloseToken,t.getFunctionPositions=r.getFunctionPositions,t.getNodeStart=r.getNodeStart,t.getPrompt=r.getPrompt,t.parsesWithoutError=r.parsesWithoutError},3591:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputationStatus=t.getRepoUrlUsingChildProcess=t.getRepoUrlFromConfigText=t.parseRepoUrl=t.extractRepoInfoInBackground=t.tryGetGitHubNWO=void 0;const r=n(1017),o=n(140),i=n(2081),s=n(4617);t.tryGetGitHubNWO=function(e){if(void 0!==e&&e!==d.PENDING)return"github.com"===e.hostname?e.owner+"/"+e.repo:void 0},t.extractRepoInfoInBackground=function(e,t){if(!t)return;const n=(0,r.dirname)(t);return a(e,n)};const a=function(e,t){const n=new o.LRUCache(1e4),i=new Set;return(e,...t)=>{const o=JSON.stringify(t),a=n.get(o);if(a)return a.result;if(i.has(o))return d.PENDING;const c=async function(e,t){var n;const o=await async function(e,t){let n=t+"_add_to_make_longer";const o=e.get(s.FileSystem);for(;t.length>1&&t.length!0),(()=>!1)))return t;n=t,t=(0,r.dirname)(t)}}(e,t);if(!o)return;const i=e.get(s.FileSystem),a=(0,r.join)(o,".git","config"),c=(await i.readFile(a)).toString(),d=null!==(n=u(c))&&void 0!==n?n:"";return{baseFolder:o,url:d,...l(d)}}(e,...t);return i.add(o),c.then((e=>{n.put(o,new p(e)),i.delete(o)})),d.PENDING}}(),c=/([^:/@]+)[:/]([^/:]+)\/([^/]+)+/;function l(e){var t,n,r,o;const i=null!==(t=e.match(c))&&void 0!==t?t:[];return{hostname:null!==(n=i[1])&&void 0!==n?n:"",owner:null!==(r=i[2])&&void 0!==r?r:"",repo:i[3]&&i[3].endsWith(".git")?i[3].slice(0,-4):null!==(o=i[3])&&void 0!==o?o:""}}function u(e){var t;const n=/^\s*\[\s*remote\s+"((\\\\|\\"|[^\\"])+)"/,r=/^\s*\[remote.([^"\s]+)/,o=/^\s*url\s*=\s*([^\s#;]+)/,i=/^\s*\[/;let s,a,c=!1;for(const l of e.split("\n"))if(c&&void 0!==s){if(s+=l,l.endsWith("\\"))s=s.substring(0,s.length-1);else if(c=!1,"origin"===a)return s}else{const e=null!==(t=l.match(n))&&void 0!==t?t:l.match(r);if(e)a=e[1];else if(l.match(i))a=void 0;else{if(s&&"origin"!==a)continue;{const e=l.match(o);if(e)if(s=e[1],s.endsWith("\\"))s=s.substring(0,s.length-1),c=!0;else if("origin"===a)return s}}}return s}var d;t.parseRepoUrl=l,t.getRepoUrlFromConfigText=u,t.getRepoUrlUsingChildProcess=async function(e){const t=(0,r.dirname)(e),n=(0,i.execFile)("git",["config","--get","remote.origin.url"],{cwd:t,encoding:"utf8"});return await new Promise(((e,t)=>{var r;null===(r=n.stdout)||void 0===r||r.on("data",(t=>{t=null==t?void 0:t.replace(/\n$/,""),e(t||void 0)})),n.on("exit",(()=>{e(void 0)}))}))},function(e){e[e.PENDING=0]="PENDING"}(d=t.ComputationStatus||(t.ComputationStatus={}));class p{constructor(e){this.result=e}}},4604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRepetitive=void 0;const n=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function r(e){const t=function(e){const t=Array(e.length).fill(0);t[0]=-1;let n=-1;for(let r=1;r=0&&e[n+1]!==e[r];)n=t[n];e[n+1]===e[r]&&n++,t[r]=n}return t}(e);for(const r of n)if(!(e.lengthe.trim().length>0)))}},9558:(e,t)=>{"use strict";function n(e,t,n=((e,t)=>e===t?0:1)){if(0===t.length||0===e.length)return{distance:t.length,startOffset:0,endOffset:0};let r=new Array(t.length+1).fill(0),o=new Array(t.length+1).fill(0),i=new Array(e.length+1).fill(0),s=new Array(e.length+1).fill(0),a=t[0];for(let t=0;t0?t-1:0;for(let c=1;c0&&(yield n),n=o,r=e)}n.length>0&&(yield n)}function s(e,t,n,r){const o=[];let i=0;for(const s of n(e))r(s)&&(t.has(s)||t.set(s,t.size),o.push([t.get(s),i])),i+=s.length;return[o,t]}function a(e){return" "!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.lexEditDistance=t.lexicalAnalyzer=t.lexGeneratorWords=t.reverseLexDictionary=t.emptyLexDictionary=t.editDistance=void 0,t.editDistance=n,t.emptyLexDictionary=r,t.reverseLexDictionary=o,t.lexGeneratorWords=i,t.lexicalAnalyzer=s,t.lexEditDistance=function(e,t,c=i){const[l,u]=s(e,r(),c,a),[d,p]=s(t,u,c,a);if(0===d.length||0===l.length)return{lexDistance:d.length,startOffset:0,endOffset:0,haystackLexLength:l.length,needleLexLength:d.length};const h=o(p),f=d.length,m=h[d[0][0]],g=h[d[f-1][0]],_=n(l.map((e=>e[0])),d.map((e=>e[0])),(function(e,t,n,r){if(0===r||r===f-1){const e=h[l[n][0]];return 0==r&&e.endsWith(m)||r==f-1&&e.startsWith(g)?0:1}return e===t?0:1})),y=l[_.startOffset][1];let v=_.endOffset0&&" "===e[v-1]&&--v,{lexDistance:_.distance,startOffset:y,endOffset:v,haystackLexLength:l.length,needleLexLength:d.length}}},1523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextDisplayQuantiles=t.ghostTextDisplayLanguageParameters=t.ghostTextDisplayMeanAlternativeLogProbParameter=t.ghostTextDisplayMeanLogProbParameter=t.ghostTextDisplayLog1pcompCharLenParameter=t.ghostTextDisplayInterceptParameter=void 0,t.ghostTextDisplayInterceptParameter=2.98410452738298,t.ghostTextDisplayLog1pcompCharLenParameter=-.838732736843507,t.ghostTextDisplayMeanLogProbParameter=1.50314646255716,t.ghostTextDisplayMeanAlternativeLogProbParameter=-.237798634012662,t.ghostTextDisplayLanguageParameters={python:.314368072478742},t.ghostTextDisplayQuantiles={.01:.225800751784931,.02:.290204307767402,.03:.333153496466045,.05:.404516749849559,.1:.513216040545626,.2:.626904979128674,.3:.694880719658273,.4:.743100684947291,.5:.782524520571946,.6:.816856186092243,.7:.84922977716585,.8:.883694877241999,.9:.921859050950077,.95:.944571268106974,.99:.969535563141733}},1153:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextScoreQuantile=t.ghostTextScoreConfidence=void 0;const r=n(5798),o=n(1523),i=(new r.Logger(r.LogLevel.INFO,"restraint"),{link:e=>Math.exp(e)/(1+Math.exp(e)),unlink:e=>Math.log(e/(1-e))});class s{constructor(e,t,n){this.name=e,this.coefficient=t,this.transformation=n||(e=>e)}contribution(e){return this.coefficient*this.transformation(e)}}const a=new class{constructor(e,t,n){if(this.link=i,this.intercept=e,this.coefficients=t,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(const e in n)this.logitsToQuantiles.set(n[e],Number(e))}predict(e,t){let n=this.intercept;for(const e of this.coefficients){const r=t[e.name];if(void 0===r)return NaN;n+=e.contribution(r)}return this.link.link(n)}quantile(e,t){return function(e,t){const n=Math.min(...Array.from(t.keys()).filter((t=>t>=e))),r=Math.max(...Array.from(t.keys()).filter((t=>tMath.log(1+e))),new s("meanLogProb",o.ghostTextDisplayMeanLogProbParameter),new s("meanAlternativeLogProb",o.ghostTextDisplayMeanAlternativeLogProbParameter)].concat(Object.entries(o.ghostTextDisplayLanguageParameters).map((e=>new s(e[0],e[1])))),o.ghostTextDisplayQuantiles);t.ghostTextScoreConfidence=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.predict(e,n)},t.ghostTextScoreQuantile=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.quantile(e,n)}},3883:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkSuffix=t.postProcessChoice=void 0;const r=n(2273),o=n(5489),i=n(913),s=n(4604);t.postProcessChoice=async function(e,t,n,a,c,l,u){if((0,s.isRepetitive)(c.tokens)){const t=o.TelemetryData.createAndMarkAsIssued();return t.extendWithRequestId(c.requestId),(0,o.telemetry)(e,"repetition.detected",t,!0),void u.info(e,"Filtered out repetitive solution")}const d={...c};if(function(e,t,n){let r="",o=t.line+1;for(;""===r&&o1);return o}(e,n,a,d.completionText,l),d.completionText?d:void 0},t.checkSuffix=function(e,t,n){const r=e.lineAt(t.line).text.substring(t.character);if(r.length>0){if(-1!==n.completionText.indexOf(r))return!0;{let e=0;for(const t of r){const r=n.completionText.indexOf(t,e+1);if(!(r>e)){e=-1;break}e=r}return-1!==e}}return!1}},5489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forceSendingTelemetry=t.dropTelemetryConfig=t.setTelemetryConfig=t.logEnginePrompt=t.logEngineCompletion=t.telemetryError=t.telemetryException=t.telemetryRaw=t.telemetryExpProblem=t.telemetry=t.configureReporter=t.telemetryEndpointUrlOverride=t.noTelemetryEndpointUrlOverride=t.TelemetryEndpointUrlOverride=t.now=t.telemetrizePromptLength=t.TelemetryData=t.setupEmptyReporters=t.setupStandardReporters=t.TelemetryReporters=t.APP_INSIGHTS_KEY_SECURE=t.APP_INSIGHTS_KEY=void 0;const r=n(6236),o=n(9929),i=n(9800),s=n(6905),a=n(4914),c=n(913),l=n(9591);t.APP_INSIGHTS_KEY="7d7048df-6dd0-4048-bb23-b716c1461f8f",t.APP_INSIGHTS_KEY_SECURE="3fdd7f28-937a-48c8-9a21-ba337db23bd1";class u{constructor(e,t){this.reporter=e,this.reporterSecure=t}getReporter(e){return this.reporter}getSecureReporter(e){if(y())return this.reporterSecure;if((0,c.shouldFailForDebugPurposes)(e))throw new Error("Internal error: telemetry opt-out")}setReporter(e){this.reporter=e}setSecureReporter(e){this.reporterSecure=e}async deactivate(){let e=Promise.resolve();this.reporter&&(e=this.reporter.dispose(),this.reporter=void 0);let t=Promise.resolve();this.reporterSecure&&(t=this.reporterSecure.dispose(),this.reporterSecure=void 0),await Promise.all([e,t])}hackOptOutListener(){this.reporter.optOutListener={dispose(){}},this.reporterSecure.optOutListener={dispose(){}}}setToken(e){this.reporter&&this.configureToken(this.reporter,e),this.reporterSecure&&this.configureToken(this.reporterSecure,e)}configureToken(e,t){const n=e;n&&n.appInsightsClient&&(n.appInsightsClient.context.tags.github_telemetry_token=t.token)}}let d;function p(e,t,n,r){const i=new o.default(t,n,r);return _(e,i),i}t.TelemetryReporters=u,t.setupStandardReporters=function(e,n){const r=(0,i.getVersion)(e),o=p(e,n,r,t.APP_INSIGHTS_KEY),s=p(e,n,r,t.APP_INSIGHTS_KEY_SECURE),a=e.get(u);return a.setReporter(o),a.setSecureReporter(s),a},t.setupEmptyReporters=function(){return new u};class h{constructor(e,t,n){this.properties=e,this.measurements=t,this.issuedTime=n}static createAndMarkAsIssued(e,t){return new h(e||{},t||{},m())}extendedBy(e,t){const n={...this.properties,...e},r={...this.measurements,...t},o=new h(n,r,this.issuedTime);return o.displayedTime=this.displayedTime,o.filtersAndExp=this.filtersAndExp,o}markAsDisplayed(){void 0===this.displayedTime&&(this.displayedTime=m())}async extendWithExpTelemetry(e){this.filtersAndExp||await e.get(s.Features).addExpAndFilterToTelemetry(this),this.filtersAndExp.exp.addToTelemetry(this),this.filtersAndExp.filters.addToTelemetry(this)}extendWithEditorAgnosticFields(e){this.properties.editor_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorInfo(e)),this.properties.editor_plugin_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e));const t=e.get(i.VscInfo);this.properties.client_machineid=t.machineId,this.properties.client_sessionid=t.sessionId,this.properties.copilot_version=`copilot/${(0,i.getVersion)(e)}`,this.properties.common_extname=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).name,this.properties.common_extversion=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).version}extendWithConfigProperties(e){const t=(0,i.dumpConfig)(e);try{t["copilot.build"]=(0,i.getBuild)(e),t["copilot.buildType"]=(0,i.getBuildType)(e)}catch(e){}d&&(t["copilot.trackingId"]=d.trackingId),this.properties={...this.properties,...t}}extendWithRequestId(e){const t={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...t}}static maybeRemoveRepoInfoFromPropertiesHack(e,t){if(e)return t;const n={};for(const e in t)h.keysToRemoveFromStandardTelemetryHack.includes(e)||(n[e]=t[e]);return n}sanitizeKeys(){this.properties=h.sanitizeKeys(this.properties),this.measurements=h.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};const t={};for(const n in e)t[h.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_")]=e[n];return t}updateTimeSinceIssuedAndDisplayed(){const e=m()-this.issuedTime;if(this.measurements.timeSinceIssuedMs=e,void 0!==this.displayedTime){const e=m()-this.displayedTime;this.measurements.timeSinceDisplayedMs=e}}validateData(e,t){var n;let r;if(h.validateTelemetryProperties(this.properties)||(r={problem:"properties",error:JSON.stringify(h.validateTelemetryProperties.errors)}),!h.validateTelemetryMeasurements(this.measurements)){const e=JSON.stringify(h.validateTelemetryMeasurements.errors);void 0===r?r={problem:"measurements",error:e}:(r.problem="both",r.error+=`; ${e}`)}if(void 0===r)return!0;if((0,c.shouldFailForDebugPurposes)(e))throw new Error(`Invalid telemetry data: ${r.problem} ${r.error} properties=${JSON.stringify(this.properties)} measurements=${JSON.stringify(this.measurements)}`);return b(e,"invalidTelemetryData",h.createAndMarkAsIssued({properties:JSON.stringify(this.properties),measurements:JSON.stringify(this.measurements),problem:r.problem,validationError:r.error}),t),t&&b(e,"invalidTelemetryData_in_secure",h.createAndMarkAsIssued({problem:r.problem,requestId:null!==(n=this.properties.requestId)&&void 0!==n?n:"unknown"}),!1),!1}async makeReadyForSending(e,t,n){this.extendWithConfigProperties(e),this.extendWithEditorAgnosticFields(e),this.sanitizeKeys(),"IncludeExp"===n&&await this.extendWithExpTelemetry(e),this.updateTimeSinceIssuedAndDisplayed(),this.validateData(e,t)||(this.properties.telemetry_failed_validation="true")}}function f(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}function m(){return(new Date).getTime()}t.TelemetryData=h,h.ajv=new r.default({strictNumbers:!1}),h.validateTelemetryProperties=h.ajv.compile({type:"object",additionalProperties:{type:"string"},required:[]}),h.validateTelemetryMeasurements=h.ajv.compile({type:"object",properties:{meanLogProb:{type:"number",nullable:!0},meanAlternativeLogProb:{type:"number",nullable:!0}},additionalProperties:{type:"number"},required:[]}),h.keysExemptedFromSanitization=[a.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName,a.ExpServiceTelemetryNames.featuresTelemetryPropertyName],h.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","repo","request_option_nwo"],t.telemetrizePromptLength=function(e){return e.isFimEnabled?{promptPrefixCharLen:e.prefix.length,promptSuffixCharLen:e.suffix.length}:{promptCharLen:e.prefix.length}},t.now=m;class g{constructor(e){this.url=e}getUrl(){return this.url}}function _(e,t){const n=t;if(n.appInsightsClient){const t=n.appInsightsClient.commonProperties,r=h.sanitizeKeys(t);n.appInsightsClient.commonProperties=r,n.appInsightsClient.context.tags[n.appInsightsClient.context.keys.cloudRoleInstance]="REDACTED";const o=e.get(g).getUrl();void 0!==o&&(n.appInsightsClient.config.endpointUrl=o)}}function y(){var e;return null!==(e=null==d?void 0:d.optedIn)&&void 0!==e&&e}async function v(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),f(e,null!=r&&r,t,o)}async function b(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),function(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryErrorEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}(e,null!=r&&r,t,o)}t.TelemetryEndpointUrlOverride=g,t.noTelemetryEndpointUrlOverride=new g,t.telemetryEndpointUrlOverride=new g("https://copilot-telemetry.githubusercontent.com/telemetry"),t.configureReporter=_,t.telemetry=v,t.telemetryExpProblem=async function(e,t){const n=h.createAndMarkAsIssued(t,{});await n.makeReadyForSending(e,!1,"SkipExp"),f(e,!1,"expProblem",n)},t.telemetryRaw=async function(e,t,n,r){f(e,!1,t,{properties:n,measurements:r})},t.telemetryException=async function(e,t,n,r){const o=t instanceof Error?t:new Error("Non-error thrown: "+t),i=y(),s=h.createAndMarkAsIssued({origin:(0,l.redactPaths)(n),reason:i?"Exception logged to restricted telemetry":"Exception, not logged due to opt-out",...r});if(await s.makeReadyForSending(e,!1,"IncludeExp"),f(e,!1,"exception",s),!i)return;const a=h.createAndMarkAsIssued({origin:n,...r});await a.makeReadyForSending(e,!0,"IncludeExp"),function(e,t,n,r){const o=e.get(u).getSecureReporter(e);o&&o.sendTelemetryException(n,h.maybeRemoveRepoInfoFromPropertiesHack(true,r.properties),r.measurements)}(e,0,o,a)},t.telemetryError=b,t.logEngineCompletion=async function(e,t,n,r,o){var i;const s=h.createAndMarkAsIssued({completionTextJson:JSON.stringify(t),choiceIndex:o.toString()});for(const[e,t]of Object.entries(n.logprobs))s.properties["logprobs_"+e]=null!==(i=JSON.stringify(t))&&void 0!==i?i:"unset";s.extendWithRequestId(r),await v(e,"engine.completion",s,!0)},t.logEnginePrompt=async function(e,t,n){let r;r=t.isFimEnabled?{promptPrefixJson:JSON.stringify(t.prefix),promptSuffixJson:JSON.stringify(t.suffix),promptElementRanges:JSON.stringify(t.promptElementRanges)}:{promptJson:JSON.stringify(t.prefix),promptElementRanges:JSON.stringify(t.promptElementRanges)};const o=n.extendedBy(r);await v(e,"engine.prompt",o,!0)},t.setTelemetryConfig=function(e){d=e},t.dropTelemetryConfig=function(){d=void 0},t.forceSendingTelemetry=function(e,n){const r=n.getReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY),_(e,r)}try{const r=n.getSecureReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY_SECURE),_(e,r)}}catch(e){}}},4630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LibTestsEditorInfo=t.createLibTestingContext=t.setupTestingContext=t.setupTestingContextNoTelemetry=t.setupTestingContextNoTelemetryNoLog=t.setupTestingContextNoTelemetryNoLogNoNotifications=void 0;const r=n(4617),o=n(7147),i=n(2137),s=n(9800),a=n(5611),c=n(6905),l=n(6046),u=n(6817),d=n(4619),p=n(5798),h=n(39),f=n(9035),m=n(5489),g=n(2369),_=n(819),y=n(4567),v=n(913),b=n(6584),w=n(751);function x(e){e.set(s.BuildInfo,new s.BuildInfo),e.set(v.RuntimeMode,v.RuntimeMode.fromEnvironment(!0)),e.set(h.Fetcher,new h.HelixFetcher(e)),e.set(p.LogVerbose,new p.LogVerbose(!1)),e.set(i.Clock,new i.Clock),e.set(l.ExpConfigMaker,new l.ExpConfigNone),e.set(d.GhostTextDebounceManager,new d.GhostTextDebounceManager),e.set(u.ContextualFilterManager,new u.ContextualFilterManager)}function T(e){x(e),e.set(f.NotificationSender,new b.TestNotificationSender),e.set(y.UrlOpener,new b.TestUrlOpener)}function E(e){T(e),e.set(p.LogTarget,new p.ConsoleLog(console))}function C(e){E(e),e.set(m.TelemetryEndpointUrlOverride,m.noTelemetryEndpointUrlOverride),e.set(m.TelemetryReporters,(0,m.setupEmptyReporters)()),(0,m.setupStandardReporters)(e,"copilot-test"),e.set(c.Features,new c.Features(e))}t.setupTestingContextNoTelemetryNoLogNoNotifications=x,t.setupTestingContextNoTelemetryNoLog=T,t.setupTestingContextNoTelemetry=E,t.setupTestingContext=C,t.createLibTestingContext=function(){const e=new a.Context;return e.set(s.ConfigProvider,new s.DefaultsOnlyConfigProvider),C(e),e.set(s.EditorAndPluginInfo,new S),e.set(r.FileSystem,k),e.set(_.TextDocumentManager,new w.TestTextDocumentManager),e.set(g.LocationFactory,new w.TestLocationFactory),e};class S extends s.EditorAndPluginInfo{getEditorInfo(e){return{name:"lib-tests-editor",version:"1"}}getEditorPluginInfo(e){return{name:"lib-tests-plugin",version:"2"}}}t.LibTestsEditorInfo=S;const k={readFile:function(e){return o.promises.readFile(e)},mtime:async function(e){return(await o.promises.stat(e)).mtimeMs},stat:async function(e){const t=await o.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},5922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readTestingGitHubToken=t.makeTestingCopilotTokenManager=void 0;const r=n(7147),o=n(5765);function i(){const e=`${process.env.HOME}/.copilot-testing-gh-token`;if(r.existsSync(e))return r.readFileSync(e).toString();throw new Error(`Tests: either GH_COPILOT_TOKEN, or GITHUB_TOKEN, must be set, or there must be a GitHub token from an app with access to Copilot in ${e}. Run "npm run get_token" to get one.`)}t.makeTestingCopilotTokenManager=function(){if(process.env.GH_COPILOT_TOKEN)return new o.FixedCopilotTokenManager({token:process.env.GH_COPILOT_TOKEN,telemetry:"enabled"});if(process.env.GITHUB_TOKEN)return new o.CopilotTokenManagerFromGitHubToken({token:process.env.GITHUB_TOKEN});const e=i();return process.env.GITHUB_TOKEN=e,new o.CopilotTokenManagerFromGitHubToken({token:e})},t.readTestingGitHubToken=i},913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVerboseLoggingEnabled=t.isDebugEnabled=t.shouldFailForDebugPurposes=t.isRunningInTest=t.RuntimeMode=void 0;class n{constructor(e){this.flags=e}static fromEnvironment(e){return new n({debug:(t=process.argv,r=process.env,t.includes("--debug")||"true"===(null===(s=r.GITHUB_COPILOT_DEBUG)||void 0===s?void 0:s.toLowerCase())),verboseLogging:o(process.env),testMode:e,recordInput:i(process.argv,process.env)});var t,r,s}}function r(e){return e.get(n).flags.testMode}function o(e){if("COPILOT_AGENT_VERBOSE"in e){const t=e.COPILOT_AGENT_VERBOSE;return"1"===t||"true"===t}return!1}function i(e,t){var n;return e.includes("--record")||"true"===(null===(n=t.GITHUB_COPILOT_RECORD)||void 0===n?void 0:n.toLowerCase())}t.RuntimeMode=n,t.isRunningInTest=r,t.shouldFailForDebugPurposes=function(e){return r(e)},t.isDebugEnabled=function(e){return e.get(n).flags.debug},t.isVerboseLoggingEnabled=function(e){return e.get(n).flags.verboseLogging}},6584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestNotificationSender=t.TestUrlOpener=t.rangeToString=t.positionToString=void 0;const r=n(9035);function o(e){return`${e.line}:${e.character}`}t.positionToString=o,t.rangeToString=function(e){return`[${o(e.start)}--${o(e.end)}]`},t.TestUrlOpener=class{constructor(){this.openedUrls=[]}open(e){this.openedUrls.push(e)}};class i extends r.NotificationSender{constructor(){super(),this.sentMessages=[]}showWarningMessage(e,...t){return this.sentMessages.push(e),t?Promise.resolve(t[0]):Promise.resolve(void 0)}}t.TestNotificationSender=i},751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestLocationFactory=t.TestTextDocumentManager=t.InMemoryTextDocument=void 0;const r=n(4086);t.InMemoryTextDocument=class{constructor(e,t,n,o,i){this._uri=e,this._textDocument=r.TextDocument.create(e.toString(),t,n,o),this._relativePath=i}get uri(){return this._uri}get relativePath(){return this._relativePath}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r={start:{line:t,character:0},end:{line:t,character:n.length}},o=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:o}}getWordRangeAtPosition(e){}update(e,t){r.TextDocument.update(this._textDocument,e,t)}},t.TestTextDocumentManager=class{constructor(){this.onDidChangeTextDocument=()=>({dispose:()=>{}}),this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.textDocuments=[]}async getTextDocument(e){}async getRelativePath(e){}findNotebook(e){}},t.TestLocationFactory=class{position(e,t){return{line:e,character:t}}range(e,t,n,r){return"number"==typeof e?{start:{line:e,character:t},end:{line:n,character:r}}:{start:e,end:t}}}},2369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocationFactory=void 0,t.LocationFactory=class{}},819:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocumentManager=t.getRelativePath=void 0;const r=n(1017);t.getRelativePath=function(e,t){for(const n of e){const e=n.fsPath;if(t.startsWith(e+r.sep))return r.relative(e,t)}},t.TextDocumentManager=class{}},4567:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealUrlOpener=t.UrlOpener=void 0;const r=n(1814);t.UrlOpener=class{},t.RealUrlOpener=class{async open(e){await r(e)}}},9591:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactPaths=void 0,t.redactPaths=function(e){return e.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}},5614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(7147);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},3272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},ql:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={shellscript:"#!/bin/sh",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",html:"",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(1017),o=n(2133);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===(0,r.extname)(o))o+=".ts";else if(".ts"!==(0,r.extname)(o))return null;return(0,r.join)((0,r.dirname)(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=(0,o.getFirstPrecedingComment)(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=(0,o.getFirstPrecedingComment)(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await(0,o.parseTree)(t,s);for(let e of(0,o.queryExports)(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await(0,o.parseTree)(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},2133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(1017),o=n(498),i=n(498);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=(0,r.resolve)(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},4343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(2133);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await(0,r.parseTree)(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!(0,r.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[(0,r.languageIdToWasmLanguage)(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!(0,r.isSupportedLanguageId)(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if((0,r.isSupportedLanguageId)(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if((0,r.isSupportedLanguageId)(e))return d(e).getNodeStart(t,n)}},8684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(5037),o=n(3272),i=n(1986),s=n(7289),a=n(1729),c=n(5037),l=n(7503),u=n(6885);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`)}}t.PromptOptions=x;const T={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function E(e){var t;return e=e.toLowerCase(),null!==(t=T[e])&&void 0!==t?t:e}function C(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=E,t.newLineEnded=C,t.getPrompt=async function(e,n,y={},w=[]){var T;const S=new x(e,y);let k=!1;const{source:P,offset:I}=n;if(I<0||I>P.length)throw new Error(`Offset ${I} is out of range.`);n.languageId=E(n.languageId);const R=new l.Priorities,O=R.justBelow(l.Priorities.TOP),A=S.pathMarker==h.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),N=S.languageMarker==p.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),D=S.includeSiblingFunctions==f.ContextOverSiblings?R.justBelow(O):R.justAbove(O),M=R.justBelow(O,D),$=R.justBelow(M),L=new l.PromptWishlist(S.lineEnding);let j,F;if(S.languageMarker!=p.NoMarker){const e=C((0,o.getLanguageMarker)(n));j=L.append(e,l.PromptElementKind.LanguageMarker,N)}if(S.pathMarker!=h.NoMarker){const e=C((0,o.getPathMarker)(n));F=L.append(e,l.PromptElementKind.PathMarker,A)}if(S.localImportContext!=_.NoContext)for(const e of await(0,i.extractLocalImportContext)(n,S.fs))L.append(C(e),l.PromptElementKind.ImportedFile,M);const q=S.neighboringTabs==m.None||0==w.length?[]:await(0,s.getNeighborSnippets)(n,w,S.neighboringTabs);function B(){q.forEach((e=>L.append(e.snippet,l.PromptElementKind.SimilarFile,$,(0,c.tokenLength)(e.snippet),e.score)))}S.neighboringTabsPosition==g.TopOfText&&B();const H=[];let U;if(S.includeSiblingFunctions==f.NoSiblings)U=P.substring(0,I);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await(0,a.getSiblingFunctions)(n);L.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>H.push(e)));let o=D;e.forEach((e=>{L.append(e,l.PromptElementKind.AfterCursor,o),o=R.justBelow(o)})),S.neighboringTabsPosition==g.AfterSiblings&&B(),U=r}if(S.neighboringTabsPosition==g.DirectlyAboveCursor){const e=U.lastIndexOf("\n")+1,t=U.substring(0,e),n=U.substring(e);L.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>H.push(e))),B(),n.length>0&&(H.push(L.append(n,l.PromptElementKind.AfterCursor,O)),H.length>1&&L.require(H[H.length-2],H[H.length-1]))}else L.appendLineForLine(U,l.PromptElementKind.BeforeCursor,O).forEach((e=>H.push(e)));if(p.Top==S.languageMarker&&H.length>0&&void 0!==j&&L.require(j,H[0]),h.Top==S.pathMarker&&H.length>0&&void 0!==F&&(j?L.require(F,j):L.require(F,H[0])),0==S.suffixPercent)return L.fulfill(S.maxPromptLength);{let e=n.offset;S.suffixStartMode!==b.Cursor&&S.suffixStartMode!==b.CursorTrimStart&&(e=await(0,a.getSiblingFunctionStart)(n));const o=S.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-S.suffixPercent)/100),s=L.fulfill(i);const l=o-s.prefixLength;let p=P.slice(e);S.suffixStartMode!=b.SiblingBlockTrimStart&&S.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=(0,r.takeFirstTokens)(p,l),f=(0,c.tokenLength)(h);f<=l-3&&(i=o-f,s=L.fulfill(i));const m=h.length,g=(0,c.tokenLength)(d);if(S.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(S.suffixMatchCriteria==v.Levenshtein){const e=null===(T=(0,u.findEditDistanceScore)(h,d))||void 0===T?void 0:T.score;m>0&&S.suffixMatchThreshold>0&&100*e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(8684),o=n(2133);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if((0,o.isSupportedLanguageId)(n)){const u=await(0,o.parseTree)(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=(0,o.getAncestorWithSiblingFunctions)(n,p);if(h){const u=(0,o.getFirstPrecedingComment)(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if((0,o.isFunctionDefinition)(n,i)){const n=(0,o.getFirstPrecedingComment)(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=(0,o.getAncestorWithSiblingFunctions)(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if((0,o.isFunctionDefinition)(n,e)){const n=(0,o.getFirstPrecedingComment)(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},1186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedWindowSizeJaccardMatcher=void 0;const r=n(1864);class o extends r.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}(e,t)}}t.FixedWindowSizeJaccardMatcher=o,o.FACTORY=e=>({to:t=>new o(t,e)})},7289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=void 0;const r=n(3272),o=n(1186),i={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}};function s(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.getNeighborSnippets=async function(e,t,n){const o=i[n],a=o.matcherFactory.to(e);return t.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...a.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>o.threshold)).sort(((e,t)=>e.score-t.score)).slice(-o.numberOfNeighbors).map((t=>({score:t.score,snippet:s(t).map((t=>(0,r.comment)(t,e.languageId)+"\n")).join("")})))}},1864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},6885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(8684),o=n(5037);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=(0,o.tokenLength)(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=(0,o.tokenLength)(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{e.exports=n(1193)},1193:(e,t,n)=>{"use strict";n(1808);var r,o=n(4404),i=n(3685),s=n(5687),a=n(2361),c=(n(9491),n(3837));function l(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||i.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,n,r,o){for(var i=d(n,r,o),s=0,a=t.requests.length;s=this.maxSockets?o.requests.push(i):o.createSocket(i,(function(t){function n(){o.emit("free",t,i)}function r(e){o.removeSocket(t),t.removeListener("free",n),t.removeListener("close",r),t.removeListener("agentRemove",r)}t.on("free",n),t.on("close",r),t.on("agentRemove",r),e.onSocket(t)}))},l.prototype.createSocket=function(e,t){var n=this,o={};n.sockets.push(o);var i=p({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),r("making CONNECT request");var s=n.request(i);function a(i,a,c){var l;return s.removeAllListeners(),a.removeAllListeners(),200!==i.statusCode?(r("tunneling socket could not be established, statusCode=%d",i.statusCode),a.destroy(),(l=new Error("tunneling socket could not be established, statusCode="+i.statusCode)).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):c.length>0?(r("got illegal response body from proxy"),a.destroy(),(l=new Error("got illegal response body from proxy")).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):(r("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=a,t(a))}s.useChunkedEncodingByDefault=!1,s.once("response",(function(e){e.upgrade=!0})),s.once("upgrade",(function(e,t,n){process.nextTick((function(){a(e,t,n)}))})),s.once("connect",a),s.once("error",(function(t){s.removeAllListeners(),r("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, cause="+t.message);i.code="ECONNRESET",e.request.emit("error",i),n.removeSocket(o)})),s.end()},l.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var n=this.requests.shift();n&&this.createSocket(n,(function(e){n.request.onSocket(e)}))}},r=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},t.debug=r},2371:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),n=0;n1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,o=1;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function _(e){throw new RangeError(f[e])}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(h,".")).split("."),t).join(".")}function v(e){for(var t=[],n=0,r=e.length;n=55296&&o<=56319&&n>1,e+=m(e/t);e>455;r+=u)e=m(e/35);return m(r+36*e/(e+38))},x=function(e){var t,n=[],r=e.length,o=0,i=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c=128&&_("not-basic"),n.push(e.charCodeAt(c));for(var d=a>0?a+1:0;d=r&&_("invalid-input");var g=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(g>=u||g>m((l-o)/h))&&_("overflow"),o+=g*h;var y=f<=s?1:f>=s+26?26:f-s;if(gm(l/v)&&_("overflow"),h*=v}var b=n.length+1;s=w(o-p,b,0==p),m(o/b)>l-i&&_("overflow"),i+=m(o/b),o%=b,n.splice(o++,0,i)}return String.fromCodePoint.apply(String,n)},T=function(e){var t=[],n=(e=v(e)).length,r=128,o=0,i=72,s=!0,a=!1,c=void 0;try{for(var d,p=e[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;h<128&&t.push(g(h))}}catch(e){a=!0,c=e}finally{try{!s&&p.return&&p.return()}finally{if(a)throw c}}var f=t.length,y=f;for(f&&t.push("-");y=r&&Pm((l-o)/I)&&_("overflow"),o+=(x-r)*I,r=x;var R=!0,O=!1,A=void 0;try{for(var N,D=e[Symbol.iterator]();!(R=(N=D.next()).done);R=!0){var M=N.value;if(Ml&&_("overflow"),M==r){for(var $=o,L=u;;L+=u){var j=L<=i?1:L>=i+26?26:L-i;if($>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function P(e){for(var t="",n=0,r=e.length;n=194&&o<224){if(r-n>=6){var i=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&o)<<6|63&i)}else t+=e.substr(n,6);n+=6}else if(o>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function I(e,t){function n(e){var n=P(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,k).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,k).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,k).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,k).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,k).replace(t.PCT_ENCODED,o)),e}function R(e){return e.replace(/^0*(.*)/,"$1")||"0"}function O(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=c(n,2)[1];return r?r.split(".").map(R).join("."):e}function A(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=c(n,3),o=r[1],i=r[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),a=c(s,2),l=a[0],u=a[1],d=u?u.split(":").map(R):[],p=l.split(":").map(R),h=t.IPV4ADDRESS.test(p[p.length-1]),f=h?7:8,m=p.length-f,g=Array(f),_=0;_1){var b=g.slice(0,y.index),w=g.slice(y.index+y.length);v=b.join(":")+"::"+w.join(":")}else v=g.join(":");return i&&(v+="%"+i),v}return e}var N=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,D=void 0==="".match(/(){0}/)[1];function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(N);if(o){D?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||void 0,n.userinfo=-1!==e.indexOf("@")?o[3]:void 0,n.host=-1!==e.indexOf("//")?o[4]:void 0,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:void 0,n.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),n.host&&(n.host=A(O(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var i=S[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)I(n,r);else{if(n.host&&(t.domainHost||i&&i.domainHost))try{n.host=E(n.host.replace(r.PCT_ENCODED,P).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}I(n,s)}i&&i.parse&&i.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function $(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(A(O(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}var L=/^\.\.?\//,j=/^\/\.(\/|$)/,F=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function B(e){for(var t=[];e.length;)if(e.match(L))e=e.replace(L,"");else if(e.match(j))e=e.replace(j,"/");else if(e.match(F))e=e.replace(F,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(q);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],o=S[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?C(e.host):E(e.host.replace(n.PCT_ENCODED,P).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}I(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var i=$(e,t);if(void 0!==i&&("suffix"!==t.reference&&r.push("//"),r.push(i),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||o&&o.absolutePath||(c=B(c)),void 0===i&&(c=c.replace(/^\/\//,"/%2F")),r.push(c)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function U(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=M(H(e,n),n),t=M(H(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=B(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=B(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function W(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,P)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},K={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function V(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var G={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=V(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(V(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=c(n,2),o=r[0],i=r[1];e.path=o&&"/"!==o?o:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:G.domainHost,parse:G.parse,serialize:G.serialize},X={},Q="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",Z=n(n("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+n("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Q,"g"),ne=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),oe=new RegExp(t("[^]",Q,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=oe;function se(e){var t=P(e);return t.match(te)?t:e}var ae={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var o=!1,i={},s=n.query.split("&"),a=0,c=s.length;a{"use strict";n.r(t),n.d(t,{NIL:()=>x,parse:()=>_,stringify:()=>d,v1:()=>g,v3:()=>v,v4:()=>b,v5:()=>w,validate:()=>l,version:()=>T});var r=n(6113),o=n.n(r);const i=new Uint8Array(256);let s=i.length;function a(){return s>i.length-16&&(o().randomFillSync(i),s=0),i.slice(s,s+=16)}const c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&c.test(e)},u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).substr(1));const d=function(e,t=0){const n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};let p,h,f=0,m=0;const g=function(e,t,n){let r=t&&n||0;const o=t||new Array(16);let i=(e=e||{}).node||p,s=void 0!==e.clockseq?e.clockseq:h;if(null==i||null==s){const t=e.random||(e.rng||a)();null==i&&(i=p=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=h=16383&(t[6]<<8|t[7]))}let c=void 0!==e.msecs?e.msecs:Date.now(),l=void 0!==e.nsecs?e.nsecs:m+1;const u=c-f+(l-m)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||c>f)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=c,m=l,h=s,c+=122192928e5;const g=(1e4*(268435455&c)+l)%4294967296;o[r++]=g>>>24&255,o[r++]=g>>>16&255,o[r++]=g>>>8&255,o[r++]=255&g;const _=c/4294967296*1e4&268435455;o[r++]=_>>>8&255,o[r++]=255&_,o[r++]=_>>>24&15|16,o[r++]=_>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(let e=0;e<6;++e)o[r+e]=i[e];return t||d(o)},_=function(e){if(!l(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function y(e,t,n){function r(e,r,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=!0;var r=n(7147),o=n(2037),i=n(1017),s=n(8212),a=n(8144),c=function(){function e(e,t,n,o){var a=this;this.extensionId=e,this.extensionVersion=t,this.firstParty=!1,this.userOptIn=!1,this.firstParty=!!o;var c=process.env.VSCODE_LOGS||"";c&&e&&"trace"===process.env.VSCODE_LOG_LEVEL&&(c=i.join(c,e+".txt"),this.logStream=r.createWriteStream(c,{flags:"a",encoding:"utf8",autoClose:!0})),this.updateUserOptIn(n),void 0!==s.env.onDidChangeTelemetryEnabled?this.optOutListener=s.env.onDidChangeTelemetryEnabled((function(){return a.updateUserOptIn(n)})):this.optOutListener=s.workspace.onDidChangeConfiguration((function(){return a.updateUserOptIn(n)}))}return e.prototype.updateUserOptIn=function(t){var n=s.workspace.getConfiguration(e.TELEMETRY_CONFIG_ID),r=void 0===s.env.isTelemetryEnabled?n.get(e.TELEMETRY_CONFIG_ENABLED_ID,!0):s.env.isTelemetryEnabled;this.userOptIn!==r&&(this.userOptIn=r,this.userOptIn?this.createAppInsightsClient(t):this.dispose())},e.prototype.createAppInsightsClient=function(e){a.defaultClient?(this.appInsightsClient=new a.TelemetryClient(e),this.appInsightsClient.channel.setUseDiskRetryCaching(!0)):(a.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0).start(),this.appInsightsClient=a.defaultClient),this.appInsightsClient.commonProperties=this.getCommonProperties(),s&&s.env&&(this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.userId]=s.env.machineId,this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.sessionId]=s.env.sessionId),e&&0===e.indexOf("AIF-")&&(this.appInsightsClient.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1",this.firstParty=!0)},e.prototype.getCommonProperties=function(){var e=Object.create(null);if(e["common.os"]=o.platform(),e["common.platformversion"]=(o.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),e["common.extname"]=this.extensionId,e["common.extversion"]=this.extensionVersion,s&&s.env){switch(e["common.vscodemachineid"]=s.env.machineId,e["common.vscodesessionid"]=s.env.sessionId,e["common.vscodeversion"]=s.version,e["common.isnewappinstall"]=s.env.isNewAppInstall,s.env.uiKind){case s.UIKind.Web:e["common.uikind"]="web";break;case s.UIKind.Desktop:e["common.uikind"]="desktop";break;default:e["common.uikind"]="unknown"}e["common.remotename"]=this.cleanRemoteName(s.env.remoteName)}return e},e.prototype.cleanRemoteName=function(e){if(!e)return"none";var t="other";return["ssh-remote","dev-container","attached-container","wsl"].forEach((function(n){0===e.indexOf(n+"+")&&(t=n)})),t},e.prototype.shouldSendErrorTelemetry=function(){return!this.firstParty||"other"!==this.cleanRemoteName(s.env.remoteName)||void 0!==this.extension&&this.extension.extensionKind!==s.ExtensionKind.Workspace&&s.env.uiKind!==s.UIKind.Web},Object.defineProperty(e.prototype,"extension",{get:function(){return void 0===this._extension&&(this._extension=s.extensions.getExtension(this.extensionId)),this._extension},enumerable:!1,configurable:!0}),e.prototype.cloneAndChange=function(e,t){if(null===e||"object"!=typeof e)return e;if("function"!=typeof t)return e;var n={};for(var r in e)n[r]=t(r,e[r]);return n},e.prototype.anonymizeFilePaths=function(e,t){if(null==e)return"";var n=[new RegExp(s.env.appRoot.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi")];this.extension&&n.push(new RegExp(this.extension.extensionPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"));var r=e;if(t){for(var o=[],i=0,a=n;i=r}))&&(r+=e.substring(p,t.index)+"",p=d.lastIndex)};"break"!==h(););p{"use strict";var r;n.r(t),n.d(t,{URI:()=>o,Utils:()=>i}),r=(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",o=0):o=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",o=0,i=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s;i>=0?s=arguments[i]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,o=47===s.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;ol){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>l&&(47===e.charCodeAt(o+d)?u=d:0===d&&(u=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(u=d)}var h="";for(d=o+u+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,i=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(l===n.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){o=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!i){r=a+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),i=47===o;i?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==d&&(d=1):-1!==s&&(d=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===d||1===d&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},447:(e,t,n)=>{var r;if(n.r(t),n.d(t,{URI:()=>f,Utils:()=>C}),"object"==typeof process)r="win32"===process.platform;else if("object"==typeof navigator){var o=navigator.userAgent;r=o.indexOf("Windows")>=0}var i,s,a=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=/^\w[\w\d+.-]*$/,l=/^\//,u=/^\/\//,d="",p="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function e(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||d,this.authority=e.authority||d,this.path=e.path||d,this.query=e.query||d,this.fragment=e.fragment||d):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||d,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==p&&(t=p+t):t=p}return t}(this.scheme,n||d),this.query=r||d,this.fragment=o||d,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!c.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!l.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,i))}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString},Object.defineProperty(e.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,o=e.query,i=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=d),void 0===n?n=this.authority:null===n&&(n=d),void 0===r?r=this.path:null===r&&(r=d),void 0===o?o=this.query:null===o&&(o=d),void 0===i?i=this.fragment:null===i&&(i=d),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new g(t,n,r,o,i)},e.parse=function(e,t){void 0===t&&(t=!1);var n=h.exec(e);return n?new g(n[2]||d,E(n[4]||d),E(n[5]||d),E(n[7]||d),E(n[9]||d),t):new g(d,d,d,d,d)},e.file=function(e){var t=d;if(r&&(e=e.replace(/\\/g,p)),e[0]===p&&e[1]===p){var n=e.indexOf(p,2);-1===n?(t=e.substring(2),e=p):(t=e.substring(2,n),e=e.substring(n)||p)}return new g("file",t,e,d,d)},e.from=function(e){return new g(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new g(t);return n._formatted=t.external,n._fsPath=t._sep===m?t.fsPath:null,n}return t},e}(),m=r?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return a(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),_=((s={})[58]="%3A",s[47]="%2F",s[63]="%3F",s[35]="%23",s[91]="%5B",s[93]="%5D",s[64]="%40",s[33]="%21",s[36]="%24",s[38]="%26",s[39]="%27",s[40]="%28",s[41]="%29",s[42]="%2A",s[43]="%2B",s[44]="%2C",s[59]="%3B",s[61]="%3D",s[32]="%20",s);function y(e,t){for(var n=void 0,r=-1,o=0;o=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||45===i||46===i||95===i||126===i||t&&47===i)-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=_[i];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),n+=s):-1===r&&(r=o)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function v(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,r&&(n=n.replace(/\//g,"\\")),n}function w(e,t){var n=t?v:y,r="",o=e.scheme,i=e.authority,s=e.path,a=e.query,c=e.fragment;if(o&&(r+=o,r+=":"),(i||"file"===o)&&(r+=p,r+=p),i){var l=i.indexOf("@");if(-1!==l){var u=i.substr(0,l);i=i.substr(l+1),-1===(l=u.indexOf(":"))?r+=n(u,!1):(r+=n(u.substr(0,l),!1),r+=":",r+=n(u.substr(l+1),!1)),r+="@"}-1===(l=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,l),!1),r+=i.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(d=s.charCodeAt(1))>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var d;(d=s.charCodeAt(0))>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function x(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+x(e.substr(3)):e}}var T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(T)?e.replace(T,(function(e){return x(e)})):e}var C,S=n(470),k=function(){for(var e=0,t=0,n=arguments.length;t{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(447)})();const{URI:o,Utils:i}=r},4617:(e,t,n)=>{var r,o,i;r={271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(747);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},ql:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={shellscript:"#!/bin/sh",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",html:"",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(622),o=n(306);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===r.extname(o))o+=".ts";else if(".ts"!==r.extname(o))return null;return r.join(r.dirname(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=o.getFirstPrecedingComment(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=o.getFirstPrecedingComment(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await o.parseTree(t,s);for(let e of o.queryExports(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await o.parseTree(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(622),o=n(87),i=n(87);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=r.resolve(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(306);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await r.parseTree(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!r.queryPythonIsDocstring(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[r.languageIdToWasmLanguage(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!r.isSupportedLanguageId(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if(r.isSupportedLanguageId(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if(r.isSupportedLanguageId(e))return d(e).getNodeStart(t,n)}},312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(94),o=n(417),i=n(179),s=n(125),a=n(670),c=n(94),l=n(456),u=n(395);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`)}}t.PromptOptions=x;const T={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function E(e){var t;return e=e.toLowerCase(),null!==(t=T[e])&&void 0!==t?t:e}function C(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=E,t.newLineEnded=C,t.getPrompt=async function(e,n,y={},w=[]){var T;const S=new x(e,y);let k=!1;const{source:P,offset:I}=n;if(I<0||I>P.length)throw new Error(`Offset ${I} is out of range.`);n.languageId=E(n.languageId);const R=new l.Priorities,O=R.justBelow(l.Priorities.TOP),A=S.pathMarker==h.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),N=S.languageMarker==p.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),D=S.includeSiblingFunctions==f.ContextOverSiblings?R.justBelow(O):R.justAbove(O),M=R.justBelow(O,D),$=R.justBelow(M),L=new l.PromptWishlist(S.lineEnding);let j,F;if(S.languageMarker!=p.NoMarker){const e=C(o.getLanguageMarker(n));j=L.append(e,l.PromptElementKind.LanguageMarker,N)}if(S.pathMarker!=h.NoMarker){const e=C(o.getPathMarker(n));F=L.append(e,l.PromptElementKind.PathMarker,A)}if(S.localImportContext!=_.NoContext)for(const e of await i.extractLocalImportContext(n,S.fs))L.append(C(e),l.PromptElementKind.ImportedFile,M);const q=S.neighboringTabs==m.None||0==w.length?[]:await s.getNeighborSnippets(n,w,S.neighboringTabs);function B(){q.forEach((e=>L.append(e.snippet,l.PromptElementKind.SimilarFile,$,c.tokenLength(e.snippet),e.score)))}S.neighboringTabsPosition==g.TopOfText&&B();const H=[];let U;if(S.includeSiblingFunctions==f.NoSiblings)U=P.substring(0,I);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await a.getSiblingFunctions(n);L.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>H.push(e)));let o=D;e.forEach((e=>{L.append(e,l.PromptElementKind.AfterCursor,o),o=R.justBelow(o)})),S.neighboringTabsPosition==g.AfterSiblings&&B(),U=r}if(S.neighboringTabsPosition==g.DirectlyAboveCursor){const e=U.lastIndexOf("\n")+1,t=U.substring(0,e),n=U.substring(e);L.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>H.push(e))),B(),n.length>0&&(H.push(L.append(n,l.PromptElementKind.AfterCursor,O)),H.length>1&&L.require(H[H.length-2],H[H.length-1]))}else L.appendLineForLine(U,l.PromptElementKind.BeforeCursor,O).forEach((e=>H.push(e)));if(p.Top==S.languageMarker&&H.length>0&&void 0!==j&&L.require(j,H[0]),h.Top==S.pathMarker&&H.length>0&&void 0!==F&&(j?L.require(F,j):L.require(F,H[0])),0==S.suffixPercent)return L.fulfill(S.maxPromptLength);{let e=n.offset;S.suffixStartMode!==b.Cursor&&S.suffixStartMode!==b.CursorTrimStart&&(e=await a.getSiblingFunctionStart(n));const o=S.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-S.suffixPercent)/100),s=L.fulfill(i);const l=o-s.prefixLength;let p=P.slice(e);S.suffixStartMode!=b.SiblingBlockTrimStart&&S.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=r.takeFirstTokens(p,l),f=c.tokenLength(h);f<=l-3&&(i=o-f,s=L.fulfill(i));const m=h.length,g=c.tokenLength(d);if(S.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(S.suffixMatchCriteria==v.Levenshtein){const e=null===(T=u.findEditDistanceScore(h,d))||void 0===T?void 0:T.score;m>0&&S.suffixMatchThreshold>0&&100*e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(312),o=n(306);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if(o.isSupportedLanguageId(n)){const u=await o.parseTree(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=o.getAncestorWithSiblingFunctions(n,p);if(h){const u=o.getFirstPrecedingComment(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if(o.isFunctionDefinition(n,i)){const n=o.getFirstPrecedingComment(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=o.getAncestorWithSiblingFunctions(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if(o.isFunctionDefinition(n,e)){const n=o.getFirstPrecedingComment(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},404:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedWindowSizeJaccardMatcher=void 0;const r=n(467);class o extends r.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}(e,t)}}t.FixedWindowSizeJaccardMatcher=o,o.FACTORY=e=>({to:t=>new o(t,e)})},125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=void 0;const r=n(417),o=n(404),i={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}};function s(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.getNeighborSnippets=async function(e,t,n){const o=i[n],a=o.matcherFactory.to(e);return t.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...a.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>o.threshold)).sort(((e,t)=>e.score-t.score)).slice(-o.numberOfNeighbors).map((t=>({score:t.score,snippet:s(t).map((t=>r.comment(t,e.languageId)+"\n")).join("")})))}},467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(312),o=n(94);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=o.tokenLength(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=o.tokenLength(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{var r,o,i=void 0!==i?i:{};void 0===(o="function"==typeof(r=function(){var t,r={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t]);var o,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!o&&!d;var p,h,f,m,g,_="";o?(_=d?n(622).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(747)),g||(g=n(622)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=i,l=function(e){process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),i.print||console.log.bind(console);var y=i.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);r=null,i.arguments&&(a=i.arguments),i.thisProgram&&(c=i.thisProgram),i.quit&&(l=i.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":$[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],$[e>>2]=pe[0],$[e+4>>2]=pe[1];break;case"float":L[e>>2]=t;break;case"double":j[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return $[e>>2];case"float":return L[e>>2];case"double":return j[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,$,L,j,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function H(e,t){return e?B(D,e,t):""}function U(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return U(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return U(e,N,n,t),n}function V(e){A=e,i.HEAP8=N=new Int8Array(e),i.HEAP16=M=new Int16Array(e),i.HEAP32=$=new Int32Array(e),i.HEAPU8=D=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=L=new Float32Array(e),i.HEAPF64=j=new Float64Array(e)}var G=i.INITIAL_MEMORY||33554432;(S=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,i.monitorRunDependencies&&i.monitorRunDependencies(te)}function ie(e){if(te--,i.monitorRunDependencies&&i.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw i.onAbort&&i.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}i.preloadedImages={},i.preloadedAudios={},i.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=i.locateFile?i.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(i)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}var we={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function xe(e,t,n){return e.includes("j")?function(e,t,n){var r=i["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Te=5250832;function Ee(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function Ce(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Ee(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Se(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function ke(e,t){var n,r;return t&&(n=i.asm["orig$"+e]),n||(n=i.asm[e]),!n&&t&&(n=i["_orig$"+e]),n||(n=i[Se(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return xe(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Pe(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return He(e);var t=Te,n=t+e+15&-16;return Te=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return $[t>>2]=n/1e3|0,$[t+4>>2]=n%1e3*1e3*1e3|0,0}function Le(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function je(e){Qe(e)}function Fe(e){E(e)}$e.sig="iii",je.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Te,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:$e,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),Le(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:je,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=H(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},He=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=Ce(n,1024),i.asm=n;var r,o=ye(t);o.neededDynlibs&&(C=o.neededDynlibs.concat(C)),r=i.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.__wasm_call_ctors).apply(null,arguments)},i._malloc=function(){return(He=i._malloc=i.asm.malloc).apply(null,arguments)}),Ue=(i._ts_language_symbol_count=function(){return(i._ts_language_symbol_count=i.asm.ts_language_symbol_count).apply(null,arguments)},i._ts_language_version=function(){return(i._ts_language_version=i.asm.ts_language_version).apply(null,arguments)},i._ts_language_field_count=function(){return(i._ts_language_field_count=i.asm.ts_language_field_count).apply(null,arguments)},i._ts_language_symbol_name=function(){return(i._ts_language_symbol_name=i.asm.ts_language_symbol_name).apply(null,arguments)},i._ts_language_symbol_for_name=function(){return(i._ts_language_symbol_for_name=i.asm.ts_language_symbol_for_name).apply(null,arguments)},i._ts_language_symbol_type=function(){return(i._ts_language_symbol_type=i.asm.ts_language_symbol_type).apply(null,arguments)},i._ts_language_field_name_for_id=function(){return(i._ts_language_field_name_for_id=i.asm.ts_language_field_name_for_id).apply(null,arguments)},i._memcpy=function(){return(i._memcpy=i.asm.memcpy).apply(null,arguments)},i._free=function(){return(i._free=i.asm.free).apply(null,arguments)},i._calloc=function(){return(i._calloc=i.asm.calloc).apply(null,arguments)},i._ts_parser_delete=function(){return(i._ts_parser_delete=i.asm.ts_parser_delete).apply(null,arguments)},i._ts_parser_reset=function(){return(i._ts_parser_reset=i.asm.ts_parser_reset).apply(null,arguments)},i._ts_parser_set_language=function(){return(i._ts_parser_set_language=i.asm.ts_parser_set_language).apply(null,arguments)},i._ts_parser_timeout_micros=function(){return(i._ts_parser_timeout_micros=i.asm.ts_parser_timeout_micros).apply(null,arguments)},i._ts_parser_set_timeout_micros=function(){return(i._ts_parser_set_timeout_micros=i.asm.ts_parser_set_timeout_micros).apply(null,arguments)},i._memcmp=function(){return(i._memcmp=i.asm.memcmp).apply(null,arguments)},i._ts_query_new=function(){return(i._ts_query_new=i.asm.ts_query_new).apply(null,arguments)},i._ts_query_delete=function(){return(i._ts_query_delete=i.asm.ts_query_delete).apply(null,arguments)},i._iswspace=function(){return(i._iswspace=i.asm.iswspace).apply(null,arguments)},i._iswalnum=function(){return(i._iswalnum=i.asm.iswalnum).apply(null,arguments)},i._ts_query_pattern_count=function(){return(i._ts_query_pattern_count=i.asm.ts_query_pattern_count).apply(null,arguments)},i._ts_query_capture_count=function(){return(i._ts_query_capture_count=i.asm.ts_query_capture_count).apply(null,arguments)},i._ts_query_string_count=function(){return(i._ts_query_string_count=i.asm.ts_query_string_count).apply(null,arguments)},i._ts_query_capture_name_for_id=function(){return(i._ts_query_capture_name_for_id=i.asm.ts_query_capture_name_for_id).apply(null,arguments)},i._ts_query_string_value_for_id=function(){return(i._ts_query_string_value_for_id=i.asm.ts_query_string_value_for_id).apply(null,arguments)},i._ts_query_predicates_for_pattern=function(){return(i._ts_query_predicates_for_pattern=i.asm.ts_query_predicates_for_pattern).apply(null,arguments)},i._ts_tree_copy=function(){return(i._ts_tree_copy=i.asm.ts_tree_copy).apply(null,arguments)},i._ts_tree_delete=function(){return(i._ts_tree_delete=i.asm.ts_tree_delete).apply(null,arguments)},i._ts_init=function(){return(i._ts_init=i.asm.ts_init).apply(null,arguments)},i._ts_parser_new_wasm=function(){return(i._ts_parser_new_wasm=i.asm.ts_parser_new_wasm).apply(null,arguments)},i._ts_parser_enable_logger_wasm=function(){return(i._ts_parser_enable_logger_wasm=i.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},i._ts_parser_parse_wasm=function(){return(i._ts_parser_parse_wasm=i.asm.ts_parser_parse_wasm).apply(null,arguments)},i._ts_language_type_is_named_wasm=function(){return(i._ts_language_type_is_named_wasm=i.asm.ts_language_type_is_named_wasm).apply(null,arguments)},i._ts_language_type_is_visible_wasm=function(){return(i._ts_language_type_is_visible_wasm=i.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},i._ts_tree_root_node_wasm=function(){return(i._ts_tree_root_node_wasm=i.asm.ts_tree_root_node_wasm).apply(null,arguments)},i._ts_tree_edit_wasm=function(){return(i._ts_tree_edit_wasm=i.asm.ts_tree_edit_wasm).apply(null,arguments)},i._ts_tree_get_changed_ranges_wasm=function(){return(i._ts_tree_get_changed_ranges_wasm=i.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},i._ts_tree_cursor_new_wasm=function(){return(i._ts_tree_cursor_new_wasm=i.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},i._ts_tree_cursor_delete_wasm=function(){return(i._ts_tree_cursor_delete_wasm=i.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},i._ts_tree_cursor_reset_wasm=function(){return(i._ts_tree_cursor_reset_wasm=i.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_first_child_wasm=function(){return(i._ts_tree_cursor_goto_first_child_wasm=i.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_next_sibling_wasm=function(){return(i._ts_tree_cursor_goto_next_sibling_wasm=i.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_parent_wasm=function(){return(i._ts_tree_cursor_goto_parent_wasm=i.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_type_id_wasm=function(){return(i._ts_tree_cursor_current_node_type_id_wasm=i.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_named_wasm=function(){return(i._ts_tree_cursor_current_node_is_named_wasm=i.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_missing_wasm=function(){return(i._ts_tree_cursor_current_node_is_missing_wasm=i.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_id_wasm=function(){return(i._ts_tree_cursor_current_node_id_wasm=i.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},i._ts_tree_cursor_start_position_wasm=function(){return(i._ts_tree_cursor_start_position_wasm=i.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},i._ts_tree_cursor_end_position_wasm=function(){return(i._ts_tree_cursor_end_position_wasm=i.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},i._ts_tree_cursor_start_index_wasm=function(){return(i._ts_tree_cursor_start_index_wasm=i.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},i._ts_tree_cursor_end_index_wasm=function(){return(i._ts_tree_cursor_end_index_wasm=i.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},i._ts_tree_cursor_current_field_id_wasm=function(){return(i._ts_tree_cursor_current_field_id_wasm=i.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_wasm=function(){return(i._ts_tree_cursor_current_node_wasm=i.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},i._ts_node_symbol_wasm=function(){return(i._ts_node_symbol_wasm=i.asm.ts_node_symbol_wasm).apply(null,arguments)},i._ts_node_child_count_wasm=function(){return(i._ts_node_child_count_wasm=i.asm.ts_node_child_count_wasm).apply(null,arguments)},i._ts_node_named_child_count_wasm=function(){return(i._ts_node_named_child_count_wasm=i.asm.ts_node_named_child_count_wasm).apply(null,arguments)},i._ts_node_child_wasm=function(){return(i._ts_node_child_wasm=i.asm.ts_node_child_wasm).apply(null,arguments)},i._ts_node_named_child_wasm=function(){return(i._ts_node_named_child_wasm=i.asm.ts_node_named_child_wasm).apply(null,arguments)},i._ts_node_child_by_field_id_wasm=function(){return(i._ts_node_child_by_field_id_wasm=i.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},i._ts_node_next_sibling_wasm=function(){return(i._ts_node_next_sibling_wasm=i.asm.ts_node_next_sibling_wasm).apply(null,arguments)},i._ts_node_prev_sibling_wasm=function(){return(i._ts_node_prev_sibling_wasm=i.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},i._ts_node_next_named_sibling_wasm=function(){return(i._ts_node_next_named_sibling_wasm=i.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},i._ts_node_prev_named_sibling_wasm=function(){return(i._ts_node_prev_named_sibling_wasm=i.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},i._ts_node_parent_wasm=function(){return(i._ts_node_parent_wasm=i.asm.ts_node_parent_wasm).apply(null,arguments)},i._ts_node_descendant_for_index_wasm=function(){return(i._ts_node_descendant_for_index_wasm=i.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_index_wasm=function(){return(i._ts_node_named_descendant_for_index_wasm=i.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_descendant_for_position_wasm=function(){return(i._ts_node_descendant_for_position_wasm=i.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_position_wasm=function(){return(i._ts_node_named_descendant_for_position_wasm=i.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_start_point_wasm=function(){return(i._ts_node_start_point_wasm=i.asm.ts_node_start_point_wasm).apply(null,arguments)},i._ts_node_end_point_wasm=function(){return(i._ts_node_end_point_wasm=i.asm.ts_node_end_point_wasm).apply(null,arguments)},i._ts_node_start_index_wasm=function(){return(i._ts_node_start_index_wasm=i.asm.ts_node_start_index_wasm).apply(null,arguments)},i._ts_node_end_index_wasm=function(){return(i._ts_node_end_index_wasm=i.asm.ts_node_end_index_wasm).apply(null,arguments)},i._ts_node_to_string_wasm=function(){return(i._ts_node_to_string_wasm=i.asm.ts_node_to_string_wasm).apply(null,arguments)},i._ts_node_children_wasm=function(){return(i._ts_node_children_wasm=i.asm.ts_node_children_wasm).apply(null,arguments)},i._ts_node_named_children_wasm=function(){return(i._ts_node_named_children_wasm=i.asm.ts_node_named_children_wasm).apply(null,arguments)},i._ts_node_descendants_of_type_wasm=function(){return(i._ts_node_descendants_of_type_wasm=i.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},i._ts_node_is_named_wasm=function(){return(i._ts_node_is_named_wasm=i.asm.ts_node_is_named_wasm).apply(null,arguments)},i._ts_node_has_changes_wasm=function(){return(i._ts_node_has_changes_wasm=i.asm.ts_node_has_changes_wasm).apply(null,arguments)},i._ts_node_has_error_wasm=function(){return(i._ts_node_has_error_wasm=i.asm.ts_node_has_error_wasm).apply(null,arguments)},i._ts_node_is_missing_wasm=function(){return(i._ts_node_is_missing_wasm=i.asm.ts_node_is_missing_wasm).apply(null,arguments)},i._ts_query_matches_wasm=function(){return(i._ts_query_matches_wasm=i.asm.ts_query_matches_wasm).apply(null,arguments)},i._ts_query_captures_wasm=function(){return(i._ts_query_captures_wasm=i.asm.ts_query_captures_wasm).apply(null,arguments)},i._iswalpha=function(){return(i._iswalpha=i.asm.iswalpha).apply(null,arguments)},i._iswdigit=function(){return(i._iswdigit=i.asm.iswdigit).apply(null,arguments)},i._iswlower=function(){return(i._iswlower=i.asm.iswlower).apply(null,arguments)},i._towupper=function(){return(i._towupper=i.asm.towupper).apply(null,arguments)},i._memchr=function(){return(i._memchr=i.asm.memchr).apply(null,arguments)},i.___errno_location=function(){return(Ue=i.___errno_location=i.asm.__errno_location).apply(null,arguments)}),We=(i._strlen=function(){return(i._strlen=i.asm.strlen).apply(null,arguments)},i.stackSave=function(){return(We=i.stackSave=i.asm.stackSave).apply(null,arguments)}),ze=i.stackRestore=function(){return(ze=i.stackRestore=i.asm.stackRestore).apply(null,arguments)},Ke=i.stackAlloc=function(){return(Ke=i.stackAlloc=i.asm.stackAlloc).apply(null,arguments)},Ve=i._setThrew=function(){return(Ve=i._setThrew=i.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=i.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=i.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},i.__Znwm=function(){return(i.__Znwm=i.asm._Znwm).apply(null,arguments)},i.__ZdlPv=function(){return(i.__ZdlPv=i.asm._ZdlPv).apply(null,arguments)},i._orig$ts_parser_timeout_micros=function(){return(i._orig$ts_parser_timeout_micros=i.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},i._orig$ts_parser_set_timeout_micros=function(){return(i._orig$ts_parser_set_timeout_micros=i.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},i._TRANSFER_BUFFER=7296,i.___THREW__=7932,i.___threwValue=7936,i.___cxa_new_handler=7928,i.allocate=function(e,t){var n;return n=t==F?Ke(e.length):He(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,i.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Ye&&function(e){var t=i._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));$[r>>2]=K(c);for(var o=1;o>2)+o]=K(e[o-1]);$[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(i.onExit&&i.onExit(e),R=!0),l(e,new Ge(e)))}if(i.run=Xe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Ye=!0;i.noInitialRun&&(Ye=!1),Xe();const Ze=i,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{i.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(747);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Pe;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{const r=n(747),o=n(622),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=n(7147)},622:e=>{"use strict";e.exports=n(1017)},13:e=>{"use strict";e.exports=n(1267)}},o={},i=function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(563),e.exports=i},498:(e,t,n)=>{var r,o=void 0!==o?o:{};void 0===(r=function(){var t,r={};for(t in o)o.hasOwnProperty(t)&&(r[t]=o[t]);var i,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,i="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!i&&!d;var p,h,f,m,g,_="";i?(_=d?n(1017).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(7147)),g||(g=n(1017)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=o,l=function(e){process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),o.print||console.log.bind(console);var y=o.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(o[t]=r[t]);r=null,o.arguments&&(a=o.arguments),o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":$[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],$[e>>2]=pe[0],$[e+4>>2]=pe[1];break;case"float":L[e>>2]=t;break;case"double":j[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return $[e>>2];case"float":return L[e>>2];case"double":return j[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,$,L,j,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function H(e,t){return e?B(D,e,t):""}function U(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return U(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return U(e,N,n,t),n}function V(e){A=e,o.HEAP8=N=new Int8Array(e),o.HEAP16=M=new Int16Array(e),o.HEAP32=$=new Int32Array(e),o.HEAPU8=D=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=new Uint32Array(e),o.HEAPF32=L=new Float32Array(e),o.HEAPF64=j=new Float64Array(e)}var G=o.INITIAL_MEMORY||33554432;(S=o.wasmMemory?o.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,o.monitorRunDependencies&&o.monitorRunDependencies(te)}function ie(e){if(te--,o.monitorRunDependencies&&o.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw o.onAbort&&o.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}o.preloadedImages={},o.preloadedAudios={},o.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=o.locateFile?o.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(o)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}var we={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function xe(e,t,n){return e.includes("j")?function(e,t,n){var r=o["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Te=5250832;function Ee(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function Ce(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Ee(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Se(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function ke(e,t){var n,r;return t&&(n=o.asm["orig$"+e]),n||(n=o.asm[e]),!n&&t&&(n=o["_orig$"+e]),n||(n=o[Se(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return xe(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Pe(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return He(e);var t=Te,n=t+e+15&-16;return Te=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return $[t>>2]=n/1e3|0,$[t+4>>2]=n%1e3*1e3*1e3|0,0}function Le(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function je(e){Qe(e)}function Fe(e){E(e)}$e.sig="iii",je.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Te,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:$e,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),Le(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:je,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=H(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},He=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=Ce(n,1024),o.asm=n;var r,i=ye(t);i.neededDynlibs&&(C=i.neededDynlibs.concat(C)),r=o.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.__wasm_call_ctors).apply(null,arguments)},o._malloc=function(){return(He=o._malloc=o.asm.malloc).apply(null,arguments)}),Ue=(o._ts_language_symbol_count=function(){return(o._ts_language_symbol_count=o.asm.ts_language_symbol_count).apply(null,arguments)},o._ts_language_version=function(){return(o._ts_language_version=o.asm.ts_language_version).apply(null,arguments)},o._ts_language_field_count=function(){return(o._ts_language_field_count=o.asm.ts_language_field_count).apply(null,arguments)},o._ts_language_symbol_name=function(){return(o._ts_language_symbol_name=o.asm.ts_language_symbol_name).apply(null,arguments)},o._ts_language_symbol_for_name=function(){return(o._ts_language_symbol_for_name=o.asm.ts_language_symbol_for_name).apply(null,arguments)},o._ts_language_symbol_type=function(){return(o._ts_language_symbol_type=o.asm.ts_language_symbol_type).apply(null,arguments)},o._ts_language_field_name_for_id=function(){return(o._ts_language_field_name_for_id=o.asm.ts_language_field_name_for_id).apply(null,arguments)},o._memcpy=function(){return(o._memcpy=o.asm.memcpy).apply(null,arguments)},o._free=function(){return(o._free=o.asm.free).apply(null,arguments)},o._calloc=function(){return(o._calloc=o.asm.calloc).apply(null,arguments)},o._ts_parser_delete=function(){return(o._ts_parser_delete=o.asm.ts_parser_delete).apply(null,arguments)},o._ts_parser_reset=function(){return(o._ts_parser_reset=o.asm.ts_parser_reset).apply(null,arguments)},o._ts_parser_set_language=function(){return(o._ts_parser_set_language=o.asm.ts_parser_set_language).apply(null,arguments)},o._ts_parser_timeout_micros=function(){return(o._ts_parser_timeout_micros=o.asm.ts_parser_timeout_micros).apply(null,arguments)},o._ts_parser_set_timeout_micros=function(){return(o._ts_parser_set_timeout_micros=o.asm.ts_parser_set_timeout_micros).apply(null,arguments)},o._memcmp=function(){return(o._memcmp=o.asm.memcmp).apply(null,arguments)},o._ts_query_new=function(){return(o._ts_query_new=o.asm.ts_query_new).apply(null,arguments)},o._ts_query_delete=function(){return(o._ts_query_delete=o.asm.ts_query_delete).apply(null,arguments)},o._iswspace=function(){return(o._iswspace=o.asm.iswspace).apply(null,arguments)},o._iswalnum=function(){return(o._iswalnum=o.asm.iswalnum).apply(null,arguments)},o._ts_query_pattern_count=function(){return(o._ts_query_pattern_count=o.asm.ts_query_pattern_count).apply(null,arguments)},o._ts_query_capture_count=function(){return(o._ts_query_capture_count=o.asm.ts_query_capture_count).apply(null,arguments)},o._ts_query_string_count=function(){return(o._ts_query_string_count=o.asm.ts_query_string_count).apply(null,arguments)},o._ts_query_capture_name_for_id=function(){return(o._ts_query_capture_name_for_id=o.asm.ts_query_capture_name_for_id).apply(null,arguments)},o._ts_query_string_value_for_id=function(){return(o._ts_query_string_value_for_id=o.asm.ts_query_string_value_for_id).apply(null,arguments)},o._ts_query_predicates_for_pattern=function(){return(o._ts_query_predicates_for_pattern=o.asm.ts_query_predicates_for_pattern).apply(null,arguments)},o._ts_tree_copy=function(){return(o._ts_tree_copy=o.asm.ts_tree_copy).apply(null,arguments)},o._ts_tree_delete=function(){return(o._ts_tree_delete=o.asm.ts_tree_delete).apply(null,arguments)},o._ts_init=function(){return(o._ts_init=o.asm.ts_init).apply(null,arguments)},o._ts_parser_new_wasm=function(){return(o._ts_parser_new_wasm=o.asm.ts_parser_new_wasm).apply(null,arguments)},o._ts_parser_enable_logger_wasm=function(){return(o._ts_parser_enable_logger_wasm=o.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},o._ts_parser_parse_wasm=function(){return(o._ts_parser_parse_wasm=o.asm.ts_parser_parse_wasm).apply(null,arguments)},o._ts_language_type_is_named_wasm=function(){return(o._ts_language_type_is_named_wasm=o.asm.ts_language_type_is_named_wasm).apply(null,arguments)},o._ts_language_type_is_visible_wasm=function(){return(o._ts_language_type_is_visible_wasm=o.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},o._ts_tree_root_node_wasm=function(){return(o._ts_tree_root_node_wasm=o.asm.ts_tree_root_node_wasm).apply(null,arguments)},o._ts_tree_edit_wasm=function(){return(o._ts_tree_edit_wasm=o.asm.ts_tree_edit_wasm).apply(null,arguments)},o._ts_tree_get_changed_ranges_wasm=function(){return(o._ts_tree_get_changed_ranges_wasm=o.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},o._ts_tree_cursor_new_wasm=function(){return(o._ts_tree_cursor_new_wasm=o.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},o._ts_tree_cursor_delete_wasm=function(){return(o._ts_tree_cursor_delete_wasm=o.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},o._ts_tree_cursor_reset_wasm=function(){return(o._ts_tree_cursor_reset_wasm=o.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_first_child_wasm=function(){return(o._ts_tree_cursor_goto_first_child_wasm=o.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_next_sibling_wasm=function(){return(o._ts_tree_cursor_goto_next_sibling_wasm=o.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_parent_wasm=function(){return(o._ts_tree_cursor_goto_parent_wasm=o.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_type_id_wasm=function(){return(o._ts_tree_cursor_current_node_type_id_wasm=o.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_named_wasm=function(){return(o._ts_tree_cursor_current_node_is_named_wasm=o.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_missing_wasm=function(){return(o._ts_tree_cursor_current_node_is_missing_wasm=o.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_id_wasm=function(){return(o._ts_tree_cursor_current_node_id_wasm=o.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},o._ts_tree_cursor_start_position_wasm=function(){return(o._ts_tree_cursor_start_position_wasm=o.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},o._ts_tree_cursor_end_position_wasm=function(){return(o._ts_tree_cursor_end_position_wasm=o.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},o._ts_tree_cursor_start_index_wasm=function(){return(o._ts_tree_cursor_start_index_wasm=o.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},o._ts_tree_cursor_end_index_wasm=function(){return(o._ts_tree_cursor_end_index_wasm=o.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},o._ts_tree_cursor_current_field_id_wasm=function(){return(o._ts_tree_cursor_current_field_id_wasm=o.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_wasm=function(){return(o._ts_tree_cursor_current_node_wasm=o.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},o._ts_node_symbol_wasm=function(){return(o._ts_node_symbol_wasm=o.asm.ts_node_symbol_wasm).apply(null,arguments)},o._ts_node_child_count_wasm=function(){return(o._ts_node_child_count_wasm=o.asm.ts_node_child_count_wasm).apply(null,arguments)},o._ts_node_named_child_count_wasm=function(){return(o._ts_node_named_child_count_wasm=o.asm.ts_node_named_child_count_wasm).apply(null,arguments)},o._ts_node_child_wasm=function(){return(o._ts_node_child_wasm=o.asm.ts_node_child_wasm).apply(null,arguments)},o._ts_node_named_child_wasm=function(){return(o._ts_node_named_child_wasm=o.asm.ts_node_named_child_wasm).apply(null,arguments)},o._ts_node_child_by_field_id_wasm=function(){return(o._ts_node_child_by_field_id_wasm=o.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},o._ts_node_next_sibling_wasm=function(){return(o._ts_node_next_sibling_wasm=o.asm.ts_node_next_sibling_wasm).apply(null,arguments)},o._ts_node_prev_sibling_wasm=function(){return(o._ts_node_prev_sibling_wasm=o.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},o._ts_node_next_named_sibling_wasm=function(){return(o._ts_node_next_named_sibling_wasm=o.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},o._ts_node_prev_named_sibling_wasm=function(){return(o._ts_node_prev_named_sibling_wasm=o.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},o._ts_node_parent_wasm=function(){return(o._ts_node_parent_wasm=o.asm.ts_node_parent_wasm).apply(null,arguments)},o._ts_node_descendant_for_index_wasm=function(){return(o._ts_node_descendant_for_index_wasm=o.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_index_wasm=function(){return(o._ts_node_named_descendant_for_index_wasm=o.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_descendant_for_position_wasm=function(){return(o._ts_node_descendant_for_position_wasm=o.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_position_wasm=function(){return(o._ts_node_named_descendant_for_position_wasm=o.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_start_point_wasm=function(){return(o._ts_node_start_point_wasm=o.asm.ts_node_start_point_wasm).apply(null,arguments)},o._ts_node_end_point_wasm=function(){return(o._ts_node_end_point_wasm=o.asm.ts_node_end_point_wasm).apply(null,arguments)},o._ts_node_start_index_wasm=function(){return(o._ts_node_start_index_wasm=o.asm.ts_node_start_index_wasm).apply(null,arguments)},o._ts_node_end_index_wasm=function(){return(o._ts_node_end_index_wasm=o.asm.ts_node_end_index_wasm).apply(null,arguments)},o._ts_node_to_string_wasm=function(){return(o._ts_node_to_string_wasm=o.asm.ts_node_to_string_wasm).apply(null,arguments)},o._ts_node_children_wasm=function(){return(o._ts_node_children_wasm=o.asm.ts_node_children_wasm).apply(null,arguments)},o._ts_node_named_children_wasm=function(){return(o._ts_node_named_children_wasm=o.asm.ts_node_named_children_wasm).apply(null,arguments)},o._ts_node_descendants_of_type_wasm=function(){return(o._ts_node_descendants_of_type_wasm=o.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},o._ts_node_is_named_wasm=function(){return(o._ts_node_is_named_wasm=o.asm.ts_node_is_named_wasm).apply(null,arguments)},o._ts_node_has_changes_wasm=function(){return(o._ts_node_has_changes_wasm=o.asm.ts_node_has_changes_wasm).apply(null,arguments)},o._ts_node_has_error_wasm=function(){return(o._ts_node_has_error_wasm=o.asm.ts_node_has_error_wasm).apply(null,arguments)},o._ts_node_is_missing_wasm=function(){return(o._ts_node_is_missing_wasm=o.asm.ts_node_is_missing_wasm).apply(null,arguments)},o._ts_query_matches_wasm=function(){return(o._ts_query_matches_wasm=o.asm.ts_query_matches_wasm).apply(null,arguments)},o._ts_query_captures_wasm=function(){return(o._ts_query_captures_wasm=o.asm.ts_query_captures_wasm).apply(null,arguments)},o._iswalpha=function(){return(o._iswalpha=o.asm.iswalpha).apply(null,arguments)},o._iswdigit=function(){return(o._iswdigit=o.asm.iswdigit).apply(null,arguments)},o._iswlower=function(){return(o._iswlower=o.asm.iswlower).apply(null,arguments)},o._towupper=function(){return(o._towupper=o.asm.towupper).apply(null,arguments)},o._memchr=function(){return(o._memchr=o.asm.memchr).apply(null,arguments)},o.___errno_location=function(){return(Ue=o.___errno_location=o.asm.__errno_location).apply(null,arguments)}),We=(o._strlen=function(){return(o._strlen=o.asm.strlen).apply(null,arguments)},o.stackSave=function(){return(We=o.stackSave=o.asm.stackSave).apply(null,arguments)}),ze=o.stackRestore=function(){return(ze=o.stackRestore=o.asm.stackRestore).apply(null,arguments)},Ke=o.stackAlloc=function(){return(Ke=o.stackAlloc=o.asm.stackAlloc).apply(null,arguments)},Ve=o._setThrew=function(){return(Ve=o._setThrew=o.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=o.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=o.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},o.__Znwm=function(){return(o.__Znwm=o.asm._Znwm).apply(null,arguments)},o.__ZdlPv=function(){return(o.__ZdlPv=o.asm._ZdlPv).apply(null,arguments)},o._orig$ts_parser_timeout_micros=function(){return(o._orig$ts_parser_timeout_micros=o.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},o._orig$ts_parser_set_timeout_micros=function(){return(o._orig$ts_parser_set_timeout_micros=o.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},o._TRANSFER_BUFFER=7296,o.___THREW__=7932,o.___threwValue=7936,o.___cxa_new_handler=7928,o.allocate=function(e,t){var n;return n=t==F?Ke(e.length):He(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,o.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Ye&&function(e){var t=o._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));$[r>>2]=K(c);for(var i=1;i>2)+i]=K(e[i-1]);$[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(o.onExit&&o.onExit(e),R=!0),l(e,new Ge(e)))}if(o.run=Xe,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Ye=!0;o.noInitialRun&&(Ye=!1),Xe();const Ze=o,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{o.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(7147);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Pe;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{const r=n(7147),o=n(1017),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=require("@opentelemetry/tracing")},9166:e=>{"use strict";e.exports=require("applicationinsights-native-metrics")},9491:e=>{"use strict";e.exports=require("assert")},852:e=>{"use strict";e.exports=require("async_hooks")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6206:e=>{"use strict";e.exports=require("console")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5158:e=>{"use strict";e.exports=require("http2")},5687:e=>{"use strict";e.exports=require("https")},8188:e=>{"use strict";e.exports=require("module")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},2781:e=>{"use strict";e.exports=require("stream")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},9796:e=>{"use strict";e.exports=require("zlib")},3180:e=>{"use strict";e.exports=JSON.parse('{"name":"@adobe/helix-fetch","version":"3.1.1","description":"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2","main":"src/index.js","scripts":{"test":"nyc mocha","lint":"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},"mocha":{"timeout":"5000","recursive":"true","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"engines":{"node":">=12.0"},"types":"src/index.d.ts","exports":{"import":"./src/index.mjs","require":"./src/index.js"},"repository":{"type":"git","url":"https://github.com/adobe/helix-fetch"},"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/adobe/helix-fetch/issues"},"homepage":"https://github.com/adobe/helix-fetch#readme","keywords":["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],"dependencies":{"debug":"4.3.4","http-cache-semantics":"4.1.0","lru-cache":"7.13.1"},"devDependencies":{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2","eslint":"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3","mocha":"10.0.0","mocha-multi-reporters":"1.5.1","nock":"13.2.9","nyc":"15.1.0","parse-cache-control":"1.0.1","pem":"1.14.6","proxy":"^1.0.2","semantic-release":"19.0.3","sinon":"14.0.0","stream-buffers":"3.0.2","tunnel":"^0.0.6"},"lint-staged":{"*.js":"eslint"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"ghooks":{"pre-commit":"npx lint-staged"}}}')},1143:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3186:e=>{"use strict";e.exports={i8:"1.7.6"}},9674:e=>{"use strict";e.exports={i8:"0.2.0"}},735:e=>{"use strict";e.exports={i8:"1.3.7"}},9876:e=>{"use strict";e.exports=JSON.parse('{"name":"copilot","displayName":"GitHub Copilot","description":"Your AI pair programmer","version":"1.45.0","build":"dev","buildType":"dev","publisher":"GitHub","preview":false,"qna":"https://github.com/github-community/community/discussions/categories/copilot","icon":"assets/Copilot-App-Icon.png","engines":{"vscode":"^1.68.0","npm":">=7.0.0"},"categories":["Other"],"badges":[{"url":"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange","href":"https://github.com/github-copilot/signup","description":"Sign up for GitHub Copilot"}],"activationEvents":["onStartupFinished"],"main":"./dist/extension","enabledApiProposals":["inlineCompletionsAdditions"],"contributes":{"commands":[{"command":"github.copilot.generate","title":"Open GitHub Copilot"},{"command":"github.copilot.toggleCopilot","title":"GitHub Copilot: Configure Enabled/Disabled"},{"command":"github.copilot.sendFeedback","title":"GitHub Copilot: Send Feedback"}],"keybindings":[{"command":"github.copilot.generate","key":"ctrl+enter","mac":"ctrl+enter","when":"editorTextFocus && github.copilot.activated"},{"command":"editor.action.inlineSuggest.trigger","key":"alt+\\\\","when":"editorTextFocus && !editorHasSelection && config.github.copilot.inlineSuggest.enable && !inlineSuggestionsVisible"}],"menus":{"editor/inlineCompletions/actions":[{"command":"github.copilot.generate","when":"github.copilot.activated"}],"commandPalette":[{"command":"github.copilot.generate","when":"github.copilot.activated"},{"command":"github.copilot.toggleCopilot","when":"github.copilot.activated"},{"command":"github.copilot.sendFeedback","when":"github.copilot.activated"}]},"configuration":[{"title":"Copilot","properties":{"github.copilot.advanced":{"type":"object","title":"Advanced Settings","properties":{"secret_key":{"type":"string","default":"","description":"Secret API key"},"length":{"type":"integer","default":500,"description":"Length of code to generate in tokens"},"temperature":{"type":"string","default":"","description":"Override sampling temperature (range 0.0 - 1.0)"},"top_p":{"type":"number","default":1,"description":"Top probability mass to consider"},"stops":{"type":"object","default":{"*":["\\n\\n\\n"],"python":["\\ndef ","\\nclass ","\\nif ","\\n\\n#"]},"description":"Configure per-language stop sequences"},"indentationMode":{"type":"object","default":{"python":false,"javascript":false,"javascriptreact":false,"jsx":false,"typescript":false,"typescriptreact":false,"go":false,"ruby":false,"*":true},"markdownDescription":"Enable or disable indentation block termination for specified [languages](https://code.visualstudio.com/docs/languages/identifiers)."},"inlineSuggestCount":{"type":"integer","default":3,"description":"Number of inline suggestions to fetch"},"listCount":{"type":"integer","default":10,"description":"Number of solutions to list in Open GitHub Copilot"},"debug.showScores":{"type":"boolean","default":false,"description":"Show scores in sorted solutions"},"debug.overrideEngine":{"type":"string","default":"","description":"Override engine name"},"debug.overrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy full URL"},"debug.testOverrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy URL when running tests"},"debug.overrideLogLevels":{"type":"object","default":{},"description":"Override what the minimum logged level is per logger (or \'*\' for all loggers). Levels are \'DEBUG\', \'INFO\', \'WARN\', \'ERROR\'. Ex: `{\\"default\\": \\"DEBUG\\"}` to see all things logged to the \'default\' logger."},"debug.filterLogCategories":{"type":"array","default":[],"description":"Show only log categories listed in this setting. If an array is empty, show all loggers"}}},"github.copilot.enable":{"type":"object","default":{"*":true,"yaml":false,"plaintext":false,"markdown":false},"markdownDescription":"Enable or disable Copilot for specified [languages](https://code.visualstudio.com/docs/languages/identifiers)"},"github.copilot.inlineSuggest.enable":{"type":"boolean","default":true,"description":"Show inline suggestions"}}}],"icons":{"copilot-logo":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0041"}},"copilot-warning":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0042"}},"copilot-notconnected":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0043"}}},"iconFonts":[{"id":"copilot-font","src":[{"path":"assets/copilot.woff","format":"woff"}]}]},"scripts":{"postinstall":"npx vscode-dts dev && mv vscode.proposed.*.ts extension/src","vscode:prepublish":"npm-run-all build:extension","build":"npm-run-all build:*","build:agent":"cd agent && npm run build","build:agent-no-pkg":"cd agent && npm run build-no-pkg","build:extension":"webpack --mode production","build:lib":"cd lib && npm run build","compile":"npm-run-all compile:*","compile:agent":"cd agent && npm run compile","compile:extension":"webpack --mode development","compile:lib":"cd lib && npm run compile","watch":"npm-run-all -p watch:*","watch:agent":"cd agent && npm run watch","watch:extension":"webpack --mode development --watch","watch:lib":"cd lib && npm run watch","lint":"eslint lib extension agent --ext ts","check_deps":"depcruise -c .dependency-cruiser.js .","test":"npm-run-all test:*","test:agent":"cd agent && npm run test","test:extension":"cd extension && ts-node ./test/runTest.ts","test:prompt":"cd prompt && npm install && npm run test","test:lib":"cd lib && npm run test","test:lsp-client":"cd lsp-client && npm run smokeTest","build_test":"tsc extension/test/run.ts","get_token":"ts-node script/getToken.ts"},"devDependencies":{"@github/prettier-config":"0.0.4","@types/crypto-js":"^4.0.1","@types/mocha":"^5.2.6","@types/node":"^13.11.0","@types/tunnel":"^0.0.3","@types/uuid":"^8.3.1","@types/vscode":"^1.68.0","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","dependency-cruiser":"^9.26.1","eslint":"^7.29.0","eslint-plugin-no-only-tests":"^2.6.0","fantasticon":"^1.2.2","get-port":"^5.1.1","mocha":"^6.1.4","npm-run-all":"^4.1.5","prettier":"2.5.1","prettier-plugin-organize-imports":"^2.3.4","ts-dedent":"^2.2.0","ts-loader":"^8.0.11","ts-node":"^9.0.0","typescript":"^4.4.3","vsce":"1.91.0","vscode-dts":"^0.3.2","vscode-test":"^1.3.0","webpack":"^5.54.0","webpack-cli":"^4.2.0","zlib":"^1.0.5"},"dependencies":{"@adobe/helix-fetch":"github:bmuskalla/helix-fetch#4e33e47bf6e64b637d5d713558fde504bf71c947","@github/copilot-promptlib":"file:prompt","@sinclair/typebox":"^0.23.4","ajv":"^8.6.3","ajv-errors":"^3.0.0","crypto-js":"^4.0.0","open":"^8.4.0","source-map-support":"^0.5.19","tunnel":"^0.0.6","uuid":"^8.3.2","vscode-extension-telemetry":"^0.1.6","vscode-uri":"^3.0.2"}}')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});const t=n(6995),o=n(2879);!async function(){const e=(0,t.init)(),n=(0,o.createWrappedConnection)(e,process.stdin,process.stdout);new o.CopilotService(e,n).listen()}()})(),module.exports=r})(); //# sourceMappingURL=agent.js.map \ No newline at end of file diff --git a/ver_update.sh b/ver_update.sh deleted file mode 100755 index a664833c..00000000 --- a/ver_update.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; -wget -O $SCRIPT_DIR/copilot/dist/agent.js https://raw.githubusercontent.com/github/copilot.vim/release/copilot/dist/agent.js