296 lines
2 MiB
JavaScript
296 lines
2 MiB
JavaScript
|
"use strict";
|
|||
|
global.__starttime = Date.now();
|
|||
|
global.__isMain = require.main === module;
|
|||
|
"use strict";var wQ=Object.create;var Ib=Object.defineProperty;var xQ=Object.getOwnPropertyDescriptor;var CQ=Object.getOwnPropertyNames;var SQ=Object.getPrototypeOf,DQ=Object.prototype.hasOwnProperty;var D=(n,e)=>()=>(n&&(e=n(n=0)),e);var v=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),qs=(n,e)=>{for(var t in e)Ib(n,t,{get:e[t],enumerable:!0})},DI=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of CQ(e))!DQ.call(n,r)&&r!==t&&Ib(n,r,{get:()=>e[r],enumerable:!(i=xQ(e,r))||i.enumerable});return n};var sr=(n,e,t)=>(t=n!=null?wQ(SQ(n)):{},DI(e||!n||!n.__esModule?Ib(t,"default",{value:n,enumerable:!0}):t,n)),Jo=n=>DI(Ib({},"__esModule",{value:!0}),n);var RI=v((Dve,PI)=>{"use strict";var TI=(n=0)=>e=>`\x1B[${38+n};5;${e}m`,kI=(n=0)=>(e,t,i)=>`\x1B[${38+n};2;${e};${t};${i}m`;function TQ(){let n=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,i]of Object.entries(e)){for(let[r,o]of Object.entries(i))e[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},i[r]=e[r],n.set(o[0],o[1]);Object.defineProperty(e,t,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:n,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi256=TI(),e.color.ansi16m=kI(),e.bgColor.ansi256=TI(10),e.bgColor.ansi16m=kI(10),Object.defineProperties(e,{rgbToAnsi256:{value:(t,i,r)=>t===i&&i===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let i=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!i)return[0,0,0];let{colorString:r}=i.groups;r.length===3&&(r=r.split("").map(s=>s+s).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1}}),e}Object.defineProperty(PI,"exports",{enumerable:!0,get:TQ})});var OS=v((Tve,_I)=>{function jS(n,e,t){var i,r,o,s,a;e==null&&(e=100);function l(){var c=Date.now()-s;c<e&&c>=0?i=setTimeout(l,e-c):(i=null,t||(a=n.apply(o,r),o=r=null))}var u=function(){o=this,r=arguments,s=Date.now();var c=t&&!i;return i||(i=setTimeout(l,e)),c&&(a=n.apply(o,r),o=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=n.apply(o,r),o=r=null,clearTimeout(i),i=null)},u}jS.debounce=jS;_I.exports=jS});var EI=v(AS=>{var za=require("path"),Ys=process.platform==="win32",Ws=require("fs"),kQ=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function PQ(){var n;if(kQ){var e=new Error;n=t}else n=i;return n;function t(r){r&&(e.message=r.message,r=e,i(r))}function i(r){if(r){if(process.throwDeprecation)throw r;if(!process.noDeprecation){var o="fs: missing callback "+(r.stack||r.message);process.traceDeprecation?console.trace(o):console.error(o)}}}}function RQ(n){return typeof n=="function"?n:PQ()}var kve=za.normalize;Ys?Uo=/(.*?)(?:[\/\\]+|$)/g:Uo=/(.*?)(?:[\/]+|$)/g;var Uo;Ys?zd=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/:zd=/^[\/]*/;var zd;AS.realpathSync=function(e,t){if(e=za.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var i=e,r={},o={},s,a,l,u;c();function c(){var y=zd.exec(e);s=y[0].length,a=y[0],l=y[0],u="",Ys&&!o[l]&&(Ws.lstatSync(l),o[l]=!0)}for(;s<e.
|
|||
|
globstar while`,e,d,t,h,g),this.matchOne(e.slice(d),t.slice(h),i))return this.debug("globstar found match!",d,a,g),!0;if(g==="."||g===".."||!r.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,d,t,h);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(i&&(this.debug(`
|
|||
|
>>> no match, partial?`,e,d,t,h),d===a))}var f;if(typeof u=="string"?(f=c===u,this.debug("string match",u,c,f)):(f=c.match(u),this.debug("pattern match",u,c,f)),!f)return!1}if(o===a&&s===l)return!0;if(o===a)return i;if(s===l)return o===a-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return VI(this.pattern,this.options)}parse(e,t){Lb(e);let i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Hr;if(e==="")return"";let r="",o=!1,s=!1,a=[],l=[],u,c=!1,d=-1,h=-1,g,f,m,y=e.charAt(0)===".",w=i.dot||y,x=()=>y?"":w?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",C=j=>j.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",P=()=>{if(u){switch(u){case"*":r+=JS,o=!0;break;case"?":r+=XS,o=!0;break;default:r+="\\"+u;break}this.debug("clearStateChar %j %j",u,r),u=!1}};for(let j=0,q;j<e.length&&(q=e.charAt(j));j++){if(this.debug("%s %s %s %j",e,j,r,q),s){if(q==="/")return!1;zI[q]&&(r+="\\"),r+=q,s=!1;continue}switch(q){case"/":return!1;case"\\":if(c&&e.charAt(j+1)==="-"){r+=q;continue}P(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",e,j,r,q),c){this.debug(" in class"),q==="!"&&j===h+1&&(q="^"),r+=q;continue}this.debug("call clearStateChar %j",u),P(),u=q,i.noext&&P();continue;case"(":{if(c){r+="(";continue}if(!u){r+="\\(";continue}let K={type:u,start:j-1,reStart:r.length,open:GI[u].open,close:GI[u].close};this.debug(this.pattern," ",K),a.push(K),r+=K.open,K.start===0&&K.type!=="!"&&(y=!0,r+=C(e.slice(j+1))),this.debug("plType %j %j",u,r),u=!1;continue}case")":{let K=a[a.length-1];if(c||!K){r+="\\)";continue}a.pop(),P(),o=!0,f=K,r+=f.close,f.type==="!"&&l.push(Object.assign(f,{reEnd:r.length}));continue}case"|":{let K=a[a.length-1];if(c||!K){r+="\\|";continue}P(),r+="|",K.start===0&&K.type!=="!"&&(y=!0,r+=C(e.slice(j+1)));continue}case"[":if(P(),c){r+="\\"+q;continue}c=!0,h=j,d=r.length,r+=q;continue;case"]":if(j===h+1||!c){r+="\\"+q;continue}g=e.substring(h+1,j);try{RegExp("["+XQ(UQ(g))+"]"),r+=q}catch{r=r.substring(0,d)+"(?:$.)"}o=!0,c=!1;continue;default:P(),zI[q]&&!(q==="^"&&c)&&(r+="\\"),r+=q;break}}for(c&&(g=e.slice(h+1),m=this.parse(g,US),r=r.substring(0,d)+"\\["+m[0],o=o||m[1]),f=a.pop();f;f=a.pop()){let j;j=r.slice(f.reStart+f.open.length),this.debug("setting tail",r,f),j=j.replace(/((?:\\{2}){0,64})(\\?)\|/g,(K,X,z)=>(z||(z="\\"),X+X+z+"|")),this.debug(`tail=%j
|
|||
|
%s`,j,j,f,r);let q=f.type==="*"?JS:f.type==="?"?XS:"\\"+f.type;o=!0,r=r.slice(0,f.reStart)+q+"\\("+j}P(),s&&(r+="\\\\");let T=YQ[r.charAt(0)];for(let j=l.length-1;j>-1;j--){let q=l[j],K=r.slice(0,q.reStart),X=r.slice(q.reStart,q.reEnd-8),z=r.slice(q.reEnd),B=r.slice(q.reEnd-8,q.reEnd)+z,fe=K.split(")").length,ve=K.split("(").length-fe,Le=z;for(let H=0;H<ve;H++)Le=Le.replace(/\)[+*?]?/,"");z=Le;let U=z===""&&t!==US?"(?:$|\\/)":"";r=K+X+z+U+B}if(r!==""&&o&&(r="(?=.)"+r),T&&(r=x()+r),t===US)return[r,o];if(i.nocase&&!o&&(o=e.toUpperCase()!==e.toLowerCase()),!o)return JQ(e);let O=i.nocase?"i":"";try{return Object.assign(new RegExp("^"+r+"$",O),{_glob:e,_src:r})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,i=t.noglobstar?JS:t.dot?qQ:WQ,r=t.nocase?"i":"",o=e.map(s=>(s=s.map(a=>typeof a=="string"?$Q(a):a===Hr?Hr:a._src).reduce((a,l)=>(a[a.length-1]===Hr&&l===Hr||a.push(l),a),[]),s.forEach((a,l)=>{a!==Hr||s[l-1]===Hr||(l===0?s.length>1?s[l+1]="(?:\\/|"+i+"\\/)?"+s[l+1]:s[l]=i:l===s.length-1?s[l-1]+="(?:\\/|"+i+")?":(s[l-1]+="(?:\\/|\\/"+i+"\\/)"+s[l+1],s[l+1]=Hr))}),s.filter(a=>a!==Hr).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,r)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let i=this.options;$S.sep!=="/"&&(e=e.split($S.sep).join("/")),e=e.split(KI),this.debug(this.pattern,"split",e);let r=this.set;this.debug(this.pattern,"set",r);let o;for(let s=e.length-1;s>=0&&(o=e[s],!o);s--);for(let s=0;s<r.length;s++){let a=r[s],l=e;if(i.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Zn.defaults(e).Minimatch}};Zn.Minimatch=Mu});var eL=v((Mve,zS)=>{typeof Object.create=="function"?zS.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:zS.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}});var tL=v((jve,QS)=>{try{if(KS=require("util"),typeof KS.inherits!="function")throw"";QS.exports=KS.inherits}catch{QS.exports=eL()}var KS});var e0=v(Us=>{Us.setopts=e7;Us.ownProp=iL;Us.makeAbs=Qd;Us.finish=t7;Us.mark=i7;Us.isIgnored=rL;Us.childrenIgnored=n7;function iL(n,e){return Object.prototype.hasOwnProperty.call(n,e)}var GQ=require("fs"),Ka=require("path"),zQ=Fb(),nL=require("path").isAbsolute,VS=zQ.Minimatch;function KQ(n,e){return n.localeCompare(e,"en")}function QQ(n,e){n.ignore=e.ignore||[],Array.isArray(n.ignore)||(n.ignore=[n.ignore]),n.ignore.length&&(n.ignore=n.ignore.map(VQ))}function VQ(n){var e=null;if(n.slice(-3)==="/**"){var t=n.replace(/(\/\*\*)+$/,"");e=new VS(t,{dot:!0})}return{matcher:new VS(n,{dot:!0}),gmatcher:e}}function e7(n,e,t){if(t||(t={}),t.matchBase&&e.indexOf("/")===-1){if(t.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}n.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,n.windowsPathsNoEscape&&(e=e.replace(/\\/g,"/")),n.silent=!!t.silent,n.pattern=e,n.strict=t.strict!==!1,n.realpath=!!t.realpath,n.realpathCache=t.realpathCache||Object.create(null),n.follow=!!t.follow,n.dot=!!t.dot,n.mark=!!t.mark,n.nodir=!!t.nodir,n.nodir&&(n.mark=!0),n.sync=!!t.sync,n.nounique=!!t.nounique,n.nonull=!!t.nonull,n.nosort=!!t.nosort,n.nocase=!!t.nocase,n.stat=!!t.stat,n.noprocess=!!t.noprocess,n.absolute=!!t.absolute,n.fs=t.fs||GQ,n.maxLength=t.maxLength||1/0,n.cache=t.cache||Object.create(null),n.statCache=t.statCache||Object.create(null),n.symlinks=t.symlinks||Object.create(null),QQ(n,t),n.changedCwd=!1;var i=process.cwd();iL(t,"cwd")?(n.cwd=Ka.resolve(t.cwd),n.changedCwd=n.cwd!==i):n.cwd=Ka.resolve(i),n.root=t.root||Ka.resolve(n.cwd,"/"),n.root=Ka.resolve(n.root),n.cwdAbs=nL(n.cwd)?n.cwd:Qd(n,n.cwd),n.nomount=!!
|
|||
|
See: https://github.com/isaacs/node-glob/issues/167`);return new Di(n,e).found}function Di(n,e){if(!n)throw new Error("must provide pattern");if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
|
|||
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Di))return new Di(n,e);if(o7(this,n,e),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var i=0;i<t;i++)this._process(this.minimatch.set[i],i,!1);this._finish()}Di.prototype._finish=function(){if(sL.ok(this instanceof Di),this.realpath){var n=this;this.matches.forEach(function(e,t){var i=n.matches[t]=Object.create(null);for(var r in e)try{r=n._makeAbs(r);var o=r7.realpathSync(r,n.realpathCache);i[o]=!0}catch(s){if(s.syscall==="stat")i[n._makeAbs(r)]=!0;else throw s}})}Qa.finish(this)};Di.prototype._process=function(n,e,t){sL.ok(this instanceof Di);for(var i=0;typeof n[i]=="string";)i++;var r;switch(i){case n.length:this._processSimple(n.join("/"),e);return;case 0:r=null;break;default:r=n.slice(0,i).join("/");break}var o=n.slice(i),s;r===null?s=".":((Mb(r)||Mb(n.map(function(u){return typeof u=="string"?u:"[*]"}).join("/")))&&(!r||!Mb(r))&&(r="/"+r),s=r);var a=this._makeAbs(s);if(!s7(this,s)){var l=o[0]===oL.GLOBSTAR;l?this._processGlobStar(r,s,a,o,e,t):this._processReaddir(r,s,a,o,e,t)}};Di.prototype._processReaddir=function(n,e,t,i,r,o){var s=this._readdir(t,o);if(!!s){for(var a=i[0],l=!!this.minimatch.negate,u=a._glob,c=this.dot||u.charAt(0)===".",d=[],h=0;h<s.length;h++){var g=s[h];if(g.charAt(0)!=="."||c){var f;l&&!n?f=!g.match(a):f=g.match(a),f&&d.push(g)}}var m=d.length;if(m!==0){if(i.length===1&&!this.mark&&!this.stat){this.matches[r]||(this.matches[r]=Object.create(null));for(var h=0;h<m;h++){var g=d[h];n&&(n.slice(-1)!=="/"?g=n+"/"+g:g=n+g),g.charAt(0)==="/"&&!this.nomount&&(g=t0.join(this.root,g)),this._emitMatch(r,g)}return}i.shift();for(var h=0;h<m;h++){var g=d[h],y;n?y=[n,g]:y=[g],this._process(y.concat(i),r,o)}}}};Di.prototype._emitMatch=function(n,e){if(!a7(this,e)){var t=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=t),!this.matches[n][e]){if(this.nodir){var i=this.cache[t];if(i==="DIR"||Array.isArray(i))return}this.matches[n][e]=!0,this.stat&&this._stat(e)}}};Di.prototype._readdirInGlobStar=function(n){if(this.follow)return this._readdir(n,!1);var e,t,i;try{t=this.fs.lstatSync(n)}catch(o){if(o.code==="ENOENT")return null}var r=t&&t.isSymbolicLink();return this.symlinks[n]=r,!r&&t&&!t.isDirectory()?this.cache[n]="FILE":e=this._readdir(n,!1),e};Di.prototype._readdir=function(n,e){var t;if(e&&!i0(this.symlinks,n))return this._readdirInGlobStar(n);if(i0(this.cache,n)){var i=this.cache[n];if(!i||i==="FILE")return null;if(Array.isArray(i))return i}try{return this._readdirEntries(n,this.fs.readdirSync(n))}catch(r){return this._readdirError(n,r),null}};Di.prototype._readdirEntries=function(n,e){if(!this.mark&&!this.stat)for(var t=0;t<e.length;t++){var i=e[t];n==="/"?i=n+i:i=n+"/"+i,this.cache[i]=!0}return this.cache[n]=e,e};Di.prototype._readdirError=function(n,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var t=this._makeAbs(n);if(this.cache[t]="FILE",t===this.cwdAbs){var i=new Error(e.code+" invalid cwd "+this.cwd);throw i.path=this.cwd,i.code=e.code,i}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(n)]=!1;break;default:if(this.cache[this._makeAbs(n)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};Di.prototype._processGlobStar=function(n,e,t,i,r,o){var s=this._readdir(t,o);if(!!s){var a=i.slice(1),l=n?[n]:[],u=l.concat(a);this._process(u,r,!1);var c=s.length,d=this.symlinks[t];if(!(d&&o))for(var h=0;h<c;h++){var g=s[h];if(!(g.charAt(0)==="."&&!this.dot)){var f=l.concat(s[h],a);this._process(f,r,!0);var m=l.concat(s[h],i);this._process(m,r,!0)}}}};Di.prototype._processSimple=function(n,e){var t=this._stat(n);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!t){if(n&&Mb(n)&&!this.nomount){var i=/[\/\\]$/.test(n);n.charAt(0)==="/"?n=t0.join(this.root,n):(n=t0.resolve(this.root,n),i&&(n+="/"))}process.platform==="win32"&&(n=n.replace(/\\/g,"/")),this._emitMatch(e,n)}};Di.prototype._stat=function(n){var e=this._makeAbs(n),t=n.slice(-1)==="/";if(n.length>this.maxLength)return!1;if(!this.stat&&i0(this.cach
|
|||
|
globstar while`,e,d,t,h,g),this.matchOne(e.slice(d),t.slice(h),i))return this.debug("globstar found match!",d,a,g),!0;if(g==="."||g===".."||!r.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,d,t,h);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(i&&(this.debug(`
|
|||
|
>>> no match, partial?`,e,d,t,h),d===a))}var f;if(typeof u=="string"?(f=c===u,this.debug("string match",u,c,f)):(f=c.match(u),this.debug("pattern match",u,c,f)),!f)return!1}if(o===a&&s===l)return!0;if(o===a)return i;if(s===l)return o===a-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return DL(this.pattern,this.options)}parse(e,t){Ob(e);let i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Br;if(e==="")return"";let r="",o=!!i.nocase,s=!1,a=[],l=[],u,c=!1,d=-1,h=-1,g,f,m,y=e.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",w=()=>{if(u){switch(u){case"*":r+=h0,o=!0;break;case"?":r+=f0,o=!0;break;default:r+="\\"+u;break}this.debug("clearStateChar %j %j",u,r),u=!1}};for(let P=0,T;P<e.length&&(T=e.charAt(P));P++){if(this.debug("%s %s %s %j",e,P,r,T),s){if(T==="/")return!1;xL[T]&&(r+="\\"),r+=T,s=!1;continue}switch(T){case"/":return!1;case"\\":if(c&&e.charAt(P+1)==="-"){r+=T;continue}w(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",e,P,r,T),c){this.debug(" in class"),T==="!"&&P===h+1&&(T="^"),r+=T;continue}this.debug("call clearStateChar %j",u),w(),u=T,i.noext&&w();continue;case"(":if(c){r+="(";continue}if(!u){r+="\\(";continue}a.push({type:u,start:P-1,reStart:r.length,open:wL[u].open,close:wL[u].close}),r+=u==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",u,r),u=!1;continue;case")":if(c||!a.length){r+="\\)";continue}w(),o=!0,f=a.pop(),r+=f.close,f.type==="!"&&l.push(f),f.reEnd=r.length;continue;case"|":if(c||!a.length){r+="\\|";continue}w(),r+="|";continue;case"[":if(w(),c){r+="\\"+T;continue}c=!0,h=P,d=r.length,r+=T;continue;case"]":if(P===h+1||!c){r+="\\"+T;continue}g=e.substring(h+1,P);try{RegExp("["+L7(E7(g))+"]"),r+=T}catch{r=r.substring(0,d)+"(?:$.)"}o=!0,c=!1;continue;default:w(),xL[T]&&!(T==="^"&&c)&&(r+="\\"),r+=T;break}}for(c&&(g=e.slice(h+1),m=this.parse(g,g0),r=r.substring(0,d)+"\\["+m[0],o=o||m[1]),f=a.pop();f;f=a.pop()){let P;P=r.slice(f.reStart+f.open.length),this.debug("setting tail",r,f),P=P.replace(/((?:\\{2}){0,64})(\\?)\|/g,(O,j,q)=>(q||(q="\\"),j+j+q+"|")),this.debug(`tail=%j
|
|||
|
%s`,P,P,f,r);let T=f.type==="*"?h0:f.type==="?"?f0:"\\"+f.type;o=!0,r=r.slice(0,f.reStart)+T+"\\("+P}w(),s&&(r+="\\\\");let x=P7[r.charAt(0)];for(let P=l.length-1;P>-1;P--){let T=l[P],O=r.slice(0,T.reStart),j=r.slice(T.reStart,T.reEnd-8),q=r.slice(T.reEnd),K=r.slice(T.reEnd-8,T.reEnd)+q,X=O.split("(").length-1,z=q;for(let fe=0;fe<X;fe++)z=z.replace(/\)[+*?]?/,"");q=z;let B=q===""&&t!==g0?"$":"";r=O+j+q+B+K}if(r!==""&&o&&(r="(?=.)"+r),x&&(r=y+r),t===g0)return[r,o];if(!o)return _7(e);let C=i.nocase?"i":"";try{return Object.assign(new RegExp("^"+r+"$",C),{_glob:e,_src:r})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,i=t.noglobstar?h0:t.dot?T7:k7,r=t.nocase?"i":"",o=e.map(s=>(s=s.map(a=>typeof a=="string"?I7(a):a===Br?Br:a._src).reduce((a,l)=>(a[a.length-1]===Br&&l===Br||a.push(l),a),[]),s.forEach((a,l)=>{a!==Br||s[l-1]===Br||(l===0?s.length>1?s[l+1]="(?:\\/|"+i+"\\/)?"+s[l+1]:s[l]=i:l===s.length-1?s[l-1]+="(?:\\/|"+i+")?":(s[l-1]+="(?:\\/|\\/"+i+"\\/)"+s[l+1],s[l+1]=Br))}),s.filter(a=>a!==Br).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,r)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let i=this.options;p0.sep!=="/"&&(e=e.split(p0.sep).join("/")),e=e.split(CL),this.debug(this.pattern,"split",e);let r=this.set;this.debug(this.pattern,"set",r);let o;for(let s=e.length-1;s>=0&&(o=e[s],!o);s--);for(let s=0;s<r.length;s++){let a=r[s],l=e;if(i.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Jn.defaults(e).Minimatch}};Jn.Minimatch=ju});var EL=v((zve,_L)=>{_L.exports=RL;RL.sync=M7;var kL=require("fs");function F7(n,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i<t.length;i++){var r=t[i].toLowerCase();if(r&&n.substr(-r.length).toLowerCase()===r)return!0}return!1}function PL(n,e,t){return!n.isSymbolicLink()&&!n.isFile()?!1:F7(e,t)}function RL(n,e,t){kL.stat(n,function(i,r){t(i,i?!1:PL(r,n,e))})}function M7(n,e){return PL(kL.statSync(n),n,e)}});var jL=v((Kve,ML)=>{ML.exports=LL;LL.sync=j7;var IL=require("fs");function LL(n,e,t){IL.stat(n,function(i,r){t(i,i?!1:FL(r,e))})}function j7(n,e){return FL(IL.statSync(n),e)}function FL(n,e){return n.isFile()&&O7(n,e)}function O7(n,e){var t=n.mode,i=n.uid,r=n.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=a|l,d=t&u||t&l&&r===s||t&a&&i===o||t&c&&o===0;return d}});var AL=v((Vve,OL)=>{var Qve=require("fs"),Ab;process.platform==="win32"||global.TESTING_WINDOWS?Ab=EL():Ab=jL();OL.exports=b0;b0.sync=A7;function b0(n,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,r){b0(n,e||{},function(o,s){o?r(o):i(s)})})}Ab(n,e||{},function(i,r){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,r=!1),t(i,r)})}function A7(n,e){try{return Ab.sync(n,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var ZL=v((ewe,YL)=>{var Ou=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",NL=require("path"),N7=Ou?";":":",HL=AL(),BL=n=>Object.assign(new Error(`not found: ${n}`),{code:"ENOENT"}),qL=(n,e)=>{let t=e.colon||N7,i=n.match(/\//)||Ou&&n.match(/\\/)?[""]:[...Ou?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],r=Ou?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Ou?r.split(t):[""];return Ou&&n.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:r}},WL=(n,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:r,pathExtExe:o}=qL(n,e),s=[],a=u=>new Promise((c,d)=>{if(u===i.length)return
|
|||
|
`,"\v","\f","\r","","","","","","","","","","","","","","\x1B","","","",""," ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","\x7F","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""," ","!","C/","PS","$?","Y=","|","SS",'"',"(c)","a","<<","!","","(r)","-","deg","+-","2","3","'","u","P","*",",","1","o",">>","1/4","1/2","3/4","?","A","A","A","A","A","A","AE","C","E","E","E","E","I","I","I","I","D","N","O","O","O","O","O","x","O","U","U","U","U","U","Th","ss","a","a","a","a","a","a","ae","c","e","e","e","e","i","i","i","i","d","n","o","o","o","o","o","/","o","u","u","u","u","y","th","y"]});var tj=v((Kwe,ej)=>{ej.exports=["A","a","A","a","A","a","C","c","C","c","C","c","C","c","D","d","D","d","E","e","E","e","E","e","E","e","E","e","G","g","G","g","G","g","G","g","H","h","H","h","I","i","I","i","I","i","I","i","I","i","IJ","","J","j","K","k","k","L","l","L","l","L","l","L","l","L","l","N","n","N","n","N","n","'n","ng","NG","O","o","O","o","O","o","OE","oe","R","r","R","r","R","r","S","s","S","s","S","s","S","s","T","t","T","t","T","t","U","u","U","u","U","u","U","u","U","u","U","u","W","w","Y","y","Y","Z","z","Z","z","Z","z","s","b","B","B","b","6","6","O","C","c","D","D","D","d","d","3","@","E","F","f","G","G","hv","I","I","K","k","l","l","W","N","n","O","O","o","OI","oi","P","p","YR","2","2","SH","sh","t","T","t","T","U","u","Y","V","Y","y","Z","z","ZH","ZH","zh","zh","2","5","5","ts","w","|","||","|=","!","DZ","Dz","dz","LJ","Lj","lj","NJ","Nj","nj","A","a","I","i","O","o","U","u","U","u","U","u","U","u","U","u","@","A","a","A","a","AE","ae","G","g","G","g","K","k","O","o","O","o","ZH","zh","j","DZ","D","dz","G","g","HV","W","N","n","A","a","AE","ae","O","o"]});var nj=v((Qwe,ij)=>{ij.exports=["A","a","A","a","E","e","E","e","I","i","I","i","O","o","O","o","R","r","R","r","U","u","U","u","S","s","T","t","Y","y","H","h","[?]","[?]","OU","ou","Z","z","A","a","E","e","O","o","O","o","O","o","O","o","Y","y","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","a","a","a","b","o","c","d","d","e","@","@","e","e","e","e","j","g","g","g","g","u","Y","h","h","i","i","I","l","l","l","lZ","W","W","m","n","n","n","o","OE","O","F","R","R","R","R","r","r","R","R","R","s","S","j","S","S","t","t","U","U","v","^","W","Y","Y","z","z","Z","Z","?","?","?","C","@","B","E","G","H","j","k","L","q","?","?","dz","dZ","dz","ts","tS","tC","fN","ls","lz","WW","]]","[?]","[?]","k","h","j","r","r","r","r","w","y","'",'"',"`","'","`","`","'","?","?","<",">","^","V","^","V","'","-","/","\\",",","_","\\","/",":",".","`","'","^","V","+","-","V",".","@",",","~",'"',"R","X","G","l","s","x","?","","","","","","","","V","=",'"',"[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var oj=v((Vwe,rj)=>{rj.exports=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","'",",","[?]","[?]","[?]","[?]","","[?]","[?]","[?]","?","[?]","[?]","[?]","[?]","[?]","","","A",";","E","E","I","[?]","O","[?]","U","O","I","A","B","G","D","E","Z","E","Th","I","K","L","M","N","Ks","O","P","R","[?]","S","T","U","Ph","Kh","Ps","O","I","U","a","e","e","i","u","a","b","g","d","e","z","e","th","i","k","l","m","n","x","o","p","r","s","s","t","u","ph","kh"
|
|||
|
`,`
|
|||
|
|
|||
|
`,"","","","",""," ","%0","%00","'","''","'''","`","``","```","^","<",">","*","!!","!?","-","_","-","^","***","--","/","-[","]-","[?]","?!","!?","7","PP","(]","[)","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","","","","","","","0","","","","4","5","6","7","8","9","+","-","=","(",")","n","0","1","2","3","4","5","6","7","8","9","+","-","=","(",")","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","ECU","CL","Cr","FF","L","mil","N","Pts","Rs","W","NS","D","EU","K","T","Dr","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","","","","","","","","","","","","","","","","","","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var Vj=v((Sxe,Qj)=>{Qj.exports=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"," 1/3 "," 2/3 "," 1/5 "," 2/5 "," 3/5 "," 4/5 "," 1/6 "," 5/6 "," 1/8 "," 3/8 "," 5/8 "," 7/8 "," 1/","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","L","C","D","M","i","ii","iii","iv","v","vi","vii","viii","ix","x","xi","xii","l","c","d","m","(D","D)","((|))",")","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","-","|","-","|","-","|","\\","/","\\","/","-","-","~","~","-","|","-","|","-","-","-","|","-","|","|","-","-","-","-","-","-","|","|","|","|","|","|","|","^","V","\\","=","V","^","-","-","|","|","-","-","|","|","=","|","=","=","|","=","|","=","=","=","=","=","=","|","=","|","=","|","\\","/","\\","/","=","=","~","~","|","|","-","|","-","|","-","-","-","|","-","|","|","|","|","|","|","|","-","\\","\\","|","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var tO=v((Dxe,eO)=>{eO.exports=["[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var nO=v((Txe,iO)=>{iO.exports=["[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]
|
|||
|
`:l=s,await(0,st.promisify)(F.appendFile)(this.fsPath,l,{encoding:"utf8",flag:"a+"});let u=await(0,st.promisify)(F.stat)(this.fsPath);if(this.shouldBackup(u.size)){let c=this.getBackupResource();await(0,st.promisify)(F.rename)(this.fsPath,c)}})()).catch(a=>{!global.REVISION&&console.error(a)})}}getCurrentTimestamp(){let t=new Date;return`${t.getFullYear()}-${hh(t.getMonth()+1)}-${hh(t.getDate())}T${gh(t)}`}getBackupResource(){return this.backupIndex=this.backupIndex>5?1:this.backupIndex,R.join(R.dirname(this.fsPath),`${R.basename(this.fsPath)}_${this.backupIndex++}`)}}});function ge(n,e){return n}function ye(n,e){return n??e}function Zi(n){return n<=0?Promise.resolve(void 0):new Promise(e=>{setTimeout(()=>{e(void 0)},n).unref()})}function ny(n,e){return new Promise(t=>{let i=e.onCancellationRequested(()=>{clearTimeout(r),t(!0)}),r=setTimeout(()=>{i.dispose(),t(!1)},n);r.unref()})}function Bq(){return new Promise(n=>{process.nextTick(()=>{n(void 0)})})}function cr(){return new Promise(n=>{setImmediate(()=>{n(void 0)})})}function ry(n,e){let t,i=r=>{t&&clearTimeout(t),t=setTimeout(()=>{n()},r??e),t.unref()};return Object.defineProperty(i,"clear",{get:()=>()=>{clearTimeout(t)}}),i}function fh(n,e,t=3){if(n.length==0)return Promise.resolve();let i=0,r=n.length,o=n.slice();return new Promise(s=>{let a=l=>{let u=()=>{if(i=i+1,i==r)s();else if(o.length){let c=o.shift();a(c)}};e(l).then(u,u)};for(let l=0;l<Math.min(t,o.length);l++){let u=o.shift();a(u)}})}function Y(n){for(;n.length;){let e=n.pop();e==null||e.dispose()}}var ph,ee=D(()=>{"use strict";ph=new Map([["<",">"],[">","<"],["{","}"],["[","]"],["(",")"]])});var B0={};qs(B0,{createLogger:()=>J,emptyFile:()=>Wq,getLoggerFile:()=>oy,getTimestamp:()=>gh,logger:()=>Yq,resolveLogFilepath:()=>qq});function qq(){let n=process.env.NVIM_COC_LOG_FILE;if(n)return n;let e=process.env.XDG_RUNTIME_DIR;if(e)try{return F.accessSync(e,F.constants.R_OK|F.constants.W_OK),R.join(e,`coc-nvim-${process.pid}.log`)}catch{}let t=Et.tmpdir();return e=R.join(t,`coc.nvim-${process.pid}`),F.mkdirSync(e,{recursive:!0}),R.join(e,"coc-nvim.log")}function Wq(n){if(F.existsSync(n))try{F.writeFileSync(n,"",{encoding:"utf8",mode:438})}catch{}}function oy(){return H0}function J(n="coc.nvim"){return Yq.createLogger(n)}var H0,Ute,Yq,Ce=D(()=>{"use strict";N0();ce();ee();N0();H0=qq();Wq(H0);Ute=ge(process.env.NVIM_COC_LOG_LEVEL||"info","off"),Yq=new iy(H0,Hq(Ute),{color:!global.REVISION&&process.platform!=="win32",userFormatters:!0})});var Jq=v((W0,Zq)=>{Zq.exports=q0(typeof Buffer<"u"&&Buffer)||q0(W0.Buffer)||q0(typeof window<"u"&&window.Buffer)||W0.Buffer;function q0(n){return n&&n.isBuffer&&n}});var Xq=v((Wu,$q)=>{var qu=$n(),Wu=$q.exports=Uq(0);Wu.alloc=Uq;Wu.concat=qu.concat;Wu.from=$te;function Uq(n){return new Array(n)}function $te(n){if(!qu.isBuffer(n)&&qu.isView(n))n=qu.Uint8Array.from(n);else if(qu.isArrayBuffer(n))n=new Uint8Array(n);else{if(typeof n=="string")return qu.from.call(Wu,n);if(typeof n=="number")throw new TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(n)}});var Kq=v((Zu,zq)=>{var Go=$n(),Yu=Go.global,Zu=zq.exports=Go.hasBuffer?Gq(0):[];Zu.alloc=Go.hasBuffer&&Yu.alloc||Gq;Zu.concat=Go.concat;Zu.from=Xte;function Gq(n){return Yu.alloc(n)}function Xte(n){if(!Go.isBuffer(n)&&Go.isView(n))n=Go.Uint8Array.from(n);else if(Go.isArrayBuffer(n))n=new Uint8Array(n);else{if(typeof n=="string")return Go.from.call(Zu,n);if(typeof n=="number")throw new TypeError('"value" argument must not be a number')}return Yu.from&&Yu.from.length!==1?Yu.from(n):new Yu(n)}});var eW=v((Ju,Vq)=>{var sy=$n(),Ju=Vq.exports=sy.hasArrayBuffer?Qq(0):[];Ju.alloc=Qq;Ju.concat=sy.concat;Ju.from=Gte;function Qq(n){return new Uint8Array(n)}function Gte(n){if(sy.isView(n)){var e=n.byteOffset,t=n.byteLength;n=n.buffer,n.byteLength!==t&&(n.slice?n=n.slice(e,e+t):(n=new Uint8Array(n),n.byteLength!==t&&(n=Array.prototype.slice.call(n,e,e+t))))}else{if(typeof n=="string")return sy.from.call(Ju,n);if(typeof n=="number")throw new TypeError('"value" argument must not be a number')}return new Uint8Arra
|
|||
|
`+l.split(/\r?\n/).slice(3).join(`
|
|||
|
`),this.client.logError(`request error on "${e}"`,t,a)}r(a)}else i(s)})})}getArgsByPrefix(e){return this.prefix!=="nvim_"&&e[0]!=this?[this.transport.isVim?this.data:this,...e]:e}getVar(e){return this.request(`${this.prefix}get_var`,[e]).then(t=>t,t=>null)}setVar(e,t,i=!1){if(i){this.notify(`${this.prefix}set_var`,[e,t]);return}return this.request(`${this.prefix}set_var`,[e,t])}deleteVar(e){this.notify(`${this.prefix}del_var`,[e])}getOption(e){return this.request(`${this.prefix}get_option`,[e])}setOption(e,t,i){if(i){this.notify(`${this.prefix}set_option`,[e,t]);return}return this.request(`${this.prefix}set_option`,[e,t])}notify(e,t=[]){this.transport.notify(e,this.getArgsByPrefix(t))}toJSON(){var e;return(e=this.data)!==null&&e!==void 0?e:0}};vy.BaseApi=dD});var xy=v(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});wy.Buffer=void 0;var $ne=Th(),hD=class extends $ne.BaseApi{constructor(){super(...arguments),this.prefix="nvim_buf_"}async attach(e=!1,t={}){return await this.request(`${this.prefix}attach`,[e,t])}async detach(){return await this.request(`${this.prefix}detach`,[])}get id(){return this.data}get length(){return this.request(`${this.prefix}line_count`,[])}get lines(){return this.getLines()}get changedtick(){return this.request(`${this.prefix}get_changedtick`,[])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[e])}getLines({start:e,end:t,strictIndexing:i}={start:0,end:-1,strictIndexing:!0}){let r=typeof i>"u"?!0:i;return this.request(`${this.prefix}get_lines`,[e,t,r])}setLines(e,t,i=!1){let{start:r,end:o,strictIndexing:s}=t??{};r=r??0,o=o??r+1;let a=s??!0;return this[i?"notify":"request"](`${this.prefix}set_lines`,[r,o,a,typeof e=="string"?[e]:e])}setVirtualText(e,t,i,r={}){return this.client.call("coc#vtext#add",[this.id,e,t,i,r],!0),Promise.resolve(e)}deleteExtMark(e,t){this.notify(`${this.prefix}del_extmark`,[e,t])}async getExtMarkById(e,t,i={}){return this.request(`${this.prefix}get_extmark_by_id`,[e,t,i])}async getExtMarks(e,t,i,r={}){return this.request(`${this.prefix}get_extmarks`,[e,t,i,r])}setExtMark(e,t,i,r={}){this.notify(`${this.prefix}set_extmark`,[e,t,i,r])}insert(e,t){return this.setLines(e,{start:t,end:t,strictIndexing:!0})}replace(e,t){let i=typeof e=="string"?[e]:e;return this.setLines(i,{start:t,end:t+i.length,strictIndexing:!1})}remove(e,t,i=!1){return this.setLines([],{start:e,end:t,strictIndexing:i})}append(e){return this.setLines(e,{start:-1,end:-1,strictIndexing:!1})}get name(){return this.request(`${this.prefix}get_name`,[])}setName(e){return this.request(`${this.prefix}set_name`,[e])}get valid(){return this.request(`${this.prefix}is_valid`,[])}mark(e){return this.request(`${this.prefix}get_mark`,[e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[e])}setKeymap(e,t,i,r={}){let o=r.expr?Object.assign({replace_keycodes:!0},r):r;this.notify(`${this.prefix}set_keymap`,[e,t,i,o])}deleteKeymap(e,t){this.notify(`${this.prefix}del_keymap`,[e,t])}get loaded(){return this.request(`${this.prefix}is_loaded`,[])}getOffset(e){return this.request(`${this.prefix}get_offset`,[e])}addHighlight({hlGroup:e,line:t,colStart:i,colEnd:r,srcId:o}){if(!e)throw new Error("hlGroup should not empty");let s=typeof r<"u"?r:-1,a=typeof i<"u"?i:-0,l=typeof o<"u"?o:-1,u=l==0?"request":"notify",c=this[u](`${this.prefix}add_highlight`,[l,e,t,a,s]);return u==="request"?c:Promise.resolve(null)}clearHighlight(e={}){let t={srcId:-1,lineStart:0,lineEnd:-1},{srcId:i,lineStart:r,lineEnd:o}=Object.assign({},t,e);return this.notify(`${this.prefix}clear_highlight`,[i,r,o])}highlightRanges(e,t,i){this.client.call("coc#highlight#ranges",[this.id,e,t,i],!0)}clearNamespace(e,t=0,i=-1){this.client.call("coc#highlight#clear_highlight",[this.id,e,t,i],!0)}placeSign(e){let t={lnum:e.lnum};typeof e.priority=="number"&&(t.priority=e.priority),this.client.call("sign_place",[e.id||0,e.group||"",e.name,this.id,t],!0)}unplaceSign(e){let t={buffer:this.id};e.id!=null&&(t.id=e.id),this.client.call("sign_unplace",[e.group||"",t],!0)}async getSigns(e){return
|
|||
|
`}debug(e,...t){gr.level!="debug"||gl||this.stream.write(this.getText("debug",e,t))}info(e,...t){gl||this.stream.write(this.getText("info",e,t))}warn(e,...t){gl||this.stream.write(this.getText("warn",e,t))}error(e,...t){if(gl)return;(tc?process.stderr:this.stream).write(this.getText("error",e,t))}trace(e,...t){gr.level!="trace"||gl||this.stream.write(this.getText("trace",e,t))}};function lre(n){return new xD(n)}gr.createLogger=lre});var TD=v(DD=>{"use strict";Object.defineProperty(DD,"__esModule",{value:!0});var ure=require("events"),T8=ky(),D8=T8.level==="debug",kh=(0,T8.createLogger)("transport"),SD=class extends ure.EventEmitter{constructor(e,t){super(),this.logger=e,this.isVim=t,this.pauseLevel=0,this.paused=new Map}debug(e,...t){!D8||kh.debug(e,...t)}info(e,...t){kh.info(e,...t)}debugMessage(e){if(!D8)return;let t=e[0];t==0?kh.debug("receive request:",e.slice(1)):t==1||(t==2?kh.debug("receive notification:",e.slice(1)):kh.debug("unknown message:",e))}pauseNotification(){this.pauseLevel=this.pauseLevel+1,this.paused.set(this.pauseLevel,[])}cancelNotification(){let{pauseLevel:e}=this;e>0&&(this.paused.delete(e),this.pauseLevel=e-1)}resumeNotification(e=!1){let{pauseLevel:t}=this;if(t==0)return e?null:Promise.resolve([[],null]);let i={};Error.captureStackTrace(i),this.pauseLevel=t-1;let r=this.paused.get(t);return this.paused.delete(t),r&&r.length?new Promise((o,s)=>{if(!e)return this.request("nvim_call_atomic",[r],(a,l)=>{if(a){let u=new Error(`call_atomic error: ${a[1]}`);return u.stack=i.stack.replace(/^Error/,`Error: ${u.message}`),s(u)}if(Array.isArray(l)&&l[1]!=null){let[u,c,d]=l[1],[h,g]=r[u],f=new Error(`call_atomic request error on "${h}": ${d}`);return f.stack=i.stack.replace(/^Error/,`Error: ${f.message}`),this.logger.error(`call_atomic request error ${c} on "${h}"`,g,d,f),s(f)}o(l)});this.notify("nvim_call_atomic",[r]),o(void 0)}):e?null:Promise.resolve([[],void 0])}};DD.default=SD});var P8=v(pr=>{"use strict";var cre=pr&&pr.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),dre=pr&&pr.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),hre=pr&&pr.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&cre(e,n,t);return dre(e,n),e},k8=pr&&pr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(pr,"__esModule",{value:!0});pr.NvimTransport=void 0;var Qo=hre(v8()),gre=w8(),pre=k8(C8()),fre=k8(TD()),kD=class extends fre.default{constructor(e){super(e,!1),this.pending=new Map,this.nextRequestId=1,this.attached=!1;let t=this.setupCodec();this.encodeStream=Qo.createEncodeStream({codec:t}),this.decodeStream=Qo.createDecodeStream({codec:t}),this.decodeStream.on("data",i=>{this.parseMessage(i)}),this.decodeStream.on("end",()=>{this.detach(),this.emit("detach")})}parseMessage(e){let t=e[0];if(this.debugMessage(e),t===0){let i=e[2].toString();this.emit("request",i,e[3],this.createResponse(i,e[1]))}else if(t===1){let i=e[1],r=this.pending.get(i);if(r){this.pending.delete(i);let o=e[2];o&&o.length!=2&&(o=[0,o.toString()]),r(o,e[3])}}else t===2?this.emit("notification",e[1].toString(),e[2]):console.error(`Invalid message type ${t}`)}setupCodec(){let e=Qo.createCodec();return gre.Metadata.forEach(({constructor:t},i)=>{e.addExtPacker(i,t,r=>Qo.encode(r.data)),e.addExtUnpacker(i,r=>new t({client:this.client,data:Qo.decode(r)}))}),this.codec=e,this.codec}attach(e,t,i){this.encodeStream=this.encodeStream.pipe(e);let r=new pre.default;t.pipe(r).pipe(this.decodeStream),this.writer=e,this.reader=t,this.client=i,this.attached=!0}detach(){if(!!this.attached){this.attached=!1,this.encodeStream.unpipe(this.writer),this.reader.unpipe(this.decodeStream);for(let e of this.pending.values
|
|||
|
`)}redraw(e){this.send(["redraw",e?"force":""])}command(e){this.send(["ex",e])}expr(e){this.send(["expr",e])}call(e,t,i){if(typeof i=="number"){this.send(["call",e,t,i]);return}this.send(["call",e,t])}dispose(){typeof this.clean=="function"&&(this.clean(),this.clean=void 0),this.removeAllListeners()}};_h.default=PD});var _8=v(_D=>{"use strict";Object.defineProperty(_D,"__esModule",{value:!0});var wre=Ph(),xre=wre.isCocNvim?"coc#api#call":"nvim#api#call",RD=class{constructor(e,t,i){this.connection=e,this.cb=t,this.id=i}request(e,t=[]){this.method=e,this.connection.call(xre,[e.slice(5),t],this.id)}callback(e,t,i){let{method:r,cb:o}=this;if(t)return o([0,t.toString()]);switch(r){case"nvim_list_wins":case"nvim_tabpage_list_wins":return o(null,i.map(s=>e.createWindow(s)));case"nvim_tabpage_get_win":case"nvim_get_current_win":case"nvim_open_win":return o(null,e.createWindow(i));case"nvim_list_bufs":return o(null,i.map(s=>e.createBuffer(s)));case"nvim_win_get_buf":case"nvim_create_buf":case"nvim_get_current_buf":return o(null,e.createBuffer(i));case"nvim_list_tabpages":return o(null,i.map(s=>e.createTabpage(s)));case"nvim_win_get_tabpage":case"nvim_get_current_tabpage":return o(null,e.createTabpage(i));default:return o(null,i)}}};_D.default=RD});var E8=v(nc=>{"use strict";var ID=nc&&nc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(nc,"__esModule",{value:!0});nc.VimTransport=void 0;var Cre=Ph(),Sre=ID(TD()),Dre=ID(R8()),Tre=ID(_8()),ED=class extends Sre.default{constructor(e){super(e,!0),this.pending=new Map,this.nextRequestId=-1,this.attached=!1,this.errText="",this.outText="",this.notifyMethod=Cre.isCocNvim?"coc#api#notify":"nvim#api#notify"}attach(e,t,i){let r=this.connection=new Dre.default(t,e);this.attached=!0,this.client=i,r.on("request",(o,s)=>{let[a,l]=s;this.emit("request",a,l,this.createResponse(a,o))}),r.on("notification",o=>{let[s,a]=o;this.emit("notification",s.toString(),a)}),r.on("response",(o,s)=>{let a=this.pending.get(o);if(a){this.pending.delete(o);let l=null,u=null;Array.isArray(s)?(l=s[0],u=s[1]):l=s,a.callback(this.client,l,u)}})}send(e){this.connection.send(e)}detach(){if(!!this.attached){this.attached=!1,this.connection.dispose();for(let e of this.pending.values())e.callback(this.client,"connection disconnected",null);this.pending.clear()}}request(e,t,i){if(!this.attached)return i([0,"transport disconnected"]);let r=this.nextRequestId;this.nextRequestId=this.nextRequestId-1;let o=new Tre.default(this.connection,(s,a)=>{i(s,a)},r);this.pending.set(r,o),o.request(e,t)}notify(e,t){if(!this.attached)return;if(this.pauseLevel!=0){let r=this.paused.get(this.pauseLevel);if(r){r.push([e,t]);return}}let i=e.slice(5);if(i=="err_write"){this.errText=this.errText+t[0].toString();return}if(i=="out_write"){let r=t[0].toString()||"";if(!r.includes(`
|
|||
|
`))this.outText=this.outText+r;else{let o=this.outText+t[0].toString();this.outText="",this.connection.call(this.notifyMethod,[i,[o]])}return}if(i=="err_writeln"){let r=this.errText+t[0].toString();this.errText="",this.connection.call(this.notifyMethod,[i,[r]]);return}this.connection.call(this.notifyMethod,[i,t])}createResponse(e,t){let i=!1,{connection:r}=this;return{send:(o,s)=>{if(i||!this.attached)return;i=!0;let a=null;s&&(a=typeof o=="string"?o:o.toString()),r.response(t,[a,s?null:o])}}}};nc.VimTransport=ED});var I8=v(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.Neovim=void 0;var kre=Th(),Pre=Ph();function Eh(n){return n?Array.isArray(n)?n:[n]:[]}var LD=class extends kre.BaseApi{constructor(){super(...arguments),this.prefix="nvim_"}get apiInfo(){return this.request(`${this.prefix}get_api_info`)}get buffers(){return this.request(`${this.prefix}list_bufs`)}get buffer(){return this.request(`${this.prefix}get_current_buf`)}async setBuffer(e){await this.request(`${this.prefix}set_current_buf`,[e])}get chans(){return this.request(`${this.prefix}list_chans`)}getChanInfo(e){return this.request(`${this.prefix}get_chan_info`,[e])}createNamespace(e=""){return Pre.isCocNvim?(e=e.startsWith("coc-")?e.slice(4):e,this.request(`${this.prefix}call_function`,["coc#highlight#create_namespace",[e]])):this.request(`${this.prefix}create_namespace`,[e])}get namespaces(){return this.request(`${this.prefix}get_namespaces`,[])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[e])}get tabpages(){return this.request(`${this.prefix}list_tabpages`)}get tabpage(){return this.request(`${this.prefix}get_current_tabpage`)}async setTabpage(e){await this.request(`${this.prefix}set_current_tabpage`,[e])}get windows(){return this.getWindows()}get window(){return this.request(`${this.prefix}get_current_win`)}getWindows(){return this.request(`${this.prefix}list_wins`)}async setWindow(e){await this.request(`${this.prefix}set_current_win`,[e])}get runtimePaths(){return this.request(`${this.prefix}list_runtime_paths`)}setDirectory(e){return this.request(`${this.prefix}set_current_dir`,[e])}get line(){return this.getLine()}createNewBuffer(e=!1,t=!1){return this.request(`${this.prefix}create_buf`,[e,t])}openFloatWindow(e,t,i){return this.request(`${this.prefix}open_win`,[e,t,i])}getLine(){return this.request(`${this.prefix}get_current_line`)}setLine(e){return this.request(`${this.prefix}set_current_line`,[e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[e])}setKeymap(e,t,i,r={}){let o=r.expr?Object.assign({replace_keycodes:!0},r):r;this.notify(`${this.prefix}set_keymap`,[e,t,i,o])}deleteKeymap(e,t){this.notify(`${this.prefix}del_keymap`,[e,t])}get mode(){return this.request(`${this.prefix}get_mode`)}get colorMap(){return this.request(`${this.prefix}get_color_map`)}getColorByName(e){return this.request(`${this.prefix}get_color_by_name`,[e])}getHighlight(e,t=!0){let i=typeof e=="string"?"by_name":"by_id";return this.request(`${this.prefix}get_hl_${i}`,[e,t])}getHighlightByName(e,t=!0){return this.request(`${this.prefix}get_hl_by_name`,[e,t])}getHighlightById(e,t=!0){return this.request(`${this.prefix}get_hl_by_id`,[e,t])}deleteCurrentLine(){return this.request(`${this.prefix}del_current_line`)}eval(e){return this.request(`${this.prefix}eval`,[e])}lua(e,t=[]){return this.request(`${this.prefix}exec_lua`,[e,t])}executeLua(e,t=[]){let i=Eh(t);return this.lua(e,i)}callDictFunction(e,t,i=[]){let r=Eh(i);return this.request(`${this.prefix}call_dict_function`,[e,t,r])}call(e,t=[],i){let r=Eh(t);return i?(this.notify(`${this.prefix}call_function`,[e,r]),null):this.request(`${this.prefix}call_function`,[e,r])}callTimer(e,t=[],i){let r=Eh(t);return i?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,r]]),null):this.transport.isVim?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,r]]),new Promise(o=>{setTimeout(()=>{o(null)},20)})):this.request(`${this.prefix}call_function`,["coc#util#timer",[e,r]])}callAsync(e,t=[]){let i=Eh(t);return this.cl
|
|||
|
`)}errWrite(e){this.notify(`${this.prefix}err_write`,[e])}errWriteLine(e){this.notify(`${this.prefix}err_writeln`,[e])}get uis(){return this.request(`${this.prefix}list_uis`)}uiAttach(e,t,i){return this.request(`${this.prefix}ui_attach`,[e,t,i])}uiDetach(){return this.request(`${this.prefix}ui_detach`,[])}uiTryResize(e,t){return this.request(`${this.prefix}ui_try_resize`,[e,t])}uiSetOption(e,t){return this.request(`${this.prefix}ui_set_option`,[e,t])}subscribe(e){return this.request(`${this.prefix}subscribe`,[e])}unsubscribe(e){return this.request(`${this.prefix}unsubscribe`,[e])}setClientInfo(e,t,i,r,o){this.notify(`${this.prefix}set_client_info`,[e,t,i,r,o])}async quit(){this.command("qa!",!0),this.transport&&this.transport.detach()}};Py.Neovim=LD});var Iy=v(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.NeovimClient=rc.AsyncResponse=void 0;var Rre=P8(),_re=E8(),Ry=Ph(),Ere=xy(),Ire=I8(),Lre=Ty(),Fre=Sy(),Mre=require("events"),jre=["nvim_buf_attach","nvim_get_mode","nvim_list_runtime_paths","nvim_win_del_var","nvim_create_buf","nvim_exec","nvim_tabpage_list_wins","nvim_buf_del_var","nvim_buf_get_mark","nvim_tabpage_set_var","nvim_create_namespace","nvim_win_get_position","nvim_win_set_height","nvim_call_atomic","nvim_buf_detach","nvim_buf_line_count","nvim_set_current_buf","nvim_set_current_dir","nvim_get_var","nvim_del_current_line","nvim_win_set_width","nvim_out_write","nvim_win_is_valid","nvim_set_current_win","nvim_get_current_tabpage","nvim_tabpage_is_valid","nvim_set_var","nvim_win_get_height","nvim_win_get_buf","nvim_win_get_width","nvim_buf_set_name","nvim_subscribe","nvim_get_current_win","nvim_feedkeys","nvim_get_vvar","nvim_tabpage_get_number","nvim_get_current_buf","nvim_win_get_option","nvim_win_get_cursor","nvim_get_current_line","nvim_win_get_var","nvim_buf_get_var","nvim_set_current_tabpage","nvim_buf_clear_namespace","nvim_err_write","nvim_del_var","nvim_call_dict_function","nvim_set_current_line","nvim_get_api_info","nvim_unsubscribe","nvim_get_option","nvim_list_wins","nvim_set_client_info","nvim_win_set_cursor","nvim_win_set_option","nvim_eval","nvim_tabpage_get_var","nvim_buf_get_option","nvim_tabpage_del_var","nvim_buf_get_name","nvim_list_bufs","nvim_win_set_buf","nvim_win_close","nvim_command_output","nvim_command","nvim_tabpage_get_win","nvim_win_set_var","nvim_buf_add_highlight","nvim_buf_set_var","nvim_win_get_number","nvim_strwidth","nvim_buf_set_lines","nvim_err_writeln","nvim_buf_set_option","nvim_list_tabpages","nvim_set_option","nvim_buf_get_lines","nvim_buf_get_changedtick","nvim_win_get_tabpage","nvim_call_function","nvim_buf_is_valid"],_y=class{constructor(e,t){this.requestId=e,this.cb=t,this.finished=!1}finish(e,t){if(!this.finished){if(this.finished=!0,e){this.cb(new Error(e));return}this.cb(null,t)}}};rc.AsyncResponse=_y;function Ore(n,e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(i=>{Object.defineProperty(n.prototype,i,Object.getOwnPropertyDescriptor(t.prototype,i)||Object.create(null))})})}var Ey=class extends Ire.Neovim{constructor(e,t){super({}),this.logger=e,this.isVim=t,this.requestId=1,this.responses=new Map,this.attachedBuffers=new Map,this._transport=t?new _re.VimTransport(e):new Rre.NvimTransport(e),this.handleRequest=this.handleRequest.bind(this),this.handleNotification=this.handleNotification.bind(this)}get transport(){return this._transport}echoError(e){let t=Ry.isCocNvim?"[coc.nvim] ":"";e instanceof Error?(Ry.isTester||this.errWriteLine(t+e.message+" use :CocOpenLog for details"),this.logError(e.message||"Unknown error",e)):(Ry.isTester||this.errWriteLine(t+e),this.logError(e.toString(),new Error))}logError(e,...t){Ry.isTester&&console.error(e,...t),this.logger&&this.logger.error(e,...t)}createBuffer(e){return new Ere.Buffer({data:e,client:this})}createWindow(e){return new Fre.Window({data:e,client:this})}createTabpage(e){return new Lre.Tabpage({data:e,client:this})}redrawVim(e){!this.isVim||this.transport.notify("nvim_command",["redraw"+(e?"!":"")])}attach({reader:e,writer:t},i=!0){this.transport.attach(t,e,this),this.tran
|
|||
|
`,WD=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,t=0,i=0,r=0;e:for(;t<this._chunks.length;){let l=this._chunks[t];i=0;t:for(;i<l.length;){switch(l[i]){case zre:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case Kre:switch(e){case 1:e=2;break;case 3:e=4,i++;break e;default:e=0}break;default:e=0}i++}r+=l.byteLength,t++}if(e!==4)return;let o=this._read(r+i),s=new Map,a=this.toString(o,"ascii").split(Qre);if(a.length<2)return s;for(let l=0;l<a.length-2;l++){let u=a[l],c=u.indexOf(":");if(c===-1)throw new Error("Message header must separate key and value using :");let d=u.substr(0,c),h=u.substr(c+1).trim();s.set(d,h)}return s}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let t=this.allocNative(e),i=0,r=0;for(;e>0;){let o=this._chunks[r];if(o.byteLength>e){let s=o.slice(0,e);t.set(s,i),i+=e,this._chunks[r]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,i),i+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}};qy.AbstractMessageBuffer=WD});var J8=v(UD=>{"use strict";Object.defineProperty(UD,"__esModule",{value:!0});var Vre=Vo(),Y8=require("util"),pl=qD(),eoe=W8(),sc=class extends eoe.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return sc.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new Y8.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?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)}};sc.emptyBuffer=Buffer.allocUnsafe(0);var YD=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),pl.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),pl.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),pl.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),pl.Disposable.create(()=>this.stream.off("data",e))}},ZD=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),pl.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),pl.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),pl.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,r)=>{let o=s=>{s==null?i():r(s)};typeof e=="string"?this.stream.write(e,t,o):this.stream.write(e,o)})}end(){this.stream.end()}},Z8=Object.freeze({messageBuffer:Object.freeze({create:n=>new sc(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new Y8.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new YD(n),asWritableStream:n=>new ZD(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function JD(){ret
|
|||
|
`,moe;(function(n){function e(t){let i=t;return i&&Oh.func(i.dispose)&&Oh.func(i.onClose)&&Oh.func(i.onError)&&Oh.func(i.write)}n.is=e})(moe=is.MessageWriter||(is.MessageWriter={}));var Uy=class{constructor(){this.errorEmitter=new V8.Emitter,this.closeEmitter=new V8.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}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: ${Oh.string(e.message)?e.message:"unknown"}`)}};is.AbstractMessageWriter=Uy;var RT;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Q8.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Q8.default)().applicationJson.encoder}}n.fromOptions=e})(RT||(RT={}));var _T=class extends Uy{constructor(e,t){super(),this.writable=e,this.options=RT.fromOptions(t),this.errorCount=0,this.writeSemaphore=new poe.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let r=[];return r.push(foe,i.byteLength.toString(),e2),r.push(e2),this.doWrite(e,r,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};is.WriteableStreamMessageWriter=_T});var a2=v(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createMessageConnection=Oe.ConnectionOptions=Oe.CancellationStrategy=Oe.CancellationSenderStrategy=Oe.CancellationReceiverStrategy=Oe.ConnectionStrategy=Oe.ConnectionError=Oe.ConnectionErrors=Oe.LogTraceNotification=Oe.SetTraceNotification=Oe.TraceFormat=Oe.TraceValues=Oe.Trace=Oe.NullLogger=Oe.ProgressType=Oe.ProgressToken=void 0;var i2=Vo(),ki=ac(),qe=fT(),n2=bT(),Ah=uc(),ET=CT(),Hh;(function(n){n.type=new qe.NotificationType("$/cancelRequest")})(Hh||(Hh={}));var r2;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(r2=Oe.ProgressToken||(Oe.ProgressToken={}));var Nh;(function(n){n.type=new qe.NotificationType("$/progress")})(Nh||(Nh={}));var IT=class{constructor(){}};Oe.ProgressType=IT;var LT;(function(n){function e(t){return ki.func(t)}n.is=e})(LT||(LT={}));Oe.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Dt;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(Dt=Oe.Trace||(Oe.Trace={}));var boe;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(boe=Oe.TraceValues||(Oe.TraceValues={}));(function(n){function e(i){if(!ki.string(i))return n.Off;switch(i=i.toLowerCase(),i){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(i){switch(i){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(Dt=Oe.Trace||(Oe.Trace={}));var Zr;(function(n){n.Text="text",n.JSON="json"})(Zr=Oe.TraceFormat||(Oe.TraceFormat={}));(function(n){function e(t){return ki.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(Zr=Oe.TraceFormat||(Oe.TraceFormat={}));var o2;(function(n){n.type=new qe.NotificationType("$/setTrace")})(o2=Oe.SetTraceNotification||(Oe.SetTraceNotification={}));var FT;(function(n){n.type=new qe.NotificationType("$/logTrace")})(FT=Oe.LogTraceNotification||(Oe.LogTraceNotification={}));var $y;(function(n){n[n.Cl
|
|||
|
${JSON.stringify(E.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let G=E.id,ue=y.get(G);if(Eb(E,ue),ue!==void 0){y.delete(G);try{if(E.error){let De=E.error,_t=new qe.ResponseError(De.code,De.message,De.data);ue.stack&&(_t.stack=ue.stack),ue.reject(_t)}else if(E.result!==void 0)ue.resolve(E.result);else throw new Error("Should never happen.")}catch(De){De.message?r.error(`Response handler '${ue.method}' failed with message: ${De.message}`):r.error(`Response handler '${ue.method}' failed unexpectedly.`)}}}}function et(E){if(Ee())return;let G,ue;if(E.method===Hh.type.method){let De=E.params.id;w.delete(De),$d(E);return}else{let De=h.get(E.method);De&&(ue=De.handler,G=De.type)}if(ue||d)try{if($d(E),ue)if(E.params===void 0)G!==void 0&&G.numberOfParams!==0&&G.parameterStructures!==qe.ParameterStructures.byName&&r.error(`Notification ${E.method} defines ${G.numberOfParams} params but received none.`),ue();else if(Array.isArray(E.params)){let De=E.params;E.method===Nh.type.method&&De.length===2&&r2.is(De[0])?ue({token:De[0],value:De[1]}):(G!==void 0&&(G.parameterStructures===qe.ParameterStructures.byName&&r.error(`Notification ${E.method} defines parameters by name but received parameters by position`),G.numberOfParams!==E.params.length&&r.error(`Notification ${E.method} defines ${G.numberOfParams} params but received ${De.length} arguments`)),ue(...De))}else G!==void 0&&G.parameterStructures===qe.ParameterStructures.byPosition&&r.error(`Notification ${E.method} defines parameters by position but received parameters by name`),ue(E.params);else d&&d(E.method,E.params)}catch(De){De.message?r.error(`Notification handler '${E.method}' failed with message: ${De.message}`):r.error(`Notification handler '${E.method}' failed unexpectedly.`)}else K.fire(E)}function tt(E){if(!E){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message:
|
|||
|
${JSON.stringify(E,null,4)}`);let G=E;if(ki.string(G.id)||ki.number(G.id)){let ue=G.id,De=y.get(ue);De&&De.reject(new Error("The received response has neither a result nor an error property."))}}function Ke(E){if(E!=null)switch(C){case Dt.Verbose:return JSON.stringify(E,null,4);case Dt.Compact:return JSON.stringify(E);default:return}}function Ci(E){if(!(C===Dt.Off||!T))if(P===Zr.Text){let G;(C===Dt.Verbose||C===Dt.Compact)&&E.params&&(G=`Params: ${Ke(E.params)}
|
|||
|
|
|||
|
`),T.log(`Sending request '${E.method} - (${E.id})'.`,G)}else Iu("send-request",E)}function Nr(E){if(!(C===Dt.Off||!T))if(P===Zr.Text){let G;(C===Dt.Verbose||C===Dt.Compact)&&(E.params?G=`Params: ${Ke(E.params)}
|
|||
|
|
|||
|
`:G=`No parameters provided.
|
|||
|
|
|||
|
`),T.log(`Sending notification '${E.method}'.`,G)}else Iu("send-notification",E)}function Tn(E,G,ue){if(!(C===Dt.Off||!T))if(P===Zr.Text){let De;(C===Dt.Verbose||C===Dt.Compact)&&(E.error&&E.error.data?De=`Error data: ${Ke(E.error.data)}
|
|||
|
|
|||
|
`:E.result?De=`Result: ${Ke(E.result)}
|
|||
|
|
|||
|
`:E.error===void 0&&(De=`No result returned.
|
|||
|
|
|||
|
`)),T.log(`Sending response '${G} - (${E.id})'. Processing request took ${Date.now()-ue}ms`,De)}else Iu("send-response",E)}function Yn(E){if(!(C===Dt.Off||!T))if(P===Zr.Text){let G;(C===Dt.Verbose||C===Dt.Compact)&&E.params&&(G=`Params: ${Ke(E.params)}
|
|||
|
|
|||
|
`),T.log(`Received request '${E.method} - (${E.id})'.`,G)}else Iu("receive-request",E)}function $d(E){if(!(C===Dt.Off||!T||E.method===FT.type.method))if(P===Zr.Text){let G;(C===Dt.Verbose||C===Dt.Compact)&&(E.params?G=`Params: ${Ke(E.params)}
|
|||
|
|
|||
|
`:G=`No parameters provided.
|
|||
|
|
|||
|
`),T.log(`Received notification '${E.method}'.`,G)}else Iu("receive-notification",E)}function Eb(E,G){if(!(C===Dt.Off||!T))if(P===Zr.Text){let ue;if((C===Dt.Verbose||C===Dt.Compact)&&(E.error&&E.error.data?ue=`Error data: ${Ke(E.error.data)}
|
|||
|
|
|||
|
`:E.result?ue=`Result: ${Ke(E.result)}
|
|||
|
|
|||
|
`:E.error===void 0&&(ue=`No result returned.
|
|||
|
|
|||
|
`)),G){let De=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";T.log(`Received response '${G.method} - (${E.id})' in ${Date.now()-G.timerStart}ms.${De}`,ue)}else T.log(`Received response ${E.id} without active response promise.`,ue)}else Iu("receive-response",E)}function Iu(E,G){if(!T||C===Dt.Off)return;let ue={isLSPMessage:!0,type:E,message:G,timestamp:Date.now()};T.log(ue)}function Xd(){if(re())throw new Ks($y.Closed,"Connection is closed.");if(Ee())throw new Ks($y.Disposed,"Connection is disposed.")}function yQ(){if(Q())throw new Ks($y.AlreadyListening,"Connection is already listening")}function vQ(){if(!Q())throw new Error("Call listen() first.")}function Gd(E){return E===void 0?null:E}function xI(E){if(E!==null)return E}function CI(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function MS(E,G){switch(E){case qe.ParameterStructures.auto:return CI(G)?xI(G):[Gd(G)];case qe.ParameterStructures.byName:if(!CI(G))throw new Error("Received parameters by name but param is not an object literal.");return xI(G);case qe.ParameterStructures.byPosition:return[Gd(G)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function SI(E,G){let ue,De=E.numberOfParams;switch(De){case 0:ue=void 0;break;case 1:ue=MS(E.parameterStructures,G[0]);break;default:ue=[];for(let _t=0;_t<G.length&&_t<De;_t++)ue.push(Gd(G[_t]));if(G.length<De)for(let _t=G.length;_t<De;_t++)ue.push(null);break}return ue}let Lu={sendNotification:(E,...G)=>{Xd();let ue,De;if(ki.string(E)){ue=E;let Yt=G[0],Ht=0,Ii=qe.ParameterStructures.auto;qe.ParameterStructures.is(Yt)&&(Ht=1,Ii=Yt);let dt=G.length,Qt=dt-Ht;switch(Qt){case 0:De=void 0;break;case 1:De=MS(Ii,G[Ht]);break;default:if(Ii===qe.ParameterStructures.byName)throw new Error(`Received ${Qt} parameters for 'by Name' notification parameter structure.`);De=G.slice(Ht,dt).map(yt=>Gd(yt));break}}else{let Yt=G;ue=E.method,De=SI(E,Yt)}let _t={jsonrpc:l,method:ue,params:De};return Nr(_t),e.write(_t).catch(()=>r.error("Sending notification failed."))},onNotification:(E,G)=>{Xd();let ue;return ki.func(E)?d=E:G&&(ki.string(E)?(ue=E,h.set(E,{type:void 0,handler:G})):(ue=E.method,h.set(E.method,{type:E,handler:G}))),{dispose:()=>{ue!==void 0?h.delete(ue):d=void 0}}},onProgress:(E,G,ue)=>{if(g.has(G))throw new Error(`Progress handler for token ${G} already registered`);return g.set(G,ue),{dispose:()=>{g.delete(G)}}},sendProgress:(E,G,ue)=>Lu.sendNotification(Nh.type,{token:G,value:ue}),onUnhandledProgress:X.event,sendRequest:(E,...G)=>{Xd(),vQ();let ue,De,_t;if(ki.string(E)){ue=E;let dt=G[0],Qt=G[G.length-1],yt=0,Si=qe.ParameterStructures.auto;qe.ParameterStructures.is(dt)&&(yt=1,Si=dt);let kn=G.length;ET.CancellationToken.is(Qt)&&(kn=kn-1,_t=Qt);let Hs=kn-yt;switch(Hs){case 0:De=void 0;break;case 1:De=MS(Si,G[yt]);break;default:if(Si===qe.ParameterStructures.byName)throw new Error(`Received ${Hs} parameters for 'by Name' request parameter structure.`);De=G.slice(yt,kn).map(Bs=>Gd(Bs));break}}else{let dt=G;ue=E.method,De=SI(E,dt);let Qt=E.numberOfParams;_t=ET.CancellationToken.is(dt[Qt])?dt[Qt]:void 0}let Yt=o++,Ht;return _t&&(Ht=_t.onCancellationRequested(()=>{let dt=B.sender.sendCancellation(Lu,Yt);return dt===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${Yt}`),Promise.resolve()):dt.catch(()=>{r.log(`Sending cancellation messages for id ${Yt} failed`)})})),new Promise((dt,Qt)=>{let yt={jsonrpc:l,id:Yt,method:ue,params:De},Si=Bs=>{dt(Bs),B.sender.cleanup(Yt),Ht==null||Ht.dispose()},kn=Bs=>{Qt(Bs),B.sender.cleanup(Yt),Ht==null||Ht.dispose()},Hs={method:ue,timerStart:Date.now(),resolve:Si,reject:kn};Error.captureStackTrace(Hs),Ci(yt);try{e.write(yt).catch(()=>r.error("Sending request failed."))}catch(Bs){Hs.reject(new qe.ResponseError(qe.ErrorCodes.MessageWriteError,Bs.message?Bs.message:"Unknown reason")),Hs=null}Hs&&y.set(Yt,Hs)})},onRequest:(E,G)=>{Xd();let ue=null;return LT.is(E)?(ue=void 0,u=E):ki.string(E)?(ue=null,G!==void 0&&(ue=E,c.set(E,{handler:G,type:void 0}))):G!==void 0&&(ue=E.method,c.set(E.method,{type:E,handler:G})),{dispose
|
|||
|
`,`\r
|
|||
|
`,"\r"];(function(n){function e(o,s,a,l){return new Ooe(o,s,a,l)}n.create=e;function t(o){var s=o;return!!(N.defined(s)&&N.string(s.uri)&&(N.undefined(s.languageId)||N.string(s.languageId))&&N.uinteger(s.lineCount)&&N.func(s.getText)&&N.func(s.positionAt)&&N.func(s.offsetAt))}n.is=t;function i(o,s){for(var a=o.getText(),l=r(s,function(f,m){var y=f.range.start.line-m.range.start.line;return y===0?f.range.start.character-m.range.start.character:y}),u=a.length,c=l.length-1;c>=0;c--){var d=l[c],h=o.offsetAt(d.range.start),g=o.offsetAt(d.range.end);if(g<=u)a=a.substring(0,h)+d.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");u=h}return a}n.applyEdits=i;function r(o,s){if(o.length<=1)return o;var a=o.length/2|0,l=o.slice(0,a),u=o.slice(a);r(l,s),r(u,s);for(var c=0,d=0,h=0;c<l.length&&d<u.length;){var g=s(l[c],u[d]);g<=0?o[h++]=l[c++]:o[h++]=u[d++]}for(;c<l.length;)o[h++]=l[c++];for(;d<u.length;)o[h++]=u[d++];return o}})(ZT||(ZT={}));Ooe=function(){function n(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(n.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),n.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content},n.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},n.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var e=[],t=this._content,i=!0,r=0;r<t.length;r++){i&&(e.push(r),i=!1);var o=t.charAt(r);i=o==="\r"||o===`
|
|||
|
`,o==="\r"&&r+1<t.length&&t.charAt(r+1)===`
|
|||
|
`&&r++}i&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},n.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return V.create(0,e);for(;i<r;){var o=Math.floor((i+r)/2);t[o]>e?r=o:i=o+1}var s=i-1;return V.create(s,e-t[s])},n.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)},Object.defineProperty(n.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),n}();(function(n){var e=Object.prototype.toString;function t(g){return typeof g<"u"}n.defined=t;function i(g){return typeof g>"u"}n.undefined=i;function r(g){return g===!0||g===!1}n.boolean=r;function o(g){return e.call(g)==="[object String]"}n.string=o;function s(g){return e.call(g)==="[object Number]"}n.number=s;function a(g,f,m){return e.call(g)==="[object Number]"&&f<=g&&g<=m}n.numberRange=a;function l(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}n.integer=l;function u(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}n.uinteger=u;function c(g){return e.call(g)==="[object Function]"}n.func=c;function d(g){return g!==null&&typeof g=="object"}n.objectLiteral=d;function h(g,f){return Array.isArray(g)&&g.every(f)}n.typedArray=h})(N||(N={}))});var ti=v(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ProtocolNotificationType=vn.ProtocolNotificationType0=vn.ProtocolRequestType=vn.ProtocolRequestType0=vn.RegistrationType=vn.MessageDirection=void 0;var fc=wl(),Aoe;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(Aoe=vn.MessageDirection||(vn.MessageDirection={}));var UT=class{constructor(e){this.method=e}};vn.RegistrationType=UT;var $T=class extends fc.RequestType0{constructor(e){super(e)}};vn.ProtocolRequestType0=$T;var XT=class extends fc.RequestType{constructor(e){super(e,fc.ParameterStructures.byName)}};vn.ProtocolRequestType=XT;var GT=class extends fc.NotificationType0{constructor(e){super(e)}};vn.ProtocolNotificationType0=GT;var zT=class extends fc.NotificationType{constructor(e){super(e,fc.ParameterStructures.byName)}};vn.ProtocolNotificationType=zT});var ev=v(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.objectLiteral=yi.typedArray=yi.stringArray=yi.array=yi.func=yi.error=yi.number=yi.string=yi.boolean=void 0;function Noe(n){return n===!0||n===!1}yi.boolean=Noe;function p2(n){return typeof n=="string"||n instanceof String}yi.string=p2;function Hoe(n){return typeof n=="number"||n instanceof Number}yi.number=Hoe;function Boe(n){return n instanceof Error}yi.error=Boe;function qoe(n){return typeof n=="function"}yi.func=qoe;function f2(n){return Array.isArray(n)}yi.array=f2;function Woe(n){return f2(n)&&n.every(e=>p2(e))}yi.stringArray=Woe;function Yoe(n,e){return Array.isArray(n)&&n.every(e)}yi.typedArray=Yoe;function Zoe(n){return n!==null&&typeof n=="object"}yi.objectLiteral=Zoe});var b2=v(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});fg.ImplementationRequest=void 0;var m2=ti(),Joe;(function(n){n.method="textDocument/implementation",n.messageDirection=m2.MessageDirection.clientToServer,n.type=new m2.ProtocolRequestType(n.method)})(Joe=fg.ImplementationRequest||(fg.ImplementationRequest={}))});var v2=v(mg=>{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});mg.TypeDefinitionRequest=void 0;var y2=ti(),Uoe;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=y2.MessageDirection.clientToServer,n.type=new y2.ProtocolRequestType(n.method)})(Uoe=mg.TypeDefinitionRequest||(mg.TypeDefinitionRequest={}))});var w2=v(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.DidChangeWorkspaceFoldersNotification=ta.WorkspaceFoldersRequest=void 0;var tv=ti(),$oe;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=tv.MessageDirec
|
|||
|
`)?n.slice(0,-1).split(`
|
|||
|
`):n.split(`
|
|||
|
`)}function yle(n){for(let e=0,t=n.length;e<t;e++){let i=n.charCodeAt(e);if(i>=65&&i<=90)return!0}return!1}function vle(n,e){if(n===e)return!0;let t=e.charCodeAt(0);return t>=65&&t<=90&&t+32===n.charCodeAt(0)}function bY(n,e){if(n.length>e.length)return-1;if(n.length===0)return 0;if(!yle(n))return e.toLowerCase().indexOf(n);let t=n.length,i=0;for(let r=0;r<e.length;r++){let o=e[r];if(vle(n[i],o)){if(i++,i===t)return r-i+1}else i>0&&(r=r-i,i=0)}return-1}function ra(n,e){e=e??n.length;let t=new Uint8Array(e),i=!0,r;for(let o=0;o<e;o++){let s=n.charCodeAt(o),a;cv(s)?r&&uv(r)?a=1:a=3:a=dv(s),i&&a>1&&(i=!1),t[o]=a,r=s}return o=>{if(o===0)return 0;if(i)return Math.min(o,e);let s=0;for(let a=0;a<Math.min(o,e);a++)s+=t[a];return s}}var ple,fle,rk,mle,ble,pe=D(()=>{"use strict";Se();Rg();ple=128,fle=2048,rk=65536,mle="utf8",ble=[[48,57],[65,90],[97,122]]});function xle(n){return!!(n instanceof Ct||n instanceof Error&&n.message.includes("transport disconnected"))}var yY,wle,sk,_,Re=D(()=>{"use strict";Ce();ee();Ti();Xe();Be();$();pe();yY=J("events"),wle=["BufWritePre"],sk=class{constructor(){this.handlers=new Map;this._bufnr=1;this._recentInserts=[];this._lastChange=0;this._insertMode=!1;this._pumAlignTop=!1;this._pumVisible=!1;this._completing=!1;this._requesting=!1;this._ready=!1;this.timeout=1e3}set requesting(e){this._requesting=e}get requesting(){return this._requesting}get ready(){return this._ready}set completing(e){this._completing=e,this._pumVisible=e}get completing(){return this._completing}get cursor(){return this._cursor??{bufnr:this._bufnr,col:1,lnum:1,insert:!1}}get bufnr(){return this._bufnr}get pumvisible(){return this._pumVisible}get pumAlignTop(){return this._pumAlignTop}get insertMode(){return this._insertMode}get lastChangeTs(){return this._lastChange}race(e,t){let i=[];return new Promise(r=>{if(Xt(t)){let o=setTimeout(()=>{Y(i),r(void 0)},t);i.push(p.Disposable.create(()=>{clearTimeout(o)}))}else p.CancellationToken.is(t)&&t.onCancellationRequested(()=>{Y(i),r(void 0)},null,i);e.forEach(o=>{this.on(o,(...s)=>{Y(i),r({name:o,args:s})},null,i)})})}async fire(e,t){if(e==="ready")this._ready=!0;else if(e=="InsertEnter")this._insertMode=!0;else if(e=="InsertLeave")this._last_pum_insert=void 0,this._insertMode=!1,this._pumVisible=!1,this._recentInserts=[];else if(e=="CursorHoldI"||e=="CursorMovedI")this._bufnr=t[0],this._insertMode||(this._insertMode=!0,this.fire("InsertEnter",[t[0]]));else if(e=="CursorHold"||e=="CursorMoved")this._bufnr=t[0],this._insertMode&&(this._insertMode=!1,this.fire("InsertLeave",[t[0]]));else if(e=="MenuPopupChanged")this._pumVisible=!0,this._pumAlignTop=t[1]>t[0].row;else if(e=="InsertCharPre")this._recentInserts.push([t[1],t[0]]);else if(e=="TextChanged")this._lastChange=Date.now();else if(e=="BufEnter")this._bufnr=t[0];else if(e=="TextChangedI"||e=="TextChangedP"){let r=t[1],o=zt(r.line??"",0,r.col-1),s;if(this._last_pum_insert!=null&&this._last_pum_insert==o?(s=[],e="TextChangedP"):s=this._recentInserts.filter(a=>a[0]==t[0]),this._last_pum_insert=void 0,this._bufnr=t[0],this._recentInserts=[],this._lastChange=Date.now(),r.pre=o,this._cursor=Object.freeze({bufnr:t[0],lnum:r.lnum,col:r.col,insert:!0}),s.length&&o.length){let a=o.slice(-1);s.findIndex(l=>l[1]==a)!==-1&&(r.insertChar=a,process.nextTick(()=>{this.fire("TextInsert",[...t,a])}))}}else if(e=="PumInsert"){this._last_pum_insert=t[0];return}if(e=="CursorMoved"||e=="CursorMovedI"){t.push(this._recentInserts.length>0);let r={bufnr:t[0],lnum:t[1][0],col:t[1][1],insert:e=="CursorMovedI"};if(this._last_pum_insert&&de(this._last_pum_insert)+1==r.col||this._cursor&&Fe(this._cursor,r))return;this._cursor=r}let i=this.handlers.get(e);if(i!=null&&i.length){let r=i.slice(),o=wle.includes(e);await Promise.allSettled(r.map(s=>(async()=>{let l;o&&(l=setTimeout(()=>{console.error(`Slow "${e}" handler detected`,s.stack),yY.error(`Slow "${e}" handler detected`,s.stack)},this.timeout));try{await s(t)}catch(u){xle(u)||yY.error(`Error on event: ${e}`,u)}clearTimeout(l)})()))}}on(e,t,i,r){if(Array.isArray(e)){let o=r||[];for(let s of e)this.on(s,t,i
|
|||
|
`;break;case 114:C+="\r";break;case 116:C+=" ";break;case 117:let j=h(4,!0);j>=0?C+=String.fromCharCode(j):d=4;break;default:d=5}P=i;continue}if(T>=0&&T<=31)if(Ig(T)){C+=n.substring(P,i),d=2;break}else d=6;i++}return C}function y(){if(r="",d=0,o=i,l=a,c=u,i>=t)return o=t,s=17;let C=n.charCodeAt(i);if(uk(C)){do i++,r+=String.fromCharCode(C),C=n.charCodeAt(i);while(uk(C));return s=15}if(Ig(C))return i++,r+=String.fromCharCode(C),C===13&&n.charCodeAt(i)===10&&(i++,r+=`
|
|||
|
`),a++,u=i,s=14;switch(C){case 123:return i++,s=1;case 125:return i++,s=2;case 91:return i++,s=3;case 93:return i++,s=4;case 58:return i++,s=6;case 44:return i++,s=5;case 34:return i++,r=m(),s=10;case 47:let P=i-1;if(n.charCodeAt(i+1)===47){for(i+=2;i<t&&!Ig(n.charCodeAt(i));)i++;return r=n.substring(P,i),s=12}if(n.charCodeAt(i+1)===42){i+=2;let T=t-1,O=!1;for(;i<T;){let j=n.charCodeAt(i);if(j===42&&n.charCodeAt(i+1)===47){i+=2,O=!0;break}i++,Ig(j)&&(j===13&&n.charCodeAt(i)===10&&i++,a++,u=i)}return O||(i++,d=1),r=n.substring(P,i),s=13}return r+=String.fromCharCode(C),i++,s=16;case 45:if(r+=String.fromCharCode(C),i++,i===t||!Cc(n.charCodeAt(i)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=f(),s=11;default:for(;i<t&&w(C);)i++,C=n.charCodeAt(i);if(o!==i){switch(r=n.substring(o,i),r){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return r+=String.fromCharCode(C),i++,s=16}}function w(C){if(uk(C)||Ig(C))return!1;switch(C){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function x(){let C;do C=y();while(C>=12&&C<=15);return C}return{setPosition:g,getPosition:()=>i,scan:e?x:y,getToken:()=>s,getTokenValue:()=>r,getTokenOffset:()=>o,getTokenLength:()=>i-o,getTokenStartLine:()=>l,getTokenStartCharacter:()=>o-c,getTokenError:()=>d}}function uk(n){return n===32||n===9}function Ig(n){return n===10||n===13}function Cc(n){return n>=48&&n<=57}var SY,hv=D(()=>{"use strict";(function(n){n[n.lineFeed=10]="lineFeed",n[n.carriageReturn=13]="carriageReturn",n[n.space=32]="space",n[n._0=48]="_0",n[n._1=49]="_1",n[n._2=50]="_2",n[n._3=51]="_3",n[n._4=52]="_4",n[n._5=53]="_5",n[n._6=54]="_6",n[n._7=55]="_7",n[n._8=56]="_8",n[n._9=57]="_9",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.asterisk=42]="asterisk",n[n.backslash=92]="backslash",n[n.closeBrace=125]="closeBrace",n[n.closeBracket=93]="closeBracket",n[n.colon=58]="colon",n[n.comma=44]="comma",n[n.dot=46]="dot",n[n.doubleQuote=34]="doubleQuote",n[n.minus=45]="minus",n[n.openBrace=123]="openBrace",n[n.openBracket=91]="openBracket",n[n.plus=43]="plus",n[n.slash=47]="slash",n[n.formFeed=12]="formFeed",n[n.tab=9]="tab"})(SY||(SY={}))});function ck(n,e,t){let i,r,o,s,a;if(e){for(s=e.offset,a=s+e.length,o=s;o>0&&!Fg(n,o-1);)o--;let C=a;for(;C<n.length&&!Fg(n,C);)C++;r=n.substring(o,C),i=Dle(r,t)}else r=n,i=0,o=0,s=0,a=n.length;let l=Tle(t,n),u=0,c=0,d;t.insertSpaces?d=Sc(" ",t.tabSize||4):d=" ";let h=Lg(r,!1),g=!1;function f(){return u>1?Sc(l,u)+Sc(d,i+c):l+Sc(d,i+c)}function m(){let C=h.scan();for(u=0;C===15||C===14;)C===14&&t.keepLines?u+=1:C===14&&(u=1),C=h.scan();return g=C===16||h.getTokenError()!==0,C}let y=[];function w(C,P,T){!g&&(!e||P<a&&T>s)&&n.substring(P,T)!==C&&y.push({offset:P,length:T-P,content:C})}let x=m();if(t.keepLines&&u>0&&w(Sc(l,u),0,0),x!==17){let C=h.getTokenOffset()+o,P=Sc(d,i);w(P,o,C)}for(;x!==17;){let C=h.getTokenOffset()+h.getTokenLength()+o,P=m(),T="",O=!1;for(;u===0&&(P===12||P===13);){let q=h.getTokenOffset()+o;w(" ",C,q),C=h.getTokenOffset()+h.getTokenLength()+o,O=P===12,T=O?f():"",P=m()}if(P===2)x!==1&&c--,t.keepLines&&u>0||!t.keepLines&&x!==1?T=f():t.keepLines&&(T=" ");else if(P===4)x!==3&&c--,t.keepLines&&u>0||!t.keepLines&&x!==3?T=f():t.keepLines&&(T=" ");else{switch(x){case 3:case 1:c++,t.keepLines&&u>0||!t.keepLines?T=f():T=" ";break;case
|
|||
|
`?`\r
|
|||
|
`:"\r";if(i===`
|
|||
|
`)return`
|
|||
|
`}return n&&n.eol||`
|
|||
|
`}function Fg(n,e){return`\r
|
|||
|
`.indexOf(n.charAt(e))!==-1}var dk=D(()=>{"use strict";hv()});function DY(n,e=[],t=Mg.DEFAULT){let i=null,r=[],o=[];function s(l){Array.isArray(r)?r.push(l):i!==null&&(r[i]=l)}return pv(n,{onObjectBegin:()=>{let l={};s(l),o.push(r),r=l,i=null},onObjectProperty:l=>{i=l},onObjectEnd:()=>{r=o.pop()},onArrayBegin:()=>{let l=[];s(l),o.push(r),r=l,i=null},onArrayEnd:()=>{r=o.pop()},onLiteralValue:s,onError:(l,u,c)=>{e.push({error:l,offset:u,length:c})}},t),r[0]}function hk(n,e=[],t=Mg.DEFAULT){let i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function r(l){i.type==="property"&&(i.length=l-i.offset,i=i.parent)}function o(l){return i.children.push(l),l}pv(n,{onObjectBegin:l=>{i=o({type:"object",offset:l,length:-1,parent:i,children:[]})},onObjectProperty:(l,u,c)=>{i=o({type:"property",offset:u,length:-1,parent:i,children:[]}),i.children.push({type:"string",value:l,offset:u,length:c,parent:i})},onObjectEnd:(l,u)=>{r(l+u),i.length=l+u-i.offset,i=i.parent,r(l+u)},onArrayBegin:(l,u)=>{i=o({type:"array",offset:l,length:-1,parent:i,children:[]})},onArrayEnd:(l,u)=>{i.length=l+u-i.offset,i=i.parent,r(l+u)},onLiteralValue:(l,u,c)=>{o({type:Ple(l),offset:u,length:c,parent:i,value:l}),r(u+c)},onSeparator:(l,u,c)=>{i.type==="property"&&(l===":"?i.colonOffset=u:l===","&&r(u))},onError:(l,u,c)=>{e.push({error:l,offset:u,length:c})}},t);let a=i.children[0];return a&&delete a.parent,a}function gv(n,e){if(!n)return;let t=n;for(let i of e)if(typeof i=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let r=!1;for(let o of t.children)if(Array.isArray(o.children)&&o.children[0].value===i&&o.children.length===2){t=o.children[1],r=!0;break}if(!r)return}else{let r=i;if(t.type!=="array"||r<0||!Array.isArray(t.children)||r>=t.children.length)return;t=t.children[r]}return t}function pv(n,e,t=Mg.DEFAULT){let i=Lg(n,!1),r=[];function o(B){return B?()=>B(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter()):()=>!0}function s(B){return B?()=>B(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter(),()=>r.slice()):()=>!0}function a(B){return B?fe=>B(fe,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter()):()=>!0}function l(B){return B?fe=>B(fe,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter(),()=>r.slice()):()=>!0}let u=s(e.onObjectBegin),c=l(e.onObjectProperty),d=o(e.onObjectEnd),h=s(e.onArrayBegin),g=o(e.onArrayEnd),f=l(e.onLiteralValue),m=a(e.onSeparator),y=o(e.onComment),w=a(e.onError),x=t&&t.disallowComments,C=t&&t.allowTrailingComma;function P(){for(;;){let B=i.scan();switch(i.getTokenError()){case 4:T(14);break;case 5:T(15);break;case 3:T(13);break;case 1:x||T(11);break;case 2:T(12);break;case 6:T(16);break}switch(B){case 12:case 13:x?T(10):y();break;case 16:T(1);break;case 15:case 14:break;default:return B}}}function T(B,fe=[],ve=[]){if(w(B),fe.length+ve.length>0){let Le=i.getToken();for(;Le!==17;){if(fe.indexOf(Le)!==-1){P();break}else if(ve.indexOf(Le)!==-1)break;Le=P()}}}function O(B){let fe=i.getTokenValue();return B?f(fe):(c(fe),r.push(fe)),P(),!0}function j(){switch(i.getToken()){case 11:let B=i.getTokenValue(),fe=Number(B);isNaN(fe)&&(T(2),fe=0),f(fe);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return P(),!0}function q(){return i.getToken()!==10?(T(3,[],[2,5]),!1):(O(!1),i.getToken()===6?(m(":"),P(),z()||T(4,[],[2,5])):T(5,[],[2,5]),r.pop(),!0)}function K(){u(),P();let B=!1;for(;i.getToken()!==2&&i.getToken()!==17;){if(i.getToken()===5){if(B||T(4,[],[]),m(","),P(),i.getToken()===2&&C)break}else B&&T(6,[],[]);q()||T(4,[],[2,5]),B=!0}return d(),i.getToken()!==2?T(7,[2],[]):P(),!0}function X(){h(),P();let B=!0,fe=!1;for(;i.getToken()!==4&&i.getToken()!==17;){if(i.getToken()===5){if(fe||T(4,[],[]),m(","),P(),i.getToken()===4&&C)break}else fe&&T(6,[],[]);B?(r.push(0),B=!1):r[r.length-1]++,z()||T(4,[],[4,5]),fe=!0}return g(),B||r.pop(),i.getToken()!==4?T(8,[4],[]):P(),!0}function z(){switch(i.getToken()){case 3:return X();case 1:return K();case 1
|
|||
|
`)),wi(t)}return wi(e)}catch{return[]}}loadSync(){try{let e=F.readFileSync(this.file,"utf8");return e=e.trim(),e.length?e.trim().split(`
|
|||
|
`):[]}catch{return[]}}async add(e){let t;try{t=F.readFileSync(this.file),t[0]===239&&t[1]===187&&t[2]===191&&(t=t.slice(3)),t=Buffer.concat([Buffer.from(e,"utf8"),new Uint8Array([10]),t])}catch{t=Buffer.concat([Buffer.from(e,"utf8"),new Uint8Array([10])])}await(0,st.promisify)(F.writeFile)(this.file,t)}async remove(e){let t=await this.load(),i=t.length;t=t.filter(r=>r!=e),t.length!=i&&await Hg(this.file,t.join(`
|
|||
|
`))}async clean(){try{await(0,st.promisify)(F.unlink)(this.file)}catch{}}}});var Wg,To=D(()=>{"use strict";Wg=(i=>(i[i.Global=1]="Global",i[i.Workspace=2]="Workspace",i[i.WorkspaceFolder=3]="WorkspaceFolder",i))(Wg||{})});function jle(n,e,t){return Mle.some(i=>n.startsWith(i))?1:e==="application"?1:e==="window"?2:e==="resource"||e==="machine-overridable"?3:e==="language-overridable"?4:t}function bv(n,e=2){let t={};for(let[i,r]of Object.entries($e(n))){let o=Fi(r);o.scope=jle(i,r.scope,e),t[i]=o}return t}var wk,di,Mle,ko=D(()=>{"use strict";To();Ti();Xe();Be();wk=class{constructor(){this.data=new Map}add(e,t){My(typeof e=="string"),My(St(t)),My(!this.data.has(e)),this.data.set(e,t)}knows(e){return this.data.has(e)}as(e){return this.data.get(e)||null}},di=new wk,Mle=["coc.source.","list.source."]});function Dk(){let n={};for(let e of Sk.getExtensions().extensions){let t=e.definitions;Object.entries($e(t)).forEach(([i,r])=>{n[i]=r})}return n}function Ole(n){return n&&typeof n.filetype=="string"&&!te(n.patterns)}function Ale(n){return n&&typeof n.command=="string"&&typeof n.title=="string"}function WY(n){let e={};if(Array.isArray(n))for(let t of n)Object.assign(e,$e(t.properties));else St(n.properties)&&(e=n.properties);return e}function Ll(n,e=2){let t=n.split(/\r?\n/).slice(e)[0];if(!t)return;t=t.replace(/^\s*at\s*/,"");let i;if(t.endsWith(")")){let o=t.match(/(\((.*?):\d+:\d+\))$/);o&&(i=o[2])}else{let o=t.match(/(.*?):\d+:\d+$/);o&&(i=o[1])}if(!i)return;let r=Sk.resolveExtension(i);if(r)return r.name;if(pt(Do,i))return"coc.nvim"}var ds,Ck,Sk,hs=D(()=>{"use strict";Se();Jt();at();ce();Xe();Be();ko();ds={ExtensionContribution:"base.contributions.extensions"},Ck=class{constructor(){this.extensionsById=new Map}resolveExtension(e){for(let t of this.extensionsById.values())if(t.filepath&&li(t.filepath,e)||!t.name.startsWith("single-")&&F.existsSync(t.directory)&&pt(F.realpathSync(t.directory),e,!1))return t}get onCommands(){let e=[];for(let t of this.extensionsById.values()){let{commands:i,onCommands:r}=t;for(let o of r)if(typeof o=="string"){let s=i.find(l=>l.command===o),a=s==null?"":s.title;e.push({id:o,title:a})}}return e}getCommandTitle(e){for(let t of this.extensionsById.values())for(let i of le(t.commands))if(i.command===e)return i.title}get commands(){let e=[];for(let t of this.extensionsById.values())e.push(...le(t.commands).filter(Ale));return e}getRootPatternsByFiletype(e){let t=[];for(let i of this.extensionsById.values())for(let r of le(i.rootPatterns).filter(Ole))r.filetype===e&&t.push(...r.patterns.filter(o=>typeof o=="string"));return t}unregistExtension(e){this.extensionsById.delete(e)}registerExtension(e,t){this.extensionsById.set(e,t)}getExtension(e){return this.extensionsById.get(e)}getExtensions(){return{extensions:this.extensionsById.values()}}},Sk=new Ck;di.add(ds.ExtensionContribution,Sk)});var Nle,Tk,Hle,kk,ie,kt=D(()=>{"use strict";Re();Ce();qg();Se();hs();$();ko();pe();Nle=J("commands"),Tk=class{constructor(e,t,i,r){this.id=e;this.impl=t;this.thisArg=i;this.internal=r}execute(...e){let{impl:t,thisArg:i}=this;return t.apply(i,le(e))}dispose(){this.thisArg=null,this.impl=null}},Hle=di.as(ds.ExtensionContribution),kk=class{constructor(){this.commands=new Map;this.titles=new Map;this.mru=new io("commands")}get commandList(){let e=[];for(let t of this.commands.values())if(!t.internal){let{id:i}=t,r=this.titles.get(i)??Hle.getCommandTitle(i);e.push({id:i,title:se(r)})}return e}dispose(){for(let e of this.commands.values())e.dispose();this.commands.clear()}execute(e){return this.executeCommand(e.command,...e.arguments??[])}register(e,t,i){for(let r of Array.isArray(e.id)?e.id:[e.id])this.registerCommand(r,e.execute,e,t),i&&this.titles.set(r,i);return e}has(e){return this.commands.has(e)}unregister(e){let t=this.commands.get(e);!t||(t.dispose(),this.commands.delete(e))}registerCommand(e,t,i,r=!1){return e.startsWith("_")&&(r=!0),this.commands.has(e)&&Nle.warn(`Command ${e} already registered`),this.commands.set(e,new Tk(e,t,i,r)),p.Disposable.create(()=>{this.commands.delete(e)})}executeCommand(e,...t){let
|
|||
|
`)}_append(e){let{nvim:t}=this;if(!t)return;let i=this.lines.length-1,r=e.split(/\r?\n/),o=this.lines[i]+r[0];this.lines[i]=o;let s=r.slice(1);this.lines=this.lines.concat(s),this.created&&(t.pauseNotification(),t.call("setbufline",[this.bufname,"$",o],!0),s.length&&t.call("appendbufline",[this.bufname,"$",s],!0),t.resumeNotification(!1,!0))}append(e){!this.validate()||this._append(e)}appendLine(e){!this.validate()||this._append(e+`
|
|||
|
`)}clear(e){let{nvim:t}=this;!this.validate()||!t||(this.lines=e?this.lines.slice(-e):[],this.created&&(t.pauseNotification(),t.call("deletebufline",[this.bufname,1,"$"],!0),this.lines.length&&t.call("appendbufline",[this.bufname,"$",this.lines],!0),t.resumeNotification(!0,!0)))}hide(){this.created=!1;let e=YY(this.bufname);this.nvim&&this.nvim.command(`exe 'silent! bwipeout! '.fnameescape('${e}')`,!0)}get bufname(){return`output:///${encodeURI(this.name)}`}show(e,t="vs"){let{nvim:i}=this;if(!i)return;let r=YY(this.bufname);i.pauseNotification(),i.command(`exe '${t} '.fnameescape('${r}')`,!0),e&&i.command("wincmd p",!0),i.resumeNotification(!0,!0),this.created=!0}validate(){return!this._disposed}dispose(){this.onDispose&&this.onDispose(),this._disposed=!0,this.hide(),this.lines=[]}}});var _k,la,Ek=D(()=>{"use strict";Re();ZY();_k=class{constructor(){this.outputChannels=new Map;this.bufnrs=new Map;this.disposable=_.on("BufUnload",e=>{let t=this.bufnrs.get(e);if(t){let i=this.outputChannels.get(t);i&&(i.created=!1)}})}getProvider(e){return{onDidChange:null,provideTextDocumentContent:async i=>{let r=this.get(i.path.slice(1));if(!r)return"";e.pauseNotification(),e.call("bufnr",["%"],!0),e.command("setlocal nospell nofoldenable nowrap noswapfile",!0),e.command("setlocal buftype=nofile bufhidden=hide",!0),e.command("setfiletype log",!0);let o=await e.resumeNotification();return this.bufnrs.set(o[0][0],r.name),r.created=!0,r.content}}}get names(){return Array.from(this.outputChannels.keys())}get(e){return this.outputChannels.get(e)}create(e,t){if(this.outputChannels.has(e))return this.outputChannels.get(e);let i=new Yg(e,t,()=>{this.outputChannels.delete(e)});return this.outputChannels.set(e,i),i}show(e,t,i){let r=this.outputChannels.get(e);!r||r.show(i,t)}dispose(){this.disposable.dispose();for(let e of this.outputChannels.values())e.dispose();this.outputChannels.clear()}},la=new _k});var yv,JY=D(()=>{"use strict";$();Re();ee();Se();yv=class{constructor(e,t){this.nvim=e;this.config=t;this.disposables=[];this._onDidClose=new p.Emitter;this.onDidClose=this._onDidClose.event;_.on("BufWinLeave",r=>{r==this.bufnr&&(this.dispose(),t.callback&&t.callback(-1))},null,this.disposables);let i=le(t.buttons).filter(r=>r.disabled!=!0);_.on("FloatBtnClick",(r,o)=>{r==this.bufnr&&(this.dispose(),t.callback&&t.callback(i[o].index))},null,this.disposables)}get lines(){return[...this.config.content.split(/\r?\n/)]}async show(e){let{nvim:t}=this,{title:i,close:r,highlights:o,buttons:s}=this.config,a=this.config.borderhighlight||e.floatBorderHighlight,l=this.config.highlight||e.floatHighlight,u={maxwidth:e.maxWidth||80};i&&(u.title=i),(r||typeof r>"u")&&(u.close=1),e.maxHeight&&(u.maxHeight=e.maxHeight),e.maxWidth&&(u.maxWidth=e.maxWidth),l&&(u.highlight=l),o&&(u.highlights=o),a&&(u.borderhighlight=[a]),s&&(u.buttons=s.filter(h=>!h.disabled).map(h=>h.text)),e.rounded&&(u.rounded=1),Array.isArray(u.buttons)&&(u.getchar=1);let[c,d]=await t.call("coc#dialog#create_dialog",[this.lines,u]);this.bufnr=d,t.command("redraw",!0)}get winid(){return this.bufnr?this.nvim.call("bufwinid",[this.bufnr]):Promise.resolve(null)}dispose(){this._onDidClose.fire(),this.bufnr=void 0,Y(this.disposables),this.disposables=[]}}});var ua,Ik=D(()=>{"use strict";$();Re();ee();Be();pe();ua=class{constructor(e,t){this.nvim=e;this.disposables=[];this.accepted=!1;this._disposed=!1;this._dimension=[0,0,0,0];this._onDidFinish=new p.Emitter;this._onDidChange=new p.Emitter;this.clear=!1;this.onDidFinish=this._onDidFinish.event;this.onDidChange=this._onDidChange.event;this._input=t,this.disposables.push(this._onDidFinish),this.disposables.push(this._onDidChange);let i;Object.defineProperty(this,"title",{set:s=>{i=s,this._winid&&e.call("coc#dialog#change_title",[this._winid,s],!0)},get:()=>i});let r=!1;Object.defineProperty(this,"loading",{set:s=>{r=s,this._winid&&e.call("coc#dialog#change_loading",[this._winid,s],!0)},get:()=>r});let o;Object.defineProperty(this,"borderhighlight",{set:s=>{o=s,this._winid&&e.call("coc#dialog#change_border_hl",[this._winid,s],!0)},get:()=>o}),Object.de
|
|||
|
\v\f\r\x1B !"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0"},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE9
|
|||
|
\v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0`},georgianacademy:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},georgianps:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},pt154:{type:"_sbcs",chars:"\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},viscii:{type:"_sbcs",chars:`\0\u1EB2\u1EB4\u1EAA\x07\b
|
|||
|
\v\f\r\u1EF6\u1EF8\x1B\u1EF4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE`},iso646cn:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
\v\f\r\x1B !"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},iso646jp:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},hproman8:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xC0\xC2\xC8\xCA\xCB\xCE\xCF\xB4\u02CB\u02C6\xA8\u02DC\xD9\xDB\u20A4\xAF\xDD\xFD\xB0\xC7\xE7\xD1\xF1\xA1\xBF\xA4\xA3\xA5\xA7\u0192\xA2\xE2\xEA\xF4\xFB\xE1\xE9\xF3\xFA\xE0\xE8\xF2\xF9\xE4\xEB\xF6\xFC\xC5\xEE\xD8\xC6\xE5\xED\xF8\xE6\xC4\xEC\xD6\xDC\xC9\xEF\xDF\xD4\xC1\xC3\xE3\xD0\xF0\xCD\xCC\xD3\xD2\xD5\xF5\u0160\u0161\xDA\u0178\xFF\xDE\xFE\xB7\xB5\xB6\xBE\u2014\xBC\xBD\xAA\xBA\xAB\u25A0\xBB\xB1\uFFFD"},macintosh:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},ascii:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"},tis620:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"}}});var x4=v(w4=>{"use strict";var hP=ms().Buffer;w4._dbcs=bs;var Gi=-1,v4=-2,Dr=-10,xn=-1e3,Ic=new Array(256),Xg=-1;for(jv=0;jv<256;jv++)Ic[jv]=Gi;var jv;function bs(n,e){if(this.encodingName=n.encodingName,!n)throw new Error("DBCS codec is called without the data.");if(!n.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var t=n.table();this.decodeTables=[],thi
|
|||
|
${u}
|
|||
|
${d.toString("utf8")}`));return}o(bP.default.decode(c,r))})})}function Fc(n,e,t=fk){if(!n.killed)if(t===3)try{let i={stdio:["pipe","pipe","ignore"]};return e&&(i.cwd=e),fn.execFileSync("taskkill",["/T","/F","/PID",n.pid.toString()],i),!0}catch{return!1}else if(t===2||t===1)try{let i=R.join(Do,"bin/terminateProcess.sh");return!fn.spawnSync(i,[n.pid.toString()]).error}catch{return!1}else return n.kill("SIGKILL"),!0}var bP,Nl=D(()=>{"use strict";Jt();Ti();ce();Il();bP=sr(N4());$();Tr()});var yP,Gg,W4=D(()=>{"use strict";ce();at();Nl();yP=sr(Kb()),Gg=class{get nodeFolder(){return Al("npm")?this._npmFolder?Promise.resolve(this._npmFolder):Ro("npm --loglevel silent root -g",{},3e3).then(e=>(this._npmFolder=(0,yP.default)(e).trim(),this._npmFolder)):Promise.resolve("")}get yarnFolder(){return Al("yarnpkg")?this._yarnFolder?Promise.resolve(this._yarnFolder):Ro("yarnpkg global dir",{},3e3).then(e=>{let t=R.join((0,yP.default)(e).trim(),"node_modules"),i=F.existsSync(t);return i&&(this._yarnFolder=t),i?t:""}):Promise.resolve("")}async resolveModule(e){let t=await this.nodeFolder,i=await this.yarnFolder;if(i){let r=await jn(R.join(i,e,"package.json"));if(r&&r.isFile())return R.join(i,e)}if(t){let r=await jn(R.join(t,e,"package.json"));if(r&&r.isFile())return R.join(t,e)}return null}}});function Wv(n,e){if(!e.startsWith("nvim-")&&!e.startsWith("patch-"))throw new Error("Feature param could only starts with nvim and patch");if(!n.isVim&&e.startsWith("patch-")||n.isVim&&e.startsWith("nvim-"))return!1;if(n.isVim){let[t,i,r,o]=n.version.match(/^(\d)(\d{2})(\d+)$/),s=`${i}.${parseInt(r,10)}.${parseInt(o,10)}`;return ur.gte(s,e.slice(6))}return ur.gte(n.version,e.slice(5))}async function Yv(n,e,t){return ai?await n.callAsync("coc#util#with_callback",[e,t]):await n.call(e,t)}function Y4(n){return vP.has(n)?vP.get(n):(qv=qv+1,vP.set(n,qv),qv)}function Z4(n){let e=n.initialConfiguration.get("coc.preferences.watchmanPath","watchman");return vo.sync(e,{nothrow:!0})}async function J4(n,e,t){let i=await n.call("expand","%:p");i=R.normalize(i);let r=i&&R.isAbsolute(i);if(r&&!pt(e,i,!0))return kc(t,R.dirname(i));let o=kc(t,e);return o&&o!=Et.homedir()?o:r?kc(t,R.dirname(i)):null}function U4(n){return lue.resolveModule(n)}function wP(n,e,t,i=eo||El){if(Array.isArray(n)){let r=0;for(let o of n){let s=wP(o,e,t);if(s===10)return s;s>r&&(r=s)}return r}else{if(typeof n=="string")return n==="*"?5:n===t?10:0;if(n&&p.TextDocumentFilter.is(n)){let r=A.parse(e),{language:o,pattern:s,scheme:a}=n,l=0;if(a)if(a===r.scheme)l=5;else if(a==="*")l=3;else return 0;if(o)if(o===t)l=10;else if(o==="*")l=Math.max(l,5);else return 0;if(s){let u=i?s.toLowerCase():s,c=i?r.fsPath.toLowerCase():r.fsPath;if(u===c||si(c,u,{dot:!0}))l=5;else return 0}return l}else return 0}}var qv,lue,vP,xP=D(()=>{"use strict";Je();W4();Jt();at();ce();Il();$();qv=2e3,lue=new Gg,vP=new Map});function V4(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function uue(n){Mc=n}function zi(n,e){if(e){if(e6.test(n))return n.replace(cue,$4)}else if(t6.test(n))return n.replace(due,$4);return n}function i6(n){return n.replace(gue,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}function jt(n,e){n=typeof n=="string"?n:n.source,e=e||"";let t={replace:(i,r)=>(r=r.source||r,r=r.replace(pue,"$1"),n=n.replace(i,r),t),getRegex:()=>new RegExp(n,e)};return t}function X4(n,e,t){if(n){let i;try{i=decodeURIComponent(i6(t)).replace(fue,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!mue.test(t)&&(t=wue(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}function wue(n,e){Zv[" "+n]||(bue.test(n)?Zv[" "+n]=n+"/":Zv[" "+n]=Jv(n,"/",!0)),n=Zv[" "+n];let t=n.indexOf(":")===-1;return e.substr
|
|||
|
`).map(r=>{let o=r.match(/^\s+/);if(o===null)return r;let[s]=o;return s.length>=i.length?r.slice(i.length):r}).join(`
|
|||
|
`)}function Sue(n){return n.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Q4(n){let e="",t,i,r=n.length;for(t=0;t<r;t++)i=n.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}function Ae(n,e,t){if(typeof n>"u"||n===null)throw new Error("marked(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=ro({},Ae.defaults,e||{}),n6(e),t){let r=e.highlight,o;try{o=no.lex(n,e)}catch(l){return t(l)}let s=function(l){let u;if(!l)try{e.walkTokens&&Ae.walkTokens(o,e.walkTokens),u=kr.parse(o,e)}catch(c){l=c}return e.highlight=r,l?t(l):t(null,u)};if(!r||r.length<3||(delete e.highlight,!o.length))return s();let a=0;Ae.walkTokens(o,function(l){l.type==="code"&&(a++,setTimeout(()=>{r(l.text,l.lang,function(u,c){if(u)return s(u);c!=null&&c!==l.text&&(l.text=c,l.escaped=!0),a--,a===0&&s()})},0))}),a===0&&s();return}function i(r){if(r.message+=`
|
|||
|
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+zi(r.message+"",!0)+"</pre>";throw r}try{let r=no.lex(n,e);if(e.walkTokens){if(e.async)return Promise.all(Ae.walkTokens(r,e.walkTokens)).then(()=>kr.parse(r,e)).catch(i);Ae.walkTokens(r,e.walkTokens)}return kr.parse(r,e)}catch(r){i(r)}}var Mc,e6,cue,t6,due,hue,$4,gue,pue,fue,mue,Zv,bue,yue,vue,Uv,zg,je,be,no,Kg,$v,Xv,kr,TRe,kRe,PRe,RRe,_Re,ERe,IRe,r6=D(()=>{Mc=V4();e6=/[&<>"']/,cue=new RegExp(e6.source,"g"),t6=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,due=new RegExp(t6.source,"g"),hue={"&":"&","<":"<",">":">",'"':""","'":"'"},$4=n=>hue[n];gue=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;pue=/(^|[^\[])\^/g;fue=/[^\w:]/g,mue=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;Zv={},bue=/^[^:]+:\/*[^/]*$/,yue=/^([^:]+:)[\s\S]*$/,vue=/^([^:]+:\/*[^/]*)[\s\S]*$/;Uv={exec:function(){}};zg=class{constructor(e){this.options=e||Mc}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Jv(i,`
|
|||
|
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],r=Cue(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){let r=Jv(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=t[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;let o=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:o,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,r,o,s,a,l,u,c,d,h,g,f,m=t[1].trim(),y=m.length>1,w={type:"list",raw:"",ordered:y,start:y?+m.slice(0,-1):"",loose:!1,items:[]};m=y?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=y?m:"[*+-]");let x=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,!(!(t=x.exec(e))||this.rules.block.hr.test(e)));){if(i=t[0],e=e.substring(i.length),c=t[2].split(`
|
|||
|
`,1)[0],d=e.split(`
|
|||
|
`,1)[0],this.options.pedantic?(s=2,g=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,g=c.slice(s),s+=t[1].length),l=!1,!c&&/^ *$/.test(d)&&(i+=d+`
|
|||
|
`,e=e.substring(d.length+1),f=!0),!f){let P=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),T=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),O=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),j=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;e&&(h=e.split(`
|
|||
|
`,1)[0],c=h,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(O.test(c)||j.test(c)||P.test(c)||T.test(e)));){if(c.search(/[^ ]/)>=s||!c.trim())g+=`
|
|||
|
`+c.slice(s);else if(!l)g+=`
|
|||
|
`+c;else break;!l&&!c.trim()&&(l=!0),i+=h+`
|
|||
|
`,e=e.substring(h.length+1)}}w.loose||(u?w.loose=!0:/\n *\n *$/.test(i)&&(u=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(g),r&&(o=r[0]!=="[ ] ",g=g.replace(/^\[[ xX]\] +/,""))),w.items.push({type:"list_item",raw:i,task:!!r,checked:o,loose:!1,text:g}),w.raw+=i}w.items[w.items.length-1].raw=i.trimRight(),w.items[w.items.length-1].text=g.trimRight(),w.raw=w.raw.trimRight();let C=w.items.length;for(a=0;a<C;a++)if(this.lexer.state.top=!1,w.items[a].tokens=this.lexer.blockTokens(w.items[a].text,[]),!w.loose){let P=w.items[a].tokens.filter(O=>O.type==="space"),T=P.length>0&&P.some(O=>/\n.*\n/.test(O.raw));w.loose=T}if(w.loose)for(a=0;a<C;a++)w.items[a].loose=!0;return w}}html(e){let t=this.rules.block.html.exec(e);if(t){let i={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};if(this.options.sanitize){let r=this.options.sanitizer?this.options.sanitizer(t[0]):zi(t[0]);i.type="paragraph",i.text=r,i.tokens=this.lexer.inline(r)}return i}}def(e){let t=this.rules.block.def.exec(e);if(t){let i=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:i,raw:t[0],href:r,title:o}}}table(e){let t=this.rules.block.table.exec(e);if(t){let i={type:"table",header:G4(t[1]).map(r=>({text:r})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
|||
|
`):[]};if(i.header.length===i.align.length){i.raw=t[0];let r=i.align.length,o,s,a,l;for(o=0;o<r;o++)/^ *-+: *$/.test(i.align[o])?i.align[o]="right":/^ *:-+: *$/.test(i.align[o])?i.align[o]="center":/^ *:-+ *$/.test(i.align[o])?i.align[o]="left":i.align[o]=null;for(r=i.rows.length,o=0;o<r;o++)i.rows[o]=G4(i.rows[o],i.header.length).map(u=>({text:u}));for(r=i.header.length,s=0;s<r;s++)i.header[s].tokens=this.lexer.inline(i.header[s].text);for(r=i.rows.length,s=0;s<r;s++)for(l=i.rows[s],a=0;a<l.length;a++)l[a].tokens=this.lexer.inline(l[a].text);return i}}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let i=t[1].charAt(t[1].length-1)===`
|
|||
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:zi(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):zi(t[0]):t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;let s=Jv(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=xue(t[2],"()");if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s&&(r=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),K4(t,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=t[r.toLowerCase()],!r){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return K4(i,r,i[0],this.lexer)}}emStrong(e,t,i=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;let o=r[1]||r[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){let s=r[0].length-1,a,l,u=s,c=0,d=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=a.length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);let h=e.slice(0,s+r.index+(r[0].length-a.length)+l);if(Math.min(s,l)%2){let f=h.slice(1,-1);return{type:"em",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let g=h.slice(2,-2);return{type:"strong",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," "),r=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return r&&o&&(i=i.substring(1,i.length-1)),i=zi(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){let i=this.rules.inline.autolink.exec(e);if(i){let r,o;return i[2]==="@"?(r=zi(this.options.mangle?t(i[1]):i[1]),o="mailto:"+r):(r=zi(i[1]),o=r),{type:"link",raw:i[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let r,o;if(i[2]==="@")r=zi(this.options.mangle?t(i[0]):i[0]),o="mailto:"+r;else{let s;do s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(s!==i[0]);r=zi(i[0]),i[1]==="www."?o="http://"+i[0]:o=i[0]}return{type:"link",raw:i[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e,t){let i=this.rules.inline.text.exec(e);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):zi(i[0]):i[0]:r=zi(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}},je={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})
|
|||
|
]`).replace("lheading",je.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Uv,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Uv,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";be.punctuation=jt(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex();be.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;be.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;be._comment=jt(je._comment).replace("(?:-->|$)","-->").getRegex();be.emStrong.lDelim=jt(be.emStrong.lDelim).replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimAst=jt(be.emStrong.rDelimAst,"g").replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimUnd=jt(be.emStrong.rDelimUnd,"g").replace(/punct/g,be._punctuation).getRegex();be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;be._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;be.autolink=jt(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex();be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;be.tag=jt(be.tag).replace("comment",be._comment).replace("attribute",be._attribute).getRegex();be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;be._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;be.link=jt(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex();be.reflink=jt(be.reflink).replace("label",be._label).replace("ref",je._label).getRegex();be.nolink=jt(be.nolink).replace("ref",je._label).getRegex();be.reflinkSearch=jt(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex();be.normal=ro({},be);be.pedantic=ro({},be.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:jt(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:jt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()});be.gfm=ro({},be.normal,{escape:jt(be.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?
|
|||
|
`),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,u)=>l+" ".repeat(u.length));let i,r,o,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
|||
|
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|||
|
`+i.raw,r.text+=`
|
|||
|
`+i.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|||
|
`+i.raw,r.text+=`
|
|||
|
`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},l),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){r=t[t.length-1],s&&r.type==="paragraph"?(r.raw+=`
|
|||
|
`+i.raw,r.text+=`
|
|||
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&r.type==="text"?(r.raw+=`
|
|||
|
`+i.raw,r.text+=`
|
|||
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,r,o,s=e,a,l,u;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+z4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+z4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),r=t[t.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,s,u)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e,Q4)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,Q4))){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0,d=e.slice(1),h;this.options.extensions.startInline.forEach(function(g){h=g.call({lexer:this},d),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(i=this.tokenizer.inlineText(o,Sue)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(u=i.raw.slice(-1)),l=!0,r=t[t.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):t.push(i);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},Kg=class{constructor(e){this.options=e||Mc}code(e,t,i){let r=(t||"").match(/\S*/)[0];if(this.options.highlight){let o=this.options.highlight(e,r);o!=null&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+`
|
|||
|
`,r?'<pre><code class="'+this.options.langPrefix+zi(r)+'">'+(i?e:zi(e,!0))+`</code></pre>
|
|||
|
`:"<pre><code>"+(i?e:zi(e,!0))+`</code></pre>
|
|||
|
`}blockquote(e){return`<blockquote>
|
|||
|
${e}</blockquote>
|
|||
|
`}html(e){return e}heading(e,t,i,r){if(this.options.headerIds){let o=this.options.headerPrefix+r.slug(i);return`<h${t} id="${o}">${e}</h${t}>
|
|||
|
`}return`<h${t}>${e}</h${t}>
|
|||
|
`}hr(){return this.options.xhtml?`<hr/>
|
|||
|
`:`<hr>
|
|||
|
`}list(e,t,i){let r=t?"ol":"ul",o=t&&i!==1?' start="'+i+'"':"";return"<"+r+o+`>
|
|||
|
`+e+"</"+r+`>
|
|||
|
`}listitem(e){return`<li>${e}</li>
|
|||
|
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>
|
|||
|
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
|||
|
<thead>
|
|||
|
`+e+`</thead>
|
|||
|
`+t+`</table>
|
|||
|
`}tablerow(e){return`<tr>
|
|||
|
${e}</tr>
|
|||
|
`}tablecell(e,t){let i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+e+`</${i}>
|
|||
|
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,i){if(e=X4(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+i+"</a>",r}image(e,t,i){if(e=X4(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let r=`<img src="${e}" alt="${i}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}},$v=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}},Xv=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[e];do r++,i=e+"-"+r;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=r,this.seen[i]=0),i}slug(e,t={}){let i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}},kr=class{constructor(e){this.options=e||Mc,this.options.renderer=this.options.renderer||new Kg,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new $v,this.slugger=new Xv}static parse(e,t){return new kr(t).parse(e)}static parseInline(e,t){return new kr(t).parseInline(e)}parse(e,t=!0){let i="",r,o,s,a,l,u,c,d,h,g,f,m,y,w,x,C,P,T,O,j=e.length;for(r=0;r<j;r++){if(g=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[g.type]&&(O=this.options.extensions.renderers[g.type].call({parser:this},g),O!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type))){i+=O||"";continue}switch(g.type){case"space":continue;case"hr":{i+=this.renderer.hr();continue}case"heading":{i+=this.renderer.heading(this.parseInline(g.tokens),g.depth,i6(this.parseInline(g.tokens,this.textRenderer)),this.slugger);continue}case"code":{i+=this.renderer.code(g.text,g.lang,g.escaped);continue}case"table":{for(d="",c="",a=g.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(g.header[o].tokens),{header:!0,align:g.align[o]});for(d+=this.renderer.tablerow(c),h="",a=g.rows.length,o=0;o<a;o++){for(u=g.rows[o],c="",l=u.length,s=0;s<l;s++)c+=this.renderer.tablecell(this.parseInline(u[s].tokens),{header:!1,align:g.align[s]});h+=this.renderer.tablerow(c)}i+=this.renderer.table(d,h);continue}case"blockquote":{h=this.parse(g.tokens),i+=this.renderer.blockquote(h);continue}case"list":{for(f=g.ordered,m=g.start,y=g.loose,a=g.items.length,h="",o=0;o<a;o++)x=g.items[o],C=x.checked,P=x.task,w="",x.task&&(T=this.renderer.checkbox(C),y?x.tokens.length>0&&x.tokens[0].type==="paragraph"?(x.tokens[0].text=T+" "+x.tokens[0].text,x.tokens[0].tokens&&x.tokens[0].tokens.length>0&&x.tokens[0].tokens[0].type==="text"&&(x.tokens[0].tokens[0].text=T+" "+x.tokens[0].tokens[0].text)):x.tokens.unshift({type:"text",text:T}):w+=T),w+=this.parse(x.tokens,y),h+=this.renderer.listitem(w,P,C);i+=this.renderer.list(h,f,m);continue}case"html":{i+=this.renderer.html(g.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(g.tokens));continue}case"text":{for(h=g.tokens?this.parseInline(g.tokens):g.text;r+1<j&&e[r+1].type==="text";)g=e[++r],h+=`
|
|||
|
`+(g.tokens?this.parseInline(g.tokens):g.text);i+=t?this.renderer.paragraph(h):h;continue}default:{let q='Token with "'+g.type+'" type was not found.';if(this.options.silent){console.error(q);return}else throw new Error(q)}}}return i}parseInline(e,t){t=t||this.renderer;let i="",r,o,s,a=e.length;for(r=0;r<a;r++){if(o=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(s=this.options.extensions.renderers[o.type].call({parser:this},o),s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){i+=s||"";continue}switch(o.type){case"escape":{i+=t.text(o.text);break}case"html":{i+=t.html(o.text);break}case"link":{i+=t.link(o.href,o.title,this.parseInline(o.tokens,t));break}case"image":{i+=t.image(o.href,o.title,o.text);break}case"strong":{i+=t.strong(this.parseInline(o.tokens,t));break}case"em":{i+=t.em(this.parseInline(o.tokens,t));break}case"codespan":{i+=t.codespan(o.text);break}case"br":{i+=t.br();break}case"del":{i+=t.del(this.parseInline(o.tokens,t));break}case"text":{i+=t.text(o.text);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return i}};Ae.options=Ae.setOptions=function(n){return ro(Ae.defaults,n),uue(Ae.defaults),Ae};Ae.getDefaults=V4;Ae.defaults=Mc;Ae.use=function(...n){let e=Ae.defaults.extensions||{renderers:{},childTokens:{}};n.forEach(t=>{let i=ro({},t);if(i.async=Ae.defaults.async||i.async,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){let o=e.renderers[r.name];o?e.renderers[r.name]=function(...s){let a=r.renderer.apply(this,s);return a===!1&&(a=o.apply(this,s)),a}:e.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[r.level]?e[r.level].unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),t.renderer){let r=Ae.defaults.renderer||new Kg;for(let o in t.renderer){let s=r[o];r[o]=(...a)=>{let l=t.renderer[o].apply(r,a);return l===!1&&(l=s.apply(r,a)),l}}i.renderer=r}if(t.tokenizer){let r=Ae.defaults.tokenizer||new zg;for(let o in t.tokenizer){let s=r[o];r[o]=(...a)=>{let l=t.tokenizer[o].apply(r,a);return l===!1&&(l=s.apply(r,a)),l}}i.tokenizer=r}if(t.walkTokens){let r=Ae.defaults.walkTokens;i.walkTokens=function(o){let s=[];return s.push(t.walkTokens.call(this,o)),r&&(s=s.concat(r.call(this,o))),s}}Ae.setOptions(i)})};Ae.walkTokens=function(n,e){let t=[];for(let i of n)switch(t=t.concat(e.call(Ae,i)),i.type){case"table":{for(let r of i.header)t=t.concat(Ae.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)t=t.concat(Ae.walkTokens(o.tokens,e));break}case"list":{t=t.concat(Ae.walkTokens(i.items,e));break}default:Ae.defaults.extensions&&Ae.defaults.extensions.childTokens&&Ae.defaults.extensions.childTokens[i.type]?Ae.defaults.extensions.childTokens[i.type].forEach(function(r){t=t.concat(Ae.walkTokens(i[r],e))}):i.tokens&&(t=t.concat(Ae.walkTokens(i.tokens,e)))}return t};Ae.parseInline=function(n,e){if(typeof n>"u"||n===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");e=ro({},Ae.defaults,e||{}),n6(e);try{let t=no.lexInline(n,e);return e.walkTokens&&Ae.walkTokens(t,e.walkTokens),kr.parseInline(t,e)}catch(t){if(t.message+=`
|
|||
|
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+zi(t.message+"",!0)+"</pre>";throw t}};Ae.Parser=kr;Ae.parser=kr.parse;Ae.Renderer=Kg;Ae.TextRenderer=$v;Ae.Lexer=no;Ae.lexer=no.lex;Ae.Tokenizer=zg;Ae.Slugger=Xv;Ae.parse=Ae;TRe=Ae.options,kRe=Ae.setOptions,PRe=Ae.use,RRe=Ae.walkTokens,_Re=Ae.parseInline,ERe=kr.parse,IRe=no.lex});function jc(n,e=!1){let t=Qg(n),i=[],r="";for(let o of t){if(!o.text)continue;let{foreground:s,background:a}=o,l=de(r),u=[l,l+de(o.text)];if(s&&a){let c=`CocList${cs(s)}${cs(a)}`;i.push({span:u,hlGroup:c})}else if(s){let c;e?s=="yellow"?c="CocMarkdownCode":s=="blue"?c="CocMarkdownLink":s=="magenta"?c="CocMarkdownHeader":c=`CocListFg${cs(s)}`:c=`CocListFg${cs(s)}`,i.push({span:u,hlGroup:c})}else if(a){let c=`CocListBg${cs(a)}`;i.push({span:u,hlGroup:c})}o.bold?i.push({span:u,hlGroup:"CocBold"}):o.italic?i.push({span:u,hlGroup:"CocItalic"}):o.underline?i.push({span:u,hlGroup:"CocUnderline"}):o.strikethrough&&i.push({span:u,hlGroup:"CocStrikeThrough"}),r=r+o.text}return{line:r,highlights:i}}function Qg(n){let e=null,t=null,i="",r=[],o=[],s={},a;a=()=>{let l,u;i.length?i=i.substr(0,i.length-1):o.length&&(l=o.length-1,u=o[l].text,u.length===1?o.pop():o[l].text=u.substr(0,u.length-1))};for(let l=0;l<n.length;l++){if(e!=null){e=="\x1B"&&n[l]=="["?(i&&(s.text=i,o.push(s),s={},i=""),i==""&&(n[l+1]=="m"||n[l+1]=="K")&&((s.foreground||s.background)&&(s.text="",o.push(s)),s={}),e=null,t=""):(i+=e+n[l],e=null);continue}else if(t!=null){n[l]==";"?(r.push(t),t=""):n[l]=="m"||n[l]=="K"?(r.push(t),t=null,i="",r.forEach(u=>{o6[u]?s.foreground=o6[u]:s6[u]?s.background=s6[u]:u==39?delete s.foreground:u==49?delete s.background:a6[u]?s[a6[u]]=!0:u==22?s.bold=!1:u==23?s.italic=!1:u==24?s.underline=!1:u==29&&(s.strikethrough=!1)}),r=[]):t+=n[l];continue}n[l]=="\x1B"?e=n[l]:n[l]=="\b"?a():i+=n[l]}return i&&(s.text=i+se(e),o.push(s)),o}var o6,s6,a6,Oc=D(()=>{"use strict";pe();o6={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white",90:"grey"},s6={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white"},a6={1:"bold",3:"italic",4:"underline",9:"strikethrough"}});function l6(n){return`${Yi.gray.open}${n}${Yi.gray.close}`}function CP(n){return`${Yi.magenta.open}${n}${Yi.magenta.close}`}function u6(n){return`${Yi.bold.open}${n}${Yi.bold.close}`}function SP(n){return`${Yi.underline.open}${n}${Yi.underline.close}`}function c6(n){return`${Yi.strikethrough.open}${n}${Yi.strikethrough.close}`}function d6(n){return`${Yi.italic.open}${n}${Yi.italic.close}`}function h6(n){return`${Yi.yellow.open}${n}${Yi.yellow.close}`}function DP(n){return`${Yi.blue.open}${n}${Yi.blue.close}`}var g6=D(()=>{"use strict";ce()});var b6=v((ORe,m6)=>{var f6={};m6.exports=f6;var p6={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(p6).forEach(function(n){var e=p6[n],t=f6[n]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var v6=v((ARe,y6)=>{var Vg=process.argv;y6.exports=function(){return Vg.indexOf("--no-color")!==-1||Vg.indexOf("--color=false")!==-1?!1:Vg.indexOf("--color")!==-1||Vg.indexOf("--color=true")!==-1||Vg.indexOf("--color=always")!==-1?!0:process.stdout&&!process.stdout.isTTY?!1:process.platform==="win32"||"COLORTERM"in process.env?!0:process.env.TERM==="dumb"?!1:!!/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)}()});var x6=v((NRe,w6)=>{w6.exports=function(e,t){var i="";e=e||"Run the trap, drop the bass",e=e.split("");var r={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2
|
|||
|
`);return i.reduce(function(r,o){return o.length>r?o.length:r},0)}});var W6=v((XRe,PP)=>{var jue=H6(),Hl=q6(),kP=Hl.repeat,Oue=Hl.truncate,Aue=Hl.pad;function ep(n){if(this.options=Hl.options({chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],colAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]},n),n&&n.rows)for(var e=0;e<n.rows.length;e++)this.push(n.rows[e])}ep.prototype.__proto__=Array.prototype;ep.prototype.__defineGetter__("width",function(){var n=this.toString().split(`
|
|||
|
`);return n.length?n[0].length:0});ep.prototype.render;ep.prototype.toString=function(){var n="",e=this.options,t=e.style,i=e.head,r=e.chars,o=e.truncate,s=e.colWidths||new Array(this.head.length),a=0;if(!i.length&&!this.length)return"";if(!s.length){var l=this.slice(0);i.length&&(l=l.concat([i])),l.forEach(function(w){if(typeof w=="object"&&w.length)u(w);else{var x=Object.keys(w)[0],C=w[x];s[0]=Math.max(s[0]||0,c(x)||0),typeof C=="object"&&C.length?u(C,1):s[1]=Math.max(s[1]||0,c(C)||0)}})}a=(s.length==1?s[0]:s.reduce(function(w,x){return w+x}))+s.length+1;function u(w,C){var C=C||0;w.forEach(function(P,T){s[T+C]=Math.max(s[T+C]||0,c(P)||0)})}function c(w){return typeof w=="object"&&w.width!=null?w.width:(typeof w=="object"?Hl.strlen(w.text):Hl.strlen(w))+(t["padding-left"]||0)+(t["padding-right"]||0)}function d(O,x,C,P){var T=0,O=x+kP(O,a-2)+C;return s.forEach(function(j,q){q!=s.length-1&&(T+=j+1,O=O.substr(0,T)+P+O.substr(T+1))}),f(e.style.border,O)}function h(){var w=d(r.top,r["top-left"]||r.top,r["top-right"]||r.top,r["top-mid"]);w&&(n+=w+`
|
|||
|
`)}function g(w,x){var C=[],P=0;if(!Array.isArray(w)&&typeof w=="object"){var T=Object.keys(w)[0],O=w[T],j=!0;Array.isArray(O)?(w=O,w.unshift(T)):w=[T,O]}w.forEach(function(X,z){var B=X.toString().split(`
|
|||
|
`).reduce(function(ve,Le){return ve.push(m(Le,z)),ve},[]),fe=B.length;fe>P&&(P=fe),C.push({contents:B,height:fe})});var q=new Array(P);C.forEach(function(X,z){X.contents.forEach(function(ve,Le){q[Le]||(q[Le]=[]),(x||j&&z===0&&e.style.head)&&(ve=f(e.style.head,ve)),q[Le].push(ve)});for(var B=X.height,fe=P;B<fe;B++)q[B]||(q[B]=[]),q[B].push(m("",z))});var K="";return q.forEach(function(X,z){K.length>0&&(K+=`
|
|||
|
`+f(e.style.border,r.left)),K+=X.join(f(e.style.border,r.middle))+f(e.style.border,r.right)}),f(e.style.border,r.left)+K}function f(w,x){return x?(w.forEach(function(C){x=jue[C](x)}),x):""}function m(C,x){var C=String(typeof C=="object"&&C.text?C.text:C),P=Hl.strlen(C),T=s[x]-(t["padding-left"]||0)-(t["padding-right"]||0),O=e.colAligns[x]||"left";return kP(" ",t["padding-left"]||0)+(P==T?C:P<T?Aue(C,T+(C.length-P)," ",O=="left"?"right":O=="middle"?"both":"left"):o?Oue(C,T,o):C)+kP(" ",t["padding-right"]||0)}i.length&&(h(),n+=g(i,t.head)+`
|
|||
|
`),this.length&&this.forEach(function(w,x){if(!i.length&&x==0)h();else if(!t.compact||x<!!i.length||w.length==0){var C=d(r.mid,r["left-mid"],r["right-mid"],r["mid-mid"]);C&&(n+=C+`
|
|||
|
`)}w.hasOwnProperty("length")&&!w.length||(n+=g(w)+`
|
|||
|
`)});var y=d(r.bottom,r["bottom-left"]||r.bottom,r["bottom-right"]||r.bottom,r["bottom-mid"]);return y?n+=y:n=n.slice(0,-1),n};PP.exports=ep;PP.exports.version="0.0.1"});function _o(n){return n}function que(n){return l6(n.replace(/(<([^>]+)>)/ig,""))}function Y6(n,e){return e?n.replace(Bue,`
|
|||
|
`):n}function Yue(n,e){return e.replace(/(^|\n)(.+)/g,"$1"+n+"$2")}function Zue(n,e){return e&&n+e.split(`
|
|||
|
`).join(`
|
|||
|
`+n)}function $ue(n,e){let t=new RegExp("(\\S(?: | )?)((?:"+e+")+)("+X6+"(?:.*)+)$","gm");return n.replace(t,`$1
|
|||
|
`+e+"$2$3")}function z6(n){return" ".repeat(n.length)}function Xue(n,e){return G6(e,n)?e:z6(IP)+e}function Gue(n,e){let t=Xue.bind(null,e);return n.split(`
|
|||
|
`).filter(_o).map(t).join(`
|
|||
|
`)}function zue(n,e,t){return G6(e,n)?{num:t+1,line:e.replace(IP,Z6(t+1))}:{num:t,line:z6(Z6(t))+e}}function Kue(n,e){let t=zue.bind(null,e),i=0;return n.split(`
|
|||
|
`).filter(_o).map(r=>{let o=t(r,i);return i=o.num,o.line}).join(`
|
|||
|
`)}function Que(n,e,t){return n=n.trim(),n=e?Kue(n,t):Gue(n,t),n}function tp(n){return n+`
|
|||
|
|
|||
|
`}function Vue(n){return n.replace(Hue,":")}function J6(n,e=null){if(!n)return[];e=e||_o;let t=e(n).split(`
|
|||
|
`),i=[];return t.forEach(function(r){if(!r)return;let o=r.replace(Nue,"").split(U6);i.push(o.splice(0,o.length-1))}),i}function K6(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function ece(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}var U6,_P,Nue,$6,Hue,Bue,Wue,Jue,Uue,X6,G6,IP,Z6,RP,EP,LP,Q6=D(()=>{"use strict";Be();g6();U6="^*||*^",_P="*|*|*|*",Nue=new RegExp(K6(_P),"g"),$6="*#COLON|*",Hue=new RegExp(K6($6),"g"),Bue=/\r/g;Wue={code:_o,blockquote:_o,html:que,heading:CP,firstHeading:CP,hr:_o,listitem:_o,list:Que,table:_o,paragraph:_o,strong:u6,em:d6,codespan:h6,del:c6,link:SP,href:SP,text:_o,unescape:!0,emoji:!1,width:80,showSectionPrefix:!1,tab:2,tableOptions:{}};Jue="\\*",Uue="\\d+\\.",X6="(?:"+[Jue,Uue].join("|")+")";G6=function(n,e){return n.match("^(?:"+e+")*"+X6)!=null};IP="* ";Z6=function(n){return n+". "};RP=new Map,EP=class{constructor(e={},t={}){this.options=e;this.highlightOptions=t;this.o=Object.assign({},Wue,e),this.tab=" ",this.tableSettings=this.o.tableOptions,this.unescape=ece,this.highlightOptions=$e(t),this.transform=this.compose(Vue,this.unescape)}text(e){return this.o.text(e)}code(e,t,i){return"``` "+t+`
|
|||
|
`+e+"\n```\n"}blockquote(e){return tp(this.o.blockquote(Zue(this.tab,e.trim())))}html(e){return this.o.html(e)}heading(e,t,i){return e=this.transform(e),tp(t===1?this.o.firstHeading(e):this.o.heading(e))}hr(){return`\u2500\u2500\u2500
|
|||
|
`}list(e,t){return e=this.o.list(e,t,this.tab),tp($ue(Yue(this.tab,e),this.tab))}listitem(e){let t=this.compose(this.o.listitem,this.transform);return e.indexOf(`
|
|||
|
`)!==-1&&(e=e.trim()),`
|
|||
|
`+IP+t(e)}checkbox(e){return"["+(e?"X":" ")+"] "}paragraph(e){return e=this.compose(this.o.paragraph,this.transform)(e),tp(e)}table(e,t){let i=W6(),r=new i(Object.assign({},{head:J6(e)[0]},this.tableSettings));return J6(t,this.transform).forEach(function(o){r.push(o)}),tp(this.o.table(r.toString()))}tablerow(e){return _P+e+_P+`
|
|||
|
`}tablecell(e,t){return e+U6}strong(e){return this.o.strong(e)}em(e){return e=Y6(e,this.o.reflowText),this.o.em(e)}codespan(e){return e=Y6(e,this.o.reflowText),this.o.codespan(e.replace(/:/g,$6))}br(){return`
|
|||
|
`}del(e){return this.o.del(e)}link(e,t,i){let r;try{r=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch{return""}if(r.startsWith("javascript:"))return"";if(i&&e&&i!=e&&RP.set(i,e),i&&i!=e)return DP(i);let o=this.o.href(e);return this.o.link(o)}image(e,t,i){return"!["+i+"]("+e+")"}compose(...e){return(...t)=>{for(let i=e.length;i-- >0;)t=[e[i].apply(this,t)];return t[0]}}static getLinks(){let e=[];for(let[t,i]of RP.entries())e.push(`${DP(t)}: ${i}`);return RP.clear(),e}},LP=EP});function sce(n){if(!n)return rce;let e=tce[n];return Ue(e)?e:n}function zv(n,e={}){let t=[],i=[],r=[],o=0;for(let s of n){let a=t.length,{content:l,filetype:u}=s,c=s.highlights;if(u==ice){let d=lce(l,e);r.push(...d.codes.map(h=>(h.startLine=h.startLine+a,h.endLine=h.endLine+a,h))),i.push(...d.highlights.map(h=>(h.lnum=h.lnum+a,h))),t.push(...d.lines)}else{let d=l.trim().split(/\r?\n/),h=V6[s.filetype];Ue(h)?r.push({hlGroup:h,startLine:a,endLine:a+d.length}):r.push({filetype:s.filetype,startLine:a,endLine:a+d.length}),t.push(...d)}if(Array.isArray(c)&&i.push(...c.map(d=>Object.assign({},d,{lnum:d.lnum+a}))),Array.isArray(s.active)){let d=ace(l,a,s.active);d.length&&i.push(...d)}o!=n.length-1&&(i.push({lnum:t.length,hlGroup:eZ,colStart:0,colEnd:-1}),t.push(tZ)),o=o+1}return{lines:t,highlights:i,codes:r}}function ace(n,e,t){let i=[],[r,o]=t,s=n.split(/\r?\n/),a=0,l=!1;for(let u=0;u<s.length;u++){let c=s[u];if(l)if(a+c.length>o){let d=rt(c,o-a);i.push({colStart:0,colEnd:d,lnum:u+e,hlGroup:Gv}),l=!1;break}else{let d=de(c);i.push({colStart:0,colEnd:d,lnum:u+e,hlGroup:Gv})}else if(a+c.length>r){l=!0;let d=rt(c,r-a);if(a+c.length>o){let h=rt(c,o-a);l=!1,i.push({colStart:d,colEnd:h,lnum:u+e,hlGroup:Gv});break}else{let h=de(c);i.push({colStart:d,colEnd:h,lnum:u+e,hlGroup:Gv})}}a=a+c.length+1}return i}function lce(n,e){Ae.setOptions({renderer:new LP,gfm:!0,breaks:_n(e.breaks)?e.breaks:!0});let t=[],i=[],r=[],o=0,s=!1,a,l=0,u=Ae(n),c=LP.getLinks();u=u.replace(/\s*$/,""),c.length&&(u=u+`
|
|||
|
|
|||
|
`+c.join(`
|
|||
|
`));let d=u.split(/\n/);for(let h=0;h<d.length;h++){let g=d[h];if(!g.length){if(!t[t.length-1])continue;let w=d[h+1];if(!w||w.startsWith(nce)||w.startsWith(tZ))continue;t.push(g),o++;continue}if(e.excludeImages&&g.indexOf("![")!==-1&&(g=g.replace(/\s*!\[.*?\]\(.*?\)/g,""),!ty(g).trim().length))continue;let f=g.match(/^\s*```\s*(\S+)?/);if(f){if(s)s=!1,r.push({filetype:a,startLine:l,endLine:o});else{let y=d[h-1];y&&/^\s*```\s*/.test(y)&&(t.push(""),o++),s=!0,a=sce(f[1]),l=o}continue}if(s){t.push(g),o++;continue}let m=jc(g,!0);if(g===oce)i.push({hlGroup:eZ,lnum:o,colStart:0,colEnd:-1});else if(m.highlights)for(let y of m.highlights){let{hlGroup:w,span:x}=y;i.push({hlGroup:w,lnum:o,colStart:x[0],colEnd:x[1]})}t.push(m.line),o++}return{lines:t,highlights:i,codes:r}}var V6,tce,Gv,eZ,ice,nce,rce,tZ,oce,FP=D(()=>{"use strict";r6();Oc();Xe();ce();pe();Q6();V6=(r=>(r.Error="CocErrorFloat",r.Warning="CocWarningFloat",r.Info="CocInfoFloat",r.Hint="CocHintFloat",r))(V6||{}),tce={js:"javascript",ts:"typescript",bash:"sh"},Gv="CocFloatActive",eZ="CocFloatDividingLine",ice="markdown",nce="```",rce="txt",tZ="\u2500",oce="\u2500\u2500\u2500"});var uce,Bl,MP=D(()=>{"use strict";ce();Re();FP();ee();Se();fs();Be();$();Jt();uce=ge(100,10),Bl=class{constructor(e){this.nvim=e;this.winid=0;this._bufnr=0;this.mutex=new Oi;this.disposables=[];this.onCursorMoved=mt(this._onCursorMoved.bind(this),uce)}bindEvents(e,t){let i=["InsertLeave","InsertEnter","BufEnter"];for(let r of i)_.on(r,o=>{o!=this._bufnr&&this.close()},null,this.disposables);_.on("MenuPopupChanged",()=>{_.pumAlignTop==t&&this.close()},null,this.disposables),this.disposables.push(p.Disposable.create(()=>{this.onCursorMoved.clear()})),_.on("CursorMoved",this.onCursorMoved.bind(this,e),this,this.disposables),_.on("CursorMovedI",this.onCursorMoved.bind(this,e),this,this.disposables)}unbind(){this.disposables.length&&(Y(this.disposables),this.disposables=[])}_onCursorMoved(e,t,i){if(t!=this._bufnr&&!(t==this.targetBufnr&&Fe(i,this.cursor))&&(t!=this.targetBufnr||!_.insertMode||e)){this.close();return}}async create(e,t=!1,i=0){await this.show(e,{offsetX:i})}async show(e,t={}){if(e.length==0||e.every(o=>o.content.length==0)){this.close();return}let i=Date.now(),r=await this.mutex.acquire();try{await this.createPopup(e,t,i),r()}catch(o){this.nvim.echoError(o),r()}}async createPopup(e,t,i){e=e.filter(m=>m.content.trim().length>0);let{lines:r,codes:o,highlights:s}=zv(e,{excludeImages:t.excludeImages,breaks:t.breaks}),a={codes:o,highlights:s,pumAlignTop:_.pumAlignTop,preferTop:typeof t.preferTop=="boolean"?t.preferTop:!1,offsetX:t.offsetX||0,title:t.title||"",close:t.close?1:0,rounded:t.rounded?1:0,modes:t.modes||["n","i","ic","s"],zindex:1};ai||(typeof t.winblend=="number"&&(a.winblend=t.winblend),t.focusable!=null&&(a.focusable=t.focusable?1:0),t.shadow&&(a.shadow=1)),t.maxHeight&&(a.maxHeight=t.maxHeight),t.maxWidth&&(a.maxWidth=t.maxWidth),t.border===!0?a.border=[1,1,1,1]:Array.isArray(t.border)&&!t.border.every(m=>m==0)&&(a.border=t.border.slice(0,4),a.rounded=t.rounded?1:0),t.highlight&&(a.highlight=t.highlight),t.borderhighlight&&(a.borderhighlight=t.borderhighlight),t.cursorline&&(a.cursorline=1);let l=t.autoHide!==!1;l&&(a.autohide=1),this.unbind();let u=await this.nvim.call("coc#dialog#create_cursor_float",[this.winid,this._bufnr,r,a]);if(this.nvim.redrawVim(),te(u)||this.closeTs>i){let m=u&&u.length>0?u[2]:this.winid;m&&(this.winid=0,this.nvim.call("coc#float#close",[m],!0),this.nvim.redrawVim());return}let[c,d,h,g,f]=u;this.winid=h,this._bufnr=g,this.targetBufnr=c,this.cursor=d,this.bindEvents(l,f==1)}close(){let{winid:e,nvim:t}=this;this.closeTs=Date.now(),this.unbind(),e&&(this.winid=0,t.call("coc#float#close",[e],!0),t.redrawVim())}checkRetrigger(e){return!!(this.winid&&this.targetBufnr==e)}get bufnr(){return this._bufnr}get buffer(){return this.bufnr?this.nvim.createBuffer(this.bufnr):null}get window(){return this.winid?this.nvim.createWindow(this.winid):null}async activated(){return this.winid?await this.nvim.call("coc#float#valid",[this.winid])!=0:!1}dispose(){this.cursor=vo
|
|||
|
`)],!0)}function dce(n){switch(n){case"error":return 2;case"warning":return 1;default:return 0}}async function uZ(n,e){if(e==="currline"){let i=await n.call("line",["."]);return M.create(i-1,0,i,0)}if(e==="cursor"){let i=await ip(n);return M.create(i,i)}let t=await n.call("coc#cursor#get_selection",[cce.includes(e)?1:0]);return!t||t[0]==-1?null:M.create(t[0],t[1],t[2],t[3])}async function cZ(n,e,t){let{start:i,end:r}=e,[o,s]=await n.eval(`[getline(${i.line+1}),getline(${r.line+1})]`),a=o.length>0?rt(o,i.character):0,l,u,c=r.character==0;if(c){u=r.line==0?0:r.line-1;let d=await n.call("getline",[u+1]);l=de(d)}else u=r.line,l=s.length>0?rt(s,r.character):0;n.pauseNotification(),n.command(`noa call cursor(${i.line+1},${a+1})`,!0),n.command("normal! v",!0),n.command(`noa call cursor(${u+1},${l})`,!0),c&&n.command("normal! $",!0),await n.resumeNotification(t)}var cce,ql=D(()=>{"use strict";ae();MP();Jt();pe();cce=["char","line","block"]});var Qv,hZ=D(()=>{"use strict";Re();JY();Ik();UY();XY();VY();ee();Se();Jt();fs();aa();Il();pe();xP();ql();Qv=class{constructor(){this.mutex=new Oi}async showDialog(e){return await this.mutex.use(async()=>{let t=new yv(this.nvim,e);return await t.show(this.dialogPreference),t})}async showPrompt(e){return await this.mutex.use(()=>nZ(this.nvim,e))}async createQuickPick(e){return await this.mutex.use(async()=>{let t=new Rc(this.nvim,this.dialogPreference);return Object.assign(t,e),t})}async showMenuPicker(e,t,i){return await this.mutex.use(async()=>{if(i&&i.isCancellationRequested)return-1;t=t||{},typeof t=="string"&&(t={title:t});let r=new Zg(this.nvim,{items:e,...t},i),o=new Promise(s=>{r.onDidClose(a=>{_.race(["BufHidden"],20).finally(()=>{s(a)})})});return await r.show(this.dialogPreference),await o})}async showQuickPick(e,t,i){t=ye(t,{});let r=await Promise.resolve(e);if(te(r))return;let o=r.some(s=>typeof s=="string");return await this.mutex.use(()=>new Promise((s,a)=>{if(i.isCancellationRequested)return s(void 0);let l=new Rc(this.nvim,this.dialogPreference);l.items=r.map(u=>typeof u=="string"?{label:u}:u),l.title=se(t.title),l.placeholder=t.placeholder,l.canSelectMany=!!t.canPickMany,l.matchOnDescription=t.matchOnDescription,l.onDidFinish(u=>{if(u==null)return s(void 0);let c=o?u.map(d=>d.label):u;if(t.canPickMany)return s(c);s(c[0])}),l.show().catch(a)}))}async showPickerDialog(e,t,i){return await this.mutex.use(async()=>{if(i&&i.isCancellationRequested)return;let r=new Jg(this.nvim,{title:t,items:$Y(e)},i),o=new Promise(a=>{r.onDidClose(l=>{a(l)})});await r.show(this.dialogPreference);let s=await o;return s==null?void 0:e.filter((a,l)=>s.includes(l))})}async requestInput(e,t,i,r){let{nvim:o}=this,s=this.configuration.get("coc.preferences.promptInput"),a=!ai||Wv(t,"patch-8.2.750")&&!eo;return s&&a?await this.mutex.use(async()=>{let l=new ua(o,se(i));return await l.show(e,Object.assign(this.inputPreference,ye(r,{}))),await new Promise(u=>{l.onDidFinish(c=>{setTimeout(()=>{u(c)},20)})})}):await this.mutex.use(async()=>{let l=await Yv(this.nvim,"input",[e+": ",se(i)]);return o.command("normal! :<C-u>",!0),l})}async createInputBox(e,t,i){let r=new ua(this.nvim,se(t));return await r.show(e,Object.assign(this.inputPreference,ye(i,{}))),r}get inputPreference(){let e=this.configuration.get("dialog");return{rounded:!!e.rounded,maxWidth:on(e.maxWidth,80),highlight:ye(e.floatHighlight,_g),borderhighlight:ye(e.floatBorderHighlight,_g)}}get dialogPreference(){let e=this.configuration.get("dialog");return{rounded:!!e.rounded,maxWidth:on(e.maxWidth,80),maxHeight:e.maxHeight,floatHighlight:ye(e.floatHighlight,_g),floatBorderHighlight:ye(e.floatBorderHighlight,_g),pickerButtons:e.pickerButtons,pickerButtonShortcut:e.pickerButtonShortcut,confirmKey:se(e.confirmKey),shortcutHighlight:se(e.shortcutHighlight)}}}});function Vv(n){return[n.hlGroup,n.lnum,n.colStart,n.colEnd,n.combine?1:0,n.start_incl?1:0,n.end_incl?1:0]}function gZ(n,e){let t=[n.hlGroup,n.lnum,n.colStart,n.colEnd];return Fe(t,e.slice(0,4))}var ew,pZ=D(()=>{"use strict";ee();Be();ew=class{async diffHighlights(e,t,i,r,o){let s=[e,t];Array.isArr
|
|||
|
`),0,i]]);return t[s-1]}echoMessages(e,t){let i=this.configuration.get("coc.preferences.messageLevel","more");lZ(this.nvim,e,t,i)}async showNotification(e,t){await new ma(this.nvim,e).show(this.getNotificationPreference(t))}async withProgress(e,t){let i=this.configuration.get("notification");if(!e.cancellable&&i.statusLineProgress)return await this.createStatusLineProgress(e,t);let r=new np(this.nvim,{task:t,title:e.title,cancellable:e.cancellable}),o=on(i.minProgressWidth,40),s=new Promise(l=>{r.onDidFinish(l)}),a=Error().stack;return await r.show(Object.assign(this.getNotificationPreference(a,e.source),{minWidth:o})),await s}async createStatusLineProgress(e,t){let{title:i}=e,r=this.statusLine.createStatusBarItem(0,!0);r.text=se(i),r.show();let o=0,s=await t({report:a=>{a.increment&&(o+=a.increment),r.text=bZ(i,a.message,o).replace(/\r?\n/g," ")}},p.CancellationToken.None);return r.dispose(),s}get enableMessageDialog(){return this.configuration.get("coc.preferences.enableMessageDialog",!1)}getNotificationPreference(e,t){t||(t=Ll(e));let i=this.configuration.get("notification"),r=ye(i.disabledProgressSources,[]),o=Array.isArray(r)&&(r.includes("*")||r.includes(t));return{border:i.border,focusable:i.focusable,marginRight:on(i.marginRight,10),timeout:on(i.timeout,1e4),maxWidth:on(i.maxWidth,60),maxHeight:on(i.maxHeight,10),highlight:i.highlightGroup,winblend:on(i.winblend,30),disabled:o,source:t}}}});var iw,wZ=D(()=>{"use strict";iw=class{constructor(e,t,i,r,o){this.cmd=e;this.args=t;this.nvim=i;this._name=r;this.strictEnv=o;this.pid=0}async start(e,t){let{nvim:i}=this,r=[this.cmd,...this.args],[o,s]=await i.call("coc#terminal#start",[r,e,t||{},!!this.strictEnv]);this.bufnr=o,this.pid=s}onExit(e){this.exitStatus={code:e===-1?void 0:e}}get name(){return this._name||this.cmd}get processId(){return Promise.resolve(this.pid)}sendText(e,t=!0){!this.bufnr||this.nvim.call("coc#terminal#send",[this.bufnr,e,t],!0)}async show(e){let{bufnr:t,nvim:i}=this;if(!t)return!1;let[r,o,s]=await i.eval(`[bufloaded(${t}),win_getid(),win_findbuf(${t})]`);if(!r)return!1;let a=s[0];return a&&o==a||(i.pauseNotification(),a?i.call("win_gotoid",[a],!0):(i.command(`below ${t}sb`,!0),i.command("resize 8",!0),i.call("coc#util#do_autocmd",["CocTerminalOpen"],!0)),i.command("normal! G",!0),e&&i.command("wincmd p",!0),await i.resumeNotification()),!0}async hide(){let{bufnr:e,nvim:t}=this;!e||await t.eval(`coc#window#close(bufwinid(${e}))`)}dispose(){this.exitStatus||(this.exitStatus={code:void 0});let{bufnr:e,nvim:t}=this;!e||(this.bufnr=void 0,t.call("coc#terminal#close",[e],!0))}}});var rp,xZ=D(()=>{"use strict";Re();wZ();ee();Be();$();rp=class{constructor(){this._terminals=new Map;this.disposables=[];this._onDidOpenTerminal=new p.Emitter;this._onDidCloseTerminal=new p.Emitter;this.onDidCloseTerminal=this._onDidCloseTerminal.event;this.onDidOpenTerminal=this._onDidOpenTerminal.event;_.on("BufUnload",e=>{if(this._terminals.has(e)){let t=this._terminals.get(e);this._onDidCloseTerminal.fire(t),this._terminals.delete(e)}},null,this.disposables),_.on("TermExit",(e,t)=>{let i=this._terminals.get(e);i&&(i.onExit(t),i.dispose())},null,this.disposables)}get terminals(){return Array.from(this._terminals.values())}async createTerminal(e,t){let i=t.cwd,r=t.shellPath,o=t.shellArgs;r||(r=await e.getOption("shell")),i||(i=await e.call("getcwd"));let s=new iw(r,o||[],e,t.name,t.strictEnv);return await s.start(i,t.env),this._terminals.set(s.bufnr,s),this._onDidOpenTerminal.fire(s),s}async runTerminalCommand(e,t,i,r){return await e.callAsync("coc#ui#run_terminal",{cmd:t,cwd:i,keepfocus:r?1:0})}async openTerminal(e,t,i){return await e.call("coc#ui#open_terminal",{cmd:t,...$e(i)})}reset(){for(let e of this._terminals.values())e.dispose();this._terminals.clear()}dispose(){this._onDidOpenTerminal.dispose(),this._onDidCloseTerminal.dispose(),Y(this.disposables),this.reset()}}});var CZ=v((kEe,gce)=>{gce.exports={description:"Configuration file for coc.nvim",additionalProperties:!1,definitions:{floatConfig:{type:"object",properties:{border:{type:"boolean",default:!1,description
|
|||
|
need restart on change.`,default:!1},"coc.preferences.watchmanPath":{type:"string",scope:"application",description:"executable path for https://facebook.github.io/watchman/, detected from $PATH by default",default:null},"coc.preferences.willSaveHandlerTimeout":{type:"integer",scope:"application",default:500,minimum:200,maximum:5e3,description:"Will save handler timeout"},"coc.source.around.disableSyntaxes":{type:"array",default:[],scope:"application",items:{type:"string"}},"coc.source.around.enable":{type:"boolean",scope:"application",default:!0},"coc.source.around.priority":{type:"integer",scope:"application",default:1},"coc.source.around.shortcut":{type:"string",scope:"application",default:"A"},"coc.source.buffer.disableSyntaxes":{type:"array",default:[],scope:"application",items:{type:"string"}},"coc.source.buffer.enable":{type:"boolean",scope:"application",default:!0},"coc.source.buffer.ignoreGitignore":{type:"boolean",default:!0,scope:"application",description:"Ignore git ignored files for buffer words"},"coc.source.buffer.priority":{type:"integer",scope:"application",default:1},"coc.source.buffer.shortcut":{type:"string",scope:"application",default:"B"},"coc.source.file.disableSyntaxes":{type:"array",default:[],scope:"application",items:{type:"string"}},"coc.source.file.enable":{type:"boolean",scope:"application",default:!0},"coc.source.file.ignoreHidden":{type:"boolean",scope:"application",default:!0,description:"Ignore completion for hidden files"},"coc.source.file.ignorePatterns":{type:"array",scope:"application",default:[],description:"Ignore patterns of matcher",items:{type:"string"}},"coc.source.file.priority":{type:"integer",scope:"application",default:10},"coc.source.file.shortcut":{type:"string",scope:"application",default:"F"},"coc.source.file.triggerCharacters":{type:"array",default:["/","\\"],scope:"application",items:{type:"string"}},"coc.source.file.trimSameExts":{type:"array",scope:"application",default:[".ts",".js"],description:"Trim same extension on file completion",items:{type:"string"}},"codeLens.enable":{type:"boolean",scope:"language-overridable",description:"Enable codeLens feature, require neovim with set virtual text feature.",default:!1},"codeLens.position":{type:"string",scope:"resource",enum:["top","eol","right_align"],description:"Position of codeLens, requires nvim >= 0.6.0",default:"top"},"codeLens.separator":{type:"string",scope:"resource",description:"Separator text for codeLens in virtual text",default:""},"codeLens.subseparator":{type:"string",scope:"resource",description:"Subseparator between codeLenses in virtual text",default:" | "},"colors.enable":{type:"boolean",scope:"language-overridable",description:"Enable colors highlight feature, for termainal vim, 'termguicolors' option should be enabled and the termainal support gui colors.",default:!1},"colors.filetypes":{type:["array","null"],default:null,scope:"resource",deprecationMessage:"Use colors.enable as language override configuration instead, see :h coc-configuration-scope",description:'Filetypes that should be enabled for colors highlight feature, use "*" for all filetypes.',items:{type:"string"}},"colors.highlightPriority":{type:"integer",scope:"application",description:"Priority for colors highlights, works on vim8 and neovim >= 0.6.0",default:1e3,maximum:4096},"cursors.cancelKey":{type:"string",scope:"application",default:"<esc>",description:"Key used for cancel cursors session."},"cursors.nextKey":{type:"string",scope:"application",default:"<C-n>",description:"Key used for jump to next cursors position."},"cursors.previousKey":{type:"string",scope:"application",default:"<C-p>",description:"Key used for jump to previous cursors position."},"cursors.wrapscan":{type:"boolean",scope:"application",default:!0,description:"Searches wrap around the first or last cursors range."},"diagnostic.autoRefresh":{type:"boolean",scope:"language-overridable",description:"Enable automatically refresh diagnostics, use diagnosticRefresh action when it's disabled.",default:!0},"diagnostic.checkCurrentLine":{type:"boolean",scope:"language-
|
|||
|
`]},"suggest.labelMaxLength":{type:"integer",scope:"application",description:"Max length of abbr that shown as label of complete item.",default:200},"suggest.languageSourcePriority":{type:"integer",default:99,scope:"language-overridable",description:"Priority of language sources."},"suggest.localityBonus":{type:"boolean",description:"Controls whether sorting favors words that appear close to the cursor.",scope:"language-overridable",default:!0},"suggest.lowPrioritySourceLimit":{type:"integer",minimum:1,maximum:100,scope:"language-overridable",description:"Max items count for source priority lower than 90."},"suggest.maxCompleteItemCount":{type:"integer",default:256,scope:"language-overridable",description:"Maximum number of complete items shown in vim"},"suggest.minTriggerInputLength":{type:"integer",default:1,scope:"language-overridable",description:"Minimal input length for trigger completion, default 1"},"suggest.noselect":{type:"boolean",scope:"application",description:"Not make vim select first item on popupmenu shown",default:!1},"suggest.preferCompleteThanJumpPlaceholder":{type:"boolean",description:"Confirm completion instead of jump to next placeholder when completion is activated.",scope:"resource",default:!1},"suggest.pumFloatConfig":{type:["object","null"],scope:"application",description:"Configure style of popup menu, suggest.floatConfig is used when not specified.",allOf:[{$ref:"#/definitions/floatConfig"}],additionalProperties:!1,default:null,properties:{border:{},rounded:{},highlight:{},borderhighlight:{},winblend:{},shadow:{}}},"suggest.removeDuplicateItems":{type:"boolean",description:"Remove completion items with duplicated word for all sources, snippet items are excluded.",scope:"language-overridable",default:!1},"suggest.reversePumAboveCursor":{type:"boolean",scope:"application",description:"Reverse order of complete items when pum shown above cursor.",default:!1},"suggest.selection":{type:"string",scope:"application",default:"first",description:"Controls how suggestions are pre-selected when showing the suggest list.",enum:["first","recentlyUsed","recentlyUsedByPrefix"]},"suggest.snippetIndicator":{type:"string",default:"~",scope:"application",description:"The character used in abbr of complete item to indicate the item could be expand as snippet."},"suggest.snippetsSupport":{type:"boolean",scope:"language-overridable",description:"Set to false to disable snippets support of completion.",default:!0},"suggest.timeout":{type:"integer",default:5e3,minimum:500,maximum:15e3,scope:"language-overridable",description:"Timeout for completion, in milliseconds."},"suggest.triggerAfterInsertEnter":{type:"boolean",description:"Trigger completion after InsertEnter, auto trigger should be 'always' to enable this option",scope:"language-overridable",default:!1},"suggest.triggerCompletionWait":{type:"integer",default:0,minimum:0,maximum:50,scope:"language-overridable",description:"Wait time between text change and completion start, cancel completion when text changed during wait."},"suggest.virtualText":{type:"boolean",scope:"application",description:"Show virtual text for insert word of selected item, requires neovim >= 0.5.0 or vim >= 9.0.0067",default:!1},"tree.closedIcon":{type:"string",scope:"application",default:"+",description:"Closed icon of tree view."},"tree.key.actions":{type:"string",scope:"application",default:"<tab>",description:"Trigger key to invoke actions."},"tree.key.activeFilter":{type:"string",scope:"application",default:"f",description:"Trigger key active filter."},"tree.key.close":{type:"string",scope:"application",default:"<esc>",description:"Trigger key to dispose the tree and close tree window."},"tree.key.collapseAll":{type:"string",scope:"application",default:"M",description:"Trigger key to collapse all tree node."},"tree.key.invoke":{type:"string",scope:"application",default:"<cr>",description:"Trigger key to invoke default command of current node or selection."},"tree.key.selectNext":{type:"string",scope:"application",default:"<C-j>",description:"Trigger key to select next item during
|
|||
|
`:"")+`From ${i.id}`),l.hasOwnProperty("included")&&!l.included){this.excludedConfigurationProperties[a]=s[a],delete s[a];continue}else this.configurationProperties[a]=s[a];!s[a].deprecationMessage&&s[a].markdownDeprecationMessage&&(s[a].deprecationMessage=s[a].markdownDeprecationMessage),o.push(a)}return o}getConfigurationProperties(){return this.configurationProperties}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){(i=>{let r=i.properties;for(let o in $e(r))this.updateSchema(o,r[o])})(e)}updateSchema(e,t){switch(Yl.properties[e]=t,t.scope){case 2:case 3:Wl.properties[e]=t;break;case 4:Wl.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Yl.properties[e],t.scope){case 2:case 3:case 4:delete Wl.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}registerOverridePropertyPatternKey(){let e={type:"object",description:"Configure editor settings to be overridden for a language.",errorMessage:"This setting does not support per-language configuration.",$ref:dp};Yl.patternProperties[nw]=e,Wl.patternProperties[nw]=e}updatePropertyDefaultValue(e,t){let i=t.defaultDefaultValue;typeof i>"u"&&!vce.some(r=>e.includes(r))&&(i=FZ(t.type)),t.default=i,t.defaultValueSource=void 0}},OZ=new YP;di.add(Zl.Configuration,OZ)});var hw,ZP,xce,Cce,Sce,va,hp,AZ=D(()=>{"use strict";Je();hw=sr(CZ());Ce();ee();Se();Jt();hs();at();Xe();AP();ce();Be();$();ko();WP();MZ();cp();jZ();dw();To();ba();ZP=J("configurations"),xce="vscode://schemas/settings/user",Cce="vscode://schemas/settings/folder",Sce=di.as(op.JSONContribution),va=di.as(Zl.Configuration),hp=class{constructor(e,t,i=!1,r=process.cwd()){this.userConfigFile=e;this._proxy=t;this.noWatch=i;this._watchedFiles=new Set;this._errors=new Map;this._onError=new p.Emitter;this._onChange=new p.Emitter;this.disposables=[];this._initialized=!1;this.cached=[];this.onError=this._onError.event;this.onDidChange=this._onChange.event;let o=this.loadDefaultConfigurations(),s=this.parseConfigurationModel(this.userConfigFile);this._configuration=new ya(o,s),this.watchFile(this.userConfigFile,1);let a=this.folderToConfigfile(r);a&&this.addFolderFile(a,!0),this._initialConfiguration=this.getConfiguration(void 0,null)}get initialConfiguration(){return this._initialConfiguration}get markdownPreference(){let e=this._initialConfiguration.get("coc.preferences");return{excludeImages:e.excludeImageLinksInMarkdownDocument,breaks:e.enableGFMBreaksInMarkdownDocument}}get errors(){return this._errors}get configuration(){return this._configuration}flushConfigurations(){this._initialized=!0,va.registerConfigurations(this.cached),this.cached=[]}updateConfigurations(e,t){this._initialized?te(t)?va.registerConfigurations(e):va.updateConfigurations({add:e,remove:t}):this.cached.push(...e)}loadDefaultConfigurations(){let e={properties:bv(hw.default.properties)};va.registerConfiguration(e),va.onDidUpdateConfiguration(s=>{if(s.properties.length===0)return;let a=va.getConfigurationProperties(),l=[],u=Object.create(null),c=[];for(let h of s.properties){let g=a[h];if(g){c.push(h);let f=g.default;Bc(u,h,f,m=>{ZP.error(`Conflict configuration: ${m}`)})}else l.push(h)}let d=this._configuration.defaults.merge(new ui(u,c));l.forEach(h=>{d.removeValue(h)}),this._initialized?this.changeConfiguration(0,d,void 0,s.properties):(this._configuration.updateDefaultConfiguration(d),this._initialConfiguration=this.getConfiguration(void 0,null))},null,this.disposables);let t=va.getConfigurationProperties(),i={},r=[];return Object.keys(t).forEach(s=>{let a=t[s].default;r.push(s),Bc(i,s,a,void 0)}),new ui(i,r)}getDescription(e){let t=Yl.properties[e];return t?t.description:void 0}getJSONSchema(e){if(e===xce)return{properties:Yl.properties,patternProperties:Yl.patternProperties,definitions:Object.assign(Dk(),hw.default.definitions),additionalProperties:!1,allowTrailingCommas:!0,allowComments:!0};if(e===Cce)return{properties:Wl.properties,patternProperties:Wl.patternProperties,definitions:Object.assign(Dk(),hw.defa
|
|||
|
`)+`
|
|||
|
`:"";if(!(h.length===0&&a===r-c))return Ye.replace(M.create(a,0,r-c,0),h)}var UP=D(()=>{"use strict";ae();ce();pe()});function ri(n,e){return Ot(n.start,e)===0&&Ot(n.end,e)===0}function $Z(n,e){return gw(n.start,e.start)?gw(n.end,e.end):!1}function gw(n,e){return n.line===e.line&&n.character===e.character}function wa(n,e){let t=n.start.line|0,i=e.start.line|0;if(t===i){let r=n.start.character|0,o=e.start.character|0;if(r===o){let s=n.end.line|0,a=e.end.line|0;if(s===a){let l=n.end.character|0,u=e.end.character|0;return l-u}return s-a}return r-o}return t-i}function XZ(n,e){let{start:t,end:i}=n;if(t.line>i.line||t.line===i.line&&t.character>i.character){let o=t;t=i,i=o}t=V.create(Math.max(0,t.line),Math.max(0,t.character));let r=Math.max(0,i.character);return typeof e=="number"&&r>e&&(r=e),i=V.create(Math.max(0,i.line),r),{start:t,end:i}}function pw(n,e){return ze(n.end,e.start)==0||ze(e.end,n.start)==0}function Wc(n,e){let{start:t,end:i}=n;return!(ze(i,e.start)<=0||ze(t,e.end)>=0)}function Jl(n,e){return!!(Ot(n.start,e)==0||Ot(n.end,e)==0||ri(e,n))}function GZ(n,e){let{line:t,character:i}=e,{start:r,end:o}=n,s=o.line==r.line?o.character+i:o.character;return M.create(r.line+t,i+r.character,o.line+t,s)}function zZ(n,e){let{start:t,end:i}=e;return n>=t.line&&n<=i.line}function Kt(n){let{start:e,end:t}=n;return e.line==t.line&&e.character==t.character}function Ot(n,e){let{start:t,end:i}=e;return ze(n,t)<0?-1:ze(n,i)>0?1:0}function ze(n,e){return n.line>e.line||e.line==n.line&&n.character>e.character?1:e.line==n.line&&n.character==e.character?0:-1}function KZ(n){return n.start.line==n.end.line}function sn(n,e){let t=e.split(/\r?\n/),i=t.length,r=t[i-1],o=i==1?n.character+e.length:r.length;return V.create(n.line+i-1,o)}var Pt=D(()=>{"use strict";ae()});function QZ(n){let{start:e,end:t}=n.range;return n.newText.endsWith(`
|
|||
|
`)&&e.line==t.line&&e.character==0&&t.character==0?e.line-1:e.line}function xa(n){let{newText:e}=n,t=fw(n.range),i=t.end.line-t.start.line;return e.split(/\r?\n/).length-i-1}function fw(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function $P(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);$P(i,e),$P(r,e);let o=0,s=0,a=0;for(;o<i.length&&s<r.length;)e(i[o],r[s])<=0?n[a++]=i[o++]:n[a++]=r[s++];for(;o<i.length;)n[a++]=i[o++];for(;s<r.length;)n[a++]=r[s++];return n}function XP(n){return $P(n,(e,t)=>{let i=e.range.start.line-t.range.start.line;return i===0?e.range.start.character-t.range.start.character:i})}function VZ(n){let{changes:e,documentChanges:t}=n;return!(t&&t.length||e&&Object.keys(e).length)}function eJ(n,e){let{changes:t,documentChanges:i}=e;if(t){let r=t[n];return r?r.map(o=>o.range):void 0}else if(Array.isArray(i)){for(let r of i)if(ei.is(r)&&r.textDocument.uri==n)return r.edits.map(o=>o.range)}}function tJ(n,e){let t=[],i=r=>{var o;r&&!t.includes(r)&&((o=e[r])==null?void 0:o.needsConfirmation)&&t.push(r)};for(let r of n)ei.is(r)?r.edits.forEach(o=>{i(o.annotationId)}):i(r.annotationId);return t}function Tce(n,e){return!!(In.is(n)&&e.includes(n.annotationId))}function iJ(n,e){let t=[];return n.forEach(i=>{if(ei.is(i)){let r=i.edits.filter(o=>!Tce(o,e));r.length>0&&t.push({textDocument:i.textDocument,edits:r})}else e.includes(i.annotationId)||t.push(i)}),t}function nJ(n){let e;return ei.is(n)?In.is(n.edits[0])&&(e=n.edits[0].annotationId):e=n.annotationId,e}function rJ(n){if(n.documentChanges)return n.documentChanges;let e=[];for(let[t,i]of Object.entries($e(n.changes)))e.push({textDocument:{uri:t,version:null},edits:i});return e}function oJ(n,e){let t=[],i=n.end,r=i.line>0&&i.character==0,o;for(let s=0;s<e.length;s++){let a=e[s],{newText:l,range:u}=a,c=(n.lines[u.end.line]??"").length;if(u=XZ(a.range,c),o){if(gw(o,u.start)&&Kt(u)&&l.length>0){let h=t[t.length-1];h.newText=l,o=void 0;continue}o=void 0}l.includes("\r")&&(l=l.replace(/\r\n/g,`
|
|||
|
`));let d=ze(u.end,i);if(d>0&&(u.end={line:i.line,character:i.character}),n.getText(u)!==l){if(d===0&&r&&!Kt(u)&&l.endsWith(`
|
|||
|
`)){l=l.slice(0,-1);let h=n.lines[i.line-1];u.end=V.create(i.line-1,h.length)}else l.length==0&&(o=u.start);t.push({range:u,newText:l})}}return XP(t)}function sJ(n,e){if(te(e))return;if(e.length==1){let{start:s,end:a}=e[0].range,{lines:l}=n,u=l[s.line]??"",c=l[a.line]??"",d=u.substring(0,s.character)+e[0].newText+c.substring(a.character);return a.line>=l.length&&n.eol?d==""?[...l.slice(0,s.line)]:(d.endsWith(`
|
|||
|
`)&&(d=d.slice(0,-1)),[...l.slice(0,s.line),...d.split(`
|
|||
|
`)]):[...l.slice(0,s.line),...d.split(`
|
|||
|
`),...l.slice(a.line+1)]}let t=n.getText(),i=0,r=[];for(let s of e){let a=n.offsetAt(s.range.start);if(a<i)throw new Error("Overlapping edit");a>i&&r.push(t.substring(i,a)),s.newText.length&&r.push(s.newText),i=n.offsetAt(s.range.end)}r.push(t.substring(i));let o=r.join("");if(o!==t)return mY(o,n.eol)}function aJ(n,e){return e.map(t=>{let{start:i,end:r}=t.range,o=se(n[i.line]),s=rt(o,i.character),a=r.line==i.line?o:se(n[r.line]),l=rt(a,r.character),{newText:u}=t;return[u.length>0?u.split(`
|
|||
|
`):[],i.line,s,r.line,l]})}function mw(n,e){let{range:t,newText:i}=e;if(ze(t.end,n)<=0){let r=i.split(`
|
|||
|
`),o=r.length-(t.end.line-t.start.line)-1,s=n.character;if(t.end.line==n.line){let a=r[r.length-1].length;r.length>1?s=a+s-t.end.character:s=t.start.character+a+s-t.end.character}return{line:o,character:s-n.character}}return{line:0,character:0}}function bw(n,e){let{line:t,character:i}=n,{range:r,newText:o}=e,{end:s}=r,a=o.split(`
|
|||
|
`),l=a.length-(s.line-r.start.line)-1,u=r.end.line-n.line;if(u>0)return{line:t,character:i};if(u<0)return{line:t+l,character:i};if(a.length>1){let d=a[a.length-1].length;return{line:t+l,character:d+i-s.character}}let c=r.start.character-r.end.character;return{line:t+l,character:c+o.length+i}}function yw(n,e){let t=V.create(n.line,n.character),i=!1;for(let r=e.length-1;r>=0;r--){let o=e[r];if(i){t.line+=xa(o);continue}ze(o.range.end,t)>0||(o.range.end.line==t.line?t=bw(t,o):(i=!0,t.line+=xa(o)))}return t}function GP(n,e){let t=0;for(let i of e){let r=fw(i.range);ze(r.end,n)<=0&&(t+=xa(i))}return t}function lJ(n,e,t){let i=n[0].range.start,r=n[n.length-1].range.end,o=e.length-r.line,s=(e[r.line]??"").length-r.character,a=t.length-o,l=(t[a]??"").length-s,u=kce(i,V.create(a,l),t);return Ye.replace(M.create(i,r),u)}function kce(n,e,t){if(n.line===e.line)return se(t[n.line]).slice(n.character,e.character);let i=[];for(let r=n.line;r<=e.line;r++){let o=t[r]??"";r===n.line?i.push(o.slice(n.character)):r===e.line?i.push(o.slice(0,e.character)):i.push(o)}return i.join(`
|
|||
|
`)}var Pr=D(()=>{"use strict";ae();Se();Be();Pt();pe()});function KP(n){if(/^\d+$/.test(n))return parseInt(n,10);if(n.length>0)return n.charCodeAt(0)}function QP(n,e){return n<zP?e<zP:e>=zP}function*Ece(n){if(Intl===void 0||typeof Intl.Segmenter!="function"){yield n;return}let e=[],t=new Intl.Segmenter("cn",{granularity:"word"}).segment(n);for(let i of t)i.isWordLike&&(yield i.segment);return e}function Ice(n){let e=[],t=0,i=0,r=n.length;for(;t<r;t++){let o=n[t];if(t+1==r&&i!=r){e.push(n.slice(i,r));continue}if(o==","){let s=t-i;if(s==0)continue;if(s==1){let a=n[t-1];if(a=="^"||a==","){e.push(a==","?",":"^,"),i=t+1,a=="^"&&n[t+1]==","&&(t++,i++);continue}}e.push(n.slice(i,t)),i=t+1}}return e}var Pce,Rce,_ce,zP,Yc,Zc,VP=D(()=>{"use strict";ae();ee();Se();Be();pe();Pce=[[257,893],[895,902],[904,1369],[1376,1416],[1418,1469],[1471,1471],[1473,1474],[1476,1522],[1525,1547],[1549,1562],[1564,1566],[1568,1641],[1646,1747],[1749,1791],[1806,2403],[2406,2415],[2417,3571],[3573,3662],[3664,3673],[3676,3843],[3859,3897],[3902,3972],[3974,4169],[4176,4346],[4348,4960],[4969,5740],[5743,5759],[5761,5786],[5789,5866],[5870,5940],[5943,6099],[6109,6143],[6155,8191],[10240,10495],[10649,10711],[10716,10747],[10750,11775],[11904,12287],[12321,12335],[12337,12348],[12350,64829],[64832,65071],[65132,65279],[65296,65305],[65313,65338],[65345,65370],[65382,65535]],Rce=65535,_ce=/[\u4e00-\u9fa5]/,zP=19968;Yc=class{constructor(e=[],t=!1){this.ranges=e;this.wordChars=t}clone(){return new Yc(this.ranges.slice(),this.wordChars)}add(e,t){let i=0,r=0;if(t!=null&&t<e){let o=t;t=e,e=o}t=t??e;for(let o of this.ranges){let[s,a]=o;if(a<e){i++;continue}if(s>t)break;if(r++,s<e&&(e=s),a>t){t=a;break}}this.ranges.splice(i,r,[e,t])}exclude(e,t){if(t!=null&&t<e){let s=t;t=e,e=s}t=t??e;let i=0,r=0,o=[];for(let s of this.ranges){let[a,l]=s;if(l<e){i++;continue}if(a>t)break;if(r++,a<e&&o.push([a,e-1]),l>t){o.push([t+1,l]);break}}r==0&&o.length==0||this.ranges.splice(i,r,...o)}flatten(){return this.ranges.reduce((e,t)=>e.concat(t),[])}includes(e){return e>256&&this.wordChars?kg(e,Pce):kg(e,this.ranges)}static fromKeywordOption(e){let t=new Yc;for(let i of Ice(e)){let r=i.length>1&&i.startsWith("^"),o=r?"exclude":"add";if(r&&(i=i.slice(1)),i==="@"&&!r)t.wordChars=!0,t[o](65,90),t[o](97,122),t[o](192,255);else if(i=="@-@")t[o]("@".charCodeAt(0));else if(i.length==1||/^\d+$/.test(i))t[o](KP(i));else if(i.includes("-")){let s=i.split("-",2),a=KP(s[0]),l=KP(s[1]);if(a===void 0||l===void 0)continue;t[o](a,l)}}return t}},Zc=class{constructor(e){this.ranges=Yc.fromKeywordOption(e)}addKeyword(e){this.ranges.add(e.codePointAt(0))}clone(){let e=new Zc("");return e.ranges=this.ranges.clone(),e}isKeywordCode(e){return e===32||e>Rce||uv(e)?!1:this.ranges.includes(e)}isKeywordChar(e){let t=e.charCodeAt(0);return this.isKeywordCode(t)}isKeyword(e){for(let t=0,i=e.length;t<i;t++)if(!this.isKeywordChar(e[t]))return!1;return!0}*iterateWords(e){let t=-1,i;for(let r=0,o=e.length;r<o;r++){let s=e.charCodeAt(r);this.isKeywordCode(s)?t==-1?t=r:i!==void 0&&!QP(i,s)&&(yield[t,r],t=r):t!=-1&&(yield[t,r],t=-1),r===o-1&&t!=-1&&(yield[t,r+1]),i=s}}matchLine(e,t=2,i=1024){let r=new Set,o=e.length;o>i&&(e=e.slice(0,i),o=i);for(let[s,a]of this.iterateWords(e)){if(a-s<t)continue;let l=e.slice(s,a);if(_ce.test(l[0]))for(let u of Ece(l))r.add(u);else r.add(l)}return Array.from(r)}async computeWordRanges(e,t,i){let r=t.start.line,o=t.end.line,s={},a=Date.now();for(let l=r;l<=o;l++){let u=e[l];if(u===void 0)break;let c=l===r?t.start.character:0;if(l===r&&(u=u.slice(c)),l===o&&(u=u.slice(0,t.end.character-c)),Date.now()-a>15){if(i&&i.isCancellationRequested)break;await cr(),a=Date.now()}for(let[d,h]of this.iterateWords(u)){let g=u.slice(d,h),f=En(s,g)?s[g]:[];f.push(M.create(l,d+c,l,h+c)),s[g]=f}}return s}}});var vw,uJ=D(()=>{"use strict";ae();vw=class{constructor(e,t,i){this._line=e,this._text=t,this._isLastLine=i}get lineNumber(){return this._line}get text(){return this._text}get range(){return M.create(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLin
|
|||
|
`)+(this.eol?`
|
|||
|
`:"")),this._content}get length(){if(!this._content){let e=this.lines.reduce((t,i)=>t+i.length+1,0);return this.eol?e:e-1}return this._content.length}get end(){let e=this.lineCount-1;return this.eol?V.create(e,0):V.create(e,this.lines[e].length)}get lineCount(){return this.lines.length+(this.eol?1:0)}getText(e){if(e){let{start:t,end:i}=e;return t.line===i.line?t.character===i.character?"":se(this.lines[t.line]).substring(t.character,i.character):this.content.substring(this.offsetAt(e.start),this.offsetAt(e.end))}return this.content}lineAt(e){let t=V.is(e)?e.line:e;if(typeof t!="number"||t<0||t>=this.lineCount||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new vw(t,this.lines[t]??"",t===this.lineCount-1)}positionAt(e){e=Math.max(Math.min(e,this.content.length),0);let t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return{line:0,character:e};for(;i<r;){let s=Math.floor((i+r)/2);t[s]>e?r=s:i=s+1}let o=i-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 i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this.content.length;return Math.max(Math.min(i+e.character,r),i)}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Lce(this.lines,this.eol)),this._lineOffsets}}});function eR(n){_.fire("BufDetach",[n])}function Ul(n){_.fire("LinesChanged",[n])}function Fce(n,e,t,i){return n?R.isAbsolute(n)?A.file(i?n:R.normalize(n)).toString():Ay(n)?A.parse(n).toString():t!=""?`${t}:${e}`:`unknown:${e}`:`untitled:${e}`}function Mce(n,e,t){return["","acwrite"].includes(n)?e===0?"b:coc_enabled = 0":`buffer size ${t} exceed coc.preferences.maxFileSize`:`not a normal buffer, buftype "${n}"`}var hJ,dJ,mp,gJ=D(()=>{"use strict";hJ=require("buffer");ae();Je();Re();Jt();UP();ee();Xe();ce();Be();Pt();$();pe();Pr();VP();cJ();dJ=ge(150,15),mp=class{constructor(e,t,i,r){this.buffer=e;this.env=t;this.nvim=i;this.isIgnored=!1;this.eol=!0;this._disposed=!1;this._attached=!1;this._notAttachReason="";this._previewwindow=!1;this._winid=-1;this.disposables=[];this.lines=[];this._onDocumentChange=new p.Emitter;this.onDocumentChange=this._onDocumentChange.event;this.fireContentChanges=mt(()=>{this._fireContentChanges()},dJ),this.fetchContent=mt(()=>{this._fetchContent()},dJ),this.init(r)}get content(){return this.syncLines.join(`
|
|||
|
`)+(this.eol?`
|
|||
|
`:"")}get attached(){return this._attached}get textDocument(){return this._textDocument}get syncLines(){return this._textDocument.lines}get version(){return this._textDocument.version}get bufnr(){return this.buffer.id}get bufname(){return this._bufname}get filetype(){return this._filetype}get uri(){return this._uri}get isCommandLine(){return this.uri&&this.uri.endsWith("%5BCommand%20Line%5D")}get languageId(){let{_filetype:e}=this;return e.includes(".")?e.match(/(.*?)\./)[1]:e}get changedtick(){return this._changedtick}convertFiletype(e){switch(e){case"javascript.jsx":return"javascriptreact";case"typescript.jsx":case"typescript.tsx":return"typescriptreact";case"tex":return"latex";default:{let t=this.env.filetypeMap;return String(t[e]||e)}}}get schema(){return A.parse(this.uri).scheme}get lineCount(){return this.lines.length}get winid(){return this._winid}get previewwindow(){return this._previewwindow}init(e){let t=this.buftype=e.buftype;this._bufname=e.bufname,this._previewwindow=!!e.previewwindow,this._winid=e.winid,this.variables=$e(e.variables),this._changedtick=e.changedtick,this.eol=e.eol==1,this._uri=Fce(e.fullpath,this.bufnr,t,this.env.isCygwin),Array.isArray(e.lines)?(this.lines=e.lines,this._noFetch=!0,this._attached=!0,this.attach()):this._notAttachReason=Mce(t,this.variables.coc_enabled,e.size),this._filetype=this.convertFiletype(e.filetype),this.setIskeyword(e.iskeyword,e.lisp),this.createTextDocument(1,this.lines)}get notAttachReason(){return this._notAttachReason}attach(){if(ai)return;let e=this.lines;this.buffer.attach(!0).then(t=>{t||eR(this.bufnr)},t=>{eR(this.bufnr)}),this.buffer.listen("lines",(t,i,r,o,s)=>{if(i&&i>this._changedtick){if(this._changedtick=i,e=[...e.slice(0,r),...s,...o==-1?[]:e.slice(o)],e.length==0&&(e=[""]),this.lines=e,Ul(t.id),_.pumvisible)return;this.fireContentChanges()}},this.disposables),this.buffer.listen("detach",()=>{eR(this.bufnr)},this.disposables)}get dirty(){return this.lines!==this.syncLines}get hasChanged(){return this.dirty?!Fe(this.lines,this.syncLines):!1}_fireContentChanges(e){if(this.lines===this.syncLines)return;let t=this._textDocument,i=[];if(!e){let{cursor:s}=_,a;if(s.bufnr==this.bufnr){let l=this.lines[s.lnum-1]??"";a=V.create(s.lnum-1,Mt(l,s.col-1))}e=UZ(t.lines,this.lines,a,s.insert)}let r;e?(r=t.getText(e.range),i.push({range:e.range,text:e.newText,rangeLength:r.length})):r="";let o=this.createTextDocument(this.version+(e?1:0),this.lines);this._onDocumentChange.fire(Object.freeze({bufnr:this.bufnr,original:r,originalLines:t.lines,textDocument:{version:o.version,uri:this.uri},contentChanges:i}))}async applyEdits(e,t=!1,i=!1){if(Array.isArray(arguments[1])&&(e=arguments[1]),!this._attached||e.length===0)return;this._forceSync();let r=this.textDocument;e=oJ(r,e);let o=sJ(r,e);if(!o)return;let s=r.lines,a=ZZ(s,o,QZ(e[0])),l=a.start===a.end&&a.start===s.length,u=s.slice(a.start,a.end),c=[];e.length<200&&a.start!==a.end&&e[e.length-1].range.end.line<s.length&&(c=aJ(s,e));let d,h=_.bufnr==this.bufnr,g;if(i&&h&&!l){let y=V.is(i)?i:void 0;if(!y&&this.bufnr===_.cursor.bufnr){let{col:w,lnum:x}=_.cursor;y=V.create(x-1,Mt(this.lines[x-1],w-1))}if(y){let w=yw(y,e);if(ze(y,w)!==0){let x=se(o[w.line]),C=rt(x,w.character)+1;d=[w.line+1,C]}g=rt(this.lines[y.line],y.character)+1}}this.nvim.pauseNotification(),h&&t&&this.nvim.command("undojoin",!0),l?this.buffer.setLines(a.replacement,{start:-1,end:-1},!0):this.nvim.call("coc#ui#set_lines",[this.bufnr,this._changedtick,u,a.replacement,a.start,a.end,c,d,g],!0),this.nvim.resumeNotification(h,!0);let f=e.length==1?e[0]:lJ(e,s,o);await Bq(),this.lines=o,Ul(this.bufnr),this.fireContentChanges.clear(),this._fireContentChanges(f);let m=M.create(a.start,0,a.start+a.replacement.length,0);return Ye.replace(m,u.join(`
|
|||
|
`)+(u.length>0?`
|
|||
|
`:""))}async changeLines(e){let t=[],i=this.lines.slice();for(let[r,o]of e)i[r]!=o&&(t.push([r,o]),i[r]=o);!t.length||(this.nvim.call("coc#ui#change_lines",[this.bufnr,t],!0),this.nvim.redrawVim(),this.lines=i,Ul(this.bufnr),this._forceSync())}_forceSync(){this.fireContentChanges.clear(),this._fireContentChanges()}forceSync(){}getOffset(e,t){return this.textDocument.offsetAt({line:e-1,character:t})}isWord(e){return this.chars.isKeyword(e)}getStartWord(e){let t=0;for(;t<e.length&&this.chars.isKeywordChar(e[t]);t++);return e.slice(0,t)}getWordRangeAtPosition(e,t,i=!0){let r=this.chars;if(t&&t.length){r=this.chars.clone();for(let u of t)r.addKeyword(u)}let o=this.getline(e.line,i),s=o[e.character];if(s==null||!r.isKeywordChar(s))return null;let a=e.character,l=e.character+1;for(;a>=0;){let u=o[a-1];if(!u||!r.isKeywordChar(u))break;a=a-1}for(;l<=o.length;){let u=o[l];if(!u||!r.isKeywordChar(u))break;l=l+1}return M.create(e.line,a,e.line,l)}createTextDocument(e,t){let{uri:i,languageId:r,eol:o}=this;return this._textDocument=new Jc(i,r,e,t,this.bufnr,o)}getSymbolRanges(e){let{version:t,filetype:i,uri:r}=this,o=new Jc(r,i,t,this.lines,this.bufnr,this.eol),s=[],a=o.getText(),l="";for(let u=0,c=a.length;u<c;u++){let d=a[u];if(d=="-"&&l.length==0)continue;let h=this.chars.isKeywordChar(d);h&&(l=l+d),l.length>0&&!h&&l==e&&s.push(M.create(o.positionAt(u-l.length),o.positionAt(u))),h||(l="")}return s}fixStartcol(e,t){let i=this.getline(e.line);if(!i)return 0;let{character:r}=e,o=i.slice(0,r),s=de(o),{chars:a}=this;for(let l=o.length-1;l>=0;l--){let u=o[l];if(!a.isKeywordChar(u)&&!t.includes(u))break;s=s-de(u)}return s}addHighlights(e,t,i,r={}){let{start:o,end:s}=i;if(!Kt(i))for(let a=o.line;a<=s.line;a++){let l=this.getline(a,!1),u=a==o.line?rt(l,o.character):0,c=a==s.line?rt(l,s.character):hJ.Buffer.byteLength(l);u>=c||e.push(Object.assign({hlGroup:t,lnum:a,colStart:u,colEnd:c},r))}}getline(e,t=!0){return t?this.lines[e]||"":this.syncLines[e]||""}getLines(e,t){return this.lines.slice(e??0,t??this.lines.length)}getDocumentContent(){let e=this.lines.join(`
|
|||
|
`);return this.eol?e+`
|
|||
|
`:e}getVar(e,t){let i=this.variables[`coc_${e}`];return i===void 0?t:i}getPosition(e,t){let i=this.getline(e-1);if(!i||t==0)return{line:e-1,character:0};let r=zt(i,0,t-1);return{line:e-1,character:r.length}}setFiletype(e){this._filetype=this.convertFiletype(e);let t=this._textDocument.lines;this._textDocument=new Jc(this.uri,this.languageId,1,t,this.bufnr,this.eol)}setIskeyword(e,t){let i=this.chars=new Zc(e),r=this.getVar("additional_keywords",[]);if(t&&i.addKeyword("-"),r&&Array.isArray(r))for(let o of r)i.addKeyword(o)}detach(){Y(this.disposables),!this._disposed&&(this._disposed=!0,this._attached=!1,this.lines=[],this.fetchContent.clear(),this.fireContentChanges.clear(),this._onDocumentChange.dispose())}async synchronize(){if(!this.attached)return;let{changedtick:e}=this;await this.patchChange(),e!=this.changedtick&&await Zi(50)}async patchChange(e){if(!!this._attached)if(ai)if(e){let t=await this.nvim.call("coc#util#get_changeinfo",[this.bufnr]);if(!t||t.changedtick<this._changedtick){this._forceSync();return}let{lnum:i,line:r,changedtick:o}=t,s=this.getline(i-1);if(this._changedtick=o,s==r)this._forceSync();else{let a=this.lines.slice();a[i-1]=r,this.lines=a,Ul(this.bufnr),this._forceSync()}}else this.fetchContent.clear(),await this._fetchContent(!0);else this._changedtick=await this.buffer.getVar("changedtick"),this._forceSync()}onTextChange(e,t){if(e==="TextChanged"||e==="TextChangedI"&&!t.insertChar||!this._noFetch){Ul(this.bufnr),this._noFetch=!1,this.fetchContent();return}let{line:i,changedtick:r,lnum:o}=t;if(r===this.changedtick)return;let s=this.lines.slice();s[o-1]=i,this.lines=s,Ul(this.bufnr),this._changedtick=r,e!=="TextChangedP"&&this._forceSync()}async _fetchContent(e){if(!ai||!this._attached)return;let{nvim:t,bufnr:i,changedtick:r}=this,o=await t.call("coc#util#get_buf_lines",[i,r]);this._noFetch=!0,o&&(this._changedtick=o.changedtick,this.lines=o.lines,Ul(this.bufnr)),e?this._forceSync():this.fireContentChanges()}}});var mJ=v((SLe,ww)=>{"use strict";ww.exports=Nce;ww.exports.format=pJ;ww.exports.parse=fJ;var jce=/\B(?=(\d{3})+(?!\d))/g,Oce=/(?:\.0*|(\.[^0]+)0+)$/,Ca={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},Ace=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function Nce(n,e){return typeof n=="string"?fJ(n):typeof n=="number"?pJ(n,e):null}function pJ(n,e){if(!Number.isFinite(n))return null;var t=Math.abs(n),i=e&&e.thousandsSeparator||"",r=e&&e.unitSeparator||"",o=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,s=Boolean(e&&e.fixedDecimals),a=e&&e.unit||"";(!a||!Ca[a.toLowerCase()])&&(t>=Ca.pb?a="PB":t>=Ca.tb?a="TB":t>=Ca.gb?a="GB":t>=Ca.mb?a="MB":t>=Ca.kb?a="KB":a="B");var l=n/Ca[a.toLowerCase()],u=l.toFixed(o);return s||(u=u.replace(Oce,"$1")),i&&(u=u.split(".").map(function(c,d){return d===0?c.replace(jce,i):c}).join(".")),u+r+a}function fJ(n){if(typeof n=="number"&&!isNaN(n))return n;if(typeof n!="string")return null;var e=Ace.exec(n),t,i="b";return e?(t=parseFloat(e[1]),i=e[4].toLowerCase()):(t=parseInt(n,10),i="b"),isNaN(t)?null:Math.floor(Ca[i]*t)}});var xw,Hce,bp,bJ=D(()=>{"use strict";ae();Je();Re();Ce();gJ();ee();at();ce();Il();$();pe();xw=J("core-documents"),Hce=ji(process.cwd()),bp=class{constructor(e,t){this.configurations=e;this.workspaceFolder=t;this._attached=!1;this._currentResolve=!1;this.disposables=[];this.creating=new Map;this.buffers=new Map;this.resolves=[];this._onDidOpenTextDocument=new p.Emitter;this._onDidCloseDocument=new p.Emitter;this._onDidChangeDocument=new p.Emitter;this._onDidSaveDocument=new p.Emitter;this._onWillSaveDocument=new p.Emitter;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidCloseDocument=this._onDidCloseDocument.event;this.onDidChangeDocument=this._onDidChangeDocument.event;this.onDidSaveTextDocument=this._onDidSaveDocument.event;this.onWillSaveTextDocument=this._onWillSaveDocument.event;this._cwd=Hce,this.getConfiguration(),this.configurations.onDidChange(this.getConfiguration,this,this.disposables)}async attach(e,t){if(this._attached)return;this.nvim=e,this._env=t,this._attached=!0;let{bufnrs:i,bufnr
|
|||
|
`)+`
|
|||
|
`}reset(){this.creating.clear();for(let e of this.buffers.keys())this.onBufUnload(e);this.buffers.clear(),this.changeRoot(process.cwd())}changeRoot(e){this._root=ji(e)}dispose(){for(let e of this.buffers.keys())this.onBufUnload(e);this._attached=!1,this.buffers.clear(),Y(this.disposables)}}});function qce(n,e){let{document:t,uri:i}=n;if(t.bufnr!=e.bufnr)return!1;let r=A.parse(i);return r.scheme==="file"?!li(r.fsPath,e.fullpath):!1}var Bce,yp,yJ=D(()=>{"use strict";ae();Je();Re();Ce();at();$();Bce=J("core-editors");yp=class{constructor(e){this.documents=e;this.disposables=[];this.editors=new Map;this.tabIds=new Set;this._onDidTabClose=new p.Emitter;this._onDidChangeActiveTextEditor=new p.Emitter;this._onDidChangeVisibleTextEditors=new p.Emitter;this.onDidTabClose=this._onDidTabClose.event;this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event;this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event}get activeTextEditor(){return this.editors.get(this.winid)}get visibleTextEditors(){return Array.from(this.editors.values())}isVisible(e){for(let t of this.editors.values())if(t.bufnr==e)return!0;return!1}onChangeCurrent(e){let t=e.id;t!==this.previousId&&(this.previousId=t,this._onDidChangeActiveTextEditor.fire(e))}async attach(e){this.nvim=e;let[t,i]=await e.eval("[win_getid(),coc#util#editor_infos()]");this.winid=t,await Promise.allSettled(i.map(r=>this.createTextEditor(r.winid))),_.on("BufUnload",r=>{for(let[o,s]of this.editors.entries())r==s.bufnr&&this.editors.delete(o)},null,this.disposables),_.on("CursorHold",this.checkEditors,this,this.disposables),_.on("TabNew",r=>{this.tabIds.add(r)},null,this.disposables),_.on("TabClosed",this.checkTabs,this,this.disposables),_.on("WinEnter",r=>{this.winid=r;let o=this.editors.get(r);o&&this.onChangeCurrent(o)},null,this.disposables),_.on("WinClosed",r=>{this.editors.has(r)&&(this.editors.delete(r),this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors))},null,this.disposables),_.on("BufWinEnter",async(r,o)=>{this.winid=o,await this.createTextEditor(o)&&this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors)},null,this.disposables)}checkTabs(e){let t=!1;for(let i of this.editors.values())e.includes(i.tabpageid)||(t=!0,this.editors.delete(i.winid));for(let i of Array.from(this.tabIds))e.includes(i)||this._onDidTabClose.fire(i);this.tabIds=new Set(e),t&&this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors)}checkUnloadedBuffers(e){for(let t of this.documents.bufnrs)e.includes(t)||_.fire("BufUnload",[t])}async checkEditors(){let[e,t,i]=await this.nvim.eval("[win_getid(),coc#util#get_loaded_bufs(),coc#util#editor_infos()]");this.winid=e,this.checkUnloadedBuffers(t);let r=!1,o=new Set;for(let s of i){let a=this.editors.get(s.winid),l=!1;a?qce(a,s)?(await _.fire("BufRename",[s.bufnr]),l=!0):(a.document.bufnr!=s.bufnr||a.tabpageid!=s.tabid)&&(l=!0):l=!0,l&&(await this.createTextEditor(s.winid),r=!0),o.add(s.winid)}this.cleanupEditors(o)&&(r=!0),r&&this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors)}cleanupEditors(e){let t=!1;for(let i of Array.from(this.editors.keys()))e.has(i)||(t=!0,this.editors.delete(i));return t}async createTextEditor(e){let{documents:t,nvim:i}=this,r=await i.call("coc#util#get_editoroption",[e]);if(!r)return!1;this.tabIds.add(r.tabpageid);let o=t.getDocument(r.bufnr);if(o&&o.attached){let s=this.fromOptions(r);return this.editors.set(e,s),e==this.winid&&this.onChangeCurrent(s),Bce.debug("editor created winid & bufnr & tabpageid: ",e,r.bufnr,r.tabpageid),!0}else this.editors.delete(r.winid);return!1}fromOptions(e){let{visibleRanges:t,bufnr:i}=e,r=this.documents.getDocument(i);return{id:`${e.tabpageid}-${e.winid}-${r.uri}`,tabpageid:e.tabpageid,winid:e.winid,winnr:e.winnr,uri:r.uri,bufnr:r.bufnr,document:r,visibleRanges:t.map(o=>M.create(o[0]-1,0,o[1],0)),options:{tabSize:e.tabSize,insertSpaces:!!e.insertSpaces}}}}});var Ki,Sa=D(()=>{"use strict";Oc();pe();Ki=class{constructor(){this.lines=[];this._highlights=[]}addLine(e,t){if(e.includes(`
|
|||
|
`)){for(let i of e.split(/\r?\n/))this.addLine(i,t);return}if(t&&this._highlights.push({lnum:this.lines.length,colStart:e.match(/^\s*/)[0].length,colEnd:de(e),hlGroup:t}),e.includes("\x1B")){let i=jc(e);for(let r of i.highlights){let{span:o,hlGroup:s}=r;this._highlights.push({lnum:this.lines.length,colStart:o[0],colEnd:o[1],hlGroup:s})}this.lines.push(i.line)}else this.lines.push(e)}addLines(e){this.lines.push(...e)}addTexts(e){let t=this.lines.length,i="";for(let r of e){let o=de(i);r.hlGroup&&this._highlights.push({lnum:t,colStart:o,colEnd:o+de(r.text),hlGroup:r.hlGroup}),i+=r.text}this.lines.push(i)}addText(e,t){if(!e)return;let{lines:i}=this,r=i[i.length-1]||"";if(e.includes(`
|
|||
|
`)){let o=e.split(`
|
|||
|
`);this.addText(o[0],t);for(let s of o.slice(1))this.addLine(s,t);return}if(t){let o=de(r);this._highlights.push({lnum:i.length?i.length-1:0,colStart:o,colEnd:o+de(e),hlGroup:t})}i.length?i[i.length-1]=`${r}${e}`:i.push(e)}get length(){return this.lines.length}getline(e){return this.lines[e]||""}get highlights(){return this._highlights}get content(){return this.lines.join(`
|
|||
|
`)}render(e,t=0,i=-1){e.setLines(this.lines,{start:t,end:i,strictIndexing:!1},!0);for(let r of this._highlights)e.addHighlight({hlGroup:r.hlGroup,colStart:r.colStart,colEnd:r.colEnd,line:t+r.lnum,srcId:-1})}}});function Yce(n,e){if(typeof n.lnum!="number")return;let t=n.lnum;if(e){let i=XP(e.edits);t=yw(V.create(t-1,0),i).line+1}return t}function Zce(n,e){var i;let t=new Map;for(let r of n){let o=nJ(r)??null,s=o?(i=e[o])==null?void 0:i.label:null,a=t.get(s);a?a.push(r):t.set(s,[r])}return t}var Wce,vp,vJ=D(()=>{"use strict";ae();Je();Re();ee();Se();at();ce();Pr();Sa();Wce=0,vp=class{constructor(e,t){this.nvim=e;this.keymaps=t;this.disposables=[];this.items=[];this.renameMap=new Map;_.on("BufUnload",i=>{i==this.bufnr&&this.dispose()},null,this.disposables)}addFile(e,t,i){this.items.push({index:t.length,filepath:e,lnum:i})}async show(e){let{nvim:t}=this,i=Wce++;t.pauseNotification(),t.command(`tabe +setl\\ buftype=nofile CocWorkspaceEdit${i}`,!0),t.command("setl bufhidden=wipe nolist",!0),t.command("setl nobuflisted wrap undolevels=-1 filetype=cocedits noswapfile",!0),await t.resumeNotification(!0);let r=await t.buffer,o=await t.call("getcwd");this.bufnr=r.id;let s=d=>{let h=A.parse(d).fsPath;return pt(o,h,!0)?R.relative(o,h):h},a=d=>R.isAbsolute(d)?d:R.join(o,d),l=new Ki,u=le(e.edit.documentChanges),c=Zce(u,e.edit.changeAnnotations??{});for(let[d,h]of c.entries()){d&&(l.addLine(d,"MoreMsg"),l.addLine(""));for(let g of h)if(ei.is(g)){let f=e.changes[g.textDocument.uri],m=s(g.textDocument.uri);l.addTexts([{text:"Change",hlGroup:"Title"},{text:" "},{text:m,hlGroup:"Directory"},{text:`:${f.lnum}`,hlGroup:"LineNr"}]),this.addFile(m,l,f.lnum),l.addLine(""),this.addChangedLines(l,f,m,f.lnum),l.addLine("")}else if(Gn.is(g)||Fn.is(g)){let f=Fn.is(g)?"Delete":"Create",m=s(g.uri);l.addTexts([{text:f,hlGroup:"Title"},{text:" "},{text:m,hlGroup:"Directory"}]),this.addFile(m,l),l.addLine("")}else if(zn.is(g)){let f=s(g.oldUri),m=s(g.newUri);l.addTexts([{text:"Rename",hlGroup:"Title"},{text:" "},{text:f,hlGroup:"Directory"},{text:"->",hlGroup:"Comment"},{text:m,hlGroup:"Directory"}]),this.renameMap.set(f,m),this.addFile(m,l),l.addLine("")}}t.pauseNotification(),l.render(r),r.setOption("modifiable",!1,!0),await t.resumeNotification(!0),this.disposables.push(this.keymaps.registerLocalKeymap(r.id,"n","<CR>",async()=>{let d=await t.call("line","."),h=await t.call("col","."),g;for(let C=this.items.length-1;C>=0;C--){let P=this.items[C];if(d>=P.index){g=P;break}}if(!g)return;let f=A.file(a(g.filepath)).toString(),m=this.renameMap.has(g.filepath)?this.renameMap.get(g.filepath):g.filepath;await t.call("coc#util#open_file",["tab drop",a(m)]);let w=le(e.edit.documentChanges).find(C=>ei.is(C)&&C.textDocument.uri==f),x=Yce(g,w);x!==void 0&&await t.call("cursor",[x,h]),t.redrawVim()},!0)),this.disposables.push(this.keymaps.registerLocalKeymap(r.id,"n","<esc>",async()=>{t.command("bwipeout!",!0)},!0))}addChangedLines(e,t,i,r){let o=bi(t.oldLines.join(`
|
|||
|
`),t.newLines.join(`
|
|||
|
`));for(let s=0;s<o.length;s++){let a=o[s];if(a[0]==bi.EQUAL){let l=a[1];if(!l.includes(`
|
|||
|
`))e.addText(l);else{let u=l.split(`
|
|||
|
`);e.addText(u[0]);let c=r+u.length-1;e.addLine(""),e.addTexts([{text:"Change",hlGroup:"Title"},{text:" "},{text:i,hlGroup:"Directory"},{text:`:${c}`,hlGroup:"LineNr"}]),this.addFile(i,e,c),e.addLine("");let d=u[u.length-1];e.addText(d)}r+=l.split(`
|
|||
|
`).length-1}else a[0]==bi.DELETE?(r+=a[1].split(`
|
|||
|
`).length-1,e.addText(a[1],"DiffDelete")):e.addText(a[1],"DiffAdd")}}dispose(){Y(this.disposables)}}});function Uce(n,e,t){let i=R.join(n,e);if(typeof t!="string"){let r=t.baseUri.fsPath;if(!pt(r,i))return!1;let o=R.relative(r,i);return si(o,t.pattern,{dot:!0})}return si(e,t,{dot:!0})}function Cw(n){return A.parse(n).fsPath}var Jce,wp,wJ=D(()=>{"use strict";ae();Je();Re();Ce();vJ();Ti();at();ce();$();pe();Pr();Jce=J("core-files"),wp=class{constructor(e,t,i,r){this.documents=e;this.configurations=t;this.workspaceFolderControl=i;this.keymaps=r;this.operationTimeout=500;this._onDidCreateFiles=new p.Emitter;this._onDidRenameFiles=new p.Emitter;this._onDidDeleteFiles=new p.Emitter;this._onWillCreateFiles=new p.Emitter;this._onWillRenameFiles=new p.Emitter;this._onWillDeleteFiles=new p.Emitter;this.onDidCreateFiles=this._onDidCreateFiles.event;this.onDidRenameFiles=this._onDidRenameFiles.event;this.onDidDeleteFiles=this._onDidDeleteFiles.event;this.onWillCreateFiles=this._onWillCreateFiles.event;this.onWillRenameFiles=this._onWillRenameFiles.event;this.onWillDeleteFiles=this._onWillDeleteFiles.event}attach(e,t,i){this.nvim=e,this.env=t,this.window=i}async openTextDocument(e){e=typeof e=="string"?A.file(e):e;let t=this.documents.getDocument(e.toString());if(t)return t;let i=e.scheme;if(i=="file"){if(!F.existsSync(e.fsPath))throw jy(e.fsPath);F.accessSync(e.fsPath,F.constants.R_OK)}return i=="untitled"?(await this.nvim.call("coc#util#open_file",["tab drop",e.path]),await this.documents.document):await this.loadResource(e.toString(),null)}async jumpTo(e,t,i){i||(i=this.configurations.initialConfiguration.get("coc.preferences.jumpCommand","edit"));let{nvim:r}=this,o=e instanceof A?e:A.parse(e),s=this.documents.getDocument(o.with({fragment:""}).toString()),a=s?s.bufnr:-1;if(!t&&o.scheme==="file"&&o.fragment){let l=o.fragment.split(","),u=parseInt(l[0],10);if(!isNaN(u)){let c=l.length>0&&/^\d+$/.test(l[1])?parseInt(l[1],10):void 0;t=V.create(u-1,c==null?0:c-1)}}if(a!=-1&&i=="edit"){if(r.pauseNotification(),r.command("silent! normal! m'",!0),r.command(`buffer ${a}`,!0),r.command("if &filetype ==# '' | filetype detect | endif",!0),t){let l=s.getline(t.line),u=rt(l,t.character)+1;r.call("cursor",[t.line+1,u],!0)}await r.resumeNotification(!0)}else{let{fsPath:l,scheme:u}=o,c=t==null?null:[t.line,t.character];if(u=="file"){let d=ji(l);await this.nvim.call("coc#util#jump",[i,d,c])}else await this.nvim.call("coc#util#jump",[i,e.toString(),c])}}async openResource(e){let{nvim:t}=this,i=A.parse(e);if(/^https?/.test(i.scheme)){await t.call("coc#ui#open_url",e);return}await this.jumpTo(e),await this.documents.document}async loadResource(e,t){let i=this.documents.getDocument(e);if(i)return i;t===void 0&&(t=this.configurations.getConfiguration("workspace").get("openResourceCommand","tab drop"));let r=A.parse(e),o=r.scheme==="file"?r.fsPath:e,s;if(t){let a=await this.nvim.call("win_getid");s=await this.nvim.call("coc#util#open_file",[t,o]),await this.nvim.call("win_gotoid",[a])}else s=(await this.nvim.call("coc#ui#open_files",[[o]]))[0];return await this.documents.createDocument(s)}async loadResources(e){let{documents:t}=this,i=e.map(o=>{let s=A.parse(o);return s.scheme=="file"?s.fsPath:o}),r=await this.nvim.call("coc#ui#open_files",[i]);return await Promise.all(r.map(o=>t.createDocument(o)))}async createFile(e,t={},i){let{nvim:r}=this,o=F.existsSync(e);if(o&&!t.overwrite&&!t.ignoreIfExists)throw jD(e);if(!o||t.overwrite){let s=new p.CancellationTokenSource;await this.fireWaitUntilEvent(this._onWillCreateFiles,{files:[A.file(e)],token:s.token},i),s.cancel();let a=R.dirname(e);if(!F.existsSync(a)){let c,d=a;for(;![".","/",R.parse(a).root].includes(d);){if(F.existsSync(R.dirname(d))){c=d;break}d=R.dirname(d)}F.mkdirSync(a,{recursive:!0}),i&&i.push(()=>{F.rmSync(c,{force:!0,recursive:!0})})}F.writeFileSync(e,"","utf8"),i&&i.push(()=>{F.rmSync(e,{force:!0,recursive:!0})});let u=(await this.loadResource(e)).bufnr;i&&i.push(()=>(_.fire("BufUnload",[u]),r.command(`silent! bd! ${u}`))),this._onDidCreateFiles.fire({files:[A.file(e)]})}}async deleteFile(e,
|
|||
|
`)?y.slice(0,-1).split(`
|
|||
|
`):y.split(`
|
|||
|
`)},r.push(async()=>{let x=this.documents.getDocument(h);!x||!x.attached||x.version!==m||(await x.applyEdits([f]),c.version=x.version)})}}else Gn.is(u)?await this.createFile(Cw(u.uri),u.options,r):Fn.is(u)?await this.deleteFile(Cw(u.uri),u.options,r):zn.is(u)&&await this.renameFile(Cw(u.oldUri),Cw(u.newUri),u.options,r);if(r.length===0)return!0;t||(this.editState={edit:{documentChanges:i,changeAnnotations:e.changeAnnotations},changes:a,recovers:r,applied:!0}),this.nvim.redrawVim()}catch(s){return Jce.error("Error on applyEdits:",e,s),t||this.window.showErrorMessage(`Error on applyEdits: ${s}`),await this.undoChanges(r),!1}return t||o||this.window.showInformationMessage("Use ':wa' to save changes or ':CocCommand workspace.inspectEdit' to inspect."),!0}async undoChanges(e){for(;e.length>0;){let t=e.pop();await Promise.resolve(t())}}async inspectEdit(){if(!this.editState){this.window.showWarningMessage("No workspace edit to inspect");return}await new vp(this.nvim,this.keymaps).show(this.editState)}async undoWorkspaceEdit(){let{editState:e}=this;if(!e||!e.applied){this.window.showWarningMessage("No workspace edit to undo");return}e.applied=!1,await this.undoChanges(e.recovers)}async redoWorkspaceEdit(){let{editState:e}=this;if(!e||e.applied){this.window.showWarningMessage("No workspace edit to redo");return}this.editState=void 0,await this.applyEdit(e.edit)}validateChanges(e){let{documents:t}=this;for(let i of e)if(ei.is(i)){let{uri:r,version:o}=i.textDocument,s=t.getDocument(r);if(typeof o=="number"&&o>0){if(!s)throw O8(r);if(s.version!=o)throw new Error(`${r} changed before apply edit`)}else if(!s&&!Bg(r))throw Oy(r)}else if(Gn.is(i)||Fn.is(i)){if(!Bg(i.uri))throw Oy(i.uri)}else if(zn.is(i)&&(!Bg(i.oldUri)||!Bg(i.newUri)))throw Oy(i.oldUri)}async findFiles(e,t,i,r){let o=this.workspaceFolderControl.workspaceFolders;if((r==null?void 0:r.isCancellationRequested)||!o.length||i===0)return[];i=i??1/0;let s=o.map(c=>A.parse(c.uri).fsPath),a;typeof e!="string"?(a=e.pattern,s=[e.baseUri.fsPath]):a=e;let l=[],u=!1;for(let c of s){let d=await(0,st.promisify)(ey)(a,{dot:!0,cwd:c,nodir:!0,absolute:!1});if(r!=null&&r.isCancellationRequested)return[];for(let h of d)if(!(t&&Uce(c,h,t))&&(l.push(A.file(R.join(c,h))),l.length===i)){u=!0;break}if(u)break}return l}async fireWaitUntilEvent(e,t,i){let r=!0,o=[];e.fire({...t,waitUntil:s=>{if(!r)throw N8("waitUntil");let a=new Promise(u=>{setTimeout(u,this.operationTimeout)}),l=Promise.race([s,a]).then(u=>{if(u&&Qs.is(u))return this.applyEdit(u,!0)});o.push(l)}}),r=!1,await Promise.all(o)}}});function xp(){return xJ.default.randomBytes(16)}var xJ,tR=D(()=>{xJ=sr(require("crypto"))});function $ce(n,e){var t=e||0,i=CJ;return[i[n[t++]],i[n[t++]],i[n[t++]],i[n[t++]],"-",i[n[t++]],i[n[t++]],"-",i[n[t++]],i[n[t++]],"-",i[n[t++]],i[n[t++]],"-",i[n[t++]],i[n[t++]],i[n[t++]],i[n[t++]],i[n[t++]],i[n[t++]]].join("")}var CJ,Cp,Sw,iR=D(()=>{CJ=[];for(Cp=0;Cp<256;++Cp)CJ[Cp]=(Cp+256).toString(16).substr(1);Sw=$ce});function Xce(n,e,t){var i=e&&t||0,r=e||[];n=n||{};var o=n.node||SJ,s=n.clockseq!==void 0?n.clockseq:nR;if(o==null||s==null){var a=n.random||(n.rng||xp)();o==null&&(o=SJ=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),s==null&&(s=nR=(a[6]<<8|a[7])&16383)}var l=n.msecs!==void 0?n.msecs:new Date().getTime(),u=n.nsecs!==void 0?n.nsecs:oR+1,c=l-rR+(u-oR)/1e4;if(c<0&&n.clockseq===void 0&&(s=s+1&16383),(c<0||l>rR)&&n.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");rR=l,oR=u,nR=s,l+=122192928e5;var d=((l&268435455)*1e4+u)%4294967296;r[i++]=d>>>24&255,r[i++]=d>>>16&255,r[i++]=d>>>8&255,r[i++]=d&255;var h=l/4294967296*1e4&268435455;r[i++]=h>>>8&255,r[i++]=h&255,r[i++]=h>>>24&15|16,r[i++]=h>>>16&255,r[i++]=s>>>8|128,r[i++]=s&255;for(var g=0;g<6;++g)r[i+g]=o[g];return e||Sw(r)}var SJ,nR,rR,oR,$l,DJ=D(()=>{tR();iR();rR=0,oR=0;$l=Xce});function Gce(n,e,t){var i=e&&t||0;typeof n=="string"&&(e=n==="binary"?new Array(16):null,n=null),n=n||{};var r=n.random||(n.rng||xp)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e)for(var o=0;o<16;++o)e[i+o]=r[o];return e||Sw(r)}var me,TJ=D(()=>{tR();i
|
|||
|
`+Error().stack.split(`
|
|||
|
`).slice(2,4).join(`
|
|||
|
`);return yR.warn(`workspace.${o} is deprecated, please use window.${o} instead.`,a),e[o].apply(e,s)}});for(let o of["onDidOpenTerminal","onDidCloseTerminal"])Object.defineProperty(this,o,{get:()=>{let s=`
|
|||
|
`+Error().stack.split(`
|
|||
|
`).slice(2,4).join(`
|
|||
|
`);return yR.warn(`workspace.${o} is deprecated, please use window.${o} instead.`,s),e[o]}});let i=this._env=await t.call("coc#util#vim_info");e.init(i),this.checkVersion(ak),this.configurations.updateMemoryConfig(this._env.config),this.workspaceFolderControl.setWorkspaceFolders(this._env.workspaceFolders),this.workspaceFolderControl.onDidChangeWorkspaceFolders(()=>{t.setVar("WorkspaceFolders",this.folderPaths,!0)}),this.files.attach(t,i,e),this.contentProvider.attach(t),this.registerTextDocumentContentProvider("output",la.getProvider(t)),this.keymaps.attach(t),this.autocmds.attach(t,i),this.watchers.attach(t,i),await this.documentsManager.attach(this.nvim,this._env),await this.editors.attach(t);let r=la.create("watchman",t);this.fileSystemWatchers.attach(r),this.strWdith&&this.strWdith.setAmbw(!i.ambiguousIsNarrow)}checkVersion(e){this._env.apiversion!=e&&this.nvim.echoError(`API version ${this._env.apiversion} is not ${ak}, please build coc.nvim by 'yarn install' after pull source code.`)}getDisplayWidth(e,t=!1){return this.strWdith.getWidth(e,t)}get version(){return Rl}get cwd(){return this.documentsManager.cwd}get env(){return this._env}get root(){return this.documentsManager.root||this.cwd}get rootPath(){return this.root}get bufnr(){return this.documentsManager.bufnr}get insertMode(){return _.insertMode}get floatSupported(){return!0}get uri(){return this.documentsManager.uri}get workspaceFolder(){return this.workspaceFolders[0]}get textDocuments(){return this.documentsManager.textDocuments}get documents(){return this.documentsManager.documents}get document(){return this.documentsManager.document}get workspaceFolders(){return this.workspaceFolderControl.workspaceFolders}checkPatterns(e,t){return this.workspaceFolderControl.checkPatterns(t??this.workspaceFolderControl.workspaceFolders,e)}get folderPaths(){return this.workspaceFolders.map(e=>A.parse(e.uri).fsPath)}get channelNames(){return la.names}get pluginRoot(){return Do}get isVim(){return this._env.isVim}get isNvim(){return!this._env.isVim}get completeOpt(){return""}get filetypes(){return this.documentsManager.filetypes}get languageIds(){return this.documentsManager.languageIds}createNameSpace(e){return Y4(e)}has(e){return Wv(this.env,e)}registerAutocmd(e){if(e.request&&e.event!=="BufWritePre"){let t=Ll(Error().stack);yR.warn(`Extension "${t}" registered synchronized autocmd "${e.event}", which could be slow.`)}return this.autocmds.registerAutocmd(e)}watchOption(e,t,i){return this.watchers.watchOption(e,t,i)}watchGlobal(e,t,i){let r=t??function(){};return this.watchers.watchGlobal(e,r,i)}match(e,t){return wP(e,t.uri,t.languageId)}createFileSystemWatcher(e,t,i,r){return this.fileSystemWatchers.createFileSystemWatcher(e,t,i,r)}createFuzzyMatch(){return new Dv(this.fuzzyExports)}getWatchmanPath(){return Z4(this.configurations)}getConfiguration(e,t){return this.configurations.getConfiguration(e,t)}resolveJSONSchema(e){return this.configurations.getJSONSchema(e)}getDocument(e){return this.documentsManager.getDocument(e)}hasDocument(e,t){let i=this.documentsManager.getDocument(e);return i!=null&&(t!=null?i.version==t:!0)}getUri(e,t=""){let i=this.documentsManager.getDocument(e);return i?i.uri:t}isAttached(e){let t=this.documentsManager.getDocument(e);return t!=null&&t.attached}getAttachedDocument(e){let t=this.getDocument(e);if(!t)throw new Error(`Buffer ${e} not created.`);if(!t.attached)throw new Error(`Buffer ${e} not attached, ${t.notAttachReason}`);return t}getQuickfixItem(e,t,i="",r){return this.documentsManager.getQuickfixItem(e,t,i,r)}createMru(e){return new io(e)}async getQuickfixList(e){return this.documentsManager.getQuickfixList(e)}async showLocations(e){await this.documentsManager.showLocations(e)}getLine(e,t){return this.documentsManager.getLine(e,t)}getWorkspaceFolder(e){return this.workspaceFolderControl.getWorkspaceFolder(typeof e=="string"?A.parse(e):e)}readFile(e){return this.documentsManager.readFile(e)}async getCurrentState(){let e=await this.document,t=await ip(this.nvim);return{document:e.textDocument,position:t}}async getFormatOptions(e){return
|
|||
|
`)==-1&&(c+=" ",d(u,"CocTreeDescription"),c+=u),{line:c,highlights:s}}async appendTreeNode(e,t,i,r,o){let s=await this.getTreeItem(e);if(!s)return 0;let a=1,l=this.getRenderedLine(s,i,t);if(o.push(...l.highlights),r.push({level:t,line:l.line,node:e}),s.collapsibleState==2){let u=t+1,c=await Promise.resolve(this.provider.getChildren(e));for(let d of le(c)){let h=await this.appendTreeNode(d,u,i+a,r,o);a=a+h}}return a}updateUI(e,t,i=0,r=-1,o=!1){if(!this.bufnr)return;let{nvim:s,winid:a}=this,l=s.createBuffer(this.bufnr);if(s.pauseNotification(),l.setOption("modifiable",!0,!0),l.setLines(e,{start:i,end:r,strictIndexing:!1},!0),this.autoWidth&&this.nvim.call("coc#window#adjust_width",[a],!0),t.length){let u=r==-1?-1:i+e.length;s.call("coc#highlight#update_highlights",[this.bufnr,SR,t,i,u],!0)}l.setOption("modifiable",!1,!0),o||this.redraw(),s.resumeNotification(!1,!0)}async reveal(e,t={}){if(this.filtering)return;let i=this.getItemLnum(e)!=null,{select:r,focus:o,expand:s}=t,a=e;if(typeof this.provider.getParent!="function")throw new Error("missing getParent function from provider for reveal.");if(!i)for(;a;){let l=await Promise.resolve(this.provider.getParent(a));if(l){let u=await this.getTreeItem(l);u.collapsibleState=2,a=l}else break}if(s){let l=await this.getTreeItem(e);if(l.collapsibleState!=0&&(l.collapsibleState=2,typeof s=="boolean"&&(s=1),s>1)){let u=Math.min(s,2),c=await Promise.resolve(this.provider.getChildren(e));for(;!te(c);){let d=[];for(let h of c){let g=await this.getTreeItem(h);if(g.collapsibleState!=0&&(g.collapsibleState=2,u>1)){let f=await Promise.resolve(this.provider.getChildren(h));d.push(...f)}}c=d,u=u-1}}}(!i||s)&&await this.render(),r!==!1&&this.selectItem(e),o&&this.focusItem(e)}updateHeadLines(e=!1){let{titleCount:t,messageCount:i}=this.lineState,r=e?-1:t+i,o=[],s=[];if(this.message&&(s.push({hlGroup:"MoreMsg",colStart:0,colEnd:de(this.message),lnum:0}),o.push(this.message),o.push("")),this.title){if(s.push({hlGroup:"CocTreeTitle",colStart:0,colEnd:de(this.title),lnum:o.length}),this.description){let a=de(this.title)+1;s.push({hlGroup:"Comment",colStart:a,colEnd:a+de(this.description),lnum:o.length})}o.push(this.title+(this.description?" "+this.description:""))}this.lineState.messageCount=this.message?2:0,this.lineState.titleCount=this.title?1:0,this.updateUI(o,s,0,r),e||this.refreshSigns()}refreshSigns(){let{selection:e,nvim:t,bufnr:i}=this;if(!e.length||!i)return;let r=t.createBuffer(i);t.pauseNotification(),r.unplaceSign({group:"CocTree"});for(let o of e){let s=this.getItemLnum(o);s!=null&&r.placeSign({id:DR+s,lnum:s+1,name:"CocTreeSelected",group:"CocTree"})}t.resumeNotification(!1,!0)}async render(){if(!this.bufnr)return;let e=await this.mutex.acquire();try{let t=[],i=[],{startLnum:r}=this,o=await Promise.resolve(this.provider.getChildren()),s=0,a=r,l=[];if(te(o))this.message="No results";else{this.message=="No results"&&(this.message="");for(let c of o){let d=await this.appendTreeNode(c,s,a,l,i);a+=d}}t.push(...l.map(c=>c.line)),this.renderedItems=l;let u=this.startLnum-r;i.forEach(c=>c.lnum=c.lnum+u),this.updateUI(t,i,this.startLnum,-1),this._onDidRefrash.fire(),this.retryTimers=0,e()}catch(t){CR.error("Error on render",t),this.renderedItems=[],this.nodesMap.clear(),this.lineState={titleCount:0,messageCount:1},e();let i=`${t}`.replace(/\r?\n/g," ");if(this.updateUI([i],[{hlGroup:"WarningMsg",colStart:0,colEnd:de(i),lnum:0}]),this.retryTimers==vde)return;this.timer=setTimeout(()=>{this.retryTimers=this.retryTimers+1,this.render()},yde)}}async show(e="belowright 30vs",t=!0){let{nvim:i}=this,[r,o]=await i.eval('[bufnr("%"),win_getid()]');this._targetBufnr=r,this._targetWinId=o;let s={command:e,bufname:this.bufname,viewId:this.viewId.replace(/"/g,'\\"'),bufnr:ye(this.bufnr,-1),winid:ye(this.winid,-1),bufhidden:ye(this.opts.bufhidden,"wipe"),canSelectMany:this.opts.canSelectMany===!0,winfixwidth:this.winfixwidth===!0},[a,l,u]=await i.call("coc#ui#create_tree",[s]);if(this.bufnr=a,this.winid=l,this._targetTabId=u,l!=s.winid&&this._onDidChangeVisibility.fire({visible:!0}),a==s.bufnr)return!0;this.
|
|||
|
`)}function o3(n){let{range:e,context:t,line:i}=n,r=["import re, os, vim, string, random",`path = vim.eval('expand("%:p")') or ""`,"fn = os.path.basename(path)"];t?(r.push("snip = ContextSnippet()"),r.push(`context = ${t}`)):r.push("context = True");let o=`(${e.start.line},${Buffer.byteLength(i.slice(0,e.start.character))})`,s=`(${e.start.line},${Buffer.byteLength(i.slice(0,e.end.character))})`,a=i.match(/^\s*/)[0];return r.push(`snip = SnippetUtil("${Hp(a)}", ${o}, ${s}, context)`),r}async function zc(n,e){try{await n.command(`pyx ${wde(e.join(`
|
|||
|
`))}`)}catch(t){let i=new Error(t.message);throw i.stack=`Error on execute python code:
|
|||
|
${e.join(`
|
|||
|
`)}
|
|||
|
`+t.stack,i}}function Bp(n){let e=Object.keys(n);if(e.length==0)return"t = ()";let t=Math.max.apply(null,e.map(r=>Number(r))),i=new Array(t).fill('""');for(let[r,o]of Object.entries(n))i[r]=`"${Hp(o)}"`;return`t = (${i.join(",")},)`}function wde(n,e=!1){if(!ai&&e===!1)return n;let t=["import traceback, vim","vim.vars['errmsg'] = ''","try:"];return t.push(...n.split(`
|
|||
|
`).map(i=>" "+i)),t.push("except Exception as e:"),t.push(" vim.vars['errmsg'] = traceback.format_exc()"),t.join(`
|
|||
|
`)}function Hp(n){return n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\t/g,"\\t").replace(/\n/g,"\\n")}function s3(n){if(n.indexOf("\\z")!==-1)throw new Error("pattern \\z not supported");if(n.indexOf("(?s)")!==-1)throw new Error("pattern (?s) not supported");if(n.indexOf("(?x)")!==-1)throw new Error("pattern (?x) not supported");if(n.indexOf(`
|
|||
|
`)!==-1)throw new Error("pattern \\n not supported");if(Cde.test(n))throw new Error("pattern (?id/name)yes-pattern|no-pattern not supported");return n.replace(kde,(e,t)=>e.startsWith("(?#")?"":e.startsWith("(?P<")?"(?"+e.slice(3):e.startsWith("(?P=")?`\\k<${t}>`:"^")}var n3,xde,Cde,Sde,Dde,Tde,kde,PR=D(()=>{"use strict";n3=require("child_process");Jt();ce();pe();xde=/\\A/,Cde=/\(\?\(\w+\).+\|/,Sde=/\(\?#.*?\)/,Dde=/\(\?P<\w+>.*?\)/,Tde=/\(\?P=(\w+)\)/,kde=new RegExp(`${Sde.source}|${xde.source}|${Dde.source}|${Tde.source}`,"g")});function l3(n,e){let t=[...n];for(;t.length>0;){let i=t.shift();if(!e(i))break;t.unshift(...i.children)}}function Ede(n,e=[]){let t="",i=n.length,r=0,o=!1,s=!1;for(;r<i;){let a=n[r];if(a.charCodeAt(0)===92&&!e.includes(r)){let l=n[r+1];if(_de.includes(l)){r++;continue}if(l=="u"||l=="l"){let u=n[r+2];u&&(t=t+(l=="u"?u.toUpperCase():u.toLowerCase())),r=r+3;continue}if(l=="U"||l=="L"){l=="U"?o=!0:s=!0,r=r+2;continue}if(l=="E"){o=!1,s=!1,r=r+2;continue}if(l=="n"){t+=`
|
|||
|
`,r=r+2;continue}if(l=="t"){t+=" ",r=r+2;continue}}o?a=a.toUpperCase():s&&(a=a.toLowerCase()),t+=a,r++}return t}var Pde,a3,Rde,ao,Iw,Lo,At,Io,Lw,Rt,Kc,qp,Qc,Qn,lo,Vc,ws,_de,Fw=D(()=>{"use strict";Ce();ee();Se();Rg();ce();pe();PR();Pde=J("snippets-parser"),a3=["VISUAL","YANK","UUID"],Rde=["d","g","i","m","s","u","y"],ao=class{static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}constructor(){this.text("")}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e=this.pos,t=0,i=this.value.charCodeAt(e),r;if(r=ao._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(ao.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(ao.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(ao.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(ao.isVariableCharacter(i)||ao.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof ao._table[i]>"u"&&!ao.isDigitCharacter(i)&&!ao.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}},Iw=ao;Iw._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13,[40]:15,[41]:16,[96]:17,[33]:18};Lo=class{constructor(){this._children=[]}appendChild(e){return e instanceof At&&this._children[this._children.length-1]instanceof At?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}setOnlyChild(e){e.parent=this,this._children=[e]}replaceChildren(e){for(let t of e)t.parent=this;this._children=e}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Vc)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}},At=class extends Lo{constructor(t){super();this.value=t}static escape(t){return t.replace(/\$|}|\\/g,"\\$&")}toString(){return this.value}toTextmateString(){return At.escape(this.value)}len(){return this.value.length}clone(){return new At(this.value)}},Io=class extends Lo{constructor(t,i,r){super();this.code=t;this.kind=i;this._value="";this._related=[];if(i==="python"){let{_related:o}=this,s,a=/\bt\[(\d+)\]/g;for(;s=a.exec(t),s!=null;){let l=parseInt(s[1],10);o.includes(l)||o.push(l)}}typeof r=="string"&&(this._value=r)}get related(){return this._related}update(t){if(this.kind!=="python")return;let i=new Set;this.code=this.code.replace(/\bt\[(\d+)\]/g,(r,o)=>{let s=Number(o),a=t.has(s)?t.get(s):s;return i.add(a),`t[${a}]`}),this._related=Array.from(i)}get index(){if(this.parent instanceof Rt)return this.parent.index}async resolve(t){if(!this.code.length)return;let i=await r3(t,this.kind,this.code,ye(this._value,""));i!=null&&(this._value=i)}len(){return this._value.length}toString(){return this._value}get value(){return this._value}toTextmateString(){let t="";return this.kind=="python"?t="!p ":this.kind=="shell"?t="":this.kind=="vim"&&(t="!v "),"`"+t+this.code+"`"}clone(){return new Io(this.code,this.kind,this.value)}},Lw=class extends Lo{},Rt=class extends Lw{constructor(t){super();this.index=t;this.primary=!1}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Kc?this._children[0]:void 0}toTextmateString(){let t="";return this.transform&&(t=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0||this.children.length==1&&this.children[0].toTextmateString()==""?`\${${this.index}${t}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${t}}`:`\${${this.index}:${this.children.map(i=>i.toTextmateString()).join("")}${t}}`}clone(){let t=new Rt(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(i=>i.clone()),t}},Kc=class extends Lo{constructor(){super(...arguments);this.options=[]}appendChild(t){return t instanceof At&&(t.parent=this,this.options.p
|
|||
|
`)){let r="";this.snippet.walk(u=>{if(u==this)return!1;if(u instanceof At){let c=u.toString().split(/\r?\n/);r=c[c.length-1].match(/^\s*/)[0]}return!0});let o=i.split(`
|
|||
|
`),a=o.filter(u=>u.length>0).map(u=>u.match(/^\s*/)[0]).reduce((u,c)=>u<c.length?u:c.length,0);i=o.map((u,c)=>c==0||u.length==0||!u.startsWith(" ".repeat(a))?u:r+u.slice(a)).join(`
|
|||
|
`)}return this.transform&&(i=this.transform.resolve(se(i))),i!=null?(this._children=[new At(i.toString())],!0):!1}toTextmateString(){let t="";return this.transform&&(t=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${t}}`:`\${${this.name}:${this.children.map(i=>i.toTextmateString()).join("")}${t}}`}clone(){let t=new lo(this.name,this.resolved);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(i=>i.clone()),t}};Vc=class extends Lo{constructor(t){super();this.ultisnip=t===!0}get hasPython(){return this.ultisnip?this.pyBlocks.length>0:!1}get hasCodeBlock(){if(!this.ultisnip)return!1;let{pyBlocks:t,otherBlocks:i}=this;return t.length>0||i.length>0}get values(){if(this._values)return this._values;let t={},i=0;this.placeholders.forEach(r=>{i=Math.max(r.index,i),r.transform==null&&(r.primary||t[r.index]===void 0)&&(t[r.index]=r.toString())});for(let r=0;r<=i;r++)t[r]===void 0&&(t[r]="");return this._values=t,t}get orderedPyIndexBlocks(){let t=[],i=this.pyBlocks.filter(a=>typeof a.index=="number");if(i.length===0)return t;let r=i.map(a=>a.index),o=[],s=a=>{let{related:l}=a;return l.length==0||l.every(u=>!r.includes(u)||o.includes(u))?(o.push(a.index),t.push(a),!0):!1};for(;i.length>0;){let a=!1;for(let l of i)s(l)&&(a=!0);if(!a)break;i=i.filter(l=>!o.includes(l.index))}return t}async evalCodeBlocks(t,i){let{pyBlocks:r,otherBlocks:o}=this;if(await Promise.all(o.map(s=>{let a=s.value;return s.resolve(t).then(()=>{s.parent instanceof Rt&&a!==s.value&&this.onPlaceholderUpdate(s.parent)})})),r.length){let s=Bp(this.values);await zc(t,[...i,s]);for(let l of r){let u=l.value;await l.resolve(t),u!==l.value&&l.parent instanceof Rt&&(this.onPlaceholderUpdate(l.parent),await zc(t,[Bp(this.values)]))}for(let l of this.orderedPyIndexBlocks)await this.updatePyIndexBlock(t,l);let a=r.filter(l=>l.index===void 0&&l.related.length>0);for(let l of a)await l.resolve(t)}}async updatePythonCodes(t,i){let r;if(i instanceof Rt)r=i.index;else{for(;i.parent;){if(i instanceof Rt){r=i.index;break}i=i.parent}if(r===void 0)return}let o=this.getDependentPyIndexBlocks(r);await zc(t,[Bp(this.values)]);for(let a of o)await this.updatePyIndexBlock(t,a);let s=this.pyBlocks.filter(a=>a.index===void 0&&a.related.length>0);for(let a of s)await a.resolve(t)}getDependentPyIndexBlocks(t){let i=[],r=[],o=this.pyBlocks.filter(a=>typeof a.index=="number"),s=a=>{let l=o.filter(u=>!r.includes(u.index)&&u.related.includes(a));l.length>0&&(i.push(...l),l.forEach(u=>{s(u.index)}))};return s(t),i}async updatePyIndexBlock(t,i){let r=i.value;await i.resolve(t),r!==i.value&&(i.parent instanceof Rt&&this.onPlaceholderUpdate(i.parent),await zc(t,[Bp(this.values)]))}get placeholderInfo(){if(!this._placeholders){let t=[],i=[],r=[],o=[];this.walk(s=>{if(s instanceof Rt)o.push(s);else if(s instanceof lo){let a=s.name.charCodeAt(0);(a<65||a>90)&&t.push(s)}else s instanceof Io&&(s.kind==="python"?i.push(s):r.push(s));return!0}),this._placeholders={placeholders:o,pyBlocks:i,otherBlocks:r,variables:t}}return this._placeholders}get variables(){return this.placeholderInfo.variables}get placeholders(){return this.placeholderInfo.placeholders}get pyBlocks(){return this.placeholderInfo.pyBlocks}get otherBlocks(){return this.placeholderInfo.otherBlocks}get maxIndexNumber(){let{placeholders:t}=this;return t.reduce((i,r)=>Math.max(i,r.index),0)}get first(){let{placeholders:t,variables:i}=this,[r,o]=dY(t.filter(s=>!s.transform),s=>s.index!==0);if(r.length){let s=Math.min.apply(null,r.map(l=>l.index)),a=r.filter(l=>l.index==s);return a.find(l=>l.primary)??a[0]}return i.length?i[0]:o.find(s=>s.primary)??o[0]}insertSnippet(t,i,r,o){let s=i instanceof Rt?i.index:this.maxIndexNumber+1,[a,l]=r,u=o?Ew(o):void 0,c=new ws(!!o,u).parse(t,!0),d=c.maxIndexNumber+1,h=new Map;for(let y of c.placeholders){let w=y.index;y.isFinalTabstop?y.index=d+s:y.index=y.index+s,h.set(w,y.index)}o&&c.pyBlocks.forEach(y=>{y.update(h)});let g=new Map;this.walk(y=>{if(y instanceof Rt&&y.index>s){let w=y.index;y.index=y.index+d,g.set(w,y.index)}return!0}),this.has
|
|||
|
`:"";if(r.indexOf(`
|
|||
|
`)==-1){let s=new Io(o+r.trim(),"python");e.appendChild(s)}else{let s=r.split(/\r?\n/);if(s=s.filter(u=>!/^\s*$/.test(u)),!s.length)return!0;let a=s[0].match(/^\s*/)[0];a.length&&s.every(u=>u.startsWith(a))&&(s=s.map(u=>u.slice(a.length))),a==" "&&s[0].startsWith(a)&&(s[0]=s[0].slice(1));let l=new Io(o+s.join(`
|
|||
|
`),"python");e.appendChild(l)}return!0}}return this._backTo(t),!1}_parseAnything(e){if(this._token.type!==14){let t=this._scanner.tokenText(this._token);return e.appendChild(new At(t)),this._accept(void 0),!0}return!1}},_de=[":","(",")","{","}"]});var Lde,Wp,Yp,RR=D(()=>{"use strict";Wp=class{constructor(){this[Lde]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)==null?void 0:e.value}get last(){var e;return(e=this._tail)==null?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){let i=this._map.get(e);if(!!i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let r=this._map.get(e);if(r)r.value=t,i!==0&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let 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;let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let e=this,t=this._state,i=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}values(){let e=this,t=this._state,i=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}entries(){let e=this,t=this._state,i=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}[(Lde=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){!this._head&&!this._tail?this._tail=e:(e.next=this._head,this._head.previous=e),this._head=e,this._state++}addItemLast(e){!this._head&&!this._tail?this._head=e:(e.previous=this._tail,this._tail.next=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)e.next.previous=void 0,this._head=e.next;else if(e===this._tail)e.previous.next=void 0,this._tail=e.previous;else{let t=e.next,i=e.previous;t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!(t!==1&&t!==2))if(t===1){if(e===this._head)return;let i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else{if(e===this._tail)return;let i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}},Yp=class extends Wp{constructor(t,i=1){super();this._limit=t,this._ratio=Math.min(Math.max(0,i),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,i=2){return super.get(t,i)}peek(t){return super.get(t,0)}set
|
|||
|
`)[0],a=Jp(e.severity).slice(0,1).toUpperCase();return{bufnr:n,lnum:i.line+1,end_lnum:r.line+1,col:Array.isArray(t)?rt(t[i.line]??"",i.character)+1:i.character+1,end_col:Array.isArray(t)?rt(t[r.line]??"",r.character)+1:r.character+1,text:`[${o}${e.code?" "+e.code:""}] ${s} [${a}]`,type:a}}function Nw(n,e){let t=n.severity??1,i=e.severity??1;if(t!=i)return t-i;let r=ze(n.range.start,e.range.start);return r!=0?r:n.source>e.source?1:-1}function P3(n){let e=n.tags||[];if(e.includes(Ji.Deprecated))return"CocDeprecatedHighlight";if(e.includes(Ji.Unnecessary))return"CocUnusedHighlight";switch(n.severity){case nt.Warning:return"CocWarningHighlight";case nt.Information:return"CocInfoHighlight";case nt.Hint:return"CocHintHighlight";default:return"CocErrorHighlight"}}function R3(n,e){let t=[],{range:i}=e;for(let r of n){let o=r.range;if(!Wc(i,o)){if(ze(o.start,i.end)>0){let s=bw(o.start,e),a=bw(o.end,e);s.line>=0&&s.character>=0&&a.line>=0&&a.character>=0&&(r.range=M.create(s,a))}t.push(r)}}return t}var FR=D(()=>{"use strict";ae();Pt();pe();Pr()});var _3,E3,I3,Wde,L3,Up,ed,Hw,F3=D(()=>{"use strict";ae();Re();ee();Se();Pt();$();We();he();FR();_3="CocDiagnostic",E3="diagnostic",I3=["CocErrorHighlight","CocWarningHighlight","CocInfoHighlight","CocHintHighlight","CocDeprecatedHighlight","CocUnusedHighlight"],Wde=ge(50,10),L3=ge("ale#other_source#ShowResults","MockAleResults"),Hw=class{constructor(e,t){this.nvim=e;this.doc=t;this.diagnosticsMap=new Map;this._disposed=!1;this._dirties=new Set;this._refreshing=!1;this._onDidRefresh=new p.Emitter;this.onDidRefresh=this._onDidRefresh.event;this.loadConfiguration();let i,r=()=>{clearTimeout(i),this._refreshing=!0,i=setTimeout(()=>{this._refreshing=!1,this._autoRefresh&&this._refresh(!0)},Wde)};r.clear=()=>{this._refreshing=!1,clearTimeout(i)},this.refreshHighlights=r}get _autoRefresh(){return this.config.enable&&this.config.autoRefresh&&this.dirty&&!this.doc.hasChanged}get config(){return this._config}loadConfiguration(){let e=b.getConfiguration("diagnostic",this.doc),t=this._config&&e.enable!=this._config.enable;this._config={enable:e.get("enable",!0),floatConfig:e.get("floatConfig",{}),messageTarget:e.get("messageTarget","float"),enableHighlightLineNumber:e.get("enableHighlightLineNumber",!0),highlightLimit:e.get("highlightLimit",1e3),highlightPriority:e.get("highlightPriority"),autoRefresh:e.get("autoRefresh",!0),checkCurrentLine:e.get("checkCurrentLine",!1),enableSign:b.env.sign&&e.get("enableSign",!0),locationlistUpdate:e.get("locationlistUpdate",!0),enableMessage:e.get("enableMessage","always"),virtualText:e.get("virtualText",!1),virtualTextAlign:e.get("virtualTextAlign","after"),virtualTextWinCol:e.get("virtualTextWinCol",null),virtualTextCurrentLineOnly:e.get("virtualTextCurrentLineOnly"),virtualTextPrefix:e.get("virtualTextPrefix"," "),virtualTextFormat:e.get("virtualTextFormat","%message"),virtualTextLimitInOneLine:e.get("virtualTextLimitInOneLine",999),virtualTextLineSeparator:e.get("virtualTextLineSeparator"," \\ "),virtualTextLines:e.get("virtualTextLines",3),displayByAle:e.get("displayByAle",!1),level:xs(e.get("level","hint")),locationlistLevel:xs(e.get("locationlistLevel")),signLevel:xs(e.get("signLevel")),virtualTextLevel:xs(e.get("virtualTextLevel")),messageLevel:xs(e.get("messageLevel")),signPriority:e.get("signPriority",10),refreshOnInsertMode:e.get("refreshOnInsertMode",!1),filetypeMap:e.get("filetypeMap",{}),showUnused:e.get("showUnused",!0),showDeprecated:e.get("showDeprecated",!0),format:e.get("format","[%source%code] [%severity] %message")},this._config.virtualText&&!Up&&this.nvim.createNamespace("coc-diagnostic-virtualText").then(i=>{Up=i}),t&&(this.config.enable?this._refresh(!1):this.clear())}async setState(e){this._config.enable!=e&&(this._config.enable=e,e?await this._refresh(!1):this.clear())}get dirty(){return this._dirties.size>0}get bufnr(){return this.doc.bufnr}get uri(){return this.doc.uri}onChange(e){let t=e.contentChanges;if(t.length>0){let i=Ye.replace(t[0].range,t[0].text);for(let[r,o]of this.diagnosticsMap.entries()){let s=R3(o,i);this.diagnosticsMap.
|
|||
|
`).join(`
|
|||
|
`+o),n.push(r+"m+"+Yw.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=bhe()+e+" "+n[0]}function bhe(){return Qi.inspectOpts.hideDate?"":new Date().toISOString()+" "}function yhe(...n){return process.stderr.write(Ww.format(...n)+`
|
|||
|
`)}function vhe(n){n?process.env.DEBUG=n:delete process.env.DEBUG}function whe(){return process.env.DEBUG}function xhe(n){n.inspectOpts={};let e=Object.keys(Qi.inspectOpts);for(let t=0;t<e.length;t++)n.inspectOpts[e[t]]=Qi.inspectOpts[e[t]]}Yw.exports=NR()(Qi);var{formatters:TU}=Yw.exports;TU.o=function(n){return this.inspectOpts.colors=this.useColors,Ww.inspect(n,this.inspectOpts).split(`
|
|||
|
`).map(e=>e.trim()).join(" ")};TU.O=function(n){return this.inspectOpts.colors=this.useColors,Ww.inspect(n,this.inspectOpts)}});var od=v((IBe,qR)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?qR.exports=vU():qR.exports=kU()});var RU=v((LBe,PU)=>{var Sf;PU.exports=function(){if(!Sf){try{Sf=od()("follow-redirects")}catch{}typeof Sf!="function"&&(Sf=function(){})}Sf.apply(null,arguments)}});var OU=v((FBe,UR)=>{var Kl=require("url"),WR=Kl.URL,Che=require("http"),She=require("https"),IU=require("stream").Writable,LU=require("assert"),FU=RU(),ZR=["abort","aborted","connect","error","socket","timeout"],JR=Object.create(null);ZR.forEach(function(n){JR[n]=function(e,t,i){this._redirectable.emit(n,e,t,i)}});var Dhe=Tf("ERR_INVALID_URL","Invalid URL",TypeError),_U=Tf("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),The=Tf("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),khe=Tf("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Phe=Tf("ERR_STREAM_WRITE_AFTER_END","write after end");function er(n,e){IU.call(this),this._sanitizeOptions(n),this._options=n,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(i){t._processResponse(i)},this._performRequest()}er.prototype=Object.create(IU.prototype);er.prototype.abort=function(){jU(this._currentRequest),this.emit("abort")};er.prototype.write=function(n,e,t){if(this._ending)throw new Phe;if(!Ql(n)&&!Ehe(n))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Df(e)&&(t=e,e=null),n.length===0){t&&t();return}this._requestBodyLength+n.length<=this._options.maxBodyLength?(this._requestBodyLength+=n.length,this._requestBodyBuffers.push({data:n,encoding:e}),this._currentRequest.write(n,e,t)):(this.emit("error",new khe),this.abort())};er.prototype.end=function(n,e,t){if(Df(n)?(t=n,n=e=null):Df(e)&&(t=e,e=null),!n)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var i=this,r=this._currentRequest;this.write(n,e,function(){i._ended=!0,r.end(null,null,t)}),this._ending=!0}};er.prototype.setHeader=function(n,e){this._options.headers[n]=e,this._currentRequest.setHeader(n,e)};er.prototype.removeHeader=function(n){delete this._options.headers[n],this._currentRequest.removeHeader(n)};er.prototype.setTimeout=function(n,e){var t=this;function i(s){s.setTimeout(n),s.removeListener("timeout",s.destroy),s.addListener("timeout",s.destroy)}function r(s){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),o()},n),i(s)}function o(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",o),t.removeListener("error",o),t.removeListener("response",o),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",r)}return e&&this.on("timeout",e),this.socket?r(this.socket):this._currentRequest.once("socket",r),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(n){er.prototype[n]=function(e,t){return this._currentRequest[n](e,t)}});["aborted","connection","socket"].forEach(function(n){Object.defineProperty(er.prototype,n,{get:function(){return this._currentRequest[n]}})});er.prototype._sanitizeOptions=function(n){if(n.headers||(n.headers={}),n.host&&(n.hostname||(n.hostname=n.host),delete n.host),!n.pathname&&n.path){var e=n.path.indexOf("?");e<0?n.pathname=n.path:(n.pathname=n.path.substring(0,e),n.search=n.path.substring(e))}};er.prototype._performRequest=function(){var n=this._options.protocol,e=this._options.nativeProtocols[n];if(!e){this.emit("error",new TypeError("Unsupported protocol "+n));return}if(this._options.agents){var t=n.slice(0,-1);this._options.agent=this._options.agents[t]}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);i._redirectable=this;for(var r of ZR)i.on(r,JR[r]);if(this._currentUrl=/^\//.test(this._
|
|||
|
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Zw(n,e){return new Zw.Agent(n,e)}(function(n){class e extends Fhe.EventEmitter{constructor(i,r){super();let o=r;typeof i=="function"?this.callback=i:i&&(o=i),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:GR()?443:80}set defaultPort(i){this.explicitDefaultPort=i}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:GR()?"https:":"http:"}set protocol(i){this.explicitProtocol=i}callback(i,r,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(i,r){let o=Object.assign({},r);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=GR()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,i._last=!0,i.shouldKeepAlive=!1;let s=!1,a=null,l=o.timeout||this.timeout,u=g=>{i._hadError||(i.emit("error",g),i._hadError=!0)},c=()=>{a=null,s=!0;let g=new Error(`A "socket" was not created for HTTP request before ${l}ms`);g.code="ETIMEOUT",u(g)},d=g=>{s||(a!==null&&(clearTimeout(a),a=null),u(g))},h=g=>{if(s)return;if(a!=null&&(clearTimeout(a),a=null),Ohe(g)){kf("Callback returned another Agent instance %o",g.constructor.name),g.addRequest(i,o);return}if(g){g.once("free",()=>{this.freeSocket(g,o)}),i.onSocket(g);return}let f=new Error(`no Duplex stream was returned to agent-base for \`${i.method} ${i.path}\``);u(f)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(kf("Converting legacy callback function to promise"),this.promisifiedCallback=jhe.default(this.callback)):this.promisifiedCallback=this.callback),typeof l=="number"&&l>0&&(a=setTimeout(c,l)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{kf("Resolving socket for %o request: %o",o.protocol,`${i.method} ${i.path}`),Promise.resolve(this.promisifiedCallback(i,o)).then(h,d)}catch(g){Promise.reject(g).catch(d)}}freeSocket(i,r){kf("Freeing socket %o %o",i.constructor.name,r),i.destroy()}destroy(){kf("Destroying agent %o",this.constructor.name)}}n.Agent=e,n.prototype=n.Agent.prototype})(Zw||(Zw={}));BU.exports=Zw});var qU=v(Vl=>{"use strict";var Ahe=Vl&&Vl.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},Pf=Vl&&Vl.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Vl,"__esModule",{value:!0});var Nhe=Pf(require("net")),Hhe=Pf(require("tls")),QR=Pf(require("url")),Bhe=Pf(od()),qhe=Pf(AU()),Whe=KR(),Pa=(0,Bhe.default)("http-proxy-agent");function Yhe(n){return typeof n=="string"?/^https:?$/i.test(n):!1}var VR=class extends Whe.Agent{constructor(e){let t;if(typeof e=="string"?t=QR.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Pa("Creating new HttpProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||Yhe(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(e,t){return Ahe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:r}=this,o=QR.default.parse(e.path);o.protocol||(o.protocol="http:"),o.hostname||(o.hostname=t.hostname||t.host||null),o.port==null&&typeof t.port&&(o.port=String(t.port)
|
|||
|
\r
|
|||
|
`)+4,e.output[0]=e._header+a.substring(l),Pa("Output buffer: %o",e.output)):e.outputData&&e.outputData.length>0&&(Pa("Patching connection write() output buffer with updated header"),a=e.outputData[0].data,l=a.indexOf(`\r
|
|||
|
\r
|
|||
|
`)+4,e.outputData[0].data=e._header+a.substring(l),Pa("Output buffer: %o",e.outputData[0].data))}return yield(0,qhe.default)(s,"connect"),s})}};Vl.default=VR});var YU=v((i_,WU)=>{"use strict";var Zhe=i_&&i_.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},e_=Zhe(qU());function t_(n){return new e_.default(n)}(function(n){n.HttpProxyAgent=e_.default,n.prototype=e_.default.prototype})(t_||(t_={}));WU.exports=t_});var ZU=v(_f=>{"use strict";var Jhe=_f&&_f.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(_f,"__esModule",{value:!0});var Uhe=Jhe(od()),Rf=Uhe.default("https-proxy-agent:parse-proxy-response");function $he(n){return new Promise((e,t)=>{let i=0,r=[];function o(){let d=n.read();d?c(d):n.once("readable",o)}function s(){n.removeListener("end",l),n.removeListener("error",u),n.removeListener("close",a),n.removeListener("readable",o)}function a(d){Rf("onclose had error %o",d)}function l(){Rf("onend")}function u(d){s(),Rf("onerror %o",d),t(d)}function c(d){r.push(d),i+=d.length;let h=Buffer.concat(r,i);if(h.indexOf(`\r
|
|||
|
\r
|
|||
|
`)===-1){Rf("have not received end of HTTP headers yet..."),o();return}let f=h.toString("ascii",0,h.indexOf(`\r
|
|||
|
`)),m=+f.split(" ")[1];Rf("got proxy server response: %o",f),e({statusCode:m,buffered:h})}n.on("error",u),n.on("close",a),n.on("end",l),o()})}_f.default=$he});var $U=v(eu=>{"use strict";var Xhe=eu&&eu.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},sd=eu&&eu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(eu,"__esModule",{value:!0});var JU=sd(require("net")),UU=sd(require("tls")),Ghe=sd(require("url")),zhe=sd(require("assert")),Khe=sd(od()),Qhe=KR(),Vhe=sd(ZU()),Ef=Khe.default("https-proxy-agent:agent"),n_=class extends Qhe.Agent{constructor(e){let t;if(typeof e=="string"?t=Ghe.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Ef("creating new HttpsProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||ige(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in i)&&(i.ALPNProtocols=["http 1.1"]),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(e,t){return Xhe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:r}=this,o;r?(Ef("Creating `tls.Socket`: %o",i),o=UU.default.connect(i)):(Ef("Creating `net.Socket`: %o",i),o=JU.default.connect(i));let s=Object.assign({},i.headers),l=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r
|
|||
|
`;i.auth&&(s["Proxy-Authorization"]=`Basic ${Buffer.from(i.auth).toString("base64")}`);let{host:u,port:c,secureEndpoint:d}=t;tge(c,d)||(u+=`:${c}`),s.Host=u,s.Connection="close";for(let y of Object.keys(s))l+=`${y}: ${s[y]}\r
|
|||
|
`;let h=Vhe.default(o);o.write(`${l}\r
|
|||
|
`);let{statusCode:g,buffered:f}=yield h;if(g===200){if(e.once("socket",ege),t.secureEndpoint){Ef("Upgrading socket connection to TLS");let y=t.servername||t.host;return UU.default.connect(Object.assign(Object.assign({},nge(t,"host","hostname","path","port")),{socket:o,servername:y}))}return o}o.destroy();let m=new JU.default.Socket({writable:!1});return m.readable=!0,e.once("socket",y=>{Ef("replaying proxy buffer for failed request"),zhe.default(y.listenerCount("data")>0),y.push(f),y.push(null)}),m})}};eu.default=n_;function ege(n){n.resume()}function tge(n,e){return Boolean(!e&&n===80||e&&n===443)}function ige(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function nge(n,...e){let t={},i;for(i in n)e.includes(i)||(t[i]=n[i]);return t}});var GU=v((s_,XU)=>{"use strict";var rge=s_&&s_.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},r_=rge($U());function o_(n){return new r_.default(n)}(function(n){n.HttpsProxyAgent=r_.default,n.prototype=r_.default.prototype})(o_||(o_={}));XU.exports=o_});function l_(n){return n.protocol==="https:"?Uw.https:Uw.http}function oge(n){return typeof n=="string"||Buffer.isBuffer(n)?n:JSON.stringify(n)}function u_(n){if(n instanceof Jw.URL)return n;let e=new Jw.URL(n);if(!["https:","http:"].includes(e.protocol))throw new Error(`Not valid protocol with ${n}, should be http: or https:`);return e}function c_(n,e){return n&&(n=typeof n=="number"?n:parseInt(n,10),!isNaN(n))?n:e.startsWith("https")?443:80}function sge(n){return n===null?"null":n===void 0?"undefined":typeof n=="string"?"string":Buffer.isBuffer(n)?"buffer":Array.isArray(n)||St(n)?"object":"unknown"}function age(n,e=process.env){let t=e.NO_PROXY??e.no_proxy;if(t==="*")return null;if(t){let r=n.hostname.replace(/^\.*/,".").toLowerCase(),o=c_(n.port,n.protocol).toString(),s=t.split(",");for(let a=0,l=s.length;a<l;a++){let u=s[a].trim().toLowerCase();if(u.includes(":")){let c=u.split(":",2),d=c[0].replace(/^\.*/,"."),h=c[1];if(o==h&&r.endsWith(d))return null}else if(u=u.replace(/^\.*/,"."),r.endsWith(u))return null}}let i;return n.protocol==="http:"?i=e.HTTP_PROXY||e.http_proxy||null:i=e.HTTPS_PROXY||e.https_proxy||e.HTTP_PROXY||e.http_proxy||null,i}function lge(n,e){let t=e.proxy||age(n);if(t){let i;try{if(i=new Jw.URL(t),!/^https?:$/.test(i.protocol))return null}catch{return null}let r={host:i.hostname,port:c_(i.port,i.protocol),auth:i.username?`${i.username}:${se(i.password)}`:void 0,rejectUnauthorized:typeof e.proxyStrictSSL=="boolean"?e.proxyStrictSSL:!0};return e5.info(`Using proxy ${t} from ${e.proxy?"configuration":"system environment"} for ${n.hostname}:`),n.protocol==="http:"?(0,KU.default)(r):(0,QU.default)(r)}return null}function d_(n,e){let t=b.getConfiguration("http",null),i=sge(e.data),r={proxy:t.get("proxy",""),proxyStrictSSL:t.get("proxyStrictSSL",!0),proxyAuthorization:t.get("proxyAuthorization",null),proxyCA:t.get("proxyCA",null)};e.query&&!n.search&&(n.search=`?${(0,VU.stringify)(e.query)}`);let o=lge(n,r),s={method:e.method??"GET",hostname:n.hostname,port:c_(n.port,n.protocol),path:n.pathname+n.search,agent:o,rejectUnauthorized:r.proxyStrictSSL,maxRedirects:3,headers:{"User-Agent":"Mozilla/5.0 (X11; Linux x86_64)","Accept-Encoding":"gzip, deflate",...e.headers??{}}};return i=="object"?s.headers["Content-Type"]="application/json":i=="string"&&(s.headers["Content-Type"]="text/plain"),r.proxyAuthorization&&(s.headers["Proxy-Authorization"]=r.proxyAuthorization),r.proxyCA&&(s.ca=F.readFileSync(r.proxyCA)),e.user&&(s.auth=e.user+":"+se(e.password)),n.username&&(s.auth=n.username+":"+se(n.password)),e.timeout&&(s.timeout=e.timeout),e.buffer&&(s.buffer=!0),s}function uge(n,e,t,i){let r=l_(n);return new Promise((o,s)=>{if(i){let u=i.onCancellationRequested(()=>{u.dispose(),l.destroy(new Ct)})}let a,l=r.request(t,u=>{let c=u;if(u.statusCode>=200&&u.statusCode<300||u.statusCode===1223){let d=u.headers,h=[],g=se(d["content-type"]);c=(0,zU.default)(u),c.on("data",f=>{h.push(f)}),c.on("end",()=>{clearTimeout(a);let f=Buffer.concat(h);if(!t.buffer&&(g.startsWith("application/json")||g.startsWith("text/"))){le
|
|||
|
`,r=Buffer.byteLength(i),o=Math.floor(Math.log(r)/Math.log(10))+1;return r+o>=Math.pow(10,o)&&(o+=1),o+r+i}};Hf.parse=(n,e,t)=>new Hf(upe(cpe(n),e),t);var upe=(n,e)=>e?Object.keys(n).reduce((t,i)=>(t[i]=n[i],t),e):n,cpe=n=>n.replace(/\n$/,"").split(`
|
|||
|
`).reduce(dpe,Object.create(null)),dpe=(n,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return n;e=e.slice((t+" ").length);let i=e.split("="),r=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!r)return n;let o=i.join("=");return n[r]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(r)?new Date(o*1e3):/^[0-9]+$/.test(o)?+o:o,n};Y5.exports=Hf});var fd=v((dqe,Z5)=>{Z5.exports=n=>{let e=n.length-1,t=-1;for(;e>-1&&n.charAt(e)==="/";)t=e,e--;return t===-1?n:n.slice(0,t)}});var hx=v((hqe,J5)=>{"use strict";J5.exports=n=>class extends n{warn(e,t,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),this.emit("warn",i.tarCode,t,i)):t instanceof Error?this.emit("error",Object.assign(t,i)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),i))}}});var z_=v((pqe,U5)=>{"use strict";var gx=["|","<",">","?",":"],G_=gx.map(n=>String.fromCharCode(61440+n.charCodeAt(0))),hpe=new Map(gx.map((n,e)=>[n,G_[e]])),gpe=new Map(G_.map((n,e)=>[n,gx[e]]));U5.exports={encode:n=>gx.reduce((e,t)=>e.split(t).join(hpe.get(t)),n),decode:n=>G_.reduce((e,t)=>e.split(t).join(gpe.get(t)),n)}});var K_=v((fqe,X5)=>{var{isAbsolute:ppe,parse:$5}=require("path").win32;X5.exports=n=>{let e="",t=$5(n);for(;ppe(n)||t.root;){let i=n.charAt(0)==="/"&&n.slice(0,4)!=="//?/"?"/":t.root;n=n.slice(i.length),e+=i,t=$5(n)}return[e,n]}});var z5=v((mqe,G5)=>{"use strict";G5.exports=(n,e,t)=>(n&=4095,t&&(n=(n|384)&-19),e&&(n&256&&(n|=64),n&32&&(n|=8),n&4&&(n|=1)),n)});var aE=v((vqe,c$)=>{"use strict";var n$=ex(),r$=dx(),o$=pd(),Oo=require("fs"),K5=require("path"),jo=hd(),fpe=fd(),s$=(n,e)=>e?(n=jo(n).replace(/^\.(\/|$)/,""),fpe(e)+"/"+n):jo(n),mpe=16*1024*1024,Q5=Symbol("process"),V5=Symbol("file"),e$=Symbol("directory"),V_=Symbol("symlink"),t$=Symbol("hardlink"),Bf=Symbol("header"),px=Symbol("read"),eE=Symbol("lstat"),fx=Symbol("onlstat"),tE=Symbol("onread"),iE=Symbol("onreadlink"),nE=Symbol("openfile"),rE=Symbol("onopenfile"),Fa=Symbol("close"),mx=Symbol("mode"),oE=Symbol("awaitDrain"),Q_=Symbol("ondrain"),Ao=Symbol("prefix"),i$=Symbol("hadError"),a$=hx(),bpe=z_(),l$=K_(),u$=z5(),bx=a$(class extends n${constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=jo(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||mpe,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=jo(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?jo(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths){let[r,o]=l$(this.path);r&&(this.path=o,i=r)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=bpe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=jo(t.absolute||K5.resolve(this.cwd,e)),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[fx](this.statCache.get(this.absolute)):this[eE]()}emit(e,...t){return e==="error"&&(this[i$]=!0),super.emit(e,...t)}[eE](){Oo.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[fx](t)})}[fx](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=vpe(e),this.emit("stat",e),this[Q5]()}[Q5](){switch(this.type){case"File":return this[V5]();case"Directory":return this[e$]();case"SymbolicLink":return this[V_]();default:return this.end()}}[mx](e){return u$(e,this.type==="Directory",this.portable)}[Ao](e){return s$(e,this.prefix)}[Bf](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new o$({path:this[Ao](this.path),linkpath:
|
|||
|
`)&&(e=n.label=e.replace(/\r?\n.*/gm,"")),e.includes(Xme)){let{line:i,highlights:r}=jc(e);n.label=i,Array.isArray(n.ansiHighlights)||(n.ansiHighlights=r)}return n.converted=!0,n}function Gme(n,e,t,i){return t?bY(e,n):i?n.toLowerCase().indexOf(e.toLowerCase()):n.indexOf(e)}function zme(n){let e=[],t=0,i=0,r="";for(;i<n.length;i++){let o=n[i];QG.includes(o.charCodeAt(0))&&r&&r!="\\"&&t!=i&&(e.push(n.slice(t,i)),t=i+1),r=o}return t!=n.length&&e.push(n.slice(t,n.length)),e.map(o=>o.replace(/\\\s/g," ").trim()).filter(o=>o.length>0)}var $me,Xme,QG,Ja,cm,VG=D(()=>{"use strict";Ce();ee();Oc();Se();zG();UP();nC();fs();$();pe();he();Za();$me=J("list-worker"),Xme="\x1B",QG=[32,9],Ja="CocListSearch",cm=class{constructor(e,t,i){this.list=e;this.prompt=t;this.listOptions=i;this._loading=!1;this._finished=!1;this.mutex=new Oi;this.totalItems=[];this._onDidChangeItems=new p.Emitter;this._onDidChangeLoading=new p.Emitter;this.onDidChangeItems=this._onDidChangeItems.event;this.onDidChangeLoading=this._onDidChangeLoading.event;this.fuzzyMatch=b.createFuzzyMatch()}set loading(e){this._loading!=e&&(this._loading=e,this._onDidChangeLoading.fire(e))}get isLoading(){return this._loading}async loadItems(e,t=!1){this.cancelFilter(),this.filteredCount=0,this._finished=!1;let{list:i,listOptions:r}=this;this.loading=!0;let{interactive:o}=r;this.tokenSource=new p.CancellationTokenSource;let s=this.tokenSource.token,a=await i.loadItems(e,s);if(!s.isCancellationRequested)if(a=a??[],Array.isArray(a)){this.tokenSource=null,this.totalItems=a,this.loading=!1,this._finished=!0;let l;o?(l=this.convertToHighlightItems(a),this._onDidChangeItems.fire({sorted:!0,items:l,reload:t,finished:!0})):(this.filterTokenSource=new p.CancellationTokenSource,await this.mutex.use(async()=>{await this.filterItems(a,{reload:t},s)}))}else{let l=a,u=this.totalItems=[],c=0,d=e.input;this.filterTokenSource=new p.CancellationTokenSource;let h=async w=>{await this.mutex.use(async()=>{if(this.input!=d&&(d=this.input,c=ye(this.filteredCount,0)),c>=u.length)return;let C=c>0,P=u.slice(c);if(c=u.length,o){let T=this.convertToHighlightItems(P);this._onDidChangeItems.fire({items:T,append:C,reload:t,sorted:!0,finished:w})}else{let T=this.filterTokenSource;await this.filterItems(P,{append:C,reload:t},T.token)}})},g=setInterval(async()=>{await h()},50);l.on("data",w=>{u.push(w)});let f=async()=>{if(l!=null&&(clearInterval(g),this.tokenSource=null,l=null,this.loading=!1,this._finished=!0,m.dispose(),!s.isCancellationRequested)){if(u.length==0){this._onDidChangeItems.fire({items:[],append:!1,sorted:!0,reload:t,finished:!0});return}await h(!0)}},m=s.onCancellationRequested(()=>{this.mutex.reset(),l==null||l.dispose(),f()}),y=l;l.on("error",async w=>{l!=null&&(l=null,y.dispose(),this.tokenSource=null,this.loading=!1,m.dispose(),clearInterval(g),b.nvim.call("coc#prompt#stop_prompt",["list"],!0),b.nvim.echoError(`Task error: ${w.toString()}`),$me.error("List task error:",w))}),l.on("end",f)}}async drawItems(){let{totalItems:e}=this;if(e.length===0)return;this.cancelFilter();let t=this.filterTokenSource=new p.CancellationTokenSource,i=t.token;await this.mutex.use(async()=>{if(i.isCancellationRequested)return;let{totalItems:r}=this;this.filteredCount=r.length,await this.filterItems(r,{},t.token)})}cancelFilter(){this.filterTokenSource&&(this.filterTokenSource.cancel(),this.filterTokenSource=null)}stop(){this.cancelFilter(),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null),this.loading=!1}get length(){return this.totalItems.length}get input(){return this.prompt.input}convertToHighlightItems(e){let t=se(this.input);t.length>0&&this.fuzzyMatch.setPattern(t);let i=e.map(r=>{if(um(r),t.length>0&&r.filterText!==""){let s=sC(r),a=this.fuzzyMatch.matchHighlights(s,Ja);r.ansiHighlights=Array.isArray(r.ansiHighlights)?r.ansiHighlights.filter(l=>l.hlGroup!==Ja):[],a&&r.ansiHighlights.push(...a.highlights)}return r});return this.fuzzyMatch.free(),i}async filterItemsByInclude(e,t,i,r){let{ignorecase:o}=this.listOptions,s=ut.smartcase,a=KG(e,ut.extendedSearchMode);o&&(a=a.map(l=>l.toLowerCase()
|
|||
|
`)]),await Zi(10),this.prompt.start()),c&&await this.doAction(r[c-1])}async doAction(e){let{list:t}=this,i;if(e!=null){if(i=t.actions.find(o=>o.name==e),!i){k.showErrorMessage(`Action ${e} not found`);return}}else i=this.defaultAction;let r;if(e=="preview"){let o=await this.ui.item;r=o?[o]:[]}else r=await this.ui.getItems();r.length&&await this.doItemAction(r,i)}async doPreview(e){let t=this.ui.getItem(e),i=this.list.actions.find(r=>r.name=="preview");!t||!i||await this.doItemAction([t],i)}async first(){await this.doDefaultAction(0)}async last(){await this.doDefaultAction(this.ui.length-1)}async previous(){await this.doDefaultAction(this.ui.index-1)}async next(){await this.doDefaultAction(this.ui.index+1)}async doDefaultAction(e){let{ui:t}=this,i=t.getItem(e);!i||(await this.ui.setIndex(e),await this.doItemAction([i],this.defaultAction),await t.echoMessage(i))}get name(){return this.list.name}get winid(){return this.ui.winid}get length(){return this.ui.length}get defaultAction(){let{defaultAction:e,actions:t,name:i}=this.list,r=b.getConfiguration(`list.source.${i}`),o;if(r.defaultAction&&(o=t.find(s=>s.name==r.defaultAction)),o||(o=t.find(s=>s.name==e)),o||(o=t[0]),!o)throw new Error(`default action "${e}" not found`);return o}async hide(e=!1,t=b.isVim){if(this.hidden)return;let{nvim:i,timer:r,targetWinid:o,context:s}=this,{winid:a}=this.ui;if(r&&clearTimeout(r),this.worker.stop(),this.history.add(),this.ui.reset(),l1.save(),this.hidden=!0,i.pauseNotification(),i.call("coc#prompt#stop_prompt",["list"],!0),a&&i.call("coc#list#close",[a,s.options.position,o,this.savedHeight],!0),e)return i.resumeNotification(!0,!0);await i.resumeNotification(!1),t&&(await Zi(10),i.call("coc#prompt#stop_prompt",["list"],!0),i.redrawVim())}toggleMode(){let e=this.prompt.mode=="normal"?"insert":"normal";this.prompt.mode=e,this.listOptions.mode=e,this.updateStatus()}stop(){this.worker.stop()}async resolveItem(){let e=this.ui.index,t=this.ui.getItem(e);if(!t||t.resolved)return;let{list:i}=this;if(typeof i.resolveItem=="function"){let r=t.label,o=await Promise.resolve(i.resolveItem(t));if(o&&e==this.ui.index){if(Object.assign(t,o,{resolved:!0}),r==o.label)return;this.ui.updateItem(t,e)}}}async showHelp(){await this.hide();let{list:e,nvim:t}=this;t.pauseNotification(),t.command("tabe +setl\\ previewwindow [LIST HELP]",!0),t.command("setl nobuflisted noswapfile buftype=nofile bufhidden=wipe",!0),await t.resumeNotification();let i=e.options&&e.options.length,r=await t.buffer,o=new Ki;if(o.addLine("NAME","Label"),o.addLine(` ${e.name} - ${e.description||""}
|
|||
|
`),o.addLine("SYNOPSIS","Label"),o.addLine(` :CocList [LIST OPTIONS] ${e.name}${i?" [ARGUMENTS]":""}
|
|||
|
`),e.detail){o.addLine("DESCRIPTION","Label");let a=e.detail.split(`
|
|||
|
`).map(l=>" "+l);o.addLine(a.join(`
|
|||
|
`)+`
|
|||
|
`)}if(i){o.addLine("ARGUMENTS","Label"),o.addLine("");for(let a of e.options)o.addLine(a.name,"Special"),o.addLine(` ${a.description}`),o.addLine("");o.addLine("")}let s=b.getConfiguration(`list.source.${e.name}`);if(Object.keys(s).length){o.addLine("CONFIGURATIONS","Label"),o.addLine("");for(let a of Object.keys(s)){let l=s[a],u=`list.source.${e.name}.${a}`,c=ye(b.configurations.getDescription(u),a);o.addLine(` "${u}"`,"MoreMsg"),o.addText(` - ${c} current value: `),o.addText(JSON.stringify(l),"Special")}o.addLine("")}o.addLine("ACTIONS","Label"),o.addLine(` ${e.actions.map(a=>a.name).join(", ")}`),o.addLine(""),o.addLine("see ':h coc-list-options' for available list options.","Comment"),t.pauseNotification(),o.render(r,0,-1),t.command("setl nomod",!0),t.command("setl nomodifiable",!0),t.command("normal! gg",!0),t.command("nnoremap <buffer> q :bd!<CR>",!0),await t.resumeNotification()}async switchMatcher(){let{matcher:e,interactive:t}=this.listOptions;if(t)return;let i=["fuzzy","strict","regex"],r=i.indexOf(e)+1;r>=i.length&&(r=0),this.listOptions.matcher=i[r],this.prompt.matcher=i[r],await this.worker.drawItems()}updateStatus(){let{ui:e,list:t,nvim:i}=this;if(!e.bufnr)return;let r=i.createBuffer(e.bufnr),o={mode:this.prompt.mode.toUpperCase(),args:this.args.join(" "),name:t.name,cwd:this.cwd,loading:this.loadingFrame,total:this.worker.length};r.setVar("list_status",o,!0),i.command("redraws",!0)}get context(){let{winid:e}=this.ui;return{options:this.listOptions,args:this.listArgs,input:this.prompt.input,cwd:b.cwd,window:this.window,buffer:this.buffer,listWindow:e?this.nvim.createWindow(e):void 0}}get window(){return this.targetWinid?this.nvim.createWindow(this.targetWinid):void 0}get buffer(){return this.targetBufnr?this.nvim.createBuffer(this.targetBufnr):void 0}onMouseEvent(e){switch(e){case"<LeftMouse>":return this.ui.onMouse("mouseDown");case"<LeftDrag>":return this.ui.onMouse("mouseDrag");case"<LeftRelease>":return this.ui.onMouse("mouseUp");case"<2-LeftMouse>":return this.ui.onMouse("doubleClick")}}async doNumberSelect(e){if(!this.listOptions.numberSelect)return!1;let t=e.charCodeAt(0);if(t>=48&&t<=57){let i=Number(e);if(i==0&&(i=10),this.ui.length>=i)return this.nvim.pauseNotification(),this.ui.setCursor(i),await this.nvim.resumeNotification(),await this.doAction(),!0}return!1}jumpBack(){let{targetWinid:e,nvim:t}=this;e&&(t.pauseNotification(),t.call("coc#prompt#stop_prompt",["list"],!0),this.nvim.call("win_gotoid",[e],!0),t.resumeNotification(!1,!0))}async resume(){this.winid&&await this.hide();let e=await this.nvim.eval('[win_getid(),bufnr("%"),winheight("%")]');this.hidden=!1,this.targetWinid=e[0],this.targetBufnr=e[1],this.savedHeight=e[2],this.prompt.start(),await this.ui.resume(),this.listOptions.autoPreview&&await this.doAction("preview")}async doItemAction(e,t){let{noQuit:i,position:r}=this.listOptions,{nvim:o}=this,s=t.persist===!0||t.name=="preview";r==="tab"&&t.tabPersist&&(s=!0);let a=this.winid&&(s||i);if(a?s||(o.pauseNotification(),o.call("coc#prompt#stop_prompt",["list"],!0),o.call("win_gotoid",[this.context.window.id],!0),await o.resumeNotification()):await this.hide(),t.multiple)await Promise.resolve(t.execute(e,this.context));else if(t.parallel)await Promise.all(e.map(l=>Promise.resolve(t.execute(l,this.context))));else for(let l of e)await Promise.resolve(t.execute(l,this.context));a&&this.ui.restoreWindow(),t.reload&&a?await this.reloadItems():a&&this.nvim.command("redraw",!0)}onInputChange(){this.timer&&clearTimeout(this.timer),this.ui.cancel(),this.history.filter(),this.listOptions.input=this.prompt.input,this.listOptions.interactive?(this.worker.stop(),this.timer=setTimeout(async()=>{await this.worker.loadItems(this.context)},ut.debounceTime)):this.worker.drawItems()}dispose(){this.hide(!0),Y(this.disposables),this.worker.dispose(),this.ui.dispose()}}});function hm(n,e){return n.length>e?n.slice(0,e-1)+".":n+" ".repeat(e-n.length)}function aC(n,e){if(!n.startsWith("file:"))return n;let t=A.parse(n).fsPath;return pt(e,t)?R.relative(e,t):t}function Mr(n,e){if(e.length===0)return[];let t=[
|
|||
|
Code: ${t.code} ${t.data?`
|
|||
|
`+t.data.toString():""}`}return n instanceof Error?Ue(n.stack)?n.stack:n.message:Ue(n)?n:(0,st.inspect)(n,!1,null,e)}function tz(n){if(typeof n!="string")return Dm(n);let e=["Params: ","Result: "];for(let t of e)if(n.startsWith(t))try{let i=JSON.parse(n.slice(t.length));return t+Dm(i,!0)}catch{return n}return n}var iz=D(()=>{"use strict";Ce();Xe();ce();$()});var iS,nS,tS,nz=D(()=>{"use strict";iS=(t=>(t[t.DoNotRestart=1]="DoNotRestart",t[t.Restart=2]="Restart",t))(iS||{}),nS=(t=>(t[t.Continue=1]="Continue",t[t.Shutdown=2]="Shutdown",t))(nS||{}),tS=class{constructor(e,t){this.name=e;this.maxRestartCount=t;this.milliseconds=3*60*1e3;this.restarts=[]}error(e,t,i){return i&&i<=3?1:2}closed(){return this.restarts.push(Date.now()),this.restarts.length<this.maxRestartCount?2:this.restarts[this.restarts.length-1]-this.restarts[0]<=this.milliseconds?(console.error(`The "${this.name}" server crashed ${this.maxRestartCount} times in the last 3 minutes. The server will not be restarted.`),1):(this.restarts.shift(),2)}}});var rS,oS,Tm,rz=D(()=>{"use strict";Ce();rS=J("language-client"),oS=class{error(e){rS.error(e)}warn(e){rS.warn(e)}info(e){rS.info(e)}log(e){rS.log(e)}},Tm=class{error(e){}warn(e){}info(e){}log(e){}}});function C1(n,e){if(n!==void 0)return n[e]}function oz(n,e){return n.filter(t=>!e.includes(t))}var sS,sz=D(()=>{"use strict";Je();at();$();he();ci();sS=class{constructor(e){this._client=e;this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return p.DidChangeWorkspaceFoldersNotification.type}getValidWorkspaceFolders(){let{workspaceFolders:e}=b;if(!e||e.length==0)return;let t=this._client.clientOptions.ignoredRootPaths??[],i=e.filter(r=>{let o=A.parse(r.uri).fsPath;return t.every(s=>!li(s,o))});return i.length?i:void 0}fillInitializeParams(e){let t=this.getValidWorkspaceFolders();this.initializeWithFolders(t),t===void 0?(this._client.warn("No valid workspaceFolder exists"),e.workspaceFolders=null):e.workspaceFolders=t.map(i=>this.asProtocol(i))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let t=this._client;t.onRequest(p.WorkspaceFoldersRequest.type,o=>{let s=()=>{let l=this.getValidWorkspaceFolders();return l===void 0?null:l.map(c=>this.asProtocol(c))},a=t.middleware.workspace;return a!=null&&a.workspaceFolders?a.workspaceFolders(o,s):s(o)});let i=C1(C1(C1(e,"workspace"),"workspaceFolders"),"changeNotifications"),r;typeof i=="string"?r=i:i&&(r=He()),r&&this.register({id:r,registerOptions:void 0})}doSendEvent(e,t){let i={event:{added:e.map(r=>this.asProtocol(r)),removed:t.map(r=>this.asProtocol(r))}};return this._client.sendNotification(p.DidChangeWorkspaceFoldersNotification.type,i)}sendInitialEvent(e){let t;if(this._initialFolders&&e){let i=oz(this._initialFolders,e),r=oz(e,this._initialFolders);(r.length>0||i.length>0)&&(t=this.doSendEvent(r,i))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t&&t.catch(i=>{this._client.error(`Sending notification ${p.DidChangeWorkspaceFoldersNotification.type.method} failed`,i)})}register(e){let t=e.id,i=this._client;if(this._listeners.size>0)return;let r=b.onDidChangeWorkspaceFolders(s=>{let a=c=>this.doSendEvent(c.added,c.removed),l=i.middleware.workspace,u=l!=null&&l.didChangeWorkspaceFolders?l.didChangeWorkspaceFolders(s,a):a(s);u&&u.catch(c=>{this._client.error(`Sending notification ${p.DidChangeWorkspaceFoldersNotification.type.method} failed`,c)})});this._listeners.set(t,r);let o=this.getValidWorkspaceFolders();this.sendInitialEvent(o)}unregister(e){}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e==null?null:{uri:e.uri,name:e.name}}}});var S1,aS,az=D(()=>{"use strict";Te();$();w1();ct();ci();S1=class extends go{constructor(t,i){super(t);this._registrationType=i;this._registrations=new Map}getState(){let t=this._registrations.size>0;return{kind:"workspace",id:this._reg
|
|||
|
`+Error().stack.split(`
|
|||
|
`).slice(2,4).join(`
|
|||
|
`);if(D1.warn(`${c} in the client options is deprecated. use disabledFeatures instead.`,d),e[c]===!0){let h=c.slice(7);a.push(h[0].toLowerCase()+h.slice(1))}}let l=e.separateDiagnostics;return e.separateDiagnostics===void 0&&(l=b.getConfiguration("diagnostic",e.workspaceFolder).get("separateRelatedInformationAsDiagnostics")),{disabledFeatures:a,disableMarkdown:r,disableSnippetCompletion:i,separateDiagnostics:l,diagnosticPullOptions:s,rootPatterns:e.rootPatterns??[],requireRootPattern:e.requireRootPattern,disableDynamicRegister:e.disableDynamicRegister,formatterPriority:e.formatterPriority??0,ignoredRootPaths:e.ignoredRootPaths??[],documentSelector:e.documentSelector??[],synchronize:e.synchronize??{},diagnosticCollectionName:e.diagnosticCollectionName,outputChannelName:e.outputChannelName??this._id,revealOutputChannelOn:e.revealOutputChannelOn??4,stdioEncoding:e.stdioEncoding??"utf8",initializationOptions:e.initializationOptions,initializationFailedHandler:e.initializationFailedHandler,progressOnInitialization:e.progressOnInitialization===!0,errorHandler:e.errorHandler??this.createDefaultErrorHandler((u=e.connectionOptions)==null?void 0:u.maxRestartCount),middleware:e.middleware??{},workspaceFolder:e.workspaceFolder,connectionOptions:e.connectionOptions,markdown:t}}get supportedMarkupKind(){return this.clientOptions.disableMarkdown?[yr.PlainText]:[yr.Markdown,yr.PlainText]}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}get id(){return this._id}get name(){return this._name}get middleware(){return this._clientOptions.middleware}getPublicState(){return this.$state===3?2:this.$state===1?3:1}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){this.checkState();try{return await(await this.$start()).sendRequest(e,...t)}catch(i){throw this.error(`Sending request ${Os(e)} failed.`,i),i}}onRequest(e,t){let i=Os(e);this._requestHandlers.set(i,t);let r=this.activeConnection(),o;return r!==void 0?(this._requestDisposables.set(i,r.onRequest(e,t)),o={dispose:()=>{let s=this._requestDisposables.get(i);s!==void 0&&(s.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),o={dispose:()=>{this._pendingRequestHandlers.delete(i);let s=this._requestDisposables.get(i);s!==void 0&&(s.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),o.dispose()}}}async sendNotification(e,t){if(!(this.$state===2||this.$state===4||this.$state===5))try{return await(await this.$start()).sendNotification(e,t)}catch(i){throw this.error(`Sending notification ${Os(e)} failed.`,i),i}}onNotification(e,t){let i=Os(e);this._notificationHandlers.set(i,t);let r=this.activeConnection(),o;return r!==void 0?(this._notificationDisposables.set(i,r.onNotification(e,t)),o={dispose:()=>{let s=this._notificationDisposables.get(i);s!==void 0&&(s.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),o={dispose:()=>{this._pendingNotificationHandlers.delete(i);let s=this._notificationDisposables.get(i);s!==void 0&&(s.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),o.dispose()}}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});let r=this.activeConnection(),o,s=this._clientOptions.middleware.handleWorkDoneProgress,a=p.WorkDoneProgress.is(e)&&s!==void 0?l=>{s(t,l,()=>i(l))}:i;return r!==void 0?(this._progressDisposables.set(t,r.onProgress(e,t,a)),o={dispose:()=>{let l=this._progressDisposables.get(t);l!==void 0&&(l.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),o={dispose:()=>{this._pendingProgressHandlers.delete(t);let l=this._progressDisposables.get(t);l!==void 0&&(l.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),o.dispose()}}}async sendProgress(e,t,i){this.checkState();try{await(await this.$
|
|||
|
|
|||
|
Related diagnostics:
|
|||
|
`;for(let l of s.relatedInformation){let u=R.basename(A.parse(l.location.uri).fsPath),c=l.location.range.start.line;a=`${a}
|
|||
|
${u}(line ${c+1}): ${l.message}`;let d=o.get(l.location.uri)||[];d.push(Ur.create(l.location.range,l.message,nt.Hint,s.code,s.source)),o.set(l.location.uri,d)}s.message=a}this._diagnostics.set(Array.from(o))}}else this._diagnostics.set(e,t)}handleApplyWorkspaceEdit(e){let t=e.edit,i=new Map;b.textDocuments.forEach(o=>i.set(o.uri.toString(),o));let r=!1;if(t.documentChanges){for(let o of t.documentChanges)if(ei.is(o)&&o.textDocument.version&&o.textDocument.version>=0){let s=i.get(o.textDocument.uri);if(s&&s.version!==o.textDocument.version){r=!0;break}}}return r?Promise.resolve({applied:!1}):b.applyEdit(e.edit).then(o=>({applied:o}))}handleFailedRequest(e,t,i,r){if(t&&t.isCancellationRequested)return r;if(i instanceof p.ResponseError){if(i.code===p.ErrorCodes.PendingResponseRejected||i.code===p.ErrorCodes.ConnectionInactive)return r;if(i.code===p.LSPErrorCodes.RequestCancelled||i.code===p.LSPErrorCodes.ServerCancelled)throw i.data!=null?new yu(i.data):new Ct;if(i.code===p.LSPErrorCodes.ContentModified){if(lS.RequestsToCancelOnContentModified.has(e.method))throw new Ct;return r}}throw this.error(`Request ${e.method} failed.`,i),i}logFailedRequest(e,t){t instanceof p.ResponseError&&t.code===p.LSPErrorCodes.RequestCancelled||this.error(`Request ${e.method} failed.`,t)}},km=lS;km.RequestsToCancelOnContentModified=new Set([p.InlayHintRequest.method,p.SemanticTokensRequest.method,p.SemanticTokensRangeRequest.method,p.SemanticTokensDeltaRequest.method]);ybe={createAll:n=>[]}});function xbe(n,e){if(R.isAbsolute(n))return n;let t=Cbe();if(t!==void 0){let i=R.join(t,n);if(F.existsSync(i))return i}if(e!==void 0){let i=R.join(e,n);if(F.existsSync(i))return i}return n}function Cbe(){let n=b.workspaceFolders;return!n||n.length===0?void 0:n[0].uri}function Sbe(n){let e=n&&n.cwd;return e&&!R.isAbsolute(e)&&(e=R.join(b.cwd,e)),e||(e=b.cwd),new Promise(t=>{F.lstat(e,(i,r)=>{t(!i&&r.isDirectory()?e:void 0)})})}function Dbe(n){return n?n.some(e=>vbe.some(t=>e.startsWith(t))||wbe.some(t=>e===t)):!1}var dS,vbe,wbe,cz,P1,pS,hS,R1,_1,E1,Nd,gS,I1=D(()=>{"use strict";Ce();ee();Xe();ce();Nl();$();he();k1();k1();dS=J("language-client-index"),vbe=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],wbe=["--debug","--debug-brk","--inspect","--inspect-brk"],cz=ge(2e3,100);(e=>{function n(t){return Ue(t.command)}e.is=n})(P1||(P1={}));pS=(r=>(r[r.stdio=0]="stdio",r[r.ipc=1]="ipc",r[r.pipe=2]="pipe",r[r.socket=3]="socket",r))(pS||{});(e=>{function n(t){let i=t;return i&&i.kind===3&&Xt(i.port)}e.isSocket=n})(hS||(hS={}));(e=>{function n(t){return Ue(t.module)}e.is=n})(R1||(R1={}));(e=>{function n(t){let i=t;return i&&i.writer!==void 0&&i.reader!==void 0}e.is=n})(_1||(_1={}));(e=>{function n(t){let i=t;return i&&i.process!==void 0&&typeof i.detached=="boolean"}e.is=n})(E1||(E1={}));Nd=class extends km{constructor(t,i,r,o,s){let a,l,u,c,d;Ue(i)?(a=t,l=i,u=r,c=o,d=!!s):(a=t.toLowerCase(),l=t,u=i,c=r,d=o);super(a,l,c);this._serverOptions=u,this._forceDebug=!!d,this._isInDebugMode=!!d}stop(t=cz){return super.stop(t).then(()=>{if(this._serverProcess){let i=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(i),this._isDetached=void 0}},i=>{if(this._serverProcess&&i.message.includes("timed out")){this._serverProcess.kill("SIGKILL"),this._serverProcess=void 0;return}throw i})}get serviceState(){return this._state}checkProcessDied(t){!t||t.pid===void 0||setTimeout(()=>{try{process.kill(t.pid,0),Fc(t)}catch{}},cz)}handleConnectionClosed(){this._serverProcess=void 0,super.handleConnectionClosed()}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode?(await new Promise(t=>setTimeout(t,1e3)),await this._start()):await this._start()}createMessageTransports(t){function i(u,c){if(!u&&!c)return;let d=Object.create(null);return Object.keys(process.env).forEach(h=>d[h]=process.env[h]),u&&Object.keys(u).forEach(h=>d[h]=u[h]),d}function r(u){if(u.stdin===null||u.stdout===null||u.stderr===null)throw new Error("Process created without stdio streams")}let o=this._s
|
|||
|
`)),!1):!0}function Rbe(n){switch(n){case"info":return 1;case"warn":return 2;case"error":return 3;case"never":return 4;default:return 4}}function gz(n,e){let t=[],i=["file","untitled"].concat(e||[]);return n?(n.forEach(r=>{t.push(...i.map(o=>({language:r,scheme:o})))}),t):i.map(r=>({scheme:r}))}function _be(n){let{transport:e,transportPort:t}=n;return!e||e=="ipc"?1:e=="stdio"?0:e=="pipe"?2:{kind:3,port:t}}function Ebe(n){return{cwd:n.cwd,execArgv:n.execArgv??[],env:n.env??void 0}}function Ibe(n){return{cwd:n.cwd,detached:!!n.detached,shell:!!n.shell,env:n.env??void 0}}function dz(n){switch(n){case 2:return 3;case 3:return 1;case 1:return 5;default:return}}function hz(n){switch(n){case 2:return"running";case 3:return"starting";case 1:return"stopped";default:return"unknown"}}function Lbe(n){switch(n){case 0:return"init";case 3:return"running";case 1:return"starting";case 2:return"startFailed";case 4:return"stopping";case 5:return"stopped";default:return"unknown"}}var Cu,F1,L1,Sn,Pm=D(()=>{"use strict";Je();Re();I1();Ce();ee();Se();ce();Be();$();We();he();Cu=J("services"),F1=(s=>(s[s.Initial=0]="Initial",s[s.Starting=1]="Starting",s[s.StartFailed=2]="StartFailed",s[s.Running=3]="Running",s[s.Stopping=4]="Stopping",s[s.Stopped=5]="Stopped",s))(F1||{}),L1=class{constructor(){this.registered=new Map;this.disposables=[];this.pendingNotifications=new Map;this.registLanguageClient=this.registerLanguageClient.bind(this),this.regist=this.register.bind(this)}init(){b.onDidOpenTextDocument(i=>{this.start(i)},null,this.disposables);let e=i=>{for(let r of i)this.registerClientsFromFolder(r)};b.onDidChangeWorkspaceFolders(i=>{e(i.added)},null,this.disposables);let t=b.initialConfiguration.get("languageserver",{});this.registerClientsByConfig(t),e(b.workspaceFolders),b.onDidChangeConfiguration(i=>{if(i.affectsConfiguration("languageserver")){let r=b.getConfiguration("languageserver",null);this.registerClientsByConfig(r)}},null,this.disposables)}registerClientsFromFolder(e){let t=A.parse(e.uri),r=b.getConfiguration(void 0,t).inspect("languageserver").workspaceFolderValue;this.registerClientsByConfig(r,t)}register(e){let{id:t}=e;if(!this.registered.get(t))return this.registered.set(t,e),this.tryStartService(e),e.onServiceReady(()=>{Cu.info(`service ${t} started`)},null,this.disposables),p.Disposable.create(()=>{!this.registered.has(t)||(e.dispose(),this.registered.delete(t))})}tryStartService(e){if(_.ready)this.shouldStart(e)&&e.start();else{let t=_.on("ready",()=>{t.dispose(),this.shouldStart(e)&&e.start()})}}getService(e){let t=this.registered.get(e);return t||(t=this.registered.get(`languageserver.${e}`)),t}shouldStart(e){if(e.state!=0)return!1;let t=e.selector;for(let i of b.documents)if(b.match(t,i.textDocument))return!0;return!1}async start(e){let t=[];for(let i of this.registered.values())i.state==0&&b.match(i.selector,e)>0&&t.push(i);await Promise.allSettled(t.map(i=>i.start()))}stop(e){let t=this.registered.get(e);if(t)return Promise.resolve(t.stop())}async toggle(e){let t=this.registered.get(e);if(!t)throw new Error(`Service ${e} not found`);let{state:i}=t;i==3?await Promise.resolve(t.stop()):i==0||i==2?await t.start():i==5&&await t.restart()}getServiceStats(){let e=[];for(let[t,i]of this.registered)e.push({id:t,languageIds:Tbe(i.selector),state:Lbe(i.state)});return e}registerClientsByConfig(e,t){for(let i of Object.keys($e(e))){let r=e[i];!Pbe(i,r)||this.registerLanguageClient(i,r,t)}}async getLanguageClient(e){let t=this.getService(e);if(t||await Zi(100),t=this.getService(e),!t||!t.client)throw new Error(`Language server ${e} not found`);return t.client}async sendNotification(e,t,i){let r=await this.getLanguageClient(e);await Promise.resolve(r.sendNotification(t,i))}async sendRequest(e,t,i,r){let o=await this.getLanguageClient(e);return r=r??p.CancellationToken.None,await Promise.resolve(o.sendRequest(t,i,r))}registerNotification(e,t){let i=this.getService(e);i&&i.client&&i.client.onNotification(t,async o=>{this.sendNotificationVim(e,t,o)});let r=this.pendingNotifications.get(e)??[];r.push({id:e,method:t}),this.pendingNotific
|
|||
|
`),s=t.start.line-e.start.line;for(let a=0;a<=s;a++){let l=ye(o[a],"");a==s?i.push(a==0?l.substring(0,t.start.character-e.start.character):l.substring(0,t.start.character)):i.push(l)}s=e.end.line-t.end.line;for(let a=0;a<=s;a++){let l=o[t.end.line-e.start.line+a]??"";a==0?s==0?r.push(e.end.character==t.end.character?"":l.slice(t.end.character-e.end.character)):r.push(l.substring(t.end.character)):r.push(l)}return[i.join(`
|
|||
|
`),r.join(`
|
|||
|
`)]}function Sz(n,e,t){let i=n.split(/\r?\n/),r=t.insertSpaces?" ".repeat(t.tabSize):" ",o=ye(t.tabSize,2);return i=i.map((s,a)=>{let l=s.match(/^\s*/)[0],u=l,c=l.startsWith(" ");return c&&t.insertSpaces?u=r.repeat(l.length):!c&&!t.insertSpaces&&(u=r.repeat(l.length/o)),(a==0||s.length==0?"":e)+u+s.slice(l.length)}),i.join(`
|
|||
|
`)}function Dz(n){return!!(/^\s/.test(n)||n.indexOf(`
|
|||
|
`)!==-1)}function Abe(n,e){return n.primary!==e.primary?n.primary?-1:1:n.index==0||e.index==0?n.index==0?1:-1:n.index-e.index}var Im,O1=D(()=>{"use strict";sp();ae();ee();Pt();Pr();PR();Fw();Im=class{constructor(e,t,i,r){this.snippetString=e;this.position=t;this.nvim=i;this.resolver=r}async init(e,t=!1){let i=e?Ew(e):void 0,o=new ws(!!e,i).parse(this.snippetString,!0);this.tmSnippet=o,await this.resolve(e),this.synchronize(),t||(this.nvim.call("coc#compat#del_var",["coc_selected_text"],!0),this.nvim.call("coc#compat#del_var",["coc_last_placeholder"],!0))}async resolve(e){let{snippet:t}=this.tmSnippet,{resolver:i,nvim:r}=this;if(i&&await t.resolveVariables(i),e&&e.noPython!==!0){let o=[];t.hasPython&&(o=o3(e)),await t.evalCodeBlocks(r,o)}}getRanges(e){let t=e.marker;if(e.value.length==0)return[];let r=this._placeholders.filter(l=>l.index==e.index).map(l=>l.range),o=this.tmSnippet.enclosingPlaceholders(t),s,a=t.parent;if(t instanceof Rt){let l=t.index;s=this.tmSnippet.placeholders.filter(u=>u.index==l&&u.parent==a)}else{let l=t.name;s=this.tmSnippet.variables.filter(u=>u.name==l&&u.parent==a)}return o.forEach(l=>{let u=this._placeholders.filter(c=>c.index==l.index&&c.marker!==l);if(!!u.length)for(let c of s){let d=this.tmSnippet.getTextBefore(c,l);u.forEach(h=>{if(h.transform)r.push(h.range);else{let g=h.range.start;r.push(M.create(sn(g,d),sn(g,d+c.toString())))}})}}),r.filter(l=>!Kt(l))}getSortedPlaceholders(e){let t=e?[e]:[],i=this._placeholders.filter(r=>r!==e&&!r.transform);return i.sort(Abe),t.push(...i),t}get hasPython(){return this.tmSnippet.pyBlocks.length>0}resetStartPosition(e){this.position=e,this.synchronize()}get start(){return Object.assign({},this.position)}get range(){return M.create(this.position,sn(this.position,this._text))}get text(){return this._text}get finalCount(){return this._placeholders.filter(e=>e.index==0).length}get placeholders(){return this._placeholders.map(e=>e.marker)}get firstPlaceholder(){let e=0;for(let t of this._placeholders)t.index==0||t.transform||(e==0||t.index<e)&&(e=t.index);return this.getPlaceholder(e)}getPlaceholderByMarker(e){return this._placeholders.find(t=>t.marker===e)}getPlaceholder(e){let t=this._placeholders.filter(r=>r.index==e&&!r.transform),i=t.find(r=>r.primary);return ye(i,t[0])}getPrevPlaceholder(e){if(e<=1)return;let t=this._placeholders.filter(r=>r.index<e&&r.index!=0&&!r.transform),i;for(;e>1;){e=e-1;let r=t.filter(o=>o.index==e);if(r.length){i=ye(r.find(o=>o.primary),r[0]);break}}return i}getNextPlaceholder(e){let t=this._placeholders.filter(s=>!s.transform),i,r=t.map(s=>s.index),o=Math.max.apply(null,r);for(let s=e+1;s<=o+1;s++){let a=s==o+1?0:s,l=t.filter(u=>u.index==a);if(l.length){i=l.find(u=>u.primary)||l[0];break}}return i}getPlaceholderByRange(e){return this._placeholders.find(t=>ri(e,t.range))}async insertSnippet(e,t,i,r){if(r){let{start:s,end:a}=e.range;this.nvim.setVar("coc_last_placeholder",{current_text:e.value,start:{line:s.line,col:s.character,character:s.character},end:{line:a.line,col:a.character,character:a.character}},!0)}let o=this.tmSnippet.insertSnippet(t,e.marker,i,r);return await this.resolve(r),this.synchronize(),o}getNewText(e,t){let{before:i,after:r}=e;if(!!t.startsWith(i)&&!(t.length<i.length+r.length)&&!!t.endsWith(r))return r.length?t.slice(i.length,-r.length):t.slice(i.length)}async updatePlaceholder(e,t,i,r){let o=this.position,{marker:s,before:a}=e,l=this.tmSnippet.clone();r.onCancellationRequested(()=>{this.tmSnippet=l,this.synchronize()});let u=M.create(o,sn(o,a));if(await this.tmSnippet.update(this.nvim,s,i),r.isCancellationRequested)return;this.synchronize();let c=this.getTextBefore(s,a);return{text:this._text,delta:mw(t,Ye.replace(u,c))}}getTextBefore(e,t){let i=this._placeholders.find(r=>r.marker==e);return i?i.before:t}removeText(e,t){let i=this.tmSnippet.deleteText(e,t);return i&&this.synchronize(),i}synchronize(){let e=this.tmSnippet,{line:t,character:i}=this.position,r=oo.create("untitled:/1","snippet",0,e.toString()),{placeholders:o,variables:s,maxIndexNumber:a}=e,l=new Map,u=a+1;this._placeholders=[...o,...s].map(
|
|||
|
`)){let c=o.getline(t.start.line),d=c.slice(t.end.character);if(d.length){let h=t.end.character,g=d.match(/^\s*/)[0].length,f=M.create(t.end.line,h,t.end.line,h+g);a.push(Ye.replace(f,c.match(/^\s*/)[0]))}}}if(await this.applyEdits(a),this.textDocument=o.textDocument,this.activate(),i&&this.current){let l=this.snippet.getPlaceholderByMarker(this.current);await this.selectPlaceholder(l,!0)}return this._isActive}async applyEdits(e){this._applying=!0,await this.document.applyEdits(e),this._applying=!1}getReplacePlaceholder(e){if(!this.snippet)return;let t=this.findPlaceholder(e);if(!(!t||t.index==0))return t}activate(){this._isActive||(this._isActive=!0,this.nvim.call("coc#snippet#enable",[this.config.preferComplete?1:0],!0))}deactivate(){this.cancel(),this._isActive&&(this.disposable.dispose(),this._isActive=!1,this._snippet=void 0,this.current=null,this.nvim.call("coc#snippet#disable",[],!0),this.config.highlight&&this.nvim.call("coc#highlight#clear_highlight",[this.bufnr,A1,0,-1],!0),this._onCancelEvent.fire(void 0),As.debug(`session ${this.bufnr} cancelled`))}get isActive(){return this._isActive}get bufnr(){return this.document.bufnr}async nextPlaceholder(){await this.forceSynchronize();let e=this.placeholder;if(!e)return;let t=this.snippet.getNextPlaceholder(e.index);t&&await this.selectPlaceholder(t)}async previousPlaceholder(){await this.forceSynchronize();let e=this.placeholder;if(!e)return;let t=this.snippet.getPrevPlaceholder(e.index);t&&await this.selectPlaceholder(t)}async selectCurrentPlaceholder(e=!0){if(await this.forceSynchronize(),!this.snippet)return;let t=this.snippet.getPlaceholderByMarker(this.current);t&&await this.selectPlaceholder(t,e)}async selectPlaceholder(e,t=!0){let{nvim:i,document:r}=this;if(!r||!e)return;let{start:o,end:s}=e.range,a=r.getline(o.line),l=rt(a,o.character)+1,u=this.current=e.marker;if(u instanceof Rt&&u.choice&&u.choice.options.length)(await Promise.resolve().then(()=>(Su(),N1))).default.setWords(u.choice.options.map(d=>d.value)),await i.call("coc#snippet#show_choices",[o.line+1,l,s,e.value]),t&&i.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0);else{let c=this.snippet.finalCount;await this.select(e,t),this.highlights(e),e.index==0&&(c==1?(As.info("Jump to final placeholder, cancelling snippet session"),this.deactivate()):i.call("coc#snippet#disable",[],!0))}}highlights(e,t=!0){if(!this.config.highlight)return;let i=this.document.buffer;this.nvim.pauseNotification(),i.clearNamespace(A1);let r=this.snippet.getRanges(e);r.length&&i.highlightRanges(A1,"CocSnippetVisual",r),this.nvim.resumeNotification(t,!0)}async select(e,t){let{range:i,value:r}=e,{nvim:o}=this;r.length>0?await o.call("coc#snippet#select",[i.start,i.end,r]):await o.call("coc#snippet#move",[i.start]),t&&o.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0),o.redrawVim()}async checkPosition(){if(!this.isActive)return;let e=await k.getCursorPosition();this.snippet&&Ot(e,this.snippet.range)!=0&&(As.info("Cursor insert out of range, cancelling snippet session"),this.deactivate())}findPlaceholder(e){let{placeholder:t}=this;return t&&ri(e,t.range)?t:this.snippet.getPlaceholderByRange(e)||null}get version(){return this.textDocument?this.textDocument.version:-1}async synchronize(e){await this.mutex.use(()=>(e&&(this.document.version!=e.version||e.version-this.version!==1)&&(e=void 0),this._synchronize(e?e.change:void 0)))}async _synchronize(e){let{document:t,textDocument:i}=this;if(!t.attached||!this._isActive)return;let r=Date.now(),o=t.textDocument;if(o.version==i.version||Fe(i.lines,o.lines))return;let{range:s,text:a}=this.snippet;e&&!ri(e.range,s)&&(e=void 0);let l=xz(s.end,i,o);if(!l){As.info("Content change after snippet, cancel snippet session"),this.deactivate();return}if(!wz(s.start,i,o)){let w=o.getText(M.create(V.create(0,0),l));if(w.endsWith(a)){let x=o.positionAt(w.length-a.length);this.snippet.resetStartPosition(x),this.textDocument=o,As.info("Content change before snippet, reset snippet position");return}As.info("Before and snippet body changed, cancel snippet session"),this.deactivate();return}let c=t
|
|||
|
`),filetype:"txt"}]:[];await t.show(a)}},rye);this.disposables.push(p.Disposable.create(()=>{i.clear()})),_.on("CursorMoved",i,this.disposables),_.on("BufUnload",r=>{r===this.bufnr&&this.dispose()},null,this.disposables)}async start(e){this.statMap.clear(),this.names=e;for(let t of e)this.statMap.set(t,0);await this.show()}addMessage(e,t){let i=this.messagesMap.get(e)||[];this.messagesMap.set(e,i.concat(t.trim().split(/\r?\n/))),(t.startsWith("Updated to")||t.startsWith("Installed extension"))&&this.updated.add(e)}startProgress(e){this.statMap.set(e,2)}finishProgress(e,t){this.statMap.set(e,t?3:1)}get remains(){let e=0;for(let t of this.names){let i=this.statMap.get(t);[3,1].includes(i)||(e=e+1)}return e}getLinesAndHighlights(e){let t=[],i=[];for(let r of this.names){let o=this.statMap.get(r),s="*",a,l=e+t.length;switch(o){case 2:{let h=new Date,g=Math.floor(h.getMilliseconds()/100);s=mR[g],a=void 0;break}case 1:s="\u2717",a="ErrorMsg";break;case 3:s="\u2713",a=this.updated.has(r)?"MoreMsg":"Comment";break}let u=this.messagesMap.get(r)||[],c=`- ${s} `,d=de(c);a&&i.push({hlGroup:a,lnum:l,colStart:d,colEnd:d+de(r)}),t.push(`${c}${r} ${u.length?u[u.length-1]:""}`)}return{lines:t,highlights:i}}getMessages(e){let t=this.names[e-2];return this.messagesMap.get(t)??[]}get stopped(){return this.interval==null}draw(){let{remains:e,bufnr:t}=this,{nvim:i}=b;if(!t)return;let r=i.createBuffer(t),o=e==0?`${this.isUpdate?"Update":"Install"} finished`:`Installing, ${e} remaining...`,{lines:s,highlights:a}=this.getLinesAndHighlights(2);i.pauseNotification(),r.setLines([o,"",...s],{start:0,end:-1,strictIndexing:!1},!0),r.updateHighlights("coc-extensions",a,{priority:99}),e==0&&this.interval&&(clearInterval(this.interval),this.interval=null),i.resumeNotification(!0,!0)}highlight(){let{nvim:e}=b;e.call("matchadd",["CocListFgCyan","^\\-\\s\\zs\\*"],!0),e.call("matchadd",["CocListFgGreen","^\\-\\s\\zs\u2713"],!0),e.call("matchadd",["CocListFgRed","^\\-\\s\\zs\u2717"],!0)}async show(){let e=_.requesting===!0,{nvim:t}=b;t.pauseNotification(),t.command(e?"enew":"vs +enew",!0),t.call("bufnr",["%"],!0),t.command("setl buftype=nofile bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1",!0),e||t.command("nnoremap <silent><nowait><buffer> q :q<CR>",!0),this.highlight();let i=await t.resumeNotification();this.bufnr=i[0][1],this.interval=setInterval(()=>{this.draw()},nye)}dispose(){this.bufnr=void 0,this.messagesMap.clear(),this.statMap.clear(),Y(this.disposables),clearInterval(this.interval),this.interval=null}}});function oye(n){return Ay(n)?n.replace(/\.git(#master|#main)?$/,""):""}var Om,CS,X1,Wt,bu=D(()=>{"use strict";kt();To();Ce();ee();Se();Jt();Xe();ce();Nl();We();he();qG();Zz();J1();Jz();Om=J("extensions-index"),CS=R.join(Kn,"extensions"),X1=class{constructor(){this.modulesFolder=R.join(CS,"node_modules");Hz(CS),this.states=new bS(CS),this.manager=new vS(this.states,CS),ie.register({id:"extensions.forceUpdateAll",execute:async()=>{let e=await this.manager.cleanExtensions();Om.info(`Force update extensions: ${e}`),await this.installExtensions(e)}},!1,"remove all global extensions and install them"),this.globalPromise=this.globalExtensions(),ie.register({id:"extensions.toggleAutoUpdate",execute:async()=>{let e=b.getConfiguration("coc.preferences",null),t=e.get("extensionUpdateCheck","daily"),i=1;t=="never"?(await e.update("extensionUpdateCheck","daily",i),k.showInformationMessage("Extension auto update enabled.")):(await e.update("extensionUpdateCheck","never",i),k.showInformationMessage("Extension auto update disabled."))}},!1,"toggle auto update of extensions.")}async init(e){if(process.env.COC_NO_PLUGINS=="1")return;let t=await this.globalPromise;this.manager.registerExtensions(t);let i=this.runtimeExtensionStats(e);this.manager.registerExtensions(i),this.manager.loadFileExtensions()}async activateExtensions(){if(await this.manager.activateExtensions(),process.env.COC_NO_PLUGINS=="1")return;let e=this.states.filterGlobalExtensions(b.env.globalExtensions);this.installExtensions(e);let t=b.initialConfiguration.get("coc.preferences"),i=t.ex
|
|||
|
`)}`);return}l.name=r,i.push({id:r,root:s,isLocal:!1,version:l.version,description:l.description??"",isLocked:t.includes(r),exotic:/^https?:/.test(o),uri:oye(o),state:this.getExtensionState(r),packageJSON:l})}),Om.debug("globalExtensionStats:",i.length),i}runtimeExtensionStats(e){let t=this.states.lockedExtensions,i=e.split(","),r=[],o=new Set;return i.map(s=>{let a=[],l=Bd(s,b.version,a);if(a.length>0)return;let{name:u}=l;!u||this.states.hasExtension(u)||o.has(u)||(this.states.addLocalExtension(u,s),o.add(u),r.push({id:l.name,isLocal:!0,isLocked:t.includes(u),version:l.version,description:l.description??"",exotic:!1,root:s,state:this.getExtensionState(l.name),packageJSON:Object.freeze(l)}))}),r}cleanModulesFolder(){let t=this.states.globalIds.map(r=>r.replace(/\/.*$/,""));if(!F.existsSync(this.modulesFolder))return;let i=F.readdirSync(this.modulesFolder);for(let r of i){if(t.includes(r))continue;let o=R.join(this.modulesFolder,r),s=F.lstatSync(o);s.isSymbolicLink()?F.unlinkSync(o):s.isDirectory()&&F.rmSync(o,{recursive:!0,force:!0})}}dispose(){this.manager.dispose()}};Wt=new X1});var SS,Uz=D(()=>{"use strict";Je();at();SS=class{constructor(e){this.doc=e;this.lineWords=[];this._gitIgnored=!1;this.parseWords();let t=A.parse(e.uri);t.scheme==="file"&&AY(t.fsPath).then(i=>{this._gitIgnored=i})}getWords(){let e=[];for(let t of this.lineWords)t.forEach(i=>{e.includes(i)||e.push(i)});return e}parseWords(){let{lineWords:e,doc:t}=this,{chars:i}=t;for(let r of this.doc.textDocument.lines){let o=i.matchLine(r,2);e.push(o)}}get bufnr(){return this.doc.bufnr}get gitIgnored(){return this._gitIgnored}onChange(e){if(e.contentChanges.length==0)return;let{lineWords:t,doc:i}=this,{range:r,text:o}=e.contentChanges[0],{start:s,end:a}=r,l=s.line,c=a.line-l,h=i.textDocument.lines.slice(l,l+o.split(/\n/).length).map(g=>i.chars.matchLine(g,2));t.splice(l,c+1,...h)}*matchWords(e){let{lineWords:t}=this;e>=t.length&&(e=t.length-1);for(let i=0;i<t.length;i++){let r=i<e?e-i-1:i,o=t[r];for(let s of o)yield s}}dispose(){this.lineWords=[]}}});function cye(n,e,t){let i=t[0];return e&&!aye.includes(n)&&sye.includes(i)&&(i=t[1]),e&&i.charCodeAt(0)>Pl&&(i=al(i)),s1(n,i.charCodeAt(0))}var sye,aye,lye,uye,or,qd=D(()=>{"use strict";Re();ee();Se();Jt();nC();ce();Xe();pe();he();Ta();sye=["_","$","-"],aye=[95,36,45],lye=ge(80,20),uye=50,or=class{constructor(e){this.noMatchWords=new Set;this.disposables=[];this._disabled=!1;this.name=e.name,this.filepath=e.filepath||"",this.sourceType=e.sourceType||0,this.isSnippet=!!e.isSnippet,this.defaults=e,this.documentSelector=e.documentSelector;let t=`coc.source.${e.name}`;this.config=ye(b.initialConfiguration.get(t),{}),b.onDidChangeConfiguration(i=>{i.affectsConfiguration(t)&&(this.config=ye(b.initialConfiguration.get(t),{}))},null,this.disposables),_.on("CompleteDone",()=>{this.noMatchWords.clear()},null,this.disposables)}get nvim(){return b.nvim}get priority(){return this.getConfig("priority",1)}get triggerPatterns(){let e=this.getConfig("triggerPatterns",null);return te(e)?null:e.map(t=>Ue(t)?new RegExp(t+"$"):t)}get triggerOnly(){let e=this.defaults.triggerOnly;return _n(e)?e:Array.isArray(this.triggerPatterns)&&this.triggerPatterns.length>0}get triggerCharacters(){return le(this.getConfig("triggerCharacters",[]))}get firstMatch(){return this.getConfig("firstMatch",!0)}get optionalFns(){return this.defaults.optionalFns||[]}get shortcut(){let e=this.getConfig("shortcut","");return e||this.name.slice(0,3)}get enable(){return this._disabled?!1:this.getConfig("enable",!0)}get filetypes(){return this.getConfig("filetypes",null)}get disableSyntaxes(){return this.getConfig("disableSyntaxes",[])}getConfig(e,t){let i=this.config[e];return it(i)||i==null?t??null:i}toggle(){this._disabled=!this._disabled}get menu(){return""}async checkComplete(e){let{disableSyntaxes:t}=this;if(!te(t)&&e.synname){let r=e.synname.toLowerCase();if(t.findIndex(o=>r.includes(o.toLowerCase()))!==-1)return!1}let i=this.defaults.shouldComplete;return it(i)?!!await Promise.resolve(i.call(this,e)):!0}async refresh(){let e=this.defaults.refresh;it(e)&&aw
|
|||
|
`)||!Kt(r))));if(Kt(r)&&o.length>0&&(o=o.slice(0,1)),o.length==0)$m.debug("no affected ranges"),this.ranges.forEach(s=>{s.adjustFromEdit({range:r,newText:i})}),this.doHighlights();else if(o.length==1&&ri(r,o[0].range)){if($m.debug("affected single range"),i.includes(`
|
|||
|
`)){this.cancel();return}await this.applySingleEdit(o[0],{range:r,newText:i})}else if(!i.length||!this.validChange(r,i)){$m.debug("filter affected ranges.");let s=this.ranges.filter(a=>!o.includes(a));s.length>0?(this.ranges=s,s.forEach(a=>{a.adjustFromEdit({range:r,newText:i})}),this.doHighlights()):this.cancel()}else{$m.debug("Check undo & redo");let s=this.ranges[0],a=this.ranges[this.ranges.length-1],l=e.originalLines.slice(s.line,a.line+1),u=this.doc.textDocument.lines.slice(s.line,a.line+1);this.applyComposedEdit(l,u)}}validChange(e,t){if(xa(Ye.replace(e,t))!=0||!ri(e,this.range))return!1;let i=this.ranges[0],r=this.ranges[this.ranges.length-1];return!(e.start.line!=i.position.line||e.end.line!=r.position.line)}get range(){let e=this.ranges[0],t=this.ranges[this.ranges.length-1];return M.create(e.position,t.range.end)}doHighlights(){let{nvim:e,ranges:t,doc:i}=this,r=i.buffer,o=[];t.forEach(s=>{i.addHighlights(o,"CocCursorRange",s.range,{combine:!1,start_incl:!0,end_incl:!0})}),o.sort((s,a)=>s.lnum!=a.lnum?s.lnum-a.lnum:s.colStart!=a.colStart?s.colStart-a.colStart:0),r.updateHighlights("cursors",o,{priority:4096}),e.redrawVim()}get currentRanges(){return this.ranges.map(e=>e.range)}cancel(){if(!this.activated)return;$m.debug("cursors cancel");let e=this.doc.buffer;this.activated=!1,this.ranges=[],e.clearNamespace("cursors"),e.setVar("coc_cursors_activated",0,!0),this._onDidUpdate.fire(),this._onDidCancel.fire()}dispose(){!this.doc||(this._onDidCancel.dispose(),this._onDidUpdate.dispose(),Y(this.disposables),this.ranges=[],this.doc=null)}async applySingleEdit(e,t){let{doc:i,ranges:r}=this;r.filter(u=>u!==e&&u.position.line==e.position.line).forEach(u=>u.adjustFromEdit(t));let s=_S(e,t.range,t.newText),a=Zm(s);r.forEach(u=>u.applyChange(s));let l=r.filter(u=>u!==e).map(u=>u.textEdit);if(this.changing=!0,await i.applyEdits(l,!0,!0),this.changing=!1,a!=0)for(let u of r){let c=Jm(u,this.ranges,e);u.move(c*a)}this.doHighlights()}applyComposedEdit(e,t){let i=bi(e[0],t[0]),r=this.ranges[0],o=r.position.character,s=r.position.line,a=r.text.length,l=i[0];if(o>0&&(l[0]!=bi.EQUAL||!l[1].startsWith(e[0].slice(0,o))))return this.cancel(),!1;let u=0,c=!1,d=[];for(let w=0;w<i.length;w++){let[x,C]=i[w];if(w==0&&o>0&&(C=C.slice(o)),x==bi.EQUAL){if(u+=C.length,u>a)break}else if(x==bi.DELETE){let P=u;if(u+=C.length,u>a){c=!0;break}d.push({offset:P,remove:C})}else{let P=i[w-1];P&&P[0]==bi.DELETE?d[d.length-1].add=C:d.push({offset:u,add:C})}}if(c||!d.length)return this.cancel(),!1;let h=oo.create("file:///1","",0,e.join(`
|
|||
|
`)),g;if(d.length==1)g={offset:d[0].offset,remove:d[0].remove?d[0].remove.length:0,insert:d[0].add??""};else if(Iye(d,a))g={prepend:[d[0].remove?d[0].remove.length:0,d[0].add??""],append:[d[1].remove?d[1].remove.length:0,d[1].add??""]};else{let w=r.text,x="",C="",P=d[0].offset;for(let T of d){if(T.offset>P+x.length){let O=w.slice(P+x.length,T.offset);x+=O,C+=O}T.add&&(C+=T.add),T.remove&&(x+=T.remove)}g={offset:P,remove:x.length,insert:C}}let f=this.ranges.map(w=>{let x=w.position.line-s,{start:C,end:P}=w.range,T=M.create(x,C.character,x,P.character);return w.applyChange(g),Ye.replace(T,w.text)});if(oo.applyEdits(h,f)!==t.join(`
|
|||
|
`))return this.cancel(),!1;let y=Zm(g);if(y!=0)for(let w of this.ranges){let x=Jm(w,this.ranges);w.move(x*y)}return this.doHighlights(),!0}}});var Gm,mK=D(()=>{"use strict";ae();We();he();kt();fK();Um();Gm=class{constructor(e){this.nvim=e;this.sessionsMap=new Map;this.disposables=[];this.loadConfiguration(),b.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),b.onDidCloseTextDocument(t=>{let i=this.getSession(t.bufnr);!i||(this.sessionsMap.delete(t.bufnr),i.dispose())},null,this.disposables),this.disposables.push(ie.registerCommand("editor.action.addRanges",async t=>{await this.addRanges(t)},null,!0))}loadConfiguration(e){if(!e||e.affectsConfiguration("cursors")){let t=b.initialConfiguration;this.config=t.get("cursors")}}cancel(e){let t=b.getDocument(e);if(!t)return;let i=this.getSession(t.bufnr);i&&i.cancel()}getSession(e){return this.sessionsMap.get(e)}async isActivated(){let e=await this.nvim.call("bufnr",["%"]);return this.sessionsMap.get(e)!=null}async select(e,t,i){let r=b.getAttachedDocument(e),{nvim:o}=this,s=this.createSession(r),a;if(t=="operator"){let l=await o.eval(`[getpos("'["),getpos("']")]`);if(i=="char"){let u=r.getPosition(l[0][1],l[0][2]),c=r.getPosition(l[1][1],l[1][2]+1),d=eI(r,M.create(u,c));s.addRanges(d)}else{let u=[];for(let c=l[0][1]-1;c<=l[1][1]-1;c++){let d=r.getline(c);u.push(M.create(c,0,c,d.length))}s.addRanges(u)}}else if(t=="word"){let l=await k.getCursorPosition();if(a=r.getWordRangeAtPosition(l),!a){let u=r.getline(l.line);l.character==u.length?a=M.create(l.line,Math.max(0,u.length-1),l.line,u.length):a=M.create(l.line,l.character,l.line,l.character+1)}s.addRange(a),await o.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}else if(t=="position"){let l=await k.getCursorPosition(),u=r.getline(l.line);l.character>=u.length?a=M.create(l.line,u.length-1,l.line,u.length):a=M.create(l.line,l.character,l.line,l.character+1),s.addRange(a),await o.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}else if(t=="range"){await o.call("eval",'feedkeys("\\<esc>", "in")');let l=await k.getSelectedRange(i);if(!l)return;let u=i==""?pK(r,l):eI(r,l);for(let c of u)s.addRange(c)}else throw new Error(`select kind "${t}" not supported`)}createSession(e){let{bufnr:t}=e,i=this.getSession(t);return i||(i=new Xm(this.nvim,e,this.config),this.sessionsMap.set(t,i),i.onDidCancel(()=>{i.dispose(),this.sessionsMap.delete(t)}),i)}async addRanges(e){let{nvim:t}=this,i=await t.call("bufnr",["%"]),r=b.getAttachedDocument(i);return this.createSession(r).addRanges(e)}reset(){for(let e of this.sessionsMap.values())e.cancel();this.sessionsMap.clear()}}});function bK(n,e,t){!Array.isArray(e)||t&&t.isCancellationRequested||(e.forEach(i=>i.parent=n),n.children=e)}var nI,Xa,rI=D(()=>{"use strict";ae();Je();kt();ce();$();he();Ap();nI=class{constructor(e,t,i,r,o,s,a){this.meta=e;this.winid=t;this.config=i;this.commandId=r;this.rootItems=o;this.getIcon=s;this.resolveChildren=a;this._onDidChangeTreeData=new p.Emitter;this.onDidChangeTreeData=this._onDidChangeTreeData.event;this.actions=[];this.addAction("Open in new tab",async l=>{await ie.executeCommand(this.commandId,t,l,"tabe")}),this.addAction("Dismiss",async l=>{if(l.parent==null){let u=this.rootItems.filter(c=>c!==l);this.reset(u)}else{let u=l.parent,c=u.children.findIndex(d=>d===l);u.children.splice(c,1),this._onDidChangeTreeData.fire(u)}})}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=void 0)}reset(e){this.rootItems=e,this._onDidChangeTreeData.fire(void 0)}addAction(e,t){this.actions.push({title:e,handler:t})}async getChildren(e){this.cancel(),this.tokenSource=new p.CancellationTokenSource;let{token:t}=this.tokenSource;if(!e){for(let r of this.rootItems){let o=await this.resolveChildren(r,this.meta,t);bK(r,o,t)}return this.rootItems}if(e.children)return e.children;let i=await this.resolveChildren(e,this.meta,t);return this.tokenSource=void 0,bK(e,i,t),i}getTreeItem(e){var i;let t=new so(e.name,e.children?2:1);return this.config.enableTooltip&&(t.tooltip=R.relative(b.cwd,A.parse(e.uri).fsPath)),
|
|||
|
`,r),i)){let o=await t.call("line",".")-1;await r._fetchContent(!1);let s=r.getline(o-1),a=r.getline(o),l=s[s.length-1];if(l&&ph.has(l)){let u=a.trim()[0];if(u&&ph.get(l)==u){let c=[],d=V.create(o-1,s.length);if(r.filetype=="vim"){let h=await b.getFormatOptions(r.uri),g=h.insertSpaces?" ".repeat(h.tabSize):" ",f=a.match(/^\s*/)[0],m=`
|
|||
|
`+f+g;c.push({range:M.create(o,f.length,o,f.length),newText:" \\ "}),m=m+"\\ ",c.push({range:M.create(d,d),newText:m}),await r.applyEdits(c),await k.moveTo(V.create(o,m.length-1))}else await t.eval(`feedkeys("\\<Esc>O", 'in')`)}}}}async documentRangeFormat(e,t){this.handler.checkProvider("formatRange",e.textDocument),await e.synchronize();let i;if(t){if(i=await k.getSelectedRange(t),!i)return-1}else{let[s,a,l]=await this.nvim.eval("[v:lnum,v:count,mode()]");if(a==0||l=="i"||l=="R")return-1;i=M.create(s-1,0,s-1+a,0)}let r=await b.getFormatOptions(e.uri),o=await this.handler.withRequestToken("Format range",s=>I.provideDocumentRangeFormattingEdits(e.textDocument,i,r,s));return te(o)?-1:(await e.applyEdits(o,!1,!0),0)}}});var sb,FK=D(()=>{"use strict";ae();kt();Re();Te();ee();Pt();$();We();he();sb=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.highlights=new Map;_.on(["CursorMoved","CursorMovedI"],()=>{this.cancel(),this.clearHighlights()},null,this.disposables),this.loadConfiguration(),b.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),k.onDidChangeActiveTextEditor(()=>{this.loadConfiguration()},null,this.disposables),ie.register({id:"document.jumpToNextSymbol",execute:async()=>{await this.jumpSymbol("next")}},!1,"Jump to next symbol highlight position."),ie.register({id:"document.jumpToPrevSymbol",execute:async()=>{await this.jumpSymbol("previous")}},!1,"Jump to previous symbol highlight position.")}loadConfiguration(e){let t=b.getConfiguration("documentHighlight",this.handler.uri);(!e||e.affectsConfiguration("documentHighlight"))&&(this.config=Object.assign(this.config||{},{priority:t.get("priority",-1),timeout:t.get("timeout",300)}))}isEnabled(e,t){let i=b.getDocument(e);return!(!i||!i.attached||t||!I.hasProvider("documentHighlight",i.textDocument))}clearHighlights(){if(this.highlights.size!=0){for(let e of this.highlights.keys())this.nvim.createWindow(e).clearMatchGroup("^CocHighlight");this.highlights.clear()}}async highlight(){let{nvim:e}=this;this.cancel();let[t,i,r,o]=await e.eval(`[bufnr("%"),win_getid(),coc#cursor#position(),get(b:,'coc_cursors_activated',0)]`);if(!this.isEnabled(t,o))return;let s=b.getDocument(t),a=await this.getHighlights(s,V.create(r[0],r[1]));if(!a)return;let l={};for(let c of a){if(!M.is(c.range))continue;let d=c.kind==Vs.Text?"CocHighlightText":c.kind==Vs.Read?"CocHighlightRead":"CocHighlightWrite";l[d]=l[d]||[],l[d].push(c.range)}let u=e.createWindow(i);e.pauseNotification(),u.clearMatchGroup("^CocHighlight");for(let c of Object.keys(l))u.highlightRanges(c,l[c],this.config.priority,!0);e.resumeNotification(!0,!0),this.highlights.set(i,a)}async jumpSymbol(e){let t=await this.getSymbolsRanges();if(!t)return;let i=await k.getCursorPosition();if(e=="next"){for(let r=0;r<=t.length-1;r++)if(ze(t[r].start,i)>0){await k.moveTo(t[r].start);return}await k.moveTo(t[0].start)}else{for(let r=t.length-1;r>=0;r--)if(ze(t[r].end,i)<0){await k.moveTo(t[r].start);return}await k.moveTo(t[t.length-1].start)}}async getSymbolsRanges(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvider("documentHighlight",e.textDocument);let i=await this.getHighlights(e,t);return i?i.filter(r=>M.is(r.range)).map(r=>r.range).sort((r,o)=>wa(r,o)):null}hasHighlights(e){return this.highlights.get(e)!=null}async getHighlights(e,t){let r=e.getline(t.line)[t.character];if(!r||!e.isWord(r))return null;await e.synchronize(),this.cancel();let o=this.tokenSource=new p.CancellationTokenSource,s=this.timer=setTimeout(()=>{o.cancel()},this.config.timeout),a=await I.getDocumentHighLight(e.textDocument,t,o.token);return clearTimeout(s),o.token.isCancellationRequested?null:a}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose(),this.tokenSource=null)}dispose(){this.timer&&clearTimeout(this.timer),this.cancel(),this.highlights.clear(),Y(this.disposables)}}});async function Yye(n,e,t){for(let i of e){if(!(i!=null&&i.targetRange))continue;let{start:r,end:o}=i.targetRange,s=o.line-r.line>=100?r.line+100:o.character==0?o.line-1:o.line,a=aw
|
|||
|
`),filetype:t})}}}function ab(n,e,t,i=!1){let r=e.trim();!r.length||(i&&t!=="markdown"&&(r="``` "+t+`
|
|||
|
`+r+"\n```"),n.push({content:r,filetype:t}))}function Zye(n){return n?typeof n.filetype=="string"&&typeof n.content=="string":!1}async function Jye(n,e,t){let i=b.getDocument(n);if(i)return i.getLines(e,t+1);let r=A.parse(n).fsPath;return F.existsSync(r)?await sa(r,e,t):[]}var Wye,lb,MK=D(()=>{"use strict";ae();Je();Te();ee();Se();at();Xe();ce();$();pe();We();he();Wye=ge(500,10),lb=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.documentLines=[];this.hasProvider=!1;this.loadConfiguration(),b.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),this.hoverFactory=k.createFloatFactory({modes:["n"],autoHide:this.config.autoHide}),this.disposables.push(this.hoverFactory),k.onDidChangeActiveTextEditor(()=>{this.loadConfiguration()},null,this.disposables)}registerProvider(){if(this.hasProvider)return;this.hasProvider=!0;let{nvim:e}=this,t={onDidChange:null,provideTextDocumentContent:async()=>(e.pauseNotification(),e.command("setlocal conceallevel=2 nospell nofoldenable wrap",!0),e.command("setlocal bufhidden=wipe nobuflisted",!0),e.command("setfiletype markdown",!0),e.command(`if winnr('j') != winnr('k') | exe "normal! z${Math.min(this.documentLines.length,this.config.previewMaxHeight)}\\<cr>" | endif`,!0),await e.resumeNotification(),this.documentLines.join(`
|
|||
|
`))};this.disposables.push(b.registerTextDocumentContentProvider("coc",t))}loadConfiguration(e){if(!e||e.affectsConfiguration("hover")){let t=b.getConfiguration("hover",this.handler.uri);this.config={floatConfig:t.get("floatConfig",{}),autoHide:t.get("autoHide",!0),target:t.get("target","float"),previewMaxHeight:t.get("previewMaxHeight",12)},this.config.target=="preview"&&this.registerProvider()}}async onHover(e){let{doc:t,position:i,winid:r}=await this.handler.getCurrentState();e=="preview"&&this.registerProvider(),this.handler.checkProvider("hover",t.textDocument),await t.synchronize();let o=await this.handler.withRequestToken("hover",a=>I.getHover(t.textDocument,i,a),!0);if(o==null||!o.length)return!1;let s=o.find(a=>M.is(a.range));if(s!=null&&s.range){let a=this.nvim.createWindow(r);a.highlightRanges("CocHoverRange",[s.range],99,!0),this.timer=setTimeout(()=>{a.clearMatchGroup("CocHoverRange"),this.nvim.redrawVim()},500)}return await this.previewHover(o,e),!0}async definitionHover(e){let{doc:t,position:i,winid:r}=await this.handler.getCurrentState();e=="preview"&&this.registerProvider(),this.handler.checkProvider("hover",t.textDocument),await t.synchronize();let o=await this.handler.withRequestToken("hover",l=>I.getHover(t.textDocument,i,l),!0);if(te(o))return!1;let s=await this.handler.withRequestToken("definitionHover",l=>I.getDefinitionLinks(t.textDocument,i,l),!1);await Yye(o,s,t.filetype);let a=o.find(l=>as.is(l)&&M.is(l.range));if(a){let l=this.nvim.createWindow(r);l.highlightRanges("CocHoverRange",[a.range],99,!0),this.timer=setTimeout(()=>{l.clearMatchGroup("CocHoverRange"),this.nvim.redrawVim()},Wye)}return await this.previewHover(o,e),!0}async previewHover(e,t){let i=[];t=t??this.config.target;let r=t==="preview";for(let s of e){if(Zye(s)){i.push(s);continue}let{contents:a}=s;if(Array.isArray(a))for(let l of a)typeof l=="string"?ab(i,l,"markdown",r):ab(i,l.value,l.language,r);else ss.is(a)?typeof a=="string"?ab(i,a,"markdown",r):ab(i,a.value,a.language,r):Mn.is(a)&&ab(i,a.value,Ny(a)?"markdown":"txt",r)}if(t=="float"){await this.hoverFactory.show(i,this.config.floatConfig);return}let o=i.reduce((s,a)=>{let l=a.content.split(/\r?\n/);return s.length>0&&s.push(""),s.push(...l),s},[]);if(t=="echo"){let s=o.join(`
|
|||
|
`).trim();await this.nvim.call("coc#ui#echo_hover",[s])}else this.documentLines=o,await this.nvim.command("noswapfile pedit coc://document")}async getHover(e){let t=[],i,r;if(e){i=e.bufnr?b.getAttachedDocument(e.bufnr):await b.document;let a=i.getline(e.line-1),l=Mt(a,e.col-1);r=V.create(e.line-1,l)}else{let a=await this.handler.getCurrentState();i=a.doc,r=a.position}this.handler.checkProvider("hover",i.textDocument),await i.synchronize();let o=new p.CancellationTokenSource,s=await I.getHover(i.textDocument,r,o.token);for(let a of s){let{contents:l}=a;Array.isArray(l)?l.forEach(u=>{t.push(typeof u=="string"?u:u.value)}):Mn.is(l)?t.push(l.value):t.push(typeof l=="string"?l:l.value)}return t=t.filter(a=>a!=null&&a.length>0),t}dispose(){this.timer&&clearTimeout(this.timer),Y(this.disposables)}}});var Ga,cI=D(()=>{"use strict";Ga=class{constructor(){this.ranges=[]}get current(){let e=[];return this.ranges.sort((t,i)=>t[0]-i[0]),this.ranges.forEach(t=>{e.push(t[0],t[1])}),e}clear(){this.ranges=[]}add(e,t){e>t&&([e,t]=[t,e]);let{ranges:i}=this;if(i.length==0)i.push([e,t]);else{i.sort((l,u)=>l[0]-u[0]);let r,o,s=[];for(let l=0;l<i.length;l++){let u=i[l];u[1]<e||u[0]>t||(s.push(l),r==null&&(r=Math.min(e,u[0])),o=Math.max(t,u[1]))}let a=s.length?i.filter((l,u)=>!s.includes(u)):i;this.ranges=a,r!=null&&o!=null?this.ranges.push([r,o]):this.ranges.push([e,t])}}has(e,t){return this.ranges.findIndex(r=>r[0]<=e&&r[1]>=t)!==-1}static mergeSpans(e){let t=[];for(let i of e){let r=t.findIndex(o=>!(i[1]<o[0]||i[0]>o[1]));if(r==-1)t.push(i);else{let o=t[r];t[r]=[Math.min(i[0],o[0]),Math.max(i[1],o[1])]}}return t}}});function dI(n){switch(n){case $r.Parameter:return"CocInlayHintParameter";case $r.Type:return"CocInlayHintType";default:return"CocInlayHint"}}var Ru,Uye,$ye,ub,jK=D(()=>{"use strict";ae();Re();Te();cI();OR();ee();Ti();Pt();$();pe();he();Uye=ge(100,10),$ye=ge(500,10);ub=class{constructor(e,t){this.nvim=e;this.doc=t;this.regions=new Ga;this.currentHints=[];this._onDidRefresh=new p.Emitter;this.onDidRefresh=this._onDidRefresh.event;this.render=ry(()=>{this.renderRange()},Uye),this.hasProvider&&this.render()}get config(){return this._config?this._config:(this.loadConfiguration(),this._config)}loadConfiguration(){let e=b.getConfiguration("inlayHint",this.doc),t=this._config&&this._config.enable!=e.enable;if(this._config={enable:e.get("enable"),display:e.get("display",!0),filetypes:e.get("filetypes"),refreshOnInsertMode:e.get("refreshOnInsertMode"),enableParameter:e.get("enableParameter"),typeSeparator:e.get("typeSeparator",""),parameterSeparator:e.get("parameterSeparator",""),subSeparator:e.get("subSeparator"," ")},t){let{enable:i,display:r}=this._config;i?(this.clearCache(),this.clearVirtualText()):r&&this.renderRange()}}onInsertLeave(){this.config.refreshOnInsertMode||this.render()}onInsertEnter(){this.config.refreshOnInsertMode||this.cancel()}get current(){return this.currentHints}get enabled(){return!this.config.display||!this.configEnabled?!1:this.hasProvider}get hasProvider(){return I.hasProvider("inlayHint",this.doc)}get configEnabled(){let{filetypes:e,enable:t}=this.config;return Array.isArray(e)?e.includes("*")||e.includes(this.doc.filetype):t===!0}toggle(){if(!I.hasProvider("inlayHint",this.doc.textDocument))throw new Error("Inlay hint provider not found for current document");if(!this.configEnabled)throw new Error(`Filetype "${this.doc.filetype}" not enabled by inlayHint configuration`);this.config.display?(this.config.display=!1,this.clearCache(),this.clearVirtualText()):(this.config.display=!0,this.renderRange())}clearCache(){this.currentHints=[],this.regions.clear(),this.render.clear()}onTextChange(){this.clearCache(),this.cancel()}onChange(){this.cancel(),this.render()}cancel(){this.render.clear(),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}async requestInlayHints(e,t){try{return await I.provideInlayHints(this.doc.textDocument,e,t)}catch(i){!t.isCancellationRequested&&i instanceof Ct&&this.render($ye)}}async renderRange(){if(this.cancel(),_.insertMode&&!this.config.refreshOnInsertMode||!this.enab
|
|||
|
`)||!Kt(r))));if(o.length==1&&ri(r,o[0].range)){if(i.includes(`
|
|||
|
`)){this.cancelEdit();return}await this.applySingleEdit(o[0],{range:r,newText:i})}else this.cancelEdit()}async applySingleEdit(e,t){let{bufnr:i,ranges:r}=this,o=b.getDocument(i);r.filter(c=>c!==e&&c.position.line==e.position.line).forEach(c=>c.adjustFromEdit(t));let a=_S(e,t.range,t.newText),l=Zm(a);r.forEach(c=>c.applyChange(a));let u=r.filter(c=>c!==e).map(c=>c.textEdit);if(this.changing=!0,await o.applyEdits(u,!0,!0),this.changing=!1,l!=0)for(let c of r){let d=Jm(c,this.ranges,e);c.move(d*l)}this.doHighlights()}doHighlights(){let{window:e,ranges:t,nvim:i}=this;e&&t&&(i.pauseNotification(),e.clearMatchGroup("^CocLinkedEditing"),e.highlightRanges("CocLinkedEditing",t.map(r=>r.range),99,!0),i.resumeNotification(!0,!0))}_checkPosition(e,t){if(_.pumvisible||!b.isAttached(e))return;let i=b.getDocument(e);if(!b.getConfiguration("coc.preferences",i).get("enableLinkedEditing",!1)||!I.hasProvider("linkedEditing",i.textDocument))return;let s=Mt(i.getline(t[0]-1),t[1]-1),a=V.create(t[0]-1,s);if(this.ranges){if(this.ranges.some(l=>Ot(a,l.range)==0))return;this.cancelEdit()}this.enable(i,a)}async enable(e,t){let i=e.textDocument,o=(this.tokenSource=new p.CancellationTokenSource).token,s=await this.nvim.window,a=await I.provideLinkedEdits(i,t,o);if(o.isCancellationRequested||!a||a.ranges.length==0)return;let l=a.ranges.map(u=>new Pu(u.start.line,u.start.character,i.getText(u)));this.wordPattern=a.wordPattern,this.bufnr=e.bufnr,this.window=s,this.ranges=l,this.doHighlights()}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}}});function Kye(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!Fe(n[t].range,e[t].range))return!1;return!0}var HK,hI,Gye,NK,zye,hb,gI,BK=D(()=>{"use strict";HK=sr(OS());ae();Re();Te();ee();Se();Be();Pt();$();We();he();Gye=ge(200,10),NK="links",zye="CocLink",hb=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.setConfiguration(),b.onDidChangeConfiguration(this.setConfiguration,this,this.disposables),_.on("CursorHold",async()=>{await this.showTooltip()},null,this.disposables),_.on(["CursorMoved","InsertEnter"],()=>{this.cancel()},null,this.disposables),this.buffers=b.registerBufferSync(i=>new gI(i)),this.disposables.push(this.buffers),I.onDidLinksRefresh(i=>{for(let r of this.buffers.items)b.match(i,r.doc)&&r.fetchLinks()},null,this.disposables)}setConfiguration(e){if((!e||e.affectsConfiguration("links"))&&(this.tooltip=b.initialConfiguration.get("links.tooltip",!1),e))for(let t of this.buffers.items)t.updateDocumentConfig()}async showTooltip(){if(!this.tooltip)return;let e=await this.getCurrentLink();if(!e||!e.target)return;let t=e.target;e.tooltip&&(t+=" "+e.tooltip);let i={content:t,filetype:"txt"};hI||(hI=k.createFloatFactory({})),await hI.show([i])}async getLinks(){let{doc:e}=await this.handler.getCurrentState(),t=this.buffers.getItem(e.bufnr);return await t.getLinks(),le(t.links)}async getCurrentLink(){let e=await this.getLinks(),t=await k.getCursorPosition();if(e&&e.length){for(let a of e)if(Ot(t,a.range)==0){if(!a.target){let l=this.tokenSource=this.tokenSource||new p.CancellationTokenSource;if(a=await I.resolveDocumentLink(a,this.tokenSource.token),this.tokenSource=void 0,!a.target||l.token.isCancellationRequested)continue}return a}}let i=await this.nvim.call("getline",["."]),r=/\w+?:\/\/[^)\]'" ]+/g,o,s;for(;(o=r.exec(i))!==null;){let a=o.index;if(a<=t.character&&a+o[0].length>=t.character){s=Tl.create(M.create(t.line,a,t.line,a+o[0].length),o[0]);break}}return s}async openCurrentLink(){let e=await this.getCurrentLink();return e?(await this.openLink(e),!0):!1}async openLink(e){if(!e.target)throw new Error("Failed to resolve link target");await b.openResource(e.target)}getBuffer(e){return this.buffers.getItem(e)}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}dispose(){Y(this.disposables)}},gI=class{constructor(e){this.doc=e;this.links=[];this.fetchLinks=(0,HK.default)(()=>{this.getLinks()},Gye),this.hasProvider&&this.fetchLinks()}get config(){return this._config?this._config:(this.updateDocumentConfig(),t
|
|||
|
`)+`
|
|||
|
`;let{start:f,end:m}=s;l[0].range=M.create(f.line,0,m.line,0)}}let d=o[s.start.line-1],h=u.length>1?u[u.length-2]:"";if(c==""&&h.startsWith(fo)&&d==h&&s.start.character==0&&s.end.character==0){r=d+`
|
|||
|
`+u.slice(0,-2).join(`
|
|||
|
`)+`
|
|||
|
`;let{start:g,end:f}=s;l[0].range=M.create(g.line-1,0,f.line-1,0)}}else if(Kt(s)&&s.start.character!=0){let u=a.split(/\r?\n/),c=u[u.length-1],d=o[s.start.line].slice(0,s.start.character);if(c.startsWith(fo)&&d==c){l[0].text=d+u.slice(0,-1).join(`
|
|||
|
`)+`
|
|||
|
`;let{start:h,end:g}=s;l[0].range=M.create(h.line,0,g.line,0)}}return{contentChanges:l,bufnr:t,textDocument:i,original:r,originalLines:o}}var Qye,fo,fb,YK=D(()=>{"use strict";sp();ae();Je();Ce();Sa();ee();at();Tr();fs();ce();Be();Pt();pe();Pr();We();he();WK();Qye=J("handler-refactorBuffer"),fo="\u3000",fb=class{constructor(e,t,i,r,o){this.bufnr=e;this.srcId=t;this.nvim=i;this.config=r;this.opts=o;this._disposed=!1;this._fileItems=[];this.mutex=new Oi;this.disposables=[];this.matchIds=new Set;this.changing=!1;this.changes=new pb,this.disposables.push(b.registerLocalKeymap(e,"n","<CR>",this.splitOpen.bind(this),!0)),r.showMenu&&this.disposables.push(b.registerLocalKeymap(e,"n",r.showMenu,this.showMenu.bind(this),!0)),b.onDidChangeTextDocument(this.onDocumentChange,this,this.disposables)}async showMenu(){let e=await k.showMenuPicker(["Tab open","Remove block"]);if(e==-1)return;let t=await this.searchCurrentRange();if(!!t){if(e==0){let r=(await this.nvim.eval("strpart(getline('.'), 0 ,col('.') - 1)")).length,o=this.getAbsolutePath(t.filepath);this.nvim.call("coc#util#jump",["tabe",o,[t.line,r]],!0)}if(e==1){let i=this.getDeleteRange(t);await this.document.applyEdits([Ye.del(i)])}}}get fileItems(){return this._fileItems}getFileItem(e){let t=A.parse(e).fsPath;return this._fileItems.find(i=>li(i.filepath,t))}getFileRange(e){for(let t of this._fileItems)for(let i of t.ranges)if(i.lnum==e)return Object.assign(ni(i,["highlights"]),{filepath:t.filepath});throw new Error(`File range not found at lnum: ${e}`)}onChange(e){if(this.changing)return;if(e.contentChanges.length===0){this.highlightLineNr(),this.nvim.redrawVim();return}let{nvim:t}=this;e=eve(e);let i=e.contentChanges[0],{original:r}=e;i.range.end.line>2&&t.call("setbufvar",[e.bufnr,"&modified",1],!0);let{range:o,text:s}=i;if(xa(Ye.replace(o,s))==0)return;let l=[Ye.replace(o,s)],u=[];if(!Kt(o)&&!s.includes("\u3000")){let c=o.start.line,d=[],h=r.split(/\r?\n/);for(let g=0;g<h.length;g++){let f=h[g];f.length>1&&f.includes("\u3000")&&d.push(c+g+1)}if(d.length){let g=d.map(f=>this.getFileRange(f));for(let f of this._fileItems)f.ranges=f.ranges.filter(m=>!d.includes(m.lnum));this.changes.add(g)}}else if(Kt(o)&&s.includes("\u3000")){let c=s.split(/\r?\n/),d=[],h=o.start.line;for(let g=0;g<c.length;g++){let f=c[g];f.length>1&&f.includes("\u3000")&&d.push(h+g+1)}if(d.length){let g=this.changes.checkInsert(d);g&&(u=g)}}else s.includes("\u3000")&&(l=this.diffChanges(r,s),l.forEach(c=>{c.range=GZ(c.range,o.start)}));this.adjustLnums(l),t.pauseNotification(),this.highlightLineNr(),t.resumeNotification(!0,!0),u.length&&u.forEach(c=>{this._fileItems.find(h=>h.filepath==c.filepath).ranges.push(c)})}diffChanges(e,t){let i=[],r=bi(e,t),o=0,s=oo.create("file:///1","",0,e);for(let a=0;a<r.length;a++){let l=r[a],u=s.positionAt(o);if(l[0]==bi.EQUAL)o=o+l[1].length;else if(l[0]==bi.DELETE){let c=s.positionAt(o+l[1].length);if(r[a+1]&&r[a+1][0]==bi.INSERT){let d=r[a+1][1];i.push(Ye.replace(M.create(u,c),d)),a=a+1}else i.push(Ye.replace(M.create(u,c),""));o=o+l[1].length}else l[0]==bi.INSERT&&i.push(Ye.insert(u,l[1]))}return i}async onDocumentChange(e){if(this.changing||e.contentChanges.length===0)return;let{uri:t}=e.textDocument,i=this.getFileItem(t);if(!i)return;let{range:r,text:o}=e.contentChanges[0],s=xa(Ye.replace(r,o)),a=[],l=[];for(let u=0;u<i.ranges.length;u++){let c=i.ranges[u];if(r.start.line>=c.start+c.lines.length)continue;if(r.end.line<c.start){c.start=c.start+s;continue}let d=b.getDocument(t).textDocument,h=c.start+c.lines.length+s,g=d.lines.slice(c.start,h);if(g.length){c.lines=g;let f=this.getReplaceRange(c);a.push(Ye.replace(f,g.join(`
|
|||
|
`)))}else{l.push(u);let f=this.getDeleteRange(c);a.push(Ye.replace(f,""))}}l.length&&(i.ranges=i.ranges.filter((u,c)=>!l.includes(c))),this._fileItems=this._fileItems.filter(u=>u.ranges&&u.ranges.length>0),a.length&&(this.adjustLnums(a),this.changing=!0,await this.document.applyEdits(a),this.changing=!1),this.nvim.pauseNotification(),this.highlightLineNr(),this.buffer.setOption("modified",!1,!0),await this.nvim.resumeNotification(!0)}adjustLnums(e){for(let t of this._fileItems)for(let i of t.ranges){let r=i.lnum-1;i.lnum+=GP(V.create(r,0),e)}}async getFileChanges(){let e=[],t=await this.buffer.lines;t.push(fo);let i=[],r,o;for(let s=0;s<t.length;s++){let a=t[s];if(a.startsWith(fo)){if(r&&(e.push({filepath:r,lines:i.slice(),lnum:o}),r=void 0,i=[]),a.length>1){let l=a.match(/^\u3000(.*)/);l&&(r=this.getAbsolutePath(l[1].replace(/\s+$/,"")),o=s+1,i=[])}}else i.push(a)}return e}async splitOpen(){let{nvim:e}=this,i=await e.createWindow(this.opts.fromWinid).valid,o=(await e.eval("strpart(getline('.'), 0 ,col('.') - 1)")).length,s=await this.searchCurrentRange();if(s){let a=this.getAbsolutePath(s.filepath);e.pauseNotification(),i?(e.call("win_gotoid",[this.opts.fromWinid],!0),this.nvim.call("coc#util#jump",["edit",a,[s.line,o]],!0)):this.nvim.call("coc#util#jump",["belowright vs",a,[s.line,o]],!0),e.command("normal! zz",!0),await e.resumeNotification(!0),i||(this.opts.fromWinid=await e.call("win_getid"))}}async searchCurrentRange(){let{nvim:e}=this,t=await e.eval('getline(1,line("."))'),i=t.length;for(let r=0;r<i;r++)if(t[i-r-1].match(/^\u3000(.+)/)){let a=this.getFileRange(i-r);return Object.assign({line:a.start+(r==0?1:r)-1},a)}}async addFileItems(e){if(this._disposed)return;let{cwd:t}=this.opts,{document:i}=this,r=await this.mutex.acquire();try{await i.synchronize();let o=i.lineCount,s=new Ki,a=[];for(let c of e){let d=[];for(let h of c.ranges){s.addLine(fo),s.addLine(fo);let g=o+s.length;s.addText(`${pt(t,c.filepath)?R.relative(t,c.filepath):c.filepath}`);let f=String(h.start+1).length+String(h.end).length+4;this.srcId||s.addText(" ".repeat(f));let m=0-s.length-o;h.highlights&&a.push(...h.highlights.map(P=>Vye(P,m)));let{lines:y,start:w,end:x,highlights:C}=h;y||(y=await this.getLines(c.filepath,w,x)),d.push({lines:y,lnum:g,start:w,highlights:C}),s.addLines(y)}if(d.length){let h={filepath:c.filepath,ranges:d},g=this._fileItems.find(f=>f.filepath==c.filepath);g?g.ranges.push(...h.ranges):this._fileItems.push(h)}}let{nvim:l,buffer:u}=this;if(this.changing=!0,l.pauseNotification(),s.render(u,o),this.highlightLineNr(),u.setOption("modified",!1,!0),u.setOption("undolevels",1e3,!0),o==2&&a.length){let c=a[0].start;l.call("coc#cursor#move_to",[c.line,c.character],!0)}await l.resumeNotification(!0),await i.patchChange(),this.changing=!1,await k.cursors.addRanges(a)}catch(o){this.changing=!1,Qye.error("Error on add file item:",o)}r()}findRange(e,t){let r=this.fileItems.find(o=>li(this.getAbsolutePath(o.filepath),e)).ranges.find(o=>o.lnum==t);if(!r)throw new Error(`File range not found at lnum: ${t}`);return r}async save(){let{nvim:e}=this,t=this.document,{buffer:i}=t;await t.patchChange();let r=await this.getFileChanges();if(!r)return;r.sort((a,l)=>a.lnum-l.lnum);let o=[];for(let a=0;a<r.length;a++){let l=r[a],u=this.findRange(l.filepath,l.lnum);Fe(u.lines,l.lines)||(o.push(Object.assign({start:u.start,end:u.start+u.lines.length},l)),u.lines=l.lines)}if(o.length==0)return await k.showInformationMessage("No change."),await i.setOption("modified",!1),!1;let s={};for(let a of o){let l=A.file(a.filepath).toString(),u=s[l]||[];u.push({range:M.create(a.start,0,a.end,0),newText:a.lines.join(`
|
|||
|
`)+`
|
|||
|
`}),s[l]=u}this.changing=!0,await b.applyEdit({changes:s}),this.changing=!1;for(let a of this.fileItems){let l=A.file(this.getAbsolutePath(a.filepath)).toString(),u=s[l];u&&u.length>0&&a.ranges.forEach(c=>{c.start+=GP(V.create(c.start,0),u)})}return e.pauseNotification(),i.setOption("modified",!1,!0),this.config.saveToFile&&e.command("silent noa wa",!0),this.highlightLineNr(),await e.resumeNotification(),!0}async getLines(e,t,i){let r=A.file(e).toString(),o=b.getDocument(r);return o?o.getLines(t,i):await sa(e,t,i-1)}getAbsolutePath(e){return R.isAbsolute(e)?e:R.join(this.opts.cwd,e)}highlightLineNr(){let{fileItems:e,nvim:t,srcId:i,bufnr:r}=this,{winid:o,cwd:s}=this.opts,a={};if(i){t.call("nvim_buf_clear_namespace",[r,i,0,-1],!0);for(let l of e)for(let u of l.ranges){let c=u.start+u.lines.length,d=`${u.start+1}:${c}`;a[u.lnum]=[u.start+1,c],t.call("nvim_buf_set_virtual_text",[r,i,u.lnum-1,[[d,"LineNr"]],{}],!0)}}else{this.matchIds.size&&(t.call("coc#highlight#clear_matches",[o,Array.from(this.matchIds)],!0),this.matchIds.clear());let l=2e3;for(let u of e){let c=`${s?R.relative(s,u.filepath):u.filepath}`,d=de(c)+1;for(let h of u.ranges){let g=h.start+h.lines.length,f=`:${h.start+1}:${g}`;for(let m=0;m<f.length;m++){let y=f[m];this.matchIds.add(l),a[h.lnum]=[h.start+1,g],t.call("matchaddpos",["Conceal",[[h.lnum,d+m]],99,l,{conceal:y,window:o}],!0),l++}}}}this.buffer.setVar("line_infos",a,!0)}getDeleteRange(e){let{document:t}=this,i=e.lnum-1,r,o=t.lineCount;for(let s=i;s<o;s++){if(s+1==o){r=V.create(o,0);break}let a=t.getline(s);if(a===fo){r=V.create(s+1,0);break}if(s!=i&&a.startsWith(fo)){r=V.create(s,0);break}}return M.create(V.create(i,0),r)}getReplaceRange(e){let{document:t}=this,i=e.lnum,r,o=t.lineCount;for(let s=i;s<o;s++){let a=t.getline(s);if(s+1==o){r=V.create(s,a.length);break}if(t.getline(s+1).startsWith("\u3000")){r=V.create(s,a.length);break}}return M.create(V.create(i,0),r)}get valid(){return this.buffer.valid}get buffer(){return this.nvim.createBuffer(this.bufnr)}get document(){return b.getDocument(this.bufnr)}dispose(){this._disposed=!0,Y(this.disposables)}}});function rve(n){if(n.length<2)return;let e=n.length;if(!n[e-1].startsWith("-")&&!n[e-2].startsWith("-"))return n[e-1]}var ZK,JK,tve,ive,nve,pI,mb,UK=D(()=>{"use strict";ZK=require("child_process"),JK=require("events");ae();Ce();Sa();Oc();fs();ce();We();tve=J("handler-search"),ive=["--color","ansi","--colors","path:fg:black","--colors","line:fg:green","--colors","match:fg:red","--no-messages","--heading","-n"],nve="\x1B",pI=class extends JK.EventEmitter{start(t,i,r){this.process=(0,ZK.spawn)(t,i,{cwd:r}),this.process.on("error",d=>{this.emit("error",d.message)});let o=yo.createInterface(this.process.stdout),s,a,l=[],u=[],c=!0;o.on("line",d=>{if(d.includes(nve)){let h=Qg(d);if(h.length==0)return;if(h[0].foreground=="black"){a={filepath:R.join(r,h[0].text),ranges:[]};return}if(h[0].foreground=="green"){let f=parseInt(h[0].text,10)-1,m=h[0].text.length+1;c&&(s=f,c=!1);let y="";for(let x of h){if(x.foreground=="red"){let C=f-s,P=y.length-m;u.push(M.create(C,P,C,P+x.text.length))}y+=x.text}let w=y.slice(m);l.push(w)}}else{let h=d.trim().length==0;a&&(h||d.trim()=="--")&&a.ranges.push({lines:l,highlights:u,start:s}),h&&(this.emit("item",a),a=null),l=[],u=[],c=!0}}),o.on("close",()=>{a&&(l.length&&a.ranges.push({lines:l,highlights:u,start:s}),this.emit("item",a)),l=u=a=null,this.emit("end")})}dispose(){this.process&&this.process.kill()}},mb=class{constructor(e,t="rg"){this.nvim=e;this.cmd=t}run(e,t,i){let{nvim:r,cmd:o}=this,{afterContext:s,beforeContext:a}=i.config,l=["-A",s.toString(),"-B",a.toString()].concat(ive,e),u=rve(e);u&&l.pop(),l.push("--",u?R.isAbsolute(u)?u:`./${u.replace(/^\.\//,"")}`:"./"),this.task=new pI,this.task.start(o,l,t);let c=new Oi,d=0,h=0,g=Date.now(),f=[],m=async()=>{if(f.length==0)return;let y=f.slice();f=[];let w=await c.acquire();try{await i.addFileItems(y)}catch(x){tve.error(x)}w()};return new Promise((y,w)=>{let x=setInterval(m,300);this.task.on("item",async C=>{d++,h=h+C.ranges.reduce((P,T)=>P+T.highlights.length,0),f.push(C)}),
|
|||
|
Modifiers: ${a.join(", ")}
|
|||
|
Highlight group: ${se(s.hlGroup)}`,highlights:l}];Ud||(Ud=k.createFloatFactory({title:"Semantic token info",highlight:"Normal",borderhighlight:"MoreMsg",border:[1,1,1,1]})),await Ud.show(u,{winblend:0})}else this.closeFloat()}closeFloat(){Ud==null||Ud.close()}async fetchHighlightGroups(){let e=await this.nvim.call("coc#util#semantic_hlgroups");this.staticConfig.highlightGroups=e}async getCurrentItem(){let e=await this.nvim.buffer;return this.getItem(e.id)}getItem(e){return this.highlighters.getItem(e)}async highlightCurrent(){let e=await this.getCurrentItem();if(!e||!e.enabled)throw new Error("Unable to perform semantic highlights for current buffer.");await this.fetchHighlightGroups(),await e.forceHighlight()}async showHighlightInfo(){let e=await this.nvim.call("bufnr",["%"]);b.getAttachedDocument(e);let{nvim:t}=this,i=this.highlighters.getItem(e),r=new Ki;t.pauseNotification(),t.command(`vs +setl\\ buftype=nofile __coc_semantic_highlights_${e}__`,!0),t.command("setl bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1",!0),t.call("bufnr",["%"],!0);let o=await t.resumeNotification();r.addLine("Semantic highlights info",FS),r.addLine("");try{i.checkState();let s=i.highlights??[];r.addLine("The number of semantic tokens: "),r.addText(String(s.length),"Number"),r.addLine(""),r.addLine("Semantic highlight groups used by current buffer",FS),r.addLine("");let a=wi(s.filter(c=>c.hlGroup!=null).map(({hlGroup:c})=>c));for(let c of a)r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:c,hlGroup:c}]);r.addLine(""),r.addLine("Tokens types that current Language Server supported:",FS),r.addLine("");let l=b.getDocument(i.bufnr),u=I.getLegend(l.textDocument)??I.getLegend(l.textDocument,!0);if(u.tokenTypes.length){for(let c of[...new Set(u.tokenTypes)]){let d=Jd+cs(c);r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:d,hlGroup:d}])}r.addLine("")}else r.addLine("No token types supported","Comment"),r.addLine("");if(r.addLine("Tokens modifiers that current Language Server supported:",FS),r.addLine(""),u.tokenModifiers.length){for(let c of[...new Set(u.tokenModifiers)]){let d=Jd+cs(c);r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:d,hlGroup:d}])}r.addLine("")}else r.addLine("No token modifiers exist","Comment"),r.addLine("")}catch(s){r.addLine(xr(s))}t.pauseNotification(),r.render(t.createBuffer(o[0][2])),t.resumeNotification(!0,!0)}dispose(){this.highlighters.dispose(),Y(this.disposables)}}});var cve,Cb,tQ=D(()=>{"use strict";Re();Te();ee();Se();ce();$();pe();We();he();IS();cve=ge(100,10),Cb=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.loadConfiguration(),this.signatureFactory=k.createFloatFactory(Object.assign({preferTop:this.config.preferAbove,autoHide:!1,modes:["i","ic","s"]},this.config.floatConfig)),this.disposables.push(this.signatureFactory),b.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),_.on("CursorMovedI",mt(this.checkCurosr.bind(this),cve),null,this.disposables),_.on(["InsertLeave","BufEnter"],()=>{var i;(i=this.tokenSource)==null||i.cancel()},null,this.disposables),_.on("TextChangedI",()=>{this.config.hideOnChange&&this.signatureFactory.close()},null,this.disposables),_.on("TextInsert",async(i,r,o)=>{if(!this.config.enableTrigger)return;let s=b.getDocument(i);!s||!s.attached||!I.shouldTriggerSignatureHelp(s.textDocument,o)||await this._triggerSignatureHelp(s,{line:r.lnum-1,character:r.pre.length},!1)},null,this.disposables),k.onDidChangeActiveTextEditor(()=>{this.loadConfiguration()},null,this.disposables)}checkCurosr(e,t){let i=this.lastPosition,r=this.signatureFactory;if(!i||e!==i.bufnr||r.window==null)return;let o=b.getDocument(e);if(!o||t[0]!=i.lnum||t[1]<i.col){r.close();return}let s=o.getline(i.lnum-1);if(zt(s,i.col-1,t[1]-1).endsWith(")"))return r.close()}loadConfiguration(e){var t;if(!e||e.affectsConfiguration("signature")){let i=(t=k.activeTextEditor)==null?void 0:t.document,r=b.getConfiguration("signature",i);this.config={target:r.get("target","float"),floatConfig:r.get("floatConfig",{}),enableTrigger:r.get("enable",!0),wait:Math.max
|
|||
|
`+i.stack);else console.error("UnhandledRejection: "+i);e.error("unhandledRejection ",r,i)});let t=(wI(),Jo(vI)).default;t({reader:process.stdin,writer:process.stdout})}else{let n=q1(),e=(Ce(),Jo(B0)).logger,t=(wI(),Jo(vI)).default;module.exports={attach:t,exports:n,logger:e,loadExtension:(i,r)=>n.extensions.manager.load(i,r)}}
|
|||
|
/*!
|
|||
|
* bytes
|
|||
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|||
|
* Copyright(c) 2015 Jed Watson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
/*!
|
|||
|
* content-disposition
|
|||
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|||
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|