likec4 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/__app__/index.html +0 -1
- package/__app__/react/likec4.tsx +11 -8
- package/__app__/src/chunks/-index-overview-C9eO_hFX.js +309 -0
- package/__app__/src/chunks/-view-lazy-data-CI4xD57c.js +9 -0
- package/__app__/src/chunks/index-KI-kE60c.js +465 -0
- package/__app__/src/chunks/likec4-CusAw_j6.js +6106 -0
- package/__app__/src/chunks/main-DY2KbFcO.js +24136 -0
- package/__app__/src/chunks/mantine-B_6mKFFA.js +13671 -0
- package/__app__/src/chunks/tanstack-router-BBWuTKWO.js +2373 -0
- package/__app__/src/icons.js +6 -6
- package/__app__/src/main.js +1 -1
- package/__app__/src/style.css +1 -1
- package/__app__/webcomponent/webcomponent.js +21699 -21851
- package/dist/chunks/prompt.cjs +45 -0
- package/dist/chunks/prompt.mjs +35 -35
- package/dist/cli/index.cjs +469 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.mjs +91 -88
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +16459 -0
- package/dist/index.d.mts +546 -2526
- package/dist/index.d.ts +546 -2526
- package/dist/index.mjs +1 -1
- package/dist/model/index.cjs +1 -0
- package/dist/model/index.d.cts +258 -0
- package/dist/model/index.d.mts +258 -0
- package/dist/model/index.d.ts +258 -0
- package/dist/model/index.mjs +1 -0
- package/dist/shared/likec4.1r1CQuHw.mjs +9 -0
- package/dist/shared/likec4.CLgnaOeL.mjs +1856 -0
- package/dist/shared/likec4.CfqfZIn-.cjs +1856 -0
- package/dist/shared/likec4.D81G5JV4.cjs +9 -0
- package/dist/shared/likec4.DCwaTTuF.d.cts +1625 -0
- package/dist/shared/likec4.DCwaTTuF.d.mts +1625 -0
- package/dist/shared/likec4.DCwaTTuF.d.ts +1625 -0
- package/package.json +72 -62
- package/react/index.d.ts +150 -918
- package/react/index.js +39830 -0
- package/react/style.css +1 -1
- package/__app__/src/chunks/-index-overview-CBnvpD1d.js +0 -309
- package/__app__/src/chunks/-view-lazy-data-WZmbIsHq.js +0 -9
- package/__app__/src/chunks/index-CIsxIzOH.js +0 -465
- package/__app__/src/chunks/likec4-DslTxitT.js +0 -6109
- package/__app__/src/chunks/main-ByUdz_Be.js +0 -24285
- package/__app__/src/chunks/mantine-oFa3ZrEq.js +0 -13658
- package/__app__/src/chunks/tanstack-router-BWjXKr0n.js +0 -2373
- package/dist/shared/likec4.lgHXhASw.mjs +0 -1832
- package/react/index.mjs +0 -41515
|
@@ -0,0 +1,1856 @@
|
|
|
1
|
+
import*as C0 from"node:fs";import{writeFileSync as A0,statSync as _N,readFileSync as zm,appendFileSync as PN,createReadStream as _0,createWriteStream as P0,existsSync as xN}from"node:fs";import Hr,{sep as x0,resolve as IN,basename as NN}from"node:path";import{fileURLToPath as qm,pathToFileURL as ON}from"node:url";import{isatty as FN}from"tty";import LN,{formatWithOptions as I0,debuglog as MN,stripVTControlCharacters as BN,inspect as Wd,promisify as zN,callbackify as go,aborted as qN}from"node:util";import jN from"util";import Tr from"path";import UN from"os";import GN from"crypto";import WN from"net";import HN from"url";import yo from"fs";import N0 from"child_process";import{stat as VN}from"node:fs/promises";import ot,{cwd as KN,platform as YN,hrtime as Hd,execPath as XN,execArgv as JN}from"node:process";import*as jm from"node:tty";import O0 from"node:tty";import{n as ZN,q as QN,r as e2,t as F0,w as Vd,l as Oe,v as Sa,x as ka,u as Ce,h as Kd,B as ms,E as L0,H as t2,J as fn,K as n2,N as Ca,S as Aa,U as M0,V as r2,X as i2,Y as s2,a0 as o2,a1 as B0,a2,a3 as c2,a4 as u2,k as z0,j as Yd,a5 as q0,a6 as l2,a7 as d2,a8 as _a,a9 as j0,aa as Um,ab as Pa,ac as sr,ad as f2,ae as p2,af as U0,ag as G0,Q as h2}from"./likec4.1r1CQuHw.mjs";import{Graphviz as Gm}from"@hpcc-js/wasm-graphviz";import{Buffer as Wm}from"buffer";import{ChildProcess as W0,spawnSync as m2,spawn as g2}from"node:child_process";import{StringDecoder as H0}from"node:string_decoder";import{setTimeout as V0,scheduler as K0,setImmediate as y2}from"node:timers/promises";import{constants as gs}from"node:os";import{once as Sn,addAbortListener as Y0,EventEmitter as v2,on as Xd,setMaxListeners as w2}from"node:events";import{serialize as b2}from"node:v8";import{Transform as D2,getDefaultHighWaterMark as Jd,PassThrough as X0,Readable as ys,Writable as Hm,Duplex as Vm}from"node:stream";import{Buffer as Km}from"node:buffer";import{finished as ki}from"node:stream/promises";import{createLogger as E2}from"vite";const R2=["amber","blue","gray","slate","green","indigo","muted","primary","red","secondary","sky"];function J0(t){return t in R2}function $2(t,e){let n=Math.ceil(t),r=Math.floor(e);if(r<n)throw new RangeError(`randomInteger: The range [${t.toString()},${e.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}var Ym,Z0;function T2(){if(Z0)return Ym;Z0=1;var t=QN(),e=e2();function n(){this.clear()}return n.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},n.prototype.first=function(){return this.head?this.head.item:void 0},n.prototype.peek=n.prototype.first,n.prototype.last=function(){return this.tail?this.tail.item:void 0},n.prototype.push=function(r){var i={item:r,next:null};return this.head?(this.tail.next=i,this.tail=i):(this.head=i,this.tail=i),this.size++,this.size},n.prototype.unshift=function(r){var i={item:r,next:null};return this.head?(this.head.next||(this.tail=this.head),i.next=this.head,this.head=i):(this.head=i,this.tail=i),this.size++,this.size},n.prototype.shift=function(){if(this.size){var r=this.head;return this.head=r.next,this.size--,r.item}},n.prototype.forEach=function(r,i){if(this.size){i=arguments.length>1?i:this;for(var s=this.head,o=0;s;)r.call(i,s.item,o,this),s=s.next,o++}},n.prototype.toArray=function(){if(!this.size)return[];for(var r=new Array(this.size),i=0,s=this.size,o=this.head;i<s;i++)r[i]=o.item,o=o.next;return r},n.prototype.values=function(){var r=this.head;return new t(function(){if(!r)return{done:!0};var i=r.item;return r=r.next,{value:i,done:!1}})},n.prototype.entries=function(){var r=this.head,i=0;return new t(function(){if(!r)return{done:!0};var s=r.item;return r=r.next,i++,{value:[i-1,s],done:!1}})},typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=n.prototype.values),n.prototype.toString=function(){return this.toArray().join(",")},n.prototype.toJSON=function(){return this.toArray()},n.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:n,enumerable:!1}),r},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.from=function(r){var i=new n;return e(r,function(s){i.push(s)}),i},Ym=n,Ym}var S2=T2();const Xm=ZN(S2),k2="LIKEC4_DELAY";function Q0(...t){let e=100;return t.length===2?e=$2(t[0],t[1]):t.length===1&&(e=t[0]),new Promise(n=>{setTimeout(()=>{n(k2)},e??100)})}const C2=(t,e)=>{const n=F0(t.source,t.target),r=F0(e.source,e.target);if(n&&!r)return 1;if(!n&&r)return-1;const i=n&&r?Vd(n,r):0;if(i!==0)return i;const s=Vd(t.source,e.source);return s!==0?s:Vd(t.target,e.target)},{min:A2,max:_2}=Math,vs=(t,e=0,n=1)=>A2(_2(e,t),n),Jm=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=vs(t[e],0,255)):e===3&&(t[e]=vs(t[e],0,1));return t},eD={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])eD[`[object ${t}]`]=t.toLowerCase();function Le(t){return eD[Object.prototype.toString.call(t)]||"object"}const ke=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):Le(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),vo=t=>{if(t.length<2)return null;const e=t.length-1;return Le(t[e])=="string"?t[e].toLowerCase():null},{PI:Zd,min:tD,max:nD}=Math,Vn=t=>Math.round(t*100)/100,Zm=t=>Math.round(t*100)/100,Vr=Zd*2,Qm=Zd/3,P2=Zd/180,x2=180/Zd;function rD(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const Te={format:{},autodetect:[]};let re=class{constructor(...e){const n=this;if(Le(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=vo(e),i=!1;if(!r){i=!0,Te.sorted||(Te.autodetect=Te.autodetect.sort((s,o)=>o.p-s.p),Te.sorted=!0);for(let s of Te.autodetect)if(r=s.test(...e),r)break}if(Te.format[r]){const s=Te.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=Jm(s)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Le(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const I2="3.1.2",ze=(...t)=>new re(...t);ze.version=I2;const wo={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},N2=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,O2=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,iD=t=>{if(t.match(N2)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const e=parseInt(t,16),n=e>>16,r=e>>8&255,i=e&255;return[n,r,i,1]}if(t.match(O2)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=parseInt(t,16),n=e>>24&255,r=e>>16&255,i=e>>8&255,s=Math.round((e&255)/255*100)/100;return[n,r,i,s]}throw new Error(`unknown hex color: ${t}`)},{round:Qd}=Math,sD=(...t)=>{let[e,n,r,i]=ke(t,"rgba"),s=vo(t)||"auto";i===void 0&&(i=1),s==="auto"&&(s=i<1?"rgba":"rgb"),e=Qd(e),n=Qd(n),r=Qd(r);let o="000000"+(e<<16|n<<8|r).toString(16);o=o.substr(o.length-6);let a="0"+Qd(i*255).toString(16);switch(a=a.substr(a.length-2),s.toLowerCase()){case"rgba":return`#${o}${a}`;case"argb":return`#${a}${o}`;default:return`#${o}`}};re.prototype.name=function(){const t=sD(this._rgb,"rgb");for(let e of Object.keys(wo))if(wo[e]===t)return e.toLowerCase();return t},Te.format.named=t=>{if(t=t.toLowerCase(),wo[t])return iD(wo[t]);throw new Error("unknown color name: "+t)},Te.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Le(t)==="string"&&wo[t.toLowerCase()])return"named"}}),re.prototype.alpha=function(t,e=!1){return t!==void 0&&Le(t)==="number"?e?(this._rgb[3]=t,this):new re([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},re.prototype.clipped=function(){return this._rgb._clipped||!1};const Sr={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},F2=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Kr(t){const e=F2.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);Sr.labWhitePoint=t,Sr.Xn=e[0],Sr.Zn=e[1]}function xa(){return Sr.labWhitePoint}const eg=(...t)=>{t=ke(t,"lab");const[e,n,r]=t,[i,s,o]=L2(e,n,r),[a,c,u]=oD(i,s,o);return[a,c,u,t.length>3?t[3]:1]},L2=(t,e,n)=>{const{kE:r,kK:i,kKE:s,Xn:o,Yn:a,Zn:c}=Sr,u=(t+16)/116,l=.002*e+u,d=u-.005*n,f=l*l*l,p=d*d*d,h=f>r?f:(116*l-16)/i,v=t>s?Math.pow((t+16)/116,3):t/i,b=p>r?p:(116*d-16)/i,g=h*o,w=v*a,R=b*c;return[g,w,R]},tg=t=>{const e=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*e},oD=(t,e,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:s,RefWhiteRGB:o,Xn:a,Yn:c,Zn:u}=Sr,l=a*r.m00+c*r.m10+u*r.m20,d=a*r.m01+c*r.m11+u*r.m21,f=a*r.m02+c*r.m12+u*r.m22,p=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,h=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,v=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,b=(t*r.m00+e*r.m10+n*r.m20)*(p/l),g=(t*r.m01+e*r.m11+n*r.m21)*(h/d),w=(t*r.m02+e*r.m12+n*r.m22)*(v/f),R=b*i.m00+g*i.m10+w*i.m20,k=b*i.m01+g*i.m11+w*i.m21,A=b*i.m02+g*i.m12+w*i.m22,N=tg(R*s.m00+k*s.m10+A*s.m20),_=tg(R*s.m01+k*s.m11+A*s.m21),B=tg(R*s.m02+k*s.m12+A*s.m22);return[N*255,_*255,B*255]},ng=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),[s,o,a]=aD(e,n,r),[c,u,l]=M2(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function M2(t,e,n){const{Xn:r,Yn:i,Zn:s,kE:o,kK:a}=Sr,c=t/r,u=e/i,l=n/s,d=c>o?Math.pow(c,1/3):(a*c+16)/116,f=u>o?Math.pow(u,1/3):(a*u+16)/116,p=l>o?Math.pow(l,1/3):(a*l+16)/116;return[116*f-16,500*(d-f),200*(f-p)]}function rg(t){const e=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*e}const aD=(t,e,n)=>{t=rg(t/255),e=rg(e/255),n=rg(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:s,Xn:o,Yn:a,Zn:c,As:u,Bs:l,Cs:d}=Sr;let f=t*r.m00+e*r.m10+n*r.m20,p=t*r.m01+e*r.m11+n*r.m21,h=t*r.m02+e*r.m12+n*r.m22;const v=o*i.m00+a*i.m10+c*i.m20,b=o*i.m01+a*i.m11+c*i.m21,g=o*i.m02+a*i.m12+c*i.m22;let w=f*i.m00+p*i.m10+h*i.m20,R=f*i.m01+p*i.m11+h*i.m21,k=f*i.m02+p*i.m12+h*i.m22;return w*=v/u,R*=b/l,k*=g/d,f=w*s.m00+R*s.m10+k*s.m20,p=w*s.m01+R*s.m11+k*s.m21,h=w*s.m02+R*s.m12+k*s.m22,[f,p,h]};re.prototype.lab=function(){return ng(this._rgb)};const B2=(...t)=>new re(...t,"lab");Object.assign(ze,{lab:B2,getLabWhitePoint:xa,setLabWhitePoint:Kr}),Te.format.lab=eg,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"lab"),Le(t)==="array"&&t.length===3)return"lab"}}),re.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=Sr.Kn*t,new re(n,"lab").alpha(e.alpha(),!0)},re.prototype.brighten=function(t=1){return this.darken(-t)},re.prototype.darker=re.prototype.darken,re.prototype.brighter=re.prototype.brighten,re.prototype.get=function(t){const[e,n]=t.split("."),r=this[e]();if(n){const i=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(i>-1)return r[i];throw new Error(`unknown channel ${n} in mode ${e}`)}else return r};const{pow:z2}=Math,q2=1e-7,j2=20;re.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Le(t)==="number"){if(t===0)return new re([0,0,0,this._rgb[3]],"rgb");if(t===1)return new re([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=j2;const i=(o,a)=>{const c=o.interpolate(a,.5,e),u=c.luminance();return Math.abs(t-u)<q2||!r--?c:u>t?i(o,c):i(c,a)},s=(n>t?i(new re([0,0,0]),this):i(this,new re([255,255,255]))).rgb();return new re([...s,this._rgb[3]])}return U2(...this._rgb.slice(0,3))};const U2=(t,e,n)=>(t=ig(t),e=ig(e),n=ig(n),.2126*t+.7152*e+.0722*n),ig=t=>(t/=255,t<=.03928?t/12.92:z2((t+.055)/1.055,2.4)),tn={},bo=(t,e,n=.5,...r)=>{let i=r[0]||"lrgb";if(!tn[i]&&!r.length&&(i=Object.keys(tn)[0]),!tn[i])throw new Error(`interpolation mode ${i} is not defined`);return Le(t)!=="object"&&(t=new re(t)),Le(e)!=="object"&&(e=new re(e)),tn[i](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};re.prototype.mix=re.prototype.interpolate=function(t,e=.5,...n){return bo(this,t,e,...n)},re.prototype.premultiply=function(t=!1){const e=this._rgb,n=e[3];return t?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new re([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:G2,cos:W2}=Math,cD=(...t)=>{let[e,n,r]=ke(t,"lch");return isNaN(r)&&(r=0),r=r*P2,[e,W2(r)*n,G2(r)*n]},sg=(...t)=>{t=ke(t,"lch");const[e,n,r]=t,[i,s,o]=cD(e,n,r),[a,c,u]=eg(i,s,o);return[a,c,u,t.length>3?t[3]:1]},H2=(...t)=>{const e=rD(ke(t,"hcl"));return sg(...e)},{sqrt:V2,atan2:K2,round:Y2}=Math,uD=(...t)=>{const[e,n,r]=ke(t,"lab"),i=V2(n*n+r*r);let s=(K2(r,n)*x2+360)%360;return Y2(i*1e4)===0&&(s=Number.NaN),[e,i,s]},og=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),[s,o,a]=ng(e,n,r),[c,u,l]=uD(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};re.prototype.lch=function(){return og(this._rgb)},re.prototype.hcl=function(){return rD(og(this._rgb))};const X2=(...t)=>new re(...t,"lch"),J2=(...t)=>new re(...t,"hcl");Object.assign(ze,{lch:X2,hcl:J2}),Te.format.lch=sg,Te.format.hcl=H2,["lch","hcl"].forEach(t=>Te.autodetect.push({p:2,test:(...e)=>{if(e=ke(e,t),Le(e)==="array"&&e.length===3)return t}})),re.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=Sr.Kn*t,n[1]<0&&(n[1]=0),new re(n,"lch").alpha(e.alpha(),!0)},re.prototype.desaturate=function(t=1){return this.saturate(-t)},re.prototype.set=function(t,e,n=!1){const[r,i]=t.split("."),s=this[r]();if(i){const o=r.indexOf(i)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if(Le(e)=="string")switch(e.charAt(0)){case"+":s[o]+=+e;break;case"-":s[o]+=+e;break;case"*":s[o]*=+e.substr(1);break;case"/":s[o]/=+e.substr(1);break;default:s[o]=+e}else if(Le(e)==="number")s[o]=e;else throw new Error("unsupported value for Color.set");const a=new re(s,r);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${i} in mode ${r}`)}else return s},re.prototype.tint=function(t=.5,...e){return bo(this,"white",t,...e)},re.prototype.shade=function(t=.5,...e){return bo(this,"black",t,...e)};const Z2=(t,e,n)=>{const r=t._rgb,i=e._rgb;return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};tn.rgb=Z2;const{sqrt:ag,pow:Do}=Math,Q2=(t,e,n)=>{const[r,i,s]=t._rgb,[o,a,c]=e._rgb;return new re(ag(Do(r,2)*(1-n)+Do(o,2)*n),ag(Do(i,2)*(1-n)+Do(a,2)*n),ag(Do(s,2)*(1-n)+Do(c,2)*n),"rgb")};tn.lrgb=Q2;const eO=(t,e,n)=>{const r=t.lab(),i=e.lab();return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};tn.lab=eO;const Eo=(t,e,n,r)=>{let i,s;r==="hsl"?(i=t.hsl(),s=e.hsl()):r==="hsv"?(i=t.hsv(),s=e.hsv()):r==="hcg"?(i=t.hcg(),s=e.hcg()):r==="hsi"?(i=t.hsi(),s=e.hsi()):r==="lch"||r==="hcl"?(r="hcl",i=t.hcl(),s=e.hcl()):r==="oklch"&&(i=t.oklch().reverse(),s=e.oklch().reverse());let o,a,c,u,l,d;(r.substr(0,1)==="h"||r==="oklch")&&([o,c,l]=i,[a,u,d]=s);let f,p,h,v;return!isNaN(o)&&!isNaN(a)?(a>o&&a-o>180?v=a-(o+360):a<o&&o-a>180?v=a+360-o:v=a-o,p=o+n*v):isNaN(o)?isNaN(a)?p=Number.NaN:(p=a,(l==1||l==0)&&r!="hsv"&&(f=u)):(p=o,(d==1||d==0)&&r!="hsv"&&(f=c)),f===void 0&&(f=c+n*(u-c)),h=l+n*(d-l),r==="oklch"?new re([h,f,p],r):new re([p,f,h],r)},lD=(t,e,n)=>Eo(t,e,n,"lch");tn.lch=lD,tn.hcl=lD;const tO=t=>{if(Le(t)=="number"&&t>=0&&t<=16777215){const e=t>>16,n=t>>8&255,r=t&255;return[e,n,r,1]}throw new Error("unknown num color: "+t)},nO=(...t)=>{const[e,n,r]=ke(t,"rgb");return(e<<16)+(n<<8)+r};re.prototype.num=function(){return nO(this._rgb)};const rO=(...t)=>new re(...t,"num");Object.assign(ze,{num:rO}),Te.format.num=tO,Te.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Le(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const iO=(t,e,n)=>{const r=t.num(),i=e.num();return new re(r+n*(i-r),"num")};tn.num=iO;const{floor:sO}=Math,oO=(...t)=>{t=ke(t,"hcg");let[e,n,r]=t,i,s,o;r=r*255;const a=n*255;if(n===0)i=s=o=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const c=sO(e),u=e-c,l=r*(1-n),d=l+a*(1-u),f=l+a*u,p=l+a;switch(c){case 0:[i,s,o]=[p,f,l];break;case 1:[i,s,o]=[d,p,l];break;case 2:[i,s,o]=[l,p,f];break;case 3:[i,s,o]=[l,d,p];break;case 4:[i,s,o]=[f,l,p];break;case 5:[i,s,o]=[p,l,d];break}}return[i,s,o,t.length>3?t[3]:1]},aO=(...t)=>{const[e,n,r]=ke(t,"rgb"),i=tD(e,n,r),s=nD(e,n,r),o=s-i,a=o*100/255,c=i/(255-o)*100;let u;return o===0?u=Number.NaN:(e===s&&(u=(n-r)/o),n===s&&(u=2+(r-e)/o),r===s&&(u=4+(e-n)/o),u*=60,u<0&&(u+=360)),[u,a,c]};re.prototype.hcg=function(){return aO(this._rgb)};const cO=(...t)=>new re(...t,"hcg");ze.hcg=cO,Te.format.hcg=oO,Te.autodetect.push({p:1,test:(...t)=>{if(t=ke(t,"hcg"),Le(t)==="array"&&t.length===3)return"hcg"}});const uO=(t,e,n)=>Eo(t,e,n,"hcg");tn.hcg=uO;const{cos:Ro}=Math,lO=(...t)=>{t=ke(t,"hsi");let[e,n,r]=t,i,s,o;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(o=(1-n)/3,i=(1+n*Ro(Vr*e)/Ro(Qm-Vr*e))/3,s=1-(o+i)):e<2/3?(e-=1/3,i=(1-n)/3,s=(1+n*Ro(Vr*e)/Ro(Qm-Vr*e))/3,o=1-(i+s)):(e-=2/3,s=(1-n)/3,o=(1+n*Ro(Vr*e)/Ro(Qm-Vr*e))/3,i=1-(s+o)),i=vs(r*i*3),s=vs(r*s*3),o=vs(r*o*3),[i*255,s*255,o*255,t.length>3?t[3]:1]},{min:dO,sqrt:fO,acos:pO}=Math,hO=(...t)=>{let[e,n,r]=ke(t,"rgb");e/=255,n/=255,r/=255;let i;const s=dO(e,n,r),o=(e+n+r)/3,a=o>0?1-s/o:0;return a===0?i=NaN:(i=(e-n+(e-r))/2,i/=fO((e-n)*(e-n)+(e-r)*(n-r)),i=pO(i),r>n&&(i=Vr-i),i/=Vr),[i*360,a,o]};re.prototype.hsi=function(){return hO(this._rgb)};const mO=(...t)=>new re(...t,"hsi");ze.hsi=mO,Te.format.hsi=lO,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"hsi"),Le(t)==="array"&&t.length===3)return"hsi"}});const gO=(t,e,n)=>Eo(t,e,n,"hsi");tn.hsi=gO;const cg=(...t)=>{t=ke(t,"hsl");const[e,n,r]=t;let i,s,o;if(n===0)i=s=o=r*255;else{const a=[0,0,0],c=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,l=2*r-u,d=e/360;a[0]=d+1/3,a[1]=d,a[2]=d-1/3;for(let f=0;f<3;f++)a[f]<0&&(a[f]+=1),a[f]>1&&(a[f]-=1),6*a[f]<1?c[f]=l+(u-l)*6*a[f]:2*a[f]<1?c[f]=u:3*a[f]<2?c[f]=l+(u-l)*(2/3-a[f])*6:c[f]=l;[i,s,o]=[c[0]*255,c[1]*255,c[2]*255]}return t.length>3?[i,s,o,t[3]]:[i,s,o,1]},dD=(...t)=>{t=ke(t,"rgba");let[e,n,r]=t;e/=255,n/=255,r/=255;const i=tD(e,n,r),s=nD(e,n,r),o=(s+i)/2;let a,c;return s===i?(a=0,c=Number.NaN):a=o<.5?(s-i)/(s+i):(s-i)/(2-s-i),e==s?c=(n-r)/(s-i):n==s?c=2+(r-e)/(s-i):r==s&&(c=4+(e-n)/(s-i)),c*=60,c<0&&(c+=360),t.length>3&&t[3]!==void 0?[c,a,o,t[3]]:[c,a,o]};re.prototype.hsl=function(){return dD(this._rgb)};const yO=(...t)=>new re(...t,"hsl");ze.hsl=yO,Te.format.hsl=cg,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"hsl"),Le(t)==="array"&&t.length===3)return"hsl"}});const vO=(t,e,n)=>Eo(t,e,n,"hsl");tn.hsl=vO;const{floor:wO}=Math,bO=(...t)=>{t=ke(t,"hsv");let[e,n,r]=t,i,s,o;if(r*=255,n===0)i=s=o=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const a=wO(e),c=e-a,u=r*(1-n),l=r*(1-n*c),d=r*(1-n*(1-c));switch(a){case 0:[i,s,o]=[r,d,u];break;case 1:[i,s,o]=[l,r,u];break;case 2:[i,s,o]=[u,r,d];break;case 3:[i,s,o]=[u,l,r];break;case 4:[i,s,o]=[d,u,r];break;case 5:[i,s,o]=[r,u,l];break}}return[i,s,o,t.length>3?t[3]:1]},{min:DO,max:EO}=Math,RO=(...t)=>{t=ke(t,"rgb");let[e,n,r]=t;const i=DO(e,n,r),s=EO(e,n,r),o=s-i;let a,c,u;return u=s/255,s===0?(a=Number.NaN,c=0):(c=o/s,e===s&&(a=(n-r)/o),n===s&&(a=2+(r-e)/o),r===s&&(a=4+(e-n)/o),a*=60,a<0&&(a+=360)),[a,c,u]};re.prototype.hsv=function(){return RO(this._rgb)};const $O=(...t)=>new re(...t,"hsv");ze.hsv=$O,Te.format.hsv=bO,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"hsv"),Le(t)==="array"&&t.length===3)return"hsv"}});const TO=(t,e,n)=>Eo(t,e,n,"hsv");tn.hsv=TO;function ef(t,e){let n=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(o=>[o]));let r=e[0].length,i=e[0].map((o,a)=>e.map(c=>c[a])),s=t.map(o=>i.map(a=>Array.isArray(o)?o.reduce((c,u,l)=>c+u*(a[l]||0),0):a.reduce((c,u)=>c+u*o,0)));return n===1&&(s=s[0]),r===1?s.map(o=>o[0]):s}const ug=(...t)=>{t=ke(t,"lab");const[e,n,r,...i]=t,[s,o,a]=SO([e,n,r]),[c,u,l]=oD(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function SO(t){var e=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=ef(n,t);return ef(e,r.map(i=>i**3))}const lg=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),s=aD(e,n,r);return[...kO(s),...i.length>0&&i[0]<1?[i[0]]:[]]};function kO(t){const e=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=ef(e,t);return ef(n,r.map(i=>Math.cbrt(i)))}re.prototype.oklab=function(){return lg(this._rgb)};const CO=(...t)=>new re(...t,"oklab");Object.assign(ze,{oklab:CO}),Te.format.oklab=ug,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"oklab"),Le(t)==="array"&&t.length===3)return"oklab"}});const AO=(t,e,n)=>{const r=t.oklab(),i=e.oklab();return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"oklab")};tn.oklab=AO;const _O=(t,e,n)=>Eo(t,e,n,"oklch");tn.oklch=_O;const{pow:dg,sqrt:fg,PI:pg,cos:fD,sin:pD,atan2:PO}=Math,xO=(t,e="lrgb",n=null)=>{const r=t.length;n||(n=Array.from(new Array(r)).map(()=>1));const i=r/n.reduce(function(d,f){return d+f});if(n.forEach((d,f)=>{n[f]*=i}),t=t.map(d=>new re(d)),e==="lrgb")return IO(t,n);const s=t.shift(),o=s.get(e),a=[];let c=0,u=0;for(let d=0;d<o.length;d++)if(o[d]=(o[d]||0)*n[0],a.push(isNaN(o[d])?0:n[0]),e.charAt(d)==="h"&&!isNaN(o[d])){const f=o[d]/180*pg;c+=fD(f)*n[0],u+=pD(f)*n[0]}let l=s.alpha()*n[0];t.forEach((d,f)=>{const p=d.get(e);l+=d.alpha()*n[f+1];for(let h=0;h<o.length;h++)if(!isNaN(p[h]))if(a[h]+=n[f+1],e.charAt(h)==="h"){const v=p[h]/180*pg;c+=fD(v)*n[f+1],u+=pD(v)*n[f+1]}else o[h]+=p[h]*n[f+1]});for(let d=0;d<o.length;d++)if(e.charAt(d)==="h"){let f=PO(u/a[d],c/a[d])/pg*180;for(;f<0;)f+=360;for(;f>=360;)f-=360;o[d]=f}else o[d]=o[d]/a[d];return l/=r,new re(o,e).alpha(l>.99999?1:l,!0)},IO=(t,e)=>{const n=t.length,r=[0,0,0,0];for(let i=0;i<t.length;i++){const s=t[i],o=e[i]/n,a=s._rgb;r[0]+=dg(a[0],2)*o,r[1]+=dg(a[1],2)*o,r[2]+=dg(a[2],2)*o,r[3]+=a[3]*o}return r[0]=fg(r[0]),r[1]=fg(r[1]),r[2]=fg(r[2]),r[3]>.9999999&&(r[3]=1),new re(Jm(r))},{pow:NO}=Math;function tf(t){let e="rgb",n=ze("#ccc"),r=0,i=[0,1],s=[],o=[0,0],a=!1,c=[],u=!1,l=0,d=1,f=!1,p={},h=!0,v=1;const b=function(_){if(_=_||["#fff","#000"],_&&Le(_)==="string"&&ze.brewer&&ze.brewer[_.toLowerCase()]&&(_=ze.brewer[_.toLowerCase()]),Le(_)==="array"){_.length===1&&(_=[_[0],_[0]]),_=_.slice(0);for(let B=0;B<_.length;B++)_[B]=ze(_[B]);s.length=0;for(let B=0;B<_.length;B++)s.push(B/(_.length-1))}return A(),c=_},g=function(_){if(a!=null){const B=a.length-1;let z=0;for(;z<B&&_>=a[z];)z++;return z-1}return 0};let w=_=>_,R=_=>_;const k=function(_,B){let z,Q;if(B==null&&(B=!1),isNaN(_)||_===null)return n;B?Q=_:a&&a.length>2?Q=g(_)/(a.length-2):d!==l?Q=(_-l)/(d-l):Q=1,Q=R(Q),B||(Q=w(Q)),v!==1&&(Q=NO(Q,v)),Q=o[0]+Q*(1-o[0]-o[1]),Q=vs(Q,0,1);const I=Math.floor(Q*1e4);if(h&&p[I])z=p[I];else{if(Le(c)==="array")for(let T=0;T<s.length;T++){const $=s[T];if(Q<=$){z=c[T];break}if(Q>=$&&T===s.length-1){z=c[T];break}if(Q>$&&Q<s[T+1]){Q=(Q-$)/(s[T+1]-$),z=ze.interpolate(c[T],c[T+1],Q,e);break}}else Le(c)==="function"&&(z=c(Q));h&&(p[I]=z)}return z};var A=()=>p={};b(t);const N=function(_){const B=ze(k(_));return u&&B[u]?B[u]():B};return N.classes=function(_){if(_!=null){if(Le(_)==="array")a=_,i=[_[0],_[_.length-1]];else{const B=ze.analyze(i);_===0?a=[B.min,B.max]:a=ze.limits(B,"e",_)}return N}return a},N.domain=function(_){if(!arguments.length)return i;l=_[0],d=_[_.length-1],s=[];const B=c.length;if(_.length===B&&l!==d)for(let z of Array.from(_))s.push((z-l)/(d-l));else{for(let z=0;z<B;z++)s.push(z/(B-1));if(_.length>2){const z=_.map((I,T)=>T/(_.length-1)),Q=_.map(I=>(I-l)/(d-l));Q.every((I,T)=>z[T]===I)||(R=I=>{if(I<=0||I>=1)return I;let T=0;for(;I>=Q[T+1];)T++;const $=(I-Q[T])/(Q[T+1]-Q[T]);return z[T]+$*(z[T+1]-z[T])})}}return i=[l,d],N},N.mode=function(_){return arguments.length?(e=_,A(),N):e},N.range=function(_,B){return b(_),N},N.out=function(_){return u=_,N},N.spread=function(_){return arguments.length?(r=_,N):r},N.correctLightness=function(_){return _==null&&(_=!0),f=_,A(),f?w=function(B){const z=k(0,!0).lab()[0],Q=k(1,!0).lab()[0],I=z>Q;let T=k(B,!0).lab()[0];const $=z+(Q-z)*B;let L=T-$,V=0,H=1,K=20;for(;Math.abs(L)>.01&&K-- >0;)(function(){return I&&(L*=-1),L<0?(V=B,B+=(H-B)*.5):(H=B,B+=(V-B)*.5),T=k(B,!0).lab()[0],L=T-$})();return B}:w=B=>B,N},N.padding=function(_){return _!=null?(Le(_)==="number"&&(_=[_,_]),o=_,N):o},N.colors=function(_,B){arguments.length<2&&(B="hex");let z=[];if(arguments.length===0)z=c.slice(0);else if(_===1)z=[N(.5)];else if(_>1){const Q=i[0],I=i[1]-Q;z=OO(0,_).map(T=>N(Q+T/(_-1)*I))}else{t=[];let Q=[];if(a&&a.length>2)for(let I=1,T=a.length,$=1<=T;$?I<T:I>T;$?I++:I--)Q.push((a[I-1]+a[I])*.5);else Q=i;z=Q.map(I=>N(I))}return ze[B]&&(z=z.map(Q=>Q[B]())),z},N.cache=function(_){return _!=null?(h=_,N):h},N.gamma=function(_){return _!=null?(v=_,N):v},N.nodata=function(_){return _!=null?(n=ze(_),N):n},N}function OO(t,e,n){let r=[],i=t<e,s=e;for(let o=t;i?o<s:o>s;i?o++:o--)r.push(o);return r}const FO=function(t){let e=[1,1];for(let n=1;n<t;n++){let r=[1];for(let i=1;i<=e.length;i++)r[i]=(e[i]||0)+e[i-1];e=r}return e},LO=function(t){let e,n,r,i;if(t=t.map(s=>new re(s)),t.length===2)[n,r]=t.map(s=>s.lab()),e=function(s){const o=[0,1,2].map(a=>n[a]+s*(r[a]-n[a]));return new re(o,"lab")};else if(t.length===3)[n,r,i]=t.map(s=>s.lab()),e=function(s){const o=[0,1,2].map(a=>(1-s)*(1-s)*n[a]+2*(1-s)*s*r[a]+s*s*i[a]);return new re(o,"lab")};else if(t.length===4){let s;[n,r,i,s]=t.map(o=>o.lab()),e=function(o){const a=[0,1,2].map(c=>(1-o)*(1-o)*(1-o)*n[c]+3*(1-o)*(1-o)*o*r[c]+3*(1-o)*o*o*i[c]+o*o*o*s[c]);return new re(a,"lab")}}else if(t.length>=5){let s,o,a;s=t.map(c=>c.lab()),a=t.length-1,o=FO(a),e=function(c){const u=1-c,l=[0,1,2].map(d=>s.reduce((f,p,h)=>f+o[h]*u**(a-h)*c**h*p[d],0));return new re(l,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},MO=t=>{const e=LO(t);return e.scale=()=>tf(e),e},{round:hD}=Math;re.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(hD)},re.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:hD(e):e)};const BO=(...t)=>new re(...t,"rgb");Object.assign(ze,{rgb:BO}),Te.format.rgb=(...t)=>{const e=ke(t,"rgba");return e[3]===void 0&&(e[3]=1),e},Te.autodetect.push({p:3,test:(...t)=>{if(t=ke(t,"rgba"),Le(t)==="array"&&(t.length===3||t.length===4&&Le(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const or=(t,e,n)=>{if(!or[n])throw new Error("unknown blend mode "+n);return or[n](t,e)},Ci=t=>(e,n)=>{const r=ze(n).rgb(),i=ze(e).rgb();return ze.rgb(t(r,i))},Ai=t=>(e,n)=>{const r=[];return r[0]=t(e[0],n[0]),r[1]=t(e[1],n[1]),r[2]=t(e[2],n[2]),r},zO=t=>t,qO=(t,e)=>t*e/255,jO=(t,e)=>t>e?e:t,UO=(t,e)=>t>e?t:e,GO=(t,e)=>255*(1-(1-t/255)*(1-e/255)),WO=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),HO=(t,e)=>255*(1-(1-e/255)/(t/255)),VO=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);or.normal=Ci(Ai(zO)),or.multiply=Ci(Ai(qO)),or.screen=Ci(Ai(GO)),or.overlay=Ci(Ai(WO)),or.darken=Ci(Ai(jO)),or.lighten=Ci(Ai(UO)),or.dodge=Ci(Ai(VO)),or.burn=Ci(Ai(HO));const{pow:KO,sin:YO,cos:XO}=Math;function JO(t=300,e=-1.5,n=1,r=1,i=[0,1]){let s=0,o;Le(i)==="array"?o=i[1]-i[0]:(o=0,i=[i,i]);const a=function(c){const u=Vr*((t+120)/360+e*c),l=KO(i[0]+o*c,r),d=(s!==0?n[0]+c*s:n)*l*(1-l)/2,f=XO(u),p=YO(u),h=l+d*(-.14861*f+1.78277*p),v=l+d*(-.29227*f-.90649*p),b=l+d*(1.97294*f);return ze(Jm([h*255,v*255,b*255,1]))};return a.start=function(c){return c==null?t:(t=c,a)},a.rotations=function(c){return c==null?e:(e=c,a)},a.gamma=function(c){return c==null?r:(r=c,a)},a.hue=function(c){return c==null?n:(n=c,Le(n)==="array"?(s=n[1]-n[0],s===0&&(n=n[1])):s=0,a)},a.lightness=function(c){return c==null?i:(Le(c)==="array"?(i=c,o=c[1]-c[0]):(i=[c,c],o=0),a)},a.scale=()=>ze.scale(a),a.hue(n),a}const ZO="0123456789abcdef",{floor:QO,random:eF}=Math,tF=()=>{let t="#";for(let e=0;e<6;e++)t+=ZO.charAt(QO(eF()*16));return new re(t,"hex")},{log:mD,pow:nF,floor:rF,abs:iF}=Math;function gD(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Le(t)==="object"&&(t=Object.values(t)),t.forEach(r=>{e&&Le(r)==="object"&&(r=r[e]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,i)=>yD(n,r,i),n}function yD(t,e="equal",n=7){Le(t)=="array"&&(t=gD(t));const{min:r,max:i}=t,s=t.values.sort((a,c)=>a-c);if(n===1)return[r,i];const o=[];if(e.substr(0,1)==="c"&&(o.push(r),o.push(i)),e.substr(0,1)==="e"){o.push(r);for(let a=1;a<n;a++)o.push(r+a/n*(i-r));o.push(i)}else if(e.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const a=Math.LOG10E*mD(r),c=Math.LOG10E*mD(i);o.push(r);for(let u=1;u<n;u++)o.push(nF(10,a+u/n*(c-a)));o.push(i)}else if(e.substr(0,1)==="q"){o.push(r);for(let a=1;a<n;a++){const c=(s.length-1)*a/n,u=rF(c);if(u===c)o.push(s[u]);else{const l=c-u;o.push(s[u]*(1-l)+s[u+1]*l)}}o.push(i)}else if(e.substr(0,1)==="k"){let a;const c=s.length,u=new Array(c),l=new Array(n);let d=!0,f=0,p=null;p=[],p.push(r);for(let b=1;b<n;b++)p.push(r+b/n*(i-r));for(p.push(i);d;){for(let g=0;g<n;g++)l[g]=0;for(let g=0;g<c;g++){const w=s[g];let R=Number.MAX_VALUE,k;for(let A=0;A<n;A++){const N=iF(p[A]-w);N<R&&(R=N,k=A),l[k]++,u[g]=k}}const b=new Array(n);for(let g=0;g<n;g++)b[g]=null;for(let g=0;g<c;g++)a=u[g],b[a]===null?b[a]=s[g]:b[a]+=s[g];for(let g=0;g<n;g++)b[g]*=1/l[g];d=!1;for(let g=0;g<n;g++)if(b[g]!==p[g]){d=!0;break}p=b,f++,f>200&&(d=!1)}const h={};for(let b=0;b<n;b++)h[b]=[];for(let b=0;b<c;b++)a=u[b],h[a].push(s[b]);let v=[];for(let b=0;b<n;b++)v.push(h[b][0]),v.push(h[b][h[b].length-1]);v=v.sort((b,g)=>b-g),o.push(v[0]);for(let b=1;b<v.length;b+=2){const g=v[b];!isNaN(g)&&o.indexOf(g)===-1&&o.push(g)}}return o}const sF=(t,e)=>{t=new re(t),e=new re(e);const n=t.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},vD=.027,oF=5e-4,aF=.1,wD=1.14,nf=.022,bD=1.414,cF=(t,e)=>{t=new re(t),e=new re(e),t.alpha()<1&&(t=bo(e,t,t.alpha(),"rgb"));const n=DD(...t.rgb()),r=DD(...e.rgb()),i=n>=nf?n:n+Math.pow(nf-n,bD),s=r>=nf?r:r+Math.pow(nf-r,bD),o=Math.pow(s,.56)-Math.pow(i,.57),a=Math.pow(s,.65)-Math.pow(i,.62),c=Math.abs(s-i)<oF?0:i<s?o*wD:a*wD;return(Math.abs(c)<aF?0:c>0?c-vD:c+vD)*100};function DD(t,e,n){return .2126729*Math.pow(t/255,2.4)+.7151522*Math.pow(e/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:Yr,pow:It,min:uF,max:lF,atan2:ED,abs:RD,cos:rf,sin:$D,exp:dF,PI:TD}=Math;function fF(t,e,n=1,r=1,i=1){var s=function(Ye){return 360*Ye/(2*TD)},o=function(Ye){return 2*TD*Ye/360};t=new re(t),e=new re(e);const[a,c,u]=Array.from(t.lab()),[l,d,f]=Array.from(e.lab()),p=(a+l)/2,h=Yr(It(c,2)+It(u,2)),v=Yr(It(d,2)+It(f,2)),b=(h+v)/2,g=.5*(1-Yr(It(b,7)/(It(b,7)+It(25,7)))),w=c*(1+g),R=d*(1+g),k=Yr(It(w,2)+It(u,2)),A=Yr(It(R,2)+It(f,2)),N=(k+A)/2,_=s(ED(u,w)),B=s(ED(f,R)),z=_>=0?_:_+360,Q=B>=0?B:B+360,I=RD(z-Q)>180?(z+Q+360)/2:(z+Q)/2,T=1-.17*rf(o(I-30))+.24*rf(o(2*I))+.32*rf(o(3*I+6))-.2*rf(o(4*I-63));let $=Q-z;$=RD($)<=180?$:Q<=z?$+360:$-360,$=2*Yr(k*A)*$D(o($)/2);const L=l-a,V=A-k,H=1+.015*It(p-50,2)/Yr(20+It(p-50,2)),K=1+.045*N,we=1+.015*N*T,te=30*dF(-It((I-275)/25,2)),C=-(2*Yr(It(N,7)/(It(N,7)+It(25,7))))*$D(2*o(te)),he=Yr(It(L/(n*H),2)+It(V/(r*K),2)+It($/(i*we),2)+C*(V/(r*K))*($/(i*we)));return lF(0,uF(100,he))}function pF(t,e,n="lab"){t=new re(t),e=new re(e);const r=t.get(n),i=e.get(n);let s=0;for(let o in r){const a=(r[o]||0)-(i[o]||0);s+=a*a}return Math.sqrt(s)}const hF=(...t)=>{try{return new re(...t),!0}catch{return!1}},mF={cool(){return tf([ze.hsl(180,1,.9),ze.hsl(250,.7,.4)])},hot(){return tf(["#000","#f00","#ff0","#fff"]).mode("rgb")}},hg={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},SD=Object.keys(hg),kD=new Map(SD.map(t=>[t.toLowerCase(),t])),gF=typeof Proxy=="function"?new Proxy(hg,{get(t,e){const n=e.toLowerCase();if(kD.has(n))return t[kD.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(SD)}}):hg,yF=(...t)=>{t=ke(t,"cmyk");const[e,n,r,i]=t,s=t.length>4?t[4]:1;return i===1?[0,0,0,s]:[e>=1?0:255*(1-e)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),s]},{max:CD}=Math,vF=(...t)=>{let[e,n,r]=ke(t,"rgb");e=e/255,n=n/255,r=r/255;const i=1-CD(e,CD(n,r)),s=i<1?1/(1-i):0,o=(1-e-i)*s,a=(1-n-i)*s,c=(1-r-i)*s;return[o,a,c,i]};re.prototype.cmyk=function(){return vF(this._rgb)};const wF=(...t)=>new re(...t,"cmyk");Object.assign(ze,{cmyk:wF}),Te.format.cmyk=yF,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"cmyk"),Le(t)==="array"&&t.length===4)return"cmyk"}});const bF=(...t)=>{const e=ke(t,"hsla");let n=vo(t)||"lsa";return e[0]=Vn(e[0]||0)+"deg",e[1]=Vn(e[1]*100)+"%",e[2]=Vn(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]="/ "+(e.length>3?e[3]:1),n="hsla"):e.length=3,`${n.substr(0,3)}(${e.join(" ")})`},DF=(...t)=>{const e=ke(t,"lab");let n=vo(t)||"lab";return e[0]=Vn(e[0])+"%",e[1]=Vn(e[1]),e[2]=Vn(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},EF=(...t)=>{const e=ke(t,"lch");let n=vo(t)||"lab";return e[0]=Vn(e[0])+"%",e[1]=Vn(e[1]),e[2]=isNaN(e[2])?"none":Vn(e[2])+"deg",n==="lcha"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lch(${e.join(" ")})`},RF=(...t)=>{const e=ke(t,"lab");return e[0]=Vn(e[0]*100)+"%",e[1]=Zm(e[1]),e[2]=Zm(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},AD=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),[s,o,a]=lg(e,n,r),[c,u,l]=uD(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},$F=(...t)=>{const e=ke(t,"lch");return e[0]=Vn(e[0]*100)+"%",e[1]=Zm(e[1]),e[2]=isNaN(e[2])?"none":Vn(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:mg}=Math,TF=(...t)=>{const e=ke(t,"rgba");let n=vo(t)||"rgb";if(n.substr(0,3)==="hsl")return bF(dD(e),n);if(n.substr(0,3)==="lab"){const r=xa();Kr("d50");const i=DF(ng(e),n);return Kr(r),i}if(n.substr(0,3)==="lch"){const r=xa();Kr("d50");const i=EF(og(e),n);return Kr(r),i}return n.substr(0,5)==="oklab"?RF(lg(e)):n.substr(0,5)==="oklch"?$F(AD(e)):(e[0]=mg(e[0]),e[1]=mg(e[1]),e[2]=mg(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]="/ "+(e.length>3?e[3]:1),n="rgba"),`${n.substr(0,3)}(${e.slice(0,n==="rgb"?3:4).join(" ")})`)},_D=(...t)=>{t=ke(t,"lch");const[e,n,r,...i]=t,[s,o,a]=cD(e,n,r),[c,u,l]=ug(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},Xr=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,ar=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,sf=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Kn=/\s*/.source,$o=/\s+/.source,gg=/\s*,\s*/.source,of=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,To=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,PD=new RegExp("^rgba?\\("+Kn+[Xr,Xr,Xr].join($o)+To+"\\)$"),xD=new RegExp("^rgb\\("+Kn+[Xr,Xr,Xr].join(gg)+Kn+"\\)$"),ID=new RegExp("^rgba\\("+Kn+[Xr,Xr,Xr,ar].join(gg)+Kn+"\\)$"),ND=new RegExp("^hsla?\\("+Kn+[of,sf,sf].join($o)+To+"\\)$"),OD=new RegExp("^hsl?\\("+Kn+[of,sf,sf].join(gg)+Kn+"\\)$"),FD=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,LD=new RegExp("^lab\\("+Kn+[ar,ar,ar].join($o)+To+"\\)$"),MD=new RegExp("^lch\\("+Kn+[ar,ar,of].join($o)+To+"\\)$"),BD=new RegExp("^oklab\\("+Kn+[ar,ar,ar].join($o)+To+"\\)$"),zD=new RegExp("^oklch\\("+Kn+[ar,ar,of].join($o)+To+"\\)$"),{round:qD}=Math,So=t=>t.map((e,n)=>n<=2?vs(qD(e),0,255):e),Nt=(t,e=0,n=100,r=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,r?t=e+(t+1)*.5*(n-e):t=e+t*(n-e)),+t),pn=(t,e)=>t==="none"?e:t,yg=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(Te.format.named)try{return Te.format.named(t)}catch{}if((e=t.match(PD))||(e=t.match(xD))){let n=e.slice(1,4);for(let i=0;i<3;i++)n[i]=+Nt(pn(n[i],0),0,255);n=So(n);const r=e[4]!==void 0?+Nt(e[4],0,1):1;return n[3]=r,n}if(e=t.match(ID)){const n=e.slice(1,5);for(let r=0;r<4;r++)n[r]=+Nt(n[r],0,255);return n}if((e=t.match(ND))||(e=t.match(OD))){const n=e.slice(1,4);n[0]=+pn(n[0].replace("deg",""),0),n[1]=+Nt(pn(n[1],0),0,100)*.01,n[2]=+Nt(pn(n[2],0),0,100)*.01;const r=So(cg(n)),i=e[4]!==void 0?+Nt(e[4],0,1):1;return r[3]=i,r}if(e=t.match(FD)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=cg(n);for(let i=0;i<3;i++)r[i]=qD(r[i]);return r[3]=+e[4],r}if(e=t.match(LD)){const n=e.slice(1,4);n[0]=Nt(pn(n[0],0),0,100),n[1]=Nt(pn(n[1],0),-125,125,!0),n[2]=Nt(pn(n[2],0),-125,125,!0);const r=xa();Kr("d50");const i=So(eg(n));Kr(r);const s=e[4]!==void 0?+Nt(e[4],0,1):1;return i[3]=s,i}if(e=t.match(MD)){const n=e.slice(1,4);n[0]=Nt(n[0],0,100),n[1]=Nt(pn(n[1],0),0,150,!1),n[2]=+pn(n[2].replace("deg",""),0);const r=xa();Kr("d50");const i=So(sg(n));Kr(r);const s=e[4]!==void 0?+Nt(e[4],0,1):1;return i[3]=s,i}if(e=t.match(BD)){const n=e.slice(1,4);n[0]=Nt(pn(n[0],0),0,1),n[1]=Nt(pn(n[1],0),-.4,.4,!0),n[2]=Nt(pn(n[2],0),-.4,.4,!0);const r=So(ug(n)),i=e[4]!==void 0?+Nt(e[4],0,1):1;return r[3]=i,r}if(e=t.match(zD)){const n=e.slice(1,4);n[0]=Nt(pn(n[0],0),0,1),n[1]=Nt(pn(n[1],0),0,.4,!1),n[2]=+pn(n[2].replace("deg",""),0);const r=So(_D(n)),i=e[4]!==void 0?+Nt(e[4],0,1):1;return r[3]=i,r}};yg.test=t=>PD.test(t)||ND.test(t)||LD.test(t)||MD.test(t)||BD.test(t)||zD.test(t)||xD.test(t)||ID.test(t)||OD.test(t)||FD.test(t)||t==="transparent",re.prototype.css=function(t){return TF(this._rgb,t)};const SF=(...t)=>new re(...t,"css");ze.css=SF,Te.format.css=yg,Te.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Le(t)==="string"&&yg.test(t))return"css"}}),Te.format.gl=(...t)=>{const e=ke(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const kF=(...t)=>new re(...t,"gl");ze.gl=kF,re.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]},re.prototype.hex=function(t){return sD(this._rgb,t)};const CF=(...t)=>new re(...t,"hex");ze.hex=CF,Te.format.hex=iD,Te.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&Le(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:af}=Math,jD=t=>{const e=t/100;let n,r,i;return e<66?(n=255,r=e<6?0:-155.25485562709179-.44596950469579133*(r=e-2)+104.49216199393888*af(r),i=e<20?0:-254.76935184120902+.8274096064007395*(i=e-10)+115.67994401066147*af(i)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*af(n),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*af(r),i=255),[n,r,i,1]},{round:AF}=Math,_F=(...t)=>{const e=ke(t,"rgb"),n=e[0],r=e[2];let i=1e3,s=4e4;const o=.4;let a;for(;s-i>o;){a=(s+i)*.5;const c=jD(a);c[2]/c[0]>=r/n?s=a:i=a}return AF(a)};re.prototype.temp=re.prototype.kelvin=re.prototype.temperature=function(){return _F(this._rgb)};const vg=(...t)=>new re(...t,"temp");Object.assign(ze,{temp:vg,kelvin:vg,temperature:vg}),Te.format.temp=Te.format.kelvin=Te.format.temperature=jD,re.prototype.oklch=function(){return AD(this._rgb)};const PF=(...t)=>new re(...t,"oklch");Object.assign(ze,{oklch:PF}),Te.format.oklch=_D,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"oklch"),Le(t)==="array"&&t.length===3)return"oklch"}}),Object.assign(ze,{analyze:gD,average:xO,bezier:MO,blend:or,brewer:gF,Color:re,colors:wo,contrast:sF,contrastAPCA:cF,cubehelix:JO,deltaE:fF,distance:pF,input:Te,interpolate:bo,limits:yD,mix:bo,random:tF,scale:tf,scales:mF,valid:hF});const wg=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],UD=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function xF(t){const e=t.get("hsl.l");return wg.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}function IF(t){const e=ze(t),n=xF(e),r=wg.findIndex(s=>s===n),i=wg.map(s=>e.set("hsl.l",s)).map(s=>ze(s)).map((s,o)=>{const a=UD[o]-UD[r];return a>=0?s.saturate(a):s.desaturate(a*-1)});return{baseColorIndex:r,colors:i}}function NF(t){return IF(t).colors.map(e=>e.hex())}const GD={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},WD={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},HD={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},OF={primary:GD,blue:GD,secondary:WD,sky:WD,muted:HD,slate:HD,gray:{fill:"#737373",stroke:"#525252",hiContrast:"#fafafa",loContrast:"#d4d4d4"},red:{fill:"#AC4D39",stroke:"#853A2D",hiContrast:"#FBD3CB",loContrast:"#f5b2a3"},green:{fill:"#428a4f",stroke:"#2d5d39",hiContrast:"#f8fafc",loContrast:"#c2f0c2"},amber:{fill:"#A35829",stroke:"#7E451D",hiContrast:"#FFE0C2",loContrast:"#f9b27c"},indigo:{fill:"#6366f1",stroke:"#4f46e5",hiContrast:"#eef2ff",loContrast:"#c7d2fe"}},FF={lineColor:"#6E6E6E",labelBgColor:"#18191b",labelColor:"#C6C6C6"},VD={lineColor:"#64748b",labelBgColor:"#0f172a",labelColor:"#cbd5e1"},KD={lineColor:"#3b82f6",labelBgColor:"#172554",labelColor:"#60a5fa"},YD={lineColor:"#0ea5e9",labelBgColor:"#082f49",labelColor:"#38bdf8"},LF={amber:{lineColor:"#b45309",labelBgColor:"#78350f",labelColor:"#FFE0C2"},blue:KD,gray:FF,green:{lineColor:"#15803d",labelBgColor:"#052e16",labelColor:"#22c55e"},indigo:{lineColor:"#6366f1",labelBgColor:"#1e1b4b",labelColor:"#818cf8"},muted:VD,primary:KD,red:{lineColor:"#AC4D39",labelBgColor:"#b91c1c",labelColor:"#f5b2a3"},secondary:YD,sky:YD,slate:VD},cr={elements:OF,relationships:LF,font:"Arial",shadow:"#0a0a0a"};function MF(t){if(t.match(/^#([0-9a-f]{3}){1,2}$/i)){const e=NF(t);return{elements:{fill:e[6],stroke:e[7],hiContrast:e[0],loContrast:e[1]},relationships:{lineColor:e[4],labelColor:e[3],labelBgColor:e[9]}}}else return{elements:cr.elements.primary,relationships:cr.relationships.primary}}function bg(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Dg(t,e,n=".",r){if(!bg(e))return Dg(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(r&&r(i,s,o,n)||(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:bg(o)&&bg(i[s])?i[s]=Dg(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function BF(t){return(...e)=>e.reduce((n,r)=>Dg(n,r,"",t),{})}const Eg=BF();function Tt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Yn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function zF(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function cf(t){return typeof t=="object"&&t!==null&&Tt(t.container)&&Yn(t.reference)&&typeof t.message=="string"}class XD{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return Tt(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Jr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ws(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function JD(t){return Jr(t)&&typeof t.fullText=="string"}class Mt{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Mt(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return nn})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=qF(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new Mt(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?nn:{done:!1,value:e(i)}})}filter(e){return new Mt(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return nn})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new Mt(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(uf(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return nn})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Mt(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(uf(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return nn})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Mt(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new Mt(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?nn:this.nextFn(n.state)))}distinct(e){return new Mt(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return nn})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function qF(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function uf(t){return!!t&&typeof t[Symbol.iterator]=="function"}const ko=new Mt(()=>{},()=>nn),nn=Object.freeze({done:!0,value:void 0});function st(...t){if(t.length===1){const e=t[0];if(e instanceof Mt)return e;if(uf(e))return new Mt(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Mt(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:nn)}return t.length>1?new Mt(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const n=t[e.collIndex++];uf(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return nn}):ko}class Co extends Mt{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(n(o.value)[Symbol.iterator]()),o}return nn})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Rg;(function(t){function e(s){return s.reduce((o,a)=>o+a,0)}t.sum=e;function n(s){return s.reduce((o,a)=>o*a,0)}t.product=n;function r(s){return s.reduce((o,a)=>Math.min(o,a))}t.min=r;function i(s){return s.reduce((o,a)=>Math.max(o,a))}t.max=i})(Rg||(Rg={}));function Ia(t){return new Co(t,e=>Jr(e)?e.content:[],{includeRoot:!0})}function ZD(t){return Ia(t).filter(ws)}function QD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function lf(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Na(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var kr;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(kr||(kr={}));function eE(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return kr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return kr.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?kr.Inside:n?kr.OverlapBack:r?kr.OverlapFront:kr.Outside}function $g(t,e){return eE(t,e)>kr.After}const Tg=/^[\w\p{L}]$/u;function _i(t,e,n=Tg){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return kg(t,e)}}function df(t,e){if(t){const n=nE(t,!0);if(n&&Sg(n,e))return n;if(JD(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(Sg(s,e))return s}}}}function Sg(t,e){return ws(t)&&e.includes(t.tokenType.name)}function kg(t,e){if(ws(t))return t;if(Jr(t)){const n=tE(t,e,!1);if(n)return kg(n,e)}}function ff(t,e){if(ws(t))return t;if(Jr(t)){const n=tE(t,e,!0);if(n)return ff(n,e)}}function tE(t,e,n){let r=0,i=t.content.length-1,s;for(;r<=i;){const o=Math.floor((r+i)/2),a=t.content[o];if(a.offset<=e&&a.end>e)return a;a.end<=e?(s=n?a:void 0,r=o+1):i=o-1}return s}function nE(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}function rE(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;r<i;){r++;const s=n.content[r];if(e||!s.hidden)return s}t=n}}function jF(t){if(t.range.start.character===0)return t;const e=t.range.start.line;let n=t,r;for(;t.container;){const i=t.container,s=r??i.content.indexOf(t);if(s===0?(t=i,r=void 0):(r=s-1,t=i.content[r]),t.range.start.line!==e)break;n=t}return n}function iE(t,e){const n=UF(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function UF(t,e){const n=sE(t),r=sE(e);let i;for(let s=0;s<n.length&&s<r.length;s++){const o=n[s],a=r[s];if(o.parent===a.parent)i={parent:o.parent,a:o.index,b:a.index};else break}return i}function sE(t){const e=[];for(;t.container;){const n=t.container,r=n.content.indexOf(t);e.push({parent:n,index:r}),t=n}return e.reverse()}const GF={__proto__:null,DefaultNameRegexp:Tg,get RangeComparison(){return kr},compareRange:eE,findCommentNode:df,findDeclarationNodeAtOffset:_i,findLeafNodeAtOffset:kg,findLeafNodeBeforeOffset:ff,flattenCst:ZD,getInteriorNodes:iE,getNextNode:rE,getPreviousNode:nE,getStartlineNode:jF,inRange:$g,isChildNode:QD,isCommentNode:Sg,streamCst:Ia,toDocumentSegment:Na,tokenToRange:lf};class oE extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Oa(t){throw new Error("Error! The input value was not handled.")}const pf="AbstractRule",hf="AbstractType",Cg="Condition",aE="TypeDefinition",Ag="ValueLiteral",Fa="AbstractElement";function _g(t){return Ge.isInstance(t,Fa)}const mf="ArrayLiteral",La="ArrayType";function WF(t){return Ge.isInstance(t,La)}const Ma="BooleanLiteral";function HF(t){return Ge.isInstance(t,Ma)}const Ba="Conjunction";function VF(t){return Ge.isInstance(t,Ba)}const za="Disjunction";function KF(t){return Ge.isInstance(t,za)}const gf="Grammar",Pg="GrammarImport",qa="InferredType";function cE(t){return Ge.isInstance(t,qa)}const ja="Interface";function uE(t){return Ge.isInstance(t,ja)}const xg="NamedArgument",Ua="Negation";function YF(t){return Ge.isInstance(t,Ua)}const yf="NumberLiteral",vf="Parameter",Ga="ParameterReference";function XF(t){return Ge.isInstance(t,Ga)}const Wa="ParserRule";function rn(t){return Ge.isInstance(t,Wa)}const Ha="ReferenceType";function JF(t){return Ge.isInstance(t,Ha)}const wf="ReturnType";function ZF(t){return Ge.isInstance(t,wf)}const Va="SimpleType";function lE(t){return Ge.isInstance(t,Va)}const bf="StringLiteral",Ao="TerminalRule";function Zr(t){return Ge.isInstance(t,Ao)}const Ka="Type";function Ig(t){return Ge.isInstance(t,Ka)}const Ng="TypeAttribute",Ya="UnionType";function QF(t){return Ge.isInstance(t,Ya)}const Xa="Action";function bs(t){return Ge.isInstance(t,Xa)}const Ja="Alternatives";function Og(t){return Ge.isInstance(t,Ja)}const Za="Assignment";function Cr(t){return Ge.isInstance(t,Za)}const Qa="CharacterRange";function eL(t){return Ge.isInstance(t,Qa)}const ec="CrossReference";function tc(t){return Ge.isInstance(t,ec)}const nc="EndOfFile";function tL(t){return Ge.isInstance(t,nc)}const rc="Group";function Pi(t){return Ge.isInstance(t,rc)}const ic="Keyword";function Ar(t){return Ge.isInstance(t,ic)}const sc="NegatedToken";function nL(t){return Ge.isInstance(t,sc)}const oc="RegexToken";function rL(t){return Ge.isInstance(t,oc)}const ac="RuleCall";function Qr(t){return Ge.isInstance(t,ac)}const cc="TerminalAlternatives";function iL(t){return Ge.isInstance(t,cc)}const uc="TerminalGroup";function sL(t){return Ge.isInstance(t,uc)}const lc="TerminalRuleCall";function dE(t){return Ge.isInstance(t,lc)}const dc="UnorderedGroup";function Fg(t){return Ge.isInstance(t,dc)}const fc="UntilToken";function oL(t){return Ge.isInstance(t,fc)}const pc="Wildcard";function aL(t){return Ge.isInstance(t,pc)}class fE extends XD{getAllTypes(){return[Fa,pf,hf,Xa,Ja,mf,La,Za,Ma,Qa,Cg,Ba,ec,za,nc,gf,Pg,rc,qa,ja,ic,xg,sc,Ua,yf,vf,Ga,Wa,Ha,oc,wf,ac,Va,bf,cc,uc,Ao,lc,Ka,Ng,aE,Ya,dc,fc,Ag,pc]}computeIsSubtype(e,n){switch(e){case Xa:case Ja:case Za:case Qa:case ec:case nc:case rc:case ic:case sc:case oc:case ac:case cc:case uc:case lc:case dc:case fc:case pc:return this.isSubtype(Fa,n);case mf:case yf:case bf:return this.isSubtype(Ag,n);case La:case Ha:case Va:case Ya:return this.isSubtype(aE,n);case Ma:return this.isSubtype(Cg,n)||this.isSubtype(Ag,n);case Ba:case za:case Ua:case Ga:return this.isSubtype(Cg,n);case qa:case ja:case Ka:return this.isSubtype(hf,n);case Wa:return this.isSubtype(pf,n)||this.isSubtype(hf,n);case Ao:return this.isSubtype(pf,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return hf;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return pf;case"Grammar:usedGrammars":return gf;case"NamedArgument:parameter":case"ParameterReference:parameter":return vf;case"TerminalRuleCall:rule":return Ao;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Fa:return{name:Fa,properties:[{name:"cardinality"},{name:"lookahead"}]};case mf:return{name:mf,properties:[{name:"elements",defaultValue:[]}]};case La:return{name:La,properties:[{name:"elementType"}]};case Ma:return{name:Ma,properties:[{name:"true",defaultValue:!1}]};case Ba:return{name:Ba,properties:[{name:"left"},{name:"right"}]};case za:return{name:za,properties:[{name:"left"},{name:"right"}]};case gf:return{name:gf,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case Pg:return{name:Pg,properties:[{name:"path"}]};case qa:return{name:qa,properties:[{name:"name"}]};case ja:return{name:ja,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case xg:return{name:xg,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Ua:return{name:Ua,properties:[{name:"value"}]};case yf:return{name:yf,properties:[{name:"value"}]};case vf:return{name:vf,properties:[{name:"name"}]};case Ga:return{name:Ga,properties:[{name:"parameter"}]};case Wa:return{name:Wa,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Ha:return{name:Ha,properties:[{name:"referenceType"}]};case wf:return{name:wf,properties:[{name:"name"}]};case Va:return{name:Va,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case bf:return{name:bf,properties:[{name:"value"}]};case Ao:return{name:Ao,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Ka:return{name:Ka,properties:[{name:"name"},{name:"type"}]};case Ng:return{name:Ng,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Ya:return{name:Ya,properties:[{name:"types",defaultValue:[]}]};case Xa:return{name:Xa,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Ja:return{name:Ja,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Za:return{name:Za,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Qa:return{name:Qa,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case ec:return{name:ec,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case nc:return{name:nc,properties:[{name:"cardinality"},{name:"lookahead"}]};case rc:return{name:rc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case ic:return{name:ic,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case sc:return{name:sc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case oc:return{name:oc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case ac:return{name:ac,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case cc:return{name:cc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case uc:return{name:uc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case lc:return{name:lc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case dc:return{name:dc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case fc:return{name:fc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case pc:return{name:pc,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Ge=new fE;function Lg(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{Tt(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):Tt(n)&&(n.$container=t,n.$containerProperty=e))}function sn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function xi(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function bt(t){const n=Df(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Df(t){for(;t.$container;)t=t.$container;return t}function hc(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Mt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(Tt(s)){if(r.keyIndex++,Mg(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const o=r.arrayIndex++,a=s[o];if(Tt(a)&&Mg(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return nn})}function _r(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Co(t,n=>hc(n,e))}function ei(t,e){if(t){if(e?.range&&!Mg(t,e.range))return new Co(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Co(t,n=>hc(n,e),{includeRoot:!0})}function Mg(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?$g(r,e):!1}function Ef(t){return new Mt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(Yn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Yn(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return nn})}function cL(t,e=bt(t).parseResult.value){const n=[];return ei(e).forEach(r=>{Ef(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),st(n)}function Bg(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=pE(i.defaultValue))}function pE(t){return Array.isArray(t)?[...t.map(pE)]:t}function zg(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(Tt(i))n[r]=zg(i,e);else if(Yn(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)Tt(o)?s.push(zg(o,e)):Yn(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return Lg(n),n}const mc={__proto__:null,assignMandatoryProperties:Bg,copyAstNode:zg,findLocalReferences:cL,findRootNode:Df,getContainerOfType:sn,getDocument:bt,hasContainerOfType:xi,linkContentToContainer:Lg,streamAllContents:_r,streamAst:ei,streamContents:hc,streamReferences:Ef};function $e(t){return t.charCodeAt(0)}function qg(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function gc(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function _o(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function uL(){throw Error("Internal Error - Should never get here!")}function hE(t){return t.type==="Character"}const Rf=[];for(let t=$e("0");t<=$e("9");t++)Rf.push(t);const $f=[$e("_")].concat(Rf);for(let t=$e("a");t<=$e("z");t++)$f.push(t);for(let t=$e("A");t<=$e("Z");t++)$f.push(t);const mE=[$e(" "),$e("\f"),$e(`
|
|
2
|
+
`),$e("\r"),$e(" "),$e("\v"),$e(" "),$e("\xA0"),$e("\u1680"),$e("\u2000"),$e("\u2001"),$e("\u2002"),$e("\u2003"),$e("\u2004"),$e("\u2005"),$e("\u2006"),$e("\u2007"),$e("\u2008"),$e("\u2009"),$e("\u200A"),$e("\u2028"),$e("\u2029"),$e("\u202F"),$e("\u205F"),$e("\u3000"),$e("\uFEFF")],lL=/[0-9a-fA-F]/,Tf=/[0-9]/,dL=/[1-9]/;class gE{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":gc(r,"global");break;case"i":gc(r,"ignoreCase");break;case"m":gc(r,"multiLine");break;case"u":gc(r,"unicode");break;case"y":gc(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break}_o(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return uL()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;_o(n);break}if(!(e===!0&&n===void 0)&&_o(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),_o(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[$e(`
|
|
3
|
+
`),$e("\r"),$e("\u2028"),$e("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=Rf;break;case"D":e=Rf,n=!0;break;case"s":e=mE;break;case"S":e=mE,n=!0;break;case"w":e=$f;break;case"W":e=$f,n=!0;break}if(_o(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=$e("\f");break;case"n":e=$e(`
|
|
4
|
+
`);break;case"r":e=$e("\r");break;case"t":e=$e(" ");break;case"v":e=$e("\v");break}if(_o(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:$e("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:$e(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:$e(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,hE(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,hE(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else qg(r.value,e),e.push($e("-")),qg(i.value,e)}else qg(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:$e("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(dL.test(e)===!1)throw Error("Expecting a positive integer");for(;Tf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Tf.test(e)===!1)throw Error("Expecting an integer");for(;Tf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:$e(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Tf.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(lL.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class Sf{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const yE=/\r?\n/gm,fL=new gE;class pL extends Sf{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
|
|
10
|
+
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=kf(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
|
|
11
|
+
`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const jg=new pL;function hL(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),jg.reset(t),jg.visit(fL.pattern(t)),jg.multiline}catch{return!1}}const mL=`\f
|
|
12
|
+
\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Ug(t){const e=typeof t=="string"?new RegExp(t):t;return mL.some(n=>e.test(n))}function kf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gL(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:kf(e)).join("")}function yL(t,e){const n=vL(t),r=e.match(n);return!!r&&r[0].length>0}function vL(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",o;function a(u){s+=n.substr(r,u),r+=u}function c(u){s+="(?:"+n.substr(r,u)+"|$)",r+=u}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=r,o=o.exec(n)||[],c(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=r,o=o.exec(n),o?a(o[0].length):c(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":o=r,r+=3,i(),s+=n.substr(o,r-o);break;case"<":switch(n[r+3]){case"=":case"!":o=r,r+=4,i(),s+=n.substr(o,r-o);break;default:a(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else a(1),s+=i()+"|$)";break;case")":return++r,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function Cf(t){return t.rules.find(e=>rn(e)&&e.entry)}function vE(t){return t.rules.filter(e=>Zr(e)&&e.hidden)}function Gg(t,e){const n=new Set,r=Cf(t);if(!r)return new Set(t.rules);const i=[r].concat(vE(t));for(const o of i)wE(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||Zr(o)&&o.hidden)&&s.add(o);return s}function wE(t,e,n){e.add(t.name),_r(t).forEach(r=>{if(Qr(r)||n&&dE(r)){const i=r.rule.ref;i&&!e.has(i.name)&&wE(i,e,n)}})}function Wg(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Yg(t.type.ref);return e?.terminal}}function bE(t){return t.hidden&&!Ug(wc(t))}function Po(t,e){return!t||!e?[]:Hg(t,e,t.astNode,!0)}function kn(t,e,n){if(!t||!e)return;const r=Hg(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Hg(t,e,n,r){if(!r){const i=sn(t.grammarSource,Cr);if(i&&i.feature===e)return[t]}return Jr(t)&&t.astNode===n?t.content.flatMap(i=>Hg(i,e,n,!1)):[]}function Vg(t,e){return t?Kg(t,e,t?.astNode):[]}function yc(t,e,n){if(!t)return;const r=Kg(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Kg(t,e,n){if(t.astNode!==n)return[];if(Ar(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Ia(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?Ar(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function DE(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=sn(t.grammarSource,Cr);if(r)return r;t=t.container}}function Yg(t){let e=t;return cE(e)&&(bs(e.$container)?e=e.$container.$container:rn(e.$container)?e=e.$container:Oa(e.$container)),EE(t,e,new Map)}function EE(t,e,n){var r;function i(s,o){let a;return sn(s,Cr)||(a=EE(o,o,n)),n.set(t,a),a}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of _r(e)){if(Cr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Qr(s)&&rn(s.rule.ref))return i(s,s.rule.ref);if(lE(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function RE(t){const e=t.$container;if(Pi(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(bs(s))return s;{const o=_r(n[i]).find(bs);if(o)return o}}}if(_g(e))return RE(e)}function xo(t,e){return t==="?"||t==="*"||Pi(e)&&!!e.guardCondition}function $E(t){return t==="*"||t==="+"}function wL(t){return t==="+="}function Af(t){return TE(t,new Set)}function TE(t,e){if(e.has(t))return!0;e.add(t);for(const n of _r(t))if(Qr(n)){if(!n.rule.ref||rn(n.rule.ref)&&!TE(n.rule.ref,e))return!1}else{if(Cr(n))return!1;if(bs(n))return!1}return!!t.definition}function bL(t){return Xg(t.type,new Set)}function Xg(t,e){if(e.has(t))return!0;if(e.add(t),WF(t))return!1;if(JF(t))return!1;if(QF(t))return t.types.every(n=>Xg(n,e));if(lE(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const n=t.typeRef.ref;return Ig(n)?Xg(n.type,e):!1}else return!1}else return!1}function Ds(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(rn(e))return e.name;if(uE(e)||Ig(e))return e.name}}}function vc(t){var e;if(rn(t))return Af(t)?t.name:(e=Ds(t))!==null&&e!==void 0?e:t.name;if(uE(t)||Ig(t)||ZF(t))return t.name;if(bs(t)){const n=SE(t);if(n)return n}else if(cE(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function SE(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return vc(t.type.ref)}function DL(t){var e,n,r;return Zr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":Af(t)?t.name:(r=Ds(t))!==null&&r!==void 0?r:t.name}function kE(t){var e,n,r;return Zr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=Ds(t))!==null&&r!==void 0?r:t.name}function wc(t){const e={s:!1,i:!1,u:!1},n=Io(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const Jg=/[\s\S]/.source;function Io(t,e){if(iL(t))return EL(t);if(sL(t))return RL(t);if(eL(t))return SL(t);if(dE(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return ti(Io(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(nL(t))return TL(t);if(oL(t))return $L(t);if(rL(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ti(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(aL(t))return ti(Jg,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function EL(t){return ti(t.elements.map(e=>Io(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function RL(t){return ti(t.elements.map(e=>Io(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function $L(t){return ti(`${Jg}*?${Io(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function TL(t){return ti(`(?!${Io(t.terminal)})${Jg}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function SL(t){return t.right?ti(`[${Zg(t.left)}-${Zg(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ti(Zg(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function Zg(t){return kf(t.value)}function ti(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const _f={__proto__:null,findAssignment:DE,findNameAssignment:Yg,findNodeForKeyword:yc,findNodeForProperty:kn,findNodesForKeyword:Vg,findNodesForKeywordInternal:Kg,findNodesForProperty:Po,getActionAtElement:RE,getActionType:SE,getAllReachableRules:Gg,getCrossReferenceTerminal:Wg,getEntryRule:Cf,getExplicitRuleType:Ds,getHiddenRules:vE,getRuleType:kE,getRuleTypeName:DL,getTypeName:vc,isArrayCardinality:$E,isArrayOperator:wL,isCommentTerminal:bE,isDataType:bL,isDataTypeRule:Af,isOptionalCardinality:xo,terminalRegex:wc};function kL(t){const e=[],n=t.Grammar;for(const r of n.rules)Zr(r)&&bE(r)&&hL(wc(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:Tg}}var CE=typeof global=="object"&&global&&global.Object===Object&&global,CL=typeof self=="object"&&self&&self.Object===Object&&self,Pr=CE||CL||Function("return this")(),Xn=Pr.Symbol,AE=Object.prototype,AL=AE.hasOwnProperty,_L=AE.toString,bc=Xn?Xn.toStringTag:void 0;function PL(t){var e=AL.call(t,bc),n=t[bc];try{t[bc]=void 0;var r=!0}catch{}var i=_L.call(t);return r&&(e?t[bc]=n:delete t[bc]),i}var xL=Object.prototype,IL=xL.toString;function NL(t){return IL.call(t)}var OL="[object Null]",FL="[object Undefined]",_E=Xn?Xn.toStringTag:void 0;function Ii(t){return t==null?t===void 0?FL:OL:_E&&_E in Object(t)?PL(t):NL(t)}function ur(t){return t!=null&&typeof t=="object"}var LL="[object Symbol]";function Dc(t){return typeof t=="symbol"||ur(t)&&Ii(t)==LL}function Pf(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var We=Array.isArray,ML=1/0,PE=Xn?Xn.prototype:void 0,xE=PE?PE.toString:void 0;function IE(t){if(typeof t=="string")return t;if(We(t))return Pf(t,IE)+"";if(Dc(t))return xE?xE.call(t):"";var e=t+"";return e=="0"&&1/t==-ML?"-0":e}var BL=/\s/;function zL(t){for(var e=t.length;e--&&BL.test(t.charAt(e)););return e}var qL=/^\s+/;function jL(t){return t&&t.slice(0,zL(t)+1).replace(qL,"")}function Jn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var NE=NaN,UL=/^[-+]0x[0-9a-f]+$/i,GL=/^0b[01]+$/i,WL=/^0o[0-7]+$/i,HL=parseInt;function VL(t){if(typeof t=="number")return t;if(Dc(t))return NE;if(Jn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Jn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=jL(t);var n=GL.test(t);return n||WL.test(t)?HL(t.slice(2),n?2:8):UL.test(t)?NE:+t}var OE=1/0,KL=17976931348623157e292;function YL(t){if(!t)return t===0?t:0;if(t=VL(t),t===OE||t===-OE){var e=t<0?-1:1;return e*KL}return t===t?t:0}function xf(t){var e=YL(t),n=e%1;return e===e?n?e-n:e:0}function Es(t){return t}var XL="[object AsyncFunction]",JL="[object Function]",ZL="[object GeneratorFunction]",QL="[object Proxy]";function ni(t){if(!Jn(t))return!1;var e=Ii(t);return e==JL||e==ZL||e==XL||e==QL}var Qg=Pr["__core-js_shared__"],FE=function(){var t=/[^.]+$/.exec(Qg&&Qg.keys&&Qg.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function eM(t){return!!FE&&FE in t}var tM=Function.prototype,nM=tM.toString;function Rs(t){if(t!=null){try{return nM.call(t)}catch{}try{return t+""}catch{}}return""}var rM=/[\\^$.*+?()[\]{}|]/g,iM=/^\[object .+?Constructor\]$/,sM=Function.prototype,oM=Object.prototype,aM=sM.toString,cM=oM.hasOwnProperty,uM=RegExp("^"+aM.call(cM).replace(rM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lM(t){if(!Jn(t)||eM(t))return!1;var e=ni(t)?uM:iM;return e.test(Rs(t))}function dM(t,e){return t?.[e]}function $s(t,e){var n=dM(t,e);return lM(n)?n:void 0}var ey=$s(Pr,"WeakMap"),LE=Object.create,fM=function(){function t(){}return function(e){if(!Jn(e))return{};if(LE)return LE(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function pM(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function zt(){}function hM(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var mM=800,gM=16,yM=Date.now;function vM(t){var e=0,n=0;return function(){var r=yM(),i=gM-(r-n);if(n=r,i>0){if(++e>=mM)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function wM(t){return function(){return t}}var If=function(){try{var t=$s(Object,"defineProperty");return t({},"",{}),t}catch{}}(),bM=If?function(t,e){return If(t,"toString",{configurable:!0,enumerable:!1,value:wM(e),writable:!0})}:Es,DM=vM(bM);function ME(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function BE(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function EM(t){return t!==t}function RM(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function ty(t,e,n){return e===e?RM(t,e,n):BE(t,EM,n)}function zE(t,e){var n=t==null?0:t.length;return!!n&&ty(t,e,0)>-1}var $M=9007199254740991,TM=/^(?:0|[1-9]\d*)$/;function Nf(t,e){var n=typeof t;return e=e??$M,!!e&&(n=="number"||n!="symbol"&&TM.test(t))&&t>-1&&t%1==0&&t<e}function ny(t,e,n){e=="__proto__"&&If?If(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Ec(t,e){return t===e||t!==t&&e!==e}var SM=Object.prototype,kM=SM.hasOwnProperty;function Of(t,e,n){var r=t[e];(!(kM.call(t,e)&&Ec(r,n))||n===void 0&&!(e in t))&&ny(t,e,n)}function ry(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],c=void 0;c===void 0&&(c=t[a]),i?ny(n,a,c):Of(n,a,c)}return n}var qE=Math.max;function CM(t,e,n){return e=qE(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=qE(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),pM(t,this,a)}}function iy(t,e){return DM(CM(t,e,Es),t+"")}var AM=9007199254740991;function sy(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=AM}function xr(t){return t!=null&&sy(t.length)&&!ni(t)}function jE(t,e,n){if(!Jn(n))return!1;var r=typeof e;return(r=="number"?xr(n)&&Nf(e,n.length):r=="string"&&e in n)?Ec(n[e],t):!1}function _M(t){return iy(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&jE(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var PM=Object.prototype;function Rc(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||PM;return t===n}function xM(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var IM="[object Arguments]";function UE(t){return ur(t)&&Ii(t)==IM}var GE=Object.prototype,NM=GE.hasOwnProperty,OM=GE.propertyIsEnumerable,Ff=UE(function(){return arguments}())?UE:function(t){return ur(t)&&NM.call(t,"callee")&&!OM.call(t,"callee")};function FM(){return!1}var WE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,HE=WE&&typeof module=="object"&&module&&!module.nodeType&&module,LM=HE&&HE.exports===WE,VE=LM?Pr.Buffer:void 0,MM=VE?VE.isBuffer:void 0,$c=MM||FM,BM="[object Arguments]",zM="[object Array]",qM="[object Boolean]",jM="[object Date]",UM="[object Error]",GM="[object Function]",WM="[object Map]",HM="[object Number]",VM="[object Object]",KM="[object RegExp]",YM="[object Set]",XM="[object String]",JM="[object WeakMap]",ZM="[object ArrayBuffer]",QM="[object DataView]",e3="[object Float32Array]",t3="[object Float64Array]",n3="[object Int8Array]",r3="[object Int16Array]",i3="[object Int32Array]",s3="[object Uint8Array]",o3="[object Uint8ClampedArray]",a3="[object Uint16Array]",c3="[object Uint32Array]",mt={};mt[e3]=mt[t3]=mt[n3]=mt[r3]=mt[i3]=mt[s3]=mt[o3]=mt[a3]=mt[c3]=!0,mt[BM]=mt[zM]=mt[ZM]=mt[qM]=mt[QM]=mt[jM]=mt[UM]=mt[GM]=mt[WM]=mt[HM]=mt[VM]=mt[KM]=mt[YM]=mt[XM]=mt[JM]=!1;function u3(t){return ur(t)&&sy(t.length)&&!!mt[Ii(t)]}function Lf(t){return function(e){return t(e)}}var KE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tc=KE&&typeof module=="object"&&module&&!module.nodeType&&module,l3=Tc&&Tc.exports===KE,oy=l3&&CE.process,Ni=function(){try{var t=Tc&&Tc.require&&Tc.require("util").types;return t||oy&&oy.binding&&oy.binding("util")}catch{}}(),YE=Ni&&Ni.isTypedArray,ay=YE?Lf(YE):u3,d3=Object.prototype,f3=d3.hasOwnProperty;function XE(t,e){var n=We(t),r=!n&&Ff(t),i=!n&&!r&&$c(t),s=!n&&!r&&!i&&ay(t),o=n||r||i||s,a=o?xM(t.length,String):[],c=a.length;for(var u in t)(e||f3.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Nf(u,c)))&&a.push(u);return a}function JE(t,e){return function(n){return t(e(n))}}var p3=JE(Object.keys,Object),h3=Object.prototype,m3=h3.hasOwnProperty;function ZE(t){if(!Rc(t))return p3(t);var e=[];for(var n in Object(t))m3.call(t,n)&&n!="constructor"&&e.push(n);return e}function Zn(t){return xr(t)?XE(t):ZE(t)}var g3=Object.prototype,y3=g3.hasOwnProperty,On=_M(function(t,e){if(Rc(e)||xr(e)){ry(e,Zn(e),t);return}for(var n in e)y3.call(e,n)&&Of(t,n,e[n])});function v3(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var w3=Object.prototype,b3=w3.hasOwnProperty;function D3(t){if(!Jn(t))return v3(t);var e=Rc(t),n=[];for(var r in t)r=="constructor"&&(e||!b3.call(t,r))||n.push(r);return n}function QE(t){return xr(t)?XE(t,!0):D3(t)}var E3=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R3=/^\w*$/;function cy(t,e){if(We(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Dc(t)?!0:R3.test(t)||!E3.test(t)||e!=null&&t in Object(e)}var Sc=$s(Object,"create");function $3(){this.__data__=Sc?Sc(null):{},this.size=0}function T3(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var S3="__lodash_hash_undefined__",k3=Object.prototype,C3=k3.hasOwnProperty;function A3(t){var e=this.__data__;if(Sc){var n=e[t];return n===S3?void 0:n}return C3.call(e,t)?e[t]:void 0}var _3=Object.prototype,P3=_3.hasOwnProperty;function x3(t){var e=this.__data__;return Sc?e[t]!==void 0:P3.call(e,t)}var I3="__lodash_hash_undefined__";function N3(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Sc&&e===void 0?I3:e,this}function Ts(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ts.prototype.clear=$3,Ts.prototype.delete=T3,Ts.prototype.get=A3,Ts.prototype.has=x3,Ts.prototype.set=N3;function O3(){this.__data__=[],this.size=0}function Mf(t,e){for(var n=t.length;n--;)if(Ec(t[n][0],e))return n;return-1}var F3=Array.prototype,L3=F3.splice;function M3(t){var e=this.__data__,n=Mf(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():L3.call(e,n,1),--this.size,!0}function B3(t){var e=this.__data__,n=Mf(e,t);return n<0?void 0:e[n][1]}function z3(t){return Mf(this.__data__,t)>-1}function q3(t,e){var n=this.__data__,r=Mf(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ri(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ri.prototype.clear=O3,ri.prototype.delete=M3,ri.prototype.get=B3,ri.prototype.has=z3,ri.prototype.set=q3;var kc=$s(Pr,"Map");function j3(){this.size=0,this.__data__={hash:new Ts,map:new(kc||ri),string:new Ts}}function U3(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Bf(t,e){var n=t.__data__;return U3(e)?n[typeof e=="string"?"string":"hash"]:n.map}function G3(t){var e=Bf(this,t).delete(t);return this.size-=e?1:0,e}function W3(t){return Bf(this,t).get(t)}function H3(t){return Bf(this,t).has(t)}function V3(t,e){var n=Bf(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ii(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ii.prototype.clear=j3,ii.prototype.delete=G3,ii.prototype.get=W3,ii.prototype.has=H3,ii.prototype.set=V3;var K3="Expected a function";function uy(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(K3);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(uy.Cache||ii),n}uy.Cache=ii;var Y3=500;function X3(t){var e=uy(t,function(r){return n.size===Y3&&n.clear(),r}),n=e.cache;return e}var J3=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z3=/\\(\\)?/g,Q3=X3(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(J3,function(n,r,i,s){e.push(i?s.replace(Z3,"$1"):r||n)}),e});function e8(t){return t==null?"":IE(t)}function zf(t,e){return We(t)?t:cy(t,e)?[t]:Q3(e8(t))}var t8=1/0;function Cc(t){if(typeof t=="string"||Dc(t))return t;var e=t+"";return e=="0"&&1/t==-t8?"-0":e}function ly(t,e){e=zf(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Cc(e[n++])];return n&&n==r?t:void 0}function n8(t,e,n){var r=t==null?void 0:ly(t,e);return r===void 0?n:r}function dy(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var eR=Xn?Xn.isConcatSpreadable:void 0;function r8(t){return We(t)||Ff(t)||!!(eR&&t&&t[eR])}function fy(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=r8),i||(i=[]);++s<o;){var a=t[s];n(a)?dy(i,a):r||(i[i.length]=a)}return i}function Qn(t){var e=t==null?0:t.length;return e?fy(t):[]}var tR=JE(Object.getPrototypeOf,Object);function nR(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function i8(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function s8(){this.__data__=new ri,this.size=0}function o8(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function a8(t){return this.__data__.get(t)}function c8(t){return this.__data__.has(t)}var u8=200;function l8(t,e){var n=this.__data__;if(n instanceof ri){var r=n.__data__;if(!kc||r.length<u8-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ii(r)}return n.set(t,e),this.size=n.size,this}function Ir(t){var e=this.__data__=new ri(t);this.size=e.size}Ir.prototype.clear=s8,Ir.prototype.delete=o8,Ir.prototype.get=a8,Ir.prototype.has=c8,Ir.prototype.set=l8;function d8(t,e){return t&&ry(e,Zn(e),t)}var rR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,iR=rR&&typeof module=="object"&&module&&!module.nodeType&&module,f8=iR&&iR.exports===rR,sR=f8?Pr.Buffer:void 0,oR=sR?sR.allocUnsafe:void 0;function p8(t,e){var n=t.length,r=oR?oR(n):new t.constructor(n);return t.copy(r),r}function py(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function aR(){return[]}var h8=Object.prototype,m8=h8.propertyIsEnumerable,cR=Object.getOwnPropertySymbols,hy=cR?function(t){return t==null?[]:(t=Object(t),py(cR(t),function(e){return m8.call(t,e)}))}:aR;function g8(t,e){return ry(t,hy(t),e)}var y8=Object.getOwnPropertySymbols,v8=y8?function(t){for(var e=[];t;)dy(e,hy(t)),t=tR(t);return e}:aR;function uR(t,e,n){var r=e(t);return We(t)?r:dy(r,n(t))}function my(t){return uR(t,Zn,hy)}function w8(t){return uR(t,QE,v8)}var gy=$s(Pr,"DataView"),yy=$s(Pr,"Promise"),No=$s(Pr,"Set"),lR="[object Map]",b8="[object Object]",dR="[object Promise]",fR="[object Set]",pR="[object WeakMap]",hR="[object DataView]",D8=Rs(gy),E8=Rs(kc),R8=Rs(yy),$8=Rs(No),T8=Rs(ey),er=Ii;(gy&&er(new gy(new ArrayBuffer(1)))!=hR||kc&&er(new kc)!=lR||yy&&er(yy.resolve())!=dR||No&&er(new No)!=fR||ey&&er(new ey)!=pR)&&(er=function(t){var e=Ii(t),n=e==b8?t.constructor:void 0,r=n?Rs(n):"";if(r)switch(r){case D8:return hR;case E8:return lR;case R8:return dR;case $8:return fR;case T8:return pR}return e});var S8=Object.prototype,k8=S8.hasOwnProperty;function C8(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&k8.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var qf=Pr.Uint8Array;function A8(t){var e=new t.constructor(t.byteLength);return new qf(e).set(new qf(t)),e}function _8(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var P8=/\w*$/;function x8(t){var e=new t.constructor(t.source,P8.exec(t));return e.lastIndex=t.lastIndex,e}var mR=Xn?Xn.prototype:void 0,gR=mR?mR.valueOf:void 0;function I8(t){return gR?Object(gR.call(t)):{}}function N8(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var O8="[object Boolean]",F8="[object Date]",L8="[object Map]",M8="[object Number]",B8="[object RegExp]",z8="[object Set]",q8="[object String]",j8="[object Symbol]",U8="[object ArrayBuffer]",G8="[object DataView]",W8="[object Float32Array]",H8="[object Float64Array]",V8="[object Int8Array]",K8="[object Int16Array]",Y8="[object Int32Array]",X8="[object Uint8Array]",J8="[object Uint8ClampedArray]",Z8="[object Uint16Array]",Q8="[object Uint32Array]";function e4(t,e,n){var r=t.constructor;switch(e){case U8:return A8(t);case O8:case F8:return new r(+t);case G8:return _8(t);case W8:case H8:case V8:case K8:case Y8:case X8:case J8:case Z8:case Q8:return N8(t);case L8:return new r;case M8:case q8:return new r(t);case B8:return x8(t);case z8:return new r;case j8:return I8(t)}}function t4(t){return typeof t.constructor=="function"&&!Rc(t)?fM(tR(t)):{}}var n4="[object Map]";function r4(t){return ur(t)&&er(t)==n4}var yR=Ni&&Ni.isMap,i4=yR?Lf(yR):r4,s4="[object Set]";function o4(t){return ur(t)&&er(t)==s4}var vR=Ni&&Ni.isSet,a4=vR?Lf(vR):o4,wR="[object Arguments]",c4="[object Array]",u4="[object Boolean]",l4="[object Date]",d4="[object Error]",bR="[object Function]",f4="[object GeneratorFunction]",p4="[object Map]",h4="[object Number]",DR="[object Object]",m4="[object RegExp]",g4="[object Set]",y4="[object String]",v4="[object Symbol]",w4="[object WeakMap]",b4="[object ArrayBuffer]",D4="[object DataView]",E4="[object Float32Array]",R4="[object Float64Array]",$4="[object Int8Array]",T4="[object Int16Array]",S4="[object Int32Array]",k4="[object Uint8Array]",C4="[object Uint8ClampedArray]",A4="[object Uint16Array]",_4="[object Uint32Array]",dt={};dt[wR]=dt[c4]=dt[b4]=dt[D4]=dt[u4]=dt[l4]=dt[E4]=dt[R4]=dt[$4]=dt[T4]=dt[S4]=dt[p4]=dt[h4]=dt[DR]=dt[m4]=dt[g4]=dt[y4]=dt[v4]=dt[k4]=dt[C4]=dt[A4]=dt[_4]=!0,dt[d4]=dt[bR]=dt[w4]=!1;function jf(t,e,n,r,i,s){var o;if(o!==void 0)return o;if(!Jn(t))return t;var a=We(t);if(a)return o=C8(t),hM(t,o);var c=er(t),u=c==bR||c==f4;if($c(t))return p8(t);if(c==DR||c==wR||u&&!i)return o=u?{}:t4(t),g8(t,d8(o,t));if(!dt[c])return i?t:{};o=e4(t,c),s||(s=new Ir);var l=s.get(t);if(l)return l;s.set(t,o),a4(t)?t.forEach(function(p){o.add(jf(p,e,n,p,t,s))}):i4(t)&&t.forEach(function(p,h){o.set(h,jf(p,e,n,h,t,s))});var d=my,f=a?void 0:d(t);return ME(f||t,function(p,h){f&&(h=p,p=t[h]),Of(o,h,jf(p,e,n,h,t,s))}),o}var P4=4;function Kt(t){return jf(t,P4)}function Ac(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var x4="__lodash_hash_undefined__";function I4(t){return this.__data__.set(t,x4),this}function N4(t){return this.__data__.has(t)}function Oo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ii;++e<n;)this.add(t[e])}Oo.prototype.add=Oo.prototype.push=I4,Oo.prototype.has=N4;function ER(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function vy(t,e){return t.has(e)}var O4=1,F4=2;function RR(t,e,n,r,i,s){var o=n&O4,a=t.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=s.get(t),l=s.get(e);if(u&&l)return u==e&&l==t;var d=-1,f=!0,p=n&F4?new Oo:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var h=t[d],v=e[d];if(r)var b=o?r(v,h,d,e,t,s):r(h,v,d,t,e,s);if(b!==void 0){if(b)continue;f=!1;break}if(p){if(!ER(e,function(g,w){if(!vy(p,w)&&(h===g||i(h,g,n,r,s)))return p.push(w)})){f=!1;break}}else if(!(h===v||i(h,v,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function L4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function wy(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var M4=1,B4=2,z4="[object Boolean]",q4="[object Date]",j4="[object Error]",U4="[object Map]",G4="[object Number]",W4="[object RegExp]",H4="[object Set]",V4="[object String]",K4="[object Symbol]",Y4="[object ArrayBuffer]",X4="[object DataView]",$R=Xn?Xn.prototype:void 0,by=$R?$R.valueOf:void 0;function J4(t,e,n,r,i,s,o){switch(n){case X4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Y4:return!(t.byteLength!=e.byteLength||!s(new qf(t),new qf(e)));case z4:case q4:case G4:return Ec(+t,+e);case j4:return t.name==e.name&&t.message==e.message;case W4:case V4:return t==e+"";case U4:var a=L4;case H4:var c=r&M4;if(a||(a=wy),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;r|=B4,o.set(t,e);var l=RR(a(t),a(e),r,i,s,o);return o.delete(t),l;case K4:if(by)return by.call(t)==by.call(e)}return!1}var Z4=1,Q4=Object.prototype,eB=Q4.hasOwnProperty;function tB(t,e,n,r,i,s){var o=n&Z4,a=my(t),c=a.length,u=my(e),l=u.length;if(c!=l&&!o)return!1;for(var d=c;d--;){var f=a[d];if(!(o?f in e:eB.call(e,f)))return!1}var p=s.get(t),h=s.get(e);if(p&&h)return p==e&&h==t;var v=!0;s.set(t,e),s.set(e,t);for(var b=o;++d<c;){f=a[d];var g=t[f],w=e[f];if(r)var R=o?r(w,g,f,e,t,s):r(g,w,f,t,e,s);if(!(R===void 0?g===w||i(g,w,n,r,s):R)){v=!1;break}b||(b=f=="constructor")}if(v&&!b){var k=t.constructor,A=e.constructor;k!=A&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof A=="function"&&A instanceof A)&&(v=!1)}return s.delete(t),s.delete(e),v}var nB=1,TR="[object Arguments]",SR="[object Array]",Uf="[object Object]",rB=Object.prototype,kR=rB.hasOwnProperty;function iB(t,e,n,r,i,s){var o=We(t),a=We(e),c=o?SR:er(t),u=a?SR:er(e);c=c==TR?Uf:c,u=u==TR?Uf:u;var l=c==Uf,d=u==Uf,f=c==u;if(f&&$c(t)){if(!$c(e))return!1;o=!0,l=!1}if(f&&!l)return s||(s=new Ir),o||ay(t)?RR(t,e,n,r,i,s):J4(t,e,c,n,r,i,s);if(!(n&nB)){var p=l&&kR.call(t,"__wrapped__"),h=d&&kR.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,b=h?e.value():e;return s||(s=new Ir),i(v,b,n,r,s)}}return f?(s||(s=new Ir),tB(t,e,n,r,i,s)):!1}function Dy(t,e,n,r,i){return t===e?!0:t==null||e==null||!ur(t)&&!ur(e)?t!==t&&e!==e:iB(t,e,n,r,Dy,i)}var sB=1,oB=2;function aB(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],c=t[a],u=o[1];if(o[2]){if(c===void 0&&!(a in t))return!1}else{var l=new Ir,d;if(!(d===void 0?Dy(u,c,sB|oB,r,l):d))return!1}}return!0}function CR(t){return t===t&&!Jn(t)}function cB(t){for(var e=Zn(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,CR(i)]}return e}function AR(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function uB(t){var e=cB(t);return e.length==1&&e[0][2]?AR(e[0][0],e[0][1]):function(n){return n===t||aB(n,t,e)}}function lB(t,e){return t!=null&&e in Object(t)}function _R(t,e,n){e=zf(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Cc(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&sy(i)&&Nf(o,i)&&(We(t)||Ff(t)))}function dB(t,e){return t!=null&&_R(t,e,lB)}var fB=1,pB=2;function hB(t,e){return cy(t)&&CR(e)?AR(Cc(t),e):function(n){var r=n8(n,t);return r===void 0&&r===e?dB(n,t):Dy(e,r,fB|pB)}}function mB(t){return function(e){return e?.[t]}}function gB(t){return function(e){return ly(e,t)}}function yB(t){return cy(t)?mB(Cc(t)):gB(t)}function lr(t){return typeof t=="function"?t:t==null?Es:typeof t=="object"?We(t)?hB(t[0],t[1]):uB(t):yB(t)}function vB(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function wB(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var c=o[++i];if(n(s[c],c,s)===!1)break}return e}}var bB=wB();function DB(t,e){return t&&bB(t,e,Zn)}function EB(t,e){return function(n,r){if(n==null)return n;if(!xr(n))return t(n,r);for(var i=n.length,s=-1,o=Object(n);++s<i&&r(o[s],s,o)!==!1;);return n}}var Ss=EB(DB);function RB(t,e,n,r){return Ss(t,function(i,s,o){e(r,i,n(i),o)}),r}function $B(t,e){return function(n,r){var i=We(n)?vB:RB,s=e?e():{};return i(n,t,lr(r),s)}}var PR=Object.prototype,TB=PR.hasOwnProperty,Ey=iy(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&jE(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=QE(s),a=-1,c=o.length;++a<c;){var u=o[a],l=t[u];(l===void 0||Ec(l,PR[u])&&!TB.call(t,u))&&(t[u]=s[u])}return t});function xR(t){return ur(t)&&xr(t)}var SB=200;function kB(t,e,n,r){var i=-1,s=zE,o=!0,a=t.length,c=[],u=e.length;if(!a)return c;e.length>=SB&&(s=vy,o=!1,e=new Oo(e));e:for(;++i<a;){var l=t[i],d=l;if(l=l!==0?l:0,o&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;c.push(l)}else s(e,d,r)||c.push(l)}return c}var Gf=iy(function(t,e){return xR(t)?kB(t,fy(e,1,xR,!0)):[]});function Fo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Yt(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:xf(e),nR(t,e<0?0:e,r)):[]}function _c(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:xf(e),e=r-e,nR(t,0,e<0?0:e)):[]}function CB(t){return typeof t=="function"?t:Es}function Ee(t,e){var n=We(t)?ME:Ss;return n(t,CB(e))}function AB(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function _B(t,e){var n=!0;return Ss(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function dr(t,e,n){var r=We(t)?AB:_B;return r(t,lr(e))}function IR(t,e){var n=[];return Ss(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function Fn(t,e){var n=We(t)?py:IR;return n(t,lr(e))}function PB(t){return function(e,n,r){var i=Object(e);if(!xr(e)){var s=lr(n);e=Zn(e),n=function(a){return s(i[a],a,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}var xB=Math.max;function IB(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:xf(n);return i<0&&(i=xB(r+i,0)),BE(t,lr(e),i)}var Lo=PB(IB);function fr(t){return t&&t.length?t[0]:void 0}function NB(t,e){var n=-1,r=xr(t)?Array(t.length):[];return Ss(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function pe(t,e){var n=We(t)?Pf:NB;return n(t,lr(e))}function Ln(t,e){return fy(pe(t,e))}var OB=Object.prototype,FB=OB.hasOwnProperty,LB=$B(function(t,e,n){FB.call(t,n)?t[n].push(e):ny(t,n,[e])}),MB=Object.prototype,BB=MB.hasOwnProperty;function zB(t,e){return t!=null&&BB.call(t,e)}function Re(t,e){return t!=null&&_R(t,e,zB)}var qB="[object String]";function Cn(t){return typeof t=="string"||!We(t)&&ur(t)&&Ii(t)==qB}function jB(t,e){return Pf(e,function(n){return t[n]})}function qt(t){return t==null?[]:jB(t,Zn(t))}var UB=Math.max;function hn(t,e,n,r){t=xr(t)?t:qt(t),n=n&&!r?xf(n):0;var i=t.length;return n<0&&(n=UB(i+n,0)),Cn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&ty(t,e,n)>-1}function NR(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return ty(t,e,i)}var GB="[object Map]",WB="[object Set]",HB=Object.prototype,VB=HB.hasOwnProperty;function at(t){if(t==null)return!0;if(xr(t)&&(We(t)||typeof t=="string"||typeof t.splice=="function"||$c(t)||ay(t)||Ff(t)))return!t.length;var e=er(t);if(e==GB||e==WB)return!t.size;if(Rc(t))return!ZE(t).length;for(var n in t)if(VB.call(t,n))return!1;return!0}var KB="[object RegExp]";function YB(t){return ur(t)&&Ii(t)==KB}var OR=Ni&&Ni.isRegExp,si=OR?Lf(OR):YB;function oi(t){return t===void 0}function XB(t,e){return t<e}function JB(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!Dc(o):n(o,a)))var a=o,c=s}return c}function ZB(t){return t&&t.length?JB(t,Es,XB):void 0}var QB="Expected a function";function e6(t){if(typeof t!="function")throw new TypeError(QB);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function t6(t,e,n,r){if(!Jn(t))return t;e=zf(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var c=Cc(e[i]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=o){var l=a[c];u=void 0,u===void 0&&(u=Jn(l)?l:Nf(e[i+1])?[]:{})}Of(a,c,u),a=a[c]}return t}function n6(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=ly(t,o);n(a,o)&&t6(s,zf(o,t),a)}return s}function pr(t,e){if(t==null)return{};var n=Pf(w8(t),function(r){return[r]});return e=lr(e),n6(t,n,function(r,i){return e(r,i[0])})}function r6(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function mn(t,e,n){var r=We(t)?i8:r6,i=arguments.length<3;return r(t,lr(e),n,i,Ss)}function Wf(t,e){var n=We(t)?py:IR;return n(t,e6(lr(e)))}function i6(t,e){var n;return Ss(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function FR(t,e,n){var r=We(t)?ER:i6;return r(t,lr(e))}var s6=1/0,o6=No&&1/wy(new No([,-0]))[1]==s6?function(t){return new No(t)}:zt,a6=200;function LR(t,e,n){var r=-1,i=zE,s=t.length,o=!0,a=[],c=a;if(s>=a6){var u=e?null:o6(t);if(u)return wy(u);o=!1,i=vy,c=new Oo}else c=e?[]:a;e:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=l!==0?l:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue e;e&&c.push(d),a.push(l)}else i(c,d,n)||(c!==a&&c.push(d),a.push(l))}return a}function Ry(t){return t&&t.length?LR(t):[]}function c6(t,e){return t&&t.length?LR(t,lr(e)):[]}function $y(t){console&&console.error&&console.error(`Error: ${t}`)}function MR(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function BR(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function zR(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function u6(t){return l6(t)?t.LABEL:t.name}function l6(t){return Cn(t.LABEL)&&t.LABEL!==""}class Nr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Ee(this.definition,n=>{n.accept(e)})}}class gn extends Nr{constructor(e){super([]),this.idx=1,On(this,pr(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Mo extends Nr{constructor(e){super(e.definition),this.orgText="",On(this,pr(e,n=>n!==void 0))}}class An extends Nr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,On(this,pr(e,n=>n!==void 0))}}class Xt extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class Mn extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class Bn extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class St extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class _n extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class Pn extends Nr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,On(this,pr(e,n=>n!==void 0))}}class gt{constructor(e){this.idx=1,On(this,pr(e,n=>n!==void 0))}accept(e){e.visit(this)}}function d6(t){return pe(t,Hf)}function Hf(t){function e(n){return pe(n,Hf)}if(t instanceof gn){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Cn(t.label)&&(n.label=t.label),n}else{if(t instanceof An)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Xt)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Mn)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Bn)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Hf(new gt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _n)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Hf(new gt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof St)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Pn)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof gt){const n={type:"Terminal",name:t.terminalType.name,label:u6(t.terminalType),idx:t.idx};Cn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=si(r)?r.source:r),n}else{if(t instanceof Mo)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Bo{visit(e){const n=e;switch(n.constructor){case gn:return this.visitNonTerminal(n);case An:return this.visitAlternative(n);case Xt:return this.visitOption(n);case Mn:return this.visitRepetitionMandatory(n);case Bn:return this.visitRepetitionMandatoryWithSeparator(n);case _n:return this.visitRepetitionWithSeparator(n);case St:return this.visitRepetition(n);case Pn:return this.visitAlternation(n);case gt:return this.visitTerminal(n);case Mo:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function f6(t){return t instanceof An||t instanceof Xt||t instanceof St||t instanceof Mn||t instanceof Bn||t instanceof _n||t instanceof gt||t instanceof Mo}function Vf(t,e=[]){return t instanceof Xt||t instanceof St||t instanceof _n?!0:t instanceof Pn?FR(t.definition,r=>Vf(r,e)):t instanceof gn&&hn(e,t)?!1:t instanceof Nr?(t instanceof gn&&e.push(t),dr(t.definition,r=>Vf(r,e))):!1}function p6(t){return t instanceof Pn}function Or(t){if(t instanceof gn)return"SUBRULE";if(t instanceof Xt)return"OPTION";if(t instanceof Pn)return"OR";if(t instanceof Mn)return"AT_LEAST_ONE";if(t instanceof Bn)return"AT_LEAST_ONE_SEP";if(t instanceof _n)return"MANY_SEP";if(t instanceof St)return"MANY";if(t instanceof gt)return"CONSUME";throw Error("non exhaustive match")}class Kf{walk(e,n=[]){Ee(e.definition,(r,i)=>{const s=Yt(e.definition,i+1);if(r instanceof gn)this.walkProdRef(r,s,n);else if(r instanceof gt)this.walkTerminal(r,s,n);else if(r instanceof An)this.walkFlat(r,s,n);else if(r instanceof Xt)this.walkOption(r,s,n);else if(r instanceof Mn)this.walkAtLeastOne(r,s,n);else if(r instanceof Bn)this.walkAtLeastOneSep(r,s,n);else if(r instanceof _n)this.walkManySep(r,s,n);else if(r instanceof St)this.walkMany(r,s,n);else if(r instanceof Pn)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new Xt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=qR(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Xt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=qR(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);Ee(e.definition,s=>{const o=new An({definition:[s]});this.walk(o,i)})}}function qR(t,e,n){return[new Xt({definition:[new gt({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function Pc(t){if(t instanceof gn)return Pc(t.referencedRule);if(t instanceof gt)return g6(t);if(f6(t))return h6(t);if(p6(t))return m6(t);throw Error("non exhaustive match")}function h6(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=Vf(s),e=e.concat(Pc(s)),r=r+1,i=n.length>r;return Ry(e)}function m6(t){const e=pe(t.definition,n=>Pc(n));return Ry(Qn(e))}function g6(t){return[t.terminalType]}const jR="_~IN~_";class y6 extends Kf{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=w6(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new An({definition:s}),a=Pc(o);this.follows[i]=a}}function v6(t){const e={};return Ee(t,n=>{const r=new y6(n).startWalking();On(e,r)}),e}function w6(t,e){return t.name+e+jR}let Yf={};const b6=new gE;function Xf(t){const e=t.toString();if(Yf.hasOwnProperty(e))return Yf[e];{const n=b6.pattern(e);return Yf[e]=n,n}}function D6(){Yf={}}const UR="Complement Sets are not supported for first char optimization",Jf=`Unable to use "first char" lexer optimizations:
|
|
13
|
+
`;function E6(t,e=!1){try{const n=Xf(t);return Ty(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===UR)e&&MR(`${Jf} Unable to optimize: < ${t.toString()} >
|
|
14
|
+
Complement Sets cannot be automatically optimized.
|
|
15
|
+
This will disable the lexer's first char optimizations.
|
|
16
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
|
|
17
|
+
This will disable the lexer's first char optimizations.
|
|
18
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),$y(`${Jf}
|
|
19
|
+
Failed parsing: < ${t.toString()} >
|
|
20
|
+
Using the @chevrotain/regexp-to-ast library
|
|
21
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function Ty(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Ty(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=s;switch(o.type){case"Character":Zf(o.value,e,n);break;case"Set":if(o.complement===!0)throw Error(UR);Ee(o.value,c=>{if(typeof c=="number")Zf(c,e,n);else{const u=c;if(n===!0)for(let l=u.from;l<=u.to;l++)Zf(l,e,n);else{for(let l=u.from;l<=u.to&&l<Ic;l++)Zf(l,e,n);if(u.to>=Ic){const l=u.from>=Ic?u.from:Ic,d=u.to,f=Oi(l),p=Oi(d);for(let h=f;h<=p;h++)e[h]=h}}}});break;case"Group":Ty(o.value,e,n);break;default:throw Error("Non Exhaustive Match")}const a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Sy(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return qt(e)}function Zf(t,e,n){const r=Oi(t);e[r]=r,n===!0&&R6(t,e)}function R6(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=Oi(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=Oi(i.charCodeAt(0));e[s]=s}}}function GR(t,e){return Lo(t.value,n=>{if(typeof n=="number")return hn(e,n);{const r=n;return Lo(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Sy(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?We(t.value)?dr(t.value,Sy):Sy(t.value):!1}class $6 extends Sf{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){hn(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?GR(e,this.targetCharCodes)===void 0&&(this.found=!0):GR(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function ky(t,e){if(e instanceof RegExp){const n=Xf(e),r=new $6(t);return r.visit(n),r.found}else return Lo(e,n=>hn(t,n.charCodeAt(0)))!==void 0}const ks="PATTERN",xc="defaultMode",Qf="modes";let WR=typeof new RegExp("(?:)").sticky=="boolean";function T6(t,e){e=Ey(e,{useSticky:WR,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
+
`],tracer:(w,R)=>R()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{K6()});let r;n("Reject Lexer.NA",()=>{r=Wf(t,w=>w[ks]===xn.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=pe(r,w=>{const R=w[ks];if(si(R)){const k=R.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!R.ignoreCase?k:k.length===2&&k[0]==="\\"&&!hn(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:e.useSticky?VR(R):HR(R)}else{if(ni(R))return i=!0,{exec:R};if(typeof R=="object")return i=!0,R;if(typeof R=="string"){if(R.length===1)return R;{const k=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(k);return e.useSticky?VR(A):HR(A)}}else throw Error("non exhaustive match")}})});let o,a,c,u,l;n("misc mapping",()=>{o=pe(r,w=>w.tokenTypeIdx),a=pe(r,w=>{const R=w.GROUP;if(R!==xn.SKIPPED){if(Cn(R))return R;if(oi(R))return!1;throw Error("non exhaustive match")}}),c=pe(r,w=>{const R=w.LONGER_ALT;if(R)return We(R)?pe(R,A=>NR(r,A)):[NR(r,R)]}),u=pe(r,w=>w.PUSH_MODE),l=pe(r,w=>Re(w,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const w=XR(e.lineTerminatorCharacters);d=pe(r,R=>!1),e.positionTracking!=="onlyOffset"&&(d=pe(r,R=>Re(R,"LINE_BREAKS")?!!R.LINE_BREAKS:YR(R,w)===!1&&ky(w,R.PATTERN)))});let f,p,h,v;n("Misc Mapping #2",()=>{f=pe(r,KR),p=pe(s,W6),h=mn(r,(w,R)=>{const k=R.GROUP;return Cn(k)&&k!==xn.SKIPPED&&(w[k]=[]),w},{}),v=pe(s,(w,R)=>({pattern:s[R],longerAlt:c[R],canLineTerminator:d[R],isCustom:f[R],short:p[R],group:a[R],push:u[R],pop:l[R],tokenTypeIdx:o[R],tokenType:r[R]}))});let b=!0,g=[];return e.safeMode||n("First Char Optimization",()=>{g=mn(r,(w,R,k)=>{if(typeof R.PATTERN=="string"){const A=R.PATTERN.charCodeAt(0),N=Oi(A);Cy(w,N,v[k])}else if(We(R.START_CHARS_HINT)){let A;Ee(R.START_CHARS_HINT,N=>{const _=typeof N=="string"?N.charCodeAt(0):N,B=Oi(_);A!==B&&(A=B,Cy(w,B,v[k]))})}else if(si(R.PATTERN))if(R.PATTERN.unicode)b=!1,e.ensureOptimizations&&$y(`${Jf} Unable to analyze < ${R.PATTERN.toString()} > pattern.
|
|
23
|
+
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
24
|
+
This will disable the lexer's first char optimizations.
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=E6(R.PATTERN,e.ensureOptimizations);at(A)&&(b=!1),Ee(A,N=>{Cy(w,N,v[k])})}else e.ensureOptimizations&&$y(`${Jf} TokenType: <${R.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
26
|
+
This will disable the lexer's first char optimizations.
|
|
27
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),b=!1;return w},[])}),{emptyGroups:h,patternIdxToConfig:v,charCodeToPatternIdxToConfig:g,hasCustom:i,canBeOptimized:b}}function S6(t,e){let n=[];const r=C6(t);n=n.concat(r.errors);const i=A6(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(k6(s)),n=n.concat(L6(s)),n=n.concat(M6(s,e)),n=n.concat(B6(s)),n}function k6(t){let e=[];const n=Fn(t,r=>si(r[ks]));return e=e.concat(P6(n)),e=e.concat(N6(n)),e=e.concat(O6(n)),e=e.concat(F6(n)),e=e.concat(x6(n)),e}function C6(t){const e=Fn(t,i=>!Re(i,ks)),n=pe(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:kt.MISSING_PATTERN,tokenTypes:[i]})),r=Gf(t,e);return{errors:n,valid:r}}function A6(t){const e=Fn(t,i=>{const s=i[ks];return!si(s)&&!ni(s)&&!Re(s,"exec")&&!Cn(s)}),n=pe(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:kt.INVALID_PATTERN,tokenTypes:[i]})),r=Gf(t,e);return{errors:n,valid:r}}const _6=/[^\\][$]/;function P6(t){class e extends Sf{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=Fn(t,i=>{const s=i.PATTERN;try{const o=Xf(s),a=new e;return a.visit(o),a.found}catch{return _6.test(s.source)}});return pe(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
28
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
29
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:kt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function x6(t){const e=Fn(t,r=>r.PATTERN.test(""));return pe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:kt.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const I6=/[^\\[][\^]|^\^/;function N6(t){class e extends Sf{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=Fn(t,i=>{const s=i.PATTERN;try{const o=Xf(s),a=new e;return a.visit(o),a.found}catch{return I6.test(s.source)}});return pe(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
30
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:kt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function O6(t){const e=Fn(t,r=>{const i=r[ks];return i instanceof RegExp&&(i.multiline||i.global)});return pe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:kt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function F6(t){const e=[];let n=pe(t,s=>mn(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!hn(e,a)&&a.PATTERN!==xn.NA&&(e.push(a),o.push(a)),o),[]));n=Ac(n);const r=Fn(n,s=>s.length>1);return pe(r,s=>{const o=pe(s,c=>c.name);return{message:`The same RegExp pattern ->${fr(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:kt.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function L6(t){const e=Fn(t,r=>{if(!Re(r,"GROUP"))return!1;const i=r.GROUP;return i!==xn.SKIPPED&&i!==xn.NA&&!Cn(i)});return pe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:kt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function M6(t,e){const n=Fn(t,i=>i.PUSH_MODE!==void 0&&!hn(e,i.PUSH_MODE));return pe(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:kt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function B6(t){const e=[],n=mn(t,(r,i,s)=>{const o=i.PATTERN;return o===xn.NA||(Cn(o)?r.push({str:o,idx:s,tokenType:i}):si(o)&&q6(o)&&r.push({str:o.source,idx:s,tokenType:i})),r},[]);return Ee(t,(r,i)=>{Ee(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&z6(s,r.PATTERN)){const c=`Token: ->${a.name}<- can never be matched.
|
|
32
|
+
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
33
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:kt.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function z6(t,e){if(si(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(ni(e))return e(t,0,[],{});if(Re(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function q6(t){return Lo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function HR(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function VR(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function j6(t,e,n){const r=[];return Re(t,xc)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+xc+`> property in its definition
|
|
34
|
+
`,type:kt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Re(t,Qf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Qf+`> property in its definition
|
|
35
|
+
`,type:kt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Re(t,Qf)&&Re(t,xc)&&!Re(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${xc}: <${t.defaultMode}>which does not exist
|
|
36
|
+
`,type:kt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Re(t,Qf)&&Ee(t.modes,(i,s)=>{Ee(i,(o,a)=>{if(oi(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
|
|
37
|
+
`,type:kt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Re(o,"LONGER_ALT")){const c=We(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];Ee(c,u=>{!oi(u)&&!hn(i,u)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${s}>
|
|
38
|
+
`,type:kt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function U6(t,e,n){const r=[];let i=!1;const s=Ac(Qn(qt(t.modes))),o=Wf(s,c=>c[ks]===xn.NA),a=XR(n);return e&&Ee(o,c=>{const u=YR(c,a);if(u!==!1){const d={message:V6(c,u),type:u.issue,tokenType:c};r.push(d)}else Re(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):ky(a,c.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
39
|
+
This Lexer has been defined to track line and column information,
|
|
40
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
41
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
42
|
+
for details.`,type:kt.NO_LINE_BREAKS_FLAGS}),r}function G6(t){const e={},n=Zn(t);return Ee(n,r=>{const i=t[r];if(We(i))e[r]=[];else throw Error("non exhaustive match")}),e}function KR(t){const e=t.PATTERN;if(si(e))return!1;if(ni(e))return!0;if(Re(e,"exec"))return!0;if(Cn(e))return!1;throw Error("non exhaustive match")}function W6(t){return Cn(t)&&t.length===1?t.charCodeAt(0):!1}const H6={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function YR(t,e){if(Re(t,"LINE_BREAKS"))return!1;if(si(t.PATTERN)){try{ky(e,t.PATTERN)}catch(n){return{issue:kt.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(Cn(t.PATTERN))return!1;if(KR(t))return{issue:kt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function V6(t,e){if(e.issue===kt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
43
|
+
The problem is in the <${t.name}> Token Type
|
|
44
|
+
Root cause: ${e.errMsg}.
|
|
45
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===kt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
46
|
+
The problem is in the <${t.name}> Token Type
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function XR(t){return pe(t,n=>Cn(n)?n.charCodeAt(0):n)}function Cy(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Ic=256;let ep=[];function Oi(t){return t<Ic?t:ep[t]}function K6(){if(at(ep)){ep=new Array(65536);for(let t=0;t<65536;t++)ep[t]=t>255?255+~~(t/255):t}}function Nc(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function tp(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let JR=1;const ZR={};function Oc(t){const e=Y6(t);X6(e),Z6(e),J6(e),Ee(e,n=>{n.isParent=n.categoryMatches.length>0})}function Y6(t){let e=Kt(t),n=t,r=!0;for(;r;){n=Ac(Qn(pe(n,s=>s.CATEGORIES)));const i=Gf(n,e);e=e.concat(i),at(i)?r=!1:n=i}return e}function X6(t){Ee(t,e=>{e$(e)||(ZR[JR]=e,e.tokenTypeIdx=JR++),t$(e)&&!We(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),t$(e)||(e.CATEGORIES=[]),Q6(e)||(e.categoryMatches=[]),ez(e)||(e.categoryMatchesMap={})})}function J6(t){Ee(t,e=>{e.categoryMatches=[],Ee(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(ZR[r].tokenTypeIdx)})})}function Z6(t){Ee(t,e=>{QR([],e)})}function QR(t,e){Ee(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),Ee(e.CATEGORIES,n=>{const r=t.concat(e);hn(r,n)||QR(r,n)})}function e$(t){return Re(t,"tokenTypeIdx")}function t$(t){return Re(t,"CATEGORIES")}function Q6(t){return Re(t,"categoryMatches")}function ez(t){return Re(t,"categoryMatchesMap")}function tz(t){return Re(t,"tokenTypeIdx")}const Ay={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var kt;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(kt||(kt={}));const Fc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ay,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Fc);class xn{constructor(e,n=Fc){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${i}>`);const{time:a,value:c}=BR(s),u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${o}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
49
|
+
a boolean 2nd argument is no longer supported`);this.config=On({},Fc,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Fc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=H6;else if(this.config.lineTerminatorCharacters===Fc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
50
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),We(e)?i={modes:{defaultMode:Kt(e)},defaultMode:xc}:(s=!1,i=Kt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(j6(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(U6(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Ee(i.modes,(a,c)=>{i.modes[c]=Wf(a,u=>oi(u))});const o=Zn(i.modes);if(Ee(i.modes,(a,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(S6(a,o))}),at(this.lexerDefinitionErrors)){Oc(a);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=T6(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=u.charCodeToPatternIdxToConfig,this.emptyGroups=On({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!at(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=pe(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
|
|
51
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
+
`+c)}Ee(this.lexerDefinitionWarning,a=>{MR(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(WR?(this.chopInput=Es,this.match=this.matchWithTest):(this.updateLastIndex=zt,this.match=this.matchWithExec),s&&(this.handleModes=zt),this.trackStartLines===!1&&(this.computeNewColumn=Es),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=zt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const a=mn(this.canModeBeOptimized,(c,u,l)=>(u===!1&&c.push(l),c),[]);if(n.ensureOptimizations&&!at(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
|
|
53
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{D6()}),this.TRACE_INIT("toFastProperties",()=>{zR(this)})})}tokenize(e,n=this.defaultMode){if(!at(this.lexerDefinitionErrors)){const i=pe(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
55
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
+
`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,o,a,c,u,l,d,f,p,h,v,b,g;const w=e,R=w.length;let k=0,A=0;const N=this.hasCustom?0:Math.floor(e.length/10),_=new Array(N),B=[];let z=this.trackStartLines?1:void 0,Q=this.trackStartLines?1:void 0;const I=G6(this.emptyGroups),T=this.trackStartLines,$=this.config.lineTerminatorsPattern;let L=0,V=[],H=[];const K=[],we=[];Object.freeze(we);let te;function C(){return V}function he(Ie){const oe=Oi(Ie),be=H[oe];return be===void 0?we:be}const Ye=Ie=>{if(K.length===1&&Ie.tokenType.PUSH_MODE===void 0){const oe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Ie);B.push({offset:Ie.startOffset,line:Ie.startLine,column:Ie.startColumn,length:Ie.image.length,message:oe})}else{K.pop();const oe=Fo(K);V=this.patternIdxToConfig[oe],H=this.charCodeToPatternIdxToConfig[oe],L=V.length;const be=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;H&&be?te=he:te=C}};function pt(Ie){K.push(Ie),H=this.charCodeToPatternIdxToConfig[Ie],V=this.patternIdxToConfig[Ie],L=V.length,L=V.length;const oe=this.canModeBeOptimized[Ie]&&this.config.safeMode===!1;H&&oe?te=he:te=C}pt.call(this,n);let W;const X=this.config.recoveryEnabled;for(;k<R;){c=null;const Ie=w.charCodeAt(k),oe=te(Ie),be=oe.length;for(r=0;r<be;r++){W=oe[r];const Se=W.pattern;u=null;const ae=W.short;if(ae!==!1?Ie===ae&&(c=Se):W.isCustom===!0?(g=Se.exec(w,k,_,I),g!==null?(c=g[0],g.payload!==void 0&&(u=g.payload)):c=null):(this.updateLastIndex(Se,k),c=this.match(Se,e,k)),c!==null){if(a=W.longerAlt,a!==void 0){const O=a.length;for(s=0;s<O;s++){const j=V[a[s]],de=j.pattern;if(l=null,j.isCustom===!0?(g=de.exec(w,k,_,I),g!==null?(o=g[0],g.payload!==void 0&&(l=g.payload)):o=null):(this.updateLastIndex(de,k),o=this.match(de,e,k)),o&&o.length>c.length){c=o,u=l,W=j;break}}}break}}if(c!==null){if(d=c.length,f=W.group,f!==void 0&&(p=W.tokenTypeIdx,h=this.createTokenInstance(c,k,p,W.tokenType,z,Q,d),this.handlePayload(h,u),f===!1?A=this.addToken(_,A,h):I[f].push(h)),e=this.chopInput(e,d),k=k+d,Q=this.computeNewColumn(Q,d),T===!0&&W.canLineTerminator===!0){let Se=0,ae,O;$.lastIndex=0;do ae=$.test(c),ae===!0&&(O=$.lastIndex-1,Se++);while(ae===!0);Se!==0&&(z=z+Se,Q=d-O,this.updateTokenEndLineColumnLocation(h,f,O,Se,z,Q,d))}this.handleModes(W,Ye,pt,h)}else{const Se=k,ae=z,O=Q;let j=X===!1;for(;j===!1&&k<R;)for(e=this.chopInput(e,1),k++,i=0;i<L;i++){const de=V[i],U=de.pattern,ce=de.short;if(ce!==!1?w.charCodeAt(k)===ce&&(j=!0):de.isCustom===!0?j=U.exec(w,k,_,I)!==null:(this.updateLastIndex(U,k),j=U.exec(e)!==null),j===!0)break}if(v=k-Se,Q=this.computeNewColumn(Q,v),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,Se,v,ae,O),B.push({offset:Se,line:ae,column:O,length:v,message:b}),X===!1)break}}return this.hasCustom||(_.length=A),{tokens:_,groups:I,errors:B}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=n}updateTokenEndLineColumnLocation(e,n,r,i,s,o,a){let c,u;n!==void 0&&(c=r===a-1,u=c?-1:0,i===1&&c===!0||(e.endLine=s+u,e.endColumn=o-1+-u))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,o){return{image:e,startOffset:n,startLine:s,startColumn:o,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:n+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+a-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}xn.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",xn.NA=/NOT_APPLICABLE/;function zo(t){return n$(t)?t.LABEL:t.name}function n$(t){return Cn(t.LABEL)&&t.LABEL!==""}const nz="parent",r$="categories",i$="label",s$="group",o$="push_mode",a$="pop_mode",c$="longer_alt",u$="line_breaks",l$="start_chars_hint";function d$(t){return rz(t)}function rz(t){const e=t.pattern,n={};if(n.name=t.name,oi(e)||(n.PATTERN=e),Re(t,nz))throw`The parent property is no longer supported.
|
|
57
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Re(t,r$)&&(n.CATEGORIES=t[r$]),Oc([n]),Re(t,i$)&&(n.LABEL=t[i$]),Re(t,s$)&&(n.GROUP=t[s$]),Re(t,a$)&&(n.POP_MODE=t[a$]),Re(t,o$)&&(n.PUSH_MODE=t[o$]),Re(t,c$)&&(n.LONGER_ALT=t[c$]),Re(t,u$)&&(n.LINE_BREAKS=t[u$]),Re(t,l$)&&(n.START_CHARS_HINT=t[l$]),n}const Fi=d$({name:"EOF",pattern:xn.NA});Oc([Fi]);function _y(t,e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function f$(t,e){return Nc(t,e)}const qo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${n$(t)?`--> ${zo(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",a=`
|
|
58
|
+
but found: '`+fr(e).image+"'";if(r)return s+r+a;{const c=mn(t,(f,p)=>f.concat(p),[]),u=pe(c,f=>`[${pe(f,p=>zo(p)).join(", ")}]`),d=`one of these possible Token sequences:
|
|
59
|
+
${pe(u,(f,p)=>` ${p+1}. ${f}`).join(`
|
|
60
|
+
`)}`;return s+d+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",o=`
|
|
61
|
+
but found: '`+fr(e).image+"'";if(n)return i+n+o;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
|
+
<${pe(t,u=>`[${pe(u,l=>zo(l)).join(",")}]`).join(" ,")}>`;return i+c+o}}};Object.freeze(qo);const iz={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
+
inside top level rule: ->`+t.name+"<-"}},Cs={buildDuplicateFoundError(t,e){function n(l){return l instanceof gt?l.terminalType.name:l instanceof gn?l.nonTerminalName:""}const r=t.name,i=fr(e),s=i.idx,o=Or(i),a=n(i),c=s>0;let u=`->${o}${c?s:""}<- ${a?`with argument: ->${a}<-`:""}
|
|
64
|
+
appears more than once (${e.length} times) in the top level rule: ->${r}<-.
|
|
65
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
|
+
`;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
|
|
67
|
+
`),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
68
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
69
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
70
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
71
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=pe(t.prefixPath,i=>zo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
72
|
+
in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
73
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
74
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
75
|
+
For Further details.`},buildAlternationAmbiguityError(t){const e=pe(t.prefixPath,i=>zo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
76
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
77
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
78
|
+
For Further details.`,r},buildEmptyRepetitionError(t){let e=Or(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
79
|
+
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
80
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
81
|
+
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
82
|
+
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=pe(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
83
|
+
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
84
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
85
|
+
${r}
|
|
86
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
87
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Mo?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function sz(t,e){const n=new oz(t,e);return n.resolveRefs(),n.errors}class oz extends Bo{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){Ee(qt(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:yn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class az extends Kf{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Kt(this.path.ruleStack).reverse(),this.occurrenceStack=Kt(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){at(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class cz extends az{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new An({definition:i});this.possibleTokTypes=Pc(s),this.found=!0}}}class np extends Kf{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class uz extends np{walkMany(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class p$ extends np{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class lz extends np{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class h$ extends np{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Py(t,e,n=[]){n=Kt(n);let r=[],i=0;function s(a){return a.concat(Yt(t,i+1))}function o(a){const c=Py(s(a),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof An)return o(a.definition);if(a instanceof gn)return o(a.definition);if(a instanceof Xt)r=o(a.definition);else if(a instanceof Mn){const c=a.definition.concat([new St({definition:a.definition})]);return o(c)}else if(a instanceof Bn){const c=[new An({definition:a.definition}),new St({definition:[new gt({terminalType:a.separator})].concat(a.definition)})];return o(c)}else if(a instanceof _n){const c=a.definition.concat([new St({definition:[new gt({terminalType:a.separator})].concat(a.definition)})]);r=o(c)}else if(a instanceof St){const c=a.definition.concat([new St({definition:a.definition})]);r=o(c)}else{if(a instanceof Pn)return Ee(a.definition,c=>{at(c.definition)===!1&&(r=o(c.definition))}),r;if(a instanceof gt)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Yt(t,i)}),r}function m$(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const c=e.length,u=c-r-1,l=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!at(d);){const f=d.pop();if(f===o){a&&Fo(d).idx<=u&&d.pop();continue}const p=f.def,h=f.idx,v=f.ruleStack,b=f.occurrenceStack;if(at(p))continue;const g=p[0];if(g===i){const w={idx:h,def:Yt(p),ruleStack:_c(v),occurrenceStack:_c(b)};d.push(w)}else if(g instanceof gt)if(h<c-1){const w=h+1,R=e[w];if(n(R,g.terminalType)){const k={idx:w,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(k)}}else if(h===c-1)l.push({nextTokenType:g.terminalType,nextTokenOccurrence:g.idx,ruleStack:v,occurrenceStack:b}),a=!0;else throw Error("non exhaustive match");else if(g instanceof gn){const w=Kt(v);w.push(g.nonTerminalName);const R=Kt(b);R.push(g.idx);const k={idx:h,def:g.definition.concat(s,Yt(p)),ruleStack:w,occurrenceStack:R};d.push(k)}else if(g instanceof Xt){const w={idx:h,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(w),d.push(o);const R={idx:h,def:g.definition.concat(Yt(p)),ruleStack:v,occurrenceStack:b};d.push(R)}else if(g instanceof Mn){const w=new St({definition:g.definition,idx:g.idx}),R=g.definition.concat([w],Yt(p)),k={idx:h,def:R,ruleStack:v,occurrenceStack:b};d.push(k)}else if(g instanceof Bn){const w=new gt({terminalType:g.separator}),R=new St({definition:[w].concat(g.definition),idx:g.idx}),k=g.definition.concat([R],Yt(p)),A={idx:h,def:k,ruleStack:v,occurrenceStack:b};d.push(A)}else if(g instanceof _n){const w={idx:h,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(w),d.push(o);const R=new gt({terminalType:g.separator}),k=new St({definition:[R].concat(g.definition),idx:g.idx}),A=g.definition.concat([k],Yt(p)),N={idx:h,def:A,ruleStack:v,occurrenceStack:b};d.push(N)}else if(g instanceof St){const w={idx:h,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(w),d.push(o);const R=new St({definition:g.definition,idx:g.idx}),k=g.definition.concat([R],Yt(p)),A={idx:h,def:k,ruleStack:v,occurrenceStack:b};d.push(A)}else if(g instanceof Pn)for(let w=g.definition.length-1;w>=0;w--){const R=g.definition[w],k={idx:h,def:R.definition.concat(Yt(p)),ruleStack:v,occurrenceStack:b};d.push(k),d.push(o)}else if(g instanceof An)d.push({idx:h,def:g.definition.concat(Yt(p)),ruleStack:v,occurrenceStack:b});else if(g instanceof Mo)d.push(dz(g,h,v,b));else throw Error("non exhaustive match")}return l}function dz(t,e,n,r){const i=Kt(n);i.push(t.name);const s=Kt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var Dt;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Dt||(Dt={}));function xy(t){if(t instanceof Xt||t==="Option")return Dt.OPTION;if(t instanceof St||t==="Repetition")return Dt.REPETITION;if(t instanceof Mn||t==="RepetitionMandatory")return Dt.REPETITION_MANDATORY;if(t instanceof Bn||t==="RepetitionMandatoryWithSeparator")return Dt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof _n||t==="RepetitionWithSeparator")return Dt.REPETITION_WITH_SEPARATOR;if(t instanceof Pn||t==="Alternation")return Dt.ALTERNATION;throw Error("non exhaustive match")}function g$(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=xy(r);return s===Dt.ALTERNATION?rp(e,n,i):ip(e,n,s,i)}function fz(t,e,n,r,i,s){const o=rp(t,e,n),a=b$(o)?tp:Nc;return s(o,r,a,i)}function pz(t,e,n,r,i,s){const o=ip(t,e,i,n),a=b$(o)?tp:Nc;return s(o[0],a,r)}function hz(t,e,n,r){const i=t.length,s=dr(t,o=>dr(o,a=>a.length===1));if(e)return function(o){const a=pe(o,c=>c.GATE);for(let c=0;c<i;c++){const u=t[c],l=u.length,d=a[c];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<l;f++){const p=u[f],h=p.length;for(let v=0;v<h;v++){const b=this.LA(v+1);if(n(b,p[v])===!1)continue e}return c}}};if(s&&!r){const o=pe(t,c=>Qn(c)),a=mn(o,(c,u,l)=>(Ee(u,d=>{Re(c,d.tokenTypeIdx)||(c[d.tokenTypeIdx]=l),Ee(d.categoryMatches,f=>{Re(c,f)||(c[f]=l)})}),c),{});return function(){const c=this.LA(1);return a[c.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){const a=t[o],c=a.length;e:for(let u=0;u<c;u++){const l=a[u],d=l.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(n(p,l[f])===!1)continue e}return o}}}}function mz(t,e,n){const r=dr(t,s=>s.length===1),i=t.length;if(r&&!n){const s=Qn(t);if(s.length===1&&at(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{const o=mn(s,(a,c,u)=>(a[c.tokenTypeIdx]=!0,Ee(c.categoryMatches,l=>{a[l]=!0}),a),[]);return function(){const a=this.LA(1);return o[a.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const o=t[s],a=o.length;for(let c=0;c<a;c++){const u=this.LA(c+1);if(e(u,o[c])===!1)continue e}return!0}return!1}}class gz extends Kf{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,Dt.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,Dt.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,Dt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,Dt.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,Dt.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class y$ extends Bo{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Dt.OPTION)}visitRepetition(e){this.checkIsTarget(e,Dt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Dt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Dt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Dt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Dt.ALTERNATION)}}function v$(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Iy(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const o=e[s];i.push(o+"_"+r.tokenTypeIdx);for(let a=0;a<r.categoryMatches.length;a++){const c="_"+r.categoryMatches[a];i.push(o+c)}}e=i}return e}function yz(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const o=e[s];if(i[o]===!0)return!1}}return!0}function w$(t,e){const n=pe(t,o=>Py([o],1)),r=v$(n.length),i=pe(n,o=>{const a={};return Ee(o,c=>{const u=Iy(c.partialPath);Ee(u,l=>{a[l]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=v$(a.length);for(let c=0;c<a.length;c++){const u=a[c];for(let l=0;l<u.length;l++){const d=u[l].partialPath,f=u[l].suffixDef,p=Iy(d);if(yz(i,p,c)||at(f)||d.length===e){const v=r[c];if(Ny(v,d)===!1){v.push(d);for(let b=0;b<p.length;b++){const g=p[b];i[c][g]=!0}}}else{const v=Py(f,o+1,d);s[c]=s[c].concat(v),Ee(v,b=>{const g=Iy(b.partialPath);Ee(g,w=>{i[c][w]=!0})})}}}}return r}function rp(t,e,n,r){const i=new y$(t,Dt.ALTERNATION,r);return e.accept(i),w$(i.result,n)}function ip(t,e,n,r){const i=new y$(t,n);e.accept(i);const s=i.result,a=new gz(e,t,n).startWalking(),c=new An({definition:s}),u=new An({definition:a});return w$([c,u],r)}function Ny(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],o=r[i];if((s===o||o.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function vz(t,e){return t.length<e.length&&dr(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function b$(t){return dr(t,e=>dr(e,n=>dr(n,r=>at(r.categoryMatches))))}function wz(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return pe(e,n=>Object.assign({type:yn.CUSTOM_LOOKAHEAD_VALIDATION},n))}function bz(t,e,n,r){const i=Ln(t,c=>Dz(c,n)),s=Iz(t,e,n),o=Ln(t,c=>Az(c,n)),a=Ln(t,c=>$z(c,t,r,n));return i.concat(s,o,a)}function Dz(t,e){const n=new Rz;t.accept(n);const r=n.allProductions,i=LB(r,Ez),s=pr(i,a=>a.length>1);return pe(qt(s),a=>{const c=fr(a),u=e.buildDuplicateFoundError(t,a),l=Or(c),d={message:u,type:yn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:c.idx},f=D$(c);return f&&(d.parameter=f),d})}function Ez(t){return`${Or(t)}_#_${t.idx}_#_${D$(t)}`}function D$(t){return t instanceof gt?t.terminalType.name:t instanceof gn?t.nonTerminalName:""}class Rz extends Bo{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function $z(t,e,n,r){const i=[];if(mn(e,(o,a)=>a.name===t.name?o+1:o,0)>1){const o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:yn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Tz(t,e,n){const r=[];let i;return hn(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:yn.INVALID_RULE_OVERRIDE,ruleName:t})),r}function E$(t,e,n,r=[]){const i=[],s=sp(e.definition);if(at(s))return[];{const o=t.name;hn(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:yn.LEFT_RECURSION,ruleName:o});const c=Gf(s,r.concat([t])),u=Ln(c,l=>{const d=Kt(r);return d.push(l),E$(t,l,n,d)});return i.concat(u)}}function sp(t){let e=[];if(at(t))return e;const n=fr(t);if(n instanceof gn)e.push(n.referencedRule);else if(n instanceof An||n instanceof Xt||n instanceof Mn||n instanceof Bn||n instanceof _n||n instanceof St)e=e.concat(sp(n.definition));else if(n instanceof Pn)e=Qn(pe(n.definition,s=>sp(s.definition)));else if(!(n instanceof gt))throw Error("non exhaustive match");const r=Vf(n),i=t.length>1;if(r&&i){const s=Yt(t);return e.concat(sp(s))}else return e}class Oy extends Bo{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Sz(t,e){const n=new Oy;t.accept(n);const r=n.alternations;return Ln(r,s=>{const o=_c(s.definition);return Ln(o,(a,c)=>{const u=m$([a],[],Nc,1);return at(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:yn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function kz(t,e,n){const r=new Oy;t.accept(r);let i=r.alternations;return i=Wf(i,o=>o.ignoreAmbiguities===!0),Ln(i,o=>{const a=o.idx,c=o.maxLookahead||e,u=rp(a,t,c,o),l=Pz(u,o,t,n),d=xz(u,o,t,n);return l.concat(d)})}class Cz extends Bo{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function Az(t,e){const n=new Oy;t.accept(n);const r=n.alternations;return Ln(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:yn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function _z(t,e,n){const r=[];return Ee(t,i=>{const s=new Cz;i.accept(s);const o=s.allProductions;Ee(o,a=>{const c=xy(a),u=a.maxLookahead||e,l=a.idx,f=ip(l,i,c,u)[0];if(at(Qn(f))){const p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:p,type:yn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function Pz(t,e,n,r){const i=[],s=mn(t,(a,c,u)=>(e.definition[u].ignoreAmbiguities===!0||Ee(c,l=>{const d=[u];Ee(t,(f,p)=>{u!==p&&Ny(f,l)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Ny(i,l)&&(i.push(l),a.push({alts:d,path:l}))}),a),[]);return pe(s,a=>{const c=pe(a.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:yn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function xz(t,e,n,r){const i=mn(t,(o,a,c)=>{const u=pe(a,l=>({idx:c,path:l}));return o.concat(u)},[]);return Ac(Ln(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,u=o.path,l=Fn(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<c&&vz(f.path,u));return pe(l,f=>{const p=[f.idx+1,c+1],h=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:yn.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:h,alternatives:p}})}))}function Iz(t,e,n){const r=[],i=pe(e,s=>s.name);return Ee(t,s=>{const o=s.name;if(hn(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:yn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function Nz(t){const e=Ey(t,{errMsgProvider:iz}),n={};return Ee(t.rules,r=>{n[r.name]=r}),sz(n,e.errMsgProvider)}function Oz(t){return t=Ey(t,{errMsgProvider:Cs}),bz(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const R$="MismatchedTokenException",$$="NoViableAltException",T$="EarlyExitException",S$="NotAllInputParsedException",k$=[R$,$$,T$,S$];Object.freeze(k$);function op(t){return hn(k$,t.name)}class ap extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class C$ extends ap{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=R$}}class Fz extends ap{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=$$}}class Lz extends ap{constructor(e,n){super(e,n),this.name=S$}}class Mz extends ap{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=T$}}const Fy={},A$="InRuleRecoveryException";class Bz extends Error{constructor(e){super(e),this.name=A$}}class zz{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Re(e,"recoveryEnabled")?e.recoveryEnabled:ai.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=qz)}getTokenToInsert(e){const n=_y(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),o=this.exportLexerState(),a=[];let c=!1;const u=this.LA(1);let l=this.LA(1);const d=()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),h=new C$(p,u,this.LA(0));h.resyncedTokens=_c(a),this.SAVE_ERROR(h)};for(;!c;)if(this.tokenMatcher(l,i)){d();return}else if(r.call(this)){d(),e.apply(this,n);return}else this.tokenMatcher(l,s)?c=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,a));this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new Bz("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||at(n))return!1;const r=this.LA(1);return Lo(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return hn(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=Lo(e,s=>f$(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Fy;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return pe(e,(r,i)=>i===0?Fy:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=pe(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Qn(e)}getFollowSetFromFollowKey(e){if(e===Fy)return[Fi];const n=e.ruleName+e.idxInCallingRule+jR+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,Fi)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return _c(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=Kt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return pe(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function qz(t,e,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(c===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];c=new s(p,i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,l=c.occurrence;const d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Fi,l=1),!(u===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,l,o)&&this.tryInRepetitionRecovery(t,e,n,u)}const jz=4,Li=8,_$=1<<Li,P$=2<<Li,Ly=3<<Li,My=4<<Li,By=5<<Li,cp=6<<Li;function zy(t,e,n){return n|e|t}class qy{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:ai.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(at(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return Ln(e,n=>E$(n,n,Cs))}validateEmptyOrAlternatives(e){return Ln(e,n=>Sz(n,Cs))}validateAmbiguousAlternationAlternatives(e,n){return Ln(e,r=>kz(r,n,Cs))}validateSomeNonEmptyLookaheadPath(e,n){return _z(e,n,Cs)}buildLookaheadForAlternation(e){return fz(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,hz)}buildLookaheadForOptional(e){return pz(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,xy(e.prodType),mz)}}class Uz{initLooksAhead(e){this.dynamicTokensEnabled=Re(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:ai.dynamicTokensEnabled,this.maxLookahead=Re(e,"maxLookahead")?e.maxLookahead:ai.maxLookahead,this.lookaheadStrategy=Re(e,"lookaheadStrategy")?e.lookaheadStrategy:new qy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Ee(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=Wz(n);Ee(r,u=>{const l=u.idx===0?"":u.idx;this.TRACE_INIT(`${Or(u)}${l}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:n,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=zy(this.fullRuleNameToShort[n.name],_$,u.idx);this.setLaFuncCache(f,d)})}),Ee(i,u=>{this.computeLookaheadFunc(n,u.idx,Ly,"Repetition",u.maxLookahead,Or(u))}),Ee(s,u=>{this.computeLookaheadFunc(n,u.idx,P$,"Option",u.maxLookahead,Or(u))}),Ee(o,u=>{this.computeLookaheadFunc(n,u.idx,My,"RepetitionMandatory",u.maxLookahead,Or(u))}),Ee(a,u=>{this.computeLookaheadFunc(n,u.idx,cp,"RepetitionMandatoryWithSeparator",u.maxLookahead,Or(u))}),Ee(c,u=>{this.computeLookaheadFunc(n,u.idx,By,"RepetitionWithSeparator",u.maxLookahead,Or(u))})})})}computeLookaheadFunc(e,n,r,i,s,o){this.TRACE_INIT(`${o}${n===0?"":n}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=zy(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return zy(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class Gz extends Bo{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const up=new Gz;function Wz(t){up.reset(),t.accept(up);const e=up.dslMethods;return up.reset(),e}function x$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function I$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function Hz(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function Vz(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const Kz="name";function N$(t,e){Object.defineProperty(t,Kz,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Yz(t,e){const n=Zn(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],o=t[s],a=o.length;for(let c=0;c<a;c++){const u=o[c];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function Xz(t,e){const n=function(){};N$(n,t+"BaseSemantics");const r={visit:function(i,s){if(We(i)&&(i=i[0]),!oi(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=Zz(this,e);if(!at(i)){const s=pe(i,o=>o.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
88
|
+
${s.join(`
|
|
89
|
+
|
|
90
|
+
`).replace(/\n/g,`
|
|
91
|
+
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function Jz(t,e,n){const r=function(){};N$(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return Ee(e,s=>{i[s]=Yz}),r.prototype=i,r.prototype.constructor=r,r}var jy;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(jy||(jy={}));function Zz(t,e){return Qz(t,e)}function Qz(t,e){const n=Fn(e,i=>ni(t[i])===!1),r=pe(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:jy.MISSING_METHOD,methodName:i}));return Ac(r)}class e5{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Re(e,"nodeLocationTracking")?e.nodeLocationTracking:ai.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=zt,this.cstFinallyStateUpdate=zt,this.cstPostTerminal=zt,this.cstPostNonTerminal=zt,this.cstPostRule=zt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=I$,this.setNodeLocationFromNode=I$,this.cstPostRule=zt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=x$,this.setNodeLocationFromNode=x$,this.cstPostRule=zt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=zt,this.setInitialNodeLocation=zt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Hz(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Vz(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(oi(this.baseCstVisitorConstructor)){const e=Xz(this.className,Zn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(oi(this.baseCstVisitorWithDefaultsConstructor)){const e=Jz(this.className,Zn(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class t5{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):fp}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?fp:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class n5{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=pp){if(hn(this.definedRulesNames,e)){const o={message:Cs.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:yn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=pp){const i=Tz(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(op(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return d6(qt(this.gastProductionsCache))}}class r5{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=tp,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Re(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
92
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
93
|
+
For Further details.`);if(We(e)){if(at(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
94
|
+
Note that the first argument for the parser constructor
|
|
95
|
+
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
96
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
97
|
+
For Further details.`)}if(We(e))this.tokensMap=mn(e,(s,o)=>(s[o.name]=o,s),{});else if(Re(e,"modes")&&dr(Qn(qt(e.modes)),tz)){const s=Qn(qt(e.modes)),o=Ry(s);this.tokensMap=mn(o,(a,c)=>(a[c.name]=c,a),{})}else if(Jn(e))this.tokensMap=Kt(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Fi;const r=Re(e,"modes")?Qn(qt(e.modes)):qt(e),i=dr(r,s=>at(s.categoryMatches));this.tokenMatcher=i?tp:Nc,Oc(qt(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
98
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Re(r,"resyncEnabled")?r.resyncEnabled:pp.resyncEnabled,s=Re(r,"recoveryValueFunc")?r.recoveryValueFunc:pp.recoveryValueFunc,o=this.ruleShortNameIdx<<jz+Li;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let a;return this.outputCst===!0?a=function(...l){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}}:a=function(...l){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l)}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(op(e)){const o=e;if(s){const a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),r(e);throw o}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(P$,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const o=e.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(My,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=n;if(i.call(this)===!0){let o=this.doSingleRepetition(s);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,Dt.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,My,e,lz)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(cp,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,h$],a,cp,e,h$)}else throw this.raiseEarlyExitException(e,Dt.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(Ly,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const c=i;i=()=>a.call(this)&&c.call(this)}}else s=n;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,Ly,e,uz,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(By,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,p$],a,By,e,p$)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,cp,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(_$,n),i=We(e)?e:e.DEF,o=this.getLaFuncFromCache(r).call(this,i);if(o!==void 0)return i[o].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Lz(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw op(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new C$(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===A$?r:s}}else throw r}saveRecogState(){const e=this.errors,n=Kt(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Fi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class i5{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Re(e,"errorMessageProvider")?e.errorMessageProvider:ai.errorMessageProvider}SAVE_ERROR(e){if(op(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Kt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Kt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],a=ip(e,s,n,this.maxLookahead)[0],c=[];for(let l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new Mz(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=rp(e,i,this.maxLookahead),o=[];for(let u=1;u<=this.maxLookahead;u++)o.push(this.LA(u));const a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:a,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Fz(c,this.LA(1),a))}}class s5{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(oi(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return m$([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=fr(e.ruleStack),i=this.getGAstProductions()[n];return new cz(i,e).startWalking()}}const lp={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(lp);const O$=!0,F$=Math.pow(2,Li)-1,L$=d$({name:"RECORDING_PHASE_TOKEN",pattern:xn.NA});Oc([L$]);const M$=_y(L$,`This IToken indicates the Parser is in Recording Phase
|
|
99
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(M$);const o5={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
100
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class a5{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return fp}topLevelRuleRecord(e,n){try{const r=new Mo({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
|
101
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
102
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return Lc.call(this,Xt,e,n)}atLeastOneInternalRecord(e,n){Lc.call(this,Mn,n,e)}atLeastOneSepFirstInternalRecord(e,n){Lc.call(this,Bn,n,e,O$)}manyInternalRecord(e,n){Lc.call(this,St,n,e)}manySepFirstInternalRecord(e,n){Lc.call(this,_n,n,e,O$)}orInternalRecord(e,n){return c5.call(this,e,n)}subruleInternalRecord(e,n,r){if(dp(n),!e||Re(e,"ruleName")===!1){const a=new Error(`<SUBRULE${B$(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
103
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Fo(this.recordingProdStack),s=e.ruleName,o=new gn({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?o5:lp}consumeInternalRecord(e,n,r){if(dp(n),!e$(e)){const o=new Error(`<CONSUME${B$(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
104
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Fo(this.recordingProdStack),s=new gt({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),M$}}function Lc(t,e,n,r=!1){dp(n);const i=Fo(this.recordingProdStack),s=ni(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),Re(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),lp}function c5(t,e){dp(e);const n=Fo(this.recordingProdStack),r=We(t)===!1,i=r===!1?t:t.DEF,s=new Pn({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});Re(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=FR(i,a=>ni(a.GATE));return s.hasPredicates=o,n.definition.push(s),Ee(i,a=>{const c=new An({definition:[]});s.definition.push(c),Re(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Re(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),lp}function B$(t){return t===0?"":`${t}`}function dp(t){if(t<0||t>F$){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
105
|
+
Idx value must be a none negative value smaller than ${F$+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class u5{initPerformanceTracer(e){if(Re(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=ai.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=BR(n),o=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function l5(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const fp=_y(Fi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(fp);const ai=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:qo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),pp=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var yn;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(yn||(yn={}));function z$(t=void 0){return function(){return t}}class Ud{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",()=>{zR(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Ee(this.definedRulesNames,i=>{const o=this[i].originalGrammarAction;let a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=Nz({rules:qt(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(at(r)&&this.skipValidations===!1){const i=Oz({rules:qt(this.gastProductionsCache),tokenTypes:qt(this.tokensMap),errMsgProvider:Cs,grammarName:n}),s=wz({lookaheadStrategy:this.lookaheadStrategy,rules:qt(this.gastProductionsCache),tokenTypes:qt(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),at(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=v6(qt(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:qt(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(qt(this.gastProductionsCache))})),!Ud.DEFER_DEFINITION_ERRORS_HANDLING&&!at(this.definitionErrors))throw e=pe(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
106
|
+
${e.join(`
|
|
107
|
+
-------------------------------
|
|
108
|
+
`)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),Re(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
109
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
110
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
111
|
+
For further details.`);this.skipValidations=Re(n,"skipValidations")?n.skipValidations:ai.skipValidations}}Ud.DEFER_DEFINITION_ERRORS_HANDLING=!1,l5(Ud,[zz,Uz,e5,t5,r5,n5,i5,s5,a5,u5]);class d5 extends Ud{constructor(e,n=ai){const r=Kt(n);r.outputCst=!1,super(e,r)}}function jo(t,e,n){return`${t.name}_${e}_${n}`}const Mi=1,f5=2,q$=4,j$=5,Mc=7,p5=8,h5=9,m5=10,g5=11,U$=12;class Uy{constructor(e){this.target=e}isEpsilon(){return!1}}class Gy extends Uy{constructor(e,n){super(e),this.tokenType=n}}class G$ extends Uy{constructor(e){super(e)}isEpsilon(){return!0}}class Wy extends Uy{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function y5(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};v5(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=As(e,i,i);s!==void 0&&A5(e,i,s)}return e}function v5(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Wt(t,i,void 0,{type:f5}),o=Wt(t,i,void 0,{type:Mc});s.stop=o,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,o)}}function W$(t,e,n){return n instanceof gt?Hy(t,e,n.terminalType,n):n instanceof gn?C5(t,e,n):n instanceof Pn?R5(t,e,n):n instanceof Xt?$5(t,e,n):n instanceof St?w5(t,e,n):n instanceof _n?b5(t,e,n):n instanceof Mn?D5(t,e,n):n instanceof Bn?E5(t,e,n):As(t,e,n)}function w5(t,e,n){const r=Wt(t,e,n,{type:j$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n));return V$(t,e,n,i)}function b5(t,e,n){const r=Wt(t,e,n,{type:j$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n)),s=Hy(t,e,n.separator,n);return V$(t,e,n,i,s)}function D5(t,e,n){const r=Wt(t,e,n,{type:q$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n));return H$(t,e,n,i)}function E5(t,e,n){const r=Wt(t,e,n,{type:q$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n)),s=Hy(t,e,n.separator,n);return H$(t,e,n,i,s)}function R5(t,e,n){const r=Wt(t,e,n,{type:Mi});Bi(t,r);const i=pe(n.definition,o=>W$(t,e,o));return Uo(t,e,r,n,...i)}function $5(t,e,n){const r=Wt(t,e,n,{type:Mi});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n));return T5(t,e,n,i)}function As(t,e,n){const r=Fn(pe(n.definition,i=>W$(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:k5(t,r)}function H$(t,e,n,r,i){const s=r.left,o=r.right,a=Wt(t,e,n,{type:g5});Bi(t,a);const c=Wt(t,e,n,{type:U$});return s.loopback=a,c.loopback=a,t.decisionMap[jo(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,Ot(o,a),i===void 0?(Ot(a,s),Ot(a,c)):(Ot(a,c),Ot(a,i.left),Ot(i.right,s)),{left:s,right:c}}function V$(t,e,n,r,i){const s=r.left,o=r.right,a=Wt(t,e,n,{type:m5});Bi(t,a);const c=Wt(t,e,n,{type:U$}),u=Wt(t,e,n,{type:h5});return a.loopback=u,c.loopback=u,Ot(a,s),Ot(a,c),Ot(o,u),i!==void 0?(Ot(u,c),Ot(u,i.left),Ot(i.right,s)):Ot(u,a),t.decisionMap[jo(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:c}}function T5(t,e,n,r){const i=r.left,s=r.right;return Ot(i,s),t.decisionMap[jo(e,"Option",n.idx)]=i,r}function Bi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Uo(t,e,n,r,...i){const s=Wt(t,e,r,{type:p5,start:n});n.end=s;for(const a of i)a!==void 0?(Ot(n,a.left),Ot(a.right,s)):Ot(n,s);const o={left:n,right:s};return t.decisionMap[jo(e,S5(r),r.idx)]=n,o}function S5(t){if(t instanceof Pn)return"Alternation";if(t instanceof Xt)return"Option";if(t instanceof St)return"Repetition";if(t instanceof _n)return"RepetitionWithSeparator";if(t instanceof Mn)return"RepetitionMandatory";if(t instanceof Bn)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function k5(t,e){const n=e.length;for(let s=0;s<n-1;s++){const o=e[s];let a;o.left.transitions.length===1&&(a=o.left.transitions[0]);const c=a instanceof Wy,u=a,l=e[s+1].left;o.left.type===Mi&&o.right.type===Mi&&a!==void 0&&(c&&u.followState===o.right||a.target===o.right)?(c?u.followState=l:a.target=l,_5(t,o.right)):Ot(o.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Hy(t,e,n,r){const i=Wt(t,e,r,{type:Mi}),s=Wt(t,e,r,{type:Mi});return Vy(i,new Gy(s,n)),{left:i,right:s}}function C5(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Wt(t,e,n,{type:Mi}),o=Wt(t,e,n,{type:Mi}),a=new Wy(i,r,o);return Vy(s,a),{left:s,right:o}}function A5(t,e,n){const r=t.ruleToStartState.get(e);Ot(r,n.left);const i=t.ruleToStopState.get(e);return Ot(n.right,i),{left:r,right:i}}function Ot(t,e){const n=new G$(e);Vy(t,n)}function Wt(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function Vy(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function _5(t,e){t.states.splice(t.states.indexOf(e),1)}const hp={};class Ky{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=K$(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return pe(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function K$(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function P5(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class Y${constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const X$=new Y$;class x5 extends qy{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=y5(e.rules),this.dfas=I5(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=jo(r,"Alternation",n),l=this.atn.decisionMap[c].decision,d=pe(g$({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>pe(f,p=>p[0]));if(J$(d,!1)&&!s){const f=mn(d,(p,h,v)=>(Ee(h,b=>{b&&(p[b.tokenTypeIdx]=v,Ee(b.categoryMatches,g=>{p[g]=v}))}),p),{});return i?function(p){var h;const v=this.LA(1),b=f[v.tokenTypeIdx];if(p!==void 0&&b!==void 0){const g=(h=p[b])===null||h===void 0?void 0:h.GATE;if(g!==void 0&&g.call(this)===!1)return}return b}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new Y$,h=f===void 0?0:f.length;for(let b=0;b<h;b++){const g=f?.[b].GATE;p.set(b,g===void 0||g.call(this))}const v=Yy.call(this,o,l,p,a);return typeof v=="number"?v:void 0}:function(){const f=Yy.call(this,o,l,X$,a);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=jo(r,i,n),l=this.atn.decisionMap[c].decision,d=pe(g$({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>pe(f,p=>p[0]));if(J$(d)&&d[0][0]&&!s){const f=d[0],p=Qn(f);if(p.length===1&&at(p[0].categoryMatches)){const v=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const h=mn(p,(v,b)=>(b!==void 0&&(v[b.tokenTypeIdx]=!0,Ee(b.categoryMatches,g=>{v[g]=!0})),v),{});return function(){const v=this.LA(1);return h[v.tokenTypeIdx]===!0}}}return function(){const f=Yy.call(this,o,l,X$,a);return typeof f=="object"?!1:f===0}}}function J$(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const a of o)if(n.has(a)){if(!i.has(a))return!1}else n.add(a),i.add(a)}}return!0}function I5(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=P5(t.decisionStates[r],r);return n}function Yy(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=G5(i.atnStartState);s=eT(i,Z$(a)),i.start=s}return N5.apply(this,[i,s,n,r])}function N5(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){let c=z5(i,a);if(c===void 0&&(c=O5.apply(this,[t,i,a,s,n,r])),c===hp)return B5(o,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,o.push(a),a=this.LA(s++)}}function O5(t,e,n,r,i,s){const o=q5(e.configs,n,i);if(o.size===0)return Q$(t,e,n,hp),hp;let a=Z$(o);const c=U5(o,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(K5(o)){const u=ZB(o.alts);a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u,F5.apply(this,[t,r,o.alts,s])}return a=Q$(t,e,n,a),a}function F5(t,e,n,r){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const s=t.atnStartState,o=s.rule,a=s.production,c=L5({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(c)}function L5(t){const e=pe(t.prefixPath,i=>zo(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${M5(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
|
|
112
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
113
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
114
|
+
For Further details.`,r}function M5(t){if(t instanceof gn)return"SUBRULE";if(t instanceof Xt)return"OPTION";if(t instanceof Pn)return"OR";if(t instanceof Mn)return"AT_LEAST_ONE";if(t instanceof Bn)return"AT_LEAST_ONE_SEP";if(t instanceof _n)return"MANY_SEP";if(t instanceof St)return"MANY";if(t instanceof gt)return"CONSUME";throw Error("non exhaustive match")}function B5(t,e,n){const r=Ln(e.configs.elements,s=>s.state.transitions),i=c6(r.filter(s=>s instanceof Gy).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function z5(t,e){return t.edges[e.tokenTypeIdx]}function q5(t,e,n){const r=new Ky,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===Mc){i.push(o);continue}const a=o.state.transitions.length;for(let c=0;c<a;c++){const u=o.state.transitions[c],l=j5(u,e);l!==void 0&&r.add({state:l,alt:o.alt,stack:o.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Ky;for(const o of r.elements)mp(o,s)}if(i.length>0&&!H5(s))for(const o of i)s.add(o);return s}function j5(t,e){if(t instanceof Gy&&f$(e,t.tokenType))return t.target}function U5(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Z$(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Q$(t,e,n,r){return r=eT(t,r),e.edges[n.tokenTypeIdx]=r,r}function eT(t,e){if(e===hp)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function G5(t){const e=new Ky,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};mp(s,e)}return e}function mp(t,e){const n=t.state;if(n.type===Mc){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};mp(o,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],o=W5(t,s);o!==void 0&&mp(o,e)}}function W5(t,e){if(e instanceof G$)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Wy){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function H5(t){for(const e of t.elements)if(e.state.type===Mc)return!0;return!1}function V5(t){for(const e of t.elements)if(e.state.type!==Mc)return!1;return!0}function K5(t){if(V5(t))return!0;const e=Y5(t.elements);return X5(e)&&!J5(e)}function Y5(t){const e=new Map;for(const n of t){const r=K$(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function X5(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function J5(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var tT;(function(t){function e(n){return typeof n=="string"}t.is=e})(tT||(tT={}));var Xy;(function(t){function e(n){return typeof n=="string"}t.is=e})(Xy||(Xy={}));var nT;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(nT||(nT={}));var gp;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(gp||(gp={}));var nt;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=gp.MAX_VALUE),i===Number.MAX_VALUE&&(i=gp.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&q.uinteger(i.line)&&q.uinteger(i.character)}t.is=n})(nt||(nt={}));var Ue;(function(t){function e(r,i,s,o){if(q.uinteger(r)&&q.uinteger(i)&&q.uinteger(s)&&q.uinteger(o))return{start:nt.create(r,i),end:nt.create(s,o)};if(nt.is(r)&&nt.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&nt.is(i.start)&&nt.is(i.end)}t.is=n})(Ue||(Ue={}));var yp;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&Ue.is(i.range)&&(q.string(i.uri)||q.undefined(i.uri))}t.is=n})(yp||(yp={}));var rT;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&Ue.is(i.targetRange)&&q.string(i.targetUri)&&Ue.is(i.targetSelectionRange)&&(Ue.is(i.originSelectionRange)||q.undefined(i.originSelectionRange))}t.is=n})(rT||(rT={}));var Jy;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.numberRange(i.red,0,1)&&q.numberRange(i.green,0,1)&&q.numberRange(i.blue,0,1)&&q.numberRange(i.alpha,0,1)}t.is=n})(Jy||(Jy={}));var iT;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&Ue.is(i.range)&&Jy.is(i.color)}t.is=n})(iT||(iT={}));var sT;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.string(i.label)&&(q.undefined(i.textEdit)||In.is(i))&&(q.undefined(i.additionalTextEdits)||q.typedArray(i.additionalTextEdits,In.is))}t.is=n})(sT||(sT={}));var oT;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(oT||(oT={}));var aT;(function(t){function e(r,i,s,o,a,c){const u={startLine:r,endLine:i};return q.defined(s)&&(u.startCharacter=s),q.defined(o)&&(u.endCharacter=o),q.defined(a)&&(u.kind=a),q.defined(c)&&(u.collapsedText=c),u}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.uinteger(i.startLine)&&q.uinteger(i.startLine)&&(q.undefined(i.startCharacter)||q.uinteger(i.startCharacter))&&(q.undefined(i.endCharacter)||q.uinteger(i.endCharacter))&&(q.undefined(i.kind)||q.string(i.kind))}t.is=n})(aT||(aT={}));var Zy;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&yp.is(i.location)&&q.string(i.message)}t.is=n})(Zy||(Zy={}));var Bc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Bc||(Bc={}));var cT;(function(t){t.Unnecessary=1,t.Deprecated=2})(cT||(cT={}));var uT;(function(t){function e(n){const r=n;return q.objectLiteral(r)&&q.string(r.href)}t.is=e})(uT||(uT={}));var vp;(function(t){function e(r,i,s,o,a,c){let u={range:r,message:i};return q.defined(s)&&(u.severity=s),q.defined(o)&&(u.code=o),q.defined(a)&&(u.source=a),q.defined(c)&&(u.relatedInformation=c),u}t.create=e;function n(r){var i;let s=r;return q.defined(s)&&Ue.is(s.range)&&q.string(s.message)&&(q.number(s.severity)||q.undefined(s.severity))&&(q.integer(s.code)||q.string(s.code)||q.undefined(s.code))&&(q.undefined(s.codeDescription)||q.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(q.string(s.source)||q.undefined(s.source))&&(q.undefined(s.relatedInformation)||q.typedArray(s.relatedInformation,Zy.is))}t.is=n})(vp||(vp={}));var Go;(function(t){function e(r,i,...s){let o={title:r,command:i};return q.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.title)&&q.string(i.command)}t.is=n})(Go||(Go={}));var In;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const o=s;return q.objectLiteral(o)&&q.string(o.newText)&&Ue.is(o.range)}t.is=i})(In||(In={}));var Qy;(function(t){function e(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.string(i.label)&&(q.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(q.string(i.description)||i.description===void 0)}t.is=n})(Qy||(Qy={}));var Wo;(function(t){function e(n){const r=n;return q.string(r)}t.is=e})(Wo||(Wo={}));var lT;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){const o=s;return In.is(o)&&(Qy.is(o.annotationId)||Wo.is(o.annotationId))}t.is=i})(lT||(lT={}));var ev;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&sv.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(ev||(ev={}));var tv;(function(t){function e(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&q.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||q.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||q.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Wo.is(i.annotationId))}t.is=n})(tv||(tv={}));var nv;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&q.string(i.oldUri)&&q.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||q.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||q.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Wo.is(i.annotationId))}t.is=n})(nv||(nv={}));var rv;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&q.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||q.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||q.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Wo.is(i.annotationId))}t.is=n})(rv||(rv={}));var iv;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>q.string(i.kind)?tv.is(i)||nv.is(i)||rv.is(i):ev.is(i)))}t.is=e})(iv||(iv={}));var dT;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)}t.is=n})(dT||(dT={}));var fT;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)&&q.integer(i.version)}t.is=n})(fT||(fT={}));var sv;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)&&(i.version===null||q.integer(i.version))}t.is=n})(sv||(sv={}));var pT;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)&&q.string(i.languageId)&&q.integer(i.version)&&q.string(i.text)}t.is=n})(pT||(pT={}));var ov;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(ov||(ov={}));var zc;(function(t){function e(n){const r=n;return q.objectLiteral(n)&&ov.is(r.kind)&&q.string(r.value)}t.is=e})(zc||(zc={}));var Ft;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Ft||(Ft={}));var tr;(function(t){t.PlainText=1,t.Snippet=2})(tr||(tr={}));var hT;(function(t){t.Deprecated=1})(hT||(hT={}));var mT;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&q.string(i.newText)&&Ue.is(i.insert)&&Ue.is(i.replace)}t.is=n})(mT||(mT={}));var gT;(function(t){t.asIs=1,t.adjustIndentation=2})(gT||(gT={}));var yT;(function(t){function e(n){const r=n;return r&&(q.string(r.detail)||r.detail===void 0)&&(q.string(r.description)||r.description===void 0)}t.is=e})(yT||(yT={}));var vT;(function(t){function e(n){return{label:n}}t.create=e})(vT||(vT={}));var wT;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(wT||(wT={}));var wp;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return q.string(i)||q.objectLiteral(i)&&q.string(i.language)&&q.string(i.value)}t.is=n})(wp||(wp={}));var bT;(function(t){function e(n){let r=n;return!!r&&q.objectLiteral(r)&&(zc.is(r.contents)||wp.is(r.contents)||q.typedArray(r.contents,wp.is))&&(n.range===void 0||Ue.is(n.range))}t.is=e})(bT||(bT={}));var DT;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(DT||(DT={}));var ET;(function(t){function e(n,r,...i){let s={label:n};return q.defined(r)&&(s.documentation=r),q.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(ET||(ET={}));var RT;(function(t){t.Text=1,t.Read=2,t.Write=3})(RT||(RT={}));var $T;(function(t){function e(n,r){let i={range:n};return q.number(r)&&(i.kind=r),i}t.create=e})($T||($T={}));var hr;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(hr||(hr={}));var TT;(function(t){t.Deprecated=1})(TT||(TT={}));var ST;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(ST||(ST={}));var kT;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(kT||(kT={}));var CT;(function(t){function e(r,i,s,o,a,c){let u={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(u.children=c),u}t.create=e;function n(r){let i=r;return i&&q.string(i.name)&&q.number(i.kind)&&Ue.is(i.range)&&Ue.is(i.selectionRange)&&(i.detail===void 0||q.string(i.detail))&&(i.deprecated===void 0||q.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(CT||(CT={}));var AT;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(AT||(AT={}));var bp;(function(t){t.Invoked=1,t.Automatic=2})(bp||(bp={}));var _T;(function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return q.defined(i)&&q.typedArray(i.diagnostics,vp.is)&&(i.only===void 0||q.typedArray(i.only,q.string))&&(i.triggerKind===void 0||i.triggerKind===bp.Invoked||i.triggerKind===bp.Automatic)}t.is=n})(_T||(_T={}));var PT;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Go.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return i&&q.string(i.title)&&(i.diagnostics===void 0||q.typedArray(i.diagnostics,vp.is))&&(i.kind===void 0||q.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Go.is(i.command))&&(i.isPreferred===void 0||q.boolean(i.isPreferred))&&(i.edit===void 0||iv.is(i.edit))}t.is=n})(PT||(PT={}));var xT;(function(t){function e(r,i){let s={range:r};return q.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return q.defined(i)&&Ue.is(i.range)&&(q.undefined(i.command)||Go.is(i.command))}t.is=n})(xT||(xT={}));var IT;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.uinteger(i.tabSize)&&q.boolean(i.insertSpaces)}t.is=n})(IT||(IT={}));var NT;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return q.defined(i)&&Ue.is(i.range)&&(q.undefined(i.target)||q.string(i.target))}t.is=n})(NT||(NT={}));var OT;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&Ue.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(OT||(OT={}));var je;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(je||(je={}));var rt;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(rt||(rt={}));var FT;(function(t){function e(n){const r=n;return q.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(FT||(FT={}));var LT;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&q.string(i.text)}t.is=n})(LT||(LT={}));var MT;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&q.boolean(i.caseSensitiveLookup)&&(q.string(i.variableName)||i.variableName===void 0)}t.is=n})(MT||(MT={}));var BT;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&(q.string(i.expression)||i.expression===void 0)}t.is=n})(BT||(BT={}));var zT;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return q.defined(i)&&Ue.is(r.stoppedLocation)}t.is=n})(zT||(zT={}));var av;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(av||(av={}));var cv;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&(i.tooltip===void 0||q.string(i.tooltip)||zc.is(i.tooltip))&&(i.location===void 0||yp.is(i.location))&&(i.command===void 0||Go.is(i.command))}t.is=n})(cv||(cv={}));var qT;(function(t){function e(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&nt.is(i.position)&&(q.string(i.label)||q.typedArray(i.label,cv.is))&&(i.kind===void 0||av.is(i.kind))&&i.textEdits===void 0||q.typedArray(i.textEdits,In.is)&&(i.tooltip===void 0||q.string(i.tooltip)||zc.is(i.tooltip))&&(i.paddingLeft===void 0||q.boolean(i.paddingLeft))&&(i.paddingRight===void 0||q.boolean(i.paddingRight))}t.is=n})(qT||(qT={}));var jT;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(jT||(jT={}));var UT;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(UT||(UT={}));var GT;(function(t){function e(n){return{items:n}}t.create=e})(GT||(GT={}));var WT;(function(t){t.Invoked=0,t.Automatic=1})(WT||(WT={}));var HT;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(HT||(HT={}));var VT;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(VT||(VT={}));var KT;(function(t){function e(n){const r=n;return q.objectLiteral(r)&&Xy.is(r.uri)&&q.string(r.name)}t.is=e})(KT||(KT={}));var YT;(function(t){function e(s,o,a,c){return new Z5(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(q.defined(o)&&q.string(o.uri)&&(q.undefined(o.languageId)||q.string(o.languageId))&&q.uinteger(o.lineCount)&&q.func(o.getText)&&q.func(o.positionAt)&&q.func(o.offsetAt))}t.is=n;function r(s,o){let a=s.getText(),c=i(o,(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),u=a.length;for(let l=c.length-1;l>=0;l--){let d=c[l],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=u)a=a.substring(0,f)+d.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");u=f}return a}t.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,c=s.slice(0,a),u=s.slice(a);i(c,o),i(u,o);let l=0,d=0,f=0;for(;l<c.length&&d<u.length;)o(c[l],u[d])<=0?s[f++]=c[l++]:s[f++]=u[d++];for(;l<c.length;)s[f++]=c[l++];for(;d<u.length;)s[f++]=u[d++];return s}})(YT||(YT={}));let Z5=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
115
|
+
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
116
|
+
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return nt.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return nt.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var q;(function(t){const e=Object.prototype.toString;function n(p){return typeof p<"u"}t.defined=n;function r(p){return typeof p>"u"}t.undefined=r;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function o(p){return e.call(p)==="[object Number]"}t.number=o;function a(p,h,v){return e.call(p)==="[object Number]"&&h<=p&&p<=v}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function u(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=u;function l(p){return e.call(p)==="[object Function]"}t.func=l;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,h){return Array.isArray(p)&&p.every(h)}t.typedArray=f})(q||(q={}));class Q5{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new JT(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new lv;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new uv(e.startOffset,e.image.length,lf(e),e.tokenType,!1);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}addHiddenTokens(e){for(const n of e){const r=new uv(n.startOffset,n.image.length,lf(n),n.tokenType,!0);r.root=this.rootNode,this.addHiddenToken(this.rootNode,r)}}addHiddenToken(e,n){const{offset:r,end:i}=n;for(let s=0;s<e.content.length;s++){const o=e.content[s],{offset:a,end:c}=o;if(Jr(o)&&r>a&&i<c){this.addHiddenToken(o,n);return}else if(i<=a){e.content.splice(s,0,n);return}}e.content.push(n)}}class XT{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(n=this.container)===null||n===void 0?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class uv extends XT{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class lv extends XT{constructor(){super(...arguments),this.content=new T0(this)}get children(){return this.content}get offset(){var e,n;return(n=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:0}get length(){return this.end-this.offset}get end(){var e,n;return(n=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&n!==void 0?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:nt.create(0,0),end:nt.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class T0 extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,T0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class JT extends lv{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const dv=Symbol("Datatype");function fv(t){return t.$type===dv}const ZT="\u200B",QT=t=>t.endsWith(ZT)?t:t+ZT;class eS{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new iq(n,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class eq extends eS{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Q5,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(QT(e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(Af(e))return dv;{const n=Ds(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(r.hidden),this.unorderedGroups.clear(),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{if(!this.isRecording()){const s={$type:e};this.stack.push(s),e===dv&&(s.value="")}let i;try{i=n(r)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:a}=this.getAssignment(r),c=this.current;if(o){const u=Ar(r)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,u,s,a)}else if(fv(c)){let u=i.image;Ar(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i){let s;this.isRecording()||(s=this.nodeBuilder.buildCompositeNode(r));const o=this.wrapper.wrapSubrule(e,n,i);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,r,s)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const o=this.current;if(fv(o))o.value+=e.toString();else if(typeof e=="object"&&e){const a=e.$type,c=this.assignWithoutOverride(e,o);a&&(c.$type=a);const u=c;this.stack.pop(),this.stack.push(u)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return Lg(e),this.nodeBuilder.construct(e),this.stack.pop(),fv(e)?this.converter.convert(e.value,e.$cstNode):(Bg(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=sn(e,Cr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?tc(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const o=this.current;let a;switch(s&&typeof r=="string"?a=this.linker.buildReference(o,n,i,r):a=r,e){case"=":{o[n]=a;break}case"?=":{o[n]=!0;break}case"+=":Array.isArray(o[n])||(o[n]=[]),o[n].push(a)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const o=e[i];o===void 0?e[i]=s:Array.isArray(o)&&Array.isArray(s)&&(s.push(...o),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class tq{buildMismatchTokenMessage(e){return qo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return qo.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return qo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return qo.buildEarlyExitMessage(e)}}class tS extends tq{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class nq extends eS{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(QT(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,n,i),this.after(r)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const rq={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new tS};class iq extends d5{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},rq),{lookaheadStrategy:r?new qy({maxLookahead:n.maxLookahead}):new x5({logging:n.skipValidations?()=>{}:void 0})}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function nS(t,e,n){return sq({parser:e,tokens:n,ruleNames:new Map},t),e}function sq(t,e){const n=Gg(e,!1),r=st(e.rules).filter(rn).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,_s(s,i.definition))}}function _s(t,e,n=!1){let r;if(Ar(e))r=fq(t,e);else if(bs(e))r=oq(t,e);else if(Cr(e))r=_s(t,e.terminal);else if(tc(e))r=rS(t,e);else if(Qr(e))r=aq(t,e);else if(Og(e))r=uq(t,e);else if(Fg(e))r=lq(t,e);else if(Pi(e))r=dq(t,e);else if(tL(e)){const i=t.consume++;r=()=>t.parser.consume(i,Fi,e)}else throw new oE(e.$cstNode,`Unexpected element type: ${e.$type}`);return iS(t,n?void 0:Dp(e),r,e.cardinality)}function oq(t,e){const n=vc(e);return()=>t.parser.action(n,e)}function aq(t,e){const n=e.rule.ref;if(rn(n)){const r=t.subrule++,i=e.arguments.length>0?cq(n,e.arguments):()=>({});return s=>t.parser.subrule(r,sS(t,n),e,i(s))}else if(Zr(n)){const r=t.consume++,i=pv(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Oa();else throw new oE(e.$cstNode,`Undefined rule type: ${e.$type}`)}function cq(t,e){const n=e.map(r=>ci(r.value));return r=>{const i={};for(let s=0;s<n.length;s++){const o=t.parameters[s],a=n[s];i[o.name]=a(r)}return i}}function ci(t){if(KF(t)){const e=ci(t.left),n=ci(t.right);return r=>e(r)||n(r)}else if(VF(t)){const e=ci(t.left),n=ci(t.right);return r=>e(r)&&n(r)}else if(YF(t)){const e=ci(t.value);return n=>!e(n)}else if(XF(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(HF(t)){const e=!!t.true;return()=>e}Oa()}function uq(t,e){if(e.elements.length===1)return _s(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:_s(t,i,!0)},o=Dp(i);o&&(s.GATE=ci(o)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const o={ALT:()=>s.ALT(i)},a=s.GATE;return a&&(o.GATE=()=>a(i)),o}))}}function lq(t,e){if(e.elements.length===1)return _s(t,e.elements[0]);const n=[];for(const a of e.elements){const c={ALT:_s(t,a,!0)},u=Dp(a);u&&(c.GATE=ci(u)),n.push(c)}const r=t.or++,i=(a,c)=>{const u=c.getRuleStack().join("-");return`uGroup_${a}_${u}`},s=a=>t.parser.alternatives(r,n.map((c,u)=>{const l={ALT:()=>!0},d=t.parser;l.ALT=()=>{if(c.ALT(a),!d.isRecording()){const p=i(r,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const h=d.unorderedGroups.get(p);typeof h?.[u]>"u"&&(h[u]=!0)}};const f=c.GATE;return f?l.GATE=()=>f(a):l.GATE=()=>{const p=d.unorderedGroups.get(i(r,d));return!p?.[u]},l})),o=iS(t,Dp(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function dq(t,e){const n=e.elements.map(r=>_s(t,r));return r=>n.forEach(i=>i(r))}function Dp(t){if(Pi(t))return t.guardCondition}function rS(t,e,n=e.terminal){if(n)if(Qr(n)&&rn(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,sS(t,n.rule.ref),e,i)}else if(Qr(n)&&Zr(n.rule.ref)){const r=t.consume++,i=pv(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Ar(n)){const r=t.consume++,i=pv(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=Yg(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+vc(e.type.ref));return rS(t,e,i)}}function fq(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function iS(t,e,n,r){const i=e&&ci(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:z$(),GATE:()=>!i(o)}])}else return n;if(r==="*"){const s=t.many++;return o=>t.parser.many(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else if(r==="+"){const s=t.many++;if(i){const o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:z$(),GATE:()=>!i(a)}])}else return o=>t.parser.atLeastOne(s,{DEF:()=>n(o)})}else if(r==="?"){const s=t.optional++;return o=>t.parser.optional(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else Oa()}function sS(t,e){const n=pq(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function pq(t,e){if(rn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!rn(r);)(Pi(r)||Og(r)||Fg(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function pv(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function hq(t){const e=t.Grammar,n=t.parser.Lexer,r=new nq(t);return nS(e,r,n.definition),r.finalize(),r}function mq(t){const e=gq(t);return e.finalize(),e}function gq(t){const e=t.Grammar,n=t.parser.Lexer,r=new eq(t);return nS(e,r,n.definition)}class yq{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=st(Gg(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return i.forEach(o=>{const a=o.PATTERN;typeof a=="object"&&a&&"test"in a&&Ug(a)?s.unshift(o):s.push(o)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Zr).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=wc(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Ug(n)?xn.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(rn).flatMap(i=>_r(i).filter(Ar)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(gL(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&yL("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class vq{convert(e,n){let r=n.grammarSource;if(tc(r)&&(r=Wg(r)),Qr(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return ui.convertInt(n);case"STRING":return ui.convertString(n);case"ID":return ui.convertID(n)}switch((i=kE(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return ui.convertNumber(n);case"boolean":return ui.convertBoolean(n);case"bigint":return ui.convertBigint(n);case"date":return ui.convertDate(n);default:return n}}}var ui;(function(t){function e(u){let l="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const p=u.charAt(++d);l+=n(p)}else l+=f}return l}t.convertString=e;function n(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
117
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function r(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=r;function i(u){return parseInt(u)}t.convertInt=i;function s(u){return BigInt(u)}t.convertBigint=s;function o(u){return new Date(u)}t.convertDate=o;function a(u){return Number(u)}t.convertNumber=a;function c(u){return u.toLowerCase()==="true"}t.convertBoolean=c})(ui||(ui={}));var wq=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ep(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ps={},Rp={},oS;function xs(){if(oS)return Rp;oS=1,Object.defineProperty(Rp,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(n){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}n.install=r}(e),Rp.default=e,Rp}var Jt={},aS;function qc(){if(aS)return Jt;aS=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.stringArray=Jt.array=Jt.func=Jt.error=Jt.number=Jt.string=Jt.boolean=void 0;function t(a){return a===!0||a===!1}Jt.boolean=t;function e(a){return typeof a=="string"||a instanceof String}Jt.string=e;function n(a){return typeof a=="number"||a instanceof Number}Jt.number=n;function r(a){return a instanceof Error}Jt.error=r;function i(a){return typeof a=="function"}Jt.func=i;function s(a){return Array.isArray(a)}Jt.array=s;function o(a){return s(a)&&a.every(c=>e(c))}return Jt.stringArray=o,Jt}var Is={},cS;function Ho(){if(cS)return Is;cS=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.Emitter=Is.Event=void 0;const t=xs();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Is.Event=e={}));class n{add(s,o=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(a)&&a.push({dispose:()=>this.remove(s,o)})}remove(s,o=null){if(!this._callbacks)return;let a=!1;for(let c=0,u=this._callbacks.length;c<u;c++)if(this._callbacks[c]===s)if(this._contexts[c]===o){this._callbacks.splice(c,1),this._contexts.splice(c,1);return}else a=!0;if(a)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const o=[],a=this._callbacks.slice(0),c=this._contexts.slice(0);for(let u=0,l=a.length;u<l;u++)try{o.push(a[u].apply(c[u],s))}catch(d){(0,t.default)().console.error(d)}return o}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,o,a)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,o);const c={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),c.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(c),c}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Is.Emitter=r,r._noop=function(){},Is}var uS;function $p(){if(uS)return Ps;uS=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.CancellationTokenSource=Ps.CancellationToken=void 0;const t=xs(),e=qc(),n=Ho();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(u){const l=u;return l&&(l===a.None||l===a.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}a.is=c})(r||(Ps.CancellationToken=r={}));const i=Object.freeze(function(a,c){const u=(0,t.default)().timer.setTimeout(a.bind(c),0);return{dispose(){u.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class o{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return Ps.CancellationTokenSource=o,Ps}var ct=$p();function bq(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let hv=0,Dq=10;function Eq(){return hv=performance.now(),new ct.CancellationTokenSource}const Tp=Symbol("OperationCancelled");function Sp(t){return t===Tp}async function jt(t){if(t===ct.CancellationToken.None)return;const e=performance.now();if(e-hv>=Dq&&(hv=e,await bq()),t.isCancellationRequested)throw Tp}class mv{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Gd{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(Gd.isIncremental(r)){const i=dS(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),c=Math.max(i.end.line,0);let u=this._lineOffsets;const l=lS(r.text,!1,s);if(c-a===l.length)for(let f=0,p=l.length;f<p;f++)u[f+a+1]=l[f];else l.length<1e4?u.splice(a+1,c-a,...l):this._lineOffsets=u=u.slice(0,a+1).concat(l,u.slice(c+1));const d=r.text.length-(o-s);if(d!==0)for(let f=a+1+l.length,p=u.length;f<p;f++)u[f]=u[f]+d}else if(Gd.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=lS(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var kp;(function(t){function e(i,s,o,a){return new Gd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Gd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=gv(s.map(Rq),(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),c=0;const u=[];for(const l of a){let d=i.offsetAt(l.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&u.push(o.substring(c,d)),l.newText.length&&u.push(l.newText),c=i.offsetAt(l.range.end)}return u.push(o.substr(c)),u.join("")}t.applyEdits=r})(kp||(kp={}));function gv(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);gv(r,e),gv(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function lS(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function dS(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Rq(t){const e=dS(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var fS;(()=>{var t={470:i=>{function s(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function o(c,u){for(var l,d="",f=0,p=-1,h=0,v=0;v<=c.length;++v){if(v<c.length)l=c.charCodeAt(v);else{if(l===47)break;l=47}if(l===47){if(!(p===v-1||h===1))if(p!==v-1&&h===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var b=d.lastIndexOf("/");if(b!==d.length-1){b===-1?(d="",f=0):f=(d=d.slice(0,b)).length-1-d.lastIndexOf("/"),p=v,h=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=v,h=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+c.slice(p+1,v):d=c.slice(p+1,v),f=v-p-1;p=v,h=0}else l===46&&h!==-1?++h:h=-1}return d}var a={resolve:function(){for(var c,u="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f;d>=0?f=arguments[d]:(c===void 0&&(c=process.cwd()),f=c),s(f),f.length!==0&&(u=f+"/"+u,l=f.charCodeAt(0)===47)}return u=o(u,!l),l?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(c){if(s(c),c.length===0)return".";var u=c.charCodeAt(0)===47,l=c.charCodeAt(c.length-1)===47;return(c=o(c,!u)).length!==0||u||(c="."),c.length>0&&l&&(c+="/"),u?"/"+c:c},isAbsolute:function(c){return s(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,u=0;u<arguments.length;++u){var l=arguments[u];s(l),l.length>0&&(c===void 0?c=l:c+="/"+l)}return c===void 0?".":a.normalize(c)},relative:function(c,u){if(s(c),s(u),c===u||(c=a.resolve(c))===(u=a.resolve(u)))return"";for(var l=1;l<c.length&&c.charCodeAt(l)===47;++l);for(var d=c.length,f=d-l,p=1;p<u.length&&u.charCodeAt(p)===47;++p);for(var h=u.length-p,v=f<h?f:h,b=-1,g=0;g<=v;++g){if(g===v){if(h>v){if(u.charCodeAt(p+g)===47)return u.slice(p+g+1);if(g===0)return u.slice(p+g)}else f>v&&(c.charCodeAt(l+g)===47?b=g:g===0&&(b=0));break}var w=c.charCodeAt(l+g);if(w!==u.charCodeAt(p+g))break;w===47&&(b=g)}var R="";for(g=l+b+1;g<=d;++g)g!==d&&c.charCodeAt(g)!==47||(R.length===0?R+="..":R+="/..");return R.length>0?R+u.slice(p+b):(p+=b,u.charCodeAt(p)===47&&++p,u.slice(p))},_makeLong:function(c){return c},dirname:function(c){if(s(c),c.length===0)return".";for(var u=c.charCodeAt(0),l=u===47,d=-1,f=!0,p=c.length-1;p>=1;--p)if((u=c.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?l?"/":".":l&&d===1?"//":c.slice(0,d)},basename:function(c,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(c);var l,d=0,f=-1,p=!0;if(u!==void 0&&u.length>0&&u.length<=c.length){if(u.length===c.length&&u===c)return"";var h=u.length-1,v=-1;for(l=c.length-1;l>=0;--l){var b=c.charCodeAt(l);if(b===47){if(!p){d=l+1;break}}else v===-1&&(p=!1,v=l+1),h>=0&&(b===u.charCodeAt(h)?--h==-1&&(f=l):(h=-1,f=v))}return d===f?f=v:f===-1&&(f=c.length),c.slice(d,f)}for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!p){d=l+1;break}}else f===-1&&(p=!1,f=l+1);return f===-1?"":c.slice(d,f)},extname:function(c){s(c);for(var u=-1,l=0,d=-1,f=!0,p=0,h=c.length-1;h>=0;--h){var v=c.charCodeAt(h);if(v!==47)d===-1&&(f=!1,d=h+1),v===46?u===-1?u=h:p!==1&&(p=1):u!==-1&&(p=-1);else if(!f){l=h+1;break}}return u===-1||d===-1||p===0||p===1&&u===d-1&&u===l+1?"":c.slice(u,d)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(u,l){var d=l.dir||l.root,f=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+f:d+"/"+f:f}(0,c)},parse:function(c){s(c);var u={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return u;var l,d=c.charCodeAt(0),f=d===47;f?(u.root="/",l=1):l=0;for(var p=-1,h=0,v=-1,b=!0,g=c.length-1,w=0;g>=l;--g)if((d=c.charCodeAt(g))!==47)v===-1&&(b=!1,v=g+1),d===46?p===-1?p=g:w!==1&&(w=1):p!==-1&&(w=-1);else if(!b){h=g+1;break}return p===-1||v===-1||w===0||w===1&&p===v-1&&p===h+1?v!==-1&&(u.base=u.name=h===0&&f?c.slice(1,v):c.slice(h,v)):(h===0&&f?(u.name=c.slice(1,p),u.base=c.slice(1,v)):(u.name=c.slice(h,p),u.base=c.slice(h,v)),u.ext=c.slice(p,v)),h>0?u.dir=c.slice(0,h-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(i,s)=>{for(var o in s)n.o(s,o)&&!n.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:s[o]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>Q}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function c(I,T){if(!I.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${I.authority}", path: "${I.path}", query: "${I.query}", fragment: "${I.fragment}"}`);if(I.scheme&&!s.test(I.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(I.path){if(I.authority){if(!o.test(I.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(I.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",l="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static isUri(T){return T instanceof f||!!T&&typeof T.authority=="string"&&typeof T.fragment=="string"&&typeof T.path=="string"&&typeof T.query=="string"&&typeof T.scheme=="string"&&typeof T.fsPath=="string"&&typeof T.with=="function"&&typeof T.toString=="function"}scheme;authority;path;query;fragment;constructor(T,$,L,V,H,K=!1){typeof T=="object"?(this.scheme=T.scheme||u,this.authority=T.authority||u,this.path=T.path||u,this.query=T.query||u,this.fragment=T.fragment||u):(this.scheme=function(we,te){return we||te?we:"file"}(T,K),this.authority=$||u,this.path=function(we,te){switch(we){case"https":case"http":case"file":te?te[0]!==l&&(te=l+te):te=l}return te}(this.scheme,L||u),this.query=V||u,this.fragment=H||u,c(this,K))}get fsPath(){return w(this)}with(T){if(!T)return this;let{scheme:$,authority:L,path:V,query:H,fragment:K}=T;return $===void 0?$=this.scheme:$===null&&($=u),L===void 0?L=this.authority:L===null&&(L=u),V===void 0?V=this.path:V===null&&(V=u),H===void 0?H=this.query:H===null&&(H=u),K===void 0?K=this.fragment:K===null&&(K=u),$===this.scheme&&L===this.authority&&V===this.path&&H===this.query&&K===this.fragment?this:new h($,L,V,H,K)}static parse(T,$=!1){const L=d.exec(T);return L?new h(L[2]||u,N(L[4]||u),N(L[5]||u),N(L[7]||u),N(L[9]||u),$):new h(u,u,u,u,u)}static file(T){let $=u;if(i&&(T=T.replace(/\\/g,l)),T[0]===l&&T[1]===l){const L=T.indexOf(l,2);L===-1?($=T.substring(2),T=l):($=T.substring(2,L),T=T.substring(L)||l)}return new h("file",$,T,u,u)}static from(T){const $=new h(T.scheme,T.authority,T.path,T.query,T.fragment);return c($,!0),$}toString(T=!1){return R(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof f)return T;{const $=new h(T);return $._formatted=T.external,$._fsPath=T._sep===p?T.fsPath:null,$}}return T}}const p=i?1:void 0;class h extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=w(this)),this._fsPath}toString(T=!1){return T?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=p),this._formatted&&(T.external=this._formatted),this.path&&(T.path=this.path),this.scheme&&(T.scheme=this.scheme),this.authority&&(T.authority=this.authority),this.query&&(T.query=this.query),this.fragment&&(T.fragment=this.fragment),T}}const v={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function b(I,T,$){let L,V=-1;for(let H=0;H<I.length;H++){const K=I.charCodeAt(H);if(K>=97&&K<=122||K>=65&&K<=90||K>=48&&K<=57||K===45||K===46||K===95||K===126||T&&K===47||$&&K===91||$&&K===93||$&&K===58)V!==-1&&(L+=encodeURIComponent(I.substring(V,H)),V=-1),L!==void 0&&(L+=I.charAt(H));else{L===void 0&&(L=I.substr(0,H));const we=v[K];we!==void 0?(V!==-1&&(L+=encodeURIComponent(I.substring(V,H)),V=-1),L+=we):V===-1&&(V=H)}}return V!==-1&&(L+=encodeURIComponent(I.substring(V))),L!==void 0?L:I}function g(I){let T;for(let $=0;$<I.length;$++){const L=I.charCodeAt($);L===35||L===63?(T===void 0&&(T=I.substr(0,$)),T+=v[L]):T!==void 0&&(T+=I[$])}return T!==void 0?T:I}function w(I,T){let $;return $=I.authority&&I.path.length>1&&I.scheme==="file"?`//${I.authority}${I.path}`:I.path.charCodeAt(0)===47&&(I.path.charCodeAt(1)>=65&&I.path.charCodeAt(1)<=90||I.path.charCodeAt(1)>=97&&I.path.charCodeAt(1)<=122)&&I.path.charCodeAt(2)===58?I.path[1].toLowerCase()+I.path.substr(2):I.path,i&&($=$.replace(/\//g,"\\")),$}function R(I,T){const $=T?g:b;let L="",{scheme:V,authority:H,path:K,query:we,fragment:te}=I;if(V&&(L+=V,L+=":"),(H||V==="file")&&(L+=l,L+=l),H){let C=H.indexOf("@");if(C!==-1){const he=H.substr(0,C);H=H.substr(C+1),C=he.lastIndexOf(":"),C===-1?L+=$(he,!1,!1):(L+=$(he.substr(0,C),!1,!1),L+=":",L+=$(he.substr(C+1),!1,!0)),L+="@"}H=H.toLowerCase(),C=H.lastIndexOf(":"),C===-1?L+=$(H,!1,!0):(L+=$(H.substr(0,C),!1,!0),L+=H.substr(C))}if(K){if(K.length>=3&&K.charCodeAt(0)===47&&K.charCodeAt(2)===58){const C=K.charCodeAt(1);C>=65&&C<=90&&(K=`/${String.fromCharCode(C+32)}:${K.substr(3)}`)}else if(K.length>=2&&K.charCodeAt(1)===58){const C=K.charCodeAt(0);C>=65&&C<=90&&(K=`${String.fromCharCode(C+32)}:${K.substr(2)}`)}L+=$(K,!0,!1)}return we&&(L+="?",L+=$(we,!1,!1)),te&&(L+="#",L+=T?te:b(te,!1,!1)),L}function k(I){try{return decodeURIComponent(I)}catch{return I.length>3?I.substr(0,3)+k(I.substr(3)):I}}const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function N(I){return I.match(A)?I.replace(A,T=>k(T)):I}var _=n(470);const B=_.posix||_,z="/";var Q;(function(I){I.joinPath=function(T,...$){return T.with({path:B.join(T.path,...$)})},I.resolvePath=function(T,...$){let L=T.path,V=!1;L[0]!==z&&(L=z+L,V=!0);let H=B.resolve(L,...$);return V&&H[0]===z&&!T.authority&&(H=H.substring(1)),T.with({path:H})},I.dirname=function(T){if(T.path.length===0||T.path===z)return T;let $=B.dirname(T.path);return $.length===1&&$.charCodeAt(0)===46&&($=""),T.with({path:$})},I.basename=function(T){return B.basename(T.path)},I.extname=function(T){return B.extname(T.path)}})(Q||(Q={}))})(),fS=r})();const{URI:Zt,Utils:jc}=fS;var Ct;(function(t){t.basename=jc.basename,t.dirname=jc.dirname,t.extname=jc.extname,t.joinPath=jc.joinPath,t.resolvePath=jc.resolvePath;function e(i,s){return i?.toString()===s?.toString()}t.equals=e;function n(i,s){const o=typeof i=="string"?i:i.path,a=typeof s=="string"?s:s.path,c=o.split("/").filter(p=>p.length>0),u=a.split("/").filter(p=>p.length>0);let l=0;for(;l<c.length&&c[l]===u[l];l++);const d="../".repeat(c.length-l),f=u.slice(l).join("/");return d+f}t.relative=n;function r(i){return Zt.parse(i.toString()).toString()}t.normalize=r})(Ct||(Ct={}));var He;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(He||(He={}));class $q{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=ct.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Zt.parse(e.uri),ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:He.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:He.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=s,s}async update(e,n){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,o=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),a=o?o.getText():await this.fileSystemProvider.readFile(e.uri);if(o)Object.defineProperty(e,"textDocument",{value:o});else{const c=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:c})}return s!==a&&(e.parseResult=await this.parseAsync(e.uri,a,n),e.parseResult.value.$document=e),e.state=He.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=kp.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class Tq{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return st(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=He.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=He.Changed,this.documentMap.delete(n)),r}}const yv=Symbol("ref_resolving");class Sq{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,n=ct.CancellationToken.None){for(const r of ei(e.parseResult.value))await jt(n),Ef(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=yv;try{const s=this.getCandidate(e);if(cf(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const o=this.loadAstNode(s);i._ref=o??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const o=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${o}`})}n.references.push(i)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,o={$refNode:r,$refText:i,get ref(){var a;if(Tt(this._ref))return this._ref;if(zF(this._nodeDescription)){const c=s.loadAstNode(this._nodeDescription);this._ref=c??s.createLinkingError({reference:o,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=yv;const c=Df(e).$document,u=s.getLinkedNode({reference:o,container:e,property:n});if(u.error&&c&&c.state<He.ComputedScopes)return this._ref=void 0;this._ref=(a=u.node)!==null&&a!==void 0?a:u.error,this._nodeDescription=u.descr,c?.references.push(this)}else if(this._ref===yv)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return Tt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return cf(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(cf(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(n=r.message)!==null&&n!==void 0?n:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=Df(e.container).$document;r&&r.state<He.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function Cp(t){return typeof t.name=="string"}class pS{getName(e){if(Cp(e))return e.name}getNameNode(e){return kn(e.$cstNode,"name")}}class kq{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=DE(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Yn(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Yn(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||QD(e,i)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(n?.$cstNode){const r=this.nameProvider.getNameNode(n);return r??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>Ct.equals(s.sourceUri,n.documentUri))),r.push(...i),st(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=bt(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Na(n),local:!0}}}}class zn{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Rg.sum(st(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var n;return(n=this.map.get(e))!==null&&n!==void 0?n:[]}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return st(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return st(this.map.keys())}values(){return st(this.map.values()).flat()}entriesGroupedByKey(){return st(this.map.entries())}}class hS{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class mS{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=ct.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=hc,i=ct.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const o of r(e))await jt(i),this.exportNode(o,s,n);return s}exportNode(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,n=ct.CancellationToken.None){const r=e.parseResult.value,i=new zn;for(const s of _r(r))await jt(n),this.processNode(s,e,i);return i}processNode(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class Ns{constructor(e,n,r){var i;this.elements=e,this.outerScope=n,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}}class gS{constructor(e,n,r){var i;this.elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const o=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(o,s)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=st(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const Ap={getElement(){},getAllElements(){return ko}};class yS{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Cq extends yS{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class vS extends yS{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class Aq extends vS{constructor(e,n){super(r=>r.toString()),n?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(n,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{for(const s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{const s=r.concat(i);for(const o of s)this.clear(o)}))}}class wS extends Cq{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class bS{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new wS(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=bt(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(st(a).filter(c=>this.reflection.isSubtype(c.type,r))),o=o.$container}while(o)}let s=this.getGlobalScope(r,e);for(let o=n.length-1;o>=0;o--)s=this.createScope(n[o],s);return s}createScope(e,n,r){return new Ns(st(e),n,r)}createScopeForNodes(e,n,r){const i=st(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new Ns(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new gS(this.indexManager.allElements(e)))}}function _q(t){return typeof t.$comment=="string"}function DS(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class Pq{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(a,c)=>this.replacer(a,c,r),o=i?(a,c)=>i(a,c,s):s;try{return this.currentDocument=bt(e),JSON.stringify(e,o,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:o,uriConverter:a}){var c,u,l,d;if(!this.ignoreProperties.has(e))if(Yn(n)){const f=n.ref,p=r?n.$refText:void 0;if(f){const h=bt(f);let v="";this.currentDocument&&this.currentDocument!==h&&(a?v=a(h.uri,n):v=h.uri.toString());const b=this.astNodeLocator.getAstNodePath(f);return{$ref:`${v}#${b}`,$refText:p}}else return{$error:(u=(c=n.error)===null||c===void 0?void 0:c.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:p}}else if(Tt(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(l=this.currentDocument)===null||l===void 0?void 0:l.uri.toString())),i&&!e&&(f??(f=Object.assign({},n)),f.$sourceText=(d=n.$cstNode)===null||d===void 0?void 0:d.text),o){f??(f=Object.assign({},n));const p=this.commentProvider.getComment(n);p&&(f.$comment=p.replace(/\r/g,""))}return f??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const o=Po(e.$cstNode,s).map(n);o.length!==0&&(i[s]=o)}),e}}linkNode(e,n,r,i,s,o){for(const[c,u]of Object.entries(e))if(Array.isArray(u))for(let l=0;l<u.length;l++){const d=u[l];DS(d)?u[l]=this.reviveReference(e,c,n,d,r):Tt(d)&&this.linkNode(d,n,r,e,c,l)}else DS(u)?e[c]=this.reviveReference(e,c,n,u,r):Tt(u)&&this.linkNode(u,n,r,e,c);const a=e;a.$container=i,a.$containerProperty=s,a.$containerIndex=o}reviveReference(e,n,r,i,s){let o=i.$refText,a=i.$error;if(i.$ref){const c=this.getRefNode(r,i.$ref,s.uriConverter);if(Tt(c))return o||(o=this.nameProvider.getName(c)),{$refText:o??"",ref:c};a=c}if(a){const c={$refText:o??""};return c.error={container:e,property:n,message:a,reference:c},c}else return}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):Zt.parse(n),u=this.langiumDocuments.getDocument(c);return u?u.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):Zt.parse(n.substring(0,i)),o=this.langiumDocuments.getDocument(s);if(!o)return"Could not find document for URI: "+n;if(i===n.length-1)return o.parseResult.value;const a=this.astNodeLocator.getAstNode(o.parseResult.value,n.substring(i+1));return a||"Could not resolve URI: "+n}catch(i){return String(i)}}}class xq{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(n.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var n,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(r=(n=this.textDocuments)===null||n===void 0?void 0:n.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const a=this.languageIdMap.get(i);if(a)return a}const s=Ct.extname(e),o=this.fileExtensionMap.get(s);if(!o)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return o}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Uc(t){return{code:t}}var _p;(function(t){t.all=["fast","slow","built-in"]})(_p||(_p={}));class Iq{constructor(e){this.entries=new zn,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(e)){const o=s;if(Array.isArray(o))for(const a of o){const c={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,c)}else if(typeof o=="function"){const a={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,a)}else Oa()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(Sp(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const o=s instanceof Error?s.message:String(s);r("error",`${n}: ${o}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=st(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,o,a)=>{await this.handleException(()=>e.call(r,i,s,o,a),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class Nq{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=ct.CancellationToken.None){const i=e.parseResult,s=[];if(await jt(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(Sp(o))throw o;console.error("An error occurred during validation:",o)}return await jt(r),s}processLexingErrors(e,n,r){var i,s,o;const a=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const c of a){const u=(o=c.severity)!==null&&o!==void 0?o:"error",l={severity:vv(u),range:{start:{line:c.line-1,character:c.column-1},end:{line:c.line-1,character:c.column+c.length-1}},message:c.message,data:Fq(u),source:this.getSource()};n.push(l)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const o=i.previousToken;if(isNaN(o.startOffset)){const a={line:0,character:0};s={start:a,end:a}}else{const a={line:o.endLine-1,character:o.endColumn};s={start:a,end:a}}}}else s=lf(i.token);if(s){const o={severity:vv("error"),range:s,message:i.message,data:Uc(mr.ParsingError),source:this.getSource()};n.push(o)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const o={node:s.container,property:s.property,index:s.index,data:{code:mr.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,n,r=ct.CancellationToken.None){const i=[],s=(o,a,c)=>{i.push(this.toDiagnostic(o,a,c))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=ct.CancellationToken.None){var s;const o=this.validationRegistry.checksBefore;for(const a of o)await jt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=ct.CancellationToken.None){await Promise.all(ei(e).map(async s=>{await jt(i);const o=this.validationRegistry.getChecks(s.$type,n.categories);for(const a of o)await a(s,r,i)}))}async validateAstAfter(e,n,r,i=ct.CancellationToken.None){var s;const o=this.validationRegistry.checksAfter;for(const a of o)await jt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:Oq(r),severity:vv(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function Oq(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=kn(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=yc(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function vv(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function Fq(t){switch(t){case"error":return Uc(mr.LexingError);case"warning":return Uc(mr.LexingWarning);case"info":return Uc(mr.LexingInfo);case"hint":return Uc(mr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var mr;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(mr||(mr={}));class Lq{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??bt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let o;const a=()=>{var c;return o??(o=Na((c=this.nameProvider.getNameNode(e))!==null&&c!==void 0?c:e.$cstNode))};return{node:e,name:n,get nameSegment(){return a()},selectionSegment:Na(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class Mq{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=ct.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of ei(i))await jt(n),Ef(s).filter(o=>!cf(o)).forEach(o=>{const a=this.createDescription(o);a&&r.push(a)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=bt(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Na(r),local:Ct.equals(n.documentUri,i)}}}class Bq{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const o=s.indexOf(this.indexSeparator);if(o>0){const a=s.substring(0,o),c=parseInt(s.substring(o+1)),u=i[a];return u?.[c]}return i[s]},e)}}var zq=Ho();class qq{constructor(e){this._ready=new mv,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new zq.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=(r=(n=e.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var Os;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(Os||(Os={}));class jq{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new zn,this.documentPhaseListeners=new zn,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=He.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=ct.CancellationToken.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===He.Validated){if(typeof n.validation=="boolean"&&n.validation)o.state=He.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof n.validation=="object"){const c=this.buildState.get(a),u=(i=c?.result)===null||i===void 0?void 0:i.validationChecks;if(u){const d=((s=n.validation.categories)!==null&&s!==void 0?s:_p.all).filter(f=>!u.includes(f));d.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:d})},result:c.result}),o.state=He.IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=He.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=ct.CancellationToken.None){this.currentState=He.Changed;for(const o of n)this.langiumDocuments.deleteDocument(o),this.buildState.delete(o.toString()),this.indexManager.remove(o);for(const o of e){if(!this.langiumDocuments.invalidateDocument(o)){const c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},o);c.state=He.Changed,this.langiumDocuments.addDocument(c)}this.buildState.delete(o.toString())}const i=st(e).concat(n).map(o=>o.toString()).toSet();this.langiumDocuments.all.filter(o=>!i.has(o.uri.toString())&&this.shouldRelink(o,i)).forEach(o=>{this.serviceRegistry.getServices(o.uri).references.Linker.unlink(o),o.state=Math.min(o.state,He.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await jt(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<He.Linked||!(!((a=this.buildState.get(o.uri.toString()))===null||a===void 0)&&a.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!(!((n=this.textDocuments)===null||n===void 0)&&n.get(e.uri))}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),Os.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,He.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,He.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,He.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,He.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,He.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,He.Validated,r,s=>this.validate(s,r));for(const s of e){const o=this.buildState.get(s.uri.toString());o&&(o.completed=!0)}}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){const s=e.filter(a=>a.state<n);for(const a of s)await jt(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r);const o=e.filter(a=>a.state===n);await this.notifyBuildPhase(o,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),Os.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),Os.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=ct.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(Tp):new Promise((s,o)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),c.dispose(),i){const u=this.langiumDocuments.getDocument(i);s(u?.uri)}else s(void 0)}),c=r.onCancellationRequested(()=>{a.dispose(),c.dispose(),o(Tp)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const o of s)try{await o(e,r)}catch(a){if(!Sp(a))throw a}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const o of s)await jt(r),await o(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,o=this.getBuildOptions(e).validation,a=typeof o=="object"?o:void 0,c=await s.validateDocument(e,a,n);e.diagnostics?e.diagnostics.push(...c):e.diagnostics=c;const u=this.buildState.get(e.uri.toString());if(u){(r=u.result)!==null&&r!==void 0||(u.result={});const l=(i=a?.categories)!==null&&i!==void 0?i:_p.all;u.result.validationChecks?u.result.validationChecks.push(...l):u.result.validationChecks=[...l]}}getBuildOptions(e){var n,r;return(r=(n=this.buildState.get(e.uri.toString()))===null||n===void 0?void 0:n.options)!==null&&r!==void 0?r:{}}}class Uq{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new vS,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=bt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{Ct.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),st(i)}allElements(e,n){let r=st(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(a=>this.astReflection.isSubtype(a.type,n))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.delete(n)}async updateContent(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class ES{constructor(e){this.initialBuildOptions={},this._ready=new mv,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var n;this.folders=(n=e.workspaceFolders)!==null&&n!==void 0?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],n)})}async initializeWorkspace(e,n=ct.CancellationToken.None){const r=await this.performStartup(e);await jt(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return Zt.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async o=>{if(this.includeEntry(e,o,r)){if(o.isDirectory)await this.traverseFolder(e,o.uri,r,i);else if(o.isFile){const a=await this.langiumDocuments.getOrCreateDocument(o.uri);i(a)}}}))}includeEntry(e,n,r){const i=Ct.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=Ct.extname(n.uri);return r.includes(s)}return!1}}class Gq{buildUnexpectedCharactersMessage(e,n,r,i,s){return Ay.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return Ay.buildUnableToPopLexerModeMessage(e)}}const Wq={mode:"full"};class Hq{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=$S(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new xn(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=Wq){var r,i,s;const o=this.chevrotainLexer.tokenize(e);return{tokens:o.tokens,errors:o.errors,hidden:(r=o.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if($S(e))return e;const n=RS(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function Vq(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function RS(t){return t&&"modes"in t&&"defaultMode"in t}function $S(t){return!Vq(t)&&!RS(t)}function Kq(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=nt.create(0,0));const s=TS(t),o=bv(r),a=Jq({lines:s,position:i,options:o});return nj({index:0,tokens:a,position:i})}function Yq(t,e){const n=bv(e),r=TS(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],o=n.start,a=n.end;return!!o?.exec(i)&&!!a?.exec(s)}function TS(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(yE)}const SS=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Xq=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Jq(t){var e,n,r;const i=[];let s=t.position.line,o=t.position.character;for(let a=0;a<t.lines.length;a++){const c=a===0,u=a===t.lines.length-1;let l=t.lines[a],d=0;if(c&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);p&&(d=p.index+p[0].length)}else{const p=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);p&&(d=p.index+p[0].length)}if(u){const p=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);p&&(l=l.substring(0,p.index))}if(l=l.substring(0,tj(l)),wv(l,d)>=l.length){if(i.length>0){const p=nt.create(s,o);i.push({type:"break",content:"",range:Ue.create(p,p)})}}else{SS.lastIndex=d;const p=SS.exec(l);if(p){const h=p[0],v=p[1],b=nt.create(s,o+d),g=nt.create(s,o+d+h.length);i.push({type:"tag",content:v,range:Ue.create(b,g)}),d+=h.length,d=wv(l,d)}if(d<l.length){const h=l.substring(d),v=Array.from(h.matchAll(Xq));i.push(...Zq(v,h,s,o+d))}}s++,o=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function Zq(t,e,n,r){const i=[];if(t.length===0){const s=nt.create(n,r),o=nt.create(n,r+e.length);i.push({type:"text",content:e,range:Ue.create(s,o)})}else{let s=0;for(const a of t){const c=a.index,u=e.substring(s,c);u.length>0&&i.push({type:"text",content:e.substring(s,c),range:Ue.create(nt.create(n,s+r),nt.create(n,c+r))});let l=u.length+1;const d=a[1];if(i.push({type:"inline-tag",content:d,range:Ue.create(nt.create(n,s+l+r),nt.create(n,s+l+d.length+r))}),l+=d.length,a.length===4){l+=a[2].length;const f=a[3];i.push({type:"text",content:f,range:Ue.create(nt.create(n,s+l+r),nt.create(n,s+l+f.length+r))})}else i.push({type:"text",content:"",range:Ue.create(nt.create(n,s+l+r),nt.create(n,s+l+r))});s=c+a[0].length}const o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Ue.create(nt.create(n,s+r),nt.create(n,s+r+o.length))})}return i}const Qq=/\S/,ej=/\s*$/;function wv(t,e){const n=t.substring(e).match(Qq);return n?e+n.index:t.length}function tj(t){const e=t.match(ej);if(e&&typeof e.index=="number")return e.index}function nj(t){var e,n,r,i;const s=nt.create(t.position.line,t.position.character);if(t.tokens.length===0)return new _S([],Ue.create(s,s));const o=[];for(;t.index<t.tokens.length;){const u=rj(t,o[o.length-1]);u&&o.push(u)}const a=(n=(e=o[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,c=(i=(r=o[o.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new _S(o,Ue.create(a,c))}function rj(t,e){const n=t.tokens[t.index];if(n.type==="tag")return CS(t,!1);if(n.type==="text"||n.type==="inline-tag")return kS(t);ij(n,e),t.index++}function ij(t,e){if(e){const n=new PS("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function kS(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(sj(t)),r=e,e=t.tokens[t.index];return new Rv(i,Ue.create(n.range.start,r.range.end))}function sj(t){return t.tokens[t.index].type==="inline-tag"?CS(t,!0):AS(t)}function CS(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){const s=AS(t);return new Ev(r,new Rv([s],s.range),e,Ue.create(n.range.start,s.range.end))}else{const s=kS(t);return new Ev(r,s,e,Ue.create(n.range.start,s.range.end))}else{const s=n.range;return new Ev(r,new Rv([],s),e,s)}}function AS(t){const e=t.tokens[t.index++];return new PS(e.content,e.range)}function bv(t){if(!t)return bv({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Dv(e,!0),end:Dv(n,!1),line:Dv(r,!0)}}function Dv(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?kf(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class _S{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=xS(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=xS(n)+i}return n.trim()}}class Ev{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
|
|
118
|
+
${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return(r=(n=e?.renderTag)===null||n===void 0?void 0:n.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=oj(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} \u2014 ${n}`:this.content.inlines.length>1&&(i=`${i}
|
|
119
|
+
${n}`),this.inline?`{${i}}`:i}}function oj(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let o=e;if(s>0){const c=wv(e,s);o=e.substring(c),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(o=`\`${o}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,o))!==null&&i!==void 0?i:aj(e,o)}}function aj(t,e){try{return Zt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Rv{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
|
|
120
|
+
`)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
|
|
121
|
+
`)}return n}}class PS{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function xS(t){return t.endsWith(`
|
|
122
|
+
`)?`
|
|
123
|
+
`:`
|
|
124
|
+
|
|
125
|
+
`}class cj{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&Yq(n))return Kq(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,n))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,n);if(s&&s.nameSegment){const o=s.nameSegment.range.start.line+1,a=s.nameSegment.range.start.character+1,c=s.documentUri.with({fragment:`L${o},${a}`});return`[${r}](${c.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=bt(e).precomputedScopes;if(!i)return;let s=e;do{const a=i.get(s).find(c=>c.name===n);if(a)return a;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class uj{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return _q(e)?e.$comment:(n=df(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class lj{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class dj{constructor(){this.previousTokenSource=new ct.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=Eq();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=ct.CancellationToken.None){const i=new mv,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){Sp(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class fj{constructor(e){this.grammarElementIdMap=new hS,this.tokenTypeIdMap=new hS,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of ei(e))n.set(i,{});if(e.$cstNode)for(const i of Ia(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)Tt(a)?o.push(this.dehydrateAstNode(a,n)):Yn(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else Tt(s)?r[i]=this.dehydrateAstNode(s,n):Yn(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return JD(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Jr(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):ws(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of ei(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Ia(e.$cstNode)){let o;"fullText"in s?(o=new JT(s.fullText),i=o):"content"in s?o=new lv:"tokenType"in s&&(o=this.hydrateCstLeafNode(s)),o&&(r.set(s,o),o.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)Tt(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):Yn(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else Tt(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Yn(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),Jr(i))for(const s of e.content){const o=this.hydrateCstNode(s,n,r++);i.content.push(o)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,o=e.startColumn,a=e.endLine,c=e.endColumn,u=e.hidden;return new uv(r,i,{start:{line:s,character:o},end:{line:a,character:c}},n,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap();const n=this.grammarElementIdMap.getKey(e);if(n)return n;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(const n of ei(this.grammar))_g(n)&&this.grammarElementIdMap.set(n,e++)}}function IS(t){return{documentation:{CommentProvider:e=>new uj(e),DocumentationProvider:e=>new cj(e)},parser:{AsyncParser:e=>new lj(e),GrammarConfig:e=>kL(e),LangiumParser:e=>mq(e),CompletionParser:e=>hq(e),ValueConverter:()=>new vq,TokenBuilder:()=>new yq,Lexer:e=>new Hq(e),ParserErrorMessageProvider:()=>new tS,LexerErrorMessageProvider:()=>new Gq},workspace:{AstNodeLocator:()=>new Bq,AstNodeDescriptionProvider:e=>new Lq(e),ReferenceDescriptionProvider:e=>new Mq(e)},references:{Linker:e=>new Sq(e),NameProvider:()=>new pS,ScopeProvider:e=>new bS(e),ScopeComputation:e=>new mS(e),References:e=>new kq(e)},serializer:{Hydrator:e=>new fj(e),JsonSerializer:e=>new Pq(e)},validation:{DocumentValidator:e=>new Nq(e),ValidationRegistry:e=>new Iq(e)},shared:()=>t.shared}}function NS(t){return{ServiceRegistry:e=>new xq(e),workspace:{LangiumDocuments:e=>new Tq(e),LangiumDocumentFactory:e=>new $q(e),DocumentBuilder:e=>new jq(e),IndexManager:e=>new Uq(e),WorkspaceManager:e=>new ES(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new dj,ConfigurationProvider:e=>new qq(e)}}}var Pp;(function(t){t.merge=(e,n)=>Ip(Ip({},e),n)})(Pp||(Pp={}));function xp(t,e,n,r,i,s,o,a,c){const u=[t,e,n,r,i,s,o,a,c].reduce(Ip,{});return FS(u)}const OS=Symbol("isProxy");function $v(t){if(t&&t[OS])for(const e of Object.values(t))$v(e);return t}function FS(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===OS?!0:MS(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(MS(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const LS=Symbol();function MS(t,e,n,r){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===LS)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=LS;try{t[e]=typeof i=="function"?i(r):FS(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Ip(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=Ip(i,r):t[n]=r}}return t}class pj{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const BS={fileSystemProvider:()=>new pj},hj={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},mj={AstReflection:()=>new fE};function gj(){const t=xp(NS(BS),mj),e=xp(IS({shared:t}),hj);return t.ServiceRegistry.register(e),e}function yj(t){var e;const n=gj(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Zt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}function vj(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function ut(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return vj(t,e,n);throw new Error("Wrong number of arguments")}function Gc(...t){return ut(Object.values,t)}var wj={done:!0,hasNext:!1},Wc={done:!1,hasNext:!1},bj=()=>wj,Dj=t=>({hasNext:!0,next:t,done:!1});function tt(t,...e){let n=t,r=e.map(s=>"lazy"in s?Ej(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!Rj(n)){let c=e[i];n=c(n),i+=1;continue}let s=[];for(let c=i;c<e.length;c++){let u=r[c];if(u===void 0||(s.push(u),u.isSingle))break}let o=[];for(let c of n)if(zS(c,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function zS(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=Wc,s=!1;for(let[o,a]of n.entries()){let{index:c,items:u}=a;if(u.push(r),i=a(r,c,u),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(zS(l,e,n.slice(o+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function Ej(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function Rj(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function qS(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return tt(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>tt(i,r),r)}throw new Error("Wrong number of arguments")}function Tv(...t){return qS($j,t)}function $j(){let t=new Set;return e=>t.has(e)?Wc:(t.add(e),{done:!1,hasNext:!0,next:e})}function Tj(...t){return ut(Sj,t,kj)}var Sj=(t,e)=>e<0?[]:t.slice(0,e);function kj(t){if(t<=0)return bj;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function Hc(...t){return ut(Cj,t)}var Cj=(t,e)=>t.length>=e;function Aj(...t){return ut(_j,t)}function _j(t,e){return e(t),t}function jS(...t){return ut(Pj,t)}function Pj(t,e){let n=[...t];return n.sort(e),n}function Sv(...t){return ut(xj,t)}var xj=(t,e,n)=>t.reduce(e,n);function US(...t){return ut(Ij,t)}function Ij(t){return[...t].reverse()}function Nj(...t){return ut(Oj,t)}function Oj(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function Vc(...t){return ut(Fj,t)}var Fj=(t,e)=>t[e];function Kc(...t){return ut(Lj,t)}var Lj=t=>t.at(-1);function vn(...t){return ut(Mj,t,Bj)}var Mj=(t,e)=>t.map(e),Bj=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function gr(...t){return ut(zj,t)}function zj(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function Yc(...t){return ut(qj,t)}function qj(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function jj(t){return t instanceof Promise}function GS(t){return typeof t=="string"}function ue(t){return!!t}function on(t){return t!=null}function Et(t){return t==null}function Np(t){return typeof t=="number"&&!Number.isNaN(t)}function Uj(t){return Array.isArray(t)}function Qt(t){return t!==void 0}function Fs(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function Gj(t){return t instanceof Error}function kv(...t){return ut(Wj,t)}function Wj(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function zi(...t){return ut(Hj,t,Vj)}var Hj=(t,e)=>t.flatMap(e),Vj=t=>(e,n,r)=>{let i=t(e,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function Kj(...t){return ut(Yj,t,Xj)}function Yj(t,e){return t.forEach(e),t}var Xj=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function Op(...t){return ut(Jj,t)}function Jj(t,e){for(let[n,r]of Object.entries(t))e(r,n,t);return t}function Ls(...t){return ut(Zj,t)}var Zj=(t,e)=>{let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let{[s]:o}=n;o===void 0&&(o=[],n[s]=o),o.push(i)}}return n};function Ve(...t){return ut(Qj,t,e9)}var Qj=(t,e)=>t.filter(e),e9=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:Wc,WS=t=>Object.assign(t,{single:!0});function HS(...t){return ut(t9,t,WS(n9))}var t9=(t,e)=>t.find(e),n9=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:Wc;function VS(...t){return ut(r9,t)}var r9=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function Vo(...t){return ut(i9,t,WS(s9))}var i9=([t])=>t,s9=()=>o9,o9=t=>({hasNext:!0,next:t,done:!0});function Fp(...t){return ut(Object.entries,t)}function KS(...t){return ut(a9,t)}var a9=(t,e)=>[...t,...e];function c9(t,{waitMs:e,timing:n="trailing",maxWaitMs:r}){if(r!==void 0&&e!==void 0&&r<e)throw new Error(`debounce: maxWaitMs (${r.toString()}) cannot be less than waitMs (${e.toString()})`);let i,s,o,a,c=()=>{if(s!==void 0){let f=s;s=void 0,clearTimeout(f)}if(o===void 0)throw new Error("REMEDA[debounce]: latestCallArgs was unexpectedly undefined.");let d=o;o=void 0,a=t(...d)},u=()=>{if(i===void 0)return;let d=i;i=void 0,clearTimeout(d),o!==void 0&&c()},l=d=>{o=d,r!==void 0&&s===void 0&&(s=setTimeout(c,r))};return{call:(...d)=>{if(i===void 0)n==="trailing"?l(d):a=t(...d);else{n!=="leading"&&l(d);let f=i;i=void 0,clearTimeout(f)}return i=setTimeout(u,e??r??0),a},cancel:()=>{if(i!==void 0){let d=i;i=void 0,clearTimeout(d)}if(s!==void 0){let d=s;s=void 0,clearTimeout(d)}o=void 0},flush:()=>(u(),a),get isPending(){return i!==void 0},get cachedValue(){return a}}}function u9(...t){return qS(l9,t)}function l9(t){if(t.length===0)return Dj;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);return n=>{let r=e.get(n);return r===void 0||r===0?{done:!1,hasNext:!0,next:n}:(e.set(n,r-1),Wc)}}function d9(...t){return ut(f9,t)}var f9=(t,e)=>e.some(n=>n(t));function p9(...t){return ut(h9,t)}function h9(t,e){if(e<1)throw new RangeError(`chunk: A chunk size of '${e.toString()}' would result in an infinite array`);if(t.length===0)return[];if(e>=t.length)return[[...t]];let n=Math.ceil(t.length/e),r=new Array(n);if(e===1)for(let[i,s]of t.entries())r[i]=[s];else for(let i=0;i<n;i+=1){let s=i*e;r[i]=t.slice(s,s+e)}return r}function YS(...t){return ut(m9,t)}var m9=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,g9={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],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],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},y9=Object.entries(g9);function Cv(t){return String(t)}Cv.open="",Cv.close="";function v9(t=!1){let e=typeof process<"u"?process:void 0,n=e?.env||{},r=e?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function w9(t=!1){let e=v9(t),n=(o,a,c,u)=>{let l="",d=0;do l+=o.substring(d,u)+c,d=u+a.length,u=o.indexOf(a,d);while(~u);return l+o.substring(d)},r=(o,a,c=o)=>{let u=l=>{let d=String(l),f=d.indexOf(a,o.length);return~f?o+n(d,a,c,f)+a:o+d+a};return u.open=o,u.close=a,u},i={isColorSupported:e},s=o=>`\x1B[${o}m`;for(let[o,a]of y9)i[o]=e?r(s(a[0]),s(a[1]),a[2]):Cv;return i}var yt=w9(FN(1)),Xc={},At={},XS;function Av(){if(XS)return At;XS=1,Object.defineProperty(At,"__esModule",{value:!0}),At.thenable=At.typedArray=At.stringArray=At.array=At.func=At.error=At.number=At.string=At.boolean=void 0;function t(u){return u===!0||u===!1}At.boolean=t;function e(u){return typeof u=="string"||u instanceof String}At.string=e;function n(u){return typeof u=="number"||u instanceof Number}At.number=n;function r(u){return u instanceof Error}At.error=r;function i(u){return typeof u=="function"}At.func=i;function s(u){return Array.isArray(u)}At.array=s;function o(u){return s(u)&&u.every(l=>e(l))}At.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}At.typedArray=a;function c(u){return u&&i(u.then)}return At.thenable=c,At}var Ke={},Jc={},Zc={},Lp={},_v={},ge={},JS;function ZS(){if(JS)return ge;JS=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.Message=ge.NotificationType9=ge.NotificationType8=ge.NotificationType7=ge.NotificationType6=ge.NotificationType5=ge.NotificationType4=ge.NotificationType3=ge.NotificationType2=ge.NotificationType1=ge.NotificationType0=ge.NotificationType=ge.RequestType9=ge.RequestType8=ge.RequestType7=ge.RequestType6=ge.RequestType5=ge.RequestType4=ge.RequestType3=ge.RequestType2=ge.RequestType1=ge.RequestType=ge.RequestType0=ge.AbstractMessageSignature=ge.ParameterStructures=ge.ResponseError=ge.ErrorCodes=void 0;const t=qc();var e;(function(T){T.ParseError=-32700,T.InvalidRequest=-32600,T.MethodNotFound=-32601,T.InvalidParams=-32602,T.InternalError=-32603,T.jsonrpcReservedErrorRangeStart=-32099,T.serverErrorStart=-32099,T.MessageWriteError=-32099,T.MessageReadError=-32098,T.PendingResponseRejected=-32097,T.ConnectionInactive=-32096,T.ServerNotInitialized=-32002,T.UnknownErrorCode=-32001,T.jsonrpcReservedErrorRangeEnd=-32e3,T.serverErrorEnd=-32e3})(e||(ge.ErrorCodes=e={}));class n extends Error{constructor($,L,V){super(L),this.code=t.number($)?$:e.UnknownErrorCode,this.data=V,Object.setPrototypeOf(this,n.prototype)}toJson(){const $={code:this.code,message:this.message};return this.data!==void 0&&($.data=this.data),$}}ge.ResponseError=n;class r{constructor($){this.kind=$}static is($){return $===r.auto||$===r.byName||$===r.byPosition}toString(){return this.kind}}ge.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor($,L){this.method=$,this.numberOfParams=L}get parameterStructures(){return r.auto}}ge.AbstractMessageSignature=i;class s extends i{constructor($){super($,0)}}ge.RequestType0=s;class o extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.RequestType=o;class a extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.RequestType1=a;class c extends i{constructor($){super($,2)}}ge.RequestType2=c;class u extends i{constructor($){super($,3)}}ge.RequestType3=u;class l extends i{constructor($){super($,4)}}ge.RequestType4=l;class d extends i{constructor($){super($,5)}}ge.RequestType5=d;class f extends i{constructor($){super($,6)}}ge.RequestType6=f;class p extends i{constructor($){super($,7)}}ge.RequestType7=p;class h extends i{constructor($){super($,8)}}ge.RequestType8=h;class v extends i{constructor($){super($,9)}}ge.RequestType9=v;class b extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.NotificationType=b;class g extends i{constructor($){super($,0)}}ge.NotificationType0=g;class w extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.NotificationType1=w;class R extends i{constructor($){super($,2)}}ge.NotificationType2=R;class k extends i{constructor($){super($,3)}}ge.NotificationType3=k;class A extends i{constructor($){super($,4)}}ge.NotificationType4=A;class N extends i{constructor($){super($,5)}}ge.NotificationType5=N;class _ extends i{constructor($){super($,6)}}ge.NotificationType6=_;class B extends i{constructor($){super($,7)}}ge.NotificationType7=B;class z extends i{constructor($){super($,8)}}ge.NotificationType8=z;class Q extends i{constructor($){super($,9)}}ge.NotificationType9=Q;var I;return function(T){function $(H){const K=H;return K&&t.string(K.method)&&(t.string(K.id)||t.number(K.id))}T.isRequest=$;function L(H){const K=H;return K&&t.string(K.method)&&H.id===void 0}T.isNotification=L;function V(H){const K=H;return K&&(K.result!==void 0||!!K.error)&&(t.string(K.id)||t.number(K.id)||K.id===null)}T.isResponse=V}(I||(ge.Message=I={})),ge}var li={},QS;function ek(){if(QS)return li;QS=1;var t;Object.defineProperty(li,"__esModule",{value:!0}),li.LRUCache=li.LinkedMap=li.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(li.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=e.None){const a=this._map.get(s);if(a)return o!==e.None&&this.touch(a,o),a.value}set(s,o,a=e.None){let c=this._map.get(s);if(c)c.value=o,a!==e.None&&this.touch(c,a);else{switch(c={key:s,value:o,next:void 0,previous:void 0},a){case e.None:this.addItemLast(c);break;case e.First:this.addItemFirst(c);break;case e.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const a=this._state;let c=this._head;for(;c;){if(o?s.bind(o)(c.value,c.key,this):s(c.value,c.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.key,done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}values(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.value,done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}entries(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:[o.key,o.value],done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>s;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,a=s.previous;if(!o||!a)throw new Error("Invalid list");o.previous=a,a.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==e.First&&o!==e.Last)){if(o===e.First){if(s===this._head)return;const a=s.next,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(a.previous=c,c.next=a),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===e.Last){if(s===this._tail)return;const a=s.next,c=s.previous;s===this._head?(a.previous=void 0,this._head=a):(a.previous=c,c.next=a),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,a)=>{s.push([a,o])}),s}fromJSON(s){this.clear();for(const[o,a]of s)this.set(o,a)}}li.LinkedMap=n;class r extends n{constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=e.AsNew){return super.get(s,o)}peek(s){return super.get(s,e.None)}set(s,o){return super.set(s,o,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return li.LRUCache=r,li}var Qc={},tk;function b9(){if(tk)return Qc;tk=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(Qc.Disposable=t={})),Qc}var Ms={},nk;function D9(){if(nk)return Ms;nk=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.SharedArrayReceiverStrategy=Ms.SharedArraySenderStrategy=void 0;const t=$p();var e;(function(o){o.Continue=0,o.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const c=new SharedArrayBuffer(4),u=new Int32Array(c,0,1);u[0]=e.Continue,this.buffers.set(a.id,c),a.$cancellationData=c}async sendCancellation(a,c){const u=this.buffers.get(c);if(u===void 0)return;const l=new Int32Array(u,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}Ms.SharedArraySenderStrategy=n;class r{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(a){this.token=new r(a)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(a){const c=a.$cancellationData;return c===void 0?new t.CancellationTokenSource:new i(c)}}return Ms.SharedArrayReceiverStrategy=s,Ms}var di={},eu={},rk;function ik(){if(rk)return eu;rk=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.Semaphore=void 0;const t=xs();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return eu.Semaphore=e,eu}var sk;function E9(){if(sk)return di;sk=1,Object.defineProperty(di,"__esModule",{value:!0}),di.ReadableStreamMessageReader=di.AbstractMessageReader=di.MessageReader=void 0;const t=xs(),e=qc(),n=Ho(),r=ik();var i;(function(c){function u(l){let d=l;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}c.is=u})(i||(di.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${e.string(u.message)?u.message:"unknown"}`)}}di.AbstractMessageReader=s;var o;(function(c){function u(l){let d,f;const p=new Map;let h;const v=new Map;if(l===void 0||typeof l=="string")d=l??"utf-8";else{if(d=l.charset??"utf-8",l.contentDecoder!==void 0&&(f=l.contentDecoder,p.set(f.name,f)),l.contentDecoders!==void 0)for(const b of l.contentDecoders)p.set(b.name,b);if(l.contentTypeDecoder!==void 0&&(h=l.contentTypeDecoder,v.set(h.name,h)),l.contentTypeDecoders!==void 0)for(const b of l.contentTypeDecoders)v.set(b.name,b)}return h===void 0&&(h=(0,t.default)().applicationJson.decoder,v.set(h.name,h)),{charset:d,contentDecoder:f,contentDecoders:p,contentTypeDecoder:h,contentTypeDecoders:v}}c.fromOptions=u})(o||(o={}));class a extends s{constructor(u,l){super(),this.readable=u,this.options=o.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const l=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),l}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const f=d.get("content-length");if(!f){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
126
|
+
${JSON.stringify(Object.fromEntries(d))}`));return}const p=parseInt(f);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));return}this.nextMessageLength=p}const l=this.buffer.tryReadBody(this.nextMessageLength);if(l===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,f=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(f)}).catch(d=>{this.fireError(d)})}}catch(l){this.fireError(l)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,l)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:l}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return di.ReadableStreamMessageReader=a,di}var fi={},ok;function R9(){if(ok)return fi;ok=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.WriteableStreamMessageWriter=fi.AbstractMessageWriter=fi.MessageWriter=void 0;const t=xs(),e=qc(),n=ik(),r=Ho(),i="Content-Length: ",s=`\r
|
|
127
|
+
`;var o;(function(l){function d(f){let p=f;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}l.is=d})(o||(fi.MessageWriter=o={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,f,p){this.errorEmitter.fire([this.asError(d),f,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}fi.AbstractMessageWriter=a;var c;(function(l){function d(f){return f===void 0||typeof f=="string"?{charset:f??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:f.charset??"utf-8",contentEncoder:f.contentEncoder,contentTypeEncoder:f.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=d})(c||(c={}));class u extends a{constructor(d,f){super(),this.writable=d,this.options=c.fromOptions(f),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(p=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(p):p).then(p=>{const h=[];return h.push(i,p.byteLength.toString(),s),h.push(s),this.doWrite(d,h,p)},p=>{throw this.fireError(p),p}))}async doWrite(d,f,p){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(p)}catch(h){return this.handleError(h,d),Promise.reject(h)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){this.writable.end()}}return fi.WriteableStreamMessageWriter=u,fi}var tu={},ak;function $9(){if(ak)return tu;ak=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
|
|
128
|
+
`;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,a=0,c=0,u=0;e:for(;a<this._chunks.length;){const p=this._chunks[a];for(c=0;c<p.length;){switch(p[c]){case t:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:o=2;break;case 3:o=4,c++;break e;default:o=0}break;default:o=0}c++}u+=p.byteLength,a++}if(o!==4)return;const l=this._read(u+c),d=new Map,f=this.toString(l,"ascii").split(n);if(f.length<2)return d;for(let p=0;p<f.length-2;p++){const h=f[p],v=h.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'
|
|
129
|
+
${h}`);const b=h.substr(0,v),g=h.substr(v+1).trim();d.set(s?b.toLowerCase():b,g)}return d}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const u=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(u)}if(this._chunks[0].byteLength>s){const u=this._chunks[0],l=this.asNative(u,s);return this._chunks[0]=u.slice(s),this._totalLength-=s,l}const o=this.allocNative(s);let a=0,c=0;for(;s>0;){const u=this._chunks[c];if(u.byteLength>s){const l=u.slice(0,s);o.set(l,a),a+=s,this._chunks[c]=u.slice(s),this._totalLength-=s,s-=s}else o.set(u,a),a+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,s-=u.byteLength}return o}}return tu.AbstractMessageBuffer=r,tu}var Pv={},ck;function T9(){return ck||(ck=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=xs(),n=qc(),r=ZS(),i=ek(),s=Ho(),o=$p();var a;(function($){$.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function($){function L(V){return typeof V=="string"||typeof V=="number"}$.is=L})(c||(t.ProgressToken=c={}));var u;(function($){$.type=new r.NotificationType("$/progress")})(u||(u={}));class l{constructor(){}}t.ProgressType=l;var d;(function($){function L(V){return n.func(V)}$.is=L})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function($){$[$.Off=0]="Off",$[$.Messages=1]="Messages",$[$.Compact=2]="Compact",$[$.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function($){$.Off="off",$.Messages="messages",$.Compact="compact",$.Verbose="verbose"})(p||(t.TraceValues=p={})),function($){function L(H){if(!n.string(H))return $.Off;switch(H=H.toLowerCase(),H){case"off":return $.Off;case"messages":return $.Messages;case"compact":return $.Compact;case"verbose":return $.Verbose;default:return $.Off}}$.fromString=L;function V(H){switch(H){case $.Off:return"off";case $.Messages:return"messages";case $.Compact:return"compact";case $.Verbose:return"verbose";default:return"off"}}$.toString=V}(f||(t.Trace=f={}));var h;(function($){$.Text="text",$.JSON="json"})(h||(t.TraceFormat=h={})),function($){function L(V){return n.string(V)?(V=V.toLowerCase(),V==="json"?$.JSON:$.Text):$.Text}$.fromString=L}(h||(t.TraceFormat=h={}));var v;(function($){$.type=new r.NotificationType("$/setTrace")})(v||(t.SetTraceNotification=v={}));var b;(function($){$.type=new r.NotificationType("$/logTrace")})(b||(t.LogTraceNotification=b={}));var g;(function($){$[$.Closed=1]="Closed",$[$.Disposed=2]="Disposed",$[$.AlreadyListening=3]="AlreadyListening"})(g||(t.ConnectionErrors=g={}));class w extends Error{constructor(L,V){super(V),this.code=L,Object.setPrototypeOf(this,w.prototype)}}t.ConnectionError=w;var R;(function($){function L(V){const H=V;return H&&n.func(H.cancelUndispatched)}$.is=L})(R||(t.ConnectionStrategy=R={}));var k;(function($){function L(V){const H=V;return H&&(H.kind===void 0||H.kind==="id")&&n.func(H.createCancellationTokenSource)&&(H.dispose===void 0||n.func(H.dispose))}$.is=L})(k||(t.IdCancellationReceiverStrategy=k={}));var A;(function($){function L(V){const H=V;return H&&H.kind==="request"&&n.func(H.createCancellationTokenSource)&&(H.dispose===void 0||n.func(H.dispose))}$.is=L})(A||(t.RequestCancellationReceiverStrategy=A={}));var N;(function($){$.Message=Object.freeze({createCancellationTokenSource(V){return new o.CancellationTokenSource}});function L(V){return k.is(V)||A.is(V)}$.is=L})(N||(t.CancellationReceiverStrategy=N={}));var _;(function($){$.Message=Object.freeze({sendCancellation(V,H){return V.sendNotification(a.type,{id:H})},cleanup(V){}});function L(V){const H=V;return H&&n.func(H.sendCancellation)&&n.func(H.cleanup)}$.is=L})(_||(t.CancellationSenderStrategy=_={}));var B;(function($){$.Message=Object.freeze({receiver:N.Message,sender:_.Message});function L(V){const H=V;return H&&N.is(H.receiver)&&_.is(H.sender)}$.is=L})(B||(t.CancellationStrategy=B={}));var z;(function($){function L(V){const H=V;return H&&n.func(H.handleMessage)}$.is=L})(z||(t.MessageStrategy=z={}));var Q;(function($){function L(V){const H=V;return H&&(B.is(H.cancellationStrategy)||R.is(H.connectionStrategy)||z.is(H.messageStrategy))}$.is=L})(Q||(t.ConnectionOptions=Q={}));var I;(function($){$[$.New=1]="New",$[$.Listening=2]="Listening",$[$.Closed=3]="Closed",$[$.Disposed=4]="Disposed"})(I||(I={}));function T($,L,V,H){const K=V!==void 0?V:t.NullLogger;let we=0,te=0,C=0;const he="2.0";let Ye;const pt=new Map;let W;const X=new Map,Ie=new Map;let oe,be=new i.LinkedMap,Se=new Map,ae=new Set,O=new Map,j=f.Off,de=h.Text,U,ce=I.New;const qe=new s.Emitter,et=new s.Emitter,se=new s.Emitter,_e=new s.Emitter,ne=new s.Emitter,De=H&&H.cancellationStrategy?H.cancellationStrategy:B.Message;function Me(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function ht(E){return E===null?"res-unknown-"+(++C).toString():"res-"+E.toString()}function Xe(){return"not-"+(++te).toString()}function Ut(E,G){r.Message.isRequest(G)?E.set(Me(G.id),G):r.Message.isResponse(G)?E.set(ht(G.id),G):E.set(Xe(),G)}function Ht(E){}function ln(){return ce===I.Listening}function J(){return ce===I.Closed}function Z(){return ce===I.Disposed}function fe(){(ce===I.New||ce===I.Listening)&&(ce=I.Closed,et.fire(void 0))}function Vt(E){qe.fire([E,void 0,void 0])}function Gt(E){qe.fire(E)}$.onClose(fe),$.onError(Vt),L.onClose(fe),L.onError(Gt);function Er(){oe||be.size===0||(oe=(0,e.default)().timer.setImmediate(()=>{oe=void 0,as()}))}function $i(E){r.Message.isRequest(E)?us(E):r.Message.isNotification(E)?Ti(E):r.Message.isResponse(E)?ls(E):Si(E)}function as(){if(be.size===0)return;const E=be.shift();try{const G=H?.messageStrategy;z.is(G)?G.handleMessage(E,$i):$i(E)}finally{Er()}}const cs=E=>{try{if(r.Message.isNotification(E)&&E.method===a.type.method){const G=E.params.id,ee=Me(G),ie=be.get(ee);if(r.Message.isRequest(ie)){const Ne=H?.connectionStrategy,Je=Ne&&Ne.cancelUndispatched?Ne.cancelUndispatched(ie,Ht):void 0;if(Je&&(Je.error!==void 0||Je.result!==void 0)){be.delete(ee),O.delete(G),Je.id=ie.id,Rr(Je,E.method,Date.now()),L.write(Je).catch(()=>K.error("Sending response for canceled message failed."));return}}const Be=O.get(G);if(Be!==void 0){Be.cancel(),Wr(E);return}else ae.add(G)}Ut(be,E)}finally{Er()}};function us(E){if(Z())return;function G(Pe,it,Ze){const Bt={jsonrpc:he,id:E.id};Pe instanceof r.ResponseError?Bt.error=Pe.toJson():Bt.result=Pe===void 0?null:Pe,Rr(Bt,it,Ze),L.write(Bt).catch(()=>K.error("Sending response failed."))}function ee(Pe,it,Ze){const Bt={jsonrpc:he,id:E.id,error:Pe.toJson()};Rr(Bt,it,Ze),L.write(Bt).catch(()=>K.error("Sending response failed."))}function ie(Pe,it,Ze){Pe===void 0&&(Pe=null);const Bt={jsonrpc:he,id:E.id,result:Pe};Rr(Bt,it,Ze),L.write(Bt).catch(()=>K.error("Sending response failed."))}ps(E);const Be=pt.get(E.method);let Ne,Je;Be&&(Ne=Be.type,Je=Be.handler);const me=Date.now();if(Je||Ye){const Pe=E.id??String(Date.now()),it=k.is(De.receiver)?De.receiver.createCancellationTokenSource(Pe):De.receiver.createCancellationTokenSource(E);E.id!==null&&ae.has(E.id)&&it.cancel(),E.id!==null&&O.set(Pe,it);try{let Ze;if(Je)if(E.params===void 0){if(Ne!==void 0&&Ne.numberOfParams!==0){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines ${Ne.numberOfParams} params but received none.`),E.method,me);return}Ze=Je(it.token)}else if(Array.isArray(E.params)){if(Ne!==void 0&&Ne.parameterStructures===r.ParameterStructures.byName){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,me);return}Ze=Je(...E.params,it.token)}else{if(Ne!==void 0&&Ne.parameterStructures===r.ParameterStructures.byPosition){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,me);return}Ze=Je(E.params,it.token)}else Ye&&(Ze=Ye(E.method,E.params,it.token));const Bt=Ze;Ze?Bt.then?Bt.then(dn=>{O.delete(Pe),G(dn,E.method,me)},dn=>{O.delete(Pe),dn instanceof r.ResponseError?ee(dn,E.method,me):dn&&n.string(dn.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${dn.message}`),E.method,me):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,me)}):(O.delete(Pe),G(Ze,E.method,me)):(O.delete(Pe),ie(Ze,E.method,me))}catch(Ze){O.delete(Pe),Ze instanceof r.ResponseError?G(Ze,E.method,me):Ze&&n.string(Ze.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${Ze.message}`),E.method,me):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,me)}}else ee(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,me)}function ls(E){if(!Z())if(E.id===null)E.error?K.error(`Received response message without id: Error is:
|
|
130
|
+
${JSON.stringify(E.error,void 0,4)}`):K.error("Received response message without id. No further error information provided.");else{const G=E.id,ee=Se.get(G);if(hs(E,ee),ee!==void 0){Se.delete(G);try{if(E.error){const ie=E.error;ee.reject(new r.ResponseError(ie.code,ie.message,ie.data))}else if(E.result!==void 0)ee.resolve(E.result);else throw new Error("Should never happen.")}catch(ie){ie.message?K.error(`Response handler '${ee.method}' failed with message: ${ie.message}`):K.error(`Response handler '${ee.method}' failed unexpectedly.`)}}}}function Ti(E){if(Z())return;let G,ee;if(E.method===a.type.method){const ie=E.params.id;ae.delete(ie),Wr(E);return}else{const ie=X.get(E.method);ie&&(ee=ie.handler,G=ie.type)}if(ee||W)try{if(Wr(E),ee)if(E.params===void 0)G!==void 0&&G.numberOfParams!==0&&G.parameterStructures!==r.ParameterStructures.byName&&K.error(`Notification ${E.method} defines ${G.numberOfParams} params but received none.`),ee();else if(Array.isArray(E.params)){const ie=E.params;E.method===u.type.method&&ie.length===2&&c.is(ie[0])?ee({token:ie[0],value:ie[1]}):(G!==void 0&&(G.parameterStructures===r.ParameterStructures.byName&&K.error(`Notification ${E.method} defines parameters by name but received parameters by position`),G.numberOfParams!==E.params.length&&K.error(`Notification ${E.method} defines ${G.numberOfParams} params but received ${ie.length} arguments`)),ee(...ie))}else G!==void 0&&G.parameterStructures===r.ParameterStructures.byPosition&&K.error(`Notification ${E.method} defines parameters by position but received parameters by name`),ee(E.params);else W&&W(E.method,E.params)}catch(ie){ie.message?K.error(`Notification handler '${E.method}' failed with message: ${ie.message}`):K.error(`Notification handler '${E.method}' failed unexpectedly.`)}else se.fire(E)}function Si(E){if(!E){K.error("Received empty message.");return}K.error(`Received message which is neither a response nor a notification message:
|
|
131
|
+
${JSON.stringify(E,null,4)}`);const G=E;if(n.string(G.id)||n.number(G.id)){const ee=G.id,ie=Se.get(ee);ie&&ie.reject(new Error("The received response has neither a result nor an error property."))}}function Tn(E){if(E!=null)switch(j){case f.Verbose:return JSON.stringify(E,null,4);case f.Compact:return JSON.stringify(E);default:return}}function ds(E){if(!(j===f.Off||!U))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&E.params&&(G=`Params: ${Tn(E.params)}
|
|
132
|
+
|
|
133
|
+
`),U.log(`Sending request '${E.method} - (${E.id})'.`,G)}else Hn("send-request",E)}function fs(E){if(!(j===f.Off||!U))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&(E.params?G=`Params: ${Tn(E.params)}
|
|
134
|
+
|
|
135
|
+
`:G=`No parameters provided.
|
|
136
|
+
|
|
137
|
+
`),U.log(`Sending notification '${E.method}'.`,G)}else Hn("send-notification",E)}function Rr(E,G,ee){if(!(j===f.Off||!U))if(de===h.Text){let ie;(j===f.Verbose||j===f.Compact)&&(E.error&&E.error.data?ie=`Error data: ${Tn(E.error.data)}
|
|
138
|
+
|
|
139
|
+
`:E.result?ie=`Result: ${Tn(E.result)}
|
|
140
|
+
|
|
141
|
+
`:E.error===void 0&&(ie=`No result returned.
|
|
142
|
+
|
|
143
|
+
`)),U.log(`Sending response '${G} - (${E.id})'. Processing request took ${Date.now()-ee}ms`,ie)}else Hn("send-response",E)}function ps(E){if(!(j===f.Off||!U))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&E.params&&(G=`Params: ${Tn(E.params)}
|
|
144
|
+
|
|
145
|
+
`),U.log(`Received request '${E.method} - (${E.id})'.`,G)}else Hn("receive-request",E)}function Wr(E){if(!(j===f.Off||!U||E.method===b.type.method))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&(E.params?G=`Params: ${Tn(E.params)}
|
|
146
|
+
|
|
147
|
+
`:G=`No parameters provided.
|
|
148
|
+
|
|
149
|
+
`),U.log(`Received notification '${E.method}'.`,G)}else Hn("receive-notification",E)}function hs(E,G){if(!(j===f.Off||!U))if(de===h.Text){let ee;if((j===f.Verbose||j===f.Compact)&&(E.error&&E.error.data?ee=`Error data: ${Tn(E.error.data)}
|
|
150
|
+
|
|
151
|
+
`:E.result?ee=`Result: ${Tn(E.result)}
|
|
152
|
+
|
|
153
|
+
`:E.error===void 0&&(ee=`No result returned.
|
|
154
|
+
|
|
155
|
+
`)),G){const ie=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";U.log(`Received response '${G.method} - (${E.id})' in ${Date.now()-G.timerStart}ms.${ie}`,ee)}else U.log(`Received response ${E.id} without active response promise.`,ee)}else Hn("receive-response",E)}function Hn(E,G){if(!U||j===f.Off)return;const ee={isLSPMessage:!0,type:E,message:G,timestamp:Date.now()};U.log(ee)}function ir(){if(J())throw new w(g.Closed,"Connection is closed.");if(Z())throw new w(g.Disposed,"Connection is disposed.")}function mo(){if(ln())throw new w(g.AlreadyListening,"Connection is already listening")}function M(){if(!ln())throw new Error("Call listen() first.")}function D(E){return E===void 0?null:E}function P(E){if(E!==null)return E}function m(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function S(E,G){switch(E){case r.ParameterStructures.auto:return m(G)?P(G):[D(G)];case r.ParameterStructures.byName:if(!m(G))throw new Error("Received parameters by name but param is not an object literal.");return P(G);case r.ParameterStructures.byPosition:return[D(G)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function y(E,G){let ee;const ie=E.numberOfParams;switch(ie){case 0:ee=void 0;break;case 1:ee=S(E.parameterStructures,G[0]);break;default:ee=[];for(let Be=0;Be<G.length&&Be<ie;Be++)ee.push(D(G[Be]));if(G.length<ie)for(let Be=G.length;Be<ie;Be++)ee.push(null);break}return ee}const x={sendNotification:(E,...G)=>{ir();let ee,ie;if(n.string(E)){ee=E;const Ne=G[0];let Je=0,me=r.ParameterStructures.auto;r.ParameterStructures.is(Ne)&&(Je=1,me=Ne);let Pe=G.length;const it=Pe-Je;switch(it){case 0:ie=void 0;break;case 1:ie=S(me,G[Je]);break;default:if(me===r.ParameterStructures.byName)throw new Error(`Received ${it} parameters for 'by Name' notification parameter structure.`);ie=G.slice(Je,Pe).map(Ze=>D(Ze));break}}else{const Ne=G;ee=E.method,ie=y(E,Ne)}const Be={jsonrpc:he,method:ee,params:ie};return fs(Be),L.write(Be).catch(Ne=>{throw K.error("Sending notification failed."),Ne})},onNotification:(E,G)=>{ir();let ee;return n.func(E)?W=E:G&&(n.string(E)?(ee=E,X.set(E,{type:void 0,handler:G})):(ee=E.method,X.set(E.method,{type:E,handler:G}))),{dispose:()=>{ee!==void 0?X.delete(ee):W=void 0}}},onProgress:(E,G,ee)=>{if(Ie.has(G))throw new Error(`Progress handler for token ${G} already registered`);return Ie.set(G,ee),{dispose:()=>{Ie.delete(G)}}},sendProgress:(E,G,ee)=>x.sendNotification(u.type,{token:G,value:ee}),onUnhandledProgress:_e.event,sendRequest:(E,...G)=>{ir(),M();let ee,ie,Be;if(n.string(E)){ee=E;const Pe=G[0],it=G[G.length-1];let Ze=0,Bt=r.ParameterStructures.auto;r.ParameterStructures.is(Pe)&&(Ze=1,Bt=Pe);let dn=G.length;o.CancellationToken.is(it)&&(dn=dn-1,Be=it);const $r=dn-Ze;switch($r){case 0:ie=void 0;break;case 1:ie=S(Bt,G[Ze]);break;default:if(Bt===r.ParameterStructures.byName)throw new Error(`Received ${$r} parameters for 'by Name' request parameter structure.`);ie=G.slice(Ze,dn).map(AN=>D(AN));break}}else{const Pe=G;ee=E.method,ie=y(E,Pe);const it=E.numberOfParams;Be=o.CancellationToken.is(Pe[it])?Pe[it]:void 0}const Ne=we++;let Je;Be&&(Je=Be.onCancellationRequested(()=>{const Pe=De.sender.sendCancellation(x,Ne);return Pe===void 0?(K.log(`Received no promise from cancellation strategy when cancelling id ${Ne}`),Promise.resolve()):Pe.catch(()=>{K.log(`Sending cancellation messages for id ${Ne} failed`)})}));const me={jsonrpc:he,id:Ne,method:ee,params:ie};return ds(me),typeof De.sender.enableCancellation=="function"&&De.sender.enableCancellation(me),new Promise(async(Pe,it)=>{const Ze=$r=>{Pe($r),De.sender.cleanup(Ne),Je?.dispose()},Bt=$r=>{it($r),De.sender.cleanup(Ne),Je?.dispose()},dn={method:ee,timerStart:Date.now(),resolve:Ze,reject:Bt};try{await L.write(me),Se.set(Ne,dn)}catch($r){throw K.error("Sending request failed."),dn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,$r.message?$r.message:"Unknown reason")),$r}})},onRequest:(E,G)=>{ir();let ee=null;return d.is(E)?(ee=void 0,Ye=E):n.string(E)?(ee=null,G!==void 0&&(ee=E,pt.set(E,{handler:G,type:void 0}))):G!==void 0&&(ee=E.method,pt.set(E.method,{type:E,handler:G})),{dispose:()=>{ee!==null&&(ee!==void 0?pt.delete(ee):Ye=void 0)}}},hasPendingResponse:()=>Se.size>0,trace:async(E,G,ee)=>{let ie=!1,Be=h.Text;ee!==void 0&&(n.boolean(ee)?ie=ee:(ie=ee.sendNotification||!1,Be=ee.traceFormat||h.Text)),j=E,de=Be,j===f.Off?U=void 0:U=G,ie&&!J()&&!Z()&&await x.sendNotification(v.type,{value:f.toString(E)})},onError:qe.event,onClose:et.event,onUnhandledNotification:se.event,onDispose:ne.event,end:()=>{L.end()},dispose:()=>{if(Z())return;ce=I.Disposed,ne.fire(void 0);const E=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const G of Se.values())G.reject(E);Se=new Map,O=new Map,ae=new Set,be=new i.LinkedMap,n.func(L.dispose)&&L.dispose(),n.func($.dispose)&&$.dispose()},listen:()=>{ir(),mo(),ce=I.Listening,$.listen(cs)},inspect:()=>{(0,e.default)().console.log("inspect")}};return x.onNotification(b.type,E=>{if(j===f.Off||!U)return;const G=j===f.Verbose||j===f.Compact;U.log(E.message,G?E.verbose:void 0)}),x.onNotification(u.type,E=>{const G=Ie.get(E.token);G?G(E.value):_e.fire(E)}),x}t.createMessageConnection=T}(Pv)),Pv}var uk;function xv(){return uk||(uk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=ZS();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=ek();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=b9();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ho();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=$p();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=D9();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=E9();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=R9();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const u=$9();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const l=T9();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return l.MessageStrategy}});const d=xs();t.RAL=d.default}(_v)),_v}var lk;function S9(){if(lk)return Lp;lk=1,Object.defineProperty(Lp,"__esModule",{value:!0});const t=jN,e=xv();class n extends e.AbstractMessageBuffer{constructor(c="utf-8"){super(c)}emptyBuffer(){return n.emptyBuffer}fromString(c,u){return Buffer.from(c,u)}toString(c,u){return c instanceof Buffer?c.toString(u):new t.TextDecoder(u).decode(c)}asNative(c,u){return u===void 0?c instanceof Buffer?c:Buffer.from(c):c instanceof Buffer?c.slice(0,u):Buffer.from(c,0,u)}allocNative(c){return Buffer.allocUnsafe(c)}}n.emptyBuffer=Buffer.allocUnsafe(0);class r{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}onData(c){return this.stream.on("data",c),e.Disposable.create(()=>this.stream.off("data",c))}}class i{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}write(c,u){return new Promise((l,d)=>{const f=p=>{p==null?l():d(p)};typeof c=="string"?this.stream.write(c,u,f):this.stream.write(c,f)})}end(){this.stream.end()}}const s=Object.freeze({messageBuffer:Object.freeze({create:a=>new n(a)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(a,c)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(a,void 0,0),c.charset))}catch(u){return Promise.reject(u)}}}),decoder:Object.freeze({name:"application/json",decode:(a,c)=>{try{return a instanceof Buffer?Promise.resolve(JSON.parse(a.toString(c.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(c.charset).decode(a)))}catch(u){return Promise.reject(u)}}})}),stream:Object.freeze({asReadableStream:a=>new r(a),asWritableStream:a=>new i(a)}),console,timer:Object.freeze({setTimeout(a,c,...u){const l=setTimeout(a,c,...u);return{dispose:()=>clearTimeout(l)}},setImmediate(a,...c){const u=setImmediate(a,...c);return{dispose:()=>clearImmediate(u)}},setInterval(a,c,...u){const l=setInterval(a,c,...u);return{dispose:()=>clearInterval(l)}}})});function o(){return s}return function(a){function c(){e.RAL.install(s)}a.install=c}(o),Lp.default=o,Lp}var dk;function Bs(){return dk||(dk=1,function(t){var e=Zc.__createBinding||(Object.create?function(I,T,$,L){L===void 0&&(L=$);var V=Object.getOwnPropertyDescriptor(T,$);(!V||("get"in V?!T.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return T[$]}}),Object.defineProperty(I,L,V)}:function(I,T,$,L){L===void 0&&(L=$),I[L]=T[$]}),n=Zc.__exportStar||function(I,T){for(var $ in I)$!=="default"&&!Object.prototype.hasOwnProperty.call(T,$)&&e(T,I,$)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const r=S9();r.default.install();const i=Tr,s=UN,o=GN,a=WN,c=xv();n(xv(),t);class u extends c.AbstractMessageReader{constructor(T){super(),this.process=T;let $=this.process;$.on("error",L=>this.fireError(L)),$.on("close",()=>this.fireClose())}listen(T){return this.process.on("message",T),c.Disposable.create(()=>this.process.off("message",T))}}t.IPCMessageReader=u;class l extends c.AbstractMessageWriter{constructor(T){super(),this.process=T,this.errorCount=0;const $=this.process;$.on("error",L=>this.fireError(L)),$.on("close",()=>this.fireClose)}write(T){try{return typeof this.process.send=="function"&&this.process.send(T,void 0,void 0,$=>{$?(this.errorCount++,this.handleError($,T)):this.errorCount=0}),Promise.resolve()}catch($){return this.handleError($,T),Promise.reject($)}}handleError(T,$){this.errorCount++,this.fireError(T,$,this.errorCount)}end(){}}t.IPCMessageWriter=l;class d extends c.AbstractMessageReader{constructor(T){super(),this.onData=new c.Emitter,T.on("close",()=>this.fireClose),T.on("error",$=>this.fireError($)),T.on("message",$=>{this.onData.fire($)})}listen(T){return this.onData.event(T)}}t.PortMessageReader=d;class f extends c.AbstractMessageWriter{constructor(T){super(),this.port=T,this.errorCount=0,T.on("close",()=>this.fireClose()),T.on("error",$=>this.fireError($))}write(T){try{return this.port.postMessage(T),Promise.resolve()}catch($){return this.handleError($,T),Promise.reject($)}}handleError(T,$){this.errorCount++,this.fireError(T,$,this.errorCount)}end(){}}t.PortMessageWriter=f;class p extends c.ReadableStreamMessageReader{constructor(T,$="utf-8"){super((0,r.default)().stream.asReadableStream(T),$)}}t.SocketMessageReader=p;class h extends c.WriteableStreamMessageWriter{constructor(T,$){super((0,r.default)().stream.asWritableStream(T),$),this.socket=T}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=h;class v extends c.ReadableStreamMessageReader{constructor(T,$){super((0,r.default)().stream.asReadableStream(T),$)}}t.StreamMessageReader=v;class b extends c.WriteableStreamMessageWriter{constructor(T,$){super((0,r.default)().stream.asWritableStream(T),$)}}t.StreamMessageWriter=b;const g=process.env.XDG_RUNTIME_DIR,w=new Map([["linux",107],["darwin",103]]);function R(){const I=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${I}-sock`;let T;g?T=i.join(g,`vscode-ipc-${I}.sock`):T=i.join(s.tmpdir(),`vscode-${I}.sock`);const $=w.get(process.platform);return $!==void 0&&T.length>$&&(0,r.default)().console.warn(`WARNING: IPC handle "${T}" is longer than ${$} characters.`),T}t.generateRandomPipeName=R;function k(I,T="utf-8"){let $;const L=new Promise((V,H)=>{$=V});return new Promise((V,H)=>{let K=(0,a.createServer)(we=>{K.close(),$([new p(we,T),new h(we,T)])});K.on("error",H),K.listen(I,()=>{K.removeListener("error",H),V({onConnected:()=>L})})})}t.createClientPipeTransport=k;function A(I,T="utf-8"){const $=(0,a.createConnection)(I);return[new p($,T),new h($,T)]}t.createServerPipeTransport=A;function N(I,T="utf-8"){let $;const L=new Promise((V,H)=>{$=V});return new Promise((V,H)=>{const K=(0,a.createServer)(we=>{K.close(),$([new p(we,T),new h(we,T)])});K.on("error",H),K.listen(I,"127.0.0.1",()=>{K.removeListener("error",H),V({onConnected:()=>L})})})}t.createClientSocketTransport=N;function _(I,T="utf-8"){const $=(0,a.createConnection)(I,"127.0.0.1");return[new p($,T),new h($,T)]}t.createServerSocketTransport=_;function B(I){const T=I;return T.read!==void 0&&T.addListener!==void 0}function z(I){const T=I;return T.write!==void 0&&T.addListener!==void 0}function Q(I,T,$,L){$||($=c.NullLogger);const V=B(I)?new v(I):I,H=z(T)?new b(T):T;return c.ConnectionStrategy.is(L)&&(L={connectionStrategy:L}),(0,c.createMessageConnection)(V,H,$,L)}t.createMessageConnection=Q}(Zc)),Zc}var Iv,fk;function pk(){return fk||(fk=1,Iv=Bs()),Iv}var nu={};function k9(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Mp={exports:{}},hk;function Nv(){return hk||(hk=1,function(t,e){(function(n){{var r=n(k9,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=r.InlineCompletionContext=r.SelectedCompletionInfo=r.InlineCompletionTriggerKind=r.InlineCompletionList=r.InlineCompletionItem=r.StringValue=r.InlayHint=r.InlayHintLabelPart=r.InlayHintKind=r.InlineValueContext=r.InlineValueEvaluatableExpression=r.InlineValueVariableLookup=r.InlineValueText=r.SemanticTokens=r.SemanticTokenModifiers=r.SemanticTokenTypes=r.SelectionRange=r.DocumentLink=r.FormattingOptions=r.CodeLens=r.CodeAction=r.CodeActionContext=r.CodeActionTriggerKind=r.CodeActionKind=r.DocumentSymbol=r.WorkspaceSymbol=r.SymbolInformation=r.SymbolTag=r.SymbolKind=r.DocumentHighlight=r.DocumentHighlightKind=r.SignatureInformation=r.ParameterInformation=r.Hover=r.MarkedString=r.CompletionList=r.CompletionItem=r.CompletionItemLabelDetails=r.InsertTextMode=r.InsertReplaceEdit=r.CompletionItemTag=r.InsertTextFormat=r.CompletionItemKind=r.MarkupContent=r.MarkupKind=r.TextDocumentItem=r.OptionalVersionedTextDocumentIdentifier=r.VersionedTextDocumentIdentifier=r.TextDocumentIdentifier=r.WorkspaceChange=r.WorkspaceEdit=r.DeleteFile=r.RenameFile=r.CreateFile=r.TextDocumentEdit=r.AnnotatedTextEdit=r.ChangeAnnotationIdentifier=r.ChangeAnnotation=r.TextEdit=r.Command=r.Diagnostic=r.CodeDescription=r.DiagnosticTag=r.DiagnosticSeverity=r.DiagnosticRelatedInformation=r.FoldingRange=r.FoldingRangeKind=r.ColorPresentation=r.ColorInformation=r.Color=r.LocationLink=r.Location=r.Range=r.Position=r.uinteger=r.integer=r.URI=r.DocumentUri=void 0;var i;(function(D){function P(m){return typeof m=="string"}D.is=P})(i||(r.DocumentUri=i={}));var s;(function(D){function P(m){return typeof m=="string"}D.is=P})(s||(r.URI=s={}));var o;(function(D){D.MIN_VALUE=-2147483648,D.MAX_VALUE=2147483647;function P(m){return typeof m=="number"&&D.MIN_VALUE<=m&&m<=D.MAX_VALUE}D.is=P})(o||(r.integer=o={}));var a;(function(D){D.MIN_VALUE=0,D.MAX_VALUE=2147483647;function P(m){return typeof m=="number"&&D.MIN_VALUE<=m&&m<=D.MAX_VALUE}D.is=P})(a||(r.uinteger=a={}));var c;(function(D){function P(S,y){return S===Number.MAX_VALUE&&(S=a.MAX_VALUE),y===Number.MAX_VALUE&&(y=a.MAX_VALUE),{line:S,character:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.uinteger(y.line)&&M.uinteger(y.character)}D.is=m})(c||(r.Position=c={}));var u;(function(D){function P(S,y,x,E){if(M.uinteger(S)&&M.uinteger(y)&&M.uinteger(x)&&M.uinteger(E))return{start:c.create(S,y),end:c.create(x,E)};if(c.is(S)&&c.is(y))return{start:S,end:y};throw new Error("Range#create called with invalid arguments[".concat(S,", ").concat(y,", ").concat(x,", ").concat(E,"]"))}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&c.is(y.start)&&c.is(y.end)}D.is=m})(u||(r.Range=u={}));var l;(function(D){function P(S,y){return{uri:S,range:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.range)&&(M.string(y.uri)||M.undefined(y.uri))}D.is=m})(l||(r.Location=l={}));var d;(function(D){function P(S,y,x,E){return{targetUri:S,targetRange:y,targetSelectionRange:x,originSelectionRange:E}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.targetRange)&&M.string(y.targetUri)&&u.is(y.targetSelectionRange)&&(u.is(y.originSelectionRange)||M.undefined(y.originSelectionRange))}D.is=m})(d||(r.LocationLink=d={}));var f;(function(D){function P(S,y,x,E){return{red:S,green:y,blue:x,alpha:E}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.numberRange(y.red,0,1)&&M.numberRange(y.green,0,1)&&M.numberRange(y.blue,0,1)&&M.numberRange(y.alpha,0,1)}D.is=m})(f||(r.Color=f={}));var p;(function(D){function P(S,y){return{range:S,color:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.range)&&f.is(y.color)}D.is=m})(p||(r.ColorInformation=p={}));var h;(function(D){function P(S,y,x){return{label:S,textEdit:y,additionalTextEdits:x}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.string(y.label)&&(M.undefined(y.textEdit)||_.is(y))&&(M.undefined(y.additionalTextEdits)||M.typedArray(y.additionalTextEdits,_.is))}D.is=m})(h||(r.ColorPresentation=h={}));var v;(function(D){D.Comment="comment",D.Imports="imports",D.Region="region"})(v||(r.FoldingRangeKind=v={}));var b;(function(D){function P(S,y,x,E,G,ee){var ie={startLine:S,endLine:y};return M.defined(x)&&(ie.startCharacter=x),M.defined(E)&&(ie.endCharacter=E),M.defined(G)&&(ie.kind=G),M.defined(ee)&&(ie.collapsedText=ee),ie}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.uinteger(y.startLine)&&M.uinteger(y.startLine)&&(M.undefined(y.startCharacter)||M.uinteger(y.startCharacter))&&(M.undefined(y.endCharacter)||M.uinteger(y.endCharacter))&&(M.undefined(y.kind)||M.string(y.kind))}D.is=m})(b||(r.FoldingRange=b={}));var g;(function(D){function P(S,y){return{location:S,message:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&l.is(y.location)&&M.string(y.message)}D.is=m})(g||(r.DiagnosticRelatedInformation=g={}));var w;(function(D){D.Error=1,D.Warning=2,D.Information=3,D.Hint=4})(w||(r.DiagnosticSeverity=w={}));var R;(function(D){D.Unnecessary=1,D.Deprecated=2})(R||(r.DiagnosticTag=R={}));var k;(function(D){function P(m){var S=m;return M.objectLiteral(S)&&M.string(S.href)}D.is=P})(k||(r.CodeDescription=k={}));var A;(function(D){function P(S,y,x,E,G,ee){var ie={range:S,message:y};return M.defined(x)&&(ie.severity=x),M.defined(E)&&(ie.code=E),M.defined(G)&&(ie.source=G),M.defined(ee)&&(ie.relatedInformation=ee),ie}D.create=P;function m(S){var y,x=S;return M.defined(x)&&u.is(x.range)&&M.string(x.message)&&(M.number(x.severity)||M.undefined(x.severity))&&(M.integer(x.code)||M.string(x.code)||M.undefined(x.code))&&(M.undefined(x.codeDescription)||M.string((y=x.codeDescription)===null||y===void 0?void 0:y.href))&&(M.string(x.source)||M.undefined(x.source))&&(M.undefined(x.relatedInformation)||M.typedArray(x.relatedInformation,g.is))}D.is=m})(A||(r.Diagnostic=A={}));var N;(function(D){function P(S,y){for(var x=[],E=2;E<arguments.length;E++)x[E-2]=arguments[E];var G={title:S,command:y};return M.defined(x)&&x.length>0&&(G.arguments=x),G}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.title)&&M.string(y.command)}D.is=m})(N||(r.Command=N={}));var _;(function(D){function P(x,E){return{range:x,newText:E}}D.replace=P;function m(x,E){return{range:{start:x,end:x},newText:E}}D.insert=m;function S(x){return{range:x,newText:""}}D.del=S;function y(x){var E=x;return M.objectLiteral(E)&&M.string(E.newText)&&u.is(E.range)}D.is=y})(_||(r.TextEdit=_={}));var B;(function(D){function P(S,y,x){var E={label:S};return y!==void 0&&(E.needsConfirmation=y),x!==void 0&&(E.description=x),E}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.string(y.label)&&(M.boolean(y.needsConfirmation)||y.needsConfirmation===void 0)&&(M.string(y.description)||y.description===void 0)}D.is=m})(B||(r.ChangeAnnotation=B={}));var z;(function(D){function P(m){var S=m;return M.string(S)}D.is=P})(z||(r.ChangeAnnotationIdentifier=z={}));var Q;(function(D){function P(x,E,G){return{range:x,newText:E,annotationId:G}}D.replace=P;function m(x,E,G){return{range:{start:x,end:x},newText:E,annotationId:G}}D.insert=m;function S(x,E){return{range:x,newText:"",annotationId:E}}D.del=S;function y(x){var E=x;return _.is(E)&&(B.is(E.annotationId)||z.is(E.annotationId))}D.is=y})(Q||(r.AnnotatedTextEdit=Q={}));var I;(function(D){function P(S,y){return{textDocument:S,edits:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&he.is(y.textDocument)&&Array.isArray(y.edits)}D.is=m})(I||(r.TextDocumentEdit=I={}));var T;(function(D){function P(S,y,x){var E={kind:"create",uri:S};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(E.options=y),x!==void 0&&(E.annotationId=x),E}D.create=P;function m(S){var y=S;return y&&y.kind==="create"&&M.string(y.uri)&&(y.options===void 0||(y.options.overwrite===void 0||M.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||M.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||z.is(y.annotationId))}D.is=m})(T||(r.CreateFile=T={}));var $;(function(D){function P(S,y,x,E){var G={kind:"rename",oldUri:S,newUri:y};return x!==void 0&&(x.overwrite!==void 0||x.ignoreIfExists!==void 0)&&(G.options=x),E!==void 0&&(G.annotationId=E),G}D.create=P;function m(S){var y=S;return y&&y.kind==="rename"&&M.string(y.oldUri)&&M.string(y.newUri)&&(y.options===void 0||(y.options.overwrite===void 0||M.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||M.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||z.is(y.annotationId))}D.is=m})($||(r.RenameFile=$={}));var L;(function(D){function P(S,y,x){var E={kind:"delete",uri:S};return y!==void 0&&(y.recursive!==void 0||y.ignoreIfNotExists!==void 0)&&(E.options=y),x!==void 0&&(E.annotationId=x),E}D.create=P;function m(S){var y=S;return y&&y.kind==="delete"&&M.string(y.uri)&&(y.options===void 0||(y.options.recursive===void 0||M.boolean(y.options.recursive))&&(y.options.ignoreIfNotExists===void 0||M.boolean(y.options.ignoreIfNotExists)))&&(y.annotationId===void 0||z.is(y.annotationId))}D.is=m})(L||(r.DeleteFile=L={}));var V;(function(D){function P(m){var S=m;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(y){return M.string(y.kind)?T.is(y)||$.is(y)||L.is(y):I.is(y)}))}D.is=P})(V||(r.WorkspaceEdit=V={}));var H=function(){function D(P,m){this.edits=P,this.changeAnnotations=m}return D.prototype.insert=function(P,m,S){var y,x;if(S===void 0?y=_.insert(P,m):z.is(S)?(x=S,y=Q.insert(P,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(S),y=Q.insert(P,m,x)),this.edits.push(y),x!==void 0)return x},D.prototype.replace=function(P,m,S){var y,x;if(S===void 0?y=_.replace(P,m):z.is(S)?(x=S,y=Q.replace(P,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(S),y=Q.replace(P,m,x)),this.edits.push(y),x!==void 0)return x},D.prototype.delete=function(P,m){var S,y;if(m===void 0?S=_.del(P):z.is(m)?(y=m,S=Q.del(P,m)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(m),S=Q.del(P,y)),this.edits.push(S),y!==void 0)return y},D.prototype.add=function(P){this.edits.push(P)},D.prototype.all=function(){return this.edits},D.prototype.clear=function(){this.edits.splice(0,this.edits.length)},D.prototype.assertChangeAnnotations=function(P){if(P===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},D}(),K=function(){function D(P){this._annotations=P===void 0?Object.create(null):P,this._counter=0,this._size=0}return D.prototype.all=function(){return this._annotations},Object.defineProperty(D.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),D.prototype.manage=function(P,m){var S;if(z.is(P)?S=P:(S=this.nextId(),m=P),this._annotations[S]!==void 0)throw new Error("Id ".concat(S," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(S));return this._annotations[S]=m,this._size++,S},D.prototype.nextId=function(){return this._counter++,this._counter.toString()},D}(),we=function(){function D(P){var m=this;this._textEditChanges=Object.create(null),P!==void 0?(this._workspaceEdit=P,P.documentChanges?(this._changeAnnotations=new K(P.changeAnnotations),P.changeAnnotations=this._changeAnnotations.all(),P.documentChanges.forEach(function(S){if(I.is(S)){var y=new H(S.edits,m._changeAnnotations);m._textEditChanges[S.textDocument.uri]=y}})):P.changes&&Object.keys(P.changes).forEach(function(S){var y=new H(P.changes[S]);m._textEditChanges[S]=y})):this._workspaceEdit={}}return Object.defineProperty(D.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),D.prototype.getTextEditChange=function(P){if(he.is(P)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:P.uri,version:P.version},S=this._textEditChanges[m.uri];if(!S){var y=[],x={textDocument:m,edits:y};this._workspaceEdit.documentChanges.push(x),S=new H(y,this._changeAnnotations),this._textEditChanges[m.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[P];if(!S){var y=[];this._workspaceEdit.changes[P]=y,S=new H(y),this._textEditChanges[P]=S}return S}},D.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new K,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},D.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},D.prototype.createFile=function(P,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;B.is(m)||z.is(m)?y=m:S=m;var x,E;if(y===void 0?x=T.create(P,S):(E=z.is(y)?y:this._changeAnnotations.manage(y),x=T.create(P,S,E)),this._workspaceEdit.documentChanges.push(x),E!==void 0)return E},D.prototype.renameFile=function(P,m,S,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var x;B.is(S)||z.is(S)?x=S:y=S;var E,G;if(x===void 0?E=$.create(P,m,y):(G=z.is(x)?x:this._changeAnnotations.manage(x),E=$.create(P,m,y,G)),this._workspaceEdit.documentChanges.push(E),G!==void 0)return G},D.prototype.deleteFile=function(P,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;B.is(m)||z.is(m)?y=m:S=m;var x,E;if(y===void 0?x=L.create(P,S):(E=z.is(y)?y:this._changeAnnotations.manage(y),x=L.create(P,S,E)),this._workspaceEdit.documentChanges.push(x),E!==void 0)return E},D}();r.WorkspaceChange=we;var te;(function(D){function P(S){return{uri:S}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)}D.is=m})(te||(r.TextDocumentIdentifier=te={}));var C;(function(D){function P(S,y){return{uri:S,version:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)&&M.integer(y.version)}D.is=m})(C||(r.VersionedTextDocumentIdentifier=C={}));var he;(function(D){function P(S,y){return{uri:S,version:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)&&(y.version===null||M.integer(y.version))}D.is=m})(he||(r.OptionalVersionedTextDocumentIdentifier=he={}));var Ye;(function(D){function P(S,y,x,E){return{uri:S,languageId:y,version:x,text:E}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)&&M.string(y.languageId)&&M.integer(y.version)&&M.string(y.text)}D.is=m})(Ye||(r.TextDocumentItem=Ye={}));var pt;(function(D){D.PlainText="plaintext",D.Markdown="markdown";function P(m){var S=m;return S===D.PlainText||S===D.Markdown}D.is=P})(pt||(r.MarkupKind=pt={}));var W;(function(D){function P(m){var S=m;return M.objectLiteral(m)&&pt.is(S.kind)&&M.string(S.value)}D.is=P})(W||(r.MarkupContent=W={}));var X;(function(D){D.Text=1,D.Method=2,D.Function=3,D.Constructor=4,D.Field=5,D.Variable=6,D.Class=7,D.Interface=8,D.Module=9,D.Property=10,D.Unit=11,D.Value=12,D.Enum=13,D.Keyword=14,D.Snippet=15,D.Color=16,D.File=17,D.Reference=18,D.Folder=19,D.EnumMember=20,D.Constant=21,D.Struct=22,D.Event=23,D.Operator=24,D.TypeParameter=25})(X||(r.CompletionItemKind=X={}));var Ie;(function(D){D.PlainText=1,D.Snippet=2})(Ie||(r.InsertTextFormat=Ie={}));var oe;(function(D){D.Deprecated=1})(oe||(r.CompletionItemTag=oe={}));var be;(function(D){function P(S,y,x){return{newText:S,insert:y,replace:x}}D.create=P;function m(S){var y=S;return y&&M.string(y.newText)&&u.is(y.insert)&&u.is(y.replace)}D.is=m})(be||(r.InsertReplaceEdit=be={}));var Se;(function(D){D.asIs=1,D.adjustIndentation=2})(Se||(r.InsertTextMode=Se={}));var ae;(function(D){function P(m){var S=m;return S&&(M.string(S.detail)||S.detail===void 0)&&(M.string(S.description)||S.description===void 0)}D.is=P})(ae||(r.CompletionItemLabelDetails=ae={}));var O;(function(D){function P(m){return{label:m}}D.create=P})(O||(r.CompletionItem=O={}));var j;(function(D){function P(m,S){return{items:m||[],isIncomplete:!!S}}D.create=P})(j||(r.CompletionList=j={}));var de;(function(D){function P(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}D.fromPlainText=P;function m(S){var y=S;return M.string(y)||M.objectLiteral(y)&&M.string(y.language)&&M.string(y.value)}D.is=m})(de||(r.MarkedString=de={}));var U;(function(D){function P(m){var S=m;return!!S&&M.objectLiteral(S)&&(W.is(S.contents)||de.is(S.contents)||M.typedArray(S.contents,de.is))&&(m.range===void 0||u.is(m.range))}D.is=P})(U||(r.Hover=U={}));var ce;(function(D){function P(m,S){return S?{label:m,documentation:S}:{label:m}}D.create=P})(ce||(r.ParameterInformation=ce={}));var qe;(function(D){function P(m,S){for(var y=[],x=2;x<arguments.length;x++)y[x-2]=arguments[x];var E={label:m};return M.defined(S)&&(E.documentation=S),M.defined(y)?E.parameters=y:E.parameters=[],E}D.create=P})(qe||(r.SignatureInformation=qe={}));var et;(function(D){D.Text=1,D.Read=2,D.Write=3})(et||(r.DocumentHighlightKind=et={}));var se;(function(D){function P(m,S){var y={range:m};return M.number(S)&&(y.kind=S),y}D.create=P})(se||(r.DocumentHighlight=se={}));var _e;(function(D){D.File=1,D.Module=2,D.Namespace=3,D.Package=4,D.Class=5,D.Method=6,D.Property=7,D.Field=8,D.Constructor=9,D.Enum=10,D.Interface=11,D.Function=12,D.Variable=13,D.Constant=14,D.String=15,D.Number=16,D.Boolean=17,D.Array=18,D.Object=19,D.Key=20,D.Null=21,D.EnumMember=22,D.Struct=23,D.Event=24,D.Operator=25,D.TypeParameter=26})(_e||(r.SymbolKind=_e={}));var ne;(function(D){D.Deprecated=1})(ne||(r.SymbolTag=ne={}));var De;(function(D){function P(m,S,y,x,E){var G={name:m,kind:S,location:{uri:x,range:y}};return E&&(G.containerName=E),G}D.create=P})(De||(r.SymbolInformation=De={}));var Me;(function(D){function P(m,S,y,x){return x!==void 0?{name:m,kind:S,location:{uri:y,range:x}}:{name:m,kind:S,location:{uri:y}}}D.create=P})(Me||(r.WorkspaceSymbol=Me={}));var ht;(function(D){function P(S,y,x,E,G,ee){var ie={name:S,detail:y,kind:x,range:E,selectionRange:G};return ee!==void 0&&(ie.children=ee),ie}D.create=P;function m(S){var y=S;return y&&M.string(y.name)&&M.number(y.kind)&&u.is(y.range)&&u.is(y.selectionRange)&&(y.detail===void 0||M.string(y.detail))&&(y.deprecated===void 0||M.boolean(y.deprecated))&&(y.children===void 0||Array.isArray(y.children))&&(y.tags===void 0||Array.isArray(y.tags))}D.is=m})(ht||(r.DocumentSymbol=ht={}));var Xe;(function(D){D.Empty="",D.QuickFix="quickfix",D.Refactor="refactor",D.RefactorExtract="refactor.extract",D.RefactorInline="refactor.inline",D.RefactorRewrite="refactor.rewrite",D.Source="source",D.SourceOrganizeImports="source.organizeImports",D.SourceFixAll="source.fixAll"})(Xe||(r.CodeActionKind=Xe={}));var Ut;(function(D){D.Invoked=1,D.Automatic=2})(Ut||(r.CodeActionTriggerKind=Ut={}));var Ht;(function(D){function P(S,y,x){var E={diagnostics:S};return y!=null&&(E.only=y),x!=null&&(E.triggerKind=x),E}D.create=P;function m(S){var y=S;return M.defined(y)&&M.typedArray(y.diagnostics,A.is)&&(y.only===void 0||M.typedArray(y.only,M.string))&&(y.triggerKind===void 0||y.triggerKind===Ut.Invoked||y.triggerKind===Ut.Automatic)}D.is=m})(Ht||(r.CodeActionContext=Ht={}));var ln;(function(D){function P(S,y,x){var E={title:S},G=!0;return typeof y=="string"?(G=!1,E.kind=y):N.is(y)?E.command=y:E.edit=y,G&&x!==void 0&&(E.kind=x),E}D.create=P;function m(S){var y=S;return y&&M.string(y.title)&&(y.diagnostics===void 0||M.typedArray(y.diagnostics,A.is))&&(y.kind===void 0||M.string(y.kind))&&(y.edit!==void 0||y.command!==void 0)&&(y.command===void 0||N.is(y.command))&&(y.isPreferred===void 0||M.boolean(y.isPreferred))&&(y.edit===void 0||V.is(y.edit))}D.is=m})(ln||(r.CodeAction=ln={}));var J;(function(D){function P(S,y){var x={range:S};return M.defined(y)&&(x.data=y),x}D.create=P;function m(S){var y=S;return M.defined(y)&&u.is(y.range)&&(M.undefined(y.command)||N.is(y.command))}D.is=m})(J||(r.CodeLens=J={}));var Z;(function(D){function P(S,y){return{tabSize:S,insertSpaces:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.uinteger(y.tabSize)&&M.boolean(y.insertSpaces)}D.is=m})(Z||(r.FormattingOptions=Z={}));var fe;(function(D){function P(S,y,x){return{range:S,target:y,data:x}}D.create=P;function m(S){var y=S;return M.defined(y)&&u.is(y.range)&&(M.undefined(y.target)||M.string(y.target))}D.is=m})(fe||(r.DocumentLink=fe={}));var Vt;(function(D){function P(S,y){return{range:S,parent:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.range)&&(y.parent===void 0||D.is(y.parent))}D.is=m})(Vt||(r.SelectionRange=Vt={}));var Gt;(function(D){D.namespace="namespace",D.type="type",D.class="class",D.enum="enum",D.interface="interface",D.struct="struct",D.typeParameter="typeParameter",D.parameter="parameter",D.variable="variable",D.property="property",D.enumMember="enumMember",D.event="event",D.function="function",D.method="method",D.macro="macro",D.keyword="keyword",D.modifier="modifier",D.comment="comment",D.string="string",D.number="number",D.regexp="regexp",D.operator="operator",D.decorator="decorator"})(Gt||(r.SemanticTokenTypes=Gt={}));var Er;(function(D){D.declaration="declaration",D.definition="definition",D.readonly="readonly",D.static="static",D.deprecated="deprecated",D.abstract="abstract",D.async="async",D.modification="modification",D.documentation="documentation",D.defaultLibrary="defaultLibrary"})(Er||(r.SemanticTokenModifiers=Er={}));var $i;(function(D){function P(m){var S=m;return M.objectLiteral(S)&&(S.resultId===void 0||typeof S.resultId=="string")&&Array.isArray(S.data)&&(S.data.length===0||typeof S.data[0]=="number")}D.is=P})($i||(r.SemanticTokens=$i={}));var as;(function(D){function P(S,y){return{range:S,text:y}}D.create=P;function m(S){var y=S;return y!=null&&u.is(y.range)&&M.string(y.text)}D.is=m})(as||(r.InlineValueText=as={}));var cs;(function(D){function P(S,y,x){return{range:S,variableName:y,caseSensitiveLookup:x}}D.create=P;function m(S){var y=S;return y!=null&&u.is(y.range)&&M.boolean(y.caseSensitiveLookup)&&(M.string(y.variableName)||y.variableName===void 0)}D.is=m})(cs||(r.InlineValueVariableLookup=cs={}));var us;(function(D){function P(S,y){return{range:S,expression:y}}D.create=P;function m(S){var y=S;return y!=null&&u.is(y.range)&&(M.string(y.expression)||y.expression===void 0)}D.is=m})(us||(r.InlineValueEvaluatableExpression=us={}));var ls;(function(D){function P(S,y){return{frameId:S,stoppedLocation:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&u.is(S.stoppedLocation)}D.is=m})(ls||(r.InlineValueContext=ls={}));var Ti;(function(D){D.Type=1,D.Parameter=2;function P(m){return m===1||m===2}D.is=P})(Ti||(r.InlayHintKind=Ti={}));var Si;(function(D){function P(S){return{value:S}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&(y.tooltip===void 0||M.string(y.tooltip)||W.is(y.tooltip))&&(y.location===void 0||l.is(y.location))&&(y.command===void 0||N.is(y.command))}D.is=m})(Si||(r.InlayHintLabelPart=Si={}));var Tn;(function(D){function P(S,y,x){var E={position:S,label:y};return x!==void 0&&(E.kind=x),E}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&c.is(y.position)&&(M.string(y.label)||M.typedArray(y.label,Si.is))&&(y.kind===void 0||Ti.is(y.kind))&&y.textEdits===void 0||M.typedArray(y.textEdits,_.is)&&(y.tooltip===void 0||M.string(y.tooltip)||W.is(y.tooltip))&&(y.paddingLeft===void 0||M.boolean(y.paddingLeft))&&(y.paddingRight===void 0||M.boolean(y.paddingRight))}D.is=m})(Tn||(r.InlayHint=Tn={}));var ds;(function(D){function P(m){return{kind:"snippet",value:m}}D.createSnippet=P})(ds||(r.StringValue=ds={}));var fs;(function(D){function P(m,S,y,x){return{insertText:m,filterText:S,range:y,command:x}}D.create=P})(fs||(r.InlineCompletionItem=fs={}));var Rr;(function(D){function P(m){return{items:m}}D.create=P})(Rr||(r.InlineCompletionList=Rr={}));var ps;(function(D){D.Invoked=0,D.Automatic=1})(ps||(r.InlineCompletionTriggerKind=ps={}));var Wr;(function(D){function P(m,S){return{range:m,text:S}}D.create=P})(Wr||(r.SelectedCompletionInfo=Wr={}));var hs;(function(D){function P(m,S){return{triggerKind:m,selectedCompletionInfo:S}}D.create=P})(hs||(r.InlineCompletionContext=hs={}));var Hn;(function(D){function P(m){var S=m;return M.objectLiteral(S)&&s.is(S.uri)&&M.string(S.name)}D.is=P})(Hn||(r.WorkspaceFolder=Hn={})),r.EOL=[`
|
|
156
|
+
`,`\r
|
|
157
|
+
`,"\r"];var ir;(function(D){function P(x,E,G,ee){return new mo(x,E,G,ee)}D.create=P;function m(x){var E=x;return!!(M.defined(E)&&M.string(E.uri)&&(M.undefined(E.languageId)||M.string(E.languageId))&&M.uinteger(E.lineCount)&&M.func(E.getText)&&M.func(E.positionAt)&&M.func(E.offsetAt))}D.is=m;function S(x,E){for(var G=x.getText(),ee=y(E,function(Pe,it){var Ze=Pe.range.start.line-it.range.start.line;return Ze===0?Pe.range.start.character-it.range.start.character:Ze}),ie=G.length,Be=ee.length-1;Be>=0;Be--){var Ne=ee[Be],Je=x.offsetAt(Ne.range.start),me=x.offsetAt(Ne.range.end);if(me<=ie)G=G.substring(0,Je)+Ne.newText+G.substring(me,G.length);else throw new Error("Overlapping edit");ie=Je}return G}D.applyEdits=S;function y(x,E){if(x.length<=1)return x;var G=x.length/2|0,ee=x.slice(0,G),ie=x.slice(G);y(ee,E),y(ie,E);for(var Be=0,Ne=0,Je=0;Be<ee.length&&Ne<ie.length;){var me=E(ee[Be],ie[Ne]);me<=0?x[Je++]=ee[Be++]:x[Je++]=ie[Ne++]}for(;Be<ee.length;)x[Je++]=ee[Be++];for(;Ne<ie.length;)x[Je++]=ie[Ne++];return x}})(ir||(r.TextDocument=ir={}));var mo=function(){function D(P,m,S,y){this._uri=P,this._languageId=m,this._version=S,this._content=y,this._lineOffsets=void 0}return Object.defineProperty(D.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),D.prototype.getText=function(P){if(P){var m=this.offsetAt(P.start),S=this.offsetAt(P.end);return this._content.substring(m,S)}return this._content},D.prototype.update=function(P,m){this._content=P.text,this._version=m,this._lineOffsets=void 0},D.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var P=[],m=this._content,S=!0,y=0;y<m.length;y++){S&&(P.push(y),S=!1);var x=m.charAt(y);S=x==="\r"||x===`
|
|
158
|
+
`,x==="\r"&&y+1<m.length&&m.charAt(y+1)===`
|
|
159
|
+
`&&y++}S&&m.length>0&&P.push(m.length),this._lineOffsets=P}return this._lineOffsets},D.prototype.positionAt=function(P){P=Math.max(Math.min(P,this._content.length),0);var m=this.getLineOffsets(),S=0,y=m.length;if(y===0)return c.create(0,P);for(;S<y;){var x=Math.floor((S+y)/2);m[x]>P?y=x:S=x+1}var E=S-1;return c.create(E,P-m[E])},D.prototype.offsetAt=function(P){var m=this.getLineOffsets();if(P.line>=m.length)return this._content.length;if(P.line<0)return 0;var S=m[P.line],y=P.line+1<m.length?m[P.line+1]:this._content.length;return Math.max(Math.min(S+P.character,y),S)},Object.defineProperty(D.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),D}(),M;(function(D){var P=Object.prototype.toString;function m(me){return typeof me<"u"}D.defined=m;function S(me){return typeof me>"u"}D.undefined=S;function y(me){return me===!0||me===!1}D.boolean=y;function x(me){return P.call(me)==="[object String]"}D.string=x;function E(me){return P.call(me)==="[object Number]"}D.number=E;function G(me,Pe,it){return P.call(me)==="[object Number]"&&Pe<=me&&me<=it}D.numberRange=G;function ee(me){return P.call(me)==="[object Number]"&&-2147483648<=me&&me<=2147483647}D.integer=ee;function ie(me){return P.call(me)==="[object Number]"&&0<=me&&me<=2147483647}D.uinteger=ie;function Be(me){return P.call(me)==="[object Function]"}D.func=Be;function Ne(me){return me!==null&&typeof me=="object"}D.objectLiteral=Ne;function Je(me,Pe){return Array.isArray(me)&&me.every(Pe)}D.typedArray=Je})(M||(M={}))})}(Mp,Mp.exports)),Mp.exports}var wn={},mk;function Rt(){if(mk)return wn;mk=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.ProtocolNotificationType=wn.ProtocolNotificationType0=wn.ProtocolRequestType=wn.ProtocolRequestType0=wn.RegistrationType=wn.MessageDirection=void 0;const t=Bs();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(wn.MessageDirection=e={}));class n{constructor(c){this.method=c}}wn.RegistrationType=n;class r extends t.RequestType0{constructor(c){super(c)}}wn.ProtocolRequestType0=r;class i extends t.RequestType{constructor(c){super(c,t.ParameterStructures.byName)}}wn.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(c){super(c)}}wn.ProtocolNotificationType0=s;class o extends t.NotificationType{constructor(c){super(c,t.ParameterStructures.byName)}}return wn.ProtocolNotificationType=o,wn}var Ov={},_t={},gk;function Fv(){if(gk)return _t;gk=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.objectLiteral=_t.typedArray=_t.stringArray=_t.array=_t.func=_t.error=_t.number=_t.string=_t.boolean=void 0;function t(u){return u===!0||u===!1}_t.boolean=t;function e(u){return typeof u=="string"||u instanceof String}_t.string=e;function n(u){return typeof u=="number"||u instanceof Number}_t.number=n;function r(u){return u instanceof Error}_t.error=r;function i(u){return typeof u=="function"}_t.func=i;function s(u){return Array.isArray(u)}_t.array=s;function o(u){return s(u)&&u.every(l=>e(l))}_t.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}_t.typedArray=a;function c(u){return u!==null&&typeof u=="object"}return _t.objectLiteral=c,_t}var ru={},yk;function C9(){if(yk)return ru;yk=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.ImplementationRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(ru.ImplementationRequest=e={})),ru}var iu={},vk;function A9(){if(vk)return iu;vk=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.TypeDefinitionRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(iu.TypeDefinitionRequest=e={})),iu}var zs={},wk;function _9(){if(wk)return zs;wk=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.DidChangeWorkspaceFoldersNotification=zs.WorkspaceFoldersRequest=void 0;const t=Rt();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(zs.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(zs.DidChangeWorkspaceFoldersNotification=n={})),zs}var su={},bk;function P9(){if(bk)return su;bk=1,Object.defineProperty(su,"__esModule",{value:!0}),su.ConfigurationRequest=void 0;const t=Rt();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(su.ConfigurationRequest=e={})),su}var qs={},Dk;function x9(){if(Dk)return qs;Dk=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.ColorPresentationRequest=qs.DocumentColorRequest=void 0;const t=Rt();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(qs.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(qs.ColorPresentationRequest=n={})),qs}var js={},Ek;function I9(){if(Ek)return js;Ek=1,Object.defineProperty(js,"__esModule",{value:!0}),js.FoldingRangeRefreshRequest=js.FoldingRangeRequest=void 0;const t=Rt();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(js.FoldingRangeRequest=e={}));var n;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(js.FoldingRangeRefreshRequest=n={})),js}var ou={},Rk;function N9(){if(Rk)return ou;Rk=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.DeclarationRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(ou.DeclarationRequest=e={})),ou}var au={},$k;function O9(){if($k)return au;$k=1,Object.defineProperty(au,"__esModule",{value:!0}),au.SelectionRangeRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(au.SelectionRangeRequest=e={})),au}var pi={},Tk;function F9(){if(Tk)return pi;Tk=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.WorkDoneProgressCancelNotification=pi.WorkDoneProgressCreateRequest=pi.WorkDoneProgress=void 0;const t=Bs(),e=Rt();var n;(function(s){s.type=new t.ProgressType;function o(a){return a===s.type}s.is=o})(n||(pi.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(pi.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||(pi.WorkDoneProgressCancelNotification=i={})),pi}var hi={},Sk;function L9(){if(Sk)return hi;Sk=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.CallHierarchyOutgoingCallsRequest=hi.CallHierarchyIncomingCallsRequest=hi.CallHierarchyPrepareRequest=void 0;const t=Rt();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(hi.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(hi.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(hi.CallHierarchyOutgoingCallsRequest=r={})),hi}var bn={},kk;function M9(){if(kk)return bn;kk=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.SemanticTokensRefreshRequest=bn.SemanticTokensRangeRequest=bn.SemanticTokensDeltaRequest=bn.SemanticTokensRequest=bn.SemanticTokensRegistrationType=bn.TokenFormat=void 0;const t=Rt();var e;(function(a){a.Relative="relative"})(e||(bn.TokenFormat=e={}));var n;(function(a){a.method="textDocument/semanticTokens",a.type=new t.RegistrationType(a.method)})(n||(bn.SemanticTokensRegistrationType=n={}));var r;(function(a){a.method="textDocument/semanticTokens/full",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(r||(bn.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(i||(bn.SemanticTokensDeltaRequest=i={}));var s;(function(a){a.method="textDocument/semanticTokens/range",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(s||(bn.SemanticTokensRangeRequest=s={}));var o;return function(a){a.method="workspace/semanticTokens/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)}(o||(bn.SemanticTokensRefreshRequest=o={})),bn}var cu={},Ck;function B9(){if(Ck)return cu;Ck=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.ShowDocumentRequest=void 0;const t=Rt();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(cu.ShowDocumentRequest=e={})),cu}var uu={},Ak;function z9(){if(Ak)return uu;Ak=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.LinkedEditingRangeRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(uu.LinkedEditingRangeRequest=e={})),uu}var en={},_k;function q9(){if(_k)return en;_k=1,Object.defineProperty(en,"__esModule",{value:!0}),en.WillDeleteFilesRequest=en.DidDeleteFilesNotification=en.DidRenameFilesNotification=en.WillRenameFilesRequest=en.DidCreateFilesNotification=en.WillCreateFilesRequest=en.FileOperationPatternKind=void 0;const t=Rt();var e;(function(c){c.file="file",c.folder="folder"})(e||(en.FileOperationPatternKind=e={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(en.WillCreateFilesRequest=n={}));var r;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(r||(en.DidCreateFilesNotification=r={}));var i;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(i||(en.WillRenameFilesRequest=i={}));var s;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(s||(en.DidRenameFilesNotification=s={}));var o;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(en.DidDeleteFilesNotification=o={}));var a;return function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(a||(en.WillDeleteFilesRequest=a={})),en}var mi={},Pk;function j9(){if(Pk)return mi;Pk=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.MonikerRequest=mi.MonikerKind=mi.UniquenessLevel=void 0;const t=Rt();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(mi.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(mi.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(mi.MonikerRequest=r={})),mi}var gi={},xk;function U9(){if(xk)return gi;xk=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.TypeHierarchySubtypesRequest=gi.TypeHierarchySupertypesRequest=gi.TypeHierarchyPrepareRequest=void 0;const t=Rt();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(gi.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(gi.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(gi.TypeHierarchySubtypesRequest=r={})),gi}var Us={},Ik;function G9(){if(Ik)return Us;Ik=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.InlineValueRefreshRequest=Us.InlineValueRequest=void 0;const t=Rt();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Us.InlineValueRequest=e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Us.InlineValueRefreshRequest=n={})),Us}var yi={},Nk;function W9(){if(Nk)return yi;Nk=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.InlayHintRefreshRequest=yi.InlayHintResolveRequest=yi.InlayHintRequest=void 0;const t=Rt();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(yi.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(yi.InlayHintResolveRequest=n={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)}(r||(yi.InlayHintRefreshRequest=r={})),yi}var qn={},Ok;function H9(){if(Ok)return qn;Ok=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.DiagnosticRefreshRequest=qn.WorkspaceDiagnosticRequest=qn.DocumentDiagnosticRequest=qn.DocumentDiagnosticReportKind=qn.DiagnosticServerCancellationData=void 0;const t=Bs(),e=Fv(),n=Rt();var r;(function(c){function u(l){const d=l;return d&&e.boolean(d.retriggerRequest)}c.is=u})(r||(qn.DiagnosticServerCancellationData=r={}));var i;(function(c){c.Full="full",c.Unchanged="unchanged"})(i||(qn.DocumentDiagnosticReportKind=i={}));var s;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(s||(qn.DocumentDiagnosticRequest=s={}));var o;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(o||(qn.WorkspaceDiagnosticRequest=o={}));var a;return function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)}(a||(qn.DiagnosticRefreshRequest=a={})),qn}var $t={},Fk;function V9(){if(Fk)return $t;Fk=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.DidCloseNotebookDocumentNotification=$t.DidSaveNotebookDocumentNotification=$t.DidChangeNotebookDocumentNotification=$t.NotebookCellArrayChange=$t.DidOpenNotebookDocumentNotification=$t.NotebookDocumentSyncRegistrationType=$t.NotebookDocument=$t.NotebookCell=$t.ExecutionSummary=$t.NotebookCellKind=void 0;const t=Nv(),e=Fv(),n=Rt();var r;(function(p){p.Markup=1,p.Code=2;function h(v){return v===1||v===2}p.is=h})(r||($t.NotebookCellKind=r={}));var i;(function(p){function h(g,w){const R={executionOrder:g};return(w===!0||w===!1)&&(R.success=w),R}p.create=h;function v(g){const w=g;return e.objectLiteral(w)&&t.uinteger.is(w.executionOrder)&&(w.success===void 0||e.boolean(w.success))}p.is=v;function b(g,w){return g===w?!0:g==null||w===null||w===void 0?!1:g.executionOrder===w.executionOrder&&g.success===w.success}p.equals=b})(i||($t.ExecutionSummary=i={}));var s;(function(p){function h(w,R){return{kind:w,document:R}}p.create=h;function v(w){const R=w;return e.objectLiteral(R)&&r.is(R.kind)&&t.DocumentUri.is(R.document)&&(R.metadata===void 0||e.objectLiteral(R.metadata))}p.is=v;function b(w,R){const k=new Set;return w.document!==R.document&&k.add("document"),w.kind!==R.kind&&k.add("kind"),w.executionSummary!==R.executionSummary&&k.add("executionSummary"),(w.metadata!==void 0||R.metadata!==void 0)&&!g(w.metadata,R.metadata)&&k.add("metadata"),(w.executionSummary!==void 0||R.executionSummary!==void 0)&&!i.equals(w.executionSummary,R.executionSummary)&&k.add("executionSummary"),k}p.diff=b;function g(w,R){if(w===R)return!0;if(w==null||R===null||R===void 0||typeof w!=typeof R||typeof w!="object")return!1;const k=Array.isArray(w),A=Array.isArray(R);if(k!==A)return!1;if(k&&A){if(w.length!==R.length)return!1;for(let N=0;N<w.length;N++)if(!g(w[N],R[N]))return!1}if(e.objectLiteral(w)&&e.objectLiteral(R)){const N=Object.keys(w),_=Object.keys(R);if(N.length!==_.length||(N.sort(),_.sort(),!g(N,_)))return!1;for(let B=0;B<N.length;B++){const z=N[B];if(!g(w[z],R[z]))return!1}}return!0}})(s||($t.NotebookCell=s={}));var o;(function(p){function h(b,g,w,R){return{uri:b,notebookType:g,version:w,cells:R}}p.create=h;function v(b){const g=b;return e.objectLiteral(g)&&e.string(g.uri)&&t.integer.is(g.version)&&e.typedArray(g.cells,s.is)}p.is=v})(o||($t.NotebookDocument=o={}));var a;(function(p){p.method="notebookDocument/sync",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.RegistrationType(p.method)})(a||($t.NotebookDocumentSyncRegistrationType=a={}));var c;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(c||($t.DidOpenNotebookDocumentNotification=c={}));var u;(function(p){function h(b){const g=b;return e.objectLiteral(g)&&t.uinteger.is(g.start)&&t.uinteger.is(g.deleteCount)&&(g.cells===void 0||e.typedArray(g.cells,s.is))}p.is=h;function v(b,g,w){const R={start:b,deleteCount:g};return w!==void 0&&(R.cells=w),R}p.create=v})(u||($t.NotebookCellArrayChange=u={}));var l;(function(p){p.method="notebookDocument/didChange",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(l||($t.DidChangeNotebookDocumentNotification=l={}));var d;(function(p){p.method="notebookDocument/didSave",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(d||($t.DidSaveNotebookDocumentNotification=d={}));var f;return function(p){p.method="notebookDocument/didClose",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method}(f||($t.DidCloseNotebookDocumentNotification=f={})),$t}var lu={},Lk;function K9(){if(Lk)return lu;Lk=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.InlineCompletionRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(lu.InlineCompletionRequest=e={})),lu}var Mk;function Y9(){return Mk||(Mk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=Rt(),n=Nv(),r=Fv(),i=C9();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=A9();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=_9();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=P9();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=x9();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=I9();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const l=N9();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const d=O9();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=F9();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const p=L9();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const h=M9();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return h.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return h.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return h.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return h.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return h.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return h.SemanticTokensRegistrationType}});const v=B9();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return v.ShowDocumentRequest}});const b=z9();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return b.LinkedEditingRangeRequest}});const g=q9();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return g.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return g.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return g.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return g.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return g.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return g.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return g.WillDeleteFilesRequest}});const w=j9();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return w.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return w.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return w.MonikerRequest}});const R=U9();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return R.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySupertypesRequest}});const k=G9();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return k.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return k.InlineValueRefreshRequest}});const A=W9();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return A.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return A.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return A.InlayHintRefreshRequest}});const N=H9();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return N.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return N.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return N.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return N.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return N.DiagnosticRefreshRequest}});const _=V9();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return _.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return _.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return _.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return _.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return _.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return _.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidCloseNotebookDocumentNotification}});const B=K9();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return B.InlineCompletionRequest}});var z;(function(m){function S(y){const x=y;return r.string(x)||r.string(x.language)||r.string(x.scheme)||r.string(x.pattern)}m.is=S})(z||(t.TextDocumentFilter=z={}));var Q;(function(m){function S(y){const x=y;return r.objectLiteral(x)&&(r.string(x.notebookType)||r.string(x.scheme)||r.string(x.pattern))}m.is=S})(Q||(t.NotebookDocumentFilter=Q={}));var I;(function(m){function S(y){const x=y;return r.objectLiteral(x)&&(r.string(x.notebook)||Q.is(x.notebook))&&(x.language===void 0||r.string(x.language))}m.is=S})(I||(t.NotebookCellTextDocumentFilter=I={}));var T;(function(m){function S(y){if(!Array.isArray(y))return!1;for(let x of y)if(!r.string(x)&&!z.is(x)&&!I.is(x))return!1;return!0}m.is=S})(T||(t.DocumentSelector=T={}));var $;(function(m){m.method="client/registerCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})($||(t.RegistrationRequest=$={}));var L;(function(m){m.method="client/unregisterCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(L||(t.UnregistrationRequest=L={}));var V;(function(m){m.Create="create",m.Rename="rename",m.Delete="delete"})(V||(t.ResourceOperationKind=V={}));var H;(function(m){m.Abort="abort",m.Transactional="transactional",m.TextOnlyTransactional="textOnlyTransactional",m.Undo="undo"})(H||(t.FailureHandlingKind=H={}));var K;(function(m){m.UTF8="utf-8",m.UTF16="utf-16",m.UTF32="utf-32"})(K||(t.PositionEncodingKind=K={}));var we;(function(m){function S(y){const x=y;return x&&r.string(x.id)&&x.id.length>0}m.hasId=S})(we||(t.StaticRegistrationOptions=we={}));var te;(function(m){function S(y){const x=y;return x&&(x.documentSelector===null||T.is(x.documentSelector))}m.is=S})(te||(t.TextDocumentRegistrationOptions=te={}));var C;(function(m){function S(x){const E=x;return r.objectLiteral(E)&&(E.workDoneProgress===void 0||r.boolean(E.workDoneProgress))}m.is=S;function y(x){const E=x;return E&&r.boolean(E.workDoneProgress)}m.hasWorkDoneProgress=y})(C||(t.WorkDoneProgressOptions=C={}));var he;(function(m){m.method="initialize",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(he||(t.InitializeRequest=he={}));var Ye;(function(m){m.unknownProtocolVersion=1})(Ye||(t.InitializeErrorCodes=Ye={}));var pt;(function(m){m.method="initialized",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(pt||(t.InitializedNotification=pt={}));var W;(function(m){m.method="shutdown",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType0(m.method)})(W||(t.ShutdownRequest=W={}));var X;(function(m){m.method="exit",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType0(m.method)})(X||(t.ExitNotification=X={}));var Ie;(function(m){m.method="workspace/didChangeConfiguration",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Ie||(t.DidChangeConfigurationNotification=Ie={}));var oe;(function(m){m.Error=1,m.Warning=2,m.Info=3,m.Log=4,m.Debug=5})(oe||(t.MessageType=oe={}));var be;(function(m){m.method="window/showMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(be||(t.ShowMessageNotification=be={}));var Se;(function(m){m.method="window/showMessageRequest",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(Se||(t.ShowMessageRequest=Se={}));var ae;(function(m){m.method="window/logMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(ae||(t.LogMessageNotification=ae={}));var O;(function(m){m.method="telemetry/event",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(O||(t.TelemetryEventNotification=O={}));var j;(function(m){m.None=0,m.Full=1,m.Incremental=2})(j||(t.TextDocumentSyncKind=j={}));var de;(function(m){m.method="textDocument/didOpen",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(de||(t.DidOpenTextDocumentNotification=de={}));var U;(function(m){function S(x){let E=x;return E!=null&&typeof E.text=="string"&&E.range!==void 0&&(E.rangeLength===void 0||typeof E.rangeLength=="number")}m.isIncremental=S;function y(x){let E=x;return E!=null&&typeof E.text=="string"&&E.range===void 0&&E.rangeLength===void 0}m.isFull=y})(U||(t.TextDocumentContentChangeEvent=U={}));var ce;(function(m){m.method="textDocument/didChange",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ce||(t.DidChangeTextDocumentNotification=ce={}));var qe;(function(m){m.method="textDocument/didClose",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(qe||(t.DidCloseTextDocumentNotification=qe={}));var et;(function(m){m.method="textDocument/didSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(et||(t.DidSaveTextDocumentNotification=et={}));var se;(function(m){m.Manual=1,m.AfterDelay=2,m.FocusOut=3})(se||(t.TextDocumentSaveReason=se={}));var _e;(function(m){m.method="textDocument/willSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(_e||(t.WillSaveTextDocumentNotification=_e={}));var ne;(function(m){m.method="textDocument/willSaveWaitUntil",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ne||(t.WillSaveTextDocumentWaitUntilRequest=ne={}));var De;(function(m){m.method="workspace/didChangeWatchedFiles",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(De||(t.DidChangeWatchedFilesNotification=De={}));var Me;(function(m){m.Created=1,m.Changed=2,m.Deleted=3})(Me||(t.FileChangeType=Me={}));var ht;(function(m){function S(y){const x=y;return r.objectLiteral(x)&&(n.URI.is(x.baseUri)||n.WorkspaceFolder.is(x.baseUri))&&r.string(x.pattern)}m.is=S})(ht||(t.RelativePattern=ht={}));var Xe;(function(m){m.Create=1,m.Change=2,m.Delete=4})(Xe||(t.WatchKind=Xe={}));var Ut;(function(m){m.method="textDocument/publishDiagnostics",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(Ut||(t.PublishDiagnosticsNotification=Ut={}));var Ht;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.TriggerForIncompleteCompletions=3})(Ht||(t.CompletionTriggerKind=Ht={}));var ln;(function(m){m.method="textDocument/completion",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ln||(t.CompletionRequest=ln={}));var J;(function(m){m.method="completionItem/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(J||(t.CompletionResolveRequest=J={}));var Z;(function(m){m.method="textDocument/hover",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Z||(t.HoverRequest=Z={}));var fe;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.ContentChange=3})(fe||(t.SignatureHelpTriggerKind=fe={}));var Vt;(function(m){m.method="textDocument/signatureHelp",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Vt||(t.SignatureHelpRequest=Vt={}));var Gt;(function(m){m.method="textDocument/definition",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Gt||(t.DefinitionRequest=Gt={}));var Er;(function(m){m.method="textDocument/references",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Er||(t.ReferencesRequest=Er={}));var $i;(function(m){m.method="textDocument/documentHighlight",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})($i||(t.DocumentHighlightRequest=$i={}));var as;(function(m){m.method="textDocument/documentSymbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(as||(t.DocumentSymbolRequest=as={}));var cs;(function(m){m.method="textDocument/codeAction",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(cs||(t.CodeActionRequest=cs={}));var us;(function(m){m.method="codeAction/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(us||(t.CodeActionResolveRequest=us={}));var ls;(function(m){m.method="workspace/symbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ls||(t.WorkspaceSymbolRequest=ls={}));var Ti;(function(m){m.method="workspaceSymbol/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ti||(t.WorkspaceSymbolResolveRequest=Ti={}));var Si;(function(m){m.method="textDocument/codeLens",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Si||(t.CodeLensRequest=Si={}));var Tn;(function(m){m.method="codeLens/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Tn||(t.CodeLensResolveRequest=Tn={}));var ds;(function(m){m.method="workspace/codeLens/refresh",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType0(m.method)})(ds||(t.CodeLensRefreshRequest=ds={}));var fs;(function(m){m.method="textDocument/documentLink",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(fs||(t.DocumentLinkRequest=fs={}));var Rr;(function(m){m.method="documentLink/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Rr||(t.DocumentLinkResolveRequest=Rr={}));var ps;(function(m){m.method="textDocument/formatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ps||(t.DocumentFormattingRequest=ps={}));var Wr;(function(m){m.method="textDocument/rangeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Wr||(t.DocumentRangeFormattingRequest=Wr={}));var hs;(function(m){m.method="textDocument/rangesFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(hs||(t.DocumentRangesFormattingRequest=hs={}));var Hn;(function(m){m.method="textDocument/onTypeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Hn||(t.DocumentOnTypeFormattingRequest=Hn={}));var ir;(function(m){m.Identifier=1})(ir||(t.PrepareSupportDefaultBehavior=ir={}));var mo;(function(m){m.method="textDocument/rename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(mo||(t.RenameRequest=mo={}));var M;(function(m){m.method="textDocument/prepareRename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(M||(t.PrepareRenameRequest=M={}));var D;(function(m){m.method="workspace/executeCommand",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(D||(t.ExecuteCommandRequest=D={}));var P;(function(m){m.method="workspace/applyEdit",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType("workspace/applyEdit")})(P||(t.ApplyWorkspaceEditRequest=P={}))}(Ov)),Ov}var du={},Bk;function X9(){if(Bk)return du;Bk=1,Object.defineProperty(du,"__esModule",{value:!0}),du.createProtocolConnection=void 0;const t=Bs();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return du.createProtocolConnection=e,du}var zk;function J9(){return zk||(zk=1,function(t){var e=nu.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=nu.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Bs(),t),n(Nv(),t),n(Rt(),t),n(Y9(),t);var r=X9();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(nu)),nu}var qk;function Pt(){return qk||(qk=1,function(t){var e=Jc.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=Jc.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=pk();n(pk(),t),n(J9(),t);function i(s,o,a,c){return(0,r.createMessageConnection)(s,o,a,c)}t.createProtocolConnection=i}(Jc)),Jc}var jn={},jk;function Uk(){if(jk)return jn;jk=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.generateUuid=jn.parse=jn.isUUID=jn.v4=jn.empty=void 0;class t{constructor(c){this._value=c}asHex(){return this._value}equals(c){return this.asHex()===c.asHex()}}class e extends t{static _oneOf(c){return c[Math.floor(c.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}}e._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],e._timeHighBits=["8","9","a","b"],jn.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}jn.v4=n;const r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function i(a){return r.test(a)}jn.isUUID=i;function s(a){if(!i(a))throw new Error("invalid uuid");return new t(a)}jn.parse=s;function o(){return n().asHex()}return jn.generateUuid=o,jn}var vi={},Gk;function Z9(){if(Gk)return vi;Gk=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.attachPartialResult=vi.ProgressFeature=vi.attachWorkDone=void 0;const t=Pt(),e=Uk();class n{constructor(f,p){this._connection=f,this._token=p,n.Instances.set(this._token,this)}begin(f,p,h,v){let b={kind:"begin",title:f,percentage:p,message:h,cancellable:v};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,b)}report(f,p){let h={kind:"report"};typeof f=="number"?(h.percentage=f,p!==void 0&&(h.message=p)):h.message=f,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,h)}done(){n.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:"end"})}}n.Instances=new Map;class r extends n{constructor(f,p){super(f,p),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class i{constructor(){}begin(){}report(){}done(){}}class s extends i{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function o(d,f){if(f===void 0||f.workDoneToken===void 0)return new i;const p=f.workDoneToken;return delete f.workDoneToken,new n(d,p)}vi.attachWorkDone=o;const a=d=>class extends d{constructor(){super(),this._progressSupported=!1}initialize(f){super.initialize(f),f?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,p=>{let h=n.Instances.get(p.token);(h instanceof r||h instanceof s)&&h.cancel()}))}attachWorkDoneProgress(f){return f===void 0?new i:new n(this.connection,f)}createWorkDoneProgress(){if(this._progressSupported){const f=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:f}).then(()=>new r(this.connection,f))}else return Promise.resolve(new s)}};vi.ProgressFeature=a;var c;(function(d){d.type=new t.ProgressType})(c||(c={}));class u{constructor(f,p){this._connection=f,this._token=p}report(f){this._connection.sendProgress(c.type,this._token,f)}}function l(d,f){if(f===void 0||f.partialResultToken===void 0)return;const p=f.partialResultToken;return delete f.partialResultToken,new u(d,p)}return vi.attachPartialResult=l,vi}var fu={},Wk;function Q9(){if(Wk)return fu;Wk=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.ConfigurationFeature=void 0;const t=Pt(),e=Av(),n=r=>class extends r{getConfiguration(i){return i?e.string(i)?this._getConfiguration({section:i}):this._getConfiguration(i):this._getConfiguration({})}_getConfiguration(i){let s={items:Array.isArray(i)?i:[i]};return this.connection.sendRequest(t.ConfigurationRequest.type,s).then(o=>Array.isArray(o)?Array.isArray(i)?o:o[0]:Array.isArray(i)?[]:null)}};return fu.ConfigurationFeature=n,fu}var pu={},Hk;function e7(){if(Hk)return pu;Hk=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.WorkspaceFoldersFeature=void 0;const t=Pt(),e=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(r){super.initialize(r);let i=r.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,s=>{this._onDidChangeWorkspaceFolders.fire(s.event)}))}fillServerCapabilities(r){super.fillServerCapabilities(r);const i=r.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=i===!0||typeof i=="string"}getWorkspaceFolders(){return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};return pu.WorkspaceFoldersFeature=e,pu}var hu={},Vk;function t7(){if(Vk)return hu;Vk=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.CallHierarchyFeature=void 0;const t=Pt(),e=n=>class extends n{get callHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onIncomingCalls:r=>{const i=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onOutgoingCalls:r=>{const i=t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return hu.CallHierarchyFeature=e,hu}var wi={},Kk;function Yk(){if(Kk)return wi;Kk=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.SemanticTokensBuilder=wi.SemanticTokensDiff=wi.SemanticTokensFeature=void 0;const t=Pt(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:s=>{const o=t.SemanticTokensRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onDelta:s=>{const o=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onRange:s=>{const o=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))}}}};wi.SemanticTokensFeature=e;class n{constructor(s,o){this.originalSequence=s,this.modifiedSequence=o}computeDiff(){const s=this.originalSequence.length,o=this.modifiedSequence.length;let a=0;for(;a<o&&a<s&&this.originalSequence[a]===this.modifiedSequence[a];)a++;if(a<o&&a<s){let c=s-1,u=o-1;for(;c>=a&&u>=a&&this.originalSequence[c]===this.modifiedSequence[u];)c--,u--;(c<a||u<a)&&(c++,u++);const l=c-a+1,d=this.modifiedSequence.slice(a,u+1);return d.length===1&&d[0]===this.originalSequence[c]?[{start:a,deleteCount:l-1}]:[{start:a,deleteCount:l,data:d}]}else return a<o?[{start:a,deleteCount:0,data:this.modifiedSequence.slice(a)}]:a<s?[{start:a,deleteCount:s-a}]:[]}}wi.SemanticTokensDiff=n;class r{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(s,o,a,c,u){let l=s,d=o;this._dataLen>0&&(l-=this._prevLine,l===0&&(d-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=d,this._data[this._dataLen++]=a,this._data[this._dataLen++]=c,this._data[this._dataLen++]=u,this._prevLine=s,this._prevChar=o}get id(){return this._id.toString()}previousResult(s){this.id===s&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}:this.build()}}return wi.SemanticTokensBuilder=r,wi}var mu={},Xk;function n7(){if(Xk)return mu;Xk=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.ShowDocumentFeature=void 0;const t=Pt(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return mu.ShowDocumentFeature=e,mu}var gu={},Jk;function r7(){if(Jk)return gu;Jk=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.FileOperationsFeature=void 0;const t=Pt(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(t.DidCreateFilesNotification.type,i=>{r(i)})}onDidRenameFiles(r){return this.connection.onNotification(t.DidRenameFilesNotification.type,i=>{r(i)})}onDidDeleteFiles(r){return this.connection.onNotification(t.DidDeleteFilesNotification.type,i=>{r(i)})}onWillCreateFiles(r){return this.connection.onRequest(t.WillCreateFilesRequest.type,(i,s)=>r(i,s))}onWillRenameFiles(r){return this.connection.onRequest(t.WillRenameFilesRequest.type,(i,s)=>r(i,s))}onWillDeleteFiles(r){return this.connection.onRequest(t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return gu.FileOperationsFeature=e,gu}var yu={},Zk;function i7(){if(Zk)return yu;Zk=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.LinkedEditingRangeFeature=void 0;const t=Pt(),e=n=>class extends n{onLinkedEditingRange(r){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0))}};return yu.LinkedEditingRangeFeature=e,yu}var vu={},Qk;function s7(){if(Qk)return vu;Qk=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.TypeHierarchyFeature=void 0;const t=Pt(),e=n=>class extends n{get typeHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onSupertypes:r=>{const i=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onSubtypes:r=>{const i=t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return vu.TypeHierarchyFeature=e,vu}var wu={},e1;function o7(){if(e1)return wu;e1=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.InlineValueFeature=void 0;const t=Pt(),e=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:r=>this.connection.onRequest(t.InlineValueRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return wu.InlineValueFeature=e,wu}var bu={},t1;function a7(){if(t1)return bu;t1=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.FoldingRangeFeature=void 0;const t=Pt(),e=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:r=>{const i=t.FoldingRangeRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return bu.FoldingRangeFeature=e,bu}var Du={},n1;function c7(){if(n1)return Du;n1=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.InlayHintFeature=void 0;const t=Pt(),e=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:r=>this.connection.onRequest(t.InlayHintRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i))),resolve:r=>this.connection.onRequest(t.InlayHintResolveRequest.type,(i,s)=>r(i,s))}}};return Du.InlayHintFeature=e,Du}var Eu={},r1;function u7(){if(r1)return Eu;r1=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.DiagnosticFeature=void 0;const t=Pt(),e=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:r=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:r=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return Eu.DiagnosticFeature=e,Eu}var Gs={},Ru={},i1;function s1(){if(i1)return Ru;i1=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.TextDocuments=void 0;const t=Pt();class e{constructor(r){this._configuration=r,this._syncedDocuments=new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this._onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(r){this._willSaveWaitUntil=r}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(r){return this._syncedDocuments.get(r)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(r){r.__textDocumentSync=t.TextDocumentSyncKind.Incremental;const i=[];return i.push(r.onDidOpenTextDocument(s=>{const o=s.textDocument,a=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,a);const c=Object.freeze({document:a});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),i.push(r.onDidChangeTextDocument(s=>{const o=s.textDocument,a=s.contentChanges;if(a.length===0)return;const{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let u=this._syncedDocuments.get(o.uri);u!==void 0&&(u=this._configuration.update(u,a,c),this._syncedDocuments.set(o.uri,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),i.push(r.onDidCloseTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(s.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),i.push(r.onWillSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:s.reason}))})),i.push(r.onWillSaveTextDocumentWaitUntil((s,o)=>{let a=this._syncedDocuments.get(s.textDocument.uri);return a!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:a,reason:s.reason}),o):[]})),i.push(r.onDidSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),t.Disposable.create(()=>{i.forEach(s=>s.dispose())})}}return Ru.TextDocuments=e,Ru}var o1;function a1(){if(o1)return Gs;o1=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.NotebookDocuments=Gs.NotebookSyncFeature=void 0;const t=Pt(),e=s1(),n=s=>class extends s{get synchronization(){return{onDidOpenNotebookDocument:o=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,a=>{o(a)}),onDidChangeNotebookDocument:o=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,a=>{o(a)}),onDidSaveNotebookDocument:o=>this.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,a=>{o(a)}),onDidCloseNotebookDocument:o=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,a=>{o(a)})}}};Gs.NotebookSyncFeature=n;class r{onDidOpenTextDocument(o){return this.openHandler=o,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(o){this.openHandler&&this.openHandler(o)}onDidChangeTextDocument(o){return this.changeHandler=o,t.Disposable.create(()=>{this.changeHandler=o})}changeTextDocument(o){this.changeHandler&&this.changeHandler(o)}onDidCloseTextDocument(o){return this.closeHandler=o,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(o){this.closeHandler&&this.closeHandler(o)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}}r.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class i{constructor(o){o instanceof e.TextDocuments?this._cellTextDocuments=o:this._cellTextDocuments=new e.TextDocuments(o),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(o){return this._cellTextDocuments.get(o.document)}getNotebookDocument(o){return this.notebookDocuments.get(o)}getNotebookCell(o){const a=this.notebookCellMap.get(o);return a&&a[0]}findNotebookDocumentForCell(o){const a=typeof o=="string"?o:o.document,c=this.notebookCellMap.get(a);return c&&c[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(o){const a=new r,c=[];return c.push(this.cellTextDocuments.listen(a)),c.push(o.notebooks.synchronization.onDidOpenNotebookDocument(u=>{this.notebookDocuments.set(u.notebookDocument.uri,u.notebookDocument);for(const l of u.cellTextDocuments)a.openTextDocument({textDocument:l});this.updateCellMap(u.notebookDocument),this._onDidOpen.fire(u.notebookDocument)})),c.push(o.notebooks.synchronization.onDidChangeNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l===void 0)return;l.version=u.notebookDocument.version;const d=l.metadata;let f=!1;const p=u.change;p.metadata!==void 0&&(f=!0,l.metadata=p.metadata);const h=[],v=[],b=[],g=[];if(p.cells!==void 0){const N=p.cells;if(N.structure!==void 0){const _=N.structure.array;if(l.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),N.structure.didOpen!==void 0)for(const B of N.structure.didOpen)a.openTextDocument({textDocument:B}),h.push(B.uri);if(N.structure.didClose)for(const B of N.structure.didClose)a.closeTextDocument({textDocument:B}),v.push(B.uri)}if(N.data!==void 0){const _=new Map(N.data.map(B=>[B.document,B]));for(let B=0;B<=l.cells.length;B++){const z=_.get(l.cells[B].document);if(z!==void 0){const Q=l.cells.splice(B,1,z);if(b.push({old:Q[0],new:z}),_.delete(z.document),_.size===0)break}}}if(N.textContent!==void 0)for(const _ of N.textContent)a.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),g.push(_.document.uri)}this.updateCellMap(l);const w={notebookDocument:l};f&&(w.metadata={old:d,new:l.metadata});const R=[];for(const N of h)R.push(this.getNotebookCell(N));const k=[];for(const N of v)k.push(this.getNotebookCell(N));const A=[];for(const N of g)A.push(this.getNotebookCell(N));(R.length>0||k.length>0||b.length>0||A.length>0)&&(w.cells={added:R,removed:k,changed:{data:b,textContent:A}}),(w.metadata!==void 0||w.cells!==void 0)&&this._onDidChange.fire(w)})),c.push(o.notebooks.synchronization.onDidSaveNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),c.push(o.notebooks.synchronization.onDidCloseNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const d of u.cellTextDocuments)a.closeTextDocument({textDocument:d});this.notebookDocuments.delete(u.notebookDocument.uri);for(const d of l.cells)this.notebookCellMap.delete(d.document)}})),t.Disposable.create(()=>{c.forEach(u=>u.dispose())})}updateCellMap(o){for(const a of o.cells)this.notebookCellMap.set(a.document,[a,o])}}return Gs.NotebookDocuments=i,Gs}var $u={},c1;function l7(){if(c1)return $u;c1=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.MonikerFeature=void 0;const t=Pt(),e=n=>class extends n{get moniker(){return{on:r=>{const i=t.MonikerRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return $u.MonikerFeature=e,$u}var u1;function l1(){if(u1)return Ke;u1=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.createConnection=Ke.combineFeatures=Ke.combineNotebooksFeatures=Ke.combineLanguagesFeatures=Ke.combineWorkspaceFeatures=Ke.combineWindowFeatures=Ke.combineClientFeatures=Ke.combineTracerFeatures=Ke.combineTelemetryFeatures=Ke.combineConsoleFeatures=Ke._NotebooksImpl=Ke._LanguagesImpl=Ke.BulkUnregistration=Ke.BulkRegistration=Ke.ErrorMessageTracker=void 0;const t=Pt(),e=Av(),n=Uk(),r=Z9(),i=Q9(),s=e7(),o=t7(),a=Yk(),c=n7(),u=r7(),l=i7(),d=s7(),f=o7(),p=a7(),h=c7(),v=u7(),b=a1(),g=l7();function w(ae){if(ae!==null)return ae}class R{constructor(){this._messages=Object.create(null)}add(O){let j=this._messages[O];j||(j=0),j++,this._messages[O]=j}sendErrors(O){Object.keys(this._messages).forEach(j=>{O.window.showErrorMessage(j)})}}Ke.ErrorMessageTracker=R;class k{constructor(){}rawAttach(O){this._rawConnection=O}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(O){}initialize(O){}error(O){this.send(t.MessageType.Error,O)}warn(O){this.send(t.MessageType.Warning,O)}info(O){this.send(t.MessageType.Info,O)}log(O){this.send(t.MessageType.Log,O)}debug(O){this.send(t.MessageType.Debug,O)}send(O,j){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:O,message:j}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class A{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}showErrorMessage(O,...j){let de={type:t.MessageType.Error,message:O,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(w)}showWarningMessage(O,...j){let de={type:t.MessageType.Warning,message:O,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(w)}showInformationMessage(O,...j){let de={type:t.MessageType.Info,message:O,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(w)}}const N=(0,c.ShowDocumentFeature)((0,r.ProgressFeature)(A));var _;(function(ae){function O(){return new B}ae.create=O})(_||(Ke.BulkRegistration=_={}));class B{constructor(){this._registrations=[],this._registered=new Set}add(O,j){const de=e.string(O)?O:O.method;if(this._registered.has(de))throw new Error(`${de} is already added to this registration`);const U=n.generateUuid();this._registrations.push({id:U,method:de,registerOptions:j||{}}),this._registered.add(de)}asRegistrationParams(){return{registrations:this._registrations}}}var z;(function(ae){function O(){return new Q(void 0,[])}ae.create=O})(z||(Ke.BulkUnregistration=z={}));class Q{constructor(O,j){this._connection=O,this._unregistrations=new Map,j.forEach(de=>{this._unregistrations.set(de.method,de)})}get isAttached(){return!!this._connection}attach(O){this._connection=O}add(O){this._unregistrations.set(O.method,O)}dispose(){let O=[];for(let de of this._unregistrations.values())O.push(de);let j={unregisterations:O};this._connection.sendRequest(t.UnregistrationRequest.type,j).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(O){const j=e.string(O)?O:O.method,de=this._unregistrations.get(j);if(!de)return!1;let U={unregisterations:[de]};return this._connection.sendRequest(t.UnregistrationRequest.type,U).then(()=>{this._unregistrations.delete(j)},ce=>{this._connection.console.info(`Un-registering request handler for ${de.id} failed.`)}),!0}}class I{attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}register(O,j,de){return O instanceof B?this.registerMany(O):O instanceof Q?this.registerSingle1(O,j,de):this.registerSingle2(O,j)}registerSingle1(O,j,de){const U=e.string(j)?j:j.method,ce=n.generateUuid();let qe={registrations:[{id:ce,method:U,registerOptions:de||{}}]};return O.isAttached||O.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,qe).then(et=>(O.add({id:ce,method:U}),O),et=>(this.connection.console.info(`Registering request handler for ${U} failed.`),Promise.reject(et)))}registerSingle2(O,j){const de=e.string(O)?O:O.method,U=n.generateUuid();let ce={registrations:[{id:U,method:de,registerOptions:j||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,ce).then(qe=>t.Disposable.create(()=>{this.unregisterSingle(U,de).catch(()=>{this.connection.console.info(`Un-registering capability with id ${U} failed.`)})}),qe=>(this.connection.console.info(`Registering request handler for ${de} failed.`),Promise.reject(qe)))}unregisterSingle(O,j){let de={unregisterations:[{id:O,method:j}]};return this.connection.sendRequest(t.UnregistrationRequest.type,de).catch(()=>{this.connection.console.info(`Un-registering request handler for ${O} failed.`)})}registerMany(O){let j=O.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,j).then(()=>new Q(this._connection,j.registrations.map(de=>({id:de.id,method:de.method}))),de=>(this.connection.console.info("Bulk registration failed."),Promise.reject(de)))}}class T{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}applyEdit(O){function j(U){return U&&!!U.edit}let de=j(O)?O:{edit:O};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,de)}}const $=(0,u.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(T)));class L{constructor(){this._trace=t.Trace.Off}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}set trace(O){this._trace=O}log(O,j){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:O,verbose:this._trace===t.Trace.Verbose?j:void 0}).catch(()=>{})}}class V{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}logEvent(O){this.connection.sendNotification(t.TelemetryEventNotification.type,O).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class H{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}attachWorkDoneProgress(O){return(0,r.attachWorkDone)(this.connection,O)}attachPartialResultProgress(O,j){return(0,r.attachPartialResult)(this.connection,j)}}Ke._LanguagesImpl=H;const K=(0,p.FoldingRangeFeature)((0,g.MonikerFeature)((0,v.DiagnosticFeature)((0,h.InlayHintFeature)((0,f.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,a.SemanticTokensFeature)((0,o.CallHierarchyFeature)(H)))))))));class we{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}attachWorkDoneProgress(O){return(0,r.attachWorkDone)(this.connection,O)}attachPartialResultProgress(O,j){return(0,r.attachPartialResult)(this.connection,j)}}Ke._NotebooksImpl=we;const te=(0,b.NotebookSyncFeature)(we);function C(ae,O){return function(j){return O(ae(j))}}Ke.combineConsoleFeatures=C;function he(ae,O){return function(j){return O(ae(j))}}Ke.combineTelemetryFeatures=he;function Ye(ae,O){return function(j){return O(ae(j))}}Ke.combineTracerFeatures=Ye;function pt(ae,O){return function(j){return O(ae(j))}}Ke.combineClientFeatures=pt;function W(ae,O){return function(j){return O(ae(j))}}Ke.combineWindowFeatures=W;function X(ae,O){return function(j){return O(ae(j))}}Ke.combineWorkspaceFeatures=X;function Ie(ae,O){return function(j){return O(ae(j))}}Ke.combineLanguagesFeatures=Ie;function oe(ae,O){return function(j){return O(ae(j))}}Ke.combineNotebooksFeatures=oe;function be(ae,O){function j(U,ce,qe){return U&&ce?qe(U,ce):U||ce}return{__brand:"features",console:j(ae.console,O.console,C),tracer:j(ae.tracer,O.tracer,Ye),telemetry:j(ae.telemetry,O.telemetry,he),client:j(ae.client,O.client,pt),window:j(ae.window,O.window,W),workspace:j(ae.workspace,O.workspace,X),languages:j(ae.languages,O.languages,Ie),notebooks:j(ae.notebooks,O.notebooks,oe)}}Ke.combineFeatures=be;function Se(ae,O,j){const de=j&&j.console?new(j.console(k)):new k,U=ae(de);de.rawAttach(U);const ce=j&&j.tracer?new(j.tracer(L)):new L,qe=j&&j.telemetry?new(j.telemetry(V)):new V,et=j&&j.client?new(j.client(I)):new I,se=j&&j.window?new(j.window(N)):new N,_e=j&&j.workspace?new(j.workspace($)):new $,ne=j&&j.languages?new(j.languages(K)):new K,De=j&&j.notebooks?new(j.notebooks(te)):new te,Me=[de,ce,qe,et,se,_e,ne,De];function ht(J){return J instanceof Promise?J:e.thenable(J)?new Promise((Z,fe)=>{J.then(Vt=>Z(Vt),Vt=>fe(Vt))}):Promise.resolve(J)}let Xe,Ut,Ht,ln={listen:()=>U.listen(),sendRequest:(J,...Z)=>U.sendRequest(e.string(J)?J:J.method,...Z),onRequest:(J,Z)=>U.onRequest(J,Z),sendNotification:(J,Z)=>{const fe=e.string(J)?J:J.method;return U.sendNotification(fe,Z)},onNotification:(J,Z)=>U.onNotification(J,Z),onProgress:U.onProgress,sendProgress:U.sendProgress,onInitialize:J=>(Ut=J,{dispose:()=>{Ut=void 0}}),onInitialized:J=>U.onNotification(t.InitializedNotification.type,J),onShutdown:J=>(Xe=J,{dispose:()=>{Xe=void 0}}),onExit:J=>(Ht=J,{dispose:()=>{Ht=void 0}}),get console(){return de},get telemetry(){return qe},get tracer(){return ce},get client(){return et},get window(){return se},get workspace(){return _e},get languages(){return ne},get notebooks(){return De},onDidChangeConfiguration:J=>U.onNotification(t.DidChangeConfigurationNotification.type,J),onDidChangeWatchedFiles:J=>U.onNotification(t.DidChangeWatchedFilesNotification.type,J),__textDocumentSync:void 0,onDidOpenTextDocument:J=>U.onNotification(t.DidOpenTextDocumentNotification.type,J),onDidChangeTextDocument:J=>U.onNotification(t.DidChangeTextDocumentNotification.type,J),onDidCloseTextDocument:J=>U.onNotification(t.DidCloseTextDocumentNotification.type,J),onWillSaveTextDocument:J=>U.onNotification(t.WillSaveTextDocumentNotification.type,J),onWillSaveTextDocumentWaitUntil:J=>U.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,J),onDidSaveTextDocument:J=>U.onNotification(t.DidSaveTextDocumentNotification.type,J),sendDiagnostics:J=>U.sendNotification(t.PublishDiagnosticsNotification.type,J),onHover:J=>U.onRequest(t.HoverRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onCompletion:J=>U.onRequest(t.CompletionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onCompletionResolve:J=>U.onRequest(t.CompletionResolveRequest.type,J),onSignatureHelp:J=>U.onRequest(t.SignatureHelpRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onDeclaration:J=>U.onRequest(t.DeclarationRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDefinition:J=>U.onRequest(t.DefinitionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onTypeDefinition:J=>U.onRequest(t.TypeDefinitionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onImplementation:J=>U.onRequest(t.ImplementationRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onReferences:J=>U.onRequest(t.ReferencesRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDocumentHighlight:J=>U.onRequest(t.DocumentHighlightRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDocumentSymbol:J=>U.onRequest(t.DocumentSymbolRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onWorkspaceSymbol:J=>U.onRequest(t.WorkspaceSymbolRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onWorkspaceSymbolResolve:J=>U.onRequest(t.WorkspaceSymbolResolveRequest.type,J),onCodeAction:J=>U.onRequest(t.CodeActionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onCodeActionResolve:J=>U.onRequest(t.CodeActionResolveRequest.type,(Z,fe)=>J(Z,fe)),onCodeLens:J=>U.onRequest(t.CodeLensRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onCodeLensResolve:J=>U.onRequest(t.CodeLensResolveRequest.type,(Z,fe)=>J(Z,fe)),onDocumentFormatting:J=>U.onRequest(t.DocumentFormattingRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onDocumentRangeFormatting:J=>U.onRequest(t.DocumentRangeFormattingRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onDocumentOnTypeFormatting:J=>U.onRequest(t.DocumentOnTypeFormattingRequest.type,(Z,fe)=>J(Z,fe)),onRenameRequest:J=>U.onRequest(t.RenameRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onPrepareRename:J=>U.onRequest(t.PrepareRenameRequest.type,(Z,fe)=>J(Z,fe)),onDocumentLinks:J=>U.onRequest(t.DocumentLinkRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDocumentLinkResolve:J=>U.onRequest(t.DocumentLinkResolveRequest.type,(Z,fe)=>J(Z,fe)),onDocumentColor:J=>U.onRequest(t.DocumentColorRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onColorPresentation:J=>U.onRequest(t.ColorPresentationRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onFoldingRanges:J=>U.onRequest(t.FoldingRangeRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onSelectionRanges:J=>U.onRequest(t.SelectionRangeRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onExecuteCommand:J=>U.onRequest(t.ExecuteCommandRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),dispose:()=>U.dispose()};for(let J of Me)J.attach(ln);return U.onRequest(t.InitializeRequest.type,J=>{O.initialize(J),e.string(J.trace)&&(ce.trace=t.Trace.fromString(J.trace));for(let Z of Me)Z.initialize(J.capabilities);if(Ut){let Z=Ut(J,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(U,J),void 0);return ht(Z).then(fe=>{if(fe instanceof t.ResponseError)return fe;let Vt=fe;Vt||(Vt={capabilities:{}});let Gt=Vt.capabilities;Gt||(Gt={},Vt.capabilities=Gt),Gt.textDocumentSync===void 0||Gt.textDocumentSync===null?Gt.textDocumentSync=e.number(ln.__textDocumentSync)?ln.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Gt.textDocumentSync)&&!e.number(Gt.textDocumentSync.change)&&(Gt.textDocumentSync.change=e.number(ln.__textDocumentSync)?ln.__textDocumentSync:t.TextDocumentSyncKind.None);for(let Er of Me)Er.fillServerCapabilities(Gt);return Vt})}else{let Z={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let fe of Me)fe.fillServerCapabilities(Z.capabilities);return Z}}),U.onRequest(t.ShutdownRequest.type,()=>{if(O.shutdownReceived=!0,Xe)return Xe(new t.CancellationTokenSource().token)}),U.onNotification(t.ExitNotification.type,()=>{try{Ht&&Ht()}finally{O.shutdownReceived?O.exit(0):O.exit(1)}}),U.onNotification(t.SetTraceNotification.type,J=>{ce.trace=t.Trace.fromString(J.value)}),ln}return Ke.createConnection=Se,Ke}var Dn={},d1;function d7(){if(d1)return Dn;d1=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.resolveModulePath=Dn.FileSystem=Dn.resolveGlobalYarnPath=Dn.resolveGlobalNodePath=Dn.resolve=Dn.uriToFilePath=void 0;const t=HN,e=Tr,n=yo,r=N0;function i(d){let f=t.parse(d);if(f.protocol!=="file:"||!f.path)return;let p=f.path.split("/");for(var h=0,v=p.length;h<v;h++)p[h]=decodeURIComponent(p[h]);if(process.platform==="win32"&&p.length>1){let b=p[0],g=p[1];b.length===0&&g.length>1&&g[1]===":"&&p.shift()}return e.normalize(p.join("/"))}Dn.uriToFilePath=i;function s(){return process.platform==="win32"}function o(d,f,p,h){const v="NODE_PATH",b=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((g,w)=>{let R=process.env,k=Object.create(null);Object.keys(R).forEach(A=>k[A]=R[A]),f&&n.existsSync(f)&&(k[v]?k[v]=f+e.delimiter+k[v]:k[v]=f,h&&h(`NODE_PATH value is: ${k[v]}`)),k.ELECTRON_RUN_AS_NODE="1";try{let A=(0,r.fork)("",[],{cwd:p,env:k,execArgv:["-e",b]});if(A.pid===void 0){w(new Error(`Starting process to resolve node module ${d} failed`));return}A.on("error",_=>{w(_)}),A.on("message",_=>{_.c==="r"&&(A.send({c:"e"}),_.s?g(_.r):w(new Error(`Failed to resolve module: ${d}`)))});let N={c:"rs",a:d};A.send(N)}catch(A){w(A)}})}Dn.resolve=o;function a(d){let f="npm";const p=Object.create(null);Object.keys(process.env).forEach(b=>p[b]=process.env[b]),p.NO_UPDATE_NOTIFIER="true";const h={encoding:"utf8",env:p};s()&&(f="npm.cmd",h.shell=!0);let v=()=>{};try{process.on("SIGPIPE",v);let b=(0,r.spawnSync)(f,["config","get","prefix"],h).stdout;if(!b){d&&d("'npm config get prefix' didn't return a value.");return}let g=b.trim();return d&&d(`'npm config get prefix' value is: ${g}`),g.length>0?s()?e.join(g,"node_modules"):e.join(g,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",v)}}Dn.resolveGlobalNodePath=a;function c(d){let f="yarn",p={encoding:"utf8"};s()&&(f="yarn.cmd",p.shell=!0);let h=()=>{};try{process.on("SIGPIPE",h);let v=(0,r.spawnSync)(f,["global","dir","--json"],p),b=v.stdout;if(!b){d&&(d("'yarn global dir' didn't return a value."),v.stderr&&d(v.stderr));return}let g=b.trim().split(/\r?\n/);for(let w of g)try{let R=JSON.parse(w);if(R.type==="log")return e.join(R.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",h)}}Dn.resolveGlobalYarnPath=c;var u;(function(d){let f;function p(){return f!==void 0||(process.platform==="win32"?f=!1:f=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),f}d.isCaseSensitive=p;function h(v,b){return p()?e.normalize(b).indexOf(e.normalize(v))===0:e.normalize(b).toLowerCase().indexOf(e.normalize(v).toLowerCase())===0}d.isParent=h})(u||(Dn.FileSystem=u={}));function l(d,f,p,h){return p?(e.isAbsolute(p)||(p=e.join(d,p)),o(f,p,p,h).then(v=>u.isParent(p,v)?v:Promise.reject(new Error(`Failed to load ${f} from node path location.`))).then(void 0,v=>o(f,a(h),d,h))):o(f,a(h),d,h)}return Dn.resolveModulePath=l,Dn}var Lv,f1;function p1(){return f1||(f1=1,Lv=Pt()),Lv}var Tu={},Su={},h1;function f7(){if(h1)return Su;h1=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.InlineCompletionFeature=void 0;const t=Pt(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return Su.InlineCompletionFeature=e,Su}var m1;function p7(){return m1||(m1=1,function(t){var e=Tu.__createBinding||(Object.create?function(c,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(c,d,f)}:function(c,u,l,d){d===void 0&&(d=l),c[d]=u[l]}),n=Tu.__exportStar||function(c,u){for(var l in c)l!=="default"&&!Object.prototype.hasOwnProperty.call(u,l)&&e(u,c,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=Yk();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=f7();n(Pt(),t);const s=s1();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=a1();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(l1(),t);var a;(function(c){c.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(Tu)),Tu}var g1;function y1(){return g1||(g1=1,function(t){var e=Xc.__createBinding||(Object.create?function(g,w,R,k){k===void 0&&(k=R);var A=Object.getOwnPropertyDescriptor(w,R);(!A||("get"in A?!w.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return w[R]}}),Object.defineProperty(g,k,A)}:function(g,w,R,k){k===void 0&&(k=R),g[k]=w[R]}),n=Xc.__exportStar||function(g,w){for(var R in g)R!=="default"&&!Object.prototype.hasOwnProperty.call(w,R)&&e(w,g,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=LN,i=Av(),s=l1(),o=d7(),a=p1();n(p1(),t),n(p7(),t);var c;(function(g){g.uriToFilePath=o.uriToFilePath,g.resolveGlobalNodePath=o.resolveGlobalNodePath,g.resolveGlobalYarnPath=o.resolveGlobalYarnPath,g.resolve=o.resolve,g.resolveModulePath=o.resolveModulePath})(c||(t.Files=c={}));function u(){}let l=!1,d;function f(){const g="--clientProcessId";function w(R){try{let k=parseInt(R);isNaN(k)||(d=setInterval(()=>{try{process.kill(k,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let R=2;R<process.argv.length;R++){let k=process.argv[R];if(k===g&&R+1<process.argv.length){w(process.argv[R+1]);return}else{let A=k.split("=");A[0]===g&&w(A[1])}}}f();const p={initialize:g=>{const w=g.processId;i.number(w)&&d===void 0&&setInterval(()=>{try{process.kill(w,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(g){l=g},exit:g=>{process.exit(g)}};function h(g,w,R,k){let A,N,_,B;return g!==void 0&&g.__brand==="features"&&(A=g,g=w,w=R,R=k),a.ConnectionStrategy.is(g)||a.ConnectionOptions.is(g)?B=g:(N=g,_=w,B=R),v(N,_,B,A)}t.createConnection=h;function v(g,w,R,k){let A=!1;if(!g&&!w&&process.argv.length>2){let z,Q,I=process.argv.slice(2);for(let T=0;T<I.length;T++){let $=I[T];if($==="--node-ipc"){g=new a.IPCMessageReader(process),w=new a.IPCMessageWriter(process);break}else if($==="--stdio"){A=!0,g=process.stdin,w=process.stdout;break}else if($==="--socket"){z=parseInt(I[T+1]);break}else if($==="--pipe"){Q=I[T+1];break}else{var N=$.split("=");if(N[0]==="--socket"){z=parseInt(N[1]);break}else if(N[0]==="--pipe"){Q=N[1];break}}}if(z){let T=(0,a.createServerSocketTransport)(z);g=T[0],w=T[1]}else if(Q){let T=(0,a.createServerPipeTransport)(Q);g=T[0],w=T[1]}}var _="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!g)throw new Error("Connection input stream is not set. "+_);if(!w)throw new Error("Connection output stream is not set. "+_);if(i.func(g.read)&&i.func(g.on)){let z=g;z.on("end",()=>{process.exit(l?0:1)}),z.on("close",()=>{process.exit(l?0:1)})}const B=z=>{const Q=(0,a.createProtocolConnection)(g,w,z,R);return A&&b(z),Q};return(0,s.createConnection)(B,p,k)}function b(g){function w(k){return k.map(A=>typeof A=="string"?A:(0,r.inspect)(A)).join(" ")}const R=new Map;console.assert=function(A,...N){if(!A)if(N.length===0)g.error("Assertion failed");else{const[_,...B]=N;g.error(`Assertion failed: ${_} ${w(B)}`)}},console.count=function(A="default"){const N=String(A);let _=R.get(N)??0;_+=1,R.set(N,_),g.log(`${N}: ${N}`)},console.countReset=function(A){A===void 0?R.clear():R.delete(String(A))},console.debug=function(...A){g.log(w(A))},console.dir=function(A,N){g.log((0,r.inspect)(A,N))},console.log=function(...A){g.log(w(A))},console.error=function(...A){g.error(w(A))},console.trace=function(...A){const N=new Error().stack.replace(/(.+\n){2}/,"");let _="Trace";A.length!==0&&(_+=`: ${w(A)}`),g.log(`${_}
|
|
160
|
+
${N}`)},console.warn=function(...A){g.warn(w(A))}}}(Xc)),Xc}var ye=y1();function v1(t,e){const n={stacks:t,tokens:e};return h7(n),n.stacks.flat().forEach(i=>{i.property=void 0}),b1(n.stacks).map(i=>i[i.length-1])}function Mv(t){const{next:e,cardinalities:n,visited:r,plus:i}=t,s=[],o=e.feature;if(r.has(o))return[];r.add(o);let a,c=o;for(;c.$container;)if(Pi(c.$container)){a=c.$container;break}else if(_g(c.$container))c=c.$container;else break;if($E(c.cardinality)){const u=Ko({next:{feature:c,type:e.type},cardinalities:n,visited:r,plus:i});for(const l of u)i.add(l.feature);s.push(...u)}if(a){const u=a.elements.indexOf(c);u!==void 0&&u<a.elements.length-1&&s.push(...w1({feature:a,type:e.type},u+1,n,r,i)),s.every(l=>xo(l.feature.cardinality,l.feature)||xo(n.get(l.feature))||i.has(l.feature))&&s.push(...Mv({next:{feature:a,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function Bv(t){return Tt(t)&&(t={feature:t}),Ko({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function Ko(t){var e,n,r;const{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];const{feature:c,type:u}=i;if(Pi(c)){if(o.has(c))return[];o.add(c)}if(Pi(c))return w1(i,0,s,o,a).map(l=>Bp(l,c.cardinality,s));if(Og(c)||Fg(c))return c.elements.flatMap(l=>Ko({next:{feature:l,type:u,property:i.property},cardinalities:s,visited:o,plus:a})).map(l=>Bp(l,c.cardinality,s));if(Cr(c)){const l={feature:c.terminal,type:u,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return Ko({next:l,cardinalities:s,visited:o,plus:a}).map(d=>Bp(d,c.cardinality,s))}else{if(bs(c))return Mv({next:{feature:c,type:vc(c),property:(n=i.property)!==null&&n!==void 0?n:c.feature},cardinalities:s,visited:o,plus:a});if(Qr(c)&&rn(c.rule.ref)){const l=c.rule.ref,d={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=Ds(l))!==null&&r!==void 0?r:l.name,property:i.property};return Ko({next:d,cardinalities:s,visited:o,plus:a}).map(f=>Bp(f,c.cardinality,s))}else return[i]}}function Bp(t,e,n){return n.set(t.feature,e),t}function w1(t,e,n,r,i){var s;const o=[];let a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],type:t.type},o.push(...Ko({next:a,cardinalities:n,visited:r,plus:i})),!!xo((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function h7(t){for(const e of t.tokens){const n=b1(t.stacks,e);t.stacks=n}}function b1(t,e){const n=[];for(const r of t)n.push(...m7(r,e));return n}function m7(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(g7)),i=[];for(;t.length>0;){const s=t.pop(),o=Mv({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?zv(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>xo(a.feature.cardinality,a.feature)||xo(n.get(a.feature))))break}return i}function g7(t){if(t.cardinality==="+")return!0;const e=sn(t,Cr);return!!(e&&e.cardinality==="+")}function zv(t,e){if(Ar(t))return t.value===e.image;if(Qr(t))return y7(t.rule.ref,e);if(tc(t)){const n=Wg(t);if(n)return zv(n,e)}return!1}function y7(t,e){return rn(t)?Bv(t.definition).some(r=>zv(r.feature,e)):Zr(t)?wc(t).test(e.image):!1}function v7(t){const e=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.triggerCharacters)!==null&&i!==void 0?i:[]}))),n=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:n.length>0?n:void 0}}class D1{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig,this.astReflection=e.shared.AstReflection,this.documentationProvider=e.documentation.DocumentationProvider}async getCompletion(e,n,r){const i=[],s=this.buildContexts(e,n.position),o=(u,l)=>{const d=this.fillCompletionItem(u,l);d&&i.push(d)},a=u=>Ar(u.feature)?u.feature.value:u.feature,c=[];for(const u of s)if(await Promise.all(st(u.features).distinct(a).exclude(c).map(l=>this.completionFor(u,l,o))),c.push(...u.features),!this.continueCompletion(i))break;return ye.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return st(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:ye.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const c=Cf(this.grammar),u=Bv({feature:c.definition,type:Ds(c)});return s.length>0?(s.shift(),v1(u.map(l=>[l]),s)):u}const o=[...s].splice(i.tokenIndex);return v1([i.elementStack.map(c=>({feature:c}))],o)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument,a=o.getText(),c=o.offsetAt(n),u={document:e,textDocument:o,offset:c,position:n},l=this.findDataTypeRuleStart(s,c);if(l){const[w,R]=l,k=(r=ff(s,w))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},u),{node:k,tokenOffset:w,tokenEndOffset:R,features:this.findFeaturesAt(o,w)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:p,previousTokenEnd:h}=this.backtrackToAnyToken(a,c);let v=d;c<=d&&p!==void 0&&(v=p);const b=(i=ff(s,v))===null||i===void 0?void 0:i.astNode;let g=!0;if(p!==void 0&&h!==void 0&&h===c&&(yield Object.assign(Object.assign({},u),{node:b,tokenOffset:p,tokenEndOffset:h,features:this.findFeaturesAt(o,p)}),g=this.performNextTokenCompletion(e,a.substring(p,h),p,h),g&&(yield Object.assign(Object.assign({},u),{node:b,tokenOffset:h,tokenEndOffset:h,features:this.findFeaturesAt(o,h)}))),b)g&&(yield Object.assign(Object.assign({},u),{node:b,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(o,d)}));else{const w=Cf(this.grammar);if(!w)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},u),{tokenOffset:d,tokenEndOffset:f,features:Bv(w.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){var r,i;let s=_i(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=sn(s?.grammarSource,rn))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=sn(s?.grammarSource,rn))===null||i===void 0)&&i.dataType);if(s)return[s.offset,s.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,n){const r=this.lexer.tokenize(e).tokens;if(r.length===0)return{nextTokenStart:n,nextTokenEnd:n};let i;for(const s of r){if(s.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(s.endOffset>=n)return{nextTokenStart:s.startOffset,nextTokenEnd:s.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=s}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}completionFor(e,n,r){if(Ar(n.feature))return this.completionForKeyword(e,n.feature,r);if(tc(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=sn(n.feature,Cr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},Bg(this.astReflection,s));const o={reference:{$refText:""},container:s,property:i.feature};try{for(const a of this.getReferenceCandidates(o,e))r(e,this.createReferenceCompletionItem(a))}catch(a){console.error(a)}}}getReferenceCandidates(e,n){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){const n=this.nodeKindProvider.getCompletionItemKind(e),r=this.getReferenceDocumentation(e);return{nodeDescription:e,kind:n,documentation:r,detail:e.type,sortText:"0"}}getReferenceDocumentation(e){if(!e.node)return;const n=this.documentationProvider.getDocumentation(e.node);if(n)return{kind:"markdown",value:n}}completionForKeyword(e,n,r){this.filterKeyword(e,n)&&r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}getKeywordCompletionItemKind(e){return ye.CompletionItemKind.Keyword}filterKeyword(e,n){return new RegExp("\\p{L}","u").test(n.value)}fillCompletionItem(e,n){var r,i;let s;if(typeof n.label=="string")s=n.label;else if("node"in n){const u=this.nameProvider.getName(n.node);if(!u)return;s=u}else if("nodeDescription"in n)s=n.nodeDescription.name;else return;let o;typeof((r=n.textEdit)===null||r===void 0?void 0:r.newText)=="string"?o=n.textEdit.newText:typeof n.insertText=="string"?o=n.insertText:o=s;const a=(i=n.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,s,o);return a?{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:a,label:s}:void 0}buildCompletionTextEdit(e,n,r){const s=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,n)){const o=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:r,range:{start:o,end:a}}}else return}}class w7{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,n,r){const i=e.parseResult.value;if(i.$cstNode){const s=i.$cstNode,o=_i(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(o)return this.collectLocationLinks(o,n)}}collectLocationLinks(e,n){var r;const i=this.findLink(e);if(i)return[ye.LocationLink.create(i.targetDocument.textDocument.uri,((r=i.target.astNode.$cstNode)!==null&&r!==void 0?r:i.target).range,i.target.range,i.source.range)]}findLink(e){const n=this.references.findDeclarationNode(e);if(n?.astNode){const r=bt(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class E1{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=_i(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const o=this.references.findDeclaration(s);if(o){const a=Ct.equals(bt(o).uri,e.uri),c={documentUri:e.uri,includeDeclaration:a};return this.references.findReferences(o,c).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ye.DocumentHighlight.create(e.segment.range)}}class b7{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e,n,r){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,n){const r=n.$cstNode,i=this.nameProvider.getNameNode(n);if(i&&r){const s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||i.text,range:r.range,selectionRange:i.range,children:this.getChildSymbols(e,n)}]}else return this.getChildSymbols(e,n)||[]}getChildSymbols(e,n){const r=[];for(const i of hc(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class D7{constructor(e){this.workspaceManager=e.workspace.WorkspaceManager,this.documentBuilder=e.workspace.DocumentBuilder,this.workspaceLock=e.workspace.WorkspaceLock,this.serviceRegistry=e.ServiceRegistry;let n=!1;e.lsp.LanguageServer.onInitialize(r=>{var i,s;n=!!(!((s=(i=r.capabilities.workspace)===null||i===void 0?void 0:i.didChangeWatchedFiles)===null||s===void 0)&&s.dynamicRegistration)}),e.lsp.LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=st(e.ServiceRegistry.all).flatMap(r=>r.LanguageMetaData.fileExtensions).map(r=>r.startsWith(".")?r.substring(1):r).distinct().toArray();if(n.length>0){const r=e.lsp.Connection,i={watchers:[{globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`}]};r?.client.register(ye.DidChangeWatchedFilesNotification.type,i)}}fireDocumentUpdate(e,n){e=e.filter(r=>this.serviceRegistry.hasServices(r)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(r=>this.documentBuilder.update(e,n,r))}).catch(r=>{console.error("Workspace initialization failed. Could not perform document update.",r)})}didChangeContent(e){this.fireDocumentUpdate([Zt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=st(e.changes).filter(i=>i.type!==ye.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Zt.parse(i.uri)).toArray(),r=st(e.changes).filter(i=>i.type===ye.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Zt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class E7{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,n,r){const i=[],s=o=>i.push(o);return this.collectFolding(e,s),i}collectFolding(e,n){var r;const i=(r=e.parseResult)===null||r===void 0?void 0:r.value;if(i){if(this.shouldProcessContent(i)){const s=_r(i).iterator();let o;do if(o=s.next(),!o.done){const a=o.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,n),this.shouldProcessContent(a)||s.prune()}while(!o.done)}this.collectCommentFolding(e,i,n)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,n,r){const i=n.$cstNode;if(i){const s=this.toFoldingRange(e,i);s&&r(s)}}collectCommentFolding(e,n,r){const i=n.$cstNode;if(i){for(const s of ZD(i))if(this.commentNames.includes(s.tokenType.name)){const o=this.toFoldingRange(e,s,ye.FoldingRangeKind.Comment);o&&r(o)}}}toFoldingRange(e,n,r){const i=n.range,s=i.start;let o=i.end;if(!(o.line-s.line<2))return this.includeLastFoldingLine(n,r)||(o=e.textDocument.positionAt(e.textDocument.offsetAt({line:o.line,character:0})-1)),ye.FoldingRange.create(s.line,o.line,s.character,o.character,r)}includeLastFoldingLine(e,n){if(n===ye.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class R7{match(e,n){if(e.length===0)return!0;let r=!1,i,s=0;const o=n.length;for(let a=0;a<o;a++){const c=n.charCodeAt(a),u=e.charCodeAt(s);if((c===u||this.toUpperCharCode(c)===this.toUpperCharCode(u))&&(r||(r=i===void 0||this.isWordTransition(i,c)),r&&s++,s===e.length))return!0;i=c}return!1}isWordTransition(e,n){return R1<=e&&e<=$1&&$7<=n&&n<=T7||e===T1&&n!==T1}toUpperCharCode(e){return R1<=e&&e<=$1?e-32:e}}const R1=97,$1=122,$7=65,T7=90,T1=95;class S1{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,n){var r,i;const s=(i=(r=e.parseResult)===null||r===void 0?void 0:r.value)===null||i===void 0?void 0:i.$cstNode;if(s){const o=e.textDocument.offsetAt(n.position),a=_i(s,o,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>o){const c=this.references.findDeclaration(a);if(c)return this.getAstNodeHoverContent(c)}}}}class S7 extends S1{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){const n=this.documentationProvider.getDocumentation(e);if(n)return{contents:{kind:"markdown",value:n}}}}var zp=Pt();const k7={[ye.SemanticTokenTypes.class]:0,[ye.SemanticTokenTypes.comment]:1,[ye.SemanticTokenTypes.enum]:2,[ye.SemanticTokenTypes.enumMember]:3,[ye.SemanticTokenTypes.event]:4,[ye.SemanticTokenTypes.function]:5,[ye.SemanticTokenTypes.interface]:6,[ye.SemanticTokenTypes.keyword]:7,[ye.SemanticTokenTypes.macro]:8,[ye.SemanticTokenTypes.method]:9,[ye.SemanticTokenTypes.modifier]:10,[ye.SemanticTokenTypes.namespace]:11,[ye.SemanticTokenTypes.number]:12,[ye.SemanticTokenTypes.operator]:13,[ye.SemanticTokenTypes.parameter]:14,[ye.SemanticTokenTypes.property]:15,[ye.SemanticTokenTypes.regexp]:16,[ye.SemanticTokenTypes.string]:17,[ye.SemanticTokenTypes.struct]:18,[ye.SemanticTokenTypes.type]:19,[ye.SemanticTokenTypes.typeParameter]:20,[ye.SemanticTokenTypes.variable]:21,[ye.SemanticTokenTypes.decorator]:22},C7={[ye.SemanticTokenModifiers.abstract]:1,[ye.SemanticTokenModifiers.async]:2,[ye.SemanticTokenModifiers.declaration]:4,[ye.SemanticTokenModifiers.defaultLibrary]:8,[ye.SemanticTokenModifiers.definition]:16,[ye.SemanticTokenModifiers.deprecated]:32,[ye.SemanticTokenModifiers.documentation]:64,[ye.SemanticTokenModifiers.modification]:128,[ye.SemanticTokenModifiers.readonly]:256,[ye.SemanticTokenModifiers.static]:512};function A7(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const o of t)o&&(o.legend.tokenTypes.forEach((a,c)=>{const u=e[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token types. They use the same index ${c}.`);e[c]=a}),o.legend.tokenModifiers.forEach((a,c)=>{const u=n[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token modifier. They use the same index ${c}.`);n[c]=a}),o.full?typeof o.full=="object"&&!o.full.delta&&(i=!1):r=!1,o.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:n},full:r&&{delta:i},range:s}}class _7 extends ye.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,n,r,i,s){this._tokens.push({line:e,char:n,length:r,tokenType:i,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}applyTokens(){for(const e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,n){return e.line===n.line?e.char-n.char:e.line-n.line}}class P7{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(n=>{this.tokensBuilders.delete(n.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(n=>{var r;this.initialize((r=n.capabilities.textDocument)===null||r===void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return k7}get tokenModifiers(){return C7}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=ct.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.buildEdits()}createAcceptor(){return n=>{"line"in n?this.highlightToken({range:{start:{line:n.line,character:n.char},end:{line:n.line,character:n.char+n.length}},type:n.type,modifier:n.modifier}):"range"in n?this.highlightToken(n):"keyword"in n?this.highlightKeyword(n):"property"in n?this.highlightProperty(n):this.highlightNode({node:n.cst,type:n.type,modifier:n.modifier})}}getDocumentTokensBuilder(e){const n=this.tokensBuilders.get(e.uri.toString());if(n)return n;const r=new _7;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=ei(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await jt(r);const a=o.value;this.highlightElement(a,n)==="prune"&&s.prune()}while(!o.done)}highlightToken(e){var n;const{range:r,type:i}=e;let s=e.modifier;if(this.currentRange&&!$g(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const o=this.tokenTypes[i];let a=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const l of s){const d=this.tokenModifiers[l];a|=d}}const c=r.start.line,u=r.end.line;if(c===u){const l=r.start.character,d=r.end.character-l;this.currentTokensBuilder.push(c,l,d,o,a)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,d=this.currentDocument.textDocument.offsetAt(r.start),f=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(c,l,f-d,o,a)}else{const l=r.start;let d=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(l.line,l.character,d-l.character-1,o,a);for(let f=c+1;f<u;f++){const p=d;d=this.currentDocument.textDocument.offsetAt({line:f+1,character:0}),this.currentTokensBuilder.push(f,0,d-p-1,o,a)}this.currentTokensBuilder.push(u,0,r.end.character,o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=kn(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...Po(e.node.$cstNode,e.property));const{type:r,modifier:i}=e;for(const s of n)this.highlightNode({node:s,type:r,modifier:i})}highlightKeyword(e){const{node:n,keyword:r,type:i,index:s,modifier:o}=e,a=[];if(typeof s=="number"){const c=yc(n.$cstNode,r,s);c&&a.push(c)}else a.push(...Vg(n.$cstNode,r));for(const c of a)this.highlightNode({node:c,type:i,modifier:o})}highlightNode(e){const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var k1;(function(t){function e(r,i,s){const o=new Map;Object.entries(i).forEach(([u,l])=>o.set(l,u));let a=0,c=0;return n(r.data,5).map(u=>{a+=u[0],u[0]!==0&&(c=0),c+=u[1];const l=u[2];return{offset:s.textDocument.offsetAt({line:a,character:c}),tokenType:o.get(u[3]),tokenModifiers:u[4],text:s.textDocument.getText({start:{line:a,character:c},end:{line:a,character:c+l}})}})}t.decode=e;function n(r,i){const s=[];for(let o=0;o<r.length;o+=i){const a=r.slice(o,o+i);s.push(a)}return s}})(k1||(k1={}));function x7(t){const e=[],n=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&n.push(...i.retriggerCharacters)});const r={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0};return r.triggerCharacters?r:void 0}class I7{constructor(e){this.onInitializeEmitter=new zp.Emitter,this.onInitializedEmitter=new zp.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(e),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){$v(this.services),this.services.ServiceRegistry.all.forEach(e=>$v(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var n,r,i,s;const o=this.services.lsp.DocumentUpdateHandler,a=(n=this.services.lsp.FileOperationHandler)===null||n===void 0?void 0:n.fileOperationOptions,c=this.services.ServiceRegistry.all,u=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.Formatter}),l=c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.Formatter)===null||he===void 0?void 0:he.formatOnTypeOptions}).find(te=>!!te),d=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeActionProvider}),f=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider}),p=A7(c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider)===null||he===void 0?void 0:he.semanticTokensOptions})),h=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,v=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentLinkProvider}),b=x7(c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.SignatureHelp)===null||he===void 0?void 0:he.signatureHelpOptions})),g=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeProvider}),w=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ImplementationProvider}),R=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider}),k=v7(c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider)===null||he===void 0?void 0:he.completionOptions})),A=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ReferencesProvider}),N=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentSymbolProvider}),_=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DefinitionProvider}),B=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentHighlightProvider}),z=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.FoldingRangeProvider}),Q=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.HoverProvider}),I=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.RenameProvider}),T=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CallHierarchyProvider}),$=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeHierarchyProvider}),L=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeLensProvider}),V=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DeclarationProvider}),H=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.InlayHintProvider}),K=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:zp.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:R?k:void 0,referencesProvider:A,documentSymbolProvider:N,definitionProvider:_,typeDefinitionProvider:g,documentHighlightProvider:B,codeActionProvider:d,documentFormattingProvider:u,documentRangeFormattingProvider:u,documentOnTypeFormattingProvider:l,foldingRangeProvider:z,hoverProvider:Q,renameProvider:I?{prepareProvider:!0}:void 0,semanticTokensProvider:f?p:void 0,signatureHelpProvider:b,implementationProvider:w,callHierarchyProvider:T?{}:void 0,typeHierarchyProvider:$?{}:void 0,documentLinkProvider:v?{resolveProvider:!1}:void 0,codeLensProvider:L?{resolveProvider:!1}:void 0,declarationProvider:V,inlayHintProvider:H?{resolveProvider:!1}:void 0,workspaceSymbolProvider:K?{resolveProvider:!!K.resolveSymbol}:void 0}}}initialized(e){this.fireInitializedOnDefaultServices(e),this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(e){this.services.workspace.ConfigurationProvider.initialize(e),this.services.workspace.WorkspaceManager.initialize(e)}fireInitializedOnDefaultServices(e){const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register(zp.DidChangeConfigurationNotification.type,i),fetchConfiguration:i=>n.workspace.getConfiguration(i)}):e;this.services.workspace.ConfigurationProvider.initialized(r).catch(i=>console.error("Error in ConfigurationProvider initialization:",i)),this.services.workspace.WorkspaceManager.initialized(e).catch(i=>console.error("Error in WorkspaceManager initialization:",i))}}class N7{getSymbolKind(e){return ye.SymbolKind.Field}getCompletionItemKind(e){return ye.CompletionItemKind.Reference}}class O7{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return[];const s=_i(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,e):[]}getReferences(e,n,r){const i=[],s=this.references.findDeclaration(e);if(s){const o={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,o).forEach(a=>{i.push(ye.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}}class F7{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,n,r){const i={},s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument.offsetAt(n.position),a=_i(s,o,this.grammarConfig.nameRegexp);if(!a)return;const c=this.references.findDeclaration(a);if(!c)return;const u={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(c,u).forEach(d=>{const f=In.replace(d.segment.range,n.newName),p=d.sourceUri.toString();i[p]?i[p].push(f):i[p]=[f]}),{changes:i}}prepareRename(e,n,r){return this.renameNodeRange(e,n.position)}renameNodeRange(e,n){const r=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(n);if(r&&i){const s=_i(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&Cp(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class C1{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=ct.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await jt(n),this.fuzzyMatcher.match(i,s.name)){const o=this.getWorkspaceSymbol(s);o&&r.push(o)}return r}getWorkspaceSymbol(e){const n=e.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:n.range,uri:e.documentUri.toString()}}}}class L7{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ye.Emitter,this._onDidOpen=new ye.Emitter,this._onDidClose=new ye.Emitter,this._onDidSave=new ye.Emitter,this._onWillSave=new ye.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(Ct.normalize(e))}set(e){const n=Ct.normalize(e.uri);let r=!0;this._syncedDocuments.has(n)&&(r=!1),this._syncedDocuments.set(n,e);const i=Object.freeze({document:e});return this._onDidOpen.fire(i),this._onDidChangeContent.fire(i),r}delete(e){const n=Ct.normalize(typeof e=="object"&&"uri"in e?e.uri:e),r=this._syncedDocuments.get(n);r!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:r})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ye.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=Ct.normalize(i.uri),o=this._configuration.create(s,i.languageId,i.version,i.text);this._syncedDocuments.set(s,o);const a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,s=r.contentChanges;if(s.length===0)return;const{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);const a=Ct.normalize(i.uri);let c=this._syncedDocuments.get(a);c!==void 0&&(c=this._configuration.update(c,s,o),this._syncedDocuments.set(a,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),n.push(e.onDidCloseTextDocument(r=>{const i=Ct.normalize(r.textDocument.uri),s=this._syncedDocuments.get(i);s!==void 0&&(this._syncedDocuments.delete(i),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{const i=this._syncedDocuments.get(Ct.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{const s=this._syncedDocuments.get(Ct.normalize(r.textDocument.uri));return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{const i=this._syncedDocuments.get(Ct.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ye.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}function M7(t){return Pp.merge(IS(t),B7(t))}function B7(t){return{lsp:{CompletionProvider:e=>new D1(e),DocumentSymbolProvider:e=>new b7(e),HoverProvider:e=>new S7(e),FoldingRangeProvider:e=>new E7(e),ReferencesProvider:e=>new O7(e),DefinitionProvider:e=>new w7(e),DocumentHighlightProvider:e=>new E1(e),RenameProvider:e=>new F7(e)},shared:()=>t.shared}}function z7(t){return Pp.merge(NS(t),q7(t))}function q7(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new I7(e),DocumentUpdateHandler:e=>new D7(e),WorkspaceSymbolProvider:e=>new C1(e),NodeKindProvider:()=>new N7,FuzzyMatcher:()=>new R7},workspace:{TextDocuments:()=>new L7(kp)}}}class j7{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new U7(e,this.collector)}formatDocument(e,n){const r=e.parseResult;return r.lexerErrors.length===0&&r.parserErrors.length===0?this.doDocumentFormat(e,n.options):[]}isFormatRangeErrorFree(e,n){const r=e.parseResult;return r.lexerErrors.length||r.parserErrors.length?Math.min(...r.lexerErrors.map(s=>{var o;return(o=s.line)!==null&&o!==void 0?o:Number.MAX_VALUE}),...r.parserErrors.map(s=>{var o;return(o=s.token.startLine)!==null&&o!==void 0?o:Number.MAX_VALUE}))>n.end.line:!0}formatDocumentRange(e,n){return this.isFormatRangeErrorFree(e,n.range)?this.doDocumentFormat(e,n.options,n.range):[]}formatDocumentOnType(e,n){const r={start:{character:0,line:n.position.line},end:n.position};return this.isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(a,c,u)=>{var l,d;const f=this.nodeModeToKey(a,c),p=i.get(f),h=(l=u.options.priority)!==null&&l!==void 0?l:0,v=(d=p?.options.priority)!==null&&d!==void 0?d:0;(!p||v<=h)&&i.set(f,u)};this.collector=s,this.iterateAstFormatting(e,r);const o=this.iterateCstFormatting(e,i,n,r);return this.avoidOverlappingEdits(e.textDocument,o)}avoidOverlappingEdits(e,n){const r=[];for(const i of n){let s=r[r.length-1];for(;s;){const o=e.offsetAt(i.range.start),a=e.offsetAt(s.range.end);if(o<a)r.pop(),s=r[r.length-1];else break}r.push(i)}return r.filter(i=>this.isNecessary(i,e))}iterateAstFormatting(e,n){const r=e.parseResult.value;this.format(r);const i=_r(r).iterator();let s;do if(s=i.next(),!s.done){const o=s.value;this.insideRange(o.$cstNode.range,n)?this.format(o):i.prune()}while(!s.done)}nodeModeToKey(e,n){return`${e.offset}:${e.end}:${n}`}insideRange(e,n){return!n||e.start.line<=n.start.line&&e.end.line>=n.end.line||e.start.line>=n.start.line&&e.end.line<=n.end.line||e.start.line<=n.end.line&&e.end.line>=n.end.line}isNecessary(e,n){return e.newText!==n.getText(e.range).replace(/\r/g,"")}iterateCstFormatting(e,n,r,i){const s={indentation:0,options:r,document:e.textDocument},o=[],c=this.iterateCstTree(e,s).iterator();let u,l;do if(l=c.next(),!l.done){const d=l.value,f=ws(d),p=this.nodeModeToKey(d,"prepend"),h=n.get(p);if(n.delete(p),h){const g=this.createTextEdit(u,d,h,s);for(const w of g)w&&this.insideRange(w.range,i)&&o.push(w)}const v=this.nodeModeToKey(d,"append"),b=n.get(v);if(n.delete(v),b){const g=rE(d);if(g){const w=this.createTextEdit(d,g,b,s);for(const R of w)R&&this.insideRange(R.range,i)&&o.push(R)}}if(!h&&d.hidden){const g=this.createHiddenTextEdits(u,d,void 0,s);for(const w of g)w&&this.insideRange(w.range,i)&&o.push(w)}f&&(u=d)}while(!l.done);return o}createHiddenTextEdits(e,n,r,i){var s;const o=n.range.start.line;if(e&&e.range.end.line===o)return[];const a=[],c={start:{character:0,line:o},end:n.range.start},u=i.document.getText(c),l=this.findFittingMove(c,(s=r?.moves)!==null&&s!==void 0?s:[],i),d=this.getExistingIndentationCharacterCount(u,i),p=this.getIndentationCharacterCount(i,l)-d;if(p===0)return[];let h="";p>0&&(h=(i.options.insertSpaces?" ":" ").repeat(p));const v=n.text.split(`
|
|
161
|
+
`);v[0]=u+v[0];for(let b=0;b<v.length;b++){const g=o+b,w={character:0,line:g};if(p>0)a.push({newText:h,range:{start:w,end:w}});else{const R=v[b];let k=0;for(;k<R.length;k++){const A=R.charAt(k);if(A!==" "&&A!==" ")break}a.push({newText:"",range:{start:w,end:{line:g,character:Math.min(k,Math.abs(p))}}})}}return a}getExistingIndentationCharacterCount(e,n){const r=" ".repeat(n.options.tabSize);return(n.options.insertSpaces?e.replaceAll(" ",r):e.replaceAll(r," ")).length}getIndentationCharacterCount(e,n){let r=e.indentation;return n&&n.tabs&&(r+=n.tabs),(e.options.insertSpaces?e.options.tabSize:1)*r}createTextEdit(e,n,r,i){var s;if(n.hidden)return this.createHiddenTextEdits(e,n,r,i);if(e&&(e.range.end.line>n.range.start.line||e.range.end.line===n.range.start.line&&e.range.end.character>n.range.start.character))return[];const o={start:(s=e?.range.end)!==null&&s!==void 0?s:{character:0,line:0},end:n.range.start},a=this.findFittingMove(o,r.moves,i);if(!a)return[];const c=a.characters,u=a.lines,l=a.tabs,d=i.indentation;i.indentation+=l??0;const f=[];return c!==void 0?e?.hidden||f.push(this.createSpaceTextEdit(o,c,r.options)):u!==void 0?f.push(this.createLineTextEdit(o,u,i,r.options)):l!==void 0&&f.push(this.createTabTextEdit(o,!!e,i)),ws(n)&&(i.indentation=d),f}createSpaceTextEdit(e,n,r){if(e.start.line===e.end.line){const s=e.end.character-e.start.character;n=this.fitIntoOptions(n,s,r)}return{newText:" ".repeat(n),range:e}}createLineTextEdit(e,n,r,i){const s=e.end.line-e.start.line;n=this.fitIntoOptions(n,s,i);const a=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
|
|
162
|
+
`.repeat(n)}${a}`,range:e}}createTabTextEdit(e,n,r){const s=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation),o=n?1:0,a=Math.max(e.end.line-e.start.line,o);return{newText:`${`
|
|
163
|
+
`.repeat(a)}${s}`,range:e}}fitIntoOptions(e,n,r){return r.allowMore?e=Math.max(n,e):r.allowLess&&(e=Math.min(n,e)),e}findFittingMove(e,n,r){if(n.length===0)return;if(n.length===1)return n[0];const i=e.end.line-e.start.line;for(const s of n){if(s.lines!==void 0&&i<=s.lines)return s;if(s.lines===void 0&&i===0)return s}return n[n.length-1]}iterateCstTree(e,n){const i=e.parseResult.value.$cstNode;return i?new Co(i,s=>this.iterateCst(s,n)):ko}iterateCst(e,n){if(!Jr(e))return ko;const r=n.indentation;return new Mt(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,nn))}}class U7{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new Dr(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new Dr(n,this.collector)}property(e,n){const r=kn(this.astNode.$cstNode,e,n);return new Dr(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=Po(this.astNode.$cstNode,r);n.push(...i)}return new Dr(n,this.collector)}keyword(e,n){const r=yc(this.astNode.$cstNode,e,n);return new Dr(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Vg(this.astNode.$cstNode,r);n.push(...i)}return new Dr(n,this.collector)}cst(e){return new Dr([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new Dr([],this.collector);let s=r[0],o=i[0];if(s.offset>o.offset){const a=s;s=o,o=a}return new Dr(iE(s,o),this.collector)}}class Dr{constructor(e,n){this.nodes=e,this.collector=n}prepend(e){for(const n of this.nodes)this.collector(n,"prepend",e);return this}append(e){for(const n of this.nodes)this.collector(n,"append",e);return this}surround(e){for(const n of this.nodes)this.collector(n,"prepend",e),this.collector(n,"append",e);return this}slice(e,n){return new Dr(this.nodes.slice(e,n),this.collector)}}var qi;(function(t){function e(...l){return{options:{},moves:l.flatMap(d=>d.moves).sort(u)}}t.fit=e;function n(l){return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,d){return{options:d??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return o(1,l)}t.newLine=s;function o(l,d){return{options:d??{},moves:[{lines:l}]}}t.newLines=o;function a(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function c(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=c;function u(l,d){var f,p,h,v,b,g;const w=(f=l.lines)!==null&&f!==void 0?f:0,R=(p=d.lines)!==null&&p!==void 0?p:0,k=(h=l.tabs)!==null&&h!==void 0?h:0,A=(v=d.tabs)!==null&&v!==void 0?v:0,N=(b=l.characters)!==null&&b!==void 0?b:0,_=(g=d.characters)!==null&&g!==void 0?g:0;return w<R?-1:w>R?1:k<A?-1:k>A?1:N<_?-1:N>_?1:0}})(qi||(qi={}));var qv,A1;function G7(){return A1||(A1=1,qv=y1()),qv}G7();var ku={},Cu={},Au={},Ws={},ji={},bi={},_1;function P1(){if(_1)return bi;_1=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.normalizePath=bi.convertSlashes=bi.cleanPath=void 0;const t=Tr;function e(s){let o=(0,t.normalize)(s);return o.length>1&&o[o.length-1]===t.sep&&(o=o.substring(0,o.length-1)),o}bi.cleanPath=e;const n=/[\\/]/g;function r(s,o){return s.replace(n,o)}bi.convertSlashes=r;function i(s,o){const{resolvePaths:a,normalizePath:c,pathSeparator:u}=o,l=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(a&&(s=(0,t.resolve)(s)),(c||l)&&(s=e(s)),s===".")return"";const d=s[s.length-1]!==u;return r(d?s+u:s,u)}return bi.normalizePath=i,bi}var Di={},x1;function W7(){if(x1)return Di;x1=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.build=Di.joinDirectoryPath=Di.joinPathWithBasePath=void 0;const t=Tr,e=P1();function n(a,c){return c+a}Di.joinPathWithBasePath=n;function r(a,c){return function(u,l){return l.startsWith(a)?l.replace(a,"")+u:(0,e.convertSlashes)((0,t.relative)(a,l),c.pathSeparator)+c.pathSeparator+u}}function i(a){return a}function s(a,c,u){return c+a+u}Di.joinDirectoryPath=s;function o(a,c){const{relativePaths:u,includeBasePath:l}=c;return u&&a?r(a,c):l?n:i}return Di.build=o,Di}var _u={},I1;function H7(){if(I1)return _u;I1=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.build=void 0;function t(o){return function(a,c){c.push(a.substring(o.length)||".")}}function e(o){return function(a,c,u){const l=a.substring(o.length)||".";u.every(d=>d(l,!0))&&c.push(l)}}const n=(o,a)=>{a.push(o||".")},r=(o,a,c)=>{const u=o||".";c.every(l=>l(u,!0))&&a.push(u)},i=()=>{};function s(o,a){const{includeDirs:c,filters:u,relativePaths:l}=a;return c?l?u&&u.length?e(o):t(o):u&&u.length?r:n:i}return _u.build=s,_u}var Pu={},N1;function V7(){if(N1)return Pu;N1=1,Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.build=void 0;const t=(o,a,c,u)=>{u.every(l=>l(o,!1))&&c.files++},e=(o,a,c,u)=>{u.every(l=>l(o,!1))&&a.push(o)},n=(o,a,c,u)=>{c.files++},r=(o,a)=>{a.push(o)},i=()=>{};function s(o){const{excludeFiles:a,filters:c,onlyCounts:u}=o;return a?i:c&&c.length?u?t:e:u?n:r}return Pu.build=s,Pu}var xu={},O1;function K7(){if(O1)return xu;O1=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.build=void 0;const t=r=>r,e=()=>[""].slice(0,0);function n(r){return r.group?e:t}return xu.build=n,xu}var Iu={},F1;function Y7(){if(F1)return Iu;F1=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.build=void 0;const t=(r,i,s)=>{r.push({directory:i,files:s,dir:i})},e=()=>{};function n(r){return r.group?t:e}return Iu.build=n,Iu}var Yo={},L1;function X7(){if(L1)return Yo;L1=1;var t=Yo.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.build=void 0;const e=t(yo),n=Tr,r=function(c,u,l){const{queue:d,options:{suppressErrors:f}}=u;d.enqueue(),e.default.realpath(c,(p,h)=>{if(p)return d.dequeue(f?null:p,u);e.default.stat(h,(v,b)=>{if(v)return d.dequeue(f?null:v,u);if(b.isDirectory()&&o(c,h,u))return d.dequeue(null,u);l(b,h),d.dequeue(null,u)})})},i=function(c,u,l){const{queue:d,options:{suppressErrors:f}}=u;d.enqueue();try{const p=e.default.realpathSync(c),h=e.default.statSync(p);if(h.isDirectory()&&o(c,p,u))return;l(h,p)}catch(p){if(!f)throw p}};function s(c,u){return!c.resolveSymlinks||c.excludeSymlinks?null:u?i:r}Yo.build=s;function o(c,u,l){if(l.options.useRealPaths)return a(u,l);let d=(0,n.dirname)(c),f=1;for(;d!==l.root&&f<2;){const p=l.symlinks.get(d);!!p&&(p===u||p.startsWith(u)||u.startsWith(p))?f++:d=(0,n.dirname)(d)}return l.symlinks.set(c,u),f>1}function a(c,u){return u.visited.includes(c+u.options.pathSeparator)}return Yo}var Nu={},M1;function J7(){if(M1)return Nu;M1=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.build=void 0;const t=l=>l.counts,e=l=>l.groups,n=l=>l.paths,r=l=>l.paths.slice(0,l.options.maxFiles),i=(l,d,f)=>(c(d,f,l.counts,l.options.suppressErrors),null),s=(l,d,f)=>(c(d,f,l.paths,l.options.suppressErrors),null),o=(l,d,f)=>(c(d,f,l.paths.slice(0,l.options.maxFiles),l.options.suppressErrors),null),a=(l,d,f)=>(c(d,f,l.groups,l.options.suppressErrors),null);function c(l,d,f,p){d(l&&!p?l:null,f)}function u(l,d){const{onlyCounts:f,group:p,maxFiles:h}=l;return f?d?t:i:p?d?e:a:h?d?r:o:d?n:s}return Nu.build=u,Nu}var Xo={},B1;function Z7(){if(B1)return Xo;B1=1;var t=Xo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.build=void 0;const e=t(yo),n={withFileTypes:!0},r=(o,a,c,u,l)=>{if(u<0)return o.queue.dequeue(null,o);o.visited.push(a),o.counts.directories++,o.queue.enqueue(),e.default.readdir(a||".",n,(d,f=[])=>{l(f,c,u),o.queue.dequeue(o.options.suppressErrors?null:d,o)})},i=(o,a,c,u,l)=>{if(u<0)return;o.visited.push(a),o.counts.directories++;let d=[];try{d=e.default.readdirSync(a||".",n)}catch(f){if(!o.options.suppressErrors)throw f}l(d,c,u)};function s(o){return o?i:r}return Xo.build=s,Xo}var Ou={},z1;function Q7(){if(z1)return Ou;z1=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.Queue=void 0;class t{onQueueEmpty;count=0;constructor(n){this.onQueueEmpty=n}enqueue(){this.count++}dequeue(n,r){(--this.count<=0||n)&&this.onQueueEmpty(n,r)}}return Ou.Queue=t,Ou}var Fu={},q1;function eU(){if(q1)return Fu;q1=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.Counter=void 0;class t{_files=0;_directories=0;set files(n){this._files=n}get files(){return this._files}set directories(n){this._directories=n}get directories(){return this._directories}get dirs(){return this._directories}}return Fu.Counter=t,Fu}var j1;function U1(){if(j1)return ji;j1=1;var t=ji.__createBinding||(Object.create?function(b,g,w,R){R===void 0&&(R=w);var k=Object.getOwnPropertyDescriptor(g,w);(!k||("get"in k?!g.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return g[w]}}),Object.defineProperty(b,R,k)}:function(b,g,w,R){R===void 0&&(R=w),b[R]=g[w]}),e=ji.__setModuleDefault||(Object.create?function(b,g){Object.defineProperty(b,"default",{enumerable:!0,value:g})}:function(b,g){b.default=g}),n=ji.__importStar||function(b){if(b&&b.__esModule)return b;var g={};if(b!=null)for(var w in b)w!=="default"&&Object.prototype.hasOwnProperty.call(b,w)&&t(g,b,w);return e(g,b),g};Object.defineProperty(ji,"__esModule",{value:!0}),ji.Walker=void 0;const r=Tr,i=P1(),s=n(W7()),o=n(H7()),a=n(V7()),c=n(K7()),u=n(Y7()),l=n(X7()),d=n(J7()),f=n(Z7()),p=Q7(),h=eU();class v{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(g,w,R){this.isSynchronous=!R,this.callbackInvoker=d.build(w,this.isSynchronous),this.root=(0,i.normalizePath)(g,w),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new h.Counter,options:w,queue:new p.Queue((k,A)=>this.callbackInvoker(A,k,R)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=s.build(this.root,w),this.pushDirectory=o.build(this.root,w),this.pushFile=a.build(w),this.getArray=c.build(w),this.groupFiles=u.build(w),this.resolveSymlink=l.build(w,this.isSynchronous),this.walkDirectory=f.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(g,w,R)=>{const{paths:k,options:{filters:A,resolveSymlinks:N,excludeSymlinks:_,exclude:B,maxFiles:z,signal:Q,useRealPaths:I,pathSeparator:T}}=this.state;if(Q&&Q.aborted||z&&k.length>z)return;this.pushDirectory(w,k,A);const $=this.getArray(this.state.paths);for(let L=0;L<g.length;++L){const V=g[L];if(V.isFile()||V.isSymbolicLink()&&!N&&!_){const H=this.joinPath(V.name,w);this.pushFile(H,$,this.state.counts,A)}else if(V.isDirectory()){let H=s.joinDirectoryPath(V.name,w,this.state.options.pathSeparator);if(B&&B(V.name,H))continue;this.walkDirectory(this.state,H,H,R-1,this.walk)}else if(V.isSymbolicLink()&&this.resolveSymlink){let H=s.joinPathWithBasePath(V.name,w);this.resolveSymlink(H,this.state,(K,we)=>{if(K.isDirectory()){if(we=(0,i.normalizePath)(we,this.state.options),B&&B(V.name,we))return;this.walkDirectory(this.state,we,I?we:H+T,R-1,this.walk)}else{we=I?we:H;const te=(0,r.basename)(we),C=(0,i.normalizePath)((0,r.dirname)(we),this.state.options);we=this.joinPath(te,C),this.pushFile(we,$,this.state.counts,A)}})}}this.groupFiles(this.state.groups,w,$)}}return ji.Walker=v,ji}var G1;function tU(){if(G1)return Ws;G1=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.callback=Ws.promise=void 0;const t=U1();function e(r,i){return new Promise((s,o)=>{n(r,i,(a,c)=>{if(a)return o(a);s(c)})})}Ws.promise=e;function n(r,i,s){new t.Walker(r,i,s).start()}return Ws.callback=n,Ws}var Lu={},W1;function nU(){if(W1)return Lu;W1=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.sync=void 0;const t=U1();function e(n,r){return new t.Walker(n,r).start()}return Lu.sync=e,Lu}var H1;function rU(){if(H1)return Au;H1=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.APIBuilder=void 0;const t=tU(),e=nU();class n{root;options;constructor(i,s){this.root=i,this.options=s}withPromise(){return(0,t.promise)(this.root,this.options)}withCallback(i){(0,t.callback)(this.root,this.options,i)}sync(){return(0,e.sync)(this.root,this.options)}}return Au.APIBuilder=n,Au}var jv={},Uv,V1;function qp(){if(V1)return Uv;V1=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",o="(?=.)",a="[^/]",c=`(?:${s}|$)`,u=`(?:^|${s})`,l=`${n}{1,2}${c}`,d=`(?!${n})`,f=`(?!${u}${l})`,p=`(?!${n}{0,1}${c})`,h=`(?!${l})`,v=`[^.${s}]`,b=`${a}*?`,w={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:a,END_ANCHOR:c,DOTS_SLASH:l,NO_DOT:d,NO_DOTS:f,NO_DOT_SLASH:p,NO_DOTS_SLASH:h,QMARK_NO_DOT:v,STAR:b,START_ANCHOR:u,SEP:"/"},R={...w,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},k={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Uv={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:k,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?R:w}},Uv}var K1;function jp(){return K1||(K1=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=qp();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>r.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(i,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(n,o=>o==="\\"?"":o),t.escapeLast=(s,o,a)=>{const c=s.lastIndexOf(o,a);return c===-1?s:s[c-1]==="\\"?t.escapeLast(s,o,c-1):`${s.slice(0,c)}\\${s.slice(c)}`},t.removePrefix=(s,o={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),o.prefix="./"),a},t.wrapOutput=(s,o={},a={})=>{const c=a.contains?"":"^",u=a.contains?"":"$";let l=`${c}(?:${s})${u}`;return o.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(s,{windows:o}={})=>{const a=s.split(o?/[\\/]/:"/"),c=a[a.length-1];return c===""?a[a.length-2]:c}}(jv)),jv}var Gv,Y1;function iU(){if(Y1)return Gv;Y1=1;const t=jp(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:p,CHAR_RIGHT_PARENTHESES:h,CHAR_RIGHT_SQUARE_BRACKET:v}=qp(),b=R=>R===a||R===r,g=R=>{R.isPrefix!==!0&&(R.depth=R.isGlobstar?1/0:1)};return Gv=(R,k)=>{const A=k||{},N=R.length-1,_=A.parts===!0||A.scanToEnd===!0,B=[],z=[],Q=[];let I=R,T=-1,$=0,L=0,V=!1,H=!1,K=!1,we=!1,te=!1,C=!1,he=!1,Ye=!1,pt=!1,W=!1,X=0,Ie,oe,be={value:"",depth:0,isGlob:!1};const Se=()=>T>=N,ae=()=>I.charCodeAt(T+1),O=()=>(Ie=oe,I.charCodeAt(++T));for(;T<N;){oe=O();let qe;if(oe===r){he=be.backslashes=!0,oe=O(),oe===c&&(C=!0);continue}if(C===!0||oe===c){for(X++;Se()!==!0&&(oe=O());){if(oe===r){he=be.backslashes=!0,O();continue}if(oe===c){X++;continue}if(C!==!0&&oe===s&&(oe=O())===s){if(V=be.isBrace=!0,K=be.isGlob=!0,W=!0,_===!0)continue;break}if(C!==!0&&oe===i){if(V=be.isBrace=!0,K=be.isGlob=!0,W=!0,_===!0)continue;break}if(oe===p&&(X--,X===0)){C=!1,V=be.isBrace=!0,W=!0;break}}if(_===!0)continue;break}if(oe===a){if(B.push(T),z.push(be),be={value:"",depth:0,isGlob:!1},W===!0)continue;if(Ie===s&&T===$+1){$+=2;continue}L=T+1;continue}if(A.noext!==!0&&(oe===d||oe===n||oe===e||oe===f||oe===o)===!0&&ae()===u){if(K=be.isGlob=!0,we=be.isExtglob=!0,W=!0,oe===o&&T===$&&(pt=!0),_===!0){for(;Se()!==!0&&(oe=O());){if(oe===r){he=be.backslashes=!0,oe=O();continue}if(oe===h){K=be.isGlob=!0,W=!0;break}}continue}break}if(oe===e){if(Ie===e&&(te=be.isGlobstar=!0),K=be.isGlob=!0,W=!0,_===!0)continue;break}if(oe===f){if(K=be.isGlob=!0,W=!0,_===!0)continue;break}if(oe===l){for(;Se()!==!0&&(qe=O());){if(qe===r){he=be.backslashes=!0,O();continue}if(qe===v){H=be.isBracket=!0,K=be.isGlob=!0,W=!0;break}}if(_===!0)continue;break}if(A.nonegate!==!0&&oe===o&&T===$){Ye=be.negated=!0,$++;continue}if(A.noparen!==!0&&oe===u){if(K=be.isGlob=!0,_===!0){for(;Se()!==!0&&(oe=O());){if(oe===u){he=be.backslashes=!0,oe=O();continue}if(oe===h){W=!0;break}}continue}break}if(K===!0){if(W=!0,_===!0)continue;break}}A.noext===!0&&(we=!1,K=!1);let j=I,de="",U="";$>0&&(de=I.slice(0,$),I=I.slice($),L-=$),j&&K===!0&&L>0?(j=I.slice(0,L),U=I.slice(L)):K===!0?(j="",U=I):j=I,j&&j!==""&&j!=="/"&&j!==I&&b(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),A.unescape===!0&&(U&&(U=t.removeBackslashes(U)),j&&he===!0&&(j=t.removeBackslashes(j)));const ce={prefix:de,input:R,start:$,base:j,glob:U,isBrace:V,isBracket:H,isGlob:K,isExtglob:we,isGlobstar:te,negated:Ye,negatedExtglob:pt};if(A.tokens===!0&&(ce.maxDepth=0,b(oe)||z.push(be),ce.tokens=z),A.parts===!0||A.tokens===!0){let qe;for(let et=0;et<B.length;et++){const se=qe?qe+1:$,_e=B[et],ne=R.slice(se,_e);A.tokens&&(et===0&&$!==0?(z[et].isPrefix=!0,z[et].value=de):z[et].value=ne,g(z[et]),ce.maxDepth+=z[et].depth),(et!==0||ne!=="")&&Q.push(ne),qe=_e}if(qe&&qe+1<R.length){const et=R.slice(qe+1);Q.push(et),A.tokens&&(z[z.length-1].value=et,g(z[z.length-1]),ce.maxDepth+=z[z.length-1].depth)}ce.slashes=B,ce.parts=Q}return ce},Gv}var Wv,X1;function sU(){if(X1)return Wv;X1=1;const t=qp(),e=jp(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(l,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...l,d);l.sort();const f=`[${l.join("-")}]`;try{new RegExp(f)}catch{return l.map(h=>e.escapeRegex(h)).join("..")}return f},c=(l,d)=>`Missing ${l}: "${d}" - use "\\\\${d}" to match literal characters`,u=(l,d)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=o[l]||l;const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n;let h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);const v={type:"bos",value:"",output:f.prepend||""},b=[v],g=f.capture?"":"?:",w=t.globChars(f.windows),R=t.extglobChars(w),{DOT_LITERAL:k,PLUS_LITERAL:A,SLASH_LITERAL:N,ONE_CHAR:_,DOTS_SLASH:B,NO_DOT:z,NO_DOT_SLASH:Q,NO_DOTS_SLASH:I,QMARK:T,QMARK_NO_DOT:$,STAR:L,START_ANCHOR:V}=w,H=se=>`(${g}(?:(?!${V}${se.dot?B:k}).)*?)`,K=f.dot?"":z,we=f.dot?T:$;let te=f.bash===!0?H(f):L;f.capture&&(te=`(${te})`),typeof f.noext=="boolean"&&(f.noextglob=f.noext);const C={input:l,index:-1,start:0,dot:f.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};l=e.removePrefix(l,C),h=l.length;const he=[],Ye=[],pt=[];let W=v,X;const Ie=()=>C.index===h-1,oe=C.peek=(se=1)=>l[C.index+se],be=C.advance=()=>l[++C.index]||"",Se=()=>l.slice(C.index+1),ae=(se="",_e=0)=>{C.consumed+=se,C.index+=_e},O=se=>{C.output+=se.output!=null?se.output:se.value,ae(se.value)},j=()=>{let se=1;for(;oe()==="!"&&(oe(2)!=="("||oe(3)==="?");)be(),C.start++,se++;return se%2===0?!1:(C.negated=!0,C.start++,!0)},de=se=>{C[se]++,pt.push(se)},U=se=>{C[se]--,pt.pop()},ce=se=>{if(W.type==="globstar"){const _e=C.braces>0&&(se.type==="comma"||se.type==="brace"),ne=se.extglob===!0||he.length&&(se.type==="pipe"||se.type==="paren");se.type!=="slash"&&se.type!=="paren"&&!_e&&!ne&&(C.output=C.output.slice(0,-W.output.length),W.type="star",W.value="*",W.output=te,C.output+=W.output)}if(he.length&&se.type!=="paren"&&(he[he.length-1].inner+=se.value),(se.value||se.output)&&O(se),W&&W.type==="text"&&se.type==="text"){W.output=(W.output||W.value)+se.value,W.value+=se.value;return}se.prev=W,b.push(se),W=se},qe=(se,_e)=>{const ne={...R[_e],conditions:1,inner:""};ne.prev=W,ne.parens=C.parens,ne.output=C.output;const De=(f.capture?"(":"")+ne.open;de("parens"),ce({type:se,value:_e,output:C.output?"":_}),ce({type:"paren",extglob:!0,value:be(),output:De}),he.push(ne)},et=se=>{let _e=se.close+(f.capture?")":""),ne;if(se.type==="negate"){let De=te;if(se.inner&&se.inner.length>1&&se.inner.includes("/")&&(De=H(f)),(De!==te||Ie()||/^\)+$/.test(Se()))&&(_e=se.close=`)$))${De}`),se.inner.includes("*")&&(ne=Se())&&/^\.[^\\/.]+$/.test(ne)){const Me=u(ne,{...d,fastpaths:!1}).output;_e=se.close=`)${Me})${De})`}se.prev.type==="bos"&&(C.negatedExtglob=!0)}ce({type:"paren",extglob:!0,value:X,output:_e}),U("parens")};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let se=!1,_e=l.replace(s,(ne,De,Me,ht,Xe,Ut)=>ht==="\\"?(se=!0,ne):ht==="?"?De?De+ht+(Xe?T.repeat(Xe.length):""):Ut===0?we+(Xe?T.repeat(Xe.length):""):T.repeat(Me.length):ht==="."?k.repeat(Me.length):ht==="*"?De?De+ht+(Xe?te:""):te:De?ne:`\\${ne}`);return se===!0&&(f.unescape===!0?_e=_e.replace(/\\/g,""):_e=_e.replace(/\\+/g,ne=>ne.length%2===0?"\\\\":ne?"\\":"")),_e===l&&f.contains===!0?(C.output=l,C):(C.output=e.wrapOutput(_e,C,d),C)}for(;!Ie();){if(X=be(),X==="\0")continue;if(X==="\\"){const ne=oe();if(ne==="/"&&f.bash!==!0||ne==="."||ne===";")continue;if(!ne){X+="\\",ce({type:"text",value:X});continue}const De=/^\\+/.exec(Se());let Me=0;if(De&&De[0].length>2&&(Me=De[0].length,C.index+=Me,Me%2!==0&&(X+="\\")),f.unescape===!0?X=be():X+=be(),C.brackets===0){ce({type:"text",value:X});continue}}if(C.brackets>0&&(X!=="]"||W.value==="["||W.value==="[^")){if(f.posix!==!1&&X===":"){const ne=W.value.slice(1);if(ne.includes("[")&&(W.posix=!0,ne.includes(":"))){const De=W.value.lastIndexOf("["),Me=W.value.slice(0,De),ht=W.value.slice(De+2),Xe=r[ht];if(Xe){W.value=Me+Xe,C.backtrack=!0,be(),!v.output&&b.indexOf(W)===1&&(v.output=_);continue}}}(X==="["&&oe()!==":"||X==="-"&&oe()==="]")&&(X=`\\${X}`),X==="]"&&(W.value==="["||W.value==="[^")&&(X=`\\${X}`),f.posix===!0&&X==="!"&&W.value==="["&&(X="^"),W.value+=X,O({value:X});continue}if(C.quotes===1&&X!=='"'){X=e.escapeRegex(X),W.value+=X,O({value:X});continue}if(X==='"'){C.quotes=C.quotes===1?0:1,f.keepQuotes===!0&&ce({type:"text",value:X});continue}if(X==="("){de("parens"),ce({type:"paren",value:X});continue}if(X===")"){if(C.parens===0&&f.strictBrackets===!0)throw new SyntaxError(c("opening","("));const ne=he[he.length-1];if(ne&&C.parens===ne.parens+1){et(he.pop());continue}ce({type:"paren",value:X,output:C.parens?")":"\\)"}),U("parens");continue}if(X==="["){if(f.nobracket===!0||!Se().includes("]")){if(f.nobracket!==!0&&f.strictBrackets===!0)throw new SyntaxError(c("closing","]"));X=`\\${X}`}else de("brackets");ce({type:"bracket",value:X});continue}if(X==="]"){if(f.nobracket===!0||W&&W.type==="bracket"&&W.value.length===1){ce({type:"text",value:X,output:`\\${X}`});continue}if(C.brackets===0){if(f.strictBrackets===!0)throw new SyntaxError(c("opening","["));ce({type:"text",value:X,output:`\\${X}`});continue}U("brackets");const ne=W.value.slice(1);if(W.posix!==!0&&ne[0]==="^"&&!ne.includes("/")&&(X=`/${X}`),W.value+=X,O({value:X}),f.literalBrackets===!1||e.hasRegexChars(ne))continue;const De=e.escapeRegex(W.value);if(C.output=C.output.slice(0,-W.value.length),f.literalBrackets===!0){C.output+=De,W.value=De;continue}W.value=`(${g}${De}|${W.value})`,C.output+=W.value;continue}if(X==="{"&&f.nobrace!==!0){de("braces");const ne={type:"brace",value:X,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};Ye.push(ne),ce(ne);continue}if(X==="}"){const ne=Ye[Ye.length-1];if(f.nobrace===!0||!ne){ce({type:"text",value:X,output:X});continue}let De=")";if(ne.dots===!0){const Me=b.slice(),ht=[];for(let Xe=Me.length-1;Xe>=0&&(b.pop(),Me[Xe].type!=="brace");Xe--)Me[Xe].type!=="dots"&&ht.unshift(Me[Xe].value);De=a(ht,f),C.backtrack=!0}if(ne.comma!==!0&&ne.dots!==!0){const Me=C.output.slice(0,ne.outputIndex),ht=C.tokens.slice(ne.tokensIndex);ne.value=ne.output="\\{",X=De="\\}",C.output=Me;for(const Xe of ht)C.output+=Xe.output||Xe.value}ce({type:"brace",value:X,output:De}),U("braces"),Ye.pop();continue}if(X==="|"){he.length>0&&he[he.length-1].conditions++,ce({type:"text",value:X});continue}if(X===","){let ne=X;const De=Ye[Ye.length-1];De&&pt[pt.length-1]==="braces"&&(De.comma=!0,ne="|"),ce({type:"comma",value:X,output:ne});continue}if(X==="/"){if(W.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",b.pop(),W=v;continue}ce({type:"slash",value:X,output:N});continue}if(X==="."){if(C.braces>0&&W.type==="dot"){W.value==="."&&(W.output=k);const ne=Ye[Ye.length-1];W.type="dots",W.output+=X,W.value+=X,ne.dots=!0;continue}if(C.braces+C.parens===0&&W.type!=="bos"&&W.type!=="slash"){ce({type:"text",value:X,output:k});continue}ce({type:"dot",value:X,output:k});continue}if(X==="?"){if(!(W&&W.value==="(")&&f.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){qe("qmark",X);continue}if(W&&W.type==="paren"){const De=oe();let Me=X;(W.value==="("&&!/[!=<:]/.test(De)||De==="<"&&!/<([!=]|\w+>)/.test(Se()))&&(Me=`\\${X}`),ce({type:"text",value:X,output:Me});continue}if(f.dot!==!0&&(W.type==="slash"||W.type==="bos")){ce({type:"qmark",value:X,output:$});continue}ce({type:"qmark",value:X,output:T});continue}if(X==="!"){if(f.noextglob!==!0&&oe()==="("&&(oe(2)!=="?"||!/[!=<:]/.test(oe(3)))){qe("negate",X);continue}if(f.nonegate!==!0&&C.index===0){j();continue}}if(X==="+"){if(f.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){qe("plus",X);continue}if(W&&W.value==="("||f.regex===!1){ce({type:"plus",value:X,output:A});continue}if(W&&(W.type==="bracket"||W.type==="paren"||W.type==="brace")||C.parens>0){ce({type:"plus",value:X});continue}ce({type:"plus",value:A});continue}if(X==="@"){if(f.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){ce({type:"at",extglob:!0,value:X,output:""});continue}ce({type:"text",value:X});continue}if(X!=="*"){(X==="$"||X==="^")&&(X=`\\${X}`);const ne=i.exec(Se());ne&&(X+=ne[0],C.index+=ne[0].length),ce({type:"text",value:X});continue}if(W&&(W.type==="globstar"||W.star===!0)){W.type="star",W.star=!0,W.value+=X,W.output=te,C.backtrack=!0,C.globstar=!0,ae(X);continue}let se=Se();if(f.noextglob!==!0&&/^\([^?]/.test(se)){qe("star",X);continue}if(W.type==="star"){if(f.noglobstar===!0){ae(X);continue}const ne=W.prev,De=ne.prev,Me=ne.type==="slash"||ne.type==="bos",ht=De&&(De.type==="star"||De.type==="globstar");if(f.bash===!0&&(!Me||se[0]&&se[0]!=="/")){ce({type:"star",value:X,output:""});continue}const Xe=C.braces>0&&(ne.type==="comma"||ne.type==="brace"),Ut=he.length&&(ne.type==="pipe"||ne.type==="paren");if(!Me&&ne.type!=="paren"&&!Xe&&!Ut){ce({type:"star",value:X,output:""});continue}for(;se.slice(0,3)==="/**";){const Ht=l[C.index+4];if(Ht&&Ht!=="/")break;se=se.slice(3),ae("/**",3)}if(ne.type==="bos"&&Ie()){W.type="globstar",W.value+=X,W.output=H(f),C.output=W.output,C.globstar=!0,ae(X);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&!ht&&Ie()){C.output=C.output.slice(0,-(ne.output+W.output).length),ne.output=`(?:${ne.output}`,W.type="globstar",W.output=H(f)+(f.strictSlashes?")":"|$)"),W.value+=X,C.globstar=!0,C.output+=ne.output+W.output,ae(X);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&se[0]==="/"){const Ht=se[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(ne.output+W.output).length),ne.output=`(?:${ne.output}`,W.type="globstar",W.output=`${H(f)}${N}|${N}${Ht})`,W.value+=X,C.output+=ne.output+W.output,C.globstar=!0,ae(X+be()),ce({type:"slash",value:"/",output:""});continue}if(ne.type==="bos"&&se[0]==="/"){W.type="globstar",W.value+=X,W.output=`(?:^|${N}|${H(f)}${N})`,C.output=W.output,C.globstar=!0,ae(X+be()),ce({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-W.output.length),W.type="globstar",W.output=H(f),W.value+=X,C.output+=W.output,C.globstar=!0,ae(X);continue}const _e={type:"star",value:X,output:te};if(f.bash===!0){_e.output=".*?",(W.type==="bos"||W.type==="slash")&&(_e.output=K+_e.output),ce(_e);continue}if(W&&(W.type==="bracket"||W.type==="paren")&&f.regex===!0){_e.output=X,ce(_e);continue}(C.index===C.start||W.type==="slash"||W.type==="dot")&&(W.type==="dot"?(C.output+=Q,W.output+=Q):f.dot===!0?(C.output+=I,W.output+=I):(C.output+=K,W.output+=K),oe()!=="*"&&(C.output+=_,W.output+=_)),ce(_e)}for(;C.brackets>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing","]"));C.output=e.escapeLast(C.output,"["),U("brackets")}for(;C.parens>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing",")"));C.output=e.escapeLast(C.output,"("),U("parens")}for(;C.braces>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing","}"));C.output=e.escapeLast(C.output,"{"),U("braces")}if(f.strictSlashes!==!0&&(W.type==="star"||W.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${N}?`}),C.backtrack===!0){C.output="";for(const se of C.tokens)C.output+=se.output!=null?se.output:se.value,se.suffix&&(C.output+=se.suffix)}return C};return u.fastpaths=(l,d)=>{const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n,h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);l=o[l]||l;const{DOT_LITERAL:v,SLASH_LITERAL:b,ONE_CHAR:g,DOTS_SLASH:w,NO_DOT:R,NO_DOTS:k,NO_DOTS_SLASH:A,STAR:N,START_ANCHOR:_}=t.globChars(f.windows),B=f.dot?k:R,z=f.dot?A:R,Q=f.capture?"":"?:",I={negated:!1,prefix:""};let T=f.bash===!0?".*?":N;f.capture&&(T=`(${T})`);const $=K=>K.noglobstar===!0?T:`(${Q}(?:(?!${_}${K.dot?w:v}).)*?)`,L=K=>{switch(K){case"*":return`${B}${g}${T}`;case".*":return`${v}${g}${T}`;case"*.*":return`${B}${T}${v}${g}${T}`;case"*/*":return`${B}${T}${b}${g}${z}${T}`;case"**":return B+$(f);case"**/*":return`(?:${B}${$(f)}${b})?${z}${g}${T}`;case"**/*.*":return`(?:${B}${$(f)}${b})?${z}${T}${v}${g}${T}`;case"**/.*":return`(?:${B}${$(f)}${b})?${v}${g}${T}`;default:{const we=/^(.*?)\.(\w+)$/.exec(K);if(!we)return;const te=L(we[1]);return te?te+v+we[2]:void 0}}},V=e.removePrefix(l,I);let H=L(V);return H&&f.strictSlashes!==!0&&(H+=`${b}?`),H},Wv=u,Wv}var Hv,J1;function oU(){if(J1)return Hv;J1=1;const t=iU(),e=sU(),n=jp(),r=qp(),i=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,a,c=!1)=>{if(Array.isArray(o)){const b=o.map(w=>s(w,a,c));return w=>{for(const R of b){const k=R(w);if(k)return k}return!1}}const u=i(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");const l=a||{},d=l.windows,f=u?s.compileRe(o,a):s.makeRe(o,a,!1,!0),p=f.state;delete f.state;let h=()=>!1;if(l.ignore){const b={...a,ignore:null,onMatch:null,onResult:null};h=s(l.ignore,b,c)}const v=(b,g=!1)=>{const{isMatch:w,match:R,output:k}=s.test(b,f,a,{glob:o,posix:d}),A={glob:o,state:p,regex:f,posix:d,input:b,output:k,match:R,isMatch:w};return typeof l.onResult=="function"&&l.onResult(A),w===!1?(A.isMatch=!1,g?A:!1):h(b)?(typeof l.onIgnore=="function"&&l.onIgnore(A),A.isMatch=!1,g?A:!1):(typeof l.onMatch=="function"&&l.onMatch(A),g?A:!0)};return c&&(v.state=p),v};return s.test=(o,a,c,{glob:u,posix:l}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const d=c||{},f=d.format||(l?n.toPosixSlashes:null);let p=o===u,h=p&&f?f(o):o;return p===!1&&(h=f?f(o):o,p=h===u),(p===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?p=s.matchBase(o,a,c,l):p=a.exec(h)),{isMatch:!!p,match:p,output:h}},s.matchBase=(o,a,c)=>(a instanceof RegExp?a:s.makeRe(a,c)).test(n.basename(o)),s.isMatch=(o,a,c)=>s(a,c)(o),s.parse=(o,a)=>Array.isArray(o)?o.map(c=>s.parse(c,a)):e(o,{...a,fastpaths:!1}),s.scan=(o,a)=>t(o,a),s.compileRe=(o,a,c=!1,u=!1)=>{if(c===!0)return o.output;const l=a||{},d=l.contains?"":"^",f=l.contains?"":"$";let p=`${d}(?:${o.output})${f}`;o&&o.negated===!0&&(p=`^(?!${p}).*$`);const h=s.toRegex(p,a);return u===!0&&(h.state=o),h},s.makeRe=(o,a={},c=!1,u=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(l.output=e.fastpaths(o,a)),l.output||(l=e(o,a)),s.compileRe(l,a,c,u)},s.toRegex=(o,a)=>{try{const c=a||{};return new RegExp(o,c.flags||(c.nocase?"i":""))}catch(c){if(a&&a.debug===!0)throw c;return/$^/}},s.constants=r,Hv=s,Hv}var Vv,Z1;function aU(){if(Z1)return Vv;Z1=1;const t=oU(),e=jp();function n(r,i,s=!1){return i&&(i.windows===null||i.windows===void 0)&&(i={...i,windows:e.isWindows()}),t(r,i,s)}return Object.assign(n,t),Vv=n,Vv}var Q1;function cU(){if(Q1)return Cu;Q1=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.Builder=void 0;const t=Tr,e=rU();var n=null;try{require.resolve("picomatch"),n=aU()}catch{}class r{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:t.sep,filters:[]};globFunction;constructor(s){this.options={...this.options,...s},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(s){return this.options.pathSeparator=s,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(s){return this.options.maxDepth=s,this}withMaxFiles(s){return this.options.maxFiles=s,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:s=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=s,this.withFullPaths()}withAbortSignal(s){return this.options.signal=s,this}normalize(){return this.options.normalizePath=!0,this}filter(s){return this.options.filters.push(s),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(s){return this.options.exclude=s,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(s){return new e.APIBuilder(s||".",this.options)}withGlobFunction(s){return this.globFunction=s,this}crawlWithOptions(s,o){return this.options={...this.options,...o},new e.APIBuilder(s||".",this.options)}glob(...s){return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...o){const a=this.globFunction||n;if(!a)throw new Error("Please specify a glob function to use glob matching.");var c=this.globCache[s.join("\0")];return c||(c=a(s,...o),this.globCache[s.join("\0")]=c),this.options.filters.push(u=>c(u)),this}}return Cu.Builder=r,Cu}var Kv={},eC;function uU(){return eC||(eC=1,Object.defineProperty(Kv,"__esModule",{value:!0})),Kv}var tC;function lU(){return tC||(tC=1,function(t){var e=ku.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),n=ku.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.fdir=void 0;const r=cU();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(uU(),t)}(ku)),ku}var dU=lU();class fU{constructor(){this.encoding="utf-8"}readFile(e){return C0.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await C0.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:Ct.joinPath(e,r.name)}))}}const wt={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},nC={silent:{level:-1},fatal:{level:wt.fatal},error:{level:wt.error},warn:{level:wt.warn},log:{level:wt.log},info:{level:wt.info},success:{level:wt.success},fail:{level:wt.fail},ready:{level:wt.info},start:{level:wt.info},box:{level:wt.info},debug:{level:wt.debug},trace:{level:wt.trace},verbose:{level:wt.verbose}};function Yv(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Xv(t,e,n=".",r){if(!Yv(e))return Xv(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:Yv(o)&&Yv(i[s])?i[s]=Xv(o,i[s],(n?`${n}.`:"")+s.toString()):i[s]=o)}return i}function pU(t){return(...e)=>e.reduce((n,r)=>Xv(n,r,""),{})}const hU=pU();function mU(t){return Object.prototype.toString.call(t)==="[object Object]"}function gU(t){return!(!mU(t)||!t.message&&!t.args||t.stack)}let Jv=!1;const rC=[];let En=class CN{options;_lastLog;_mockFn;constructor(e={}){const n=e.types||nC;this.options=hU({...e,defaults:{...e.defaults},level:Zv(e.level,n),reporters:[...e.reporters||[]]},{types:nC,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const r in n){const i={type:r,...this.options.defaults,...n[r]};this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=Zv(e,this.options.types,this.options.level)}prompt(e,n){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,n)}create(e){const n=new CN({...this.options,...e});return this._mockFn&&n.mockTypes(this._mockFn),n}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const n=this.options.reporters.indexOf(e);if(n!==-1)return this.options.reporters.splice(n,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,n){e&&(e.__write||(e.__write=e.write),e.write=r=>{this[n].raw(String(r).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){Jv=!0}resumeLogs(){Jv=!1;const e=rC.splice(0);for(const n of e)n[0]._logFn(n[1],n[2])}mockTypes(e){const n=e||this.options.mockFn;if(this._mockFn=n,typeof n=="function")for(const r in this.options.types)this[r]=n(r,this.options.types[r])||this[r],this[r].raw=this[r]}_wrapLogFn(e,n){return(...r)=>{if(Jv){rC.push([this,e,r,n]);return}return this._logFn(e,r,n)}}_logFn(e,n,r){if((e.level||0)>this.level)return!1;const i={date:new Date,args:[],...e,level:Zv(e.level,this.options.types)};!r&&n.length===1&&gU(n[0])?Object.assign(i,n[0]):i.args=[...n],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
|
|
164
|
+
`)),i.args.push(`
|
|
165
|
+
`+i.additional.join(`
|
|
166
|
+
`)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";const s=(a=!1)=>{const c=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&c>0){const u=[...this._lastLog.object.args];c>1&&u.push(`(repeated ${c} times)`),this._log({...this._lastLog.object,args:u}),this._lastLog.count=1}a&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);const o=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,o<this.options.throttle)try{const a=JSON.stringify([i.type,i.tag,i.args]),c=this._lastLog.serialized===a;if(this._lastLog.serialized=a,c&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(s,this.options.throttle);return}}catch{}s(!0)}_log(e){for(const n of this.options.reporters)n.log(e,{options:this.options})}};function Zv(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}En.prototype.add=En.prototype.addReporter,En.prototype.remove=En.prototype.removeReporter,En.prototype.clear=En.prototype.removeReporter,En.prototype.withScope=En.prototype.withTag,En.prototype.mock=En.prototype.mockTypes,En.prototype.pause=En.prototype.pauseLogs,En.prototype.resume=En.prototype.resumeLogs;function yU(t={}){return new En(t)}function iC(t){const e=process.cwd()+x0;return t.split(`
|
|
167
|
+
`).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function vU(t,e){return(e.__write||e.write).call(e,t)}const Qv=t=>t?`[${t}]`:"";class sC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return r+iC(e).join(`
|
|
168
|
+
${r}`)}formatError(e,n){const r=e.message??I0(n,e),i=e.stack?this.formatStack(e.stack,n):"",s=n?.errorLevel||0,o=s>0?`${" ".repeat(s)}[cause]: `:"",a=e.cause?`
|
|
169
|
+
|
|
170
|
+
`+this.formatError(e.cause,{...n,errorLevel:s+1}):"";return o+r+`
|
|
171
|
+
`+i+a}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?this.formatError(i,n):i);return I0(n,...r)}formatDate(e,n){return n.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,n){const r=this.formatArgs(e.args,n);return e.type==="box"?`
|
|
172
|
+
`+[Qv(e.tag),e.title&&e.title,...r.split(`
|
|
173
|
+
`)].filter(Boolean).map(i=>" > "+i).join(`
|
|
174
|
+
`)+`
|
|
175
|
+
`:this.filterAndJoin([Qv(e.type),Qv(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return vU(r+`
|
|
176
|
+
`,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}}const{env:Ui={},argv:oC=[],platform:wU=""}=typeof process>"u"?{}:process,bU="NO_COLOR"in Ui||oC.includes("--no-color"),DU="FORCE_COLOR"in Ui||oC.includes("--color"),EU=wU==="win32",aC=Ui.TERM==="dumb",RU=jm&&jm.isatty&&jm.isatty(1)&&Ui.TERM&&!aC,$U="CI"in Ui&&("GITHUB_ACTIONS"in Ui||"GITLAB_CI"in Ui||"CIRCLECI"in Ui),TU=!bU&&(DU||EU&&!aC||RU||$U);function cC(t,e,n,r,i=e.slice(0,Math.max(0,t))+r,s=e.slice(Math.max(0,t+n.length)),o=s.indexOf(n)){return i+(o<0?s:cC(o,s,n,r))}function SU(t,e,n,r,i){return t<0?n+e+r:n+cC(t,e,r,i)+r}function kU(t,e,n=t,r=t.length+1){return i=>i||!(i===""||i===void 0)?SU((""+i).indexOf(e,r),i,t,e,n):""}function Ae(t,e,n){return kU(`\x1B[${t}m`,`\x1B[${e}m`,n)}const uC={reset:Ae(0,0),bold:Ae(1,22,"\x1B[22m\x1B[1m"),dim:Ae(2,22,"\x1B[22m\x1B[2m"),italic:Ae(3,23),underline:Ae(4,24),inverse:Ae(7,27),hidden:Ae(8,28),strikethrough:Ae(9,29),black:Ae(30,39),red:Ae(31,39),green:Ae(32,39),yellow:Ae(33,39),blue:Ae(34,39),magenta:Ae(35,39),cyan:Ae(36,39),white:Ae(37,39),gray:Ae(90,39),bgBlack:Ae(40,49),bgRed:Ae(41,49),bgGreen:Ae(42,49),bgYellow:Ae(43,49),bgBlue:Ae(44,49),bgMagenta:Ae(45,49),bgCyan:Ae(46,49),bgWhite:Ae(47,49),blackBright:Ae(90,39),redBright:Ae(91,39),greenBright:Ae(92,39),yellowBright:Ae(93,39),blueBright:Ae(94,39),magentaBright:Ae(95,39),cyanBright:Ae(96,39),whiteBright:Ae(97,39),bgBlackBright:Ae(100,49),bgRedBright:Ae(101,49),bgGreenBright:Ae(102,49),bgYellowBright:Ae(103,49),bgBlueBright:Ae(104,49),bgMagentaBright:Ae(105,49),bgCyanBright:Ae(106,49),bgWhiteBright:Ae(107,49)};function CU(t=TU){return t?uC:Object.fromEntries(Object.keys(uC).map(e=>[e,String]))}const Rn=CU();function AU(t,e="reset"){return Rn[t]||Rn[e]}const _U=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function Mu(t){return t.replace(new RegExp(_U,"g"),"")}const lC={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},PU={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function xU(t,e={}){const n={...e,style:{...PU,...e.style}},r=t.split(`
|
|
177
|
+
`),i=[],s=AU(n.style.borderColor),o={...typeof n.style.borderStyle=="string"?lC[n.style.borderStyle]||lC.solid:n.style.borderStyle};if(s)for(const p in o)o[p]=s(o[p]);const a=n.style.padding%2===0?n.style.padding:n.style.padding+1,c=r.length+a,u=Math.max(...r.map(p=>p.length))+a,l=u+a,d=n.style.marginLeft>0?" ".repeat(n.style.marginLeft):"";if(n.style.marginTop>0&&i.push("".repeat(n.style.marginTop)),n.title){const p=s?s(n.title):n.title,h=o.h.repeat(Math.floor((u-Mu(n.title).length)/2)),v=o.h.repeat(u-Mu(n.title).length-Mu(h).length+a);i.push(`${d}${o.tl}${h}${p}${v}${o.tr}`)}else i.push(`${d}${o.tl}${o.h.repeat(l)}${o.tr}`);const f=n.style.valign==="center"?Math.floor((c-r.length)/2):n.style.valign==="top"?c-r.length-a:c-r.length;for(let p=0;p<c;p++)if(p<f||p>=f+r.length)i.push(`${d}${o.v}${" ".repeat(l)}${o.v}`);else{const h=r[p-f],v=" ".repeat(a),b=" ".repeat(u-Mu(h).length);i.push(`${d}${o.v}${v}${h}${b}${o.v}`)}return i.push(`${d}${o.bl}${o.h.repeat(l)}${o.br}`),n.style.marginBottom>0&&i.push("".repeat(n.style.marginBottom)),i.join(`
|
|
178
|
+
`)}const Up=Object.create(null),Bu=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Up:globalThis),Gi=new Proxy(Up,{get(t,e){return Bu()[e]??Up[e]},has(t,e){const n=Bu();return e in n||e in Up},set(t,e,n){const r=Bu(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=Bu(!0);return delete n[e],!0},ownKeys(){const t=Bu(!0);return Object.keys(t)}}),IU=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",NU=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function OU(){if(globalThis.process?.env)for(const t of NU){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const dC=OU();dC.name;function Hs(t){return t?t!=="false":!1}const FU=globalThis.process?.platform||"",LU=Hs(Gi.CI)||dC.ci!==!1,MU=Hs(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),BU=Hs(Gi.DEBUG),fC=IU==="test"||Hs(Gi.TEST);Hs(Gi.MINIMAL);const zU=/^win/i.test(FU);!Hs(Gi.NO_COLOR)&&(Hs(Gi.FORCE_COLOR)||(MU||zU)&&Gi.TERM);const qU=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(qU?.split(".")[0]);const jU=globalThis.process||Object.create(null),pC={versions:{}};new Proxy(jU,{get(t,e){if(e==="env")return Gi;if(e in t)return t[e];if(e in pC)return pC[e]}});const UU=globalThis.process?.release?.name==="node",GU=!!globalThis.Bun||!!globalThis.process?.versions?.bun,WU=!!globalThis.Deno,HU=!!globalThis.fastly,VU=!!globalThis.Netlify,KU=!!globalThis.EdgeRuntime,YU=globalThis.navigator?.userAgent==="Cloudflare-Workers",XU=[[VU,"netlify"],[KU,"edge-light"],[YU,"workerd"],[HU,"fastly"],[WU,"deno"],[GU,"bun"],[UU,"node"]];function JU(){const t=XU.find(e=>e[0]);if(t)return{name:t[1]}}const ZU=JU();ZU?.name;function QU({onlyFirst:t=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}const eG=QU();function tG(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(eG,"")}function nG(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function rG(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function iG(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function sG(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function oG(t,{ambiguousAsWide:e=!1}={}){return sG(t),rG(t)||iG(t)||e&&nG(t)?2:1}const aG=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,cG=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},uG=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function lG(t,e={}){if(typeof t!="string"||t.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=e;if(r||(t=tG(t)),t.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:o}of cG.segment(t)){const a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!uG.test(o)){if(aG().test(o)){i+=2;continue}i+=oG(a,s)}}return i}function hC(){const{env:t}=ot,{TERM:e,TERM_PROGRAM:n}=t;return ot.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const dG={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},fG={0:"red",1:"yellow"},pG=hC(),Fr=(t,e)=>pG?t:e,mC={error:Fr("\u2716","\xD7"),fatal:Fr("\u2716","\xD7"),ready:Fr("\u2714","\u221A"),warn:Fr("\u26A0","\u203C"),info:Fr("\u2139","i"),success:Fr("\u2714","\u221A"),debug:Fr("\u2699","D"),trace:Fr("\u2192","\u2192"),fail:Fr("\u2716","\xD7"),start:Fr("\u25D0","o"),log:""};function gC(t){return typeof Intl!="object"||!Intl.Segmenter?Mu(t).length:lG(t)}class hG extends sC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return`
|
|
179
|
+
${r}`+iC(e).map(i=>" "+i.replace(/^at +/,s=>Rn.gray(s)).replace(/\((.+)\)/,(s,o)=>`(${Rn.cyan(o)})`)).join(`
|
|
180
|
+
${r}`)}formatType(e,n,r){const i=dG[e.type]||fG[e.level]||"gray";if(n)return gG(i)(Rn.black(` ${e.type.toUpperCase()} `));const s=typeof mC[e.type]=="string"?mC[e.type]:e.icon||e.type;return s?mG(i)(s):""}formatLogObj(e,n){const[r,...i]=this.formatArgs(e.args,n).split(`
|
|
181
|
+
`);if(e.type==="box")return xU(Gp(r+(i.length>0?`
|
|
182
|
+
`+i.join(`
|
|
183
|
+
`):"")),{title:e.title?Gp(e.title):void 0,style:e.style});const s=this.formatDate(e.date,n),o=s&&Rn.gray(s),a=e.badge??e.level<2,c=this.formatType(e,a,n),u=e.tag?Rn.gray(e.tag):"";let l;const d=this.filterAndJoin([c,Gp(r)]),f=this.filterAndJoin(n.columns?[u,o]:[u]),p=(n.columns||0)-gC(d)-gC(f)-2;if(l=p>0&&(n.columns||0)>=80?d+" ".repeat(p)+f:(f?`${Rn.gray(`[${f}]`)} `:"")+d,l+=Gp(i.length>0?`
|
|
184
|
+
`+i.join(`
|
|
185
|
+
`):""),e.type==="trace"){const h=new Error("Trace: "+e.message);l+=this.formatStack(h.stack||"")}return a?`
|
|
186
|
+
`+l+`
|
|
187
|
+
`:l}}function Gp(t){return t.replace(/`([^`]+)`/gm,(e,n)=>Rn.cyan(n)).replace(/\s+_([^_]+)_\s+/gm,(e,n)=>` ${Rn.underline(n)} `)}function mG(t="white"){return Rn[t]||Rn.white}function gG(t="bgWhite"){return Rn[`bg${t[0].toUpperCase()}${t.slice(1)}`]||Rn.bgWhite}function yC(t={}){let e=yG();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),yU({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...n)=>import("../chunks/prompt.mjs").then(r=>r.prompt(...n)),reporters:t.reporters||[t.fancy??!(LU||fC)?new hG:new sC],...t})}function yG(){return BU?wt.debug:fC?wt.warn:wt.info}yC();const vG=t=>{ew.forEach(e=>{wG(t,e)})},ew=["name","message","stack","cause","errors"],wG=(t,e)=>{const n=tw(t,e);if(n!==void 0){if(bG(n)){Ei(t,e,t[e]);return}DG(n)&&vC(t,e,n)}},tw=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:tw(r,e)},bG=({get:t,set:e})=>t!==void 0&&e===void 0,DG=({enumerable:t,writable:e})=>t||!e,Ei=(t,e,n)=>{vC(t,e,{value:n})},vC=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},EG=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(RG).map(e).filter(Boolean);Ei(t,"errors",n)}else $G(t)?Ei(t,"errors",[]):t.errors!==void 0&&TG(t)},RG=t=>t!==void 0,$G=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),TG=t=>{delete t.errors,t.errors!==void 0&&Ei(t,"errors",[])},SG=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:Ei(t,"cause",n)},kG=t=>CG(t)||AG(t),CG=t=>{try{return t instanceof Error}catch{return!1}},AG=t=>{try{return _G.has(Object.prototype.toString.call(t))}catch{return!1}},_G=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]);function Wp(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const PG=t=>!Object.isExtensible(t)||ew.some(e=>xG(t,e)||IG(t,e)),xG=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},IG=(t,e)=>{try{return t[e],!1}catch{return!0}},nw=t=>{const e=NG(t.message,t.name);Ei(t,"stack",e)},NG=(t="",e="Error")=>{const n=OG(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},OG=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},FG=t=>{const e={};for(const n of LG(t))try{const r=t[n],{enumerable:i,configurable:s,writable:o=!0}=tw(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},LG=t=>{const e=MG(t);for(const n of ew)BG(t,n)&&e.push(n);return e},MG=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},BG=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},wC=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=FG(t),a=zG(n,o),c=GG(e,a);return n===a&&WG(c,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([u,l])=>{HG(c,u,l)}),r===void 0&&nw(c),c},zG=(t,e)=>typeof t=="string"&&t!==""?t:UG(qG(e)),qG=t=>{try{return JSON.stringify(t)}catch{return jG(t)}},jG=t=>{try{return String(t)}catch{return"Invalid error"}},UG=t=>t.length<bC?t:`${t.slice(0,bC)}...`,bC=1e3,GG=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in DC?new DC[t](e):new Error(e),DC={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},WG=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},HG=(t,e,n)=>{n!==void 0&&Ei(t,e,n)},VG=t=>{try{const e=new Error(String(t));return nw(e),e}catch(e){return e}},{toString:KG}=Object.prototype,YG=t=>XG(t)?wC(t):kG(t)?JG(t)?wC(t):t:VG(t),XG=t=>{try{return Wp(t)}catch{return!1}},JG=t=>ZG(t)||PG(t)||QG(t),ZG=t=>{try{return KG.call(t)==="[object Object]"}catch{return!0}},QG=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Hp=(t,{shallow:e=!1}={})=>EC(t,[],e),EC=(t,e,n)=>{if(e.includes(t))return;const r=n?eW:s=>EC(s,[...e,t],n),i=YG(t);return tW(i,r),i},eW=t=>t,tW=(t,e)=>{nW(t),rW(t),iW(t),SG(t,e),EG(t,e),vG(t)},nW=t=>{if(Vp(t.name))return;const e=Object.getPrototypeOf(t).name,n=Vp(e)?e:t.constructor.name;Ei(t,"name",n)},rW=t=>{Vp(t.message)||Ei(t,"message","")},iW=t=>{Vp(t.stack)||nw(t)},Vp=t=>typeof t=="string"&&t!=="",sW=(t,e,n=t.name)=>{if(oW(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},oW=t=>{if(!aW(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!RC(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!cW(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},aW=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,RC=t=>t!==null&&(t.name==="Error"||RC(Object.getPrototypeOf(t))),cW=t=>typeof t.prototype.constructor=="function",$C=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},uW=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(lW(t,e),kC(t,"constructor"),dW(t,e))},lW=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},dW=(t,e)=>{kC(t,"name");const n=TC(e.prototype);t.name!==n&&$C(t,"name",n)},TC=t=>fW(t)??pW(t)??TC(Object.getPrototypeOf(t)),fW=t=>Object.hasOwn(t,"name")&&SC(t.name)?t.name:void 0,pW=t=>typeof t.constructor=="function"&&SC(t.constructor.name)?t.constructor.name:void 0,SC=t=>typeof t=="string"&&t!=="",kC=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},hW=(t,e)=>{if(!mW(t,e))return;const n=yW(t,e);$C(t,"stack",n)},mW=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&gW(),gW=()=>{class t extends Error{}const e={value:CC,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(CC)},CC="SetErrorClassError",yW=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=vW(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},vW=(t,e)=>[[`
|
|
188
|
+
${t}: `,`
|
|
189
|
+
${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],wW=(t,e,n)=>{const r=Hp(t),i=sW(r,e,n);return uW(r,e),hW(r,i),r},bW=(t,e)=>e.configurable===!1?DW(t,e):$W(t,e),DW=(t,e)=>({...e,...EW(t,e),...RW(t,e)}),EW=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},RW=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},$W=(t,e)=>{const n=zu(t.enumerable,e.enumerable,!0),r=zu(t.writable,e.writable,!0),i=zu(t.configurable,e.configurable,!0);return{...TW(t,e,r),enumerable:n,configurable:i}},TW=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!AC(t)&&!AC(e)?{value:e.value,writable:n}:{get:zu(t.get,e.get),set:zu(t.set,e.set)},AC=({get:t,set:e})=>t!==void 0||e!==void 0,zu=(t,e,n)=>t??e??n,SW=(t,e,n)=>{if(!kW(t))throw new TypeError(`Argument must be an object: ${t}`);if(!CW(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return AW(n)},kW=t=>typeof t=="object"&&t!==null,CW=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},AW=t=>{if(!Wp(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,...a}=t,c="value"in t;return _W({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:c}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:c}},_W=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{_C(o,r,"get"),_C(o,i,"set"),rw(t,"enumerable"),rw(e,"writable"),rw(n,"configurable"),xW(s)},_C=(t,e,n)=>{if(PW(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},PW=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},rw=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},xW=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},IW=(t,e,n)=>{const r=SW(t,e,n),i=PC(t,e),s=bW(r,i);return NW(t,e,s),t},PC=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:PC(r,e)},NW=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},OW=(t,e,n)=>{if(n!==void 0)return xC(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return xC(t,e)},xC=(t,e,n)=>{const r=FW(e);IW(t,e,{value:n,...r})},FW=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},LW=t=>MW(t)||BW(t),MW=t=>{try{return t instanceof Error}catch{return!1}},BW=t=>{try{return zW.has(Object.prototype.toString.call(t))}catch{return!1}},zW=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),qW=(t,e,n={})=>{if(IC(t,"First argument"),IC(e,"Second argument"),!Wp(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},IC=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!jW(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},jW=t=>Wp(t)||LW(t),UW=({error:t,props:e,propName:n,soft:r})=>GW(n)||!VW.call(e,n)||r&&t[n]!==void 0,GW=t=>t in WW||HW.has(t),WW=new Error("check"),HW=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:VW}=Object.prototype,KW=(t,e,n)=>{const{soft:r}=qW(t,e,n);for(const i of Reflect.ownKeys(e))YW({error:t,props:e,propName:i,soft:r});return t},YW=({error:t,props:e,propName:n,soft:r})=>{UW({error:t,props:e,propName:n,soft:r})||OW(t,n,e[n])},Kp=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},XW=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Kp(t,"errors",n)},JW=({target:t,source:e,parent:n,child:r})=>{if(!NC(t)){ZW(t,e);return}NC(e)&&Kp(t,"errors",[...r.errors,...n.errors])},ZW=(t,e)=>{e.errors!==void 0&&Kp(t,"errors",e.errors)},NC=t=>t.errors!==void 0&&t.errors.length!==0,QW=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},eH=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?tH({name:t,stack:e,newMessage:n,currentMessage:r}):rH(t,e,n),tH=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=nH(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},nH=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
|
|
190
|
+
${n}`,`
|
|
191
|
+
${e}`],[` ${n}`,` ${e}`],[n,e]],rH=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
|
|
192
|
+
`)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
|
|
193
|
+
`):`${r}${i}
|
|
194
|
+
${e}`},iH=(t,e,n)=>{const r=Hp(t),i=QW(r,e,n);return FC(r,"message",e),sH(r,e,i),r},sH=(t,e,n)=>{if(e===n||!oH())return;const r=eH(t,e,n);FC(t,"stack",r)},oH=()=>{const{stack:t}=new Error(OC);return typeof t=="string"&&t.includes(OC)},OC="set-error-message test message",FC=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},LC=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Hp(t),i=aH(e,r.message);return iH(r,i,n)},aH=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:cH(n,r,t)},cH=(t,e,n)=>t.endsWith(uH)?n.endsWith(lH)?`${t}
|
|
195
|
+
${e}`:`${t} ${e}`:`${e}
|
|
196
|
+
${t}`,uH=":",lH=`
|
|
197
|
+
`,dH=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,LC(n,i,r.message)},fH=(t,e)=>MC(t)===e,MC=t=>typeof t=="object"&&t!==null?t.stack:void 0,pH=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Kp(e,"stack",n.stack),n),hH=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},mH=t=>BC(t,[]).error,BC=(t,e)=>{if(e.includes(t))return{};const n=c=>BC(c,[...e,t]),r=MC(t),i=Hp(t,{shallow:!0}),s=fH(i,r);XW(i,n);const{parent:o,childHasStack:a}=gH(i,n);return{error:o,errorHasStack:s||a}},gH=(t,e)=>{const n=hH(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:yH({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},yH=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=pH({wrap:r,target:i,source:s,childHasStack:n}),a=wW(i,i.constructor,o.name),c=dH({parent:t,child:e,target:a,stackError:o});return JW({target:c,source:s,parent:t,child:e}),KW(c,s,{soft:!r})};function zC(t){return function(e,n){if(typeof n?.toJSON=="function"&&(n=n.toJSON()),!(n!==null&&typeof n=="object"))return n;if(t.has(n))return"[Circular]";t.add(n);const r=Array.isArray(n)?[]:{};for(const[i,s]of Object.entries(n))r[i]=zC(t)(i,s);return t.delete(n),r}}function qC(t,{indentation:e}={}){return JSON.stringify(t,zC(new WeakSet),e)}const vH=t=>t.split(`
|
|
198
|
+
`).map(e=>e.trim().replace("file://",""));function wH(t,e=vH){const n={message:""},r=t.args.find(s=>s instanceof Error);if(!r)return n.message=t.args.map(s=>typeof s=="string"?s:qC(s)).join("; "),typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n;const i=t.args.reduce((s,o)=>{if(o===r)return s;const a=typeof o=="string"?o:qC(o);return LC(s,a)},mH(r));if(n.message=i.message,n.error={message:i.message,name:i.name},i.stack){const s=e(i.stack);n.error.stack=s.join(`
|
|
199
|
+
`),n.message+=`
|
|
200
|
+
`+s.slice(1).map(o=>" "+o).join(`
|
|
201
|
+
`)}return typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n}function bH(t){const e=KN()+x0;return t.split(`
|
|
202
|
+
`).map(n=>n.trim().replace("file://","").replace(e,""))}function DH(t){return wH(t,bH)}const jC=wt.debug,xt=yC({level:jC,defaults:{level:jC},throttle:2,throttleMin:500,formatOptions:{colors:!0,compact:!1,date:!1}}),Fe=xt.withTag("lsp");function UC(t){Fe.error(t)}function ve(t){if(t instanceof Error){Fe.warn(t.stack??t.message);return}Fe.warn(t)}function EH(t){Fe.level=wt[t]}function RH(t){const e={log:(n,r)=>{const{message:i,error:s}=DH(n);switch(n.type){case"silent":break;case"verbose":case"trace":{t.tracer.log(i);break}case"debug":{t.console.debug(i);break}case"log":{t.console.log(i);break}case"info":case"box":case"ready":case"start":case"success":{t.console.info(i);break}case"warn":{t.console.warn(i);break}case"fail":case"error":case"fatal":{t.console.error(i),s?t.telemetry.logEvent({eventName:"error",...s}):t.telemetry.logEvent({eventName:"error",message:i});break}default:Oe(n.type)}}};xt.setReporters([e]),Fe.setReporters(xt.options.reporters)}const $H={fileSystemProvider:()=>new TH};let TH=class extends fU{async readDirectory(e){const n=await new dU.fdir().withSymlinks().withFullPaths().crawl(e.fsPath).withPromise(),r=[];for(const i of n)try{const s=await VN(i);r.push({isFile:s.isFile(),isDirectory:s.isDirectory(),uri:Zt.file(i)})}catch(s){Fe.error(s)}return r}};function GC(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function iw(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function WC(t){return iw(t)||GC(t)}function qu(t){return typeof t=="string"||WC(t)}function SH(t){return Array.isArray(t)&&t.every(qu)}function kH(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function HC(t){if(WC(t))return t;const[e,n,r]=t.split(":");return kH(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function CH(t){if(t.length<2&&(qu(t[0])&&qu(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>HC(e))}const Yp=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function AH(t){return Object.assign(Object.seal(Object.assign({},Yp)),t)}function _H(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function nr(t,...e){return _H(t,...e)}const PH=t=>(...e)=>n=>t(n,...e),xH=t=>({[Symbol.iterator]:t}),yr=PH((t,e)=>Array.from(xH(function*(){for(const n of t)yield e(n)})));class VC{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Qe=VC.prototype.createElement.bind(new VC),IH=/\r?\n/;function vr(t){return e=>e.join(t)}function NH(t){return e=>t+e+t}function Wi(t,e){return n=>t+n+e}function Xp(t){return e=>t+e}const KC=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),Jp=t=>t.split(IH),ju=(t,e,n)=>nr(Jp,yr(Xp(t==="space"?" ".repeat(e):`
|
|
203
|
+
`)),vr(n)),Vs=t=>{switch(t){case"crlf":return`\r
|
|
204
|
+
`;case"lf":return`
|
|
205
|
+
`}},OH={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=Vs(t.endOfLine);return nr(yr(t.print),vr(n),ju(t.indentStyle,t.indentSize,n),Wi(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},FH={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},LH={match(t){return t.type==="Comment"},print(t,e){const n=Vs(t.endOfLine);switch(e.kind){case"Block":return nr(Jp,yr(Xp(" * ")),vr(n),Wi(`/**${n}`,`${n} */`))(e.value);case"Macro":return nr(Jp,yr(Xp("# ")),vr(n))(e.value);case"Slash":default:return nr(Jp,yr(Xp("// ")),vr(n))(e.value)}}},MH={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(Vs(t.endOfLine))}},BH={match(t){return t.type==="Edge"},print(t,e){const n=nr(yr(t.print),vr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),ju(t.indentStyle,t.indentSize,r),Wi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},zH={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;const n=[];if(e.strict&&n.push("strict"),n.push(e.directed?"digraph":"graph"),e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),ju(t.indentStyle,t.indentSize,r),Wi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},qH=nr(KC,NH('"')),jH=Wi("<",">"),UH={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return jH(e.value);case!0:return qH(e.value);case!1:default:return KC(e.value)}}},GH={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),ju(t.indentStyle,t.indentSize,r),Wi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},WH={match(t){return t.type==="NodeRefGroup"},print(t,e){return nr(yr(t.print),vr(" "),Wi("{","}"))(e.children)}},HH={match(t){return t.type==="NodeRef"},print(t,e){const n=[t.print(e.id)];return e.port&&n.push(t.print(e.port)),e.compass&&n.push(t.print(e.compass)),n.join(":")}},VH={match(t){return t.type==="Subgraph"},print(t,e){const n=["subgraph"];if(e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),ju(t.indentStyle,t.indentSize,r),Wi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},KH=[OH,FH,LH,MH,BH,zH,UH,GH,WH,HH,VH];class YH{options;#e=[...KH];constructor(e={}){this.options=e}print(e){const n=[...this.#e],{indentSize:r=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,o={directed:!0,indentSize:r,indentStyle:i,endOfLine:s,print(a){for(const c of n)if(c.match(a))return c.print(o,a);throw Error()}};return o.print(e)}}function XH(t,e){const n=new YH(e).print(t);if(!n)throw new Error;return n}function Zp(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Qe("Attribute",{key:Qe("Literal",{value:t,quoted:!1},[]),value:Qe("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Qe("Attribute",{key:Qe("Literal",{value:t,quoted:!1},[]),value:Qe("Literal",{value:e,quoted:!0},[])},[])}return Qe("Attribute",{key:Qe("Literal",{value:t,quoted:!1},[]),value:Qe("Literal",{value:String(e),quoted:!1},[])},[])}function Ks(t,e){return Qe("Comment",{kind:e,value:t},[])}function YC(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield Zp(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n)}())}const JH={match(t){return t.$$type==="AttributeList"},convert(t,e){return Qe("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>Zp(n,r)))}},ZH={match(t){return t.$$type==="Edge"},convert(t,e){return Qe("Edge",{targets:e.targets.map(n=>iw(n)?Qe("NodeRef",{id:Qe("Literal",{value:n.id,quoted:!0},[])},[]):GC(n)?Qe("NodeRef",{id:Qe("Literal",{value:n.id,quoted:!0},[]),port:n.port?Qe("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Qe("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Qe("NodeRefGroup",{},n.map(r=>iw(r)?Qe("NodeRef",{id:Qe("Literal",{value:r.id,quoted:!0},[])},[]):Qe("NodeRef",{id:Qe("Literal",{value:r.id,quoted:!0},[]),port:r.port?Qe("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Qe("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Ks(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Zp(n,r))])}},QH={match(t){return t.$$type==="Graph"},convert(t,e){return Qe("Dot",{},[...e.comment?[Ks(e.comment,t.commentKind)]:[],Qe("Graph",{directed:e.directed,strict:e.strict,id:e.id?Qe("Literal",{value:e.id,quoted:!0},[]):void 0},YC(t,e))])}},eV={match(t){return t.$$type==="Node"},convert(t,e){return Qe("Node",{id:Qe("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Ks(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Zp(n,r))])}},tV={match(t){return t.$$type==="Subgraph"},convert(t,e){return Qe("Subgraph",{id:e.id?Qe("Literal",{value:e.id,quoted:!0},[]):void 0},YC(t,e))}},nV=[JH,ZH,eV,QH,tV];class rV{options;#e=[...nV];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){for(const o of n)if(o.match(s))return o.convert(i,s);throw Error()}};return i.convert(e)}}function iV(t,e){return new rV(e).convert(t)}const F=new Proxy(Object.freeze({}),{get:(t,e)=>e});class sw{}class ow extends sw{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,n){n!=null&&this.#e.set(e,n)}delete(e){this.#e.delete(e)}apply(e){const n=Array.isArray(e)?e:Object.entries(e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class aw extends ow{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class XC extends ow{#e=Yp;id;comment;attributes=Object.freeze({graph:new aw("Graph"),edge:new aw("Edge"),node:new aw("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=AH(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){const n=new this.#e.Subgraph(...e);return n.with(this.#e),this.addSubgraph(n),n}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,n){const r=new this.#e.Node(e,n);return this.addNode(r),r}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(n=>n.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,n){const r=e.map(s=>SH(s)?CH(s):HC(s)),i=new this.#e.Edge(r,n);return this.addEdge(i),i}subgraph(...e){const n=e.find(o=>typeof o=="string"),r=e.find(o=>typeof o=="object"&&o!==null),i=e.find(o=>typeof o=="function"),s=n?this.getSubgraph(n)??this.createSubgraph(n):this.createSubgraph();return r!==void 0&&s.apply(r),i!==void 0&&i(s),s}node(e,...n){if(typeof e=="string"){const r=e,i=n.find(a=>typeof a=="object"&&a!==null),s=n.find(a=>typeof a=="function"),o=this.getNode(r)??this.createNode(r);return i!==void 0&&o.attributes.apply(i),s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...n){if(Array.isArray(e)){const r=e,i=n.find(a=>typeof a=="object"),s=n.find(a=>typeof a=="function"),o=this.createEdge(r,i);return s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class JC extends XC{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(r=>typeof r=="string"),this.strict=e.find(r=>typeof r=="boolean")??!1;const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}}class sV extends JC{get directed(){return!0}}class oV extends JC{get directed(){return!1}}class aV extends XC{get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(r=>typeof r=="string");const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}}class ZC extends ow{comment}let cV=class extends sw{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new ZC(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class uV extends sw{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(qu(e[0])&&qu(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new ZC(n)}}Object.assign(Yp,{Graph:oV,Digraph:sV,Subgraph:aV,Node:cV,Edge:uV});function QC(t,e){return(...n)=>{const r=t?this.Digraph:this.Graph,i=n.find(c=>typeof c=="string"),s=n.find(c=>typeof c=="object"),o=n.find(c=>typeof c=="function"),a=new r(i,e,s);return a.with(this),typeof o=="function"&&o(a),a}}function eA(t,e=Yp){return Object.freeze({digraph:QC.call(e,!0,t),graph:QC.call(e,!1,t)})}const tA=eA(!1),lV=tA.digraph;tA.graph;const dV=eA(!0);function nA(t,e){const n=iV(t,e?.convert);return XH(n,e?.print)}var cw,rA;function fV(){if(rA)return cw;rA=1;function t(r){let i=r.length-1,s=r[i];for(;s===" "||s===" ";)s=r[--i];return r.substring(0,i+1)}function e(r){return r.split(`
|
|
206
|
+
`).map(o=>t(o)).join(`
|
|
207
|
+
`)}cw=function(r,i){if(i=i||{},r==null)return r;var s=i.width||50,o=typeof i.indent=="string"?i.indent:" ",a=i.newline||`
|
|
208
|
+
`+o,c=typeof i.escape=="function"?i.escape:n,u=".{1,"+s+"}";i.cut!==!0&&(u+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var l=new RegExp(u,"g"),d=r.match(l)||[],f=o+d.map(function(p){return p.slice(-1)===`
|
|
209
|
+
`&&(p=p.slice(0,p.length-1)),c(p)}).join(a);return i.trim===!0&&(f=e(f)),f};function n(r){return r}return cw}var pV=fV();const hV=Ep(pV),Qp={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},r)=>{if(!e)return n*2.55;t/=360,e/=100,n/=100;const i=n<.5?n*(1+e):n+e-n*e,s=2*n-i;switch(r){case"r":return Qp.hue2rgb(s,i,t+1/3)*255;case"g":return Qp.hue2rgb(s,i,t)*255;case"b":return Qp.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),s=Math.min(t,e,n),o=(i+s)/2;if(r==="l")return o*100;if(i===s)return 0;const a=i-s,c=o>.5?a/(2-i-s):a/(i+s);if(r==="s")return c*100;switch(i){case t:return((e-n)/a+(e<n?6:0))*60;case e:return((n-t)/a+2)*60;case n:return((t-e)/a+4)*60;default:return-1}}},mV={clamp:(t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},gV={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},xe={channel:Qp,lang:mV,unit:gV},Hi={};for(let t=0;t<=255;t++)Hi[t]=xe.unit.dec2hex(t);const an={ALL:0,RGB:1,HSL:2};class yV{constructor(){this.type=an.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=an.ALL}is(e){return this.type===e}}class vV{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new yV}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=an.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=xe.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=xe.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=xe.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=xe.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=xe.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=xe.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(an.HSL)&&n!==void 0?n:(this._ensureHSL(),xe.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(an.HSL)&&n!==void 0?n:(this._ensureHSL(),xe.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(an.HSL)&&n!==void 0?n:(this._ensureHSL(),xe.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(an.RGB)&&n!==void 0?n:(this._ensureRGB(),xe.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(an.RGB)&&n!==void 0?n:(this._ensureRGB(),xe.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(an.RGB)&&n!==void 0?n:(this._ensureRGB(),xe.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(an.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(an.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(an.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(an.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(an.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(an.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const uw=new vV({r:0,g:0,b:0,a:0},"transparent"),Jo={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Jo.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,s=i%4===0,o=i>4,a=o?1:17,c=o?8:4,u=s?0:-1,l=o?255:15;return uw.set({r:(r>>c*(u+3)&l)*a,g:(r>>c*(u+2)&l)*a,b:(r>>c*(u+1)&l)*a,a:s?(r&l)*a/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${Hi[Math.round(e)]}${Hi[Math.round(n)]}${Hi[Math.round(r)]}${Hi[Math.round(i*255)]}`:`#${Hi[Math.round(e)]}${Hi[Math.round(n)]}${Hi[Math.round(r)]}`}},Ys={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Ys.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return xe.channel.clamp.h(parseFloat(n)*.9);case"rad":return xe.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return xe.channel.clamp.h(parseFloat(n)*360)}}return xe.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(Ys.re);if(!n)return;const[,r,i,s,o,a]=n;return uw.set({h:Ys._hue2deg(r),s:xe.channel.clamp.s(parseFloat(i)),l:xe.channel.clamp.l(parseFloat(s)),a:o?xe.channel.clamp.a(a?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${xe.lang.round(e)}, ${xe.lang.round(n)}%, ${xe.lang.round(r)}%, ${i})`:`hsl(${xe.lang.round(e)}, ${xe.lang.round(n)}%, ${xe.lang.round(r)}%)`}},Uu={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Uu.colors[t];if(e)return Jo.parse(e)},stringify:t=>{const e=Jo.stringify(t);for(const n in Uu.colors)if(Uu.colors[n]===e)return n}},Gu={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(Gu.re);if(!n)return;const[,r,i,s,o,a,c,u,l]=n;return uw.set({r:xe.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:xe.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:xe.channel.clamp.b(c?parseFloat(a)*2.55:parseFloat(a)),a:u?xe.channel.clamp.a(l?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${xe.lang.round(e)}, ${xe.lang.round(n)}, ${xe.lang.round(r)}, ${xe.lang.round(i)})`:`rgb(${xe.lang.round(e)}, ${xe.lang.round(n)}, ${xe.lang.round(r)})`}},Vi={format:{keyword:Uu,hex:Jo,rgb:Gu,rgba:Gu,hsl:Ys,hsla:Ys},parse:t=>{if(typeof t!="string")return t;const e=Jo.parse(t)||Gu.parse(t)||Ys.parse(t)||Uu.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(an.HSL)||t.data.r===void 0?Ys.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Gu.stringify(t):Jo.stringify(t)},wV=(t,e)=>{const n=Vi.parse(t);for(const r in e)n[r]=xe.channel.clamp[r](e[r]);return Vi.stringify(n)},iA=t=>Vi.format.hex.stringify(Vi.parse(t)),bV=(t,e,n)=>{const r=Vi.parse(t),i=r[e],s=xe.channel.clamp[e](i+n);return i!==s&&(r[e]=s),Vi.stringify(r)},DV=(t,e)=>bV(t,"a",-e),EV=(t,e)=>{const n=Vi.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return wV(t,r)},RV=(t,e)=>{const n=Vi.parse(t),r={},i=(s,o,a)=>o>0?(a-s)*o/100:s*o/100;for(const s in e)r[s]=i(n[s],e[s],xe.channel.max[s]);return EV(t,r)};class $V{value;next;constructor(e){this.value=e}}class TV{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new $V(e);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#n++}dequeue(){const e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}}function lw(t){sA(t);const e=new TV;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(c,u,l)=>{const d=(async()=>c(...l))();u(d);try{await d}catch{}i()},o=(c,u,l)=>{new Promise(d=>{e.enqueue(d)}).then(s.bind(void 0,c,u,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},a=(c,...u)=>new Promise(l=>{o(c,l,u)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(c){sA(c),t=c,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function sA(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var SV=Object.getOwnPropertyNames,kV=Object.getOwnPropertySymbols,CV=Object.prototype.hasOwnProperty;function oA(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function eh(t){return function(e,n,r){if(!e||!n||typeof e!="object"||typeof n!="object")return t(e,n,r);var i=r.cache,s=i.get(e),o=i.get(n);if(s&&o)return s===n&&o===e;i.set(e,n),i.set(n,e);var a=t(e,n,r);return i.delete(e),i.delete(n),a}}function aA(t){return SV(t).concat(kV(t))}var cA=Object.hasOwn||function(t,e){return CV.call(t,e)};function Zo(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var uA="_owner",lA=Object.getOwnPropertyDescriptor,dA=Object.keys;function AV(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function _V(t,e){return Zo(t.getTime(),e.getTime())}function fA(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],p=d[1],h=a.value,v=h[0],b=h[1];!u&&!r[l]&&(u=n.equals(f,v,s,l,t,e,n)&&n.equals(p,b,f,v,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function PV(t,e,n){var r=dA(t),i=r.length;if(dA(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===uA&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!cA(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Wu(t,e,n){var r=aA(t),i=r.length;if(aA(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===uA&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!cA(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=lA(t,s),a=lA(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function xV(t,e){return Zo(t.valueOf(),e.valueOf())}function IV(t,e){return t.source===e.source&&t.flags===e.flags}function pA(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function NV(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var OV="[object Arguments]",FV="[object Boolean]",LV="[object Date]",MV="[object Map]",BV="[object Number]",zV="[object Object]",qV="[object RegExp]",jV="[object Set]",UV="[object String]",GV=Array.isArray,hA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,mA=Object.assign,WV=Object.prototype.toString.call.bind(Object.prototype.toString);function HV(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(u,l,d){if(u===l)return!0;if(u==null||l==null||typeof u!="object"||typeof l!="object")return u!==u&&l!==l;var f=u.constructor;if(f!==l.constructor)return!1;if(f===Object)return i(u,l,d);if(GV(u))return e(u,l,d);if(hA!=null&&hA(u))return c(u,l,d);if(f===Date)return n(u,l,d);if(f===RegExp)return o(u,l,d);if(f===Map)return r(u,l,d);if(f===Set)return a(u,l,d);var p=WV(u);return p===LV?n(u,l,d):p===qV?o(u,l,d):p===MV?r(u,l,d):p===jV?a(u,l,d):p===zV?typeof u.then!="function"&&typeof l.then!="function"&&i(u,l,d):p===OV?i(u,l,d):p===FV||p===BV||p===UV?s(u,l,d):!1}}function VV(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Wu:AV,areDatesEqual:_V,areMapsEqual:r?oA(fA,Wu):fA,areObjectsEqual:r?Wu:PV,arePrimitiveWrappersEqual:xV,areRegExpsEqual:IV,areSetsEqual:r?oA(pA,Wu):pA,areTypedArraysEqual:r?Wu:NV};if(n&&(i=mA({},i,n(i))),e){var s=eh(i.areArraysEqual),o=eh(i.areMapsEqual),a=eh(i.areObjectsEqual),c=eh(i.areSetsEqual);i=mA({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function KV(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function YV(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(a,c){var u=r(),l=u.cache,d=l===void 0?e?new WeakMap:void 0:l,f=u.meta;return n(a,c,{cache:d,equals:i,meta:f,strict:s})};if(e)return function(a,c){return n(a,c,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(a,c){return n(a,c,o)}}var XV=Ki();Ki({strict:!0}),Ki({circular:!0}),Ki({circular:!0,strict:!0}),Ki({createInternalComparator:function(){return Zo}}),Ki({strict:!0,createInternalComparator:function(){return Zo}}),Ki({circular:!0,createInternalComparator:function(){return Zo}}),Ki({circular:!0,createInternalComparator:function(){return Zo},strict:!0});function Ki(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=VV(t),c=HV(a),u=r?r(c):KV(c);return YV({circular:n,comparator:c,createState:i,equals:u,strict:o})}function gA(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:o,y:a,width:c,height:u}=s;return{...i,width:c,height:u,position:[o,a]}}),r=t.edges.map(i=>{const s=e.edges[i.id];return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const yA=(t,e)=>t.width>e.width+10||t.height>e.height+10;function JV(t,e){if(t.hash===e.hash)return{diagram:gA(t,e)};if(XV(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||yA(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||!!r.labelBBox&&!!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:gA(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const o={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||yA(i,s)||(o.fixedsize={width:s.width,height:s.height}),r.push(o),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:Fp(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function Un(t){return t.children.length>0}function cn(t){switch(t){case"open":return"vee";default:return t}}function Lr(t){return Array.isArray(t)?[Lr(t[0]),Lr(t[1])]:(Ce(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const vA=t=>(Ce(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),ft=t=>Math.ceil(t/72*1e3)/1e3,Gn=t=>Math.ceil(t);Gn(40).toString();function wA(t,e){return iA(RV(t,{l:-35-5*e,s:-15-5*e}))}function ZV(t){return iA(DV(t,.3))}function QV(t){return t.trim().replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function dw(t,e,n){let r=hV(t,{width:e,indent:"",escape:QV}).split(`
|
|
210
|
+
`);return Qt(n)&&n>0&&r.length>n&&(r=r.slice(0,n-1)),r}function Xs({text:t,maxchars:e,fontsize:n,maxLines:r,bold:i,color:s}){let o=dw(t,e,r).join("<BR/>");i&&(o=`<B>${o}</B>`);const a=s?` COLOR="${s}"`:"";return`<FONT POINT-SIZE="${Gn(n)}"${a}>${o}</FONT>`}function eK(t,e){const n=ue(t.icon),r=[Xs({text:t.title,fontsize:19,maxchars:35,maxLines:3})];if(ue(t.technology)&&r.push(Xs({text:t.technology,fontsize:12,maxchars:n?35:45,maxLines:1,color:e.loContrast})),ue(t.description)&&r.push(Xs({text:t.description,fontsize:14,maxchars:n?35:45,maxLines:5,color:e.loContrast})),r.length===1&&!n)return`<${r[0]}>`;const i=n?(s,o,a)=>{let c=`<TD ALIGN="TEXT" BALIGN="LEFT">${s}</TD>`;if(o===0){const u=a.length>1?` ROWSPAN="${a.length}"`:"";let l=76;(t.shape==="queue"||t.shape==="mobile")&&(l+=20),c=`<TD${u} WIDTH="${l}"> </TD>${c}`,c=`${c}<TD${u} WIDTH="16"> </TD>`}return`<TR>${c}</TR>`}:s=>`<TR><TD>${s}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="6">${r.map(i).join("")}</TABLE>>`}function tK(t,e){const n=Xs({text:t.title.toUpperCase(),maxchars:50,fontsize:11,maxLines:1,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const Hu=40,fw=`BGCOLOR="${cr.relationships[ka].labelBgColor}A0"`;function bA({label:t,technology:e}){const n=[];if(ue(t)&&n.push(Xs({text:t,maxchars:Hu,fontsize:14,maxLines:5,bold:t==="[...]"})),ue(e)&&n.push(Xs({text:`[ ${e} ]`,fontsize:12,maxLines:1,maxchars:Hu})),n.length===0)return null;const r=n.map(i=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${i}</TD></TR>`).join("");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${fw}>${r}</TABLE>>`}function nK(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${fw}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${Gn(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ue(e)?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${fw} CELLPADDING="2">`,Xs({text:e,maxchars:Hu,fontsize:14}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}const pw="dashed",hw=cr.font;class mw{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(Un).map(i=>i.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(i=>this.compoundIds.has(i.source)||this.compoundIds.has(i.target)).map(i=>i.id):[]);const n=new Map;for(const i of e.edges)n.set(i.id,n2(i.source,i.target));this.edgeDistances=n;const r=this.graphvizModel=this.createGraph();this.applyNodeAttributes(r.attributes.node),this.applyEdgeAttributes(r.attributes.edge)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;edgeDistances;graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}postBuild(e){}build(e){const n=(i,s)=>{const o=this.nodeId(i),a=this.elementToSubgraph(i,s.subgraph(o));this.subgraphs.set(i.id,a);for(const c of i.children){const u=this.viewElement(c);if(Un(u))n(u,a);else{const l=fn(this.getGraphNode(u.id),`Graphviz Node not found for ${u.id}`);a.node(l.id)}}},r=[];for(const i of this.view.nodes)if(Un(i))Et(i.parent)&&r.push(i);else{const s=this.nodeId(i),o=this.elementToNode(i,e.node(s));this.nodes.set(i.id,o)}for(const i of r)n(i,e);for(const i of this.view.edges){const s=this.addEdge(i,e);s&&this.edges.set(i.id,s)}}print(){const e=this.graphvizModel;return this.build(e),this.postBuild(e),nA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){const e=this.view.autoLayout,n=lV({[F.bgcolor]:"transparent",[F.layout]:"dot",[F.compound]:!0,[F.rankdir]:e.direction,[F.TBbalance]:"min",[F.splines]:"spline",[F.outputorder]:"nodesfirst",[F.nodesep]:ft(e.nodeSep??110),[F.ranksep]:ft(e.rankSep??120),[F.pack]:Gn(e.rankSep??120),[F.packmode]:"array_3",[F.pad]:ft(15),[F.fontname]:hw});return n.attributes.graph.apply({[F.fontsize]:Gn(15),[F.labeljust]:e.direction==="RL"?"r":"l",[F.labelloc]:e.direction==="BT"?"b":"t",[F.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[F.fontname]:hw,[F.shape]:"rect",[F.width]:ft(320),[F.height]:ft(180),[F.style]:"filled",[F.penwidth]:0})}applyEdgeAttributes(e){e.apply({[F.arrowsize]:.75,[F.fontname]:hw,[F.fontsize]:Gn(14),[F.penwidth]:Gn(2),[F.color]:cr.relationships[ka].lineColor,[F.fontcolor]:cr.relationships[ka].labelColor})}checkNodeId(e,n=!1){return n?e="cluster_"+e:e.toLowerCase().startsWith("cluster")&&(e="nd_"+e),this.ids.has(e)?null:(this.ids.add(e),e)}nodeId(e){const n=Un(e);let r=Ca(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;let s=e.id,o;for(;o=Aa(s);){if(r=Ca(o).toLowerCase()+"_"+r,i=this.checkNodeId(r,n),i!==null)return i;s=o}r=Ca(e.id).toLowerCase();let a=1;do i=this.checkNodeId(r+"_"+a++,n);while(i===null);return i}elementToSubgraph(e,n){Ce(Un(e),"node should be compound"),Ce(Np(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=ZV(r.loContrast);return n.apply({[F.likec4_id]:e.id,[F.likec4_level]:e.level,[F.likec4_depth]:e.depth,[F.fillcolor]:wA(r.fill,e.depth),[F.color]:wA(r.stroke,e.depth),[F.style]:"filled",[F.margin]:Gn(e.children.length>1?40:32)}),Fs(e.title.trim())||n.set(F.label,tK(e,i)),n}elementToNode(e,n){Ce(!Un(e),"node should not be compound");const r=ue(e.icon),i=this.getElementColorValues(e.color);switch(n.attributes.apply({[F.likec4_id]:e.id,[F.likec4_level]:e.level,[F.fillcolor]:i.fill,[F.fontcolor]:i.hiContrast,[F.color]:i.stroke,[F.margin]:`${ft(r?10:26)},${ft(26)}`}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[F.margin]:`${ft(r?10:26)},${ft(0)}`,[F.penwidth]:Gn(2),[F.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[F.margin]:`${ft(r?10:30)},${ft(32)}`});break}case"mobile":{n.attributes.apply({[F.margin]:`${ft(r?10:30)},${ft(26)}`});break}case"queue":{n.attributes.apply({[F.width]:ft(320),[F.height]:ft(165),[F.margin]:`${ft(r?10:30)},${ft(26)}`});break}}return n.attributes.set(F.label,eK(e,i)),n}leafElements(e){return e===null?this.view.nodes.filter(n=>!Un(n)):this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return Un(r)?this.leafElements(r.id):r})}descendants(e){return e===null?this.view.nodes.slice():this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return[r,...this.descendants(r.id)]})}viewElement(e){return fn(this.view.nodes.find(n=>n.id===e),`Node ${e} not found`)}getGraphNode(e){return this.nodes.get(e)??null}getSubgraph(e){return this.subgraphs.get(e)??null}edgeEndpoint(e,n){let r=this.viewElement(e),i=this.getGraphNode(e),s;return i||(Ce(Un(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,Ce(s,`subgraph ${e} not found`),r=fn(n(this.leafElements(e)),`leaf element in ${e} not found`),i=fn(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}findInternalEdges(e){if(e===null)return this.view.edges.slice();const n=this.viewElement(e);return tt(this.descendants(e),zi(r=>KS(r.inEdges,r.outEdges)),Tv(),u9(KS(n.inEdges,n.outEdges)),vn(r=>this.view.edges.find(i=>i.id===r)),Ve(ue))}withoutCompoundEdges(e){return this.edgesWithCompounds.size===0?e:{...e,inEdges:e.inEdges.filter(n=>!this.edgesWithCompounds.has(n)),outEdges:e.outEdges.filter(n=>!this.edgesWithCompounds.has(n))}}assignGroups(){const e=tt(this.view.nodes,Ve(Un),vn(r=>r.id),jS(Vd),US(),vn(r=>{const i=this.findInternalEdges(r).filter(s=>s.source!==s.target&&!this.compoundIds.has(s.source)&&!this.compoundIds.has(s.target));return{id:r,edges:i}}),Ve(({edges:r})=>r.length>1&&r.length<8),Tj(4)),n=new Set;for(const r of e){const i=r.edges.filter(s=>!n.has(s.source)&&!n.has(s.target));for(const s of i)try{const o=fn(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=fn(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),o.attributes.set(F.group,r.id),a.attributes.set(F.group,r.id)}catch(o){xt.error(o)}}}applyManualLayout({height:e,...n}){const r=n.x<0?-n.x:0,i=n.y<0?-n.y:0,s=r>0||i>0;for(const{id:o,...a}of n.nodes){const c=this.getGraphNode(o);if(!c)continue;const u=ft(a.center.x)+r,l=ft(e-a.center.y);a.fixedsize?c.attributes.apply({[F.pos]:`${u},${l}!`,[F.pin]:!0,[F.width]:ft(a.fixedsize.width),[F.height]:ft(a.fixedsize.height),[F.fixedsize]:!0}):c.attributes.set(F.pos,`${u},${l}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(F.weight),a.attributes.delete(F.minlen),a.attributes.delete(F.constraint);const c=n.edges.find(u=>u.id===o)?.dotpos;c&&!s&&a.attributes.set(F.pos,c)}return this.graphvizModel.apply({[F.layout]:"fdp",[F.overlap]:"vpsc",[F.sep]:"+50,50",[F.esep]:"+10,10",[F.start]:"random2",[F.splines]:"compound"}),this.graphvizModel.delete(F.compound),this.graphvizModel.delete(F.rankdir),this.graphvizModel.delete(F.nodesep),this.graphvizModel.delete(F.ranksep),this.graphvizModel.delete(F.pack),this.graphvizModel.delete(F.pad),this.graphvizModel.delete(F.packmode),this.graphvizModel.attributes.graph.delete(F.margin),this}getRelationshipColorValues(e){return J0(e)?cr.relationships[e]:this.view.customColorDefinitions[e]?.relationships??cr.relationships[M0]}getElementColorValues(e){return J0(e)?cr.elements[e]:this.view.customColorDefinitions[e]?.elements??cr.elements[M0]}}class rK extends mw{createGraph(){const e=super.createGraph(),n=this.view.autoLayout;return e.delete(F.TBbalance),e.apply({[F.nodesep]:ft(n.nodeSep??130),[F.ranksep]:ft(n.rankSep??130)}),e}postBuild(e){tt(this.view.nodes,vn(n=>({node:n,graphvizNode:this.getGraphNode(n.id)})),Ls(({node:n,graphvizNode:r})=>{if(r!=null)return Kd.modelRef(n)??void 0}),Gc(),Ve(Hc(2)),Kj(n=>{e.subgraph({[F.rank]:"same"},r=>{for(const{graphvizNode:i}of n)r.node(fn(i).id)})}),Aj(()=>{e.set(F.newrank,!0),e.set(F.clusterrank,"global"),e.delete(F.pack),e.delete(F.packmode)}))}elementToSubgraph(e,n){const r=super.elementToSubgraph(e,n);return e.children.length>1&&r.set(F.margin,Gn(50)),r}addEdge(e,n){const[r,i]=[e.source,e.target],[s,o,a]=this.edgeEndpoint(r,w=>Kc(w)),[c,u,l]=this.edgeEndpoint(i,Vo),d=on(l)||on(a),f=n.edge([o,u],{[F.likec4_id]:e.id,[F.style]:e.line??pw});l&&f.attributes.set(F.lhead,l),a&&f.attributes.set(F.ltail,a);const p=this.edgeDistances.get(e.id)??0,h=[...s.inEdges,...s.outEdges,...c.inEdges,...c.outEdges].reduce((w,R)=>Math.max(w,this.edgeDistances.get(R)??0),0);h-p>1&&f.attributes.set(F.weight,h-p);const v=bA(e);if(v&&f.attributes.set(d?F.xlabel:F.label,v),e.color){const w=this.getRelationshipColorValues(e.color);f.attributes.apply({[F.color]:w.lineColor,[F.fontcolor]:w.labelColor})}let[b,g]=[e.head??ms,e.tail??"none"];return b==="none"&&g==="none"?(f.attributes.apply({[F.arrowtail]:"none",[F.arrowhead]:"none",[F.dir]:"none"}),f):e.dir==="both"?(f.attributes.apply({[F.arrowhead]:cn(b),[F.arrowtail]:cn(e.tail??b),[F.dir]:"both"}),!d&&Kd.modelRef(s)!==Kd.modelRef(c)&&f.attributes.set(F.constraint,!1),f):(b!==ms&&f.attributes.set(F.arrowhead,cn(b)),g!=="none"&&f.attributes.set(F.arrowtail,cn(g)),f)}}class S0 extends mw{static toDot(e){return new S0(e).print()}postBuild(e){e.set(F.TBbalance,"max"),L0(this.edgesWithCompounds,n=>this.view.edges.some(r=>r.id===n&&r.label))&&(e.delete(F.pack),e.delete(F.packmode))}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,k=>Kc(k)),[u,l,d]=this.edgeEndpoint(s,Vo),f=n.edge([a,l],{[F.likec4_id]:e.id,[F.style]:e.line??pw});if(d&&f.attributes.set(F.lhead,d),c&&f.attributes.set(F.ltail,c),e.color&&e.color!==ka){const k=this.getRelationshipColorValues(e.color);f.attributes.apply({[F.color]:k.lineColor,[F.fontcolor]:k.labelColor})}const p=t2(e.id),h=nK(p,e.label?.trim());f.attributes.set(F.label,h);const v=this.edgeDistances.get(e.id)??0,b=[...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].reduce((k,A)=>Math.max(k,this.edgeDistances.get(A)??0),0);b-v>1&&f.attributes.set(F.weight,b-v);const g=r.findIndex(k=>k.id===i);r.findIndex(k=>k.id===s)<g&&e.dir!=="back"&&f.attributes.apply({[F.constraint]:!1});let[w,R]=[e.head??ms,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[F.arrowtail]:cn(w),[F.minlen]:0,[F.dir]:"back"}),R!=="none"&&f.attributes.apply({[F.arrowhead]:cn(R),[F.dir]:"both"}),f):w==="none"&&R==="none"||w!=="none"&&R!=="none"?(f.attributes.apply({[F.arrowhead]:cn(w),[F.arrowtail]:cn(R),[F.dir]:"both"}),f):w==="none"?(f.attributes.delete(F.arrowhead),f.attributes.apply({[F.arrowtail]:cn(R),[F.minlen]:0,[F.dir]:"back"}),f):(w!==ms&&f.attributes.set(F.arrowhead,cn(w)),f)}}class iK extends mw{postBuild(e){this.assignGroups();const n=new Set,r=this.view.nodes.reduce((i,s)=>(Un(s)&&(n.add(s.id),i.push(s)),i),[]);for(const i of r){const s=tt(i.children,Ve(u=>!this.compoundIds.has(u)),vn(u=>this.viewElement(u)),Ve(u=>u.inEdges.length===0&&u.outEdges.length===0));if(s.length<=2)continue;let o=2;switch(!0){case s.length>11:o=4;break;case s.length>4:o=3;break}const a=fn(this.getSubgraph(i.id),`Subgraph not found for ${i.id}`);let c=null;p9(s,o).forEach(u=>{const l=u.length>1?a.createSubgraph({[F.rank]:"same"}):null;u.forEach((d,f)=>{const p=this.getGraphNode(d.id);p&&(l?.node(p.id),f===0&&(c&&a.edge([c,p],{[F.style]:"invis"}),c=p))})})}L0(this.edgesWithCompounds,i=>this.view.edges.some(s=>s.id===i&&s.label))&&(e.delete(F.pack),e.delete(F.packmode))}addEdge(e,n){const r=this.view.edges,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,A=>Kc(A)),[u,l,d]=this.edgeEndpoint(s,Vo),f=e.parent,p=n.edge([a,l],{[F.likec4_id]:e.id,[F.style]:e.line??pw});d&&p.attributes.set(F.lhead,d),c&&p.attributes.set(F.ltail,c);const h=on(d)||on(c),v=this.edgeDistances.get(e.id)??0,b=[...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].reduce((A,N)=>Math.max(A,this.edgeDistances.get(N)??0),0);b-v>1&&p.attributes.set(F.weight,b-v);const g=bA(e);if(g&&p.attributes.set(h?F.xlabel:F.label,g),e.color){const A=this.getRelationshipColorValues(e.color);p.attributes.apply({[F.color]:A.lineColor,[F.fontcolor]:A.labelColor})}let[w,R]=[e.head??ms,e.tail??"none"];if(e.dir==="back")return p.attributes.apply({[F.arrowtail]:cn(w),[F.dir]:"back"}),R!=="none"&&p.attributes.apply({[F.arrowhead]:cn(R),[F.dir]:"both",[F.minlen]:0}),p;if(w==="none"&&R==="none")return p.attributes.apply({[F.arrowtail]:"none",[F.arrowhead]:"none",[F.dir]:"none",[F.minlen]:0,[F.constraint]:!1}),p;if(w!=="none"&&R!=="none")return p.attributes.apply({[F.arrowhead]:cn(w),[F.arrowtail]:cn(R),[F.dir]:"both",[F.minlen]:0}),p;if(w!==ms&&p.attributes.set(F.arrowhead,cn(w)),R!=="none"&&p.attributes.set(F.arrowtail,cn(R)),r.length===1)return p;let k;return f===null&&o.parent==null&&u.parent==null?k=r.filter(A=>{if(A.id===e.id||A.parent!==null||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)return!1;const N=this.viewElement(A.source),_=this.viewElement(A.target);return Un(N)||Un(_)?!1:N.parent==null&&_.parent==null}):k=this.findInternalEdges(f).filter(A=>!(A.id===e.id||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)),k.length===0&&(f===null||this.leafElements(f).length<=3)&&p.attributes.set(F.minlen,0),p}}function th(t){const[e,n,r,i]=t?t.split(",").map(a=>Lr(+a)):[0,0,0,0],s=Math.round(r-e),o=Math.round(n-i);return{x:Math.round(e),y:Math.round(i),width:s,height:o}}function sK(t){try{const[e,n]=t.split(",");return{x:Lr(parseFloat(e)),y:Lr(parseFloat(n))}}catch(e){throw new Error(`Failed on parsing pos: ${t}`,{cause:e})}}function DA(t){const{x:e,y:n}=sK(t.pos),r=vA(parseFloat(t.width)),i=vA(parseFloat(t.height));return{x:e-Math.round(r/2),y:n-Math.round(i/2),width:r,height:i}}function EA(t,[e,n]=[0,0]){if(!t||t.length===0)return null;let r=1/0,i=1/0,s=-1/0,o=-1/0,a=13;try{for(const u of t){if(u.op==="F"){a=Lr(u.size);continue}if(u.op==="T"){let l=Lr(u.pt[0])-e,d=Lr(u.width);switch(u.align){case"r":l-=d;break;case"c":l-=Math.round(d/2);break}r=Math.min(r,l),s=Math.max(s,l+d);let f=Lr(u.pt[1])-n;i=Math.min(i,Math.round(f-a)),o=Math.max(o,f)}}}catch(u){return xt.warn(`Failed on parsing label draw ops: ${u}
|
|
211
|
+
${JSON.stringify(t,null,2)}`),null}if(r===1/0)return null;const c=2;return{x:r-c,y:i-c,width:s-r+2*c,height:o-i+2*c}}function RA({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");Ce(Hc(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&xt.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>Lr(s));return Ce(Hc(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw new Error(`failed on parsing view ${n} edge ${e} _draw_:
|
|
212
|
+
${JSON.stringify(t,null,2)}`,{cause:r})}}function oK(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},c){const u=EA(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s?dw(s,Hu).join(`
|
|
213
|
+
`):null,o=o?dw(o,Hu).join(`
|
|
214
|
+
`):void 0,{id:e,source:n,target:r,label:s,...ue(o)&&{description:o},...ue(t.pos)&&{dotpos:t.pos},points:RA(t,c),labelBBox:u,...l?{dir:"back"}:{},...a}}function $A(t,e){const n=JSON.parse(t),r=th(n.bb),{nodes:i,edges:s,manualLayout:o,...a}=e,c={...a,bounds:r,nodes:[],edges:[]},u=n.objects??[];for(const d of i){const f=u.find(p=>p.likec4_id===d.id);Ce(f,`View ${a.id} node ${d.id} not found in graphviz output`);try{const{x:p,y:h,width:v,height:b}="bb"in f?th(f.bb):DA(f),g=[p,h];c.nodes.push({...d,position:g,width:v,height:b,labelBBox:EA(f._ldraw_,g)??{x:p,y:h,width:v,height:b}})}catch(p){throw new Error(`Failed on parsing node ${d.id}:
|
|
215
|
+
${JSON.stringify(f,null,2)}`,{cause:p})}}const l=n.edges??[];for(const d of s){const f=l.find(p=>p.likec4_id===d.id);if(!f){xt.warn(`View ${a.id} edge ${d.id} not found in graphviz output, skipping`);continue}c.edges.push(oK(f,d,a.id))}return c}const nh=t=>String(t+1).padStart(2,"0");function aK(t){const e=JSON.parse(t),n=th(e.bb),r={nodes:[],edges:[],bounds:n},i=new Map,s=e.objects??[];for(const o of s){if(!o.likec4_type)continue;const a=nh(o._gvid),c=o.likec4_path??"",u=i.get(o._gvid),{x:l,y:d,width:f,height:p}="bb"in o?th(o.bb):DA(o),h={x:l,y:d};if(o.likec4_type==="view")Ce(o.likec4_id,`View ${o} has no likec4_id`),r.nodes.push({id:a,type:"view",parentId:u?.id??null,height:p,width:f,position:h,label:o.label??"",viewId:o.likec4_id});else{const v={id:a,type:o.likec4_type,parentId:u?.id??null,height:p,width:f,position:h,path:c,label:o.label??""},b=[..."subgraphs"in o?o.subgraphs:[],..."nodes"in o?o.nodes:[]];for(const g of b)i.set(g,v);r.nodes.push(v)}}for(const o of e.edges??[])try{const a=nh(o.tail),c=nh(o.head);r.edges.push({id:`link${nh(o._gvid)}`,source:a,target:c,points:RA(o)})}catch(a){xt.warn(a)}return r}const TA=cr.font,rh="/";class k0{static toDot(e){return new k0(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=dV.graph({[F.layout]:"osage",[F.pack]:Gn(100),[F.packmode]:"array_ltc",[F.pad]:ft(15),[F.fontname]:TA,[F.splines]:"polyline",[F.esep]:"+20"});n.attributes.graph.apply({[F.fontsize]:Gn(20),[F.labeljust]:"l",[F.labelloc]:"t"}),n.attributes.node.apply({[F.fontname]:TA,[F.shape]:"rect",[F.width]:ft(400),[F.height]:ft(300),[F.fixedsize]:!0,[F.fontsize]:10}),n.attributes.edge.apply({[F.penwidth]:Gn(2)});const r=new Set(e.map(c=>c.relativePath??""));let i=0,s=[...e];const o=r.size>1;o&&s.sort((c,u)=>{const l=c.relativePath?.split(rh)??[""],d=u.relativePath?.split(rh)??[""];l.push(c.title??"Untitled"),d.push(u.title??"Untitled");const f=l.length,p=d.length;switch(i=Math.max(i,f,p),!0){case f>p:return-1;case f<p:return 1;default:{for(let h=0;h<f;h++){const v=l[h].localeCompare(d[h]);if(v!==0)return v}return 0}}});const a=new Map;s.forEach((c,u)=>{this.addView(o?c:{...c,relativePath:""},u+i);const l=c.nodes.reduce((d,f)=>(f.navigateTo&&d.add(f.navigateTo),d),new Set);l.size>0&&a.set(c.id,l)});for(const[c,u]of a)for(const l of u)n.edge([c,l])}getParentForPath(e){if(e==="")return this.graphvizModel;const n=e.toLowerCase();let r=this.subgraphs.get(n);if(!r){const i=n.endsWith(".c4")||n.endsWith(".likec4"),s=e.includes(rh)?e.slice(0,e.lastIndexOf(rh)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[F.likec4_type]:i?"file":"folder",[F.likec4_path]:e,[F.sortv]:this.subgraphs.size,[F.label]:ue(s)?e.slice(s.length+1):e}),this.subgraphs.set(n,r)}return r}addView(e,n=0){return this.getParentForPath(e.relativePath??"").node(e.id,{[F.likec4_type]:"view",[F.likec4_id]:e.id,[F.sortv]:n,[F.label]:e.title||"Untitled"})}print(){return nA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const SA=t=>{switch(!0){case Sa.isDynamic(t):return new S0(t);case Sa.isDeployment(t):return new rK(t);case Sa.isElement(t):return new iK(t);default:Oe(t)}};class kA{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async layout(e){try{let n=await this.dot(e);const r=await this.graphviz.layoutJson(n);let i=$A(r,e);if(e.manualLayout){const s=JV(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=SA(e);if(o.hasEdgesWithCompounds)xt.warn(`Manual layout for view ${e.id} is ignored, as edges with compounds are not supported`);else{o.applyManualLayout(s.relayout);const a=await this.graphviz.layoutJson(o.print());i=$A(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
|
|
216
|
+
`).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
|
|
217
|
+
`),{dot:n,diagram:i}}catch(n){throw new Error(`Error during layout: ${e.id}`,{cause:n})}}async svg(e){let n=await this.dot(e);return n=n.split(`
|
|
218
|
+
`).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
|
|
219
|
+
`),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=SA(e).print();if(!Sa.isElement(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return xt.warn(`Error during unflatten: ${e.id}`,r),n}}async layoutOverviewGraph(e){if(e.length===0)return Promise.resolve({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}});const n=k0.toDot(e),r=await this.graphviz.layoutJson(n);return aK(r)}}const cK=lw(1);let CA=class Mm{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>Mm._graphviz??=Gm.load())}async attempt(e,n){return await cK(async()=>{const r=xt.withTag("graphviz-wasm");try{return await n()}catch(i){r.error(`FAILED GraphvizWasmAdapter: ${e}`,i),Gm.unload(),Mm._graphviz=null}r.warn("Retrying..."),await Q0(50,300);try{return await n()}finally{Gm.unload(),Mm._graphviz=null}})}async unflatten(e){return await this.attempt(`unflatten
|
|
220
|
+
${e}`,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt(`acyclic
|
|
221
|
+
${e}`,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt(`dot
|
|
222
|
+
${e}`,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt(`svg
|
|
223
|
+
${e}`,async()=>(await this.graphviz()).layout(e,"svg"))}};const gw="DeploymentElement";function AA(t){return Y.isInstance(t,gw)}const ih="DeploymentViewRule";function uK(t){return Y.isInstance(t,ih)}const Vu="DynamicViewRule";function yw(t){return Y.isInstance(t,Vu)}const Ku="ElementExpression";function vw(t){return Y.isInstance(t,Ku)}const sh="ElementPredicate";function lK(t){return Y.isInstance(t,sh)}const oh="ElementPredicateOrWhere";function dK(t){return Y.isInstance(t,oh)}const Js="ElementProperty";function fK(t){return Y.isInstance(t,Js)}const ww="ExpressionV2";function pK(t){return Y.isInstance(t,ww)}const Yu="FqnExpr";function hK(t){return Y.isInstance(t,Yu)}const bw="FqnReferenceable",Zs="LikeC4View";function Dw(t){return Y.isInstance(t,Zs)}const ah="MetadataProperty";function Qo(t){return Y.isInstance(t,ah)}const Ew="Predicate";function mK(t){return Y.isInstance(t,Ew)}const Xu="Referenceable",ch="RelationExpr";function _A(t){return Y.isInstance(t,ch)}const uh="RelationExpression";function Rw(t){return Y.isInstance(t,uh)}const lh="RelationPredicate";function gK(t){return Y.isInstance(t,lh)}const dh="RelationPredicateOrWhere";function yK(t){return Y.isInstance(t,dh)}const Ju="RelationProperty",fh="RelationshipStyleProperty";function PA(t){return Y.isInstance(t,fh)}const ea="StringProperty";function xA(t){return Y.isInstance(t,ea)}const Zu="StyleProperty";function $w(t){return Y.isInstance(t,Zu)}const ph="ViewProperty";function vK(t){return Y.isInstance(t,ph)}const Qu="ViewRule";function wK(t){return Y.isInstance(t,Qu)}const hh="ViewRulePredicate";function mh(t){return Y.isInstance(t,hh)}const gh="ViewRuleStyleOrGlobalRef";function Tw(t){return Y.isInstance(t,gh)}const el="WhereElement";function IA(t){return Y.isInstance(t,el)}const tl="WhereElementExpression";function bK(t){return Y.isInstance(t,tl)}const NA="WhereExpression",yh="WhereKindEqual";function DK(t){return Y.isInstance(t,yh)}const nl="WhereRelation";function OA(t){return Y.isInstance(t,nl)}const rl="WhereRelationExpression";function EK(t){return Y.isInstance(t,rl)}const vh="WhereTagEqual";function RK(t){return Y.isInstance(t,vh)}const il="ArrowProperty";function sl(t){return Y.isInstance(t,il)}const ol="BorderProperty";function wh(t){return Y.isInstance(t,ol)}const al="ColorProperty";function Qs(t){return Y.isInstance(t,al)}const eo="CustomColor",bh="CustomElementProperties";function $K(t){return Y.isInstance(t,bh)}const Dh="CustomRelationProperties";function TK(t){return Y.isInstance(t,Dh)}const Yi="DeployedInstance";function Mr(t){return Y.isInstance(t,Yi)}const Sw="DeployedInstanceBody",Xi="DeploymentNode";function Nn(t){return Y.isInstance(t,Xi)}const kw="DeploymentNodeBody",ta="DeploymentNodeKind",Eh="DeploymentRelation";function to(t){return Y.isInstance(t,Eh)}const Cw="DeploymentRelationBody",cl="DeploymentView";function FA(t){return Y.isInstance(t,cl)}const Aw="DeploymentViewBody",ul="DeploymentViewRulePredicate";function _w(t){return Y.isInstance(t,ul)}const Pw="DeploymentViewRulePredicateExpression",ll="DeploymentViewRuleStyle";function SK(t){return Y.isInstance(t,ll)}const dl="DirectedRelationExpr";function LA(t){return Y.isInstance(t,dl)}const fl="DirectedRelationExpression";function xw(t){return Y.isInstance(t,fl)}const na="DynamicView";function MA(t){return Y.isInstance(t,na)}const Rh="DynamicViewBody";function kK(t){return Y.isInstance(t,Rh)}const pl="DynamicViewGlobalPredicateRef";function CK(t){return Y.isInstance(t,pl)}const hl="DynamicViewIncludePredicate";function AK(t){return Y.isInstance(t,hl)}const $h="DynamicViewParallelSteps";function Iw(t){return Y.isInstance(t,$h)}const Th="DynamicViewPredicateIterator";function BA(t){return Y.isInstance(t,Th)}const Nw="DynamicViewRef",Sh="DynamicViewStep";function Ow(t){return Y.isInstance(t,Sh)}const rr="Element";function Wn(t){return Y.isInstance(t,rr)}const kh="ElementBody";function ml(t){return Y.isInstance(t,kh)}const gl="ElementDescedantsExpression";function Fw(t){return Y.isInstance(t,gl)}const Ch="ElementExpressionsIterator";function _K(t){return Y.isInstance(t,Ch)}const Ji="ElementKind";function PK(t){return Y.isInstance(t,Ji)}const yl="ElementKindExpression";function Ah(t){return Y.isInstance(t,yl)}const vl="ElementPredicateWhere";function Lw(t){return Y.isInstance(t,vl)}const wl="ElementPredicateWith";function _h(t){return Y.isInstance(t,wl)}const bl="ElementRef";function Dl(t){return Y.isInstance(t,bl)}const El="ElementStringProperty";function Rl(t){return Y.isInstance(t,El)}const $l="ElementStyleProperty";function Zi(t){return Y.isInstance(t,$l)}const Tl="ElementTagExpression";function Ph(t){return Y.isInstance(t,Tl)}const ra="ElementView";function xh(t){return Y.isInstance(t,ra)}const Ih="ElementViewBody";function zA(t){return Y.isInstance(t,Ih)}const Mw="ElementViewRef",Sl="ExcludePredicate";function Nh(t){return Y.isInstance(t,Sl)}const kl="ExpandElementExpression";function qA(t){return Y.isInstance(t,kl)}const no="ExtendElement";function ia(t){return Y.isInstance(t,no)}const Oh="ExtendElementBody";function jA(t){return Y.isInstance(t,Oh)}const Fh="FqnElementRef";function UA(t){return Y.isInstance(t,Fh)}const Bw="FqnExpressions",Lh="FqnRef";function GA(t){return Y.isInstance(t,Lh)}const Cl="FqnRefExpr";function zw(t){return Y.isInstance(t,Cl)}const sa="GlobalDynamicPredicateGroup";function WA(t){return Y.isInstance(t,sa)}const oa="GlobalPredicateGroup";function HA(t){return Y.isInstance(t,oa)}const aa="Globals";function qw(t){return Y.isInstance(t,aa)}const Mh="GlobalStyle";function Al(t){return Y.isInstance(t,Mh)}const Bh="GlobalStyleGroup";function _l(t){return Y.isInstance(t,Bh)}const Pl="GlobalStyleId",xl="IconProperty";function Br(t){return Y.isInstance(t,xl)}const Il="IncludePredicate";function jw(t){return Y.isInstance(t,Il)}const Nl="IncomingRelationExpr";function VA(t){return Y.isInstance(t,Nl)}const Ol="IncomingRelationExpression";function KA(t){return Y.isInstance(t,Ol)}const Fl="InOutRelationExpr";function xK(t){return Y.isInstance(t,Fl)}const Ll="InOutRelationExpression";function Uw(t){return Y.isInstance(t,Ll)}const ro="LibIcon";function IK(t){return Y.isInstance(t,ro)}const zh="LikeC4Grammar";function NK(t){return Y.isInstance(t,zh)}const qh="LikeC4Lib";function YA(t){return Y.isInstance(t,qh)}const Ml="LineProperty";function Bl(t){return Y.isInstance(t,Ml)}const zl="LinkProperty";function jh(t){return Y.isInstance(t,zl)}const ql="MetadataAttribute";function OK(t){return Y.isInstance(t,ql)}const jl="MetadataBody";function FK(t){return Y.isInstance(t,jl)}const ca="Model";function XA(t){return Y.isInstance(t,ca)}const Ul="ModelDeployments",ua="ModelViews";function Gl(t){return Y.isInstance(t,ua)}const Uh="NavigateToProperty";function Gh(t){return Y.isInstance(t,Uh)}const Wl="NotationProperty";function la(t){return Y.isInstance(t,Wl)}const Hl="NotesProperty";function JA(t){return Y.isInstance(t,Hl)}const Vl="OpacityProperty";function Wh(t){return Y.isInstance(t,Vl)}const Kl="OutgoingRelationExpr";function ZA(t){return Y.isInstance(t,Kl)}const Yl="OutgoingRelationExpression";function Gw(t){return Y.isInstance(t,Yl)}const Hh="Predicates";function QA(t){return Y.isInstance(t,Hh)}const Vh="Relation";function zr(t){return Y.isInstance(t,Vh)}const Kh="RelationBody";function LK(t){return Y.isInstance(t,Kh)}const Xl="RelationNavigateToProperty";function Jl(t){return Y.isInstance(t,Xl)}const Zl="RelationPredicateWhere";function e_(t){return Y.isInstance(t,Zl)}const Ql="RelationPredicateWith";function Ww(t){return Y.isInstance(t,Ql)}const Qi="RelationshipKind";function MK(t){return Y.isInstance(t,Qi)}const ed="RelationStringProperty";function td(t){return Y.isInstance(t,ed)}const nd="RelationStyleProperty";function Yh(t){return Y.isInstance(t,nd)}const rd="ShapeProperty";function Xh(t){return Y.isInstance(t,rd)}const Jh="SpecificationColor";function Zh(t){return Y.isInstance(t,Jh)}const da="SpecificationDeploymentNodeKind";function Qh(t){return Y.isInstance(t,da)}const fa="SpecificationElementKind";function pa(t){return Y.isInstance(t,fa)}const id="SpecificationElementStringProperty";function Hw(t){return Y.isInstance(t,id)}const ha="SpecificationRelationshipKind";function ma(t){return Y.isInstance(t,ha)}const sd="SpecificationRelationshipStringProperty";function t_(t){return Y.isInstance(t,sd)}const ga="SpecificationRule";function Vw(t){return Y.isInstance(t,ga)}const ya="SpecificationTag";function em(t){return Y.isInstance(t,ya)}const es="Tag";function n_(t){return Y.isInstance(t,es)}const tm="Tags";function Kw(t){return Y.isInstance(t,tm)}const Yw="ViewRef",od="ViewRuleAutoLayout";function ad(t){return Y.isInstance(t,od)}const cd="ViewRuleGlobalPredicateRef";function BK(t){return Y.isInstance(t,cd)}const ud="ViewRuleGlobalStyle";function r_(t){return Y.isInstance(t,ud)}const ld="ViewRuleGroup";function nm(t){return Y.isInstance(t,ld)}const dd="ViewRuleStyle";function fd(t){return Y.isInstance(t,dd)}const pd="ViewStringProperty";function zK(t){return Y.isInstance(t,pd)}const hd="WhereBinaryExpression";function qK(t){return Y.isInstance(t,hd)}const md="WhereElementKind";function jK(t){return Y.isInstance(t,md)}const gd="WhereElementNegation";function i_(t){return Y.isInstance(t,gd)}const yd="WhereElementTag";function UK(t){return Y.isInstance(t,yd)}const vd="WhereRelationKind";function s_(t){return Y.isInstance(t,vd)}const wd="WhereRelationNegation";function o_(t){return Y.isInstance(t,wd)}const bd="WhereRelationTag";function GK(t){return Y.isInstance(t,bd)}const Dd="WildcardExpression";function io(t){return Y.isInstance(t,Dd)}class a_ extends XD{getAllTypes(){return[il,ol,al,eo,bh,Dh,Yi,Sw,gw,Xi,kw,ta,Eh,Cw,cl,Aw,ih,ul,Pw,ll,dl,fl,na,Rh,pl,hl,$h,Th,Nw,Vu,Sh,rr,kh,gl,Ku,Ch,Ji,yl,sh,oh,vl,wl,Js,bl,El,$l,Tl,ra,Ih,Mw,Sl,kl,ww,no,Oh,Fh,Yu,Bw,Lh,Cl,bw,sa,oa,Mh,Bh,Pl,aa,xl,Fl,Ll,Il,Nl,Ol,ro,zh,qh,Zs,Ml,zl,ql,jl,ah,ca,Ul,ua,Uh,Wl,Hl,Vl,Kl,Yl,Ew,Hh,Xu,Vh,Kh,ch,uh,Xl,lh,dh,Zl,Ql,Ju,ed,nd,Qi,fh,rd,Jh,da,fa,id,ha,sd,ga,ya,ea,Zu,es,tm,ph,Yw,Qu,od,cd,ud,ld,hh,dd,gh,pd,hd,el,tl,md,gd,yd,NA,yh,nl,rl,vd,wd,bd,vh,Dd]}computeIsSubtype(e,n){switch(e){case il:case Ml:return this.isSubtype(fh,n);case ol:case Vl:case rd:return this.isSubtype(Zu,n);case al:return this.isSubtype(fh,n)||this.isSubtype(Zu,n);case Yi:case Xi:return this.isSubtype(gw,n)||this.isSubtype(Xu,n);case cl:case na:case ra:return this.isSubtype(Zs,n);case ul:case ll:return this.isSubtype(ih,n);case dl:case Nl:case Fl:case Kl:return this.isSubtype(ch,n);case fl:case Ol:case Ll:case Yl:return this.isSubtype(uh,n);case pl:case hl:return this.isSubtype(Vu,n);case rr:return this.isSubtype(bw,n)||this.isSubtype(Xu,n);case gl:case yl:case bl:case Tl:case kl:return this.isSubtype(Ku,n);case Ku:case vl:return this.isSubtype(oh,n);case sh:case lh:return this.isSubtype(Ew,n);case oh:case wl:return this.isSubtype(sh,n);case El:return this.isSubtype(Js,n)||this.isSubtype(ea,n);case $l:return this.isSubtype(Js,n);case Sl:case Il:return this.isSubtype(hh,n);case no:case Xu:return this.isSubtype(bw,n);case Yu:case ch:return this.isSubtype(ww,n);case Cl:return this.isSubtype(Yu,n);case xl:return this.isSubtype(Js,n)||this.isSubtype(Zu,n);case zl:return this.isSubtype(Js,n)||this.isSubtype(Ju,n)||this.isSubtype(ph,n);case ql:case Wl:case Hl:case id:case sd:return this.isSubtype(ea,n);case jl:return this.isSubtype(ah,n);case ah:return this.isSubtype(Js,n)||this.isSubtype(Ju,n);case uh:case Zl:return this.isSubtype(dh,n);case Xl:case nd:return this.isSubtype(Ju,n);case dh:case Ql:return this.isSubtype(lh,n);case ed:return this.isSubtype(Ju,n)||this.isSubtype(ea,n);case od:return this.isSubtype(ih,n)||this.isSubtype(Vu,n)||this.isSubtype(Qu,n);case cd:case ld:case hh:return this.isSubtype(Qu,n);case ud:case dd:return this.isSubtype(gh,n);case gh:return this.isSubtype(Vu,n)||this.isSubtype(Qu,n);case pd:return this.isSubtype(ea,n)||this.isSubtype(ph,n);case hd:return this.isSubtype(tl,n)||this.isSubtype(rl,n);case el:case gd:return this.isSubtype(tl,n);case tl:case rl:return this.isSubtype(NA,n);case md:return this.isSubtype(el,n)||this.isSubtype(yh,n);case yd:return this.isSubtype(el,n)||this.isSubtype(vh,n);case nl:case wd:return this.isSubtype(rl,n);case vd:return this.isSubtype(yh,n)||this.isSubtype(nl,n);case bd:return this.isSubtype(nl,n)||this.isSubtype(vh,n);case Dd:return this.isSubtype(Ku,n)||this.isSubtype(Yu,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return eo;case"DeploymentNode:kind":return ta;case"DeploymentRelation:kind":case"DynamicViewStep:kind":case"OutgoingRelationExpr:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return Qi;case"DynamicViewGlobalPredicateRef:predicate":return sa;case"DynamicViewRef:view":return na;case"Element:kind":case"ElementKindExpression:kind":case"WhereElementKind:value":return Ji;case"ElementRef:el":case"FqnElementRef:el":return rr;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationTag:value":return es;case"ElementViewRef:view":return ra;case"FqnRef:value":return Xu;case"IconProperty:libicon":return ro;case"ViewRef:view":return Zs;case"ViewRuleGlobalPredicateRef:predicate":return oa;case"ViewRuleGlobalStyle:style":return Pl;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case il:return{name:il,properties:[{name:"key"},{name:"value"}]};case ol:return{name:ol,properties:[{name:"key"},{name:"value"}]};case al:return{name:al,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case eo:return{name:eo,properties:[{name:"name"}]};case bh:return{name:bh,properties:[{name:"props",defaultValue:[]}]};case Dh:return{name:Dh,properties:[{name:"props",defaultValue:[]}]};case Yi:return{name:Yi,properties:[{name:"body"},{name:"element"},{name:"name"},{name:"title"}]};case Sw:return{name:Sw,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Xi:return{name:Xi,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"title"}]};case kw:return{name:kw,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case ta:return{name:ta,properties:[{name:"name"}]};case Eh:return{name:Eh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Cw:return{name:Cw,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case cl:return{name:cl,properties:[{name:"body"},{name:"name"}]};case Aw:return{name:Aw,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case ul:return{name:ul,properties:[{name:"expr"},{name:"isInclude",defaultValue:!1}]};case Pw:return{name:Pw,properties:[{name:"prev"},{name:"value"}]};case ll:return{name:ll,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case dl:return{name:dl,properties:[{name:"source"},{name:"target"}]};case fl:return{name:fl,properties:[{name:"source"},{name:"target"}]};case na:return{name:na,properties:[{name:"body"},{name:"name"}]};case Rh:return{name:Rh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case pl:return{name:pl,properties:[{name:"predicate"}]};case hl:return{name:hl,properties:[{name:"predicates"}]};case $h:return{name:$h,properties:[{name:"steps",defaultValue:[]}]};case Th:return{name:Th,properties:[{name:"prev"},{name:"value"}]};case Nw:return{name:Nw,properties:[{name:"view"}]};case Sh:return{name:Sh,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case rr:return{name:rr,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case kh:return{name:kh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case gl:return{name:gl,properties:[{name:"parent"},{name:"suffix"}]};case Ch:return{name:Ch,properties:[{name:"prev"},{name:"value"}]};case Ji:return{name:Ji,properties:[{name:"name"}]};case yl:return{name:yl,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case vl:return{name:vl,properties:[{name:"subject"},{name:"where"}]};case wl:return{name:wl,properties:[{name:"custom"},{name:"subject"}]};case bl:return{name:bl,properties:[{name:"el"},{name:"parent"}]};case El:return{name:El,properties:[{name:"key"},{name:"value"}]};case $l:return{name:$l,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Tl:return{name:Tl,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case ra:return{name:ra,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case Ih:return{name:Ih,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Mw:return{name:Mw,properties:[{name:"view"}]};case Sl:return{name:Sl,properties:[{name:"predicates"}]};case kl:return{name:kl,properties:[{name:"expand"}]};case no:return{name:no,properties:[{name:"body"},{name:"element"}]};case Oh:return{name:Oh,properties:[{name:"elements",defaultValue:[]}]};case Fh:return{name:Fh,properties:[{name:"el"},{name:"parent"}]};case Bw:return{name:Bw,properties:[{name:"prev"},{name:"value"}]};case Lh:return{name:Lh,properties:[{name:"parent"},{name:"value"}]};case Cl:return{name:Cl,properties:[{name:"ref"},{name:"selector"}]};case sa:return{name:sa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case oa:return{name:oa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case aa:return{name:aa,properties:[{name:"name"},{name:"predicates",defaultValue:[]},{name:"styles",defaultValue:[]}]};case Mh:return{name:Mh,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case Bh:return{name:Bh,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case Pl:return{name:Pl,properties:[{name:"name"}]};case xl:return{name:xl,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case Il:return{name:Il,properties:[{name:"predicates"}]};case Nl:return{name:Nl,properties:[{name:"to"}]};case Ol:return{name:Ol,properties:[{name:"to"}]};case Fl:return{name:Fl,properties:[{name:"inout"}]};case Ll:return{name:Ll,properties:[{name:"inout"}]};case ro:return{name:ro,properties:[{name:"name"}]};case zh:return{name:zh,properties:[{name:"deployments",defaultValue:[]},{name:"globals",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case qh:return{name:qh,properties:[{name:"icons",defaultValue:[]}]};case Ml:return{name:Ml,properties:[{name:"key"},{name:"value"}]};case zl:return{name:zl,properties:[{name:"key"},{name:"title"},{name:"value"}]};case ql:return{name:ql,properties:[{name:"key"},{name:"value"}]};case jl:return{name:jl,properties:[{name:"props",defaultValue:[]}]};case ca:return{name:ca,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case Ul:return{name:Ul,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case ua:return{name:ua,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"views",defaultValue:[]}]};case Uh:return{name:Uh,properties:[{name:"key"},{name:"value"}]};case Wl:return{name:Wl,properties:[{name:"key"},{name:"value"}]};case Hl:return{name:Hl,properties:[{name:"key"},{name:"value"}]};case Vl:return{name:Vl,properties:[{name:"key"},{name:"value"}]};case Kl:return{name:Kl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Yl:return{name:Yl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Hh:return{name:Hh,properties:[{name:"prev"},{name:"value"}]};case Vh:return{name:Vh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Kh:return{name:Kh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Xl:return{name:Xl,properties:[{name:"key"},{name:"value"}]};case Zl:return{name:Zl,properties:[{name:"subject"},{name:"where"}]};case Ql:return{name:Ql,properties:[{name:"custom"},{name:"subject"}]};case Qi:return{name:Qi,properties:[{name:"name"}]};case ed:return{name:ed,properties:[{name:"key"},{name:"value"}]};case nd:return{name:nd,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case rd:return{name:rd,properties:[{name:"key"},{name:"value"}]};case Jh:return{name:Jh,properties:[{name:"color"},{name:"name"}]};case da:return{name:da,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case fa:return{name:fa,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case id:return{name:id,properties:[{name:"key"},{name:"value"}]};case ha:return{name:ha,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case sd:return{name:sd,properties:[{name:"key"},{name:"value"}]};case ga:return{name:ga,properties:[{name:"colors",defaultValue:[]},{name:"deploymentNodes",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case ya:return{name:ya,properties:[{name:"tag"}]};case es:return{name:es,properties:[{name:"name"}]};case tm:return{name:tm,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Yw:return{name:Yw,properties:[{name:"view"}]};case od:return{name:od,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case cd:return{name:cd,properties:[{name:"predicate"}]};case ud:return{name:ud,properties:[{name:"style"}]};case ld:return{name:ld,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case dd:return{name:dd,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case pd:return{name:pd,properties:[{name:"key"},{name:"value"}]};case hd:return{name:hd,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case md:return{name:md,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case gd:return{name:gd,properties:[{name:"value"}]};case yd:return{name:yd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case vd:return{name:vd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case wd:return{name:wd,properties:[{name:"value"}]};case bd:return{name:bd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Dd:return{name:Dd,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const Y=new a_;let c_;const WK=()=>c_??(c_=yj(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","name":"LikeC4Grammar","entry":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4Lib","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"likec4lib"},{"$type":"Keyword","value":"{"},{"$type":"Keyword","value":"icons"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"icons","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibIcon","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tag","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColor","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"specification"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"relationships","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"colors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"deploymentNodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"element"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationDeploymentNodeKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deploymentNode"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationTag","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"tag"},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationColor","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"color"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"color","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"relationship"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Model","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"model"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Element","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}}]}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElement","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tags","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Tags"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Relation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelViews","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"views"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamic"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@36"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@37"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewLayoutDirection","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"TopBottom"},{"$type":"Keyword","value":"LeftRight"},{"$type":"Keyword","value":"BottomTop"},{"$type":"Keyword","value":"RightLeft"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewParallelSteps","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"parallel"},{"$type":"Keyword","value":"par"}]},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBackward","operator":"?=","terminal":{"$type":"Keyword","value":"<-"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"IncludePredicate"}},{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExcludePredicate"}},{"$type":"Keyword","value":"exclude"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicates","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Predicates"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicate","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@119"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicates","inferredType":{"$type":"InferredType","name":"ElementPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementOr","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementAnd","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementPrimary","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementSelectorExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementTagExpression"}},{"$type":"Keyword","value":"element.tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementDescedantsExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]}}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicates","inferredType":{"$type":"InferredType","name":"RelationPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationOr","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationAnd","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationPrimary","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelation","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpression"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpression"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpressionsIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementExpressionsIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewIncludePredicate","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@120"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewPredicateIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DynamicViewPredicateIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"style","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@121"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyleOrGlobalRef","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleAutoLayout","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"autoLayout"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotationProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notation"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotesProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notes"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomElementProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationNavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelDeployments","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"deployment"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNode","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}]}]},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstance","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]}],"cardinality":"?"},{"$type":"Keyword","value":"instanceOf"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstanceBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelation","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"targets","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicate","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isInclude","operator":"?=","terminal":{"$type":"Keyword","value":"include"}},{"$type":"Keyword","value":"exclude"}]},{"$type":"Assignment","feature":"expr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicateExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DeploymentViewRulePredicateExpression"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExpressionV2","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpr","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRefExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"ref","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Assignment","feature":"selector","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpr","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpr"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpr"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpressions","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnExpressions"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Globals","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"global"}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@122"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]}]},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"predicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalDynamicPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamicPredicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleId","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"styleGroup"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LinkProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"link"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ColorProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"color"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"themeColor","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OpacityProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"opacity"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"icon"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"libicon","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]}]}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"shape"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderStyleValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"Keyword","value":"none"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"border"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"line"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"head"},{"$type":"Keyword","value":"tail"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineOptions","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"solid"},{"$type":"Keyword","value":"dashed"},{"$type":"Keyword","value":"dotted"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"Keyword","value":"normal"},{"$type":"Keyword","value":"onormal"},{"$type":"Keyword","value":"dot"},{"$type":"Keyword","value":"odot"},{"$type":"Keyword","value":"diamond"},{"$type":"Keyword","value":"odiamond"},{"$type":"Keyword","value":"crow"},{"$type":"Keyword","value":"open"},{"$type":"Keyword","value":"vee"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ThemeColor","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"primary"},{"$type":"Keyword","value":"secondary"},{"$type":"Keyword","value":"muted"},{"$type":"Keyword","value":"slate"},{"$type":"Keyword","value":"blue"},{"$type":"Keyword","value":"indigo"},{"$type":"Keyword","value":"sky"},{"$type":"Keyword","value":"red"},{"$type":"Keyword","value":"gray"},{"$type":"Keyword","value":"green"},{"$type":"Keyword","value":"amber"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementShape","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rectangle"},{"$type":"Keyword","value":"person"},{"$type":"Keyword","value":"browser"},{"$type":"Keyword","value":"mobile"},{"$type":"Keyword","value":"cylinder"},{"$type":"Keyword","value":"storage"},{"$type":"Keyword","value":"queue"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorValue","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Uri","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TagId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DotId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorId","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Id","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"},{"$type":"Keyword","value":"group"},{"$type":"Keyword","value":"node"},{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"instance"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EqOperator","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"is"}},{"$type":"Assignment","feature":"not","operator":"?=","terminal":{"$type":"Keyword","value":"not"},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IsEqual","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","hidden":true,"name":"BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/[\\\\r\\\\n]+/"},"fragment":false},{"$type":"TerminalRule","name":"LIB_ICON","definition":{"$type":"RegexToken","regex":"/(aws|azure|gcp|tech):[-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_WITH_SCHEMA","definition":{"$type":"RegexToken","regex":"/\\\\w+:\\\\/\\\\/\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_RELATIVE","definition":{"$type":"RegexToken","regex":"/\\\\.{0,2}\\\\/[^\\\\/]\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotUnderscore","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\._(?![_a-zA-Z])/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotWildcard","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\.\\\\*{1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hash","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"#"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"StickyDot","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\./"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Dot","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"."}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NotEqual","definition":{"$type":"RegexToken","regex":"/\\\\!\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Eq","definition":{"$type":"RegexToken","regex":"/\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Percent","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+%/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"String","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"IdTerminal","definition":{"$type":"RegexToken","regex":"/[_]*[a-zA-Z][-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Number","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+\\\\b/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hex","definition":{"$type":"RegexToken","regex":"/\\\\b[a-zA-Z0-9]+\\\\b/"},"fragment":false,"hidden":false}],"types":[{"$type":"Type","name":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@36"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@37"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@103"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@44"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@29"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@33"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@89"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@63/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@0/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@63/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@1/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@58"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@70"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}}]}},{"$type":"Type","name":"Referenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@6"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@21"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),u_={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},HK={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},VK={AstReflection:()=>new a_},KK={Grammar:()=>WK(),LanguageMetaData:()=>u_,parser:{ParserConfig:()=>HK}};function $n(t){return t.el.ref}function rm(t){const e=[t.el.$refText];let n=t.parent;for(;n;)e.push(n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}const Ed=Symbol.for("idattr"),im={writeId(t,e){return t[Ed]=e,t},readId(t){return t[Ed]}},Rd={writeId(t,e){return Et(e)?t[Ed]=void 0:t[Ed]=e,t},readId(t){return t[Ed]}};function $d(t){return t.textDocument.languageId===u_.languageId}function Xw(t){return $d(t)&&t.state>=He.IndexedContent&&!!t.c4fqnIndex}function va(t){return $d(t)&&t.state==He.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex&&!!t.c4Deployments&&!!t.c4DeploymentRelations}function*YK(t){const e=Xm.from(t.parseResult.value.models.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(zr(r)){n.push(r);continue}if(ia(r)){if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);continue}if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function*XK(t){const e=Xm.from(t.parseResult.value.deployments.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(to(r)){n.push(r);continue}if(Nn(r)&&r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function JK(t){const e=$n(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(Qt(t.source)){const n=$n(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!ml(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function l_({value:t}){const e=parseFloat(t);return isNaN(e)?100:YS(e,{min:0,max:100})}function ts(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case wh(r):{ue(r.value)&&(n.border=r.value);break}case Qs(r):{const i=Td(r);ue(i)&&(n.color=i);break}case Xh(r):{ue(r.value)&&(n.shape=r.value);break}case Br(r):{const i=r.libicon?.ref?.name??r.value;ue(i)&&(n.icon=i);break}case Wh(r):{n.opacity=l_(r);break}default:Oe(r)}return n}function ZK(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Qs(r):{const i=Td(r);ue(i)&&(n.color=i);break}case Bl(r):{n.line=r.value;break}case sl(r):{switch(r.key){case"head":{n.head=r.value;break}case"tail":{n.tail=r.value;break}default:Oe(r)}break}default:Oe(r)}return n}function Jw(t,e){const{color:n,line:r,head:i,tail:s}=ZK(t?.filter(PA),e);return{...n&&n!==ka?{color:n}:{},...r&&r!==r2?{line:r}:{},...i&&i!==ms?{head:i}:{},...s?{tail:s}:{}}}function Td(t){return t?.themeColor??t?.customColor?.$refText}function Zw(t){const e=t.rankSep,n=t.nodeSep;let r;switch(t.direction){case"TopBottom":{r="TB";break}case"BottomTop":{r="BT";break}case"LeftRight":{r="LR";break}case"RightLeft":{r="RL";break}default:Oe(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function QK(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Oe(t)}}function d_(t){if(vw(t))return t;if(Lw(t))return t.subject;if(_h(t))return d_(t.subject);Oe(t)}class eY{parser;locator;constructor(e){this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getDocumentation(e){try{if(Nn(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id];return r.title!==e.name&&i.push(" ",`**${r.title}**`),i.join(`
|
|
224
|
+
`)}if(Mr(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id,`_instance of_ ${r.element}`];return i&&s.push(" ",`**${i.title}**`),s.join(`
|
|
225
|
+
`)}if(Wn(e)){const n=bt(e),r=this.parser.forDocument(n).parseElement(e);return r?[r.id," ",`**${r.title}**`].join(`
|
|
226
|
+
`):void 0}}catch(n){ve(n)}}}function tY(t,e){return[t,e]=f_(t,e)>0?[e,t]:[t,e],nY(t.range,e.range.start)}function f_(t,e){const n=t.range.start.line-e.range.start.line;return n!==0?n:t.range.start.character-e.range.start.character}function nY(t,e){return!(e.line<t.start.line||e.line>t.end.line||e.line==t.start.line&&e.character<t.start.character||e.line==t.end.line&&e.character>t.end.character)}function p_(t){return t.range.start.line!=t.range.end.line}const le={newLine:qi.newLine({allowMore:!0}),oneSpace:qi.oneSpace(),noSpace:qi.noSpace(),indent:qi.indent({allowMore:!0}),noIndent:qi.noIndent()};class rY extends j7{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatGlobals(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatMetadataProperty(e),this.formatView(e),this.formatViewRuleGroup(e),this.formatViewRuleGlobalStyle(e),this.formatIncludeExcludeExpressions(e),this.formatWhereExpression(e),this.formatAutolayoutProperty(e),this.formatWithPredicate(e),this.formatViewRuleStyle(e),this.formatLeafProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,Kw,(n,r)=>{r.cst(Po(n.$cstNode,"values").slice(1)).prepend(le.oneSpace),r.keywords(",").prepend(le.noSpace).append(le.oneSpace)})}formatRelation(e){this.on(e,zr,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(le.oneSpace),r.keywords("]->").prepend(le.noSpace),r.keywords("-[").append(le.noSpace),r.nodes(...Ve([n.target,n.tags],ue)).prepend(le.oneSpace),r.properties("title","technology").prepend(le.oneSpace)}),this.on(e,Ow,(n,r)=>{r.keywords("->","<-").surround(le.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(le.oneSpace),r.keywords("]->").prepend(le.noSpace).append(le.oneSpace),r.keywords("-[").prepend(le.oneSpace).append(le.noSpace),r.properties("title").prepend(le.oneSpace)}),this.on(e,xw)?.property("target").prepend(le.oneSpace),this.on(e,Gw,(n,r)=>{r.property("from").append(le.oneSpace),r.keywords("]->").prepend(le.noSpace),r.keywords("-[").append(le.noSpace)}),this.on(e,KA)?.keywords("->").append(le.oneSpace),this.on(e,Uw)?.keyword("->").prepend(le.oneSpace)}removeIndentFromTopLevelStatements(e){(XA(e)||Vw(e)||Gl(e)||YA(e)||qw(e))&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global").prepend(le.noIndent)}indentContentInBraces(e){if(YA(e)||Vw(e)||pa(e)||ma(e)||qw(e)||Al(e)||_l(e)||XA(e)||ml(e)||jA(e)||LK(e)||Yh(e)||FK(e)||Gl(e)||zA(e)||kK(e)||fd(e)||nm(e)||$K(e)||TK(e)||Zi(e)||Iw(e)){const n=this.getNodeFormatter(e),r=n.keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let o=null;for(const a of s.nodes)(!o||!tY(o,a))&&n.cst([a]).prepend(le.indent),o=a;r.prepend(le.noIndent).prepend(le.oneSpace),i.prepend(le.noIndent).prepend(qi.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,PK)?.keywords("element").append(le.oneSpace)}formatView(e){this.on(e,xh,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(le.oneSpace),r.keywords("of","extends").surround(le.oneSpace)}),this.on(e,MA)?.keywords("dynamic","view").append(le.oneSpace)}formatLeafProperty(e){if(Rl(e)||td(e)||zK(e)||la(e)||Hw(e)||t_(e)||Qs(e)||Bl(e)||sl(e)||Br(e)||Xh(e)||wh(e)||Wh(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity");r.nodes.length===0?i.append(le.oneSpace):r.prepend(le.noSpace).append(le.oneSpace),n.keyword(";").prepend(le.noSpace).append(le.newLine)}}formatLinkProperty(e){this.on(e,jh,(n,r)=>{r.keyword("link").append(le.oneSpace),r.property("value").append(le.oneSpace),r.keyword(":").prepend(le.noSpace).append(le.oneSpace),r.keyword(";").prepend(le.noSpace).append(le.newLine)})}formatNavigateToProperty(e){this.on(e,Gh)?.property("key").append(le.oneSpace)}formatAutolayoutProperty(e){this.on(e,ad,(n,r)=>{r.keyword("autoLayout").append(le.oneSpace),r.property("rankSep").prepend(le.oneSpace),r.property("nodeSep").prepend(le.oneSpace)})}formatMetadataProperty(e){this.on(e,OK,(n,r)=>{r.property("key").append(le.oneSpace),r.keyword(":").prepend(le.noSpace).append(le.oneSpace),r.keyword(";").prepend(le.noSpace).append(le.newLine)})}formatElementDeclaration(e){this.on(e,Wn,(n,r)=>{const i=kn(n.$cstNode,"kind"),s=kn(n.$cstNode,"name");s&&i&&(f_(s,i)>0?r.cst([i]).append(le.oneSpace):(r.cst([s]).append(le.oneSpace),r.cst([i]).prepend(le.oneSpace))),r.properties("props").prepend(le.oneSpace)})}formatGlobals(e){this.on(e,Al,(n,r)=>{r.keyword("style").append(le.oneSpace),r.property("id").append(le.oneSpace)}),this.on(e,_l,(n,r)=>{r.keyword("styleGroup").append(le.oneSpace)})}formatSpecificationRule(e){if((pa(e)||ma(e)||em(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag").append(le.oneSpace),Zh(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(le.oneSpace),n.property("name").append(le.oneSpace)}}formatWithPredicate(e){const n=this.getNodeFormatter(e);(_h(e)||Ww(e))&&n.keyword("with").prepend(le.oneSpace)}formatViewRuleGlobalStyle(e){this.on(e,r_,(n,r)=>{r.keywords("global","style").append(le.oneSpace)})}formatViewRuleGroup(e){this.on(e,nm,(n,r)=>{r.keyword("group").append(le.oneSpace)})}formatViewRuleStyle(e){this.on(e,fd)?.keyword("style").append(le.oneSpace),this.on(e,_K)?.keyword(",").prepend(le.noSpace).append(le.oneSpace)}formatWhereExpression(e){if((yK(e)||dK(e))&&this.getNodeFormatter(e).keyword("where").append(le.oneSpace),(EK(e)||bK(e))&&this.getNodeFormatter(e).property("operator").surround(le.oneSpace),(i_(e)||o_(e))&&this.getNodeFormatter(e).keyword("not").append(le.oneSpace),IA(e)||UK(e)||jK(e)||OA(e)||GK(e)||s_(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(le.oneSpace),n.property("not").surround(le.oneSpace)}}formatIncludeExcludeExpressions(e){if(yw(e)||jw(e)||Nh(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!p_(e.$cstNode))&&n.keywords("include","exclude").append(le.oneSpace)}if(BA(e)||QA(e)||QA(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&p_(r?.$cstNode);i&&n.property("value").prepend(le.indent),n.keyword(",").prepend(le.noSpace).append(i?le.newLine:le.oneSpace)}}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||yw(n)||jw(n)||Nh(n))return n;n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}class iY{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==He.Validated&&(Fe.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(He.Validated,e.uri,r),Fe.debug(`Document ${e.uri.path} is validated`)),va(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=im.readId(i),o=i.$cstNode?.range;return!o||!s?[]:{range:{start:o.start,end:{line:o.start.line,character:o.start.character+4}},command:{command:"likec4.open-preview",arguments:[s],title:"open preview"}}}):void 0}}class sY extends D1{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(n.value==="deployment"&&xi(e.node,Gl))return r(e,{label:n.value,detail:"Insert deployment view",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:["deployment view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," include $0","}"].join(`
|
|
227
|
+
`)});if(["title","description","technology"].includes(n.value))return r(e,{label:n.value,kind:Ft.Property,insertTextFormat:tr.Snippet,insertText:`${n.value} '\${0}'`});if(["views","specification","model","deployment","with"].includes(n.value))return r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} {
|
|
228
|
+
$0
|
|
229
|
+
}`});if(n.value==="group")return r(e,{label:n.value,detail:"Insert group block",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
|
|
230
|
+
`)});if(n.value==="dynamic"&&xi(e.node,Gl))return r(e,{label:n.value,detail:"Insert dynamic view",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
|
|
231
|
+
`)});if(n.value==="style"&&e.node)return xi(e.node,Al)?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
|
|
232
|
+
\${3|color,shape,border,opacity,icon|} $0
|
|
233
|
+
}`}):xi(e.node,d9([Gl,_l]))?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} \${1:*} {
|
|
234
|
+
\${2|color,shape,border,opacity,icon|} $0
|
|
235
|
+
}`}):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} {
|
|
236
|
+
\${1|color,shape,border,opacity,icon|} $0
|
|
237
|
+
}`});if(n.value==="extend")return r(e,{label:n.value,detail:"Extend another view",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:`extend \${1:element} {
|
|
238
|
+
$0
|
|
239
|
+
}`});if(n.value==="autoLayout")return r(e,{label:n.value,kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class oY extends E1{createDocumentHighlight(e){return ye.DocumentHighlight.create(e.segment.range,ye.DocumentHighlightKind.Read)}}const aY=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,cY=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,uY=/^([/\\]\s*){2,}[^/\\]/;function h_(t){return["./","../"].some(e=>t.startsWith(e))}function Qw(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?aY.test(t):cY.test(t)||(e.acceptRelative?uY.test(t):!1)}function lY(t="",e){return t.endsWith("/")}function dY(t="",e){return(lY(t)?t.slice(0,-1):t)||"/"}function fY(t="",e){return t.endsWith("/")?t:t+"/"}function sm(t=""){return t.startsWith("/")}function m_(t=""){return(sm(t)?t.slice(1):t)||"/"}function pY(t=""){return sm(t)?t:"/"+t}function hY(t,e){if(mY(e))return t;const n=dY(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function mY(t){return!t||t==="/"}function om(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}class gY{constructor(e){this.services=e}getDocumentLinks(e,n){return va(e)?_r(e.parseResult.value).filter(jh).map(r=>{try{const i=kn(r.$cstNode,"value")?.range,s=this.resolveLink(e,r.value);if(i&&Qw(s))return{range:i,target:s}}catch(i){ve(i)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(Qw(n)||sm(n))return n;const r=h_(n)?new URL(e.uri.toString(!0)):this.services.shared.workspace.WorkspaceManager.workspaceURL;return new URL(n,r).toString()}relativeLink(e,n){if(sm(n))return m_(n);if(h_(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return m_(hY(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}class yY{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator,this.nameProvider=e.references.NameProvider}nodeKindProvider;nameProvider;parser;locator;getSymbols({parseResult:{value:{specifications:e,models:n,deployments:r,views:i,likec4lib:s}}}){return[...s.map(o=>()=>this.getLikec4LibSymbol(o)),...e.map(o=>()=>this.getSpecSymbol(o)),...n.map(o=>()=>this.getModelSymbol(o)),...r.map(o=>()=>this.getDeploymentModelSymbol(o)),...i.map(o=>()=>this.getModelViewsSymbol(o))].flatMap(o=>{try{return o()??[]}catch(a){return ve(a),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ue);return r.length===0?[]:[{kind:hr.Namespace,name:"icons",range:n.range,selectionRange:yc(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=kn(n,"name");if(!r)return[];const i=tt([...e.elements,...e.tags,...e.relationships],vn(s=>{try{if(pa(s)||ma(s)||Qh(s))return this.getKindSymbol(s);if(em(s))return this.getTagSymbol(s)}catch(o){return ve(o),null}Oe(s)}),Ve(ue));return i.length===0?[]:[{kind:hr.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=kn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getElementsSymbol(i))}]:[]}getDeploymentModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=kn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getDeploymentElementSymbol(i))}]:[]}getElementsSymbol(e){try{if(ia(e))return this.getExtendElementSymbol(e);if(Wn(e))return this.getElementSymbol(e)}catch(n){ve(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:rm(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=kn(n,"name");if(!r||!n)return[];const i=e.name,s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(o=>this.getElementsSymbol(o))??[]}]}getModelViewsSymbol(e){const n=e.$cstNode,r=kn(n,"name");return!r||!n?[]:[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.views.flatMap(i=>this.getViewSymbol(i))}]}getKindSymbol(e){return!e.$cstNode||!e.kind.$cstNode||Fs(e.kind.name)?null:{kind:this.symbolKind(e),name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||Fs(e.tag.name)?null:{kind:this.symbolKind(e),name:"#"+e.tag.name,range:e.$cstNode.range,selectionRange:e.tag.$cstNode.range}}getLibIconSymbol(e){return!e.$cstNode||Fs(e.name)?null:{kind:this.symbolKind(e),name:e.name,range:e.$cstNode.range,selectionRange:e.$cstNode.range}}getViewSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.name?kn(n,"name"):null;return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}getDeploymentElementSymbol(e){try{if(Nn(e))return this.getDeploymentNodeSymbol(e);if(Mr(e))return this.getDeployedInstanceSymbol(e)}catch(n){ve(n)}return[]}getDeploymentNodeSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=this.nameProvider.getNameStrict(e),s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(o=>this.getDeploymentElementSymbol(o))??[]}]}getDeployedInstanceSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=bt(e),s=this.parser.forDocument(i).parseDeployedInstance(e),o=this.nameProvider.getNameStrict(e),a="instance of "+s.element;return[{kind:this.symbolKind(e),name:o,range:n.range,selectionRange:r.range,detail:a,children:[]}]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}var eb,g_;function vY(){return g_||(g_=1,eb=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),eb}var wY=vY();const bY=Ep(wY);function tb(t){const e=bY(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}class DY extends S1{parser;locator;constructor(e){super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(n_(e))return{contents:{kind:"markdown",value:tb(`
|
|
240
|
+
tag: \`${e.name}\`
|
|
241
|
+
`)}};if(Nn(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("Deployment: `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
|
|
242
|
+
`)}}}if(Mr(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id+" ",`instance of \`${r.element}\``];return i&&s.push(`### ${i.title}`,"Element: `"+i.kind+"` "),{contents:{kind:"markdown",value:s.join(`
|
|
243
|
+
`)}}}if(Wn(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"Element: `"+n.kind+"` "].join(`
|
|
244
|
+
`)}}:void 0}}}class EY extends P7{highlightElement(e,n){if(Wn(e)||Nn(e))return this.highlightNameAndKind(e,n);if(Mr(e)){"name"in e&&n({node:e,property:"name",type:je.variable,modifier:[rt.definition,rt.readonly]});return}if(Dw(e))return this.highlightView(e,n);if(MK(e))return n({node:e,property:"name",type:je.function});if(IK(e))return n({node:e,property:"name",type:je.type,modifier:[rt.definition]}),"prune";if(Gw(e)&&"kind"in e){n({node:e,property:"kind",type:je.function});return}if(zr(e)&&"kind"in e&&n({node:e,property:"kind",type:je.function}),Gh(e)||Jl(e))return n({node:e,property:"key",type:je.property}),n({node:e,property:"value",type:je.variable,modifier:[rt.definition,rt.readonly]}),"prune";if((Fw(e)||io(e))&&e.$cstNode)return n({cst:e.$cstNode,type:je.variable,modifier:[rt.definition,rt.readonly]}),"prune";if(zw(e)){e.selector&&n({node:e,property:"selector",type:je.variable,modifier:[rt.definition,rt.readonly]});return}if(s_(e)&&ue(e.value)){n({node:e,property:"value",type:je.function});return}if((IA(e)||OA(e))&&ue(e.value)){n({node:e,property:"value",type:je.type,modifier:[rt.definition,rt.readonly]});return}if(Ah(e)&&ue(e.kind))return n({node:e,property:"kind",type:je.type,modifier:[rt.definition]}),"prune";if(Ph(e)&&ue(e.tag))return n({node:e,property:"tag",type:je.type,modifier:[rt.definition]}),"prune";if(GA(e))return n({node:e,property:"value",type:e.parent?je.property:je.variable,modifier:[rt.definition,rt.readonly]}),e.parent?void 0:"prune";if(Dl(e)||UA(e))return n({node:e,property:"el",type:e.parent?je.property:je.variable,modifier:[rt.definition,rt.readonly]}),e.parent?void 0:"prune";if(Zh(e)){n({node:e,keyword:"color",type:je.keyword}),n({node:e,property:"name",type:je.type,modifier:[rt.declaration,rt.readonly]});return}if((pa(e)||ma(e)||Qh(e))&&n({node:e,property:"kind",type:je.type,modifier:[rt.declaration,rt.readonly]}),Kw(e))return n({node:e,property:"values",type:je.interface});if(n_(e))return n({node:e,property:"name",type:je.type,modifier:[rt.definition]});if((Yh(e)||Zi(e)&&ml(e.$container))&&n({node:e,property:"key",type:je.property}),Wh(e))return n({node:e,property:"key",type:je.property}),n({node:e,property:"value",type:je.number}),"prune";if(jh(e)||Br(e)||xA(e))return n({node:e,property:"key",type:je.property}),Br(e)&&(e.libicon||e.value==="none")?(n({node:e,property:e.libicon?"libicon":"value",type:je.enum,modifier:[rt.defaultLibrary]}),"prune"):("value"in e&&e.value&&n({node:e,property:"value",type:je.string}),"prune");if(Qs(e)||Xh(e)||sl(e)||Bl(e)||wh(e))return n({node:e,property:"key",type:je.property}),"value"in e&&n({node:e,property:"value",type:je.enum}),"prune"}highlightNameAndKind(e,n){n({node:e,property:"name",type:je.variable,modifier:[rt.declaration,rt.readonly]}),n({node:e,property:"kind",type:je.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:je.variable,modifier:[rt.declaration,rt.readonly,"local"]})}}const y_=Symbol.for("DeploymentsIndex");class RY{constructor(e){this.services=e,this.Names=e.references.NameProvider,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(He.IndexedContent,(n,r)=>{for(const i of n)delete i[y_]})}Names;langiumDocuments;documents(){return this.langiumDocuments.all.filter(e=>$d(e)&&e.state>=He.IndexedContent)}get(e){return e.state<He.IndexedContent&&ve(`Document ${e.uri.path} is not indexed`),e[y_]??=this.createDocumentIndex(e)}nested(e){const n=this.getFqn(e);return this.documents().flatMap(r=>this.get(r).nested(n))}byFqn(e){return this.documents().flatMap(n=>this.get(n).byFqn(e))}getFqn(e){let n=Rd.readId(e);if(ue(n))return n;const r=[this.Names.getNameStrict(e)];let i=e,s;for(;s=sn(i.$container,Nn);)r.push(this.Names.getNameStrict(s)),i=s;return n=r.reduceRight((o,a)=>`${o}.${a}`),Rd.writeId(e,n),n}createDocumentIndex(e){const n=e.parseResult.value.deployments.flatMap(l=>l.elements);if(n.length===0)return Bm.EMPTY;const r=new Array,i=new zn,s=new zn,o=this.Names,a=this.services.workspace.AstNodeDescriptionProvider,c=l=>{const d={...a.createDescription(l.node,l.name,e),fqn:l.fqn};return Rd.writeId(l.node,l.fqn),s.add(l.fqn,d),d},u=(l,d)=>{const f=[],p=l.body?.elements;if(!p||p.length===0)return[];const h=new Set;for(const v of p)if(!to(v))try{const b=o.getName(v);if(ue(b)){const g=`${d}.${b}`,w=c({node:v,name:b,fqn:g});i.add(d,w),h.add(w.name),Nn(v)&&v.body&&f.push(...u(v,g))}}catch(b){ve(b)}return f.length>0&&tt(f,Ls(Vc("name")),Op((v,b)=>{v.length>1||h.has(b)||i.add(d,v[0])})),i.get(d)};for(const l of n)try{if(to(l))continue;const d=o.getName(l);ue(d)&&(r.push(c({node:l,name:d,fqn:d})),u(l,d))}catch(d){ve(d)}return new Bm(r,i,s)}}class Bm{constructor(e,n,r){this._rootNodes=e,this._nested=n,this._byfqn=r}static EMPTY=new Bm([],new zn,new zn);rootNodes(){return this._rootNodes}byFqn(e){return this._byfqn.get(e)}nested(e){return this._nested.get(e)}unique(){const e=[];return tt([...this._byfqn.values()],Ls(Vc("name")),Op(n=>{n.length===1&&e.push(n[0])})),e}}const{findNodeForProperty:$Y}=_f,{toDocumentSegment:v_}=GF;function TY(t,e,n){const r=$Y(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:v_(e.$cstNode)},...r&&{nameSegment:v_(r)},path:t.getAstNodePath(e),type:rr}}function SY(t,e){const n=t.c4fqnIndex=new zn,r=t.parseResult.value.models.flatMap(a=>a.elements);if(r.length===0)return;const i=e.workspace.AstNodeLocator,s=Xm.from(r.map(a=>[a,null]));let o;for(;o=s.shift();)try{const[a,c]=o;if(zr(a))continue;if(ia(a)){if(Qt(a.body)&&!Fs(a.body.elements)){const u=rm(a.element);for(const l of a.body.elements)zr(l)||s.push([l,u])}continue}if(Wn(a)){const u=i2(a.name,c);if(n.add(u,{...TY(i,a,t),fqn:u}),Rd.writeId(a,u),Qt(a.body)&&!Fs(a.body.elements))for(const l of a.body.elements)zr(l)||s.push([l,u]);continue}Oe(a)}catch(a){UC(a)}}class kY{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(He.IndexedContent,async(n,r)=>{for(const i of n)if($d(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Views;try{SY(i,e)}catch(s){ve(s)}}return await Promise.resolve()}),Fe.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(Xw)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return Rd.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return st([e]).flatMap(n=>{const r=this.entries(i=>Aa(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new zn(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new Mt(()=>{const n=`${e}.`,r=new Set,i=[],s=new zn;if(this.entries(o=>o.startsWith(n)).forEach(o=>{const a=Ca(o.fqn),c={...o,name:a};Aa(o.fqn)===e?(r.add(a),s.add(a,c)):i.push(c)}),s.size+i.length===0)return null;for(const o of i)r.has(o.name)||s.add(o.name,o);return s.entriesGroupedByKey().flatMap(([o,a])=>a.length===1?a:[]).iterator()},n=>n?n.next():nn)}}function CY(t){const e=new s2({type:"directed"}),n=[];for(const r of o2(t))e.addNode(r.id,{view:r}),B0(r)&&n.push(r);if(n.length===0)return t;for(const r of n){if(!e.hasNode(r.extends)){console.warn(`View "${r.id}" extends from "${r.extends}" which does not exist`);continue}if(a2(e,r.id,r.extends)){console.warn(`View "${r.id}" extends from "${r.extends}" which creates a cycle`);continue}e.addDirectedEdge(r.id,r.extends)}return c2.topologicalSort(e).reverse().reduce((r,i)=>{const s=e.getNodeAttribute(i,"view");if(!B0(s))return r[s.id]=s,r;const o=r[s.extends];return!o||!u2(o)||(r[s.id]={...o,...s,rules:[...o.rules,...s.rules]}),r},{})}var AY=Object.getOwnPropertyNames,_Y=Object.getOwnPropertySymbols,PY=Object.prototype.hasOwnProperty;function w_(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function am(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);var c=t(n,r,i);return s.delete(n),s.delete(r),c}}function b_(t){return AY(t).concat(_Y(t))}var D_=Object.hasOwn||function(t,e){return PY.call(t,e)};function wa(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var E_="_owner",R_=Object.getOwnPropertyDescriptor,$_=Object.keys;function xY(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function IY(t,e){return wa(t.getTime(),e.getTime())}function T_(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],p=d[1],h=a.value,v=h[0],b=h[1];!u&&!r[l]&&(u=n.equals(f,v,s,l,t,e,n)&&n.equals(p,b,f,v,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function NY(t,e,n){var r=$_(t),i=r.length;if($_(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===E_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!D_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Sd(t,e,n){var r=b_(t),i=r.length;if(b_(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===E_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!D_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=R_(t,s),a=R_(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function OY(t,e){return wa(t.valueOf(),e.valueOf())}function FY(t,e){return t.source===e.source&&t.flags===e.flags}function S_(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function LY(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var MY="[object Arguments]",BY="[object Boolean]",zY="[object Date]",qY="[object Map]",jY="[object Number]",UY="[object Object]",GY="[object RegExp]",WY="[object Set]",HY="[object String]",VY=Array.isArray,k_=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,C_=Object.assign,KY=Object.prototype.toString.call.bind(Object.prototype.toString);function YY(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(l,d,f){if(l===d)return!0;if(l==null||d==null||typeof l!="object"||typeof d!="object")return l!==l&&d!==d;var p=l.constructor;if(p!==d.constructor)return!1;if(p===Object)return i(l,d,f);if(VY(l))return e(l,d,f);if(k_!=null&&k_(l))return c(l,d,f);if(p===Date)return n(l,d,f);if(p===RegExp)return o(l,d,f);if(p===Map)return r(l,d,f);if(p===Set)return a(l,d,f);var h=KY(l);return h===zY?n(l,d,f):h===GY?o(l,d,f):h===qY?r(l,d,f):h===WY?a(l,d,f):h===UY?typeof l.then!="function"&&typeof d.then!="function"&&i(l,d,f):h===MY?i(l,d,f):h===BY||h===jY||h===HY?s(l,d,f):!1}}function XY(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Sd:xY,areDatesEqual:IY,areMapsEqual:r?w_(T_,Sd):T_,areObjectsEqual:r?Sd:NY,arePrimitiveWrappersEqual:OY,areRegExpsEqual:FY,areSetsEqual:r?w_(S_,Sd):S_,areTypedArraysEqual:r?Sd:LY};if(n&&(i=C_({},i,n(i))),e){var s=am(i.areArraysEqual),o=am(i.areMapsEqual),a=am(i.areObjectsEqual),c=am(i.areSetsEqual);i=C_({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function JY(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function ZY(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(c,u){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:void 0:d,p=l.meta;return n(c,u,{cache:f,equals:i,meta:p,strict:s})};if(e)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return n(c,u,o)}}var A_=ns();ns({strict:!0}),ns({circular:!0}),ns({circular:!0,strict:!0}),ns({createInternalComparator:function(){return wa}}),ns({strict:!0,createInternalComparator:function(){return wa}}),ns({circular:!0,createInternalComparator:function(){return wa}}),ns({circular:!0,createInternalComparator:function(){return wa},strict:!0});function ns(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=XY(t),c=YY(a),u=r?r(c):JY(c);return ZY({circular:n,comparator:c,createState:i,equals:u,strict:o})}function QY(t){const e=new Map;for(const n of t)if(Sa.isElement(n)&&n.viewOf&&Et(n.extends)){const r=e.get(n.viewOf)??[];r.push(n.id),e.set(n.viewOf,r)}for(const{id:n,nodes:r}of t)for(const i of r){const s=Kd.modelRef(i);if(i.navigateTo||!s)continue;const o=HS(e.get(s)??[],a=>a!==n);o&&(i.navigateTo=o)}return t}function eX(t,e="/"){const n=tt(t,vn(c=>c.docUri),Ve(ue),Tv());if(n.length===0)return"";if(n.length===1){const c=om(n[0]).pathname.split(e);return c.length<=1?e:(c.pop(),c.join(e)+e)}Ce(Hc(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=om(r).pathname.split(e);let o=s.length;for(const c of i){if(c===r)continue;const u=om(c).pathname.split(e);for(let l=0;l<o;l++)u[l]!==s[l]&&(o=l);if(o===0)return""}const a=s.slice(0,o).join(e);return a.endsWith(e)?a:a+e}function tX(t){const e="/",n=eX(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=om(r.docUri).pathname;return n.length>0?(Ce(i.startsWith(n),`Expect path "${i}" to start with common prefix: "${n}"`),i=i.slice(n.length)):i=i.includes(e)?i.slice(i.lastIndexOf(e)+1):i,{view:r,parts:i.split(e)}}).sort((r,i)=>{if(r.parts.length!==i.parts.length)return r.parts.length-i.parts.length;for(let s=0;s<r.parts.length;s++){const o=z0(r.parts[s],i.parts[s]);if(o!==0)return o}return z0(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}function nX(t,e){const n={tags:new Set,deployments:{},elements:{},relationships:{},colors:{}},r={predicates:{},dynamicPredicates:{},styles:{}};for(const g of e){const{c4Specification:w,c4Globals:R}=g;w.tags.forEach(k=>n.tags.add(k)),Object.assign(n.elements,w.elements),Object.assign(n.relationships,w.relationships),Object.assign(n.colors,w.colors),Object.assign(n.deployments,w.deployments),Object.assign(r.predicates,R.predicates),Object.assign(r.dynamicPredicates,R.dynamicPredicates),Object.assign(r.styles,R.styles)}function i(g,w){return vn(w,R=>{try{const k=t.lsp.DocumentLinkProvider.relativeLink(g,R.url);if(k&&k!==R.url)return{...R,relative:k}}catch(k){ve(k)}return R})}const s=Yc(n.colors,g=>MF(g.color));function o(g){return({tags:w,links:R,style:{color:k,shape:A,icon:N,opacity:_,border:B},id:z,kind:Q,title:I,description:T,technology:$,metadata:L})=>{try{const V=n.elements[Q];if(!V)return Fe.warn(`No kind '${Q}' found for ${z}`),null;const H=R?i(g,R):null;return k??=V.style.color,A??=V.style.shape,N??=V.style.icon,_??=V.style.opacity,B??=V.style.border,$??=V.technology,{...k&&{color:k},...A&&{shape:A},...N&&{icon:N},...L&&!Fs(L)&&{metadata:L},...V.notation&&{notation:V.notation},style:{...B&&{border:B},...Np(_)&&{opacity:_}},links:H,tags:w??null,technology:$??null,description:T??null,title:I,kind:Q,id:z}}catch(V){ve(V)}return null}}const a=tt(e,zi(g=>vn(g.c4Elements,o(g))),Ve(ue),q0,Sv((g,w)=>{const R=Aa(w.id);return R&&Et(g[R])?(ve(`No parent found for ${w.id}`),g):(g[w.id]=w,g)},{}));function c(g){return({astPath:w,source:R,target:k,kind:A,links:N,id:_,...B})=>{if(Et(a[R])||Et(a[k]))return Fe.warn(`Invalid relation ${_} at ${g.uri.path} ${w}, source: ${R}(${!!a[R]}), target: ${k}(${!!a[k]})`),null;const z=N?i(g,N):null;return on(A)&&A in n.relationships?{...n.relationships[A],...B,...z&&{links:z},source:R,target:k,kind:A,id:_}:{...z&&{links:z},...B,source:R,target:k,id:_}}}const u=tt(e,zi(g=>vn(g.c4Relations,c(g))),Ve(ue),jS(C2),US(),kv(Vc("id")));function l(g){return w=>{if(!d2.isDeploymentNode(w)){if(!w.links||w.links.length===0)return w;const R=i(g,w.links);return{...w,links:R}}try{const R=n.deployments[w.kind];if(!R)return Fe.warn(`No kind '${w.kind}' found for ${w.id}`),null;let{technology:k=R.technology,notation:A=R.notation,links:N,style:_}=w;return{...w,...A&&{notation:A},...k&&{technology:k},style:{border:"dashed",opacity:10,...R.style,..._},links:N?i(g,N):null}}catch(R){ve(R)}return null}}const d=tt(e,zi(g=>vn(g.c4Deployments,l(g))),Ve(ue),q0,Sv((g,w)=>{const R=Aa(w.id);return R&&Et(g[R])?(ve(`No parent found for deployment element ${w.id}`),g):(g[w.id]=w,g)},{}));function f(g){return({astPath:w,source:R,target:k,kind:A,links:N,id:_,...B})=>{if(Et(d[R.id])||Et(d[k.id]))return Fe.warn(`Invalid deployment relation ${_} at ${g.uri.path} ${w}, source: ${R.id}(${!!d[R.id]}), target: ${k.id}(${!!d[k.id]})`),null;const z=N?i(g,N):null;return on(A)&&A in n.relationships?{...n.relationships[A],...B,...z&&{links:z},source:R,target:k,kind:A,id:_}:{...z&&{links:z},...B,source:R,target:k,id:_}}}const p=tt(e,zi(g=>vn(g.c4DeploymentRelations,f(g))),Ve(ue),Sv((g,w)=>Qt(g[w.id])?(ve(`Duplicate deployment relation ${w.id}`),g):(g[w.id]=w,g),{}));function h(g){const w=g.uri.toString();return R=>{let{id:k,title:A,description:N,tags:_,links:B,astPath:z,...Q}=R;R.__==="element"&&Et(A)&&"viewOf"in R&&(A=a[R.viewOf]?.title??null),Et(A)&&k==="index"&&(A="Landscape view");const I=B?i(g,B):null;return{...Q,customColorDefinitions:s,tags:_,links:I,docUri:w,description:N,title:A,id:k}}}const v=tt(e,zi(g=>vn(g.c4Views,h(g))),tX);v.some(g=>g.id==="index")||v.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:s,rules:[{include:[{wildcard:!0}]}]});const b=tt(v,kv(Vc("id")),CY);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships,deployments:n.deployments},elements:a,relations:u,globals:r,views:b,deployments:{elements:d,relations:p}}}const __="ParsedLikeC4Model",nb="ComputedLikeC4Model";class rX{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments;const n=e.likec4.ModelParser;e.shared.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.notifyListeners(i)}),e.shared.workspace.DocumentBuilder.onBuildPhase(He.Validated,async(r,i)=>{let s=[];try{Fe.debug(`[ModelBuilder] onValidated (${r.length} docs)`);for(const o of r)s.push(n.parse(o).uri)}catch(o){ve(o)}return s.length>0&&this.notifyListeners(s),await Promise.resolve()}),Fe.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){const e=this.documents();return e.length===0?(Fe.debug("[ModelBuilder] No documents to build model from"),null):this.services.WorkspaceCache.get(__,()=>(Fe.debug(`[ModelBuilder] buildModel (${e.length} docs)`),nX(this.services,e)))}async buildModel(e){return this.services.WorkspaceCache.get(__)||await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await jt(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(nb,()=>{const i=Yd.makeCompute(e),s=[];for(const a of Gc(e.views)){const c=i(a);if(!c.isSuccess){ve(c.error);continue}s.push(c.view)}QY(s);const o=gr(s,a=>{const c=this.previousViews[a.id],u=c&&A_(a,c)?c:a;return r.set(P_(a.id),u),[a.id,u]});return this.previousViews={...o},{...structuredClone(Nj(e,["specification","elements","relations","globals","deployments"])),views:o}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;return n.has(nb)?n.get(nb):await this.services.shared.workspace.WorkspaceLock.read(async()=>{e&&await jt(e);const r=this.unsafeSyncBuildModel();return r?this.unsafeSyncBuildComputedModel(r):null})}async computeView(e,n){const r=this.services.WorkspaceCache,i=P_(e);return r.has(i)?r.get(i):await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await jt(n),r.get(i,()=>{const s=this.unsafeSyncBuildModel(),o=s?.views[e];if(!o)return Fe.warn(`[ModelBuilder] Cannot find view ${e}`),null;const a=Yd.makeCompute(s)(o);if(!a.isSuccess)return ve(a.error),null;let c=a.view;const u=tt(s.views,Gc(),Ve(l2),Ve(d=>d.id!==e),Ls(d=>d.viewOf));for(const d of c.nodes)if(!d.navigateTo){const f=u[d.id];f&&(d.navigateTo=f[0].id)}const l=this.previousViews[e];return l&&A_(c,l)?c=l:this.previousViews[e]=c,c})))}onModelParsed(e){return this.listeners.push(e),Os.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(){return this.langiumDocuments.all.filter(va).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){ve(r)}}}function P_(t){return`computed-view-${t}`}const{findNodeForKeyword:iX,findNodeForProperty:cm}=_f,{getDocument:sX}=mc;class oX{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;deploymentsIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(va)}getParsedElement(e){if(GS(e)){const i=e,s=this.fqnIndex.byFqn(e).head();if(!s)return null;const o=this.langiumDocuments.getDocument(s.documentUri);return!o||!va(o)?null:o.c4Elements.find(a=>a.id===i)??null}const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=sX(e);return va(r)?r.c4Elements.find(i=>i.id===n)??null:null}locateElement(e,n){const r=this.fqnIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateDeploymentElement(e,n){const r=this.deploymentsIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateRelation(e){for(const n of this.documents()){const r=n.c4Relations.find(o=>o.id===e)??n.c4DeploymentRelations.find(o=>o.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(!zr(i)&&!to(i))continue;let s=i.title?cm(i.$cstNode,"title"):void 0;if(s??=i.kind?cm(i.$cstNode,"kind"):void 0,s??=cm(i.$cstNode,"target"),s??=i.$cstNode,!!s)return{uri:n.uri.toString(),range:s.range}}return null}locateViewAst(e){for(const n of this.documents()){const r=n.c4Views.find(s=>s.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(Dw(i))return{doc:n,view:r,viewAst:i}}return null}locateView(e){const n=this.locateViewAst(e);if(!n)return null;const r=n.viewAst;let i=r.name?cm(r.$cstNode,"name"):void 0;return i??=iX(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}var rb,x_;function aX(){if(x_)return rb;x_=1;function t(e){if(typeof e!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=e}return t.prototype.clear=function(){this.items=new WeakMap},t.prototype.get=function(e){var n=this.items.get(e);return typeof n>"u"&&(n=this.factory(e),this.items.set(e,n)),n},t.prototype.peek=function(e){return this.items.get(e)},t.prototype.set=function(e,n){return this.items.set(e,n),this},t.prototype.has=function(e){return this.items.has(e)},t.prototype.delete=function(e){return this.items.delete(e)},t.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),rb=t,rb}var cX=aX();const uX=Ep(cX),ba=["this","it","self","super","likec4lib","global"];function vt(t){return async(e,n,r)=>{try{const i=t(e,n,r);jj(i)&&await i}catch(i){ve(i)}}}const{getDocument:lX}=mc,dX=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return vt((r,i)=>{const s=n.getName(r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const o=fn(n.getNameNode(r),"name CstNode not found").range;ba.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=e.getFqn(r);e.byFqn(a).limit(2).toArray().length>1&&i("error",`Duplicate node name "${a}"`,{node:r,range:o})})},fX=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return vt((r,i)=>{const s=n.getName(r);if(!s){i("error","Deployed instance must be named, unique inside node",{node:r});return}const o=fn(n.getNameNode(r),"name CstNode not found").range;ba.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=e.getFqn(r);e.byFqn(a).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${a}"`,{node:r,range:o})})},pX=t=>{const e=t.likec4.ModelParser;return vt((n,r)=>{if(!n.source?.value?.ref){let c=n.source?.$cstNode?.text??"";r("error",`DeploymentRelation source '${c}' not resolved`,{node:n,property:"source"});return}if(!n.target?.value?.ref){let c=n.target?.$cstNode?.text??"";r("error",`DeploymentRelation target '${c}' not resolved`,{node:n,property:"target"});return}const i=lX(n),s=e.forDocument(i),o=s.parseFqnRef(n.source);if(_a.isModelRef(o)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"source"});return}const a=s.parseFqnRef(n.target);if(_a.isModelRef(a)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"target"});return}j0(o.deployment,a.deployment)&&r("error","Invalid parent-child relationship",{node:n})})},hX=t=>vt((e,n)=>{const r=d_(e.value);switch(!0){case Ah(r):case Ph(r):case io(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}}),mX=t=>{const e=t.likec4.FqnIndex;return vt((n,r)=>{const i=$n(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const o=$n(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(Um(s,a)||Um(a,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:gX}=mc,yX=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return vt((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}ba.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const o=gX(r).uri,a=n.getAstNodePath(r),c=e.byFqn(s).filter(u=>u.documentUri!==o||u.path!==a).head();if(c){const u=c.documentUri!==o;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...u&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},vX=t=>vt((e,n)=>{const r=parseFloat(e.value);(isNaN(r)||r<0||r>100)&&n("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})}),wX=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Br(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Zi(r)&&ml(r.$container)&&r.$container.props.some(i=>Br(i))&&n("warning","Redundant as icon defined on element",{node:e})},bX=t=>(e,n)=>{xi(e,Ow)||n("error","Notes can be defined only inside dynamic view",{node:e})},DX=t=>{const e=t.likec4.FqnIndex;return vt((n,r)=>{const i=$n(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let o;if(Qt(n.source)){if(o=$n(n.source),!o)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!ml(n.$container))return r("error","Sourceless relation must be nested",{node:n});o=n.$container.$container}const a=e.getFqn(o);a||r("error","Source not resolved",{node:n}),a&&s&&j0(a,s)&&r("error","Invalid parent-child relationship",{node:n})})},EX=t=>vt((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),RX=t=>vt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})}),$X=t=>vt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),TX=t=>vt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),SX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{ba.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(Ji).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==bt(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},kX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{const i="#"+n.name,s=e.allElements(es).filter(o=>o.name===i&&o.node!==n).head();if(s){const o=s.documentUri!==bt(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},CX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{ba.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Qi).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},I_=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{const i=e.allElements(oa),s=e.allElements(sa);i.concat(s).filter(o=>o.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},AX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{e.allElements(Pl).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})})},_X=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{n.name&&(ba.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Zs).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))})},PX=t=>vt((e,n)=>{const r=sn(e,mh);Nh(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=Lw(e.subject)?e.subject.subject:e.subject;switch(!0){case Dl(i):case Fw(i):case qA(i):case io(i):return;case Ah(i):case Ph(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Oe(i)}}),xX=t=>vt((e,n)=>{xi(e,Rw)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})}),IX=t=>{const e=t.likec4.ModelParser;return vt((n,r)=>{if(n.$container.$type!=="DeploymentViewRulePredicateExpression")return;const i=sn(n,_w);if(!i||i.isInclude!==!0)return;const s=bt(n),o=e.forDocument(s),a="Model reference is allowed in exclude predicate only";if(LA(n)){Pa.isModelRef(o.parseFqnExpr(n.source.from))&&r("error",a,{node:n.source,property:"from"}),Pa.isModelRef(o.parseFqnExpr(n.target))&&r("error",a,{node:n,property:"target"});return}let c;if(VA(n)?c=n.to:ZA(n)?c=n.from:c=n.inout.to,Pa.isModelRef(o.parseFqnExpr(c))){r("error",a,{node:n});return}})},NX=t=>{const e=t.likec4.ModelParser;return vt((n,r)=>{const i=n.ref.value.ref;if(Et(i)){r("error","Invalid empty reference",{node:n});return}const s=bt(n),o=e.forDocument(s).parseFqnRefExpr(n);if(n.$container.$type==="DeploymentViewRulePredicateExpression"){if(Pa.isModelRef(o)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(Pa.isDeploymentRef(o)&&_a.isInsideInstanceRef(o.ref)){r("error","Must reference deployment nodes or instances, but not internals",{node:n});return}}!Nn(i)&&on(n.selector)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"})})},OX=t=>vt((e,n)=>{if(io(e.to)&&!Uw(e.$container)){const r=sn(e,xh);Et(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),FX=t=>vt((e,n)=>{if(io(e.from)&&!xw(e.$container)){const r=sn(e,xh);Et(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),LX=t=>vt((e,n)=>{const r=sn(e,mh);Nh(r)&&n("error",'Invalid usage inside "exclude"',{node:e})});function MX(t){return e=>t.some(n=>n(e))}const BX=MX([qw,HA,WA,Al,_l,BA,_h,Ww,vw,Rw,Iw,Ow,uK,_w,pK,_A,zw,vK,$w,mK,Kw,wK,yw,Dw,Tw,Mr,Nn,to,PA,Qo,zr,fK,xA,Gh,Wn,ia,pa,ma,Qh,em,Zh,Vw]),zX=t=>{let e=t;for(;e&&!NK(e);){if(BX(e))return e;e=e.$container}};function qX(t){const e=t.diagnostics?.filter(r=>r.severity===Bc.Error)??[],n=new WeakSet;for(const{node:r}of e){if(Et(r)||n.has(r))continue;n.add(r);const i=zX(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function jX(t){Fe.debug("registerValidationChecks"),t.validation.ValidationRegistry.register({DeployedInstance:fX(t),DeploymentNode:dX(t),DeploymentRelation:pX(t),FqnRefExpr:NX(t),RelationExpr:IX(t),NotesProperty:bX(),OpacityProperty:vX(),IconProperty:wX(),SpecificationRule:RX(),Model:$X(),Globals:TX(),GlobalPredicateGroup:I_(t),GlobalDynamicPredicateGroup:I_(t),GlobalStyleId:AX(t),DynamicViewStep:mX(t),LikeC4View:_X(t),Element:yX(t),ElementKind:SX(t),Relation:DX(t),RelationBody:EX(),Tag:kX(t),DynamicViewPredicateIterator:hX(),ElementPredicateWith:PX(),RelationPredicateWith:LX(),ExpandElementExpression:xX(),RelationshipKind:CX(t),IncomingRelationExpression:OX(),OutgoingRelationExpression:FX()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)Fe.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function qr(t){return on(t)?lt(t).split(`
|
|
245
|
+
`).join(" "):void 0}function lt(t){return on(t)?tb(t).trim():void 0}class UX{constructor(e,n){this.services=e,this.doc=n,this.isValid=qX(n).isValid}isValid;resolveFqn(e){if(AA(e))return this.services.likec4.DeploymentsIndex.getFqn(e);if(ia(e))return rm(e.element);const n=this.services.likec4.FqnIndex.getFqn(e);return Ce(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!(!e||!this.isValid(e)))return gr(e.props,n=>[n.key,lt(n.value)])}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;const r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(ue);i.length>0&&r.push(...i)}}catch{}n=n.prev}return r.reverse(),sr(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return tt(e.props,Ve(jh),zi(n=>{if(!this.isValid(n))return[];const r=n.value;if(ue(r)){const i=ue(n.title)?qr(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}function kd(...t){var e=t.length>1?t.join(":::"):t[0];return f2(e)}function GX(t){return class extends t{parseDeployment(){const e=this.doc;for(const n of XK(e))try{switch(!0){case to(n):{this.isValid(n)&&e.c4DeploymentRelations.push(this.parseDeploymentRelation(n));break}case Mr(n):e.c4Deployments.push(this.parseDeployedInstance(n));break;case Nn(n):{e.c4Deployments.push(this.parseDeploymentNode(n));break}default:Oe(n)}}catch(r){ve(r)}}parseDeploymentNode(e){const n=this.isValid,r=this.resolveFqn(e),i=fn(e.kind.ref,"DeploymentKind not resolved").name,s=this.convertTags(e.body),o=e.body?.props.find(Zi)?.props,a=ts(o,n),c=this.getMetadata(e.body?.props.find(Qo)),u=tt(e.body?.props??[],Ve(n),Ve(Rl),gr(v=>[v.key,v.value||void 0])),l=lt(e.title??u.title),d=lt(u.description),f=qr(u.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Br);if(h&&n(h)){const v=h.libicon?.ref?.name??h.value;ue(v)&&(a.icon=v)}return{id:r,kind:i,title:l??Ca(r),...c&&{metadata:c},...s&&{tags:s},...p&&sr(p)&&{links:p},...ue(f)&&{technology:f},...ue(d)&&{description:d},style:a}}parseDeployedInstance(e){const n=this.isValid,r=this.resolveFqn(e),i=this.resolveFqn(fn($n(e.element),"DeployedInstance element not found")),s=this.convertTags(e.body),o=e.body?.props.find(Zi)?.props,a=ts(o,n),c=this.getMetadata(e.body?.props.find(Qo)),u=tt(e.body?.props??[],Ve(n),Ve(Rl),gr(v=>[v.key,v.value||void 0])),l=lt(e.title??u.title),d=lt(u.description),f=qr(u.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Br);if(h&&n(h)){const v=h.libicon?.ref?.name??h.value;ue(v)&&(a.icon=v)}return{id:r,element:i,...c&&{metadata:c},...l&&{title:l},...s&&{tags:s},...p&&sr(p)&&{links:p},...ue(f)&&{technology:f},...ue(d)&&{description:d},style:a}}parseDeploymentRelation(e){const n=this.isValid,r=this.getAstNodePath(e),i=_a.toDeploymentRef(this.parseFqnRef(e.source)),s=_a.toDeploymentRef(this.parseFqnRef(e.target)),o=this.convertTags(e)??this.convertTags(e.body),a=this.convertLinks(e.body),c=e.kind?.ref?.name,u=this.getMetadata(e.body?.props.find(Qo)),l=gr(e.body?.props.filter(td)??[],b=>[b.key,b.value]),d=tt(e.body?.props??[],Ve(Jl),vn(b=>b.value.view.ref?.name),Ve(ue),Vo()),f=lt(e.title??l.title),p=lt(l.description),h=qr(e.technology)??lt(l.technology),v=e.body?.props.find(Yh);return{id:kd("deployment",r,i.id,s.id),source:i,target:s,...f&&{title:f},...u&&{metadata:u},...ue(h)&&{technology:h},...ue(p)&&{description:p},...c&&{kind:c},...o&&{tags:o},...sr(a)&&{links:a},...Jw(v?.props,n),...d&&{navigateTo:d},astPath:r}}}}function WX(t){for(var e=t.length,n=0,r=0;r<e;){var i=t.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<e){var s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function HX(t,e,n){for(var r=t.length,i=n,s=0;s<r;){var o=t.charCodeAt(s++);if(o&4294967168)if(!(o&4294965248))e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){var a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}o&4294901760?(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128):(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128)}else{e[i++]=o;continue}e[i++]=o&63|128}}var VX=new TextEncoder,KX=50;function YX(t,e,n){VX.encodeInto(t,e.subarray(n))}function XX(t,e,n){t.length>KX?YX(t,e,n):HX(t,e,n)}var JX=4096;function N_(t,e,n){for(var r=e,i=r+n,s=[],o="";r<i;){var a=t[r++];if(!(a&128))s.push(a);else if((a&224)===192){var c=t[r++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){var c=t[r++]&63,u=t[r++]&63;s.push((a&31)<<12|c<<6|u)}else if((a&248)===240){var c=t[r++]&63,u=t[r++]&63,l=t[r++]&63,d=(a&7)<<18|c<<12|u<<6|l;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(a);s.length>=JX&&(o+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,s)),o}var ZX=new TextDecoder,QX=200;function eJ(t,e,n){var r=t.subarray(e,e+n);return ZX.decode(r)}function tJ(t,e,n){return n>QX?eJ(t,e,n):N_(t,e,n)}var um=function(){function t(e,n){this.type=e,this.data=n}return t}(),nJ=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jr=function(t){nJ(e,t);function e(n){var r=t.call(this,n)||this,i=Object.create(e.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:e.name}),r}return e}(Error),Cd=4294967295;function rJ(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function O_(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function F_(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function iJ(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var sJ=-1,oJ=4294967296-1,aJ=17179869184-1;function cJ(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=aJ)if(n===0&&e<=oJ){var r=new Uint8Array(4),i=new DataView(r.buffer);return i.setUint32(0,e),r}else{var s=e/4294967296,o=e&4294967295,r=new Uint8Array(8),i=new DataView(r.buffer);return i.setUint32(0,n<<2|s&3),i.setUint32(4,o),r}else{var r=new Uint8Array(12),i=new DataView(r.buffer);return i.setUint32(0,n),O_(i,4,e),r}}function uJ(t){var e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function lJ(t){if(t instanceof Date){var e=uJ(t);return cJ(e)}else return null}function dJ(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:{var n=e.getUint32(0),r=0;return{sec:n,nsec:r}}case 8:{var i=e.getUint32(0),s=e.getUint32(4),n=(i&3)*4294967296+s,r=i>>>2;return{sec:n,nsec:r}}case 12:{var n=F_(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new jr("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function fJ(t){var e=dJ(t);return new Date(e.sec*1e3+e.nsec/1e6)}var pJ={type:sJ,encode:lJ,decode:fJ},L_=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(pJ)}return t.prototype.register=function(e){var n=e.type,r=e.encode,i=e.decode;if(n>=0)this.encoders[n]=r,this.decoders[n]=i;else{var s=1+n;this.builtInEncoders[s]=r,this.builtInDecoders[s]=i}},t.prototype.tryToEncode=function(e,n){for(var r=0;r<this.builtInEncoders.length;r++){var i=this.builtInEncoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=-1-r;return new um(o,s)}}}for(var r=0;r<this.encoders.length;r++){var i=this.encoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=r;return new um(o,s)}}}return e instanceof um?e:null},t.prototype.decode=function(e,n,r){var i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new um(n,e)},t.defaultCodec=new t,t}();function lm(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}function hJ(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=lm(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var mJ=100,gJ=2048,yJ=function(){function t(e){var n,r,i,s,o,a,c,u;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:L_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxDepth=(i=e?.maxDepth)!==null&&i!==void 0?i:mJ,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:gJ,this.sortKeys=(o=e?.sortKeys)!==null&&o!==void 0?o:!1,this.forceFloat32=(a=e?.forceFloat32)!==null&&a!==void 0?a:!1,this.ignoreUndefined=(c=e?.ignoreUndefined)!==null&&c!==void 0?c:!1,this.forceIntegerToFloat=(u=e?.forceIntegerToFloat)!==null&&u!==void 0?u:!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return t.prototype.reinitializeState=function(){this.pos=0},t.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},t.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},t.prototype.doEncode=function(e,n){if(n>this.maxDepth)throw new Error("Too deep objects in depth ".concat(n));e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)},t.prototype.ensureBufferSizeToWrite=function(e){var n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)},t.prototype.resizeBuffer=function(e){var n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r},t.prototype.encodeNil=function(){this.writeU8(192)},t.prototype.encodeBoolean=function(e){e===!1?this.writeU8(194):this.writeU8(195)},t.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},t.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},t.prototype.encodeBigInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},t.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error("Too long string: ".concat(e," bytes in UTF-8"))},t.prototype.encodeString=function(e){var n=5,r=WX(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),XX(e,this.bytes,this.pos),this.pos+=r},t.prototype.encodeObject=function(e,n){var r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)))},t.prototype.encodeBinary=function(e){var n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error("Too large binary: ".concat(n));var r=lm(e);this.writeU8a(r)},t.prototype.encodeArray=function(e,n){var r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error("Too large array: ".concat(r));for(var i=0,s=e;i<s.length;i++){var o=s[i];this.doEncode(o,n+1)}},t.prototype.countWithoutUndefined=function(e,n){for(var r=0,i=0,s=n;i<s.length;i++){var o=s[i];e[o]!==void 0&&r++}return r},t.prototype.encodeMap=function(e,n){var r=Object.keys(e);this.sortKeys&&r.sort();var i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error("Too large map object: ".concat(i));for(var s=0,o=r;s<o.length;s++){var a=o[s],c=e[a];this.ignoreUndefined&&c===void 0||(this.encodeString(a),this.doEncode(c,n+1))}},t.prototype.encodeExtension=function(e){var n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error("Too large extension object: ".concat(n));this.writeI8(e.type),this.writeU8a(e.data)},t.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},t.prototype.writeU8a=function(e){var n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n},t.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},t.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},t.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},t.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},t.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},t.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},t.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},t.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),rJ(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),O_(this.view,this.pos,e),this.pos+=8},t.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},t.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},t}();function vJ(t,e){var n=new yJ(e);return n.encodeSharedRef(t)}function ib(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var wJ=16,bJ=16,DJ=function(){function t(e,n){e===void 0&&(e=wJ),n===void 0&&(n=bJ),this.maxKeyLength=e,this.maxLengthPerKey=n,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return t.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},t.prototype.find=function(e,n,r){var i=this.caches[r-1];e:for(var s=0,o=i;s<o.length;s++){for(var a=o[s],c=a.bytes,u=0;u<r;u++)if(c[u]!==e[n+u])continue e;return a.str}return null},t.prototype.store=function(e,n){var r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)},t.prototype.decode=function(e,n,r){var i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;var s=N_(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s},t}(),EJ=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(d){o(d)}}function c(l){try{u(r.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},sb=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},M_=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}},Da=function(t){return this instanceof Da?(this.v=t,this):new Da(t)},RJ=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(p){return new Promise(function(h,v){s.push([f,p,h,v])>1||a(f,p)})})}function a(f,p){try{c(r[f](p))}catch(h){d(s[0][3],h)}}function c(f){f.value instanceof Da?Promise.resolve(f.value.v).then(u,l):d(s[0][2],f)}function u(f){a("next",f)}function l(f){a("throw",f)}function d(f,p){f(p),s.shift(),s.length&&a(s[0][0],s[0][1])}},B_="array",dm="map_key",$J="map_value",TJ=function(t){return typeof t=="string"||typeof t=="number"},Ad=-1,ob=new DataView(new ArrayBuffer(0)),SJ=new Uint8Array(ob.buffer);try{ob.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ab=RangeError,z_=new ab("Insufficient data"),kJ=new DJ,CJ=function(){function t(e){var n,r,i,s,o,a,c;this.totalPos=0,this.pos=0,this.view=ob,this.bytes=SJ,this.headByte=Ad,this.stack=[],this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:L_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxStrLength=(i=e?.maxStrLength)!==null&&i!==void 0?i:Cd,this.maxBinLength=(s=e?.maxBinLength)!==null&&s!==void 0?s:Cd,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:Cd,this.maxMapLength=(a=e?.maxMapLength)!==null&&a!==void 0?a:Cd,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:Cd,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:kJ}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=Ad,this.stack.length=0},t.prototype.setBuffer=function(e){this.bytes=lm(e),this.view=hJ(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===Ad&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=lm(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}},t.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},t.prototype.createExtraByteError=function(e){var n=this,r=n.view,i=n.pos;return new RangeError("Extra ".concat(r.byteLength-i," of ").concat(r.byteLength," byte(s) found at buffer[").concat(e,"]"))},t.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n},t.prototype.decodeMulti=function(e){return sb(this,function(n){switch(n.label){case 0:this.reinitializeState(),this.setBuffer(e),n.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})},t.prototype.decodeAsync=function(e){var n,r,i,s,o,a,c;return EJ(this,void 0,void 0,function(){var u,l,d,f,p,h,v,b;return sb(this,function(g){switch(g.label){case 0:u=!1,g.label=1;case 1:g.trys.push([1,6,7,12]),n=!0,r=M_(e),g.label=2;case 2:return[4,r.next()];case 3:if(i=g.sent(),s=i.done,!!s)return[3,5];c=i.value,n=!1;try{if(d=c,u)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{l=this.doDecodeSync(),u=!0}catch(w){if(!(w instanceof ab))throw w}this.totalPos+=this.pos}finally{n=!0}g.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return f=g.sent(),o={error:f},[3,12];case 7:return g.trys.push([7,,10,11]),!n&&!s&&(a=r.return)?[4,a.call(r)]:[3,9];case 8:g.sent(),g.label=9;case 9:return[3,11];case 10:if(o)throw o.error;return[7];case 11:return[7];case 12:if(u){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,l]}throw p=this,h=p.headByte,v=p.pos,b=p.totalPos,new RangeError("Insufficient data in parsing ".concat(ib(h)," at ").concat(b," (").concat(v," in the current buffer)"))}})})},t.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},t.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},t.prototype.decodeMultiAsync=function(e,n){return RJ(this,arguments,function(){var i,s,o,a,c,u,l,d,f,p,h,v;return sb(this,function(b){switch(b.label){case 0:i=n,s=-1,b.label=1;case 1:b.trys.push([1,15,16,21]),o=!0,a=M_(e),b.label=2;case 2:return[4,Da(a.next())];case 3:if(c=b.sent(),f=c.done,!!f)return[3,14];v=c.value,o=!1,b.label=4;case 4:if(b.trys.push([4,,12,13]),u=v,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(u),i&&(s=this.readArraySize(),i=!1,this.complete()),b.label=5;case 5:b.trys.push([5,10,,11]),b.label=6;case 6:return[4,Da(this.doDecodeSync())];case 7:return[4,b.sent()];case 8:return b.sent(),--s===0?[3,9]:[3,6];case 9:return[3,11];case 10:if(l=b.sent(),!(l instanceof ab))throw l;return[3,11];case 11:return this.totalPos+=this.pos,[3,13];case 12:return o=!0,[7];case 13:return[3,2];case 14:return[3,21];case 15:return d=b.sent(),p={error:d},[3,21];case 16:return b.trys.push([16,,19,20]),!o&&!f&&(h=a.return)?[4,Da(h.call(a))]:[3,18];case 17:b.sent(),b.label=18;case 18:return[3,20];case 19:if(p)throw p.error;return[7];case 20:return[7];case 21:return[2]}})})},t.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),n=void 0;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){var r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){var r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{var i=e-160;n=this.decodeUtf8String(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){var i=this.lookU8();n=this.decodeUtf8String(i,1)}else if(e===218){var i=this.lookU16();n=this.decodeUtf8String(i,2)}else if(e===219){var i=this.lookU32();n=this.decodeUtf8String(i,4)}else if(e===220){var r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){var r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){var r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){var r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){var r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){var r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){var r=this.lookU32();n=this.decodeBinary(r,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){var r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){var r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){var r=this.lookU32();n=this.decodeExtension(r,4)}else throw new jr("Unrecognized type byte: ".concat(ib(e)));this.complete();for(var s=this.stack;s.length>0;){var o=s[s.length-1];if(o.type===B_)if(o.array[o.position]=n,o.position++,o.position===o.size)s.pop(),n=o.array;else continue e;else if(o.type===dm){if(!TJ(n))throw new jr("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new jr("The key __proto__ is not allowed");o.key=n,o.type=$J;continue e}else if(o.map[o.key]=n,o.readCount++,o.readCount===o.size)s.pop(),n=o.map;else{o.key=null,o.type=dm;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===Ad&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=Ad},t.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new jr("Unrecognized array type byte: ".concat(ib(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new jr("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:dm,size:e,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new jr("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:B_,size:e,array:new Array(e),position:0})},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new jr("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw z_;var i=this.pos+n,s;return this.stateIsMapKey()&&(!((r=this.keyDecoder)===null||r===void 0)&&r.canBeCached(e))?s=this.keyDecoder.decode(this.bytes,i,e):s=tJ(this.bytes,i,e),this.pos+=n+e,s},t.prototype.stateIsMapKey=function(){if(this.stack.length>0){var e=this.stack[this.stack.length-1];return e.type===dm}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new jr("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw z_;var r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i},t.prototype.decodeExtension=function(e,n){if(e>this.maxExtLength)throw new jr("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},t.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},t.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},t.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},t.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},t.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},t.prototype.readU64=function(){var e=iJ(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=F_(this.view,this.pos);return this.pos+=8,e},t.prototype.readU64AsBigInt=function(){var e=this.view.getBigUint64(this.pos);return this.pos+=8,e},t.prototype.readI64AsBigInt=function(){var e=this.view.getBigInt64(this.pos);return this.pos+=8,e},t.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},t.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},t}();function AJ(t,e){var n=new CJ(e);return n.decode(t)}const _J=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",PJ=(t,e=0,n=t.byteLength-e)=>{if(!_J(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Wm.from(t,e,n)},q_=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Wm.from(t,e):Wm.from(t)},xJ=/^[A-Za-z0-9+/]*={0,2}$/,IJ=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!xJ.exec(t))throw new TypeError("Invalid base64 string.");const e=q_(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},NJ=t=>{const e=q_(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},OJ=t=>{let e;if(typeof t=="string"?e=NJ(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return PJ(e.buffer,e.byteOffset,e.byteLength).toString("base64")},{getDocument:FJ}=mc;function LJ({nodes:t,edges:e,...n}){return{...n,nodes:Yc(t,({x:r,y:i,width:s,height:o,isCompound:a,...c})=>({...c,b:[r,i,s,o],c:a})),edges:Yc(e,({points:r,controlPoints:i,labelBBox:s,dotpos:o,...a})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!o&&{dp:o},...a,p:r}))}}function MJ({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:p2(n)?{direction:n}:n,nodes:Yc(t,({b:i,c:s,...o})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...o})),edges:Yc(e,({p:i,cp:s,l:o,dp:a,...c})=>({...!!s&&{controlPoints:s},...!!o&&{labelBBox:o},...!!a&&{dotpos:a},...c,points:i}))}}const j_=500;function BJ(t){const e=vJ(LJ(t)),n=OJ(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+j_,n.length))),i+=j_;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
|
|
246
|
+
`)}function U_(t){return t.includes("@likec4-generated")}function zJ(t){if(!U_(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
|
|
247
|
+
`).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=IJ(e);return MJ(AJ(n))}function cb(t){const e=df(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!U_(e.text)))try{return zJ(e.text)}catch(n){const r=FJ(t);Fe.warn(n),Fe.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function qJ(t){return class extends t{parseDeploymentView(e){const n=e.body;Ce(n,"DynamicElementView body is not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+kd(this.doc.uri.toString(),i));const o=qr(r.find(d=>d.key==="title")?.value)??null,a=lt(r.find(d=>d.key==="description")?.value)??null,c=this.convertTags(n),u=this.convertLinks(n);im.writeId(e,s);const l=cb(e);return{__:"deployment",id:s,astPath:i,title:o,description:a,tags:c,links:sr(u)?u:null,rules:n.rules.flatMap(d=>{try{return this.isValid(d)?this.parseDeploymentViewRule(d):[]}catch(f){return ve(f),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(_w(e))return this.parseDeploymentViewRulePredicate(e);if(ad(e))return Zw(e);if(SK(e))return this.parseDeploymentViewRuleStyle(e);Oe(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;if(on(i)&&this.isValid(i))switch(!0){case hK(i):n.unshift(this.parseFqnExpr(i));break;case _A(i):n.unshift(this.parseRelationExpr(i));break;default:Oe(i)}}catch(i){ve(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=e.props.filter($w),r=e.props.find(la),i=lt(r?.value);return{targets:this.parseFqnExpressions(e.targets),...i&&{notation:i},style:{...ts(n,this.isValid)}}}}}function jJ(t){let e;for(;e=t.value?.ref;){if(Nn(e))return null;if(Mr(e))return e;if(Et(t.parent))return null;t=t.parent}return null}function UJ(t){return class extends t{parseFqnRef(e){const n=fn(e.value.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(Wn(n)){const r=jJ(e);if(!r)return{model:this.resolveFqn(n)};const i=this.resolveFqn(r),s=this.resolveFqn(n);return{deployment:i,element:s}}if(AA(n))return{deployment:this.resolveFqn(n)};Oe(n)}parseFqnExpr(e){if(io(e))return{wildcard:!0};if(zw(e))return this.parseFqnRefExpr(e);Oe(e)}parseFqnRefExpr(e){const n=this.parseFqnRef(e.ref);switch(!0){case e.selector==="._":return{ref:n,selector:"expanded"};case e.selector===".**":return{ref:n,selector:"descendants"};case e.selector===".*":return{ref:n,selector:"children"};default:return{ref:n}}}parseFqnExpressions(e){const n=[];let r=e;for(;r;){try{on(r.value)&&this.isValid(r.value)&&n.push(this.parseFqnExpr(r.value))}catch(i){ve(i)}r=r.prev}return n.reverse()}parseRelationExpr(e){if(LA(e))return{source:this.parseFqnExpr(e.source.from),target:this.parseFqnExpr(e.target),isBidirectional:e.source.isBidirectional};if(xK(e))return{inout:this.parseFqnExpr(e.inout.to)};if(ZA(e))return{outgoing:this.parseFqnExpr(e.from)};if(VA(e))return{incoming:this.parseFqnExpr(e.to)};Oe(e)}}}function GJ(t){return class extends t{parseGlobals(){const{parseResult:e,c4Globals:n}=this.doc,r=this.isValid,i=e.value.globals.filter(r),s=i.flatMap(a=>a.predicates.filter(r));for(const a of s)try{const c=a.name;if(!ue(c))continue;if(c in n.predicates){Fe.warn(`Global predicate named "${c}" is already defined`);continue}this.parseAndStoreGlobalPredicateGroupOrDynamic(a,c,n)}catch(c){ve(c)}const o=i.flatMap(a=>a.styles.filter(r));for(const a of o)try{const c=a.id.name;if(!ue(c))continue;if(c in n.styles){Fe.warn(`Global style named "${c}" is already defined`);continue}const u=this.parseGlobalStyleOrGroup(a);u.length>0&&(n.styles[c]=u)}catch(c){ve(c)}}parseAndStoreGlobalPredicateGroupOrDynamic(e,n,r){if(HA(e)){const i=this.parseGlobalPredicateGroup(e);i.length>0&&(r.predicates[n]=i);return}if(WA(e)){const i=this.parseGlobalDynamicPredicateGroup(e);i.length>0&&(r.dynamicPredicates[n]=i);return}Oe(e)}parseGlobalPredicateGroup(e){return e.predicates.map(n=>this.parseViewRulePredicate(n))}parseGlobalDynamicPredicateGroup(e){return e.predicates.map(n=>this.parseDynamicViewIncludePredicate(n))}parseGlobalStyleOrGroup(e){if(Al(e))return[this.parseViewRuleStyle(e)];if(_l(e))return e.styles.map(n=>this.parseViewRuleStyle(n));Oe(e)}}}function WJ(t){return class extends t{parseModel(){const e=this.doc;for(const n of YK(e))try{if(Wn(n)){e.c4Elements.push(this.parseElement(n));continue}if(zr(n)){this.isValid(n)&&e.c4Relations.push(this.parseRelation(n));continue}Oe(n)}catch(r){ve(r)}}parseElement(e){const n=this.isValid,r=this.resolveFqn(e),i=fn(e.kind.ref,"Element kind is not resolved").name,s=this.parseTags(e.body),o=e.body?.props.find(Zi)?.props,a=ts(o,n),c=this.getMetadata(e.body?.props.find(Qo)),u=this.getAstNodePath(e);let[l,d,f]=e.props??[];const p=tt(e.body?.props??[],Ve(n),Ve(Rl),gr(b=>[b.key,b.value||void 0]));l=lt(l??p.title),d=lt(p.description??d),f=qr(p.technology??f);const h=this.parseLinks(e.body),v=e.body?.props.find(Br);if(v&&n(v)){const b=v.libicon?.ref?.name??v.value;ue(b)&&(a.icon=b)}return{id:r,kind:i,astPath:u,title:l??e.name,...c&&{metadata:c},...s&&{tags:s},...h&&sr(h)&&{links:h},...ue(f)&&{technology:f},...ue(d)&&{description:d},style:a}}parseRelation(e){const n=this.isValid,r=JK(e),i=this.resolveFqn(r.target),s=this.resolveFqn(r.source),o=this.parseTags(e)??this.parseTags(e.body),a=this.parseLinks(e.body),c=e.kind?.ref?.name,u=this.getMetadata(e.body?.props.find(Qo)),l=this.getAstNodePath(e),d=gr(e.body?.props.filter(td).filter(g=>on(g.value))??[],g=>[g.key,g.value]),f=tt(e.body?.props??[],Ve(Jl),vn(g=>g.value.view.ref?.name),Ve(ue),Vo()),p=lt(e.title??d.title)??"",h=lt(d.description),v=qr(e.technology)??lt(d.technology),b=e.body?.props.find(Yh);return{id:kd(l,s,i),astPath:l,source:s,target:i,title:p,...u&&{metadata:u},...ue(v)&&{technology:v},...ue(h)&&{description:h},...c&&{kind:c},...o&&{tags:o},...sr(a)&&{links:a},...Jw(b?.props,n),...f&&{navigateTo:f}}}}}const G_=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function _d(t){switch(!0){case RK(t):{const e=t.value?.ref?.name;return Ce(e,"Expected tag name"),{tag:G_(t,e)}}case DK(t):{const e=t.value?.ref?.name;return Ce(e,"Expected kind name"),{kind:G_(t,e)}}case(i_(t)||o_(t)):return{not:_d(t.value)};case qK(t):{const e=_d(t.left),n=_d(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[G0(e)?e.and:e,G0(n)?n.and:n].flat();return Ce(sr(i),"Expected non-empty array"),{and:i}}case"or":{const i=[U0(e)?e.or:e,U0(n)?n.or:n].flat();return Ce(sr(i),"Expected non-empty array"),{or:i}}default:Oe(r)}}default:Oe(t)}}function HJ(t){return class extends t{parsePredicate(e){if(lK(e))return this.parseElementPredicate(e);if(gK(e))return this.parseRelationPredicate(e);Oe(e)}parseElementPredicate(e){if(_h(e))return this.parseElementPredicateWith(e);if(Lw(e))return this.parseElementPredicateWhere(e);if(vw(e))return this.parseElementExpression(e);Oe(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{r.value&&n.unshift(this.parseElementExpression(r.value))}catch(i){ve(i)}r=r.prev}return n}parseElementExpression(e){if(io(e))return{wildcard:!0};if(Ah(e))return Ce(e.kind?.ref,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.ref.name,isEqual:e.isEqual};if(Ph(e)){Ce(e.tag?.ref,"ElementTagExpr tag is not resolved: "+e.$cstNode?.text);let n=e.tag.$refText;return n.startsWith("#")&&(n=n.slice(1)),{elementTag:n,isEqual:e.isEqual}}if(qA(e)){const n=$n(e.expand);return Ce(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(Fw(e)){const n=$n(e.parent);return Ce(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isChildren:e.suffix===".*",isDescendants:e.suffix===".**"}}if(Dl(e)){const n=$n(e);return Ce(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Oe(e)}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpression(e.subject),condition:e.where?_d(e.where):{kind:{neq:"--always-true--"}}}}}parseElementPredicateWith(e){const n=this.parseElementPredicate(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(!this.isValid(i))return r;if(Gh(i)){const s=i.value.view.$refText;return ue(s)&&(r.custom.navigateTo=s),r}if(Rl(i))return Qt(i.value)&&(r.custom[i.key]=lt(i.value)||""),r;if(Br(i)){const s=i.libicon?.ref?.name??i.value;return Qt(s)&&(r.custom[i.key]=s),r}if(Qs(i)){const s=Td(i);return Qt(s)&&(r.custom[i.key]=s),r}if(Xh(i)||wh(i))return Qt(i.value)&&(r.custom[i.key]=i.value),r;if(Wh(i))return Qt(i.value)&&(r.custom[i.key]=l_(i)),r;if(la(i))return ue(i.value)&&(r.custom[i.key]=lt(i.value)),r;Oe(i)},{custom:{expr:n}})}parseRelationPredicate(e){if(Ww(e)){let n=e_(e.subject)?this.parseRelationPredicateWhere(e.subject):this.parseRelationExpression(e.subject);return this.parseRelationPredicateWith(e,n)}if(e_(e))return this.parseRelationPredicateWhere(e);if(Rw(e))return this.parseRelationExpression(e);Oe(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpression(e.subject),condition:e.where?_d(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){return(e.custom?.props??[]).reduce((r,i)=>{if(td(i)||la(i)||JA(i))return Qt(i.value)&&(r.customRelation[i.key]=lt(i.value)??""),r;if(sl(i))return ue(i.value)&&(r.customRelation[i.key]=i.value),r;if(Qs(i)){const s=Td(i);return ue(s)&&(r.customRelation[i.key]=s),r}if(Bl(i))return ue(i.value)&&(r.customRelation[i.key]=i.value),r;if(Jl(i)){const s=i.value.view.ref?.name;return ue(s)&&(r.customRelation.navigateTo=s),r}Oe(i)},{customRelation:{relation:n}})}parseRelationExpression(e){if(xw(e))return{source:this.parseElementExpression(e.source.from),target:this.parseElementExpression(e.target),isBidirectional:e.source.isBidirectional};if(Uw(e))return{inout:this.parseElementExpression(e.inout.to)};if(Gw(e))return{outgoing:this.parseElementExpression(e.from)};if(KA(e))return{incoming:this.parseElementExpression(e.to)};Oe(e)}}}function VJ(t){return class extends t{parseSpecification(){const{parseResult:{value:{specifications:e}},c4Specification:n}=this.doc,r=this.isValid,i=e.flatMap(u=>u.elements.filter(this.isValid));for(const{kind:u,props:l}of i)try{const d=u.name;if(!ue(d))continue;if(d in n.elements){Fe.warn(`Element kind "${d}" is already defined`);continue}const f=l.find(Zi),p=tt(l.filter(Hw)??[],Ve(h=>this.isValid(h)&&on(h.value)),gr(h=>[h.key,lt(h.value)]));n.elements[d]={...p,style:{...ts(f?.props,this.isValid)}}}catch(d){ve(d)}const s=e.flatMap(u=>u.relationships.filter(this.isValid));for(const{kind:u,props:l}of s)try{const d=u.name;if(!ue(d))continue;if(d in n.relationships){Fe.warn(`Relationship kind "${d}" is already defined`);continue}const f=tt(l.filter(t_)??[],Ve(p=>this.isValid(p)&&on(p.value)),gr(p=>[p.key,lt(p.value)]));n.relationships[d]={...f,...Jw(l,this.isValid)}}catch(d){ve(d)}const o=e.flatMap(u=>u.tags.filter(this.isValid));for(const u of o){const l=u.tag.name;ue(l)&&n.tags.add(l)}const a=e.flatMap(u=>u.deploymentNodes.filter(r));for(const u of a)try{Object.assign(n.deployments,this.parseSpecificationDeploymentNodeKind(u))}catch(l){ve(l)}const c=e.flatMap(u=>u.colors.filter(r));for(const{name:u,color:l}of c)try{const d=u.name;if(d in n.colors){Fe.warn(`Custom color "${d}" is already defined`);continue}n.colors[d]={color:l}}catch(d){ve(d)}}parseSpecificationDeploymentNodeKind({kind:e,props:n}){const r=e.name;if(!ue(r))throw new Error("DeploymentNodeKind name is not resolved");const i=n.find(Zi),s=tt(n.filter(Hw)??[],Ve(o=>this.isValid(o)&&on(o.value)),gr(o=>[o.key,lt(o.value)]));return{[r]:{...s,style:{...ts(i?.props,this.isValid)}}}}}}function KJ(t){return class extends t{parseViews(){const e=this.isValid;for(const n of this.doc.parseResult.value.views){const r=n.styles.flatMap(i=>{try{return e(i)?this.parseViewRuleStyleOrGlobalRef(i):[]}catch(s){return ve(s),[]}});for(const i of n.views)try{if(!e(i))continue;switch(!0){case xh(i):this.doc.c4Views.push(this.parseElementView(i,r));break;case MA(i):this.doc.c4Views.push(this.parseDynamicElementView(i,r));break;case FA(i):this.doc.c4Views.push(this.parseDeploymentView(i));break;default:Oe(i)}}catch(s){ve(s)}}}parseElementView(e,n){const r=e.body;Ce(r,"ElementView body is not defined");const i=this.getAstNodePath(e);let s=null;if("viewOf"in e){const p=$n(e.viewOf),h=p&&this.resolveFqn(p);h?s=h:Fe.warn("viewOf is not resolved: "+e.$cstNode?.text)}let o=e.name;o||(o="view_"+kd(this.doc.uri.toString(),i,s??""));const a=qr(r.props.find(p=>p.key==="title")?.value)??null,c=lt(r.props.find(p=>p.key==="description")?.value)??null,u=this.convertTags(r),l=this.convertLinks(r),d=cb(e),f={__:"element",id:o,astPath:i,title:a,description:c,tags:u,links:sr(l)?l:null,rules:[...n,...r.rules.flatMap(p=>{try{return this.isValid(p)?this.parseViewRule(p):[]}catch(h){return ve(h),[]}})],...s&&{viewOf:s},...d&&{manualLayout:d}};if(im.writeId(e,f.id),"extends"in e){const p=e.extends.view.ref;return Ce(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(f,{extends:p.name})}return f}parseViewRule(e){if(mh(e))return this.parseViewRulePredicate(e);if(BK(e))return this.parseViewRuleGlobalPredicateRef(e);if(Tw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(ad(e))return Zw(e);if(nm(e))return this.parseViewRuleGroup(e);Oe(e)}parseViewRulePredicate(e){const n=[];let r=e.predicates;for(;r;){const{value:i,prev:s}=r;try{ue(i)&&this.isValid(i)&&n.unshift(this.parsePredicate(i))}catch(o){ve(o)}if(!s)break;r=s}return jw(e)?{include:n}:{exclude:n}}parseViewRuleGlobalPredicateRef(e){return{predicateId:e.predicate.$refText}}parseViewRuleStyleOrGlobalRef(e){if(fd(e))return this.parseViewRuleStyle(e);if(r_(e))return this.parseViewRuleGlobalStyle(e);Oe(e)}parseViewRuleGroup(e){const n=[];for(const r of e.groupRules)try{if(!this.isValid(r))continue;if(mh(r)){n.push(this.parseViewRulePredicate(r));continue}if(nm(r)){n.push(this.parseViewRuleGroup(r));continue}Oe(r)}catch(i){ve(i)}return{title:qr(e.title)??null,groupRules:n,...ts(e.props,this.isValid)}}parseViewRuleStyle(e){const n=e.props.filter($w),r=e.target,i=e.props.find(la);return this.parseRuleStyle(n,r,i)}parseRuleStyle(e,n,r){const i=ts(e,this.isValid),s=lt(r?.value);return{targets:this.parseElementExpressionsIterator(n),...s&&{notation:s},style:{...i}}}parseViewRuleGlobalStyle(e){return{styleId:e.style.$refText}}parseDynamicElementView(e,n){const r=e.body;Ce(r,"DynamicElementView body is not defined");const i=this.isValid,s=r.props.filter(i),o=this.getAstNodePath(e);let a=e.name;a||(a="dynamic_"+kd(this.doc.uri.toString(),o));const c=qr(s.find(p=>p.key==="title")?.value)??null,u=lt(s.find(p=>p.key==="description")?.value)??null,l=this.convertTags(r),d=this.convertLinks(r);im.writeId(e,a);const f=cb(e);return{__:"dynamic",id:a,astPath:o,title:c,description:u,tags:l,links:sr(d)?d:null,rules:[...n,...r.rules.flatMap(p=>{try{return i(p)?this.parseDynamicViewRule(p):[]}catch(h){return ve(h),[]}},[])],steps:r.steps.reduce((p,h)=>{try{i(h)&&(Iw(h)?p.push(this.parseDynamicParallelSteps(h)):p.push(this.parseDynamicStep(h)))}catch(v){ve(v)}return p},[]),...f&&{manualLayout:f}}}parseDynamicViewRule(e){if(AK(e))return this.parseDynamicViewIncludePredicate(e);if(CK(e))return this.parseViewRuleGlobalPredicateRef(e);if(Tw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(ad(e))return Zw(e);Oe(e)}parseDynamicViewIncludePredicate(e){const n=[];let r=e.predicates;for(;r;){try{if(on(r.value)&&this.isValid(r.value)){const i=this.parseElementPredicate(r.value);n.unshift(i)}}catch(i){ve(i)}r=r.prev}return{include:n}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=$n(e.source);if(!n)throw new Error("Invalid reference to source");const r=$n(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const o=lt(e.title)??null;let a={source:i,target:s,title:o};if(e.isBackward&&(a={source:s,target:i,title:o,isBackward:!0}),!Uj(e.custom?.props))return a;for(const c of e.custom.props)try{switch(!0){case Jl(c):{const u=c.value.view.ref?.name;ue(u)&&(a.navigateTo=u);break}case td(c):case la(c):case JA(c):{Qt(c.value)&&(a[c.key]=lt(c.value)??"");break}case sl(c):{Qt(c.value)&&(a[c.key]=c.value);break}case Qs(c):{const u=Td(c);Qt(u)&&(a[c.key]=u);break}case Bl(c):{Qt(c.value)&&(a[c.key]=c.value);break}default:Oe(c)}}catch(u){ve(u)}return a}}}const YJ=tt(UX,UJ,WJ,GX,qJ,HJ,VJ,KJ,GJ);class XJ extends YJ{}class JJ{constructor(e){this.services=e}cachedParsers=new uX(e=>new XJ(this.services,e));parse(e){Ce(Xw(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`);try{e=Object.assign(e,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{},deployments:{}},c4Elements:[],c4Relations:[],c4Deployments:[],c4DeploymentRelations:[],c4Globals:{predicates:{},dynamicPredicates:{},styles:{}},c4Views:[]});const n=this.cachedParsers.get(e);return n.parseSpecification(),n.parseModel(),n.parseGlobals(),n.parseDeployment(),n.parseViews(),n.doc}catch(n){throw new Error(`Error parsing document ${e.uri.toString()}`,{cause:n})}}forDocument(e){return Ce(Xw(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`),this.cachedParsers.get(e)}}const{findNodeForKeyword:ZJ,findNodeForProperty:vle}=_f,QJ=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...Fp(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},eZ=(t,e)=>n=>{if(!fd(n))return!1;const r=n.target.value;if(!r||ue(n.target.prev)||!Dl(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function tZ(t,{view:e,viewAst:n,targets:r,style:i}){Ce(n.body,`View ${e.id} has no body`);const s=n.$cstNode;Ce(s,"viewCstNode");const o=Kc(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;Ce(o,"insertPos is not defined");const a=s.range.start.character+2,c=t.likec4.FqnIndex,u=Ve(n.body.rules,fd),l=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach(b=>{const g=VS(u,eZ(b,c)),w=l&&Um(l,b)?b.substring(l.length+1):b;g?d.push({fqn:w,rule:g}):f.push({fqn:w})});const p={start:o,end:o},h=b=>{b.start.line<=p.start.line&&(b.start.line==p.start.line?p.start.character=Math.min(b.start.character,p.start.character):p.start=b.start),b.end.line>=p.end.line&&(b.end.line==p.end.line?p.end.character=Math.max(b.end.character,p.end.character):p.end=b.end)},v=[];if(f.length>0){const b=f.flatMap(({fqn:g})=>QJ(g,i,a));v.push(In.insert(o,`
|
|
248
|
+
`+b.join(`
|
|
249
|
+
`))),p.start={line:o.line+1,character:a},p.end={line:o.line+b.length,character:Kc(b)?.length??0}}if(d.length>0)for(const{rule:b}of d){const g=b.$cstNode;Ce(g,"RuleCstNode not found");for(const[w,R]of Fp(i)){const k=w==="opacity"?R.toString()+"%":R,A=b.props.find(z=>z.key===w);if(A&&A.$cstNode){const{range:{start:z,end:Q}}=A.$cstNode;h({start:z,end:Q}),v.push(In.replace({start:z,end:Q},w+" "+k));continue}const N=ZJ(g,"{")?.range.end;Ce(N,"Opening brace not found");const _=" ".repeat(2+g.range.start.character),B=_+w+" "+k;v.push(In.insert(N,`
|
|
250
|
+
`+B)),h({start:{line:N.line+1,character:_.length},end:{line:N.line+1,character:B.length}})}}return{modifiedRange:p,edits:v}}const{findNodeForProperty:wle,findNodeForKeyword:nZ}=_f;function rZ(t,{view:e,viewAst:n,layout:r}){Ce(n.body,`View ${e.id} has no body`);const i=n.$cstNode;Ce(i,"viewCstNode");const s=QK(r.direction),o=VS(n.body.rules,ad);let a=`autoLayout ${s}`;if(Np(r.rankSep)&&(a+=` ${r.rankSep}`,Np(r.nodeSep)&&(a+=` ${r.nodeSep}`)),o&&o.$cstNode)return In.replace(o.$cstNode.range,a);const c=nZ(n.body.$cstNode,"}")?.range.start;Ce(c,"Closing brace not found");const u=` ${a}
|
|
251
|
+
`;return In.insert(c,u)}function iZ(t,e=1,n={}){const{indent:r=" ",includeEmptyLines:i=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function sZ(t,{viewAst:e,layout:n}){Ce(e.$cstNode,"invalid view.$cstNode");const r=df(e.$cstNode,["BLOCK_COMMENT"]);let i=BJ(n);return e.$cstNode.range.start.character>0&&(i=iZ(i,e.$cstNode.range.start.character)),r?In.replace(r.range,i.trimStart()):In.insert({line:e.$cstNode.range.start.line,character:0},i+`
|
|
252
|
+
`)}class oZ{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;Ce(n,"LSP Connection not available");let r=null;try{await this.services.shared.workspace.WorkspaceLock.write(async()=>{const{doc:i,edits:s,modifiedRange:o}=this.convertToTextEdit(e),a={uri:i.textDocument.uri,version:i.textDocument.version};if(!s.length)return;const c=await n.workspace.applyEdit({label:`LikeC4 - change view ${e.viewId}`,edit:{changes:{[a.uri]:s}}});if(!c.applied){n.window.showErrorMessage(`Failed to apply changes ${c.failureReason}`);return}r={uri:a.uri,range:o}})}catch(i){xt.error(`Failed to apply change ${e.change.op} ${e.viewId}`,i)}return r}convertToTextEdit({viewId:e,change:n}){const r=this.locator.locateViewAst(e);if(!r)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(n.op){case"change-element-style":return{doc:r.doc,...tZ(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=rZ(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=sZ(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Oe(n)}}}class aZ extends pS{constructor(e){super(),this.services=e}getNameStrict(e){return fn(this.getName(e),`Failed getName for ${this.services.workspace.AstNodeLocator.getAstNodePath(e)}`)}getName(e){if(Cp(e))return e.name;if(Mr(e))return e.element.el.$refText}getNameNode(e){if(Cp(e))return super.getNameNode(e);if(Mr(e))return e.element.el.$refNode}}function cZ(t){return tt(t,Ls(e=>`${e.type}.${e.name}`),Fp(),zi(([e,n])=>n.length===1?n:[]))}class uZ extends mS{constructor(e){super(e)}async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:o,globals:a,likec4lib:c,deployments:u}=e.parseResult.value;this.exportLibrary(c,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(o,r,e),this.exportGlobals(a,r,e),this.exportDeployments(u,r,e)}catch(i){ve(i)}return r}exportViews(e,n,r){const i=e?.flatMap(s=>s.views);if(!(Et(i)||i.length===0))for(const s of i)try{ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){ve(o)}}exportGlobals(e,n,r){if(!(Et(e)||e.length===0)){for(const i of e.flatMap(s=>s.predicates))try{const s=i;ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ve(s)}for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ve(s)}}}exportModel(e,n,r){if(!(Et(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{Wn(i)&&ue(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){ve(s)}}exportLibrary(e,n,r){if(!Et(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){ve(i)}}exportSpecification(e,n,r){if(!(Et(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.deploymentNodes,...s.tags,...s.colors]))try{switch(!0){case Qh(i):case pa(i):{ue(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case em(i):{ue(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case ma(i):{ue(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r),this.descriptions.createDescription(i.kind,"."+i.kind.name,r));continue}case Zh(i):{ue(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Oe(i)}}catch(s){ve(s)}}exportDeployments(e,n,r){const i=e?.flatMap(s=>s.elements);if(!(Et(i)||i.length===0))for(const s of i)try{Nn(s)&&ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){ve(o)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=[],o=new zn;for(const a of i.models)try{s.push(...this.processContainer(a,o,e))}catch(c){ve(c)}for(const a of i.deployments)try{s.push(...this.processDeployments(a,o,e))}catch(c){ve(c)}cZ(s).forEach(a=>{o.add(i,a)}),r(o)})}processContainer(e,n,r){const i=new zn,s=[];for(const a of e.elements){if(zr(a))continue;let c;if(Wn(a)?(ue(a.name)&&i.add(a.name,this.descriptions.createDescription(a,a.name,r)),c=a.body):ia(a)&&(c=a.body),c&&c.elements.length>0)try{s.push(...this.processContainer(c,n,r))}catch(u){ve(u)}}s.length&&tt(s,Ve(a=>!i.has(a.name)),Ls(a=>a.name),Op((a,c)=>{a.length===1&&i.add(c,a[0])}));const o=[...i.values()];return n.addAll(e,o),o}processDeployments(e,n,r){const i=new Set,s=[];for(const o of e.elements){if(to(o))continue;let a=this.nameProvider.getName(o);if(ue(a)){const c=this.descriptions.createDescription(o,a,r);n.add(e,c),i.add(c.name)}if(Nn(o)&&o.body)try{s.push(...this.processDeployments(o.body,n,r))}catch(c){ve(c)}}return s.length>0&&tt(s,Ve(o=>!i.has(o.name)),Ls(o=>o.name),Op((o,a)=>{o.length===1&&n.add(e,o[0])})),[...n.get(e).values()]}}const{getDocument:lZ}=mc;class dZ extends bS{deploymentsIndex;fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new Mt(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():nn)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return st([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>$n(e)))}scopeElementView({viewOf:e,extends:n}){return e?st([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>$n(e))):n?st([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):ko}):ko}getScope(e){try{const n=this.reflection.getReferenceType(e);try{const r=e.container;if(GA(r))return this.getScopeForFqnRef(r,e);if(n!==rr)return this.getGlobalScope(n,e);if(UA(r)&&e.property==="el"){const i=r.parent;return i?new Ns(this.directChildrenOf(rm(i))):this.getGlobalScope(n,e)}if(Dl(r)&&e.property==="el"){const i=r.parent;if(i)return new Ns(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=sn(r,Wn);return s?new gS([this.descriptions.createDescription(s,e.reference.$refText)]):Ap}}return this.computeScope(e)}catch(r){return Fe.warn(r),this.getGlobalScope(n,e)}}catch(n){return Fe.warn(n),Ap}}getScopeForFqnRef(e,n){const r=e.parent;if(!r)return this.createScope(this.computeScope(n,Xi).getAllElements(),this.createScope(this.computeScope(n,Yi).getAllElements(),xi(e,FA)?this.computeScope(n,rr):Ap));const i=r.value.ref;return i?Nn(i)?new Ns(this.deploymentsIndex.nested(i)):Mr(i)?new Ns(this.scopeElementRef(i.element)):Wn(i)?new Ns(this.uniqueDescedants(()=>i)):Oe(i):Ap}computeScope(e,n=this.reflection.getReferenceType(e)){const r=this.reflection.isSubtype(n,rr),i=[],s=lZ(e.container).precomputedScopes;if(!s)return this.getGlobalScope(n,e);const o=c=>this.reflection.isSubtype(c.type,n);let a=e.container;for(;a;){const c=s.get(a).filter(o);c.length>0&&i.push(st(c)),r&&jA(a)&&i.push(this.scopeExtendElement(a.$container)),r&&zA(a)&&i.push(this.scopeElementView(a.$container)),a=a.$container}return i.reduceRight((c,u)=>this.createScope(u,c),this.getGlobalScope(n,e))}}const fZ=`likec4lib { icons {
|
|
253
|
+
aws:activate
|
|
254
|
+
aws:alexa-for-business
|
|
255
|
+
aws:amplify
|
|
256
|
+
aws:apache-mxnet-on-aws
|
|
257
|
+
aws:api-gateway
|
|
258
|
+
aws:app-config
|
|
259
|
+
aws:app-flow
|
|
260
|
+
aws:app-mesh
|
|
261
|
+
aws:app-runner
|
|
262
|
+
aws:app-stream
|
|
263
|
+
aws:app-sync
|
|
264
|
+
aws:application-auto-scaling
|
|
265
|
+
aws:application-composer
|
|
266
|
+
aws:application-cost-profiler
|
|
267
|
+
aws:application-discovery-service
|
|
268
|
+
aws:application-migration-service
|
|
269
|
+
aws:artifact
|
|
270
|
+
aws:athena
|
|
271
|
+
aws:audit-manager
|
|
272
|
+
aws:augmented-ai-a2i
|
|
273
|
+
aws:aurora
|
|
274
|
+
aws:auto-scaling
|
|
275
|
+
aws:backint-agent
|
|
276
|
+
aws:backup
|
|
277
|
+
aws:batch
|
|
278
|
+
aws:billing-conductor
|
|
279
|
+
aws:bottlerocket
|
|
280
|
+
aws:braket
|
|
281
|
+
aws:budgets
|
|
282
|
+
aws:certificate-manager
|
|
283
|
+
aws:chatbot
|
|
284
|
+
aws:chime
|
|
285
|
+
aws:chime-sdk
|
|
286
|
+
aws:chime-voice-connector
|
|
287
|
+
aws:clean-rooms
|
|
288
|
+
aws:client-vpn
|
|
289
|
+
aws:cloud-control-api
|
|
290
|
+
aws:cloud-development-kit
|
|
291
|
+
aws:cloud-directory
|
|
292
|
+
aws:cloud-formation
|
|
293
|
+
aws:cloud-front
|
|
294
|
+
aws:cloud-hsm
|
|
295
|
+
aws:cloud-map
|
|
296
|
+
aws:cloud-search
|
|
297
|
+
aws:cloud-shell
|
|
298
|
+
aws:cloud-trail
|
|
299
|
+
aws:cloud-wan
|
|
300
|
+
aws:cloud-watch
|
|
301
|
+
aws:cloud9
|
|
302
|
+
aws:code-artifact
|
|
303
|
+
aws:code-build
|
|
304
|
+
aws:code-catalyst
|
|
305
|
+
aws:code-commit
|
|
306
|
+
aws:code-deploy
|
|
307
|
+
aws:code-guru
|
|
308
|
+
aws:code-pipeline
|
|
309
|
+
aws:code-star
|
|
310
|
+
aws:code-whisperer
|
|
311
|
+
aws:cognito
|
|
312
|
+
aws:command-line-interface
|
|
313
|
+
aws:comprehend
|
|
314
|
+
aws:comprehend-medical
|
|
315
|
+
aws:compute-optimizer
|
|
316
|
+
aws:config
|
|
317
|
+
aws:connect
|
|
318
|
+
aws:console-mobile-application
|
|
319
|
+
aws:control-tower
|
|
320
|
+
aws:corretto
|
|
321
|
+
aws:cost-and-usage-report
|
|
322
|
+
aws:cost-explorer
|
|
323
|
+
aws:data-exchange
|
|
324
|
+
aws:data-pipeline
|
|
325
|
+
aws:data-sync
|
|
326
|
+
aws:data-zone
|
|
327
|
+
aws:database-migration-service
|
|
328
|
+
aws:deep-composer
|
|
329
|
+
aws:deep-learning-amis
|
|
330
|
+
aws:deep-learning-containers
|
|
331
|
+
aws:deep-lens
|
|
332
|
+
aws:deep-racer
|
|
333
|
+
aws:detective
|
|
334
|
+
aws:dev-ops-guru
|
|
335
|
+
aws:device-farm
|
|
336
|
+
aws:direct-connect
|
|
337
|
+
aws:directory-service
|
|
338
|
+
aws:distro-for-open-telemetry
|
|
339
|
+
aws:document-db
|
|
340
|
+
aws:dynamo-db
|
|
341
|
+
aws:ec2
|
|
342
|
+
aws:ec2-auto-scaling
|
|
343
|
+
aws:ec2-image-builder
|
|
344
|
+
aws:ecs-anywhere
|
|
345
|
+
aws:efs
|
|
346
|
+
aws:eks-anywhere
|
|
347
|
+
aws:eks-cloud
|
|
348
|
+
aws:eks-distro
|
|
349
|
+
aws:elasti-cache
|
|
350
|
+
aws:elastic-beanstalk
|
|
351
|
+
aws:elastic-block-store
|
|
352
|
+
aws:elastic-container-registry
|
|
353
|
+
aws:elastic-container-service
|
|
354
|
+
aws:elastic-disaster-recovery
|
|
355
|
+
aws:elastic-fabric-adapter
|
|
356
|
+
aws:elastic-inference
|
|
357
|
+
aws:elastic-kubernetes-service
|
|
358
|
+
aws:elastic-load-balancing
|
|
359
|
+
aws:elastic-transcoder
|
|
360
|
+
aws:elemental-appliances-software
|
|
361
|
+
aws:elemental-conductor
|
|
362
|
+
aws:elemental-delta
|
|
363
|
+
aws:elemental-link
|
|
364
|
+
aws:elemental-live
|
|
365
|
+
aws:elemental-media-connect
|
|
366
|
+
aws:elemental-media-convert
|
|
367
|
+
aws:elemental-media-live
|
|
368
|
+
aws:elemental-media-package
|
|
369
|
+
aws:elemental-media-store
|
|
370
|
+
aws:elemental-media-tailor
|
|
371
|
+
aws:elemental-server
|
|
372
|
+
aws:emr
|
|
373
|
+
aws:event-bridge
|
|
374
|
+
aws:express-workflows
|
|
375
|
+
aws:fargate
|
|
376
|
+
aws:fault-injection-simulator
|
|
377
|
+
aws:file-cache
|
|
378
|
+
aws:fin-space
|
|
379
|
+
aws:firewall-manager
|
|
380
|
+
aws:forecast
|
|
381
|
+
aws:fraud-detector
|
|
382
|
+
aws:free-rtos
|
|
383
|
+
aws:fsx
|
|
384
|
+
aws:fsx-for-lustre
|
|
385
|
+
aws:fsx-for-net-app-ontap
|
|
386
|
+
aws:fsx-for-open-zfs
|
|
387
|
+
aws:fsx-for-wfs
|
|
388
|
+
aws:game-kit
|
|
389
|
+
aws:game-lift
|
|
390
|
+
aws:game-sparks
|
|
391
|
+
aws:genomics-cli
|
|
392
|
+
aws:global-accelerator
|
|
393
|
+
aws:glue
|
|
394
|
+
aws:glue-data-brew
|
|
395
|
+
aws:glue-elastic-views
|
|
396
|
+
aws:ground-station
|
|
397
|
+
aws:guard-duty
|
|
398
|
+
aws:health-lake
|
|
399
|
+
aws:honeycode
|
|
400
|
+
aws:iam-identity-center
|
|
401
|
+
aws:identity-and-access-management
|
|
402
|
+
aws:inspector
|
|
403
|
+
aws:interactive-video-service
|
|
404
|
+
aws:io-t-1-click
|
|
405
|
+
aws:io-t-analytics
|
|
406
|
+
aws:io-t-button
|
|
407
|
+
aws:io-t-core
|
|
408
|
+
aws:io-t-device-defender
|
|
409
|
+
aws:io-t-device-management
|
|
410
|
+
aws:io-t-edu-kit
|
|
411
|
+
aws:io-t-events
|
|
412
|
+
aws:io-t-express-link
|
|
413
|
+
aws:io-t-fleet-wise
|
|
414
|
+
aws:io-t-greengrass
|
|
415
|
+
aws:io-t-robo-runner
|
|
416
|
+
aws:io-t-site-wise
|
|
417
|
+
aws:io-t-things-graph
|
|
418
|
+
aws:io-t-twin-maker
|
|
419
|
+
aws:iq
|
|
420
|
+
aws:kendra
|
|
421
|
+
aws:key-management-service
|
|
422
|
+
aws:keyspaces
|
|
423
|
+
aws:kinesis
|
|
424
|
+
aws:kinesis-data-analytics
|
|
425
|
+
aws:kinesis-data-streams
|
|
426
|
+
aws:kinesis-firehose
|
|
427
|
+
aws:kinesis-video-streams
|
|
428
|
+
aws:lake-formation
|
|
429
|
+
aws:lambda
|
|
430
|
+
aws:launch-wizard
|
|
431
|
+
aws:lex
|
|
432
|
+
aws:license-manager
|
|
433
|
+
aws:lightsail
|
|
434
|
+
aws:local-zones
|
|
435
|
+
aws:location-service
|
|
436
|
+
aws:lookout-for-equipment
|
|
437
|
+
aws:lookout-for-metrics
|
|
438
|
+
aws:lookout-for-vision
|
|
439
|
+
aws:lumberyard
|
|
440
|
+
aws:macie
|
|
441
|
+
aws:mainframe-modernization
|
|
442
|
+
aws:managed-blockchain
|
|
443
|
+
aws:managed-grafana
|
|
444
|
+
aws:managed-service-for-prometheus
|
|
445
|
+
aws:managed-services
|
|
446
|
+
aws:managed-streaming-for-apache-kafka
|
|
447
|
+
aws:managed-workflows-for-apache-airflow
|
|
448
|
+
aws:management-console
|
|
449
|
+
aws:marketplace-dark
|
|
450
|
+
aws:marketplace-light
|
|
451
|
+
aws:memory-db-for-redis
|
|
452
|
+
aws:migration-evaluator
|
|
453
|
+
aws:migration-hub
|
|
454
|
+
aws:monitron
|
|
455
|
+
aws:mq
|
|
456
|
+
aws:neptune
|
|
457
|
+
aws:network-firewall
|
|
458
|
+
aws:neuron
|
|
459
|
+
aws:nice-dcv
|
|
460
|
+
aws:nice-engin-frame
|
|
461
|
+
aws:nimble-studio
|
|
462
|
+
aws:nitro-enclaves
|
|
463
|
+
aws:omics
|
|
464
|
+
aws:open-3d-engine
|
|
465
|
+
aws:open-search-service
|
|
466
|
+
aws:ops-works
|
|
467
|
+
aws:organizations
|
|
468
|
+
aws:outposts-family
|
|
469
|
+
aws:outposts-rack
|
|
470
|
+
aws:outposts-servers
|
|
471
|
+
aws:panorama
|
|
472
|
+
aws:parallel-cluster
|
|
473
|
+
aws:personal-health-dashboard
|
|
474
|
+
aws:personalize
|
|
475
|
+
aws:pinpoint
|
|
476
|
+
aws:pinpoint-apis
|
|
477
|
+
aws:polly
|
|
478
|
+
aws:private-5g
|
|
479
|
+
aws:private-certificate-authority
|
|
480
|
+
aws:private-link
|
|
481
|
+
aws:professional-services
|
|
482
|
+
aws:proton
|
|
483
|
+
aws:quantum-ledger-database
|
|
484
|
+
aws:quick-sight
|
|
485
|
+
aws:rds
|
|
486
|
+
aws:rds-on-vmware
|
|
487
|
+
aws:re-post
|
|
488
|
+
aws:red-hat-open-shift-service-on-aws
|
|
489
|
+
aws:redshift
|
|
490
|
+
aws:rekognition
|
|
491
|
+
aws:reserved-instance-reporting
|
|
492
|
+
aws:resilience-hub
|
|
493
|
+
aws:resource-access-manager
|
|
494
|
+
aws:resource-explorer
|
|
495
|
+
aws:robo-maker
|
|
496
|
+
aws:route-53
|
|
497
|
+
aws:s3-on-outposts
|
|
498
|
+
aws:sage-maker
|
|
499
|
+
aws:sage-maker-ground-truth
|
|
500
|
+
aws:sage-maker-studio-lab
|
|
501
|
+
aws:savings-plans
|
|
502
|
+
aws:secrets-manager
|
|
503
|
+
aws:security-hub
|
|
504
|
+
aws:security-lake
|
|
505
|
+
aws:server-migration-service
|
|
506
|
+
aws:serverless-application-repository
|
|
507
|
+
aws:service-catalog
|
|
508
|
+
aws:service-management-connector
|
|
509
|
+
aws:shield
|
|
510
|
+
aws:signer
|
|
511
|
+
aws:sim-space-weaver
|
|
512
|
+
aws:simple-email-service
|
|
513
|
+
aws:simple-notification-service
|
|
514
|
+
aws:simple-queue-service
|
|
515
|
+
aws:simple-storage-service
|
|
516
|
+
aws:simple-storage-service-glacier
|
|
517
|
+
aws:site-to-site-vpn
|
|
518
|
+
aws:snowball
|
|
519
|
+
aws:snowball-edge
|
|
520
|
+
aws:snowcone
|
|
521
|
+
aws:snowmobile
|
|
522
|
+
aws:step-functions
|
|
523
|
+
aws:storage-gateway
|
|
524
|
+
aws:sumerian
|
|
525
|
+
aws:supply-chain
|
|
526
|
+
aws:support
|
|
527
|
+
aws:systems-manager
|
|
528
|
+
aws:tensor-flow-on-aws
|
|
529
|
+
aws:textract
|
|
530
|
+
aws:thinkbox-deadline
|
|
531
|
+
aws:thinkbox-frost
|
|
532
|
+
aws:thinkbox-krakatoa
|
|
533
|
+
aws:thinkbox-sequoia
|
|
534
|
+
aws:thinkbox-stoke
|
|
535
|
+
aws:thinkbox-xmesh
|
|
536
|
+
aws:timestream
|
|
537
|
+
aws:tools-and-sdks
|
|
538
|
+
aws:torch-serve
|
|
539
|
+
aws:training-certification
|
|
540
|
+
aws:transcribe
|
|
541
|
+
aws:transfer-family
|
|
542
|
+
aws:transit-gateway
|
|
543
|
+
aws:translate
|
|
544
|
+
aws:trusted-advisor
|
|
545
|
+
aws:verified-access
|
|
546
|
+
aws:verified-permissions
|
|
547
|
+
aws:virtual-private-cloud
|
|
548
|
+
aws:vmware-cloud-on-aws
|
|
549
|
+
aws:vpc-lattice
|
|
550
|
+
aws:waf
|
|
551
|
+
aws:wavelength
|
|
552
|
+
aws:well-architected-tool
|
|
553
|
+
aws:wickr
|
|
554
|
+
aws:work-docs
|
|
555
|
+
aws:work-docs-sdk
|
|
556
|
+
aws:work-link
|
|
557
|
+
aws:work-mail
|
|
558
|
+
aws:work-spaces-family
|
|
559
|
+
aws:x-ray
|
|
560
|
+
azure:abs-member
|
|
561
|
+
azure:active-directory-connect-health
|
|
562
|
+
azure:activity-log
|
|
563
|
+
azure:administrative-units
|
|
564
|
+
azure:advisor
|
|
565
|
+
azure:ai-studio
|
|
566
|
+
azure:aks-automatic
|
|
567
|
+
azure:aks-istio
|
|
568
|
+
azure:alerts
|
|
569
|
+
azure:all-resources
|
|
570
|
+
azure:analysis-services
|
|
571
|
+
azure:anomaly-detector
|
|
572
|
+
azure:api-center
|
|
573
|
+
azure:api-connections
|
|
574
|
+
azure:api-management-services
|
|
575
|
+
azure:api-proxy
|
|
576
|
+
azure:app-compliance-automation
|
|
577
|
+
azure:app-configuration
|
|
578
|
+
azure:app-registrations
|
|
579
|
+
azure:app-service-certificates
|
|
580
|
+
azure:app-service-domains
|
|
581
|
+
azure:app-service-environments
|
|
582
|
+
azure:app-service-plans
|
|
583
|
+
azure:app-services
|
|
584
|
+
azure:app-space
|
|
585
|
+
azure:app-space-component
|
|
586
|
+
azure:applens
|
|
587
|
+
azure:application-gateway-containers
|
|
588
|
+
azure:application-gateways
|
|
589
|
+
azure:application-group
|
|
590
|
+
azure:application-insights
|
|
591
|
+
azure:application-security-groups
|
|
592
|
+
azure:aquila
|
|
593
|
+
azure:arc-data-services
|
|
594
|
+
azure:arc-kubernetes
|
|
595
|
+
azure:arc-machines
|
|
596
|
+
azure:arc-sql-managed-instance
|
|
597
|
+
azure:arc-sql-server
|
|
598
|
+
azure:atm-multistack
|
|
599
|
+
azure:auto-scale
|
|
600
|
+
azure:automanaged-vm
|
|
601
|
+
azure:automation-accounts
|
|
602
|
+
azure:availability-sets
|
|
603
|
+
azure:avs-vm
|
|
604
|
+
azure:azure-a
|
|
605
|
+
azure:azure-ad-b2c
|
|
606
|
+
azure:azure-api-for-fhir
|
|
607
|
+
azure:azure-applied-ai-services
|
|
608
|
+
azure:azure-arc
|
|
609
|
+
azure:azure-attestation
|
|
610
|
+
azure:azure-backup-center
|
|
611
|
+
azure:azure-blockchain-service
|
|
612
|
+
azure:azure-center-for-sap
|
|
613
|
+
azure:azure-chaos-studio
|
|
614
|
+
azure:azure-cloud-shell
|
|
615
|
+
azure:azure-communication-services
|
|
616
|
+
azure:azure-communications-gateway
|
|
617
|
+
azure:azure-compute-galleries
|
|
618
|
+
azure:azure-cosmos-db
|
|
619
|
+
azure:azure-data-catalog
|
|
620
|
+
azure:azure-data-explorer-clusters
|
|
621
|
+
azure:azure-database-maria-db-server
|
|
622
|
+
azure:azure-database-migration-services
|
|
623
|
+
azure:azure-database-my-sql-server
|
|
624
|
+
azure:azure-database-postgre-sql-server
|
|
625
|
+
azure:azure-database-postgre-sql-server-group
|
|
626
|
+
azure:azure-databox-gateway
|
|
627
|
+
azure:azure-databricks
|
|
628
|
+
azure:azure-deployment-environments
|
|
629
|
+
azure:azure-dev-ops
|
|
630
|
+
azure:azure-dev-tunnels
|
|
631
|
+
azure:azure-edge-hardware-center
|
|
632
|
+
azure:azure-experimentation-studio
|
|
633
|
+
azure:azure-fileshares
|
|
634
|
+
azure:azure-firewall-manager
|
|
635
|
+
azure:azure-firewall-policy
|
|
636
|
+
azure:azure-hcp-cache
|
|
637
|
+
azure:azure-hpc-workbenches
|
|
638
|
+
azure:azure-hybrid-center
|
|
639
|
+
azure:azure-information-protection
|
|
640
|
+
azure:azure-io-t-operations
|
|
641
|
+
azure:azure-lighthouse
|
|
642
|
+
azure:azure-load-testing
|
|
643
|
+
azure:azure-managed-grafana
|
|
644
|
+
azure:azure-maps-accounts
|
|
645
|
+
azure:azure-media-service
|
|
646
|
+
azure:azure-migrate
|
|
647
|
+
azure:azure-monitor-dashboard
|
|
648
|
+
azure:azure-monitor-pipeline
|
|
649
|
+
azure:azure-monitors-for-sap-solutions
|
|
650
|
+
azure:azure-net-app-files
|
|
651
|
+
azure:azure-network-function-manager
|
|
652
|
+
azure:azure-network-function-manager-functions
|
|
653
|
+
azure:azure-object-understanding
|
|
654
|
+
azure:azure-open-ai
|
|
655
|
+
azure:azure-operator-5g-core
|
|
656
|
+
azure:azure-operator-insights
|
|
657
|
+
azure:azure-operator-nexus
|
|
658
|
+
azure:azure-operator-service-manager
|
|
659
|
+
azure:azure-orbital
|
|
660
|
+
azure:azure-programmable-connectivity
|
|
661
|
+
azure:azure-purview-accounts
|
|
662
|
+
azure:azure-quotas
|
|
663
|
+
azure:azure-red-hat-open-shift
|
|
664
|
+
azure:azure-sentinel
|
|
665
|
+
azure:azure-service-bus
|
|
666
|
+
azure:azure-sphere
|
|
667
|
+
azure:azure-spring-apps
|
|
668
|
+
azure:azure-sql
|
|
669
|
+
azure:azure-sql-edge
|
|
670
|
+
azure:azure-sql-server-stretch-databases
|
|
671
|
+
azure:azure-sql-vm
|
|
672
|
+
azure:azure-stack
|
|
673
|
+
azure:azure-stack-edge
|
|
674
|
+
azure:azure-stack-hci-sizer
|
|
675
|
+
azure:azure-storage-mover
|
|
676
|
+
azure:azure-support-center-blue
|
|
677
|
+
azure:azure-sustainability
|
|
678
|
+
azure:azure-synapse-analytics
|
|
679
|
+
azure:azure-token-service
|
|
680
|
+
azure:azure-video-indexer
|
|
681
|
+
azure:azure-virtual-desktop
|
|
682
|
+
azure:azure-vmware-solution
|
|
683
|
+
azure:azure-workbooks
|
|
684
|
+
azure:azurite
|
|
685
|
+
azure:backlog
|
|
686
|
+
azure:backup-vault
|
|
687
|
+
azure:bare-metal-infrastructure
|
|
688
|
+
azure:bastions
|
|
689
|
+
azure:batch-accounts
|
|
690
|
+
azure:batch-ai
|
|
691
|
+
azure:biz-talk
|
|
692
|
+
azure:blob-block
|
|
693
|
+
azure:blob-page
|
|
694
|
+
azure:blockchain-applications
|
|
695
|
+
azure:blueprints
|
|
696
|
+
azure:bonsai
|
|
697
|
+
azure:bot-services
|
|
698
|
+
azure:branch
|
|
699
|
+
azure:browser
|
|
700
|
+
azure:bug
|
|
701
|
+
azure:builds
|
|
702
|
+
azure:business-process-tracking
|
|
703
|
+
azure:cache
|
|
704
|
+
azure:cache-redis
|
|
705
|
+
azure:capacity
|
|
706
|
+
azure:capacity-reservation-groups
|
|
707
|
+
azure:cdn-profiles
|
|
708
|
+
azure:central-service-instance-for-sap
|
|
709
|
+
azure:ceres
|
|
710
|
+
azure:change-analysis
|
|
711
|
+
azure:client-apps
|
|
712
|
+
azure:cloud-services-classic
|
|
713
|
+
azure:cloud-services-extended-support
|
|
714
|
+
azure:cloud-test
|
|
715
|
+
azure:code
|
|
716
|
+
azure:code-optimization
|
|
717
|
+
azure:cognitive-search
|
|
718
|
+
azure:cognitive-services
|
|
719
|
+
azure:cognitive-services-decisions
|
|
720
|
+
azure:collaborative-service
|
|
721
|
+
azure:commit
|
|
722
|
+
azure:community-images
|
|
723
|
+
azure:compliance
|
|
724
|
+
azure:compliance-center
|
|
725
|
+
azure:compute-fleet
|
|
726
|
+
azure:computer-vision
|
|
727
|
+
azure:conditional-access
|
|
728
|
+
azure:confidential-ledgers
|
|
729
|
+
azure:connected-cache
|
|
730
|
+
azure:connected-vehicle-platform
|
|
731
|
+
azure:connections
|
|
732
|
+
azure:consortium
|
|
733
|
+
azure:container-apps-environments
|
|
734
|
+
azure:container-instances
|
|
735
|
+
azure:container-registries
|
|
736
|
+
azure:container-services-deprecated
|
|
737
|
+
azure:content-moderators
|
|
738
|
+
azure:content-safety
|
|
739
|
+
azure:controls
|
|
740
|
+
azure:controls-horizontal
|
|
741
|
+
azure:cost-alerts
|
|
742
|
+
azure:cost-analysis
|
|
743
|
+
azure:cost-budgets
|
|
744
|
+
azure:cost-export
|
|
745
|
+
azure:cost-management
|
|
746
|
+
azure:cost-management-and-billing
|
|
747
|
+
azure:counter
|
|
748
|
+
azure:cubes
|
|
749
|
+
azure:custom-ip-prefix
|
|
750
|
+
azure:custom-vision
|
|
751
|
+
azure:customer-lockbox-for-microsoft-azure
|
|
752
|
+
azure:dashboard
|
|
753
|
+
azure:dashboard-hub
|
|
754
|
+
azure:data-box
|
|
755
|
+
azure:data-collection-rules
|
|
756
|
+
azure:data-factories
|
|
757
|
+
azure:data-lake-analytics
|
|
758
|
+
azure:data-lake-storage-gen1
|
|
759
|
+
azure:data-lake-store-gen1
|
|
760
|
+
azure:data-share-invitations
|
|
761
|
+
azure:data-shares
|
|
762
|
+
azure:database-instance-for-sap
|
|
763
|
+
azure:ddo-s-protection-plans
|
|
764
|
+
azure:dedicated-hsm
|
|
765
|
+
azure:defender-cm-local-manager
|
|
766
|
+
azure:defender-dcs-controller
|
|
767
|
+
azure:defender-distributer-control-system
|
|
768
|
+
azure:defender-engineering-station
|
|
769
|
+
azure:defender-external-management
|
|
770
|
+
azure:defender-freezer-monitor
|
|
771
|
+
azure:defender-historian
|
|
772
|
+
azure:defender-hmi
|
|
773
|
+
azure:defender-industrial-packaging-system
|
|
774
|
+
azure:defender-industrial-printer
|
|
775
|
+
azure:defender-industrial-robot
|
|
776
|
+
azure:defender-industrial-scale-system
|
|
777
|
+
azure:defender-marquee
|
|
778
|
+
azure:defender-meter
|
|
779
|
+
azure:defender-plc
|
|
780
|
+
azure:defender-pneumatic-device
|
|
781
|
+
azure:defender-programable-board
|
|
782
|
+
azure:defender-relay
|
|
783
|
+
azure:defender-robot-controller
|
|
784
|
+
azure:defender-rtu
|
|
785
|
+
azure:defender-sensor
|
|
786
|
+
azure:defender-slot
|
|
787
|
+
azure:defender-web-guiding-system
|
|
788
|
+
azure:detonation
|
|
789
|
+
azure:dev-console
|
|
790
|
+
azure:dev-ops-starter
|
|
791
|
+
azure:dev-test-labs
|
|
792
|
+
azure:device-compliance
|
|
793
|
+
azure:device-configuration
|
|
794
|
+
azure:device-enrollment
|
|
795
|
+
azure:device-provisioning-services
|
|
796
|
+
azure:device-security-apple
|
|
797
|
+
azure:device-security-google
|
|
798
|
+
azure:device-security-windows
|
|
799
|
+
azure:device-update-io-t-hub
|
|
800
|
+
azure:devices
|
|
801
|
+
azure:diagnostics-settings
|
|
802
|
+
azure:digital-twins
|
|
803
|
+
azure:disk-encryption-sets
|
|
804
|
+
azure:disk-pool
|
|
805
|
+
azure:disks
|
|
806
|
+
azure:disks-classic
|
|
807
|
+
azure:disks-snapshots
|
|
808
|
+
azure:dns-multistack
|
|
809
|
+
azure:dns-private-resolver
|
|
810
|
+
azure:dns-security-policy
|
|
811
|
+
azure:dns-zones
|
|
812
|
+
azure:download
|
|
813
|
+
azure:e-books
|
|
814
|
+
azure:edge-management
|
|
815
|
+
azure:education
|
|
816
|
+
azure:elastic-job-agents
|
|
817
|
+
azure:elastic-san
|
|
818
|
+
azure:endpoint-analytics
|
|
819
|
+
azure:enterprise-applications
|
|
820
|
+
azure:entra-connect
|
|
821
|
+
azure:entra-connect-health
|
|
822
|
+
azure:entra-connect-sync
|
|
823
|
+
azure:entra-domain-services
|
|
824
|
+
azure:entra-global-secure-access
|
|
825
|
+
azure:entra-id-protection
|
|
826
|
+
azure:entra-identity-custom-roles
|
|
827
|
+
azure:entra-identity-licenses
|
|
828
|
+
azure:entra-identity-risky-signins
|
|
829
|
+
azure:entra-identity-risky-users
|
|
830
|
+
azure:entra-identity-roles-and-administrators
|
|
831
|
+
azure:entra-internet-access
|
|
832
|
+
azure:entra-managed-identities
|
|
833
|
+
azure:entra-private-access
|
|
834
|
+
azure:entra-privleged-identity-management
|
|
835
|
+
azure:entra-verified-id
|
|
836
|
+
azure:error
|
|
837
|
+
azure:event-grid-domains
|
|
838
|
+
azure:event-grid-subscriptions
|
|
839
|
+
azure:event-grid-topics
|
|
840
|
+
azure:event-hub-clusters
|
|
841
|
+
azure:event-hubs
|
|
842
|
+
azure:exchange-access
|
|
843
|
+
azure:exchange-on-premises-access
|
|
844
|
+
azure:express-route-circuits
|
|
845
|
+
azure:express-route-direct
|
|
846
|
+
azure:express-route-traffic-collector
|
|
847
|
+
azure:extended-security-updates
|
|
848
|
+
azure:extensions
|
|
849
|
+
azure:external-identities
|
|
850
|
+
azure:face-apis
|
|
851
|
+
azure:feature-previews
|
|
852
|
+
azure:fhir-service
|
|
853
|
+
azure:fiji
|
|
854
|
+
azure:file
|
|
855
|
+
azure:files
|
|
856
|
+
azure:firewalls
|
|
857
|
+
azure:folder-blank
|
|
858
|
+
azure:folder-website
|
|
859
|
+
azure:form-recognizers
|
|
860
|
+
azure:free-services
|
|
861
|
+
azure:front-door-and-cdn-profiles
|
|
862
|
+
azure:ftp
|
|
863
|
+
azure:function-apps
|
|
864
|
+
azure:gear
|
|
865
|
+
azure:genomics
|
|
866
|
+
azure:genomics-accounts
|
|
867
|
+
azure:globe-error
|
|
868
|
+
azure:globe-success
|
|
869
|
+
azure:globe-warning
|
|
870
|
+
azure:groups
|
|
871
|
+
azure:guide
|
|
872
|
+
azure:hd-insight-clusters
|
|
873
|
+
azure:hdi-aks-cluster
|
|
874
|
+
azure:heart
|
|
875
|
+
azure:help-and-support
|
|
876
|
+
azure:host-groups
|
|
877
|
+
azure:host-pools
|
|
878
|
+
azure:hosts
|
|
879
|
+
azure:ic-m-troubleshooting
|
|
880
|
+
azure:identity-governance
|
|
881
|
+
azure:identity-multi-factor-authentication
|
|
882
|
+
azure:identity-secure-score
|
|
883
|
+
azure:image
|
|
884
|
+
azure:image-definitions
|
|
885
|
+
azure:image-templates
|
|
886
|
+
azure:image-versions
|
|
887
|
+
azure:images
|
|
888
|
+
azure:immersive-readers
|
|
889
|
+
azure:import-export-jobs
|
|
890
|
+
azure:industrial-io-t
|
|
891
|
+
azure:information
|
|
892
|
+
azure:infrastructure-backup
|
|
893
|
+
azure:input-output
|
|
894
|
+
azure:instance-pools
|
|
895
|
+
azure:integration-accounts
|
|
896
|
+
azure:integration-environments
|
|
897
|
+
azure:integration-service-environments
|
|
898
|
+
azure:internet-analyzer-profiles
|
|
899
|
+
azure:intune
|
|
900
|
+
azure:intune-app-protection
|
|
901
|
+
azure:intune-for-education
|
|
902
|
+
azure:intune-trends
|
|
903
|
+
azure:io-t-central-applications
|
|
904
|
+
azure:io-t-edge
|
|
905
|
+
azure:io-t-hub
|
|
906
|
+
azure:ip-address-manager
|
|
907
|
+
azure:ip-groups
|
|
908
|
+
azure:journey-hub
|
|
909
|
+
azure:key-vaults
|
|
910
|
+
azure:keys
|
|
911
|
+
azure:kubernetes-fleet-manager
|
|
912
|
+
azure:kubernetes-services
|
|
913
|
+
azure:lab-accounts
|
|
914
|
+
azure:lab-services
|
|
915
|
+
azure:language
|
|
916
|
+
azure:language-understanding
|
|
917
|
+
azure:launch-portal
|
|
918
|
+
azure:learn
|
|
919
|
+
azure:load-balancer-hub
|
|
920
|
+
azure:load-balancers
|
|
921
|
+
azure:load-test
|
|
922
|
+
azure:load-testing
|
|
923
|
+
azure:local-network-gateways
|
|
924
|
+
azure:location
|
|
925
|
+
azure:log-analytics-query-pack
|
|
926
|
+
azure:log-analytics-workspaces
|
|
927
|
+
azure:log-streaming
|
|
928
|
+
azure:logic-apps
|
|
929
|
+
azure:logic-apps-custom-connector
|
|
930
|
+
azure:machine-learning
|
|
931
|
+
azure:machine-learning-studio-classic-web-services
|
|
932
|
+
azure:machine-learning-studio-web-service-plans
|
|
933
|
+
azure:machine-learning-studio-workspaces
|
|
934
|
+
azure:machines-azure-arc
|
|
935
|
+
azure:maintenance-configuration
|
|
936
|
+
azure:managed-applications-center
|
|
937
|
+
azure:managed-database
|
|
938
|
+
azure:managed-desktop
|
|
939
|
+
azure:managed-dev-ops-pools
|
|
940
|
+
azure:managed-file-shares
|
|
941
|
+
azure:managed-identities
|
|
942
|
+
azure:managed-instance-apache-cassandra
|
|
943
|
+
azure:managed-service-fabric
|
|
944
|
+
azure:management-groups
|
|
945
|
+
azure:management-portal
|
|
946
|
+
azure:marketplace
|
|
947
|
+
azure:marketplace-management
|
|
948
|
+
azure:med-tech-service
|
|
949
|
+
azure:media
|
|
950
|
+
azure:media-file
|
|
951
|
+
azure:mesh-applications
|
|
952
|
+
azure:metrics
|
|
953
|
+
azure:metrics-advisor
|
|
954
|
+
azure:microsoft-defender-easm
|
|
955
|
+
azure:microsoft-defender-for-cloud
|
|
956
|
+
azure:microsoft-defender-for-io-t
|
|
957
|
+
azure:microsoft-dev-box
|
|
958
|
+
azure:mindaro
|
|
959
|
+
azure:mission-landing-zone
|
|
960
|
+
azure:mobile
|
|
961
|
+
azure:mobile-engagement
|
|
962
|
+
azure:mobile-networks
|
|
963
|
+
azure:modular-data-center
|
|
964
|
+
azure:module
|
|
965
|
+
azure:monitor
|
|
966
|
+
azure:monitor-health-models
|
|
967
|
+
azure:multi-tenancy
|
|
968
|
+
azure:multifactor-authentication
|
|
969
|
+
azure:my-customers
|
|
970
|
+
azure:nat
|
|
971
|
+
azure:network-interfaces
|
|
972
|
+
azure:network-managers
|
|
973
|
+
azure:network-security-groups
|
|
974
|
+
azure:network-security-perimeters
|
|
975
|
+
azure:network-watcher
|
|
976
|
+
azure:notification-hub-namespaces
|
|
977
|
+
azure:notification-hubs
|
|
978
|
+
azure:offers
|
|
979
|
+
azure:on-premises-data-gateways
|
|
980
|
+
azure:open-supply-chain-platform
|
|
981
|
+
azure:operation-log-classic
|
|
982
|
+
azure:oracle-database
|
|
983
|
+
azure:os-images-classic
|
|
984
|
+
azure:osconfig
|
|
985
|
+
azure:outbound-connection
|
|
986
|
+
azure:partner-namespace
|
|
987
|
+
azure:partner-registration
|
|
988
|
+
azure:partner-topic
|
|
989
|
+
azure:peering-service
|
|
990
|
+
azure:peerings
|
|
991
|
+
azure:personalizers
|
|
992
|
+
azure:plans
|
|
993
|
+
azure:policy
|
|
994
|
+
azure:power
|
|
995
|
+
azure:power-bi-embedded
|
|
996
|
+
azure:power-platform
|
|
997
|
+
azure:power-up
|
|
998
|
+
azure:powershell
|
|
999
|
+
azure:preview-features
|
|
1000
|
+
azure:private-endpoints
|
|
1001
|
+
azure:private-link
|
|
1002
|
+
azure:private-link-service
|
|
1003
|
+
azure:private-link-services
|
|
1004
|
+
azure:process-explorer
|
|
1005
|
+
azure:production-ready-database
|
|
1006
|
+
azure:proximity-placement-groups
|
|
1007
|
+
azure:public-ip-addresses
|
|
1008
|
+
azure:public-ip-addresses-classic
|
|
1009
|
+
azure:public-ip-prefixes
|
|
1010
|
+
azure:qn-a-makers
|
|
1011
|
+
azure:quickstart-center
|
|
1012
|
+
azure:recent
|
|
1013
|
+
azure:recovery-services-vaults
|
|
1014
|
+
azure:region-management
|
|
1015
|
+
azure:relays
|
|
1016
|
+
azure:remote-rendering
|
|
1017
|
+
azure:reservations
|
|
1018
|
+
azure:reserved-capacity
|
|
1019
|
+
azure:reserved-ip-addresses-classic
|
|
1020
|
+
azure:resource-explorer
|
|
1021
|
+
azure:resource-graph-explorer
|
|
1022
|
+
azure:resource-group-list
|
|
1023
|
+
azure:resource-groups
|
|
1024
|
+
azure:resource-guard
|
|
1025
|
+
azure:resource-linked
|
|
1026
|
+
azure:resource-management-private-link
|
|
1027
|
+
azure:resource-mover
|
|
1028
|
+
azure:resources-provider
|
|
1029
|
+
azure:restore-points
|
|
1030
|
+
azure:restore-points-collections
|
|
1031
|
+
azure:route-filters
|
|
1032
|
+
azure:route-tables
|
|
1033
|
+
azure:rtos
|
|
1034
|
+
azure:savings-plans
|
|
1035
|
+
azure:scheduler
|
|
1036
|
+
azure:scheduler-job-collections
|
|
1037
|
+
azure:scvmm-management-servers
|
|
1038
|
+
azure:search
|
|
1039
|
+
azure:search-grid
|
|
1040
|
+
azure:security
|
|
1041
|
+
azure:security-baselines
|
|
1042
|
+
azure:send-grid-accounts
|
|
1043
|
+
azure:server-farm
|
|
1044
|
+
azure:serverless-search
|
|
1045
|
+
azure:service-catalog-mad
|
|
1046
|
+
azure:service-endpoint-policies
|
|
1047
|
+
azure:service-fabric-clusters
|
|
1048
|
+
azure:service-health
|
|
1049
|
+
azure:service-providers
|
|
1050
|
+
azure:shared-image-galleries
|
|
1051
|
+
azure:signal-r
|
|
1052
|
+
azure:software-as-a-service
|
|
1053
|
+
azure:software-updates
|
|
1054
|
+
azure:solutions
|
|
1055
|
+
azure:sonic-dash
|
|
1056
|
+
azure:spatial-anchor-accounts
|
|
1057
|
+
azure:speech-services
|
|
1058
|
+
azure:spot-vm
|
|
1059
|
+
azure:spot-vmss
|
|
1060
|
+
azure:sql-data-warehouses
|
|
1061
|
+
azure:sql-database
|
|
1062
|
+
azure:sql-elastic-pools
|
|
1063
|
+
azure:sql-managed-instance
|
|
1064
|
+
azure:sql-server
|
|
1065
|
+
azure:sql-server-registries
|
|
1066
|
+
azure:ssd
|
|
1067
|
+
azure:ssh-keys
|
|
1068
|
+
azure:ssis-lift-and-shift-ir
|
|
1069
|
+
azure:stack-hci-premium
|
|
1070
|
+
azure:static-apps
|
|
1071
|
+
azure:stor-simple-data-managers
|
|
1072
|
+
azure:stor-simple-device-managers
|
|
1073
|
+
azure:storage-accounts
|
|
1074
|
+
azure:storage-accounts-classic
|
|
1075
|
+
azure:storage-actions
|
|
1076
|
+
azure:storage-azure-files
|
|
1077
|
+
azure:storage-container
|
|
1078
|
+
azure:storage-explorer
|
|
1079
|
+
azure:storage-functions
|
|
1080
|
+
azure:storage-queue
|
|
1081
|
+
azure:storage-sync-services
|
|
1082
|
+
azure:stream-analytics-jobs
|
|
1083
|
+
azure:subnet
|
|
1084
|
+
azure:subscriptions
|
|
1085
|
+
azure:system-topic
|
|
1086
|
+
azure:table
|
|
1087
|
+
azure:tag
|
|
1088
|
+
azure:tags
|
|
1089
|
+
azure:targets-management
|
|
1090
|
+
azure:template-specs
|
|
1091
|
+
azure:templates
|
|
1092
|
+
azure:tenant-properties
|
|
1093
|
+
azure:tenant-status
|
|
1094
|
+
azure:test-base
|
|
1095
|
+
azure:tfs-vc-repository
|
|
1096
|
+
azure:time-series-data-sets
|
|
1097
|
+
azure:time-series-insights-access-policies
|
|
1098
|
+
azure:time-series-insights-environments
|
|
1099
|
+
azure:time-series-insights-event-sources
|
|
1100
|
+
azure:toolbox
|
|
1101
|
+
azure:traffic-manager-profiles
|
|
1102
|
+
azure:translator-text
|
|
1103
|
+
azure:troubleshoot
|
|
1104
|
+
azure:universal-print
|
|
1105
|
+
azure:update-management-center
|
|
1106
|
+
azure:updates
|
|
1107
|
+
azure:user-privacy
|
|
1108
|
+
azure:user-settings
|
|
1109
|
+
azure:user-subscriptions
|
|
1110
|
+
azure:users
|
|
1111
|
+
azure:verifiable-credentials
|
|
1112
|
+
azure:verification-as-a-service
|
|
1113
|
+
azure:versions
|
|
1114
|
+
azure:video-analyzers
|
|
1115
|
+
azure:virtual-clusters
|
|
1116
|
+
azure:virtual-enclaves
|
|
1117
|
+
azure:virtual-instance-for-sap
|
|
1118
|
+
azure:virtual-machine
|
|
1119
|
+
azure:virtual-machines-classic
|
|
1120
|
+
azure:virtual-network-gateways
|
|
1121
|
+
azure:virtual-networks
|
|
1122
|
+
azure:virtual-networks-classic
|
|
1123
|
+
azure:virtual-router
|
|
1124
|
+
azure:virtual-visits-builder
|
|
1125
|
+
azure:virtual-wan-hub
|
|
1126
|
+
azure:virtual-wans
|
|
1127
|
+
azure:vm-app-definitions
|
|
1128
|
+
azure:vm-app-versions
|
|
1129
|
+
azure:vm-image-version
|
|
1130
|
+
azure:vm-images-classic
|
|
1131
|
+
azure:vm-scale-sets
|
|
1132
|
+
azure:wac
|
|
1133
|
+
azure:wac-installer
|
|
1134
|
+
azure:web-app-database
|
|
1135
|
+
azure:web-application-firewall-policies-waf
|
|
1136
|
+
azure:web-jobs
|
|
1137
|
+
azure:web-slots
|
|
1138
|
+
azure:web-test
|
|
1139
|
+
azure:website-power
|
|
1140
|
+
azure:website-staging
|
|
1141
|
+
azure:windows-notification-services
|
|
1142
|
+
azure:windows10-core-services
|
|
1143
|
+
azure:workbooks
|
|
1144
|
+
azure:worker-container-app
|
|
1145
|
+
azure:workflow
|
|
1146
|
+
azure:workspace-gateway
|
|
1147
|
+
azure:workspaces
|
|
1148
|
+
gcp:access-context-manager
|
|
1149
|
+
gcp:administration
|
|
1150
|
+
gcp:advanced-agent-modeling
|
|
1151
|
+
gcp:advanced-solutions-lab
|
|
1152
|
+
gcp:agent-assist
|
|
1153
|
+
gcp:ai-hub
|
|
1154
|
+
gcp:ai-platform
|
|
1155
|
+
gcp:ai-platform-unified
|
|
1156
|
+
gcp:analytics-hub
|
|
1157
|
+
gcp:anthos
|
|
1158
|
+
gcp:anthos-config-management
|
|
1159
|
+
gcp:anthos-service-mesh
|
|
1160
|
+
gcp:api
|
|
1161
|
+
gcp:api-analytics
|
|
1162
|
+
gcp:api-monetization
|
|
1163
|
+
gcp:apigee-api-platform
|
|
1164
|
+
gcp:apigee-sense
|
|
1165
|
+
gcp:app-engine
|
|
1166
|
+
gcp:artifact-registry
|
|
1167
|
+
gcp:asset-inventory
|
|
1168
|
+
gcp:assured-workloads
|
|
1169
|
+
gcp:auto-ml
|
|
1170
|
+
gcp:auto-ml-natural-language
|
|
1171
|
+
gcp:auto-ml-tables
|
|
1172
|
+
gcp:auto-ml-translation
|
|
1173
|
+
gcp:auto-ml-video-intelligence
|
|
1174
|
+
gcp:auto-ml-vision
|
|
1175
|
+
gcp:bare-metal-solutions
|
|
1176
|
+
gcp:batch
|
|
1177
|
+
gcp:beyondcorp
|
|
1178
|
+
gcp:big-query
|
|
1179
|
+
gcp:bigtable
|
|
1180
|
+
gcp:billing
|
|
1181
|
+
gcp:binary-authorization
|
|
1182
|
+
gcp:catalog
|
|
1183
|
+
gcp:certificate-authority-service
|
|
1184
|
+
gcp:certificate-manager
|
|
1185
|
+
gcp:cloud-api-gateway
|
|
1186
|
+
gcp:cloud-apis
|
|
1187
|
+
gcp:cloud-armor
|
|
1188
|
+
gcp:cloud-asset-inventory
|
|
1189
|
+
gcp:cloud-audit-logs
|
|
1190
|
+
gcp:cloud-build
|
|
1191
|
+
gcp:cloud-cdn
|
|
1192
|
+
gcp:cloud-code
|
|
1193
|
+
gcp:cloud-composer
|
|
1194
|
+
gcp:cloud-data-fusion
|
|
1195
|
+
gcp:cloud-deploy
|
|
1196
|
+
gcp:cloud-deployment-manager
|
|
1197
|
+
gcp:cloud-dns
|
|
1198
|
+
gcp:cloud-domains
|
|
1199
|
+
gcp:cloud-ekm
|
|
1200
|
+
gcp:cloud-endpoints
|
|
1201
|
+
gcp:cloud-external-ip-addresses
|
|
1202
|
+
gcp:cloud-firewall-rules
|
|
1203
|
+
gcp:cloud-for-marketing
|
|
1204
|
+
gcp:cloud-functions
|
|
1205
|
+
gcp:cloud-generic
|
|
1206
|
+
gcp:cloud-gpu
|
|
1207
|
+
gcp:cloud-healthcare-api
|
|
1208
|
+
gcp:cloud-healthcare-marketplace
|
|
1209
|
+
gcp:cloud-hsm
|
|
1210
|
+
gcp:cloud-ids
|
|
1211
|
+
gcp:cloud-inference-api
|
|
1212
|
+
gcp:cloud-interconnect
|
|
1213
|
+
gcp:cloud-jobs-api
|
|
1214
|
+
gcp:cloud-load-balancing
|
|
1215
|
+
gcp:cloud-logging
|
|
1216
|
+
gcp:cloud-media-edge
|
|
1217
|
+
gcp:cloud-monitoring
|
|
1218
|
+
gcp:cloud-nat
|
|
1219
|
+
gcp:cloud-natural-language-api
|
|
1220
|
+
gcp:cloud-network
|
|
1221
|
+
gcp:cloud-ops
|
|
1222
|
+
gcp:cloud-optimization-ai
|
|
1223
|
+
gcp:cloud-optimization-ai-fleet-routing-api
|
|
1224
|
+
gcp:cloud-router
|
|
1225
|
+
gcp:cloud-routes
|
|
1226
|
+
gcp:cloud-run
|
|
1227
|
+
gcp:cloud-run-for-anthos
|
|
1228
|
+
gcp:cloud-scheduler
|
|
1229
|
+
gcp:cloud-security-scanner
|
|
1230
|
+
gcp:cloud-shell
|
|
1231
|
+
gcp:cloud-spanner
|
|
1232
|
+
gcp:cloud-sql
|
|
1233
|
+
gcp:cloud-storage
|
|
1234
|
+
gcp:cloud-tasks
|
|
1235
|
+
gcp:cloud-test-lab
|
|
1236
|
+
gcp:cloud-tpu
|
|
1237
|
+
gcp:cloud-translation-api
|
|
1238
|
+
gcp:cloud-vision-api
|
|
1239
|
+
gcp:cloud-vpn
|
|
1240
|
+
gcp:compute-engine
|
|
1241
|
+
gcp:configuration-management
|
|
1242
|
+
gcp:connectivity-test
|
|
1243
|
+
gcp:connectors
|
|
1244
|
+
gcp:contact-center-ai
|
|
1245
|
+
gcp:container-optimized-os
|
|
1246
|
+
gcp:container-registry
|
|
1247
|
+
gcp:data-catalog
|
|
1248
|
+
gcp:data-labeling
|
|
1249
|
+
gcp:data-layers
|
|
1250
|
+
gcp:data-loss-prevention-api
|
|
1251
|
+
gcp:data-qn-a
|
|
1252
|
+
gcp:data-studio
|
|
1253
|
+
gcp:data-transfer
|
|
1254
|
+
gcp:database-migration-service
|
|
1255
|
+
gcp:dataflow
|
|
1256
|
+
gcp:datalab
|
|
1257
|
+
gcp:dataplex
|
|
1258
|
+
gcp:datapol
|
|
1259
|
+
gcp:dataprep
|
|
1260
|
+
gcp:dataproc
|
|
1261
|
+
gcp:dataproc-metastore
|
|
1262
|
+
gcp:datashare
|
|
1263
|
+
gcp:datastore
|
|
1264
|
+
gcp:datastream
|
|
1265
|
+
gcp:debugger
|
|
1266
|
+
gcp:developer-portal
|
|
1267
|
+
gcp:dialogflow
|
|
1268
|
+
gcp:dialogflow-cx
|
|
1269
|
+
gcp:dialogflow-insights
|
|
1270
|
+
gcp:document-ai
|
|
1271
|
+
gcp:early-access-center
|
|
1272
|
+
gcp:error-reporting
|
|
1273
|
+
gcp:eventarc
|
|
1274
|
+
gcp:filestore
|
|
1275
|
+
gcp:financial-services-marketplace
|
|
1276
|
+
gcp:firestore
|
|
1277
|
+
gcp:fleet-engine
|
|
1278
|
+
gcp:free-trial
|
|
1279
|
+
gcp:game-servers
|
|
1280
|
+
gcp:gce-systems-management
|
|
1281
|
+
gcp:genomics
|
|
1282
|
+
gcp:gke-on-prem
|
|
1283
|
+
gcp:google-cloud-marketplace
|
|
1284
|
+
gcp:google-kubernetes-engine
|
|
1285
|
+
gcp:google-maps-platform
|
|
1286
|
+
gcp:healthcare-nlp-api
|
|
1287
|
+
gcp:home
|
|
1288
|
+
gcp:identity-and-access-management
|
|
1289
|
+
gcp:identity-aware-proxy
|
|
1290
|
+
gcp:identity-platform
|
|
1291
|
+
gcp:iot-core
|
|
1292
|
+
gcp:iot-edge
|
|
1293
|
+
gcp:key-access-justifications
|
|
1294
|
+
gcp:key-management-service
|
|
1295
|
+
gcp:kuberun
|
|
1296
|
+
gcp:launcher
|
|
1297
|
+
gcp:local-ssd
|
|
1298
|
+
gcp:looker
|
|
1299
|
+
gcp:managed-service-for-microsoft-active-directory
|
|
1300
|
+
gcp:media-translation-api
|
|
1301
|
+
gcp:memorystore
|
|
1302
|
+
gcp:migrate-for-anthos
|
|
1303
|
+
gcp:migrate-for-compute-engine
|
|
1304
|
+
gcp:my-cloud
|
|
1305
|
+
gcp:network-connectivity-center
|
|
1306
|
+
gcp:network-intelligence-center
|
|
1307
|
+
gcp:network-security
|
|
1308
|
+
gcp:network-tiers
|
|
1309
|
+
gcp:network-topology
|
|
1310
|
+
gcp:onboarding
|
|
1311
|
+
gcp:os-configuration-management
|
|
1312
|
+
gcp:os-inventory-management
|
|
1313
|
+
gcp:os-patch-management
|
|
1314
|
+
gcp:partner-interconnect
|
|
1315
|
+
gcp:partner-portal
|
|
1316
|
+
gcp:performance-dashboard
|
|
1317
|
+
gcp:permissions
|
|
1318
|
+
gcp:persistent-disk
|
|
1319
|
+
gcp:phishing-protection
|
|
1320
|
+
gcp:policy-analyzer
|
|
1321
|
+
gcp:premium-network-tier
|
|
1322
|
+
gcp:private-connectivity
|
|
1323
|
+
gcp:private-service-connect
|
|
1324
|
+
gcp:producer-portal
|
|
1325
|
+
gcp:profiler
|
|
1326
|
+
gcp:project
|
|
1327
|
+
gcp:pub-sub
|
|
1328
|
+
gcp:quantum-engine
|
|
1329
|
+
gcp:quotas
|
|
1330
|
+
gcp:real-world-insights
|
|
1331
|
+
gcp:recommendations-ai
|
|
1332
|
+
gcp:release-notes
|
|
1333
|
+
gcp:retail-api
|
|
1334
|
+
gcp:risk-manager
|
|
1335
|
+
gcp:runtime-config
|
|
1336
|
+
gcp:secret-manager
|
|
1337
|
+
gcp:security
|
|
1338
|
+
gcp:security-command-center
|
|
1339
|
+
gcp:security-health-advisor
|
|
1340
|
+
gcp:security-key-enforcement
|
|
1341
|
+
gcp:service-discovery
|
|
1342
|
+
gcp:speech-to-text
|
|
1343
|
+
gcp:stackdriver
|
|
1344
|
+
gcp:standard-network-tier
|
|
1345
|
+
gcp:stream-suite
|
|
1346
|
+
gcp:support
|
|
1347
|
+
gcp:tensorflow-enterprise
|
|
1348
|
+
gcp:text-to-speech
|
|
1349
|
+
gcp:tools-for-powershell
|
|
1350
|
+
gcp:trace
|
|
1351
|
+
gcp:traffic-director
|
|
1352
|
+
gcp:transfer
|
|
1353
|
+
gcp:transfer-appliance
|
|
1354
|
+
gcp:user-preferences
|
|
1355
|
+
gcp:vertex-ai
|
|
1356
|
+
gcp:video-intelligence-api
|
|
1357
|
+
gcp:virtual-private-cloud
|
|
1358
|
+
gcp:visual-inspection
|
|
1359
|
+
gcp:vmware-engine
|
|
1360
|
+
gcp:web-risk
|
|
1361
|
+
gcp:web-security-scanner
|
|
1362
|
+
gcp:workflows
|
|
1363
|
+
gcp:workload-identity-pool
|
|
1364
|
+
tech:aarch64
|
|
1365
|
+
tech:adobe-illustrator
|
|
1366
|
+
tech:adobe-photoshop
|
|
1367
|
+
tech:adobe-premiere-pro
|
|
1368
|
+
tech:adobe-xd
|
|
1369
|
+
tech:adonis-js
|
|
1370
|
+
tech:after-effects
|
|
1371
|
+
tech:airflow
|
|
1372
|
+
tech:akka
|
|
1373
|
+
tech:algolia
|
|
1374
|
+
tech:alpine-js
|
|
1375
|
+
tech:amazon-web-services
|
|
1376
|
+
tech:anaconda
|
|
1377
|
+
tech:android
|
|
1378
|
+
tech:android-studio
|
|
1379
|
+
tech:angular
|
|
1380
|
+
tech:angular-js
|
|
1381
|
+
tech:ansible
|
|
1382
|
+
tech:ant-design
|
|
1383
|
+
tech:apache
|
|
1384
|
+
tech:apl
|
|
1385
|
+
tech:appcelerator
|
|
1386
|
+
tech:apple
|
|
1387
|
+
tech:apple-safari
|
|
1388
|
+
tech:appwrite
|
|
1389
|
+
tech:arch-linux
|
|
1390
|
+
tech:arduino
|
|
1391
|
+
tech:argo-cd
|
|
1392
|
+
tech:astro
|
|
1393
|
+
tech:atom
|
|
1394
|
+
tech:autodesk-maya
|
|
1395
|
+
tech:autodesk-shot-grid
|
|
1396
|
+
tech:awk
|
|
1397
|
+
tech:azios
|
|
1398
|
+
tech:azure
|
|
1399
|
+
tech:azure-devops
|
|
1400
|
+
tech:azure-sql-database
|
|
1401
|
+
tech:babel
|
|
1402
|
+
tech:backbone-js
|
|
1403
|
+
tech:ballerina
|
|
1404
|
+
tech:bamboo
|
|
1405
|
+
tech:bash
|
|
1406
|
+
tech:behance
|
|
1407
|
+
tech:bitbucket
|
|
1408
|
+
tech:blender
|
|
1409
|
+
tech:bootstrap
|
|
1410
|
+
tech:bower
|
|
1411
|
+
tech:browserstack
|
|
1412
|
+
tech:bulma
|
|
1413
|
+
tech:bun
|
|
1414
|
+
tech:c
|
|
1415
|
+
tech:cairo-graphics
|
|
1416
|
+
tech:cake-php
|
|
1417
|
+
tech:canva
|
|
1418
|
+
tech:capacitor
|
|
1419
|
+
tech:cassandra
|
|
1420
|
+
tech:cent-os
|
|
1421
|
+
tech:chrome
|
|
1422
|
+
tech:circle-ci
|
|
1423
|
+
tech:clarity
|
|
1424
|
+
tech:clion
|
|
1425
|
+
tech:clojure
|
|
1426
|
+
tech:clojure-script
|
|
1427
|
+
tech:cloudflare
|
|
1428
|
+
tech:cloudflare-workers
|
|
1429
|
+
tech:cmake
|
|
1430
|
+
tech:code-igniter
|
|
1431
|
+
tech:code-pen
|
|
1432
|
+
tech:codeac
|
|
1433
|
+
tech:codecov
|
|
1434
|
+
tech:coffee-script
|
|
1435
|
+
tech:composer
|
|
1436
|
+
tech:confluence
|
|
1437
|
+
tech:consul
|
|
1438
|
+
tech:contao
|
|
1439
|
+
tech:corejs
|
|
1440
|
+
tech:cosmosdb
|
|
1441
|
+
tech:couchdb
|
|
1442
|
+
tech:cplusplus
|
|
1443
|
+
tech:crystal
|
|
1444
|
+
tech:csharp
|
|
1445
|
+
tech:css3
|
|
1446
|
+
tech:cucumber
|
|
1447
|
+
tech:cypress
|
|
1448
|
+
tech:d3js
|
|
1449
|
+
tech:dart
|
|
1450
|
+
tech:data-grip
|
|
1451
|
+
tech:data-spell
|
|
1452
|
+
tech:dbeaver
|
|
1453
|
+
tech:debian
|
|
1454
|
+
tech:deno
|
|
1455
|
+
tech:devicon
|
|
1456
|
+
tech:digital-ocean
|
|
1457
|
+
tech:discord-js
|
|
1458
|
+
tech:django
|
|
1459
|
+
tech:django-rest
|
|
1460
|
+
tech:docker
|
|
1461
|
+
tech:doctrine
|
|
1462
|
+
tech:dropwizard
|
|
1463
|
+
tech:drupal
|
|
1464
|
+
tech:eclipse-ceylon
|
|
1465
|
+
tech:eclipse-ide
|
|
1466
|
+
tech:eclipse-vert-x
|
|
1467
|
+
tech:elasticbeats
|
|
1468
|
+
tech:elasticsearch
|
|
1469
|
+
tech:electron
|
|
1470
|
+
tech:eleventy-11ty
|
|
1471
|
+
tech:elixir
|
|
1472
|
+
tech:elm
|
|
1473
|
+
tech:embedded-c
|
|
1474
|
+
tech:ember-js
|
|
1475
|
+
tech:envoy
|
|
1476
|
+
tech:erlang
|
|
1477
|
+
tech:eslint
|
|
1478
|
+
tech:express
|
|
1479
|
+
tech:facebook
|
|
1480
|
+
tech:fast-api
|
|
1481
|
+
tech:fastify
|
|
1482
|
+
tech:fauna
|
|
1483
|
+
tech:feathers
|
|
1484
|
+
tech:fedora
|
|
1485
|
+
tech:figma
|
|
1486
|
+
tech:file-zilla
|
|
1487
|
+
tech:firebase
|
|
1488
|
+
tech:firefox
|
|
1489
|
+
tech:flask
|
|
1490
|
+
tech:flutter
|
|
1491
|
+
tech:fortran
|
|
1492
|
+
tech:foundation
|
|
1493
|
+
tech:fsharp
|
|
1494
|
+
tech:gatling
|
|
1495
|
+
tech:gatsby
|
|
1496
|
+
tech:gazebo
|
|
1497
|
+
tech:gcc
|
|
1498
|
+
tech:gentoo
|
|
1499
|
+
tech:ghost
|
|
1500
|
+
tech:gimp
|
|
1501
|
+
tech:git
|
|
1502
|
+
tech:gitbook
|
|
1503
|
+
tech:github
|
|
1504
|
+
tech:github-actions
|
|
1505
|
+
tech:github-codespaces
|
|
1506
|
+
tech:gitlab
|
|
1507
|
+
tech:gitpod
|
|
1508
|
+
tech:gitter
|
|
1509
|
+
tech:gnu-emacs
|
|
1510
|
+
tech:go
|
|
1511
|
+
tech:go-land
|
|
1512
|
+
tech:godot-engine
|
|
1513
|
+
tech:google
|
|
1514
|
+
tech:google-cloud
|
|
1515
|
+
tech:gradle
|
|
1516
|
+
tech:grafana
|
|
1517
|
+
tech:grails
|
|
1518
|
+
tech:graphql
|
|
1519
|
+
tech:groovy
|
|
1520
|
+
tech:grunt-js
|
|
1521
|
+
tech:gulp-js
|
|
1522
|
+
tech:hadoop
|
|
1523
|
+
tech:handlebars
|
|
1524
|
+
tech:hardhat
|
|
1525
|
+
tech:harvester
|
|
1526
|
+
tech:hashicorp-vault
|
|
1527
|
+
tech:haskell
|
|
1528
|
+
tech:haxe
|
|
1529
|
+
tech:helm
|
|
1530
|
+
tech:heroku
|
|
1531
|
+
tech:hibernate
|
|
1532
|
+
tech:homebrew
|
|
1533
|
+
tech:html5
|
|
1534
|
+
tech:hugo
|
|
1535
|
+
tech:ibm-spss-statistics
|
|
1536
|
+
tech:ie10
|
|
1537
|
+
tech:ifttt
|
|
1538
|
+
tech:influxdb
|
|
1539
|
+
tech:inkscape
|
|
1540
|
+
tech:insomnia
|
|
1541
|
+
tech:intellij-idea
|
|
1542
|
+
tech:ionic
|
|
1543
|
+
tech:jaeger
|
|
1544
|
+
tech:jamstack
|
|
1545
|
+
tech:jasmine
|
|
1546
|
+
tech:java
|
|
1547
|
+
tech:javascript
|
|
1548
|
+
tech:jeet
|
|
1549
|
+
tech:jekyll
|
|
1550
|
+
tech:jenkins
|
|
1551
|
+
tech:jest
|
|
1552
|
+
tech:jetbrains
|
|
1553
|
+
tech:jira
|
|
1554
|
+
tech:jira-align
|
|
1555
|
+
tech:jquery
|
|
1556
|
+
tech:json
|
|
1557
|
+
tech:jule
|
|
1558
|
+
tech:julia
|
|
1559
|
+
tech:junit
|
|
1560
|
+
tech:jupyter
|
|
1561
|
+
tech:k3os
|
|
1562
|
+
tech:k3s
|
|
1563
|
+
tech:kafka
|
|
1564
|
+
tech:kaggle
|
|
1565
|
+
tech:karate
|
|
1566
|
+
tech:karma
|
|
1567
|
+
tech:keras
|
|
1568
|
+
tech:kibana
|
|
1569
|
+
tech:knex-js
|
|
1570
|
+
tech:knockout
|
|
1571
|
+
tech:kotlin
|
|
1572
|
+
tech:krakenjs
|
|
1573
|
+
tech:ktor
|
|
1574
|
+
tech:kubernetes
|
|
1575
|
+
tech:labview
|
|
1576
|
+
tech:laravel
|
|
1577
|
+
tech:latex
|
|
1578
|
+
tech:less-js
|
|
1579
|
+
tech:linkedin
|
|
1580
|
+
tech:linux
|
|
1581
|
+
tech:liquibase
|
|
1582
|
+
tech:livewire
|
|
1583
|
+
tech:llvm
|
|
1584
|
+
tech:logstash
|
|
1585
|
+
tech:lua
|
|
1586
|
+
tech:lumen
|
|
1587
|
+
tech:magento
|
|
1588
|
+
tech:markdown
|
|
1589
|
+
tech:material-ui
|
|
1590
|
+
tech:materialize
|
|
1591
|
+
tech:matlab
|
|
1592
|
+
tech:matplotlib
|
|
1593
|
+
tech:maven
|
|
1594
|
+
tech:meteor-js
|
|
1595
|
+
tech:microsoft-sql-server
|
|
1596
|
+
tech:minitab
|
|
1597
|
+
tech:mob-x
|
|
1598
|
+
tech:mocha
|
|
1599
|
+
tech:modx
|
|
1600
|
+
tech:moleculer
|
|
1601
|
+
tech:mongodb
|
|
1602
|
+
tech:mongoose-js
|
|
1603
|
+
tech:moodle
|
|
1604
|
+
tech:ms-dos
|
|
1605
|
+
tech:mysql
|
|
1606
|
+
tech:nano
|
|
1607
|
+
tech:nerog
|
|
1608
|
+
tech:nestjs
|
|
1609
|
+
tech:net
|
|
1610
|
+
tech:net-core
|
|
1611
|
+
tech:network-x
|
|
1612
|
+
tech:new4j
|
|
1613
|
+
tech:nextjs
|
|
1614
|
+
tech:nginx
|
|
1615
|
+
tech:nhibernate
|
|
1616
|
+
tech:nim
|
|
1617
|
+
tech:nimble
|
|
1618
|
+
tech:nix
|
|
1619
|
+
tech:nodejs
|
|
1620
|
+
tech:nodemon
|
|
1621
|
+
tech:nodewebkit
|
|
1622
|
+
tech:npm
|
|
1623
|
+
tech:nuget
|
|
1624
|
+
tech:num-py
|
|
1625
|
+
tech:nuxt-js
|
|
1626
|
+
tech:objective-c
|
|
1627
|
+
tech:ocaml
|
|
1628
|
+
tech:oh-my-zsh
|
|
1629
|
+
tech:okta
|
|
1630
|
+
tech:open-al
|
|
1631
|
+
tech:open-api
|
|
1632
|
+
tech:open-cl
|
|
1633
|
+
tech:open-cv
|
|
1634
|
+
tech:open-gl
|
|
1635
|
+
tech:open-stack
|
|
1636
|
+
tech:open-suse
|
|
1637
|
+
tech:open-telemetry
|
|
1638
|
+
tech:opera
|
|
1639
|
+
tech:oracle
|
|
1640
|
+
tech:p5js
|
|
1641
|
+
tech:packer
|
|
1642
|
+
tech:pandas
|
|
1643
|
+
tech:perl
|
|
1644
|
+
tech:pf-sense
|
|
1645
|
+
tech:phalcon
|
|
1646
|
+
tech:phoenix-framework
|
|
1647
|
+
tech:photon-engine
|
|
1648
|
+
tech:php
|
|
1649
|
+
tech:php-storm
|
|
1650
|
+
tech:playwrite
|
|
1651
|
+
tech:ploty
|
|
1652
|
+
tech:podman
|
|
1653
|
+
tech:polygon
|
|
1654
|
+
tech:portainer
|
|
1655
|
+
tech:postcss
|
|
1656
|
+
tech:postgresql
|
|
1657
|
+
tech:postman
|
|
1658
|
+
tech:powershell
|
|
1659
|
+
tech:processing
|
|
1660
|
+
tech:prometheus
|
|
1661
|
+
tech:protractor
|
|
1662
|
+
tech:purescript
|
|
1663
|
+
tech:putty
|
|
1664
|
+
tech:pycharm
|
|
1665
|
+
tech:pyscript
|
|
1666
|
+
tech:pytest
|
|
1667
|
+
tech:python
|
|
1668
|
+
tech:python-poetry
|
|
1669
|
+
tech:pytorch
|
|
1670
|
+
tech:qodana
|
|
1671
|
+
tech:qt
|
|
1672
|
+
tech:quarkus
|
|
1673
|
+
tech:quasar
|
|
1674
|
+
tech:qwik
|
|
1675
|
+
tech:r
|
|
1676
|
+
tech:rabbitmq
|
|
1677
|
+
tech:rancher
|
|
1678
|
+
tech:raspberrypi
|
|
1679
|
+
tech:reach
|
|
1680
|
+
tech:react
|
|
1681
|
+
tech:react-bootstrap
|
|
1682
|
+
tech:realm
|
|
1683
|
+
tech:red-cube-s-epic-compiler-thingy-programming-re-ct
|
|
1684
|
+
tech:redhat
|
|
1685
|
+
tech:redis
|
|
1686
|
+
tech:redux
|
|
1687
|
+
tech:ren-py
|
|
1688
|
+
tech:rider
|
|
1689
|
+
tech:robot-operating-system-ros
|
|
1690
|
+
tech:rocksdb
|
|
1691
|
+
tech:rollup-js
|
|
1692
|
+
tech:rspec
|
|
1693
|
+
tech:rstudio
|
|
1694
|
+
tech:ruby
|
|
1695
|
+
tech:ruby-mine
|
|
1696
|
+
tech:ruby-on-rails
|
|
1697
|
+
tech:rust
|
|
1698
|
+
tech:salesforce
|
|
1699
|
+
tech:sanity
|
|
1700
|
+
tech:sass
|
|
1701
|
+
tech:scala
|
|
1702
|
+
tech:scalingo
|
|
1703
|
+
tech:sdl
|
|
1704
|
+
tech:selenium
|
|
1705
|
+
tech:sema-software
|
|
1706
|
+
tech:sequelize
|
|
1707
|
+
tech:shopware
|
|
1708
|
+
tech:sketch
|
|
1709
|
+
tech:slack
|
|
1710
|
+
tech:socket-io
|
|
1711
|
+
tech:solid-js
|
|
1712
|
+
tech:solidity
|
|
1713
|
+
tech:sonarqube
|
|
1714
|
+
tech:sourcetree
|
|
1715
|
+
tech:spark
|
|
1716
|
+
tech:splunk
|
|
1717
|
+
tech:spring
|
|
1718
|
+
tech:sql-developer
|
|
1719
|
+
tech:sqlalchemy
|
|
1720
|
+
tech:sqlite
|
|
1721
|
+
tech:ssh
|
|
1722
|
+
tech:stackoverflow
|
|
1723
|
+
tech:stata
|
|
1724
|
+
tech:storybook
|
|
1725
|
+
tech:streamlit
|
|
1726
|
+
tech:stylus
|
|
1727
|
+
tech:subversion
|
|
1728
|
+
tech:svelte
|
|
1729
|
+
tech:swagger
|
|
1730
|
+
tech:swift
|
|
1731
|
+
tech:symfony
|
|
1732
|
+
tech:tailwind-css
|
|
1733
|
+
tech:tauri
|
|
1734
|
+
tech:tensorflow
|
|
1735
|
+
tech:terraform
|
|
1736
|
+
tech:tex
|
|
1737
|
+
tech:the-algorithms
|
|
1738
|
+
tech:three-js
|
|
1739
|
+
tech:titanium-sdk
|
|
1740
|
+
tech:tomcat
|
|
1741
|
+
tech:tortoise-git
|
|
1742
|
+
tech:tower
|
|
1743
|
+
tech:traefik-mesh
|
|
1744
|
+
tech:traefik-proxy
|
|
1745
|
+
tech:travis-ci
|
|
1746
|
+
tech:trello
|
|
1747
|
+
tech:twitter
|
|
1748
|
+
tech:typescript
|
|
1749
|
+
tech:typo3
|
|
1750
|
+
tech:ubuntu
|
|
1751
|
+
tech:uml
|
|
1752
|
+
tech:unity
|
|
1753
|
+
tech:unix
|
|
1754
|
+
tech:unreal-engine
|
|
1755
|
+
tech:uwsgi
|
|
1756
|
+
tech:v8
|
|
1757
|
+
tech:vagrant
|
|
1758
|
+
tech:vala
|
|
1759
|
+
tech:vercel
|
|
1760
|
+
tech:veutify
|
|
1761
|
+
tech:vim
|
|
1762
|
+
tech:visualstudio
|
|
1763
|
+
tech:vite
|
|
1764
|
+
tech:vitejs
|
|
1765
|
+
tech:vscode
|
|
1766
|
+
tech:vsphere
|
|
1767
|
+
tech:vue
|
|
1768
|
+
tech:vue-storefront
|
|
1769
|
+
tech:vyper
|
|
1770
|
+
tech:webassembly
|
|
1771
|
+
tech:webflow
|
|
1772
|
+
tech:weblate
|
|
1773
|
+
tech:webpack
|
|
1774
|
+
tech:webstorm
|
|
1775
|
+
tech:windows8
|
|
1776
|
+
tech:windows11
|
|
1777
|
+
tech:woo-commerce
|
|
1778
|
+
tech:wordpress
|
|
1779
|
+
tech:xamarin
|
|
1780
|
+
tech:xcode
|
|
1781
|
+
tech:xml
|
|
1782
|
+
tech:yaml
|
|
1783
|
+
tech:yarn
|
|
1784
|
+
tech:yii-framework
|
|
1785
|
+
tech:yuno-host
|
|
1786
|
+
tech:zend-framework
|
|
1787
|
+
tech:zig
|
|
1788
|
+
}}`,W_="likec4builtin",pZ=`${W_}:///likec4/lib/icons.c4`;var rs=Bs();const hZ=new rs.NotificationType("likec4/onDidChangeModel"),mZ=new rs.RequestType0("likec4/fetchModel"),gZ=new rs.RequestType("likec4/fetchComputedModel"),yZ=new rs.RequestType("likec4/computeView"),vZ=new rs.RequestType("likec4/layout-view"),wZ=new rs.RequestType("likec4/build"),bZ=new rs.RequestType("likec4/locate"),DZ=new rs.RequestType("likec4/change-view");class EZ{constructor(e){this.services=e}disposables=[];init(){const e=this.services.likec4.ModelBuilder,n=this.services.likec4.ModelLocator,r=this.services.likec4.ModelChanges,i=this.services.likec4.Views,s=this.services.shared.lsp.Connection;if(!s){Fe.info("[ServerRpc] no connection, not initializing");return}Fe.info("[ServerRpc] init");const o=this.services.shared.workspace.LangiumDocuments,a=this.services.shared.workspace.DocumentBuilder,c=c9(()=>{s.sendNotification(hZ,"").catch(l=>(Fe.error(`[ServerRpc] error sending onDidChangeModel: ${l}`),Promise.resolve()))},{timing:"trailing",waitMs:300,maxWaitMs:1e3});let u=!0;this.disposables.push(Os.create(()=>{c.cancel()}),e.onModelParsed(()=>c.call()),s.onRequest(gZ,async({cleanCaches:l},d)=>(l&&this.services.WorkspaceCache.clear(),{model:await e.buildComputedModel(d)})),s.onRequest(mZ,async l=>({model:await e.buildModel(l)})),s.onRequest(yZ,async({viewId:l},d)=>({view:await e.computeView(l,d)})),s.onRequest(vZ,async({viewId:l},d)=>({result:await i.layoutView(l,d)})),s.onRequest(wZ,async({docs:l},d)=>{const f=l.map(v=>Zt.parse(v)),p=v=>f.every(b=>!Ct.equals(b,v)),h=o.all.filter(v=>$d(v)&&p(v.uri)&&v.uri.scheme!==W_).map(v=>v.uri).toArray();Fe.debug(`[ServerRpc] received request to build:
|
|
1789
|
+
changed (total ${f.length}):${l.map(v=>`
|
|
1790
|
+
- `+v).join("")}
|
|
1791
|
+
deleted (total ${h.length}):${h.map(v=>`
|
|
1792
|
+
- `+v.toString()).join(`
|
|
1793
|
+
`)}`),!u&&f.length+h.length>0&&(await Promise.allSettled([...f,...h].map(async v=>{const b=v.toString();Fe.debug(`clear diagnostics for ${b}`);try{await s.sendDiagnostics({uri:b,diagnostics:[]})}catch(g){Fe.warn(`error clearing diagnostics for ${b}: ${g}`)}})),await jt(d)),u=!1,await a.update(f,h,d)}),s.onRequest(bZ,l=>{if("element"in l)return n.locateElement(l.element,l.property??"name");if("relation"in l)return n.locateRelation(l.relation);if("view"in l)return n.locateView(l.view);if("deployment"in l)return n.locateDeploymentElement(l.deployment,l.property??"name");Oe(l)}),s.onRequest(DZ,async(l,d)=>await r.applyChange(l)))}dispose(){let e;for(;e=this.disposables.pop();)try{e.dispose()}catch(n){UC(n)}}}class RZ{constructor(e){this.services=e}getSymbolKind(e){const n=Tt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(rr,no,Xi,Yi):return hr.Constructor;case r(ca,ua,Ul,aa,ga):return hr.Namespace;case r(Zs):return hr.Class;case r(es,ro,eo,ya):return hr.EnumMember;case r(Qi,ha):return hr.Event;case r(Ji,ta,fa,da):return hr.TypeParameter}return hr.Field}getCompletionItemKind(e){const n=Tt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(eo):return Ft.Color;case r(rr,Xi,Yi,no):return Ft.Constructor;case r(ca,ua,Ul,aa,ga):return Ft.Module;case r(Zs):return Ft.Class;case r(es,ro,eo,ya):return Ft.EnumMember;case r(Qi,ha):return Ft.Event;case r(Ji,fa,ta,da):return Ft.TypeParameter;default:return Ft.Reference}}}class $Z extends ES{documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(fZ,Zt.parse(pZ))),await super.loadAdditionalDocuments(e,n)}workspace(){return this.folders&&h2(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return Ce(e,"Workspace not initialized"),Zt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return Ce(e,"Workspace not initialized"),new URL(e.uri)}}class TZ extends C1{}class SZ{constructor(e){this.services=e}cache=new WeakMap;viewsWithReportedErrors=new Set;get layouter(){return this.services.likec4.Layouter}async computedViews(e){const n=await this.services.likec4.ModelBuilder.buildComputedModel(e);return n?Gc(n.views):[]}async layoutAllViews(e){const n=await this.computedViews(e);if(n.length===0)return[];const r=[],i=[];for(const s of n)this.viewsWithReportedErrors.delete(s.id),i.push(this.layouter.layout(s).then(o=>(this.cache.set(s,o),o)).catch(o=>(this.cache.delete(s),ve(o),Promise.reject(o))));for(const s of await Promise.allSettled(i))s.status==="fulfilled"&&r.push(s.value);return r}async layoutView(e,n){const r=await this.services.likec4.ModelBuilder.buildComputedModel(n);if(!r)return null;const i=r.views[e];if(!i)return null;let s=this.cache.get(i);if(s)return s;try{const o=await this.layouter.layout(i);return this.viewsWithReportedErrors.delete(e),this.cache.set(i,o),o}catch(o){if(!this.viewsWithReportedErrors.has(e)){const a=o instanceof Error?o.message:""+o;this.services.shared.lsp.Connection?.window.showErrorMessage(`LikeC4: ${a}`),this.viewsWithReportedErrors.add(e)}return Fe.error(o),Promise.reject(o)}}async diagrams(){return(await this.layoutAllViews()).map(e=>e.diagram)}async viewsAsGraphvizOut(){const e="All-LayoutedViews-DotWithSvg",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=(await this.computedViews()).map(async o=>{const{dot:a,svg:c}=await this.layouter.svg(o);return{id:o.id,dot:a,svg:c}}),i=[],s=await Promise.allSettled(r);for(const o of s)o.status==="fulfilled"?i.push(o.value):ve(o.reason);return n.set(e,i),i}async overviewGraph(){const e="OverviewGraph",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}const kZ={lsp:{NodeKindProvider:t=>new RZ(t),WorkspaceSymbolProvider:t=>new TZ(t)},workspace:{WorkspaceManager:t=>new $Z(t)}};function Lt(t){return e=>new t(e)}const CZ={documentation:{DocumentationProvider:Lt(eY)},WorkspaceCache:t=>new wS(t.shared),DocumentCache:t=>new Aq(t.shared),Rpc:Lt(EZ),likec4:{Layouter:t=>(Fe.debug("Creating GraphvizLayouter with GraphvizWasmAdapter"),new kA(new CA)),Views:Lt(SZ),DeploymentsIndex:Lt(RY),ModelChanges:Lt(oZ),FqnIndex:Lt(kY),ModelParser:Lt(JJ),ModelBuilder:Lt(rX),ModelLocator:Lt(oX)},lsp:{CompletionProvider:Lt(sY),DocumentHighlightProvider:Lt(oY),DocumentSymbolProvider:Lt(yY),SemanticTokenProvider:Lt(EY),HoverProvider:Lt(DY),CodeLensProvider:Lt(iY),DocumentLinkProvider:Lt(gY),Formatter:Lt(rY)},references:{NameProvider:Lt(aZ),ScopeComputation:Lt(uZ),ScopeProvider:Lt(dZ)}};function AZ(t,e,n,r){const i=_Z(t),s=[M7({shared:i}),KK,CZ,e,n,r].reduce(H_,{}),o=xp(s);return i.ServiceRegistry.register(o),jX(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function _Z(t={}){const e={...BS,...t};return t.connection&&RH(t.connection),xp(z7(e),VK,kZ)}function H_(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=H_(i,r):t[n]=r}}return t}function un(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const ub=(t,e)=>{const n=V_(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},V_=t=>t instanceof URL?qm(t):t,K_=(t,e=[],n={})=>{const r=ub(t,"First argument"),[i,s]=un(e)?[[],e]:[e,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const o=i.map(String),a=o.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!un(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,o,s]},{toString:Y_}=Object.prototype,PZ=t=>Y_.call(t)==="[object ArrayBuffer]",wr=t=>Y_.call(t)==="[object Uint8Array]",Pd=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),xZ=new TextEncoder,X_=t=>xZ.encode(t),IZ=new TextDecoder,J_=t=>IZ.decode(t),NZ=(t,e)=>OZ(t,e).join(""),OZ=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new H0(e),r=t.map(s=>typeof s=="string"?X_(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},lb=t=>t.length===1&&wr(t[0])?t[0]:Z_(FZ(t)),FZ=t=>t.map(e=>typeof e=="string"?X_(e):e),Z_=t=>{const e=new Uint8Array(LZ(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},LZ=t=>{let e=0;for(const n of t)e+=n.length;return e},MZ=t=>Array.isArray(t)&&Array.isArray(t.raw),BZ=(t,e)=>{let n=[];for(const[s,o]of t.entries())n=zZ({templates:t,expressions:e,tokens:n,index:s,template:o});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},zZ=({templates:t,expressions:e,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[r]}`);const{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=qZ(i,t.raw[r]),c=eP(n,s,o);if(r===e.length)return c;const u=e[r],l=Array.isArray(u)?u.map(d=>tP(d)):[tP(u)];return eP(c,l,a)},qZ=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=Q_.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){const c=e[a];if(Q_.has(c))r!==o&&n.push(t.slice(r,o)),r=o+1;else if(c==="\\"){const u=e[a+1];u==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=jZ[u]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},Q_=new Set([" "," ","\r",`
|
|
1794
|
+
`]),jZ={x:3,u:5},eP=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],tP=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(un(t)&&("stdout"in t||"isMaxBuffer"in t))return UZ(t);throw t instanceof W0||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},UZ=({stdout:t})=>{if(typeof t=="string")return t;if(wr(t))return J_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)},so=t=>db.includes(t),db=[ot.stdin,ot.stdout,ot.stderr],Ur=["stdin","stdout","stderr"],nP=t=>Ur[t]??`stdio[${t}]`,GZ=t=>{const e={...t};for(const n of oP)e[n]=rP(t,n);return e},rP=(t,e)=>{const n=Array.from({length:WZ(t)+1}),r=HZ(t[e],n,e);return JZ(r,e)},WZ=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Ur.length):Ur.length,HZ=(t,e,n)=>un(t)?VZ(t,e,n):e.fill(t),VZ=(t,e,n)=>{for(const r of Object.keys(t).sort(KZ))for(const i of YZ(r,n,e))e[i]=t[r];return e},KZ=(t,e)=>iP(t)<iP(e)?1:-1,iP=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,YZ=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=sP(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
1795
|
+
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
1796
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},sP=t=>{if(t==="all")return t;if(Ur.includes(t))return Ur.indexOf(t);const e=XZ.exec(t);if(e!==null)return Number(e[1])},XZ=/^fd(\d+)$/,JZ=(t,e)=>t.map(n=>n===void 0?QZ[e]:n),ZZ=MN("execa").enabled?"full":"none",QZ={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ZZ,stripFinalNewline:!0},oP=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],xd=(t,e)=>e==="ipc"?t.at(-1):t[e],fb=({verbose:t},e)=>hb(t,e)!=="none",pb=({verbose:t},e)=>!["none","short"].includes(hb(t,e)),eQ=({verbose:t},e)=>{const n=hb(t,e);return mb(n)?n:void 0},hb=(t,e)=>e===void 0?tQ(t):xd(t,e),tQ=t=>t.find(e=>mb(e))??gb.findLast(e=>t.includes(e)),mb=t=>typeof t=="function",gb=["none","short","full"],nQ=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>cQ(aP(s))).join(" ");return{command:r,escapedCommand:i}},yb=t=>BN(t).split(`
|
|
1797
|
+
`).map(e=>aP(e)).join(`
|
|
1798
|
+
`),aP=t=>t.replaceAll(sQ,e=>rQ(e)),rQ=t=>{const e=oQ[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=aQ?`\\u${r.padStart(4,"0")}`:`\\U${r}`},iQ=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},sQ=iQ(),oQ={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},aQ=65535,cQ=t=>uQ.test(t)?t:YN==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,uQ=/^[\w./-]+$/;function lQ(){return ot.platform!=="win32"?ot.env.TERM!=="linux":!!ot.env.WT_SESSION||!!ot.env.TERMINUS_SUBLIME||ot.env.ConEmuTask==="{cmd::Cmder}"||ot.env.TERM_PROGRAM==="Terminus-Sublime"||ot.env.TERM_PROGRAM==="vscode"||ot.env.TERM==="xterm-256color"||ot.env.TERM==="alacritty"||ot.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const cP={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},dQ={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},fQ={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},pQ={...cP,...dQ},hQ={...cP,...fQ},mQ=lQ(),vb=mQ?pQ:hQ,gQ=O0.WriteStream.prototype.hasColors(),fm=(t,e)=>{if(!gQ)return i=>i;const n=`\x1B[${t}m`,r=`\x1B[${e}m`;return i=>{const s=i+"";let o=s.indexOf(r);if(o===-1)return n+s+r;let a=n,c=0;for(;o!==-1;)a+=s.slice(c,o)+n,c=o+r.length,o=s.indexOf(r,c);return a+=s.slice(c)+r,a}},yQ=fm(1,22),wb=fm(90,39),vQ=fm(91,39),wQ=fm(93,39),bQ=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:o=!0}})=>{const a=DQ(n),c=EQ[t]({failed:s,reject:o,piped:r}),u=RQ[t]({reject:o});return`${wb(`[${a}]`)} ${wb(`[${i}]`)} ${u(c)} ${u(e)}`},DQ=t=>`${pm(t.getHours(),2)}:${pm(t.getMinutes(),2)}:${pm(t.getSeconds(),2)}.${pm(t.getMilliseconds(),3)}`,pm=(t,e)=>String(t).padStart(e,"0"),uP=({failed:t,reject:e})=>t?e?vb.cross:vb.warning:vb.tick,EQ={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:uP,duration:uP},lP=t=>t,RQ={command:()=>yQ,output:()=>lP,ipc:()=>lP,error:({reject:t})=>t?vQ:wQ,duration:()=>wb},$Q=(t,e,n)=>{const r=eQ(e,n);return t.map(({verboseLine:i,verboseObject:s})=>TQ(i,s,r)).filter(i=>i!==void 0).map(i=>SQ(i)).join("")},TQ=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},SQ=t=>t.endsWith(`
|
|
1799
|
+
`)?t:`${t}
|
|
1800
|
+
`,Id=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=kQ({type:t,result:i,verboseInfo:r}),o=CQ(e,s),a=$Q(o,r,n);A0(_Q,a)},kQ=({type:t,result:e,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:t,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:e,options:s}),CQ=(t,e)=>t.split(`
|
|
1801
|
+
`).map(n=>AQ({...e,message:n})),AQ=t=>({verboseLine:bQ(t),verboseObject:t}),_Q=2,dP=t=>{const e=typeof t=="string"?t:Wd(t);return yb(e).replaceAll(" "," ".repeat(PQ))},PQ=2,xQ=(t,e)=>{fb(e)&&Id({type:"command",verboseMessage:t,verboseInfo:e})},IQ=(t,e,n)=>{FQ(t);const r=NQ(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},NQ=t=>fb({verbose:t})?OQ++:void 0;let OQ=0n;const FQ=t=>{for(const e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!gb.includes(e)&&!mb(e)){const n=gb.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},fP=()=>Hd.bigint(),pP=t=>Number(Hd.bigint()-t)/1e6,hP=(t,e,n)=>{const r=fP(),{command:i,escapedCommand:s}=nQ(t,e),o=rP(n,"verbose"),a=IQ(o,s,{...n});return xQ(s,a),{command:i,escapedCommand:s,startTime:r,verboseInfo:a}};var oo={exports:{}},bb,mP;function LQ(){if(mP)return bb;mP=1,bb=r,r.sync=i;var t=yo;function e(s,o){var a=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var c=0;c<a.length;c++){var u=a[c].toLowerCase();if(u&&s.substr(-u.length).toLowerCase()===u)return!0}return!1}function n(s,o,a){return!s.isSymbolicLink()&&!s.isFile()?!1:e(o,a)}function r(s,o,a){t.stat(s,function(c,u){a(c,c?!1:n(u,s,o))})}function i(s,o){return n(t.statSync(s),s,o)}return bb}var Db,gP;function MQ(){if(gP)return Db;gP=1,Db=e,e.sync=n;var t=yo;function e(s,o,a){t.stat(s,function(c,u){a(c,c?!1:r(u,o))})}function n(s,o){return r(t.statSync(s),o)}function r(s,o){return s.isFile()&&i(s,o)}function i(s,o){var a=s.mode,c=s.uid,u=s.gid,l=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),d=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),f=parseInt("100",8),p=parseInt("010",8),h=parseInt("001",8),v=f|p,b=a&h||a&p&&u===d||a&f&&c===l||a&v&&l===0;return b}return Db}var Eb,yP;function BQ(){if(yP)return Eb;yP=1;var t;process.platform==="win32"||wq.TESTING_WINDOWS?t=LQ():t=MQ(),Eb=e,e.sync=n;function e(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,a){e(r,i||{},function(c,u){c?a(c):o(u)})})}t(r,i||{},function(o,a){o&&(o.code==="EACCES"||i&&i.ignoreErrors)&&(o=null,a=!1),s(o,a)})}function n(r,i){try{return t.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return Eb}var Rb,vP;function zQ(){if(vP)return Rb;vP=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=Tr,n=t?";":":",r=BQ(),i=c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),s=(c,u)=>{const l=u.colon||n,d=c.match(/\//)||t&&c.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(l)],f=t?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=t?f.split(l):[""];return t&&c.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:d,pathExt:p,pathExtExe:f}},o=(c,u,l)=>{typeof u=="function"&&(l=u,u={}),u||(u={});const{pathEnv:d,pathExt:f,pathExtExe:p}=s(c,u),h=[],v=g=>new Promise((w,R)=>{if(g===d.length)return u.all&&h.length?w(h):R(i(c));const k=d[g],A=/^".*"$/.test(k)?k.slice(1,-1):k,N=e.join(A,c),_=!A&&/^\.[\\\/]/.test(c)?c.slice(0,2)+N:N;w(b(_,g,0))}),b=(g,w,R)=>new Promise((k,A)=>{if(R===f.length)return k(v(w+1));const N=f[R];r(g+N,{pathExt:p},(_,B)=>{if(!_&&B)if(u.all)h.push(g+N);else return k(g+N);return k(b(g,w,R+1))})});return l?v(0).then(g=>l(null,g),l):v(0)},a=(c,u)=>{u=u||{};const{pathEnv:l,pathExt:d,pathExtExe:f}=s(c,u),p=[];for(let h=0;h<l.length;h++){const v=l[h],b=/^".*"$/.test(v)?v.slice(1,-1):v,g=e.join(b,c),w=!b&&/^\.[\\\/]/.test(c)?c.slice(0,2)+g:g;for(let R=0;R<d.length;R++){const k=w+d[R];try{if(r.sync(k,{pathExt:f}))if(u.all)p.push(k);else return k}catch{}}}if(u.all&&p.length)return p;if(u.nothrow)return null;throw i(c)};return Rb=o,o.sync=a,Rb}var hm={exports:{}},wP;function qQ(){if(wP)return hm.exports;wP=1;const t=(e={})=>{const n=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return hm.exports=t,hm.exports.default=t,hm.exports}var $b,bP;function jQ(){if(bP)return $b;bP=1;const t=Tr,e=zQ(),n=qQ();function r(s,o){const a=s.options.env||process.env,c=process.cwd(),u=s.options.cwd!=null,l=u&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let d;try{d=e.sync(s.command,{path:a[n({env:a})],pathExt:o?t.delimiter:void 0})}catch{}finally{l&&process.chdir(c)}return d&&(d=t.resolve(u?s.options.cwd:"",d)),d}function i(s){return r(s)||r(s,!0)}return $b=i,$b}var mm={},DP;function UQ(){if(DP)return mm;DP=1;const t=/([()\][%!^"`<>&|;, *?])/g;function e(r){return r=r.replace(t,"^$1"),r}function n(r,i){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(t,"^$1"),i&&(r=r.replace(t,"^$1")),r}return mm.command=e,mm.argument=n,mm}var Tb,EP;function GQ(){return EP||(EP=1,Tb=/^#!(.*)/),Tb}var Sb,RP;function WQ(){if(RP)return Sb;RP=1;const t=GQ();return Sb=(e="")=>{const n=e.match(t);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},Sb}var kb,$P;function HQ(){if($P)return kb;$P=1;const t=yo,e=WQ();function n(r){const s=Buffer.alloc(150);let o;try{o=t.openSync(r,"r"),t.readSync(o,s,0,150,0),t.closeSync(o)}catch{}return e(s.toString())}return kb=n,kb}var Cb,TP;function VQ(){if(TP)return Cb;TP=1;const t=Tr,e=jQ(),n=UQ(),r=HQ(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,o=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function a(l){l.file=e(l);const d=l.file&&r(l.file);return d?(l.args.unshift(l.file),l.command=d,e(l)):l.file}function c(l){if(!i)return l;const d=a(l),f=!s.test(d);if(l.options.forceShell||f){const p=o.test(d);l.command=t.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(v=>n.argument(v,p));const h=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${h}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}function u(l,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const p={command:l,args:d,options:f,file:void 0,original:{command:l,args:d}};return f.shell?p:c(p)}return Cb=u,Cb}var Ab,SP;function KQ(){if(SP)return Ab;SP=1;const t=process.platform==="win32";function e(s,o){return Object.assign(new Error(`${o} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${o} ${s.command}`,path:s.command,spawnargs:s.args})}function n(s,o){if(!t)return;const a=s.emit;s.emit=function(c,u){if(c==="exit"){const l=r(u,o);if(l)return a.call(s,"error",l)}return a.apply(s,arguments)}}function r(s,o){return t&&s===1&&!o.file?e(o.original,"spawn"):null}function i(s,o){return t&&s===1&&!o.file?e(o.original,"spawnSync"):null}return Ab={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:e},Ab}var kP;function YQ(){if(kP)return oo.exports;kP=1;const t=N0,e=VQ(),n=KQ();function r(s,o,a){const c=e(s,o,a),u=t.spawn(c.command,c.args,c.options);return n.hookChildProcess(u,c),u}function i(s,o,a){const c=e(s,o,a),u=t.spawnSync(c.command,c.args,c.options);return u.error=u.error||n.verifyENOENTSync(u.status,c),u}return oo.exports=r,oo.exports.spawn=r,oo.exports.sync=i,oo.exports._parse=e,oo.exports._enoent=n,oo.exports}var XQ=YQ();const JQ=Ep(XQ);function CP(t={}){const{env:e=process.env,platform:n=process.platform}=t;return n!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}const ZQ=({cwd:t=ot.cwd(),path:e=ot.env[CP()],preferLocal:n=!0,execPath:r=ot.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?qm(t):t,o=Hr.resolve(s),a=[];return n&&QQ(a,o),i&&eee(a,r,o),[...a,e].join(Hr.delimiter)},QQ=(t,e)=>{let n;for(;n!==e;)t.push(Hr.join(e,"node_modules/.bin")),n=e,e=Hr.resolve(e,"..")},eee=(t,e,n)=>{const r=e instanceof URL?qm(e):e;t.push(Hr.resolve(n,r,".."))},tee=({env:t=ot.env,...e}={})=>{t={...t};const n=CP({env:t});return e.path=t[n],t[n]=ZQ(e),t},nee=(t,e,n)=>{const r=n?xb:Pb,i=t instanceof Nd?{}:{cause:t};return new r(e,i)};class Nd extends Error{}const AP=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,_P,{value:!0,writable:!1,enumerable:!1,configurable:!1})},ree=t=>_b(t)&&_P in t,_P=Symbol("isExecaError"),_b=t=>Object.prototype.toString.call(t)==="[object Error]";class Pb extends Error{}AP(Pb,Pb.name);class xb extends Error{}AP(xb,xb.name);const iee=()=>{const t=xP-PP+1;return Array.from({length:t},see)},see=(t,e)=>({name:`SIGRT${e+1}`,number:PP+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),PP=34,xP=64,oee=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],IP=()=>{const t=iee();return[...oee,...t].map(aee)},aee=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:o}}=gs,a=o!==void 0;return{name:t,number:a?o:e,description:n,supported:a,action:r,forced:i,standard:s}},cee=()=>{const t=IP();return Object.fromEntries(t.map(uee))},uee=({name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o})=>[t,{name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o}],lee=cee(),dee=()=>{const t=IP(),e=xP+1,n=Array.from({length:e},(r,i)=>fee(i,t));return Object.assign({},...n)},fee=(t,e)=>{const n=pee(t,e);if(n===void 0)return{};const{name:r,description:i,supported:s,action:o,forced:a,standard:c}=n;return{[t]:{name:r,number:t,description:i,supported:s,action:o,forced:a,standard:c}}},pee=(t,e)=>{const n=e.find(({name:r})=>gs.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};dee();const hee=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return NP(t,e)},mee=t=>t===0?t:NP(t,"`subprocess.kill()`'s argument"),NP=(t,e)=>{if(Number.isInteger(t))return gee(t,e);if(typeof t=="string")return vee(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
1802
|
+
${Ib()}`)},gee=(t,e)=>{if(OP.has(t))return OP.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
1803
|
+
${Ib()}`)},yee=()=>new Map(Object.entries(gs.signals).reverse().map(([t,e])=>[e,t])),OP=yee(),vee=(t,e)=>{if(t in gs.signals)return t;throw t.toUpperCase()in gs.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
1804
|
+
${Ib()}`)},Ib=()=>`Available signal names: ${wee()}.
|
|
1805
|
+
Available signal numbers: ${bee()}.`,wee=()=>Object.keys(gs.signals).sort().map(t=>`'${t}'`).join(", "),bee=()=>[...new Set(Object.values(gs.signals).sort((t,e)=>t-e))].join(", "),FP=t=>lee[t].description,Dee=t=>{if(t===!1)return t;if(t===!0)return Eee;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Eee=1e3*5,Ree=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},o,a)=>{const{signal:c,error:u}=$ee(o,a,n);Tee(u,r);const l=t(c);return See({kill:t,signal:c,forceKillAfterDelay:e,killSignal:n,killResult:l,context:i,controller:s}),l},$ee=(t,e,n)=>{const[r=n,i]=_b(t)?[void 0,t]:[t,e];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!_b(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:mee(r),error:i}},Tee=(t,e)=>{t!==void 0&&e.reject(t)},See=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:o})=>{e===r&&i&&LP({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:o.signal})},LP=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await V0(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},MP=async(t,e)=>{t.aborted||await Sn(t,"abort",{signal:e})},kee=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},Cee=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[Aee(t,e,r,i)],Aee=async(t,e,n,{signal:r})=>{throw await MP(e,r),n.terminationReason??="cancel",t.kill(),e.reason},Nb=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{_ee(t,e,n),BP(t,e,r)},_ee=(t,e,n)=>{if(!n)throw new Error(`${br(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},BP=(t,e,n)=>{if(!n)throw new Error(`${br(t,e)} cannot be used: the ${is(e)} has already exited or disconnected.`)},Pee=t=>{throw new Error(`${br("getOneMessage",t)} could not complete: the ${is(t)} exited or disconnected.`)},xee=t=>{throw new Error(`${br("sendMessage",t)} failed: the ${is(t)} is sending a message too, instead of listening to incoming messages.
|
|
1806
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
1807
|
+
|
|
1808
|
+
const [receivedMessage] = await Promise.all([
|
|
1809
|
+
${br("getOneMessage",t)},
|
|
1810
|
+
${br("sendMessage",t,"message, {strict: true}")},
|
|
1811
|
+
]);`)},zP=(t,e)=>new Error(`${br("sendMessage",e)} failed when sending an acknowledgment response to the ${is(e)}.`,{cause:t}),Iee=t=>{throw new Error(`${br("sendMessage",t)} failed: the ${is(t)} is not listening to incoming messages.`)},Nee=t=>{throw new Error(`${br("sendMessage",t)} failed: the ${is(t)} exited without listening to incoming messages.`)},Oee=()=>new Error(`\`cancelSignal\` aborted: the ${is(!0)} disconnected.`),Fee=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Lee=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${br(e,n)} cannot be used: the ${is(n)} is disconnecting.`,{cause:t})},Mee=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(Bee(t))throw new Error(`${br(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},Bee=({code:t,message:e})=>zee.has(t)||qee.some(n=>e.includes(n)),zee=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),qee=["could not be cloned","circular structure","call stack size exceeded"],br=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${jee(e)}${t}(${n})`,jee=t=>t?"":"subprocess.",is=t=>t?"parent process":"subprocess",Ob=t=>{t.connected&&t.disconnect()},Od=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},qP=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=ao.get(t),s=jP(i,e,!0),o=t.stdio[s];if(o===null)throw new TypeError(UP(s,e,r,!0));return o},Fb=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=ao.get(t),s=jP(i,e,!1),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(UP(s,e,r,!1));return o},ao=new WeakMap,jP=(t,e,n)=>{const r=Uee(e,n);return Gee(r,e,n,t),r},Uee=(t,e)=>{const n=sP(t);if(n!==void 0)return n;const{validOptions:r,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Fd(e)}" must not be "${t}".
|
|
1812
|
+
It must be ${r} or "fd3", "fd4" (and so on).
|
|
1813
|
+
It is optional and defaults to "${i}".`)},Gee=(t,e,n,r)=>{const i=r[GP(t)];if(i===void 0)throw new TypeError(`"${Fd(n)}" must not be ${e}. That file descriptor does not exist.
|
|
1814
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${Fd(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${Fd(n)}" must not be ${e}. It must be a writable stream, not readable.`)},UP=(t,e,n,r)=>{if(t==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;const{optionName:i,optionValue:s}=Wee(t,n);return`The "${i}: ${Lb(s)}" option is incompatible with using "${Fd(r)}: ${Lb(e)}".
|
|
1815
|
+
Please set this option with "pipe" instead.`},Wee=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=GP(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${s}]`,optionValue:i[s]}},GP=t=>t==="all"?1:t,Fd=t=>t?"to":"from",Lb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",gm=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),Y0(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},WP=(t,e)=>{e&&Mb(t)},Mb=t=>{t.refCounted()},HP=(t,e)=>{e&&Bb(t)},Bb=t=>{t.unrefCounted()},Hee=(t,e)=>{e&&(Bb(t),Bb(t))},Vee=(t,e)=>{e&&(Mb(t),Mb(t))},Kee=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(tte(i)||pte(i))return;ym.has(t)||ym.set(t,[]);const s=ym.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await ote(t,r,i),await K0.yield();const o=await ete({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",o),r.emit("message:done")}},Yee=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{QP();const s=ym.get(t);for(;s?.length>0;)await Sn(r,"message:done");t.removeListener("message",i),Vee(e,n),r.connected=!1,r.emit("disconnect")},ym=new WeakMap,vm=(t,e,n)=>{if(wm.has(t))return wm.get(t);const r=new v2;return r.connected=!0,wm.set(t,r),Xee({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},wm=new WeakMap,Xee=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=Kee.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",Yee.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),Hee(n,r)},VP=t=>{const e=wm.get(t);return e===void 0?t.channel!==null:e.connected},Jee=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=vm(t,e,n),o=zb(t,s);return{id:Zee++,type:Dm,message:r,hasListeners:o}};let Zee=0n;const Qee=(t,e)=>{if(!(e?.type!==Dm||e.hasListeners))for(const{id:n}of t)n!==void 0&&bm[n].resolve({isDeadlock:!0,hasListeners:!1})},ete=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Dm||!e.connected)return t;const{id:s,message:o}=t,a={id:s,type:KP,message:zb(e,i)};try{await YP({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return o},tte=t=>{if(t?.type!==KP)return!1;const{id:e,message:n}=t;return bm[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},nte=async(t,e,n)=>{if(t?.type!==Dm)return;const r=Od();bm[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:o}=await Promise.race([r,rte(e,n,i)]);s&&xee(n),o||Iee(n)}finally{i.abort(),delete bm[t.id]}},bm={},rte=async(t,e,{signal:n})=>{gm(t,1,n),await Sn(t,"disconnect",{signal:n}),Nee(e)},Dm="execa:ipc:request",KP="execa:ipc:response",ite=(t,e,n)=>{Ld.has(t)||Ld.set(t,new Set);const r=Ld.get(t),i=Od(),s=n?e.id:void 0,o={onMessageSent:i,id:s};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},ste=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},ote=async(t,e,n)=>{for(;!zb(t,e)&&Ld.get(t)?.size>0;){const r=[...Ld.get(t)];Qee(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},Ld=new WeakMap,zb=(t,e)=>e.listenerCount("message")>ate(t),ate=t=>ao.has(t)&&!xd(ao.get(t).options.buffer,"ipc")?1:0,YP=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const o="sendMessage";return Nb({methodName:o,isSubprocess:n,ipc:r,isConnected:t.connected}),cte({anyProcess:t,channel:e,methodName:o,isSubprocess:n,message:i,strict:s})},cte=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const o=Jee({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),a=ite(t,o,s);try{await XP({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(c){throw Ob(t),c}finally{ste(a)}},XP=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=ute(t);try{await Promise.all([nte(r,t,n),s(r)])}catch(o){throw Lee({error:o,methodName:e,isSubprocess:n}),Mee({error:o,methodName:e,isSubprocess:n,message:i}),o}},ute=t=>{if(qb.has(t))return qb.get(t);const e=zN(t.send.bind(t));return qb.set(t,e),e},qb=new WeakMap,lte=(t,e)=>{const n="cancelSignal";return BP(n,!1,t.connected),XP({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:ZP,message:e},message:e})},dte=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await fte({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),jb.signal),fte=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!JP){if(JP=!0,!r){Fee();return}if(e===null){QP();return}vm(t,e,n),await K0.yield()}};let JP=!1;const pte=t=>t?.type!==ZP?!1:(jb.abort(t.message),!0),ZP="execa:ipc:cancel",QP=()=>{jb.abort(Oee())},jb=new AbortController,hte=({gracefulCancel:t,cancelSignal:e,ipc:n,serialization:r})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},mte=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[gte({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],gte=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await MP(e,i);const s=yte(e);throw await lte(t,s),LP({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},yte=({reason:t})=>{if(!(t instanceof DOMException))return t;const e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e},vte=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},wte=(t,e,n,r)=>e===0||e===void 0?[]:[bte(t,e,n,r)],bte=async(t,e,n,{signal:r})=>{throw await V0(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new Nd},Dte=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},Ete=(t,e,{node:n=!1,nodePath:r=XN,nodeOptions:i=JN.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:o,...a})=>{if(o!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const c=ub(r,'The "nodePath" option'),u=Hr.resolve(s,c),l={...a,nodePath:u,node:n,cwd:s};if(!n)return[t,e,l];if(Hr.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...i,t,...e],{ipc:!0,...l,shell:!1}]},Rte=({ipcInput:t,ipc:e,serialization:n})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Ste[n](t)}},$te=t=>{try{b2(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Tte=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},Ste={advanced:$te,json:Tte},kte=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},Cte=({encoding:t})=>{if(Ub.has(t))return;const e=_te(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Em(t)}\`.
|
|
1816
|
+
Please rename it to ${Em(e)}.`);const n=[...Ub].map(r=>Em(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Em(t)}\`.
|
|
1817
|
+
Please rename it to one of: ${n}.`)},Ate=new Set(["utf8","utf16le"]),co=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Ub=new Set([...Ate,...co]),_te=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in ex)return ex[e];if(Ub.has(e))return e},ex={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Em=t=>typeof t=="string"?`"${t}"`:String(t),Pte=(t=tx())=>{const e=ub(t,'The "cwd" option');return Hr.resolve(e)},tx=()=>{try{return ot.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
1818
|
+
${t.message}`,t}},xte=(t,e)=>{if(e===tx())return t;let n;try{n=_N(e)}catch(r){return`The "cwd" option is invalid: ${e}.
|
|
1819
|
+
${r.message}
|
|
1820
|
+
${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
1821
|
+
${t}`},nx=(t,e,n)=>{n.cwd=Pte(n.cwd);const[r,i,s]=Ete(t,e,n),{command:o,args:a,options:c}=JQ._parse(r,i,s),u=GZ(c),l=Ite(u);return vte(l),Cte(l),Rte(l),kee(l),hte(l),l.shell=V_(l.shell),l.env=Nte(l),l.killSignal=hee(l.killSignal),l.forceKillAfterDelay=Dee(l.forceKillAfterDelay),l.lines=l.lines.map((d,f)=>d&&!co.has(l.encoding)&&l.buffer[f]),ot.platform==="win32"&&Hr.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},Ite=({extendEnv:t=!0,preferLocal:e=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:o=!0,all:a=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:h="advanced",...v})=>({...v,extendEnv:t,preferLocal:e,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:f,ipc:p,serialization:h}),Nte=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const o=e?{...ot.env,...t}:t;return n||r?tee({env:o,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):o};function Gb(t){if(typeof t=="string")return Ote(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Fte(t)}const Ote=t=>t.at(-1)===rx?t.slice(0,t.at(-2)===ix?-2:-1):t,Fte=t=>t.at(-1)===Lte?t.subarray(0,t.at(-2)===Mte?-2:-1):t,rx=`
|
|
1822
|
+
`,Lte=rx.codePointAt(0),ix="\r",Mte=ix.codePointAt(0);function uo(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function sx(t,{checkOpen:e=!0}={}){return uo(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Rm(t,{checkOpen:e=!0}={}){return uo(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function ox(t,e){return sx(t,e)&&Rm(t,e)}const Bte=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);let zte=class{#e;#t;#n=!1;#r=void 0;constructor(e,n){this.#e=e,this.#t=n}next(){const e=()=>this.#s();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const n=()=>this.#i(e);return this.#r?this.#r.then(n,n):n()}async#s(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(n){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),n}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#i(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){const n=this.#e.cancel(e);return this.#e.releaseLock(),await n,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Wb=Symbol();function ax(){return this[Wb].next()}Object.defineProperty(ax,"name",{value:"next"});function cx(t){return this[Wb].return(t)}Object.defineProperty(cx,"name",{value:"return"});const qte=Object.create(Bte,{next:{enumerable:!0,configurable:!0,writable:!0,value:ax},return:{enumerable:!0,configurable:!0,writable:!0,value:cx}});function jte({preventCancel:t=!1}={}){const e=this.getReader(),n=new zte(e,t),r=Object.create(qte);return r[Wb]=n,r}const Ute=t=>{if(Rm(t,{checkOpen:!1})&&Hb.on!==void 0)return Wte(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Gte.call(t)==="[object ReadableStream]")return jte.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Gte}=Object.prototype,Wte=async function*(t){const e=new AbortController,n={};Hte(t,e,n);try{for await(const[r]of Hb.on(t,"data",{signal:e.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!e.signal.aborted)throw r}finally{t.destroy()}},Hte=async(t,e,n)=>{try{await Hb.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},Hb={},Vb=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const u=Ute(t),l=e();l.length=0;try{for await(const d of u){const f=Kte(d),p=n[f](d,l);ux({convertedChunk:p,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return Vte({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(l)}catch(d){const f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(l),f}},Vte=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const o=i(t);o!==void 0&&ux({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},ux=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const o=n(t),a=e.length+o;if(a<=s){lx(t,e,i,a);return}const c=r(t,s-e.length);throw c!==void 0&&lx(c,e,i,s),new $m},lx=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},Kte=t=>{const e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=dx.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&dx.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:dx}=Object.prototype;class $m extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const lo=t=>t,Kb=()=>{},fx=({contents:t})=>t,px=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},hx=t=>t.length;async function Yte(t,e){return Vb(t,Qte,e)}const Xte=()=>({contents:[]}),Jte=()=>1,Zte=(t,{contents:e})=>(e.push(t),e),Qte={init:Xte,convertChunk:{string:lo,buffer:lo,arrayBuffer:lo,dataView:lo,typedArray:lo,others:lo},getSize:Jte,truncateChunk:Kb,addChunk:Zte,getFinalChunk:Kb,finalize:fx};async function ene(t,e){return Vb(t,une,e)}const tne=()=>({contents:new ArrayBuffer(0)}),nne=t=>rne.encode(t),rne=new TextEncoder,mx=t=>new Uint8Array(t),gx=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),ine=(t,e)=>t.slice(0,e),sne=(t,{contents:e,length:n},r)=>{const i=wx()?ane(e,r):one(e,r);return new Uint8Array(i).set(t,n),i},one=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(yx(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},ane=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:yx(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},yx=t=>vx**Math.ceil(Math.log(t)/Math.log(vx)),vx=2,cne=({contents:t,length:e})=>wx()?t:t.slice(0,e),wx=()=>"resize"in ArrayBuffer.prototype,une={init:tne,convertChunk:{string:nne,buffer:mx,arrayBuffer:mx,dataView:gx,typedArray:gx,others:px},getSize:hx,truncateChunk:ine,addChunk:sne,getFinalChunk:Kb,finalize:cne};async function lne(t,e){return Vb(t,mne,e)}const dne=()=>({contents:"",textDecoder:new TextDecoder}),Tm=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),fne=(t,{contents:e})=>e+t,pne=(t,e)=>t.slice(0,e),hne=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},mne={init:dne,convertChunk:{string:lo,buffer:Tm,arrayBuffer:Tm,dataView:Tm,typedArray:Tm,others:px},getSize:hx,truncateChunk:pne,addChunk:fne,getFinalChunk:hne,finalize:fx},gne=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof $m))throw t;if(s==="all")return t;const o=yne(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},yne=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",vne=(t,e,n)=>{if(e.length!==n)return;const r=new $m;throw r.maxBufferInfo={fdNumber:"ipc"},r},wne=(t,e)=>{const{streamName:n,threshold:r,unit:i}=bne(t,e);return`Command's ${n} was larger than ${r} ${i}`},bne=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=t;delete t.maxBufferInfo;const i=xd(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:nP(n),threshold:i,unit:r}},Dne=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>Yb(n)),Ene=(t,e,n)=>{if(!e)return t;const r=Yb(n);return t.length>r?t.slice(0,r):t},Yb=([,t])=>t,Rne=({stdio:t,all:e,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h,maxBuffer:v,timeout:b,cwd:g})=>{const w=r?.code,R=$ne({originalError:r,timedOut:c,timeout:b,isMaxBuffer:d,maxBuffer:v,errorCode:w,signal:i,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h}),k=Sne(r,g),A=k===void 0?"":`
|
|
1823
|
+
${k}`,N=`${R}: ${a}${A}`,_=e===void 0?[t[2],t[1]]:[e],B=[N,..._,...t.slice(3),n.map(z=>kne(z)).join(`
|
|
1824
|
+
`)].map(z=>yb(Gb(Cne(z)))).filter(Boolean).join(`
|
|
1825
|
+
|
|
1826
|
+
`);return{originalMessage:k,shortMessage:N,message:B}},$ne=({originalError:t,timedOut:e,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{const h=Tne(d,f);return e?`Command timed out after ${n} milliseconds${h}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${h}`:r?`${wne(t,i)}${h}`:s!==void 0?`Command failed with ${s}${h}`:d?`Command was killed with ${p} (${FP(p)})${h}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Tne=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Sne=(t,e)=>{if(t instanceof Nd)return;const n=ree(t)?t.originalMessage:String(t?.message??t),r=yb(xte(n,e));return r===""?void 0:r},kne=t=>typeof t=="string"?t:Wd(t),Cne=t=>Array.isArray(t)?t.map(e=>Gb(bx(e))).filter(Boolean).join(`
|
|
1827
|
+
`):bx(t),bx=t=>typeof t=="string"?t:wr(t)?J_(t):"",Dx=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:o})=>Ex({command:t,escapedCommand:e,cwd:s,durationMs:pP(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),Xb=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:o})=>Jb({error:t,command:e,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),Jb=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:h,timeout:v=h,forceKillAfterDelay:b,killSignal:g,cwd:w,maxBuffer:R},isSync:k})=>{const{exitCode:A,signal:N,signalDescription:_}=_ne(u,l),{originalMessage:B,shortMessage:z,message:Q}=Rne({stdio:d,all:f,ipcOutput:p,originalError:t,signal:N,signalDescription:_,exitCode:A,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:b,killSignal:g,maxBuffer:R,timeout:v,cwd:w}),I=nee(t,Q,k);return Object.assign(I,Ane({error:I,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:A,signal:N,signalDescription:_,stdio:d,all:f,ipcOutput:p,cwd:w,originalMessage:B,shortMessage:z})),I},Ane=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:f,all:p,ipcOutput:h,cwd:v,originalMessage:b,shortMessage:g})=>Ex({shortMessage:g,originalMessage:b,command:e,escapedCommand:n,cwd:v,durationMs:pP(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:h,pipedFrom:[]}),Ex=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),_ne=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:FP(e);return{exitCode:n,signal:r,signalDescription:i}},Rx=t=>Number.isFinite(t)?t:0;function Pne(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Rx(t*1e3)%1e3),nanoseconds:Math.trunc(Rx(t*1e6)%1e3)}}function xne(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Ine(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Pne(t);break}case"bigint":return xne(t)}throw new TypeError("Expected a finite number or bigint")}const Nne=t=>t===0||t===0n,One=(t,e)=>e===1||e===1n?t:`${t}s`,Fne=1e-7,Lne=24n*60n*60n*1000n;function $x(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,d)=>{const f=Math.floor(l*10**d+Fne);return(Math.round(f)/10**d).toFixed(d)},o=(l,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&Nne(l)&&!(e.colonNotation&&f==="m"))){if(p??=String(l),e.colonNotation){const h=p.includes(".")?p.split(".")[0].length:p.length,v=i.length>0?2:1;p="0".repeat(Math.max(0,v-h))+p}else p+=e.verbose?" "+One(d,l):f;i.push(p)}},a=Ine(t),c=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(c,"day","d"):(o(c/365n,"year","y"),o(c%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(f,"microsecond","\xB5s"),o(p,"nanosecond","ns");else{const h=d+f/1e3+p/1e6,v=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,b=h>=1?Math.round(h):Math.ceil(h),g=v?h.toFixed(v):b;o(Number.parseFloat(g),"millisecond","ms",g)}}else{const l=(n?Number(t%Lne):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(l,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(u)}const Mne=(t,e)=>{t.failed&&Id({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},Bne=(t,e)=>{fb(e)&&(Mne(t,e),zne(t,e))},zne=(t,e)=>{const n=`(done in ${$x(t.durationMs)})`;Id({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},Zb=(t,e,{reject:n})=>{if(Bne(t,e),t.failed&&n)throw t;return t},qne=(t,e)=>Ea(t)?"asyncGenerator":Ax(t)?"generator":e0(t)?"fileUrl":Vne(t)?"filePath":Xne(t)?"webStream":uo(t,{checkOpen:!1})?"native":wr(t)?"uint8Array":Jne(t)?"asyncIterable":Zne(t)?"iterable":n0(t)?Tx({transform:t},e):Wne(t)?jne(t,e):"native",jne=(t,e)=>ox(t.transform,{checkOpen:!1})?Une(t,e):n0(t.transform)?Tx(t,e):Gne(t,e),Une=(t,e)=>(Sx(t,e,"Duplex stream"),"duplex"),Tx=(t,e)=>(Sx(t,e,"web TransformStream"),"webTransform"),Sx=({final:t,binary:e,objectMode:n},r,i)=>{kx(t,`${r}.final`,i),kx(e,`${r}.binary`,i),Qb(n,`${r}.objectMode`)},kx=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},Gne=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!Cx(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ox(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(n0(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Cx(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return Qb(n,`${i}.binary`),Qb(r,`${i}.objectMode`),Ea(t)||Ea(e)?"asyncGenerator":"generator"},Qb=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Cx=t=>Ea(t)||Ax(t),Ea=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Ax=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Wne=t=>un(t)&&(t.transform!==void 0||t.final!==void 0),e0=t=>Object.prototype.toString.call(t)==="[object URL]",Hne=t=>e0(t)&&t.protocol!=="file:",Vne=t=>un(t)&&Object.keys(t).length===1&&_x(t.file),_x=t=>typeof t=="string",Kne=(t,e)=>t==="native"&&typeof e=="string"&&!Yne.has(e),Yne=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Px=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",t0=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Xne=t=>Px(t)||t0(t),n0=t=>Px(t?.readable)&&t0(t?.writable),Jne=t=>xx(t)&&typeof t[Symbol.asyncIterator]=="function",Zne=t=>xx(t)&&typeof t[Symbol.iterator]=="function",xx=t=>typeof t=="object"&&t!==null,fo=new Set(["generator","asyncGenerator","duplex","webTransform"]),Ix=new Set(["fileUrl","filePath","fileNumber"]),Nx=new Set(["fileUrl","filePath"]),Qne=new Set([...Nx,"webStream","nodeStream"]),ere=new Set(["webTransform","duplex"]),Sm={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},Ox=(t,e,n,r)=>r==="output"?tre(t,e,n):nre(t,e,n),tre=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},nre=(t,e,n)=>{const r=e===0?t===!0:n[e-1].value.readableObjectMode,i=e!==n.length-1&&(t??r);return{writableObjectMode:r,readableObjectMode:i}},rre=(t,e)=>{const n=t.findLast(({type:r})=>fo.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},ire=(t,e,n,r)=>[...t.filter(({type:i})=>!fo.has(i)),...sre(t,e,n,r)],sre=(t,e,n,{encoding:r})=>{const i=t.filter(({type:o})=>fo.has(o)),s=Array.from({length:i.length});for(const[o,a]of Object.entries(i))s[o]=ore({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:n,encoding:r});return lre(s,n)},ore=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:o})=>e==="duplex"?are({stdioItem:t,optionName:i}):e==="webTransform"?cre({stdioItem:t,index:n,newTransforms:r,direction:s}):ure({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:o}),are=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:n,readableObjectMode:r}}},cre=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:o}=un(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=Ox(o,n,r,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},ure=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:o,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=un(e)?e:{transform:e},d=c||co.has(s),{writableObjectMode:f,readableObjectMode:p}=Ox(l,n,r,i);return{...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:f,readableObjectMode:p}}},lre=(t,e)=>e==="input"?t.reverse():t,dre=(t,e,n)=>{const r=t.map(i=>fre(i,e));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??mre},fre=({type:t,value:e},n)=>pre[n]??Fx[t](e),pre=["input","output","output"],Ra=()=>{},r0=()=>"input",Fx={generator:Ra,asyncGenerator:Ra,fileUrl:Ra,filePath:Ra,iterable:r0,asyncIterable:r0,uint8Array:r0,webStream:t=>t0(t)?"output":"input",nodeStream(t){return Rm(t,{checkOpen:!1})?sx(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Ra,duplex:Ra,native(t){const e=hre(t);if(e!==void 0)return e;if(uo(t,{checkOpen:!1}))return Fx.nodeStream(t)}},hre=t=>{if([0,ot.stdin].includes(t))return"input";if([1,2,ot.stdout,ot.stderr].includes(t))return"output"},mre="output",gre=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,yre=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const o=vre(t,r).map((a,c)=>Lx(a,c));return s?bre(o,n,i):gre(o,e)},vre=(t,e)=>{if(t===void 0)return Ur.map(r=>e[r]);if(wre(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Ur.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,Ur.length);return Array.from({length:n},(r,i)=>t[i])},wre=t=>Ur.some(e=>t[e]!==void 0),Lx=(t,e)=>Array.isArray(t)?t.map(n=>Lx(n,e)):t??(e>=Ur.length?"ignore":"pipe"),bre=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!pb(n,i)&&Dre(r)?"ignore":r),Dre=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),Ere=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?Rre({stdioItem:t,fdNumber:r,direction:i}):Sre({stdioItem:t,fdNumber:r}),Rre=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=$re({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(uo(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},$re=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=Tre(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(O0.isatty(i))throw new TypeError(`The \`${e}: ${Lb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Pd(zm(i)),optionName:e}}},Tre=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=db.indexOf(t);if(n!==-1)return n},Sre=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:Mx(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:Mx(e,e,n),optionName:n}:uo(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,Mx=(t,e,n)=>{const r=db[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},kre=({input:t,inputFile:e},n)=>n===0?[...Cre(t),..._re(e)]:[],Cre=t=>t===void 0?[]:[{type:Are(t),value:t,optionName:"input"}],Are=t=>{if(Rm(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(wr(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},_re=t=>t===void 0?[]:[{...Pre(t),optionName:"inputFile"}],Pre=t=>{if(e0(t))return{type:"fileUrl",value:t};if(_x(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},xre=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),Ire=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const o=Nre(i,t);if(o.length!==0){if(s){Ore({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});return}if(Qne.has(t))return Bx({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});ere.has(t)&&Lre({otherStdioItems:o,type:t,value:e,optionName:n})}},Nre=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),Ore=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{Nx.has(e)&&Bx({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},Bx=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(a=>Fre(a,n));if(s.length===0)return;const o=s.find(a=>a.direction!==i);return zx(o,r,e),i==="output"?s[0].stream:void 0},Fre=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,Lre=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);zx(i,r,e)},zx=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Sm[n]} that is the same.`)},qx=(t,e,n,r)=>{const s=yre(e,n,r).map((a,c)=>Mre({stdioOption:a,fdNumber:c,options:e,isSync:r})),o=Hre({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=o.map(({stdioItems:a})=>Yre(a)),o},Mre=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=nP(e),{stdioItems:s,isStdioArray:o}=Bre({stdioOption:t,fdNumber:e,options:n,optionName:i}),a=dre(s,e,i),c=s.map(d=>Ere({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:r})),u=ire(c,i,a,n),l=rre(u,a);return Wre(u,l),{direction:a,objectMode:l,stdioItems:u}},Bre=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(c=>zre(c,r)),...kre(n,e)],o=xre(s),a=o.length>1;return qre(o,a,r),Ure(o),{stdioItems:o,isStdioArray:a}},zre=(t,e)=>({type:qne(t,e),value:t,optionName:e}),qre=(t,e,n)=>{if(t.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(e){for(const{value:r,optionName:i}of t)if(jre.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},jre=new Set(["ignore","ipc"]),Ure=t=>{for(const e of t)Gre(e)},Gre=({type:t,value:e,optionName:n})=>{if(Hne(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
1828
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Kne(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Wre=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>Ix.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Hre=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(Vre({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw jx(i),s}},Vre=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:o})=>{const a=n.map(c=>Kre({stdioItem:c,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:o}));return{direction:t,objectMode:e,stdioItems:a}},Kre=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const o=Ire({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[n][t.type](t,r)}},jx=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!so(n)&&n.destroy()},Yre=t=>{if(t.length>1)return t.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:e,value:n}]=t;return e==="native"?n:"pipe"},Xre=(t,e)=>qx(Zre,t,e,!0),Gr=({type:t,optionName:e})=>{Ux(e,Sm[t])},Jre=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Ux(t,`"${e}"`),{}),Ux=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Gx={generator(){},asyncGenerator:Gr,webStream:Gr,nodeStream:Gr,webTransform:Gr,duplex:Gr,asyncIterable:Gr,native:Jre},Zre={input:{...Gx,fileUrl:({value:t})=>({contents:[Pd(zm(t))]}),filePath:({value:{file:t}})=>({contents:[Pd(zm(t))]}),fileNumber:Gr,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Gx,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:Gr,string:Gr,uint8Array:Gr}},$a=(t,{stripFinalNewline:e},n)=>Wx(e,n)&&t!==void 0&&!Array.isArray(t)?Gb(t):t,Wx=(t,e)=>e==="all"?t[1]||t[2]:t[e],Hx=(t,e,n,r)=>t||n?void 0:Yx(e,r),Vx=(t,e,n)=>n?t.flatMap(r=>Kx(r,e)):Kx(t,e),Kx=(t,e)=>{const{transform:n,final:r}=Yx(e,{});return[...n(t),...r()]},Yx=(t,e)=>(e.previousChunks="",{transform:Qre.bind(void 0,e,t),final:tie.bind(void 0,e)}),Qre=function*(t,e,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=t,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
|
|
1829
|
+
`){const o=eie(n,s,e,t);let a=n.slice(i+1,s+1-o);r.length>0&&(a=i0(r,a),r=""),yield a,i=s}i!==n.length-1&&(r=i0(r,n.slice(i+1))),t.previousChunks=r},eie=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),tie=function*({previousChunks:t}){t.length>0&&(yield t)},nie=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:rie.bind(void 0,r)},rie=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?iie:oie;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},i0=(t,e)=>`${t}${e}`,iie={windowsNewline:`\r
|
|
1830
|
+
`,unixNewline:`
|
|
1831
|
+
`,LF:`
|
|
1832
|
+
`,concatBytes:i0},sie=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},oie={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:sie},aie=(t,e)=>t?void 0:cie.bind(void 0,e),cie=function*(t,e){if(typeof e!="string"&&!wr(e)&&!Km.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},uie=(t,e)=>t?lie.bind(void 0,e):die.bind(void 0,e),lie=function*(t,e){Xx(t,e),yield e},die=function*(t,e){if(Xx(t,e),typeof e!="string"&&!wr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},Xx=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
1833
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
1834
|
+
if (condition) { yield value; }`)},Jx=(t,e,n)=>{if(n)return;if(t)return{transform:fie.bind(void 0,new TextEncoder)};const r=new H0(e);return{transform:pie.bind(void 0,r),final:hie.bind(void 0,r)}},fie=function*(t,e){Km.isBuffer(e)?yield Pd(e):typeof e=="string"?yield t.encode(e):yield e},pie=function*(t,e){yield wr(e)?t.write(e):e},hie=function*(t){const e=t.end();e!==""&&(yield e)},Zx=go(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),s0=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=vie}=e[n];for await(const i of r(t))yield*s0(i,e,n+1)},mie=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*gie(n,Number(e),t)},gie=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*s0(r,n,e+1)},yie=go(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),vie=function*(t){yield t},Qx=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},wie=(t,e)=>[...e.flatMap(n=>[...Md(n,t,0)]),...o0(t)],Md=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=Die}=e[n];for(const i of r(t))yield*Md(i,e,n+1)},o0=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*bie(n,Number(e),t)},bie=function*(t,e,n){if(t!==void 0)for(const r of t())yield*Md(r,n,e+1)},Die=function*(t){yield t},eI=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:o})=>{const a={},c=nI(t,o,s),u=Ea(e),l=Ea(n),d=u?Zx.bind(void 0,s0,a):Qx.bind(void 0,Md),f=u||l?Zx.bind(void 0,mie,a):Qx.bind(void 0,o0),p=u||l?yie.bind(void 0,a):void 0;return{stream:new D2({writableObjectMode:r,writableHighWaterMark:Jd(r),readableObjectMode:i,readableHighWaterMark:Jd(i),transform(v,b,g){d([v,c,0],this,g)},flush(v){f([c],this,v)},destroy:p})}},tI=(t,e,n,r)=>{const i=e.filter(({type:o})=>o==="generator"),s=r?i.reverse():i;for(const{value:o,optionName:a}of s){const c=nI(o,n,a);t=wie(c,t)}return t},nI=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},o,a)=>{const c={};return[{transform:aie(r,a)},Jx(n,o,r),Hx(n,s,r,c),{transform:t,final:e},{transform:uie(i,a)},nie({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},Eie=(t,e)=>{for(const n of Rie(t))$ie(t,n,e)},Rie=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),$ie=(t,e,n)=>{const{stdioItems:r}=t[e],i=r.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){const[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Sm[a]} with synchronous methods.`)}const o=i.map(({contents:a})=>a).map(a=>Tie(a,r));n.input=lb(o)},Tie=(t,e)=>{const n=tI(t,e,"utf8",!0);return Sie(n),lb(n)},Sie=t=>{const e=t.find(n=>typeof n!="string"&&!wr(n));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)},rI=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&pb(n,r)&&!co.has(e)&&kie(r)&&(t.some(({type:i,value:s})=>i==="native"&&Cie.has(s))||t.every(({type:i})=>fo.has(i))),kie=t=>t===1||t===2,Cie=new Set(["pipe","overlapped"]),Aie=async(t,e,n,r)=>{for await(const i of t)Pie(e)||iI(i,n,r)},_ie=(t,e,n)=>{for(const r of t)iI(r,e,n)},Pie=t=>t._readableState.pipes.length>0,iI=(t,e,n)=>{const r=dP(t);Id({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},xie=({fileDescriptors:t,syncResult:{output:e},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};const s={},o=new Set([]);return{output:e.map((c,u)=>Iie({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...s}},Iie=({result:t,fileDescriptors:e,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;const f=Ene(t,s,d),p=Pd(f),{stdioItems:h,objectMode:v}=e[n],b=Nie([p],h,c,r),{serializedResult:g,finalResult:w=g}=Oie({chunks:b,objectMode:v,encoding:c,lines:u,stripFinalNewline:l,fdNumber:n});Fie({serializedResult:g,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:h,objectMode:v});const R=a[n]?w:void 0;try{return r.error===void 0&&Lie(g,h,i),R}catch(k){return r.error=k,R}},Nie=(t,e,n,r)=>{try{return tI(t,e,n,!1)}catch(i){return r.error=i,t}},Oie=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:lb(t)};const o=NZ(t,n);return r[s]?{serializedResult:o,finalResult:Vx(o,!i[s],e)}:{serializedResult:o}},Fie=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:o})=>{if(!rI({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const a=Vx(t,!1,o);try{_ie(a,e,r)}catch(c){n.error??=c}},Lie=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>Ix.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?PN(r,t):(n.add(i),A0(r,t))}},Mie=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,$a(e,n,"all")]:Array.isArray(e)?[$a(t,n,"all"),...e]:wr(t)&&wr(e)?Z_([t,e]):`${t}${e}`},Bie=async(t,e)=>{const[n,r]=await zie(t);return e.isForcefullyTerminated??=!1,[n,r]},zie=async t=>{const[e,n]=await Promise.allSettled([Sn(t,"spawn"),Sn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?sI(t):n.value},sI=async t=>{try{return await Sn(t,"exit")}catch{return sI(t)}},qie=async t=>{const[e,n]=await t;if(!jie(e,n)&&oI(e,n))throw new Nd;return[e,n]},jie=(t,e)=>t===void 0&&e===void 0,oI=(t,e)=>t!==0||e!==null,Uie=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=Gie(t,e,n),o=s?.code==="ETIMEDOUT",a=Dne(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:o,isMaxBuffer:a}},Gie=(t,e,n)=>t!==void 0?t:oI(e,n)?new Nd:void 0,Wie=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=Hie(t,e,n),d=Yie({file:r,commandArguments:i,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return Zb(d,c,u)},Hie=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=hP(t,e,n),a=Vie(n),{file:c,commandArguments:u,options:l}=nx(t,e,a);Kie(l);const d=Xre(l,o);return{file:c,commandArguments:u,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},Vie=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Kie=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&km("ipcInput"),t&&km("ipc: true"),n&&km("detached: true"),r&&km("cancelSignal")},km=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Yie=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{const c=Xie({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:a});if(c.failed)return c;const{resultError:u,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p}=Uie(c,n),{output:h,error:v=u}=xie({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:s}),b=h.map((w,R)=>$a(w,n,R)),g=$a(Mie(h,n),n,"all");return Zie({error:v,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p,stdio:b,all:g,options:n,command:r,escapedCommand:i,startTime:a})},Xie=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{Eie(s,n);const a=Jie(n);return m2(t,e,a)}catch(a){return Xb({error:a,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:o,isSync:!0})}},Jie=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:Yb(e)}),Zie=({error:t,exitCode:e,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:o,options:a,command:c,escapedCommand:u,startTime:l})=>t===void 0?Dx({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):Jb({error:t,command:c,escapedCommand:u,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:n,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:!0}),Qie=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Nb({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:VP(t)}),ese({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),ese=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{WP(e,i);const s=vm(t,e,n),o=new AbortController;try{return await Promise.race([tse(s,r,o),nse(s,n,o),rse(s,n,o)])}catch(a){throw Ob(t),a}finally{o.abort(),HP(e,i)}},tse=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await Sn(t,"message",{signal:n});return r}for await(const[r]of Xd(t,"message",{signal:n}))if(e(r))return r},nse=async(t,e,{signal:n})=>{await Sn(t,"disconnect",{signal:n}),Pee(e)},rse=async(t,e,{signal:n})=>{const[r]=await Sn(t,"strict:error",{signal:n});throw zP(r,e)},ise=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>aI({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),aI=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Nb({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:VP(t)}),WP(e,s);const o=vm(t,e,n),a=new AbortController,c={};return sse(t,o,a),ose({ipcEmitter:o,isSubprocess:n,controller:a,state:c}),ase({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:a,state:c,reference:s})},sse=async(t,e,n)=>{try{await Sn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},ose=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await Sn(t,"strict:error",{signal:n.signal});r.error=zP(i,e),n.abort()}catch{}},ase=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(const[c]of Xd(n,"message",{signal:s.signal}))cI(o),yield c}catch{cI(o)}finally{s.abort(),HP(e,a),r||Ob(t),i&&await t}},cI=({error:t})=>{if(t)throw t},cse=(t,{ipc:e})=>{Object.assign(t,uI(t,!1,e))},use=()=>{const t=ot,e=!0,n=ot.channel!==void 0;return{...uI(t,e,n),getCancelSignal:dte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},uI=(t,e,n)=>({sendMessage:YP.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:Qie.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:ise.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),lse=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:o})=>{jx(r);const a=new W0;dse(a,r),Object.assign(a,{readable:fse,writable:pse,duplex:hse});const c=Xb({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),u=mse(c,o,i);return{subprocess:a,promise:u}},dse=(t,e)=>{const n=Bd(),r=Bd(),i=Bd(),s=Array.from({length:e.length-3},Bd),o=Bd(),a=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:o,stdio:a})},Bd=()=>{const t=new X0;return t.end(),t},fse=()=>new ys({read(){}}),pse=()=>new Hm({write(){}}),hse=()=>new Vm({read(){},write(){}}),mse=async(t,e,n)=>Zb(t,e,n),gse=(t,e)=>qx(yse,t,e,!1),zd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Sm[t]}.`)},lI={fileNumber:zd,generator:eI,asyncGenerator:eI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:Vm.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},yse={input:{...lI,fileUrl:({value:t})=>({stream:_0(t)}),filePath:({value:{file:t}})=>({stream:_0(t)}),webStream:({value:t})=>({stream:ys.fromWeb(t)}),iterable:({value:t})=>({stream:ys.from(t)}),asyncIterable:({value:t})=>({stream:ys.from(t)}),string:({value:t})=>({stream:ys.from(t)}),uint8Array:({value:t})=>({stream:ys.from(Km.from(t))})},output:{...lI,fileUrl:({value:t})=>({stream:P0(t)}),filePath:({value:{file:t}})=>({stream:P0(t)}),webStream:({value:t})=>({stream:Hm.fromWeb(t)}),iterable:zd,asyncIterable:zd,string:zd,uint8Array:zd}};function a0(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)c0(i);const e=t.some(({readableObjectMode:i})=>i),n=vse(t,e),r=new wse({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const vse=(t,e)=>{if(t.length===0)return Jd(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class wse extends X0{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(c0(e),this.#e.has(e))return;this.#e.add(e),this.#r??=bse(this,this.#e,this.#s);const n=Rse({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#s});this.#i.set(e,n),e.pipe(this,{end:!1})}async remove(e){if(c0(e),!this.#e.has(e))return!1;const n=this.#i.get(e);return n===void 0?!1:(this.#i.delete(e),e.unpipe(this),await n,!0)}}const bse=async(t,e,n)=>{Cm(t,hI);const r=new AbortController;try{await Promise.race([Dse(t,r),Ese(t,e,n,r)])}finally{r.abort(),Cm(t,-hI)}},Dse=async(t,{signal:e})=>{try{await ki(t,{signal:e,cleanup:!0})}catch(n){throw dI(t,n),n}},Ese=async(t,e,n,{signal:r})=>{for await(const[i]of Xd(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},c0=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Rse=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:o})=>{Cm(t,mI);const a=new AbortController;try{await Promise.race([$se(s,e,a),Tse({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:a}),Sse({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),Cm(t,-mI)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?u0(t):kse(t))},$se=async(t,e,{signal:n})=>{try{await t,n.aborted||u0(e)}catch(r){n.aborted||dI(e,r)}},Tse=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await ki(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(o){if(s.aborted||!n.has(e))return;fI(o)?i.add(e):pI(t,o)}},Sse=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await Sn(t,i,{signal:s}),!t.readable)return Sn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},kse=t=>{t.writable&&t.end()},dI=(t,e)=>{fI(e)?u0(t):pI(t,e)},fI=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",u0=t=>{(t.readable||t.writable)&&t.destroy()},pI=(t,e)=>{t.destroyed||(t.once("error",Cse),t.destroy(e))},Cse=()=>{},Cm=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},hI=2,mI=1,Am=(t,e)=>{t.pipe(e),Ase(t,e),_se(t,e)},Ase=async(t,e)=>{if(!(so(t)||so(e))){try{await ki(t,{cleanup:!0,readable:!0,writable:!1})}catch{}gI(e)}},gI=t=>{t.writable&&t.end()},_se=async(t,e)=>{if(!(so(t)||so(e))){try{await ki(e,{cleanup:!0,readable:!1,writable:!0})}catch{}yI(t)}},yI=t=>{t.readable&&t.destroy()},Pse=(t,e,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(const{stream:a}of s.filter(({type:c})=>fo.has(c)))xse(t,a,o,i);for(const{stream:a}of s.filter(({type:c})=>!fo.has(c)))Nse({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const o=s.length===1?s[0]:a0(s);Am(o,i)}},xse=(t,e,n,r)=>{n==="output"?Am(t.stdio[r],e):Am(e,t.stdio[r]);const i=Ise[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},Ise=["stdin","stdout","stderr"],Nse=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;Ose(e,s);const[o,a]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],c=i.get(o)??[];i.set(o,[...c,a])},Ose=(t,{signal:e})=>{so(t)&&gm(t,Fse,e)},Fse=2,Ta=[];Ta.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&Ta.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&Ta.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const _m=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",l0=Symbol.for("signal-exit emitter"),d0=globalThis,Lse=Object.defineProperty.bind(Object);class Mse{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(d0[l0])return d0[l0];Lse(d0,l0,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){const r=this.listeners[e],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const s of this.listeners[e])i=s(n,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",n,r)||i),i}}class vI{}const Bse=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class zse extends vI{onExit(){return()=>{}}load(){}unload(){}}class qse extends vI{#e=f0.platform==="win32"?"SIGINT":"SIGHUP";#t=new Mse;#n;#r;#s;#i={};#o=!1;constructor(e){super(),this.#n=e,this.#i={};for(const n of Ta)this.#i[n]=()=>{const r=this.#n.listeners(n);let{count:i}=this.#t;const s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const o=this.#t.emit("exit",null,n),a=n==="SIGHUP"?this.#e:n;o||e.kill(e.pid,a)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,n){if(!_m(this.#n))return()=>{};this.#o===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of Ta)try{const n=this.#i[e];n&&this.#n.on(e,n)}catch{}this.#n.emit=(e,...n)=>this.#c(e,...n),this.#n.reallyExit=e=>this.#a(e)}}unload(){this.#o&&(this.#o=!1,Ta.forEach(e=>{const n=this.#i[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,n)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#s,this.#t.count-=1)}#a(e){return _m(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#s.call(this.#n,this.#n.exitCode)):0}#c(e,...n){const r=this.#r;if(e==="exit"&&_m(this.#n)){typeof n[0]=="number"&&(this.#n.exitCode=n[0]);const i=r.call(this.#n,e,...n);return this.#t.emit("exit",this.#n.exitCode,null),i}else return r.call(this.#n,e,...n)}}const f0=globalThis.process,{onExit:jse,load:Dle,unload:Ele}=Bse(_m(f0)?new qse(f0):new zse),Use=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=jse(()=>{t.kill()});Y0(r,()=>{i()})},Gse=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=fP(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=Wse(n,r,i),{sourceStream:d,sourceError:f}=Vse(t,u),{options:p,fileDescriptors:h}=ao.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:h,startTime:s}},Wse=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=Hse(t,e,...n),a=qP(r,s);return{destination:r,destinationStream:a,from:i,unpipeSignal:o}}catch(r){return{destinationError:r}}},Hse=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(wI,t)(n,...r),pipeOptions:t};if(typeof n=="string"||n instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,o]=K_(n,...r);return{destination:e(wI)(i,s,o),pipeOptions:o}}if(ao.has(n)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},wI=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Vse=(t,e)=>{try{return{sourceStream:Fb(t,e)}}catch(n){return{sourceError:n}}},Kse=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:o})=>{const a=Yse({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(a!==void 0)throw bI({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},Yse=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return yI(t),r;if(e!==void 0)return gI(n),e},bI=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>Xb({error:t,command:DI,escapedCommand:DI,fileDescriptors:e,options:n,startTime:r,isSync:!1}),DI="source.pipe(destination)",Xse=async t=>{const[{status:e,reason:n,value:r=n},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i==="rejected")throw o;if(e==="rejected")throw r;return o},Jse=(t,e,n)=>{const r=Pm.has(e)?Qse(t,e):Zse(t,e);return gm(t,toe,n.signal),gm(e,noe,n.signal),eoe(e),r},Zse=(t,e)=>{const n=a0([t]);return Am(n,e),Pm.set(e,n),n},Qse=(t,e)=>{const n=Pm.get(e);return n.add(t),n},eoe=async t=>{try{await ki(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Pm.delete(t)},Pm=new WeakMap,toe=2,noe=1,roe=(t,e)=>t===void 0?[]:[ioe(t,e)],ioe=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await qN(t,e),await n.remove(e);const o=new Error("Pipe canceled by `unpipeSignal` option.");throw bI({error:o,fileDescriptors:r,sourceOptions:i,startTime:s})},p0=(t,...e)=>{if(un(e[0]))return p0.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=Gse(t,...e),i=soe({...r,destination:n});return i.pipe=p0.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},soe=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{const l=ooe(t,i);Kse({sourceStream:e,sourceError:r,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:u});const d=new AbortController;try{const f=Jse(e,s,d);return await Promise.race([Xse(l),...roe(a,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:u})])}finally{d.abort()}},ooe=(t,e)=>Promise.allSettled([t,e]),EI=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const o=new AbortController;return aoe(e,o),$I({stream:t,controller:o,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},aoe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},RI=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const o=new AbortController;coe(e,o,t);const a=t.readableObjectMode&&!s;return $I({stream:t,controller:o,binary:r==="buffer",shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!i})},coe=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},$I=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})=>{const a=Xd(t,"data",{signal:e.signal,highWaterMark:SI,highWatermark:SI});return uoe({onStdoutChunk:a,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})},TI=Jd(!0),SI=TI,uoe=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o}){const a=loe({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(const[c]of t)yield*Md(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*o0(a)}},loe=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Jx(t,n,!e),Hx(t,i,!r,{})].filter(Boolean),doe=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{const d=foe({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:a,verboseInfo:u,streamInfo:l});if(!i){await Promise.all([poe(t),d]);return}const f=Wx(c,n),p=RI({stream:t,onStreamEnd:e,lines:o,encoding:r,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([hoe({stream:t,iterable:p,fdNumber:n,encoding:r,maxBuffer:s,lines:o}),d]);return h},foe=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!rI({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const a=RI({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Aie(a,t,n,s)},poe=async t=>{await y2(),t.readableFlowing===null&&t.resume()},hoe=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await Yte(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await ene(n,{maxBuffer:s})):await lne(n,{maxBuffer:s})}catch(a){return CI(gne({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:r}))}},kI=async t=>{try{return await t}catch(e){return CI(e)}},CI=({bufferedData:t})=>PZ(t)?new Uint8Array(t):t,h0=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=moe(t,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],ki(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||voe(a,e,n,r)}finally{o.abort()}},moe=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&goe(t,n,r),r},goe=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{yoe(e,n),r.call(t,...i)}},yoe=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},voe=(t,e,n,r)=>{if(!woe(t,e,n,r))throw t},woe=(t,e,n,r=!0)=>n.propagating?_I(t)||m0(t):(n.propagating=!0,AI(n,e)===r?_I(t):m0(t)),AI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",m0=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",_I=t=>t?.code==="EPIPE",boe=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>PI({stream:c,fdNumber:u,encoding:e,buffer:n[u],maxBuffer:r[u],lines:i[u],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),PI=async({stream:t,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!t)return;const l=h0(t,e,u);if(AI(u,e)){await l;return}const[d]=await Promise.all([doe({stream:t,onStreamEnd:l,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return d},Doe=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?a0([t,e].filter(Boolean)):void 0,Eoe=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>PI({...Roe(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:$oe(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),Roe=({stdout:t,stderr:e,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:n,buffer:s}},$oe=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,Toe=t=>pb(t,"ipc"),Soe=(t,e)=>{const n=dP(t);Id({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},koe=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const o=Toe(s),a=xd(e,"ipc"),c=xd(n,"ipc");for await(const u of aI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(vne(t,i,c),i.push(u)),o&&Soe(u,s);return i},Coe=async(t,e)=>(await Promise.allSettled([t]),e),Aoe=async({subprocess:t,options:{encoding:e,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:v,onInternalError:b,controller:g})=>{const w=Bie(t,f),R={originalStreams:v,fileDescriptors:h,subprocess:t,exitPromise:w,propagating:!1},k=boe({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:p,streamInfo:R}),A=Eoe({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:p,streamInfo:R}),N=[],_=koe({subprocess:t,buffer:n,maxBuffer:r,ipc:l,ipcOutput:N,verboseInfo:p}),B=_oe(v,t,R),z=Poe(h,R);try{return await Promise.race([Promise.all([{},qie(w),Promise.all(k),A,_,kte(t,d),...B,...z]),b,xoe(t,g),...wte(t,s,f,g),...Cee({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:g}),...mte({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:g})])}catch(Q){return f.terminationReason??="other",Promise.all([{error:Q},w,Promise.all(k.map(I=>kI(I))),kI(A),Coe(_,N),Promise.allSettled(B),Promise.allSettled(z)])}},_oe=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:h0(r,i,n)),Poe=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>uo(s,{checkOpen:!1})&&!so(s)).map(({type:i,value:s,stream:o=s})=>h0(o,r,e,{isSameDirection:fo.has(i),stopOnExit:i==="native"}))),xoe=async(t,{signal:e})=>{const[n]=await Sn(t,"error",{signal:e});throw n},Ioe=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),g0=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=Od();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},xm=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},xI=async t=>{if(t!==void 0)try{await II(t)}catch{}},Noe=async t=>{if(t!==void 0)try{await NI(t)}catch{}},II=async t=>{await ki(t,{cleanup:!0,readable:!1,writable:!0})},NI=async t=>{await ki(t,{cleanup:!0,readable:!0,writable:!1})},OI=async(t,e)=>{if(await t,e)throw e},FI=(t,e,n)=>{n&&!m0(n)?t.destroy(n):e&&t.destroy()},Ooe=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const o=i||co.has(n),{subprocessStdout:a,waitReadableDestroy:c}=LI(t,r,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=MI(a,o),{read:f,onStdoutDataDone:p}=BI({subprocessStdout:a,subprocess:t,binary:o,encoding:n,preserveNewlines:s}),h=new ys({read:f,destroy:go(qI.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return zI({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},LI=(t,e,n)=>{const r=Fb(t,e),i=g0(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},MI=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:TI},BI=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=Od(),o=EI({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Foe(this,o,s)},onStdoutDataDone:s}},Foe=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},zI=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await NI(t),await r,await xI(i),await e,n.readable&&n.push(null)}catch(s){await xI(i),jI(n,s)}},qI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await xm(n,e)&&(jI(t,r),await OI(e,r))},jI=(t,e)=>{FI(t,t.readable,e)},Loe=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=UI(t,n,e),o=new Hm({...GI(r,t,i),destroy:go(HI.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return WI(r,o),o},UI=(t,e,n)=>{const r=qP(t,e),i=g0(n,r,"writableFinal"),s=g0(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},GI=(t,e,n)=>({write:Moe.bind(void 0,t),final:go(Boe.bind(void 0,t,e,n))}),Moe=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},Boe=async(t,e,n)=>{await xm(n,e)&&(t.writable&&t.end(),await e)},WI=async(t,e,n)=>{try{await II(t),e.writable&&e.end()}catch(r){await Noe(n),VI(e,r)}},HI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await xm(n,e),await xm(r,e)&&(VI(t,i),await OI(e,i))},VI=(t,e)=>{FI(t,t.writable,e)},zoe=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{const a=s||co.has(n),{subprocessStdout:c,waitReadableDestroy:u}=LI(t,r,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:f}=UI(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:v}=MI(c,a),{read:b,onStdoutDataDone:g}=BI({subprocessStdout:c,subprocess:t,binary:a,encoding:n,preserveNewlines:o}),w=new Vm({read:b,...GI(l,t,d),destroy:go(qoe.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:v,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:h,writableObjectMode:l.writableObjectMode,encoding:p});return zI({subprocessStdout:c,onStdoutDataDone:g,readable:w,subprocess:t,subprocessStdin:l}),WI(l,w,c),w},qoe=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([qI({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},o),HI({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},o)])},KI=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||co.has(e),o=Fb(t,n),a=EI({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return joe(a,o,t)},joe=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},Uoe=(t,{encoding:e})=>{const n=Ioe();t.readable=Ooe.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=Loe.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=zoe.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=KI.bind(void 0,t,e),t[Symbol.asyncIterator]=KI.bind(void 0,t,e,{})},Goe=(t,e)=>{for(const[n,r]of Hoe){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},Woe=(async()=>{})().constructor.prototype,Hoe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Woe,t)]),Voe=(t,e,n,r)=>{const{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=Koe(t,e,n),{subprocess:f,promise:p}=Xoe({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=p0.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Goe(f,p),ao.set(f,{options:l,fileDescriptors:d}),f},Koe=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=hP(t,e,n),{file:a,commandArguments:c,options:u}=nx(t,e,n),l=Yoe(u),d=gse(l,o);return{file:a,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},Yoe=({timeout:t,signal:e,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t}},Xoe=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=g2(t,e,n)}catch(h){return lse({error:h,command:s,escapedCommand:o,fileDescriptors:a,options:n,startTime:r,verboseInfo:i})}const u=new AbortController;w2(Number.POSITIVE_INFINITY,u.signal);const l=[...c.stdio];Pse(c,a,u),Use(c,n,u);const d={},f=Od();c.kill=Ree.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:u}),c.all=Doe(c,n),Uoe(c,n),cse(c,n);const p=Joe({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:d,onInternalError:f,controller:u});return{subprocess:c,promise:p}},Joe=async({subprocess:t,options:e,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{const[d,[f,p],h,v,b]=await Aoe({subprocess:t,options:e,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();const g=h.map((k,A)=>$a(k,e,A)),w=$a(v,e,"all"),R=Zoe({errorInfo:d,exitCode:f,signal:p,stdio:g,all:w,ipcOutput:b,context:c,options:e,command:o,escapedCommand:a,startTime:n});return Zb(R,r,e)},Zoe=({errorInfo:t,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,context:o,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in t?Jb({error:t.error,command:c,escapedCommand:u,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof $m,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:a,startTime:l,isSync:!1}):Dx({command:c,escapedCommand:u,stdio:r,all:i,ipcOutput:s,options:a,startTime:l}),y0=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,Qoe(r,t[r],i)]));return{...t,...n}},Qoe=(t,e,n)=>eae.has(t)&&un(e)&&un(n)?{...e,...n}:n,eae=new Set(["env",...oP]),po=(t,e,n,r)=>{const i=(o,a,c)=>po(o,a,n,c),s=(...o)=>tae({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...o);return r!==void 0&&r(s,i,e),s},tae=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...o)=>{if(un(s))return i(t,y0(n,s),r);const{file:a,commandArguments:c,options:u,isSync:l}=nae({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:n});return l?Wie(a,c,u):Voe(a,c,u,i)},nae=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=MZ(e)?BZ(e,n):[e,...n],[o,a,c]=K_(...s),u=y0(y0(r,i),c),{file:l=o,commandArguments:d=a,options:f=u,isSync:p=!1}=t({file:o,commandArguments:a,options:u});return{file:l,commandArguments:d,options:f,isSync:p}},rae=({file:t,commandArguments:e})=>YI(t,e),iae=({file:t,commandArguments:e})=>({...YI(t,e),isSync:!0}),YI=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);const[n,...r]=sae(t);return{file:n,commandArguments:r}},sae=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);const e=t.trim();if(e==="")return[];const n=[];for(const r of e.split(oae)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},oae=/ +/g,aae=(t,e,n)=>{t.sync=e(uae,n),t.s=t.sync},cae=({options:t})=>XI(t),uae=({options:t})=>({...XI(t),isSync:!0}),XI=t=>({options:{...lae(t),...t}}),lae=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},dae={preferLocal:!0},v0=po(()=>({}));po(()=>({isSync:!0})),po(rae),po(iae),po(Dte),po(cae,{},dae,aae),use();const w0=lw(2);let fae=class{constructor(e="dot"){this.path=e}async unflatten(e){return await w0(async()=>{const n=await v0("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?xt.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
1835
|
+
|
|
1836
|
+
but returned
|
|
1837
|
+
${n.stdout}`):xt.error(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
1838
|
+
|
|
1839
|
+
nothing returned, ignoring...`)),n.stdout&&(e=n.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await w0(async()=>{const n=await v0(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw xt.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: "${n.stderr}"`),n;xt.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed "${n.stderr}"`)}return n.stdout})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await w0(async()=>{const n=await v0(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw xt.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: ${n.stderr}`),n;xt.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed ${n.stderr}`)}return n.stdout})}};const JI="1.19.1",pae=t=>{b0.forEach(e=>{hae(t,e)})},b0=["name","message","stack","cause","errors"],hae=(t,e)=>{const n=D0(t,e);if(n!==void 0){if(mae(n)){Ri(t,e,t[e]);return}gae(n)&&ZI(t,e,n)}},D0=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:D0(r,e)},mae=({get:t,set:e})=>t!==void 0&&e===void 0,gae=({enumerable:t,writable:e})=>t||!e,Ri=(t,e,n)=>{ZI(t,e,{value:n})},ZI=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},yae=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(vae).map(e).filter(Boolean);Ri(t,"errors",n)}else wae(t)?Ri(t,"errors",[]):t.errors!==void 0&&bae(t)},vae=t=>t!==void 0,wae=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),bae=t=>{delete t.errors,t.errors!==void 0&&Ri(t,"errors",[])},Dae=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:Ri(t,"cause",n)},Eae=t=>Rae(t)||$ae(t),Rae=t=>{try{return t instanceof Error}catch{return!1}},$ae=t=>{try{return Tae.has(Object.prototype.toString.call(t))}catch{return!1}},Tae=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),Sae=t=>!Object.isExtensible(t)||b0.some(e=>kae(t,e)||Cae(t,e)),kae=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},Cae=(t,e)=>{try{return t[e],!1}catch{return!0}},E0=t=>{const e=Aae(t.message,t.name);Ri(t,"stack",e)},Aae=(t="",e="Error")=>{const n=_ae(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},_ae=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},Pae=t=>{const e={};for(const n of xae(t))try{const r=t[n],{enumerable:i,configurable:s,writable:o=!0}=D0(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},xae=t=>{const e=Iae(t);for(const n of b0)Nae(t,n)&&e.push(n);return e},Iae=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},Nae=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},QI=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=Pae(t),a=Oae(n,o),c=Bae(e,a);return n===a&&zae(c,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([u,l])=>{qae(c,u,l)}),r===void 0&&E0(c),c},Oae=(t,e)=>typeof t=="string"&&t!==""?t:Mae(Fae(e)),Fae=t=>{try{return JSON.stringify(t)}catch{return Lae(t)}},Lae=t=>{try{return String(t)}catch{return"Invalid error"}},Mae=t=>t.length<eN?t:`${t.slice(0,eN)}...`,eN=1e3,Bae=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in tN?new tN[t](e):new Error(e),tN={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},zae=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},qae=(t,e,n)=>{n!==void 0&&Ri(t,e,n)},jae=t=>{try{const e=new Error(String(t));return E0(e),e}catch(e){return e}},{toString:Uae}=Object.prototype,Gae=t=>Wae(t)?QI(t):Eae(t)?Hae(t)?QI(t):t:jae(t),Wae=t=>{try{return un(t)}catch{return!1}},Hae=t=>Vae(t)||Sae(t)||Kae(t),Vae=t=>{try{return Uae.call(t)==="[object Object]"}catch{return!0}},Kae=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Im=(t,{shallow:e=!1}={})=>nN(t,[],e),nN=(t,e,n)=>{if(e.includes(t))return;const r=n?Yae:s=>nN(s,[...e,t],n),i=Gae(t);return Xae(i,r),i},Yae=t=>t,Xae=(t,e)=>{Jae(t),Zae(t),Qae(t),Dae(t,e),yae(t,e),pae(t)},Jae=t=>{if(Nm(t.name))return;const e=Object.getPrototypeOf(t).name,n=Nm(e)?e:t.constructor.name;Ri(t,"name",n)},Zae=t=>{Nm(t.message)||Ri(t,"message","")},Qae=t=>{Nm(t.stack)||E0(t)},Nm=t=>typeof t=="string"&&t!=="",ece=(t,e,n=t.name)=>{if(tce(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},tce=t=>{if(!nce(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!rN(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!rce(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},nce=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,rN=t=>t!==null&&(t.name==="Error"||rN(Object.getPrototypeOf(t))),rce=t=>typeof t.prototype.constructor=="function",iN=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},ice=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(sce(t,e),aN(t,"constructor"),oce(t,e))},sce=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},oce=(t,e)=>{aN(t,"name");const n=sN(e.prototype);t.name!==n&&iN(t,"name",n)},sN=t=>ace(t)??cce(t)??sN(Object.getPrototypeOf(t)),ace=t=>Object.hasOwn(t,"name")&&oN(t.name)?t.name:void 0,cce=t=>typeof t.constructor=="function"&&oN(t.constructor.name)?t.constructor.name:void 0,oN=t=>typeof t=="string"&&t!=="",aN=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},uce=(t,e)=>{if(!lce(t,e))return;const n=fce(t,e);iN(t,"stack",n)},lce=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&dce(),dce=()=>{class t extends Error{}const e={value:cN,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(cN)},cN="SetErrorClassError",fce=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=pce(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},pce=(t,e)=>[[`
|
|
1840
|
+
${t}: `,`
|
|
1841
|
+
${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],hce=(t,e,n)=>{const r=Im(t),i=ece(r,e,n);return ice(r,e),uce(r,i),r},mce=(t,e)=>e.configurable===!1?gce(t,e):wce(t,e),gce=(t,e)=>({...e,...yce(t,e),...vce(t,e)}),yce=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},vce=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},wce=(t,e)=>{const n=qd(t.enumerable,e.enumerable,!0),r=qd(t.writable,e.writable,!0),i=qd(t.configurable,e.configurable,!0);return{...bce(t,e,r),enumerable:n,configurable:i}},bce=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!uN(t)&&!uN(e)?{value:e.value,writable:n}:{get:qd(t.get,e.get),set:qd(t.set,e.set)},uN=({get:t,set:e})=>t!==void 0||e!==void 0,qd=(t,e,n)=>t??e??n,Dce=(t,e,n)=>{if(!Ece(t))throw new TypeError(`Argument must be an object: ${t}`);if(!Rce(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return $ce(n)},Ece=t=>typeof t=="object"&&t!==null,Rce=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},$ce=t=>{if(!un(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,...a}=t,c="value"in t;return Tce({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:c}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:c}},Tce=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{lN(o,r,"get"),lN(o,i,"set"),R0(t,"enumerable"),R0(e,"writable"),R0(n,"configurable"),kce(s)},lN=(t,e,n)=>{if(Sce(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},Sce=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},R0=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},kce=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},Cce=(t,e,n)=>{const r=Dce(t,e,n),i=dN(t,e),s=mce(r,i);return Ace(t,e,s),t},dN=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:dN(r,e)},Ace=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},_ce=(t,e,n)=>{if(n!==void 0)return fN(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return fN(t,e)},fN=(t,e,n)=>{const r=Pce(e);Cce(t,e,{value:n,...r})},Pce=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},xce=t=>Ice(t)||Nce(t),Ice=t=>{try{return t instanceof Error}catch{return!1}},Nce=t=>{try{return Oce.has(Object.prototype.toString.call(t))}catch{return!1}},Oce=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),Fce=(t,e,n={})=>{if(pN(t,"First argument"),pN(e,"Second argument"),!un(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},pN=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!Lce(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},Lce=t=>un(t)||xce(t),Mce=({error:t,props:e,propName:n,soft:r})=>Bce(n)||!jce.call(e,n)||r&&t[n]!==void 0,Bce=t=>t in zce||qce.has(t),zce=new Error("check"),qce=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:jce}=Object.prototype,Uce=(t,e,n)=>{const{soft:r}=Fce(t,e,n);for(const i of Reflect.ownKeys(e))Gce({error:t,props:e,propName:i,soft:r});return t},Gce=({error:t,props:e,propName:n,soft:r})=>{Mce({error:t,props:e,propName:n,soft:r})||_ce(t,n,e[n])},Om=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},Wce=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Om(t,"errors",n)},Hce=({target:t,source:e,parent:n,child:r})=>{if(!hN(t)){Vce(t,e);return}hN(e)&&Om(t,"errors",[...r.errors,...n.errors])},Vce=(t,e)=>{e.errors!==void 0&&Om(t,"errors",e.errors)},hN=t=>t.errors!==void 0&&t.errors.length!==0,Kce=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},Yce=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?Xce({name:t,stack:e,newMessage:n,currentMessage:r}):Zce(t,e,n),Xce=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=Jce(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},Jce=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
|
|
1842
|
+
${n}`,`
|
|
1843
|
+
${e}`],[` ${n}`,` ${e}`],[n,e]],Zce=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
|
|
1844
|
+
`)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
|
|
1845
|
+
`):`${r}${i}
|
|
1846
|
+
${e}`},Qce=(t,e,n)=>{const r=Im(t),i=Kce(r,e,n);return gN(r,"message",e),eue(r,e,i),r},eue=(t,e,n)=>{if(e===n||!tue())return;const r=Yce(t,e,n);gN(t,"stack",r)},tue=()=>{const{stack:t}=new Error(mN);return typeof t=="string"&&t.includes(mN)},mN="set-error-message test message",gN=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},nue=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Im(t),i=rue(e,r.message);return Qce(r,i,n)},rue=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:iue(n,r,t)},iue=(t,e,n)=>t.endsWith(sue)?n.endsWith(oue)?`${t}
|
|
1847
|
+
${e}`:`${t} ${e}`:`${e}
|
|
1848
|
+
${t}`,sue=":",oue=`
|
|
1849
|
+
`,aue=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,nue(n,i,r.message)},cue=(t,e)=>yN(t)===e,yN=t=>typeof t=="object"&&t!==null?t.stack:void 0,uue=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Om(e,"stack",n.stack),n),lue=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},due=t=>vN(t,[]).error,vN=(t,e)=>{if(e.includes(t))return{};const n=u=>vN(u,[...e,t]),r=yN(t),i=Im(t,{shallow:!0}),s=cue(i,r);Wce(i,n);const{parent:o,childHasStack:a}=fue(i,n);return{error:o,errorHasStack:s||a}},fue=(t,e)=>{const n=lue(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:pue({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},pue=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=uue({wrap:r,target:i,source:s,childHasStack:n}),a=hce(i,i.constructor,o.name),c=aue({parent:t,child:e,target:a,stackError:o});return Hce({target:c,source:s,parent:t,child:e}),Uce(c,s,{soft:!r})},Fm=Object.create(null),jd=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Fm:globalThis),ss=new Proxy(Fm,{get(t,e){return jd()[e]??Fm[e]},has(t,e){const n=jd();return e in n||e in Fm},set(t,e,n){const r=jd(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=jd(!0);return delete n[e],!0},ownKeys(){const t=jd(!0);return Object.keys(t)}}),hue=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",mue=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function gue(){if(globalThis.process?.env)for(const t of mue){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const wN=gue();wN.name;function ho(t){return t?t!=="false":!1}const yue=globalThis.process?.platform||"",Lm=ho(ss.CI)||wN.ci!==!1,bN=ho(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);ho(ss.DEBUG);const vue=hue==="test"||ho(ss.TEST);ho(ss.MINIMAL);const wue=/^win/i.test(yue);!ho(ss.NO_COLOR)&&(ho(ss.FORCE_COLOR)||(bN||wue)&&ss.TERM);const bue=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(bue?.split(".")[0]);const Due=globalThis.process||Object.create(null),DN={versions:{}};new Proxy(Due,{get(t,e){if(e==="env")return ss;if(e in t)return t[e];if(e in DN)return DN[e]}});const Eue=globalThis.process?.release?.name==="node",Rue=!!globalThis.Bun||!!globalThis.process?.versions?.bun,$ue=!!globalThis.Deno,Tue=!!globalThis.fastly,Sue=!!globalThis.Netlify,kue=!!globalThis.EdgeRuntime,Cue=globalThis.navigator?.userAgent==="Cloudflare-Workers",Aue=[[Sue,"netlify"],[kue,"edge-light"],[Cue,"workerd"],[Tue,"fastly"],[$ue,"deno"],[Rue,"bun"],[Eue,"node"]];function _ue(){const t=Aue.find(e=>e[0]);if(t)return{name:t[1]}}const Pue=_ue();Pue?.name;const EN=yt.bold(yt.bgRed(yt.white("ERROR"))),RN=yt.bold(yt.yellow("WARN")),xue=yt.bold(yt.green("INFO"));function $N(t){const e=E2("info",{prefix:t,allowClearScreen:!Lm}),n=!Lm;return{...e,info(r,i){e.info(`${xue} ${r}`,{timestamp:n,...i})},warn(r,i){if(r instanceof Error){e.warn(`${RN} ${yt.red(r.name+" "+r.message)}
|
|
1850
|
+
${Wd(r,{colors:!0})}`,{timestamp:n,...i});return}e.warn(`${RN} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){const s=due(r);e.error(`${EN} ${yt.red(s.message)}
|
|
1851
|
+
${Wd(s,{colors:!0})}`,{timestamp:n,error:r,...i});return}e.error(`${EN} ${r}`,{timestamp:n,...i})}}}const $0=()=>{},Iue={info:$0,warn:$0,error:$0},Nue=1e6;function TN(t){const[e,n]=Hd(t),r=e*1e3+n/Nue;return{ms:r,pretty:$x(r)}}function Oue(t){const e=Hd();return{stopAndLog(n="done in "){n=yt.green(`${n}${TN(e).pretty}`),t?t.info(n):xt.success(n)}}}class Fue{constructor(e){this.services=e}isInitialized=!1;async initWorkspace(e){if(this.isInitialized)throw new Error("Workspace already initialized");const n=this.services.logger,r=this.services.shared.workspace.WorkspaceManager;n.info(`${yt.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,rootUri:null,workspaceFolders:[e]}),await r.initializeWorkspace([e])}async init(){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;const e=this.services.logger,n=this.services.likec4.ModelBuilder,r=this.services.shared.workspace.LangiumDocuments,i=this.services.shared.workspace.DocumentBuilder,s=r.all.toArray();if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${yt.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const o=await n.buildComputedModel(),a=Gc(o?.views??{}).length;if(a===0){e.warn(`${yt.dim("workspace:")} no views found`);return}e.info(`${yt.dim("workspace:")} ${yt.green(`\u2713 computed ${a} views`)}`);const c=await this.services.likec4.Views.diagrams();c.length===a?e.info(`${yt.dim("workspace:")} ${yt.green("\u2713 all views layouted")}`):e.warn(`${yt.dim("workspace:")} ${yt.yellow(`\u2717 layouted ${c.length} views`)}`)}}function Lue(t){return e=>new t(e)}const Mue={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:Lue(Fue)}};function SN(t){const e=Eg(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=Iue;break;case"vite":n=$N("c4:lsp ");break;case"default":n=xt.withTag("lsp");break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${yt.dim("version")} ${JI}`),n.info(`${yt.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new kA(r===!0?new fae:new CA)}};return EH(e.logger===!1?"silent":"info"),e.logger!==!1&&e.logger!=="default"&&Fe.setReporters([{log:({level:s,...o},a)=>{const c=o.tag||"",u=o.args.map(d=>Gj(d)?d.stack??d.message:typeof d=="string"?d:String(d));c&&u.unshift(`[${c}]`);const l=u.join(" ");switch(!0){case s>=wt.debug:break;case s>=wt.info:{n.info(l);break}case s>=wt.log:{n.info(l);break}case s>=wt.warn:{n.warn(l);break}case s>=wt.fatal:{n.error(l);break}}}}]),AZ(e.useFileSystem?$H:{},Mue,i).likec4}const kN=t=>new Error(`Invalid model:
|
|
1852
|
+
${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
|
|
1853
|
+
`)}`);class os{constructor(e,n,r){this.workspace=e,this.langium=n,this.isPrintErrorEnabled=r,this.logger=n.logger,this.isPrintErrorEnabled&&this.printErrors()}static async fromSource(e,n){const r=SN(Eg(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Zt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=Ct.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const o=new os(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&o.hasErrors()?(o.dispose(),Promise.reject(kN(o))):o}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=IN(e);if(!xN(r))throw new Error(`Workspace not found: ${r}`);let i=os.likec4Instances.get(r);if(!i){const s=SN(Eg(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:ON(r).toString(),name:NN(r)}),await s.cli.Workspace.init(),i=new os(r,s,n?.printErrors??!0),os.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(kN(i))):i}modelComputedRef;modelLayoutedRef;logger;get viewsService(){return this.langium.likec4.Views}get LangiumDocuments(){return this.langium.shared.workspace.LangiumDocuments}async diagrams(){return await this.langium.likec4.Views.diagrams()}computedModel(){let e=this.modelComputedRef?.deref();if(!e){const n=this.langium.likec4.ModelBuilder.unsafeSyncBuildModel();if(!n)throw new Error("Failed to build model");const r=this.langium.likec4.ModelBuilder.unsafeSyncBuildComputedModel(n);e=Yd.create(r),this.modelComputedRef=new WeakRef(e)}return e}async layoutedModel(){let e=this.modelLayoutedRef?.deref();if(!e){const n=await this.langium.likec4.ModelBuilder.buildComputedModel();if(!n)throw new Error("Failed to build model");const r=await this.viewsService.diagrams();e=Yd.create({...n,__:"layouted",views:kv(r,Vc("id"))}),this.modelLayoutedRef=new WeakRef(e)}return e}getErrors(){return this.LangiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===Bc.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}hasErrors(){return this.LangiumDocuments.all.some(e=>e.diagnostics?.some(n=>n.severity===Bc.Error)??!1)}printErrors(){let e=!1;for(const n of this.LangiumDocuments.all){const r=n.diagnostics?.filter(i=>i.severity===1);if(r&&r.length>0){e=!0;const i=r.flatMap(s=>{const o=s.range.start.line,a=s.message.split(`
|
|
1854
|
+
`);return a.length>10&&(a.length=10,a.push("...")),a.map((c,u)=>u===0?" "+yt.dim(`Line ${o}: `)+yt.red(c):" ".repeat(10)+yt.red(c))}).join(`
|
|
1855
|
+
`);this.logger.error(`Invalid ${n.uri.fsPath}
|
|
1856
|
+
${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){this.modelLayoutedRef=void 0,this.modelComputedRef=void 0;const r=this.langium.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.langium.shared.workspace.DocumentBuilder.update(e?[Zt.file(e)]:[],n?[Zt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(i),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of os.likec4Instances)n===this&&os.likec4Instances.delete(e)}}export{Q0 as E,hC as F,os as L,yE as N,Co as T,xt as Y,Po as a,Tv as b,Ve as c,ue as d,lw as e,HS as f,bt as g,gr as h,Tt as i,$N as j,Qw as k,Rn as l,pY as m,Et as n,Vo as o,yt as p,TN as q,tb as r,Oue as s,GS as t,YS as u,Hc as v,fY as w,tt as x,wt as y,JI as z};
|