Skip to content

Instantly share code, notes, and snippets.

@chukShirley
Created August 25, 2023 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chukShirley/6bc2f7fcae491a314bbcb36f819f3108 to your computer and use it in GitHub Desktop.
Save chukShirley/6bc2f7fcae491a314bbcb36f819f3108 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
Project Mode enabled: true
Starting search of: /Users/adamshirley/apps/k3s/K3S-Replenish-RPG
Found RPGLE files: 1079
Validating file from server: qrpglesrc/ar_cexcer.rpgle
Big mode detected!
Validating file from server: qrpglesrc/ar_pgmdstr.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_cexcer.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_pgmdstr.rpgle
Validating file from server: qrpglesrc/ar_oexcer.rpgle
Validating file from server: qrpglesrc/locatns_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_oexcer.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/locatns_h.rpgle
Validating file from server: qrpglesrc/ar_mexcer.rpgle
Validating file from server: qrpglesrc/suplier_h.rpgle
Validating file from server: qrpglesrc/intslog_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_mexcer.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/suplier_h.rpgle
Validating file from server: qrpglesrc/prodsoq_h.rpgle
Validating file from server: qrpglesrc/tablcod_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/intslog_h.rpgle
Validating file from server: rpglint.json
Validating file from server: qrpglesrc/product_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/tablcod_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/prodsoq_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/product_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/.vscode/rpglint.json
Validating file from server: qrpglesrc/suplsoq_h.rpgle
Validating file from server: qrpglesrc/company_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/company_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/suplsoq_h.rpgle
Validating file from server: qrpglesrc/ar_excer_h.rpgle
Validating file from server: qrpglesrc/ar_srlnb_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_excer_h.rpgle
Validating file from server: qrpglesrc/buyrgrp_h.rpgle
Validating file from server: qrpglesrc/k3s_apipro.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_srlnb_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/buyrgrp_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/k3s_apipro.rpgle
Validating file from server: rpglint.json
Validating file from server: qrpglesrc/k3s_apipro.rpgle
Validating file from server: rpglint.json
Validating file from server: qrpglesrc/ar_dexcer.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_dexcer.rpgle
Validating file from server: qrpglesrc/phldlog_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/phldlog_h.rpgle
Validating file from server: qrpglesrc/prodhld_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/prodhld_h.rpgle
Validating file from server: qrpglesrc/ar_m090_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_m090_h.rpgle
Validating file from server: qrpglesrc/ar_3056_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_3056_h.rpgle
Validating file from server: qrpglesrc/ar_m130_h.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_m130_h.rpgle
Validating file from server: 'qrpglesrc/buyrgrp_h.rpgle' Buyer Service Pgm
/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1
(()=>{var e={5623:e=>{"use strict";function t(e,t,o){e instanceof RegExp&&(e=n(e,o)),t instanceof RegExp&&(t=n(t,o));var i=r(e,t,o);return i&&{start:i[0],end:i[1],pre:o.slice(0,i[0]),body:o.slice(i[0]+e.length,i[1]),post:o.slice(i[1]+t.length)}}function n(e,t){var n=t.match(e);return n?n[0]:null}function r(e,t,n){var r,o,i,s,a,c=n.indexOf(e),u=n.indexOf(t,c+1),l=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],i=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(e,l+1)):1==r.length?a=[r.pop(),u]:((o=r.pop())<i&&(i=o,s=u),u=n.indexOf(t,l+1)),l=c<u&&c>=0?c:u;r.length&&(a=[i,s])}return a}e.exports=t,t.range=r},1048:e=>{e.exports=function(e,n){for(var r=[],o=0;o<e.length;o++){var i=n(e[o],o);t(i)?r.push.apply(r,i):r.push(i)}return r};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,s=new Array(i);o<i;o++)s[o]=r[o].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,o,i,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,o),!0;case 5:return l.fn.call(l.context,t,r,o,i),!0;case 6:return l.fn.call(l.context,t,r,o,i,s),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,o);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||r&&a.context!==r||s(this,i);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||o&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},7334:(e,t,n)=>{e.exports=l,l.realpath=l,l.sync=d,l.realpathSync=d,l.monkeypatch=function(){r.realpath=l,r.realpathSync=d},l.unmonkeypatch=function(){r.realpath=o,r.realpathSync=i};var r=n(7147),o=r.realpath,i=r.realpathSync,s=process.version,a=/^v[0-5]\./.test(s),c=n(7059);function u(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function l(e,t,n){if(a)return o(e,t,n);"function"==typeof t&&(n=t,t=null),o(e,t,(function(r,o){u(r)?c.realpath(e,t,n):n(r,o)}))}function d(e,t){if(a)return i(e,t);try{return i(e,t)}catch(n){if(u(n))return c.realpathSync(e,t);throw n}}},7059:(e,t,n)=>{var r=n(1017),o="win32"===process.platform,i=n(7147),s=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);if(r.normalize,o)var a=/(.*?)(?:[\/\\]+|$)/g;else a=/(.*?)(?:[\/]+|$)/g;if(o)var c=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else c=/^[\/]*/;t.realpathSync=function(e,t){if(e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var n,s,u,l,d=e,p={},h={};function f(){var t=c.exec(e);n=t[0].length,s=t[0],u=t[0],l="",o&&!h[u]&&(i.lstatSync(u),h[u]=!0)}for(f();n<e.length;){a.lastIndex=n;var m=a.exec(e);if(l=s,s+=m[0],u=l+m[1],n=a.lastIndex,!(h[u]||t&&t[u]===u)){var g;if(t&&Object.prototype.hasOwnProperty.call(t,u))g=t[u];else{var y=i.lstatSync(u);if(!y.isSymbolicLink()){h[u]=!0,t&&(t[u]=u);continue}var v=null;if(!o){var b=y.dev.toString(32)+":"+y.ino.toString(32);p.hasOwnProperty(b)&&(v=p[b])}null===v&&(i.statSync(u),v=i.readlinkSync(u)),g=r.resolve(l,v),t&&(t[u]=g),o||(p[b]=v)}e=r.resolve(g,e.slice(n)),f()}}return t&&(t[d]=e),e},t.realpath=function(e,t,n){if("function"!=typeof n&&(n=function(e){return"function"==typeof e?e:function(){var e;if(s){var t=new Error;e=function(e){e&&(t.message=e.message,n(e=t))}}else e=n;return e;function n(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}(t),t=null),e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(n.bind(null,null,t[e]));var u,l,d,p,h=e,f={},m={};function g(){var t=c.exec(e);u=t[0].length,l=t[0],d=t[0],p="",o&&!m[d]?i.lstat(d,(function(e){if(e)return n(e);m[d]=!0,y()})):process.nextTick(y)}function y(){if(u>=e.length)return t&&(t[h]=e),n(null,e);a.lastIndex=u;var r=a.exec(e);return p=l,l+=r[0],d=p+r[1],u=a.lastIndex,m[d]||t&&t[d]===d?process.nextTick(y):t&&Object.prototype.hasOwnProperty.call(t,d)?R(t[d]):i.lstat(d,v)}function v(e,r){if(e)return n(e);if(!r.isSymbolicLink())return m[d]=!0,t&&(t[d]=d),process.nextTick(y);if(!o){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(f.hasOwnProperty(s))return b(null,f[s],d)}i.stat(d,(function(e){if(e)return n(e);i.readlink(d,(function(e,t){o||(f[s]=t),b(e,t)}))}))}function b(e,o,i){if(e)return n(e);var s=r.resolve(p,o);t&&(t[i]=s),R(s)}function R(t){e=r.resolve(t,e.slice(u)),g()}g()}},6772:(e,t,n)=>{function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.setopts=function(e,t,n){if(n||(n={}),n.matchBase&&-1===t.indexOf("/")){if(n.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!n.silent,e.pattern=t,e.strict=!1!==n.strict,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0),e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.fs=n.fs||o,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(l))}(e,n),e.changedCwd=!1;var s=process.cwd();r(n,"cwd")?(e.cwd=i.resolve(n.cwd),e.changedCwd=e.cwd!==s):e.cwd=s,e.root=n.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=a(e.cwd)?e.cwd:d(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,n.allowWindowsEscape=!1,e.minimatch=new c(t,n),e.options=e.minimatch.options},t.ownProp=r,t.makeAbs=d,t.finish=function(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,o=e.matches.length;r<o;r++){var i=e.matches[r];if(i&&0!==Object.keys(i).length){var s=Object.keys(i);t?n.push.apply(n,s):s.forEach((function(e){n[e]=!0}))}else if(e.nonull){var a=e.minimatch.globSet[r];t?n.push(a):n[a]=!0}}if(t||(n=Object.keys(n)),e.nosort||(n=n.sort(u)),e.mark){for(r=0;r<n.length;r++)n[r]=e._mark(n[r]);e.nodir&&(n=n.filter((function(t){var n=!/\/$/.test(t),r=e.cache[t]||e.cache[d(e,t)];return n&&r&&(n="DIR"!==r&&!Array.isArray(r)),n})))}e.ignore.length&&(n=n.filter((function(t){return!p(e,t)}))),e.found=n},t.mark=function(e,t){var n=d(e,t),r=e.cache[n],o=t;if(r){var i="DIR"===r||Array.isArray(r),s="/"===t.slice(-1);if(i&&!s?o+="/":!i&&s&&(o=o.slice(0,-1)),o!==t){var a=d(e,o);e.statCache[a]=e.statCache[n],e.cache[a]=e.cache[n]}}return o},t.isIgnored=p,t.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(t))}))};var o=n(7147),i=n(1017),s=n(6522),a=n(4095),c=s.Minimatch;function u(e,t){return e.localeCompare(t,"en")}function l(e){var t=null;if("/**"===e.slice(-3)){var n=e.replace(/(\/\*\*)+$/,"");t=new c(n,{dot:!0})}return{matcher:new c(e,{dot:!0}),gmatcher:t}}function d(e,t){var n=t;return n="/"===t.charAt(0)?i.join(e.root,t):a(t)||""===t?t:e.changedCwd?i.resolve(e.cwd,t):i.resolve(t),"win32"===process.platform&&(n=n.replace(/\\/g,"/")),n}function p(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))}))}},2884:(e,t,n)=>{e.exports=v;var r=n(7334),o=n(6522),i=(o.Minimatch,n(4378)),s=n(2361).EventEmitter,a=n(1017),c=n(9491),u=n(4095),l=n(4751),d=n(6772),p=d.setopts,h=d.ownProp,f=n(7844),m=(n(3837),d.childrenIgnored),g=d.isIgnored,y=n(778);function v(e,t,n){if("function"==typeof t&&(n=t,t={}),t||(t={}),t.sync){if(n)throw new TypeError("callback provided to sync glob");return l(e,t)}return new R(e,t,n)}v.sync=l;var b=v.GlobSync=l.GlobSync;function R(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&t.sync){if(n)throw new TypeError("callback provided to sync glob");return new b(e,t)}if(!(this instanceof R))return new R(e,t,n);p(this,e,t),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=new Array(r),"function"==typeof n&&(n=y(n),this.on("error",n),this.on("end",(function(e){n(null,e)})));var o=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===r)return a();for(var i=!0,s=0;s<r;s++)this._process(this.minimatch.set[s],s,!1,a);function a(){--o._processing,o._processing<=0&&(i?process.nextTick((function(){o._finish()})):o._finish())}i=!1}v.glob=v,v.hasMagic=function(e,t){var n=function(e,t){if(null===t||"object"!=typeof t)return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}({},t);n.noprocess=!0;var r=new R(e,n).minimatch.set;if(!e)return!1;if(r.length>1)return!0;for(var o=0;o<r[0].length;o++)if("string"!=typeof r[0][o])return!0;return!1},v.Glob=R,i(R,s),R.prototype._finish=function(){if(c(this instanceof R),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();d.finish(this),this.emit("end",this.found)}},R.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,n=0;n<this.matches.length;n++)this._realpathSet(n,r)}function r(){0==--e&&t._finish()}},R.prototype._realpathSet=function(e,t){var n=this.matches[e];if(!n)return t();var o=Object.keys(n),i=this,s=o.length;if(0===s)return t();var a=this.matches[e]=Object.create(null);o.forEach((function(n,o){n=i._makeAbs(n),r.realpath(n,i.realpathCache,(function(r,o){r?"stat"===r.syscall?a[n]=!0:i.emit("error",r):a[o]=!0,0==--s&&(i.matches[e]=a,t())}))}))},R.prototype._mark=function(e){return d.mark(this,e)},R.prototype._makeAbs=function(e){return d.makeAbs(this,e)},R.prototype.abort=function(){this.aborted=!0,this.emit("abort")},R.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},R.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var n=e[t];this._emitMatch(n[0],n[1])}}if(this._processQueue.length){var r=this._processQueue.slice(0);for(this._processQueue.length=0,t=0;t<r.length;t++){var o=r[t];this._processing--,this._process(o[0],o[1],o[2],o[3])}}}},R.prototype._process=function(e,t,n,r){if(c(this instanceof R),c("function"==typeof r),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,n,r]);else{for(var i,s=0;"string"==typeof e[s];)s++;switch(s){case e.length:return void this._processSimple(e.join("/"),t,r);case 0:i=null;break;default:i=e.slice(0,s).join("/")}var a,l=e.slice(s);null===i?a=".":u(i)||u(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(i&&u(i)||(i="/"+i),a=i):a=i;var d=this._makeAbs(a);if(m(this,a))return r();l[0]===o.GLOBSTAR?this._processGlobStar(i,a,d,l,t,n,r):this._processReaddir(i,a,d,l,t,n,r)}},R.prototype._processReaddir=function(e,t,n,r,o,i,s){var a=this;this._readdir(n,i,(function(c,u){return a._processReaddir2(e,t,n,r,o,i,u,s)}))},R.prototype._processReaddir2=function(e,t,n,r,o,i,s,c){if(!s)return c();for(var u=r[0],l=!!this.minimatch.negate,d=u._glob,p=this.dot||"."===d.charAt(0),h=[],f=0;f<s.length;f++)("."!==(g=s[f]).charAt(0)||p)&&(l&&!e?!g.match(u):g.match(u))&&h.push(g);var m=h.length;if(0===m)return c();if(1===r.length&&!this.mark&&!this.stat){for(this.matches[o]||(this.matches[o]=Object.create(null)),f=0;f<m;f++){var g=h[f];e&&(g="/"!==e?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=a.join(this.root,g)),this._emitMatch(o,g)}return c()}for(r.shift(),f=0;f<m;f++)g=h[f],e&&(g="/"!==e?e+"/"+g:e+g),this._process([g].concat(r),o,i,c);c()},R.prototype._emitMatch=function(e,t){if(!this.aborted&&!g(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var n=u(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0;var o=this.statCache[n];o&&this.emit("stat",t,o),this.emit("match",t)}}},R.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var n=this,r=f("lstat\0"+e,(function(r,o){if(r&&"ENOENT"===r.code)return t();var i=o&&o.isSymbolicLink();n.symlinks[e]=i,i||!o||o.isDirectory()?n._readdir(e,!1,t):(n.cache[e]="FILE",t())}));r&&n.fs.lstat(e,r)}},R.prototype._readdir=function(e,t,n){if(!this.aborted&&(n=f("readdir\0"+e+"\0"+t,n))){if(t&&!h(this.symlinks,e))return this._readdirInGlobStar(e,n);if(h(this.cache,e)){var r=this.cache[e];if(!r||"FILE"===r)return n();if(Array.isArray(r))return n(null,r)}this.fs.readdir(e,function(e,t,n){return function(r,o){r?e._readdirError(t,r,n):e._readdirEntries(t,o,n)}}(this,e,n))}},R.prototype._readdirEntries=function(e,t,n){if(!this.aborted){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var o=t[r];o="/"===e?e+o:e+"/"+o,this.cache[o]=!0}return this.cache[e]=t,n(null,t)}},R.prototype._readdirError=function(e,t,n){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var o=new Error(t.code+" invalid cwd "+this.cwd);o.path=this.cwd,o.code=t.code,this.emit("error",o),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return n()}},R.prototype._processGlobStar=function(e,t,n,r,o,i,s){var a=this;this._readdir(n,i,(function(c,u){a._processGlobStar2(e,t,n,r,o,i,u,s)}))},R.prototype._processGlobStar2=function(e,t,n,r,o,i,s,a){if(!s)return a();var c=r.slice(1),u=e?[e]:[],l=u.concat(c);this._process(l,o,!1,a);var d=this.symlinks[n],p=s.length;if(d&&i)return a();for(var h=0;h<p;h++)if("."!==s[h].charAt(0)||this.dot){var f=u.concat(s[h],c);this._process(f,o,!0,a);var m=u.concat(s[h],r);this._process(m,o,!0,a)}a()},R.prototype._processSimple=function(e,t,n){var r=this;this._stat(e,(function(o,i){r._processSimple2(e,t,o,i,n)}))},R.prototype._processSimple2=function(e,t,n,r,o){if(this.matches[t]||(this.matches[t]=Object.create(null)),!r)return o();if(e&&u(e)&&!this.nomount){var i=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=a.join(this.root,e):(e=a.resolve(this.root,e),i&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),o()},R.prototype._stat=function(e,t){var n=this._makeAbs(e),r="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&h(this.cache,n)){var o=this.cache[n];if(Array.isArray(o)&&(o="DIR"),!r||"DIR"===o)return t(null,o);if(r&&"FILE"===o)return t()}var i=this.statCache[n];if(void 0!==i){if(!1===i)return t(null,i);var s=i.isDirectory()?"DIR":"FILE";return r&&"FILE"===s?t():t(null,s,i)}var a=this,c=f("stat\0"+n,(function(r,o){if(o&&o.isSymbolicLink())return a.fs.stat(n,(function(r,i){r?a._stat2(e,n,null,o,t):a._stat2(e,n,r,i,t)}));a._stat2(e,n,r,o,t)}));c&&a.fs.lstat(n,c)},R.prototype._stat2=function(e,t,n,r,o){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,o();var i="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return o(null,!1,r);var s=!0;return r&&(s=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||s,i&&"FILE"===s?o():o(null,s,r)}},5146:(e,t,n)=>{var r=n(1048),o=n(5623);e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),y(function(e){return e.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(a).split("\\,").join(c).split("\\.").join(u)}(e),!0).map(d)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",c="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function d(e){return e.split(i).join("\\").split(s).join("{").split(a).join("}").split(c).join(",").split(u).join(".")}function p(e){if(!e)return[""];var t=[],n=o("{","}",e);if(!n)return e.split(",");var r=n.pre,i=n.body,s=n.post,a=r.split(",");a[a.length-1]+="{"+i+"}";var c=p(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),t.push.apply(t,a),t}function h(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function m(e,t){return e<=t}function g(e,t){return e>=t}function y(e,t){var n=[],i=o("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var s,c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),d=c||u,v=i.body.indexOf(",")>=0;if(!d&&!v)return i.post.match(/,.*\}/)?y(e=i.pre+"{"+i.body+a+i.post):[e];if(d)s=i.body.split(/\.\./);else if(1===(s=p(i.body)).length&&1===(s=y(s[0],!1).map(h)).length)return(C=i.post.length?y(i.post,!1):[""]).map((function(e){return i.pre+s[0]+e}));var b,R=i.pre,C=i.post.length?y(i.post,!1):[""];if(d){var D=l(s[0]),w=l(s[1]),k=Math.max(s[0].length,s[1].length),T=3==s.length?Math.abs(l(s[2])):1,S=m;w<D&&(T*=-1,S=g);var E=s.some(f);b=[];for(var P=D;S(P,w);P+=T){var _;if(u)"\\"===(_=String.fromCharCode(P))&&(_="");else if(_=String(P),E){var x=k-_.length;if(x>0){var N=new Array(x+1).join("0");_=P<0?"-"+N+_.slice(1):N+_}}b.push(_)}}else b=r(s,(function(e){return y(e,!1)}));for(var O=0;O<b.length;O++)for(var q=0;q<C.length;q++){var I=R+b[O]+C[q];(!t||d||I)&&n.push(I)}return n}},6522:(e,t,n)=>{e.exports=p,p.Minimatch=h;var r=function(){try{return n(1017)}catch(e){}}()||{sep:"/"};p.sep=r.sep;var o=p.GLOBSTAR=h.GLOBSTAR={},i=n(5146),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",c=a+"*?",u="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{}),l=/\/+/;function d(e,t){t=t||{};var n={};return Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function p(e,t,n){return m(t),n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&new h(t,n).match(e)}function h(e,t){if(!(this instanceof h))return new h(e,t);m(e),t||(t={}),e=e.trim(),t.allowWindowsEscape||"/"===r.sep||(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}function f(e,t){return t||(t=this instanceof h?this.options:{}),e=void 0===e?this.pattern:e,m(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:i(e)}p.filter=function(e,t){return t=t||{},function(n,r,o){return p(n,e,t)}},p.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return p;var t=p,n=function(n,r,o){return t(n,r,d(e,o))};return(n.Minimatch=function(n,r){return new t.Minimatch(n,d(e,r))}).defaults=function(n){return t.defaults(d(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,d(e,r))},n.defaults=function(n){return t.defaults(d(e,n))},n.makeRe=function(n,r){return t.makeRe(n,d(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,d(e,r))},n.match=function(n,r,o){return t.match(n,r,d(e,o))},n},h.defaults=function(e){return p.defaults(e).Minimatch},h.prototype.debug=function(){},h.prototype.make=function(){var e=this.pattern,t=this.options;if(t.nocomment||"#"!==e.charAt(0))if(e){this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map((function(e){return e.split(l)})),this.debug(this.pattern,n),n=n.map((function(e,t,n){return e.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,n),this.set=n}else this.empty=!0;else this.comment=!0},h.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=0;if(!this.options.nonegate){for(var r=0,o=e.length;r<o&&"!"===e.charAt(r);r++)t=!t,n++;n&&(this.pattern=e.substr(n)),this.negate=t}},p.braceExpand=function(e,t){return f(e,t)},h.prototype.braceExpand=f;var m=function(e){if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};h.prototype.parse=function(e,t){m(e);var n=this.options;if("**"===e){if(!n.noglobstar)return o;e="*"}if(""===e)return"";var r,i="",l=!!n.nocase,d=!1,p=[],h=[],f=!1,y=-1,v=-1,b="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",R=this;function C(){if(r){switch(r){case"*":i+=c,l=!0;break;case"?":i+=a,l=!0;break;default:i+="\\"+r}R.debug("clearStateChar %j %j",r,i),r=!1}}for(var D,w=0,k=e.length;w<k&&(D=e.charAt(w));w++)if(this.debug("%s\t%s %s %j",e,w,i,D),d&&u[D])i+="\\"+D,d=!1;else switch(D){case"/":return!1;case"\\":C(),d=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,w,i,D),f){this.debug(" in class"),"!"===D&&w===v+1&&(D="^"),i+=D;continue}R.debug("call clearStateChar %j",r),C(),r=D,n.noext&&C();continue;case"(":if(f){i+="(";continue}if(!r){i+="\\(";continue}p.push({type:r,start:w-1,reStart:i.length,open:s[r].open,close:s[r].close}),i+="!"===r?"(?:(?!(?:":"(?:",this.debug("plType %j %j",r,i),r=!1;continue;case")":if(f||!p.length){i+="\\)";continue}C(),l=!0;var T=p.pop();i+=T.close,"!"===T.type&&h.push(T),T.reEnd=i.length;continue;case"|":if(f||!p.length||d){i+="\\|",d=!1;continue}C(),i+="|";continue;case"[":if(C(),f){i+="\\"+D;continue}f=!0,v=w,y=i.length,i+=D;continue;case"]":if(w===v+1||!f){i+="\\"+D,d=!1;continue}var S=e.substring(v+1,w);try{RegExp("["+S+"]")}catch(e){var E=this.parse(S,g);i=i.substr(0,y)+"\\["+E[0]+"\\]",l=l||E[1],f=!1;continue}l=!0,f=!1,i+=D;continue;default:C(),d?d=!1:!u[D]||"^"===D&&f||(i+="\\"),i+=D}for(f&&(S=e.substr(v+1),E=this.parse(S,g),i=i.substr(0,y)+"\\["+E[0],l=l||E[1]),T=p.pop();T;T=p.pop()){var P=i.slice(T.reStart+T.open.length);this.debug("setting tail",i,T),P=P.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,n){return n||(n="\\"),t+t+n+"|"})),this.debug("tail=%j\n %s",P,P,T,i);var _="*"===T.type?c:"?"===T.type?a:"\\"+T.type;l=!0,i=i.slice(0,T.reStart)+_+"\\("+P}C(),d&&(i+="\\\\");var x=!1;switch(i.charAt(0)){case"[":case".":case"(":x=!0}for(var N=h.length-1;N>-1;N--){var O=h[N],q=i.slice(0,O.reStart),I=i.slice(O.reStart,O.reEnd-8),A=i.slice(O.reEnd-8,O.reEnd),L=i.slice(O.reEnd);A+=L;var M=q.split("(").length-1,j=L;for(w=0;w<M;w++)j=j.replace(/\)[+*?]?/,"");var F="";""===(L=j)&&t!==g&&(F="$"),i=q+I+L+F+A}if(""!==i&&l&&(i="(?=.)"+i),x&&(i=b+i),t===g)return[i,l];if(!l)return e.replace(/\\(.)/g,"$1");var U=n.nocase?"i":"";try{var W=new RegExp("^"+i+"$",U)}catch(e){return new RegExp("$.")}return W._glob=e,W._src=i,W};var g={};p.makeRe=function(e,t){return new h(e,t||{}).makeRe()},h.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,n=t.noglobstar?c:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=t.nocase?"i":"",i=e.map((function(e){return e.map((function(e){return e===o?n:"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e._src})).join("\\/")})).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,r)}catch(e){this.regexp=!1}return this.regexp},p.match=function(e,t,n){var r=new h(t,n=n||{});return e=e.filter((function(e){return r.match(e)})),r.options.nonull&&!e.length&&e.push(t),e},h.prototype.match=function(e,t){if(void 0===t&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var n=this.options;"/"!==r.sep&&(e=e.split(r.sep).join("/")),e=e.split(l),this.debug(this.pattern,"split",e);var o,i,s=this.set;for(this.debug(this.pattern,"set",s),i=e.length-1;i>=0&&!(o=e[i]);i--);for(i=0;i<s.length;i++){var a=s[i],c=e;if(n.matchBase&&1===a.length&&(c=[o]),this.matchOne(c,a,t))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},h.prototype.matchOne=function(e,t,n){var r=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,s=0,a=e.length,c=t.length;i<a&&s<c;i++,s++){this.debug("matchOne loop");var u,l=t[s],d=e[i];if(this.debug(t,l,d),!1===l)return!1;if(l===o){this.debug("GLOBSTAR",[t,l,d]);var p=i,h=s+1;if(h===c){for(this.debug("** at the end");i<a;i++)if("."===e[i]||".."===e[i]||!r.dot&&"."===e[i].charAt(0))return!1;return!0}for(;p<a;){var f=e[p];if(this.debug("\nglobstar while",e,p,t,h,f),this.matchOne(e.slice(p),t.slice(h),n))return this.debug("globstar found match!",p,a,f),!0;if("."===f||".."===f||!r.dot&&"."===f.charAt(0)){this.debug("dot detected!",e,p,t,h);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!n||(this.debug("\n>>> no match, partial?",e,p,t,h),p!==a))}if("string"==typeof l?(u=d===l,this.debug("string match",l,d,u)):(u=d.match(l),this.debug("pattern match",l,d,u)),!u)return!1}if(i===a&&s===c)return!0;if(i===a)return n;if(s===c)return i===a-1&&""===e[i];throw new Error("wtf?")}},4751:(e,t,n)=>{e.exports=h,h.GlobSync=f;var r=n(7334),o=n(6522),i=(o.Minimatch,n(2884).Glob,n(3837),n(1017)),s=n(9491),a=n(4095),c=n(6772),u=c.setopts,l=c.ownProp,d=c.childrenIgnored,p=c.isIgnored;function h(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new f(e,t).found}function f(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof f))return new f(e,t);if(u(this,e,t),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var r=0;r<n;r++)this._process(this.minimatch.set[r],r,!1);this._finish()}f.prototype._finish=function(){if(s.ok(this instanceof f),this.realpath){var e=this;this.matches.forEach((function(t,n){var o=e.matches[n]=Object.create(null);for(var i in t)try{i=e._makeAbs(i),o[r.realpathSync(i,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;o[e._makeAbs(i)]=!0}}))}c.finish(this)},f.prototype._process=function(e,t,n){s.ok(this instanceof f);for(var r,i=0;"string"==typeof e[i];)i++;switch(i){case e.length:return void this._processSimple(e.join("/"),t);case 0:r=null;break;default:r=e.slice(0,i).join("/")}var c,u=e.slice(i);null===r?c=".":a(r)||a(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(r&&a(r)||(r="/"+r),c=r):c=r;var l=this._makeAbs(c);d(this,c)||(u[0]===o.GLOBSTAR?this._processGlobStar(r,c,l,u,t,n):this._processReaddir(r,c,l,u,t,n))},f.prototype._processReaddir=function(e,t,n,r,o,s){var a=this._readdir(n,s);if(a){for(var c=r[0],u=!!this.minimatch.negate,l=c._glob,d=this.dot||"."===l.charAt(0),p=[],h=0;h<a.length;h++)("."!==(g=a[h]).charAt(0)||d)&&(u&&!e?!g.match(c):g.match(c))&&p.push(g);var f=p.length;if(0!==f)if(1!==r.length||this.mark||this.stat)for(r.shift(),h=0;h<f;h++){var m;g=p[h],m=e?[e,g]:[g],this._process(m.concat(r),o,s)}else{this.matches[o]||(this.matches[o]=Object.create(null));for(h=0;h<f;h++){var g=p[h];e&&(g="/"!==e.slice(-1)?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=i.join(this.root,g)),this._emitMatch(o,g)}}}},f.prototype._emitMatch=function(e,t){if(!p(this,t)){var n=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},f.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,n;try{n=this.fs.lstatSync(e)}catch(e){if("ENOENT"===e.code)return null}var r=n&&n.isSymbolicLink();return this.symlinks[e]=r,r||!n||n.isDirectory()?t=this._readdir(e,!1):this.cache[e]="FILE",t},f.prototype._readdir=function(e,t){if(t&&!l(this.symlinks,e))return this._readdirInGlobStar(e);if(l(this.cache,e)){var n=this.cache[e];if(!n||"FILE"===n)return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},f.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var r=t[n];r="/"===e?e+r:e+"/"+r,this.cache[r]=!0}return this.cache[e]=t,t},f.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var r=new Error(t.code+" invalid cwd "+this.cwd);throw r.path=this.cwd,r.code=t.code,r}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t)}},f.prototype._processGlobStar=function(e,t,n,r,o,i){var s=this._readdir(n,i);if(s){var a=r.slice(1),c=e?[e]:[],u=c.concat(a);this._process(u,o,!1);var l=s.length;if(!this.symlinks[n]||!i)for(var d=0;d<l;d++)if("."!==s[d].charAt(0)||this.dot){var p=c.concat(s[d],a);this._process(p,o,!0);var h=c.concat(s[d],r);this._process(h,o,!0)}}},f.prototype._processSimple=function(e,t){var n=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),n){if(e&&a(e)&&!this.nomount){var r=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=i.join(this.root,e):(e=i.resolve(this.root,e),r&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}},f.prototype._stat=function(e){var t=this._makeAbs(e),n="/"===e.slice(-1);if(e.length>this.maxLength)return!1;if(!this.stat&&l(this.cache,t)){var r=this.cache[t];if(Array.isArray(r)&&(r="DIR"),!n||"DIR"===r)return r;if(n&&"FILE"===r)return!1}var o=this.statCache[t];if(!o){var i;try{i=this.fs.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(i&&i.isSymbolicLink())try{o=this.fs.statSync(t)}catch(e){o=i}else o=i}return this.statCache[t]=o,r=!0,o&&(r=o.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||r,(!n||"FILE"!==r)&&r},f.prototype._mark=function(e){return c.mark(this,e)},f.prototype._makeAbs=function(e){return c.makeAbs(this,e)}},7844:(e,t,n)=>{var r=n(2479),o=Object.create(null),i=n(778);e.exports=r((function(e,t){return o[e]?(o[e].push(t),null):(o[e]=[t],function(e){return i((function t(){var n=o[e],r=n.length,i=function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r]=e[r];return n}(arguments);try{for(var s=0;s<r;s++)n[s].apply(null,i)}finally{n.length>r?(n.splice(0,r),process.nextTick((function(){t.apply(null,i)}))):delete o[e]}}))}(e))}))},4378:(e,t,n)=>{try{var r=n(3837);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(5717)}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},778:(e,t,n)=>{var r=n(2479);function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(o),e.exports.strict=r(i),o.proto=o((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},4095:e=>{"use strict";function t(e){return"/"===e.charAt(0)}function n(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),n=t[1]||"",r=Boolean(n&&":"!==n.charAt(1));return Boolean(t[2]||r)}e.exports="win32"===process.platform?n:t,e.exports.posix=t,e.exports.win32=n},3870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFormat=t.TraceValues=t.Trace=t.ProgressType=t.ProgressToken=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.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=void 0;const r=n(839);Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return r.Message}}),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(6184);Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return o.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return o.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return o.Touch}});const i=n(3911);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const s=n(7135);Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});const a=n(3881);Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const c=n(6525);Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return c.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return c.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return c.ReadableStreamMessageReader}});const u=n(6654);Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.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,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),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,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),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 d=n(147);t.RAL=d.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=(0,r.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}));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.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const r=n(147),o=n(7574),i=n(839),s=n(6184),a=n(7135),c=n(3881);var u,l,d,p,h,f,m,g,y,v,b,R,C,D,w;!function(e){e.type=new i.NotificationType("$/cancelRequest")}(u||(u={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(l=t.ProgressToken||(t.ProgressToken={})),function(e){e.type=new i.NotificationType("$/progress")}(d||(d={})),t.ProgressType=class{constructor(){}},function(e){e.is=function(e){return o.func(e)}}(p||(p={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(h=t.Trace||(t.Trace={})),(w=t.TraceValues||(t.TraceValues={})).Off="off",w.Messages="messages",w.Compact="compact",w.Verbose="verbose",function(e){e.fromString=function(t){if(!o.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(h=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return o.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(f=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new i.NotificationType("$/setTrace")}(m=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new i.NotificationType("$/logTrace")}(g=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(y=t.ConnectionErrors||(t.ConnectionErrors={}));class k extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,k.prototype)}}t.ConnectionError=k,function(e){e.is=function(e){const t=e;return t&&o.func(t.cancelUndispatched)}}(v=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)}}(b=t.CancellationReceiverStrategy||(t.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(u.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&o.func(t.sendCancellation)&&o.func(t.cleanup)}}(R=t.CancellationSenderStrategy||(t.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:b.Message,sender:R.Message}),e.is=function(e){const t=e;return t&&b.is(t.receiver)&&R.is(t.sender)}}(C=t.CancellationStrategy||(t.CancellationStrategy={})),(t.ConnectionOptions||(t.ConnectionOptions={})).is=function(e){const t=e;return t&&(C.is(t.cancellationStrategy)||v.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"}(D||(D={})),t.createMessageConnection=function(e,n,v,b){const R=void 0!==v?v:t.NullLogger;let w=0,T=0,S=0;const E="2.0";let P;const _=new Map;let x;const N=new Map,O=new Map;let q,I,A=new s.LinkedMap,L=new Map,M=new Set,j=new Map,F=h.Off,U=f.Text,W=D.New;const $=new a.Emitter,H=new a.Emitter,V=new a.Emitter,K=new a.Emitter,B=new a.Emitter,z=b&&b.cancellationStrategy?b.cancellationStrategy:C.Message;function Q(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 G(e){}function X(){return W===D.Listening}function J(){return W===D.Closed}function Y(){return W===D.Disposed}function Z(){W!==D.New&&W!==D.Listening||(W=D.Closed,H.fire(void 0))}function ee(){q||0===A.size||(q=(0,r.default)().timer.setImmediate((()=>{q=void 0,function(){if(0===A.size)return;const e=A.shift();try{i.Message.isRequest(e)?function(e){if(Y())return;function t(t,r,o){const s={jsonrpc:E,id:e.id};t instanceof i.ResponseError?s.error=t.toJson():s.result=void 0===t?null:t,re(s,r,o),n.write(s).catch((()=>R.error("Sending response failed.")))}function r(t,r,o){const i={jsonrpc:E,id:e.id,error:t.toJson()};re(i,r,o),n.write(i).catch((()=>R.error("Sending response failed.")))}!function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),I.log(`Received request '${e.method} - (${e.id})'.`,t)}else ie("receive-request",e)}(e);const s=_.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||P){const s=e.id??String(Date.now()),l=z.receiver.createCancellationTokenSource(s);null!==e.id&&M.has(e.id)&&l.cancel(),null!==e.id&&j.set(s,l);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 received none.`),e.method,u);d=c(l.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,u);d=c(...e.params,l.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,u);d=c(e.params,l.token)}else P&&(d=P(e.method,e.params,l.token));const p=d;d?p.then?p.then((n=>{j.delete(s),t(n,e.method,u)}),(t=>{j.delete(s),t instanceof i.ResponseError?r(t,e.method,u):t&&o.string(t.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):(j.delete(s),t(d,e.method,u)):(j.delete(s),function(t,r,o){void 0===t&&(t=null);const i={jsonrpc:E,id:e.id,result:t};re(i,r,o),n.write(i).catch((()=>R.error("Sending response failed.")))}(d,e.method,u))}catch(n){j.delete(s),n instanceof i.ResponseError?t(n,e.method,u):n&&o.string(n.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,u):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else r(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):i.Message.isNotification(e)?function(e){if(Y())return;let t,n;if(e.method===u.type.method){const t=e.params.id;return M.delete(t),void oe(e)}{const r=N.get(e.method);r&&(n=r.handler,t=r.type)}if(n||x)try{if(oe(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==i.ParameterStructures.byName&&R.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const r=e.params;e.method===d.type.method&&2===r.length&&l.is(r[0])?n({token:r[0],value:r[1]}):(void 0!==t&&(t.parameterStructures===i.ParameterStructures.byName&&R.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&R.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${r.length} arguments`)),n(...r))}else void 0!==t&&t.parameterStructures===i.ParameterStructures.byPosition&&R.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else x&&x(e.method,e.params)}catch(t){t.message?R.error(`Notification handler '${e.method}' failed with message: ${t.message}`):R.error(`Notification handler '${e.method}' failed unexpectedly.`)}else V.fire(e)}(e):i.Message.isResponse(e)?function(e){if(!Y())if(null===e.id)e.error?R.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):R.error("Received response message without id. No further error information provided.");else{const t=e.id,n=L.get(t);if(function(e,t){if(F!==h.Off&&I)if(U===f.Text){let n;if(F!==h.Verbose&&F!==h.Compact||(e.error&&e.error.data?n=`Error data: ${ne(e.error.data)}\n\n`:e.result?n=`Result: ${ne(e.result)}\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}).`:"";I.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else I.log(`Received response ${e.id} without active response promise.`,n)}else ie("receive-response",e)}(e,n),void 0!==n){L.delete(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?R.error(`Response handler '${n.method}' failed with message: ${e.message}`):R.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void R.error("Received empty message.");R.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=t.id,n=L.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{ee()}}()})))}e.onClose(Z),e.onError((function(e){$.fire([e,void 0,void 0])})),n.onClose(Z),n.onError((function(e){$.fire(e)}));const te=e=>{try{if(i.Message.isNotification(e)&&e.method===u.type.method){const t=e.params.id,r=Q(t),o=A.get(r);if(i.Message.isRequest(o)){const i=b?.connectionStrategy,s=i&&i.cancelUndispatched?i.cancelUndispatched(o,G):void 0;if(s&&(void 0!==s.error||void 0!==s.result))return A.delete(r),j.delete(t),s.id=o.id,re(s,e.method,Date.now()),void n.write(s).catch((()=>R.error("Sending response for canceled message failed.")))}const s=j.get(t);if(void 0!==s)return s.cancel(),void oe(e);M.add(t)}!function(e,t){var n;i.Message.isRequest(t)?e.set(Q(t.id),t):i.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++S).toString():"res-"+n.toString(),t):e.set("not-"+(++T).toString(),t)}(A,e)}finally{ee()}};function ne(e){if(null!=e)switch(F){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function re(e,t,n){if(F!==h.Off&&I)if(U===f.Text){let r;F!==h.Verbose&&F!==h.Compact||(e.error&&e.error.data?r=`Error data: ${ne(e.error.data)}\n\n`:e.result?r=`Result: ${ne(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),I.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else ie("send-response",e)}function oe(e){if(F!==h.Off&&I&&e.method!==g.type.method)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Received notification '${e.method}'.`,t)}else ie("receive-notification",e)}function ie(e,t){if(!I||F===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};I.log(n)}function se(){if(J())throw new k(y.Closed,"Connection is closed.");if(Y())throw new k(y.Disposed,"Connection is disposed.")}function ae(e){return void 0===e?null:e}function ce(e){return null===e?void 0:e}function ue(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function le(e,t){switch(e){case i.ParameterStructures.auto:return ue(t)?ce(t):[ae(t)];case i.ParameterStructures.byName:if(!ue(t))throw new Error("Received parameters by name but param is not an object literal.");return ce(t);case i.ParameterStructures.byPosition:return[ae(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function de(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=le(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(ae(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const pe={sendNotification:(e,...t)=>{let r,s;if(se(),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 u=c-o;switch(u){case 0:s=void 0;break;case 1:s=le(a,t[o]);break;default:if(a===i.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);s=t.slice(o,c).map((e=>ae(e)))}}else{const n=t;r=e.method,s=de(e,n)}const a={jsonrpc:E,method:r,params:s};return function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Sending notification '${e.method}'.`,t)}else ie("send-notification",e)}(a),n.write(a).catch((()=>R.error("Sending notification failed.")))},onNotification:(e,t)=>{let n;return se(),o.func(e)?x=e:t&&(o.string(e)?(n=e,N.set(e,{type:void 0,handler:t})):(n=e.method,N.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==n?N.delete(n):x=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)=>pe.sendNotification(d.type,{token:t,value:n}),onUnhandledProgress:K.event,sendRequest:(e,...t)=>{let r,s,a;if(se(),function(){if(!X())throw new Error("Call listen() first.")}(),o.string(e)){r=e;const n=t[0],o=t[t.length-1];let u=0,l=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(u=1,l=n);let d=t.length;c.CancellationToken.is(o)&&(d-=1,a=o);const p=d-u;switch(p){case 0:s=void 0;break;case 1:s=le(l,t[u]);break;default:if(l===i.ParameterStructures.byName)throw new Error(`Received ${p} parameters for 'by Name' request parameter structure.`);s=t.slice(u,d).map((e=>ae(e)))}}else{const n=t;r=e.method,s=de(e,n);const o=e.numberOfParams;a=c.CancellationToken.is(n[o])?n[o]:void 0}const u=w++;let l;return a&&(l=a.onCancellationRequested((()=>{const e=z.sender.sendCancellation(pe,u);return void 0===e?(R.log(`Received no promise from cancellation strategy when cancelling id ${u}`),Promise.resolve()):e.catch((()=>{R.log(`Sending cancellation messages for id ${u} failed`)}))}))),new Promise(((e,t)=>{const o={jsonrpc:E,id:u,method:r,params:s};let a={method:r,timerStart:Date.now(),resolve:t=>{e(t),z.sender.cleanup(u),l?.dispose()},reject:e=>{t(e),z.sender.cleanup(u),l?.dispose()}};!function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),I.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ie("send-request",e)}(o);try{n.write(o).catch((()=>R.error("Sending request failed.")))}catch(e){a.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),a=null}a&&L.set(u,a)}))},onRequest:(e,t)=>{se();let n=null;return p.is(e)?(n=void 0,P=e):o.string(e)?(n=null,void 0!==t&&(n=e,_.set(e,{handler:t,type:void 0}))):void 0!==t&&(n=e.method,_.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==n&&(void 0!==n?_.delete(n):P=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(e,t,n)=>{let r=!1,i=f.Text;void 0!==n&&(o.boolean(n)?r=n:(r=n.sendNotification||!1,i=n.traceFormat||f.Text)),F=e,U=i,I=F===h.Off?void 0:t,!r||J()||Y()||await pe.sendNotification(m.type,{value:h.toString(e)})},onError:$.event,onClose:H.event,onUnhandledNotification:V.event,onDispose:B.event,end:()=>{n.end()},dispose:()=>{if(Y())return;W=D.Disposed,B.fire(void 0);const t=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const e of L.values())e.reject(t);L=new Map,j=new Map,M=new Set,A=new s.LinkedMap,o.func(n.dispose)&&n.dispose(),o.func(e.dispose)&&e.dispose()},listen:()=>{se(),function(){if(X())throw new k(y.AlreadyListening,"Connection is already listening")}(),W=D.Listening,e.listen(te)},inspect:()=>{(0,r.default)().console.log("inspect")}};return pe.onNotification(g.type,(e=>{if(F===h.Off||!I)return;const t=F===h.Verbose||F===h.Compact;I.log(e.message,t?e.verbose:void 0)})),pe.onNotification(d.type,(e=>{const t=O.get(e.token);t?t(e.value):K.fire(e)})),pe}},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<o;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const t=[],n=this._callbacks.slice(0),o=this._contexts.slice(0);for(let i=0,s=n.length;i<s;i++)try{t.push(n[i].apply(o[i],e))}catch(e){(0,r.default)().console.error(e)}return t}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class i{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{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,r;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}(r=t.Touch||(t.Touch={}));class o{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=r.None){const n=this._map.get(e);if(n)return t!==r.None&&this.touch(n,t),n.value}set(e,t,n=r.None){let o=this._map.get(e);if(o)o.value=t,n!==r.None&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case r.None:this.addItemLast(o);break;case r.First:this.addItemFirst(o);break;case r.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._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(n=Symbol.toStringTag,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===r.First||t===r.Last)if(t===r.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===r.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=o,t.LRUCache=class extends o{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=r.AsNew){return super.get(e,t)}peek(e){return super.get(e,r.None)}set(e,t){return super.set(e,t,r.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(;t<this._chunks.length;){const o=this._chunks[t];for(n=0;n<o.length;){switch(o[n]){case 13:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case 10:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}r+=o.byteLength,t++}if(4!==e)return;const o=this._read(r+n),i=new Map,s=this.toString(o,"ascii").split("\r\n");if(s.length<2)return i;for(let e=0;e<s.length-2;e++){const t=s[e],n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");const r=t.substr(0,n),o=t.substr(n+1).trim();i.set(r,o)}return i}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._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){let t,n;const o=new Map;let i;const s=new Map;if(void 0===e||"string"==typeof e)t=e??"utf-8";else{if(t=e.charset??"utf-8",void 0!==e.contentDecoder&&(n=e.contentDecoder,o.set(n.name,n)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)o.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(i=e.contentTypeDecoder,s.set(i.name,i)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)s.set(t.name,t)}return void 0===i&&(i=(0,r.default)().applicationJson.decoder,s.set(i.name,i)),{charset:t,contentDecoder:n,contentDecoders:o,contentTypeDecoder:i,contentTypeDecoders:s}}}(s||(s={})),t.ReadableStreamMessageReader=class extends a{constructor(e,t){super(),this.readable=e,this.options=s.fromOptions(t),this.buffer=(0,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&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,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){return void 0===e||"string"==typeof e?{charset:e??"utf-8",contentTypeEncoder:(0,r.default)().applicationJson.encoder}:{charset:e.charset??"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,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.Message=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,i;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3}(o=t.ErrorCodes||(t.ErrorCodes={}));class s extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:o.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,s.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}t.ResponseError=s;class a{constructor(e){this.kind=e}static is(e){return e===a.auto||e===a.byName||e===a.byPosition}toString(){return this.kind}}t.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");class c{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return a.auto}}t.AbstractMessageSignature=c,t.RequestType0=class extends c{constructor(e){super(e,0)}},t.RequestType=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType1=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType2=class extends c{constructor(e){super(e,2)}},t.RequestType3=class extends c{constructor(e){super(e,3)}},t.RequestType4=class extends c{constructor(e){super(e,4)}},t.RequestType5=class extends c{constructor(e){super(e,5)}},t.RequestType6=class extends c{constructor(e){super(e,6)}},t.RequestType7=class extends c{constructor(e){super(e,7)}},t.RequestType8=class extends c{constructor(e){super(e,8)}},t.RequestType9=class extends c{constructor(e){super(e,9)}},t.NotificationType=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType0=class extends c{constructor(e){super(e,0)}},t.NotificationType1=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType2=class extends c{constructor(e){super(e,2)}},t.NotificationType3=class extends c{constructor(e){super(e,3)}},t.NotificationType4=class extends c{constructor(e){super(e,4)}},t.NotificationType5=class extends c{constructor(e){super(e,5)}},t.NotificationType6=class extends c{constructor(e){super(e,6)}},t.NotificationType7=class extends c{constructor(e){super(e,7)}},t.NotificationType8=class extends c{constructor(e){super(e,8)}},t.NotificationType9=class extends c{constructor(e){super(e,9)}},(i=t.Message||(t.Message={})).isRequest=function(e){const t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},i.isNotification=function(e){const t=e;return t&&r.string(t.method)&&void 0===e.id},i.isResponse=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&&(0,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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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),u=n(6113),l=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((0,i.default)().stream.asReadableStream(e),t)}}t.SocketMessageReader=h;class f extends s.WriteableStreamMessageWriter{constructor(e,t){super((0,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((0,i.default)().stream.asReadableStream(e),t)}}t.StreamMessageReader=m;class g extends s.WriteableStreamMessageWriter{constructor(e,t){super((0,i.default)().stream.asWritableStream(e),t)}}t.StreamMessageWriter=g;const y=process.env.XDG_RUNTIME_DIR,v=new Map([["linux",107],["darwin",103]]);t.generateRandomPipeName=function(){const e=(0,u.randomBytes)(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=y?a.join(y,`vscode-ipc-${e}.sock`):a.join(c.tmpdir(),`vscode-${e}.sock`);const n=v.get(process.platform);return void 0!==n&&t.length>=n&&(0,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=(0,l.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=(0,l.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=(0,l.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=(0,l.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}),(0,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 u{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 l=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 u(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function d(){return l}!function(e){e.install=function(){r.default.install(l)}}(d||(d={})),t.default=d},5028:(e,t,n)=>{"use strict";e.exports=n(4389)},1661:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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.RequestFailed=-32803,i.ServerCancelled=-32802,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}),(0,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=t.MessageDirection=void 0;const r=n(4389);var o;(o=t.MessageDirection||(t.MessageDirection={})).clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both",t.RegistrationType=class{constructor(e){this.method=e}};class i extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=i;class s extends r.RequestType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolRequestType=s;class a extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=a;class c extends r.NotificationType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolNotificationType=c},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.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",o.messageDirection=r.MessageDirection.clientToServer,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,i;(i=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.ColorPresentationRequest||(t.ColorPresentationRequest={})).method="textDocument/colorPresentation",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},5934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;const r=n(6140);var o;(o=t.ConfigurationRequest||(t.ConfigurationRequest={})).method="workspace/configuration",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)},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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},9824:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;const r=n(4389),o=n(9533),i=n(6140);var s,a,c,u;(t.DiagnosticServerCancellationData||(t.DiagnosticServerCancellationData={})).is=function(e){const t=e;return t&&o.boolean(t.retriggerRequest)},(u=t.DocumentDiagnosticReportKind||(t.DocumentDiagnosticReportKind={})).Full="full",u.Unchanged="unchanged",(c=t.DocumentDiagnosticRequest||(t.DocumentDiagnosticRequest={})).method="textDocument/diagnostic",c.messageDirection=i.MessageDirection.clientToServer,c.type=new i.ProtocolRequestType(c.method),c.partialResult=new r.ProgressType,(a=t.WorkspaceDiagnosticRequest||(t.WorkspaceDiagnosticRequest={})).method="workspace/diagnostic",a.messageDirection=i.MessageDirection.clientToServer,a.type=new i.ProtocolRequestType(a.method),a.partialResult=new r.ProgressType,(s=t.DiagnosticRefreshRequest||(t.DiagnosticRefreshRequest={})).method="workspace/diagnostic/refresh",s.messageDirection=i.MessageDirection.clientToServer,s.type=new i.ProtocolRequestType0(s.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,u,l;(l=t.FileOperationPatternKind||(t.FileOperationPatternKind={})).file="file",l.folder="folder",(u=t.WillCreateFilesRequest||(t.WillCreateFilesRequest={})).method="workspace/willCreateFiles",u.messageDirection=r.MessageDirection.clientToServer,u.type=new r.ProtocolRequestType(u.method),(c=t.DidCreateFilesNotification||(t.DidCreateFilesNotification={})).method="workspace/didCreateFiles",c.messageDirection=r.MessageDirection.clientToServer,c.type=new r.ProtocolNotificationType(c.method),(a=t.WillRenameFilesRequest||(t.WillRenameFilesRequest={})).method="workspace/willRenameFiles",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType(a.method),(s=t.DidRenameFilesNotification||(t.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method),(i=t.DidDeleteFilesNotification||(t.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolNotificationType(i.method),(o=t.WillDeleteFilesRequest||(t.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},3394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRequest=void 0;const r=n(6140);var o;(o=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",o.messageDirection=r.MessageDirection.clientToServer,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},9999:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;const r=n(6140);var o,i,s;(s=t.InlayHintRequest||(t.InlayHintRequest={})).method="textDocument/inlayHint",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.InlayHintResolveRequest||(t.InlayHintResolveRequest={})).method="inlayHint/resolve",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.InlayHintRefreshRequest||(t.InlayHintRefreshRequest={})).method="workspace/inlayHint/refresh",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType0(o.method)},5246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;const r=n(6140);var o,i;(i=t.InlineValueRequest||(t.InlineValueRequest={})).method="textDocument/inlineValue",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.InlineValueRefreshRequest||(t.InlineValueRefreshRequest={})).method="workspace/inlineValue/refresh",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType0(o.method)},542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),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.RelativePattern=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.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=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.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=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=void 0;const r=n(6140),o=n(1674),i=n(9533),s=n(2122);Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});const a=n(1589);Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const c=n(8744);Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return c.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return c.DidChangeWorkspaceFoldersNotification}});const u=n(5934);Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return u.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 d=n(3394);Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return d.FoldingRangeRequest}});const p=n(764);Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return p.DeclarationRequest}});const h=n(5206);Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const f=n(1862);Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const m=n(2918);Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return m.CallHierarchyPrepareRequest}});const g=n(9434);Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return g.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return g.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return g.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return g.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return g.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return g.SemanticTokensRegistrationType}});const y=n(5726);Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});const v=n(6305);Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return v.LinkedEditingRangeRequest}});const b=n(7846);Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return b.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return b.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return b.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return b.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return b.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return b.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return b.WillDeleteFilesRequest}});const R=n(3443);Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return R.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return R.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return R.MonikerRequest}});const C=n(3693);Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return C.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySupertypesRequest}});const D=n(5246);Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return D.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return D.InlineValueRefreshRequest}});const w=n(9999);Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const k=n(9824);Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return k.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return k.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return k.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return k.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return k.DiagnosticRefreshRequest}});const T=n(7169);var S,E,P,_,x,N,O,q,I,A,L,M,j,F,U,W,$,H,V,K,B,z,Q,G,X,J,Y,Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce,De,we,ke,Te,Se,Ee,Pe,_e,xe;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return T.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return T.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return T.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return T.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return T.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return T.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidCloseNotebookDocumentNotification}}),function(e){e.is=function(e){const t=e;return i.string(t.language)||i.string(t.scheme)||i.string(t.pattern)}}(S=t.TextDocumentFilter||(t.TextDocumentFilter={})),function(e){e.is=function(e){const t=e;return i.objectLiteral(t)&&(i.string(t.notebookType)||i.string(t.scheme)||i.string(t.pattern))}}(E=t.NotebookDocumentFilter||(t.NotebookDocumentFilter={})),function(e){e.is=function(e){const t=e;return i.objectLiteral(t)&&(i.string(t.notebook)||E.is(t.notebook))&&(void 0===t.language||i.string(t.language))}}(P=t.NotebookCellTextDocumentFilter||(t.NotebookCellTextDocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!i.string(t)&&!S.is(t)&&!P.is(t))return!1;return!0}}(_=t.DocumentSelector||(t.DocumentSelector={})),(xe=t.RegistrationRequest||(t.RegistrationRequest={})).method="client/registerCapability",xe.messageDirection=r.MessageDirection.serverToClient,xe.type=new r.ProtocolRequestType(xe.method),(_e=t.UnregistrationRequest||(t.UnregistrationRequest={})).method="client/unregisterCapability",_e.messageDirection=r.MessageDirection.serverToClient,_e.type=new r.ProtocolRequestType(_e.method),(Pe=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",Pe.Rename="rename",Pe.Delete="delete",(Ee=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",Ee.Transactional="transactional",Ee.TextOnlyTransactional="textOnlyTransactional",Ee.Undo="undo",(Se=t.PositionEncodingKind||(t.PositionEncodingKind={})).UTF8="utf-8",Se.UTF16="utf-16",Se.UTF32="utf-32",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&i.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||_.is(t.documentSelector))},(Te=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return i.objectLiteral(t)&&(void 0===t.workDoneProgress||i.boolean(t.workDoneProgress))},Te.hasWorkDoneProgress=function(e){const t=e;return t&&i.boolean(t.workDoneProgress)},(ke=t.InitializeRequest||(t.InitializeRequest={})).method="initialize",ke.messageDirection=r.MessageDirection.clientToServer,ke.type=new r.ProtocolRequestType(ke.method),(t.InitializeErrorCodes||(t.InitializeErrorCodes={})).unknownProtocolVersion=1,(we=t.InitializedNotification||(t.InitializedNotification={})).method="initialized",we.messageDirection=r.MessageDirection.clientToServer,we.type=new r.ProtocolNotificationType(we.method),(De=t.ShutdownRequest||(t.ShutdownRequest={})).method="shutdown",De.messageDirection=r.MessageDirection.clientToServer,De.type=new r.ProtocolRequestType0(De.method),(Ce=t.ExitNotification||(t.ExitNotification={})).method="exit",Ce.messageDirection=r.MessageDirection.clientToServer,Ce.type=new r.ProtocolNotificationType0(Ce.method),(Re=t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).method="workspace/didChangeConfiguration",Re.messageDirection=r.MessageDirection.clientToServer,Re.type=new r.ProtocolNotificationType(Re.method),(be=t.MessageType||(t.MessageType={})).Error=1,be.Warning=2,be.Info=3,be.Log=4,(ve=t.ShowMessageNotification||(t.ShowMessageNotification={})).method="window/showMessage",ve.messageDirection=r.MessageDirection.serverToClient,ve.type=new r.ProtocolNotificationType(ve.method),(ye=t.ShowMessageRequest||(t.ShowMessageRequest={})).method="window/showMessageRequest",ye.messageDirection=r.MessageDirection.serverToClient,ye.type=new r.ProtocolRequestType(ye.method),(ge=t.LogMessageNotification||(t.LogMessageNotification={})).method="window/logMessage",ge.messageDirection=r.MessageDirection.serverToClient,ge.type=new r.ProtocolNotificationType(ge.method),(me=t.TelemetryEventNotification||(t.TelemetryEventNotification={})).method="telemetry/event",me.messageDirection=r.MessageDirection.serverToClient,me.type=new r.ProtocolNotificationType(me.method),(fe=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,fe.Full=1,fe.Incremental=2,(he=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",he.messageDirection=r.MessageDirection.clientToServer,he.type=new r.ProtocolNotificationType(he.method),(pe=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)},pe.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(de=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",de.messageDirection=r.MessageDirection.clientToServer,de.type=new r.ProtocolNotificationType(de.method),(le=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",le.messageDirection=r.MessageDirection.clientToServer,le.type=new r.ProtocolNotificationType(le.method),(ue=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",ue.messageDirection=r.MessageDirection.clientToServer,ue.type=new r.ProtocolNotificationType(ue.method),(ce=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,ce.AfterDelay=2,ce.FocusOut=3,(ae=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",ae.messageDirection=r.MessageDirection.clientToServer,ae.type=new r.ProtocolNotificationType(ae.method),(se=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",se.messageDirection=r.MessageDirection.clientToServer,se.type=new r.ProtocolRequestType(se.method),(ie=t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).method="workspace/didChangeWatchedFiles",ie.messageDirection=r.MessageDirection.clientToServer,ie.type=new r.ProtocolNotificationType(ie.method),(oe=t.FileChangeType||(t.FileChangeType={})).Created=1,oe.Changed=2,oe.Deleted=3,(t.RelativePattern||(t.RelativePattern={})).is=function(e){const t=e;return i.objectLiteral(t)&&(o.URI.is(t.baseUri)||o.WorkspaceFolder.is(t.baseUri))&&i.string(t.pattern)},(re=t.WatchKind||(t.WatchKind={})).Create=1,re.Change=2,re.Delete=4,(ne=t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).method="textDocument/publishDiagnostics",ne.messageDirection=r.MessageDirection.serverToClient,ne.type=new r.ProtocolNotificationType(ne.method),(te=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,te.TriggerCharacter=2,te.TriggerForIncompleteCompletions=3,(ee=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",ee.messageDirection=r.MessageDirection.clientToServer,ee.type=new r.ProtocolRequestType(ee.method),(Z=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",Z.messageDirection=r.MessageDirection.clientToServer,Z.type=new r.ProtocolRequestType(Z.method),(Y=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",Y.messageDirection=r.MessageDirection.clientToServer,Y.type=new r.ProtocolRequestType(Y.method),(J=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,J.TriggerCharacter=2,J.ContentChange=3,(X=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",X.messageDirection=r.MessageDirection.clientToServer,X.type=new r.ProtocolRequestType(X.method),(G=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",G.messageDirection=r.MessageDirection.clientToServer,G.type=new r.ProtocolRequestType(G.method),(Q=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",Q.messageDirection=r.MessageDirection.clientToServer,Q.type=new r.ProtocolRequestType(Q.method),(z=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",z.messageDirection=r.MessageDirection.clientToServer,z.type=new r.ProtocolRequestType(z.method),(B=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",B.messageDirection=r.MessageDirection.clientToServer,B.type=new r.ProtocolRequestType(B.method),(K=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",K.messageDirection=r.MessageDirection.clientToServer,K.type=new r.ProtocolRequestType(K.method),(V=t.CodeActionResolveRequest||(t.CodeActionResolveRequest={})).method="codeAction/resolve",V.messageDirection=r.MessageDirection.clientToServer,V.type=new r.ProtocolRequestType(V.method),(H=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",H.messageDirection=r.MessageDirection.clientToServer,H.type=new r.ProtocolRequestType(H.method),($=t.WorkspaceSymbolResolveRequest||(t.WorkspaceSymbolResolveRequest={})).method="workspaceSymbol/resolve",$.messageDirection=r.MessageDirection.clientToServer,$.type=new r.ProtocolRequestType($.method),(W=t.CodeLensRequest||(t.CodeLensRequest={})).method="textDocument/codeLens",W.messageDirection=r.MessageDirection.clientToServer,W.type=new r.ProtocolRequestType(W.method),(U=t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).method="codeLens/resolve",U.messageDirection=r.MessageDirection.clientToServer,U.type=new r.ProtocolRequestType(U.method),(F=t.CodeLensRefreshRequest||(t.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",F.messageDirection=r.MessageDirection.serverToClient,F.type=new r.ProtocolRequestType0(F.method),(j=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",j.messageDirection=r.MessageDirection.clientToServer,j.type=new r.ProtocolRequestType(j.method),(M=t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).method="documentLink/resolve",M.messageDirection=r.MessageDirection.clientToServer,M.type=new r.ProtocolRequestType(M.method),(L=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",L.messageDirection=r.MessageDirection.clientToServer,L.type=new r.ProtocolRequestType(L.method),(A=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",A.messageDirection=r.MessageDirection.clientToServer,A.type=new r.ProtocolRequestType(A.method),(I=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",I.messageDirection=r.MessageDirection.clientToServer,I.type=new r.ProtocolRequestType(I.method),(t.PrepareSupportDefaultBehavior||(t.PrepareSupportDefaultBehavior={})).Identifier=1,(q=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",q.messageDirection=r.MessageDirection.clientToServer,q.type=new r.ProtocolRequestType(q.method),(O=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",O.messageDirection=r.MessageDirection.clientToServer,O.type=new r.ProtocolRequestType(O.method),(N=t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).method="workspace/executeCommand",N.messageDirection=r.MessageDirection.clientToServer,N.type=new r.ProtocolRequestType(N.method),(x=t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).method="workspace/applyEdit",x.messageDirection=r.MessageDirection.serverToClient,x.type=new r.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.messageDirection=r.MessageDirection.clientToServer,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},7169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;const r=n(1674),o=n(9533),i=n(6140);var s,a,c,u,l,d,p,h,f,m;!function(e){e.Markup=1,e.Code=2,e.is=function(e){return 1===e||2===e}}(s=t.NotebookCellKind||(t.NotebookCellKind={})),function(e){e.create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},e.is=function(e){const t=e;return o.objectLiteral(t)&&r.uinteger.is(t.executionOrder)&&(void 0===t.success||o.boolean(t.success))},e.equals=function(e,t){return e===t||null!=e&&null!=t&&e.executionOrder===t.executionOrder&&e.success===t.success}}(a=t.ExecutionSummary||(t.ExecutionSummary={})),function(e){function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(typeof e!=typeof n)return!1;if("object"!=typeof e)return!1;const r=Array.isArray(e),i=Array.isArray(n);if(r!==i)return!1;if(r&&i){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1}if(o.objectLiteral(e)&&o.objectLiteral(n)){const r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;if(r.sort(),o.sort(),!t(r,o))return!1;for(let o=0;o<r.length;o++){const i=r[o];if(!t(e[i],n[i]))return!1}}return!0}e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){const t=e;return o.objectLiteral(t)&&s.is(t.kind)&&r.DocumentUri.is(t.document)&&(void 0===t.metadata||o.objectLiteral(t.metadata))},e.diff=function(e,n){const r=new Set;return e.document!==n.document&&r.add("document"),e.kind!==n.kind&&r.add("kind"),e.executionSummary!==n.executionSummary&&r.add("executionSummary"),void 0===e.metadata&&void 0===n.metadata||t(e.metadata,n.metadata)||r.add("metadata"),void 0===e.executionSummary&&void 0===n.executionSummary||a.equals(e.executionSummary,n.executionSummary)||r.add("executionSummary"),r}}(c=t.NotebookCell||(t.NotebookCell={})),(m=t.NotebookDocument||(t.NotebookDocument={})).create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},m.is=function(e){const t=e;return o.objectLiteral(t)&&o.string(t.uri)&&r.integer.is(t.version)&&o.typedArray(t.cells,c.is)},function(e){e.method="notebookDocument/sync",e.messageDirection=i.MessageDirection.clientToServer,e.type=new i.RegistrationType(e.method)}(u=t.NotebookDocumentSyncRegistrationType||(t.NotebookDocumentSyncRegistrationType={})),(f=t.DidOpenNotebookDocumentNotification||(t.DidOpenNotebookDocumentNotification={})).method="notebookDocument/didOpen",f.messageDirection=i.MessageDirection.clientToServer,f.type=new i.ProtocolNotificationType(f.method),f.registrationMethod=u.method,(h=t.NotebookCellArrayChange||(t.NotebookCellArrayChange={})).is=function(e){const t=e;return o.objectLiteral(t)&&r.uinteger.is(t.start)&&r.uinteger.is(t.deleteCount)&&(void 0===t.cells||o.typedArray(t.cells,c.is))},h.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r},(p=t.DidChangeNotebookDocumentNotification||(t.DidChangeNotebookDocumentNotification={})).method="notebookDocument/didChange",p.messageDirection=i.MessageDirection.clientToServer,p.type=new i.ProtocolNotificationType(p.method),p.registrationMethod=u.method,(d=t.DidSaveNotebookDocumentNotification||(t.DidSaveNotebookDocumentNotification={})).method="notebookDocument/didSave",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method),d.registrationMethod=u.method,(l=t.DidCloseNotebookDocumentNotification||(t.DidCloseNotebookDocumentNotification={})).method="notebookDocument/didClose",l.messageDirection=i.MessageDirection.clientToServer,l.type=new i.ProtocolNotificationType(l.method),l.registrationMethod=u.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,s,a;(a=t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,a.is=function(e){return e===a.type},(s=t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).method="window/workDoneProgress/create",s.messageDirection=o.MessageDirection.serverToClient,s.type=new o.ProtocolRequestType(s.method),(i=t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).method="window/workDoneProgress/cancel",i.messageDirection=o.MessageDirection.clientToServer,i.type=new o.ProtocolNotificationType(i.method)},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.messageDirection=r.MessageDirection.clientToServer,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=void 0;const r=n(6140);var o,i,s,a,c;(t.TokenFormat||(t.TokenFormat={})).Relative="relative",function(e){e.method="textDocument/semanticTokens",e.type=new r.RegistrationType(e.method)}(o=t.SemanticTokensRegistrationType||(t.SemanticTokensRegistrationType={})),(c=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",c.messageDirection=r.MessageDirection.clientToServer,c.type=new r.ProtocolRequestType(c.method),c.registrationMethod=o.method,(a=t.SemanticTokensDeltaRequest||(t.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType(a.method),a.registrationMethod=o.method,(s=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),s.registrationMethod=o.method,(i=t.SemanticTokensRefreshRequest||(t.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType0(i.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.messageDirection=r.MessageDirection.serverToClient,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},3693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;const r=n(6140);var o,i,s;(s=t.TypeHierarchyPrepareRequest||(t.TypeHierarchyPrepareRequest={})).method="textDocument/prepareTypeHierarchy",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.TypeHierarchySupertypesRequest||(t.TypeHierarchySupertypesRequest={})).method="typeHierarchy/supertypes",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.TypeHierarchySubtypesRequest||(t.TypeHierarchySubtypesRequest={})).method="typeHierarchy/subtypes",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},8744:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;const r=n(6140);var o,i;(i=t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).method="workspace/workspaceFolders",i.messageDirection=r.MessageDirection.serverToClient,i.type=new r.ProtocolRequestType0(i.method),(o=t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).method="workspace/didChangeWorkspaceFolders",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)},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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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(1661),t),t.createProtocolConnection=function(e,t,n,r){return(0,i.createMessageConnection)(e,t,n,r)}},6560:(e,t,n)=>{"use strict";e.exports=n(273)},1674:(e,t,n)=>{"use strict";var r,o,i,s,a,c,u,l,d,p,h,f,m,g,y,v,b,R,C,D,w,k,T,S,E,P,_,x;n.r(t),n.d(t,{AnnotatedTextEdit:()=>T,ChangeAnnotation:()=>w,ChangeAnnotationIdentifier:()=>k,CodeAction:()=>ie,CodeActionContext:()=>oe,CodeActionKind:()=>ne,CodeActionTriggerKind:()=>re,CodeDescription:()=>b,CodeLens:()=>se,Color:()=>d,ColorInformation:()=>p,ColorPresentation:()=>h,Command:()=>C,CompletionItem:()=>H,CompletionItemKind:()=>M,CompletionItemLabelDetails:()=>$,CompletionItemTag:()=>F,CompletionList:()=>V,CreateFile:()=>E,DeleteFile:()=>_,Diagnostic:()=>R,DiagnosticRelatedInformation:()=>g,DiagnosticSeverity:()=>y,DiagnosticTag:()=>v,DocumentHighlight:()=>X,DocumentHighlightKind:()=>G,DocumentLink:()=>ce,DocumentSymbol:()=>te,DocumentUri:()=>r,EOL:()=>Te,FoldingRange:()=>m,FoldingRangeKind:()=>f,FormattingOptions:()=>ae,Hover:()=>B,InlayHint:()=>be,InlayHintKind:()=>ye,InlayHintLabelPart:()=>ve,InlineValueContext:()=>ge,InlineValueEvaluatableExpression:()=>me,InlineValueText:()=>he,InlineValueVariableLookup:()=>fe,InsertReplaceEdit:()=>U,InsertTextFormat:()=>j,InsertTextMode:()=>W,Location:()=>u,LocationLink:()=>l,MarkedString:()=>K,MarkupContent:()=>L,MarkupKind:()=>A,OptionalVersionedTextDocumentIdentifier:()=>q,ParameterInformation:()=>z,Position:()=>a,Range:()=>c,RenameFile:()=>P,SelectionRange:()=>ue,SemanticTokenModifiers:()=>de,SemanticTokenTypes:()=>le,SemanticTokens:()=>pe,SignatureInformation:()=>Q,SymbolInformation:()=>Z,SymbolKind:()=>J,SymbolTag:()=>Y,TextDocument:()=>ke,TextDocumentEdit:()=>S,TextDocumentIdentifier:()=>N,TextDocumentItem:()=>I,TextEdit:()=>D,URI:()=>o,VersionedTextDocumentIdentifier:()=>O,WorkspaceChange:()=>we,WorkspaceEdit:()=>x,WorkspaceFolder:()=>Re,WorkspaceSymbol:()=>ee,integer:()=>i,uinteger:()=>s}),function(e){e.is=function(e){return"string"==typeof e}}(r||(r={})),function(e){e.is=function(e){return"string"==typeof e}}(o||(o={})),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(i||(i={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(s||(s={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=s.MAX_VALUE),t===Number.MAX_VALUE&&(t=s.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.uinteger(t.line)&&Se.uinteger(t.character)}}(a||(a={})),function(e){e.create=function(e,t,n,r){if(Se.uinteger(e)&&Se.uinteger(t)&&Se.uinteger(n)&&Se.uinteger(r))return{start:a.create(e,t),end:a.create(n,r)};if(a.is(e)&&a.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Se.objectLiteral(t)&&a.is(t.start)&&a.is(t.end)}}(c||(c={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&c.is(t.range)&&(Se.string(t.uri)||Se.undefined(t.uri))}}(u||(u={})),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 Se.objectLiteral(t)&&c.is(t.targetRange)&&Se.string(t.targetUri)&&c.is(t.targetSelectionRange)&&(c.is(t.originSelectionRange)||Se.undefined(t.originSelectionRange))}}(l||(l={})),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 Se.objectLiteral(t)&&Se.numberRange(t.red,0,1)&&Se.numberRange(t.green,0,1)&&Se.numberRange(t.blue,0,1)&&Se.numberRange(t.alpha,0,1)}}(d||(d={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&c.is(t.range)&&d.is(t.color)}}(p||(p={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.string(t.label)&&(Se.undefined(t.textEdit)||D.is(t))&&(Se.undefined(t.additionalTextEdits)||Se.typedArray(t.additionalTextEdits,D.is))}}(h||(h={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(f||(f={})),function(e){e.create=function(e,t,n,r,o,i){var s={startLine:e,endLine:t};return Se.defined(n)&&(s.startCharacter=n),Se.defined(r)&&(s.endCharacter=r),Se.defined(o)&&(s.kind=o),Se.defined(i)&&(s.collapsedText=i),s},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.uinteger(t.startLine)&&Se.uinteger(t.startLine)&&(Se.undefined(t.startCharacter)||Se.uinteger(t.startCharacter))&&(Se.undefined(t.endCharacter)||Se.uinteger(t.endCharacter))&&(Se.undefined(t.kind)||Se.string(t.kind))}}(m||(m={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Se.defined(t)&&u.is(t.location)&&Se.string(t.message)}}(g||(g={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(y||(y={})),function(e){e.Unnecessary=1,e.Deprecated=2}(v||(v={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.string(t.href)}}(b||(b={})),function(e){e.create=function(e,t,n,r,o,i){var s={range:e,message:t};return Se.defined(n)&&(s.severity=n),Se.defined(r)&&(s.code=r),Se.defined(o)&&(s.source=o),Se.defined(i)&&(s.relatedInformation=i),s},e.is=function(e){var t,n=e;return Se.defined(n)&&c.is(n.range)&&Se.string(n.message)&&(Se.number(n.severity)||Se.undefined(n.severity))&&(Se.integer(n.code)||Se.string(n.code)||Se.undefined(n.code))&&(Se.undefined(n.codeDescription)||Se.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Se.string(n.source)||Se.undefined(n.source))&&(Se.undefined(n.relatedInformation)||Se.typedArray(n.relatedInformation,g.is))}}(R||(R={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={title:e,command:t};return Se.defined(n)&&n.length>0&&(o.arguments=n),o},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.title)&&Se.string(t.command)}}(C||(C={})),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 Se.objectLiteral(t)&&Se.string(t.newText)&&c.is(t.range)}}(D||(D={})),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 Se.objectLiteral(t)&&Se.string(t.label)&&(Se.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Se.string(t.description)||void 0===t.description)}}(w||(w={})),function(e){e.is=function(e){var t=e;return Se.string(t)}}(k||(k={})),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 D.is(t)&&(w.is(t.annotationId)||k.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 Se.defined(t)&&q.is(t.textDocument)&&Array.isArray(t.edits)}}(S||(S={})),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&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(E||(E={})),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&&Se.string(t.oldUri)&&Se.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(P||(P={})),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&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Se.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Se.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(_||(_={})),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 Se.string(e.kind)?E.is(e)||P.is(e)||_.is(e):S.is(e)})))}}(x||(x={}));var N,O,q,I,A,L,M,j,F,U,W,$,H,V,K,B,z,Q,G,X,J,Y,Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce=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=D.insert(e,t):k.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=D.replace(e,t):k.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=D.del(e):k.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}(),De=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(k.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),we=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new De(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(S.is(e)){var n=new Ce(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ce(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(q.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 Ce(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 Ce(o),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new De,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)||k.is(t)?r=t:n=t,void 0===r?o=E.create(e,n):(i=k.is(r)?r:this._changeAnnotations.manage(r),o=E.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)||k.is(n)?o=n:r=n,void 0===o?i=P.create(e,t,r):(s=k.is(o)?o:this._changeAnnotations.manage(o),i=P.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)||k.is(t)?r=t:n=t,void 0===r?o=_.create(e,n):(i=k.is(r)?r:this._changeAnnotations.manage(r),o=_.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 Se.defined(t)&&Se.string(t.uri)}}(N||(N={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&Se.integer(t.version)}}(O||(O={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&(null===t.version||Se.integer(t.version))}}(q||(q={})),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 Se.defined(t)&&Se.string(t.uri)&&Se.string(t.languageId)&&Se.integer(t.version)&&Se.string(t.text)}}(I||(I={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(A||(A={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(e)&&A.is(t.kind)&&Se.string(t.value)}}(L||(L={})),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}(j||(j={})),function(e){e.Deprecated=1}(F||(F={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Se.string(t.newText)&&c.is(t.insert)&&c.is(t.replace)}}(U||(U={})),function(e){e.asIs=1,e.adjustIndentation=2}(W||(W={})),function(e){e.is=function(e){var t=e;return t&&(Se.string(t.detail)||void 0===t.detail)&&(Se.string(t.description)||void 0===t.description)}}($||($={})),function(e){e.create=function(e){return{label:e}}}(H||(H={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(V||(V={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Se.string(t)||Se.objectLiteral(t)&&Se.string(t.language)&&Se.string(t.value)}}(K||(K={})),function(e){e.is=function(e){var t=e;return!!t&&Se.objectLiteral(t)&&(L.is(t.contents)||K.is(t.contents)||Se.typedArray(t.contents,K.is))&&(void 0===e.range||c.is(e.range))}}(B||(B={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(z||(z={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={label:e};return Se.defined(t)&&(o.documentation=t),Se.defined(n)?o.parameters=n:o.parameters=[],o}}(Q||(Q={})),function(e){e.Text=1,e.Read=2,e.Write=3}(G||(G={})),function(e){e.create=function(e,t){var n={range:e};return Se.number(t)&&(n.kind=t),n}}(X||(X={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(J||(J={})),function(e){e.Deprecated=1}(Y||(Y={})),function(e){e.create=function(e,t,n,r,o){var i={name:e,kind:t,location:{uri:r,range:n}};return o&&(i.containerName=o),i}}(Z||(Z={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(ee||(ee={})),function(e){e.create=function(e,t,n,r,o,i){var s={name:e,detail:t,kind:n,range:r,selectionRange:o};return void 0!==i&&(s.children=i),s},e.is=function(e){var t=e;return t&&Se.string(t.name)&&Se.number(t.kind)&&c.is(t.range)&&c.is(t.selectionRange)&&(void 0===t.detail||Se.string(t.detail))&&(void 0===t.deprecated||Se.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(te||(te={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(ne||(ne={})),function(e){e.Invoked=1,e.Automatic=2}(re||(re={})),function(e){e.create=function(e,t,n){var r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){var t=e;return Se.defined(t)&&Se.typedArray(t.diagnostics,R.is)&&(void 0===t.only||Se.typedArray(t.only,Se.string))&&(void 0===t.triggerKind||t.triggerKind===re.Invoked||t.triggerKind===re.Automatic)}}(oe||(oe={})),function(e){e.create=function(e,t,n){var r={title:e},o=!0;return"string"==typeof t?(o=!1,r.kind=t):C.is(t)?r.command=t:r.edit=t,o&&void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&Se.string(t.title)&&(void 0===t.diagnostics||Se.typedArray(t.diagnostics,R.is))&&(void 0===t.kind||Se.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||C.is(t.command))&&(void 0===t.isPreferred||Se.boolean(t.isPreferred))&&(void 0===t.edit||x.is(t.edit))}}(ie||(ie={})),function(e){e.create=function(e,t){var n={range:e};return Se.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return Se.defined(t)&&c.is(t.range)&&(Se.undefined(t.command)||C.is(t.command))}}(se||(se={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.uinteger(t.tabSize)&&Se.boolean(t.insertSpaces)}}(ae||(ae={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return Se.defined(t)&&c.is(t.range)&&(Se.undefined(t.target)||Se.string(t.target))}}(ce||(ce={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return Se.objectLiteral(n)&&c.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(ue||(ue={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(le||(le={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(de||(de={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(pe||(pe={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&Se.string(t.text)}}(he||(he={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&Se.boolean(t.caseSensitiveLookup)&&(Se.string(t.variableName)||void 0===t.variableName)}}(fe||(fe={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&(Se.string(t.expression)||void 0===t.expression)}}(me||(me={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return Se.defined(t)&&c.is(e.stoppedLocation)}}(ge||(ge={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(ye||(ye={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&(void 0===t.tooltip||Se.string(t.tooltip)||L.is(t.tooltip))&&(void 0===t.location||u.is(t.location))&&(void 0===t.command||C.is(t.command))}}(ve||(ve={})),function(e){e.create=function(e,t,n){var r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return Se.objectLiteral(t)&&a.is(t.position)&&(Se.string(t.label)||Se.typedArray(t.label,ve.is))&&(void 0===t.kind||ye.is(t.kind))&&void 0===t.textEdits||Se.typedArray(t.textEdits,D.is)&&(void 0===t.tooltip||Se.string(t.tooltip)||L.is(t.tooltip))&&(void 0===t.paddingLeft||Se.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Se.boolean(t.paddingRight))}}(be||(be={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&o.is(t.uri)&&Se.string(t.name)}}(Re||(Re={}));var ke,Te=["\n","\r\n","\r"];!function(e){function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,o=e.slice(0,r),i=e.slice(r);t(o,n),t(i,n);for(var s=0,a=0,c=0;s<o.length&&a<i.length;){var u=n(o[s],i[a]);e[c++]=u<=0?o[s++]:i[a++]}for(;s<o.length;)e[c++]=o[s++];for(;a<i.length;)e[c++]=i[a++];return e}e.create=function(e,t,n,r){return new Ee(e,t,n,r)},e.is=function(e){var t=e;return!!(Se.defined(t)&&Se.string(t.uri)&&(Se.undefined(t.languageId)||Se.string(t.languageId))&&Se.uinteger(t.lineCount)&&Se.func(t.getText)&&Se.func(t.positionAt)&&Se.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),o=t(n,(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})),i=r.length,s=o.length-1;s>=0;s--){var a=o[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=i))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),i=c}return r}}(ke||(ke={}));var Se,Ee=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;r<t.length;r++){n&&(e.push(r),n=!1);var o=t.charAt(r);n="\r"===o||"\n"===o,"\r"===o&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&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 a.create(0,e);for(;n<r;){var o=Math.floor((n+r)/2);t[o]>e?r=o:n=o+1}var i=n-1;return a.create(i,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+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(Se||(Se={}))},6265:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const i=n(9817);Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return i.SemanticTokensBuilder}}),o(n(273),t);const s=n(8382);Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const a=n(9748);Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return a.NotebookDocuments}}),o(n(9891),t),(t.ProposedFeatures||(t.ProposedFeatures={})).all={__brand:"features"}},7985:(e,t,n)=>{"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;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=r.CallHierarchyOutgoingCallsRequest.type;return 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(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}}},6634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticFeature=void 0;const r=n(273);t.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(r.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(r.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(r.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(r.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(r.WorkspaceDiagnosticRequest.partialResult,t))))}}}},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){return this.connection.onNotification(r.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(r.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return 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)))}}},6507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintFeature=void 0;const r=n(273);t.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(r.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(r.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(r.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}}},8970:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueFeature=void 0;const r=n(273);t.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(r.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(r.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}}},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){return 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;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},9748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotebookDocuments=t.NotebookSyncFeature=void 0;const r=n(273),o=n(8382);t.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(r.DidOpenNotebookDocumentNotification.type,(t=>{e(t)})),onDidChangeNotebookDocument:e=>this.connection.onNotification(r.DidChangeNotebookDocumentNotification.type,(t=>{e(t)})),onDidSaveNotebookDocument:e=>this.connection.onNotification(r.DidSaveNotebookDocumentNotification.type,(t=>{e(t)})),onDidCloseNotebookDocument:e=>this.connection.onNotification(r.DidCloseNotebookDocumentNotification.type,(t=>{e(t)}))}}};class i{onDidOpenTextDocument(e){return this.openHandler=e,r.Disposable.create((()=>{this.openHandler=void 0}))}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,r.Disposable.create((()=>{this.changeHandler=e}))}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,r.Disposable.create((()=>{this.closeHandler=void 0}))}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return i.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return i.NULL_DISPOSE}onDidSaveTextDocument(){return i.NULL_DISPOSE}}i.NULL_DISPOSE=Object.freeze({dispose:()=>{}}),t.NotebookDocuments=class{constructor(e){e instanceof o.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new o.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new r.Emitter,this._onDidChange=new r.Emitter,this._onDidSave=new r.Emitter,this._onDidClose=new r.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){const t="string"==typeof e?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const t=new i,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument((e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(const n of e.cellTextDocuments)t.openTextDocument({textDocument:n});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)}))),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0===n)return;n.version=e.notebookDocument.version;const r=n.metadata;let o=!1;const i=e.change;void 0!==i.metadata&&(o=!0,n.metadata=i.metadata);const s=[],a=[],c=[],u=[];if(void 0!==i.cells){const e=i.cells;if(void 0!==e.structure){const r=e.structure.array;if(n.cells.splice(r.start,r.deleteCount,...void 0!==r.cells?r.cells:[]),void 0!==e.structure.didOpen)for(const n of e.structure.didOpen)t.openTextDocument({textDocument:n}),s.push(n.uri);if(e.structure.didClose)for(const n of e.structure.didClose)t.closeTextDocument({textDocument:n}),a.push(n.uri)}if(void 0!==e.data){const t=new Map(e.data.map((e=>[e.document,e])));for(let e=0;e<=n.cells.length;e++){const r=t.get(n.cells[e].document);if(void 0!==r){const o=n.cells.splice(e,1,r);if(c.push({old:o[0],new:r}),t.delete(r.document),0===t.size)break}}}if(void 0!==e.textContent)for(const n of e.textContent)t.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),u.push(n.document.uri)}this.updateCellMap(n);const l={notebookDocument:n};o&&(l.metadata={old:r,new:n.metadata});const d=[];for(const e of s)d.push(this.getNotebookCell(e));const p=[];for(const e of a)p.push(this.getNotebookCell(e));const h=[];for(const e of u)h.push(this.getNotebookCell(e));(d.length>0||p.length>0||c.length>0||h.length>0)&&(l.cells={added:d,removed:p,changed:{data:c,textContent:h}}),void 0===l.metadata&&void 0===l.cells||this._onDidChange.fire(l)}))),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument((e=>{const t=this.notebookDocuments.get(e.notebookDocument.uri);void 0!==t&&this._onDidSave.fire(t)}))),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0!==n){this._onDidClose.fire(n);for(const n of e.cellTextDocuments)t.closeTextDocument({textDocument:n});this.notebookDocuments.delete(e.notebookDocument.uri);for(const e of n.cells)this.notebookCellMap.delete(e.document)}}))),r.Disposable.create((()=>{n.forEach((e=>e.dispose()))}))}updateCellMap(e){for(const t of e.cells)this.notebookCellMap.set(t.document,[t,e])}}},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 u;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){super.initialize(e),!0===e?.window?.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=(0,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}(u||(u={}));class l{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(u.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 l(e,n)}},9817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensDiff=t.SemanticTokensFeature=void 0;const r=n(273);t.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(r.SemanticTokensRefreshRequest.type),on:e=>{const t=r.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=r.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=r.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class o{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){const e=this.originalSequence.length,t=this.modifiedSequence.length;let n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,o=t-1;for(;r>=n&&o>=n&&this.originalSequence[r]===this.modifiedSequence[o];)r--,o--;(r<n||o<n)&&(r++,o++);const i=r-n+1,s=this.modifiedSequence.slice(n,o+1);return 1===s.length&&s[0]===this.originalSequence[r]?[{start:n,deleteCount:i-1}]:[{start:n,deleteCount:i,data:s}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}}t.SemanticTokensDiff=o,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(){return void 0!==this._prevData?{resultId:this.id,edits:new o(this._prevData,this._data).computeDiff()}:this.build()}}},9891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineNotebooksFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._NotebooksImpl=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=void 0;const r=n(273),o=n(289),i=n(7560),s=n(2731),a=n(2507),c=n(1836),u=n(7985),l=n(9817),d=n(5421),p=n(828),h=n(2776),f=n(4606),m=n(8970),g=n(6507),y=n(6634),v=n(9748),b=n(8120);function R(e){if(null!==e)return e}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 C{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}).catch((()=>{(0,r.RAL)().console.error("Sending log message failed")}))}}const D=(0,d.ShowDocumentFeature)((0,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(R)}showWarningMessage(e,...t){let n={type:r.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(R)}showInformationMessage(e,...t){let n={type:r.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(R)}}));(t.BulkRegistration||(t.BulkRegistration={})).create=function(){return new w};class w{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 k(void 0,[])};class k{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).catch((()=>{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 T{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 w?this.registerMany(e):e instanceof k?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).catch((()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)}))}))),(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).catch((()=>{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 k(this._connection,t.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const S=(0,p.FileOperationsFeature)((0,c.WorkspaceFoldersFeature)((0,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 E{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}).catch((()=>{}))}}class P{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).catch((()=>{this.connection.console.log("Sending TelemetryEventNotification failed")}))}}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){}attachWorkDoneProgress(e){return(0,s.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,s.attachPartialResult)(this.connection,t)}}t._LanguagesImpl=_;const x=(0,b.MonikerFeature)((0,y.DiagnosticFeature)((0,g.InlayHintFeature)((0,m.InlineValueFeature)((0,f.TypeHierarchyFeature)((0,h.LinkedEditingRangeFeature)((0,l.SemanticTokensFeature)((0,u.CallHierarchyFeature)(_))))))));class N{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(0,s.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,s.attachPartialResult)(this.connection,t)}}t._NotebooksImpl=N;const O=(0,v.NotebookSyncFeature)(N);function q(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function A(e,t){return function(n){return t(e(n))}}function L(e,t){return function(n){return t(e(n))}}function M(e,t){return function(n){return t(e(n))}}function j(e,t){return function(n){return t(e(n))}}function F(e,t){return function(n){return t(e(n))}}function U(e,t){return function(n){return t(e(n))}}t.combineConsoleFeatures=q,t.combineTelemetryFeatures=I,t.combineTracerFeatures=A,t.combineClientFeatures=L,t.combineWindowFeatures=M,t.combineWorkspaceFeatures=j,t.combineLanguagesFeatures=F,t.combineNotebooksFeatures=U,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,q),tracer:n(e.tracer,t.tracer,A),telemetry:n(e.telemetry,t.telemetry,I),client:n(e.client,t.client,L),window:n(e.window,t.window,M),workspace:n(e.workspace,t.workspace,j),languages:n(e.languages,t.languages,F),notebooks:n(e.notebooks,t.notebooks,U)}},t.createConnection=function(e,t,n){const i=n&&n.console?new(n.console(C)):new C,a=e(i);i.rawAttach(a);const c=n&&n.tracer?new(n.tracer(E)):new E,u=n&&n.telemetry?new(n.telemetry(P)):new P,l=n&&n.client?new(n.client(T)):new T,d=n&&n.window?new(n.window(D)):new D,p=n&&n.workspace?new(n.workspace(S)):new S,h=n&&n.languages?new(n.languages(x)):new x,f=n&&n.notebooks?new(n.notebooks(O)):new O,m=[i,c,u,l,d,p,h,f];let g,y,v,b={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;return 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=>(y=e,{dispose:()=>{y=void 0}}),onInitialized:e=>a.onNotification(r.InitializedNotification.type,e),onShutdown:e=>(g=e,{dispose:()=>{g=void 0}}),onExit:e=>(v=e,{dispose:()=>{v=void 0}}),get console(){return i},get telemetry(){return u},get tracer(){return c},get client(){return l},get window(){return d},get workspace(){return p},get languages(){return h},get notebooks(){return f},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,(0,s.attachWorkDone)(a,t),void 0))),onCompletion:e=>a.onRequest(r.CompletionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onCompletionResolve:e=>a.onRequest(r.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(r.SignatureHelpRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),void 0))),onDeclaration:e=>a.onRequest(r.DeclarationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDefinition:e=>a.onRequest(r.DefinitionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onTypeDefinition:e=>a.onRequest(r.TypeDefinitionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onImplementation:e=>a.onRequest(r.ImplementationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onReferences:e=>a.onRequest(r.ReferencesRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDocumentHighlight:e=>a.onRequest(r.DocumentHighlightRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDocumentSymbol:e=>a.onRequest(r.DocumentSymbolRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onWorkspaceSymbol:e=>a.onRequest(r.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onWorkspaceSymbolResolve:e=>a.onRequest(r.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>a.onRequest(r.CodeActionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(r.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,(0,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,(0,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,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onColorPresentation:e=>a.onRequest(r.ColorPresentationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onFoldingRanges:e=>a.onRequest(r.FoldingRangeRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onSelectionRanges:e=>a.onRequest(r.SelectionRangeRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onExecuteCommand:e=>a.onRequest(r.ExecuteCommandRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),void 0))),dispose:()=>a.dispose()};for(let e of m)e.attach(b);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 m)t.initialize(e.capabilities);if(y){let t=y(e,(new r.CancellationTokenSource).token,(0,s.attachWorkDone)(a,e),void 0);return(n=t,n instanceof Promise?n:o.thenable(n)?new Promise(((e,t)=>{n.then((t=>e(t)),(e=>t(e)))})):Promise.resolve(n)).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(b.__textDocumentSync)?b.__textDocumentSync:r.TextDocumentSyncKind.None:o.number(n.textDocumentSync)||o.number(n.textDocumentSync.change)||(n.textDocumentSync.change=o.number(b.__textDocumentSync)?b.__textDocumentSync:r.TextDocumentSyncKind.None);for(let e of m)e.fillServerCapabilities(n);return t}))}{let e={capabilities:{textDocumentSync:r.TextDocumentSyncKind.None}};for(let t of m)t.fillServerCapabilities(e.capabilities);return e}var n})),a.onRequest(r.ShutdownRequest.type,(()=>(t.shutdownReceived=!0,g?g((new r.CancellationTokenSource).token):void 0))),a.onNotification(r.ExitNotification.type,(()=>{try{v&&v()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}})),a.onNotification(r.SetTraceNotification.type,(e=>{c.trace=r.Trace.fromString(e.value)})),b}},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)}}},8382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocuments=void 0;const r=n(273);t.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,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 onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.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._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=r.TextDocumentSyncKind.Incremental;const t=[];return t.push(e.onDidOpenTextDocument((e=>{const t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);const r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)}))),t.push(e.onDidChangeTextDocument((e=>{const t=e.textDocument,n=e.contentChanges;if(0===n.length)return;const{version:r}=t;if(null==r)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);let o=this._syncedDocuments.get(t.uri);void 0!==o&&(o=this._configuration.update(o,n,r),this._syncedDocuments.set(t.uri,o),this._onDidChangeContent.fire(Object.freeze({document:o})))}))),t.push(e.onDidCloseTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))}))),t.push(e.onWillSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))}))),t.push(e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return void 0!==n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]}))),t.push(e.onDidSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onDidSave.fire(Object.freeze({document:t}))}))),r.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}}},4606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyFeature=void 0;const r=n(273);t.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(r.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=r.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=r.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},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()}},1836:(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{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.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)})))}fillServerCapabilities(e){super.fillServerCapabilities(e);const t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=!0===t||"string"==typeof t}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._notificationIsAutoRegistered||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="NODE_PATH",c=["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(((u,l)=>{let d=process.env,p=Object.create(null);Object.keys(d).forEach((e=>p[e]=d[e])),t&&i.existsSync(t)&&(p[a]?p[a]=t+o.delimiter+p[a]:p[a]=t,r&&r(`NODE_PATH value is: ${p[a]}`)),p.ELECTRON_RUN_AS_NODE="1";try{let t=(0,s.fork)("",[],{cwd:n,env:p,execArgv:["-e",c]});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?u(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let r={c:"rs",a:e};t.send(r)}catch(e){l(e)}}))}function u(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=(0,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 l;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;i<s;i++)n[i]=decodeURIComponent(n[i]);if("win32"===process.platform&&n.length>1){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=u,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=(0,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())}}(l=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=>l.isParent(n,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>c(t,u(r),e,r)))):c(t,u(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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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);function u(){0}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 d,p=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(d=setInterval((()=>{try{process.kill(t,0)}catch(e){u(),process.exit(p?0:1)}}),3e3))}catch(e){}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length)return void t(process.argv[n+1]);{let n=r.split("=");n[0]===e&&t(n[1])}}}();const h={initialize:e=>{const t=e.processId;i.number(t)&&void 0===d&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(p?0:1)}}),3e3)},get shutdownReceived(){return p},set shutdownReceived(e){p=e},exit:e=>{u(),process.exit(e)}};t.createConnection=function(e,t,n,r){let o,a,l,d;return void 0!==e&&"features"===e.__brand&&(o=e,e=t,t=n,n=r),c.ConnectionStrategy.is(e)||c.ConnectionOptions.is(e)?d=e:(a=e,l=t,d=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<i.length;s++){let a=i[s];if("--node-ipc"===a){e=new c.IPCMessageReader(process),t=new c.IPCMessageWriter(process);break}if("--stdio"===a){e=process.stdin,t=process.stdout;break}if("--socket"===a){n=parseInt(i[s+1]);break}if("--pipe"===a){r=i[s+1];break}var o=a.split("=");if("--socket"===o[0]){n=parseInt(o[1]);break}if("--pipe"===o[0]){r=o[1];break}}if(n){let r=(0,c.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,c.createServerPipeTransport)(r);e=n[0],t=n[1]}}var a="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+a);if(!t)throw new Error("Connection output stream is not set. "+a);if(i.func(e.read)&&i.func(e.on)){let t=e;t.on("end",(()=>{u(),process.exit(p?0:1)})),t.on("close",(()=>{u(),process.exit(p?0:1)}))}return(0,s.createConnection)((r=>(0,c.createProtocolConnection)(e,t,r,n)),h,r)}(a,l,d,o)}},8212:(e,t,n)=>{"use strict";e.exports=n(5809)},2479:e=>{e.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),o=e[e.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach((function(e){r[e]=o[e]})),r}}},9491:e=>{"use strict";e.exports=require("assert")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")}},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.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";n.r(r);var e,t=n(8212),o=n(5809);class i{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(i.isIncremental(t)){const e=c(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 s=this._lineOffsets;const u=a(t.text,!1,n);if(i-o===u.length)for(let e=0,t=u.length;e<t;e++)s[e+o+1]=u[e];else u.length<1e4?s.splice(o+1,i-o,...u):this._lineOffsets=s=s.slice(0,o+1).concat(u,s.slice(i+1));const l=t.text.length-(r-n);if(0!==l)for(let e=o+1+u.length,t=s.length;e<t;e++)s[e]=s[e]+l}else{if(!i.isFull(t))throw new Error("Unknown change event received");this._content=t.text,this._lineOffsets=void 0}this._version=t}getLineOffsets(){return void 0===this._lineOffsets&&(this._lineOffsets=a(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};for(;n<r;){let o=Math.floor((n+r)/2);t[o]>e?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+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}function s(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);s(r,t),s(o,t);let i=0,a=0,c=0;for(;i<r.length&&a<o.length;){let n=t(r[i],o[a]);e[c++]=n<=0?r[i++]:o[a++]}for(;i<r.length;)e[c++]=r[i++];for(;a<o.length;)e[c++]=o[a++];return e}function a(e,t,n=0){const r=t?[n]:[];for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);13!==o&&10!==o||(13===o&&t+1<e.length&&10===e.charCodeAt(t+1)&&t++,r.push(n+t+1))}return r}function c(e){const t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function u(e){const 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){let n=e.getText(),r=s(t.map(u),((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 i=[];for(const t of r){let r=e.offsetAt(t.range.start);if(r<o)throw new Error("Overlapping edit");r>o&&i.push(n.substring(o,r)),t.newText.length&&i.push(t.newText),o=e.offsetAt(t.range.end)}return i.push(n.substr(o)),i.join("")}}(e||(e={}));var l=Object.defineProperty,d=Object.defineProperties,p=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y=(e,t)=>{for(var n in t||(t={}))f.call(t,n)&&g(e,n,t[n]);if(h)for(var n of h(t))m.call(t,n)&&g(e,n,t[n]);return e};const v=[{name:"FORMAT_STATEMEMT",match:[{type:"asterisk"},{type:"asterisk"},{type:"word"}],becomes:{type:"format"}},{name:"DIRECTIVE",match:[{type:"divide"},{type:"word",match:e=>["TITLE","EJECT","SPACE","COPY","INCLUDE","SET","RESTORE","OVERLOAD","DEFINE","UNDEFINED","IF","ELSE","ELSEIF","ENDIF","EOF","CHARCOUNT"].includes(e.toUpperCase())}],becomes:{type:"directive"}},{name:"IS_NUMBER",match:[{type:"number"},{type:"dot"},{type:"number"}],becomes:{type:"number"}},{name:"IS_SPECIAL",match:[{type:"asterisk"},{type:"word",match:e=>["CTDATA","BLANK","BLANKS","ZERO","ZEROS","ON","OFF","NULL","ISO","MDY","DMY","EUR","YMD","USA","SECONDS","S","MINUTES","MN","HOURS","H","DAYS","D","MONTHS","M","YEARS","Y","HIVAL","END","LOVAL","START","N","OMIT","STRING","CWIDEN","CONVERT"].includes(e.toUpperCase())||e.toUpperCase().startsWith("IN")}],becomes:{type:"special"}},{name:"HEX",match:[{type:"word",match:e=>"x"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"TIME",match:[{type:"word",match:e=>"t"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"DATE",match:[{type:"word",match:e=>"d"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"DECLARE",match:[{type:"word",match:e=>"DCL"===e.toUpperCase()},{type:"minus"},{type:"word"}],becomes:{type:"declare"}},{name:"END",match:[{type:"word",match:e=>"END"===e.toUpperCase()},{type:"minus"},{type:"word"}],becomes:{type:"end"}},{name:"DECLARE_SUB",match:[{type:"word",match:e=>"BEGSR"===e.toUpperCase()}],becomes:{type:"declare"}},{name:"END_SUB",match:[{type:"word",match:e=>"ENDSR"===e.toUpperCase()}],becomes:{type:"end"}},{name:"FOR-EACH",match:[{type:"word",match:e=>"FOR"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"EACH"===e.toUpperCase()}],becomes:{type:"word"}},{name:"EVAL-CORR",match:[{type:"word",match:e=>"EVAL"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"CORR"===e.toUpperCase()}],becomes:{type:"word"}},{name:"ON-EXIT",match:[{type:"word",match:e=>"ON"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"EXIT"===e.toUpperCase()}],becomes:{type:"word"}},{name:"CTL-OPT",match:[{type:"word",match:e=>"CTL"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"OPT"===e.toUpperCase()}],becomes:{type:"declare"}},{name:"BIF",match:[{type:"percent"},{type:"word"}],becomes:{type:"builtin"}},{name:"ON-ERROR",match:[{type:"word",match:e=>"ON"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"ERROR"===e.toUpperCase()}],becomes:{type:"word"}},{name:"NEWLINE",match:[{type:"newliner"},{type:"newline"}],becomes:{type:"newline"}}],b=["%",".","(",")","+","-","*","/","=",":",",",";","\n","\r"," "],R={"%":"percent",".":"dot","(":"openbracket",")":"closebracket","+":"plus","-":"minus","/":"divide","*":"asterisk","=":"equal",":":"seperator",";":"semicolon",",":"comma","\n":"newline","\r":"newliner"};function C(e){let t=0,n=-1,r="Normal",o=[],i=0,s="";for(let a=0;a<e.length;a++)"Normal"===r&&e[a]&&e[a+1]&&"//"===e.substring(a,a+2)?(n=a,s="//",r="Comment",a++):"Comment"===r&&"\n"===e[a]?(r="Normal",o.push({value:s,type:"comment",range:{start:n,end:a-1,line:t}},{value:e[a],type:"newline",range:{start:a,end:a+e[a].length,line:t}}),s="",i=a+1):"Comment"===r||"String"===r&&"'"!==e[a]?s+=e[a]:"'"===e[a]?("String"===r?(s+=e[a],o.push({value:s,type:"string",range:{start:i,end:i+s.length,line:t}}),s=""):(i=a,s+=e[a]),r="String"===r?"Normal":"String"):b.includes(e[a])&&"Normal"===r?(""!==s.trim()&&(o.push({value:s,type:"word",range:{start:i,end:i+s.length,line:t}}),s="")," "!==e[a]&&o.push({value:e[a],type:R[e[a]],range:{start:a,end:a+e[a].length,line:t}}),i=a+1):s+=e[a],"\n"===e[a]&&t++;return""!==s.trim()&&"Comment"!==r?(o.push({value:s,type:"Normal"===r?"word":"string",range:{start:i,end:i+s.length,line:t}}),s=""):o.push({value:s,type:"comment",range:{start:i,end:i+s.length,line:t}}),o=function(e){for(let r=0;r<e.length;r++)for(let o=0;o<v.length;o++){const i=v[o];let s=!0;for(let t=0;t<i.match.length;t++){const n=i.match[t];if(e[r+t]){if(e[r+t].type!==n.type){s=!1;break}if(n.match){if(!n.match(e[r+t].value)){s=!1;break}s=!0}else s=!0}else s=!1}if(s){const o=e.slice(r,r+i.match.length);e.splice(r,i.match.length,(t=y({},i.becomes),n={value:o.map((e=>e.value)).join(""),range:{start:o[0].range.start,end:o[o.length-1].range.end,line:o[0].range.line}},d(t,p(n))));break}}var t,n;return e}(o),o}function D(e){let t=0,n=0;for(let r=0;r<e.length;r++)switch(e[r].type){case"openbracket":0===n&&(t=r),n++;break;case"closebracket":if(n--,0===n){const n=e.slice(t+1,r);e.splice(t,r-t+1,{type:"block",block:D(n),range:{line:e[t].range.line,start:e[r].range.start,end:e[r].range.end}}),r=t}}return e}class w{constructor(e){this.type=e,this.name="",this.keywords=[],this.keyword={},this.description="",this.tags=[],this.position=void 0,this.references=[],this.subItems=[],this.readParms=!1,this.range={start:null,end:null},this.scope=void 0}clone(){const e=new w(this.type);return e.name=this.name,e.keywords=[...this.keywords],e.description=this.description,e.tags=this.tags,this.position&&(e.position={path:this.position.path,line:this.position.line}),e.subItems=this.subItems.map((e=>e.clone())),e.range={start:this.range.start,end:this.range.end},e}}const k=[...Array(98).keys(),"LR","KL"].map((e=>`IN${e.toString().padStart(2,"0")}`)).map((e=>{const t=new w("variable");return t.name=e,t.keywords=["IND"],t}));class T{constructor(e={}){this.keyword={},this.parameters=e.parameters||[],this.subroutines=e.subroutines||[],this.procedures=e.procedures||[],this.files=e.files||[],this.variables=e.variables||[],this.structs=e.structs||[],this.constants=e.constants||[],this.sqlReferences=e.sqlReferences||[],this.indicators=e.indicators||[...k],this.includes=e.includes||[]}merge(e){return e?new T({parameters:[...this.parameters,...e.parameters],subroutines:[...this.subroutines,...e.subroutines],procedures:[...this.procedures,...e.procedures],variables:[...this.variables,...e.variables],files:[...this.files,...e.files],structs:[...this.structs,...e.structs],constants:[...this.constants,...e.constants],sqlReferences:[...this.sqlReferences,...e.sqlReferences],indicators:[...this.indicators,...e.indicators]}):this}getNames(){const e=this.files.map((e=>e.subItems.map((e=>e.name)))).flat();return[...this.parameters.map((e=>e.name)),...this.constants.map((e=>e.name)),...this.procedures.map((e=>e.name)),...this.files.map((e=>e.name)),...e,...this.subroutines.map((e=>e.name)),...this.variables.map((e=>e.name)),...this.structs.map((e=>e.name))].filter((e=>e))}getDefinitionBlockEnd(e){const t=[this.procedures.filter((t=>t.position.path===e&&void 0!==t.keyword.EXTPROC)).pop(),this.structs.filter((t=>t.position.path===e)).pop(),this.variables.filter((t=>t.position.path===e)).pop(),this.constants.filter((t=>t.position.path===e)).pop(),this.files.filter((t=>t.position.path===e)).pop()].filter((e=>void 0!==e)).map((e=>e.range&&e.range.end?e.range.end:e.position.line)).sort(((e,t)=>t-e));return t.length>=1?t[0]:0}find(e){e=e.toUpperCase();const t=[...this.files.map((e=>e.subItems)).flat(),...this.structs],n=[...this.parameters.filter((t=>t.name.toUpperCase()===e)),...this.constants.filter((t=>t.name.toUpperCase()===e)),...this.procedures.filter((t=>t.name.toUpperCase()===e)),...this.files.filter((t=>t.name.toUpperCase()===e)),...t.filter((t=>t.name.toUpperCase()===e)),...this.subroutines.filter((t=>t.name.toUpperCase()===e)),...this.variables.filter((t=>t.name.toUpperCase()===e)),...this.indicators.filter((t=>t.name.toUpperCase()===e))];return t.length>0&&0===n.length&&t.filter((e=>!0!==e.keyword.QUALIFIED)).forEach((t=>{n.push(...t.subItems.filter((t=>t.name.toUpperCase()===e)))})),n.length>0?n[0]:null}clearReferences(){[...this.parameters,...this.constants,...this.files,...this.procedures,...this.subroutines,...this.variables,...this.structs].forEach((e=>{e.references=[]})),this.procedures.forEach((e=>{e.scope&&e.scope.clearReferences()})),[...this.files.map((e=>e.subItems)).flat(),...this.structs].forEach((e=>{e.subItems.forEach((e=>e.references=[]))}))}findDefinition(e,t){const n=this.procedures.find((t=>e>=t.range.start&&e<=t.range.end));if(n&&n.scope){const e=n.scope.find(t);if(e)return e}const r=this.find(t);if(r)return r}fixProcedures(){this.procedures.length>0&&this.procedures.forEach((e=>{e.scope&&e.subItems.length>0&&(e.scope.parameters=[...e.subItems],e.scope.fixProcedures())}))}}const S={"DCL-DS":["LIKEDS","LIKEREC","END-DS"],"DCL-PI":["END-PI"],"DCL-PR":["OVERLOAD","END-PR"]};function E(e){return{name:e.substr(6,10).trim(),keywords:e.substr(43).trim().split(" ").filter((e=>""!==e))}}function P(e){const t=(e=e.padEnd(80)).substr(11,14).trim(),n=e.substr(25,10).trim().toUpperCase(),r=e.substr(35,14).trim(),o=e.substr(35).trim();return{opcode:n,factor1:t,factor2:r,result:e.substr(49,14).trim(),extended:o,ind1:e.substr(70,2).trim(),ind2:e.substr(72,2).trim(),ind3:e.substr(74,2).trim()}}function _(e){return{potentialName:(e=e.padEnd(80)).substring(6).trim(),name:e.substr(6,15).trim(),pos:e.substr(25,7).trim(),len:e.substr(32,7).trim(),type:e.substr(39,1).trim(),decimals:e.substr(40,3).trim(),field:e.substr(23,2).trim().toUpperCase(),keywords:e.substr(43).trim().toUpperCase().split(" ").filter((e=>""!==e))}}function x(e){const t=(e=e.padEnd(80)).substr(6,16).trim(),n=e.substring(6).trim(),r="B"===e[23].toUpperCase();return{name:t,potentialName:n,keywords:e.substr(43).trim().toUpperCase().split(" ").filter((e=>""!==e)),start:r}}function N(e){let t="",n=Number(e.len);switch(e.pos&&(n=n-Number(e.pos)+1),e.type.toUpperCase()){case"A":e.keywords.indexOf("VARYING")>=0?(t="Varchar",n-=2):t="Char",t+="("+n+")";break;case"B":t=""!=e.pos?4==Number(e.len)?"Bindec(9)":"Bindec(4)":"Bindec("+e.len+")";break;case"C":t="Ucs2("+e.len+")";break;case"D":case"L":t="Date";break;case"F":t="Float("+e.len+")";break;case"G":t=e.keywords.indexOf("VARYING")>=0?"Vargraph":"Graph",t+="("+e.len+")";break;case"I":switch(n){case 1:t="Int(3)";break;case 2:t="Int(5)";break;case 4:t="Int(10)";break;case 8:t="Int(20)";break;default:t="Int("+n+")"}break;case"N":t="Ind";break;case"P":t="Packed("+n+":"+e.decimals+")";break;case"S":t="Zoned("+n+":"+e.decimals+")";break;case"T":t="Time";break;case"U":switch(n){case 1:t="Uns(3)";break;case 2:t="Uns(5)";break;case 4:t="Uns(10)";break;case 8:t="Uns(20)";break;default:t="Uns("+n+")"}break;case"Z":t="Timestamp",t+="("+n+")";break;case"*":t="Pointer";break;case"":"DS"==e.field?t="lineData.Len("+e.len+")":""!=e.len&&(""==e.decimals?(t=e.keywords.indexOf("VARYING")>=0?"Varchar":"Char",t+="("+n+")"):t=""===e.field?"Zoned("+n+":"+e.decimals+")":"Packed("+n+":"+e.decimals+")")}return t.toUpperCase()}class O{constructor(){this.parsedCache={},this.tables={},this.tableFetch=void 0,this.includeFileFetch=void 0}setTableFetch(e){this.tableFetch=e}setIncludeFileFetch(e){this.includeFileFetch=e}async fetchTable(e,t="",n){if(void 0===e||e&&""===e.trim())return[];if(!this.tableFetch)return[];const r=e.toUpperCase(),o=r,i=Date.now();if(this.tables[o]){if(this.tables[o].fetching)return[];if(i<=this.tables[o].fetched+18e5)return this.tables[o].recordFormats.map((e=>e.clone()))}let s;this.tables[o]={fetching:!0,fetched:0,recordFormats:[]};try{s=await this.tableFetch(r,n),this.tables[o]={fetched:i,recordFormats:s}}catch(e){this.tables[o]={fetched:i,recordFormats:[]},s=[]}return this.tables[o].fetching=!1,s.map((e=>e.clone()))}clearParsedCache(e){this.parsedCache[e]=void 0}getParsedCache(e){return this.parsedCache[e]}static getIncludeFromDirective(e){if(e.includes("*"))return;const t=e.toUpperCase();let n=t.indexOf("/COPY "),r=6;return-1===n&&(n=t.indexOf("/INCLUDE "),r=9),n>=0?e.substring(n+r).trim():void 0}async getDocs(e,t,n={withIncludes:!0}){const r=this.getParsedCache(e);if(!0!==n.ignoreCache&&r)return r;if(!t)return null;const o={};let i,s,a,c,u,l,d,p,h=t.replace(new RegExp("\\\r","g"),"").split("\n"),f=[],m=[],g=!1,y=!1,v=[],b=[],R=[];v.push(new T);const C=(e,t)=>{let n=e;return["EXTFILE"].forEach((e=>{const r=t.find((t=>t.startsWith(`${e}(`)&&t.endsWith(")")));r&&(n=r.substring(e.length+1,r.length-1).toUpperCase(),n.startsWith("'")&&n.endsWith("'")&&(n=n.substring(1,n.length-1)))})),"*EXTDESC"===n&&["EXTDESC"].forEach((e=>{const r=t.find((t=>t.startsWith(`${e}(`)&&t.endsWith(")")));r&&(n=r.substring(e.length+1,r.length-1).toUpperCase(),n.startsWith("'")&&n.endsWith("'")&&(n=n.substring(1,n.length-1)))})),n},D=async(e,t)=>{const n=["LIKEDS","LIKEREC","EXTNAME"];for(const r of n){const n=t.keywords.find((e=>e.startsWith(`${r}(`)&&e.endsWith(")")));if(n){let o=n.substring(r.length+1,n.length-1).toUpperCase();if(o.includes(":")){const e=o.split(":").filter((e=>!1===e.trim().startsWith("*")));if(!(e.length>0))break;o=e[0]}if(o.startsWith("'")&&o.endsWith("'")&&(o=o.substring(1,o.length-1)),["EXTNAME"].includes(r)){t.keywords.includes("QUALIFIED")||t.keywords.push("QUALIFIED");const n=await this.fetchTable(o,t.keywords.length.toString(),t.keywords.includes("ALIAS"));n.length>0&&n.forEach((n=>{n.subItems.forEach((t=>{t.position={path:e,line:u}})),t.subItems.push(...n.subItems)}))}else for(let e=v.length-1;e>=0;e--){const n=v[e].structs.find((e=>e.name.toUpperCase()===o));if(n)return t.subItems=n.subItems,void(t.keywords.includes("QUALIFIED")||t.keywords.push("QUALIFIED"))}}}};if(n.withIncludes&&this.includeFileFetch)for(let t=h.length-1;t>=0;t--){let n=h[t];if(""===n)continue;const r=O.getIncludeFromDirective(n);if(r){const n=await this.includeFileFetch(e,r);n.found&&(o[n.uri]=n.lines,v[0].includes.push({toPath:n.uri,line:t}))}}let k;o[e]=h;let q,I=!1,A=!1;for(const e of Object.keys(o)){if(0===o[e].length)continue;u=-1,A=o[e][0].toUpperCase().startsWith("**FREE");let t,n,r=!1,h=0;for(let L of o[e]){const o=v[v.length-1];let M;if(r=!1,u+=1,L.startsWith("**")){if(0===u)continue;break}if(!1===A&&L.length>6){const e=L[6];if(M=L[5].toUpperCase(),"*"===e)continue;if("/"===e)L=L.substring(6),r=!0;else if(" "===M)L=L.substring(7),r=!0;else{if(!["D","P","C","F","H"].includes(M))continue;if("C"===M){const e=L.toUpperCase();if(!1===["BEGSR","ENDSR","CALL"].some((t=>e.includes(t))))continue}}L.length>80&&(L=L.substring(0,80))}if(p=[],l=[],A||r){if(L=L.trim(),""===L)continue;p=L.split(";"),l=p[0].toUpperCase().split(" ").filter((e=>""!==e)),d=p[0].split(" ").filter((e=>""!==e));const r=L.startsWith("//");if(!r){if("/EOF"===l[0]&&0===h)break;if("/IF"===l[0]){h+=1;continue}if("/ENDIF"===l[0]){h-=1;continue}if(h>0)continue;if(L.startsWith("/"))continue}if(p.length>1&&p[1].includes("//")&&(L=p[0]+";"),t||(n=u),!r)if(L.endsWith(";"))t&&(L=t+L,t=void 0,p=L.split(";"),l=p[0].toUpperCase().split(" ").filter((e=>""!==e)),d=p[0].split(" ").filter((e=>""!==e)));else if(!L.endsWith(";")){t=(t||"")+L.trim(),t.endsWith("-")?t=t.substring(0,t.length-1):t+=" ";continue}switch(l[0]){case"CTL-OPT":R.push(...l.slice(1));break;case"DCL-F":if(void 0===s&&l.length>1){s=new w("file"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.position={path:e,line:u};const t=C(l[1],l);let n="";l.find((e=>{if(e.toUpperCase().includes("PREFIX"))return n=e.trim().substring(7,e.indexOf(")")),!0}));const r=await this.fetchTable(t,l.length.toString(),l.includes("ALIAS"));if(r.length>0){const e=l.includes("QUALIFIED");r.forEach((t=>{t.keywords=[l[1]],e&&t.keywords.push("QUALIFIED"),t.position=s.position,t.subItems.forEach((e=>{n&&(e.name=n+e.name),e.position=s.position}))})),s.subItems.push(...r)}o.files.push(s),g=!0}break;case"DCL-C":void 0===s&&l.length>1&&(s=new w("constant"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.position={path:e,line:n},o.constants.push(s),g=!0);break;case"DCL-S":l.length>1&&void 0===s&&(s=new w("variable"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},o.variables.push(s),g=!0);break;case"DCL-DS":void 0===s&&l.length>1&&(s=new w("struct"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.range={start:n,end:n},q="structs",await D(e,s),s.keywords.some((e=>S["DCL-DS"].some((t=>e.startsWith(t)))))?(s.range.end=n,o.structs.push(s)):(s.readParms=!0,b.push(s)),g=!0,f=[]);break;case"END-DS":b.length>0&&(b[b.length-1].range.end=n),1===b.length?o.structs.push(b.pop()):b.length>1&&b[b.length-2].subItems.push(b.pop());break;case"DCL-PR":void 0===s&&l.length>1&&(o.procedures.find((e=>e.name&&e.name.toUpperCase()===l[1]))||(q="procedures",s=new w("procedure"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.readParms=!0,s.range={start:n,end:n},s.keywords.some((e=>S["DCL-PR"].some((t=>e.startsWith(t)))))&&(s.range.end=n,o.procedures.push(s),g=!0),f=[]));break;case"END-PR":s&&"procedure"===s.type&&(s.range.end=n,v[0].procedures.some((e=>e.name.toUpperCase()===s.name.toUpperCase()))||o.procedures.push(s),g=!0);break;case"DCL-PROC":if(l.length>1){const t=o.procedures.findIndex((e=>e.name&&e.name.toUpperCase()===l[1]));t>=0&&o.procedures.splice(t,1),s=new w("procedure"),c=d[1],s.name=c,s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.readParms=!1,s.range={start:n,end:n},o.procedures.push(s),g=!0,v.push(new T)}break;case"DCL-PI":if(c&&l.length>0){q="procedures",s=v[0].procedures.find((e=>e.name===c));const e=l.findIndex((e=>"END-PI"===e));s&&(e>=0&&(l.splice(e,1),s.readParms=!1,g=!0),s.keywords.push(...l.slice(2)),s.readParms=!0,f=[])}break;case"END-PI":s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.readParms=!1,g=!0);break;case"END-PROC":v.length>1&&(s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.scope=v.pop(),s.range.end=n,g=!0));break;case"BEGSR":l.length>1&&(o.subroutines.find((e=>e.name&&e.name.toUpperCase()===l[1]))||(s=new w("subroutine"),s.name=d[1],s.description=f.join("\n"),s.keywords=["Subroutine"],s.position={path:e,line:n},s.range={start:n,end:n},f=[]));break;case"ENDSR":s&&"subroutine"===s.type&&(s.range.end=n,o.subroutines.push(s),g=!0);break;case"EXEC":if(l.length>2&&!l.includes("FETCH")){const t=["INTO","FROM","UPDATE","CALL","JOIN"],r=(e="")=>{const t={schema:void 0,name:e},n=Math.max(t.name.indexOf("."),t.name.indexOf("/"));n>=0&&(t.schema=t.name.substring(0,n),t.name=t.name.substring(n+1));const r=t.name.indexOf("(");return r>=0&&(t.name=t.name.substring(0,r)),t};l.forEach(((i,s)=>{if(t.includes(i)&&("INTO"!==i||"INSERT"===l[s-1])&&s>=0&&s+1<l.length){const t=d[s+1],i=r(t),a=new w("file");a.name=i.name,a.keywords=[],a.description=i.schema||"",a.position={path:e,line:n},o.sqlReferences.push(a)}g=!0}))}break;case"///":y=!y,!0===y&&(i=void 0,f=[],m=[]);break;default:if(r){if(y){const e=L.substring(2).trim();if(e.length>0)if(e.startsWith("@")){const t=e.substring(1).split(" ");m.push({tag:t[0],content:t.slice(1).join(" ")})}else m.length>0?m[m.length-1].content+=` ${e}`:void 0===i?i=e:f.push(e)}}else if(s||b.length>=1&&(s=b[b.length-1]),s&&["procedure","struct"].includes(s.type)&&s.readParms&&l.length>0){if(l[0].startsWith("DCL")&&(l.slice(1),d=d.splice(1)),a=new w("subitem"),a.name="*N"===l[0]?`parm${s.subItems.length+1}`:d[0],a.keywords=l.slice(1),a.position={path:e,line:n},"procedure"===s.type){const e=s.tags.filter((e=>"param"===e.tag)),t=e.length>s.subItems.length?e[s.subItems.length]:void 0;t&&(a.description=t.content)}await D(e,a),a.keyword=O.expandKeywords(a.keywords),s.subItems.push(a),a=void 0,"struct"===s.type&&(g=!0)}}}else{if(h>0)continue;switch(M){case"H":R.push(L.substring(6));break;case"F":const t=E(L);if(k=C(t.name,t.keywords),t.name){s=new w("file"),s.name=k,s.keywords=t.keywords,s.position={path:e,line:u};let n="";t.keywords.find((e=>{if(e.toUpperCase().includes("PREFIX"))return n=e.substring(7,e.indexOf(")")),!0}));const r=await this.fetchTable(k,L.length.toString(),t.keywords.includes("ALIAS"));if(r.length>0){const e=t.keywords.includes("QUALIFIED");r.forEach((t=>{t.keywords=[k],e&&t.keywords.push("QUALIFIED"),t.position=s.position,t.subItems.forEach((e=>{n&&(e.name=n.toUpperCase()+e.name),e.position=s.position}))})),q="structs",s.subItems.push(...r)}o.files.push(s)}else s=o.files[o.files.length-1],s.keywords=[...s.keywords?s.keywords:[],...t.keywords];g=!0;break;case"C":const n=P(L);switch(k=n.factor1,n.opcode){case"BEGSR":o.subroutines.find((e=>e.name&&e.name.toUpperCase()===k))||(s=new w("subroutine"),s.name=k,s.keywords=["Subroutine"],s.position={path:e,line:u},s.range={start:u,end:u},f=[]);break;case"ENDSR":s&&"subroutine"===s.type&&(s.range.end=u,o.subroutines.push(s),g=!0);break;case"CALL":const t=new w("procedure");t.name=n.factor2.startsWith("'")&&n.factor2.endsWith("'")?n.factor2.substring(1,n.factor2.length-1):n.factor2,t.keywords=["EXTPGM"],t.description=f.join("\n"),t.tags=m,t.position={path:e,line:u},t.range={start:u,end:u},t.keyword=O.expandKeywords(t.keywords),o.procedures.push(t)}break;case"P":const r=x(L);if(""===r.potentialName)continue;if(r.potentialName.endsWith("..."))k=r.potentialName.substring(0,r.potentialName.length-3),I=!0;else if(r.start){if(k=r.name.length>0?r.name:k,k){const t=o.procedures.findIndex((e=>e.name&&e.name.toUpperCase()===k.toUpperCase()));t>=0&&o.procedures.splice(t,1),s=new w("procedure"),c=k,s.name=c,s.keywords=r.keywords,s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},o.procedures.push(s),g=!0,v.push(new T)}}else v.length>1&&(s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.scope=v.pop(),s.range.end=u,g=!0));break;case"D":const i=_(L);if(""===i.potentialName)continue;if(i.potentialName.endsWith("...")){k=i.potentialName.substring(0,i.potentialName.length-3),I=!0;continue}switch(k=i.name.length>0?i.name:k||"",i.field){case"C":s=new w("constant"),s.name=k||"*N",s.keywords=[...i.keywords],s.position={path:e,line:u-(I?1:0)},o.constants.push(s),g=!0;break;case"S":s=new w("variable"),s.name=k||"*N",s.keywords=[N(i),...i.keywords],s.position={path:e,line:u-(I?1:0)},o.variables.push(s),g=!0;break;case"DS":s=new w("struct"),s.name=k||"*N",s.keywords=i.keywords,s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},D(e,s),q="structs",o.structs.push(s),g=!0;break;case"PR":o.procedures.find((e=>e.name&&e.name.toUpperCase()===k.toUpperCase()))||(s=new w("procedure"),s.name=k||"*N",s.keywords=[N(i),...i.keywords],s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},q="procedures",o.procedures.push(s),f=[]);break;case"PI":c&&(s=v[0].procedures.find((e=>e.name===c)),q="procedures",s&&s.keywords.push(N(i),...i.keywords));break;default:if(!s)switch(q){case"structs":case"procedures":let e;for(let t=v.length-1;t>=0&&(e=v[t],!(e[q].length>0));t--);s=e[q][e[q].length-1]}s&&(""===k&&(i.type||i.len)&&(k=""===k?`parm${s.subItems.length+1}`:k),k?(a=new w("subitem"),a.name=k,a.keywords=[N(i),...i.keywords],a.position={path:e,line:u},await D(e,a),a.keyword=O.expandKeywords(a.keywords),s.subItems.push(a),a=void 0,g=!0):s&&(s.subItems.length>0?s.subItems[s.subItems.length-1].keywords.push(N(i),...i.keywords):s.keywords.push(...i.keywords)),s.range.end=u)}k=void 0}}g&&(s&&(s.keyword=O.expandKeywords(s.keywords)),k=void 0,I=!1,s=void 0,i=void 0,f=[],m=[],g=!1)}}v.length>0&&(v[0].keyword=O.expandKeywords(R)),v[0].fixProcedures();const L=v[0];return this.parsedCache[e]=L,L}static expandKeywords(e){const t={};if(e.length>0){const n=D(C(e.join(" ")));for(let e=0;e<n.length;e++)n[e].value&&(n[e+1]&&"block"===n[e+1].type?(t[n[e].value.toUpperCase()]=n[e+1].block.map((e=>e.value)).join(""),e++):t[n[e].value.toUpperCase()]=!0)}return t}}const q=new t.TextDocuments(e),I=new O;function A(e,n){const r=e.getText().split("\n"),o=Math.min(r.length-1,Math.max(0,n.line)),i=r[o],s=Math.min(i.length-1,Math.max(0,n.character));let a=s;for(;a>0&&!/[\s\W]/.test(i.charAt(a-1));)a-=1;let c=s;for(;c<i.length&&!/[\s\W]/.test(i.charAt(c+1));)c+=1;return a===c?void 0:e.getText(t.Range.create(o,Math.max(0,a),o,c+1)).replace(/(\r\n|\n|\r)/gm,"")}var L;(()=>{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(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){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;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(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;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,s=i-o,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,u=s<c?s:c,l=-1,d=0;d<=u;++d){if(d===u){if(c>u){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>u&&(47===e.charCodeAt(o+d)?l=d:0===d&&(l=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(l=d)}var h="";for(d=o+l+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+l):(a+=l,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 u=e.charCodeAt(r);if(47===u){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===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,u=!0,l=e.length-1,d=0;l>=r;--l)if(47!==(o=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===o?-1===s?s=l:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){a=l+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}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}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={};(()=>{var e;if(n.r(r),n.d(r,{URI:()=>h,Utils:()=>k}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var o,i,s=(o=function(e,t){return o=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])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//,l="",d="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,h=function(){function t(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||l,this.authority=e.authority||l,this.path=e.path||l,this.query=e.query||l,this.fragment=e.fragment||l):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||l,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==d&&(t=d+t):t=d}return t}(this.scheme,n||l),this.query=r||l,this.fragment=o||l,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.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 t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),t.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=l),void 0===n?n=this.authority:null===n&&(n=l),void 0===r?r=this.path:null===r&&(r=l),void 0===o?o=this.query:null===o&&(o=l),void 0===i?i=this.fragment:null===i&&(i=l),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new m(t,n,r,o,i)},t.parse=function(e,t){void 0===t&&(t=!1);var n=p.exec(e);return n?new m(n[2]||l,w(n[4]||l),w(n[5]||l),w(n[7]||l),w(n[9]||l),t):new m(l,l,l,l,l)},t.file=function(t){var n=l;if(e&&(t=t.replace(/\\/g,d)),t[0]===d&&t[1]===d){var r=t.indexOf(d,2);-1===r?(n=t.substring(2),t=d):(n=t.substring(2,r),t=t.substring(r)||d)}return new m("file",n,t,l,l)},t.from=function(e){return new m(e.scheme,e.authority,e.path,e.query,e.fragment)},t.prototype.toString=function(e){return void 0===e&&(e=!1),R(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new m(e);return n._formatted=e.external,n._fsPath=e._sep===f?e.fsPath:null,n}return e},t}(),f=e?1:void 0,m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(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?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=f),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}(h),g=((i={})[58]="%3A",i[47]="%2F",i[63]="%3F",i[35]="%23",i[91]="%5B",i[93]="%5D",i[64]="%40",i[33]="%21",i[36]="%24",i[38]="%26",i[39]="%27",i[40]="%28",i[41]="%29",i[42]="%2A",i[43]="%2B",i[44]="%2C",i[59]="%3B",i[61]="%3D",i[32]="%20",i);function y(e,t){for(var n=void 0,r=-1,o=0;o<e.length;o++){var i=e.charCodeAt(o);if(i>=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=g[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;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=g[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function b(t,n){var r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function R(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+=d,r+=d),i){var u=i.indexOf("@");if(-1!==u){var l=i.substr(0,u);i=i.substr(u+1),-1===(u=l.indexOf(":"))?r+=n(l,!1):(r+=n(l.substr(0,u),!1),r+=":",r+=n(l.substr(u+1),!1)),r+="@"}-1===(u=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,u),!1),r+=i.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(p=s.charCodeAt(1))>=65&&p<=90&&(s="/".concat(String.fromCharCode(p+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var p;(p=s.charCodeAt(0))>=65&&p<=90&&(s="".concat(String.fromCharCode(p+32),":").concat(s.substr(2)))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function C(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+C(e.substr(3)):e}}var D=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function w(e){return e.match(D)?e.replace(D,(function(e){return C(e)})):e}var k,T=n(470),S=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},E=T.posix||T,P="/";!function(e){e.joinPath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.with({path:E.join.apply(E,S([e.path],t,!1))})},e.resolvePath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.path,o=!1;r[0]!==P&&(r=P+r,o=!0);var i=E.resolve.apply(E,S([r],t,!1));return o&&i[0]===P&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===P)return e;var t=E.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return E.basename(e.path)},e.extname=function(e){return E.extname(e.path)}}(k||(k={}))})(),L=r})();const{URI:M,Utils:j}=L,F=[{name:"printf",type:"function",insertText:"printf(${1:value})$0",detail:"int(10)",description:"Print to standard out",prototype:["///","// printf","// Print to standard out","// @param String value pointer","///","dcl-pr printf int(10) extproc('printf');"," format pointer value options(*string);","end-pr;"],example:["**free","dcl-s outtext varchar(50);","outtext = 'Hello world'","printf(outtext + '\\n');"]},{name:"Qp0zLprintf",type:"function",insertText:"Qp0zLprintf(${1:value})$0",detail:"int(10)",description:"Prints user data specified by format-string as an information message type to the job log.",prototype:["///","// Qp0zLprintf","// Prints user data specified by format-string as","// an information message type to the job log.","// To ensure messages are written to the job log, always","// use a new line (\\n) at the end of each format-string.","// @param format-string","///","dcl-pr Qp0zLprintf int(10) extproc('Qp0zLprintf');"," format pointer value options(*string);","end-pr;"]},{name:"system",type:"function",insertText:"system(${1:value})$0",detail:"int(10)",description:"Execute an ILE command",prototype:["///","// system","// Execute an ILE command","// @param The command as string pointer","///","dcl-pr system int(10) extproc('system');"," command pointer value options(*string);","end-pr;"]},{name:"QzshSystem",type:"function",insertText:"QzshSystem(${1:value})$0",detail:"int(10)",description:"Runs the specified shell command by spawning a child process and invoking qsh",prototype:["///","// QzshSystem","// Runs the specified shell command by","// spawning a child process and invoking qsh","// @param The command as string pointer","///","dcl-pr QzshSystem int(10) extproc('QzshSystem');"," command pointer value options(*string);","end-pr;"]},{name:"getenv",type:"function",insertText:"getenv(${1:'ENVVAR'})$0",detail:"pointer",description:"Searches the job-level environment list for a string",prototype:["///","// getenv","// Searches the job-level environment list for a string","// @param Environment variable name","///","dcl-pr getenv pointer extproc('getenv');"," name pointer value options(*string:*trim);","end-pr;"],example:["**free","dcl-s EnvVarValue char(500);","EnvVarValue = %str(getenv('ENVVAR'));"]},{name:"putenv",type:"function",insertText:"putenv(${1:'ENVVAR=value'})$0",detail:"int(10)",description:"Creates or changes an environment variable",prototype:["///","// putenv","// Creates or changes an environment variable","// @param Environment variable name and value","///","dcl-pr putenv pointer extproc('putenv');"," change pointer value options(*string:*trim);","end-pr;"],example:["**free","dcl-s EnvVarValue char(500);","EnvVarValue = 'Some value to store';","putenv('ENVVAR=' + EnvVarValue);"]},{name:"QUSCRTUS",type:"function",insertText:"QUSCRTUS(\n ${1:'NAME LIB'}:\n ${2:'LOG'}:\n ${3:size}:\n ${4:'*ALL'}:\n ${5:'New object'}\n);$0",detail:"void",description:"Create User Space",prototype:["///","// QUSCRTUS","// Create User Space","///","dcl-pr QUSCRTUS extpgm('QUSCRTUS');"," qualifiedName char(20) const;"," extendedAtribute char(10) const;"," initialSize int(10) const;"," initialValue char(1) const;"," publicAuthority char(10) const;"," description char(50) const;"," // optional parm group 1"," UsrSpcRepl char(10) const options(*nopass);"," UsrSpcErrC likeds(ApiErrC) options(*nopass: *varsize);"," // optional parm group 2"," UsrSpcDomn char(10) const options(*nopass);"," // optional parm group 3"," UsrSpcReqS int(10) const options(*nopass);"," UsrSpcOptA char(1) const options(*nopass);","end-pr;"]},{name:"QUSDLTUS",type:"function",insertText:"QUSDLTUS(${1:'NAME LIB'}:${2:APIERRC});",detail:"void",description:"Delete User Space",prototype:["///","// QUSDLTUS","// Delete User Space","///","dcl-pr QUSDLTUS extpgm('QUSDLTUS');"," qualifiedName char(20) const;"," errorResponse likeds(APIERRC_T) options(*varsize);","end-pr;"]},{name:"APIERRC_T",type:"struct",insertText:"APIERRC_T",detail:"ERRC0100 format",description:"Error data structure",prototype:["///","// APPERRC template","// Used for error capturing","///","dcl-ds APIERRC_T Qualified Template;"," bytesProvided Int(10:0); // Inz(%size(ApiErrC))"," bytesAvailable Int(10:0);"," exceptionID Char(7);"," reserved Char(1);"," exceptionData Char(3000);","end-ds;"],example:["**free","dcl-ds apierrc likeds(APIERRC_T);","apierrc.bytesProvided = %size(apierrc);"]},{name:"QCMDEXC",type:"function",description:"Execute a system command",detail:"void",insertText:"QCMDEXC(\n ${1:commandString}:\n ${2:commandLength}\n)$0",prototype:["///","// QCMDEXC","// Execute a system command","///","Dcl-Pr QCMDEXC EXTPGM('QCMDEXC');"," commandString CHAR(32702) CONST OPTIONS(*VARSIZE);"," commandLength PACKED(15:5) CONST;","End-Pr;"]},{name:"QCLRDTAQ",type:"function",description:"Clear data queue",detail:"void",insertText:"QCLRDTAQ(\n ${1:dqName}:\n ${2:dqLibrary}:\n ${3:keyOrder}:\n ${4:keyDataLength}:\n ${5:keyData}:\n ${6:prErrCode}\n)$0",prototype:["///","// QCLRDTAQ","// Clear data queue","///","Dcl-Pr QCLRDTAQ EXTPGM('QCLRDTAQ');"," dqName CHAR(10) CONST;"," dqLibrary CHAR(10) CONST;"," keyOrder CHAR(2) CONST OPTIONS(*NOPASS);"," keyDataLength PACKED(3:0) CONST OPTIONS(*NOPASS);"," keyData CHAR(256) CONST OPTIONS(*NOPASS:*VARSIZE);"," prErrCode LIKEDS(APIERRC_T) OPTIONS(*NOPASS:*VARSIZE);","End-Pr;"]},{name:"QSNDDTAQ",type:"function",description:"Send to data queue",detail:"void",insertText:"QSNDDTAQ(\n ${1:dqName}:\n ${2:dqLibrary}:\n ${3:dataInLen}:\n ${4:dataIn}:\n ${5:keyDataLength}:\n ${6:keyData}:\n ${7:asyncRequest}:\n ${8:isJourneyEntry}\n)$0",prototype:["///","// QSNDDTAQ","// Send to data queue","///","Dcl-Pr QSNDDTAQ EXTPGM('QSNDDTAQ');"," dqName CHAR(10) CONST;"," dqLibrary CHAR(10) CONST;"," dataInLen PACKED(5:0);"," dataIn CHAR(65535) OPTIONS(*VARSIZE);"," keyDataLength PACKED(3:0) CONST OPTIONS(*NOPASS);"," keyData CHAR(256) CONST OPTIONS(*NOPASS:*VARSIZE);"," asyncRequest CHAR(10) CONST OPTIONS(*NOPASS);"," isJourneyEntry CHAR(10) CONST OPTIONS(*NOPASS);","End-Pr;"]},{name:"memcpy",type:"function",description:"",detail:"void",insertText:"memcpy(\n ${1:target}:\n ${2:source}:\n ${3:length}\n)$0",prototype:["///","// memcpy","// API","///","dcl-pr memcpy EXTPROC('__MEMCPY');"," target POINTER VALUE;"," source POINTER VALUE;"," length UNS(10) VALUE;","end-pr;"]},{name:"QRCVDTAQ",type:"function",description:"",detail:"void",insertText:"QRCVDTAQ(\n ${1:Object}:\n ${2:Library}:\n ${3:DataLen}:\n ${4:Data}:\n ${5:WaitTime}:\n ${6:KeyOrder}:\n ${7:KeyLen}:\n ${8:Key}\n)$0",prototype:["///","// QRCVDTAQ","// API","///","dcl-pr QRCVDTAQ EXTPGM('QRCVDTAQ');"," Object CHAR(10);"," Library CHAR(10);"," DataLen PACKED(5);"," Data CHAR(DQ_LEN);"," WaitTime PACKED(5);"," KeyOrder CHAR(2) OPTIONS(*NOPASS);"," KeyLen PACKED(3) OPTIONS(*NOPASS);"," Key POINTER OPTIONS(*NOPASS);","end-pr;"]},{name:"RSLVSP2",type:"function",description:"Get library pointer",detail:"void",insertText:"RSLVSP2(\n ${1:objectResult}:\n ${2:rslvsp_in}\n)$0",prototype:["///","// RSLVSP2","// Get library pointer","// @param Resulting pointer by reference","// @param Struct rslvsp_t","///","dcl-pr RSLVSP2 EXTPROC('_RSLVSP2');"," objectResult POINTER;"," rslvsp_in LIKEDS(RSLVSP_T) QUALIFIED;","end-pr;"]},{name:"RSLVSP4",type:"function",description:"Get object pointer",detail:"void",insertText:"RSLVSP4(\n ${1:objectResult}:\n ${2:rslvsp_in}:\n ${3:libraryPointer}\n)$0",prototype:["///","// RSLVSP4","// Get object pointer","// @param Resulting pointer by reference","// @param Struct rslvsp_t","// @param Library pointer from RSLVSP2","///","dcl-pr RSLVSP4 EXTPROC('_RSLVSP4');"," objectResult POINTER;"," rslvsp_in CHAR(34);"," libraryPointer POINTER;","end-pr;"]},{name:"QleActBndPgmLong",type:"function",description:"Activate service program",detail:"INT(20)",insertText:"QleActBndPgmLong(\n ${1:serviceProgram}\n)$0",prototype:["///","// QleActBndPgmLong","// Activate service program","// @param Pointer to service program from RSLVSP4","///","dcl-pr QleActBndPgmLong INT(20) EXTPROC('QLEACTBNDPGMLONG');"," serviceProgram POINTER;","end-pr;"]},{name:"RetrieveFunctionPointer",type:"function",description:"Retrieve function pointer",detail:"POINTER",insertText:"RetrieveFunctionPointer(\n ${1:Mark}:\n ${2:ExportNum}:\n ${3:ExportNameLen}:\n ${4:ExportName}:\n ${5:rFuncPointer}:\n ${6:rFuncResult}\n)$0",prototype:["///","// RetrieveFunctionPointer","// Retrieve function pointer","// @param Value from QleActBndPgmLong","// @param Export number.","// @param Export name length","// @param Export name","// @param Resulting function pointer","// @param Resulting status code","///","dcl-pr RetrieveFunctionPointer POINTER EXTPROC('QLEGETEXPLONG');"," Mark INT(20);"," ///"," // @value 0 (zero is valid)"," ///"," ExportNum INT(10) VALUE;"," ExportNameLen INT(10);"," ExportName POINTER VALUE OPTIONS(*STRING);"," rFuncPointer POINTER;"," rFuncResult INT(10);","end-pr;"]},{name:"callpgmv",type:"function",description:"",detail:"void",insertText:"callpgmv(\n ${1:pgm_ptr}:\n ${2:argv}:\n ${3:argc}\n)$0",prototype:["///","// callpgmv","// API","///","dcl-pr callpgmv EXTPROC('_CALLPGMV');"," pgm_ptr POINTER;"," argv POINTER DIM(256);"," argc UNS(10) VALUE;","end-pr;"]},{name:"rslvsp_t",type:"struct",description:"Resolve object pointer struct",detail:"QUALIFIED TEMPLATE",insertText:"rslvsp_t",prototype:["///","// rslvsp_t","// Resolve object struct","///","dcl-ds rslvsp_t QUALIFIED TEMPLATE;"," ///"," // @value x'0401' Library"," // @value x'0201' Program"," // @value x'0203' Service Program"," ///"," Obj_Type CHAR(2);"," Obj_Name CHAR(30);"," Auth CHAR(2) INZ(X'0000');","end-ds;"]}],U=o.CompletionItem.create("@rpglint-skip");U.kind=o.CompletionItemKind.Snippet,U.detail="The next line will skip rules and indentation checking.";const W=o.CompletionItem.create("@rpglint-skip-indent");W.kind=o.CompletionItemKind.Snippet,W.detail="The next line will skip indentation checking.";const $=o.CompletionItem.create("@rpglint-skip-rules");$.kind=o.CompletionItemKind.Snippet,$.detail="The next line will skip rules checking.";const H=[U,W,$],V=require("fs/promises");var K=n(6729);class B extends Error{constructor(e){super(e),this.name="TimeoutError"}}class z extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const Q=e=>void 0===globalThis.DOMException?new z(e):new DOMException(e),G=e=>{const t=void 0===e.reason?Q("This operation was aborted."):e.reason;return t instanceof Error?t:Q(t)};var X,J=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class Y{constructor(){X.set(this,[])}enqueue(e,t){const n={priority:(t={priority:0,...t}).priority,run:e};if(this.size&&J(this,X,"f")[this.size-1].priority>=t.priority)return void J(this,X,"f").push(n);const r=function(e,t,n){let r=0,o=e.length;for(;o>0;){const n=Math.trunc(o/2);let s=r+n;i=e[s],t.priority-i.priority<=0?(r=++s,o-=n+1):o=n}var i;return r}(J(this,X,"f"),n);J(this,X,"f").splice(r,0,n)}dequeue(){const e=J(this,X,"f").shift();return null==e?void 0:e.run}filter(e){return J(this,X,"f").filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return J(this,X,"f").length}}X=new WeakMap;var Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce,De,we,ke,Te=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},Se=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class Ee extends Error{}ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,oe=new WeakMap,ie=new WeakMap,se=new WeakMap,ae=new WeakMap,ce=new WeakMap,ue=new WeakMap,le=new WeakMap,de=new WeakMap,pe=new WeakMap,he=new WeakMap,Z=new WeakSet,fe=function(){return Se(this,te,"f")||Se(this,ne,"f")<Se(this,re,"f")},me=function(){return Se(this,le,"f")<Se(this,de,"f")},ge=function(){var e;Te(this,le,(e=Se(this,le,"f"),--e),"f"),Se(this,Z,"m",be).call(this),this.emit("next")},ye=function(){Se(this,Z,"m",Ce).call(this),Se(this,Z,"m",Re).call(this),Te(this,ae,void 0,"f")},ve=function(){const e=Date.now();if(void 0===Se(this,se,"f")){const t=Se(this,ie,"f")-e;if(!(t<0))return void 0===Se(this,ae,"f")&&Te(this,ae,setTimeout((()=>{Se(this,Z,"m",ye).call(this)}),t),"f"),!0;Te(this,ne,Se(this,ee,"f")?Se(this,le,"f"):0,"f")}return!1},be=function(){if(0===Se(this,ce,"f").size)return Se(this,se,"f")&&clearInterval(Se(this,se,"f")),Te(this,se,void 0,"f"),this.emit("empty"),0===Se(this,le,"f")&&this.emit("idle"),!1;if(!Se(this,pe,"f")){const e=!Se(this,Z,"a",ve);if(Se(this,Z,"a",fe)&&Se(this,Z,"a",me)){const t=Se(this,ce,"f").dequeue();return!!t&&(this.emit("active"),t(),e&&Se(this,Z,"m",Re).call(this),!0)}}return!1},Re=function(){Se(this,te,"f")||void 0!==Se(this,se,"f")||(Te(this,se,setInterval((()=>{Se(this,Z,"m",Ce).call(this)}),Se(this,oe,"f")),"f"),Te(this,ie,Date.now()+Se(this,oe,"f"),"f"))},Ce=function(){0===Se(this,ne,"f")&&0===Se(this,le,"f")&&Se(this,se,"f")&&(clearInterval(Se(this,se,"f")),Te(this,se,void 0,"f")),Te(this,ne,Se(this,ee,"f")?Se(this,le,"f"):0,"f"),Se(this,Z,"m",De).call(this)},De=function(){for(;Se(this,Z,"m",be).call(this););},we=async function(e){return new Promise(((t,n)=>{e.addEventListener("abort",(()=>{n(new Ee("The task was aborted."))}),{once:!0})}))},ke=async function(e,t){return new Promise((n=>{const r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)}))};var Pe=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const _e=(0,t.createConnection)(t.ProposedFeatures.all),xe=new class extends K{constructor(e){var t,n,r,o;if(super(),Z.add(this),ee.set(this,void 0),te.set(this,void 0),ne.set(this,0),re.set(this,void 0),oe.set(this,void 0),ie.set(this,0),se.set(this,void 0),ae.set(this,void 0),ce.set(this,void 0),ue.set(this,void 0),le.set(this,0),de.set(this,void 0),pe.set(this,void 0),he.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Y,...e}).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(n=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==n?n:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(o=null===(r=e.interval)||void 0===r?void 0:r.toString())&&void 0!==o?o:""}\` (${typeof e.interval})`);Te(this,ee,e.carryoverConcurrencyCount,"f"),Te(this,te,e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,"f"),Te(this,re,e.intervalCap,"f"),Te(this,oe,e.interval,"f"),Te(this,ce,new e.queueClass,"f"),Te(this,ue,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Te(this,he,!0===e.throwOnTimeout,"f"),Te(this,pe,!1===e.autoStart,"f")}get concurrency(){return Se(this,de,"f")}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Te(this,de,e,"f"),Se(this,Z,"m",De).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:Se(this,he,"f"),...t},new Promise(((n,r)=>{Se(this,ce,"f").enqueue((async()=>{var o,i,s;Te(this,le,(i=Se(this,le,"f"),++i),"f"),Te(this,ne,(s=Se(this,ne,"f"),++s),"f");try{if(null===(o=t.signal)||void 0===o?void 0:o.aborted)throw new Ee("The task was aborted.");let r=e({signal:t.signal});t.timeout&&(r=function(e,t,n,r){let o;const i=new Promise(((i,s)=>{if("number"!=typeof t||1!==Math.sign(t))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t!==Number.POSITIVE_INFINITY){if((r={customTimers:{setTimeout,clearTimeout},...r}).signal){const{signal:e}=r;e.aborted&&s(G(e)),e.addEventListener("abort",(()=>{s(G(e))}))}o=r.customTimers.setTimeout.call(void 0,(()=>{const r=n instanceof Error?n:new B(`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),s(r)}),t),(async()=>{try{i(await e)}catch(e){s(e)}finally{r.customTimers.clearTimeout.call(void 0,o)}})()}else i(e)}));return i.clear=()=>{clearTimeout(o),o=void 0},i}(Promise.resolve(r),t.timeout)),t.signal&&(r=Promise.race([r,Se(this,Z,"m",we).call(this,t.signal)]));const i=await r;n(i),this.emit("completed",i)}catch(e){if(e instanceof B&&!t.throwOnTimeout)return void n();r(e),this.emit("error",e)}finally{Se(this,Z,"m",ge).call(this)}}),t),this.emit("add"),Se(this,Z,"m",be).call(this)}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return Se(this,pe,"f")?(Te(this,pe,!1,"f"),Se(this,Z,"m",De).call(this),this):this}pause(){Te(this,pe,!0,"f")}clear(){Te(this,ce,new(Se(this,ue,"f")),"f")}async onEmpty(){0!==Se(this,ce,"f").size&&await Se(this,Z,"m",ke).call(this,"empty")}async onSizeLessThan(e){Se(this,ce,"f").size<e||await Se(this,Z,"m",ke).call(this,"next",(()=>Se(this,ce,"f").size<e))}async onIdle(){0===Se(this,le,"f")&&0===Se(this,ce,"f").size||await Se(this,Z,"m",ke).call(this,"idle")}get size(){return Se(this,ce,"f").size}sizeBy(e){return Se(this,ce,"f").filter(e).length}get pending(){return Se(this,le,"f")}get isPaused(){return Se(this,pe,"f")}};let Ne=[];function Oe(e,t=""){return Pe(this,null,(function*(){const n=function(e,t=""){return q.keys().find((n=>n.includes(e)&&n.startsWith(`${t}:`)))}(e,t);if(n)return n;console.log(`Validating file from server: ${e}`);return(yield _e.sendRequest("getUri",e))||void 0}))}function qe(e){return Pe(this,null,(function*(){const t=q.get(e);if(t)return t.getText();console.log(`Fetching file from server: ${e}`);return(yield _e.sendRequest("getFile",e))||void 0}))}_e.onDidChangeWatchedFiles((e=>{Ne.forEach((t=>t(e)))}));let Ie={},Ae={};function Le(e,t){return Pe(this,null,(function*(){const n=t.join("-");if(Ae[e]&&Ae[e][n])return Ae[e][n];const r=yield Me(e),o=(r?et[r.uri]:[])||[],i=yield xe.add((()=>_e.sendRequest("streamfileResolve",[t,o])));return i&&(Ae[e]||(Ae[e]={}),Ae[e][n]=i),i}))}function Me(e){return Pe(this,null,(function*(){let t;const n=yield _e.workspace.getWorkspaceFolders();return n&&(t=n.find((t=>e.startsWith(t.uri)))),t}))}const je=["ACQ1","BEGSR","CALLP","CHAIN","CLEAR","CLOSE","COMMIT","DATA","DATA","DEALLOC","DELETE","DOU","DOW","DSPLY","DUMP1","ELSE","ELSEIF","ENDDO","ENDFOR","ENDIF","ENDMON","ENDSL","ENDSR","EVAL","EVALR","EVAL","EXCEPT","EXFMT","EXSR","FEOD","FOR","FORCE","IF","IN","ITER","LEAVE","LEAVESR","MONITOR","NEXT1","ON","OPEN","OTHER","OUT1","POST","READ","READC","READE","READP","READPE","REL","RESET","RETURN","ROLBK","SELECT","SETGT","SETLL","SORTA","TEST","UNLOCK","UPDATE","WHEN","WRITE","XML"];class Fe{constructor(e,t,n=0){this.tokens=e,this.range=t,this.indent=n,this.beginBlock=!1}getTokenByOffset(e){const t=n=>{const r=n.find((t=>e>=t.range.start&&e<=t.range.end));return"block"===(null==r?void 0:r.type)&&r.block?t(r.block):r};return t(this.tokens)}asBlocks(){return D(this.tokens)}static getParameters(e){let t=[],n=[];for(let r=0;r<e.length;r++)"seperator"===e[r].type?(t.push({type:"block",block:n,range:{line:n[0].range.line,start:n[0].range.start,end:n[n.length-1].range.end}}),n=[e[r]]):n.push(e[r]);return n.length>0&&t.push({type:"block",block:n,range:{line:n[0].range.line,start:n[0].range.start,end:n[n.length-1].range.end}}),t}static trimTokens(e){if(e.length>0){let t=e.findIndex((e=>"newline"!==e.type));t<0&&(t=0);let n=0;for(let t=e.length-1;t>=0;t--)if("newline"!==e[t].type){n=t+1;break}e=e.slice(t,n)}return e}}class Ue{constructor(e){this.statements=[],this.parseStatements(C(e))}addStatement(e,t){t.length>0&&this.statements.push(new Fe(t,{line:t[0].range.line,start:t[0].range.start,end:t[t.length-1].range.end},e))}parseStatements(e){let t,n="Normal",r={need:!0,index:-1},o={index:0};for(let i=0;i<e.length;i++)switch(e[i].type){case"semicolon":const s=Fe.trimTokens(e.slice(o.index,i));t=e[r.index];const a=s[0]&&t?s[0].range.start-t.range.end:0;r.need=!0,this.addStatement(a,s),o={index:i+1};break;case"format":const c=Fe.trimTokens(e.slice(o.index,i+1));if(1===c.length){t=e[r.index];const n=c[0]&&t?c[0].range.start-t.range.end:0;r.need=!0,this.addStatement(n,c),o={index:i+1}}break;case"comment":const u=Fe.trimTokens(e.slice(o.index,i+1));if(1===u.length){if(e[i-1]&&e[i-1].range.line!==u[0].range.line){t=e[r.index];const n=u[0]&&t?u[0].range.start-t.range.end:0;r.need=!0,this.addStatement(n,u)}o={index:i+1}}break;case"directive":"directive"===Fe.trimTokens(e.slice(o.index,i+1))[0].type&&(n="Directive");break;case"newline":if("Directive"===n){const s=Fe.trimTokens(e.slice(o.index,i));t=e[r.index];const a=s[0]&&t?s[0].range.start-t.range.end:0;this.addStatement(a,s),r.need=!0,o={index:i+1},n="Normal"}(r.need||e[i-1]&&"newline"===e[i-1].type)&&(r.index=i,r.need=!1)}const i=Fe.trimTokens(e.slice(o.index,e.length));if(i.length>0){t=e[r.index];const n=i[0]?i[0].range.start-t.range.end:0;this.addStatement(n,i)}}getStatementByLine(e){return this.statements.find((t=>t.range.line===e))}getStatementByOffset(e){return this.statements.find(((t,n)=>{const r=this.statements[n+1]?this.statements[n+1].range.start:t.range.end;return e>=t.range.start&&e<r||n===this.statements.length-1&&e>=r}))}getTokenByOffset(e){const t=this.getStatementByOffset(e);if(t)return t.getTokenByOffset(e)}}var We=Object.defineProperty,$e=Object.defineProperties,He=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,ze=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Qe={BlankStructNamesCheck:"Struct names cannot be blank (`*N`).",QualifiedCheck:"Struct names must be qualified (`QUALIFIED`).",PrototypeCheck:"Prototypes can only be defined with either `EXTPGM` or `EXTPROC`",ForceOptionalParens:"Expressions must be surrounded by brackets.",NoOCCURS:"`OCCURS` is not allowed.",NoSELECTAll:"`SELECT *` is not allowed in Embedded SQL.",UselessOperationCheck:"Redundant operation codes (EVAL, CALLP, DCL-PARM, DCL-SUBF) not allowed.",UppercaseConstants:"Constants must be in uppercase.",SpecificCasing:"Does not match required case.",InvalidDeclareNumber:"Variable names cannot start with a number",IncorrectVariableCase:"Variable name casing does not match definition.",RequiresParameter:"Procedure calls require brackets.",RequiresProcedureDescription:"Procedures require a title and description.",StringLiteralDupe:"Same string literal used more than once. Consider using a constant instead.",RequireBlankSpecial:"`*BLANK` should be used over empty string literals.",CopybookDirective:"Directive does not match requirement.",UppercaseDirectives:"Directives must be in uppercase.",NoSQLJoins:"SQL joins are not allowed. Consider creating a view instead.",NoGlobalsInProcedures:"Global variables should not be referenced in procedures.",NoCTDATA:"`CTDATA` is not allowed.",PrettyComments:"Comments must be correctly formatted.",NoGlobalSubroutines:"Subroutines should not be defined in the global scope.",NoLocalSubroutines:"Subroutines should not be defined in procedures.",UnexpectedEnd:"Statement unexpected. Likely missing the equivalent `DCL..`/`BEG..`",NoUnreferenced:"No reference to definition.",NoExternalTo:"Cannot declare prototype to this external API.",NoExecuteImmediate:"EXECUTE IMMEDIATE is not allowed.",NoExtProgramVariable:"Not allowed to use variable in EXTPGM or EXTPROC.",IncludeMustBeRelative:"Path not valid. It must be relative to the project.",SQLHostVarCheck:"Also defined in scope. Should likely be host variable.",RequireOtherBlock:"OTHER block missing from SELECT block."},Ge={none:0,single:1,singleIndent:2,singleRules:3};class Xe{static getErrorText(e){return Qe[e]}static getErrors(e,t,n){const r=void 0!==t.indent,o=t.indent||2,i=Object.keys(t).length-(t.indent?1:0);n||(n=new T);const s=n.procedures;let a=!1,c=!1,u=0,l=!1,d=!1,p=-1;const h=[],f=[];let m,g=0,y=0,v=!1;t.NoUnreferenced&&(t.CollectReferences=!0),t.CollectReferences&&n.clearReferences(),t.NoExternalTo&&t.NoExternalTo.length&&(t.NoExternalTo=t.NoExternalTo.map((e=>e.toUpperCase())));const b=[],R=[];let C=0,D=Ge.none;const w=new Ue(e.content);for(let k=0;k<w.statements.length;k++){const T=w.statements[k],E=T.tokens;if(p=T.range.line,y=T.indent,y>=0){if(v=!1,"comment"===E[0].type){const e=E[0].value.substring(2).trimEnd();switch(t.PrettyComments?e&&"/"!==e[0]&&0===e.search(/\S/)&&f.push({offset:{position:E[0].range.start,end:E[0].range.start+2},type:"PrettyComments",newValue:"// "}):v=!0,e.trim()){case"@rpglint-skip":D=Ge.single;continue;case"@rpglint-skip-indent":D=Ge.singleIndent;continue;case"@rpglint-skip-rules":D=Ge.singleRules;continue}}if(i>0&&![Ge.single,Ge.singleRules].includes(D)){const r=n.procedures.find((e=>p>=e.range.start&&p<=e.range.end)),o=n.merge(a&&r?r.scope:void 0),i=t.IncorrectVariableCase||t.SQLHostVarCheck?o.getNames():[];let d,h,m=!1;if(E.length>=1){if("directive"===E[0].type){const e=E[0].value.toUpperCase();if("/EOF"===e&&0===C)break;"/IF"===e?C+=1:"/ENDIF"===e&&(C-=1)}switch(E[0].type){case"format":p>0&&E[0].value.startsWith("**")&&t.NoCTDATA&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoCTDATA"});break;case"directive":if(d=E[0].value,t.UppercaseDirectives&&d!==d.toUpperCase()&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UppercaseDirectives",newValue:d.toUpperCase()}),(t.CopybookDirective||t.IncludeMustBeRelative)&&["/COPY","/INCLUDE"].includes(d.toUpperCase())){if(t.IncludeMustBeRelative)if(2===E.length){const t=E[1];if("word"===t.type){const n=t.value.substring(1,t.value.length-1).trim().toUpperCase(),r=e.availableIncludes&&e.availableIncludes.length>0?e.availableIncludes.find((e=>e.toUpperCase().includes(n.toUpperCase()))):void 0;f.push({offset:{position:t.range.start,end:t.range.end+t.value.length},type:"IncludeMustBeRelative",newValue:r?`'${r}'`:void 0})}else if("string"===t.type){const n=t.value.substring(1,t.value.length-1).trim();if(!0===n.startsWith("/"))f.push({offset:{position:t.range.start,end:t.range.end},type:"IncludeMustBeRelative"});else if(e.availableIncludes&&e.availableIncludes.length>0){const r=e.availableIncludes.find((e=>e.toUpperCase().includes(n.toUpperCase())));r&&n!==r&&f.push({offset:{position:t.range.start,end:t.range.end},type:"IncludeMustBeRelative",newValue:`'${r}'`})}}}else if(4===E.length&&"comma"===E[2].type){if(e.availableIncludes&&e.availableIncludes.length>0){const t=`${E[1].value}/${E[3].value}`.toUpperCase(),n=e.availableIncludes.find((e=>e.toUpperCase().includes(t)));n&&t!==n&&f.push({offset:{position:E[1].range.start,end:E[3].range.end},type:"IncludeMustBeRelative",newValue:`'${n}'`})}}else f.push({type:"IncludeMustBeRelative",offset:{position:E[0].range.start,end:E[E.length-1].range.end}});if(t.CopybookDirective){const e=`/${t.CopybookDirective.toUpperCase()}`;d.toUpperCase()!==e&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"CopybookDirective",newValue:e})}}break;case"declare":if(E.length<2)break;if(t.SpecificCasing){const e=t.SpecificCasing.find((e=>[E[0].value.toUpperCase(),"*DECLARE"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d=E[1].value,d.match(/^\d/)&&f.push({offset:{position:E[1].range.start,end:E[1].range.end},type:"InvalidDeclareNumber"}),E[0].value.toUpperCase()){case"BEGSR":c&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),c=!0,a?t.NoLocalSubroutines&&f.push({type:"NoLocalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}):t.NoGlobalSubroutines&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoGlobalSubroutines",newValue:"Dcl-Proc"});break;case"DCL-PROC":if((c||a)&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),a=!0,E.length<2)break;if(t.RequiresProcedureDescription){d=E[1].value;const e=s.find((e=>e.name.toUpperCase()===d.toUpperCase()));e&&(e.description||f.push({type:"RequiresProcedureDescription",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}))}break;case"DCL-C":if(t.UppercaseConstants&&d!==d.toUpperCase()&&f.push({offset:{position:E[1].range.start,end:E[1].range.end},type:"UppercaseConstants",newValue:d.toUpperCase()}),t.StringLiteralDupe&&"string"===E[2].type){let e=R.find((e=>e.value===E[2].value));e||(e={definition:d,value:E[2].value,list:[]},R.push(e))}break;case"DCL-PI":E.some((e=>"end"===e.type))||(l=!0);break;case"DCL-PR":if(l=!0,t.PrototypeCheck||t.NoExtProgramVariable){const e=E.findIndex((e=>e.value&&["EXTPGM","EXTPROC"].includes(e.value.toUpperCase())));if(e>=0){if(t.NoExtProgramVariable){const t=E.find(((t,n)=>n>e&&"word"===t.type));t&&f.push({offset:{position:t.range.start,end:t.range.end},type:"NoExtProgramVariable"})}}else t.PrototypeCheck&&f.push({type:"PrototypeCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}break;case"DCL-DS":u+=1,t.NoOCCURS&&E.some((e=>e.value&&"OCCURS"===e.value.toUpperCase()))&&f.push({type:"NoOCCURS",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.QualifiedCheck&&(E.some((e=>e.value&&["LIKEDS","LIKEREC","QUALIFIED"].includes(e.value.toUpperCase())))||f.push({type:"QualifiedCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})),t.BlankStructNamesCheck&&E.some((e=>"special"===e.type&&"*N"===e.value.toUpperCase()))&&f.push({type:"BlankStructNamesCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.NoCTDATA&&E.some((e=>["CTDATA","*CTDATA"].includes(e.value.toUpperCase())))&&f.push({type:"NoCTDATA",offset:{position:E[0].range.start,end:E[E.length-1].range.end}});break;case"DCL-SUBF":case"DCL-PARM":if(t.UselessOperationCheck&&E[1]&&E[1].value){const e=E[1].value.toUpperCase();je.includes(e)||f.push({offset:{position:E[0].range.start,end:E[0].range.end+1},type:"UselessOperationCheck"})}}break;case"end":if(d=E[0].value.toUpperCase(),t.SpecificCasing){const e=t.SpecificCasing.find((e=>[d,"*DECLARE"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d){case"ENDSR":c?c=!1:f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),!1===a&&t.NoGlobalSubroutines&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoGlobalSubroutines",newValue:"End-Proc"});break;case"END-DS":u-=1;break;case"END-PROC":(!1===a||c)&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),a=!1;break;case"END-PR":case"END-PI":!1===l&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),l=!1}break;case"word":if(d=E[0].value.toUpperCase(),t.SpecificCasing){const e=t.SpecificCasing.find((e=>d===e.operation.toUpperCase()));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d.toUpperCase()){case"EVAL":case"CALLP":E[1]&&"openbracket"!==E[1].type&&t.UselessOperationCheck&&f.push({offset:{position:E[0].range.start,end:E[0].range.end+1},type:"UselessOperationCheck"});break;case"LEAVESR":t.NoGlobalSubroutines&&!a&&f.push({type:"NoGlobalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end},newValue:"return"});break;case"EXSR":t.NoGlobalSubroutines&&2===E.length&&n.subroutines.find((e=>e.name.toUpperCase()===E[1].value.toUpperCase()))&&f.push({type:"NoGlobalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end},newValue:`${E[1].value}()`});break;case"EXEC":if(m=!0,t.NoSELECTAll){const e=E.findIndex((e=>e.value&&"SELECT"===e.value.toUpperCase())),t=E.findIndex((e=>e.value&&"*"===e.value));e>=0&&e+1===t&&f.push({offset:{position:E[0].range.start,end:E[E.length-1].range.end},type:"NoSELECTAll"})}if(t.NoSQLJoins&&E.some((e=>e.value&&"JOIN"===e.value.toUpperCase()))&&f.push({type:"NoSQLJoins",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.NoExecuteImmediate){const e=E.findIndex((e=>e.value&&"EXECUTE"===e.value.toUpperCase())),t=E.findIndex((e=>e.value&&"IMMEDIATE"===e.value.toUpperCase()));e>=0&&e+1===t&&f.push({type:"NoExecuteImmediate",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}t.SQLHostVarCheck&&E.forEach(((e,t)=>{if("word"===e.type&&i.some((t=>t.toUpperCase()===e.value.toUpperCase()))){const n=E[t-1];n&&!["dot","seperator"].includes(n.type)&&f.push({offset:{position:e.range.start,end:e.range.end},type:"SQLHostVarCheck",newValue:`:${e.value}`})}}));break;case"SELECT":b.push({otherBlockExists:!1,offset:{position:E[0].range.start,end:E[E.length-1].range.end}});break;case"OTHER":b.length>0&&(b[b.length-1].otherBlockExists=!0);break;case"ENDSL":if(b.length>0){const e=b.pop();t.RequireOtherBlock&&e&&!e.otherBlockExists&&f.push({type:"RequireOtherBlock",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}break;case"IF":case"ELSEIF":case"WHEN":case"DOW":case"DOU":if(t.ForceOptionalParens){const e=E[E.length-1];"openbracket"===E[1].type&&"closebracket"===e.type||f.push({type:"ForceOptionalParens",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}}}}if(E.length>0)for(let e=0;e<E.length;e++)if(h=E[e],h.value)switch(h.type){case"builtin":if(t.SpecificCasing){const e=t.SpecificCasing.find((e=>[h.value.toUpperCase(),"*BIF"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=h.value.toUpperCase();break;case"*LOWER":t=h.value.toLowerCase()}h.value!==t&&f.push({offset:{position:h.range.start,end:h.range.end},type:"SpecificCasing",newValue:t})}}break;case"special":if(t.CollectReferences){d=h.value.substring(1).toUpperCase();const e=n.find(d);e&&e.references.push({offset:{position:h.range.start,end:h.range.end},type:null})}break;case"word":const o=h.value.toUpperCase();t.NoGlobalsInProcedures&&a&&!l&&n.variables.find((e=>e.name.toUpperCase()===o))&&f.push({offset:{position:h.range.start,end:h.range.end},type:"NoGlobalsInProcedures"});const c=["declare","end"].includes(E[0].type);if(t.IncorrectVariableCase&&(!1===m||m&&E[e-1]&&"seperator"===E[e-1].type)&&!((c||l||u>0)&&e>=0&&E[e+1]&&"openbracket"===E[e+1].type)){const e=i.find((e=>e.toUpperCase()===o));e&&e!==h.value&&f.push({offset:{position:h.range.start,end:h.range.end},type:"IncorrectVariableCase",newValue:e})}if(c&&e>=2||!c){if(t.RequiresParameter&&!l&&!c&&s.find((e=>e.name.toUpperCase()===o))){let t=!1;"CTL-OPT"===E[0].value.toUpperCase()||"directive"===E[0].type||(E.length<=e+1||"openbracket"!==E[e+1].type)&&(t=!0),t&&f.push({offset:{position:h.range.start,end:h.range.end},type:"RequiresParameter"})}if(t.CollectReferences){if(E[e-1]&&"dot"===E[e-1].type)break;let t;if(r&&r.scope&&(t=r.scope.find(o),t||(t=r.subItems.find((e=>e.name.toUpperCase()===o)))),t||(t=n.find(o)),t&&((void 0===t.position||t.position&&t.position.line!==p)&&t.references.push({offset:{position:h.range.start,end:h.range.end}}),t.keyword.QUALIFIED)){let n=e+1;if(E[n]&&("openbracket"===E[n].type&&(n=E.findIndex(((e,t)=>t>n&&"closebracket"===e.type)),n>=0&&n++),E[n]&&"dot"===E[n].type&&(n++,E[n]&&"word"===E[n].type&&E[n].value))){const e=E[n],r=e.value.toUpperCase(),o=t.subItems.find((e=>e.name.toUpperCase()==r));o&&o.references.push({offset:{position:e.range.start,end:e.range.end}})}}}}break;case"string":if(""===h.value.substring(1,h.value.length-1).trim()&&t.RequireBlankSpecial&&!m)f.push({offset:{position:h.range.start,end:h.range.end},type:"RequireBlankSpecial",newValue:"*BLANK"});else if(t.StringLiteralDupe&&!m&&"declare"!==E[0].type){let e=R.find((e=>e.value===h.value));e||(e={value:h.value,list:[]},R.push(e)),e.list.push({offset:{position:h.range.start,end:h.range.end}})}}}if("format"===E[0].type&&"**CTDATA"===E[0].value.toUpperCase())break;v||(v=[Ge.singleIndent,Ge.single].includes(D)),void 0!==w.statements[k-1]&&w.statements[k-1].range.line===p||(r&&!1===v&&(m=E[0].value.toUpperCase(),["ENDIF","ENDFOR","ENDDO","ELSE","ELSEIF","ON-ERROR","ENDMON","ENDSR","WHEN","OTHER","END-PROC","END-PI","END-PR","END-DS","ENDSL"].includes(m)&&(g-=o,["ENDSL"].includes(m)&&(g-=o),"END-PROC"===m&&d&&(d=!1,g-=o)),y!==g&&h.push({line:p,expectedIndent:g,currentIndent:y}),["IF","ELSE","ELSEIF","FOR","FOR-EACH","DOW","DOU","MONITOR","ON-ERROR","ON-EXIT","BEGSR","SELECT","WHEN","OTHER","DCL-PROC","DCL-PI","DCL-PR","DCL-DS"].includes(m)&&(["DCL-DS","DCL-PI","DCL-PR"].includes(m)&&S[m].some((e=>E.map((e=>e.value.toUpperCase())).includes(e)))||("SELECT"===m?!1===v&&(g+=2*o):"ON-EXIT"===m?(g+=o,d=!0):g+=o))),D=Ge.none)}}if(R.length>0){const e=t.literalMinimum||2;R.forEach((t=>{t.list.length>=e&&t.list.forEach((e=>{var n,r;f.push((n=((e,t)=>{for(var n in t||(t={}))Ke.call(t,n)&&ze(e,n,t[n]);if(Ve)for(var n of Ve(t))Be.call(t,n)&&ze(e,n,t[n]);return e})({},e),r={type:"StringLiteralDupe",newValue:t.definition},$e(n,He(r))))}))}))}return t.NoExternalTo&&t.NoExternalTo.length&&[n,...n.procedures.filter((e=>void 0!==e.scope)).map((e=>e.scope))].forEach((e=>{e.procedures.forEach((e=>{if(e.keyword.EXTPROC||e.keyword.EXTPGM){let n=e.keyword.EXTPROC||e.keyword.EXTPGM;if(n=!0===n?e.name.toUpperCase():n.toUpperCase(),n=n.startsWith("'")&&n.endsWith("'")?n.substring(1,n.length-1):n,t.NoExternalTo.includes(n)){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoExternalTo",offset:{position:t.range.start,end:t.range.end}})}}}))})),t.NoUnreferenced&&[n,...n.procedures.filter((e=>void 0!==e.scope)).map((e=>e.scope))].forEach((t=>{[...t.constants,...t.variables].filter((t=>t.position.path===e.uri)).forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),t.subroutines.filter((t=>t.position.path===e.uri&&t.name&&!["*INZSR","*PSSR"].includes(t.name.toUpperCase()))).forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),t.procedures.filter((t=>t.position.path===e.uri)).forEach((e=>{if(!e.keyword.EXPORT){if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}e.keyword.EXTPGM||e.keyword.EXTPROC||e.subItems.forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}}))}})),t.structs.filter((t=>t.position.path===e.uri)).forEach((e=>{const t=e.subItems.some((e=>e.references.length>0));if(0===e.references.length&&(e.subItems.forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),!1===t)){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}}))})),{indentErrors:h,errors:f,doc:w}}}var Je=n(2884),Ye=n(1017),Ze=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));let et={},tt=!1;function nt(e){return Ze(this,null,(function*(){const t=yield Me(e);if(t){const n=yield ot(e),r=null==n?void 0:n.getText();if(r)try{const n=JSON.parse(r);if(n.includePath&&Array.isArray(n.includePath)){n.includePath.some((e=>"string"!=typeof e))?console.log(`${e} -> 'includePath' is not a valid string array.`):et[t.uri]=n.includePath}return n}catch(t){console.log(`Unable to parse JSON in ${e}.`)}}return{}}))}function rt(e){return Ze(this,null,(function*(){const t=yield ot(e);if(t){const n=null==t?void 0:t.getText(),r=yield I.getDocs(e,n);r&&n.length>=6&&"**FREE"===n.substring(0,6).toUpperCase()&&Xe.getErrors({uri:e,content:n},{CollectReferences:!0},r)}}))}function ot(t){return Ze(this,null,(function*(){let n=q.get(t);if(n)return n;try{const n=yield V.readFile(M.parse(t).fsPath,{encoding:"utf-8"});return e.create(t,"rpgle",1,n)}catch(e){}}))}let it=[];function st(e){return Ze(this,null,(function*(){const t=yield Me(e);if(t){const e=M.parse(null==t?void 0:t.uri).path;(!it||it&&0===it.length)&&(it=Je.glob.sync("**/*.{rpgleinc,rpgleh}",{cwd:e,nocase:!0,absolute:!0}).map((t=>({uri:M.file(t).toString(),relative:Ye.relative(e,t)}))))}return it}))}const at=n(1017);function ct(){let e=[];return tt&&Object.keys(I.parsedCache).forEach((t=>{const n=at.parse(t).base,r=at.parse(n);let o=at.basename(r.name).toUpperCase();if(o.endsWith(".PGM")&&(o=o.substring(0,o.length-4)),!1===n.toLowerCase().endsWith(".rpgleinc")){const n=I.getParsedCache(t);if(n){const t=n.keyword.MAIN;if(t){if("string"==typeof t){const r=n.procedures.find((e=>e.name.toUpperCase()===t.toUpperCase()));if(r){let t=r.keywords.map((e=>e.toLowerCase()));t.push(`extpgm('${o}')`);const n=[`dcl-pr ${r.name} ${t.join(" ")};`,...r.subItems.map((e=>` ${e.name} ${e.keywords.map((e=>e.toLowerCase())).join(" ")};`)),"end-pr;"];e.push({name:o,insertText:`${o}(${r.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,detail:o,description:r.description,type:"function",prototype:n})}}}else n.keyword.NOMAIN&&n.procedures.forEach((t=>{if(t.keyword.EXPORT){let n=t.keywords.map((e=>e.toLowerCase())).filter((e=>"export"!==e));n.push(`extproc('${t.name.toUpperCase()}')`);const r=[`dcl-pr ${t.name} ${n.join(" ")};`,...t.subItems.map((e=>` ${e.name} ${e.keywords.map((e=>e.toLowerCase())).join(" ")};`)),"end-pr;"];e.push({name:t.name,insertText:`${t.name}(${t.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,detail:t.name,description:t.description,type:"function",prototype:r})}}))}}})),e}const ut=n(1017),lt={function:o.CompletionItemKind.Function,struct:o.CompletionItemKind.Struct},dt="\n";function pt(e){return t=this,n=null,r=function*(){const t=e.textDocument.uri,n=e.range,r=q.get(t);if(r&&"**FREE"===r.getText(o.Range.create(0,0,0,6)).toUpperCase()){const e=yield I.getDocs(r.uri);if(e){const t=yield Ct(r,e,!1);if(t){const e=t.errors.filter((e=>n.start.line===r.positionAt(e.offset.position).line));if(e.length>0)return Dt(r,e)}}}},new Promise(((e,o)=>{var i=e=>{try{a(r.next(e))}catch(e){o(e)}},s=e=>{try{a(r.throw(e))}catch(e){o(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((r=r.apply(t,n)).next())}));var t,n,r}function ht(e){return t=this,n=null,r=function*(){const t=e.textDocument.uri,n=q.get(t);if(n&&"**FREE"===n.getText(o.Range.create(0,0,0,6)).toUpperCase()){const e=yield Rt(n.uri);if(e){let t=yield I.getDocs(n.uri);if(t){t=yield I.getDocs(n.uri,n.getText(),{ignoreCache:!0});const{errors:r}=Xe.getErrors({uri:n.uri,content:n.getText()},e,t),i=Dt(n,r.filter((e=>"RequiresProcedureDescription"!==e.type)));let s=[],a=0,c=[];i.filter((e=>e.edit)).forEach((e=>{if(e.edit&&e.edit.changes){const t=e.edit.changes[n.uri];t[0]&&s.includes(t[0].range.start.line)?a+=1:t.forEach((e=>{const t=e.range.start.line;c.push(e),s.includes(t)||s.push(t)}))}}));const{indentErrors:u}=Xe.getErrors({uri:n.uri,content:n.getText()},e,t),l=u.map((e=>{const t=o.Range.create(e.line,0,e.line,e.currentIndent);return o.TextEdit.replace(t,"".padEnd(e.expectedIndent," "))}));return[...c,...l]}}}return[]},new Promise(((e,o)=>{var i=e=>{try{a(r.next(e))}catch(e){o(e)}},s=e=>{try{a(r.throw(e))}catch(e){o(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((r=r.apply(t,n)).next())}));var t,n,r}function ft(e){const t=e.split("/").map((e=>e.split(","))).flat().filter((e=>e.length>=1));return{name:t[t.length-1],file:t[t.length-2],library:t[t.length-3],asp:t[t.length-4]}}var mt=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const gt=n(1017);let yt={};function vt(e,t){return t.offset,o.Range.create(e.positionAt(t.offset.position),e.positionAt(t.offset.end))}let bt={};function Rt(e){return mt(this,null,(function*(){const t=yield function(e){return mt(this,null,(function*(){const t=M.parse(e);let n;const r=bt[e];if(r)return 0===r.resolved?r.uri:void 0;switch(t.scheme){case"member":if(n=["",ft(t.path).library,"VSCODE","RPGLINT.JSON"].join("/"),n=M.from({scheme:"member",path:n}).toString(),yt[n])return n;n=yield Oe(n);break;case"streamfile":const e=yield _e.sendRequest("getWorkingDirectory");e&&(n=M.from({scheme:"streamfile",path:gt.posix.join(e,".vscode","rpglint.json")}).toString(),n=yield Oe(n,t.scheme));break;case"file":n=yield Oe("rpglint.json",t.scheme)}return bt[e]=n?{resolved:0,uri:n}:{resolved:1,uri:""},n}))}(e);let n={};if(t){if(yt[t])return JSON.parse(yt[t]);try{yt[t]="{}";const e=yield qe(t);e&&(n=JSON.parse(e),yt[t]=e)}catch(e){delete yt[t],console.log(`Error getting lint config for ${t}: ${e.message}`),console.log(e.stack)}}return n}))}function Ct(e,t,n=!0){return mt(this,null,(function*(){if("**FREE"===e.getText(o.Range.create(0,0,0,6)).toUpperCase()){const r=e.getText(),i=[],s=[],a=yield Rt(e.uri);let c,u;tt&&(a.CollectReferences=!0,u=(yield st(e.uri)).map((e=>e.relative)));try{c=Xe.getErrors({uri:e.uri,content:r,availableIncludes:u},a,t)}catch(t){return console.log(`Error linting ${e.uri}: ${t.message}`),void console.log(t.stack)}const l=c.indentErrors,d=c.errors;return l.length>0&&l.forEach((e=>{const t=o.Range.create(e.line,0,e.line,e.currentIndent);i.push(o.Diagnostic.create(t,`Incorrect indentation. Expected ${e.expectedIndent}, got ${e.currentIndent}`,o.DiagnosticSeverity.Warning))})),d.length>0&&d.forEach((t=>{const n=vt(e,t),r=o.Diagnostic.create(n,Xe.getErrorText(t.type),o.DiagnosticSeverity.Warning);s.push(r)})),n&&_e.sendDiagnostics({uri:e.uri,diagnostics:[...i,...s]}),c}}))}function Dt(e,t){let n=[];const r=t.filter((e=>"NoGlobalSubroutines"===e.type));return t=t.filter((e=>"NoGlobalSubroutines"!==e.type)),r.reverse(),t.push(...r),t.forEach((t=>{let r,i=vt(e,t);switch(t.type){case"UppercaseConstants":t.newValue&&(r=o.CodeAction.create("Convert constant name to uppercase",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"ForceOptionalParens":r=o.CodeAction.create("Add brackets around expression",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.insert(i.end,")"),o.TextEdit.insert(i.start,"(")]}},n.push(r);break;case"UselessOperationCheck":r=o.CodeAction.create("Remove operation code",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.del(i)]}},n.push(r);break;case"SpecificCasing":case"IncorrectVariableCase":case"UppercaseDirectives":t.newValue&&(r=o.CodeAction.create(`Correct casing to '${t.newValue}'`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"RequiresProcedureDescription":r=o.CodeAction.create("Add title and description",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.insert(i.start,"///\n// Title\n// Description\n///\n")]}},n.push(r);break;case"RequireBlankSpecial":t.newValue&&(r=o.CodeAction.create("Convert constant name to uppercase",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"SQLHostVarCheck":case"CopybookDirective":case"StringLiteralDupe":case"NoGlobalSubroutines":t.newValue&&(r=o.CodeAction.create(`Switch to '${t.newValue}'`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"IncludeMustBeRelative":t.newValue&&(r=o.CodeAction.create(`Correct path to ${t.newValue}`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"PrettyComments":t.newValue&&(r=o.CodeAction.create("Fix comment formatting",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r))}})),n}const wt=n(1017);var kt=n(7147),Tt=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const St=n(1017);let Et=!1,Pt=!1,_t=!1,xt=!1;_e.onInitialize((e=>{const n=e.capabilities;Et=!(!n.workspace||!n.workspace.configuration),Pt=!(!n.workspace||!n.workspace.workspaceFolders),_t=!!(n.textDocument&&n.textDocument.publishDiagnostics&&n.textDocument.publishDiagnostics.relatedInformation);const r={capabilities:{textDocumentSync:t.TextDocumentSyncKind.Incremental}};if(r.capabilities.documentSymbolProvider=!0,r.capabilities.definitionProvider=!0,r.capabilities.completionProvider={triggerCharacters:[" ",".",":"]},r.capabilities.hoverProvider=!0,r.capabilities.referencesProvider=!0,r.capabilities.implementationProvider=!0,r.capabilities.codeActionProvider=!0,r.capabilities.documentFormattingProvider={workDoneProgress:!0},Pt&&(r.capabilities.workspace={workspaceFolders:{supported:!0}}),Pt){const t=e.workspaceFolders;t&&t.length>0&&(xt=!0,r.capabilities.workspaceSymbolProvider=!0)}return console.log(`Project Mode enabled: ${xt}`),r})),_e.onInitialized((()=>{xt&&function(){Ze(this,null,(function*(){tt=!0,function(){Ze(this,null,(function*(){const e=yield _e.workspace.getWorkspaceFolders();let t=!1;if(e){let n=[];for(const r of e){const e=M.parse(r.uri).fsPath;console.log(`Starting search of: ${e}`);const o=Je.glob.sync("**/*.{rpgle,sqlrpgle,rpgleinc,rpgleh}",{cwd:e,absolute:!0,nocase:!0});console.log(`Found RPGLE files: ${o.length}`),n.push(...o.map((e=>M.from({scheme:"file",path:e}).toString())));const i=Je.glob.sync("**/iproj.json",{cwd:e,absolute:!0,nocase:!0});if(i.length>0){const e=i[0],n=M.from({scheme:"file",path:e}).toString();(yield nt(n)).big&&(t=!0)}}if(t&&console.log("Big mode detected!"),n.length<1e3||t)for(const e of n)yield rt(e);else console.log("Disabling project mode for large project."),tt=!1}}))}(),Ne.push((e=>{e.changes.forEach((e=>{const t=Ye.parse(e.uri),n=t.ext.toLowerCase();switch(e.type){case o.FileChangeType.Created:case o.FileChangeType.Changed:switch(n){case".rpgleinc":case".rpgleh":rt(e.uri),it=[];break;case".json":"iproj.json"===t.base&&nt(e.uri)}break;default:I.clearParsedCache(e.uri)}}))})),_e.onRequest("getCache",(e=>I.getParsedCache(e)))}))}()})),I.setTableFetch(((e,t=!1)=>Tt(void 0,null,(function*(){var n;return function(e,t=!1){let n={};return e.forEach((e=>{const{WHNAME:r,WHFLDT:o,WHFLDB:i,WHFLDD:s,WHFLDP:a,WHFTXT:c}=e,u=e.WHALIS?e.WHALIS.trim():void 0,l=t&&u||e.WHFLDE;if(""===l.trim())return;if(l.startsWith("*"))return;let d;n[r]?d=n[r]:(d=new w("struct"),d.name=r,n[r]=d);const p=new w("subitem");p.name=l;const h=[];"Y"===e.WHVARL&&h.push("VARYING"),p.keywords=[N({type:o,len:0===s?i:s,decimals:a,keywords:h})],p.description=c.trim(),d.subItems.push(p)})),Object.values(n)}(yield(n=e,_e.sendRequest("getObject",n)),t)}))));let Nt={};I.setIncludeFileFetch(((e,t)=>Tt(void 0,null,(function*(){const n=M.parse(e),r=n.path;let o,i;if(!Nt[t]){Nt[t]=!0;const s=t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"'),a=s||t.includes("/")&&!t.includes(",");if(o=t,s&&(o=o.substring(1,o.length-1)),a)if(["streamfile","member"].includes(n.scheme))if(o.startsWith("/"))i=M.from({scheme:"streamfile",path:o}).toString();else{const t=[o,`${o}.rpgleinc`,`${o}.rpgle`],n=yield Le(e,t);n&&(i=M.from({scheme:"streamfile",path:n}).toString())}else{const t=yield _e.workspace.getWorkspaceFolders();let s;if(t&&(s=t.find((e=>r.startsWith(M.parse(e.uri).path)))),tt?i=yield Oe(o,n.scheme):(s&&(o=St.posix.join(M.parse(s.uri).path,o)),i=(0,kt.existsSync)(o)?M.from({scheme:n.scheme,path:o}).toString():void 0),!i){const t=yield Le(e,[o]);t&&(i=M.from({scheme:"streamfile",path:t}).toString())}}else{const r=ft(t);let s=r.file||"QRPGLESRC",a=r.name;if(r.library)o=["",...r.asp?[r.asp]:[],r.library,s,a+".rpgleinc"].join("/"),o=M.from({scheme:"member",path:o}).toString(),i=yield Oe(o,n.scheme);else{const t=yield function(e,t,n){return Pe(this,null,(function*(){const r=n+t;if(Ie[e]&&Ie[e][r])return Ie[e][r];const o=yield xe.add((()=>_e.sendRequest("memberResolve",[t,n])));return o&&(Ie[e]||(Ie[e]={}),Ie[e][r]=o),o}))}(e,a,s);t&&(o=["",...r.asp?[r.asp]:[],t.library,t.file,t.name+".rpgleinc"].join("/"),i=M.from({scheme:"member",path:o}).toString())}}if(Nt[t]=!1,i){const e=yield qe(i);if(e)return{found:!0,uri:i,lines:e.split("\n")}}}return Nt[t]=!1,{found:!1,uri:i}})))),_e.onDocumentSymbol((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=[],r=q.get(t);if(r){const e=yield I.getDocs(t,r.getText()),i=e=>{const n=[];return e.procedures.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Function,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0));e.scope&&(r.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),r.children.push(...i(e.scope))),n.push(r)})),n.push(...e.subroutines.filter((e=>e.position&&e.position.path===t)).filter((e=>e.range.start)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Function,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0)))),...e.variables.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Variable,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),...e.constants.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Constant,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0))))),e.files.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.File,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0));r.children=[],e.subItems.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const n=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Struct,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0));n.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),r.children&&r.children.push(n)})),n.push(r)})),e.structs.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Struct,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0));r.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),n.push(r)})),n};e&&n.push(...i(e))}return n},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onDefinition((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=e.position.line,r=q.get(t);if(r){const i=yield I.getDocs(t,r.getText());if(i){const s=r.getText(o.Range.create(n,0,n,200)),a=O.getIncludeFromDirective(s);if(a){const e=yield I.includeFileFetch(t,a);if(e.found&&e.uri)return o.Location.create(e.uri,o.Range.create(0,0,0,0))}else{const t=A(r,e.position);if(t){const e=i.findDefinition(n,t);if(e)return o.Location.create(e.position.path,o.Range.create(e.position.line,0,e.position.line,0))}}}}return null},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onCompletion((function(e){return t=this,null,n=function*(){var t;const n=[],r=e.position.line,i=null==(t=e.context)?void 0:t.triggerCharacter,s=e.textDocument.uri,a=q.get(s);if(a){const t=yield I.getDocs(s,a.getText());if(t){const c="**FREE"===a.getText(o.Range.create(0,0,0,6)).toUpperCase(),u=t.procedures.find(((e,n)=>r>=e.range.start&&(r<=e.range.end+1||n===t.procedures.length-1))),l=a.getText(o.Range.create(e.position.line,0,e.position.line,200));if("."===i){let r=o.Position.create(e.position.line,e.position.character-2),i=A(a,r);if(i){const t=l.lastIndexOf("(",r.character);t>-1&&(r=o.Position.create(e.position.line,t-1),i=A(a,r))}if(i){i=i.toUpperCase();const e=[u&&u.scope?u.scope.parameters.find((e=>e.name.toUpperCase()===i&&e.subItems.length>0)):void 0,u&&u.scope?u.scope.structs.find((e=>e.name.toUpperCase()===i)):void 0,t.structs.find((e=>e.name.toUpperCase()===i))].find((e=>e));e&&e.keyword.QUALIFIED&&n.push(...e.subItems.map((t=>{const n=o.CompletionItem.create(t.name);return n.kind=o.CompletionItemKind.Property,n.insertText=t.name,n.detail=t.keywords.join(" "),n.documentation=t.description+""+(e?` (${e.name})`:""),n})))}}else{const e=l.toUpperCase();if(tt&&(e.includes("/COPY")||e.includes("/INCLUDE"))){const e=yield st(s);n.push(...e.map((e=>{const t=ut.basename(e.uri),n=o.CompletionItem.create(t);return n.kind=o.CompletionItemKind.File,n.insertText=`'${e.relative}'`,n.detail=e.relative,n})))}else if(l.trimStart().startsWith("//"))n.push(...H);else{const e=e=>{for(const t of e.parameters){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Variable,e.insertText=t.name,e.detail=["parameter",...t.keywords].join(" "),e.documentation=t.description,n.push(e)}for(const t of e.procedures){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Function,e.insertTextFormat=o.InsertTextFormat.Snippet,e.insertText=`${t.name}(${t.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}for(const t of e.subroutines){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Function,e.insertText=`${t.name}`,e.documentation=t.description,n.push(e)}for(const t of e.variables){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Variable,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}e.files.forEach((e=>{const t=o.CompletionItem.create(`${e.name}`);t.kind=o.CompletionItemKind.File,t.insertText=`${e.name}`,t.detail=e.keywords.join(" "),t.documentation=e.description,n.push(t);for(const t of e.subItems){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Struct,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e),t.keyword.QUALIFIED||t.subItems.forEach((e=>{const r=o.CompletionItem.create(`${e.name}`);r.kind=o.CompletionItemKind.Property,r.insertText=`${e.name}`,r.detail=e.keywords.join(" "),r.documentation=e.description+` (${t.name})`,n.push(r)}))}}));for(const t of e.structs){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Struct,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e),t.keyword.QUALIFIED||t.subItems.forEach((e=>{const r=o.CompletionItem.create(`${e.name}`);r.kind=o.CompletionItemKind.Property,r.insertText=`${e.name}`,r.detail=e.keywords.join(" "),r.documentation=e.description+` (${t.name})`,n.push(r)}))}for(const t of e.constants){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Constant,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}};if(e(t),u&&u.scope&&e(u.scope),c){const e=s.toLowerCase().endsWith(".rpgleinc"),r=t.getDefinitionBlockEnd(a.uri)+1,i=o.Range.create(r,0,r,0);[...F,...ct()].filter((e=>!t.procedures.some((t=>{const n=e.name.toUpperCase();if(t.name.toUpperCase()===n)return!0;let r=t.keyword.EXTPROC||t.keyword.EXTPGM;return"string"==typeof r&&(r.startsWith("'")&&(r=r.substring(1)),r.endsWith("'")&&(r=r.substring(0,r.length-1)),r.toUpperCase()===n)||void 0}))&&!t.structs.some((t=>t.name.toUpperCase()===e.name.toUpperCase())))).forEach((t=>{const r=o.CompletionItem.create(t.name);r.kind=lt[t.type],r.detail=`${t.detail} (auto-import)`,r.documentation={kind:"markdown",value:[t.description,t.example?["---","","```rpgle",t.example.join(dt),"```"].join(dt):void 0].filter((e=>e)).join(dt+dt)},r.insertTextFormat=o.InsertTextFormat.Snippet,e?r.insertText=t.prototype.join(dt):(r.insertText=t.insertText,r.additionalTextEdits=[{range:i,newText:dt+t.prototype.join(dt)+dt}]),n.push(r)}))}}}}}return n},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onHover((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=e.position.line,r=q.get(t);if(r){const i=yield I.getDocs(t,r.getText());if(i){const s=A(r,e.position);if(!s)return;const a=i.procedures.find((e=>e.name.toUpperCase()===s.toUpperCase()));if(a){let e="",n=a.keywords.filter((e=>"EXTPROC"!==e));0===n.length&&(n=["void"]);const r=a.tags.find((e=>"return"===e.tag)),i=a.tags.find((e=>"deprecated"===e.tag));i&&(e+=`**Deprecated:** ${i.content}\n\n`),e+=`\`\`\`vb\n${a.name}(`,a.subItems.length>0&&(e+=`\n ${a.subItems.map((e=>`${e.name}: ${e.keywords.join(" ").trim()}`)).join(",\n ")}\n`),e+=`): ${n.join(" ")}\n\`\`\` \n`,a.description&&(e+=`${a.description}\n\n`);const s=a.tags.filter((e=>"param"===e.tag));return e+=a.subItems.map(((e,t)=>`*@param* \`${e.name.replace(new RegExp("\\*","g"),"\\*")}\` ${s[t]?s[t].content:e.description}`)).join("\n\n"),r&&(e+=`\n\n*@returns* ${r.content}`),a.position&&t!==a.position.path&&(e+=`\n\n*@file* \`${a.position.path}:${a.position.line+1}\``),{contents:{kind:o.MarkupKind.Markdown,value:e}}}{const e=i.procedures.find((e=>n>=e.range.start&&n<=e.range.end));let a;if(e&&e.scope&&(a=e.scope.find(s)),a||(a=i.find(s)),a){let e=`\`${a.name}\`: \`${a.keywords.join(" ").trim()}\``;return a.position&&t!==a.position.path&&(e+=`\n\n*@file* \`${a.position.path}:${a.position.line+1}\``),{contents:{kind:o.MarkupKind.Markdown,value:e}}}{const e=r.getText(o.Range.create(n,0,n,200)),i=O.getIncludeFromDirective(e);if(i){const e=yield I.includeFileFetch(t,i);let n=i;if(e.found&&e.uri){const t=M.parse(e.uri);if("member"===t.scheme){const e=t.path.lastIndexOf(".");n=e>=0?t.path.substring(0,e):t.path,n.startsWith("/")&&(n=n.substring(1))}else n=t.path}return{contents:{kind:o.MarkupKind.Markdown,value:(e.found?`\`${n}\``:i)+` (${e.found?"found":"not found"})`}}}}}}}},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onReferences((function(e){return t=this,null,n=function*(){var t;const n=e.textDocument.uri,r=e.position,i=q.get(n);if(i){const e="**FREE"===i.getText(o.Range.create(0,0,0,6)).toUpperCase();let s=null==(t=A(i,r))?void 0:t.trim();if(s){if(s.endsWith(";")){const e=s.split(";");s=e[0]}const t=yield I.getDocs(n,i.getText());if(t){e&&Xe.getErrors({uri:n,content:i.getText()},{CollectReferences:!0},t);const a=t.findDefinition(r.line,s);if(a)return tt?yield function(e){return((e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())})))(this,null,(function*(){let t=[];if(tt){const n=Object.keys(I.parsedCache),r=q.get(e.position.path);if(r&&t.push(...e.references.map((t=>o.Location.create(e.position.path,vt(r,t))))),e.keyword.EXPORT){const r=e.name.toUpperCase();for(const e of n){const n=q.get(e);n&&I.getParsedCache(e).procedures.forEach((i=>{let s=!1;const a=i.keyword.EXTPROC;var c;a?!0===a?i.name.toUpperCase()===r&&(s=!0):(c=a,"'"===c[0]&&(c=c.substring(1)),"'"===c[c.length-1]&&(c=c.substring(0,c.length-1)),c).toUpperCase()===r&&(s=!0):i.keyword.EXPORT||i.name.toUpperCase()!==r||(s=!0),s&&(t.some((t=>t.uri===e))||t.push(o.Location.create(i.position.path,o.Range.create(i.position.line,0,i.position.line,0)),...i.references.map((t=>o.Location.create(e,vt(n,t))))))}))}}else{const r=e.position.path;for(const i of n){const n=yield ot(i);if(n){const s=I.getParsedCache(i),a=s.includes.find((e=>e.toPath===r));if(a){const r=s.find(e.name);r&&r.position.path===e.position.path&&("**FREE"!==n.getText(o.Range.create(0,0,0,6)).toUpperCase()||0===r.references.length?t.push(o.Location.create(i,o.Range.create(a.line,0,a.line,0))):t.push(...r.references.map((e=>o.Location.create(i,vt(n,e))))))}}}}}return t}))}(a):a.references.map((e=>o.Location.create(a.position.path,vt(i,e))))}}}},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onWorkspaceSymbol((function(e){if(console.log(e.query),tt){const e=Object.keys(I.parsedCache);let t=[];return e.forEach((e=>{const n=wt.basename(e);if(n.toLowerCase().endsWith(".rpgleinc"))t.push(o.WorkspaceSymbol.create(n,o.SymbolKind.File,e,o.Range.create(0,0,0,0)));else{const r=I.getParsedCache(e);r&&(r.keyword.MAIN?t.push(o.WorkspaceSymbol.create(n,o.SymbolKind.Method,e,o.Range.create(0,0,0,0))):r.keyword.NOMAIN&&r.procedures.forEach((n=>{n.keyword.EXPORT&&t.push(o.WorkspaceSymbol.create(n.name,o.SymbolKind.Function,e,o.Range.create(n.position.line,0,n.position.line,0)))})))}})),t}})),_e.onImplementation((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=q.get(t);if(n){const i=A(n,e.position);if(i){const e=i.toUpperCase();if(tt){const t=Object.keys(I.parsedCache);for(const n of t){const t=I.getParsedCache(n);for(const n of t.procedures)if(n.keyword.EXPORT&&n.name.toUpperCase()===e)return o.Location.create(n.position.path,o.Range.create(n.position.line,0,n.position.line,0))}}const n=I.getParsedCache(t);if(n){const e=n.keyword.BNDDIR;if("string"==typeof e){const t=e.split(":").map((e=>{return"'"===(t=e)[0]&&(t=t.substring(1)),"'"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t;var t})).map((e=>{const t=e.split("/");return{name:t[t.length-1],lib:t[t.length-2]}})),n=yield(r={symbol:i,binders:t},_e.sendRequest("symbolLookup",r));if(n){const e=Object.keys(n).find((e=>e.toUpperCase()===i.toUpperCase()));if(e){const t=n[e],r=yield Promise.allSettled(t.map((e=>Oe(e))));for(const e of r)if("fulfilled"===e.status&&e.value){const t=I.getParsedCache(e.value);if(t){const e=t.find(i);return o.Location.create(e.position.path,o.Range.create(e.position.line,0,e.position.line,0))}}}}}}}}var r},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),function(e){e.onCodeAction(pt),e.onDocumentFormatting(ht),Ne.push((e=>{let t=!1;e.changes.forEach((e=>{const n=e.uri.toLowerCase();if("rpglint.json"===gt.basename(n)){const e=Object.keys(yt).find((e=>e.toLowerCase()===n));e&&yt[e]&&delete yt[e],bt={},t=!0}})),t&&q.all().forEach((e=>{"rpgle"===e.languageId&&I.getDocs(e.uri,e.getText(),{withIncludes:!0,ignoreCache:!0}).then((t=>{t&&Ct(e,t)}))}))})),q.onDidOpen((e=>mt(this,null,(function*(){const t=e.document.uri,n=M.parse(t);["member","streamfile"].includes(n.scheme)&&(bt={},yt={})})))),q.onDidClose((e=>mt(this,null,(function*(){const t=e.document.uri;Ie[t]={},Ae[t]={}}))))}(_e),q.onDidChangeContent((e=>{I.getDocs(e.document.uri,e.document.getText(),{withIncludes:!0,ignoreCache:!0}).then((t=>{t&&Ct(e.document,t)}))})),q.listen(_e),_e.listen()})();var o=exports;for(var i in r)o[i]=r[i];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
s [Error]: Request streamfileResolve failed with message: Cannot read properties of undefined (reading 'homeDirectory')
at /Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1:51163
at /Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1:51457
at Immediate.<anonymous> (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1:51819)
at process.processImmediate (node:internal/timers:466:21) {
code: -32603,
data: undefined
}
[Info - 3:08:00 PM] Connection to server got closed. Server will restart.
Project Mode enabled: true
Validating file from server: rpglint.json
Starting search of: /Users/adamshirley/apps/k3s/K3S-Replenish-RPG
Found RPGLE files: 1079
Validating file from server: rpglint.json
/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1
(()=>{var e={5623:e=>{"use strict";function t(e,t,o){e instanceof RegExp&&(e=n(e,o)),t instanceof RegExp&&(t=n(t,o));var i=r(e,t,o);return i&&{start:i[0],end:i[1],pre:o.slice(0,i[0]),body:o.slice(i[0]+e.length,i[1]),post:o.slice(i[1]+t.length)}}function n(e,t){var n=t.match(e);return n?n[0]:null}function r(e,t,n){var r,o,i,s,a,c=n.indexOf(e),u=n.indexOf(t,c+1),l=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],i=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(e,l+1)):1==r.length?a=[r.pop(),u]:((o=r.pop())<i&&(i=o,s=u),u=n.indexOf(t,l+1)),l=c<u&&c>=0?c:u;r.length&&(a=[i,s])}return a}e.exports=t,t.range=r},1048:e=>{e.exports=function(e,n){for(var r=[],o=0;o<e.length;o++){var i=n(e[o],o);t(i)?r.push.apply(r,i):r.push(i)}return r};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,s=new Array(i);o<i;o++)s[o]=r[o].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,o,i,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,o),!0;case 5:return l.fn.call(l.context,t,r,o,i),!0;case 6:return l.fn.call(l.context,t,r,o,i,s),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,o);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||r&&a.context!==r||s(this,i);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||o&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},7334:(e,t,n)=>{e.exports=l,l.realpath=l,l.sync=d,l.realpathSync=d,l.monkeypatch=function(){r.realpath=l,r.realpathSync=d},l.unmonkeypatch=function(){r.realpath=o,r.realpathSync=i};var r=n(7147),o=r.realpath,i=r.realpathSync,s=process.version,a=/^v[0-5]\./.test(s),c=n(7059);function u(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function l(e,t,n){if(a)return o(e,t,n);"function"==typeof t&&(n=t,t=null),o(e,t,(function(r,o){u(r)?c.realpath(e,t,n):n(r,o)}))}function d(e,t){if(a)return i(e,t);try{return i(e,t)}catch(n){if(u(n))return c.realpathSync(e,t);throw n}}},7059:(e,t,n)=>{var r=n(1017),o="win32"===process.platform,i=n(7147),s=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);if(r.normalize,o)var a=/(.*?)(?:[\/\\]+|$)/g;else a=/(.*?)(?:[\/]+|$)/g;if(o)var c=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else c=/^[\/]*/;t.realpathSync=function(e,t){if(e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var n,s,u,l,d=e,p={},h={};function f(){var t=c.exec(e);n=t[0].length,s=t[0],u=t[0],l="",o&&!h[u]&&(i.lstatSync(u),h[u]=!0)}for(f();n<e.length;){a.lastIndex=n;var m=a.exec(e);if(l=s,s+=m[0],u=l+m[1],n=a.lastIndex,!(h[u]||t&&t[u]===u)){var g;if(t&&Object.prototype.hasOwnProperty.call(t,u))g=t[u];else{var y=i.lstatSync(u);if(!y.isSymbolicLink()){h[u]=!0,t&&(t[u]=u);continue}var v=null;if(!o){var b=y.dev.toString(32)+":"+y.ino.toString(32);p.hasOwnProperty(b)&&(v=p[b])}null===v&&(i.statSync(u),v=i.readlinkSync(u)),g=r.resolve(l,v),t&&(t[u]=g),o||(p[b]=v)}e=r.resolve(g,e.slice(n)),f()}}return t&&(t[d]=e),e},t.realpath=function(e,t,n){if("function"!=typeof n&&(n=function(e){return"function"==typeof e?e:function(){var e;if(s){var t=new Error;e=function(e){e&&(t.message=e.message,n(e=t))}}else e=n;return e;function n(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}(t),t=null),e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(n.bind(null,null,t[e]));var u,l,d,p,h=e,f={},m={};function g(){var t=c.exec(e);u=t[0].length,l=t[0],d=t[0],p="",o&&!m[d]?i.lstat(d,(function(e){if(e)return n(e);m[d]=!0,y()})):process.nextTick(y)}function y(){if(u>=e.length)return t&&(t[h]=e),n(null,e);a.lastIndex=u;var r=a.exec(e);return p=l,l+=r[0],d=p+r[1],u=a.lastIndex,m[d]||t&&t[d]===d?process.nextTick(y):t&&Object.prototype.hasOwnProperty.call(t,d)?R(t[d]):i.lstat(d,v)}function v(e,r){if(e)return n(e);if(!r.isSymbolicLink())return m[d]=!0,t&&(t[d]=d),process.nextTick(y);if(!o){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(f.hasOwnProperty(s))return b(null,f[s],d)}i.stat(d,(function(e){if(e)return n(e);i.readlink(d,(function(e,t){o||(f[s]=t),b(e,t)}))}))}function b(e,o,i){if(e)return n(e);var s=r.resolve(p,o);t&&(t[i]=s),R(s)}function R(t){e=r.resolve(t,e.slice(u)),g()}g()}},6772:(e,t,n)=>{function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.setopts=function(e,t,n){if(n||(n={}),n.matchBase&&-1===t.indexOf("/")){if(n.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!n.silent,e.pattern=t,e.strict=!1!==n.strict,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0),e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.fs=n.fs||o,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(l))}(e,n),e.changedCwd=!1;var s=process.cwd();r(n,"cwd")?(e.cwd=i.resolve(n.cwd),e.changedCwd=e.cwd!==s):e.cwd=s,e.root=n.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=a(e.cwd)?e.cwd:d(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,n.allowWindowsEscape=!1,e.minimatch=new c(t,n),e.options=e.minimatch.options},t.ownProp=r,t.makeAbs=d,t.finish=function(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,o=e.matches.length;r<o;r++){var i=e.matches[r];if(i&&0!==Object.keys(i).length){var s=Object.keys(i);t?n.push.apply(n,s):s.forEach((function(e){n[e]=!0}))}else if(e.nonull){var a=e.minimatch.globSet[r];t?n.push(a):n[a]=!0}}if(t||(n=Object.keys(n)),e.nosort||(n=n.sort(u)),e.mark){for(r=0;r<n.length;r++)n[r]=e._mark(n[r]);e.nodir&&(n=n.filter((function(t){var n=!/\/$/.test(t),r=e.cache[t]||e.cache[d(e,t)];return n&&r&&(n="DIR"!==r&&!Array.isArray(r)),n})))}e.ignore.length&&(n=n.filter((function(t){return!p(e,t)}))),e.found=n},t.mark=function(e,t){var n=d(e,t),r=e.cache[n],o=t;if(r){var i="DIR"===r||Array.isArray(r),s="/"===t.slice(-1);if(i&&!s?o+="/":!i&&s&&(o=o.slice(0,-1)),o!==t){var a=d(e,o);e.statCache[a]=e.statCache[n],e.cache[a]=e.cache[n]}}return o},t.isIgnored=p,t.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(t))}))};var o=n(7147),i=n(1017),s=n(6522),a=n(4095),c=s.Minimatch;function u(e,t){return e.localeCompare(t,"en")}function l(e){var t=null;if("/**"===e.slice(-3)){var n=e.replace(/(\/\*\*)+$/,"");t=new c(n,{dot:!0})}return{matcher:new c(e,{dot:!0}),gmatcher:t}}function d(e,t){var n=t;return n="/"===t.charAt(0)?i.join(e.root,t):a(t)||""===t?t:e.changedCwd?i.resolve(e.cwd,t):i.resolve(t),"win32"===process.platform&&(n=n.replace(/\\/g,"/")),n}function p(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))}))}},2884:(e,t,n)=>{e.exports=v;var r=n(7334),o=n(6522),i=(o.Minimatch,n(4378)),s=n(2361).EventEmitter,a=n(1017),c=n(9491),u=n(4095),l=n(4751),d=n(6772),p=d.setopts,h=d.ownProp,f=n(7844),m=(n(3837),d.childrenIgnored),g=d.isIgnored,y=n(778);function v(e,t,n){if("function"==typeof t&&(n=t,t={}),t||(t={}),t.sync){if(n)throw new TypeError("callback provided to sync glob");return l(e,t)}return new R(e,t,n)}v.sync=l;var b=v.GlobSync=l.GlobSync;function R(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&t.sync){if(n)throw new TypeError("callback provided to sync glob");return new b(e,t)}if(!(this instanceof R))return new R(e,t,n);p(this,e,t),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=new Array(r),"function"==typeof n&&(n=y(n),this.on("error",n),this.on("end",(function(e){n(null,e)})));var o=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===r)return a();for(var i=!0,s=0;s<r;s++)this._process(this.minimatch.set[s],s,!1,a);function a(){--o._processing,o._processing<=0&&(i?process.nextTick((function(){o._finish()})):o._finish())}i=!1}v.glob=v,v.hasMagic=function(e,t){var n=function(e,t){if(null===t||"object"!=typeof t)return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}({},t);n.noprocess=!0;var r=new R(e,n).minimatch.set;if(!e)return!1;if(r.length>1)return!0;for(var o=0;o<r[0].length;o++)if("string"!=typeof r[0][o])return!0;return!1},v.Glob=R,i(R,s),R.prototype._finish=function(){if(c(this instanceof R),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();d.finish(this),this.emit("end",this.found)}},R.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,n=0;n<this.matches.length;n++)this._realpathSet(n,r)}function r(){0==--e&&t._finish()}},R.prototype._realpathSet=function(e,t){var n=this.matches[e];if(!n)return t();var o=Object.keys(n),i=this,s=o.length;if(0===s)return t();var a=this.matches[e]=Object.create(null);o.forEach((function(n,o){n=i._makeAbs(n),r.realpath(n,i.realpathCache,(function(r,o){r?"stat"===r.syscall?a[n]=!0:i.emit("error",r):a[o]=!0,0==--s&&(i.matches[e]=a,t())}))}))},R.prototype._mark=function(e){return d.mark(this,e)},R.prototype._makeAbs=function(e){return d.makeAbs(this,e)},R.prototype.abort=function(){this.aborted=!0,this.emit("abort")},R.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},R.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var n=e[t];this._emitMatch(n[0],n[1])}}if(this._processQueue.length){var r=this._processQueue.slice(0);for(this._processQueue.length=0,t=0;t<r.length;t++){var o=r[t];this._processing--,this._process(o[0],o[1],o[2],o[3])}}}},R.prototype._process=function(e,t,n,r){if(c(this instanceof R),c("function"==typeof r),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,n,r]);else{for(var i,s=0;"string"==typeof e[s];)s++;switch(s){case e.length:return void this._processSimple(e.join("/"),t,r);case 0:i=null;break;default:i=e.slice(0,s).join("/")}var a,l=e.slice(s);null===i?a=".":u(i)||u(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(i&&u(i)||(i="/"+i),a=i):a=i;var d=this._makeAbs(a);if(m(this,a))return r();l[0]===o.GLOBSTAR?this._processGlobStar(i,a,d,l,t,n,r):this._processReaddir(i,a,d,l,t,n,r)}},R.prototype._processReaddir=function(e,t,n,r,o,i,s){var a=this;this._readdir(n,i,(function(c,u){return a._processReaddir2(e,t,n,r,o,i,u,s)}))},R.prototype._processReaddir2=function(e,t,n,r,o,i,s,c){if(!s)return c();for(var u=r[0],l=!!this.minimatch.negate,d=u._glob,p=this.dot||"."===d.charAt(0),h=[],f=0;f<s.length;f++)("."!==(g=s[f]).charAt(0)||p)&&(l&&!e?!g.match(u):g.match(u))&&h.push(g);var m=h.length;if(0===m)return c();if(1===r.length&&!this.mark&&!this.stat){for(this.matches[o]||(this.matches[o]=Object.create(null)),f=0;f<m;f++){var g=h[f];e&&(g="/"!==e?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=a.join(this.root,g)),this._emitMatch(o,g)}return c()}for(r.shift(),f=0;f<m;f++)g=h[f],e&&(g="/"!==e?e+"/"+g:e+g),this._process([g].concat(r),o,i,c);c()},R.prototype._emitMatch=function(e,t){if(!this.aborted&&!g(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var n=u(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0;var o=this.statCache[n];o&&this.emit("stat",t,o),this.emit("match",t)}}},R.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var n=this,r=f("lstat\0"+e,(function(r,o){if(r&&"ENOENT"===r.code)return t();var i=o&&o.isSymbolicLink();n.symlinks[e]=i,i||!o||o.isDirectory()?n._readdir(e,!1,t):(n.cache[e]="FILE",t())}));r&&n.fs.lstat(e,r)}},R.prototype._readdir=function(e,t,n){if(!this.aborted&&(n=f("readdir\0"+e+"\0"+t,n))){if(t&&!h(this.symlinks,e))return this._readdirInGlobStar(e,n);if(h(this.cache,e)){var r=this.cache[e];if(!r||"FILE"===r)return n();if(Array.isArray(r))return n(null,r)}this.fs.readdir(e,function(e,t,n){return function(r,o){r?e._readdirError(t,r,n):e._readdirEntries(t,o,n)}}(this,e,n))}},R.prototype._readdirEntries=function(e,t,n){if(!this.aborted){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var o=t[r];o="/"===e?e+o:e+"/"+o,this.cache[o]=!0}return this.cache[e]=t,n(null,t)}},R.prototype._readdirError=function(e,t,n){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var o=new Error(t.code+" invalid cwd "+this.cwd);o.path=this.cwd,o.code=t.code,this.emit("error",o),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return n()}},R.prototype._processGlobStar=function(e,t,n,r,o,i,s){var a=this;this._readdir(n,i,(function(c,u){a._processGlobStar2(e,t,n,r,o,i,u,s)}))},R.prototype._processGlobStar2=function(e,t,n,r,o,i,s,a){if(!s)return a();var c=r.slice(1),u=e?[e]:[],l=u.concat(c);this._process(l,o,!1,a);var d=this.symlinks[n],p=s.length;if(d&&i)return a();for(var h=0;h<p;h++)if("."!==s[h].charAt(0)||this.dot){var f=u.concat(s[h],c);this._process(f,o,!0,a);var m=u.concat(s[h],r);this._process(m,o,!0,a)}a()},R.prototype._processSimple=function(e,t,n){var r=this;this._stat(e,(function(o,i){r._processSimple2(e,t,o,i,n)}))},R.prototype._processSimple2=function(e,t,n,r,o){if(this.matches[t]||(this.matches[t]=Object.create(null)),!r)return o();if(e&&u(e)&&!this.nomount){var i=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=a.join(this.root,e):(e=a.resolve(this.root,e),i&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),o()},R.prototype._stat=function(e,t){var n=this._makeAbs(e),r="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&h(this.cache,n)){var o=this.cache[n];if(Array.isArray(o)&&(o="DIR"),!r||"DIR"===o)return t(null,o);if(r&&"FILE"===o)return t()}var i=this.statCache[n];if(void 0!==i){if(!1===i)return t(null,i);var s=i.isDirectory()?"DIR":"FILE";return r&&"FILE"===s?t():t(null,s,i)}var a=this,c=f("stat\0"+n,(function(r,o){if(o&&o.isSymbolicLink())return a.fs.stat(n,(function(r,i){r?a._stat2(e,n,null,o,t):a._stat2(e,n,r,i,t)}));a._stat2(e,n,r,o,t)}));c&&a.fs.lstat(n,c)},R.prototype._stat2=function(e,t,n,r,o){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,o();var i="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return o(null,!1,r);var s=!0;return r&&(s=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||s,i&&"FILE"===s?o():o(null,s,r)}},5146:(e,t,n)=>{var r=n(1048),o=n(5623);e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),y(function(e){return e.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(a).split("\\,").join(c).split("\\.").join(u)}(e),!0).map(d)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",c="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function d(e){return e.split(i).join("\\").split(s).join("{").split(a).join("}").split(c).join(",").split(u).join(".")}function p(e){if(!e)return[""];var t=[],n=o("{","}",e);if(!n)return e.split(",");var r=n.pre,i=n.body,s=n.post,a=r.split(",");a[a.length-1]+="{"+i+"}";var c=p(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),t.push.apply(t,a),t}function h(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function m(e,t){return e<=t}function g(e,t){return e>=t}function y(e,t){var n=[],i=o("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var s,c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),d=c||u,v=i.body.indexOf(",")>=0;if(!d&&!v)return i.post.match(/,.*\}/)?y(e=i.pre+"{"+i.body+a+i.post):[e];if(d)s=i.body.split(/\.\./);else if(1===(s=p(i.body)).length&&1===(s=y(s[0],!1).map(h)).length)return(C=i.post.length?y(i.post,!1):[""]).map((function(e){return i.pre+s[0]+e}));var b,R=i.pre,C=i.post.length?y(i.post,!1):[""];if(d){var D=l(s[0]),w=l(s[1]),k=Math.max(s[0].length,s[1].length),T=3==s.length?Math.abs(l(s[2])):1,S=m;w<D&&(T*=-1,S=g);var E=s.some(f);b=[];for(var P=D;S(P,w);P+=T){var _;if(u)"\\"===(_=String.fromCharCode(P))&&(_="");else if(_=String(P),E){var x=k-_.length;if(x>0){var N=new Array(x+1).join("0");_=P<0?"-"+N+_.slice(1):N+_}}b.push(_)}}else b=r(s,(function(e){return y(e,!1)}));for(var O=0;O<b.length;O++)for(var q=0;q<C.length;q++){var I=R+b[O]+C[q];(!t||d||I)&&n.push(I)}return n}},6522:(e,t,n)=>{e.exports=p,p.Minimatch=h;var r=function(){try{return n(1017)}catch(e){}}()||{sep:"/"};p.sep=r.sep;var o=p.GLOBSTAR=h.GLOBSTAR={},i=n(5146),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",c=a+"*?",u="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{}),l=/\/+/;function d(e,t){t=t||{};var n={};return Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function p(e,t,n){return m(t),n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&new h(t,n).match(e)}function h(e,t){if(!(this instanceof h))return new h(e,t);m(e),t||(t={}),e=e.trim(),t.allowWindowsEscape||"/"===r.sep||(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}function f(e,t){return t||(t=this instanceof h?this.options:{}),e=void 0===e?this.pattern:e,m(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:i(e)}p.filter=function(e,t){return t=t||{},function(n,r,o){return p(n,e,t)}},p.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return p;var t=p,n=function(n,r,o){return t(n,r,d(e,o))};return(n.Minimatch=function(n,r){return new t.Minimatch(n,d(e,r))}).defaults=function(n){return t.defaults(d(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,d(e,r))},n.defaults=function(n){return t.defaults(d(e,n))},n.makeRe=function(n,r){return t.makeRe(n,d(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,d(e,r))},n.match=function(n,r,o){return t.match(n,r,d(e,o))},n},h.defaults=function(e){return p.defaults(e).Minimatch},h.prototype.debug=function(){},h.prototype.make=function(){var e=this.pattern,t=this.options;if(t.nocomment||"#"!==e.charAt(0))if(e){this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map((function(e){return e.split(l)})),this.debug(this.pattern,n),n=n.map((function(e,t,n){return e.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,n),this.set=n}else this.empty=!0;else this.comment=!0},h.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=0;if(!this.options.nonegate){for(var r=0,o=e.length;r<o&&"!"===e.charAt(r);r++)t=!t,n++;n&&(this.pattern=e.substr(n)),this.negate=t}},p.braceExpand=function(e,t){return f(e,t)},h.prototype.braceExpand=f;var m=function(e){if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};h.prototype.parse=function(e,t){m(e);var n=this.options;if("**"===e){if(!n.noglobstar)return o;e="*"}if(""===e)return"";var r,i="",l=!!n.nocase,d=!1,p=[],h=[],f=!1,y=-1,v=-1,b="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",R=this;function C(){if(r){switch(r){case"*":i+=c,l=!0;break;case"?":i+=a,l=!0;break;default:i+="\\"+r}R.debug("clearStateChar %j %j",r,i),r=!1}}for(var D,w=0,k=e.length;w<k&&(D=e.charAt(w));w++)if(this.debug("%s\t%s %s %j",e,w,i,D),d&&u[D])i+="\\"+D,d=!1;else switch(D){case"/":return!1;case"\\":C(),d=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,w,i,D),f){this.debug(" in class"),"!"===D&&w===v+1&&(D="^"),i+=D;continue}R.debug("call clearStateChar %j",r),C(),r=D,n.noext&&C();continue;case"(":if(f){i+="(";continue}if(!r){i+="\\(";continue}p.push({type:r,start:w-1,reStart:i.length,open:s[r].open,close:s[r].close}),i+="!"===r?"(?:(?!(?:":"(?:",this.debug("plType %j %j",r,i),r=!1;continue;case")":if(f||!p.length){i+="\\)";continue}C(),l=!0;var T=p.pop();i+=T.close,"!"===T.type&&h.push(T),T.reEnd=i.length;continue;case"|":if(f||!p.length||d){i+="\\|",d=!1;continue}C(),i+="|";continue;case"[":if(C(),f){i+="\\"+D;continue}f=!0,v=w,y=i.length,i+=D;continue;case"]":if(w===v+1||!f){i+="\\"+D,d=!1;continue}var S=e.substring(v+1,w);try{RegExp("["+S+"]")}catch(e){var E=this.parse(S,g);i=i.substr(0,y)+"\\["+E[0]+"\\]",l=l||E[1],f=!1;continue}l=!0,f=!1,i+=D;continue;default:C(),d?d=!1:!u[D]||"^"===D&&f||(i+="\\"),i+=D}for(f&&(S=e.substr(v+1),E=this.parse(S,g),i=i.substr(0,y)+"\\["+E[0],l=l||E[1]),T=p.pop();T;T=p.pop()){var P=i.slice(T.reStart+T.open.length);this.debug("setting tail",i,T),P=P.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,n){return n||(n="\\"),t+t+n+"|"})),this.debug("tail=%j\n %s",P,P,T,i);var _="*"===T.type?c:"?"===T.type?a:"\\"+T.type;l=!0,i=i.slice(0,T.reStart)+_+"\\("+P}C(),d&&(i+="\\\\");var x=!1;switch(i.charAt(0)){case"[":case".":case"(":x=!0}for(var N=h.length-1;N>-1;N--){var O=h[N],q=i.slice(0,O.reStart),I=i.slice(O.reStart,O.reEnd-8),A=i.slice(O.reEnd-8,O.reEnd),L=i.slice(O.reEnd);A+=L;var M=q.split("(").length-1,j=L;for(w=0;w<M;w++)j=j.replace(/\)[+*?]?/,"");var F="";""===(L=j)&&t!==g&&(F="$"),i=q+I+L+F+A}if(""!==i&&l&&(i="(?=.)"+i),x&&(i=b+i),t===g)return[i,l];if(!l)return e.replace(/\\(.)/g,"$1");var U=n.nocase?"i":"";try{var W=new RegExp("^"+i+"$",U)}catch(e){return new RegExp("$.")}return W._glob=e,W._src=i,W};var g={};p.makeRe=function(e,t){return new h(e,t||{}).makeRe()},h.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,n=t.noglobstar?c:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=t.nocase?"i":"",i=e.map((function(e){return e.map((function(e){return e===o?n:"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e._src})).join("\\/")})).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,r)}catch(e){this.regexp=!1}return this.regexp},p.match=function(e,t,n){var r=new h(t,n=n||{});return e=e.filter((function(e){return r.match(e)})),r.options.nonull&&!e.length&&e.push(t),e},h.prototype.match=function(e,t){if(void 0===t&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var n=this.options;"/"!==r.sep&&(e=e.split(r.sep).join("/")),e=e.split(l),this.debug(this.pattern,"split",e);var o,i,s=this.set;for(this.debug(this.pattern,"set",s),i=e.length-1;i>=0&&!(o=e[i]);i--);for(i=0;i<s.length;i++){var a=s[i],c=e;if(n.matchBase&&1===a.length&&(c=[o]),this.matchOne(c,a,t))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},h.prototype.matchOne=function(e,t,n){var r=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,s=0,a=e.length,c=t.length;i<a&&s<c;i++,s++){this.debug("matchOne loop");var u,l=t[s],d=e[i];if(this.debug(t,l,d),!1===l)return!1;if(l===o){this.debug("GLOBSTAR",[t,l,d]);var p=i,h=s+1;if(h===c){for(this.debug("** at the end");i<a;i++)if("."===e[i]||".."===e[i]||!r.dot&&"."===e[i].charAt(0))return!1;return!0}for(;p<a;){var f=e[p];if(this.debug("\nglobstar while",e,p,t,h,f),this.matchOne(e.slice(p),t.slice(h),n))return this.debug("globstar found match!",p,a,f),!0;if("."===f||".."===f||!r.dot&&"."===f.charAt(0)){this.debug("dot detected!",e,p,t,h);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!n||(this.debug("\n>>> no match, partial?",e,p,t,h),p!==a))}if("string"==typeof l?(u=d===l,this.debug("string match",l,d,u)):(u=d.match(l),this.debug("pattern match",l,d,u)),!u)return!1}if(i===a&&s===c)return!0;if(i===a)return n;if(s===c)return i===a-1&&""===e[i];throw new Error("wtf?")}},4751:(e,t,n)=>{e.exports=h,h.GlobSync=f;var r=n(7334),o=n(6522),i=(o.Minimatch,n(2884).Glob,n(3837),n(1017)),s=n(9491),a=n(4095),c=n(6772),u=c.setopts,l=c.ownProp,d=c.childrenIgnored,p=c.isIgnored;function h(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new f(e,t).found}function f(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof f))return new f(e,t);if(u(this,e,t),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var r=0;r<n;r++)this._process(this.minimatch.set[r],r,!1);this._finish()}f.prototype._finish=function(){if(s.ok(this instanceof f),this.realpath){var e=this;this.matches.forEach((function(t,n){var o=e.matches[n]=Object.create(null);for(var i in t)try{i=e._makeAbs(i),o[r.realpathSync(i,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;o[e._makeAbs(i)]=!0}}))}c.finish(this)},f.prototype._process=function(e,t,n){s.ok(this instanceof f);for(var r,i=0;"string"==typeof e[i];)i++;switch(i){case e.length:return void this._processSimple(e.join("/"),t);case 0:r=null;break;default:r=e.slice(0,i).join("/")}var c,u=e.slice(i);null===r?c=".":a(r)||a(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(r&&a(r)||(r="/"+r),c=r):c=r;var l=this._makeAbs(c);d(this,c)||(u[0]===o.GLOBSTAR?this._processGlobStar(r,c,l,u,t,n):this._processReaddir(r,c,l,u,t,n))},f.prototype._processReaddir=function(e,t,n,r,o,s){var a=this._readdir(n,s);if(a){for(var c=r[0],u=!!this.minimatch.negate,l=c._glob,d=this.dot||"."===l.charAt(0),p=[],h=0;h<a.length;h++)("."!==(g=a[h]).charAt(0)||d)&&(u&&!e?!g.match(c):g.match(c))&&p.push(g);var f=p.length;if(0!==f)if(1!==r.length||this.mark||this.stat)for(r.shift(),h=0;h<f;h++){var m;g=p[h],m=e?[e,g]:[g],this._process(m.concat(r),o,s)}else{this.matches[o]||(this.matches[o]=Object.create(null));for(h=0;h<f;h++){var g=p[h];e&&(g="/"!==e.slice(-1)?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=i.join(this.root,g)),this._emitMatch(o,g)}}}},f.prototype._emitMatch=function(e,t){if(!p(this,t)){var n=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},f.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,n;try{n=this.fs.lstatSync(e)}catch(e){if("ENOENT"===e.code)return null}var r=n&&n.isSymbolicLink();return this.symlinks[e]=r,r||!n||n.isDirectory()?t=this._readdir(e,!1):this.cache[e]="FILE",t},f.prototype._readdir=function(e,t){if(t&&!l(this.symlinks,e))return this._readdirInGlobStar(e);if(l(this.cache,e)){var n=this.cache[e];if(!n||"FILE"===n)return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},f.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var r=t[n];r="/"===e?e+r:e+"/"+r,this.cache[r]=!0}return this.cache[e]=t,t},f.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var r=new Error(t.code+" invalid cwd "+this.cwd);throw r.path=this.cwd,r.code=t.code,r}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t)}},f.prototype._processGlobStar=function(e,t,n,r,o,i){var s=this._readdir(n,i);if(s){var a=r.slice(1),c=e?[e]:[],u=c.concat(a);this._process(u,o,!1);var l=s.length;if(!this.symlinks[n]||!i)for(var d=0;d<l;d++)if("."!==s[d].charAt(0)||this.dot){var p=c.concat(s[d],a);this._process(p,o,!0);var h=c.concat(s[d],r);this._process(h,o,!0)}}},f.prototype._processSimple=function(e,t){var n=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),n){if(e&&a(e)&&!this.nomount){var r=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=i.join(this.root,e):(e=i.resolve(this.root,e),r&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}},f.prototype._stat=function(e){var t=this._makeAbs(e),n="/"===e.slice(-1);if(e.length>this.maxLength)return!1;if(!this.stat&&l(this.cache,t)){var r=this.cache[t];if(Array.isArray(r)&&(r="DIR"),!n||"DIR"===r)return r;if(n&&"FILE"===r)return!1}var o=this.statCache[t];if(!o){var i;try{i=this.fs.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(i&&i.isSymbolicLink())try{o=this.fs.statSync(t)}catch(e){o=i}else o=i}return this.statCache[t]=o,r=!0,o&&(r=o.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||r,(!n||"FILE"!==r)&&r},f.prototype._mark=function(e){return c.mark(this,e)},f.prototype._makeAbs=function(e){return c.makeAbs(this,e)}},7844:(e,t,n)=>{var r=n(2479),o=Object.create(null),i=n(778);e.exports=r((function(e,t){return o[e]?(o[e].push(t),null):(o[e]=[t],function(e){return i((function t(){var n=o[e],r=n.length,i=function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r]=e[r];return n}(arguments);try{for(var s=0;s<r;s++)n[s].apply(null,i)}finally{n.length>r?(n.splice(0,r),process.nextTick((function(){t.apply(null,i)}))):delete o[e]}}))}(e))}))},4378:(e,t,n)=>{try{var r=n(3837);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(5717)}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},778:(e,t,n)=>{var r=n(2479);function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(o),e.exports.strict=r(i),o.proto=o((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},4095:e=>{"use strict";function t(e){return"/"===e.charAt(0)}function n(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),n=t[1]||"",r=Boolean(n&&":"!==n.charAt(1));return Boolean(t[2]||r)}e.exports="win32"===process.platform?n:t,e.exports.posix=t,e.exports.win32=n},3870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFormat=t.TraceValues=t.Trace=t.ProgressType=t.ProgressToken=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.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=void 0;const r=n(839);Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return r.Message}}),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(6184);Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return o.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return o.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return o.Touch}});const i=n(3911);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const s=n(7135);Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});const a=n(3881);Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const c=n(6525);Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return c.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return c.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return c.ReadableStreamMessageReader}});const u=n(6654);Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.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,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),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,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),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 d=n(147);t.RAL=d.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=(0,r.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}));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.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const r=n(147),o=n(7574),i=n(839),s=n(6184),a=n(7135),c=n(3881);var u,l,d,p,h,f,m,g,y,v,b,R,C,D,w;!function(e){e.type=new i.NotificationType("$/cancelRequest")}(u||(u={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(l=t.ProgressToken||(t.ProgressToken={})),function(e){e.type=new i.NotificationType("$/progress")}(d||(d={})),t.ProgressType=class{constructor(){}},function(e){e.is=function(e){return o.func(e)}}(p||(p={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(h=t.Trace||(t.Trace={})),(w=t.TraceValues||(t.TraceValues={})).Off="off",w.Messages="messages",w.Compact="compact",w.Verbose="verbose",function(e){e.fromString=function(t){if(!o.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(h=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return o.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(f=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new i.NotificationType("$/setTrace")}(m=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new i.NotificationType("$/logTrace")}(g=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(y=t.ConnectionErrors||(t.ConnectionErrors={}));class k extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,k.prototype)}}t.ConnectionError=k,function(e){e.is=function(e){const t=e;return t&&o.func(t.cancelUndispatched)}}(v=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)}}(b=t.CancellationReceiverStrategy||(t.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(u.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&o.func(t.sendCancellation)&&o.func(t.cleanup)}}(R=t.CancellationSenderStrategy||(t.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:b.Message,sender:R.Message}),e.is=function(e){const t=e;return t&&b.is(t.receiver)&&R.is(t.sender)}}(C=t.CancellationStrategy||(t.CancellationStrategy={})),(t.ConnectionOptions||(t.ConnectionOptions={})).is=function(e){const t=e;return t&&(C.is(t.cancellationStrategy)||v.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"}(D||(D={})),t.createMessageConnection=function(e,n,v,b){const R=void 0!==v?v:t.NullLogger;let w=0,T=0,S=0;const E="2.0";let P;const _=new Map;let x;const N=new Map,O=new Map;let q,I,A=new s.LinkedMap,L=new Map,M=new Set,j=new Map,F=h.Off,U=f.Text,W=D.New;const $=new a.Emitter,H=new a.Emitter,V=new a.Emitter,K=new a.Emitter,B=new a.Emitter,z=b&&b.cancellationStrategy?b.cancellationStrategy:C.Message;function Q(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 G(e){}function X(){return W===D.Listening}function J(){return W===D.Closed}function Y(){return W===D.Disposed}function Z(){W!==D.New&&W!==D.Listening||(W=D.Closed,H.fire(void 0))}function ee(){q||0===A.size||(q=(0,r.default)().timer.setImmediate((()=>{q=void 0,function(){if(0===A.size)return;const e=A.shift();try{i.Message.isRequest(e)?function(e){if(Y())return;function t(t,r,o){const s={jsonrpc:E,id:e.id};t instanceof i.ResponseError?s.error=t.toJson():s.result=void 0===t?null:t,re(s,r,o),n.write(s).catch((()=>R.error("Sending response failed.")))}function r(t,r,o){const i={jsonrpc:E,id:e.id,error:t.toJson()};re(i,r,o),n.write(i).catch((()=>R.error("Sending response failed.")))}!function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),I.log(`Received request '${e.method} - (${e.id})'.`,t)}else ie("receive-request",e)}(e);const s=_.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||P){const s=e.id??String(Date.now()),l=z.receiver.createCancellationTokenSource(s);null!==e.id&&M.has(e.id)&&l.cancel(),null!==e.id&&j.set(s,l);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 received none.`),e.method,u);d=c(l.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,u);d=c(...e.params,l.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,u);d=c(e.params,l.token)}else P&&(d=P(e.method,e.params,l.token));const p=d;d?p.then?p.then((n=>{j.delete(s),t(n,e.method,u)}),(t=>{j.delete(s),t instanceof i.ResponseError?r(t,e.method,u):t&&o.string(t.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):(j.delete(s),t(d,e.method,u)):(j.delete(s),function(t,r,o){void 0===t&&(t=null);const i={jsonrpc:E,id:e.id,result:t};re(i,r,o),n.write(i).catch((()=>R.error("Sending response failed.")))}(d,e.method,u))}catch(n){j.delete(s),n instanceof i.ResponseError?t(n,e.method,u):n&&o.string(n.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,u):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else r(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):i.Message.isNotification(e)?function(e){if(Y())return;let t,n;if(e.method===u.type.method){const t=e.params.id;return M.delete(t),void oe(e)}{const r=N.get(e.method);r&&(n=r.handler,t=r.type)}if(n||x)try{if(oe(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==i.ParameterStructures.byName&&R.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const r=e.params;e.method===d.type.method&&2===r.length&&l.is(r[0])?n({token:r[0],value:r[1]}):(void 0!==t&&(t.parameterStructures===i.ParameterStructures.byName&&R.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&R.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${r.length} arguments`)),n(...r))}else void 0!==t&&t.parameterStructures===i.ParameterStructures.byPosition&&R.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else x&&x(e.method,e.params)}catch(t){t.message?R.error(`Notification handler '${e.method}' failed with message: ${t.message}`):R.error(`Notification handler '${e.method}' failed unexpectedly.`)}else V.fire(e)}(e):i.Message.isResponse(e)?function(e){if(!Y())if(null===e.id)e.error?R.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):R.error("Received response message without id. No further error information provided.");else{const t=e.id,n=L.get(t);if(function(e,t){if(F!==h.Off&&I)if(U===f.Text){let n;if(F!==h.Verbose&&F!==h.Compact||(e.error&&e.error.data?n=`Error data: ${ne(e.error.data)}\n\n`:e.result?n=`Result: ${ne(e.result)}\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}).`:"";I.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else I.log(`Received response ${e.id} without active response promise.`,n)}else ie("receive-response",e)}(e,n),void 0!==n){L.delete(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?R.error(`Response handler '${n.method}' failed with message: ${e.message}`):R.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void R.error("Received empty message.");R.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=t.id,n=L.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{ee()}}()})))}e.onClose(Z),e.onError((function(e){$.fire([e,void 0,void 0])})),n.onClose(Z),n.onError((function(e){$.fire(e)}));const te=e=>{try{if(i.Message.isNotification(e)&&e.method===u.type.method){const t=e.params.id,r=Q(t),o=A.get(r);if(i.Message.isRequest(o)){const i=b?.connectionStrategy,s=i&&i.cancelUndispatched?i.cancelUndispatched(o,G):void 0;if(s&&(void 0!==s.error||void 0!==s.result))return A.delete(r),j.delete(t),s.id=o.id,re(s,e.method,Date.now()),void n.write(s).catch((()=>R.error("Sending response for canceled message failed.")))}const s=j.get(t);if(void 0!==s)return s.cancel(),void oe(e);M.add(t)}!function(e,t){var n;i.Message.isRequest(t)?e.set(Q(t.id),t):i.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++S).toString():"res-"+n.toString(),t):e.set("not-"+(++T).toString(),t)}(A,e)}finally{ee()}};function ne(e){if(null!=e)switch(F){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function re(e,t,n){if(F!==h.Off&&I)if(U===f.Text){let r;F!==h.Verbose&&F!==h.Compact||(e.error&&e.error.data?r=`Error data: ${ne(e.error.data)}\n\n`:e.result?r=`Result: ${ne(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),I.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else ie("send-response",e)}function oe(e){if(F!==h.Off&&I&&e.method!==g.type.method)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Received notification '${e.method}'.`,t)}else ie("receive-notification",e)}function ie(e,t){if(!I||F===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};I.log(n)}function se(){if(J())throw new k(y.Closed,"Connection is closed.");if(Y())throw new k(y.Disposed,"Connection is disposed.")}function ae(e){return void 0===e?null:e}function ce(e){return null===e?void 0:e}function ue(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function le(e,t){switch(e){case i.ParameterStructures.auto:return ue(t)?ce(t):[ae(t)];case i.ParameterStructures.byName:if(!ue(t))throw new Error("Received parameters by name but param is not an object literal.");return ce(t);case i.ParameterStructures.byPosition:return[ae(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function de(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=le(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(ae(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const pe={sendNotification:(e,...t)=>{let r,s;if(se(),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 u=c-o;switch(u){case 0:s=void 0;break;case 1:s=le(a,t[o]);break;default:if(a===i.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);s=t.slice(o,c).map((e=>ae(e)))}}else{const n=t;r=e.method,s=de(e,n)}const a={jsonrpc:E,method:r,params:s};return function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Sending notification '${e.method}'.`,t)}else ie("send-notification",e)}(a),n.write(a).catch((()=>R.error("Sending notification failed.")))},onNotification:(e,t)=>{let n;return se(),o.func(e)?x=e:t&&(o.string(e)?(n=e,N.set(e,{type:void 0,handler:t})):(n=e.method,N.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==n?N.delete(n):x=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)=>pe.sendNotification(d.type,{token:t,value:n}),onUnhandledProgress:K.event,sendRequest:(e,...t)=>{let r,s,a;if(se(),function(){if(!X())throw new Error("Call listen() first.")}(),o.string(e)){r=e;const n=t[0],o=t[t.length-1];let u=0,l=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(u=1,l=n);let d=t.length;c.CancellationToken.is(o)&&(d-=1,a=o);const p=d-u;switch(p){case 0:s=void 0;break;case 1:s=le(l,t[u]);break;default:if(l===i.ParameterStructures.byName)throw new Error(`Received ${p} parameters for 'by Name' request parameter structure.`);s=t.slice(u,d).map((e=>ae(e)))}}else{const n=t;r=e.method,s=de(e,n);const o=e.numberOfParams;a=c.CancellationToken.is(n[o])?n[o]:void 0}const u=w++;let l;return a&&(l=a.onCancellationRequested((()=>{const e=z.sender.sendCancellation(pe,u);return void 0===e?(R.log(`Received no promise from cancellation strategy when cancelling id ${u}`),Promise.resolve()):e.catch((()=>{R.log(`Sending cancellation messages for id ${u} failed`)}))}))),new Promise(((e,t)=>{const o={jsonrpc:E,id:u,method:r,params:s};let a={method:r,timerStart:Date.now(),resolve:t=>{e(t),z.sender.cleanup(u),l?.dispose()},reject:e=>{t(e),z.sender.cleanup(u),l?.dispose()}};!function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),I.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ie("send-request",e)}(o);try{n.write(o).catch((()=>R.error("Sending request failed.")))}catch(e){a.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),a=null}a&&L.set(u,a)}))},onRequest:(e,t)=>{se();let n=null;return p.is(e)?(n=void 0,P=e):o.string(e)?(n=null,void 0!==t&&(n=e,_.set(e,{handler:t,type:void 0}))):void 0!==t&&(n=e.method,_.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==n&&(void 0!==n?_.delete(n):P=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(e,t,n)=>{let r=!1,i=f.Text;void 0!==n&&(o.boolean(n)?r=n:(r=n.sendNotification||!1,i=n.traceFormat||f.Text)),F=e,U=i,I=F===h.Off?void 0:t,!r||J()||Y()||await pe.sendNotification(m.type,{value:h.toString(e)})},onError:$.event,onClose:H.event,onUnhandledNotification:V.event,onDispose:B.event,end:()=>{n.end()},dispose:()=>{if(Y())return;W=D.Disposed,B.fire(void 0);const t=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const e of L.values())e.reject(t);L=new Map,j=new Map,M=new Set,A=new s.LinkedMap,o.func(n.dispose)&&n.dispose(),o.func(e.dispose)&&e.dispose()},listen:()=>{se(),function(){if(X())throw new k(y.AlreadyListening,"Connection is already listening")}(),W=D.Listening,e.listen(te)},inspect:()=>{(0,r.default)().console.log("inspect")}};return pe.onNotification(g.type,(e=>{if(F===h.Off||!I)return;const t=F===h.Verbose||F===h.Compact;I.log(e.message,t?e.verbose:void 0)})),pe.onNotification(d.type,(e=>{const t=O.get(e.token);t?t(e.value):K.fire(e)})),pe}},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<o;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const t=[],n=this._callbacks.slice(0),o=this._contexts.slice(0);for(let i=0,s=n.length;i<s;i++)try{t.push(n[i].apply(o[i],e))}catch(e){(0,r.default)().console.error(e)}return t}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class i{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{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,r;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}(r=t.Touch||(t.Touch={}));class o{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=r.None){const n=this._map.get(e);if(n)return t!==r.None&&this.touch(n,t),n.value}set(e,t,n=r.None){let o=this._map.get(e);if(o)o.value=t,n!==r.None&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case r.None:this.addItemLast(o);break;case r.First:this.addItemFirst(o);break;case r.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._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(n=Symbol.toStringTag,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===r.First||t===r.Last)if(t===r.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===r.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=o,t.LRUCache=class extends o{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=r.AsNew){return super.get(e,t)}peek(e){return super.get(e,r.None)}set(e,t){return super.set(e,t,r.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(;t<this._chunks.length;){const o=this._chunks[t];for(n=0;n<o.length;){switch(o[n]){case 13:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case 10:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}r+=o.byteLength,t++}if(4!==e)return;const o=this._read(r+n),i=new Map,s=this.toString(o,"ascii").split("\r\n");if(s.length<2)return i;for(let e=0;e<s.length-2;e++){const t=s[e],n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");const r=t.substr(0,n),o=t.substr(n+1).trim();i.set(r,o)}return i}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._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){let t,n;const o=new Map;let i;const s=new Map;if(void 0===e||"string"==typeof e)t=e??"utf-8";else{if(t=e.charset??"utf-8",void 0!==e.contentDecoder&&(n=e.contentDecoder,o.set(n.name,n)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)o.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(i=e.contentTypeDecoder,s.set(i.name,i)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)s.set(t.name,t)}return void 0===i&&(i=(0,r.default)().applicationJson.decoder,s.set(i.name,i)),{charset:t,contentDecoder:n,contentDecoders:o,contentTypeDecoder:i,contentTypeDecoders:s}}}(s||(s={})),t.ReadableStreamMessageReader=class extends a{constructor(e,t){super(),this.readable=e,this.options=s.fromOptions(t),this.buffer=(0,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&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,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){return void 0===e||"string"==typeof e?{charset:e??"utf-8",contentTypeEncoder:(0,r.default)().applicationJson.encoder}:{charset:e.charset??"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,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.Message=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,i;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3}(o=t.ErrorCodes||(t.ErrorCodes={}));class s extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:o.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,s.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}t.ResponseError=s;class a{constructor(e){this.kind=e}static is(e){return e===a.auto||e===a.byName||e===a.byPosition}toString(){return this.kind}}t.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");class c{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return a.auto}}t.AbstractMessageSignature=c,t.RequestType0=class extends c{constructor(e){super(e,0)}},t.RequestType=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType1=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType2=class extends c{constructor(e){super(e,2)}},t.RequestType3=class extends c{constructor(e){super(e,3)}},t.RequestType4=class extends c{constructor(e){super(e,4)}},t.RequestType5=class extends c{constructor(e){super(e,5)}},t.RequestType6=class extends c{constructor(e){super(e,6)}},t.RequestType7=class extends c{constructor(e){super(e,7)}},t.RequestType8=class extends c{constructor(e){super(e,8)}},t.RequestType9=class extends c{constructor(e){super(e,9)}},t.NotificationType=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType0=class extends c{constructor(e){super(e,0)}},t.NotificationType1=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType2=class extends c{constructor(e){super(e,2)}},t.NotificationType3=class extends c{constructor(e){super(e,3)}},t.NotificationType4=class extends c{constructor(e){super(e,4)}},t.NotificationType5=class extends c{constructor(e){super(e,5)}},t.NotificationType6=class extends c{constructor(e){super(e,6)}},t.NotificationType7=class extends c{constructor(e){super(e,7)}},t.NotificationType8=class extends c{constructor(e){super(e,8)}},t.NotificationType9=class extends c{constructor(e){super(e,9)}},(i=t.Message||(t.Message={})).isRequest=function(e){const t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},i.isNotification=function(e){const t=e;return t&&r.string(t.method)&&void 0===e.id},i.isResponse=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&&(0,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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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),u=n(6113),l=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((0,i.default)().stream.asReadableStream(e),t)}}t.SocketMessageReader=h;class f extends s.WriteableStreamMessageWriter{constructor(e,t){super((0,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((0,i.default)().stream.asReadableStream(e),t)}}t.StreamMessageReader=m;class g extends s.WriteableStreamMessageWriter{constructor(e,t){super((0,i.default)().stream.asWritableStream(e),t)}}t.StreamMessageWriter=g;const y=process.env.XDG_RUNTIME_DIR,v=new Map([["linux",107],["darwin",103]]);t.generateRandomPipeName=function(){const e=(0,u.randomBytes)(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=y?a.join(y,`vscode-ipc-${e}.sock`):a.join(c.tmpdir(),`vscode-${e}.sock`);const n=v.get(process.platform);return void 0!==n&&t.length>=n&&(0,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=(0,l.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=(0,l.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=(0,l.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=(0,l.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}),(0,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 u{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 l=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 u(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function d(){return l}!function(e){e.install=function(){r.default.install(l)}}(d||(d={})),t.default=d},5028:(e,t,n)=>{"use strict";e.exports=n(4389)},1661:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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.RequestFailed=-32803,i.ServerCancelled=-32802,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}),(0,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=t.MessageDirection=void 0;const r=n(4389);var o;(o=t.MessageDirection||(t.MessageDirection={})).clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both",t.RegistrationType=class{constructor(e){this.method=e}};class i extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=i;class s extends r.RequestType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolRequestType=s;class a extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=a;class c extends r.NotificationType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolNotificationType=c},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.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",o.messageDirection=r.MessageDirection.clientToServer,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,i;(i=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.ColorPresentationRequest||(t.ColorPresentationRequest={})).method="textDocument/colorPresentation",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},5934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;const r=n(6140);var o;(o=t.ConfigurationRequest||(t.ConfigurationRequest={})).method="workspace/configuration",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)},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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},9824:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;const r=n(4389),o=n(9533),i=n(6140);var s,a,c,u;(t.DiagnosticServerCancellationData||(t.DiagnosticServerCancellationData={})).is=function(e){const t=e;return t&&o.boolean(t.retriggerRequest)},(u=t.DocumentDiagnosticReportKind||(t.DocumentDiagnosticReportKind={})).Full="full",u.Unchanged="unchanged",(c=t.DocumentDiagnosticRequest||(t.DocumentDiagnosticRequest={})).method="textDocument/diagnostic",c.messageDirection=i.MessageDirection.clientToServer,c.type=new i.ProtocolRequestType(c.method),c.partialResult=new r.ProgressType,(a=t.WorkspaceDiagnosticRequest||(t.WorkspaceDiagnosticRequest={})).method="workspace/diagnostic",a.messageDirection=i.MessageDirection.clientToServer,a.type=new i.ProtocolRequestType(a.method),a.partialResult=new r.ProgressType,(s=t.DiagnosticRefreshRequest||(t.DiagnosticRefreshRequest={})).method="workspace/diagnostic/refresh",s.messageDirection=i.MessageDirection.clientToServer,s.type=new i.ProtocolRequestType0(s.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,u,l;(l=t.FileOperationPatternKind||(t.FileOperationPatternKind={})).file="file",l.folder="folder",(u=t.WillCreateFilesRequest||(t.WillCreateFilesRequest={})).method="workspace/willCreateFiles",u.messageDirection=r.MessageDirection.clientToServer,u.type=new r.ProtocolRequestType(u.method),(c=t.DidCreateFilesNotification||(t.DidCreateFilesNotification={})).method="workspace/didCreateFiles",c.messageDirection=r.MessageDirection.clientToServer,c.type=new r.ProtocolNotificationType(c.method),(a=t.WillRenameFilesRequest||(t.WillRenameFilesRequest={})).method="workspace/willRenameFiles",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType(a.method),(s=t.DidRenameFilesNotification||(t.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method),(i=t.DidDeleteFilesNotification||(t.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolNotificationType(i.method),(o=t.WillDeleteFilesRequest||(t.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},3394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRequest=void 0;const r=n(6140);var o;(o=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",o.messageDirection=r.MessageDirection.clientToServer,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},9999:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;const r=n(6140);var o,i,s;(s=t.InlayHintRequest||(t.InlayHintRequest={})).method="textDocument/inlayHint",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.InlayHintResolveRequest||(t.InlayHintResolveRequest={})).method="inlayHint/resolve",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.InlayHintRefreshRequest||(t.InlayHintRefreshRequest={})).method="workspace/inlayHint/refresh",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType0(o.method)},5246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;const r=n(6140);var o,i;(i=t.InlineValueRequest||(t.InlineValueRequest={})).method="textDocument/inlineValue",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.InlineValueRefreshRequest||(t.InlineValueRefreshRequest={})).method="workspace/inlineValue/refresh",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType0(o.method)},542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),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.RelativePattern=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.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=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.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=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=void 0;const r=n(6140),o=n(1674),i=n(9533),s=n(2122);Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});const a=n(1589);Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const c=n(8744);Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return c.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return c.DidChangeWorkspaceFoldersNotification}});const u=n(5934);Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return u.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 d=n(3394);Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return d.FoldingRangeRequest}});const p=n(764);Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return p.DeclarationRequest}});const h=n(5206);Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const f=n(1862);Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const m=n(2918);Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return m.CallHierarchyPrepareRequest}});const g=n(9434);Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return g.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return g.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return g.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return g.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return g.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return g.SemanticTokensRegistrationType}});const y=n(5726);Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});const v=n(6305);Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return v.LinkedEditingRangeRequest}});const b=n(7846);Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return b.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return b.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return b.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return b.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return b.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return b.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return b.WillDeleteFilesRequest}});const R=n(3443);Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return R.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return R.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return R.MonikerRequest}});const C=n(3693);Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return C.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySupertypesRequest}});const D=n(5246);Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return D.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return D.InlineValueRefreshRequest}});const w=n(9999);Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const k=n(9824);Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return k.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return k.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return k.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return k.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return k.DiagnosticRefreshRequest}});const T=n(7169);var S,E,P,_,x,N,O,q,I,A,L,M,j,F,U,W,$,H,V,K,B,z,Q,G,X,J,Y,Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce,De,we,ke,Te,Se,Ee,Pe,_e,xe;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return T.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return T.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return T.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return T.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return T.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return T.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidCloseNotebookDocumentNotification}}),function(e){e.is=function(e){const t=e;return i.string(t.language)||i.string(t.scheme)||i.string(t.pattern)}}(S=t.TextDocumentFilter||(t.TextDocumentFilter={})),function(e){e.is=function(e){const t=e;return i.objectLiteral(t)&&(i.string(t.notebookType)||i.string(t.scheme)||i.string(t.pattern))}}(E=t.NotebookDocumentFilter||(t.NotebookDocumentFilter={})),function(e){e.is=function(e){const t=e;return i.objectLiteral(t)&&(i.string(t.notebook)||E.is(t.notebook))&&(void 0===t.language||i.string(t.language))}}(P=t.NotebookCellTextDocumentFilter||(t.NotebookCellTextDocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!i.string(t)&&!S.is(t)&&!P.is(t))return!1;return!0}}(_=t.DocumentSelector||(t.DocumentSelector={})),(xe=t.RegistrationRequest||(t.RegistrationRequest={})).method="client/registerCapability",xe.messageDirection=r.MessageDirection.serverToClient,xe.type=new r.ProtocolRequestType(xe.method),(_e=t.UnregistrationRequest||(t.UnregistrationRequest={})).method="client/unregisterCapability",_e.messageDirection=r.MessageDirection.serverToClient,_e.type=new r.ProtocolRequestType(_e.method),(Pe=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",Pe.Rename="rename",Pe.Delete="delete",(Ee=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",Ee.Transactional="transactional",Ee.TextOnlyTransactional="textOnlyTransactional",Ee.Undo="undo",(Se=t.PositionEncodingKind||(t.PositionEncodingKind={})).UTF8="utf-8",Se.UTF16="utf-16",Se.UTF32="utf-32",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&i.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||_.is(t.documentSelector))},(Te=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return i.objectLiteral(t)&&(void 0===t.workDoneProgress||i.boolean(t.workDoneProgress))},Te.hasWorkDoneProgress=function(e){const t=e;return t&&i.boolean(t.workDoneProgress)},(ke=t.InitializeRequest||(t.InitializeRequest={})).method="initialize",ke.messageDirection=r.MessageDirection.clientToServer,ke.type=new r.ProtocolRequestType(ke.method),(t.InitializeErrorCodes||(t.InitializeErrorCodes={})).unknownProtocolVersion=1,(we=t.InitializedNotification||(t.InitializedNotification={})).method="initialized",we.messageDirection=r.MessageDirection.clientToServer,we.type=new r.ProtocolNotificationType(we.method),(De=t.ShutdownRequest||(t.ShutdownRequest={})).method="shutdown",De.messageDirection=r.MessageDirection.clientToServer,De.type=new r.ProtocolRequestType0(De.method),(Ce=t.ExitNotification||(t.ExitNotification={})).method="exit",Ce.messageDirection=r.MessageDirection.clientToServer,Ce.type=new r.ProtocolNotificationType0(Ce.method),(Re=t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).method="workspace/didChangeConfiguration",Re.messageDirection=r.MessageDirection.clientToServer,Re.type=new r.ProtocolNotificationType(Re.method),(be=t.MessageType||(t.MessageType={})).Error=1,be.Warning=2,be.Info=3,be.Log=4,(ve=t.ShowMessageNotification||(t.ShowMessageNotification={})).method="window/showMessage",ve.messageDirection=r.MessageDirection.serverToClient,ve.type=new r.ProtocolNotificationType(ve.method),(ye=t.ShowMessageRequest||(t.ShowMessageRequest={})).method="window/showMessageRequest",ye.messageDirection=r.MessageDirection.serverToClient,ye.type=new r.ProtocolRequestType(ye.method),(ge=t.LogMessageNotification||(t.LogMessageNotification={})).method="window/logMessage",ge.messageDirection=r.MessageDirection.serverToClient,ge.type=new r.ProtocolNotificationType(ge.method),(me=t.TelemetryEventNotification||(t.TelemetryEventNotification={})).method="telemetry/event",me.messageDirection=r.MessageDirection.serverToClient,me.type=new r.ProtocolNotificationType(me.method),(fe=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,fe.Full=1,fe.Incremental=2,(he=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",he.messageDirection=r.MessageDirection.clientToServer,he.type=new r.ProtocolNotificationType(he.method),(pe=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)},pe.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(de=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",de.messageDirection=r.MessageDirection.clientToServer,de.type=new r.ProtocolNotificationType(de.method),(le=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",le.messageDirection=r.MessageDirection.clientToServer,le.type=new r.ProtocolNotificationType(le.method),(ue=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",ue.messageDirection=r.MessageDirection.clientToServer,ue.type=new r.ProtocolNotificationType(ue.method),(ce=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,ce.AfterDelay=2,ce.FocusOut=3,(ae=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",ae.messageDirection=r.MessageDirection.clientToServer,ae.type=new r.ProtocolNotificationType(ae.method),(se=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",se.messageDirection=r.MessageDirection.clientToServer,se.type=new r.ProtocolRequestType(se.method),(ie=t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).method="workspace/didChangeWatchedFiles",ie.messageDirection=r.MessageDirection.clientToServer,ie.type=new r.ProtocolNotificationType(ie.method),(oe=t.FileChangeType||(t.FileChangeType={})).Created=1,oe.Changed=2,oe.Deleted=3,(t.RelativePattern||(t.RelativePattern={})).is=function(e){const t=e;return i.objectLiteral(t)&&(o.URI.is(t.baseUri)||o.WorkspaceFolder.is(t.baseUri))&&i.string(t.pattern)},(re=t.WatchKind||(t.WatchKind={})).Create=1,re.Change=2,re.Delete=4,(ne=t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).method="textDocument/publishDiagnostics",ne.messageDirection=r.MessageDirection.serverToClient,ne.type=new r.ProtocolNotificationType(ne.method),(te=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,te.TriggerCharacter=2,te.TriggerForIncompleteCompletions=3,(ee=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",ee.messageDirection=r.MessageDirection.clientToServer,ee.type=new r.ProtocolRequestType(ee.method),(Z=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",Z.messageDirection=r.MessageDirection.clientToServer,Z.type=new r.ProtocolRequestType(Z.method),(Y=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",Y.messageDirection=r.MessageDirection.clientToServer,Y.type=new r.ProtocolRequestType(Y.method),(J=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,J.TriggerCharacter=2,J.ContentChange=3,(X=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",X.messageDirection=r.MessageDirection.clientToServer,X.type=new r.ProtocolRequestType(X.method),(G=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",G.messageDirection=r.MessageDirection.clientToServer,G.type=new r.ProtocolRequestType(G.method),(Q=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",Q.messageDirection=r.MessageDirection.clientToServer,Q.type=new r.ProtocolRequestType(Q.method),(z=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",z.messageDirection=r.MessageDirection.clientToServer,z.type=new r.ProtocolRequestType(z.method),(B=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",B.messageDirection=r.MessageDirection.clientToServer,B.type=new r.ProtocolRequestType(B.method),(K=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",K.messageDirection=r.MessageDirection.clientToServer,K.type=new r.ProtocolRequestType(K.method),(V=t.CodeActionResolveRequest||(t.CodeActionResolveRequest={})).method="codeAction/resolve",V.messageDirection=r.MessageDirection.clientToServer,V.type=new r.ProtocolRequestType(V.method),(H=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",H.messageDirection=r.MessageDirection.clientToServer,H.type=new r.ProtocolRequestType(H.method),($=t.WorkspaceSymbolResolveRequest||(t.WorkspaceSymbolResolveRequest={})).method="workspaceSymbol/resolve",$.messageDirection=r.MessageDirection.clientToServer,$.type=new r.ProtocolRequestType($.method),(W=t.CodeLensRequest||(t.CodeLensRequest={})).method="textDocument/codeLens",W.messageDirection=r.MessageDirection.clientToServer,W.type=new r.ProtocolRequestType(W.method),(U=t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).method="codeLens/resolve",U.messageDirection=r.MessageDirection.clientToServer,U.type=new r.ProtocolRequestType(U.method),(F=t.CodeLensRefreshRequest||(t.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",F.messageDirection=r.MessageDirection.serverToClient,F.type=new r.ProtocolRequestType0(F.method),(j=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",j.messageDirection=r.MessageDirection.clientToServer,j.type=new r.ProtocolRequestType(j.method),(M=t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).method="documentLink/resolve",M.messageDirection=r.MessageDirection.clientToServer,M.type=new r.ProtocolRequestType(M.method),(L=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",L.messageDirection=r.MessageDirection.clientToServer,L.type=new r.ProtocolRequestType(L.method),(A=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",A.messageDirection=r.MessageDirection.clientToServer,A.type=new r.ProtocolRequestType(A.method),(I=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",I.messageDirection=r.MessageDirection.clientToServer,I.type=new r.ProtocolRequestType(I.method),(t.PrepareSupportDefaultBehavior||(t.PrepareSupportDefaultBehavior={})).Identifier=1,(q=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",q.messageDirection=r.MessageDirection.clientToServer,q.type=new r.ProtocolRequestType(q.method),(O=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",O.messageDirection=r.MessageDirection.clientToServer,O.type=new r.ProtocolRequestType(O.method),(N=t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).method="workspace/executeCommand",N.messageDirection=r.MessageDirection.clientToServer,N.type=new r.ProtocolRequestType(N.method),(x=t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).method="workspace/applyEdit",x.messageDirection=r.MessageDirection.serverToClient,x.type=new r.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.messageDirection=r.MessageDirection.clientToServer,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},7169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;const r=n(1674),o=n(9533),i=n(6140);var s,a,c,u,l,d,p,h,f,m;!function(e){e.Markup=1,e.Code=2,e.is=function(e){return 1===e||2===e}}(s=t.NotebookCellKind||(t.NotebookCellKind={})),function(e){e.create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},e.is=function(e){const t=e;return o.objectLiteral(t)&&r.uinteger.is(t.executionOrder)&&(void 0===t.success||o.boolean(t.success))},e.equals=function(e,t){return e===t||null!=e&&null!=t&&e.executionOrder===t.executionOrder&&e.success===t.success}}(a=t.ExecutionSummary||(t.ExecutionSummary={})),function(e){function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(typeof e!=typeof n)return!1;if("object"!=typeof e)return!1;const r=Array.isArray(e),i=Array.isArray(n);if(r!==i)return!1;if(r&&i){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1}if(o.objectLiteral(e)&&o.objectLiteral(n)){const r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;if(r.sort(),o.sort(),!t(r,o))return!1;for(let o=0;o<r.length;o++){const i=r[o];if(!t(e[i],n[i]))return!1}}return!0}e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){const t=e;return o.objectLiteral(t)&&s.is(t.kind)&&r.DocumentUri.is(t.document)&&(void 0===t.metadata||o.objectLiteral(t.metadata))},e.diff=function(e,n){const r=new Set;return e.document!==n.document&&r.add("document"),e.kind!==n.kind&&r.add("kind"),e.executionSummary!==n.executionSummary&&r.add("executionSummary"),void 0===e.metadata&&void 0===n.metadata||t(e.metadata,n.metadata)||r.add("metadata"),void 0===e.executionSummary&&void 0===n.executionSummary||a.equals(e.executionSummary,n.executionSummary)||r.add("executionSummary"),r}}(c=t.NotebookCell||(t.NotebookCell={})),(m=t.NotebookDocument||(t.NotebookDocument={})).create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},m.is=function(e){const t=e;return o.objectLiteral(t)&&o.string(t.uri)&&r.integer.is(t.version)&&o.typedArray(t.cells,c.is)},function(e){e.method="notebookDocument/sync",e.messageDirection=i.MessageDirection.clientToServer,e.type=new i.RegistrationType(e.method)}(u=t.NotebookDocumentSyncRegistrationType||(t.NotebookDocumentSyncRegistrationType={})),(f=t.DidOpenNotebookDocumentNotification||(t.DidOpenNotebookDocumentNotification={})).method="notebookDocument/didOpen",f.messageDirection=i.MessageDirection.clientToServer,f.type=new i.ProtocolNotificationType(f.method),f.registrationMethod=u.method,(h=t.NotebookCellArrayChange||(t.NotebookCellArrayChange={})).is=function(e){const t=e;return o.objectLiteral(t)&&r.uinteger.is(t.start)&&r.uinteger.is(t.deleteCount)&&(void 0===t.cells||o.typedArray(t.cells,c.is))},h.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r},(p=t.DidChangeNotebookDocumentNotification||(t.DidChangeNotebookDocumentNotification={})).method="notebookDocument/didChange",p.messageDirection=i.MessageDirection.clientToServer,p.type=new i.ProtocolNotificationType(p.method),p.registrationMethod=u.method,(d=t.DidSaveNotebookDocumentNotification||(t.DidSaveNotebookDocumentNotification={})).method="notebookDocument/didSave",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method),d.registrationMethod=u.method,(l=t.DidCloseNotebookDocumentNotification||(t.DidCloseNotebookDocumentNotification={})).method="notebookDocument/didClose",l.messageDirection=i.MessageDirection.clientToServer,l.type=new i.ProtocolNotificationType(l.method),l.registrationMethod=u.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,s,a;(a=t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,a.is=function(e){return e===a.type},(s=t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).method="window/workDoneProgress/create",s.messageDirection=o.MessageDirection.serverToClient,s.type=new o.ProtocolRequestType(s.method),(i=t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).method="window/workDoneProgress/cancel",i.messageDirection=o.MessageDirection.clientToServer,i.type=new o.ProtocolNotificationType(i.method)},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.messageDirection=r.MessageDirection.clientToServer,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=void 0;const r=n(6140);var o,i,s,a,c;(t.TokenFormat||(t.TokenFormat={})).Relative="relative",function(e){e.method="textDocument/semanticTokens",e.type=new r.RegistrationType(e.method)}(o=t.SemanticTokensRegistrationType||(t.SemanticTokensRegistrationType={})),(c=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",c.messageDirection=r.MessageDirection.clientToServer,c.type=new r.ProtocolRequestType(c.method),c.registrationMethod=o.method,(a=t.SemanticTokensDeltaRequest||(t.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType(a.method),a.registrationMethod=o.method,(s=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),s.registrationMethod=o.method,(i=t.SemanticTokensRefreshRequest||(t.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType0(i.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.messageDirection=r.MessageDirection.serverToClient,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},3693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;const r=n(6140);var o,i,s;(s=t.TypeHierarchyPrepareRequest||(t.TypeHierarchyPrepareRequest={})).method="textDocument/prepareTypeHierarchy",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.TypeHierarchySupertypesRequest||(t.TypeHierarchySupertypesRequest={})).method="typeHierarchy/supertypes",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.TypeHierarchySubtypesRequest||(t.TypeHierarchySubtypesRequest={})).method="typeHierarchy/subtypes",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},8744:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;const r=n(6140);var o,i;(i=t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).method="workspace/workspaceFolders",i.messageDirection=r.MessageDirection.serverToClient,i.type=new r.ProtocolRequestType0(i.method),(o=t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).method="workspace/didChangeWorkspaceFolders",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)},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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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(1661),t),t.createProtocolConnection=function(e,t,n,r){return(0,i.createMessageConnection)(e,t,n,r)}},6560:(e,t,n)=>{"use strict";e.exports=n(273)},1674:(e,t,n)=>{"use strict";var r,o,i,s,a,c,u,l,d,p,h,f,m,g,y,v,b,R,C,D,w,k,T,S,E,P,_,x;n.r(t),n.d(t,{AnnotatedTextEdit:()=>T,ChangeAnnotation:()=>w,ChangeAnnotationIdentifier:()=>k,CodeAction:()=>ie,CodeActionContext:()=>oe,CodeActionKind:()=>ne,CodeActionTriggerKind:()=>re,CodeDescription:()=>b,CodeLens:()=>se,Color:()=>d,ColorInformation:()=>p,ColorPresentation:()=>h,Command:()=>C,CompletionItem:()=>H,CompletionItemKind:()=>M,CompletionItemLabelDetails:()=>$,CompletionItemTag:()=>F,CompletionList:()=>V,CreateFile:()=>E,DeleteFile:()=>_,Diagnostic:()=>R,DiagnosticRelatedInformation:()=>g,DiagnosticSeverity:()=>y,DiagnosticTag:()=>v,DocumentHighlight:()=>X,DocumentHighlightKind:()=>G,DocumentLink:()=>ce,DocumentSymbol:()=>te,DocumentUri:()=>r,EOL:()=>Te,FoldingRange:()=>m,FoldingRangeKind:()=>f,FormattingOptions:()=>ae,Hover:()=>B,InlayHint:()=>be,InlayHintKind:()=>ye,InlayHintLabelPart:()=>ve,InlineValueContext:()=>ge,InlineValueEvaluatableExpression:()=>me,InlineValueText:()=>he,InlineValueVariableLookup:()=>fe,InsertReplaceEdit:()=>U,InsertTextFormat:()=>j,InsertTextMode:()=>W,Location:()=>u,LocationLink:()=>l,MarkedString:()=>K,MarkupContent:()=>L,MarkupKind:()=>A,OptionalVersionedTextDocumentIdentifier:()=>q,ParameterInformation:()=>z,Position:()=>a,Range:()=>c,RenameFile:()=>P,SelectionRange:()=>ue,SemanticTokenModifiers:()=>de,SemanticTokenTypes:()=>le,SemanticTokens:()=>pe,SignatureInformation:()=>Q,SymbolInformation:()=>Z,SymbolKind:()=>J,SymbolTag:()=>Y,TextDocument:()=>ke,TextDocumentEdit:()=>S,TextDocumentIdentifier:()=>N,TextDocumentItem:()=>I,TextEdit:()=>D,URI:()=>o,VersionedTextDocumentIdentifier:()=>O,WorkspaceChange:()=>we,WorkspaceEdit:()=>x,WorkspaceFolder:()=>Re,WorkspaceSymbol:()=>ee,integer:()=>i,uinteger:()=>s}),function(e){e.is=function(e){return"string"==typeof e}}(r||(r={})),function(e){e.is=function(e){return"string"==typeof e}}(o||(o={})),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(i||(i={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(s||(s={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=s.MAX_VALUE),t===Number.MAX_VALUE&&(t=s.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.uinteger(t.line)&&Se.uinteger(t.character)}}(a||(a={})),function(e){e.create=function(e,t,n,r){if(Se.uinteger(e)&&Se.uinteger(t)&&Se.uinteger(n)&&Se.uinteger(r))return{start:a.create(e,t),end:a.create(n,r)};if(a.is(e)&&a.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Se.objectLiteral(t)&&a.is(t.start)&&a.is(t.end)}}(c||(c={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&c.is(t.range)&&(Se.string(t.uri)||Se.undefined(t.uri))}}(u||(u={})),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 Se.objectLiteral(t)&&c.is(t.targetRange)&&Se.string(t.targetUri)&&c.is(t.targetSelectionRange)&&(c.is(t.originSelectionRange)||Se.undefined(t.originSelectionRange))}}(l||(l={})),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 Se.objectLiteral(t)&&Se.numberRange(t.red,0,1)&&Se.numberRange(t.green,0,1)&&Se.numberRange(t.blue,0,1)&&Se.numberRange(t.alpha,0,1)}}(d||(d={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&c.is(t.range)&&d.is(t.color)}}(p||(p={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.string(t.label)&&(Se.undefined(t.textEdit)||D.is(t))&&(Se.undefined(t.additionalTextEdits)||Se.typedArray(t.additionalTextEdits,D.is))}}(h||(h={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(f||(f={})),function(e){e.create=function(e,t,n,r,o,i){var s={startLine:e,endLine:t};return Se.defined(n)&&(s.startCharacter=n),Se.defined(r)&&(s.endCharacter=r),Se.defined(o)&&(s.kind=o),Se.defined(i)&&(s.collapsedText=i),s},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.uinteger(t.startLine)&&Se.uinteger(t.startLine)&&(Se.undefined(t.startCharacter)||Se.uinteger(t.startCharacter))&&(Se.undefined(t.endCharacter)||Se.uinteger(t.endCharacter))&&(Se.undefined(t.kind)||Se.string(t.kind))}}(m||(m={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Se.defined(t)&&u.is(t.location)&&Se.string(t.message)}}(g||(g={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(y||(y={})),function(e){e.Unnecessary=1,e.Deprecated=2}(v||(v={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.string(t.href)}}(b||(b={})),function(e){e.create=function(e,t,n,r,o,i){var s={range:e,message:t};return Se.defined(n)&&(s.severity=n),Se.defined(r)&&(s.code=r),Se.defined(o)&&(s.source=o),Se.defined(i)&&(s.relatedInformation=i),s},e.is=function(e){var t,n=e;return Se.defined(n)&&c.is(n.range)&&Se.string(n.message)&&(Se.number(n.severity)||Se.undefined(n.severity))&&(Se.integer(n.code)||Se.string(n.code)||Se.undefined(n.code))&&(Se.undefined(n.codeDescription)||Se.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Se.string(n.source)||Se.undefined(n.source))&&(Se.undefined(n.relatedInformation)||Se.typedArray(n.relatedInformation,g.is))}}(R||(R={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={title:e,command:t};return Se.defined(n)&&n.length>0&&(o.arguments=n),o},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.title)&&Se.string(t.command)}}(C||(C={})),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 Se.objectLiteral(t)&&Se.string(t.newText)&&c.is(t.range)}}(D||(D={})),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 Se.objectLiteral(t)&&Se.string(t.label)&&(Se.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Se.string(t.description)||void 0===t.description)}}(w||(w={})),function(e){e.is=function(e){var t=e;return Se.string(t)}}(k||(k={})),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 D.is(t)&&(w.is(t.annotationId)||k.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 Se.defined(t)&&q.is(t.textDocument)&&Array.isArray(t.edits)}}(S||(S={})),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&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(E||(E={})),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&&Se.string(t.oldUri)&&Se.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(P||(P={})),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&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Se.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Se.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(_||(_={})),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 Se.string(e.kind)?E.is(e)||P.is(e)||_.is(e):S.is(e)})))}}(x||(x={}));var N,O,q,I,A,L,M,j,F,U,W,$,H,V,K,B,z,Q,G,X,J,Y,Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce=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=D.insert(e,t):k.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=D.replace(e,t):k.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=D.del(e):k.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}(),De=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(k.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),we=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new De(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(S.is(e)){var n=new Ce(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ce(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(q.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 Ce(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 Ce(o),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new De,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)||k.is(t)?r=t:n=t,void 0===r?o=E.create(e,n):(i=k.is(r)?r:this._changeAnnotations.manage(r),o=E.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)||k.is(n)?o=n:r=n,void 0===o?i=P.create(e,t,r):(s=k.is(o)?o:this._changeAnnotations.manage(o),i=P.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)||k.is(t)?r=t:n=t,void 0===r?o=_.create(e,n):(i=k.is(r)?r:this._changeAnnotations.manage(r),o=_.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 Se.defined(t)&&Se.string(t.uri)}}(N||(N={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&Se.integer(t.version)}}(O||(O={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&(null===t.version||Se.integer(t.version))}}(q||(q={})),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 Se.defined(t)&&Se.string(t.uri)&&Se.string(t.languageId)&&Se.integer(t.version)&&Se.string(t.text)}}(I||(I={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(A||(A={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(e)&&A.is(t.kind)&&Se.string(t.value)}}(L||(L={})),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}(j||(j={})),function(e){e.Deprecated=1}(F||(F={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Se.string(t.newText)&&c.is(t.insert)&&c.is(t.replace)}}(U||(U={})),function(e){e.asIs=1,e.adjustIndentation=2}(W||(W={})),function(e){e.is=function(e){var t=e;return t&&(Se.string(t.detail)||void 0===t.detail)&&(Se.string(t.description)||void 0===t.description)}}($||($={})),function(e){e.create=function(e){return{label:e}}}(H||(H={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(V||(V={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Se.string(t)||Se.objectLiteral(t)&&Se.string(t.language)&&Se.string(t.value)}}(K||(K={})),function(e){e.is=function(e){var t=e;return!!t&&Se.objectLiteral(t)&&(L.is(t.contents)||K.is(t.contents)||Se.typedArray(t.contents,K.is))&&(void 0===e.range||c.is(e.range))}}(B||(B={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(z||(z={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={label:e};return Se.defined(t)&&(o.documentation=t),Se.defined(n)?o.parameters=n:o.parameters=[],o}}(Q||(Q={})),function(e){e.Text=1,e.Read=2,e.Write=3}(G||(G={})),function(e){e.create=function(e,t){var n={range:e};return Se.number(t)&&(n.kind=t),n}}(X||(X={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(J||(J={})),function(e){e.Deprecated=1}(Y||(Y={})),function(e){e.create=function(e,t,n,r,o){var i={name:e,kind:t,location:{uri:r,range:n}};return o&&(i.containerName=o),i}}(Z||(Z={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(ee||(ee={})),function(e){e.create=function(e,t,n,r,o,i){var s={name:e,detail:t,kind:n,range:r,selectionRange:o};return void 0!==i&&(s.children=i),s},e.is=function(e){var t=e;return t&&Se.string(t.name)&&Se.number(t.kind)&&c.is(t.range)&&c.is(t.selectionRange)&&(void 0===t.detail||Se.string(t.detail))&&(void 0===t.deprecated||Se.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(te||(te={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(ne||(ne={})),function(e){e.Invoked=1,e.Automatic=2}(re||(re={})),function(e){e.create=function(e,t,n){var r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){var t=e;return Se.defined(t)&&Se.typedArray(t.diagnostics,R.is)&&(void 0===t.only||Se.typedArray(t.only,Se.string))&&(void 0===t.triggerKind||t.triggerKind===re.Invoked||t.triggerKind===re.Automatic)}}(oe||(oe={})),function(e){e.create=function(e,t,n){var r={title:e},o=!0;return"string"==typeof t?(o=!1,r.kind=t):C.is(t)?r.command=t:r.edit=t,o&&void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&Se.string(t.title)&&(void 0===t.diagnostics||Se.typedArray(t.diagnostics,R.is))&&(void 0===t.kind||Se.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||C.is(t.command))&&(void 0===t.isPreferred||Se.boolean(t.isPreferred))&&(void 0===t.edit||x.is(t.edit))}}(ie||(ie={})),function(e){e.create=function(e,t){var n={range:e};return Se.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return Se.defined(t)&&c.is(t.range)&&(Se.undefined(t.command)||C.is(t.command))}}(se||(se={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.uinteger(t.tabSize)&&Se.boolean(t.insertSpaces)}}(ae||(ae={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return Se.defined(t)&&c.is(t.range)&&(Se.undefined(t.target)||Se.string(t.target))}}(ce||(ce={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return Se.objectLiteral(n)&&c.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(ue||(ue={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(le||(le={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(de||(de={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(pe||(pe={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&Se.string(t.text)}}(he||(he={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&Se.boolean(t.caseSensitiveLookup)&&(Se.string(t.variableName)||void 0===t.variableName)}}(fe||(fe={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&(Se.string(t.expression)||void 0===t.expression)}}(me||(me={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return Se.defined(t)&&c.is(e.stoppedLocation)}}(ge||(ge={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(ye||(ye={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&(void 0===t.tooltip||Se.string(t.tooltip)||L.is(t.tooltip))&&(void 0===t.location||u.is(t.location))&&(void 0===t.command||C.is(t.command))}}(ve||(ve={})),function(e){e.create=function(e,t,n){var r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return Se.objectLiteral(t)&&a.is(t.position)&&(Se.string(t.label)||Se.typedArray(t.label,ve.is))&&(void 0===t.kind||ye.is(t.kind))&&void 0===t.textEdits||Se.typedArray(t.textEdits,D.is)&&(void 0===t.tooltip||Se.string(t.tooltip)||L.is(t.tooltip))&&(void 0===t.paddingLeft||Se.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Se.boolean(t.paddingRight))}}(be||(be={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&o.is(t.uri)&&Se.string(t.name)}}(Re||(Re={}));var ke,Te=["\n","\r\n","\r"];!function(e){function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,o=e.slice(0,r),i=e.slice(r);t(o,n),t(i,n);for(var s=0,a=0,c=0;s<o.length&&a<i.length;){var u=n(o[s],i[a]);e[c++]=u<=0?o[s++]:i[a++]}for(;s<o.length;)e[c++]=o[s++];for(;a<i.length;)e[c++]=i[a++];return e}e.create=function(e,t,n,r){return new Ee(e,t,n,r)},e.is=function(e){var t=e;return!!(Se.defined(t)&&Se.string(t.uri)&&(Se.undefined(t.languageId)||Se.string(t.languageId))&&Se.uinteger(t.lineCount)&&Se.func(t.getText)&&Se.func(t.positionAt)&&Se.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),o=t(n,(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})),i=r.length,s=o.length-1;s>=0;s--){var a=o[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=i))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),i=c}return r}}(ke||(ke={}));var Se,Ee=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;r<t.length;r++){n&&(e.push(r),n=!1);var o=t.charAt(r);n="\r"===o||"\n"===o,"\r"===o&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&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 a.create(0,e);for(;n<r;){var o=Math.floor((n+r)/2);t[o]>e?r=o:n=o+1}var i=n-1;return a.create(i,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+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(Se||(Se={}))},6265:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const i=n(9817);Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return i.SemanticTokensBuilder}}),o(n(273),t);const s=n(8382);Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const a=n(9748);Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return a.NotebookDocuments}}),o(n(9891),t),(t.ProposedFeatures||(t.ProposedFeatures={})).all={__brand:"features"}},7985:(e,t,n)=>{"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;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=r.CallHierarchyOutgoingCallsRequest.type;return 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(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}}},6634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticFeature=void 0;const r=n(273);t.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(r.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(r.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(r.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(r.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(r.WorkspaceDiagnosticRequest.partialResult,t))))}}}},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){return this.connection.onNotification(r.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(r.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return 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)))}}},6507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintFeature=void 0;const r=n(273);t.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(r.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(r.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(r.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}}},8970:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueFeature=void 0;const r=n(273);t.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(r.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(r.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}}},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){return 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;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},9748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotebookDocuments=t.NotebookSyncFeature=void 0;const r=n(273),o=n(8382);t.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(r.DidOpenNotebookDocumentNotification.type,(t=>{e(t)})),onDidChangeNotebookDocument:e=>this.connection.onNotification(r.DidChangeNotebookDocumentNotification.type,(t=>{e(t)})),onDidSaveNotebookDocument:e=>this.connection.onNotification(r.DidSaveNotebookDocumentNotification.type,(t=>{e(t)})),onDidCloseNotebookDocument:e=>this.connection.onNotification(r.DidCloseNotebookDocumentNotification.type,(t=>{e(t)}))}}};class i{onDidOpenTextDocument(e){return this.openHandler=e,r.Disposable.create((()=>{this.openHandler=void 0}))}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,r.Disposable.create((()=>{this.changeHandler=e}))}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,r.Disposable.create((()=>{this.closeHandler=void 0}))}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return i.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return i.NULL_DISPOSE}onDidSaveTextDocument(){return i.NULL_DISPOSE}}i.NULL_DISPOSE=Object.freeze({dispose:()=>{}}),t.NotebookDocuments=class{constructor(e){e instanceof o.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new o.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new r.Emitter,this._onDidChange=new r.Emitter,this._onDidSave=new r.Emitter,this._onDidClose=new r.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){const t="string"==typeof e?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const t=new i,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument((e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(const n of e.cellTextDocuments)t.openTextDocument({textDocument:n});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)}))),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0===n)return;n.version=e.notebookDocument.version;const r=n.metadata;let o=!1;const i=e.change;void 0!==i.metadata&&(o=!0,n.metadata=i.metadata);const s=[],a=[],c=[],u=[];if(void 0!==i.cells){const e=i.cells;if(void 0!==e.structure){const r=e.structure.array;if(n.cells.splice(r.start,r.deleteCount,...void 0!==r.cells?r.cells:[]),void 0!==e.structure.didOpen)for(const n of e.structure.didOpen)t.openTextDocument({textDocument:n}),s.push(n.uri);if(e.structure.didClose)for(const n of e.structure.didClose)t.closeTextDocument({textDocument:n}),a.push(n.uri)}if(void 0!==e.data){const t=new Map(e.data.map((e=>[e.document,e])));for(let e=0;e<=n.cells.length;e++){const r=t.get(n.cells[e].document);if(void 0!==r){const o=n.cells.splice(e,1,r);if(c.push({old:o[0],new:r}),t.delete(r.document),0===t.size)break}}}if(void 0!==e.textContent)for(const n of e.textContent)t.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),u.push(n.document.uri)}this.updateCellMap(n);const l={notebookDocument:n};o&&(l.metadata={old:r,new:n.metadata});const d=[];for(const e of s)d.push(this.getNotebookCell(e));const p=[];for(const e of a)p.push(this.getNotebookCell(e));const h=[];for(const e of u)h.push(this.getNotebookCell(e));(d.length>0||p.length>0||c.length>0||h.length>0)&&(l.cells={added:d,removed:p,changed:{data:c,textContent:h}}),void 0===l.metadata&&void 0===l.cells||this._onDidChange.fire(l)}))),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument((e=>{const t=this.notebookDocuments.get(e.notebookDocument.uri);void 0!==t&&this._onDidSave.fire(t)}))),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0!==n){this._onDidClose.fire(n);for(const n of e.cellTextDocuments)t.closeTextDocument({textDocument:n});this.notebookDocuments.delete(e.notebookDocument.uri);for(const e of n.cells)this.notebookCellMap.delete(e.document)}}))),r.Disposable.create((()=>{n.forEach((e=>e.dispose()))}))}updateCellMap(e){for(const t of e.cells)this.notebookCellMap.set(t.document,[t,e])}}},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 u;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){super.initialize(e),!0===e?.window?.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=(0,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}(u||(u={}));class l{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(u.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 l(e,n)}},9817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensDiff=t.SemanticTokensFeature=void 0;const r=n(273);t.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(r.SemanticTokensRefreshRequest.type),on:e=>{const t=r.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=r.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=r.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class o{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){const e=this.originalSequence.length,t=this.modifiedSequence.length;let n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,o=t-1;for(;r>=n&&o>=n&&this.originalSequence[r]===this.modifiedSequence[o];)r--,o--;(r<n||o<n)&&(r++,o++);const i=r-n+1,s=this.modifiedSequence.slice(n,o+1);return 1===s.length&&s[0]===this.originalSequence[r]?[{start:n,deleteCount:i-1}]:[{start:n,deleteCount:i,data:s}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}}t.SemanticTokensDiff=o,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(){return void 0!==this._prevData?{resultId:this.id,edits:new o(this._prevData,this._data).computeDiff()}:this.build()}}},9891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineNotebooksFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._NotebooksImpl=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=void 0;const r=n(273),o=n(289),i=n(7560),s=n(2731),a=n(2507),c=n(1836),u=n(7985),l=n(9817),d=n(5421),p=n(828),h=n(2776),f=n(4606),m=n(8970),g=n(6507),y=n(6634),v=n(9748),b=n(8120);function R(e){if(null!==e)return e}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 C{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}).catch((()=>{(0,r.RAL)().console.error("Sending log message failed")}))}}const D=(0,d.ShowDocumentFeature)((0,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(R)}showWarningMessage(e,...t){let n={type:r.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(R)}showInformationMessage(e,...t){let n={type:r.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(R)}}));(t.BulkRegistration||(t.BulkRegistration={})).create=function(){return new w};class w{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 k(void 0,[])};class k{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).catch((()=>{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 T{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 w?this.registerMany(e):e instanceof k?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).catch((()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)}))}))),(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).catch((()=>{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 k(this._connection,t.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const S=(0,p.FileOperationsFeature)((0,c.WorkspaceFoldersFeature)((0,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 E{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}).catch((()=>{}))}}class P{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).catch((()=>{this.connection.console.log("Sending TelemetryEventNotification failed")}))}}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){}attachWorkDoneProgress(e){return(0,s.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,s.attachPartialResult)(this.connection,t)}}t._LanguagesImpl=_;const x=(0,b.MonikerFeature)((0,y.DiagnosticFeature)((0,g.InlayHintFeature)((0,m.InlineValueFeature)((0,f.TypeHierarchyFeature)((0,h.LinkedEditingRangeFeature)((0,l.SemanticTokensFeature)((0,u.CallHierarchyFeature)(_))))))));class N{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(0,s.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,s.attachPartialResult)(this.connection,t)}}t._NotebooksImpl=N;const O=(0,v.NotebookSyncFeature)(N);function q(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function A(e,t){return function(n){return t(e(n))}}function L(e,t){return function(n){return t(e(n))}}function M(e,t){return function(n){return t(e(n))}}function j(e,t){return function(n){return t(e(n))}}function F(e,t){return function(n){return t(e(n))}}function U(e,t){return function(n){return t(e(n))}}t.combineConsoleFeatures=q,t.combineTelemetryFeatures=I,t.combineTracerFeatures=A,t.combineClientFeatures=L,t.combineWindowFeatures=M,t.combineWorkspaceFeatures=j,t.combineLanguagesFeatures=F,t.combineNotebooksFeatures=U,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,q),tracer:n(e.tracer,t.tracer,A),telemetry:n(e.telemetry,t.telemetry,I),client:n(e.client,t.client,L),window:n(e.window,t.window,M),workspace:n(e.workspace,t.workspace,j),languages:n(e.languages,t.languages,F),notebooks:n(e.notebooks,t.notebooks,U)}},t.createConnection=function(e,t,n){const i=n&&n.console?new(n.console(C)):new C,a=e(i);i.rawAttach(a);const c=n&&n.tracer?new(n.tracer(E)):new E,u=n&&n.telemetry?new(n.telemetry(P)):new P,l=n&&n.client?new(n.client(T)):new T,d=n&&n.window?new(n.window(D)):new D,p=n&&n.workspace?new(n.workspace(S)):new S,h=n&&n.languages?new(n.languages(x)):new x,f=n&&n.notebooks?new(n.notebooks(O)):new O,m=[i,c,u,l,d,p,h,f];let g,y,v,b={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;return 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=>(y=e,{dispose:()=>{y=void 0}}),onInitialized:e=>a.onNotification(r.InitializedNotification.type,e),onShutdown:e=>(g=e,{dispose:()=>{g=void 0}}),onExit:e=>(v=e,{dispose:()=>{v=void 0}}),get console(){return i},get telemetry(){return u},get tracer(){return c},get client(){return l},get window(){return d},get workspace(){return p},get languages(){return h},get notebooks(){return f},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,(0,s.attachWorkDone)(a,t),void 0))),onCompletion:e=>a.onRequest(r.CompletionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onCompletionResolve:e=>a.onRequest(r.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(r.SignatureHelpRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),void 0))),onDeclaration:e=>a.onRequest(r.DeclarationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDefinition:e=>a.onRequest(r.DefinitionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onTypeDefinition:e=>a.onRequest(r.TypeDefinitionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onImplementation:e=>a.onRequest(r.ImplementationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onReferences:e=>a.onRequest(r.ReferencesRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDocumentHighlight:e=>a.onRequest(r.DocumentHighlightRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDocumentSymbol:e=>a.onRequest(r.DocumentSymbolRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onWorkspaceSymbol:e=>a.onRequest(r.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onWorkspaceSymbolResolve:e=>a.onRequest(r.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>a.onRequest(r.CodeActionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(r.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,(0,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,(0,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,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onColorPresentation:e=>a.onRequest(r.ColorPresentationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onFoldingRanges:e=>a.onRequest(r.FoldingRangeRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onSelectionRanges:e=>a.onRequest(r.SelectionRangeRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onExecuteCommand:e=>a.onRequest(r.ExecuteCommandRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),void 0))),dispose:()=>a.dispose()};for(let e of m)e.attach(b);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 m)t.initialize(e.capabilities);if(y){let t=y(e,(new r.CancellationTokenSource).token,(0,s.attachWorkDone)(a,e),void 0);return(n=t,n instanceof Promise?n:o.thenable(n)?new Promise(((e,t)=>{n.then((t=>e(t)),(e=>t(e)))})):Promise.resolve(n)).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(b.__textDocumentSync)?b.__textDocumentSync:r.TextDocumentSyncKind.None:o.number(n.textDocumentSync)||o.number(n.textDocumentSync.change)||(n.textDocumentSync.change=o.number(b.__textDocumentSync)?b.__textDocumentSync:r.TextDocumentSyncKind.None);for(let e of m)e.fillServerCapabilities(n);return t}))}{let e={capabilities:{textDocumentSync:r.TextDocumentSyncKind.None}};for(let t of m)t.fillServerCapabilities(e.capabilities);return e}var n})),a.onRequest(r.ShutdownRequest.type,(()=>(t.shutdownReceived=!0,g?g((new r.CancellationTokenSource).token):void 0))),a.onNotification(r.ExitNotification.type,(()=>{try{v&&v()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}})),a.onNotification(r.SetTraceNotification.type,(e=>{c.trace=r.Trace.fromString(e.value)})),b}},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)}}},8382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocuments=void 0;const r=n(273);t.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,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 onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.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._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=r.TextDocumentSyncKind.Incremental;const t=[];return t.push(e.onDidOpenTextDocument((e=>{const t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);const r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)}))),t.push(e.onDidChangeTextDocument((e=>{const t=e.textDocument,n=e.contentChanges;if(0===n.length)return;const{version:r}=t;if(null==r)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);let o=this._syncedDocuments.get(t.uri);void 0!==o&&(o=this._configuration.update(o,n,r),this._syncedDocuments.set(t.uri,o),this._onDidChangeContent.fire(Object.freeze({document:o})))}))),t.push(e.onDidCloseTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))}))),t.push(e.onWillSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))}))),t.push(e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return void 0!==n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]}))),t.push(e.onDidSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onDidSave.fire(Object.freeze({document:t}))}))),r.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}}},4606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyFeature=void 0;const r=n(273);t.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(r.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=r.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=r.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},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()}},1836:(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{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.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)})))}fillServerCapabilities(e){super.fillServerCapabilities(e);const t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=!0===t||"string"==typeof t}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._notificationIsAutoRegistered||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="NODE_PATH",c=["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(((u,l)=>{let d=process.env,p=Object.create(null);Object.keys(d).forEach((e=>p[e]=d[e])),t&&i.existsSync(t)&&(p[a]?p[a]=t+o.delimiter+p[a]:p[a]=t,r&&r(`NODE_PATH value is: ${p[a]}`)),p.ELECTRON_RUN_AS_NODE="1";try{let t=(0,s.fork)("",[],{cwd:n,env:p,execArgv:["-e",c]});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?u(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let r={c:"rs",a:e};t.send(r)}catch(e){l(e)}}))}function u(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=(0,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 l;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;i<s;i++)n[i]=decodeURIComponent(n[i]);if("win32"===process.platform&&n.length>1){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=u,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=(0,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())}}(l=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=>l.isParent(n,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>c(t,u(r),e,r)))):c(t,u(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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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);function u(){0}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 d,p=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(d=setInterval((()=>{try{process.kill(t,0)}catch(e){u(),process.exit(p?0:1)}}),3e3))}catch(e){}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length)return void t(process.argv[n+1]);{let n=r.split("=");n[0]===e&&t(n[1])}}}();const h={initialize:e=>{const t=e.processId;i.number(t)&&void 0===d&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(p?0:1)}}),3e3)},get shutdownReceived(){return p},set shutdownReceived(e){p=e},exit:e=>{u(),process.exit(e)}};t.createConnection=function(e,t,n,r){let o,a,l,d;return void 0!==e&&"features"===e.__brand&&(o=e,e=t,t=n,n=r),c.ConnectionStrategy.is(e)||c.ConnectionOptions.is(e)?d=e:(a=e,l=t,d=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<i.length;s++){let a=i[s];if("--node-ipc"===a){e=new c.IPCMessageReader(process),t=new c.IPCMessageWriter(process);break}if("--stdio"===a){e=process.stdin,t=process.stdout;break}if("--socket"===a){n=parseInt(i[s+1]);break}if("--pipe"===a){r=i[s+1];break}var o=a.split("=");if("--socket"===o[0]){n=parseInt(o[1]);break}if("--pipe"===o[0]){r=o[1];break}}if(n){let r=(0,c.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,c.createServerPipeTransport)(r);e=n[0],t=n[1]}}var a="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+a);if(!t)throw new Error("Connection output stream is not set. "+a);if(i.func(e.read)&&i.func(e.on)){let t=e;t.on("end",(()=>{u(),process.exit(p?0:1)})),t.on("close",(()=>{u(),process.exit(p?0:1)}))}return(0,s.createConnection)((r=>(0,c.createProtocolConnection)(e,t,r,n)),h,r)}(a,l,d,o)}},8212:(e,t,n)=>{"use strict";e.exports=n(5809)},2479:e=>{e.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),o=e[e.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach((function(e){r[e]=o[e]})),r}}},9491:e=>{"use strict";e.exports=require("assert")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")}},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.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";n.r(r);var e,t=n(8212),o=n(5809);class i{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(i.isIncremental(t)){const e=c(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 s=this._lineOffsets;const u=a(t.text,!1,n);if(i-o===u.length)for(let e=0,t=u.length;e<t;e++)s[e+o+1]=u[e];else u.length<1e4?s.splice(o+1,i-o,...u):this._lineOffsets=s=s.slice(0,o+1).concat(u,s.slice(i+1));const l=t.text.length-(r-n);if(0!==l)for(let e=o+1+u.length,t=s.length;e<t;e++)s[e]=s[e]+l}else{if(!i.isFull(t))throw new Error("Unknown change event received");this._content=t.text,this._lineOffsets=void 0}this._version=t}getLineOffsets(){return void 0===this._lineOffsets&&(this._lineOffsets=a(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};for(;n<r;){let o=Math.floor((n+r)/2);t[o]>e?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+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}function s(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);s(r,t),s(o,t);let i=0,a=0,c=0;for(;i<r.length&&a<o.length;){let n=t(r[i],o[a]);e[c++]=n<=0?r[i++]:o[a++]}for(;i<r.length;)e[c++]=r[i++];for(;a<o.length;)e[c++]=o[a++];return e}function a(e,t,n=0){const r=t?[n]:[];for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);13!==o&&10!==o||(13===o&&t+1<e.length&&10===e.charCodeAt(t+1)&&t++,r.push(n+t+1))}return r}function c(e){const t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function u(e){const 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){let n=e.getText(),r=s(t.map(u),((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 i=[];for(const t of r){let r=e.offsetAt(t.range.start);if(r<o)throw new Error("Overlapping edit");r>o&&i.push(n.substring(o,r)),t.newText.length&&i.push(t.newText),o=e.offsetAt(t.range.end)}return i.push(n.substr(o)),i.join("")}}(e||(e={}));var l=Object.defineProperty,d=Object.defineProperties,p=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y=(e,t)=>{for(var n in t||(t={}))f.call(t,n)&&g(e,n,t[n]);if(h)for(var n of h(t))m.call(t,n)&&g(e,n,t[n]);return e};const v=[{name:"FORMAT_STATEMEMT",match:[{type:"asterisk"},{type:"asterisk"},{type:"word"}],becomes:{type:"format"}},{name:"DIRECTIVE",match:[{type:"divide"},{type:"word",match:e=>["TITLE","EJECT","SPACE","COPY","INCLUDE","SET","RESTORE","OVERLOAD","DEFINE","UNDEFINED","IF","ELSE","ELSEIF","ENDIF","EOF","CHARCOUNT"].includes(e.toUpperCase())}],becomes:{type:"directive"}},{name:"IS_NUMBER",match:[{type:"number"},{type:"dot"},{type:"number"}],becomes:{type:"number"}},{name:"IS_SPECIAL",match:[{type:"asterisk"},{type:"word",match:e=>["CTDATA","BLANK","BLANKS","ZERO","ZEROS","ON","OFF","NULL","ISO","MDY","DMY","EUR","YMD","USA","SECONDS","S","MINUTES","MN","HOURS","H","DAYS","D","MONTHS","M","YEARS","Y","HIVAL","END","LOVAL","START","N","OMIT","STRING","CWIDEN","CONVERT"].includes(e.toUpperCase())||e.toUpperCase().startsWith("IN")}],becomes:{type:"special"}},{name:"HEX",match:[{type:"word",match:e=>"x"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"TIME",match:[{type:"word",match:e=>"t"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"DATE",match:[{type:"word",match:e=>"d"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"DECLARE",match:[{type:"word",match:e=>"DCL"===e.toUpperCase()},{type:"minus"},{type:"word"}],becomes:{type:"declare"}},{name:"END",match:[{type:"word",match:e=>"END"===e.toUpperCase()},{type:"minus"},{type:"word"}],becomes:{type:"end"}},{name:"DECLARE_SUB",match:[{type:"word",match:e=>"BEGSR"===e.toUpperCase()}],becomes:{type:"declare"}},{name:"END_SUB",match:[{type:"word",match:e=>"ENDSR"===e.toUpperCase()}],becomes:{type:"end"}},{name:"FOR-EACH",match:[{type:"word",match:e=>"FOR"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"EACH"===e.toUpperCase()}],becomes:{type:"word"}},{name:"EVAL-CORR",match:[{type:"word",match:e=>"EVAL"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"CORR"===e.toUpperCase()}],becomes:{type:"word"}},{name:"ON-EXIT",match:[{type:"word",match:e=>"ON"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"EXIT"===e.toUpperCase()}],becomes:{type:"word"}},{name:"CTL-OPT",match:[{type:"word",match:e=>"CTL"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"OPT"===e.toUpperCase()}],becomes:{type:"declare"}},{name:"BIF",match:[{type:"percent"},{type:"word"}],becomes:{type:"builtin"}},{name:"ON-ERROR",match:[{type:"word",match:e=>"ON"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"ERROR"===e.toUpperCase()}],becomes:{type:"word"}},{name:"NEWLINE",match:[{type:"newliner"},{type:"newline"}],becomes:{type:"newline"}}],b=["%",".","(",")","+","-","*","/","=",":",",",";","\n","\r"," "],R={"%":"percent",".":"dot","(":"openbracket",")":"closebracket","+":"plus","-":"minus","/":"divide","*":"asterisk","=":"equal",":":"seperator",";":"semicolon",",":"comma","\n":"newline","\r":"newliner"};function C(e){let t=0,n=-1,r="Normal",o=[],i=0,s="";for(let a=0;a<e.length;a++)"Normal"===r&&e[a]&&e[a+1]&&"//"===e.substring(a,a+2)?(n=a,s="//",r="Comment",a++):"Comment"===r&&"\n"===e[a]?(r="Normal",o.push({value:s,type:"comment",range:{start:n,end:a-1,line:t}},{value:e[a],type:"newline",range:{start:a,end:a+e[a].length,line:t}}),s="",i=a+1):"Comment"===r||"String"===r&&"'"!==e[a]?s+=e[a]:"'"===e[a]?("String"===r?(s+=e[a],o.push({value:s,type:"string",range:{start:i,end:i+s.length,line:t}}),s=""):(i=a,s+=e[a]),r="String"===r?"Normal":"String"):b.includes(e[a])&&"Normal"===r?(""!==s.trim()&&(o.push({value:s,type:"word",range:{start:i,end:i+s.length,line:t}}),s="")," "!==e[a]&&o.push({value:e[a],type:R[e[a]],range:{start:a,end:a+e[a].length,line:t}}),i=a+1):s+=e[a],"\n"===e[a]&&t++;return""!==s.trim()&&"Comment"!==r?(o.push({value:s,type:"Normal"===r?"word":"string",range:{start:i,end:i+s.length,line:t}}),s=""):o.push({value:s,type:"comment",range:{start:i,end:i+s.length,line:t}}),o=function(e){for(let r=0;r<e.length;r++)for(let o=0;o<v.length;o++){const i=v[o];let s=!0;for(let t=0;t<i.match.length;t++){const n=i.match[t];if(e[r+t]){if(e[r+t].type!==n.type){s=!1;break}if(n.match){if(!n.match(e[r+t].value)){s=!1;break}s=!0}else s=!0}else s=!1}if(s){const o=e.slice(r,r+i.match.length);e.splice(r,i.match.length,(t=y({},i.becomes),n={value:o.map((e=>e.value)).join(""),range:{start:o[0].range.start,end:o[o.length-1].range.end,line:o[0].range.line}},d(t,p(n))));break}}var t,n;return e}(o),o}function D(e){let t=0,n=0;for(let r=0;r<e.length;r++)switch(e[r].type){case"openbracket":0===n&&(t=r),n++;break;case"closebracket":if(n--,0===n){const n=e.slice(t+1,r);e.splice(t,r-t+1,{type:"block",block:D(n),range:{line:e[t].range.line,start:e[r].range.start,end:e[r].range.end}}),r=t}}return e}class w{constructor(e){this.type=e,this.name="",this.keywords=[],this.keyword={},this.description="",this.tags=[],this.position=void 0,this.references=[],this.subItems=[],this.readParms=!1,this.range={start:null,end:null},this.scope=void 0}clone(){const e=new w(this.type);return e.name=this.name,e.keywords=[...this.keywords],e.description=this.description,e.tags=this.tags,this.position&&(e.position={path:this.position.path,line:this.position.line}),e.subItems=this.subItems.map((e=>e.clone())),e.range={start:this.range.start,end:this.range.end},e}}const k=[...Array(98).keys(),"LR","KL"].map((e=>`IN${e.toString().padStart(2,"0")}`)).map((e=>{const t=new w("variable");return t.name=e,t.keywords=["IND"],t}));class T{constructor(e={}){this.keyword={},this.parameters=e.parameters||[],this.subroutines=e.subroutines||[],this.procedures=e.procedures||[],this.files=e.files||[],this.variables=e.variables||[],this.structs=e.structs||[],this.constants=e.constants||[],this.sqlReferences=e.sqlReferences||[],this.indicators=e.indicators||[...k],this.includes=e.includes||[]}merge(e){return e?new T({parameters:[...this.parameters,...e.parameters],subroutines:[...this.subroutines,...e.subroutines],procedures:[...this.procedures,...e.procedures],variables:[...this.variables,...e.variables],files:[...this.files,...e.files],structs:[...this.structs,...e.structs],constants:[...this.constants,...e.constants],sqlReferences:[...this.sqlReferences,...e.sqlReferences],indicators:[...this.indicators,...e.indicators]}):this}getNames(){const e=this.files.map((e=>e.subItems.map((e=>e.name)))).flat();return[...this.parameters.map((e=>e.name)),...this.constants.map((e=>e.name)),...this.procedures.map((e=>e.name)),...this.files.map((e=>e.name)),...e,...this.subroutines.map((e=>e.name)),...this.variables.map((e=>e.name)),...this.structs.map((e=>e.name))].filter((e=>e))}getDefinitionBlockEnd(e){const t=[this.procedures.filter((t=>t.position.path===e&&void 0!==t.keyword.EXTPROC)).pop(),this.structs.filter((t=>t.position.path===e)).pop(),this.variables.filter((t=>t.position.path===e)).pop(),this.constants.filter((t=>t.position.path===e)).pop(),this.files.filter((t=>t.position.path===e)).pop()].filter((e=>void 0!==e)).map((e=>e.range&&e.range.end?e.range.end:e.position.line)).sort(((e,t)=>t-e));return t.length>=1?t[0]:0}find(e){e=e.toUpperCase();const t=[...this.files.map((e=>e.subItems)).flat(),...this.structs],n=[...this.parameters.filter((t=>t.name.toUpperCase()===e)),...this.constants.filter((t=>t.name.toUpperCase()===e)),...this.procedures.filter((t=>t.name.toUpperCase()===e)),...this.files.filter((t=>t.name.toUpperCase()===e)),...t.filter((t=>t.name.toUpperCase()===e)),...this.subroutines.filter((t=>t.name.toUpperCase()===e)),...this.variables.filter((t=>t.name.toUpperCase()===e)),...this.indicators.filter((t=>t.name.toUpperCase()===e))];return t.length>0&&0===n.length&&t.filter((e=>!0!==e.keyword.QUALIFIED)).forEach((t=>{n.push(...t.subItems.filter((t=>t.name.toUpperCase()===e)))})),n.length>0?n[0]:null}clearReferences(){[...this.parameters,...this.constants,...this.files,...this.procedures,...this.subroutines,...this.variables,...this.structs].forEach((e=>{e.references=[]})),this.procedures.forEach((e=>{e.scope&&e.scope.clearReferences()})),[...this.files.map((e=>e.subItems)).flat(),...this.structs].forEach((e=>{e.subItems.forEach((e=>e.references=[]))}))}findDefinition(e,t){const n=this.procedures.find((t=>e>=t.range.start&&e<=t.range.end));if(n&&n.scope){const e=n.scope.find(t);if(e)return e}const r=this.find(t);if(r)return r}fixProcedures(){this.procedures.length>0&&this.procedures.forEach((e=>{e.scope&&e.subItems.length>0&&(e.scope.parameters=[...e.subItems],e.scope.fixProcedures())}))}}const S={"DCL-DS":["LIKEDS","LIKEREC","END-DS"],"DCL-PI":["END-PI"],"DCL-PR":["OVERLOAD","END-PR"]};function E(e){return{name:e.substr(6,10).trim(),keywords:e.substr(43).trim().split(" ").filter((e=>""!==e))}}function P(e){const t=(e=e.padEnd(80)).substr(11,14).trim(),n=e.substr(25,10).trim().toUpperCase(),r=e.substr(35,14).trim(),o=e.substr(35).trim();return{opcode:n,factor1:t,factor2:r,result:e.substr(49,14).trim(),extended:o,ind1:e.substr(70,2).trim(),ind2:e.substr(72,2).trim(),ind3:e.substr(74,2).trim()}}function _(e){return{potentialName:(e=e.padEnd(80)).substring(6).trim(),name:e.substr(6,15).trim(),pos:e.substr(25,7).trim(),len:e.substr(32,7).trim(),type:e.substr(39,1).trim(),decimals:e.substr(40,3).trim(),field:e.substr(23,2).trim().toUpperCase(),keywords:e.substr(43).trim().toUpperCase().split(" ").filter((e=>""!==e))}}function x(e){const t=(e=e.padEnd(80)).substr(6,16).trim(),n=e.substring(6).trim(),r="B"===e[23].toUpperCase();return{name:t,potentialName:n,keywords:e.substr(43).trim().toUpperCase().split(" ").filter((e=>""!==e)),start:r}}function N(e){let t="",n=Number(e.len);switch(e.pos&&(n=n-Number(e.pos)+1),e.type.toUpperCase()){case"A":e.keywords.indexOf("VARYING")>=0?(t="Varchar",n-=2):t="Char",t+="("+n+")";break;case"B":t=""!=e.pos?4==Number(e.len)?"Bindec(9)":"Bindec(4)":"Bindec("+e.len+")";break;case"C":t="Ucs2("+e.len+")";break;case"D":case"L":t="Date";break;case"F":t="Float("+e.len+")";break;case"G":t=e.keywords.indexOf("VARYING")>=0?"Vargraph":"Graph",t+="("+e.len+")";break;case"I":switch(n){case 1:t="Int(3)";break;case 2:t="Int(5)";break;case 4:t="Int(10)";break;case 8:t="Int(20)";break;default:t="Int("+n+")"}break;case"N":t="Ind";break;case"P":t="Packed("+n+":"+e.decimals+")";break;case"S":t="Zoned("+n+":"+e.decimals+")";break;case"T":t="Time";break;case"U":switch(n){case 1:t="Uns(3)";break;case 2:t="Uns(5)";break;case 4:t="Uns(10)";break;case 8:t="Uns(20)";break;default:t="Uns("+n+")"}break;case"Z":t="Timestamp",t+="("+n+")";break;case"*":t="Pointer";break;case"":"DS"==e.field?t="lineData.Len("+e.len+")":""!=e.len&&(""==e.decimals?(t=e.keywords.indexOf("VARYING")>=0?"Varchar":"Char",t+="("+n+")"):t=""===e.field?"Zoned("+n+":"+e.decimals+")":"Packed("+n+":"+e.decimals+")")}return t.toUpperCase()}class O{constructor(){this.parsedCache={},this.tables={},this.tableFetch=void 0,this.includeFileFetch=void 0}setTableFetch(e){this.tableFetch=e}setIncludeFileFetch(e){this.includeFileFetch=e}async fetchTable(e,t="",n){if(void 0===e||e&&""===e.trim())return[];if(!this.tableFetch)return[];const r=e.toUpperCase(),o=r,i=Date.now();if(this.tables[o]){if(this.tables[o].fetching)return[];if(i<=this.tables[o].fetched+18e5)return this.tables[o].recordFormats.map((e=>e.clone()))}let s;this.tables[o]={fetching:!0,fetched:0,recordFormats:[]};try{s=await this.tableFetch(r,n),this.tables[o]={fetched:i,recordFormats:s}}catch(e){this.tables[o]={fetched:i,recordFormats:[]},s=[]}return this.tables[o].fetching=!1,s.map((e=>e.clone()))}clearParsedCache(e){this.parsedCache[e]=void 0}getParsedCache(e){return this.parsedCache[e]}static getIncludeFromDirective(e){if(e.includes("*"))return;const t=e.toUpperCase();let n=t.indexOf("/COPY "),r=6;return-1===n&&(n=t.indexOf("/INCLUDE "),r=9),n>=0?e.substring(n+r).trim():void 0}async getDocs(e,t,n={withIncludes:!0}){const r=this.getParsedCache(e);if(!0!==n.ignoreCache&&r)return r;if(!t)return null;const o={};let i,s,a,c,u,l,d,p,h=t.replace(new RegExp("\\\r","g"),"").split("\n"),f=[],m=[],g=!1,y=!1,v=[],b=[],R=[];v.push(new T);const C=(e,t)=>{let n=e;return["EXTFILE"].forEach((e=>{const r=t.find((t=>t.startsWith(`${e}(`)&&t.endsWith(")")));r&&(n=r.substring(e.length+1,r.length-1).toUpperCase(),n.startsWith("'")&&n.endsWith("'")&&(n=n.substring(1,n.length-1)))})),"*EXTDESC"===n&&["EXTDESC"].forEach((e=>{const r=t.find((t=>t.startsWith(`${e}(`)&&t.endsWith(")")));r&&(n=r.substring(e.length+1,r.length-1).toUpperCase(),n.startsWith("'")&&n.endsWith("'")&&(n=n.substring(1,n.length-1)))})),n},D=async(e,t)=>{const n=["LIKEDS","LIKEREC","EXTNAME"];for(const r of n){const n=t.keywords.find((e=>e.startsWith(`${r}(`)&&e.endsWith(")")));if(n){let o=n.substring(r.length+1,n.length-1).toUpperCase();if(o.includes(":")){const e=o.split(":").filter((e=>!1===e.trim().startsWith("*")));if(!(e.length>0))break;o=e[0]}if(o.startsWith("'")&&o.endsWith("'")&&(o=o.substring(1,o.length-1)),["EXTNAME"].includes(r)){t.keywords.includes("QUALIFIED")||t.keywords.push("QUALIFIED");const n=await this.fetchTable(o,t.keywords.length.toString(),t.keywords.includes("ALIAS"));n.length>0&&n.forEach((n=>{n.subItems.forEach((t=>{t.position={path:e,line:u}})),t.subItems.push(...n.subItems)}))}else for(let e=v.length-1;e>=0;e--){const n=v[e].structs.find((e=>e.name.toUpperCase()===o));if(n)return t.subItems=n.subItems,void(t.keywords.includes("QUALIFIED")||t.keywords.push("QUALIFIED"))}}}};if(n.withIncludes&&this.includeFileFetch)for(let t=h.length-1;t>=0;t--){let n=h[t];if(""===n)continue;const r=O.getIncludeFromDirective(n);if(r){const n=await this.includeFileFetch(e,r);n.found&&(o[n.uri]=n.lines,v[0].includes.push({toPath:n.uri,line:t}))}}let k;o[e]=h;let q,I=!1,A=!1;for(const e of Object.keys(o)){if(0===o[e].length)continue;u=-1,A=o[e][0].toUpperCase().startsWith("**FREE");let t,n,r=!1,h=0;for(let L of o[e]){const o=v[v.length-1];let M;if(r=!1,u+=1,L.startsWith("**")){if(0===u)continue;break}if(!1===A&&L.length>6){const e=L[6];if(M=L[5].toUpperCase(),"*"===e)continue;if("/"===e)L=L.substring(6),r=!0;else if(" "===M)L=L.substring(7),r=!0;else{if(!["D","P","C","F","H"].includes(M))continue;if("C"===M){const e=L.toUpperCase();if(!1===["BEGSR","ENDSR","CALL"].some((t=>e.includes(t))))continue}}L.length>80&&(L=L.substring(0,80))}if(p=[],l=[],A||r){if(L=L.trim(),""===L)continue;p=L.split(";"),l=p[0].toUpperCase().split(" ").filter((e=>""!==e)),d=p[0].split(" ").filter((e=>""!==e));const r=L.startsWith("//");if(!r){if("/EOF"===l[0]&&0===h)break;if("/IF"===l[0]){h+=1;continue}if("/ENDIF"===l[0]){h-=1;continue}if(h>0)continue;if(L.startsWith("/"))continue}if(p.length>1&&p[1].includes("//")&&(L=p[0]+";"),t||(n=u),!r)if(L.endsWith(";"))t&&(L=t+L,t=void 0,p=L.split(";"),l=p[0].toUpperCase().split(" ").filter((e=>""!==e)),d=p[0].split(" ").filter((e=>""!==e)));else if(!L.endsWith(";")){t=(t||"")+L.trim(),t.endsWith("-")?t=t.substring(0,t.length-1):t+=" ";continue}switch(l[0]){case"CTL-OPT":R.push(...l.slice(1));break;case"DCL-F":if(void 0===s&&l.length>1){s=new w("file"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.position={path:e,line:u};const t=C(l[1],l);let n="";l.find((e=>{if(e.toUpperCase().includes("PREFIX"))return n=e.trim().substring(7,e.indexOf(")")),!0}));const r=await this.fetchTable(t,l.length.toString(),l.includes("ALIAS"));if(r.length>0){const e=l.includes("QUALIFIED");r.forEach((t=>{t.keywords=[l[1]],e&&t.keywords.push("QUALIFIED"),t.position=s.position,t.subItems.forEach((e=>{n&&(e.name=n+e.name),e.position=s.position}))})),s.subItems.push(...r)}o.files.push(s),g=!0}break;case"DCL-C":void 0===s&&l.length>1&&(s=new w("constant"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.position={path:e,line:n},o.constants.push(s),g=!0);break;case"DCL-S":l.length>1&&void 0===s&&(s=new w("variable"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},o.variables.push(s),g=!0);break;case"DCL-DS":void 0===s&&l.length>1&&(s=new w("struct"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.range={start:n,end:n},q="structs",await D(e,s),s.keywords.some((e=>S["DCL-DS"].some((t=>e.startsWith(t)))))?(s.range.end=n,o.structs.push(s)):(s.readParms=!0,b.push(s)),g=!0,f=[]);break;case"END-DS":b.length>0&&(b[b.length-1].range.end=n),1===b.length?o.structs.push(b.pop()):b.length>1&&b[b.length-2].subItems.push(b.pop());break;case"DCL-PR":void 0===s&&l.length>1&&(o.procedures.find((e=>e.name&&e.name.toUpperCase()===l[1]))||(q="procedures",s=new w("procedure"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.readParms=!0,s.range={start:n,end:n},s.keywords.some((e=>S["DCL-PR"].some((t=>e.startsWith(t)))))&&(s.range.end=n,o.procedures.push(s),g=!0),f=[]));break;case"END-PR":s&&"procedure"===s.type&&(s.range.end=n,v[0].procedures.some((e=>e.name.toUpperCase()===s.name.toUpperCase()))||o.procedures.push(s),g=!0);break;case"DCL-PROC":if(l.length>1){const t=o.procedures.findIndex((e=>e.name&&e.name.toUpperCase()===l[1]));t>=0&&o.procedures.splice(t,1),s=new w("procedure"),c=d[1],s.name=c,s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.readParms=!1,s.range={start:n,end:n},o.procedures.push(s),g=!0,v.push(new T)}break;case"DCL-PI":if(c&&l.length>0){q="procedures",s=v[0].procedures.find((e=>e.name===c));const e=l.findIndex((e=>"END-PI"===e));s&&(e>=0&&(l.splice(e,1),s.readParms=!1,g=!0),s.keywords.push(...l.slice(2)),s.readParms=!0,f=[])}break;case"END-PI":s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.readParms=!1,g=!0);break;case"END-PROC":v.length>1&&(s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.scope=v.pop(),s.range.end=n,g=!0));break;case"BEGSR":l.length>1&&(o.subroutines.find((e=>e.name&&e.name.toUpperCase()===l[1]))||(s=new w("subroutine"),s.name=d[1],s.description=f.join("\n"),s.keywords=["Subroutine"],s.position={path:e,line:n},s.range={start:n,end:n},f=[]));break;case"ENDSR":s&&"subroutine"===s.type&&(s.range.end=n,o.subroutines.push(s),g=!0);break;case"EXEC":if(l.length>2&&!l.includes("FETCH")){const t=["INTO","FROM","UPDATE","CALL","JOIN"],r=(e="")=>{const t={schema:void 0,name:e},n=Math.max(t.name.indexOf("."),t.name.indexOf("/"));n>=0&&(t.schema=t.name.substring(0,n),t.name=t.name.substring(n+1));const r=t.name.indexOf("(");return r>=0&&(t.name=t.name.substring(0,r)),t};l.forEach(((i,s)=>{if(t.includes(i)&&("INTO"!==i||"INSERT"===l[s-1])&&s>=0&&s+1<l.length){const t=d[s+1],i=r(t),a=new w("file");a.name=i.name,a.keywords=[],a.description=i.schema||"",a.position={path:e,line:n},o.sqlReferences.push(a)}g=!0}))}break;case"///":y=!y,!0===y&&(i=void 0,f=[],m=[]);break;default:if(r){if(y){const e=L.substring(2).trim();if(e.length>0)if(e.startsWith("@")){const t=e.substring(1).split(" ");m.push({tag:t[0],content:t.slice(1).join(" ")})}else m.length>0?m[m.length-1].content+=` ${e}`:void 0===i?i=e:f.push(e)}}else if(s||b.length>=1&&(s=b[b.length-1]),s&&["procedure","struct"].includes(s.type)&&s.readParms&&l.length>0){if(l[0].startsWith("DCL")&&(l.slice(1),d=d.splice(1)),a=new w("subitem"),a.name="*N"===l[0]?`parm${s.subItems.length+1}`:d[0],a.keywords=l.slice(1),a.position={path:e,line:n},"procedure"===s.type){const e=s.tags.filter((e=>"param"===e.tag)),t=e.length>s.subItems.length?e[s.subItems.length]:void 0;t&&(a.description=t.content)}await D(e,a),a.keyword=O.expandKeywords(a.keywords),s.subItems.push(a),a=void 0,"struct"===s.type&&(g=!0)}}}else{if(h>0)continue;switch(M){case"H":R.push(L.substring(6));break;case"F":const t=E(L);if(k=C(t.name,t.keywords),t.name){s=new w("file"),s.name=k,s.keywords=t.keywords,s.position={path:e,line:u};let n="";t.keywords.find((e=>{if(e.toUpperCase().includes("PREFIX"))return n=e.substring(7,e.indexOf(")")),!0}));const r=await this.fetchTable(k,L.length.toString(),t.keywords.includes("ALIAS"));if(r.length>0){const e=t.keywords.includes("QUALIFIED");r.forEach((t=>{t.keywords=[k],e&&t.keywords.push("QUALIFIED"),t.position=s.position,t.subItems.forEach((e=>{n&&(e.name=n.toUpperCase()+e.name),e.position=s.position}))})),q="structs",s.subItems.push(...r)}o.files.push(s)}else s=o.files[o.files.length-1],s.keywords=[...s.keywords?s.keywords:[],...t.keywords];g=!0;break;case"C":const n=P(L);switch(k=n.factor1,n.opcode){case"BEGSR":o.subroutines.find((e=>e.name&&e.name.toUpperCase()===k))||(s=new w("subroutine"),s.name=k,s.keywords=["Subroutine"],s.position={path:e,line:u},s.range={start:u,end:u},f=[]);break;case"ENDSR":s&&"subroutine"===s.type&&(s.range.end=u,o.subroutines.push(s),g=!0);break;case"CALL":const t=new w("procedure");t.name=n.factor2.startsWith("'")&&n.factor2.endsWith("'")?n.factor2.substring(1,n.factor2.length-1):n.factor2,t.keywords=["EXTPGM"],t.description=f.join("\n"),t.tags=m,t.position={path:e,line:u},t.range={start:u,end:u},t.keyword=O.expandKeywords(t.keywords),o.procedures.push(t)}break;case"P":const r=x(L);if(""===r.potentialName)continue;if(r.potentialName.endsWith("..."))k=r.potentialName.substring(0,r.potentialName.length-3),I=!0;else if(r.start){if(k=r.name.length>0?r.name:k,k){const t=o.procedures.findIndex((e=>e.name&&e.name.toUpperCase()===k.toUpperCase()));t>=0&&o.procedures.splice(t,1),s=new w("procedure"),c=k,s.name=c,s.keywords=r.keywords,s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},o.procedures.push(s),g=!0,v.push(new T)}}else v.length>1&&(s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.scope=v.pop(),s.range.end=u,g=!0));break;case"D":const i=_(L);if(""===i.potentialName)continue;if(i.potentialName.endsWith("...")){k=i.potentialName.substring(0,i.potentialName.length-3),I=!0;continue}switch(k=i.name.length>0?i.name:k||"",i.field){case"C":s=new w("constant"),s.name=k||"*N",s.keywords=[...i.keywords],s.position={path:e,line:u-(I?1:0)},o.constants.push(s),g=!0;break;case"S":s=new w("variable"),s.name=k||"*N",s.keywords=[N(i),...i.keywords],s.position={path:e,line:u-(I?1:0)},o.variables.push(s),g=!0;break;case"DS":s=new w("struct"),s.name=k||"*N",s.keywords=i.keywords,s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},D(e,s),q="structs",o.structs.push(s),g=!0;break;case"PR":o.procedures.find((e=>e.name&&e.name.toUpperCase()===k.toUpperCase()))||(s=new w("procedure"),s.name=k||"*N",s.keywords=[N(i),...i.keywords],s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},q="procedures",o.procedures.push(s),f=[]);break;case"PI":c&&(s=v[0].procedures.find((e=>e.name===c)),q="procedures",s&&s.keywords.push(N(i),...i.keywords));break;default:if(!s)switch(q){case"structs":case"procedures":let e;for(let t=v.length-1;t>=0&&(e=v[t],!(e[q].length>0));t--);s=e[q][e[q].length-1]}s&&(""===k&&(i.type||i.len)&&(k=""===k?`parm${s.subItems.length+1}`:k),k?(a=new w("subitem"),a.name=k,a.keywords=[N(i),...i.keywords],a.position={path:e,line:u},await D(e,a),a.keyword=O.expandKeywords(a.keywords),s.subItems.push(a),a=void 0,g=!0):s&&(s.subItems.length>0?s.subItems[s.subItems.length-1].keywords.push(N(i),...i.keywords):s.keywords.push(...i.keywords)),s.range.end=u)}k=void 0}}g&&(s&&(s.keyword=O.expandKeywords(s.keywords)),k=void 0,I=!1,s=void 0,i=void 0,f=[],m=[],g=!1)}}v.length>0&&(v[0].keyword=O.expandKeywords(R)),v[0].fixProcedures();const L=v[0];return this.parsedCache[e]=L,L}static expandKeywords(e){const t={};if(e.length>0){const n=D(C(e.join(" ")));for(let e=0;e<n.length;e++)n[e].value&&(n[e+1]&&"block"===n[e+1].type?(t[n[e].value.toUpperCase()]=n[e+1].block.map((e=>e.value)).join(""),e++):t[n[e].value.toUpperCase()]=!0)}return t}}const q=new t.TextDocuments(e),I=new O;function A(e,n){const r=e.getText().split("\n"),o=Math.min(r.length-1,Math.max(0,n.line)),i=r[o],s=Math.min(i.length-1,Math.max(0,n.character));let a=s;for(;a>0&&!/[\s\W]/.test(i.charAt(a-1));)a-=1;let c=s;for(;c<i.length&&!/[\s\W]/.test(i.charAt(c+1));)c+=1;return a===c?void 0:e.getText(t.Range.create(o,Math.max(0,a),o,c+1)).replace(/(\r\n|\n|\r)/gm,"")}var L;(()=>{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(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){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;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(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;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,s=i-o,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,u=s<c?s:c,l=-1,d=0;d<=u;++d){if(d===u){if(c>u){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>u&&(47===e.charCodeAt(o+d)?l=d:0===d&&(l=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(l=d)}var h="";for(d=o+l+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+l):(a+=l,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 u=e.charCodeAt(r);if(47===u){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===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,u=!0,l=e.length-1,d=0;l>=r;--l)if(47!==(o=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===o?-1===s?s=l:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){a=l+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}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}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={};(()=>{var e;if(n.r(r),n.d(r,{URI:()=>h,Utils:()=>k}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var o,i,s=(o=function(e,t){return o=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])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//,l="",d="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,h=function(){function t(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||l,this.authority=e.authority||l,this.path=e.path||l,this.query=e.query||l,this.fragment=e.fragment||l):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||l,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==d&&(t=d+t):t=d}return t}(this.scheme,n||l),this.query=r||l,this.fragment=o||l,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.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 t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),t.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=l),void 0===n?n=this.authority:null===n&&(n=l),void 0===r?r=this.path:null===r&&(r=l),void 0===o?o=this.query:null===o&&(o=l),void 0===i?i=this.fragment:null===i&&(i=l),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new m(t,n,r,o,i)},t.parse=function(e,t){void 0===t&&(t=!1);var n=p.exec(e);return n?new m(n[2]||l,w(n[4]||l),w(n[5]||l),w(n[7]||l),w(n[9]||l),t):new m(l,l,l,l,l)},t.file=function(t){var n=l;if(e&&(t=t.replace(/\\/g,d)),t[0]===d&&t[1]===d){var r=t.indexOf(d,2);-1===r?(n=t.substring(2),t=d):(n=t.substring(2,r),t=t.substring(r)||d)}return new m("file",n,t,l,l)},t.from=function(e){return new m(e.scheme,e.authority,e.path,e.query,e.fragment)},t.prototype.toString=function(e){return void 0===e&&(e=!1),R(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new m(e);return n._formatted=e.external,n._fsPath=e._sep===f?e.fsPath:null,n}return e},t}(),f=e?1:void 0,m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(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?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=f),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}(h),g=((i={})[58]="%3A",i[47]="%2F",i[63]="%3F",i[35]="%23",i[91]="%5B",i[93]="%5D",i[64]="%40",i[33]="%21",i[36]="%24",i[38]="%26",i[39]="%27",i[40]="%28",i[41]="%29",i[42]="%2A",i[43]="%2B",i[44]="%2C",i[59]="%3B",i[61]="%3D",i[32]="%20",i);function y(e,t){for(var n=void 0,r=-1,o=0;o<e.length;o++){var i=e.charCodeAt(o);if(i>=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=g[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;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=g[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function b(t,n){var r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function R(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+=d,r+=d),i){var u=i.indexOf("@");if(-1!==u){var l=i.substr(0,u);i=i.substr(u+1),-1===(u=l.indexOf(":"))?r+=n(l,!1):(r+=n(l.substr(0,u),!1),r+=":",r+=n(l.substr(u+1),!1)),r+="@"}-1===(u=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,u),!1),r+=i.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(p=s.charCodeAt(1))>=65&&p<=90&&(s="/".concat(String.fromCharCode(p+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var p;(p=s.charCodeAt(0))>=65&&p<=90&&(s="".concat(String.fromCharCode(p+32),":").concat(s.substr(2)))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function C(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+C(e.substr(3)):e}}var D=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function w(e){return e.match(D)?e.replace(D,(function(e){return C(e)})):e}var k,T=n(470),S=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},E=T.posix||T,P="/";!function(e){e.joinPath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.with({path:E.join.apply(E,S([e.path],t,!1))})},e.resolvePath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.path,o=!1;r[0]!==P&&(r=P+r,o=!0);var i=E.resolve.apply(E,S([r],t,!1));return o&&i[0]===P&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===P)return e;var t=E.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return E.basename(e.path)},e.extname=function(e){return E.extname(e.path)}}(k||(k={}))})(),L=r})();const{URI:M,Utils:j}=L,F=[{name:"printf",type:"function",insertText:"printf(${1:value})$0",detail:"int(10)",description:"Print to standard out",prototype:["///","// printf","// Print to standard out","// @param String value pointer","///","dcl-pr printf int(10) extproc('printf');"," format pointer value options(*string);","end-pr;"],example:["**free","dcl-s outtext varchar(50);","outtext = 'Hello world'","printf(outtext + '\\n');"]},{name:"Qp0zLprintf",type:"function",insertText:"Qp0zLprintf(${1:value})$0",detail:"int(10)",description:"Prints user data specified by format-string as an information message type to the job log.",prototype:["///","// Qp0zLprintf","// Prints user data specified by format-string as","// an information message type to the job log.","// To ensure messages are written to the job log, always","// use a new line (\\n) at the end of each format-string.","// @param format-string","///","dcl-pr Qp0zLprintf int(10) extproc('Qp0zLprintf');"," format pointer value options(*string);","end-pr;"]},{name:"system",type:"function",insertText:"system(${1:value})$0",detail:"int(10)",description:"Execute an ILE command",prototype:["///","// system","// Execute an ILE command","// @param The command as string pointer","///","dcl-pr system int(10) extproc('system');"," command pointer value options(*string);","end-pr;"]},{name:"QzshSystem",type:"function",insertText:"QzshSystem(${1:value})$0",detail:"int(10)",description:"Runs the specified shell command by spawning a child process and invoking qsh",prototype:["///","// QzshSystem","// Runs the specified shell command by","// spawning a child process and invoking qsh","// @param The command as string pointer","///","dcl-pr QzshSystem int(10) extproc('QzshSystem');"," command pointer value options(*string);","end-pr;"]},{name:"getenv",type:"function",insertText:"getenv(${1:'ENVVAR'})$0",detail:"pointer",description:"Searches the job-level environment list for a string",prototype:["///","// getenv","// Searches the job-level environment list for a string","// @param Environment variable name","///","dcl-pr getenv pointer extproc('getenv');"," name pointer value options(*string:*trim);","end-pr;"],example:["**free","dcl-s EnvVarValue char(500);","EnvVarValue = %str(getenv('ENVVAR'));"]},{name:"putenv",type:"function",insertText:"putenv(${1:'ENVVAR=value'})$0",detail:"int(10)",description:"Creates or changes an environment variable",prototype:["///","// putenv","// Creates or changes an environment variable","// @param Environment variable name and value","///","dcl-pr putenv pointer extproc('putenv');"," change pointer value options(*string:*trim);","end-pr;"],example:["**free","dcl-s EnvVarValue char(500);","EnvVarValue = 'Some value to store';","putenv('ENVVAR=' + EnvVarValue);"]},{name:"QUSCRTUS",type:"function",insertText:"QUSCRTUS(\n ${1:'NAME LIB'}:\n ${2:'LOG'}:\n ${3:size}:\n ${4:'*ALL'}:\n ${5:'New object'}\n);$0",detail:"void",description:"Create User Space",prototype:["///","// QUSCRTUS","// Create User Space","///","dcl-pr QUSCRTUS extpgm('QUSCRTUS');"," qualifiedName char(20) const;"," extendedAtribute char(10) const;"," initialSize int(10) const;"," initialValue char(1) const;"," publicAuthority char(10) const;"," description char(50) const;"," // optional parm group 1"," UsrSpcRepl char(10) const options(*nopass);"," UsrSpcErrC likeds(ApiErrC) options(*nopass: *varsize);"," // optional parm group 2"," UsrSpcDomn char(10) const options(*nopass);"," // optional parm group 3"," UsrSpcReqS int(10) const options(*nopass);"," UsrSpcOptA char(1) const options(*nopass);","end-pr;"]},{name:"QUSDLTUS",type:"function",insertText:"QUSDLTUS(${1:'NAME LIB'}:${2:APIERRC});",detail:"void",description:"Delete User Space",prototype:["///","// QUSDLTUS","// Delete User Space","///","dcl-pr QUSDLTUS extpgm('QUSDLTUS');"," qualifiedName char(20) const;"," errorResponse likeds(APIERRC_T) options(*varsize);","end-pr;"]},{name:"APIERRC_T",type:"struct",insertText:"APIERRC_T",detail:"ERRC0100 format",description:"Error data structure",prototype:["///","// APPERRC template","// Used for error capturing","///","dcl-ds APIERRC_T Qualified Template;"," bytesProvided Int(10:0); // Inz(%size(ApiErrC))"," bytesAvailable Int(10:0);"," exceptionID Char(7);"," reserved Char(1);"," exceptionData Char(3000);","end-ds;"],example:["**free","dcl-ds apierrc likeds(APIERRC_T);","apierrc.bytesProvided = %size(apierrc);"]},{name:"QCMDEXC",type:"function",description:"Execute a system command",detail:"void",insertText:"QCMDEXC(\n ${1:commandString}:\n ${2:commandLength}\n)$0",prototype:["///","// QCMDEXC","// Execute a system command","///","Dcl-Pr QCMDEXC EXTPGM('QCMDEXC');"," commandString CHAR(32702) CONST OPTIONS(*VARSIZE);"," commandLength PACKED(15:5) CONST;","End-Pr;"]},{name:"QCLRDTAQ",type:"function",description:"Clear data queue",detail:"void",insertText:"QCLRDTAQ(\n ${1:dqName}:\n ${2:dqLibrary}:\n ${3:keyOrder}:\n ${4:keyDataLength}:\n ${5:keyData}:\n ${6:prErrCode}\n)$0",prototype:["///","// QCLRDTAQ","// Clear data queue","///","Dcl-Pr QCLRDTAQ EXTPGM('QCLRDTAQ');"," dqName CHAR(10) CONST;"," dqLibrary CHAR(10) CONST;"," keyOrder CHAR(2) CONST OPTIONS(*NOPASS);"," keyDataLength PACKED(3:0) CONST OPTIONS(*NOPASS);"," keyData CHAR(256) CONST OPTIONS(*NOPASS:*VARSIZE);"," prErrCode LIKEDS(APIERRC_T) OPTIONS(*NOPASS:*VARSIZE);","End-Pr;"]},{name:"QSNDDTAQ",type:"function",description:"Send to data queue",detail:"void",insertText:"QSNDDTAQ(\n ${1:dqName}:\n ${2:dqLibrary}:\n ${3:dataInLen}:\n ${4:dataIn}:\n ${5:keyDataLength}:\n ${6:keyData}:\n ${7:asyncRequest}:\n ${8:isJourneyEntry}\n)$0",prototype:["///","// QSNDDTAQ","// Send to data queue","///","Dcl-Pr QSNDDTAQ EXTPGM('QSNDDTAQ');"," dqName CHAR(10) CONST;"," dqLibrary CHAR(10) CONST;"," dataInLen PACKED(5:0);"," dataIn CHAR(65535) OPTIONS(*VARSIZE);"," keyDataLength PACKED(3:0) CONST OPTIONS(*NOPASS);"," keyData CHAR(256) CONST OPTIONS(*NOPASS:*VARSIZE);"," asyncRequest CHAR(10) CONST OPTIONS(*NOPASS);"," isJourneyEntry CHAR(10) CONST OPTIONS(*NOPASS);","End-Pr;"]},{name:"memcpy",type:"function",description:"",detail:"void",insertText:"memcpy(\n ${1:target}:\n ${2:source}:\n ${3:length}\n)$0",prototype:["///","// memcpy","// API","///","dcl-pr memcpy EXTPROC('__MEMCPY');"," target POINTER VALUE;"," source POINTER VALUE;"," length UNS(10) VALUE;","end-pr;"]},{name:"QRCVDTAQ",type:"function",description:"",detail:"void",insertText:"QRCVDTAQ(\n ${1:Object}:\n ${2:Library}:\n ${3:DataLen}:\n ${4:Data}:\n ${5:WaitTime}:\n ${6:KeyOrder}:\n ${7:KeyLen}:\n ${8:Key}\n)$0",prototype:["///","// QRCVDTAQ","// API","///","dcl-pr QRCVDTAQ EXTPGM('QRCVDTAQ');"," Object CHAR(10);"," Library CHAR(10);"," DataLen PACKED(5);"," Data CHAR(DQ_LEN);"," WaitTime PACKED(5);"," KeyOrder CHAR(2) OPTIONS(*NOPASS);"," KeyLen PACKED(3) OPTIONS(*NOPASS);"," Key POINTER OPTIONS(*NOPASS);","end-pr;"]},{name:"RSLVSP2",type:"function",description:"Get library pointer",detail:"void",insertText:"RSLVSP2(\n ${1:objectResult}:\n ${2:rslvsp_in}\n)$0",prototype:["///","// RSLVSP2","// Get library pointer","// @param Resulting pointer by reference","// @param Struct rslvsp_t","///","dcl-pr RSLVSP2 EXTPROC('_RSLVSP2');"," objectResult POINTER;"," rslvsp_in LIKEDS(RSLVSP_T) QUALIFIED;","end-pr;"]},{name:"RSLVSP4",type:"function",description:"Get object pointer",detail:"void",insertText:"RSLVSP4(\n ${1:objectResult}:\n ${2:rslvsp_in}:\n ${3:libraryPointer}\n)$0",prototype:["///","// RSLVSP4","// Get object pointer","// @param Resulting pointer by reference","// @param Struct rslvsp_t","// @param Library pointer from RSLVSP2","///","dcl-pr RSLVSP4 EXTPROC('_RSLVSP4');"," objectResult POINTER;"," rslvsp_in CHAR(34);"," libraryPointer POINTER;","end-pr;"]},{name:"QleActBndPgmLong",type:"function",description:"Activate service program",detail:"INT(20)",insertText:"QleActBndPgmLong(\n ${1:serviceProgram}\n)$0",prototype:["///","// QleActBndPgmLong","// Activate service program","// @param Pointer to service program from RSLVSP4","///","dcl-pr QleActBndPgmLong INT(20) EXTPROC('QLEACTBNDPGMLONG');"," serviceProgram POINTER;","end-pr;"]},{name:"RetrieveFunctionPointer",type:"function",description:"Retrieve function pointer",detail:"POINTER",insertText:"RetrieveFunctionPointer(\n ${1:Mark}:\n ${2:ExportNum}:\n ${3:ExportNameLen}:\n ${4:ExportName}:\n ${5:rFuncPointer}:\n ${6:rFuncResult}\n)$0",prototype:["///","// RetrieveFunctionPointer","// Retrieve function pointer","// @param Value from QleActBndPgmLong","// @param Export number.","// @param Export name length","// @param Export name","// @param Resulting function pointer","// @param Resulting status code","///","dcl-pr RetrieveFunctionPointer POINTER EXTPROC('QLEGETEXPLONG');"," Mark INT(20);"," ///"," // @value 0 (zero is valid)"," ///"," ExportNum INT(10) VALUE;"," ExportNameLen INT(10);"," ExportName POINTER VALUE OPTIONS(*STRING);"," rFuncPointer POINTER;"," rFuncResult INT(10);","end-pr;"]},{name:"callpgmv",type:"function",description:"",detail:"void",insertText:"callpgmv(\n ${1:pgm_ptr}:\n ${2:argv}:\n ${3:argc}\n)$0",prototype:["///","// callpgmv","// API","///","dcl-pr callpgmv EXTPROC('_CALLPGMV');"," pgm_ptr POINTER;"," argv POINTER DIM(256);"," argc UNS(10) VALUE;","end-pr;"]},{name:"rslvsp_t",type:"struct",description:"Resolve object pointer struct",detail:"QUALIFIED TEMPLATE",insertText:"rslvsp_t",prototype:["///","// rslvsp_t","// Resolve object struct","///","dcl-ds rslvsp_t QUALIFIED TEMPLATE;"," ///"," // @value x'0401' Library"," // @value x'0201' Program"," // @value x'0203' Service Program"," ///"," Obj_Type CHAR(2);"," Obj_Name CHAR(30);"," Auth CHAR(2) INZ(X'0000');","end-ds;"]}],U=o.CompletionItem.create("@rpglint-skip");U.kind=o.CompletionItemKind.Snippet,U.detail="The next line will skip rules and indentation checking.";const W=o.CompletionItem.create("@rpglint-skip-indent");W.kind=o.CompletionItemKind.Snippet,W.detail="The next line will skip indentation checking.";const $=o.CompletionItem.create("@rpglint-skip-rules");$.kind=o.CompletionItemKind.Snippet,$.detail="The next line will skip rules checking.";const H=[U,W,$],V=require("fs/promises");var K=n(6729);class B extends Error{constructor(e){super(e),this.name="TimeoutError"}}class z extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const Q=e=>void 0===globalThis.DOMException?new z(e):new DOMException(e),G=e=>{const t=void 0===e.reason?Q("This operation was aborted."):e.reason;return t instanceof Error?t:Q(t)};var X,J=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class Y{constructor(){X.set(this,[])}enqueue(e,t){const n={priority:(t={priority:0,...t}).priority,run:e};if(this.size&&J(this,X,"f")[this.size-1].priority>=t.priority)return void J(this,X,"f").push(n);const r=function(e,t,n){let r=0,o=e.length;for(;o>0;){const n=Math.trunc(o/2);let s=r+n;i=e[s],t.priority-i.priority<=0?(r=++s,o-=n+1):o=n}var i;return r}(J(this,X,"f"),n);J(this,X,"f").splice(r,0,n)}dequeue(){const e=J(this,X,"f").shift();return null==e?void 0:e.run}filter(e){return J(this,X,"f").filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return J(this,X,"f").length}}X=new WeakMap;var Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce,De,we,ke,Te=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},Se=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class Ee extends Error{}ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,oe=new WeakMap,ie=new WeakMap,se=new WeakMap,ae=new WeakMap,ce=new WeakMap,ue=new WeakMap,le=new WeakMap,de=new WeakMap,pe=new WeakMap,he=new WeakMap,Z=new WeakSet,fe=function(){return Se(this,te,"f")||Se(this,ne,"f")<Se(this,re,"f")},me=function(){return Se(this,le,"f")<Se(this,de,"f")},ge=function(){var e;Te(this,le,(e=Se(this,le,"f"),--e),"f"),Se(this,Z,"m",be).call(this),this.emit("next")},ye=function(){Se(this,Z,"m",Ce).call(this),Se(this,Z,"m",Re).call(this),Te(this,ae,void 0,"f")},ve=function(){const e=Date.now();if(void 0===Se(this,se,"f")){const t=Se(this,ie,"f")-e;if(!(t<0))return void 0===Se(this,ae,"f")&&Te(this,ae,setTimeout((()=>{Se(this,Z,"m",ye).call(this)}),t),"f"),!0;Te(this,ne,Se(this,ee,"f")?Se(this,le,"f"):0,"f")}return!1},be=function(){if(0===Se(this,ce,"f").size)return Se(this,se,"f")&&clearInterval(Se(this,se,"f")),Te(this,se,void 0,"f"),this.emit("empty"),0===Se(this,le,"f")&&this.emit("idle"),!1;if(!Se(this,pe,"f")){const e=!Se(this,Z,"a",ve);if(Se(this,Z,"a",fe)&&Se(this,Z,"a",me)){const t=Se(this,ce,"f").dequeue();return!!t&&(this.emit("active"),t(),e&&Se(this,Z,"m",Re).call(this),!0)}}return!1},Re=function(){Se(this,te,"f")||void 0!==Se(this,se,"f")||(Te(this,se,setInterval((()=>{Se(this,Z,"m",Ce).call(this)}),Se(this,oe,"f")),"f"),Te(this,ie,Date.now()+Se(this,oe,"f"),"f"))},Ce=function(){0===Se(this,ne,"f")&&0===Se(this,le,"f")&&Se(this,se,"f")&&(clearInterval(Se(this,se,"f")),Te(this,se,void 0,"f")),Te(this,ne,Se(this,ee,"f")?Se(this,le,"f"):0,"f"),Se(this,Z,"m",De).call(this)},De=function(){for(;Se(this,Z,"m",be).call(this););},we=async function(e){return new Promise(((t,n)=>{e.addEventListener("abort",(()=>{n(new Ee("The task was aborted."))}),{once:!0})}))},ke=async function(e,t){return new Promise((n=>{const r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)}))};var Pe=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const _e=(0,t.createConnection)(t.ProposedFeatures.all),xe=new class extends K{constructor(e){var t,n,r,o;if(super(),Z.add(this),ee.set(this,void 0),te.set(this,void 0),ne.set(this,0),re.set(this,void 0),oe.set(this,void 0),ie.set(this,0),se.set(this,void 0),ae.set(this,void 0),ce.set(this,void 0),ue.set(this,void 0),le.set(this,0),de.set(this,void 0),pe.set(this,void 0),he.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Y,...e}).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(n=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==n?n:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(o=null===(r=e.interval)||void 0===r?void 0:r.toString())&&void 0!==o?o:""}\` (${typeof e.interval})`);Te(this,ee,e.carryoverConcurrencyCount,"f"),Te(this,te,e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,"f"),Te(this,re,e.intervalCap,"f"),Te(this,oe,e.interval,"f"),Te(this,ce,new e.queueClass,"f"),Te(this,ue,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Te(this,he,!0===e.throwOnTimeout,"f"),Te(this,pe,!1===e.autoStart,"f")}get concurrency(){return Se(this,de,"f")}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Te(this,de,e,"f"),Se(this,Z,"m",De).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:Se(this,he,"f"),...t},new Promise(((n,r)=>{Se(this,ce,"f").enqueue((async()=>{var o,i,s;Te(this,le,(i=Se(this,le,"f"),++i),"f"),Te(this,ne,(s=Se(this,ne,"f"),++s),"f");try{if(null===(o=t.signal)||void 0===o?void 0:o.aborted)throw new Ee("The task was aborted.");let r=e({signal:t.signal});t.timeout&&(r=function(e,t,n,r){let o;const i=new Promise(((i,s)=>{if("number"!=typeof t||1!==Math.sign(t))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t!==Number.POSITIVE_INFINITY){if((r={customTimers:{setTimeout,clearTimeout},...r}).signal){const{signal:e}=r;e.aborted&&s(G(e)),e.addEventListener("abort",(()=>{s(G(e))}))}o=r.customTimers.setTimeout.call(void 0,(()=>{const r=n instanceof Error?n:new B(`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),s(r)}),t),(async()=>{try{i(await e)}catch(e){s(e)}finally{r.customTimers.clearTimeout.call(void 0,o)}})()}else i(e)}));return i.clear=()=>{clearTimeout(o),o=void 0},i}(Promise.resolve(r),t.timeout)),t.signal&&(r=Promise.race([r,Se(this,Z,"m",we).call(this,t.signal)]));const i=await r;n(i),this.emit("completed",i)}catch(e){if(e instanceof B&&!t.throwOnTimeout)return void n();r(e),this.emit("error",e)}finally{Se(this,Z,"m",ge).call(this)}}),t),this.emit("add"),Se(this,Z,"m",be).call(this)}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return Se(this,pe,"f")?(Te(this,pe,!1,"f"),Se(this,Z,"m",De).call(this),this):this}pause(){Te(this,pe,!0,"f")}clear(){Te(this,ce,new(Se(this,ue,"f")),"f")}async onEmpty(){0!==Se(this,ce,"f").size&&await Se(this,Z,"m",ke).call(this,"empty")}async onSizeLessThan(e){Se(this,ce,"f").size<e||await Se(this,Z,"m",ke).call(this,"next",(()=>Se(this,ce,"f").size<e))}async onIdle(){0===Se(this,le,"f")&&0===Se(this,ce,"f").size||await Se(this,Z,"m",ke).call(this,"idle")}get size(){return Se(this,ce,"f").size}sizeBy(e){return Se(this,ce,"f").filter(e).length}get pending(){return Se(this,le,"f")}get isPaused(){return Se(this,pe,"f")}};let Ne=[];function Oe(e,t=""){return Pe(this,null,(function*(){const n=function(e,t=""){return q.keys().find((n=>n.includes(e)&&n.startsWith(`${t}:`)))}(e,t);if(n)return n;console.log(`Validating file from server: ${e}`);return(yield _e.sendRequest("getUri",e))||void 0}))}function qe(e){return Pe(this,null,(function*(){const t=q.get(e);if(t)return t.getText();console.log(`Fetching file from server: ${e}`);return(yield _e.sendRequest("getFile",e))||void 0}))}_e.onDidChangeWatchedFiles((e=>{Ne.forEach((t=>t(e)))}));let Ie={},Ae={};function Le(e,t){return Pe(this,null,(function*(){const n=t.join("-");if(Ae[e]&&Ae[e][n])return Ae[e][n];const r=yield Me(e),o=(r?et[r.uri]:[])||[],i=yield xe.add((()=>_e.sendRequest("streamfileResolve",[t,o])));return i&&(Ae[e]||(Ae[e]={}),Ae[e][n]=i),i}))}function Me(e){return Pe(this,null,(function*(){let t;const n=yield _e.workspace.getWorkspaceFolders();return n&&(t=n.find((t=>e.startsWith(t.uri)))),t}))}const je=["ACQ1","BEGSR","CALLP","CHAIN","CLEAR","CLOSE","COMMIT","DATA","DATA","DEALLOC","DELETE","DOU","DOW","DSPLY","DUMP1","ELSE","ELSEIF","ENDDO","ENDFOR","ENDIF","ENDMON","ENDSL","ENDSR","EVAL","EVALR","EVAL","EXCEPT","EXFMT","EXSR","FEOD","FOR","FORCE","IF","IN","ITER","LEAVE","LEAVESR","MONITOR","NEXT1","ON","OPEN","OTHER","OUT1","POST","READ","READC","READE","READP","READPE","REL","RESET","RETURN","ROLBK","SELECT","SETGT","SETLL","SORTA","TEST","UNLOCK","UPDATE","WHEN","WRITE","XML"];class Fe{constructor(e,t,n=0){this.tokens=e,this.range=t,this.indent=n,this.beginBlock=!1}getTokenByOffset(e){const t=n=>{const r=n.find((t=>e>=t.range.start&&e<=t.range.end));return"block"===(null==r?void 0:r.type)&&r.block?t(r.block):r};return t(this.tokens)}asBlocks(){return D(this.tokens)}static getParameters(e){let t=[],n=[];for(let r=0;r<e.length;r++)"seperator"===e[r].type?(t.push({type:"block",block:n,range:{line:n[0].range.line,start:n[0].range.start,end:n[n.length-1].range.end}}),n=[e[r]]):n.push(e[r]);return n.length>0&&t.push({type:"block",block:n,range:{line:n[0].range.line,start:n[0].range.start,end:n[n.length-1].range.end}}),t}static trimTokens(e){if(e.length>0){let t=e.findIndex((e=>"newline"!==e.type));t<0&&(t=0);let n=0;for(let t=e.length-1;t>=0;t--)if("newline"!==e[t].type){n=t+1;break}e=e.slice(t,n)}return e}}class Ue{constructor(e){this.statements=[],this.parseStatements(C(e))}addStatement(e,t){t.length>0&&this.statements.push(new Fe(t,{line:t[0].range.line,start:t[0].range.start,end:t[t.length-1].range.end},e))}parseStatements(e){let t,n="Normal",r={need:!0,index:-1},o={index:0};for(let i=0;i<e.length;i++)switch(e[i].type){case"semicolon":const s=Fe.trimTokens(e.slice(o.index,i));t=e[r.index];const a=s[0]&&t?s[0].range.start-t.range.end:0;r.need=!0,this.addStatement(a,s),o={index:i+1};break;case"format":const c=Fe.trimTokens(e.slice(o.index,i+1));if(1===c.length){t=e[r.index];const n=c[0]&&t?c[0].range.start-t.range.end:0;r.need=!0,this.addStatement(n,c),o={index:i+1}}break;case"comment":const u=Fe.trimTokens(e.slice(o.index,i+1));if(1===u.length){if(e[i-1]&&e[i-1].range.line!==u[0].range.line){t=e[r.index];const n=u[0]&&t?u[0].range.start-t.range.end:0;r.need=!0,this.addStatement(n,u)}o={index:i+1}}break;case"directive":"directive"===Fe.trimTokens(e.slice(o.index,i+1))[0].type&&(n="Directive");break;case"newline":if("Directive"===n){const s=Fe.trimTokens(e.slice(o.index,i));t=e[r.index];const a=s[0]&&t?s[0].range.start-t.range.end:0;this.addStatement(a,s),r.need=!0,o={index:i+1},n="Normal"}(r.need||e[i-1]&&"newline"===e[i-1].type)&&(r.index=i,r.need=!1)}const i=Fe.trimTokens(e.slice(o.index,e.length));if(i.length>0){t=e[r.index];const n=i[0]?i[0].range.start-t.range.end:0;this.addStatement(n,i)}}getStatementByLine(e){return this.statements.find((t=>t.range.line===e))}getStatementByOffset(e){return this.statements.find(((t,n)=>{const r=this.statements[n+1]?this.statements[n+1].range.start:t.range.end;return e>=t.range.start&&e<r||n===this.statements.length-1&&e>=r}))}getTokenByOffset(e){const t=this.getStatementByOffset(e);if(t)return t.getTokenByOffset(e)}}var We=Object.defineProperty,$e=Object.defineProperties,He=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,ze=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Qe={BlankStructNamesCheck:"Struct names cannot be blank (`*N`).",QualifiedCheck:"Struct names must be qualified (`QUALIFIED`).",PrototypeCheck:"Prototypes can only be defined with either `EXTPGM` or `EXTPROC`",ForceOptionalParens:"Expressions must be surrounded by brackets.",NoOCCURS:"`OCCURS` is not allowed.",NoSELECTAll:"`SELECT *` is not allowed in Embedded SQL.",UselessOperationCheck:"Redundant operation codes (EVAL, CALLP, DCL-PARM, DCL-SUBF) not allowed.",UppercaseConstants:"Constants must be in uppercase.",SpecificCasing:"Does not match required case.",InvalidDeclareNumber:"Variable names cannot start with a number",IncorrectVariableCase:"Variable name casing does not match definition.",RequiresParameter:"Procedure calls require brackets.",RequiresProcedureDescription:"Procedures require a title and description.",StringLiteralDupe:"Same string literal used more than once. Consider using a constant instead.",RequireBlankSpecial:"`*BLANK` should be used over empty string literals.",CopybookDirective:"Directive does not match requirement.",UppercaseDirectives:"Directives must be in uppercase.",NoSQLJoins:"SQL joins are not allowed. Consider creating a view instead.",NoGlobalsInProcedures:"Global variables should not be referenced in procedures.",NoCTDATA:"`CTDATA` is not allowed.",PrettyComments:"Comments must be correctly formatted.",NoGlobalSubroutines:"Subroutines should not be defined in the global scope.",NoLocalSubroutines:"Subroutines should not be defined in procedures.",UnexpectedEnd:"Statement unexpected. Likely missing the equivalent `DCL..`/`BEG..`",NoUnreferenced:"No reference to definition.",NoExternalTo:"Cannot declare prototype to this external API.",NoExecuteImmediate:"EXECUTE IMMEDIATE is not allowed.",NoExtProgramVariable:"Not allowed to use variable in EXTPGM or EXTPROC.",IncludeMustBeRelative:"Path not valid. It must be relative to the project.",SQLHostVarCheck:"Also defined in scope. Should likely be host variable.",RequireOtherBlock:"OTHER block missing from SELECT block."},Ge={none:0,single:1,singleIndent:2,singleRules:3};class Xe{static getErrorText(e){return Qe[e]}static getErrors(e,t,n){const r=void 0!==t.indent,o=t.indent||2,i=Object.keys(t).length-(t.indent?1:0);n||(n=new T);const s=n.procedures;let a=!1,c=!1,u=0,l=!1,d=!1,p=-1;const h=[],f=[];let m,g=0,y=0,v=!1;t.NoUnreferenced&&(t.CollectReferences=!0),t.CollectReferences&&n.clearReferences(),t.NoExternalTo&&t.NoExternalTo.length&&(t.NoExternalTo=t.NoExternalTo.map((e=>e.toUpperCase())));const b=[],R=[];let C=0,D=Ge.none;const w=new Ue(e.content);for(let k=0;k<w.statements.length;k++){const T=w.statements[k],E=T.tokens;if(p=T.range.line,y=T.indent,y>=0){if(v=!1,"comment"===E[0].type){const e=E[0].value.substring(2).trimEnd();switch(t.PrettyComments?e&&"/"!==e[0]&&0===e.search(/\S/)&&f.push({offset:{position:E[0].range.start,end:E[0].range.start+2},type:"PrettyComments",newValue:"// "}):v=!0,e.trim()){case"@rpglint-skip":D=Ge.single;continue;case"@rpglint-skip-indent":D=Ge.singleIndent;continue;case"@rpglint-skip-rules":D=Ge.singleRules;continue}}if(i>0&&![Ge.single,Ge.singleRules].includes(D)){const r=n.procedures.find((e=>p>=e.range.start&&p<=e.range.end)),o=n.merge(a&&r?r.scope:void 0),i=t.IncorrectVariableCase||t.SQLHostVarCheck?o.getNames():[];let d,h,m=!1;if(E.length>=1){if("directive"===E[0].type){const e=E[0].value.toUpperCase();if("/EOF"===e&&0===C)break;"/IF"===e?C+=1:"/ENDIF"===e&&(C-=1)}switch(E[0].type){case"format":p>0&&E[0].value.startsWith("**")&&t.NoCTDATA&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoCTDATA"});break;case"directive":if(d=E[0].value,t.UppercaseDirectives&&d!==d.toUpperCase()&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UppercaseDirectives",newValue:d.toUpperCase()}),(t.CopybookDirective||t.IncludeMustBeRelative)&&["/COPY","/INCLUDE"].includes(d.toUpperCase())){if(t.IncludeMustBeRelative)if(2===E.length){const t=E[1];if("word"===t.type){const n=t.value.substring(1,t.value.length-1).trim().toUpperCase(),r=e.availableIncludes&&e.availableIncludes.length>0?e.availableIncludes.find((e=>e.toUpperCase().includes(n.toUpperCase()))):void 0;f.push({offset:{position:t.range.start,end:t.range.end+t.value.length},type:"IncludeMustBeRelative",newValue:r?`'${r}'`:void 0})}else if("string"===t.type){const n=t.value.substring(1,t.value.length-1).trim();if(!0===n.startsWith("/"))f.push({offset:{position:t.range.start,end:t.range.end},type:"IncludeMustBeRelative"});else if(e.availableIncludes&&e.availableIncludes.length>0){const r=e.availableIncludes.find((e=>e.toUpperCase().includes(n.toUpperCase())));r&&n!==r&&f.push({offset:{position:t.range.start,end:t.range.end},type:"IncludeMustBeRelative",newValue:`'${r}'`})}}}else if(4===E.length&&"comma"===E[2].type){if(e.availableIncludes&&e.availableIncludes.length>0){const t=`${E[1].value}/${E[3].value}`.toUpperCase(),n=e.availableIncludes.find((e=>e.toUpperCase().includes(t)));n&&t!==n&&f.push({offset:{position:E[1].range.start,end:E[3].range.end},type:"IncludeMustBeRelative",newValue:`'${n}'`})}}else f.push({type:"IncludeMustBeRelative",offset:{position:E[0].range.start,end:E[E.length-1].range.end}});if(t.CopybookDirective){const e=`/${t.CopybookDirective.toUpperCase()}`;d.toUpperCase()!==e&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"CopybookDirective",newValue:e})}}break;case"declare":if(E.length<2)break;if(t.SpecificCasing){const e=t.SpecificCasing.find((e=>[E[0].value.toUpperCase(),"*DECLARE"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d=E[1].value,d.match(/^\d/)&&f.push({offset:{position:E[1].range.start,end:E[1].range.end},type:"InvalidDeclareNumber"}),E[0].value.toUpperCase()){case"BEGSR":c&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),c=!0,a?t.NoLocalSubroutines&&f.push({type:"NoLocalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}):t.NoGlobalSubroutines&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoGlobalSubroutines",newValue:"Dcl-Proc"});break;case"DCL-PROC":if((c||a)&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),a=!0,E.length<2)break;if(t.RequiresProcedureDescription){d=E[1].value;const e=s.find((e=>e.name.toUpperCase()===d.toUpperCase()));e&&(e.description||f.push({type:"RequiresProcedureDescription",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}))}break;case"DCL-C":if(t.UppercaseConstants&&d!==d.toUpperCase()&&f.push({offset:{position:E[1].range.start,end:E[1].range.end},type:"UppercaseConstants",newValue:d.toUpperCase()}),t.StringLiteralDupe&&"string"===E[2].type){let e=R.find((e=>e.value===E[2].value));e||(e={definition:d,value:E[2].value,list:[]},R.push(e))}break;case"DCL-PI":E.some((e=>"end"===e.type))||(l=!0);break;case"DCL-PR":if(l=!0,t.PrototypeCheck||t.NoExtProgramVariable){const e=E.findIndex((e=>e.value&&["EXTPGM","EXTPROC"].includes(e.value.toUpperCase())));if(e>=0){if(t.NoExtProgramVariable){const t=E.find(((t,n)=>n>e&&"word"===t.type));t&&f.push({offset:{position:t.range.start,end:t.range.end},type:"NoExtProgramVariable"})}}else t.PrototypeCheck&&f.push({type:"PrototypeCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}break;case"DCL-DS":u+=1,t.NoOCCURS&&E.some((e=>e.value&&"OCCURS"===e.value.toUpperCase()))&&f.push({type:"NoOCCURS",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.QualifiedCheck&&(E.some((e=>e.value&&["LIKEDS","LIKEREC","QUALIFIED"].includes(e.value.toUpperCase())))||f.push({type:"QualifiedCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})),t.BlankStructNamesCheck&&E.some((e=>"special"===e.type&&"*N"===e.value.toUpperCase()))&&f.push({type:"BlankStructNamesCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.NoCTDATA&&E.some((e=>["CTDATA","*CTDATA"].includes(e.value.toUpperCase())))&&f.push({type:"NoCTDATA",offset:{position:E[0].range.start,end:E[E.length-1].range.end}});break;case"DCL-SUBF":case"DCL-PARM":if(t.UselessOperationCheck&&E[1]&&E[1].value){const e=E[1].value.toUpperCase();je.includes(e)||f.push({offset:{position:E[0].range.start,end:E[0].range.end+1},type:"UselessOperationCheck"})}}break;case"end":if(d=E[0].value.toUpperCase(),t.SpecificCasing){const e=t.SpecificCasing.find((e=>[d,"*DECLARE"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d){case"ENDSR":c?c=!1:f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),!1===a&&t.NoGlobalSubroutines&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoGlobalSubroutines",newValue:"End-Proc"});break;case"END-DS":u-=1;break;case"END-PROC":(!1===a||c)&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),a=!1;break;case"END-PR":case"END-PI":!1===l&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),l=!1}break;case"word":if(d=E[0].value.toUpperCase(),t.SpecificCasing){const e=t.SpecificCasing.find((e=>d===e.operation.toUpperCase()));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d.toUpperCase()){case"EVAL":case"CALLP":E[1]&&"openbracket"!==E[1].type&&t.UselessOperationCheck&&f.push({offset:{position:E[0].range.start,end:E[0].range.end+1},type:"UselessOperationCheck"});break;case"LEAVESR":t.NoGlobalSubroutines&&!a&&f.push({type:"NoGlobalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end},newValue:"return"});break;case"EXSR":t.NoGlobalSubroutines&&2===E.length&&n.subroutines.find((e=>e.name.toUpperCase()===E[1].value.toUpperCase()))&&f.push({type:"NoGlobalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end},newValue:`${E[1].value}()`});break;case"EXEC":if(m=!0,t.NoSELECTAll){const e=E.findIndex((e=>e.value&&"SELECT"===e.value.toUpperCase())),t=E.findIndex((e=>e.value&&"*"===e.value));e>=0&&e+1===t&&f.push({offset:{position:E[0].range.start,end:E[E.length-1].range.end},type:"NoSELECTAll"})}if(t.NoSQLJoins&&E.some((e=>e.value&&"JOIN"===e.value.toUpperCase()))&&f.push({type:"NoSQLJoins",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.NoExecuteImmediate){const e=E.findIndex((e=>e.value&&"EXECUTE"===e.value.toUpperCase())),t=E.findIndex((e=>e.value&&"IMMEDIATE"===e.value.toUpperCase()));e>=0&&e+1===t&&f.push({type:"NoExecuteImmediate",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}t.SQLHostVarCheck&&E.forEach(((e,t)=>{if("word"===e.type&&i.some((t=>t.toUpperCase()===e.value.toUpperCase()))){const n=E[t-1];n&&!["dot","seperator"].includes(n.type)&&f.push({offset:{position:e.range.start,end:e.range.end},type:"SQLHostVarCheck",newValue:`:${e.value}`})}}));break;case"SELECT":b.push({otherBlockExists:!1,offset:{position:E[0].range.start,end:E[E.length-1].range.end}});break;case"OTHER":b.length>0&&(b[b.length-1].otherBlockExists=!0);break;case"ENDSL":if(b.length>0){const e=b.pop();t.RequireOtherBlock&&e&&!e.otherBlockExists&&f.push({type:"RequireOtherBlock",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}break;case"IF":case"ELSEIF":case"WHEN":case"DOW":case"DOU":if(t.ForceOptionalParens){const e=E[E.length-1];"openbracket"===E[1].type&&"closebracket"===e.type||f.push({type:"ForceOptionalParens",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}}}}if(E.length>0)for(let e=0;e<E.length;e++)if(h=E[e],h.value)switch(h.type){case"builtin":if(t.SpecificCasing){const e=t.SpecificCasing.find((e=>[h.value.toUpperCase(),"*BIF"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=h.value.toUpperCase();break;case"*LOWER":t=h.value.toLowerCase()}h.value!==t&&f.push({offset:{position:h.range.start,end:h.range.end},type:"SpecificCasing",newValue:t})}}break;case"special":if(t.CollectReferences){d=h.value.substring(1).toUpperCase();const e=n.find(d);e&&e.references.push({offset:{position:h.range.start,end:h.range.end},type:null})}break;case"word":const o=h.value.toUpperCase();t.NoGlobalsInProcedures&&a&&!l&&n.variables.find((e=>e.name.toUpperCase()===o))&&f.push({offset:{position:h.range.start,end:h.range.end},type:"NoGlobalsInProcedures"});const c=["declare","end"].includes(E[0].type);if(t.IncorrectVariableCase&&(!1===m||m&&E[e-1]&&"seperator"===E[e-1].type)&&!((c||l||u>0)&&e>=0&&E[e+1]&&"openbracket"===E[e+1].type)){const e=i.find((e=>e.toUpperCase()===o));e&&e!==h.value&&f.push({offset:{position:h.range.start,end:h.range.end},type:"IncorrectVariableCase",newValue:e})}if(c&&e>=2||!c){if(t.RequiresParameter&&!l&&!c&&s.find((e=>e.name.toUpperCase()===o))){let t=!1;"CTL-OPT"===E[0].value.toUpperCase()||"directive"===E[0].type||(E.length<=e+1||"openbracket"!==E[e+1].type)&&(t=!0),t&&f.push({offset:{position:h.range.start,end:h.range.end},type:"RequiresParameter"})}if(t.CollectReferences){if(E[e-1]&&"dot"===E[e-1].type)break;let t;if(r&&r.scope&&(t=r.scope.find(o),t||(t=r.subItems.find((e=>e.name.toUpperCase()===o)))),t||(t=n.find(o)),t&&((void 0===t.position||t.position&&t.position.line!==p)&&t.references.push({offset:{position:h.range.start,end:h.range.end}}),t.keyword.QUALIFIED)){let n=e+1;if(E[n]&&("openbracket"===E[n].type&&(n=E.findIndex(((e,t)=>t>n&&"closebracket"===e.type)),n>=0&&n++),E[n]&&"dot"===E[n].type&&(n++,E[n]&&"word"===E[n].type&&E[n].value))){const e=E[n],r=e.value.toUpperCase(),o=t.subItems.find((e=>e.name.toUpperCase()==r));o&&o.references.push({offset:{position:e.range.start,end:e.range.end}})}}}}break;case"string":if(""===h.value.substring(1,h.value.length-1).trim()&&t.RequireBlankSpecial&&!m)f.push({offset:{position:h.range.start,end:h.range.end},type:"RequireBlankSpecial",newValue:"*BLANK"});else if(t.StringLiteralDupe&&!m&&"declare"!==E[0].type){let e=R.find((e=>e.value===h.value));e||(e={value:h.value,list:[]},R.push(e)),e.list.push({offset:{position:h.range.start,end:h.range.end}})}}}if("format"===E[0].type&&"**CTDATA"===E[0].value.toUpperCase())break;v||(v=[Ge.singleIndent,Ge.single].includes(D)),void 0!==w.statements[k-1]&&w.statements[k-1].range.line===p||(r&&!1===v&&(m=E[0].value.toUpperCase(),["ENDIF","ENDFOR","ENDDO","ELSE","ELSEIF","ON-ERROR","ENDMON","ENDSR","WHEN","OTHER","END-PROC","END-PI","END-PR","END-DS","ENDSL"].includes(m)&&(g-=o,["ENDSL"].includes(m)&&(g-=o),"END-PROC"===m&&d&&(d=!1,g-=o)),y!==g&&h.push({line:p,expectedIndent:g,currentIndent:y}),["IF","ELSE","ELSEIF","FOR","FOR-EACH","DOW","DOU","MONITOR","ON-ERROR","ON-EXIT","BEGSR","SELECT","WHEN","OTHER","DCL-PROC","DCL-PI","DCL-PR","DCL-DS"].includes(m)&&(["DCL-DS","DCL-PI","DCL-PR"].includes(m)&&S[m].some((e=>E.map((e=>e.value.toUpperCase())).includes(e)))||("SELECT"===m?!1===v&&(g+=2*o):"ON-EXIT"===m?(g+=o,d=!0):g+=o))),D=Ge.none)}}if(R.length>0){const e=t.literalMinimum||2;R.forEach((t=>{t.list.length>=e&&t.list.forEach((e=>{var n,r;f.push((n=((e,t)=>{for(var n in t||(t={}))Ke.call(t,n)&&ze(e,n,t[n]);if(Ve)for(var n of Ve(t))Be.call(t,n)&&ze(e,n,t[n]);return e})({},e),r={type:"StringLiteralDupe",newValue:t.definition},$e(n,He(r))))}))}))}return t.NoExternalTo&&t.NoExternalTo.length&&[n,...n.procedures.filter((e=>void 0!==e.scope)).map((e=>e.scope))].forEach((e=>{e.procedures.forEach((e=>{if(e.keyword.EXTPROC||e.keyword.EXTPGM){let n=e.keyword.EXTPROC||e.keyword.EXTPGM;if(n=!0===n?e.name.toUpperCase():n.toUpperCase(),n=n.startsWith("'")&&n.endsWith("'")?n.substring(1,n.length-1):n,t.NoExternalTo.includes(n)){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoExternalTo",offset:{position:t.range.start,end:t.range.end}})}}}))})),t.NoUnreferenced&&[n,...n.procedures.filter((e=>void 0!==e.scope)).map((e=>e.scope))].forEach((t=>{[...t.constants,...t.variables].filter((t=>t.position.path===e.uri)).forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),t.subroutines.filter((t=>t.position.path===e.uri&&t.name&&!["*INZSR","*PSSR"].includes(t.name.toUpperCase()))).forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),t.procedures.filter((t=>t.position.path===e.uri)).forEach((e=>{if(!e.keyword.EXPORT){if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}e.keyword.EXTPGM||e.keyword.EXTPROC||e.subItems.forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}}))}})),t.structs.filter((t=>t.position.path===e.uri)).forEach((e=>{const t=e.subItems.some((e=>e.references.length>0));if(0===e.references.length&&(e.subItems.forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),!1===t)){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}}))})),{indentErrors:h,errors:f,doc:w}}}var Je=n(2884),Ye=n(1017),Ze=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));let et={},tt=!1;function nt(e){return Ze(this,null,(function*(){const t=yield Me(e);if(t){const n=yield ot(e),r=null==n?void 0:n.getText();if(r)try{const n=JSON.parse(r);if(n.includePath&&Array.isArray(n.includePath)){n.includePath.some((e=>"string"!=typeof e))?console.log(`${e} -> 'includePath' is not a valid string array.`):et[t.uri]=n.includePath}return n}catch(t){console.log(`Unable to parse JSON in ${e}.`)}}return{}}))}function rt(e){return Ze(this,null,(function*(){const t=yield ot(e);if(t){const n=null==t?void 0:t.getText(),r=yield I.getDocs(e,n);r&&n.length>=6&&"**FREE"===n.substring(0,6).toUpperCase()&&Xe.getErrors({uri:e,content:n},{CollectReferences:!0},r)}}))}function ot(t){return Ze(this,null,(function*(){let n=q.get(t);if(n)return n;try{const n=yield V.readFile(M.parse(t).fsPath,{encoding:"utf-8"});return e.create(t,"rpgle",1,n)}catch(e){}}))}let it=[];function st(e){return Ze(this,null,(function*(){const t=yield Me(e);if(t){const e=M.parse(null==t?void 0:t.uri).path;(!it||it&&0===it.length)&&(it=Je.glob.sync("**/*.{rpgleinc,rpgleh}",{cwd:e,nocase:!0,absolute:!0}).map((t=>({uri:M.file(t).toString(),relative:Ye.relative(e,t)}))))}return it}))}const at=n(1017);function ct(){let e=[];return tt&&Object.keys(I.parsedCache).forEach((t=>{const n=at.parse(t).base,r=at.parse(n);let o=at.basename(r.name).toUpperCase();if(o.endsWith(".PGM")&&(o=o.substring(0,o.length-4)),!1===n.toLowerCase().endsWith(".rpgleinc")){const n=I.getParsedCache(t);if(n){const t=n.keyword.MAIN;if(t){if("string"==typeof t){const r=n.procedures.find((e=>e.name.toUpperCase()===t.toUpperCase()));if(r){let t=r.keywords.map((e=>e.toLowerCase()));t.push(`extpgm('${o}')`);const n=[`dcl-pr ${r.name} ${t.join(" ")};`,...r.subItems.map((e=>` ${e.name} ${e.keywords.map((e=>e.toLowerCase())).join(" ")};`)),"end-pr;"];e.push({name:o,insertText:`${o}(${r.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,detail:o,description:r.description,type:"function",prototype:n})}}}else n.keyword.NOMAIN&&n.procedures.forEach((t=>{if(t.keyword.EXPORT){let n=t.keywords.map((e=>e.toLowerCase())).filter((e=>"export"!==e));n.push(`extproc('${t.name.toUpperCase()}')`);const r=[`dcl-pr ${t.name} ${n.join(" ")};`,...t.subItems.map((e=>` ${e.name} ${e.keywords.map((e=>e.toLowerCase())).join(" ")};`)),"end-pr;"];e.push({name:t.name,insertText:`${t.name}(${t.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,detail:t.name,description:t.description,type:"function",prototype:r})}}))}}})),e}const ut=n(1017),lt={function:o.CompletionItemKind.Function,struct:o.CompletionItemKind.Struct},dt="\n";function pt(e){return t=this,n=null,r=function*(){const t=e.textDocument.uri,n=e.range,r=q.get(t);if(r&&"**FREE"===r.getText(o.Range.create(0,0,0,6)).toUpperCase()){const e=yield I.getDocs(r.uri);if(e){const t=yield Ct(r,e,!1);if(t){const e=t.errors.filter((e=>n.start.line===r.positionAt(e.offset.position).line));if(e.length>0)return Dt(r,e)}}}},new Promise(((e,o)=>{var i=e=>{try{a(r.next(e))}catch(e){o(e)}},s=e=>{try{a(r.throw(e))}catch(e){o(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((r=r.apply(t,n)).next())}));var t,n,r}function ht(e){return t=this,n=null,r=function*(){const t=e.textDocument.uri,n=q.get(t);if(n&&"**FREE"===n.getText(o.Range.create(0,0,0,6)).toUpperCase()){const e=yield Rt(n.uri);if(e){let t=yield I.getDocs(n.uri);if(t){t=yield I.getDocs(n.uri,n.getText(),{ignoreCache:!0});const{errors:r}=Xe.getErrors({uri:n.uri,content:n.getText()},e,t),i=Dt(n,r.filter((e=>"RequiresProcedureDescription"!==e.type)));let s=[],a=0,c=[];i.filter((e=>e.edit)).forEach((e=>{if(e.edit&&e.edit.changes){const t=e.edit.changes[n.uri];t[0]&&s.includes(t[0].range.start.line)?a+=1:t.forEach((e=>{const t=e.range.start.line;c.push(e),s.includes(t)||s.push(t)}))}}));const{indentErrors:u}=Xe.getErrors({uri:n.uri,content:n.getText()},e,t),l=u.map((e=>{const t=o.Range.create(e.line,0,e.line,e.currentIndent);return o.TextEdit.replace(t,"".padEnd(e.expectedIndent," "))}));return[...c,...l]}}}return[]},new Promise(((e,o)=>{var i=e=>{try{a(r.next(e))}catch(e){o(e)}},s=e=>{try{a(r.throw(e))}catch(e){o(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((r=r.apply(t,n)).next())}));var t,n,r}function ft(e){const t=e.split("/").map((e=>e.split(","))).flat().filter((e=>e.length>=1));return{name:t[t.length-1],file:t[t.length-2],library:t[t.length-3],asp:t[t.length-4]}}var mt=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const gt=n(1017);let yt={};function vt(e,t){return t.offset,o.Range.create(e.positionAt(t.offset.position),e.positionAt(t.offset.end))}let bt={};function Rt(e){return mt(this,null,(function*(){const t=yield function(e){return mt(this,null,(function*(){const t=M.parse(e);let n;const r=bt[e];if(r)return 0===r.resolved?r.uri:void 0;switch(t.scheme){case"member":if(n=["",ft(t.path).library,"VSCODE","RPGLINT.JSON"].join("/"),n=M.from({scheme:"member",path:n}).toString(),yt[n])return n;n=yield Oe(n);break;case"streamfile":const e=yield _e.sendRequest("getWorkingDirectory");e&&(n=M.from({scheme:"streamfile",path:gt.posix.join(e,".vscode","rpglint.json")}).toString(),n=yield Oe(n,t.scheme));break;case"file":n=yield Oe("rpglint.json",t.scheme)}return bt[e]=n?{resolved:0,uri:n}:{resolved:1,uri:""},n}))}(e);let n={};if(t){if(yt[t])return JSON.parse(yt[t]);try{yt[t]="{}";const e=yield qe(t);e&&(n=JSON.parse(e),yt[t]=e)}catch(e){delete yt[t],console.log(`Error getting lint config for ${t}: ${e.message}`),console.log(e.stack)}}return n}))}function Ct(e,t,n=!0){return mt(this,null,(function*(){if("**FREE"===e.getText(o.Range.create(0,0,0,6)).toUpperCase()){const r=e.getText(),i=[],s=[],a=yield Rt(e.uri);let c,u;tt&&(a.CollectReferences=!0,u=(yield st(e.uri)).map((e=>e.relative)));try{c=Xe.getErrors({uri:e.uri,content:r,availableIncludes:u},a,t)}catch(t){return console.log(`Error linting ${e.uri}: ${t.message}`),void console.log(t.stack)}const l=c.indentErrors,d=c.errors;return l.length>0&&l.forEach((e=>{const t=o.Range.create(e.line,0,e.line,e.currentIndent);i.push(o.Diagnostic.create(t,`Incorrect indentation. Expected ${e.expectedIndent}, got ${e.currentIndent}`,o.DiagnosticSeverity.Warning))})),d.length>0&&d.forEach((t=>{const n=vt(e,t),r=o.Diagnostic.create(n,Xe.getErrorText(t.type),o.DiagnosticSeverity.Warning);s.push(r)})),n&&_e.sendDiagnostics({uri:e.uri,diagnostics:[...i,...s]}),c}}))}function Dt(e,t){let n=[];const r=t.filter((e=>"NoGlobalSubroutines"===e.type));return t=t.filter((e=>"NoGlobalSubroutines"!==e.type)),r.reverse(),t.push(...r),t.forEach((t=>{let r,i=vt(e,t);switch(t.type){case"UppercaseConstants":t.newValue&&(r=o.CodeAction.create("Convert constant name to uppercase",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"ForceOptionalParens":r=o.CodeAction.create("Add brackets around expression",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.insert(i.end,")"),o.TextEdit.insert(i.start,"(")]}},n.push(r);break;case"UselessOperationCheck":r=o.CodeAction.create("Remove operation code",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.del(i)]}},n.push(r);break;case"SpecificCasing":case"IncorrectVariableCase":case"UppercaseDirectives":t.newValue&&(r=o.CodeAction.create(`Correct casing to '${t.newValue}'`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"RequiresProcedureDescription":r=o.CodeAction.create("Add title and description",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.insert(i.start,"///\n// Title\n// Description\n///\n")]}},n.push(r);break;case"RequireBlankSpecial":t.newValue&&(r=o.CodeAction.create("Convert constant name to uppercase",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"SQLHostVarCheck":case"CopybookDirective":case"StringLiteralDupe":case"NoGlobalSubroutines":t.newValue&&(r=o.CodeAction.create(`Switch to '${t.newValue}'`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"IncludeMustBeRelative":t.newValue&&(r=o.CodeAction.create(`Correct path to ${t.newValue}`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"PrettyComments":t.newValue&&(r=o.CodeAction.create("Fix comment formatting",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r))}})),n}const wt=n(1017);var kt=n(7147),Tt=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const St=n(1017);let Et=!1,Pt=!1,_t=!1,xt=!1;_e.onInitialize((e=>{const n=e.capabilities;Et=!(!n.workspace||!n.workspace.configuration),Pt=!(!n.workspace||!n.workspace.workspaceFolders),_t=!!(n.textDocument&&n.textDocument.publishDiagnostics&&n.textDocument.publishDiagnostics.relatedInformation);const r={capabilities:{textDocumentSync:t.TextDocumentSyncKind.Incremental}};if(r.capabilities.documentSymbolProvider=!0,r.capabilities.definitionProvider=!0,r.capabilities.completionProvider={triggerCharacters:[" ",".",":"]},r.capabilities.hoverProvider=!0,r.capabilities.referencesProvider=!0,r.capabilities.implementationProvider=!0,r.capabilities.codeActionProvider=!0,r.capabilities.documentFormattingProvider={workDoneProgress:!0},Pt&&(r.capabilities.workspace={workspaceFolders:{supported:!0}}),Pt){const t=e.workspaceFolders;t&&t.length>0&&(xt=!0,r.capabilities.workspaceSymbolProvider=!0)}return console.log(`Project Mode enabled: ${xt}`),r})),_e.onInitialized((()=>{xt&&function(){Ze(this,null,(function*(){tt=!0,function(){Ze(this,null,(function*(){const e=yield _e.workspace.getWorkspaceFolders();let t=!1;if(e){let n=[];for(const r of e){const e=M.parse(r.uri).fsPath;console.log(`Starting search of: ${e}`);const o=Je.glob.sync("**/*.{rpgle,sqlrpgle,rpgleinc,rpgleh}",{cwd:e,absolute:!0,nocase:!0});console.log(`Found RPGLE files: ${o.length}`),n.push(...o.map((e=>M.from({scheme:"file",path:e}).toString())));const i=Je.glob.sync("**/iproj.json",{cwd:e,absolute:!0,nocase:!0});if(i.length>0){const e=i[0],n=M.from({scheme:"file",path:e}).toString();(yield nt(n)).big&&(t=!0)}}if(t&&console.log("Big mode detected!"),n.length<1e3||t)for(const e of n)yield rt(e);else console.log("Disabling project mode for large project."),tt=!1}}))}(),Ne.push((e=>{e.changes.forEach((e=>{const t=Ye.parse(e.uri),n=t.ext.toLowerCase();switch(e.type){case o.FileChangeType.Created:case o.FileChangeType.Changed:switch(n){case".rpgleinc":case".rpgleh":rt(e.uri),it=[];break;case".json":"iproj.json"===t.base&&nt(e.uri)}break;default:I.clearParsedCache(e.uri)}}))})),_e.onRequest("getCache",(e=>I.getParsedCache(e)))}))}()})),I.setTableFetch(((e,t=!1)=>Tt(void 0,null,(function*(){var n;return function(e,t=!1){let n={};return e.forEach((e=>{const{WHNAME:r,WHFLDT:o,WHFLDB:i,WHFLDD:s,WHFLDP:a,WHFTXT:c}=e,u=e.WHALIS?e.WHALIS.trim():void 0,l=t&&u||e.WHFLDE;if(""===l.trim())return;if(l.startsWith("*"))return;let d;n[r]?d=n[r]:(d=new w("struct"),d.name=r,n[r]=d);const p=new w("subitem");p.name=l;const h=[];"Y"===e.WHVARL&&h.push("VARYING"),p.keywords=[N({type:o,len:0===s?i:s,decimals:a,keywords:h})],p.description=c.trim(),d.subItems.push(p)})),Object.values(n)}(yield(n=e,_e.sendRequest("getObject",n)),t)}))));let Nt={};I.setIncludeFileFetch(((e,t)=>Tt(void 0,null,(function*(){const n=M.parse(e),r=n.path;let o,i;if(!Nt[t]){Nt[t]=!0;const s=t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"'),a=s||t.includes("/")&&!t.includes(",");if(o=t,s&&(o=o.substring(1,o.length-1)),a)if(["streamfile","member"].includes(n.scheme))if(o.startsWith("/"))i=M.from({scheme:"streamfile",path:o}).toString();else{const t=[o,`${o}.rpgleinc`,`${o}.rpgle`],n=yield Le(e,t);n&&(i=M.from({scheme:"streamfile",path:n}).toString())}else{const t=yield _e.workspace.getWorkspaceFolders();let s;if(t&&(s=t.find((e=>r.startsWith(M.parse(e.uri).path)))),tt?i=yield Oe(o,n.scheme):(s&&(o=St.posix.join(M.parse(s.uri).path,o)),i=(0,kt.existsSync)(o)?M.from({scheme:n.scheme,path:o}).toString():void 0),!i){const t=yield Le(e,[o]);t&&(i=M.from({scheme:"streamfile",path:t}).toString())}}else{const r=ft(t);let s=r.file||"QRPGLESRC",a=r.name;if(r.library)o=["",...r.asp?[r.asp]:[],r.library,s,a+".rpgleinc"].join("/"),o=M.from({scheme:"member",path:o}).toString(),i=yield Oe(o,n.scheme);else{const t=yield function(e,t,n){return Pe(this,null,(function*(){const r=n+t;if(Ie[e]&&Ie[e][r])return Ie[e][r];const o=yield xe.add((()=>_e.sendRequest("memberResolve",[t,n])));return o&&(Ie[e]||(Ie[e]={}),Ie[e][r]=o),o}))}(e,a,s);t&&(o=["",...r.asp?[r.asp]:[],t.library,t.file,t.name+".rpgleinc"].join("/"),i=M.from({scheme:"member",path:o}).toString())}}if(Nt[t]=!1,i){const e=yield qe(i);if(e)return{found:!0,uri:i,lines:e.split("\n")}}}return Nt[t]=!1,{found:!1,uri:i}})))),_e.onDocumentSymbol((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=[],r=q.get(t);if(r){const e=yield I.getDocs(t,r.getText()),i=e=>{const n=[];return e.procedures.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Function,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0));e.scope&&(r.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),r.children.push(...i(e.scope))),n.push(r)})),n.push(...e.subroutines.filter((e=>e.position&&e.position.path===t)).filter((e=>e.range.start)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Function,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0)))),...e.variables.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Variable,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),...e.constants.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Constant,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0))))),e.files.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.File,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0));r.children=[],e.subItems.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const n=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Struct,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0));n.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),r.children&&r.children.push(n)})),n.push(r)})),e.structs.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Struct,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0));r.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),n.push(r)})),n};e&&n.push(...i(e))}return n},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onDefinition((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=e.position.line,r=q.get(t);if(r){const i=yield I.getDocs(t,r.getText());if(i){const s=r.getText(o.Range.create(n,0,n,200)),a=O.getIncludeFromDirective(s);if(a){const e=yield I.includeFileFetch(t,a);if(e.found&&e.uri)return o.Location.create(e.uri,o.Range.create(0,0,0,0))}else{const t=A(r,e.position);if(t){const e=i.findDefinition(n,t);if(e)return o.Location.create(e.position.path,o.Range.create(e.position.line,0,e.position.line,0))}}}}return null},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onCompletion((function(e){return t=this,null,n=function*(){var t;const n=[],r=e.position.line,i=null==(t=e.context)?void 0:t.triggerCharacter,s=e.textDocument.uri,a=q.get(s);if(a){const t=yield I.getDocs(s,a.getText());if(t){const c="**FREE"===a.getText(o.Range.create(0,0,0,6)).toUpperCase(),u=t.procedures.find(((e,n)=>r>=e.range.start&&(r<=e.range.end+1||n===t.procedures.length-1))),l=a.getText(o.Range.create(e.position.line,0,e.position.line,200));if("."===i){let r=o.Position.create(e.position.line,e.position.character-2),i=A(a,r);if(i){const t=l.lastIndexOf("(",r.character);t>-1&&(r=o.Position.create(e.position.line,t-1),i=A(a,r))}if(i){i=i.toUpperCase();const e=[u&&u.scope?u.scope.parameters.find((e=>e.name.toUpperCase()===i&&e.subItems.length>0)):void 0,u&&u.scope?u.scope.structs.find((e=>e.name.toUpperCase()===i)):void 0,t.structs.find((e=>e.name.toUpperCase()===i))].find((e=>e));e&&e.keyword.QUALIFIED&&n.push(...e.subItems.map((t=>{const n=o.CompletionItem.create(t.name);return n.kind=o.CompletionItemKind.Property,n.insertText=t.name,n.detail=t.keywords.join(" "),n.documentation=t.description+""+(e?` (${e.name})`:""),n})))}}else{const e=l.toUpperCase();if(tt&&(e.includes("/COPY")||e.includes("/INCLUDE"))){const e=yield st(s);n.push(...e.map((e=>{const t=ut.basename(e.uri),n=o.CompletionItem.create(t);return n.kind=o.CompletionItemKind.File,n.insertText=`'${e.relative}'`,n.detail=e.relative,n})))}else if(l.trimStart().startsWith("//"))n.push(...H);else{const e=e=>{for(const t of e.parameters){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Variable,e.insertText=t.name,e.detail=["parameter",...t.keywords].join(" "),e.documentation=t.description,n.push(e)}for(const t of e.procedures){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Function,e.insertTextFormat=o.InsertTextFormat.Snippet,e.insertText=`${t.name}(${t.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}for(const t of e.subroutines){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Function,e.insertText=`${t.name}`,e.documentation=t.description,n.push(e)}for(const t of e.variables){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Variable,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}e.files.forEach((e=>{const t=o.CompletionItem.create(`${e.name}`);t.kind=o.CompletionItemKind.File,t.insertText=`${e.name}`,t.detail=e.keywords.join(" "),t.documentation=e.description,n.push(t);for(const t of e.subItems){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Struct,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e),t.keyword.QUALIFIED||t.subItems.forEach((e=>{const r=o.CompletionItem.create(`${e.name}`);r.kind=o.CompletionItemKind.Property,r.insertText=`${e.name}`,r.detail=e.keywords.join(" "),r.documentation=e.description+` (${t.name})`,n.push(r)}))}}));for(const t of e.structs){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Struct,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e),t.keyword.QUALIFIED||t.subItems.forEach((e=>{const r=o.CompletionItem.create(`${e.name}`);r.kind=o.CompletionItemKind.Property,r.insertText=`${e.name}`,r.detail=e.keywords.join(" "),r.documentation=e.description+` (${t.name})`,n.push(r)}))}for(const t of e.constants){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Constant,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}};if(e(t),u&&u.scope&&e(u.scope),c){const e=s.toLowerCase().endsWith(".rpgleinc"),r=t.getDefinitionBlockEnd(a.uri)+1,i=o.Range.create(r,0,r,0);[...F,...ct()].filter((e=>!t.procedures.some((t=>{const n=e.name.toUpperCase();if(t.name.toUpperCase()===n)return!0;let r=t.keyword.EXTPROC||t.keyword.EXTPGM;return"string"==typeof r&&(r.startsWith("'")&&(r=r.substring(1)),r.endsWith("'")&&(r=r.substring(0,r.length-1)),r.toUpperCase()===n)||void 0}))&&!t.structs.some((t=>t.name.toUpperCase()===e.name.toUpperCase())))).forEach((t=>{const r=o.CompletionItem.create(t.name);r.kind=lt[t.type],r.detail=`${t.detail} (auto-import)`,r.documentation={kind:"markdown",value:[t.description,t.example?["---","","```rpgle",t.example.join(dt),"```"].join(dt):void 0].filter((e=>e)).join(dt+dt)},r.insertTextFormat=o.InsertTextFormat.Snippet,e?r.insertText=t.prototype.join(dt):(r.insertText=t.insertText,r.additionalTextEdits=[{range:i,newText:dt+t.prototype.join(dt)+dt}]),n.push(r)}))}}}}}return n},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onHover((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=e.position.line,r=q.get(t);if(r){const i=yield I.getDocs(t,r.getText());if(i){const s=A(r,e.position);if(!s)return;const a=i.procedures.find((e=>e.name.toUpperCase()===s.toUpperCase()));if(a){let e="",n=a.keywords.filter((e=>"EXTPROC"!==e));0===n.length&&(n=["void"]);const r=a.tags.find((e=>"return"===e.tag)),i=a.tags.find((e=>"deprecated"===e.tag));i&&(e+=`**Deprecated:** ${i.content}\n\n`),e+=`\`\`\`vb\n${a.name}(`,a.subItems.length>0&&(e+=`\n ${a.subItems.map((e=>`${e.name}: ${e.keywords.join(" ").trim()}`)).join(",\n ")}\n`),e+=`): ${n.join(" ")}\n\`\`\` \n`,a.description&&(e+=`${a.description}\n\n`);const s=a.tags.filter((e=>"param"===e.tag));return e+=a.subItems.map(((e,t)=>`*@param* \`${e.name.replace(new RegExp("\\*","g"),"\\*")}\` ${s[t]?s[t].content:e.description}`)).join("\n\n"),r&&(e+=`\n\n*@returns* ${r.content}`),a.position&&t!==a.position.path&&(e+=`\n\n*@file* \`${a.position.path}:${a.position.line+1}\``),{contents:{kind:o.MarkupKind.Markdown,value:e}}}{const e=i.procedures.find((e=>n>=e.range.start&&n<=e.range.end));let a;if(e&&e.scope&&(a=e.scope.find(s)),a||(a=i.find(s)),a){let e=`\`${a.name}\`: \`${a.keywords.join(" ").trim()}\``;return a.position&&t!==a.position.path&&(e+=`\n\n*@file* \`${a.position.path}:${a.position.line+1}\``),{contents:{kind:o.MarkupKind.Markdown,value:e}}}{const e=r.getText(o.Range.create(n,0,n,200)),i=O.getIncludeFromDirective(e);if(i){const e=yield I.includeFileFetch(t,i);let n=i;if(e.found&&e.uri){const t=M.parse(e.uri);if("member"===t.scheme){const e=t.path.lastIndexOf(".");n=e>=0?t.path.substring(0,e):t.path,n.startsWith("/")&&(n=n.substring(1))}else n=t.path}return{contents:{kind:o.MarkupKind.Markdown,value:(e.found?`\`${n}\``:i)+` (${e.found?"found":"not found"})`}}}}}}}},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onReferences((function(e){return t=this,null,n=function*(){var t;const n=e.textDocument.uri,r=e.position,i=q.get(n);if(i){const e="**FREE"===i.getText(o.Range.create(0,0,0,6)).toUpperCase();let s=null==(t=A(i,r))?void 0:t.trim();if(s){if(s.endsWith(";")){const e=s.split(";");s=e[0]}const t=yield I.getDocs(n,i.getText());if(t){e&&Xe.getErrors({uri:n,content:i.getText()},{CollectReferences:!0},t);const a=t.findDefinition(r.line,s);if(a)return tt?yield function(e){return((e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())})))(this,null,(function*(){let t=[];if(tt){const n=Object.keys(I.parsedCache),r=q.get(e.position.path);if(r&&t.push(...e.references.map((t=>o.Location.create(e.position.path,vt(r,t))))),e.keyword.EXPORT){const r=e.name.toUpperCase();for(const e of n){const n=q.get(e);n&&I.getParsedCache(e).procedures.forEach((i=>{let s=!1;const a=i.keyword.EXTPROC;var c;a?!0===a?i.name.toUpperCase()===r&&(s=!0):(c=a,"'"===c[0]&&(c=c.substring(1)),"'"===c[c.length-1]&&(c=c.substring(0,c.length-1)),c).toUpperCase()===r&&(s=!0):i.keyword.EXPORT||i.name.toUpperCase()!==r||(s=!0),s&&(t.some((t=>t.uri===e))||t.push(o.Location.create(i.position.path,o.Range.create(i.position.line,0,i.position.line,0)),...i.references.map((t=>o.Location.create(e,vt(n,t))))))}))}}else{const r=e.position.path;for(const i of n){const n=yield ot(i);if(n){const s=I.getParsedCache(i),a=s.includes.find((e=>e.toPath===r));if(a){const r=s.find(e.name);r&&r.position.path===e.position.path&&("**FREE"!==n.getText(o.Range.create(0,0,0,6)).toUpperCase()||0===r.references.length?t.push(o.Location.create(i,o.Range.create(a.line,0,a.line,0))):t.push(...r.references.map((e=>o.Location.create(i,vt(n,e))))))}}}}}return t}))}(a):a.references.map((e=>o.Location.create(a.position.path,vt(i,e))))}}}},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onWorkspaceSymbol((function(e){if(console.log(e.query),tt){const e=Object.keys(I.parsedCache);let t=[];return e.forEach((e=>{const n=wt.basename(e);if(n.toLowerCase().endsWith(".rpgleinc"))t.push(o.WorkspaceSymbol.create(n,o.SymbolKind.File,e,o.Range.create(0,0,0,0)));else{const r=I.getParsedCache(e);r&&(r.keyword.MAIN?t.push(o.WorkspaceSymbol.create(n,o.SymbolKind.Method,e,o.Range.create(0,0,0,0))):r.keyword.NOMAIN&&r.procedures.forEach((n=>{n.keyword.EXPORT&&t.push(o.WorkspaceSymbol.create(n.name,o.SymbolKind.Function,e,o.Range.create(n.position.line,0,n.position.line,0)))})))}})),t}})),_e.onImplementation((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=q.get(t);if(n){const i=A(n,e.position);if(i){const e=i.toUpperCase();if(tt){const t=Object.keys(I.parsedCache);for(const n of t){const t=I.getParsedCache(n);for(const n of t.procedures)if(n.keyword.EXPORT&&n.name.toUpperCase()===e)return o.Location.create(n.position.path,o.Range.create(n.position.line,0,n.position.line,0))}}const n=I.getParsedCache(t);if(n){const e=n.keyword.BNDDIR;if("string"==typeof e){const t=e.split(":").map((e=>{return"'"===(t=e)[0]&&(t=t.substring(1)),"'"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t;var t})).map((e=>{const t=e.split("/");return{name:t[t.length-1],lib:t[t.length-2]}})),n=yield(r={symbol:i,binders:t},_e.sendRequest("symbolLookup",r));if(n){const e=Object.keys(n).find((e=>e.toUpperCase()===i.toUpperCase()));if(e){const t=n[e],r=yield Promise.allSettled(t.map((e=>Oe(e))));for(const e of r)if("fulfilled"===e.status&&e.value){const t=I.getParsedCache(e.value);if(t){const e=t.find(i);return o.Location.create(e.position.path,o.Range.create(e.position.line,0,e.position.line,0))}}}}}}}}var r},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),function(e){e.onCodeAction(pt),e.onDocumentFormatting(ht),Ne.push((e=>{let t=!1;e.changes.forEach((e=>{const n=e.uri.toLowerCase();if("rpglint.json"===gt.basename(n)){const e=Object.keys(yt).find((e=>e.toLowerCase()===n));e&&yt[e]&&delete yt[e],bt={},t=!0}})),t&&q.all().forEach((e=>{"rpgle"===e.languageId&&I.getDocs(e.uri,e.getText(),{withIncludes:!0,ignoreCache:!0}).then((t=>{t&&Ct(e,t)}))}))})),q.onDidOpen((e=>mt(this,null,(function*(){const t=e.document.uri,n=M.parse(t);["member","streamfile"].includes(n.scheme)&&(bt={},yt={})})))),q.onDidClose((e=>mt(this,null,(function*(){const t=e.document.uri;Ie[t]={},Ae[t]={}}))))}(_e),q.onDidChangeContent((e=>{I.getDocs(e.document.uri,e.document.getText(),{withIncludes:!0,ignoreCache:!0}).then((t=>{t&&Ct(e.document,t)}))})),q.listen(_e),_e.listen()})();var o=exports;for(var i in r)o[i]=r[i];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
s [Error]: Unhandled method getUri
at /Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1:51163
at /Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1:51457
at Immediate.<anonymous> (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1:51819)
at process.processImmediate (node:internal/timers:466:21) {
code: -32601,
data: undefined
}
[Info - 3:08:00 PM] Connection to server got closed. Server will restart.
[Error - 3:08:00 PM] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
at Object.dispose (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:57991)
at Object.dispose (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:138077)
at T.handleConnectionClosed (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:138290)
at T.handleConnectionClosed (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:198643)
at t (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:136379)
at r.invoke (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:59604)
at o.fire (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:60365)
at Y (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:47249)
at r.invoke (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:59604)
at o.fire (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:60365)
at d.fireClose (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:68246)
at ChildProcess.<anonymous> (/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/extension.js:1:79207)
at ChildProcess.emit (node:events:525:35)
at maybeClose (node:internal/child_process:1121:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
Project Mode enabled: true
Validating file from server: rpglint.json
Starting search of: /Users/adamshirley/apps/k3s/K3S-Replenish-RPG
Found RPGLE files: 1079
Validating file from server: rpglint.json
/Users/adamshirley/.vscode/extensions/halcyontechltd.vscode-rpgle-0.21.3/out/server.js:1
(()=>{var e={5623:e=>{"use strict";function t(e,t,o){e instanceof RegExp&&(e=n(e,o)),t instanceof RegExp&&(t=n(t,o));var i=r(e,t,o);return i&&{start:i[0],end:i[1],pre:o.slice(0,i[0]),body:o.slice(i[0]+e.length,i[1]),post:o.slice(i[1]+t.length)}}function n(e,t){var n=t.match(e);return n?n[0]:null}function r(e,t,n){var r,o,i,s,a,c=n.indexOf(e),u=n.indexOf(t,c+1),l=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],i=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(e,l+1)):1==r.length?a=[r.pop(),u]:((o=r.pop())<i&&(i=o,s=u),u=n.indexOf(t,l+1)),l=c<u&&c>=0?c:u;r.length&&(a=[i,s])}return a}e.exports=t,t.range=r},1048:e=>{e.exports=function(e,n){for(var r=[],o=0;o<e.length;o++){var i=n(e[o],o);t(i)?r.push.apply(r,i):r.push(i)}return r};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,s=new Array(i);o<i;o++)s[o]=r[o].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,o,i,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,o),!0;case 5:return l.fn.call(l.context,t,r,o,i),!0;case 6:return l.fn.call(l.context,t,r,o,i,s),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,o);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||r&&a.context!==r||s(this,i);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||o&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},7334:(e,t,n)=>{e.exports=l,l.realpath=l,l.sync=d,l.realpathSync=d,l.monkeypatch=function(){r.realpath=l,r.realpathSync=d},l.unmonkeypatch=function(){r.realpath=o,r.realpathSync=i};var r=n(7147),o=r.realpath,i=r.realpathSync,s=process.version,a=/^v[0-5]\./.test(s),c=n(7059);function u(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function l(e,t,n){if(a)return o(e,t,n);"function"==typeof t&&(n=t,t=null),o(e,t,(function(r,o){u(r)?c.realpath(e,t,n):n(r,o)}))}function d(e,t){if(a)return i(e,t);try{return i(e,t)}catch(n){if(u(n))return c.realpathSync(e,t);throw n}}},7059:(e,t,n)=>{var r=n(1017),o="win32"===process.platform,i=n(7147),s=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);if(r.normalize,o)var a=/(.*?)(?:[\/\\]+|$)/g;else a=/(.*?)(?:[\/]+|$)/g;if(o)var c=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else c=/^[\/]*/;t.realpathSync=function(e,t){if(e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var n,s,u,l,d=e,p={},h={};function f(){var t=c.exec(e);n=t[0].length,s=t[0],u=t[0],l="",o&&!h[u]&&(i.lstatSync(u),h[u]=!0)}for(f();n<e.length;){a.lastIndex=n;var m=a.exec(e);if(l=s,s+=m[0],u=l+m[1],n=a.lastIndex,!(h[u]||t&&t[u]===u)){var g;if(t&&Object.prototype.hasOwnProperty.call(t,u))g=t[u];else{var y=i.lstatSync(u);if(!y.isSymbolicLink()){h[u]=!0,t&&(t[u]=u);continue}var v=null;if(!o){var b=y.dev.toString(32)+":"+y.ino.toString(32);p.hasOwnProperty(b)&&(v=p[b])}null===v&&(i.statSync(u),v=i.readlinkSync(u)),g=r.resolve(l,v),t&&(t[u]=g),o||(p[b]=v)}e=r.resolve(g,e.slice(n)),f()}}return t&&(t[d]=e),e},t.realpath=function(e,t,n){if("function"!=typeof n&&(n=function(e){return"function"==typeof e?e:function(){var e;if(s){var t=new Error;e=function(e){e&&(t.message=e.message,n(e=t))}}else e=n;return e;function n(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}(t),t=null),e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(n.bind(null,null,t[e]));var u,l,d,p,h=e,f={},m={};function g(){var t=c.exec(e);u=t[0].length,l=t[0],d=t[0],p="",o&&!m[d]?i.lstat(d,(function(e){if(e)return n(e);m[d]=!0,y()})):process.nextTick(y)}function y(){if(u>=e.length)return t&&(t[h]=e),n(null,e);a.lastIndex=u;var r=a.exec(e);return p=l,l+=r[0],d=p+r[1],u=a.lastIndex,m[d]||t&&t[d]===d?process.nextTick(y):t&&Object.prototype.hasOwnProperty.call(t,d)?R(t[d]):i.lstat(d,v)}function v(e,r){if(e)return n(e);if(!r.isSymbolicLink())return m[d]=!0,t&&(t[d]=d),process.nextTick(y);if(!o){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(f.hasOwnProperty(s))return b(null,f[s],d)}i.stat(d,(function(e){if(e)return n(e);i.readlink(d,(function(e,t){o||(f[s]=t),b(e,t)}))}))}function b(e,o,i){if(e)return n(e);var s=r.resolve(p,o);t&&(t[i]=s),R(s)}function R(t){e=r.resolve(t,e.slice(u)),g()}g()}},6772:(e,t,n)=>{function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.setopts=function(e,t,n){if(n||(n={}),n.matchBase&&-1===t.indexOf("/")){if(n.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!n.silent,e.pattern=t,e.strict=!1!==n.strict,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0),e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.fs=n.fs||o,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(l))}(e,n),e.changedCwd=!1;var s=process.cwd();r(n,"cwd")?(e.cwd=i.resolve(n.cwd),e.changedCwd=e.cwd!==s):e.cwd=s,e.root=n.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=a(e.cwd)?e.cwd:d(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,n.allowWindowsEscape=!1,e.minimatch=new c(t,n),e.options=e.minimatch.options},t.ownProp=r,t.makeAbs=d,t.finish=function(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,o=e.matches.length;r<o;r++){var i=e.matches[r];if(i&&0!==Object.keys(i).length){var s=Object.keys(i);t?n.push.apply(n,s):s.forEach((function(e){n[e]=!0}))}else if(e.nonull){var a=e.minimatch.globSet[r];t?n.push(a):n[a]=!0}}if(t||(n=Object.keys(n)),e.nosort||(n=n.sort(u)),e.mark){for(r=0;r<n.length;r++)n[r]=e._mark(n[r]);e.nodir&&(n=n.filter((function(t){var n=!/\/$/.test(t),r=e.cache[t]||e.cache[d(e,t)];return n&&r&&(n="DIR"!==r&&!Array.isArray(r)),n})))}e.ignore.length&&(n=n.filter((function(t){return!p(e,t)}))),e.found=n},t.mark=function(e,t){var n=d(e,t),r=e.cache[n],o=t;if(r){var i="DIR"===r||Array.isArray(r),s="/"===t.slice(-1);if(i&&!s?o+="/":!i&&s&&(o=o.slice(0,-1)),o!==t){var a=d(e,o);e.statCache[a]=e.statCache[n],e.cache[a]=e.cache[n]}}return o},t.isIgnored=p,t.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(t))}))};var o=n(7147),i=n(1017),s=n(6522),a=n(4095),c=s.Minimatch;function u(e,t){return e.localeCompare(t,"en")}function l(e){var t=null;if("/**"===e.slice(-3)){var n=e.replace(/(\/\*\*)+$/,"");t=new c(n,{dot:!0})}return{matcher:new c(e,{dot:!0}),gmatcher:t}}function d(e,t){var n=t;return n="/"===t.charAt(0)?i.join(e.root,t):a(t)||""===t?t:e.changedCwd?i.resolve(e.cwd,t):i.resolve(t),"win32"===process.platform&&(n=n.replace(/\\/g,"/")),n}function p(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))}))}},2884:(e,t,n)=>{e.exports=v;var r=n(7334),o=n(6522),i=(o.Minimatch,n(4378)),s=n(2361).EventEmitter,a=n(1017),c=n(9491),u=n(4095),l=n(4751),d=n(6772),p=d.setopts,h=d.ownProp,f=n(7844),m=(n(3837),d.childrenIgnored),g=d.isIgnored,y=n(778);function v(e,t,n){if("function"==typeof t&&(n=t,t={}),t||(t={}),t.sync){if(n)throw new TypeError("callback provided to sync glob");return l(e,t)}return new R(e,t,n)}v.sync=l;var b=v.GlobSync=l.GlobSync;function R(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&t.sync){if(n)throw new TypeError("callback provided to sync glob");return new b(e,t)}if(!(this instanceof R))return new R(e,t,n);p(this,e,t),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=new Array(r),"function"==typeof n&&(n=y(n),this.on("error",n),this.on("end",(function(e){n(null,e)})));var o=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===r)return a();for(var i=!0,s=0;s<r;s++)this._process(this.minimatch.set[s],s,!1,a);function a(){--o._processing,o._processing<=0&&(i?process.nextTick((function(){o._finish()})):o._finish())}i=!1}v.glob=v,v.hasMagic=function(e,t){var n=function(e,t){if(null===t||"object"!=typeof t)return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}({},t);n.noprocess=!0;var r=new R(e,n).minimatch.set;if(!e)return!1;if(r.length>1)return!0;for(var o=0;o<r[0].length;o++)if("string"!=typeof r[0][o])return!0;return!1},v.Glob=R,i(R,s),R.prototype._finish=function(){if(c(this instanceof R),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();d.finish(this),this.emit("end",this.found)}},R.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,n=0;n<this.matches.length;n++)this._realpathSet(n,r)}function r(){0==--e&&t._finish()}},R.prototype._realpathSet=function(e,t){var n=this.matches[e];if(!n)return t();var o=Object.keys(n),i=this,s=o.length;if(0===s)return t();var a=this.matches[e]=Object.create(null);o.forEach((function(n,o){n=i._makeAbs(n),r.realpath(n,i.realpathCache,(function(r,o){r?"stat"===r.syscall?a[n]=!0:i.emit("error",r):a[o]=!0,0==--s&&(i.matches[e]=a,t())}))}))},R.prototype._mark=function(e){return d.mark(this,e)},R.prototype._makeAbs=function(e){return d.makeAbs(this,e)},R.prototype.abort=function(){this.aborted=!0,this.emit("abort")},R.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},R.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var n=e[t];this._emitMatch(n[0],n[1])}}if(this._processQueue.length){var r=this._processQueue.slice(0);for(this._processQueue.length=0,t=0;t<r.length;t++){var o=r[t];this._processing--,this._process(o[0],o[1],o[2],o[3])}}}},R.prototype._process=function(e,t,n,r){if(c(this instanceof R),c("function"==typeof r),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,n,r]);else{for(var i,s=0;"string"==typeof e[s];)s++;switch(s){case e.length:return void this._processSimple(e.join("/"),t,r);case 0:i=null;break;default:i=e.slice(0,s).join("/")}var a,l=e.slice(s);null===i?a=".":u(i)||u(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(i&&u(i)||(i="/"+i),a=i):a=i;var d=this._makeAbs(a);if(m(this,a))return r();l[0]===o.GLOBSTAR?this._processGlobStar(i,a,d,l,t,n,r):this._processReaddir(i,a,d,l,t,n,r)}},R.prototype._processReaddir=function(e,t,n,r,o,i,s){var a=this;this._readdir(n,i,(function(c,u){return a._processReaddir2(e,t,n,r,o,i,u,s)}))},R.prototype._processReaddir2=function(e,t,n,r,o,i,s,c){if(!s)return c();for(var u=r[0],l=!!this.minimatch.negate,d=u._glob,p=this.dot||"."===d.charAt(0),h=[],f=0;f<s.length;f++)("."!==(g=s[f]).charAt(0)||p)&&(l&&!e?!g.match(u):g.match(u))&&h.push(g);var m=h.length;if(0===m)return c();if(1===r.length&&!this.mark&&!this.stat){for(this.matches[o]||(this.matches[o]=Object.create(null)),f=0;f<m;f++){var g=h[f];e&&(g="/"!==e?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=a.join(this.root,g)),this._emitMatch(o,g)}return c()}for(r.shift(),f=0;f<m;f++)g=h[f],e&&(g="/"!==e?e+"/"+g:e+g),this._process([g].concat(r),o,i,c);c()},R.prototype._emitMatch=function(e,t){if(!this.aborted&&!g(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var n=u(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0;var o=this.statCache[n];o&&this.emit("stat",t,o),this.emit("match",t)}}},R.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var n=this,r=f("lstat\0"+e,(function(r,o){if(r&&"ENOENT"===r.code)return t();var i=o&&o.isSymbolicLink();n.symlinks[e]=i,i||!o||o.isDirectory()?n._readdir(e,!1,t):(n.cache[e]="FILE",t())}));r&&n.fs.lstat(e,r)}},R.prototype._readdir=function(e,t,n){if(!this.aborted&&(n=f("readdir\0"+e+"\0"+t,n))){if(t&&!h(this.symlinks,e))return this._readdirInGlobStar(e,n);if(h(this.cache,e)){var r=this.cache[e];if(!r||"FILE"===r)return n();if(Array.isArray(r))return n(null,r)}this.fs.readdir(e,function(e,t,n){return function(r,o){r?e._readdirError(t,r,n):e._readdirEntries(t,o,n)}}(this,e,n))}},R.prototype._readdirEntries=function(e,t,n){if(!this.aborted){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var o=t[r];o="/"===e?e+o:e+"/"+o,this.cache[o]=!0}return this.cache[e]=t,n(null,t)}},R.prototype._readdirError=function(e,t,n){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var o=new Error(t.code+" invalid cwd "+this.cwd);o.path=this.cwd,o.code=t.code,this.emit("error",o),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return n()}},R.prototype._processGlobStar=function(e,t,n,r,o,i,s){var a=this;this._readdir(n,i,(function(c,u){a._processGlobStar2(e,t,n,r,o,i,u,s)}))},R.prototype._processGlobStar2=function(e,t,n,r,o,i,s,a){if(!s)return a();var c=r.slice(1),u=e?[e]:[],l=u.concat(c);this._process(l,o,!1,a);var d=this.symlinks[n],p=s.length;if(d&&i)return a();for(var h=0;h<p;h++)if("."!==s[h].charAt(0)||this.dot){var f=u.concat(s[h],c);this._process(f,o,!0,a);var m=u.concat(s[h],r);this._process(m,o,!0,a)}a()},R.prototype._processSimple=function(e,t,n){var r=this;this._stat(e,(function(o,i){r._processSimple2(e,t,o,i,n)}))},R.prototype._processSimple2=function(e,t,n,r,o){if(this.matches[t]||(this.matches[t]=Object.create(null)),!r)return o();if(e&&u(e)&&!this.nomount){var i=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=a.join(this.root,e):(e=a.resolve(this.root,e),i&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),o()},R.prototype._stat=function(e,t){var n=this._makeAbs(e),r="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&h(this.cache,n)){var o=this.cache[n];if(Array.isArray(o)&&(o="DIR"),!r||"DIR"===o)return t(null,o);if(r&&"FILE"===o)return t()}var i=this.statCache[n];if(void 0!==i){if(!1===i)return t(null,i);var s=i.isDirectory()?"DIR":"FILE";return r&&"FILE"===s?t():t(null,s,i)}var a=this,c=f("stat\0"+n,(function(r,o){if(o&&o.isSymbolicLink())return a.fs.stat(n,(function(r,i){r?a._stat2(e,n,null,o,t):a._stat2(e,n,r,i,t)}));a._stat2(e,n,r,o,t)}));c&&a.fs.lstat(n,c)},R.prototype._stat2=function(e,t,n,r,o){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,o();var i="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return o(null,!1,r);var s=!0;return r&&(s=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||s,i&&"FILE"===s?o():o(null,s,r)}},5146:(e,t,n)=>{var r=n(1048),o=n(5623);e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),y(function(e){return e.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(a).split("\\,").join(c).split("\\.").join(u)}(e),!0).map(d)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",c="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function d(e){return e.split(i).join("\\").split(s).join("{").split(a).join("}").split(c).join(",").split(u).join(".")}function p(e){if(!e)return[""];var t=[],n=o("{","}",e);if(!n)return e.split(",");var r=n.pre,i=n.body,s=n.post,a=r.split(",");a[a.length-1]+="{"+i+"}";var c=p(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),t.push.apply(t,a),t}function h(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function m(e,t){return e<=t}function g(e,t){return e>=t}function y(e,t){var n=[],i=o("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var s,c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),d=c||u,v=i.body.indexOf(",")>=0;if(!d&&!v)return i.post.match(/,.*\}/)?y(e=i.pre+"{"+i.body+a+i.post):[e];if(d)s=i.body.split(/\.\./);else if(1===(s=p(i.body)).length&&1===(s=y(s[0],!1).map(h)).length)return(C=i.post.length?y(i.post,!1):[""]).map((function(e){return i.pre+s[0]+e}));var b,R=i.pre,C=i.post.length?y(i.post,!1):[""];if(d){var D=l(s[0]),w=l(s[1]),k=Math.max(s[0].length,s[1].length),T=3==s.length?Math.abs(l(s[2])):1,S=m;w<D&&(T*=-1,S=g);var E=s.some(f);b=[];for(var P=D;S(P,w);P+=T){var _;if(u)"\\"===(_=String.fromCharCode(P))&&(_="");else if(_=String(P),E){var x=k-_.length;if(x>0){var N=new Array(x+1).join("0");_=P<0?"-"+N+_.slice(1):N+_}}b.push(_)}}else b=r(s,(function(e){return y(e,!1)}));for(var O=0;O<b.length;O++)for(var q=0;q<C.length;q++){var I=R+b[O]+C[q];(!t||d||I)&&n.push(I)}return n}},6522:(e,t,n)=>{e.exports=p,p.Minimatch=h;var r=function(){try{return n(1017)}catch(e){}}()||{sep:"/"};p.sep=r.sep;var o=p.GLOBSTAR=h.GLOBSTAR={},i=n(5146),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",c=a+"*?",u="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{}),l=/\/+/;function d(e,t){t=t||{};var n={};return Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function p(e,t,n){return m(t),n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&new h(t,n).match(e)}function h(e,t){if(!(this instanceof h))return new h(e,t);m(e),t||(t={}),e=e.trim(),t.allowWindowsEscape||"/"===r.sep||(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}function f(e,t){return t||(t=this instanceof h?this.options:{}),e=void 0===e?this.pattern:e,m(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:i(e)}p.filter=function(e,t){return t=t||{},function(n,r,o){return p(n,e,t)}},p.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return p;var t=p,n=function(n,r,o){return t(n,r,d(e,o))};return(n.Minimatch=function(n,r){return new t.Minimatch(n,d(e,r))}).defaults=function(n){return t.defaults(d(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,d(e,r))},n.defaults=function(n){return t.defaults(d(e,n))},n.makeRe=function(n,r){return t.makeRe(n,d(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,d(e,r))},n.match=function(n,r,o){return t.match(n,r,d(e,o))},n},h.defaults=function(e){return p.defaults(e).Minimatch},h.prototype.debug=function(){},h.prototype.make=function(){var e=this.pattern,t=this.options;if(t.nocomment||"#"!==e.charAt(0))if(e){this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map((function(e){return e.split(l)})),this.debug(this.pattern,n),n=n.map((function(e,t,n){return e.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,n),this.set=n}else this.empty=!0;else this.comment=!0},h.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=0;if(!this.options.nonegate){for(var r=0,o=e.length;r<o&&"!"===e.charAt(r);r++)t=!t,n++;n&&(this.pattern=e.substr(n)),this.negate=t}},p.braceExpand=function(e,t){return f(e,t)},h.prototype.braceExpand=f;var m=function(e){if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};h.prototype.parse=function(e,t){m(e);var n=this.options;if("**"===e){if(!n.noglobstar)return o;e="*"}if(""===e)return"";var r,i="",l=!!n.nocase,d=!1,p=[],h=[],f=!1,y=-1,v=-1,b="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",R=this;function C(){if(r){switch(r){case"*":i+=c,l=!0;break;case"?":i+=a,l=!0;break;default:i+="\\"+r}R.debug("clearStateChar %j %j",r,i),r=!1}}for(var D,w=0,k=e.length;w<k&&(D=e.charAt(w));w++)if(this.debug("%s\t%s %s %j",e,w,i,D),d&&u[D])i+="\\"+D,d=!1;else switch(D){case"/":return!1;case"\\":C(),d=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,w,i,D),f){this.debug(" in class"),"!"===D&&w===v+1&&(D="^"),i+=D;continue}R.debug("call clearStateChar %j",r),C(),r=D,n.noext&&C();continue;case"(":if(f){i+="(";continue}if(!r){i+="\\(";continue}p.push({type:r,start:w-1,reStart:i.length,open:s[r].open,close:s[r].close}),i+="!"===r?"(?:(?!(?:":"(?:",this.debug("plType %j %j",r,i),r=!1;continue;case")":if(f||!p.length){i+="\\)";continue}C(),l=!0;var T=p.pop();i+=T.close,"!"===T.type&&h.push(T),T.reEnd=i.length;continue;case"|":if(f||!p.length||d){i+="\\|",d=!1;continue}C(),i+="|";continue;case"[":if(C(),f){i+="\\"+D;continue}f=!0,v=w,y=i.length,i+=D;continue;case"]":if(w===v+1||!f){i+="\\"+D,d=!1;continue}var S=e.substring(v+1,w);try{RegExp("["+S+"]")}catch(e){var E=this.parse(S,g);i=i.substr(0,y)+"\\["+E[0]+"\\]",l=l||E[1],f=!1;continue}l=!0,f=!1,i+=D;continue;default:C(),d?d=!1:!u[D]||"^"===D&&f||(i+="\\"),i+=D}for(f&&(S=e.substr(v+1),E=this.parse(S,g),i=i.substr(0,y)+"\\["+E[0],l=l||E[1]),T=p.pop();T;T=p.pop()){var P=i.slice(T.reStart+T.open.length);this.debug("setting tail",i,T),P=P.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,n){return n||(n="\\"),t+t+n+"|"})),this.debug("tail=%j\n %s",P,P,T,i);var _="*"===T.type?c:"?"===T.type?a:"\\"+T.type;l=!0,i=i.slice(0,T.reStart)+_+"\\("+P}C(),d&&(i+="\\\\");var x=!1;switch(i.charAt(0)){case"[":case".":case"(":x=!0}for(var N=h.length-1;N>-1;N--){var O=h[N],q=i.slice(0,O.reStart),I=i.slice(O.reStart,O.reEnd-8),A=i.slice(O.reEnd-8,O.reEnd),L=i.slice(O.reEnd);A+=L;var M=q.split("(").length-1,j=L;for(w=0;w<M;w++)j=j.replace(/\)[+*?]?/,"");var F="";""===(L=j)&&t!==g&&(F="$"),i=q+I+L+F+A}if(""!==i&&l&&(i="(?=.)"+i),x&&(i=b+i),t===g)return[i,l];if(!l)return e.replace(/\\(.)/g,"$1");var U=n.nocase?"i":"";try{var W=new RegExp("^"+i+"$",U)}catch(e){return new RegExp("$.")}return W._glob=e,W._src=i,W};var g={};p.makeRe=function(e,t){return new h(e,t||{}).makeRe()},h.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,n=t.noglobstar?c:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=t.nocase?"i":"",i=e.map((function(e){return e.map((function(e){return e===o?n:"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e._src})).join("\\/")})).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,r)}catch(e){this.regexp=!1}return this.regexp},p.match=function(e,t,n){var r=new h(t,n=n||{});return e=e.filter((function(e){return r.match(e)})),r.options.nonull&&!e.length&&e.push(t),e},h.prototype.match=function(e,t){if(void 0===t&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var n=this.options;"/"!==r.sep&&(e=e.split(r.sep).join("/")),e=e.split(l),this.debug(this.pattern,"split",e);var o,i,s=this.set;for(this.debug(this.pattern,"set",s),i=e.length-1;i>=0&&!(o=e[i]);i--);for(i=0;i<s.length;i++){var a=s[i],c=e;if(n.matchBase&&1===a.length&&(c=[o]),this.matchOne(c,a,t))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},h.prototype.matchOne=function(e,t,n){var r=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,s=0,a=e.length,c=t.length;i<a&&s<c;i++,s++){this.debug("matchOne loop");var u,l=t[s],d=e[i];if(this.debug(t,l,d),!1===l)return!1;if(l===o){this.debug("GLOBSTAR",[t,l,d]);var p=i,h=s+1;if(h===c){for(this.debug("** at the end");i<a;i++)if("."===e[i]||".."===e[i]||!r.dot&&"."===e[i].charAt(0))return!1;return!0}for(;p<a;){var f=e[p];if(this.debug("\nglobstar while",e,p,t,h,f),this.matchOne(e.slice(p),t.slice(h),n))return this.debug("globstar found match!",p,a,f),!0;if("."===f||".."===f||!r.dot&&"."===f.charAt(0)){this.debug("dot detected!",e,p,t,h);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!n||(this.debug("\n>>> no match, partial?",e,p,t,h),p!==a))}if("string"==typeof l?(u=d===l,this.debug("string match",l,d,u)):(u=d.match(l),this.debug("pattern match",l,d,u)),!u)return!1}if(i===a&&s===c)return!0;if(i===a)return n;if(s===c)return i===a-1&&""===e[i];throw new Error("wtf?")}},4751:(e,t,n)=>{e.exports=h,h.GlobSync=f;var r=n(7334),o=n(6522),i=(o.Minimatch,n(2884).Glob,n(3837),n(1017)),s=n(9491),a=n(4095),c=n(6772),u=c.setopts,l=c.ownProp,d=c.childrenIgnored,p=c.isIgnored;function h(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new f(e,t).found}function f(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof f))return new f(e,t);if(u(this,e,t),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var r=0;r<n;r++)this._process(this.minimatch.set[r],r,!1);this._finish()}f.prototype._finish=function(){if(s.ok(this instanceof f),this.realpath){var e=this;this.matches.forEach((function(t,n){var o=e.matches[n]=Object.create(null);for(var i in t)try{i=e._makeAbs(i),o[r.realpathSync(i,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;o[e._makeAbs(i)]=!0}}))}c.finish(this)},f.prototype._process=function(e,t,n){s.ok(this instanceof f);for(var r,i=0;"string"==typeof e[i];)i++;switch(i){case e.length:return void this._processSimple(e.join("/"),t);case 0:r=null;break;default:r=e.slice(0,i).join("/")}var c,u=e.slice(i);null===r?c=".":a(r)||a(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(r&&a(r)||(r="/"+r),c=r):c=r;var l=this._makeAbs(c);d(this,c)||(u[0]===o.GLOBSTAR?this._processGlobStar(r,c,l,u,t,n):this._processReaddir(r,c,l,u,t,n))},f.prototype._processReaddir=function(e,t,n,r,o,s){var a=this._readdir(n,s);if(a){for(var c=r[0],u=!!this.minimatch.negate,l=c._glob,d=this.dot||"."===l.charAt(0),p=[],h=0;h<a.length;h++)("."!==(g=a[h]).charAt(0)||d)&&(u&&!e?!g.match(c):g.match(c))&&p.push(g);var f=p.length;if(0!==f)if(1!==r.length||this.mark||this.stat)for(r.shift(),h=0;h<f;h++){var m;g=p[h],m=e?[e,g]:[g],this._process(m.concat(r),o,s)}else{this.matches[o]||(this.matches[o]=Object.create(null));for(h=0;h<f;h++){var g=p[h];e&&(g="/"!==e.slice(-1)?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=i.join(this.root,g)),this._emitMatch(o,g)}}}},f.prototype._emitMatch=function(e,t){if(!p(this,t)){var n=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},f.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,n;try{n=this.fs.lstatSync(e)}catch(e){if("ENOENT"===e.code)return null}var r=n&&n.isSymbolicLink();return this.symlinks[e]=r,r||!n||n.isDirectory()?t=this._readdir(e,!1):this.cache[e]="FILE",t},f.prototype._readdir=function(e,t){if(t&&!l(this.symlinks,e))return this._readdirInGlobStar(e);if(l(this.cache,e)){var n=this.cache[e];if(!n||"FILE"===n)return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},f.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var r=t[n];r="/"===e?e+r:e+"/"+r,this.cache[r]=!0}return this.cache[e]=t,t},f.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var r=new Error(t.code+" invalid cwd "+this.cwd);throw r.path=this.cwd,r.code=t.code,r}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t)}},f.prototype._processGlobStar=function(e,t,n,r,o,i){var s=this._readdir(n,i);if(s){var a=r.slice(1),c=e?[e]:[],u=c.concat(a);this._process(u,o,!1);var l=s.length;if(!this.symlinks[n]||!i)for(var d=0;d<l;d++)if("."!==s[d].charAt(0)||this.dot){var p=c.concat(s[d],a);this._process(p,o,!0);var h=c.concat(s[d],r);this._process(h,o,!0)}}},f.prototype._processSimple=function(e,t){var n=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),n){if(e&&a(e)&&!this.nomount){var r=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=i.join(this.root,e):(e=i.resolve(this.root,e),r&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}},f.prototype._stat=function(e){var t=this._makeAbs(e),n="/"===e.slice(-1);if(e.length>this.maxLength)return!1;if(!this.stat&&l(this.cache,t)){var r=this.cache[t];if(Array.isArray(r)&&(r="DIR"),!n||"DIR"===r)return r;if(n&&"FILE"===r)return!1}var o=this.statCache[t];if(!o){var i;try{i=this.fs.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(i&&i.isSymbolicLink())try{o=this.fs.statSync(t)}catch(e){o=i}else o=i}return this.statCache[t]=o,r=!0,o&&(r=o.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||r,(!n||"FILE"!==r)&&r},f.prototype._mark=function(e){return c.mark(this,e)},f.prototype._makeAbs=function(e){return c.makeAbs(this,e)}},7844:(e,t,n)=>{var r=n(2479),o=Object.create(null),i=n(778);e.exports=r((function(e,t){return o[e]?(o[e].push(t),null):(o[e]=[t],function(e){return i((function t(){var n=o[e],r=n.length,i=function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r]=e[r];return n}(arguments);try{for(var s=0;s<r;s++)n[s].apply(null,i)}finally{n.length>r?(n.splice(0,r),process.nextTick((function(){t.apply(null,i)}))):delete o[e]}}))}(e))}))},4378:(e,t,n)=>{try{var r=n(3837);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(5717)}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},778:(e,t,n)=>{var r=n(2479);function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(o),e.exports.strict=r(i),o.proto=o((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},4095:e=>{"use strict";function t(e){return"/"===e.charAt(0)}function n(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),n=t[1]||"",r=Boolean(n&&":"!==n.charAt(1));return Boolean(t[2]||r)}e.exports="win32"===process.platform?n:t,e.exports.posix=t,e.exports.win32=n},3870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFormat=t.TraceValues=t.Trace=t.ProgressType=t.ProgressToken=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.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=void 0;const r=n(839);Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return r.Message}}),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(6184);Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return o.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return o.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return o.Touch}});const i=n(3911);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const s=n(7135);Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});const a=n(3881);Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const c=n(6525);Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return c.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return c.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return c.ReadableStreamMessageReader}});const u=n(6654);Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.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,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),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,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),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 d=n(147);t.RAL=d.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=(0,r.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}));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.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const r=n(147),o=n(7574),i=n(839),s=n(6184),a=n(7135),c=n(3881);var u,l,d,p,h,f,m,g,y,v,b,R,C,D,w;!function(e){e.type=new i.NotificationType("$/cancelRequest")}(u||(u={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(l=t.ProgressToken||(t.ProgressToken={})),function(e){e.type=new i.NotificationType("$/progress")}(d||(d={})),t.ProgressType=class{constructor(){}},function(e){e.is=function(e){return o.func(e)}}(p||(p={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(h=t.Trace||(t.Trace={})),(w=t.TraceValues||(t.TraceValues={})).Off="off",w.Messages="messages",w.Compact="compact",w.Verbose="verbose",function(e){e.fromString=function(t){if(!o.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(h=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return o.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(f=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new i.NotificationType("$/setTrace")}(m=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new i.NotificationType("$/logTrace")}(g=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(y=t.ConnectionErrors||(t.ConnectionErrors={}));class k extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,k.prototype)}}t.ConnectionError=k,function(e){e.is=function(e){const t=e;return t&&o.func(t.cancelUndispatched)}}(v=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)}}(b=t.CancellationReceiverStrategy||(t.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(u.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&o.func(t.sendCancellation)&&o.func(t.cleanup)}}(R=t.CancellationSenderStrategy||(t.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:b.Message,sender:R.Message}),e.is=function(e){const t=e;return t&&b.is(t.receiver)&&R.is(t.sender)}}(C=t.CancellationStrategy||(t.CancellationStrategy={})),(t.ConnectionOptions||(t.ConnectionOptions={})).is=function(e){const t=e;return t&&(C.is(t.cancellationStrategy)||v.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"}(D||(D={})),t.createMessageConnection=function(e,n,v,b){const R=void 0!==v?v:t.NullLogger;let w=0,T=0,S=0;const E="2.0";let P;const _=new Map;let x;const N=new Map,O=new Map;let q,I,A=new s.LinkedMap,L=new Map,M=new Set,j=new Map,F=h.Off,U=f.Text,W=D.New;const $=new a.Emitter,H=new a.Emitter,V=new a.Emitter,K=new a.Emitter,B=new a.Emitter,z=b&&b.cancellationStrategy?b.cancellationStrategy:C.Message;function Q(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 G(e){}function X(){return W===D.Listening}function J(){return W===D.Closed}function Y(){return W===D.Disposed}function Z(){W!==D.New&&W!==D.Listening||(W=D.Closed,H.fire(void 0))}function ee(){q||0===A.size||(q=(0,r.default)().timer.setImmediate((()=>{q=void 0,function(){if(0===A.size)return;const e=A.shift();try{i.Message.isRequest(e)?function(e){if(Y())return;function t(t,r,o){const s={jsonrpc:E,id:e.id};t instanceof i.ResponseError?s.error=t.toJson():s.result=void 0===t?null:t,re(s,r,o),n.write(s).catch((()=>R.error("Sending response failed.")))}function r(t,r,o){const i={jsonrpc:E,id:e.id,error:t.toJson()};re(i,r,o),n.write(i).catch((()=>R.error("Sending response failed.")))}!function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),I.log(`Received request '${e.method} - (${e.id})'.`,t)}else ie("receive-request",e)}(e);const s=_.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||P){const s=e.id??String(Date.now()),l=z.receiver.createCancellationTokenSource(s);null!==e.id&&M.has(e.id)&&l.cancel(),null!==e.id&&j.set(s,l);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 received none.`),e.method,u);d=c(l.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,u);d=c(...e.params,l.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,u);d=c(e.params,l.token)}else P&&(d=P(e.method,e.params,l.token));const p=d;d?p.then?p.then((n=>{j.delete(s),t(n,e.method,u)}),(t=>{j.delete(s),t instanceof i.ResponseError?r(t,e.method,u):t&&o.string(t.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):(j.delete(s),t(d,e.method,u)):(j.delete(s),function(t,r,o){void 0===t&&(t=null);const i={jsonrpc:E,id:e.id,result:t};re(i,r,o),n.write(i).catch((()=>R.error("Sending response failed.")))}(d,e.method,u))}catch(n){j.delete(s),n instanceof i.ResponseError?t(n,e.method,u):n&&o.string(n.message)?r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,u):r(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else r(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):i.Message.isNotification(e)?function(e){if(Y())return;let t,n;if(e.method===u.type.method){const t=e.params.id;return M.delete(t),void oe(e)}{const r=N.get(e.method);r&&(n=r.handler,t=r.type)}if(n||x)try{if(oe(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==i.ParameterStructures.byName&&R.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const r=e.params;e.method===d.type.method&&2===r.length&&l.is(r[0])?n({token:r[0],value:r[1]}):(void 0!==t&&(t.parameterStructures===i.ParameterStructures.byName&&R.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&R.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${r.length} arguments`)),n(...r))}else void 0!==t&&t.parameterStructures===i.ParameterStructures.byPosition&&R.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else x&&x(e.method,e.params)}catch(t){t.message?R.error(`Notification handler '${e.method}' failed with message: ${t.message}`):R.error(`Notification handler '${e.method}' failed unexpectedly.`)}else V.fire(e)}(e):i.Message.isResponse(e)?function(e){if(!Y())if(null===e.id)e.error?R.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):R.error("Received response message without id. No further error information provided.");else{const t=e.id,n=L.get(t);if(function(e,t){if(F!==h.Off&&I)if(U===f.Text){let n;if(F!==h.Verbose&&F!==h.Compact||(e.error&&e.error.data?n=`Error data: ${ne(e.error.data)}\n\n`:e.result?n=`Result: ${ne(e.result)}\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}).`:"";I.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else I.log(`Received response ${e.id} without active response promise.`,n)}else ie("receive-response",e)}(e,n),void 0!==n){L.delete(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?R.error(`Response handler '${n.method}' failed with message: ${e.message}`):R.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void R.error("Received empty message.");R.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=t.id,n=L.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{ee()}}()})))}e.onClose(Z),e.onError((function(e){$.fire([e,void 0,void 0])})),n.onClose(Z),n.onError((function(e){$.fire(e)}));const te=e=>{try{if(i.Message.isNotification(e)&&e.method===u.type.method){const t=e.params.id,r=Q(t),o=A.get(r);if(i.Message.isRequest(o)){const i=b?.connectionStrategy,s=i&&i.cancelUndispatched?i.cancelUndispatched(o,G):void 0;if(s&&(void 0!==s.error||void 0!==s.result))return A.delete(r),j.delete(t),s.id=o.id,re(s,e.method,Date.now()),void n.write(s).catch((()=>R.error("Sending response for canceled message failed.")))}const s=j.get(t);if(void 0!==s)return s.cancel(),void oe(e);M.add(t)}!function(e,t){var n;i.Message.isRequest(t)?e.set(Q(t.id),t):i.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++S).toString():"res-"+n.toString(),t):e.set("not-"+(++T).toString(),t)}(A,e)}finally{ee()}};function ne(e){if(null!=e)switch(F){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function re(e,t,n){if(F!==h.Off&&I)if(U===f.Text){let r;F!==h.Verbose&&F!==h.Compact||(e.error&&e.error.data?r=`Error data: ${ne(e.error.data)}\n\n`:e.result?r=`Result: ${ne(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),I.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else ie("send-response",e)}function oe(e){if(F!==h.Off&&I&&e.method!==g.type.method)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Received notification '${e.method}'.`,t)}else ie("receive-notification",e)}function ie(e,t){if(!I||F===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};I.log(n)}function se(){if(J())throw new k(y.Closed,"Connection is closed.");if(Y())throw new k(y.Disposed,"Connection is disposed.")}function ae(e){return void 0===e?null:e}function ce(e){return null===e?void 0:e}function ue(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function le(e,t){switch(e){case i.ParameterStructures.auto:return ue(t)?ce(t):[ae(t)];case i.ParameterStructures.byName:if(!ue(t))throw new Error("Received parameters by name but param is not an object literal.");return ce(t);case i.ParameterStructures.byPosition:return[ae(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function de(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=le(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(ae(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const pe={sendNotification:(e,...t)=>{let r,s;if(se(),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 u=c-o;switch(u){case 0:s=void 0;break;case 1:s=le(a,t[o]);break;default:if(a===i.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);s=t.slice(o,c).map((e=>ae(e)))}}else{const n=t;r=e.method,s=de(e,n)}const a={jsonrpc:E,method:r,params:s};return function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Sending notification '${e.method}'.`,t)}else ie("send-notification",e)}(a),n.write(a).catch((()=>R.error("Sending notification failed.")))},onNotification:(e,t)=>{let n;return se(),o.func(e)?x=e:t&&(o.string(e)?(n=e,N.set(e,{type:void 0,handler:t})):(n=e.method,N.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==n?N.delete(n):x=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)=>pe.sendNotification(d.type,{token:t,value:n}),onUnhandledProgress:K.event,sendRequest:(e,...t)=>{let r,s,a;if(se(),function(){if(!X())throw new Error("Call listen() first.")}(),o.string(e)){r=e;const n=t[0],o=t[t.length-1];let u=0,l=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(u=1,l=n);let d=t.length;c.CancellationToken.is(o)&&(d-=1,a=o);const p=d-u;switch(p){case 0:s=void 0;break;case 1:s=le(l,t[u]);break;default:if(l===i.ParameterStructures.byName)throw new Error(`Received ${p} parameters for 'by Name' request parameter structure.`);s=t.slice(u,d).map((e=>ae(e)))}}else{const n=t;r=e.method,s=de(e,n);const o=e.numberOfParams;a=c.CancellationToken.is(n[o])?n[o]:void 0}const u=w++;let l;return a&&(l=a.onCancellationRequested((()=>{const e=z.sender.sendCancellation(pe,u);return void 0===e?(R.log(`Received no promise from cancellation strategy when cancelling id ${u}`),Promise.resolve()):e.catch((()=>{R.log(`Sending cancellation messages for id ${u} failed`)}))}))),new Promise(((e,t)=>{const o={jsonrpc:E,id:u,method:r,params:s};let a={method:r,timerStart:Date.now(),resolve:t=>{e(t),z.sender.cleanup(u),l?.dispose()},reject:e=>{t(e),z.sender.cleanup(u),l?.dispose()}};!function(e){if(F!==h.Off&&I)if(U===f.Text){let t;F!==h.Verbose&&F!==h.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),I.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ie("send-request",e)}(o);try{n.write(o).catch((()=>R.error("Sending request failed.")))}catch(e){a.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),a=null}a&&L.set(u,a)}))},onRequest:(e,t)=>{se();let n=null;return p.is(e)?(n=void 0,P=e):o.string(e)?(n=null,void 0!==t&&(n=e,_.set(e,{handler:t,type:void 0}))):void 0!==t&&(n=e.method,_.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==n&&(void 0!==n?_.delete(n):P=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(e,t,n)=>{let r=!1,i=f.Text;void 0!==n&&(o.boolean(n)?r=n:(r=n.sendNotification||!1,i=n.traceFormat||f.Text)),F=e,U=i,I=F===h.Off?void 0:t,!r||J()||Y()||await pe.sendNotification(m.type,{value:h.toString(e)})},onError:$.event,onClose:H.event,onUnhandledNotification:V.event,onDispose:B.event,end:()=>{n.end()},dispose:()=>{if(Y())return;W=D.Disposed,B.fire(void 0);const t=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const e of L.values())e.reject(t);L=new Map,j=new Map,M=new Set,A=new s.LinkedMap,o.func(n.dispose)&&n.dispose(),o.func(e.dispose)&&e.dispose()},listen:()=>{se(),function(){if(X())throw new k(y.AlreadyListening,"Connection is already listening")}(),W=D.Listening,e.listen(te)},inspect:()=>{(0,r.default)().console.log("inspect")}};return pe.onNotification(g.type,(e=>{if(F===h.Off||!I)return;const t=F===h.Verbose||F===h.Compact;I.log(e.message,t?e.verbose:void 0)})),pe.onNotification(d.type,(e=>{const t=O.get(e.token);t?t(e.value):K.fire(e)})),pe}},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<o;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const t=[],n=this._callbacks.slice(0),o=this._contexts.slice(0);for(let i=0,s=n.length;i<s;i++)try{t.push(n[i].apply(o[i],e))}catch(e){(0,r.default)().console.error(e)}return t}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class i{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{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,r;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}(r=t.Touch||(t.Touch={}));class o{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=r.None){const n=this._map.get(e);if(n)return t!==r.None&&this.touch(n,t),n.value}set(e,t,n=r.None){let o=this._map.get(e);if(o)o.value=t,n!==r.None&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case r.None:this.addItemLast(o);break;case r.First:this.addItemFirst(o);break;case r.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._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(n=Symbol.toStringTag,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===r.First||t===r.Last)if(t===r.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===r.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=o,t.LRUCache=class extends o{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=r.AsNew){return super.get(e,t)}peek(e){return super.get(e,r.None)}set(e,t){return super.set(e,t,r.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(;t<this._chunks.length;){const o=this._chunks[t];for(n=0;n<o.length;){switch(o[n]){case 13:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case 10:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}r+=o.byteLength,t++}if(4!==e)return;const o=this._read(r+n),i=new Map,s=this.toString(o,"ascii").split("\r\n");if(s.length<2)return i;for(let e=0;e<s.length-2;e++){const t=s[e],n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");const r=t.substr(0,n),o=t.substr(n+1).trim();i.set(r,o)}return i}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._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){let t,n;const o=new Map;let i;const s=new Map;if(void 0===e||"string"==typeof e)t=e??"utf-8";else{if(t=e.charset??"utf-8",void 0!==e.contentDecoder&&(n=e.contentDecoder,o.set(n.name,n)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)o.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(i=e.contentTypeDecoder,s.set(i.name,i)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)s.set(t.name,t)}return void 0===i&&(i=(0,r.default)().applicationJson.decoder,s.set(i.name,i)),{charset:t,contentDecoder:n,contentDecoders:o,contentTypeDecoder:i,contentTypeDecoders:s}}}(s||(s={})),t.ReadableStreamMessageReader=class extends a{constructor(e,t){super(),this.readable=e,this.options=s.fromOptions(t),this.buffer=(0,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&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,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){return void 0===e||"string"==typeof e?{charset:e??"utf-8",contentTypeEncoder:(0,r.default)().applicationJson.encoder}:{charset:e.charset??"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,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.Message=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,i;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3}(o=t.ErrorCodes||(t.ErrorCodes={}));class s extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:o.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,s.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}t.ResponseError=s;class a{constructor(e){this.kind=e}static is(e){return e===a.auto||e===a.byName||e===a.byPosition}toString(){return this.kind}}t.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");class c{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return a.auto}}t.AbstractMessageSignature=c,t.RequestType0=class extends c{constructor(e){super(e,0)}},t.RequestType=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType1=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType2=class extends c{constructor(e){super(e,2)}},t.RequestType3=class extends c{constructor(e){super(e,3)}},t.RequestType4=class extends c{constructor(e){super(e,4)}},t.RequestType5=class extends c{constructor(e){super(e,5)}},t.RequestType6=class extends c{constructor(e){super(e,6)}},t.RequestType7=class extends c{constructor(e){super(e,7)}},t.RequestType8=class extends c{constructor(e){super(e,8)}},t.RequestType9=class extends c{constructor(e){super(e,9)}},t.NotificationType=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType0=class extends c{constructor(e){super(e,0)}},t.NotificationType1=class extends c{constructor(e,t=a.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType2=class extends c{constructor(e){super(e,2)}},t.NotificationType3=class extends c{constructor(e){super(e,3)}},t.NotificationType4=class extends c{constructor(e){super(e,4)}},t.NotificationType5=class extends c{constructor(e){super(e,5)}},t.NotificationType6=class extends c{constructor(e){super(e,6)}},t.NotificationType7=class extends c{constructor(e){super(e,7)}},t.NotificationType8=class extends c{constructor(e){super(e,8)}},t.NotificationType9=class extends c{constructor(e){super(e,9)}},(i=t.Message||(t.Message={})).isRequest=function(e){const t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},i.isNotification=function(e){const t=e;return t&&r.string(t.method)&&void 0===e.id},i.isResponse=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&&(0,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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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),u=n(6113),l=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((0,i.default)().stream.asReadableStream(e),t)}}t.SocketMessageReader=h;class f extends s.WriteableStreamMessageWriter{constructor(e,t){super((0,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((0,i.default)().stream.asReadableStream(e),t)}}t.StreamMessageReader=m;class g extends s.WriteableStreamMessageWriter{constructor(e,t){super((0,i.default)().stream.asWritableStream(e),t)}}t.StreamMessageWriter=g;const y=process.env.XDG_RUNTIME_DIR,v=new Map([["linux",107],["darwin",103]]);t.generateRandomPipeName=function(){const e=(0,u.randomBytes)(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=y?a.join(y,`vscode-ipc-${e}.sock`):a.join(c.tmpdir(),`vscode-${e}.sock`);const n=v.get(process.platform);return void 0!==n&&t.length>=n&&(0,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=(0,l.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=(0,l.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=(0,l.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=(0,l.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}),(0,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 u{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 l=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 u(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function d(){return l}!function(e){e.install=function(){r.default.install(l)}}(d||(d={})),t.default=d},5028:(e,t,n)=>{"use strict";e.exports=n(4389)},1661:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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.RequestFailed=-32803,i.ServerCancelled=-32802,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}),(0,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=t.MessageDirection=void 0;const r=n(4389);var o;(o=t.MessageDirection||(t.MessageDirection={})).clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both",t.RegistrationType=class{constructor(e){this.method=e}};class i extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=i;class s extends r.RequestType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolRequestType=s;class a extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=a;class c extends r.NotificationType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolNotificationType=c},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.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",o.messageDirection=r.MessageDirection.clientToServer,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,i;(i=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.ColorPresentationRequest||(t.ColorPresentationRequest={})).method="textDocument/colorPresentation",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},5934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;const r=n(6140);var o;(o=t.ConfigurationRequest||(t.ConfigurationRequest={})).method="workspace/configuration",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)},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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},9824:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;const r=n(4389),o=n(9533),i=n(6140);var s,a,c,u;(t.DiagnosticServerCancellationData||(t.DiagnosticServerCancellationData={})).is=function(e){const t=e;return t&&o.boolean(t.retriggerRequest)},(u=t.DocumentDiagnosticReportKind||(t.DocumentDiagnosticReportKind={})).Full="full",u.Unchanged="unchanged",(c=t.DocumentDiagnosticRequest||(t.DocumentDiagnosticRequest={})).method="textDocument/diagnostic",c.messageDirection=i.MessageDirection.clientToServer,c.type=new i.ProtocolRequestType(c.method),c.partialResult=new r.ProgressType,(a=t.WorkspaceDiagnosticRequest||(t.WorkspaceDiagnosticRequest={})).method="workspace/diagnostic",a.messageDirection=i.MessageDirection.clientToServer,a.type=new i.ProtocolRequestType(a.method),a.partialResult=new r.ProgressType,(s=t.DiagnosticRefreshRequest||(t.DiagnosticRefreshRequest={})).method="workspace/diagnostic/refresh",s.messageDirection=i.MessageDirection.clientToServer,s.type=new i.ProtocolRequestType0(s.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,u,l;(l=t.FileOperationPatternKind||(t.FileOperationPatternKind={})).file="file",l.folder="folder",(u=t.WillCreateFilesRequest||(t.WillCreateFilesRequest={})).method="workspace/willCreateFiles",u.messageDirection=r.MessageDirection.clientToServer,u.type=new r.ProtocolRequestType(u.method),(c=t.DidCreateFilesNotification||(t.DidCreateFilesNotification={})).method="workspace/didCreateFiles",c.messageDirection=r.MessageDirection.clientToServer,c.type=new r.ProtocolNotificationType(c.method),(a=t.WillRenameFilesRequest||(t.WillRenameFilesRequest={})).method="workspace/willRenameFiles",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType(a.method),(s=t.DidRenameFilesNotification||(t.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method),(i=t.DidDeleteFilesNotification||(t.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolNotificationType(i.method),(o=t.WillDeleteFilesRequest||(t.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},3394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRequest=void 0;const r=n(6140);var o;(o=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",o.messageDirection=r.MessageDirection.clientToServer,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},9999:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;const r=n(6140);var o,i,s;(s=t.InlayHintRequest||(t.InlayHintRequest={})).method="textDocument/inlayHint",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.InlayHintResolveRequest||(t.InlayHintResolveRequest={})).method="inlayHint/resolve",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.InlayHintRefreshRequest||(t.InlayHintRefreshRequest={})).method="workspace/inlayHint/refresh",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType0(o.method)},5246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;const r=n(6140);var o,i;(i=t.InlineValueRequest||(t.InlineValueRequest={})).method="textDocument/inlineValue",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.InlineValueRefreshRequest||(t.InlineValueRefreshRequest={})).method="workspace/inlineValue/refresh",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType0(o.method)},542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),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.RelativePattern=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.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=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.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=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=void 0;const r=n(6140),o=n(1674),i=n(9533),s=n(2122);Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});const a=n(1589);Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const c=n(8744);Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return c.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return c.DidChangeWorkspaceFoldersNotification}});const u=n(5934);Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return u.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 d=n(3394);Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return d.FoldingRangeRequest}});const p=n(764);Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return p.DeclarationRequest}});const h=n(5206);Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const f=n(1862);Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const m=n(2918);Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return m.CallHierarchyPrepareRequest}});const g=n(9434);Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return g.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return g.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return g.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return g.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return g.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return g.SemanticTokensRegistrationType}});const y=n(5726);Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});const v=n(6305);Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return v.LinkedEditingRangeRequest}});const b=n(7846);Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return b.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return b.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return b.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return b.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return b.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return b.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return b.WillDeleteFilesRequest}});const R=n(3443);Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return R.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return R.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return R.MonikerRequest}});const C=n(3693);Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return C.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySupertypesRequest}});const D=n(5246);Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return D.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return D.InlineValueRefreshRequest}});const w=n(9999);Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const k=n(9824);Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return k.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return k.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return k.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return k.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return k.DiagnosticRefreshRequest}});const T=n(7169);var S,E,P,_,x,N,O,q,I,A,L,M,j,F,U,W,$,H,V,K,B,z,Q,G,X,J,Y,Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce,De,we,ke,Te,Se,Ee,Pe,_e,xe;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return T.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return T.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return T.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return T.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return T.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return T.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return T.DidCloseNotebookDocumentNotification}}),function(e){e.is=function(e){const t=e;return i.string(t.language)||i.string(t.scheme)||i.string(t.pattern)}}(S=t.TextDocumentFilter||(t.TextDocumentFilter={})),function(e){e.is=function(e){const t=e;return i.objectLiteral(t)&&(i.string(t.notebookType)||i.string(t.scheme)||i.string(t.pattern))}}(E=t.NotebookDocumentFilter||(t.NotebookDocumentFilter={})),function(e){e.is=function(e){const t=e;return i.objectLiteral(t)&&(i.string(t.notebook)||E.is(t.notebook))&&(void 0===t.language||i.string(t.language))}}(P=t.NotebookCellTextDocumentFilter||(t.NotebookCellTextDocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!i.string(t)&&!S.is(t)&&!P.is(t))return!1;return!0}}(_=t.DocumentSelector||(t.DocumentSelector={})),(xe=t.RegistrationRequest||(t.RegistrationRequest={})).method="client/registerCapability",xe.messageDirection=r.MessageDirection.serverToClient,xe.type=new r.ProtocolRequestType(xe.method),(_e=t.UnregistrationRequest||(t.UnregistrationRequest={})).method="client/unregisterCapability",_e.messageDirection=r.MessageDirection.serverToClient,_e.type=new r.ProtocolRequestType(_e.method),(Pe=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",Pe.Rename="rename",Pe.Delete="delete",(Ee=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",Ee.Transactional="transactional",Ee.TextOnlyTransactional="textOnlyTransactional",Ee.Undo="undo",(Se=t.PositionEncodingKind||(t.PositionEncodingKind={})).UTF8="utf-8",Se.UTF16="utf-16",Se.UTF32="utf-32",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&i.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||_.is(t.documentSelector))},(Te=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return i.objectLiteral(t)&&(void 0===t.workDoneProgress||i.boolean(t.workDoneProgress))},Te.hasWorkDoneProgress=function(e){const t=e;return t&&i.boolean(t.workDoneProgress)},(ke=t.InitializeRequest||(t.InitializeRequest={})).method="initialize",ke.messageDirection=r.MessageDirection.clientToServer,ke.type=new r.ProtocolRequestType(ke.method),(t.InitializeErrorCodes||(t.InitializeErrorCodes={})).unknownProtocolVersion=1,(we=t.InitializedNotification||(t.InitializedNotification={})).method="initialized",we.messageDirection=r.MessageDirection.clientToServer,we.type=new r.ProtocolNotificationType(we.method),(De=t.ShutdownRequest||(t.ShutdownRequest={})).method="shutdown",De.messageDirection=r.MessageDirection.clientToServer,De.type=new r.ProtocolRequestType0(De.method),(Ce=t.ExitNotification||(t.ExitNotification={})).method="exit",Ce.messageDirection=r.MessageDirection.clientToServer,Ce.type=new r.ProtocolNotificationType0(Ce.method),(Re=t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).method="workspace/didChangeConfiguration",Re.messageDirection=r.MessageDirection.clientToServer,Re.type=new r.ProtocolNotificationType(Re.method),(be=t.MessageType||(t.MessageType={})).Error=1,be.Warning=2,be.Info=3,be.Log=4,(ve=t.ShowMessageNotification||(t.ShowMessageNotification={})).method="window/showMessage",ve.messageDirection=r.MessageDirection.serverToClient,ve.type=new r.ProtocolNotificationType(ve.method),(ye=t.ShowMessageRequest||(t.ShowMessageRequest={})).method="window/showMessageRequest",ye.messageDirection=r.MessageDirection.serverToClient,ye.type=new r.ProtocolRequestType(ye.method),(ge=t.LogMessageNotification||(t.LogMessageNotification={})).method="window/logMessage",ge.messageDirection=r.MessageDirection.serverToClient,ge.type=new r.ProtocolNotificationType(ge.method),(me=t.TelemetryEventNotification||(t.TelemetryEventNotification={})).method="telemetry/event",me.messageDirection=r.MessageDirection.serverToClient,me.type=new r.ProtocolNotificationType(me.method),(fe=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,fe.Full=1,fe.Incremental=2,(he=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",he.messageDirection=r.MessageDirection.clientToServer,he.type=new r.ProtocolNotificationType(he.method),(pe=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)},pe.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(de=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",de.messageDirection=r.MessageDirection.clientToServer,de.type=new r.ProtocolNotificationType(de.method),(le=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",le.messageDirection=r.MessageDirection.clientToServer,le.type=new r.ProtocolNotificationType(le.method),(ue=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",ue.messageDirection=r.MessageDirection.clientToServer,ue.type=new r.ProtocolNotificationType(ue.method),(ce=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,ce.AfterDelay=2,ce.FocusOut=3,(ae=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",ae.messageDirection=r.MessageDirection.clientToServer,ae.type=new r.ProtocolNotificationType(ae.method),(se=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",se.messageDirection=r.MessageDirection.clientToServer,se.type=new r.ProtocolRequestType(se.method),(ie=t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).method="workspace/didChangeWatchedFiles",ie.messageDirection=r.MessageDirection.clientToServer,ie.type=new r.ProtocolNotificationType(ie.method),(oe=t.FileChangeType||(t.FileChangeType={})).Created=1,oe.Changed=2,oe.Deleted=3,(t.RelativePattern||(t.RelativePattern={})).is=function(e){const t=e;return i.objectLiteral(t)&&(o.URI.is(t.baseUri)||o.WorkspaceFolder.is(t.baseUri))&&i.string(t.pattern)},(re=t.WatchKind||(t.WatchKind={})).Create=1,re.Change=2,re.Delete=4,(ne=t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).method="textDocument/publishDiagnostics",ne.messageDirection=r.MessageDirection.serverToClient,ne.type=new r.ProtocolNotificationType(ne.method),(te=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,te.TriggerCharacter=2,te.TriggerForIncompleteCompletions=3,(ee=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",ee.messageDirection=r.MessageDirection.clientToServer,ee.type=new r.ProtocolRequestType(ee.method),(Z=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",Z.messageDirection=r.MessageDirection.clientToServer,Z.type=new r.ProtocolRequestType(Z.method),(Y=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",Y.messageDirection=r.MessageDirection.clientToServer,Y.type=new r.ProtocolRequestType(Y.method),(J=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,J.TriggerCharacter=2,J.ContentChange=3,(X=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",X.messageDirection=r.MessageDirection.clientToServer,X.type=new r.ProtocolRequestType(X.method),(G=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",G.messageDirection=r.MessageDirection.clientToServer,G.type=new r.ProtocolRequestType(G.method),(Q=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",Q.messageDirection=r.MessageDirection.clientToServer,Q.type=new r.ProtocolRequestType(Q.method),(z=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",z.messageDirection=r.MessageDirection.clientToServer,z.type=new r.ProtocolRequestType(z.method),(B=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",B.messageDirection=r.MessageDirection.clientToServer,B.type=new r.ProtocolRequestType(B.method),(K=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",K.messageDirection=r.MessageDirection.clientToServer,K.type=new r.ProtocolRequestType(K.method),(V=t.CodeActionResolveRequest||(t.CodeActionResolveRequest={})).method="codeAction/resolve",V.messageDirection=r.MessageDirection.clientToServer,V.type=new r.ProtocolRequestType(V.method),(H=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",H.messageDirection=r.MessageDirection.clientToServer,H.type=new r.ProtocolRequestType(H.method),($=t.WorkspaceSymbolResolveRequest||(t.WorkspaceSymbolResolveRequest={})).method="workspaceSymbol/resolve",$.messageDirection=r.MessageDirection.clientToServer,$.type=new r.ProtocolRequestType($.method),(W=t.CodeLensRequest||(t.CodeLensRequest={})).method="textDocument/codeLens",W.messageDirection=r.MessageDirection.clientToServer,W.type=new r.ProtocolRequestType(W.method),(U=t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).method="codeLens/resolve",U.messageDirection=r.MessageDirection.clientToServer,U.type=new r.ProtocolRequestType(U.method),(F=t.CodeLensRefreshRequest||(t.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",F.messageDirection=r.MessageDirection.serverToClient,F.type=new r.ProtocolRequestType0(F.method),(j=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",j.messageDirection=r.MessageDirection.clientToServer,j.type=new r.ProtocolRequestType(j.method),(M=t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).method="documentLink/resolve",M.messageDirection=r.MessageDirection.clientToServer,M.type=new r.ProtocolRequestType(M.method),(L=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",L.messageDirection=r.MessageDirection.clientToServer,L.type=new r.ProtocolRequestType(L.method),(A=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",A.messageDirection=r.MessageDirection.clientToServer,A.type=new r.ProtocolRequestType(A.method),(I=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",I.messageDirection=r.MessageDirection.clientToServer,I.type=new r.ProtocolRequestType(I.method),(t.PrepareSupportDefaultBehavior||(t.PrepareSupportDefaultBehavior={})).Identifier=1,(q=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",q.messageDirection=r.MessageDirection.clientToServer,q.type=new r.ProtocolRequestType(q.method),(O=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",O.messageDirection=r.MessageDirection.clientToServer,O.type=new r.ProtocolRequestType(O.method),(N=t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).method="workspace/executeCommand",N.messageDirection=r.MessageDirection.clientToServer,N.type=new r.ProtocolRequestType(N.method),(x=t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).method="workspace/applyEdit",x.messageDirection=r.MessageDirection.serverToClient,x.type=new r.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.messageDirection=r.MessageDirection.clientToServer,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},7169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;const r=n(1674),o=n(9533),i=n(6140);var s,a,c,u,l,d,p,h,f,m;!function(e){e.Markup=1,e.Code=2,e.is=function(e){return 1===e||2===e}}(s=t.NotebookCellKind||(t.NotebookCellKind={})),function(e){e.create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},e.is=function(e){const t=e;return o.objectLiteral(t)&&r.uinteger.is(t.executionOrder)&&(void 0===t.success||o.boolean(t.success))},e.equals=function(e,t){return e===t||null!=e&&null!=t&&e.executionOrder===t.executionOrder&&e.success===t.success}}(a=t.ExecutionSummary||(t.ExecutionSummary={})),function(e){function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(typeof e!=typeof n)return!1;if("object"!=typeof e)return!1;const r=Array.isArray(e),i=Array.isArray(n);if(r!==i)return!1;if(r&&i){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1}if(o.objectLiteral(e)&&o.objectLiteral(n)){const r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;if(r.sort(),o.sort(),!t(r,o))return!1;for(let o=0;o<r.length;o++){const i=r[o];if(!t(e[i],n[i]))return!1}}return!0}e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){const t=e;return o.objectLiteral(t)&&s.is(t.kind)&&r.DocumentUri.is(t.document)&&(void 0===t.metadata||o.objectLiteral(t.metadata))},e.diff=function(e,n){const r=new Set;return e.document!==n.document&&r.add("document"),e.kind!==n.kind&&r.add("kind"),e.executionSummary!==n.executionSummary&&r.add("executionSummary"),void 0===e.metadata&&void 0===n.metadata||t(e.metadata,n.metadata)||r.add("metadata"),void 0===e.executionSummary&&void 0===n.executionSummary||a.equals(e.executionSummary,n.executionSummary)||r.add("executionSummary"),r}}(c=t.NotebookCell||(t.NotebookCell={})),(m=t.NotebookDocument||(t.NotebookDocument={})).create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},m.is=function(e){const t=e;return o.objectLiteral(t)&&o.string(t.uri)&&r.integer.is(t.version)&&o.typedArray(t.cells,c.is)},function(e){e.method="notebookDocument/sync",e.messageDirection=i.MessageDirection.clientToServer,e.type=new i.RegistrationType(e.method)}(u=t.NotebookDocumentSyncRegistrationType||(t.NotebookDocumentSyncRegistrationType={})),(f=t.DidOpenNotebookDocumentNotification||(t.DidOpenNotebookDocumentNotification={})).method="notebookDocument/didOpen",f.messageDirection=i.MessageDirection.clientToServer,f.type=new i.ProtocolNotificationType(f.method),f.registrationMethod=u.method,(h=t.NotebookCellArrayChange||(t.NotebookCellArrayChange={})).is=function(e){const t=e;return o.objectLiteral(t)&&r.uinteger.is(t.start)&&r.uinteger.is(t.deleteCount)&&(void 0===t.cells||o.typedArray(t.cells,c.is))},h.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r},(p=t.DidChangeNotebookDocumentNotification||(t.DidChangeNotebookDocumentNotification={})).method="notebookDocument/didChange",p.messageDirection=i.MessageDirection.clientToServer,p.type=new i.ProtocolNotificationType(p.method),p.registrationMethod=u.method,(d=t.DidSaveNotebookDocumentNotification||(t.DidSaveNotebookDocumentNotification={})).method="notebookDocument/didSave",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method),d.registrationMethod=u.method,(l=t.DidCloseNotebookDocumentNotification||(t.DidCloseNotebookDocumentNotification={})).method="notebookDocument/didClose",l.messageDirection=i.MessageDirection.clientToServer,l.type=new i.ProtocolNotificationType(l.method),l.registrationMethod=u.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,s,a;(a=t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,a.is=function(e){return e===a.type},(s=t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).method="window/workDoneProgress/create",s.messageDirection=o.MessageDirection.serverToClient,s.type=new o.ProtocolRequestType(s.method),(i=t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).method="window/workDoneProgress/cancel",i.messageDirection=o.MessageDirection.clientToServer,i.type=new o.ProtocolNotificationType(i.method)},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.messageDirection=r.MessageDirection.clientToServer,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=void 0;const r=n(6140);var o,i,s,a,c;(t.TokenFormat||(t.TokenFormat={})).Relative="relative",function(e){e.method="textDocument/semanticTokens",e.type=new r.RegistrationType(e.method)}(o=t.SemanticTokensRegistrationType||(t.SemanticTokensRegistrationType={})),(c=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",c.messageDirection=r.MessageDirection.clientToServer,c.type=new r.ProtocolRequestType(c.method),c.registrationMethod=o.method,(a=t.SemanticTokensDeltaRequest||(t.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType(a.method),a.registrationMethod=o.method,(s=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),s.registrationMethod=o.method,(i=t.SemanticTokensRefreshRequest||(t.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType0(i.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.messageDirection=r.MessageDirection.serverToClient,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.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},3693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;const r=n(6140);var o,i,s;(s=t.TypeHierarchyPrepareRequest||(t.TypeHierarchyPrepareRequest={})).method="textDocument/prepareTypeHierarchy",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),(i=t.TypeHierarchySupertypesRequest||(t.TypeHierarchySupertypesRequest={})).method="typeHierarchy/supertypes",i.messageDirection=r.MessageDirection.clientToServer,i.type=new r.ProtocolRequestType(i.method),(o=t.TypeHierarchySubtypesRequest||(t.TypeHierarchySubtypesRequest={})).method="typeHierarchy/subtypes",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method)},8744:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;const r=n(6140);var o,i;(i=t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).method="workspace/workspaceFolders",i.messageDirection=r.MessageDirection.serverToClient,i.type=new r.ProtocolRequestType0(i.method),(o=t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).method="workspace/didChangeWorkspaceFolders",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)},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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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(1661),t),t.createProtocolConnection=function(e,t,n,r){return(0,i.createMessageConnection)(e,t,n,r)}},6560:(e,t,n)=>{"use strict";e.exports=n(273)},1674:(e,t,n)=>{"use strict";var r,o,i,s,a,c,u,l,d,p,h,f,m,g,y,v,b,R,C,D,w,k,T,S,E,P,_,x;n.r(t),n.d(t,{AnnotatedTextEdit:()=>T,ChangeAnnotation:()=>w,ChangeAnnotationIdentifier:()=>k,CodeAction:()=>ie,CodeActionContext:()=>oe,CodeActionKind:()=>ne,CodeActionTriggerKind:()=>re,CodeDescription:()=>b,CodeLens:()=>se,Color:()=>d,ColorInformation:()=>p,ColorPresentation:()=>h,Command:()=>C,CompletionItem:()=>H,CompletionItemKind:()=>M,CompletionItemLabelDetails:()=>$,CompletionItemTag:()=>F,CompletionList:()=>V,CreateFile:()=>E,DeleteFile:()=>_,Diagnostic:()=>R,DiagnosticRelatedInformation:()=>g,DiagnosticSeverity:()=>y,DiagnosticTag:()=>v,DocumentHighlight:()=>X,DocumentHighlightKind:()=>G,DocumentLink:()=>ce,DocumentSymbol:()=>te,DocumentUri:()=>r,EOL:()=>Te,FoldingRange:()=>m,FoldingRangeKind:()=>f,FormattingOptions:()=>ae,Hover:()=>B,InlayHint:()=>be,InlayHintKind:()=>ye,InlayHintLabelPart:()=>ve,InlineValueContext:()=>ge,InlineValueEvaluatableExpression:()=>me,InlineValueText:()=>he,InlineValueVariableLookup:()=>fe,InsertReplaceEdit:()=>U,InsertTextFormat:()=>j,InsertTextMode:()=>W,Location:()=>u,LocationLink:()=>l,MarkedString:()=>K,MarkupContent:()=>L,MarkupKind:()=>A,OptionalVersionedTextDocumentIdentifier:()=>q,ParameterInformation:()=>z,Position:()=>a,Range:()=>c,RenameFile:()=>P,SelectionRange:()=>ue,SemanticTokenModifiers:()=>de,SemanticTokenTypes:()=>le,SemanticTokens:()=>pe,SignatureInformation:()=>Q,SymbolInformation:()=>Z,SymbolKind:()=>J,SymbolTag:()=>Y,TextDocument:()=>ke,TextDocumentEdit:()=>S,TextDocumentIdentifier:()=>N,TextDocumentItem:()=>I,TextEdit:()=>D,URI:()=>o,VersionedTextDocumentIdentifier:()=>O,WorkspaceChange:()=>we,WorkspaceEdit:()=>x,WorkspaceFolder:()=>Re,WorkspaceSymbol:()=>ee,integer:()=>i,uinteger:()=>s}),function(e){e.is=function(e){return"string"==typeof e}}(r||(r={})),function(e){e.is=function(e){return"string"==typeof e}}(o||(o={})),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(i||(i={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(s||(s={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=s.MAX_VALUE),t===Number.MAX_VALUE&&(t=s.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.uinteger(t.line)&&Se.uinteger(t.character)}}(a||(a={})),function(e){e.create=function(e,t,n,r){if(Se.uinteger(e)&&Se.uinteger(t)&&Se.uinteger(n)&&Se.uinteger(r))return{start:a.create(e,t),end:a.create(n,r)};if(a.is(e)&&a.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Se.objectLiteral(t)&&a.is(t.start)&&a.is(t.end)}}(c||(c={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&c.is(t.range)&&(Se.string(t.uri)||Se.undefined(t.uri))}}(u||(u={})),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 Se.objectLiteral(t)&&c.is(t.targetRange)&&Se.string(t.targetUri)&&c.is(t.targetSelectionRange)&&(c.is(t.originSelectionRange)||Se.undefined(t.originSelectionRange))}}(l||(l={})),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 Se.objectLiteral(t)&&Se.numberRange(t.red,0,1)&&Se.numberRange(t.green,0,1)&&Se.numberRange(t.blue,0,1)&&Se.numberRange(t.alpha,0,1)}}(d||(d={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&c.is(t.range)&&d.is(t.color)}}(p||(p={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.string(t.label)&&(Se.undefined(t.textEdit)||D.is(t))&&(Se.undefined(t.additionalTextEdits)||Se.typedArray(t.additionalTextEdits,D.is))}}(h||(h={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(f||(f={})),function(e){e.create=function(e,t,n,r,o,i){var s={startLine:e,endLine:t};return Se.defined(n)&&(s.startCharacter=n),Se.defined(r)&&(s.endCharacter=r),Se.defined(o)&&(s.kind=o),Se.defined(i)&&(s.collapsedText=i),s},e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.uinteger(t.startLine)&&Se.uinteger(t.startLine)&&(Se.undefined(t.startCharacter)||Se.uinteger(t.startCharacter))&&(Se.undefined(t.endCharacter)||Se.uinteger(t.endCharacter))&&(Se.undefined(t.kind)||Se.string(t.kind))}}(m||(m={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Se.defined(t)&&u.is(t.location)&&Se.string(t.message)}}(g||(g={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(y||(y={})),function(e){e.Unnecessary=1,e.Deprecated=2}(v||(v={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&Se.string(t.href)}}(b||(b={})),function(e){e.create=function(e,t,n,r,o,i){var s={range:e,message:t};return Se.defined(n)&&(s.severity=n),Se.defined(r)&&(s.code=r),Se.defined(o)&&(s.source=o),Se.defined(i)&&(s.relatedInformation=i),s},e.is=function(e){var t,n=e;return Se.defined(n)&&c.is(n.range)&&Se.string(n.message)&&(Se.number(n.severity)||Se.undefined(n.severity))&&(Se.integer(n.code)||Se.string(n.code)||Se.undefined(n.code))&&(Se.undefined(n.codeDescription)||Se.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Se.string(n.source)||Se.undefined(n.source))&&(Se.undefined(n.relatedInformation)||Se.typedArray(n.relatedInformation,g.is))}}(R||(R={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={title:e,command:t};return Se.defined(n)&&n.length>0&&(o.arguments=n),o},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.title)&&Se.string(t.command)}}(C||(C={})),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 Se.objectLiteral(t)&&Se.string(t.newText)&&c.is(t.range)}}(D||(D={})),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 Se.objectLiteral(t)&&Se.string(t.label)&&(Se.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Se.string(t.description)||void 0===t.description)}}(w||(w={})),function(e){e.is=function(e){var t=e;return Se.string(t)}}(k||(k={})),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 D.is(t)&&(w.is(t.annotationId)||k.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 Se.defined(t)&&q.is(t.textDocument)&&Array.isArray(t.edits)}}(S||(S={})),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&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(E||(E={})),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&&Se.string(t.oldUri)&&Se.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(P||(P={})),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&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Se.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Se.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(_||(_={})),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 Se.string(e.kind)?E.is(e)||P.is(e)||_.is(e):S.is(e)})))}}(x||(x={}));var N,O,q,I,A,L,M,j,F,U,W,$,H,V,K,B,z,Q,G,X,J,Y,Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce=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=D.insert(e,t):k.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=D.replace(e,t):k.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=D.del(e):k.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}(),De=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(k.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),we=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new De(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(S.is(e)){var n=new Ce(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ce(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(q.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 Ce(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 Ce(o),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new De,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)||k.is(t)?r=t:n=t,void 0===r?o=E.create(e,n):(i=k.is(r)?r:this._changeAnnotations.manage(r),o=E.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)||k.is(n)?o=n:r=n,void 0===o?i=P.create(e,t,r):(s=k.is(o)?o:this._changeAnnotations.manage(o),i=P.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)||k.is(t)?r=t:n=t,void 0===r?o=_.create(e,n):(i=k.is(r)?r:this._changeAnnotations.manage(r),o=_.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 Se.defined(t)&&Se.string(t.uri)}}(N||(N={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&Se.integer(t.version)}}(O||(O={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&(null===t.version||Se.integer(t.version))}}(q||(q={})),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 Se.defined(t)&&Se.string(t.uri)&&Se.string(t.languageId)&&Se.integer(t.version)&&Se.string(t.text)}}(I||(I={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(A||(A={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(e)&&A.is(t.kind)&&Se.string(t.value)}}(L||(L={})),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}(j||(j={})),function(e){e.Deprecated=1}(F||(F={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Se.string(t.newText)&&c.is(t.insert)&&c.is(t.replace)}}(U||(U={})),function(e){e.asIs=1,e.adjustIndentation=2}(W||(W={})),function(e){e.is=function(e){var t=e;return t&&(Se.string(t.detail)||void 0===t.detail)&&(Se.string(t.description)||void 0===t.description)}}($||($={})),function(e){e.create=function(e){return{label:e}}}(H||(H={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(V||(V={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Se.string(t)||Se.objectLiteral(t)&&Se.string(t.language)&&Se.string(t.value)}}(K||(K={})),function(e){e.is=function(e){var t=e;return!!t&&Se.objectLiteral(t)&&(L.is(t.contents)||K.is(t.contents)||Se.typedArray(t.contents,K.is))&&(void 0===e.range||c.is(e.range))}}(B||(B={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(z||(z={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={label:e};return Se.defined(t)&&(o.documentation=t),Se.defined(n)?o.parameters=n:o.parameters=[],o}}(Q||(Q={})),function(e){e.Text=1,e.Read=2,e.Write=3}(G||(G={})),function(e){e.create=function(e,t){var n={range:e};return Se.number(t)&&(n.kind=t),n}}(X||(X={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(J||(J={})),function(e){e.Deprecated=1}(Y||(Y={})),function(e){e.create=function(e,t,n,r,o){var i={name:e,kind:t,location:{uri:r,range:n}};return o&&(i.containerName=o),i}}(Z||(Z={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(ee||(ee={})),function(e){e.create=function(e,t,n,r,o,i){var s={name:e,detail:t,kind:n,range:r,selectionRange:o};return void 0!==i&&(s.children=i),s},e.is=function(e){var t=e;return t&&Se.string(t.name)&&Se.number(t.kind)&&c.is(t.range)&&c.is(t.selectionRange)&&(void 0===t.detail||Se.string(t.detail))&&(void 0===t.deprecated||Se.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(te||(te={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(ne||(ne={})),function(e){e.Invoked=1,e.Automatic=2}(re||(re={})),function(e){e.create=function(e,t,n){var r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){var t=e;return Se.defined(t)&&Se.typedArray(t.diagnostics,R.is)&&(void 0===t.only||Se.typedArray(t.only,Se.string))&&(void 0===t.triggerKind||t.triggerKind===re.Invoked||t.triggerKind===re.Automatic)}}(oe||(oe={})),function(e){e.create=function(e,t,n){var r={title:e},o=!0;return"string"==typeof t?(o=!1,r.kind=t):C.is(t)?r.command=t:r.edit=t,o&&void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&Se.string(t.title)&&(void 0===t.diagnostics||Se.typedArray(t.diagnostics,R.is))&&(void 0===t.kind||Se.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||C.is(t.command))&&(void 0===t.isPreferred||Se.boolean(t.isPreferred))&&(void 0===t.edit||x.is(t.edit))}}(ie||(ie={})),function(e){e.create=function(e,t){var n={range:e};return Se.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return Se.defined(t)&&c.is(t.range)&&(Se.undefined(t.command)||C.is(t.command))}}(se||(se={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return Se.defined(t)&&Se.uinteger(t.tabSize)&&Se.boolean(t.insertSpaces)}}(ae||(ae={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return Se.defined(t)&&c.is(t.range)&&(Se.undefined(t.target)||Se.string(t.target))}}(ce||(ce={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return Se.objectLiteral(n)&&c.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(ue||(ue={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(le||(le={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(de||(de={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(pe||(pe={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&Se.string(t.text)}}(he||(he={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&Se.boolean(t.caseSensitiveLookup)&&(Se.string(t.variableName)||void 0===t.variableName)}}(fe||(fe={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return null!=t&&c.is(t.range)&&(Se.string(t.expression)||void 0===t.expression)}}(me||(me={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return Se.defined(t)&&c.is(e.stoppedLocation)}}(ge||(ge={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(ye||(ye={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return Se.objectLiteral(t)&&(void 0===t.tooltip||Se.string(t.tooltip)||L.is(t.tooltip))&&(void 0===t.location||u.is(t.location))&&(void 0===t.command||C.is(t.command))}}(ve||(ve={})),function(e){e.create=function(e,t,n){var r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return Se.objectLiteral(t)&&a.is(t.position)&&(Se.string(t.label)||Se.typedArray(t.label,ve.is))&&(void 0===t.kind||ye.is(t.kind))&&void 0===t.textEdits||Se.typedArray(t.textEdits,D.is)&&(void 0===t.tooltip||Se.string(t.tooltip)||L.is(t.tooltip))&&(void 0===t.paddingLeft||Se.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Se.boolean(t.paddingRight))}}(be||(be={})),function(e){e.is=function(e){var t=e;return Se.objectLiteral(t)&&o.is(t.uri)&&Se.string(t.name)}}(Re||(Re={}));var ke,Te=["\n","\r\n","\r"];!function(e){function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,o=e.slice(0,r),i=e.slice(r);t(o,n),t(i,n);for(var s=0,a=0,c=0;s<o.length&&a<i.length;){var u=n(o[s],i[a]);e[c++]=u<=0?o[s++]:i[a++]}for(;s<o.length;)e[c++]=o[s++];for(;a<i.length;)e[c++]=i[a++];return e}e.create=function(e,t,n,r){return new Ee(e,t,n,r)},e.is=function(e){var t=e;return!!(Se.defined(t)&&Se.string(t.uri)&&(Se.undefined(t.languageId)||Se.string(t.languageId))&&Se.uinteger(t.lineCount)&&Se.func(t.getText)&&Se.func(t.positionAt)&&Se.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),o=t(n,(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})),i=r.length,s=o.length-1;s>=0;s--){var a=o[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=i))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),i=c}return r}}(ke||(ke={}));var Se,Ee=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;r<t.length;r++){n&&(e.push(r),n=!1);var o=t.charAt(r);n="\r"===o||"\n"===o,"\r"===o&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&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 a.create(0,e);for(;n<r;){var o=Math.floor((n+r)/2);t[o]>e?r=o:n=o+1}var i=n-1;return a.create(i,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+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(Se||(Se={}))},6265:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const i=n(9817);Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return i.SemanticTokensBuilder}}),o(n(273),t);const s=n(8382);Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const a=n(9748);Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return a.NotebookDocuments}}),o(n(9891),t),(t.ProposedFeatures||(t.ProposedFeatures={})).all={__brand:"features"}},7985:(e,t,n)=>{"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;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=r.CallHierarchyOutgoingCallsRequest.type;return 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(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}}},6634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticFeature=void 0;const r=n(273);t.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(r.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(r.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(r.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(r.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(r.WorkspaceDiagnosticRequest.partialResult,t))))}}}},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){return this.connection.onNotification(r.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(r.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return 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)))}}},6507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintFeature=void 0;const r=n(273);t.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(r.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(r.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(r.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}}},8970:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueFeature=void 0;const r=n(273);t.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(r.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(r.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}}},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){return 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;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},9748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotebookDocuments=t.NotebookSyncFeature=void 0;const r=n(273),o=n(8382);t.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(r.DidOpenNotebookDocumentNotification.type,(t=>{e(t)})),onDidChangeNotebookDocument:e=>this.connection.onNotification(r.DidChangeNotebookDocumentNotification.type,(t=>{e(t)})),onDidSaveNotebookDocument:e=>this.connection.onNotification(r.DidSaveNotebookDocumentNotification.type,(t=>{e(t)})),onDidCloseNotebookDocument:e=>this.connection.onNotification(r.DidCloseNotebookDocumentNotification.type,(t=>{e(t)}))}}};class i{onDidOpenTextDocument(e){return this.openHandler=e,r.Disposable.create((()=>{this.openHandler=void 0}))}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,r.Disposable.create((()=>{this.changeHandler=e}))}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,r.Disposable.create((()=>{this.closeHandler=void 0}))}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return i.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return i.NULL_DISPOSE}onDidSaveTextDocument(){return i.NULL_DISPOSE}}i.NULL_DISPOSE=Object.freeze({dispose:()=>{}}),t.NotebookDocuments=class{constructor(e){e instanceof o.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new o.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new r.Emitter,this._onDidChange=new r.Emitter,this._onDidSave=new r.Emitter,this._onDidClose=new r.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){const t="string"==typeof e?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const t=new i,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument((e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(const n of e.cellTextDocuments)t.openTextDocument({textDocument:n});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)}))),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0===n)return;n.version=e.notebookDocument.version;const r=n.metadata;let o=!1;const i=e.change;void 0!==i.metadata&&(o=!0,n.metadata=i.metadata);const s=[],a=[],c=[],u=[];if(void 0!==i.cells){const e=i.cells;if(void 0!==e.structure){const r=e.structure.array;if(n.cells.splice(r.start,r.deleteCount,...void 0!==r.cells?r.cells:[]),void 0!==e.structure.didOpen)for(const n of e.structure.didOpen)t.openTextDocument({textDocument:n}),s.push(n.uri);if(e.structure.didClose)for(const n of e.structure.didClose)t.closeTextDocument({textDocument:n}),a.push(n.uri)}if(void 0!==e.data){const t=new Map(e.data.map((e=>[e.document,e])));for(let e=0;e<=n.cells.length;e++){const r=t.get(n.cells[e].document);if(void 0!==r){const o=n.cells.splice(e,1,r);if(c.push({old:o[0],new:r}),t.delete(r.document),0===t.size)break}}}if(void 0!==e.textContent)for(const n of e.textContent)t.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),u.push(n.document.uri)}this.updateCellMap(n);const l={notebookDocument:n};o&&(l.metadata={old:r,new:n.metadata});const d=[];for(const e of s)d.push(this.getNotebookCell(e));const p=[];for(const e of a)p.push(this.getNotebookCell(e));const h=[];for(const e of u)h.push(this.getNotebookCell(e));(d.length>0||p.length>0||c.length>0||h.length>0)&&(l.cells={added:d,removed:p,changed:{data:c,textContent:h}}),void 0===l.metadata&&void 0===l.cells||this._onDidChange.fire(l)}))),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument((e=>{const t=this.notebookDocuments.get(e.notebookDocument.uri);void 0!==t&&this._onDidSave.fire(t)}))),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0!==n){this._onDidClose.fire(n);for(const n of e.cellTextDocuments)t.closeTextDocument({textDocument:n});this.notebookDocuments.delete(e.notebookDocument.uri);for(const e of n.cells)this.notebookCellMap.delete(e.document)}}))),r.Disposable.create((()=>{n.forEach((e=>e.dispose()))}))}updateCellMap(e){for(const t of e.cells)this.notebookCellMap.set(t.document,[t,e])}}},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 u;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){super.initialize(e),!0===e?.window?.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=(0,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}(u||(u={}));class l{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(u.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 l(e,n)}},9817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensDiff=t.SemanticTokensFeature=void 0;const r=n(273);t.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(r.SemanticTokensRefreshRequest.type),on:e=>{const t=r.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=r.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=r.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class o{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){const e=this.originalSequence.length,t=this.modifiedSequence.length;let n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,o=t-1;for(;r>=n&&o>=n&&this.originalSequence[r]===this.modifiedSequence[o];)r--,o--;(r<n||o<n)&&(r++,o++);const i=r-n+1,s=this.modifiedSequence.slice(n,o+1);return 1===s.length&&s[0]===this.originalSequence[r]?[{start:n,deleteCount:i-1}]:[{start:n,deleteCount:i,data:s}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}}t.SemanticTokensDiff=o,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(){return void 0!==this._prevData?{resultId:this.id,edits:new o(this._prevData,this._data).computeDiff()}:this.build()}}},9891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineNotebooksFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._NotebooksImpl=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=void 0;const r=n(273),o=n(289),i=n(7560),s=n(2731),a=n(2507),c=n(1836),u=n(7985),l=n(9817),d=n(5421),p=n(828),h=n(2776),f=n(4606),m=n(8970),g=n(6507),y=n(6634),v=n(9748),b=n(8120);function R(e){if(null!==e)return e}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 C{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}).catch((()=>{(0,r.RAL)().console.error("Sending log message failed")}))}}const D=(0,d.ShowDocumentFeature)((0,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(R)}showWarningMessage(e,...t){let n={type:r.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(R)}showInformationMessage(e,...t){let n={type:r.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(R)}}));(t.BulkRegistration||(t.BulkRegistration={})).create=function(){return new w};class w{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 k(void 0,[])};class k{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).catch((()=>{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 T{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 w?this.registerMany(e):e instanceof k?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).catch((()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)}))}))),(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).catch((()=>{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 k(this._connection,t.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const S=(0,p.FileOperationsFeature)((0,c.WorkspaceFoldersFeature)((0,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 E{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}).catch((()=>{}))}}class P{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).catch((()=>{this.connection.console.log("Sending TelemetryEventNotification failed")}))}}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){}attachWorkDoneProgress(e){return(0,s.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,s.attachPartialResult)(this.connection,t)}}t._LanguagesImpl=_;const x=(0,b.MonikerFeature)((0,y.DiagnosticFeature)((0,g.InlayHintFeature)((0,m.InlineValueFeature)((0,f.TypeHierarchyFeature)((0,h.LinkedEditingRangeFeature)((0,l.SemanticTokensFeature)((0,u.CallHierarchyFeature)(_))))))));class N{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(0,s.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,s.attachPartialResult)(this.connection,t)}}t._NotebooksImpl=N;const O=(0,v.NotebookSyncFeature)(N);function q(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function A(e,t){return function(n){return t(e(n))}}function L(e,t){return function(n){return t(e(n))}}function M(e,t){return function(n){return t(e(n))}}function j(e,t){return function(n){return t(e(n))}}function F(e,t){return function(n){return t(e(n))}}function U(e,t){return function(n){return t(e(n))}}t.combineConsoleFeatures=q,t.combineTelemetryFeatures=I,t.combineTracerFeatures=A,t.combineClientFeatures=L,t.combineWindowFeatures=M,t.combineWorkspaceFeatures=j,t.combineLanguagesFeatures=F,t.combineNotebooksFeatures=U,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,q),tracer:n(e.tracer,t.tracer,A),telemetry:n(e.telemetry,t.telemetry,I),client:n(e.client,t.client,L),window:n(e.window,t.window,M),workspace:n(e.workspace,t.workspace,j),languages:n(e.languages,t.languages,F),notebooks:n(e.notebooks,t.notebooks,U)}},t.createConnection=function(e,t,n){const i=n&&n.console?new(n.console(C)):new C,a=e(i);i.rawAttach(a);const c=n&&n.tracer?new(n.tracer(E)):new E,u=n&&n.telemetry?new(n.telemetry(P)):new P,l=n&&n.client?new(n.client(T)):new T,d=n&&n.window?new(n.window(D)):new D,p=n&&n.workspace?new(n.workspace(S)):new S,h=n&&n.languages?new(n.languages(x)):new x,f=n&&n.notebooks?new(n.notebooks(O)):new O,m=[i,c,u,l,d,p,h,f];let g,y,v,b={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;return 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=>(y=e,{dispose:()=>{y=void 0}}),onInitialized:e=>a.onNotification(r.InitializedNotification.type,e),onShutdown:e=>(g=e,{dispose:()=>{g=void 0}}),onExit:e=>(v=e,{dispose:()=>{v=void 0}}),get console(){return i},get telemetry(){return u},get tracer(){return c},get client(){return l},get window(){return d},get workspace(){return p},get languages(){return h},get notebooks(){return f},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,(0,s.attachWorkDone)(a,t),void 0))),onCompletion:e=>a.onRequest(r.CompletionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onCompletionResolve:e=>a.onRequest(r.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(r.SignatureHelpRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),void 0))),onDeclaration:e=>a.onRequest(r.DeclarationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDefinition:e=>a.onRequest(r.DefinitionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onTypeDefinition:e=>a.onRequest(r.TypeDefinitionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onImplementation:e=>a.onRequest(r.ImplementationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onReferences:e=>a.onRequest(r.ReferencesRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDocumentHighlight:e=>a.onRequest(r.DocumentHighlightRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onDocumentSymbol:e=>a.onRequest(r.DocumentSymbolRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onWorkspaceSymbol:e=>a.onRequest(r.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onWorkspaceSymbolResolve:e=>a.onRequest(r.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>a.onRequest(r.CodeActionRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(r.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,(0,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,(0,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,(0,s.attachWorkDone)(a,t),(0,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,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onColorPresentation:e=>a.onRequest(r.ColorPresentationRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onFoldingRanges:e=>a.onRequest(r.FoldingRangeRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onSelectionRanges:e=>a.onRequest(r.SelectionRangeRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),(0,s.attachPartialResult)(a,t)))),onExecuteCommand:e=>a.onRequest(r.ExecuteCommandRequest.type,((t,n)=>e(t,n,(0,s.attachWorkDone)(a,t),void 0))),dispose:()=>a.dispose()};for(let e of m)e.attach(b);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 m)t.initialize(e.capabilities);if(y){let t=y(e,(new r.CancellationTokenSource).token,(0,s.attachWorkDone)(a,e),void 0);return(n=t,n instanceof Promise?n:o.thenable(n)?new Promise(((e,t)=>{n.then((t=>e(t)),(e=>t(e)))})):Promise.resolve(n)).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(b.__textDocumentSync)?b.__textDocumentSync:r.TextDocumentSyncKind.None:o.number(n.textDocumentSync)||o.number(n.textDocumentSync.change)||(n.textDocumentSync.change=o.number(b.__textDocumentSync)?b.__textDocumentSync:r.TextDocumentSyncKind.None);for(let e of m)e.fillServerCapabilities(n);return t}))}{let e={capabilities:{textDocumentSync:r.TextDocumentSyncKind.None}};for(let t of m)t.fillServerCapabilities(e.capabilities);return e}var n})),a.onRequest(r.ShutdownRequest.type,(()=>(t.shutdownReceived=!0,g?g((new r.CancellationTokenSource).token):void 0))),a.onNotification(r.ExitNotification.type,(()=>{try{v&&v()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}})),a.onNotification(r.SetTraceNotification.type,(e=>{c.trace=r.Trace.fromString(e.value)})),b}},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)}}},8382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocuments=void 0;const r=n(273);t.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,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 onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.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._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=r.TextDocumentSyncKind.Incremental;const t=[];return t.push(e.onDidOpenTextDocument((e=>{const t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);const r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)}))),t.push(e.onDidChangeTextDocument((e=>{const t=e.textDocument,n=e.contentChanges;if(0===n.length)return;const{version:r}=t;if(null==r)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);let o=this._syncedDocuments.get(t.uri);void 0!==o&&(o=this._configuration.update(o,n,r),this._syncedDocuments.set(t.uri,o),this._onDidChangeContent.fire(Object.freeze({document:o})))}))),t.push(e.onDidCloseTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))}))),t.push(e.onWillSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))}))),t.push(e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return void 0!==n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]}))),t.push(e.onDidSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onDidSave.fire(Object.freeze({document:t}))}))),r.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}}},4606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyFeature=void 0;const r=n(273);t.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(r.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=r.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=r.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},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()}},1836:(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{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.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)})))}fillServerCapabilities(e){super.fillServerCapabilities(e);const t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=!0===t||"string"==typeof t}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._notificationIsAutoRegistered||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="NODE_PATH",c=["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(((u,l)=>{let d=process.env,p=Object.create(null);Object.keys(d).forEach((e=>p[e]=d[e])),t&&i.existsSync(t)&&(p[a]?p[a]=t+o.delimiter+p[a]:p[a]=t,r&&r(`NODE_PATH value is: ${p[a]}`)),p.ELECTRON_RUN_AS_NODE="1";try{let t=(0,s.fork)("",[],{cwd:n,env:p,execArgv:["-e",c]});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?u(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let r={c:"rs",a:e};t.send(r)}catch(e){l(e)}}))}function u(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=(0,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 l;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;i<s;i++)n[i]=decodeURIComponent(n[i]);if("win32"===process.platform&&n.length>1){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=u,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=(0,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())}}(l=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=>l.isParent(n,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>c(t,u(r),e,r)))):c(t,u(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);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}: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);function u(){0}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 d,p=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(d=setInterval((()=>{try{process.kill(t,0)}catch(e){u(),process.exit(p?0:1)}}),3e3))}catch(e){}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length)return void t(process.argv[n+1]);{let n=r.split("=");n[0]===e&&t(n[1])}}}();const h={initialize:e=>{const t=e.processId;i.number(t)&&void 0===d&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(p?0:1)}}),3e3)},get shutdownReceived(){return p},set shutdownReceived(e){p=e},exit:e=>{u(),process.exit(e)}};t.createConnection=function(e,t,n,r){let o,a,l,d;return void 0!==e&&"features"===e.__brand&&(o=e,e=t,t=n,n=r),c.ConnectionStrategy.is(e)||c.ConnectionOptions.is(e)?d=e:(a=e,l=t,d=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<i.length;s++){let a=i[s];if("--node-ipc"===a){e=new c.IPCMessageReader(process),t=new c.IPCMessageWriter(process);break}if("--stdio"===a){e=process.stdin,t=process.stdout;break}if("--socket"===a){n=parseInt(i[s+1]);break}if("--pipe"===a){r=i[s+1];break}var o=a.split("=");if("--socket"===o[0]){n=parseInt(o[1]);break}if("--pipe"===o[0]){r=o[1];break}}if(n){let r=(0,c.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,c.createServerPipeTransport)(r);e=n[0],t=n[1]}}var a="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+a);if(!t)throw new Error("Connection output stream is not set. "+a);if(i.func(e.read)&&i.func(e.on)){let t=e;t.on("end",(()=>{u(),process.exit(p?0:1)})),t.on("close",(()=>{u(),process.exit(p?0:1)}))}return(0,s.createConnection)((r=>(0,c.createProtocolConnection)(e,t,r,n)),h,r)}(a,l,d,o)}},8212:(e,t,n)=>{"use strict";e.exports=n(5809)},2479:e=>{e.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),o=e[e.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach((function(e){r[e]=o[e]})),r}}},9491:e=>{"use strict";e.exports=require("assert")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")}},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.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";n.r(r);var e,t=n(8212),o=n(5809);class i{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(i.isIncremental(t)){const e=c(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 s=this._lineOffsets;const u=a(t.text,!1,n);if(i-o===u.length)for(let e=0,t=u.length;e<t;e++)s[e+o+1]=u[e];else u.length<1e4?s.splice(o+1,i-o,...u):this._lineOffsets=s=s.slice(0,o+1).concat(u,s.slice(i+1));const l=t.text.length-(r-n);if(0!==l)for(let e=o+1+u.length,t=s.length;e<t;e++)s[e]=s[e]+l}else{if(!i.isFull(t))throw new Error("Unknown change event received");this._content=t.text,this._lineOffsets=void 0}this._version=t}getLineOffsets(){return void 0===this._lineOffsets&&(this._lineOffsets=a(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};for(;n<r;){let o=Math.floor((n+r)/2);t[o]>e?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+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}function s(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);s(r,t),s(o,t);let i=0,a=0,c=0;for(;i<r.length&&a<o.length;){let n=t(r[i],o[a]);e[c++]=n<=0?r[i++]:o[a++]}for(;i<r.length;)e[c++]=r[i++];for(;a<o.length;)e[c++]=o[a++];return e}function a(e,t,n=0){const r=t?[n]:[];for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);13!==o&&10!==o||(13===o&&t+1<e.length&&10===e.charCodeAt(t+1)&&t++,r.push(n+t+1))}return r}function c(e){const t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function u(e){const 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){let n=e.getText(),r=s(t.map(u),((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 i=[];for(const t of r){let r=e.offsetAt(t.range.start);if(r<o)throw new Error("Overlapping edit");r>o&&i.push(n.substring(o,r)),t.newText.length&&i.push(t.newText),o=e.offsetAt(t.range.end)}return i.push(n.substr(o)),i.join("")}}(e||(e={}));var l=Object.defineProperty,d=Object.defineProperties,p=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y=(e,t)=>{for(var n in t||(t={}))f.call(t,n)&&g(e,n,t[n]);if(h)for(var n of h(t))m.call(t,n)&&g(e,n,t[n]);return e};const v=[{name:"FORMAT_STATEMEMT",match:[{type:"asterisk"},{type:"asterisk"},{type:"word"}],becomes:{type:"format"}},{name:"DIRECTIVE",match:[{type:"divide"},{type:"word",match:e=>["TITLE","EJECT","SPACE","COPY","INCLUDE","SET","RESTORE","OVERLOAD","DEFINE","UNDEFINED","IF","ELSE","ELSEIF","ENDIF","EOF","CHARCOUNT"].includes(e.toUpperCase())}],becomes:{type:"directive"}},{name:"IS_NUMBER",match:[{type:"number"},{type:"dot"},{type:"number"}],becomes:{type:"number"}},{name:"IS_SPECIAL",match:[{type:"asterisk"},{type:"word",match:e=>["CTDATA","BLANK","BLANKS","ZERO","ZEROS","ON","OFF","NULL","ISO","MDY","DMY","EUR","YMD","USA","SECONDS","S","MINUTES","MN","HOURS","H","DAYS","D","MONTHS","M","YEARS","Y","HIVAL","END","LOVAL","START","N","OMIT","STRING","CWIDEN","CONVERT"].includes(e.toUpperCase())||e.toUpperCase().startsWith("IN")}],becomes:{type:"special"}},{name:"HEX",match:[{type:"word",match:e=>"x"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"TIME",match:[{type:"word",match:e=>"t"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"DATE",match:[{type:"word",match:e=>"d"===e.toUpperCase()},{type:"string"}],becomes:{type:"hex"}},{name:"DECLARE",match:[{type:"word",match:e=>"DCL"===e.toUpperCase()},{type:"minus"},{type:"word"}],becomes:{type:"declare"}},{name:"END",match:[{type:"word",match:e=>"END"===e.toUpperCase()},{type:"minus"},{type:"word"}],becomes:{type:"end"}},{name:"DECLARE_SUB",match:[{type:"word",match:e=>"BEGSR"===e.toUpperCase()}],becomes:{type:"declare"}},{name:"END_SUB",match:[{type:"word",match:e=>"ENDSR"===e.toUpperCase()}],becomes:{type:"end"}},{name:"FOR-EACH",match:[{type:"word",match:e=>"FOR"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"EACH"===e.toUpperCase()}],becomes:{type:"word"}},{name:"EVAL-CORR",match:[{type:"word",match:e=>"EVAL"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"CORR"===e.toUpperCase()}],becomes:{type:"word"}},{name:"ON-EXIT",match:[{type:"word",match:e=>"ON"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"EXIT"===e.toUpperCase()}],becomes:{type:"word"}},{name:"CTL-OPT",match:[{type:"word",match:e=>"CTL"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"OPT"===e.toUpperCase()}],becomes:{type:"declare"}},{name:"BIF",match:[{type:"percent"},{type:"word"}],becomes:{type:"builtin"}},{name:"ON-ERROR",match:[{type:"word",match:e=>"ON"===e.toUpperCase()},{type:"minus"},{type:"word",match:e=>"ERROR"===e.toUpperCase()}],becomes:{type:"word"}},{name:"NEWLINE",match:[{type:"newliner"},{type:"newline"}],becomes:{type:"newline"}}],b=["%",".","(",")","+","-","*","/","=",":",",",";","\n","\r"," "],R={"%":"percent",".":"dot","(":"openbracket",")":"closebracket","+":"plus","-":"minus","/":"divide","*":"asterisk","=":"equal",":":"seperator",";":"semicolon",",":"comma","\n":"newline","\r":"newliner"};function C(e){let t=0,n=-1,r="Normal",o=[],i=0,s="";for(let a=0;a<e.length;a++)"Normal"===r&&e[a]&&e[a+1]&&"//"===e.substring(a,a+2)?(n=a,s="//",r="Comment",a++):"Comment"===r&&"\n"===e[a]?(r="Normal",o.push({value:s,type:"comment",range:{start:n,end:a-1,line:t}},{value:e[a],type:"newline",range:{start:a,end:a+e[a].length,line:t}}),s="",i=a+1):"Comment"===r||"String"===r&&"'"!==e[a]?s+=e[a]:"'"===e[a]?("String"===r?(s+=e[a],o.push({value:s,type:"string",range:{start:i,end:i+s.length,line:t}}),s=""):(i=a,s+=e[a]),r="String"===r?"Normal":"String"):b.includes(e[a])&&"Normal"===r?(""!==s.trim()&&(o.push({value:s,type:"word",range:{start:i,end:i+s.length,line:t}}),s="")," "!==e[a]&&o.push({value:e[a],type:R[e[a]],range:{start:a,end:a+e[a].length,line:t}}),i=a+1):s+=e[a],"\n"===e[a]&&t++;return""!==s.trim()&&"Comment"!==r?(o.push({value:s,type:"Normal"===r?"word":"string",range:{start:i,end:i+s.length,line:t}}),s=""):o.push({value:s,type:"comment",range:{start:i,end:i+s.length,line:t}}),o=function(e){for(let r=0;r<e.length;r++)for(let o=0;o<v.length;o++){const i=v[o];let s=!0;for(let t=0;t<i.match.length;t++){const n=i.match[t];if(e[r+t]){if(e[r+t].type!==n.type){s=!1;break}if(n.match){if(!n.match(e[r+t].value)){s=!1;break}s=!0}else s=!0}else s=!1}if(s){const o=e.slice(r,r+i.match.length);e.splice(r,i.match.length,(t=y({},i.becomes),n={value:o.map((e=>e.value)).join(""),range:{start:o[0].range.start,end:o[o.length-1].range.end,line:o[0].range.line}},d(t,p(n))));break}}var t,n;return e}(o),o}function D(e){let t=0,n=0;for(let r=0;r<e.length;r++)switch(e[r].type){case"openbracket":0===n&&(t=r),n++;break;case"closebracket":if(n--,0===n){const n=e.slice(t+1,r);e.splice(t,r-t+1,{type:"block",block:D(n),range:{line:e[t].range.line,start:e[r].range.start,end:e[r].range.end}}),r=t}}return e}class w{constructor(e){this.type=e,this.name="",this.keywords=[],this.keyword={},this.description="",this.tags=[],this.position=void 0,this.references=[],this.subItems=[],this.readParms=!1,this.range={start:null,end:null},this.scope=void 0}clone(){const e=new w(this.type);return e.name=this.name,e.keywords=[...this.keywords],e.description=this.description,e.tags=this.tags,this.position&&(e.position={path:this.position.path,line:this.position.line}),e.subItems=this.subItems.map((e=>e.clone())),e.range={start:this.range.start,end:this.range.end},e}}const k=[...Array(98).keys(),"LR","KL"].map((e=>`IN${e.toString().padStart(2,"0")}`)).map((e=>{const t=new w("variable");return t.name=e,t.keywords=["IND"],t}));class T{constructor(e={}){this.keyword={},this.parameters=e.parameters||[],this.subroutines=e.subroutines||[],this.procedures=e.procedures||[],this.files=e.files||[],this.variables=e.variables||[],this.structs=e.structs||[],this.constants=e.constants||[],this.sqlReferences=e.sqlReferences||[],this.indicators=e.indicators||[...k],this.includes=e.includes||[]}merge(e){return e?new T({parameters:[...this.parameters,...e.parameters],subroutines:[...this.subroutines,...e.subroutines],procedures:[...this.procedures,...e.procedures],variables:[...this.variables,...e.variables],files:[...this.files,...e.files],structs:[...this.structs,...e.structs],constants:[...this.constants,...e.constants],sqlReferences:[...this.sqlReferences,...e.sqlReferences],indicators:[...this.indicators,...e.indicators]}):this}getNames(){const e=this.files.map((e=>e.subItems.map((e=>e.name)))).flat();return[...this.parameters.map((e=>e.name)),...this.constants.map((e=>e.name)),...this.procedures.map((e=>e.name)),...this.files.map((e=>e.name)),...e,...this.subroutines.map((e=>e.name)),...this.variables.map((e=>e.name)),...this.structs.map((e=>e.name))].filter((e=>e))}getDefinitionBlockEnd(e){const t=[this.procedures.filter((t=>t.position.path===e&&void 0!==t.keyword.EXTPROC)).pop(),this.structs.filter((t=>t.position.path===e)).pop(),this.variables.filter((t=>t.position.path===e)).pop(),this.constants.filter((t=>t.position.path===e)).pop(),this.files.filter((t=>t.position.path===e)).pop()].filter((e=>void 0!==e)).map((e=>e.range&&e.range.end?e.range.end:e.position.line)).sort(((e,t)=>t-e));return t.length>=1?t[0]:0}find(e){e=e.toUpperCase();const t=[...this.files.map((e=>e.subItems)).flat(),...this.structs],n=[...this.parameters.filter((t=>t.name.toUpperCase()===e)),...this.constants.filter((t=>t.name.toUpperCase()===e)),...this.procedures.filter((t=>t.name.toUpperCase()===e)),...this.files.filter((t=>t.name.toUpperCase()===e)),...t.filter((t=>t.name.toUpperCase()===e)),...this.subroutines.filter((t=>t.name.toUpperCase()===e)),...this.variables.filter((t=>t.name.toUpperCase()===e)),...this.indicators.filter((t=>t.name.toUpperCase()===e))];return t.length>0&&0===n.length&&t.filter((e=>!0!==e.keyword.QUALIFIED)).forEach((t=>{n.push(...t.subItems.filter((t=>t.name.toUpperCase()===e)))})),n.length>0?n[0]:null}clearReferences(){[...this.parameters,...this.constants,...this.files,...this.procedures,...this.subroutines,...this.variables,...this.structs].forEach((e=>{e.references=[]})),this.procedures.forEach((e=>{e.scope&&e.scope.clearReferences()})),[...this.files.map((e=>e.subItems)).flat(),...this.structs].forEach((e=>{e.subItems.forEach((e=>e.references=[]))}))}findDefinition(e,t){const n=this.procedures.find((t=>e>=t.range.start&&e<=t.range.end));if(n&&n.scope){const e=n.scope.find(t);if(e)return e}const r=this.find(t);if(r)return r}fixProcedures(){this.procedures.length>0&&this.procedures.forEach((e=>{e.scope&&e.subItems.length>0&&(e.scope.parameters=[...e.subItems],e.scope.fixProcedures())}))}}const S={"DCL-DS":["LIKEDS","LIKEREC","END-DS"],"DCL-PI":["END-PI"],"DCL-PR":["OVERLOAD","END-PR"]};function E(e){return{name:e.substr(6,10).trim(),keywords:e.substr(43).trim().split(" ").filter((e=>""!==e))}}function P(e){const t=(e=e.padEnd(80)).substr(11,14).trim(),n=e.substr(25,10).trim().toUpperCase(),r=e.substr(35,14).trim(),o=e.substr(35).trim();return{opcode:n,factor1:t,factor2:r,result:e.substr(49,14).trim(),extended:o,ind1:e.substr(70,2).trim(),ind2:e.substr(72,2).trim(),ind3:e.substr(74,2).trim()}}function _(e){return{potentialName:(e=e.padEnd(80)).substring(6).trim(),name:e.substr(6,15).trim(),pos:e.substr(25,7).trim(),len:e.substr(32,7).trim(),type:e.substr(39,1).trim(),decimals:e.substr(40,3).trim(),field:e.substr(23,2).trim().toUpperCase(),keywords:e.substr(43).trim().toUpperCase().split(" ").filter((e=>""!==e))}}function x(e){const t=(e=e.padEnd(80)).substr(6,16).trim(),n=e.substring(6).trim(),r="B"===e[23].toUpperCase();return{name:t,potentialName:n,keywords:e.substr(43).trim().toUpperCase().split(" ").filter((e=>""!==e)),start:r}}function N(e){let t="",n=Number(e.len);switch(e.pos&&(n=n-Number(e.pos)+1),e.type.toUpperCase()){case"A":e.keywords.indexOf("VARYING")>=0?(t="Varchar",n-=2):t="Char",t+="("+n+")";break;case"B":t=""!=e.pos?4==Number(e.len)?"Bindec(9)":"Bindec(4)":"Bindec("+e.len+")";break;case"C":t="Ucs2("+e.len+")";break;case"D":case"L":t="Date";break;case"F":t="Float("+e.len+")";break;case"G":t=e.keywords.indexOf("VARYING")>=0?"Vargraph":"Graph",t+="("+e.len+")";break;case"I":switch(n){case 1:t="Int(3)";break;case 2:t="Int(5)";break;case 4:t="Int(10)";break;case 8:t="Int(20)";break;default:t="Int("+n+")"}break;case"N":t="Ind";break;case"P":t="Packed("+n+":"+e.decimals+")";break;case"S":t="Zoned("+n+":"+e.decimals+")";break;case"T":t="Time";break;case"U":switch(n){case 1:t="Uns(3)";break;case 2:t="Uns(5)";break;case 4:t="Uns(10)";break;case 8:t="Uns(20)";break;default:t="Uns("+n+")"}break;case"Z":t="Timestamp",t+="("+n+")";break;case"*":t="Pointer";break;case"":"DS"==e.field?t="lineData.Len("+e.len+")":""!=e.len&&(""==e.decimals?(t=e.keywords.indexOf("VARYING")>=0?"Varchar":"Char",t+="("+n+")"):t=""===e.field?"Zoned("+n+":"+e.decimals+")":"Packed("+n+":"+e.decimals+")")}return t.toUpperCase()}class O{constructor(){this.parsedCache={},this.tables={},this.tableFetch=void 0,this.includeFileFetch=void 0}setTableFetch(e){this.tableFetch=e}setIncludeFileFetch(e){this.includeFileFetch=e}async fetchTable(e,t="",n){if(void 0===e||e&&""===e.trim())return[];if(!this.tableFetch)return[];const r=e.toUpperCase(),o=r,i=Date.now();if(this.tables[o]){if(this.tables[o].fetching)return[];if(i<=this.tables[o].fetched+18e5)return this.tables[o].recordFormats.map((e=>e.clone()))}let s;this.tables[o]={fetching:!0,fetched:0,recordFormats:[]};try{s=await this.tableFetch(r,n),this.tables[o]={fetched:i,recordFormats:s}}catch(e){this.tables[o]={fetched:i,recordFormats:[]},s=[]}return this.tables[o].fetching=!1,s.map((e=>e.clone()))}clearParsedCache(e){this.parsedCache[e]=void 0}getParsedCache(e){return this.parsedCache[e]}static getIncludeFromDirective(e){if(e.includes("*"))return;const t=e.toUpperCase();let n=t.indexOf("/COPY "),r=6;return-1===n&&(n=t.indexOf("/INCLUDE "),r=9),n>=0?e.substring(n+r).trim():void 0}async getDocs(e,t,n={withIncludes:!0}){const r=this.getParsedCache(e);if(!0!==n.ignoreCache&&r)return r;if(!t)return null;const o={};let i,s,a,c,u,l,d,p,h=t.replace(new RegExp("\\\r","g"),"").split("\n"),f=[],m=[],g=!1,y=!1,v=[],b=[],R=[];v.push(new T);const C=(e,t)=>{let n=e;return["EXTFILE"].forEach((e=>{const r=t.find((t=>t.startsWith(`${e}(`)&&t.endsWith(")")));r&&(n=r.substring(e.length+1,r.length-1).toUpperCase(),n.startsWith("'")&&n.endsWith("'")&&(n=n.substring(1,n.length-1)))})),"*EXTDESC"===n&&["EXTDESC"].forEach((e=>{const r=t.find((t=>t.startsWith(`${e}(`)&&t.endsWith(")")));r&&(n=r.substring(e.length+1,r.length-1).toUpperCase(),n.startsWith("'")&&n.endsWith("'")&&(n=n.substring(1,n.length-1)))})),n},D=async(e,t)=>{const n=["LIKEDS","LIKEREC","EXTNAME"];for(const r of n){const n=t.keywords.find((e=>e.startsWith(`${r}(`)&&e.endsWith(")")));if(n){let o=n.substring(r.length+1,n.length-1).toUpperCase();if(o.includes(":")){const e=o.split(":").filter((e=>!1===e.trim().startsWith("*")));if(!(e.length>0))break;o=e[0]}if(o.startsWith("'")&&o.endsWith("'")&&(o=o.substring(1,o.length-1)),["EXTNAME"].includes(r)){t.keywords.includes("QUALIFIED")||t.keywords.push("QUALIFIED");const n=await this.fetchTable(o,t.keywords.length.toString(),t.keywords.includes("ALIAS"));n.length>0&&n.forEach((n=>{n.subItems.forEach((t=>{t.position={path:e,line:u}})),t.subItems.push(...n.subItems)}))}else for(let e=v.length-1;e>=0;e--){const n=v[e].structs.find((e=>e.name.toUpperCase()===o));if(n)return t.subItems=n.subItems,void(t.keywords.includes("QUALIFIED")||t.keywords.push("QUALIFIED"))}}}};if(n.withIncludes&&this.includeFileFetch)for(let t=h.length-1;t>=0;t--){let n=h[t];if(""===n)continue;const r=O.getIncludeFromDirective(n);if(r){const n=await this.includeFileFetch(e,r);n.found&&(o[n.uri]=n.lines,v[0].includes.push({toPath:n.uri,line:t}))}}let k;o[e]=h;let q,I=!1,A=!1;for(const e of Object.keys(o)){if(0===o[e].length)continue;u=-1,A=o[e][0].toUpperCase().startsWith("**FREE");let t,n,r=!1,h=0;for(let L of o[e]){const o=v[v.length-1];let M;if(r=!1,u+=1,L.startsWith("**")){if(0===u)continue;break}if(!1===A&&L.length>6){const e=L[6];if(M=L[5].toUpperCase(),"*"===e)continue;if("/"===e)L=L.substring(6),r=!0;else if(" "===M)L=L.substring(7),r=!0;else{if(!["D","P","C","F","H"].includes(M))continue;if("C"===M){const e=L.toUpperCase();if(!1===["BEGSR","ENDSR","CALL"].some((t=>e.includes(t))))continue}}L.length>80&&(L=L.substring(0,80))}if(p=[],l=[],A||r){if(L=L.trim(),""===L)continue;p=L.split(";"),l=p[0].toUpperCase().split(" ").filter((e=>""!==e)),d=p[0].split(" ").filter((e=>""!==e));const r=L.startsWith("//");if(!r){if("/EOF"===l[0]&&0===h)break;if("/IF"===l[0]){h+=1;continue}if("/ENDIF"===l[0]){h-=1;continue}if(h>0)continue;if(L.startsWith("/"))continue}if(p.length>1&&p[1].includes("//")&&(L=p[0]+";"),t||(n=u),!r)if(L.endsWith(";"))t&&(L=t+L,t=void 0,p=L.split(";"),l=p[0].toUpperCase().split(" ").filter((e=>""!==e)),d=p[0].split(" ").filter((e=>""!==e)));else if(!L.endsWith(";")){t=(t||"")+L.trim(),t.endsWith("-")?t=t.substring(0,t.length-1):t+=" ";continue}switch(l[0]){case"CTL-OPT":R.push(...l.slice(1));break;case"DCL-F":if(void 0===s&&l.length>1){s=new w("file"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.position={path:e,line:u};const t=C(l[1],l);let n="";l.find((e=>{if(e.toUpperCase().includes("PREFIX"))return n=e.trim().substring(7,e.indexOf(")")),!0}));const r=await this.fetchTable(t,l.length.toString(),l.includes("ALIAS"));if(r.length>0){const e=l.includes("QUALIFIED");r.forEach((t=>{t.keywords=[l[1]],e&&t.keywords.push("QUALIFIED"),t.position=s.position,t.subItems.forEach((e=>{n&&(e.name=n+e.name),e.position=s.position}))})),s.subItems.push(...r)}o.files.push(s),g=!0}break;case"DCL-C":void 0===s&&l.length>1&&(s=new w("constant"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.position={path:e,line:n},o.constants.push(s),g=!0);break;case"DCL-S":l.length>1&&void 0===s&&(s=new w("variable"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},o.variables.push(s),g=!0);break;case"DCL-DS":void 0===s&&l.length>1&&(s=new w("struct"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.range={start:n,end:n},q="structs",await D(e,s),s.keywords.some((e=>S["DCL-DS"].some((t=>e.startsWith(t)))))?(s.range.end=n,o.structs.push(s)):(s.readParms=!0,b.push(s)),g=!0,f=[]);break;case"END-DS":b.length>0&&(b[b.length-1].range.end=n),1===b.length?o.structs.push(b.pop()):b.length>1&&b[b.length-2].subItems.push(b.pop());break;case"DCL-PR":void 0===s&&l.length>1&&(o.procedures.find((e=>e.name&&e.name.toUpperCase()===l[1]))||(q="procedures",s=new w("procedure"),s.name=d[1],s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.readParms=!0,s.range={start:n,end:n},s.keywords.some((e=>S["DCL-PR"].some((t=>e.startsWith(t)))))&&(s.range.end=n,o.procedures.push(s),g=!0),f=[]));break;case"END-PR":s&&"procedure"===s.type&&(s.range.end=n,v[0].procedures.some((e=>e.name.toUpperCase()===s.name.toUpperCase()))||o.procedures.push(s),g=!0);break;case"DCL-PROC":if(l.length>1){const t=o.procedures.findIndex((e=>e.name&&e.name.toUpperCase()===l[1]));t>=0&&o.procedures.splice(t,1),s=new w("procedure"),c=d[1],s.name=c,s.keywords=l.slice(2),s.description=f.join("\n"),s.tags=m,s.position={path:e,line:n},s.readParms=!1,s.range={start:n,end:n},o.procedures.push(s),g=!0,v.push(new T)}break;case"DCL-PI":if(c&&l.length>0){q="procedures",s=v[0].procedures.find((e=>e.name===c));const e=l.findIndex((e=>"END-PI"===e));s&&(e>=0&&(l.splice(e,1),s.readParms=!1,g=!0),s.keywords.push(...l.slice(2)),s.readParms=!0,f=[])}break;case"END-PI":s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.readParms=!1,g=!0);break;case"END-PROC":v.length>1&&(s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.scope=v.pop(),s.range.end=n,g=!0));break;case"BEGSR":l.length>1&&(o.subroutines.find((e=>e.name&&e.name.toUpperCase()===l[1]))||(s=new w("subroutine"),s.name=d[1],s.description=f.join("\n"),s.keywords=["Subroutine"],s.position={path:e,line:n},s.range={start:n,end:n},f=[]));break;case"ENDSR":s&&"subroutine"===s.type&&(s.range.end=n,o.subroutines.push(s),g=!0);break;case"EXEC":if(l.length>2&&!l.includes("FETCH")){const t=["INTO","FROM","UPDATE","CALL","JOIN"],r=(e="")=>{const t={schema:void 0,name:e},n=Math.max(t.name.indexOf("."),t.name.indexOf("/"));n>=0&&(t.schema=t.name.substring(0,n),t.name=t.name.substring(n+1));const r=t.name.indexOf("(");return r>=0&&(t.name=t.name.substring(0,r)),t};l.forEach(((i,s)=>{if(t.includes(i)&&("INTO"!==i||"INSERT"===l[s-1])&&s>=0&&s+1<l.length){const t=d[s+1],i=r(t),a=new w("file");a.name=i.name,a.keywords=[],a.description=i.schema||"",a.position={path:e,line:n},o.sqlReferences.push(a)}g=!0}))}break;case"///":y=!y,!0===y&&(i=void 0,f=[],m=[]);break;default:if(r){if(y){const e=L.substring(2).trim();if(e.length>0)if(e.startsWith("@")){const t=e.substring(1).split(" ");m.push({tag:t[0],content:t.slice(1).join(" ")})}else m.length>0?m[m.length-1].content+=` ${e}`:void 0===i?i=e:f.push(e)}}else if(s||b.length>=1&&(s=b[b.length-1]),s&&["procedure","struct"].includes(s.type)&&s.readParms&&l.length>0){if(l[0].startsWith("DCL")&&(l.slice(1),d=d.splice(1)),a=new w("subitem"),a.name="*N"===l[0]?`parm${s.subItems.length+1}`:d[0],a.keywords=l.slice(1),a.position={path:e,line:n},"procedure"===s.type){const e=s.tags.filter((e=>"param"===e.tag)),t=e.length>s.subItems.length?e[s.subItems.length]:void 0;t&&(a.description=t.content)}await D(e,a),a.keyword=O.expandKeywords(a.keywords),s.subItems.push(a),a=void 0,"struct"===s.type&&(g=!0)}}}else{if(h>0)continue;switch(M){case"H":R.push(L.substring(6));break;case"F":const t=E(L);if(k=C(t.name,t.keywords),t.name){s=new w("file"),s.name=k,s.keywords=t.keywords,s.position={path:e,line:u};let n="";t.keywords.find((e=>{if(e.toUpperCase().includes("PREFIX"))return n=e.substring(7,e.indexOf(")")),!0}));const r=await this.fetchTable(k,L.length.toString(),t.keywords.includes("ALIAS"));if(r.length>0){const e=t.keywords.includes("QUALIFIED");r.forEach((t=>{t.keywords=[k],e&&t.keywords.push("QUALIFIED"),t.position=s.position,t.subItems.forEach((e=>{n&&(e.name=n.toUpperCase()+e.name),e.position=s.position}))})),q="structs",s.subItems.push(...r)}o.files.push(s)}else s=o.files[o.files.length-1],s.keywords=[...s.keywords?s.keywords:[],...t.keywords];g=!0;break;case"C":const n=P(L);switch(k=n.factor1,n.opcode){case"BEGSR":o.subroutines.find((e=>e.name&&e.name.toUpperCase()===k))||(s=new w("subroutine"),s.name=k,s.keywords=["Subroutine"],s.position={path:e,line:u},s.range={start:u,end:u},f=[]);break;case"ENDSR":s&&"subroutine"===s.type&&(s.range.end=u,o.subroutines.push(s),g=!0);break;case"CALL":const t=new w("procedure");t.name=n.factor2.startsWith("'")&&n.factor2.endsWith("'")?n.factor2.substring(1,n.factor2.length-1):n.factor2,t.keywords=["EXTPGM"],t.description=f.join("\n"),t.tags=m,t.position={path:e,line:u},t.range={start:u,end:u},t.keyword=O.expandKeywords(t.keywords),o.procedures.push(t)}break;case"P":const r=x(L);if(""===r.potentialName)continue;if(r.potentialName.endsWith("..."))k=r.potentialName.substring(0,r.potentialName.length-3),I=!0;else if(r.start){if(k=r.name.length>0?r.name:k,k){const t=o.procedures.findIndex((e=>e.name&&e.name.toUpperCase()===k.toUpperCase()));t>=0&&o.procedures.splice(t,1),s=new w("procedure"),c=k,s.name=c,s.keywords=r.keywords,s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},o.procedures.push(s),g=!0,v.push(new T)}}else v.length>1&&(s=v[0].procedures.find((e=>e.name===c)),s&&"procedure"===s.type&&(s.scope=v.pop(),s.range.end=u,g=!0));break;case"D":const i=_(L);if(""===i.potentialName)continue;if(i.potentialName.endsWith("...")){k=i.potentialName.substring(0,i.potentialName.length-3),I=!0;continue}switch(k=i.name.length>0?i.name:k||"",i.field){case"C":s=new w("constant"),s.name=k||"*N",s.keywords=[...i.keywords],s.position={path:e,line:u-(I?1:0)},o.constants.push(s),g=!0;break;case"S":s=new w("variable"),s.name=k||"*N",s.keywords=[N(i),...i.keywords],s.position={path:e,line:u-(I?1:0)},o.variables.push(s),g=!0;break;case"DS":s=new w("struct"),s.name=k||"*N",s.keywords=i.keywords,s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},D(e,s),q="structs",o.structs.push(s),g=!0;break;case"PR":o.procedures.find((e=>e.name&&e.name.toUpperCase()===k.toUpperCase()))||(s=new w("procedure"),s.name=k||"*N",s.keywords=[N(i),...i.keywords],s.position={path:e,line:u-(I?1:0)},s.range={start:s.position.line,end:s.position.line},q="procedures",o.procedures.push(s),f=[]);break;case"PI":c&&(s=v[0].procedures.find((e=>e.name===c)),q="procedures",s&&s.keywords.push(N(i),...i.keywords));break;default:if(!s)switch(q){case"structs":case"procedures":let e;for(let t=v.length-1;t>=0&&(e=v[t],!(e[q].length>0));t--);s=e[q][e[q].length-1]}s&&(""===k&&(i.type||i.len)&&(k=""===k?`parm${s.subItems.length+1}`:k),k?(a=new w("subitem"),a.name=k,a.keywords=[N(i),...i.keywords],a.position={path:e,line:u},await D(e,a),a.keyword=O.expandKeywords(a.keywords),s.subItems.push(a),a=void 0,g=!0):s&&(s.subItems.length>0?s.subItems[s.subItems.length-1].keywords.push(N(i),...i.keywords):s.keywords.push(...i.keywords)),s.range.end=u)}k=void 0}}g&&(s&&(s.keyword=O.expandKeywords(s.keywords)),k=void 0,I=!1,s=void 0,i=void 0,f=[],m=[],g=!1)}}v.length>0&&(v[0].keyword=O.expandKeywords(R)),v[0].fixProcedures();const L=v[0];return this.parsedCache[e]=L,L}static expandKeywords(e){const t={};if(e.length>0){const n=D(C(e.join(" ")));for(let e=0;e<n.length;e++)n[e].value&&(n[e+1]&&"block"===n[e+1].type?(t[n[e].value.toUpperCase()]=n[e+1].block.map((e=>e.value)).join(""),e++):t[n[e].value.toUpperCase()]=!0)}return t}}const q=new t.TextDocuments(e),I=new O;function A(e,n){const r=e.getText().split("\n"),o=Math.min(r.length-1,Math.max(0,n.line)),i=r[o],s=Math.min(i.length-1,Math.max(0,n.character));let a=s;for(;a>0&&!/[\s\W]/.test(i.charAt(a-1));)a-=1;let c=s;for(;c<i.length&&!/[\s\W]/.test(i.charAt(c+1));)c+=1;return a===c?void 0:e.getText(t.Range.create(o,Math.max(0,a),o,c+1)).replace(/(\r\n|\n|\r)/gm,"")}var L;(()=>{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(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){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;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(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;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,s=i-o,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,u=s<c?s:c,l=-1,d=0;d<=u;++d){if(d===u){if(c>u){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>u&&(47===e.charCodeAt(o+d)?l=d:0===d&&(l=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(l=d)}var h="";for(d=o+l+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+l):(a+=l,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 u=e.charCodeAt(r);if(47===u){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===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,u=!0,l=e.length-1,d=0;l>=r;--l)if(47!==(o=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===o?-1===s?s=l:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){a=l+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}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}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={};(()=>{var e;if(n.r(r),n.d(r,{URI:()=>h,Utils:()=>k}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var o,i,s=(o=function(e,t){return o=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])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//,l="",d="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,h=function(){function t(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||l,this.authority=e.authority||l,this.path=e.path||l,this.query=e.query||l,this.fragment=e.fragment||l):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||l,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==d&&(t=d+t):t=d}return t}(this.scheme,n||l),this.query=r||l,this.fragment=o||l,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.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 t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),t.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=l),void 0===n?n=this.authority:null===n&&(n=l),void 0===r?r=this.path:null===r&&(r=l),void 0===o?o=this.query:null===o&&(o=l),void 0===i?i=this.fragment:null===i&&(i=l),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new m(t,n,r,o,i)},t.parse=function(e,t){void 0===t&&(t=!1);var n=p.exec(e);return n?new m(n[2]||l,w(n[4]||l),w(n[5]||l),w(n[7]||l),w(n[9]||l),t):new m(l,l,l,l,l)},t.file=function(t){var n=l;if(e&&(t=t.replace(/\\/g,d)),t[0]===d&&t[1]===d){var r=t.indexOf(d,2);-1===r?(n=t.substring(2),t=d):(n=t.substring(2,r),t=t.substring(r)||d)}return new m("file",n,t,l,l)},t.from=function(e){return new m(e.scheme,e.authority,e.path,e.query,e.fragment)},t.prototype.toString=function(e){return void 0===e&&(e=!1),R(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new m(e);return n._formatted=e.external,n._fsPath=e._sep===f?e.fsPath:null,n}return e},t}(),f=e?1:void 0,m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(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?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=f),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}(h),g=((i={})[58]="%3A",i[47]="%2F",i[63]="%3F",i[35]="%23",i[91]="%5B",i[93]="%5D",i[64]="%40",i[33]="%21",i[36]="%24",i[38]="%26",i[39]="%27",i[40]="%28",i[41]="%29",i[42]="%2A",i[43]="%2B",i[44]="%2C",i[59]="%3B",i[61]="%3D",i[32]="%20",i);function y(e,t){for(var n=void 0,r=-1,o=0;o<e.length;o++){var i=e.charCodeAt(o);if(i>=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=g[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;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=g[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function b(t,n){var r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function R(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+=d,r+=d),i){var u=i.indexOf("@");if(-1!==u){var l=i.substr(0,u);i=i.substr(u+1),-1===(u=l.indexOf(":"))?r+=n(l,!1):(r+=n(l.substr(0,u),!1),r+=":",r+=n(l.substr(u+1),!1)),r+="@"}-1===(u=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,u),!1),r+=i.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(p=s.charCodeAt(1))>=65&&p<=90&&(s="/".concat(String.fromCharCode(p+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var p;(p=s.charCodeAt(0))>=65&&p<=90&&(s="".concat(String.fromCharCode(p+32),":").concat(s.substr(2)))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function C(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+C(e.substr(3)):e}}var D=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function w(e){return e.match(D)?e.replace(D,(function(e){return C(e)})):e}var k,T=n(470),S=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},E=T.posix||T,P="/";!function(e){e.joinPath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.with({path:E.join.apply(E,S([e.path],t,!1))})},e.resolvePath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.path,o=!1;r[0]!==P&&(r=P+r,o=!0);var i=E.resolve.apply(E,S([r],t,!1));return o&&i[0]===P&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===P)return e;var t=E.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return E.basename(e.path)},e.extname=function(e){return E.extname(e.path)}}(k||(k={}))})(),L=r})();const{URI:M,Utils:j}=L,F=[{name:"printf",type:"function",insertText:"printf(${1:value})$0",detail:"int(10)",description:"Print to standard out",prototype:["///","// printf","// Print to standard out","// @param String value pointer","///","dcl-pr printf int(10) extproc('printf');"," format pointer value options(*string);","end-pr;"],example:["**free","dcl-s outtext varchar(50);","outtext = 'Hello world'","printf(outtext + '\\n');"]},{name:"Qp0zLprintf",type:"function",insertText:"Qp0zLprintf(${1:value})$0",detail:"int(10)",description:"Prints user data specified by format-string as an information message type to the job log.",prototype:["///","// Qp0zLprintf","// Prints user data specified by format-string as","// an information message type to the job log.","// To ensure messages are written to the job log, always","// use a new line (\\n) at the end of each format-string.","// @param format-string","///","dcl-pr Qp0zLprintf int(10) extproc('Qp0zLprintf');"," format pointer value options(*string);","end-pr;"]},{name:"system",type:"function",insertText:"system(${1:value})$0",detail:"int(10)",description:"Execute an ILE command",prototype:["///","// system","// Execute an ILE command","// @param The command as string pointer","///","dcl-pr system int(10) extproc('system');"," command pointer value options(*string);","end-pr;"]},{name:"QzshSystem",type:"function",insertText:"QzshSystem(${1:value})$0",detail:"int(10)",description:"Runs the specified shell command by spawning a child process and invoking qsh",prototype:["///","// QzshSystem","// Runs the specified shell command by","// spawning a child process and invoking qsh","// @param The command as string pointer","///","dcl-pr QzshSystem int(10) extproc('QzshSystem');"," command pointer value options(*string);","end-pr;"]},{name:"getenv",type:"function",insertText:"getenv(${1:'ENVVAR'})$0",detail:"pointer",description:"Searches the job-level environment list for a string",prototype:["///","// getenv","// Searches the job-level environment list for a string","// @param Environment variable name","///","dcl-pr getenv pointer extproc('getenv');"," name pointer value options(*string:*trim);","end-pr;"],example:["**free","dcl-s EnvVarValue char(500);","EnvVarValue = %str(getenv('ENVVAR'));"]},{name:"putenv",type:"function",insertText:"putenv(${1:'ENVVAR=value'})$0",detail:"int(10)",description:"Creates or changes an environment variable",prototype:["///","// putenv","// Creates or changes an environment variable","// @param Environment variable name and value","///","dcl-pr putenv pointer extproc('putenv');"," change pointer value options(*string:*trim);","end-pr;"],example:["**free","dcl-s EnvVarValue char(500);","EnvVarValue = 'Some value to store';","putenv('ENVVAR=' + EnvVarValue);"]},{name:"QUSCRTUS",type:"function",insertText:"QUSCRTUS(\n ${1:'NAME LIB'}:\n ${2:'LOG'}:\n ${3:size}:\n ${4:'*ALL'}:\n ${5:'New object'}\n);$0",detail:"void",description:"Create User Space",prototype:["///","// QUSCRTUS","// Create User Space","///","dcl-pr QUSCRTUS extpgm('QUSCRTUS');"," qualifiedName char(20) const;"," extendedAtribute char(10) const;"," initialSize int(10) const;"," initialValue char(1) const;"," publicAuthority char(10) const;"," description char(50) const;"," // optional parm group 1"," UsrSpcRepl char(10) const options(*nopass);"," UsrSpcErrC likeds(ApiErrC) options(*nopass: *varsize);"," // optional parm group 2"," UsrSpcDomn char(10) const options(*nopass);"," // optional parm group 3"," UsrSpcReqS int(10) const options(*nopass);"," UsrSpcOptA char(1) const options(*nopass);","end-pr;"]},{name:"QUSDLTUS",type:"function",insertText:"QUSDLTUS(${1:'NAME LIB'}:${2:APIERRC});",detail:"void",description:"Delete User Space",prototype:["///","// QUSDLTUS","// Delete User Space","///","dcl-pr QUSDLTUS extpgm('QUSDLTUS');"," qualifiedName char(20) const;"," errorResponse likeds(APIERRC_T) options(*varsize);","end-pr;"]},{name:"APIERRC_T",type:"struct",insertText:"APIERRC_T",detail:"ERRC0100 format",description:"Error data structure",prototype:["///","// APPERRC template","// Used for error capturing","///","dcl-ds APIERRC_T Qualified Template;"," bytesProvided Int(10:0); // Inz(%size(ApiErrC))"," bytesAvailable Int(10:0);"," exceptionID Char(7);"," reserved Char(1);"," exceptionData Char(3000);","end-ds;"],example:["**free","dcl-ds apierrc likeds(APIERRC_T);","apierrc.bytesProvided = %size(apierrc);"]},{name:"QCMDEXC",type:"function",description:"Execute a system command",detail:"void",insertText:"QCMDEXC(\n ${1:commandString}:\n ${2:commandLength}\n)$0",prototype:["///","// QCMDEXC","// Execute a system command","///","Dcl-Pr QCMDEXC EXTPGM('QCMDEXC');"," commandString CHAR(32702) CONST OPTIONS(*VARSIZE);"," commandLength PACKED(15:5) CONST;","End-Pr;"]},{name:"QCLRDTAQ",type:"function",description:"Clear data queue",detail:"void",insertText:"QCLRDTAQ(\n ${1:dqName}:\n ${2:dqLibrary}:\n ${3:keyOrder}:\n ${4:keyDataLength}:\n ${5:keyData}:\n ${6:prErrCode}\n)$0",prototype:["///","// QCLRDTAQ","// Clear data queue","///","Dcl-Pr QCLRDTAQ EXTPGM('QCLRDTAQ');"," dqName CHAR(10) CONST;"," dqLibrary CHAR(10) CONST;"," keyOrder CHAR(2) CONST OPTIONS(*NOPASS);"," keyDataLength PACKED(3:0) CONST OPTIONS(*NOPASS);"," keyData CHAR(256) CONST OPTIONS(*NOPASS:*VARSIZE);"," prErrCode LIKEDS(APIERRC_T) OPTIONS(*NOPASS:*VARSIZE);","End-Pr;"]},{name:"QSNDDTAQ",type:"function",description:"Send to data queue",detail:"void",insertText:"QSNDDTAQ(\n ${1:dqName}:\n ${2:dqLibrary}:\n ${3:dataInLen}:\n ${4:dataIn}:\n ${5:keyDataLength}:\n ${6:keyData}:\n ${7:asyncRequest}:\n ${8:isJourneyEntry}\n)$0",prototype:["///","// QSNDDTAQ","// Send to data queue","///","Dcl-Pr QSNDDTAQ EXTPGM('QSNDDTAQ');"," dqName CHAR(10) CONST;"," dqLibrary CHAR(10) CONST;"," dataInLen PACKED(5:0);"," dataIn CHAR(65535) OPTIONS(*VARSIZE);"," keyDataLength PACKED(3:0) CONST OPTIONS(*NOPASS);"," keyData CHAR(256) CONST OPTIONS(*NOPASS:*VARSIZE);"," asyncRequest CHAR(10) CONST OPTIONS(*NOPASS);"," isJourneyEntry CHAR(10) CONST OPTIONS(*NOPASS);","End-Pr;"]},{name:"memcpy",type:"function",description:"",detail:"void",insertText:"memcpy(\n ${1:target}:\n ${2:source}:\n ${3:length}\n)$0",prototype:["///","// memcpy","// API","///","dcl-pr memcpy EXTPROC('__MEMCPY');"," target POINTER VALUE;"," source POINTER VALUE;"," length UNS(10) VALUE;","end-pr;"]},{name:"QRCVDTAQ",type:"function",description:"",detail:"void",insertText:"QRCVDTAQ(\n ${1:Object}:\n ${2:Library}:\n ${3:DataLen}:\n ${4:Data}:\n ${5:WaitTime}:\n ${6:KeyOrder}:\n ${7:KeyLen}:\n ${8:Key}\n)$0",prototype:["///","// QRCVDTAQ","// API","///","dcl-pr QRCVDTAQ EXTPGM('QRCVDTAQ');"," Object CHAR(10);"," Library CHAR(10);"," DataLen PACKED(5);"," Data CHAR(DQ_LEN);"," WaitTime PACKED(5);"," KeyOrder CHAR(2) OPTIONS(*NOPASS);"," KeyLen PACKED(3) OPTIONS(*NOPASS);"," Key POINTER OPTIONS(*NOPASS);","end-pr;"]},{name:"RSLVSP2",type:"function",description:"Get library pointer",detail:"void",insertText:"RSLVSP2(\n ${1:objectResult}:\n ${2:rslvsp_in}\n)$0",prototype:["///","// RSLVSP2","// Get library pointer","// @param Resulting pointer by reference","// @param Struct rslvsp_t","///","dcl-pr RSLVSP2 EXTPROC('_RSLVSP2');"," objectResult POINTER;"," rslvsp_in LIKEDS(RSLVSP_T) QUALIFIED;","end-pr;"]},{name:"RSLVSP4",type:"function",description:"Get object pointer",detail:"void",insertText:"RSLVSP4(\n ${1:objectResult}:\n ${2:rslvsp_in}:\n ${3:libraryPointer}\n)$0",prototype:["///","// RSLVSP4","// Get object pointer","// @param Resulting pointer by reference","// @param Struct rslvsp_t","// @param Library pointer from RSLVSP2","///","dcl-pr RSLVSP4 EXTPROC('_RSLVSP4');"," objectResult POINTER;"," rslvsp_in CHAR(34);"," libraryPointer POINTER;","end-pr;"]},{name:"QleActBndPgmLong",type:"function",description:"Activate service program",detail:"INT(20)",insertText:"QleActBndPgmLong(\n ${1:serviceProgram}\n)$0",prototype:["///","// QleActBndPgmLong","// Activate service program","// @param Pointer to service program from RSLVSP4","///","dcl-pr QleActBndPgmLong INT(20) EXTPROC('QLEACTBNDPGMLONG');"," serviceProgram POINTER;","end-pr;"]},{name:"RetrieveFunctionPointer",type:"function",description:"Retrieve function pointer",detail:"POINTER",insertText:"RetrieveFunctionPointer(\n ${1:Mark}:\n ${2:ExportNum}:\n ${3:ExportNameLen}:\n ${4:ExportName}:\n ${5:rFuncPointer}:\n ${6:rFuncResult}\n)$0",prototype:["///","// RetrieveFunctionPointer","// Retrieve function pointer","// @param Value from QleActBndPgmLong","// @param Export number.","// @param Export name length","// @param Export name","// @param Resulting function pointer","// @param Resulting status code","///","dcl-pr RetrieveFunctionPointer POINTER EXTPROC('QLEGETEXPLONG');"," Mark INT(20);"," ///"," // @value 0 (zero is valid)"," ///"," ExportNum INT(10) VALUE;"," ExportNameLen INT(10);"," ExportName POINTER VALUE OPTIONS(*STRING);"," rFuncPointer POINTER;"," rFuncResult INT(10);","end-pr;"]},{name:"callpgmv",type:"function",description:"",detail:"void",insertText:"callpgmv(\n ${1:pgm_ptr}:\n ${2:argv}:\n ${3:argc}\n)$0",prototype:["///","// callpgmv","// API","///","dcl-pr callpgmv EXTPROC('_CALLPGMV');"," pgm_ptr POINTER;"," argv POINTER DIM(256);"," argc UNS(10) VALUE;","end-pr;"]},{name:"rslvsp_t",type:"struct",description:"Resolve object pointer struct",detail:"QUALIFIED TEMPLATE",insertText:"rslvsp_t",prototype:["///","// rslvsp_t","// Resolve object struct","///","dcl-ds rslvsp_t QUALIFIED TEMPLATE;"," ///"," // @value x'0401' Library"," // @value x'0201' Program"," // @value x'0203' Service Program"," ///"," Obj_Type CHAR(2);"," Obj_Name CHAR(30);"," Auth CHAR(2) INZ(X'0000');","end-ds;"]}],U=o.CompletionItem.create("@rpglint-skip");U.kind=o.CompletionItemKind.Snippet,U.detail="The next line will skip rules and indentation checking.";const W=o.CompletionItem.create("@rpglint-skip-indent");W.kind=o.CompletionItemKind.Snippet,W.detail="The next line will skip indentation checking.";const $=o.CompletionItem.create("@rpglint-skip-rules");$.kind=o.CompletionItemKind.Snippet,$.detail="The next line will skip rules checking.";const H=[U,W,$],V=require("fs/promises");var K=n(6729);class B extends Error{constructor(e){super(e),this.name="TimeoutError"}}class z extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const Q=e=>void 0===globalThis.DOMException?new z(e):new DOMException(e),G=e=>{const t=void 0===e.reason?Q("This operation was aborted."):e.reason;return t instanceof Error?t:Q(t)};var X,J=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class Y{constructor(){X.set(this,[])}enqueue(e,t){const n={priority:(t={priority:0,...t}).priority,run:e};if(this.size&&J(this,X,"f")[this.size-1].priority>=t.priority)return void J(this,X,"f").push(n);const r=function(e,t,n){let r=0,o=e.length;for(;o>0;){const n=Math.trunc(o/2);let s=r+n;i=e[s],t.priority-i.priority<=0?(r=++s,o-=n+1):o=n}var i;return r}(J(this,X,"f"),n);J(this,X,"f").splice(r,0,n)}dequeue(){const e=J(this,X,"f").shift();return null==e?void 0:e.run}filter(e){return J(this,X,"f").filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return J(this,X,"f").length}}X=new WeakMap;var Z,ee,te,ne,re,oe,ie,se,ae,ce,ue,le,de,pe,he,fe,me,ge,ye,ve,be,Re,Ce,De,we,ke,Te=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},Se=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class Ee extends Error{}ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,oe=new WeakMap,ie=new WeakMap,se=new WeakMap,ae=new WeakMap,ce=new WeakMap,ue=new WeakMap,le=new WeakMap,de=new WeakMap,pe=new WeakMap,he=new WeakMap,Z=new WeakSet,fe=function(){return Se(this,te,"f")||Se(this,ne,"f")<Se(this,re,"f")},me=function(){return Se(this,le,"f")<Se(this,de,"f")},ge=function(){var e;Te(this,le,(e=Se(this,le,"f"),--e),"f"),Se(this,Z,"m",be).call(this),this.emit("next")},ye=function(){Se(this,Z,"m",Ce).call(this),Se(this,Z,"m",Re).call(this),Te(this,ae,void 0,"f")},ve=function(){const e=Date.now();if(void 0===Se(this,se,"f")){const t=Se(this,ie,"f")-e;if(!(t<0))return void 0===Se(this,ae,"f")&&Te(this,ae,setTimeout((()=>{Se(this,Z,"m",ye).call(this)}),t),"f"),!0;Te(this,ne,Se(this,ee,"f")?Se(this,le,"f"):0,"f")}return!1},be=function(){if(0===Se(this,ce,"f").size)return Se(this,se,"f")&&clearInterval(Se(this,se,"f")),Te(this,se,void 0,"f"),this.emit("empty"),0===Se(this,le,"f")&&this.emit("idle"),!1;if(!Se(this,pe,"f")){const e=!Se(this,Z,"a",ve);if(Se(this,Z,"a",fe)&&Se(this,Z,"a",me)){const t=Se(this,ce,"f").dequeue();return!!t&&(this.emit("active"),t(),e&&Se(this,Z,"m",Re).call(this),!0)}}return!1},Re=function(){Se(this,te,"f")||void 0!==Se(this,se,"f")||(Te(this,se,setInterval((()=>{Se(this,Z,"m",Ce).call(this)}),Se(this,oe,"f")),"f"),Te(this,ie,Date.now()+Se(this,oe,"f"),"f"))},Ce=function(){0===Se(this,ne,"f")&&0===Se(this,le,"f")&&Se(this,se,"f")&&(clearInterval(Se(this,se,"f")),Te(this,se,void 0,"f")),Te(this,ne,Se(this,ee,"f")?Se(this,le,"f"):0,"f"),Se(this,Z,"m",De).call(this)},De=function(){for(;Se(this,Z,"m",be).call(this););},we=async function(e){return new Promise(((t,n)=>{e.addEventListener("abort",(()=>{n(new Ee("The task was aborted."))}),{once:!0})}))},ke=async function(e,t){return new Promise((n=>{const r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)}))};var Pe=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const _e=(0,t.createConnection)(t.ProposedFeatures.all),xe=new class extends K{constructor(e){var t,n,r,o;if(super(),Z.add(this),ee.set(this,void 0),te.set(this,void 0),ne.set(this,0),re.set(this,void 0),oe.set(this,void 0),ie.set(this,0),se.set(this,void 0),ae.set(this,void 0),ce.set(this,void 0),ue.set(this,void 0),le.set(this,0),de.set(this,void 0),pe.set(this,void 0),he.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Y,...e}).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(n=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==n?n:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(o=null===(r=e.interval)||void 0===r?void 0:r.toString())&&void 0!==o?o:""}\` (${typeof e.interval})`);Te(this,ee,e.carryoverConcurrencyCount,"f"),Te(this,te,e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,"f"),Te(this,re,e.intervalCap,"f"),Te(this,oe,e.interval,"f"),Te(this,ce,new e.queueClass,"f"),Te(this,ue,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Te(this,he,!0===e.throwOnTimeout,"f"),Te(this,pe,!1===e.autoStart,"f")}get concurrency(){return Se(this,de,"f")}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Te(this,de,e,"f"),Se(this,Z,"m",De).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:Se(this,he,"f"),...t},new Promise(((n,r)=>{Se(this,ce,"f").enqueue((async()=>{var o,i,s;Te(this,le,(i=Se(this,le,"f"),++i),"f"),Te(this,ne,(s=Se(this,ne,"f"),++s),"f");try{if(null===(o=t.signal)||void 0===o?void 0:o.aborted)throw new Ee("The task was aborted.");let r=e({signal:t.signal});t.timeout&&(r=function(e,t,n,r){let o;const i=new Promise(((i,s)=>{if("number"!=typeof t||1!==Math.sign(t))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t!==Number.POSITIVE_INFINITY){if((r={customTimers:{setTimeout,clearTimeout},...r}).signal){const{signal:e}=r;e.aborted&&s(G(e)),e.addEventListener("abort",(()=>{s(G(e))}))}o=r.customTimers.setTimeout.call(void 0,(()=>{const r=n instanceof Error?n:new B(`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),s(r)}),t),(async()=>{try{i(await e)}catch(e){s(e)}finally{r.customTimers.clearTimeout.call(void 0,o)}})()}else i(e)}));return i.clear=()=>{clearTimeout(o),o=void 0},i}(Promise.resolve(r),t.timeout)),t.signal&&(r=Promise.race([r,Se(this,Z,"m",we).call(this,t.signal)]));const i=await r;n(i),this.emit("completed",i)}catch(e){if(e instanceof B&&!t.throwOnTimeout)return void n();r(e),this.emit("error",e)}finally{Se(this,Z,"m",ge).call(this)}}),t),this.emit("add"),Se(this,Z,"m",be).call(this)}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return Se(this,pe,"f")?(Te(this,pe,!1,"f"),Se(this,Z,"m",De).call(this),this):this}pause(){Te(this,pe,!0,"f")}clear(){Te(this,ce,new(Se(this,ue,"f")),"f")}async onEmpty(){0!==Se(this,ce,"f").size&&await Se(this,Z,"m",ke).call(this,"empty")}async onSizeLessThan(e){Se(this,ce,"f").size<e||await Se(this,Z,"m",ke).call(this,"next",(()=>Se(this,ce,"f").size<e))}async onIdle(){0===Se(this,le,"f")&&0===Se(this,ce,"f").size||await Se(this,Z,"m",ke).call(this,"idle")}get size(){return Se(this,ce,"f").size}sizeBy(e){return Se(this,ce,"f").filter(e).length}get pending(){return Se(this,le,"f")}get isPaused(){return Se(this,pe,"f")}};let Ne=[];function Oe(e,t=""){return Pe(this,null,(function*(){const n=function(e,t=""){return q.keys().find((n=>n.includes(e)&&n.startsWith(`${t}:`)))}(e,t);if(n)return n;console.log(`Validating file from server: ${e}`);return(yield _e.sendRequest("getUri",e))||void 0}))}function qe(e){return Pe(this,null,(function*(){const t=q.get(e);if(t)return t.getText();console.log(`Fetching file from server: ${e}`);return(yield _e.sendRequest("getFile",e))||void 0}))}_e.onDidChangeWatchedFiles((e=>{Ne.forEach((t=>t(e)))}));let Ie={},Ae={};function Le(e,t){return Pe(this,null,(function*(){const n=t.join("-");if(Ae[e]&&Ae[e][n])return Ae[e][n];const r=yield Me(e),o=(r?et[r.uri]:[])||[],i=yield xe.add((()=>_e.sendRequest("streamfileResolve",[t,o])));return i&&(Ae[e]||(Ae[e]={}),Ae[e][n]=i),i}))}function Me(e){return Pe(this,null,(function*(){let t;const n=yield _e.workspace.getWorkspaceFolders();return n&&(t=n.find((t=>e.startsWith(t.uri)))),t}))}const je=["ACQ1","BEGSR","CALLP","CHAIN","CLEAR","CLOSE","COMMIT","DATA","DATA","DEALLOC","DELETE","DOU","DOW","DSPLY","DUMP1","ELSE","ELSEIF","ENDDO","ENDFOR","ENDIF","ENDMON","ENDSL","ENDSR","EVAL","EVALR","EVAL","EXCEPT","EXFMT","EXSR","FEOD","FOR","FORCE","IF","IN","ITER","LEAVE","LEAVESR","MONITOR","NEXT1","ON","OPEN","OTHER","OUT1","POST","READ","READC","READE","READP","READPE","REL","RESET","RETURN","ROLBK","SELECT","SETGT","SETLL","SORTA","TEST","UNLOCK","UPDATE","WHEN","WRITE","XML"];class Fe{constructor(e,t,n=0){this.tokens=e,this.range=t,this.indent=n,this.beginBlock=!1}getTokenByOffset(e){const t=n=>{const r=n.find((t=>e>=t.range.start&&e<=t.range.end));return"block"===(null==r?void 0:r.type)&&r.block?t(r.block):r};return t(this.tokens)}asBlocks(){return D(this.tokens)}static getParameters(e){let t=[],n=[];for(let r=0;r<e.length;r++)"seperator"===e[r].type?(t.push({type:"block",block:n,range:{line:n[0].range.line,start:n[0].range.start,end:n[n.length-1].range.end}}),n=[e[r]]):n.push(e[r]);return n.length>0&&t.push({type:"block",block:n,range:{line:n[0].range.line,start:n[0].range.start,end:n[n.length-1].range.end}}),t}static trimTokens(e){if(e.length>0){let t=e.findIndex((e=>"newline"!==e.type));t<0&&(t=0);let n=0;for(let t=e.length-1;t>=0;t--)if("newline"!==e[t].type){n=t+1;break}e=e.slice(t,n)}return e}}class Ue{constructor(e){this.statements=[],this.parseStatements(C(e))}addStatement(e,t){t.length>0&&this.statements.push(new Fe(t,{line:t[0].range.line,start:t[0].range.start,end:t[t.length-1].range.end},e))}parseStatements(e){let t,n="Normal",r={need:!0,index:-1},o={index:0};for(let i=0;i<e.length;i++)switch(e[i].type){case"semicolon":const s=Fe.trimTokens(e.slice(o.index,i));t=e[r.index];const a=s[0]&&t?s[0].range.start-t.range.end:0;r.need=!0,this.addStatement(a,s),o={index:i+1};break;case"format":const c=Fe.trimTokens(e.slice(o.index,i+1));if(1===c.length){t=e[r.index];const n=c[0]&&t?c[0].range.start-t.range.end:0;r.need=!0,this.addStatement(n,c),o={index:i+1}}break;case"comment":const u=Fe.trimTokens(e.slice(o.index,i+1));if(1===u.length){if(e[i-1]&&e[i-1].range.line!==u[0].range.line){t=e[r.index];const n=u[0]&&t?u[0].range.start-t.range.end:0;r.need=!0,this.addStatement(n,u)}o={index:i+1}}break;case"directive":"directive"===Fe.trimTokens(e.slice(o.index,i+1))[0].type&&(n="Directive");break;case"newline":if("Directive"===n){const s=Fe.trimTokens(e.slice(o.index,i));t=e[r.index];const a=s[0]&&t?s[0].range.start-t.range.end:0;this.addStatement(a,s),r.need=!0,o={index:i+1},n="Normal"}(r.need||e[i-1]&&"newline"===e[i-1].type)&&(r.index=i,r.need=!1)}const i=Fe.trimTokens(e.slice(o.index,e.length));if(i.length>0){t=e[r.index];const n=i[0]?i[0].range.start-t.range.end:0;this.addStatement(n,i)}}getStatementByLine(e){return this.statements.find((t=>t.range.line===e))}getStatementByOffset(e){return this.statements.find(((t,n)=>{const r=this.statements[n+1]?this.statements[n+1].range.start:t.range.end;return e>=t.range.start&&e<r||n===this.statements.length-1&&e>=r}))}getTokenByOffset(e){const t=this.getStatementByOffset(e);if(t)return t.getTokenByOffset(e)}}var We=Object.defineProperty,$e=Object.defineProperties,He=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,ze=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Qe={BlankStructNamesCheck:"Struct names cannot be blank (`*N`).",QualifiedCheck:"Struct names must be qualified (`QUALIFIED`).",PrototypeCheck:"Prototypes can only be defined with either `EXTPGM` or `EXTPROC`",ForceOptionalParens:"Expressions must be surrounded by brackets.",NoOCCURS:"`OCCURS` is not allowed.",NoSELECTAll:"`SELECT *` is not allowed in Embedded SQL.",UselessOperationCheck:"Redundant operation codes (EVAL, CALLP, DCL-PARM, DCL-SUBF) not allowed.",UppercaseConstants:"Constants must be in uppercase.",SpecificCasing:"Does not match required case.",InvalidDeclareNumber:"Variable names cannot start with a number",IncorrectVariableCase:"Variable name casing does not match definition.",RequiresParameter:"Procedure calls require brackets.",RequiresProcedureDescription:"Procedures require a title and description.",StringLiteralDupe:"Same string literal used more than once. Consider using a constant instead.",RequireBlankSpecial:"`*BLANK` should be used over empty string literals.",CopybookDirective:"Directive does not match requirement.",UppercaseDirectives:"Directives must be in uppercase.",NoSQLJoins:"SQL joins are not allowed. Consider creating a view instead.",NoGlobalsInProcedures:"Global variables should not be referenced in procedures.",NoCTDATA:"`CTDATA` is not allowed.",PrettyComments:"Comments must be correctly formatted.",NoGlobalSubroutines:"Subroutines should not be defined in the global scope.",NoLocalSubroutines:"Subroutines should not be defined in procedures.",UnexpectedEnd:"Statement unexpected. Likely missing the equivalent `DCL..`/`BEG..`",NoUnreferenced:"No reference to definition.",NoExternalTo:"Cannot declare prototype to this external API.",NoExecuteImmediate:"EXECUTE IMMEDIATE is not allowed.",NoExtProgramVariable:"Not allowed to use variable in EXTPGM or EXTPROC.",IncludeMustBeRelative:"Path not valid. It must be relative to the project.",SQLHostVarCheck:"Also defined in scope. Should likely be host variable.",RequireOtherBlock:"OTHER block missing from SELECT block."},Ge={none:0,single:1,singleIndent:2,singleRules:3};class Xe{static getErrorText(e){return Qe[e]}static getErrors(e,t,n){const r=void 0!==t.indent,o=t.indent||2,i=Object.keys(t).length-(t.indent?1:0);n||(n=new T);const s=n.procedures;let a=!1,c=!1,u=0,l=!1,d=!1,p=-1;const h=[],f=[];let m,g=0,y=0,v=!1;t.NoUnreferenced&&(t.CollectReferences=!0),t.CollectReferences&&n.clearReferences(),t.NoExternalTo&&t.NoExternalTo.length&&(t.NoExternalTo=t.NoExternalTo.map((e=>e.toUpperCase())));const b=[],R=[];let C=0,D=Ge.none;const w=new Ue(e.content);for(let k=0;k<w.statements.length;k++){const T=w.statements[k],E=T.tokens;if(p=T.range.line,y=T.indent,y>=0){if(v=!1,"comment"===E[0].type){const e=E[0].value.substring(2).trimEnd();switch(t.PrettyComments?e&&"/"!==e[0]&&0===e.search(/\S/)&&f.push({offset:{position:E[0].range.start,end:E[0].range.start+2},type:"PrettyComments",newValue:"// "}):v=!0,e.trim()){case"@rpglint-skip":D=Ge.single;continue;case"@rpglint-skip-indent":D=Ge.singleIndent;continue;case"@rpglint-skip-rules":D=Ge.singleRules;continue}}if(i>0&&![Ge.single,Ge.singleRules].includes(D)){const r=n.procedures.find((e=>p>=e.range.start&&p<=e.range.end)),o=n.merge(a&&r?r.scope:void 0),i=t.IncorrectVariableCase||t.SQLHostVarCheck?o.getNames():[];let d,h,m=!1;if(E.length>=1){if("directive"===E[0].type){const e=E[0].value.toUpperCase();if("/EOF"===e&&0===C)break;"/IF"===e?C+=1:"/ENDIF"===e&&(C-=1)}switch(E[0].type){case"format":p>0&&E[0].value.startsWith("**")&&t.NoCTDATA&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoCTDATA"});break;case"directive":if(d=E[0].value,t.UppercaseDirectives&&d!==d.toUpperCase()&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UppercaseDirectives",newValue:d.toUpperCase()}),(t.CopybookDirective||t.IncludeMustBeRelative)&&["/COPY","/INCLUDE"].includes(d.toUpperCase())){if(t.IncludeMustBeRelative)if(2===E.length){const t=E[1];if("word"===t.type){const n=t.value.substring(1,t.value.length-1).trim().toUpperCase(),r=e.availableIncludes&&e.availableIncludes.length>0?e.availableIncludes.find((e=>e.toUpperCase().includes(n.toUpperCase()))):void 0;f.push({offset:{position:t.range.start,end:t.range.end+t.value.length},type:"IncludeMustBeRelative",newValue:r?`'${r}'`:void 0})}else if("string"===t.type){const n=t.value.substring(1,t.value.length-1).trim();if(!0===n.startsWith("/"))f.push({offset:{position:t.range.start,end:t.range.end},type:"IncludeMustBeRelative"});else if(e.availableIncludes&&e.availableIncludes.length>0){const r=e.availableIncludes.find((e=>e.toUpperCase().includes(n.toUpperCase())));r&&n!==r&&f.push({offset:{position:t.range.start,end:t.range.end},type:"IncludeMustBeRelative",newValue:`'${r}'`})}}}else if(4===E.length&&"comma"===E[2].type){if(e.availableIncludes&&e.availableIncludes.length>0){const t=`${E[1].value}/${E[3].value}`.toUpperCase(),n=e.availableIncludes.find((e=>e.toUpperCase().includes(t)));n&&t!==n&&f.push({offset:{position:E[1].range.start,end:E[3].range.end},type:"IncludeMustBeRelative",newValue:`'${n}'`})}}else f.push({type:"IncludeMustBeRelative",offset:{position:E[0].range.start,end:E[E.length-1].range.end}});if(t.CopybookDirective){const e=`/${t.CopybookDirective.toUpperCase()}`;d.toUpperCase()!==e&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"CopybookDirective",newValue:e})}}break;case"declare":if(E.length<2)break;if(t.SpecificCasing){const e=t.SpecificCasing.find((e=>[E[0].value.toUpperCase(),"*DECLARE"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d=E[1].value,d.match(/^\d/)&&f.push({offset:{position:E[1].range.start,end:E[1].range.end},type:"InvalidDeclareNumber"}),E[0].value.toUpperCase()){case"BEGSR":c&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),c=!0,a?t.NoLocalSubroutines&&f.push({type:"NoLocalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}):t.NoGlobalSubroutines&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoGlobalSubroutines",newValue:"Dcl-Proc"});break;case"DCL-PROC":if((c||a)&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),a=!0,E.length<2)break;if(t.RequiresProcedureDescription){d=E[1].value;const e=s.find((e=>e.name.toUpperCase()===d.toUpperCase()));e&&(e.description||f.push({type:"RequiresProcedureDescription",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}))}break;case"DCL-C":if(t.UppercaseConstants&&d!==d.toUpperCase()&&f.push({offset:{position:E[1].range.start,end:E[1].range.end},type:"UppercaseConstants",newValue:d.toUpperCase()}),t.StringLiteralDupe&&"string"===E[2].type){let e=R.find((e=>e.value===E[2].value));e||(e={definition:d,value:E[2].value,list:[]},R.push(e))}break;case"DCL-PI":E.some((e=>"end"===e.type))||(l=!0);break;case"DCL-PR":if(l=!0,t.PrototypeCheck||t.NoExtProgramVariable){const e=E.findIndex((e=>e.value&&["EXTPGM","EXTPROC"].includes(e.value.toUpperCase())));if(e>=0){if(t.NoExtProgramVariable){const t=E.find(((t,n)=>n>e&&"word"===t.type));t&&f.push({offset:{position:t.range.start,end:t.range.end},type:"NoExtProgramVariable"})}}else t.PrototypeCheck&&f.push({type:"PrototypeCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}break;case"DCL-DS":u+=1,t.NoOCCURS&&E.some((e=>e.value&&"OCCURS"===e.value.toUpperCase()))&&f.push({type:"NoOCCURS",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.QualifiedCheck&&(E.some((e=>e.value&&["LIKEDS","LIKEREC","QUALIFIED"].includes(e.value.toUpperCase())))||f.push({type:"QualifiedCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})),t.BlankStructNamesCheck&&E.some((e=>"special"===e.type&&"*N"===e.value.toUpperCase()))&&f.push({type:"BlankStructNamesCheck",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.NoCTDATA&&E.some((e=>["CTDATA","*CTDATA"].includes(e.value.toUpperCase())))&&f.push({type:"NoCTDATA",offset:{position:E[0].range.start,end:E[E.length-1].range.end}});break;case"DCL-SUBF":case"DCL-PARM":if(t.UselessOperationCheck&&E[1]&&E[1].value){const e=E[1].value.toUpperCase();je.includes(e)||f.push({offset:{position:E[0].range.start,end:E[0].range.end+1},type:"UselessOperationCheck"})}}break;case"end":if(d=E[0].value.toUpperCase(),t.SpecificCasing){const e=t.SpecificCasing.find((e=>[d,"*DECLARE"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d){case"ENDSR":c?c=!1:f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),!1===a&&t.NoGlobalSubroutines&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"NoGlobalSubroutines",newValue:"End-Proc"});break;case"END-DS":u-=1;break;case"END-PROC":(!1===a||c)&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),a=!1;break;case"END-PR":case"END-PI":!1===l&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"UnexpectedEnd"}),l=!1}break;case"word":if(d=E[0].value.toUpperCase(),t.SpecificCasing){const e=t.SpecificCasing.find((e=>d===e.operation.toUpperCase()));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=E[0].value.toUpperCase();break;case"*LOWER":t=E[0].value.toLowerCase()}E[0].value!==t&&f.push({offset:{position:E[0].range.start,end:E[0].range.end},type:"SpecificCasing",newValue:t})}}switch(d.toUpperCase()){case"EVAL":case"CALLP":E[1]&&"openbracket"!==E[1].type&&t.UselessOperationCheck&&f.push({offset:{position:E[0].range.start,end:E[0].range.end+1},type:"UselessOperationCheck"});break;case"LEAVESR":t.NoGlobalSubroutines&&!a&&f.push({type:"NoGlobalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end},newValue:"return"});break;case"EXSR":t.NoGlobalSubroutines&&2===E.length&&n.subroutines.find((e=>e.name.toUpperCase()===E[1].value.toUpperCase()))&&f.push({type:"NoGlobalSubroutines",offset:{position:E[0].range.start,end:E[E.length-1].range.end},newValue:`${E[1].value}()`});break;case"EXEC":if(m=!0,t.NoSELECTAll){const e=E.findIndex((e=>e.value&&"SELECT"===e.value.toUpperCase())),t=E.findIndex((e=>e.value&&"*"===e.value));e>=0&&e+1===t&&f.push({offset:{position:E[0].range.start,end:E[E.length-1].range.end},type:"NoSELECTAll"})}if(t.NoSQLJoins&&E.some((e=>e.value&&"JOIN"===e.value.toUpperCase()))&&f.push({type:"NoSQLJoins",offset:{position:E[0].range.start,end:E[E.length-1].range.end}}),t.NoExecuteImmediate){const e=E.findIndex((e=>e.value&&"EXECUTE"===e.value.toUpperCase())),t=E.findIndex((e=>e.value&&"IMMEDIATE"===e.value.toUpperCase()));e>=0&&e+1===t&&f.push({type:"NoExecuteImmediate",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}t.SQLHostVarCheck&&E.forEach(((e,t)=>{if("word"===e.type&&i.some((t=>t.toUpperCase()===e.value.toUpperCase()))){const n=E[t-1];n&&!["dot","seperator"].includes(n.type)&&f.push({offset:{position:e.range.start,end:e.range.end},type:"SQLHostVarCheck",newValue:`:${e.value}`})}}));break;case"SELECT":b.push({otherBlockExists:!1,offset:{position:E[0].range.start,end:E[E.length-1].range.end}});break;case"OTHER":b.length>0&&(b[b.length-1].otherBlockExists=!0);break;case"ENDSL":if(b.length>0){const e=b.pop();t.RequireOtherBlock&&e&&!e.otherBlockExists&&f.push({type:"RequireOtherBlock",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}break;case"IF":case"ELSEIF":case"WHEN":case"DOW":case"DOU":if(t.ForceOptionalParens){const e=E[E.length-1];"openbracket"===E[1].type&&"closebracket"===e.type||f.push({type:"ForceOptionalParens",offset:{position:E[0].range.start,end:E[E.length-1].range.end}})}}}}if(E.length>0)for(let e=0;e<E.length;e++)if(h=E[e],h.value)switch(h.type){case"builtin":if(t.SpecificCasing){const e=t.SpecificCasing.find((e=>[h.value.toUpperCase(),"*BIF"].includes(e.operation.toUpperCase())));if(e){let t=e.expected;switch(t.toUpperCase()){case"*UPPER":t=h.value.toUpperCase();break;case"*LOWER":t=h.value.toLowerCase()}h.value!==t&&f.push({offset:{position:h.range.start,end:h.range.end},type:"SpecificCasing",newValue:t})}}break;case"special":if(t.CollectReferences){d=h.value.substring(1).toUpperCase();const e=n.find(d);e&&e.references.push({offset:{position:h.range.start,end:h.range.end},type:null})}break;case"word":const o=h.value.toUpperCase();t.NoGlobalsInProcedures&&a&&!l&&n.variables.find((e=>e.name.toUpperCase()===o))&&f.push({offset:{position:h.range.start,end:h.range.end},type:"NoGlobalsInProcedures"});const c=["declare","end"].includes(E[0].type);if(t.IncorrectVariableCase&&(!1===m||m&&E[e-1]&&"seperator"===E[e-1].type)&&!((c||l||u>0)&&e>=0&&E[e+1]&&"openbracket"===E[e+1].type)){const e=i.find((e=>e.toUpperCase()===o));e&&e!==h.value&&f.push({offset:{position:h.range.start,end:h.range.end},type:"IncorrectVariableCase",newValue:e})}if(c&&e>=2||!c){if(t.RequiresParameter&&!l&&!c&&s.find((e=>e.name.toUpperCase()===o))){let t=!1;"CTL-OPT"===E[0].value.toUpperCase()||"directive"===E[0].type||(E.length<=e+1||"openbracket"!==E[e+1].type)&&(t=!0),t&&f.push({offset:{position:h.range.start,end:h.range.end},type:"RequiresParameter"})}if(t.CollectReferences){if(E[e-1]&&"dot"===E[e-1].type)break;let t;if(r&&r.scope&&(t=r.scope.find(o),t||(t=r.subItems.find((e=>e.name.toUpperCase()===o)))),t||(t=n.find(o)),t&&((void 0===t.position||t.position&&t.position.line!==p)&&t.references.push({offset:{position:h.range.start,end:h.range.end}}),t.keyword.QUALIFIED)){let n=e+1;if(E[n]&&("openbracket"===E[n].type&&(n=E.findIndex(((e,t)=>t>n&&"closebracket"===e.type)),n>=0&&n++),E[n]&&"dot"===E[n].type&&(n++,E[n]&&"word"===E[n].type&&E[n].value))){const e=E[n],r=e.value.toUpperCase(),o=t.subItems.find((e=>e.name.toUpperCase()==r));o&&o.references.push({offset:{position:e.range.start,end:e.range.end}})}}}}break;case"string":if(""===h.value.substring(1,h.value.length-1).trim()&&t.RequireBlankSpecial&&!m)f.push({offset:{position:h.range.start,end:h.range.end},type:"RequireBlankSpecial",newValue:"*BLANK"});else if(t.StringLiteralDupe&&!m&&"declare"!==E[0].type){let e=R.find((e=>e.value===h.value));e||(e={value:h.value,list:[]},R.push(e)),e.list.push({offset:{position:h.range.start,end:h.range.end}})}}}if("format"===E[0].type&&"**CTDATA"===E[0].value.toUpperCase())break;v||(v=[Ge.singleIndent,Ge.single].includes(D)),void 0!==w.statements[k-1]&&w.statements[k-1].range.line===p||(r&&!1===v&&(m=E[0].value.toUpperCase(),["ENDIF","ENDFOR","ENDDO","ELSE","ELSEIF","ON-ERROR","ENDMON","ENDSR","WHEN","OTHER","END-PROC","END-PI","END-PR","END-DS","ENDSL"].includes(m)&&(g-=o,["ENDSL"].includes(m)&&(g-=o),"END-PROC"===m&&d&&(d=!1,g-=o)),y!==g&&h.push({line:p,expectedIndent:g,currentIndent:y}),["IF","ELSE","ELSEIF","FOR","FOR-EACH","DOW","DOU","MONITOR","ON-ERROR","ON-EXIT","BEGSR","SELECT","WHEN","OTHER","DCL-PROC","DCL-PI","DCL-PR","DCL-DS"].includes(m)&&(["DCL-DS","DCL-PI","DCL-PR"].includes(m)&&S[m].some((e=>E.map((e=>e.value.toUpperCase())).includes(e)))||("SELECT"===m?!1===v&&(g+=2*o):"ON-EXIT"===m?(g+=o,d=!0):g+=o))),D=Ge.none)}}if(R.length>0){const e=t.literalMinimum||2;R.forEach((t=>{t.list.length>=e&&t.list.forEach((e=>{var n,r;f.push((n=((e,t)=>{for(var n in t||(t={}))Ke.call(t,n)&&ze(e,n,t[n]);if(Ve)for(var n of Ve(t))Be.call(t,n)&&ze(e,n,t[n]);return e})({},e),r={type:"StringLiteralDupe",newValue:t.definition},$e(n,He(r))))}))}))}return t.NoExternalTo&&t.NoExternalTo.length&&[n,...n.procedures.filter((e=>void 0!==e.scope)).map((e=>e.scope))].forEach((e=>{e.procedures.forEach((e=>{if(e.keyword.EXTPROC||e.keyword.EXTPGM){let n=e.keyword.EXTPROC||e.keyword.EXTPGM;if(n=!0===n?e.name.toUpperCase():n.toUpperCase(),n=n.startsWith("'")&&n.endsWith("'")?n.substring(1,n.length-1):n,t.NoExternalTo.includes(n)){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoExternalTo",offset:{position:t.range.start,end:t.range.end}})}}}))})),t.NoUnreferenced&&[n,...n.procedures.filter((e=>void 0!==e.scope)).map((e=>e.scope))].forEach((t=>{[...t.constants,...t.variables].filter((t=>t.position.path===e.uri)).forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),t.subroutines.filter((t=>t.position.path===e.uri&&t.name&&!["*INZSR","*PSSR"].includes(t.name.toUpperCase()))).forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),t.procedures.filter((t=>t.position.path===e.uri)).forEach((e=>{if(!e.keyword.EXPORT){if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}e.keyword.EXTPGM||e.keyword.EXTPROC||e.subItems.forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}}))}})),t.structs.filter((t=>t.position.path===e.uri)).forEach((e=>{const t=e.subItems.some((e=>e.references.length>0));if(0===e.references.length&&(e.subItems.forEach((e=>{if(0===e.references.length){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}})),!1===t)){const t=w.getStatementByLine(e.position.line);t&&f.push({type:"NoUnreferenced",offset:{position:t.range.start,end:t.range.end}})}}))})),{indentErrors:h,errors:f,doc:w}}}var Je=n(2884),Ye=n(1017),Ze=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));let et={},tt=!1;function nt(e){return Ze(this,null,(function*(){const t=yield Me(e);if(t){const n=yield ot(e),r=null==n?void 0:n.getText();if(r)try{const n=JSON.parse(r);if(n.includePath&&Array.isArray(n.includePath)){n.includePath.some((e=>"string"!=typeof e))?console.log(`${e} -> 'includePath' is not a valid string array.`):et[t.uri]=n.includePath}return n}catch(t){console.log(`Unable to parse JSON in ${e}.`)}}return{}}))}function rt(e){return Ze(this,null,(function*(){const t=yield ot(e);if(t){const n=null==t?void 0:t.getText(),r=yield I.getDocs(e,n);r&&n.length>=6&&"**FREE"===n.substring(0,6).toUpperCase()&&Xe.getErrors({uri:e,content:n},{CollectReferences:!0},r)}}))}function ot(t){return Ze(this,null,(function*(){let n=q.get(t);if(n)return n;try{const n=yield V.readFile(M.parse(t).fsPath,{encoding:"utf-8"});return e.create(t,"rpgle",1,n)}catch(e){}}))}let it=[];function st(e){return Ze(this,null,(function*(){const t=yield Me(e);if(t){const e=M.parse(null==t?void 0:t.uri).path;(!it||it&&0===it.length)&&(it=Je.glob.sync("**/*.{rpgleinc,rpgleh}",{cwd:e,nocase:!0,absolute:!0}).map((t=>({uri:M.file(t).toString(),relative:Ye.relative(e,t)}))))}return it}))}const at=n(1017);function ct(){let e=[];return tt&&Object.keys(I.parsedCache).forEach((t=>{const n=at.parse(t).base,r=at.parse(n);let o=at.basename(r.name).toUpperCase();if(o.endsWith(".PGM")&&(o=o.substring(0,o.length-4)),!1===n.toLowerCase().endsWith(".rpgleinc")){const n=I.getParsedCache(t);if(n){const t=n.keyword.MAIN;if(t){if("string"==typeof t){const r=n.procedures.find((e=>e.name.toUpperCase()===t.toUpperCase()));if(r){let t=r.keywords.map((e=>e.toLowerCase()));t.push(`extpgm('${o}')`);const n=[`dcl-pr ${r.name} ${t.join(" ")};`,...r.subItems.map((e=>` ${e.name} ${e.keywords.map((e=>e.toLowerCase())).join(" ")};`)),"end-pr;"];e.push({name:o,insertText:`${o}(${r.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,detail:o,description:r.description,type:"function",prototype:n})}}}else n.keyword.NOMAIN&&n.procedures.forEach((t=>{if(t.keyword.EXPORT){let n=t.keywords.map((e=>e.toLowerCase())).filter((e=>"export"!==e));n.push(`extproc('${t.name.toUpperCase()}')`);const r=[`dcl-pr ${t.name} ${n.join(" ")};`,...t.subItems.map((e=>` ${e.name} ${e.keywords.map((e=>e.toLowerCase())).join(" ")};`)),"end-pr;"];e.push({name:t.name,insertText:`${t.name}(${t.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,detail:t.name,description:t.description,type:"function",prototype:r})}}))}}})),e}const ut=n(1017),lt={function:o.CompletionItemKind.Function,struct:o.CompletionItemKind.Struct},dt="\n";function pt(e){return t=this,n=null,r=function*(){const t=e.textDocument.uri,n=e.range,r=q.get(t);if(r&&"**FREE"===r.getText(o.Range.create(0,0,0,6)).toUpperCase()){const e=yield I.getDocs(r.uri);if(e){const t=yield Ct(r,e,!1);if(t){const e=t.errors.filter((e=>n.start.line===r.positionAt(e.offset.position).line));if(e.length>0)return Dt(r,e)}}}},new Promise(((e,o)=>{var i=e=>{try{a(r.next(e))}catch(e){o(e)}},s=e=>{try{a(r.throw(e))}catch(e){o(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((r=r.apply(t,n)).next())}));var t,n,r}function ht(e){return t=this,n=null,r=function*(){const t=e.textDocument.uri,n=q.get(t);if(n&&"**FREE"===n.getText(o.Range.create(0,0,0,6)).toUpperCase()){const e=yield Rt(n.uri);if(e){let t=yield I.getDocs(n.uri);if(t){t=yield I.getDocs(n.uri,n.getText(),{ignoreCache:!0});const{errors:r}=Xe.getErrors({uri:n.uri,content:n.getText()},e,t),i=Dt(n,r.filter((e=>"RequiresProcedureDescription"!==e.type)));let s=[],a=0,c=[];i.filter((e=>e.edit)).forEach((e=>{if(e.edit&&e.edit.changes){const t=e.edit.changes[n.uri];t[0]&&s.includes(t[0].range.start.line)?a+=1:t.forEach((e=>{const t=e.range.start.line;c.push(e),s.includes(t)||s.push(t)}))}}));const{indentErrors:u}=Xe.getErrors({uri:n.uri,content:n.getText()},e,t),l=u.map((e=>{const t=o.Range.create(e.line,0,e.line,e.currentIndent);return o.TextEdit.replace(t,"".padEnd(e.expectedIndent," "))}));return[...c,...l]}}}return[]},new Promise(((e,o)=>{var i=e=>{try{a(r.next(e))}catch(e){o(e)}},s=e=>{try{a(r.throw(e))}catch(e){o(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((r=r.apply(t,n)).next())}));var t,n,r}function ft(e){const t=e.split("/").map((e=>e.split(","))).flat().filter((e=>e.length>=1));return{name:t[t.length-1],file:t[t.length-2],library:t[t.length-3],asp:t[t.length-4]}}var mt=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const gt=n(1017);let yt={};function vt(e,t){return t.offset,o.Range.create(e.positionAt(t.offset.position),e.positionAt(t.offset.end))}let bt={};function Rt(e){return mt(this,null,(function*(){const t=yield function(e){return mt(this,null,(function*(){const t=M.parse(e);let n;const r=bt[e];if(r)return 0===r.resolved?r.uri:void 0;switch(t.scheme){case"member":if(n=["",ft(t.path).library,"VSCODE","RPGLINT.JSON"].join("/"),n=M.from({scheme:"member",path:n}).toString(),yt[n])return n;n=yield Oe(n);break;case"streamfile":const e=yield _e.sendRequest("getWorkingDirectory");e&&(n=M.from({scheme:"streamfile",path:gt.posix.join(e,".vscode","rpglint.json")}).toString(),n=yield Oe(n,t.scheme));break;case"file":n=yield Oe("rpglint.json",t.scheme)}return bt[e]=n?{resolved:0,uri:n}:{resolved:1,uri:""},n}))}(e);let n={};if(t){if(yt[t])return JSON.parse(yt[t]);try{yt[t]="{}";const e=yield qe(t);e&&(n=JSON.parse(e),yt[t]=e)}catch(e){delete yt[t],console.log(`Error getting lint config for ${t}: ${e.message}`),console.log(e.stack)}}return n}))}function Ct(e,t,n=!0){return mt(this,null,(function*(){if("**FREE"===e.getText(o.Range.create(0,0,0,6)).toUpperCase()){const r=e.getText(),i=[],s=[],a=yield Rt(e.uri);let c,u;tt&&(a.CollectReferences=!0,u=(yield st(e.uri)).map((e=>e.relative)));try{c=Xe.getErrors({uri:e.uri,content:r,availableIncludes:u},a,t)}catch(t){return console.log(`Error linting ${e.uri}: ${t.message}`),void console.log(t.stack)}const l=c.indentErrors,d=c.errors;return l.length>0&&l.forEach((e=>{const t=o.Range.create(e.line,0,e.line,e.currentIndent);i.push(o.Diagnostic.create(t,`Incorrect indentation. Expected ${e.expectedIndent}, got ${e.currentIndent}`,o.DiagnosticSeverity.Warning))})),d.length>0&&d.forEach((t=>{const n=vt(e,t),r=o.Diagnostic.create(n,Xe.getErrorText(t.type),o.DiagnosticSeverity.Warning);s.push(r)})),n&&_e.sendDiagnostics({uri:e.uri,diagnostics:[...i,...s]}),c}}))}function Dt(e,t){let n=[];const r=t.filter((e=>"NoGlobalSubroutines"===e.type));return t=t.filter((e=>"NoGlobalSubroutines"!==e.type)),r.reverse(),t.push(...r),t.forEach((t=>{let r,i=vt(e,t);switch(t.type){case"UppercaseConstants":t.newValue&&(r=o.CodeAction.create("Convert constant name to uppercase",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"ForceOptionalParens":r=o.CodeAction.create("Add brackets around expression",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.insert(i.end,")"),o.TextEdit.insert(i.start,"(")]}},n.push(r);break;case"UselessOperationCheck":r=o.CodeAction.create("Remove operation code",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.del(i)]}},n.push(r);break;case"SpecificCasing":case"IncorrectVariableCase":case"UppercaseDirectives":t.newValue&&(r=o.CodeAction.create(`Correct casing to '${t.newValue}'`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"RequiresProcedureDescription":r=o.CodeAction.create("Add title and description",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.insert(i.start,"///\n// Title\n// Description\n///\n")]}},n.push(r);break;case"RequireBlankSpecial":t.newValue&&(r=o.CodeAction.create("Convert constant name to uppercase",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"SQLHostVarCheck":case"CopybookDirective":case"StringLiteralDupe":case"NoGlobalSubroutines":t.newValue&&(r=o.CodeAction.create(`Switch to '${t.newValue}'`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"IncludeMustBeRelative":t.newValue&&(r=o.CodeAction.create(`Correct path to ${t.newValue}`,o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r));break;case"PrettyComments":t.newValue&&(r=o.CodeAction.create("Fix comment formatting",o.CodeActionKind.QuickFix),r.edit={changes:{[e.uri]:[o.TextEdit.replace(i,t.newValue)]}},n.push(r))}})),n}const wt=n(1017);var kt=n(7147),Tt=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));const St=n(1017);let Et=!1,Pt=!1,_t=!1,xt=!1;_e.onInitialize((e=>{const n=e.capabilities;Et=!(!n.workspace||!n.workspace.configuration),Pt=!(!n.workspace||!n.workspace.workspaceFolders),_t=!!(n.textDocument&&n.textDocument.publishDiagnostics&&n.textDocument.publishDiagnostics.relatedInformation);const r={capabilities:{textDocumentSync:t.TextDocumentSyncKind.Incremental}};if(r.capabilities.documentSymbolProvider=!0,r.capabilities.definitionProvider=!0,r.capabilities.completionProvider={triggerCharacters:[" ",".",":"]},r.capabilities.hoverProvider=!0,r.capabilities.referencesProvider=!0,r.capabilities.implementationProvider=!0,r.capabilities.codeActionProvider=!0,r.capabilities.documentFormattingProvider={workDoneProgress:!0},Pt&&(r.capabilities.workspace={workspaceFolders:{supported:!0}}),Pt){const t=e.workspaceFolders;t&&t.length>0&&(xt=!0,r.capabilities.workspaceSymbolProvider=!0)}return console.log(`Project Mode enabled: ${xt}`),r})),_e.onInitialized((()=>{xt&&function(){Ze(this,null,(function*(){tt=!0,function(){Ze(this,null,(function*(){const e=yield _e.workspace.getWorkspaceFolders();let t=!1;if(e){let n=[];for(const r of e){const e=M.parse(r.uri).fsPath;console.log(`Starting search of: ${e}`);const o=Je.glob.sync("**/*.{rpgle,sqlrpgle,rpgleinc,rpgleh}",{cwd:e,absolute:!0,nocase:!0});console.log(`Found RPGLE files: ${o.length}`),n.push(...o.map((e=>M.from({scheme:"file",path:e}).toString())));const i=Je.glob.sync("**/iproj.json",{cwd:e,absolute:!0,nocase:!0});if(i.length>0){const e=i[0],n=M.from({scheme:"file",path:e}).toString();(yield nt(n)).big&&(t=!0)}}if(t&&console.log("Big mode detected!"),n.length<1e3||t)for(const e of n)yield rt(e);else console.log("Disabling project mode for large project."),tt=!1}}))}(),Ne.push((e=>{e.changes.forEach((e=>{const t=Ye.parse(e.uri),n=t.ext.toLowerCase();switch(e.type){case o.FileChangeType.Created:case o.FileChangeType.Changed:switch(n){case".rpgleinc":case".rpgleh":rt(e.uri),it=[];break;case".json":"iproj.json"===t.base&&nt(e.uri)}break;default:I.clearParsedCache(e.uri)}}))})),_e.onRequest("getCache",(e=>I.getParsedCache(e)))}))}()})),I.setTableFetch(((e,t=!1)=>Tt(void 0,null,(function*(){var n;return function(e,t=!1){let n={};return e.forEach((e=>{const{WHNAME:r,WHFLDT:o,WHFLDB:i,WHFLDD:s,WHFLDP:a,WHFTXT:c}=e,u=e.WHALIS?e.WHALIS.trim():void 0,l=t&&u||e.WHFLDE;if(""===l.trim())return;if(l.startsWith("*"))return;let d;n[r]?d=n[r]:(d=new w("struct"),d.name=r,n[r]=d);const p=new w("subitem");p.name=l;const h=[];"Y"===e.WHVARL&&h.push("VARYING"),p.keywords=[N({type:o,len:0===s?i:s,decimals:a,keywords:h})],p.description=c.trim(),d.subItems.push(p)})),Object.values(n)}(yield(n=e,_e.sendRequest("getObject",n)),t)}))));let Nt={};I.setIncludeFileFetch(((e,t)=>Tt(void 0,null,(function*(){const n=M.parse(e),r=n.path;let o,i;if(!Nt[t]){Nt[t]=!0;const s=t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"'),a=s||t.includes("/")&&!t.includes(",");if(o=t,s&&(o=o.substring(1,o.length-1)),a)if(["streamfile","member"].includes(n.scheme))if(o.startsWith("/"))i=M.from({scheme:"streamfile",path:o}).toString();else{const t=[o,`${o}.rpgleinc`,`${o}.rpgle`],n=yield Le(e,t);n&&(i=M.from({scheme:"streamfile",path:n}).toString())}else{const t=yield _e.workspace.getWorkspaceFolders();let s;if(t&&(s=t.find((e=>r.startsWith(M.parse(e.uri).path)))),tt?i=yield Oe(o,n.scheme):(s&&(o=St.posix.join(M.parse(s.uri).path,o)),i=(0,kt.existsSync)(o)?M.from({scheme:n.scheme,path:o}).toString():void 0),!i){const t=yield Le(e,[o]);t&&(i=M.from({scheme:"streamfile",path:t}).toString())}}else{const r=ft(t);let s=r.file||"QRPGLESRC",a=r.name;if(r.library)o=["",...r.asp?[r.asp]:[],r.library,s,a+".rpgleinc"].join("/"),o=M.from({scheme:"member",path:o}).toString(),i=yield Oe(o,n.scheme);else{const t=yield function(e,t,n){return Pe(this,null,(function*(){const r=n+t;if(Ie[e]&&Ie[e][r])return Ie[e][r];const o=yield xe.add((()=>_e.sendRequest("memberResolve",[t,n])));return o&&(Ie[e]||(Ie[e]={}),Ie[e][r]=o),o}))}(e,a,s);t&&(o=["",...r.asp?[r.asp]:[],t.library,t.file,t.name+".rpgleinc"].join("/"),i=M.from({scheme:"member",path:o}).toString())}}if(Nt[t]=!1,i){const e=yield qe(i);if(e)return{found:!0,uri:i,lines:e.split("\n")}}}return Nt[t]=!1,{found:!1,uri:i}})))),_e.onDocumentSymbol((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=[],r=q.get(t);if(r){const e=yield I.getDocs(t,r.getText()),i=e=>{const n=[];return e.procedures.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Function,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0));e.scope&&(r.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),r.children.push(...i(e.scope))),n.push(r)})),n.push(...e.subroutines.filter((e=>e.position&&e.position.path===t)).filter((e=>e.range.start)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Function,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0)))),...e.variables.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Variable,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),...e.constants.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Constant,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0))))),e.files.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.File,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0));r.children=[],e.subItems.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const n=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Struct,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0));n.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),r.children&&r.children.push(n)})),n.push(r)})),e.structs.filter((e=>e.position&&e.position.path===t)).forEach((e=>{const r=o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Struct,o.Range.create(e.range.start,0,e.range.end,0),o.Range.create(e.range.start,0,e.range.start,0));r.children=e.subItems.filter((e=>e.position&&e.position.path===t)).map((e=>o.DocumentSymbol.create(e.name,e.keywords.join(" ").trim(),o.SymbolKind.Property,o.Range.create(e.position.line,0,e.position.line,0),o.Range.create(e.position.line,0,e.position.line,0)))),n.push(r)})),n};e&&n.push(...i(e))}return n},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onDefinition((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=e.position.line,r=q.get(t);if(r){const i=yield I.getDocs(t,r.getText());if(i){const s=r.getText(o.Range.create(n,0,n,200)),a=O.getIncludeFromDirective(s);if(a){const e=yield I.includeFileFetch(t,a);if(e.found&&e.uri)return o.Location.create(e.uri,o.Range.create(0,0,0,0))}else{const t=A(r,e.position);if(t){const e=i.findDefinition(n,t);if(e)return o.Location.create(e.position.path,o.Range.create(e.position.line,0,e.position.line,0))}}}}return null},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onCompletion((function(e){return t=this,null,n=function*(){var t;const n=[],r=e.position.line,i=null==(t=e.context)?void 0:t.triggerCharacter,s=e.textDocument.uri,a=q.get(s);if(a){const t=yield I.getDocs(s,a.getText());if(t){const c="**FREE"===a.getText(o.Range.create(0,0,0,6)).toUpperCase(),u=t.procedures.find(((e,n)=>r>=e.range.start&&(r<=e.range.end+1||n===t.procedures.length-1))),l=a.getText(o.Range.create(e.position.line,0,e.position.line,200));if("."===i){let r=o.Position.create(e.position.line,e.position.character-2),i=A(a,r);if(i){const t=l.lastIndexOf("(",r.character);t>-1&&(r=o.Position.create(e.position.line,t-1),i=A(a,r))}if(i){i=i.toUpperCase();const e=[u&&u.scope?u.scope.parameters.find((e=>e.name.toUpperCase()===i&&e.subItems.length>0)):void 0,u&&u.scope?u.scope.structs.find((e=>e.name.toUpperCase()===i)):void 0,t.structs.find((e=>e.name.toUpperCase()===i))].find((e=>e));e&&e.keyword.QUALIFIED&&n.push(...e.subItems.map((t=>{const n=o.CompletionItem.create(t.name);return n.kind=o.CompletionItemKind.Property,n.insertText=t.name,n.detail=t.keywords.join(" "),n.documentation=t.description+""+(e?` (${e.name})`:""),n})))}}else{const e=l.toUpperCase();if(tt&&(e.includes("/COPY")||e.includes("/INCLUDE"))){const e=yield st(s);n.push(...e.map((e=>{const t=ut.basename(e.uri),n=o.CompletionItem.create(t);return n.kind=o.CompletionItemKind.File,n.insertText=`'${e.relative}'`,n.detail=e.relative,n})))}else if(l.trimStart().startsWith("//"))n.push(...H);else{const e=e=>{for(const t of e.parameters){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Variable,e.insertText=t.name,e.detail=["parameter",...t.keywords].join(" "),e.documentation=t.description,n.push(e)}for(const t of e.procedures){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Function,e.insertTextFormat=o.InsertTextFormat.Snippet,e.insertText=`${t.name}(${t.subItems.map(((e,t)=>`\${${t+1}:${e.name}}`)).join(":")})`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}for(const t of e.subroutines){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Function,e.insertText=`${t.name}`,e.documentation=t.description,n.push(e)}for(const t of e.variables){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Variable,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}e.files.forEach((e=>{const t=o.CompletionItem.create(`${e.name}`);t.kind=o.CompletionItemKind.File,t.insertText=`${e.name}`,t.detail=e.keywords.join(" "),t.documentation=e.description,n.push(t);for(const t of e.subItems){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Struct,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e),t.keyword.QUALIFIED||t.subItems.forEach((e=>{const r=o.CompletionItem.create(`${e.name}`);r.kind=o.CompletionItemKind.Property,r.insertText=`${e.name}`,r.detail=e.keywords.join(" "),r.documentation=e.description+` (${t.name})`,n.push(r)}))}}));for(const t of e.structs){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Struct,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e),t.keyword.QUALIFIED||t.subItems.forEach((e=>{const r=o.CompletionItem.create(`${e.name}`);r.kind=o.CompletionItemKind.Property,r.insertText=`${e.name}`,r.detail=e.keywords.join(" "),r.documentation=e.description+` (${t.name})`,n.push(r)}))}for(const t of e.constants){const e=o.CompletionItem.create(`${t.name}`);e.kind=o.CompletionItemKind.Constant,e.insertText=`${t.name}`,e.detail=t.keywords.join(" "),e.documentation=t.description,n.push(e)}};if(e(t),u&&u.scope&&e(u.scope),c){const e=s.toLowerCase().endsWith(".rpgleinc"),r=t.getDefinitionBlockEnd(a.uri)+1,i=o.Range.create(r,0,r,0);[...F,...ct()].filter((e=>!t.procedures.some((t=>{const n=e.name.toUpperCase();if(t.name.toUpperCase()===n)return!0;let r=t.keyword.EXTPROC||t.keyword.EXTPGM;return"string"==typeof r&&(r.startsWith("'")&&(r=r.substring(1)),r.endsWith("'")&&(r=r.substring(0,r.length-1)),r.toUpperCase()===n)||void 0}))&&!t.structs.some((t=>t.name.toUpperCase()===e.name.toUpperCase())))).forEach((t=>{const r=o.CompletionItem.create(t.name);r.kind=lt[t.type],r.detail=`${t.detail} (auto-import)`,r.documentation={kind:"markdown",value:[t.description,t.example?["---","","```rpgle",t.example.join(dt),"```"].join(dt):void 0].filter((e=>e)).join(dt+dt)},r.insertTextFormat=o.InsertTextFormat.Snippet,e?r.insertText=t.prototype.join(dt):(r.insertText=t.insertText,r.additionalTextEdits=[{range:i,newText:dt+t.prototype.join(dt)+dt}]),n.push(r)}))}}}}}return n},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onHover((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=e.position.line,r=q.get(t);if(r){const i=yield I.getDocs(t,r.getText());if(i){const s=A(r,e.position);if(!s)return;const a=i.procedures.find((e=>e.name.toUpperCase()===s.toUpperCase()));if(a){let e="",n=a.keywords.filter((e=>"EXTPROC"!==e));0===n.length&&(n=["void"]);const r=a.tags.find((e=>"return"===e.tag)),i=a.tags.find((e=>"deprecated"===e.tag));i&&(e+=`**Deprecated:** ${i.content}\n\n`),e+=`\`\`\`vb\n${a.name}(`,a.subItems.length>0&&(e+=`\n ${a.subItems.map((e=>`${e.name}: ${e.keywords.join(" ").trim()}`)).join(",\n ")}\n`),e+=`): ${n.join(" ")}\n\`\`\` \n`,a.description&&(e+=`${a.description}\n\n`);const s=a.tags.filter((e=>"param"===e.tag));return e+=a.subItems.map(((e,t)=>`*@param* \`${e.name.replace(new RegExp("\\*","g"),"\\*")}\` ${s[t]?s[t].content:e.description}`)).join("\n\n"),r&&(e+=`\n\n*@returns* ${r.content}`),a.position&&t!==a.position.path&&(e+=`\n\n*@file* \`${a.position.path}:${a.position.line+1}\``),{contents:{kind:o.MarkupKind.Markdown,value:e}}}{const e=i.procedures.find((e=>n>=e.range.start&&n<=e.range.end));let a;if(e&&e.scope&&(a=e.scope.find(s)),a||(a=i.find(s)),a){let e=`\`${a.name}\`: \`${a.keywords.join(" ").trim()}\``;return a.position&&t!==a.position.path&&(e+=`\n\n*@file* \`${a.position.path}:${a.position.line+1}\``),{contents:{kind:o.MarkupKind.Markdown,value:e}}}{const e=r.getText(o.Range.create(n,0,n,200)),i=O.getIncludeFromDirective(e);if(i){const e=yield I.includeFileFetch(t,i);let n=i;if(e.found&&e.uri){const t=M.parse(e.uri);if("member"===t.scheme){const e=t.path.lastIndexOf(".");n=e>=0?t.path.substring(0,e):t.path,n.startsWith("/")&&(n=n.substring(1))}else n=t.path}return{contents:{kind:o.MarkupKind.Markdown,value:(e.found?`\`${n}\``:i)+` (${e.found?"found":"not found"})`}}}}}}}},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onReferences((function(e){return t=this,null,n=function*(){var t;const n=e.textDocument.uri,r=e.position,i=q.get(n);if(i){const e="**FREE"===i.getText(o.Range.create(0,0,0,6)).toUpperCase();let s=null==(t=A(i,r))?void 0:t.trim();if(s){if(s.endsWith(";")){const e=s.split(";");s=e[0]}const t=yield I.getDocs(n,i.getText());if(t){e&&Xe.getErrors({uri:n,content:i.getText()},{CollectReferences:!0},t);const a=t.findDefinition(r.line,s);if(a)return tt?yield function(e){return((e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(e){o(e)}},s=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())})))(this,null,(function*(){let t=[];if(tt){const n=Object.keys(I.parsedCache),r=q.get(e.position.path);if(r&&t.push(...e.references.map((t=>o.Location.create(e.position.path,vt(r,t))))),e.keyword.EXPORT){const r=e.name.toUpperCase();for(const e of n){const n=q.get(e);n&&I.getParsedCache(e).procedures.forEach((i=>{let s=!1;const a=i.keyword.EXTPROC;var c;a?!0===a?i.name.toUpperCase()===r&&(s=!0):(c=a,"'"===c[0]&&(c=c.substring(1)),"'"===c[c.length-1]&&(c=c.substring(0,c.length-1)),c).toUpperCase()===r&&(s=!0):i.keyword.EXPORT||i.name.toUpperCase()!==r||(s=!0),s&&(t.some((t=>t.uri===e))||t.push(o.Location.create(i.position.path,o.Range.create(i.position.line,0,i.position.line,0)),...i.references.map((t=>o.Location.create(e,vt(n,t))))))}))}}else{const r=e.position.path;for(const i of n){const n=yield ot(i);if(n){const s=I.getParsedCache(i),a=s.includes.find((e=>e.toPath===r));if(a){const r=s.find(e.name);r&&r.position.path===e.position.path&&("**FREE"!==n.getText(o.Range.create(0,0,0,6)).toUpperCase()||0===r.references.length?t.push(o.Location.create(i,o.Range.create(a.line,0,a.line,0))):t.push(...r.references.map((e=>o.Location.create(i,vt(n,e))))))}}}}}return t}))}(a):a.references.map((e=>o.Location.create(a.position.path,vt(i,e))))}}}},new Promise(((e,r)=>{var o=e=>{try{s(n.next(e))}catch(e){r(e)}},i=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((n=n.apply(t,null)).next())}));var t,n})),_e.onWorkspaceSymbol((function(e){if(console.log(e.query),tt){const e=Object.keys(I.parsedCache);let t=[];return e.forEach((e=>{const n=wt.basename(e);if(n.toLowerCase().endsWith(".rpgleinc"))t.push(o.WorkspaceSymbol.create(n,o.SymbolKind.File,e,o.Range.create(0,0,0,0)));else{const r=I.getParsedCache(e);r&&(r.keyword.MAIN?t.push(o.WorkspaceSymbol.create(n,o.SymbolKind.Method,e,o.Range.create(0,0,0,0))):r.keyword.NOMAIN&&r.procedures.forEach((n=>{n.keyword.EXPORT&&t.push(o.WorkspaceSymbol.create(n.name,o.SymbolKind.Function,e,o.Range.create(n.position.line,0,n.position.line,0)))})))}})),t}})),_e.onImplementation((function(e){return t=this,null,n=function*(){const t=e.textDocument.uri,n=q.get(t);if(n){const i=A(n,e.position);if(i){const e=i.toUpperCase();if(tt){const t=Object.keys(I.parsedCache);for(const n of t){const t=I.getParsedCache(n);for(const n of t.procedures)if(n.keyword.EXPORT&&n.name.toUpperCase()===e)return o.Location.create(n.position.path,o.Range.create(n.position.line,0,n.position.line,0))}}const n=I.getParsedCache(t);if(n){const e=n.keyword.BNDDIR;if("string"==ty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment